petsc4py-3.15.1/0000755000175000017500000000000014062764472013572 5ustar balaybalay00000000000000petsc4py-3.15.1/docs/0000755000175000017500000000000014062764472014522 5ustar balaybalay00000000000000petsc4py-3.15.1/docs/index.rst0000644000175000017500000000362214030740317016351 0ustar balaybalay00000000000000================ PETSc for Python ================ :Author: Lisandro Dalcin :Contact: dalcinl@gmail.com Online Documentation -------------------- + `User Manual (HTML)`_ (generated with Sphinx_). + `User Manual (PDF)`_ (generated with Sphinx_). + `API Reference`_ (generated with Epydoc_). .. _User Manual (HTML): usrman/index.html .. _User Manual (PDF): petsc4py.pdf .. _API Reference: apiref/index.html .. _Sphinx: http://sphinx.pocoo.org/ .. _Epydoc: http://epydoc.sourceforge.net/ Discussion and Support ---------------------- + Mailing Lists: petsc-users@mcs.anl.gov, petsc-dev@mcs.anl.gov Downloads and Development ------------------------- + Issue Tracker: https://gitlab.com/petsc/petsc/-/issues + Git Repository: https://gitlab.com/petsc/petsc.git + The source code is in ``src/binding/petsc4py`` + Previous source releases: https://pypi.org/project/petsc4py/ Citations --------- If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project. * L. Dalcin, P. Kler, R. Paz, and A. Cosimo, *Parallel Distributed Computing using Python*, Advances in Water Resources, 34(9):1124-1139, 2011. http://dx.doi.org/10.1016/j.advwatres.2011.04.013 * S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, *PETSc Users Manual*, ANL-95/11 - Revision 3.14, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf Acknowledgments --------------- This project was partially supported by the Extreme Computing Research Center (ECRC), Division of Computer, Electrical, and Mathematical Sciences & Engineering (CEMSE), King Abdullah University of Science and Technology (KAUST). petsc4py-3.15.1/docs/index.html0000644000175000017500000002641014062764421016514 0ustar balaybalay00000000000000 PETSc for Python

PETSc for Python

Author: Lisandro Dalcin
Contact: dalcinl@gmail.com

Online Documentation

Discussion and Support

Downloads and Development

Citations

If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project.

Acknowledgments

This project was partially supported by the Extreme Computing Research Center (ECRC), Division of Computer, Electrical, and Mathematical Sciences & Engineering (CEMSE), King Abdullah University of Science and Technology (KAUST).

petsc4py-3.15.1/docs/petsc4py.pdf0000644000175000017500000032077514062764470017004 0ustar balaybalay00000000000000%PDF-1.5 % 1 0 obj << /Length 843 /Filter /FlateDecode >> stream xmUMo0WxNWH Z&T~3ڮzy87?nkNehܤ=77U\;?:׺v==onU;O^uu#½O ۍ=٘a?kLy6F/7}̽][H<Sicݾk^90jYVH^v}0<rL ͯ_/CkBnyWTHkuqö{s\녚"p]ϞќKյ u/A )`JbD>`2$`TY'`(ZqBJŌ )Ǩ%553<,(hlwB60aG+LgıcW c rn q9Mܗ8% CMq.5ShrAI皎\Sȩ ]8 `Y7ь1Oyezl,d mYĸSSJf-1i:C&e c4R$D& &+übLaj by+bYBg YJYYr֟bx(rGT̛`F+٭L ,C9?d+͊11ӊĊ׊T_~+Cg!o!_??/?㫄Y ?^B\jUP{xᇻL^U}9pQq0O}c}3tȢ}Ə!VOu˷ endstream endobj 40 0 obj << /Length 586 /Filter /FlateDecode >> stream xmTˎ0+$$0  a#A%߯jD岻fc;Z̫MfG} q]/ޭmޯo⣩0Z^x]fkn{E+{*ʧypg6;5PVpH8$hmڢ*߄zR:")󨺠3qXysO'H)-"}[˺s 3 4{pYdrK+ a }ѫW{ Fvm7344AGc ڤ_86 endstream endobj 41 0 obj << /Length 770 /Filter /FlateDecode >> stream xmUn0E"y$U6ɢ5h)8",c\Ws/.7?3oz(yѧ2zvAwG݌=yzVmMמMW\=j_I*Cn_f &1y+Sw$F5? S4!1!r3Ҵ>Za?ɻ=ñK}:j=w(]UU#5dkuѥy e*x12+Sx,099)5tJN'{fS 2R̼  KV iXBRs>^ .KCc2c4&Wo"q8^zl p5u%=cK(q/?xQcc/s/G|-mƯP/S8+8 4fRSYZ"?.01шŕ[KPKS60e;U}Z8~Sg; _gvi;Kc g̭oZ ' L^ ^$K{)p/EX{)^ (½ߎ> stream xmVMo8WhCj~H\HrhSbd IJ!ۇռâ؃޼!9_?7?UepPgww͡pcӷx6׏;[Rd񟇧}z eq<÷LUJM롯{Ni~l1>_\}~8ȳ&qq;RUl, g^Cs=~k*[4^͖OmTI:/nY㵞1Ls*J`#l neܢ8Wi+xA= pMn?SbZbh`-؁6+ҖtΘ 7 XB[M98h򯠛& jwJ7ɿq/1n^i 1z1MN F_ HĒ?K|M,愆f[ eR SxK¿ec QR+ey h_8khG_=soSs9S[<9^r%Z:k`N<'{>[AkZ&# 9%F-܂ϩ=WC'}k_KRV³ᯌQV $!6n/xzjgu endstream endobj 43 0 obj << /Length 1026 /Filter /FlateDecode >> stream xmKo0 ޡ@wbKE=îv;pCL2bzn>|ܘnxv%p[)OM5ף/ߝ\qh%-p< ~۷k'}r6?F<.oƓOVn<k~I1=9;[ˡy6Rw2)]~C2Dww<_ws1vn<ďqǝ{r?x),9|?\LR`йiߺq߿.I㻦\}𥹢9/85dNrf=KʳXxΈ9&^zz_/e%^I%Юskfy*x7`?J#+ ruAι.Ț낼 \duA\r \WyUb^卼:oy#yuȫF^7꼑Wl8/a9/Qr^8⼐Wyޅlf`;%[mp$[MyX[R+IL6`Yː 9HKvvI6)+Kk ㇹ7+/Qe\G$@if<`F[fĩW诉70O*Ƴx"ÜE)=+b~sN~v?SȆG?r#W?r#7?p>Sfcʥ~dFbw4ψ}}kfGl-?r\q# ?zSf fWKfUM}k5sBoh:0Ν4}{CUNzVcC6&9&jQ,^ktfj)B5&^SkP{MkMC"^+C*^kP{BEքkm V:^LZ"R[=nj lp\u[#CWCi8,ߙ~4?s endstream endobj 64 0 obj << /Length 1487 /Filter /FlateDecode >> stream xXKsHWQBFƲ K6񞀃,HmɁ"Nx=ntzyFf3 +AI$%81ʫwZ+Dp=U!'#ߗgbDR )"F䘰-]py!IY04{za `8 eSq`T2-42D"!p(Vh_:םʼw)Nc#39!jGIL`s1Ehhّ$8 ղ{Խ{GcF$$vL曎I|p!`X:p)!$xeAI:P_'@BSxD"@ &2B3[Y"ڦ>2zTxF ϳ4}$vdr},Ndl7?"h-ډ3&&)q66'':) K.ZC7Mp{/>La41sso]SA%CG ]PܿG,5ܗ"e7]Zjx _>/z[waz6sKUG8/?h 4;IN'C0' ۘAXN,7*VVﲼY^N[cAԝ\~,&*GyWFEcFMc/xjKou{Cު^5v!; y?At^Gu"oQ. ]AT┳q΁=i#}+eR88f$]\$05\`cLr`=!,w;f\ 6.sz(zl̝ܺ~v_`t]3E=n{|{qSk<+3w۶Y}*X0ellXQ`;Nֶed)f #}^m z˺<   4.z_ecYӼ \^L-NezukN&P=TJFmm g7󦪆k4n\8'"[E0KQPL*0zXA3融-=PwV}Z>%?r{Ԕns@YCZw0Qnvջ;5 w l T>~ԚV>֠ bR#I;~:C(gtjE^5n-:.ZVE'{g=)Į>0BnJycBˆ|cI1rQdĘ :dIS|HB~Q?f8T.U~}~͂21jz$uY> stream xڭYM{6WH=5uL\Ǐ۸!"!` 0 f@݋`>^*\ݾ A0&y76WQ$iMڄ M7jɋֿ??lga~z_j2y.6#\&[\Y$nIqf 9چ+?.-(m}P$6j~H=Vizִ z5=UOs`i5[EQ Q-e-[Sqv]S~GUFVx@Tв`.Ox5R~ ɃOQxqON^Ker6 <&E#9dA6:itK{~ZiF,"{<$*K0UM#' Y*ٓibOLޭЧg'EnJc(ݣ z Q~䶭uǍ-߽H>^;e'AV]T$v(y# YFi(ծv@V';?Plp*MU a/eflpNxPzd}dc@W=Es4ܕL'O)Tlj >~O [~a\Jjlڝl+BrS5n( MUoqY2M_F쮸D9X%lFE;47 y~5ՈQmۄWP+1ΨkH}< Jc͚3ci,/ͨ;\&sۻUu{~|E&8GUVv>mqO]~ͻgZ:12~}1]! ukXڕms<4 "z1*q!WKnGQ P {od"qGPc0/ ^@w-pi/Z^r2]eإ[`ŋg<γ sDC_:4HC,ϖ<H endstream endobj 86 0 obj << /Length 1998 /Filter /FlateDecode >> stream xڭXm6B \UTk&.-QlZ,p(Y{bpH3yyf( td\ bH_4lX]\"IeDbQ̔&xŇ?!"xQ..-˫IcQ0^_ƟFyyX؆u^OxqaR@! ~]p(\%6C&/3 8^ {1%d]N,~(Xf]Va/\rw-MV̯t4#Z&|^Ljo=ϪƐH }ZTGm~-D7ٺP h?`ٕ?`O$,0DY+1UdIlQeUdfXEwd+˃{) Di bi Cpr ѻM-AؑK."P<mA#1$0 q2>xD0`8Pw`ᒀs6u[wʼn  DB2mcY&z-[KHȥ 9 y0r3KH>!+ΓX6,`͒4 $(4Jid26OSj%Q<@ 1 j4P`83nyʯ5Xl4"x_œ6uWUEҨ-iўT; .-ׄdu۬/T~*R}^GںuS톳V˲kz@j+Pnj߬MEwƇEJ&!xF=`:.yms9'#'Y4_1o1(vhR ae12zh> |T ,VI+4mbܰ H.kMt6eS4 v2C_4 fȠӛ\#bkKiwS ڣjɬ=ȧAț_O s: åxw FA߭ĉ]]D) vL$ V>vnyo#RX~c/H]CԽb*-Ԁ A V `hHeXFLםaAdU=ES5o#C t&c\\!rLuU,xXPQ$c JtCenNHyVJ3J&?X]zKҹ[oEW96.Jy v5 4J]0m8M#ۃ03:-/z[/M$J+ q~D/VQ2nsZZvu'v\oN|N<:_^FCoRZDҿ@*GsG50u ?B|M3#颤yIK`2fNgگНC!ÿp!HQ7 q{ oKhȬP`,$={{WWWN;MuOeo]_>#o.T)1.M[>g? endstream endobj 97 0 obj << /Length 1499 /Filter /FlateDecode >> stream xڵWYo8~ϯУ4I}KJIv x`df#K_3ʲ(؇D7#-<=O&dq&<M Dzs/^SEw;Q,}ĜgSv,z97!y0i>)u^7{uEwZ۷o͢29:v5==MSl[լ3p>Ufze\41 `jgSWu cԳ_e:nV1m tb3Ղ޻59h:1b&% ^2f*E?et7+-vTơץl0 ac /h+y;xBJU*4{B$۽|T5!הH{Y d">v]/49*v#d a][o]uY]ӕ-[}E>y ۄ+Uf "%"dAQ=f 8{%f x`0KPM> Bbtr1`̂N0ށ YR"((- ;j%jQeC-1ES˖ĎZUFjp 1v8+s؍F^ARlar+LHLBC}2m2/I(" qD,Kwe =x3n8O lFM]t8lȎnr%^=rO}St8r:A wN:VOWΗ(yIh=16Rd#)~;_+R==m endstream endobj 109 0 obj << /Length1 1396 /Length2 5927 /Length3 0 /Length 6885 /Filter /FlateDecode >> stream xڍTTk;UH 20 14ҝ4ҒHJt 1߻ֽk{?{{y>V&}#^0 !x% ( C.?nVS'o%)(rD%$@ (/ C :|M8 Iw::!Pa Ppx@A0qEhr?JpH;!n>>>| WO>,'pB+dowu0GSC"x ' G僼AP s@UB gJf8=~YXʂ8.0?@e9 'K? Q>B>)C?\M5}>Ju[@{]Ew䋥 ~缌ێvӷitӤhf =hqd=Fu]i>lT4#PS\Nt!ŮxC5{פxLlf-w>d+} qO4C7G"U锅qM HJةݕT,sf tOOܻ_4Qwk>OHNb5][+0^646~%,ExEǤWy+%ĦP=A$geBEՅgc3#c' ;[<+&\dȤ & >-E~zAqE*pLJ)Po5+`q)GqBZ\t4JW,l vxS \ᕄ!fpFdؘ,#- O+j Y=]-] aS$䋉Ѳ\OCҡSKuz/@5-)y[TXld#l=TFj0NOR E[P>};Px@-tERֻV5&o`t+戸д)4+*푬H;l9,ixbNb$ 'љImak'ss%RgkH?ʫbYq"=o)k\pj,*Оd#~%䇥MJi͎S=|gDecfFQ>΄1O sW0xO+vۭhsk|%;gTȵQ8jѷєR~7+!cs10''1''VMi뼫 W/bh>PqMKG06WPVƴӕ" /ݥZ,}b>#R~-S2c7زvagL!o.vl‰4ЯwmQD^1b4-uK_4pڝO3ݱr)5a DYJvS6EPIt?BsEUbP8uή6yx:o𢻤avd˪d!s[rR5_Qql6{&>A3o|y)rl!lVU>xaY;/Q %Ξ<;, {ȓ4r@ y~Y}r=¾Һ9ƣ3|6-Mxk-u -ŏ.1քQ7 hOZKu5esBF1" kQ6-TϻzWDi85L2؉Q,&1jxhgk@f/p͂&=rRdpBXw F“ ],N)gw3ؑvt ߆<IJov[dc{o\F14z6<ݴm|bT|{.P]< &,ӻEߠn+9{fmx!j2zKnyԨ.'7Oq7,nF4D=4r(%KՃ T7;b@ח3YZoq)v/); E7Ibz u\.jEJbhv 0yLx-p8=}/֙*QNഭrN)0n2wOV6 Sh.\w<}RF,6w6^;C $I z,- ;/3M4OD{'j@߆3J"n= 샮d= o |O-EW2LVC)ձŵbؑkl 'bB/ykk- 1&iQd#,ܓZ&uXjygFs;MT<b^vkNɮ>ݔy N?lӞep3V k{AFJu0MXRn2i}rEGnE$9ƥEHa{dwf$aAsӕgv*jǑ7Heh64з7Fg #IaL~Ow4N?@pU? vv9?\f S`y4,Qz" \Mfh~mZC,(7HϮ| N ʊR(T ?C/-b]̡CT. sV2sMeWݳxSդ)^mo 3CU{,Ij=tѮgtP~H-uBc79/g'L;sol(B>2`xI|:#L30NYiueEyf[}1wX9<49XŨZp49sתsZ>ǿǦH ~ޖtf܎O},vD2lqg!֫s3(RqǔC:^,wKCpf 6Fr_ZW1ff&g(HogxUp;/ L_.̑7ehsRy 2C#܎Xtfǖ)k'.#ñFoeߦpQ&Ei`uXfi!$}M/ўV~{v8_~PfZ꩸(tzU^lڶG<_dflPC6\c5qPv5kF>M ³ۮHoœF}AZL$Cc ͱ6J/v)S"H/ ޻3\h\|ÀtE:FB,.'4f빖 LIR5T ~aswKVREM':?#ach'>sI< ދcplB$EoѪ$ӠJhKOJkppn>LI^}dת-*y[zgw>XUI%|L@!`KX4)"@<)\۰]rrM1_.Ml]Ww1LtGg~̍(]|W-lPᙴ4 <;n_܏~\vTo0Kf@TlU(˼l+ S"|CC~'/`D<*O3ilm[,Qu {2 .rJ_xK3䷖޽s@Zx!|lSznI4;Osܡ5'ו56 Qֿ4zvjxޓ)M;2\/Ob#"M˯Ͳ# 52SXZN\гbkz!N.7:alˬZ~[,]A8cÇ|_̴>O?VBƉ6wT&g`&(5ŀ/TI B747 tila%gfg9kSo;cvdeH˩gdžr\6)DHP,ZM;ք= pd 2G@Q70QǦ5a۳"[<ʮCzutpqWZ^hWBSkKJ`><4tާbpc։|¼Bqf i5 D"*DHbgC#["/Xj~J ('RT}*GWٵB3|Ku]L^3sjTOhJ .ui~*{Hf$n:^~HDTy"ӧE/)m$\mX<$JT<.XF K7Z o ^^Vҳe_f^4FG 0E}2삗 ɍٯy1vDnx#ŘOh\IONy׶) \.;0ico.ܴl׭m[>12'fZ;dԟ-.{9rsTrV => K|a؁I3g=ϛww X>*^6P^9_ň _ό!(alAnqy&MZS0o}Va dPSR, R.1k<+CgbUH tPn` yڊL+2Kfqj `{"xQ[x|ߧ=ق1=@䢆H4$!Ar͟ҁI*޷8 4qB& T-؇PHDnZ92|(14PD)G:fAB BN=٠ph}yiLE]bWlr ڭg endstream endobj 111 0 obj << /Length1 1376 /Length2 5980 /Length3 0 /Length 6926 /Filter /FlateDecode >> stream xڍvTT6Hw$CAf!fE%DBZAJ:T@i~Z߷f3sЁ 4 # HPc1C ¤H⯙D@ `mJ0 FN $.-$! Կh7i@ 扄`@Br+]|ܐv6xm!)) p@ᆴM@6H)xe1iAA///0v{@pD_ Z0gğ܀=xAܱ(8 n@.?l!п A;P>H`tB*o ࿀0'w46 C:ߕy]mo{6nH;E_i+(;n# E඿{>@!]=jJ!Xlv ^Wz}o/3? `mE`HaߎH8X#(dǚ!S{BwXz('WPHCzO)(?a!@@JT$fс!VO H){J*yjg.-4?7AloW 'n sF:`9_U꿡?DU:Ga, $ #Ucc1~) Bݑ-(|Xy8bXZv!(4̄̇e'#Ȁ `Cl-ڍXEDAlϰ>ps7 k[7†4vC]xI<0r{Tqog&>Q긫4ǦYxue,(( <{sqfHZFeeoz3p"B[djv (:He\cS͑pLht L6̵|{=Vo)l}`!͓ӡpuWg*Cz]Vڟ*wLz# eqsNH؍<zj)ۦMu&i6$+Kf@gLu- kSwg+︬-$=7lHL*ϗ:.y:#WzY-y.tH*`k/Z)4tijJ~Jffۦ>*'6ڦ>CI@o? UW,+ 4||$e\0="p']u#+~ѐj} ;aLc}0R<Jo{}E@'$ ۙqө^JCj`=߾bJ|a}IUoɡG_#Cp\F*ٮQݞC2_jM]nf&1zF} f0Q<R?*VMr _XnXT%E?&CnԚܫV ݯJ,kz;\+3ҁ&q䄹cG˩cS]3o|G&*vءɢ-! (8zD.R/Po%KsT>? fޱnVڏF^ȅ[ѯ GYI߯'QQp2< A˦OEl|sbe =ҡNLmI`еqIHPT3<'=sթ\1{տ [5|g"Y@š:{l[ؿƥ!"}İp|[RĪN%LI6DxBh-*2bQӍ~i*xepL(fE/PoxH|6e{!{"z*=;!vC1PZUOז޾Mjr\3cym/!%Kq ZxPHP=x.Q 5y$l\56:6t_hY9nϥ"8rjl>Seh||q2f Yr?T?ϊO*P,7j >f4S i!>嶙=hTQZBH J0*s&awfyhy h~OA-Hw djx~v9\v7]?[njIΊj̑, юYLMD.kǦIMp3fU)浏`%2U4(8Et70Po}wJiWr bQ%?DP-*>R&W)]8gBF,e#XL<|` i>ٚ~%ܡ"ȋ,;>,Yld Kh-T(3aZ6̣6CoJw/ZhHhhs+Kmi۰CF&ԾywʅTwSv$hֈ"bQ.Ǔònae!{y>tRl̮Pz}6iHtI1 $.ˇ鉭Sֹ&⹈{Ծ_B4dĹoW;_-ɜYT 'vQE<)48H?&yJފM\GM zt? <]wѰ?#s[i?be6}27]NC\W*JS>偺j|~zNC֪b&2ʌ BsQ tϛn &D=TK'u]ƹv)% 60uL~}s^Ib>y"\ݶ~4fy y,H=+H#I(yj~|J_}8 k=mξȮ}jc'G2KE[-6ĶWvm~VxiX2k{}4ũZՠ]v²6 tkR8a:w'y#UOpƲ9?+H/AΪ Xy)=σ/7F]CI=49PӴǵ^|ǥ* [n-%=tY*c3 ~%FhNOTغMjRzWHs&3&جo4_Ofv!p­ "WB>_E-sYMsRqTAm^1nn :ѩH6,ґs-ƇNJJ{hAEroŶ:(Q&k/J|9m3wY԰)KO rNde6Dl:gGh4RZ+.( +.\'PQ=kOc_Xk(ޙ{`B&;k&}^rCb9`ϲ9@~+Wd7/E![u*&/DWE }Ï T"{3657Z @k+\r^H &44 Mx?P OԴ6Dt{a޴SĉsjԮ5JJdu-eVk殟wϑMw#V$+![;M6H.tϐ@&'d^ajʣڶΟDɌ{ZR. /wB|@bO4~hJgoi&oHۜ0Q}'~6jQv4rxWav+Zs=92/Ѕ8zW~չ 2vqZIż7^wqH~FJ&%g96^[,]Ea|ڦTj`Qxo5p,sn(:Tl9.'üE#eI% #ٲY( `EF`ًU.$~.Xحs ٴZ20TiCqfn~ZV)#=HܸG>\&y`.Koeƕ+$c|5Jo'0M\.gLRK1t1"GcVKZeMi2g,0ZcӺg__{*_npRhi=kFy H.V2 DOWAFȵ+]53Lu Q{f0fGH^{~+z9cK B> stream xڭWeT&D@Cniff`ATKBRRRRAABJos{uczv׾}5BPL pWFRA!)IͭpR 0(‘,%7rFÝ9H@@/Y $x0!0up Pehm i0$ F8!0$Qh ($~F  0 C17Nh0zFwD"F3\1$ 3ɽ2L=΂7Mm wjG/iJ:͇x%2*eMyf_˻ =H9X3>Tt *yF9S23n!..Xs8>tz60QqMW|7˕hz#E?9'օdoҬV l{nMuV~Pw8+\f $p$ݡxzӘR Ic=q"*(֑OϪŘ=7KĠSyFׄ5MMD'GH?RZw%Cq*UI|ՉQw  җeFnC !K>j"SonJZ*l)8lOs㈪vbS>MsLZd`ḚvfS#Aݴkhf81DqrY^=8Vmfܱs<ފ] e͍~"&#LSR,ՠ7zZa쏗aNt͑a%LJ *]%L-I&z iYwq~[?a}g,ZaH0%n4m¾=I&aL: 0=C߫5նDv,Y,3KEPKcN+Wc0L_)jjnXZ6ya0SׂNl,J.\5^r]]8_c'>LV0auLrQyՌ[RPО1zWs܇R0L-lde¦~4wy&KgYʖ]+Gt6ZE=|<̔DE~eMwl yu7R+4` u)VP'=3M}iNs^,߾YK)}m8JrcvV)ƪ$8ЍL+K0<;=_a}4,ey _ ]/˩r%bg+6]$>|?I8U}jĽҟ K&-X0*x3O1TX#Ũ%M٫Ao?_`Y 2,4+A|=-XmדQ8y3!.@BN/r+`¤N@g=\o&O2s-?L&ύjI,/28GhUgk]XmrEvby v^"sUZ/(ݩSS'I1~J+`/eSQf3 PL3WL|,{{ȩKxa*ZHyݱ U9GfcG57Bbhߞf|0ᅯND㻋 bIxiL;T'QK&<\^i$.mXp"w r): wE8Ý4)rrouI&K~'Wc<'W9<مC_~e )aj/x{'mt/v4-X.I'[^Ť j|BR:W]x/5%79oMEPy[*Ӥ^{bd]:-ІX<@*ڶU^\Lv44 [y7{8LHe}~QD<dc)s5iCSic2?*I!O{5QG$'d<7l .V[C[xtP1&z^7ϯs<{<Ю4y%eRcE oG4jqܟbB 'tn[c5uaǴU=\HT h,!n wETaI8/ -#֤`-5O v!.cq'z+nKa$- 1Vz|dwyȢ!c鬰&JqzlPd m*(R}<߯Zwe'xPKzxY.hWx"fХTѻjMvJh)wN]X + *Εf l~Z i'{ c7H'[c?]l";!ˑWw%g)7*^+ FsڥMjzYvɺ^gAt8l fk9=2 ") VI<*?UFQxM(IwDW o3'[Œ!Z5<8c*lck np)%K(] oP [!9F ar͙3 5k!C2^Oxd-jҵG1p^6@E>ŅLp͠-QISC2^bk{b=-ݴ20=癣F :;=tx["IUMwfK-JY.I2_8N),̥V=[=2 rVh[yRw Xs̺sG W /F׫?=?Ï endstream endobj 115 0 obj << /Length1 1612 /Length2 9022 /Length3 0 /Length 9847 /Filter /FlateDecode >> stream xڭweT\[-\$h%H7HMK@[!X9scWUYjZco:* m6)%H cb-\U *lZ 7N 00@Ȃ.!!!t:lc 0j3'`睮`!A ;2j F5]Z84,V bX;A/VN OiXR 3 irb8`Ww`{s!Vn?Nr:=G8>4\aVP3 UCVo0[ ؟ܮg79d|0^ w1g@'FPs=0Tfo"E?q;njxa*?w p;xGf )ͳ `OP X[8[=Ov /rچ2:,SxL?JQu'q rqZ{Kx2 gVax }V\tdcJ$.C8qw'bsqNA~`SG@U20cM^3J̛D <2?|%`b=i$#~N_4̊_@Qi h/j [qWݣOھd8A eɉG O٥JyCko<~h#%7 ( | ۽˘ 酕hqR1u<=@FǴP %0]DfBm_܌ͻ霍_ [ڸ\ K ]+jSA+zZ8s7N!tL%`ڹ37t?h'\u@`p4\݇@('>`A穢ds@p&va4߀O/$Jۇ8z>>]O)瘜~&]Ҳoz Ǟĉ4Id^7鵆cmi,-jFPO1M[wqJkdFq_ٳ%&s&q4.KrroپeY8H-Kwrԃ_WM'FmR‧'z^Hx[1~r,\ѫܨD'9:q3SC*Y˕|hQz6I#ݤ{L'3KځZWAfWP.EKwx@z^΋O8Uw=M' fC}Yoiq.DH]CѦXOmןƴ9^ncMN~qRYLao+o:-LF,Fʬ/?)TP*pR{olcћ|ԎsLSU4$ _7Z Ќj!rnc"VH(e2ݿɎu<iQ47QT$6IT" H*VfP&[Qĸw_D)ipI22\(J9[VvhmIi1缏xr^b# 7In^+C5KSإ<:gEcM=V;9"Vx9ԭ Jq(wz>.:^z=_&. Dڲ.8둈 FN8Ŭ&g Ʃ" 1~D:ͥ) 8[[}}۬m>M03?tcJspDZ; o+1=._m+|E16W׻%Wf/%Щ"/!9UrW3ƗTᕈeغofÙ=T,!A2QYCOf!B8\p-^wE Pȑ(MrR{ܒvbLfeUӹ+_δGUWnzJ"0U,"w&Nni觼?s:ɀX&Z쒈VM?WP `@ {s-][ \5s;A*OP8 spsdV$+ֈwjwԵ,z,S ]ȫ%5yHq ՜f[-n˙I/XyL[d/d ĂpdnnsBSnYJ-z?K&gk`Twbh^PC:p֭Dq gyl?,wK_|(ߌ$nSO]OniF;1V(x+ Wo%Eu|u%F >u7W㓪hPTW<ҿJʥ _uQfP mxyG@{ҍzkSXF ?,H,|!3>d U?8sVCͮ4%I3AQL$ 0s~2l\~w{y/m.<u^5)/%sD{.{ᕵtmZњ+#@skK2ܣˤg?7.IӃK]bt&*;UhޱPn#N.:6M'T@'Ν&bHsa.r gY #xNߘLѣזw{ox);B,*7. bv \/;d?}O]~V;QCgmD&7P"뒢V?=,2U#;Rh'2^F lCKǠZ.~Z#iulxd-YB5PV/.X;q$gbǂ/WWsְڕ^d=H9ȷBʧ/ |0~-s </Wonkf%S5E qA@ŇFUx@v7,ʳ`&spH[z>ڮ6\$`H6Ÿ+:2>^3Hk?ZS}X, CAEE: AQHzIqbcG8yeFott7ظo9!E) /Xd|mߍ^L_CPĘKÓY\(doQ/.xwYf8ﵿqjfsx_uKqWZK^x{,b ?{Yo=d$RVQd`CD'| r&`H˯H_XdvǴy۾lUb-CZqD~qEFjVUʒHÍA )r'X#aCQp=^ML$Ar[@\|w~,谗Ů%\$PY?,w1#j:ޕ7haUEb/\0l1{P!Om*(x( <\>_I'^!u= uVW 8%n>c7A+TcaV%u?0쩉r} S^1Czrgadf[[ %QC1_$4u}֔D]hc ׉+JyM 㵵6oٟCHn>ޙ'E,U%T 3窮:NROAUX9-P.~ [:tm32$b+hL4In2 Ŭj0\ntb#`z֘MUK%|\N৚h§қuДhkKezy la$ Ғ&w$ ø m|YC*öw$a:GV8v$h,G;2ήIS"xk:&;8  ֹ^݊٬;SORݙaC#nQ vDVơKhKKޑ A ;ws~apО12H-~j➤wk9"XBW vrW9?.K8wEUJN^}w7VÀǍ0nm9@lͮML]׷:%w|8Re9Y>:5cu}2fdiOn J5_}^jŴ&@t%lRB0h3VW > ?k㾲\:[=^@Ion]֟J8d|)Fn2ǿxT ]>/ ^V-d6\Ukt]]+$oO*s|?߭ 7,__jEv|XiA-GqFF M|;m=Y C6/Zrj?J ~Y"+Z29E)o vx_׻TO%e@FI0Gl]ܟ* þ}V4AXpM:E8uIß5kզvx7} .X!/p4₴J0WMI,vgHLUX/-6 lH?N>_ƟbR?s>%gsA+SؤKm1wC'{E 46hٳsq2r-xM3Z,yE.>6TEg󝩔^h Ofa=+)ȲVEa()x5ј$^;Z8VV=ŁIh*QD00I K 'SmUvUul㻉o,`Y<|@'险5JX18+?Y,W`6yfΊa]U } 1g@ 4xl _f[}'?c\k(J(BSp?Ԫ"1hu6 =%rڈK߻І:f){JhM6ax^USop;⛸/6cmD3R~_"L\߸0[,,Ԃɾ줃LQn4qiM`Bwv_(´L+eB,2t2n'=mjJN,Ǎ;Tրp/?c$XL」HA(M_~ծRw G}Hz;S[ [9hS&}|T?㲬ޓgKS{-c{.e7jQ~/uN^d<*D+anL ɻ /x75:!dQ/e^]Y\'LKmo( goqD|[d.'Q&o:u{G(<d4`8yboC|n')eIK,z2;J#I_EQ"BV%p!JC +!T=B\ui%ӎӞ^=@J̌O!8߸҃эh_rG3;W8G0&o{o\b%緆u#}?R!Fwc{qΌr'rlPa(QjWyYY};e֚q4w;]83B{xmx3 i2"fmp$xEWFP·+Kҗ*k\pV=-ԽHn# v~BT 첡1Gc\:N,#oh~6[5(;C<. TiP<(2)vl i=g|iyhCng ЋI4OQle9qa V[0!yugk]a 㢁jms3Pv 3m2hY2 =2 fuh?SUT  P(/JΔ(:`mٰjZY5E۹=o 0^u`Kaa~d#Ry⊄FKUhǨ{9zpA- ʡcU\SQE9e_vF-V *aePxg)WH`DT-h3-`!cU-${>5O(m(dYNjE EGעk$n4Dz oOOcqU®_,(~ɔoR*#ˬi𐇚z`$b ͺ gDMQR# bAS =F>MlJw݈ X}׺~*KqI>, }^0rrfP^}R1 SYuf.@yCUŝNr$E"b40 `#|q|I_xl( PW9Uӝc%VDvaO*.U zj7צ$kOXK2adn\$//.iT%{Y38-Hm|n:_b]7F:0#BL?a*^Uxjк؍TkVX|#&AO.eE-M!#D\}*`'{v ~W $@=dVN7w({1>eR55ٸ#YcUz$@z4M9l5]$Ʒ0cuݡS qC$)wyhkOφʾ|-hX#QBFQxZƕN>ͯJ@/W7;~c 9>+k]#C+cw03b水F+E+m=3Wkr(_2dsQ0y Qu#(jxьVHŶ 4j"ɍ?%©\b^XOd4϶A:)E ޞ{v*s~ ?对)NhLF'`|c? ǗwE;Q5&ݳB"1'ե,Y7`-@ipl.Hd{ʇ#%jΖe2l"RF'x䈒uZ8^@N1<=vt-vPx wBrۆRmϓRwL'{)E~xHRoZԑ|i Ĥ85n}7X[:ՄIi"\𭤼ǘ~)q:f&t=$W΅2TL)K|p`J5g 3~yx'enYaϕ%M1+Wt\z|8ht" CUG VU3'P,4JxonI rf> stream xڭveTђ-i4@pw@pwh&Ѝ4NH=!ww #3sg7f^+9vծsV3jhK[C-A PKvtsBTeրg'?:# C!r@Hȁ<<naaatF,lk0j鳼zOϟFOm!w=Cj@`vd5 ̊jEthY:*`+ak\9]@ | irb8\+=!Vn '%y g)8*=A`<~]5 =kwvn~؁B ]@oWͩ(.__ӿYϪtGP2`@=>܂v^.  =Msqm?~LFb'0 y'lY/BDCS3`5$}#r]܈}aN_t +auc"^3{Nʬ/ۓAG~,yxKL͂69͊?WYF2\2+GkuA=b w $dtJKԂ[_ϔsugEūOh@=D/VU"Y aV]7  HRTvGQVewyƨjM C[&2dc|w%-Wu@:F ~d+wm}C]П?%cPT)b7_;>~:ᇚOHbeAlrkJZ G( N`ߨF+{4ZJ(!XKfj3źMQNLbr Bn_:Jot< Ҩ!`L {-(uْ'9c5&KCёdOixx̍~v>Mr_#[GN1wtV byn*dç !g;(۶X&k VG+uB$ZPϖL kJEH?įv1q|.8 r?4L ,Jw4)-Pp*|6Do}wSލKCovwFk`;\:% Vtsz_C3"XOu%}x1}y+#ȗ`"l0A B2Q@,)/"w$y;lMfۋ ȴXK11"+m|#2QB=2$c-o."HStRx^;(ru"f*/G#'F激IroxY͵]Pq;}xpWSQVR5[Rk7ҋ.?lWk3a.T[8H'QDyJ?v]FM%/U츴ȸQrRrzJ+ÖAWzy;Mux4wQVeQtgjn6-.矱2,;DT#úsJ't ~j&:gB`j~0ӵ48f|3w=3/R"7ƈsLZ4}\{2oT/&yG\8Dc6ޟ$l$LJ k"(8O= 3}Z{эLT2T؂VvN簾;Y")wuZ153Ux?M5KK8+}SW2Ot[))OX>[3*(H3/<lVHv)VtV?㸠u-TKS5/&Y(#)aעf d?K+90zל.k{%aYI*X }n(,x,0]sd=WUWDXx<7T!\2-2ҏӗ{\ӡ5dHC4BsœxБFq8+AKʧ.rW7X55->uא)* ! vDƚV̀2[ bDt͑(_H~=tVLxb̹&&x}a+kBZN_U+7'n4K}ȤB:m*Kْ3 r-YfثѵVHPjMP9^;oǿKgE#7jW1!C}oaN=Z>* 5iׂcT{t>dfvy.%-b$$ Kp j>W7AN6̜Ch+=')ZW otH I~Y,tk'&-dOڑq~_3VP:3!<*W'/$w1m,)C#TON$. \) K_平%~JCȹS=Egcd+6jwqg]vH WfzugtBcMښ*i,麶v{3IÆWp,&ܥq>V^Kܳլ׆C\R?DSd;aqAdYh?ǥ?} )_"bƯ0cEVG/{wF)s~WRRD7}ʫؚgm 2I>1 \GJ.4*v7oMTTlKU<2q6?mվ {eM'g2YN &n"xd6LlgZk\"-I )g95׳ =Ntlݳkx˽r:v)i\~ UރF})03'g1mR ڛЧRZE?8Rź^v ;jj  al҅G{1EJ}]T ?\<;,4K,`Exht$[:RN|ȗMU׫>p X66KҬY0&erY; qG ^m D]}f7ID%-o OÃX{bŹjp ^߸F` (KuFrIfS7߹Xg8׀hs e莝^u&`I;39?՝˩%o2J|Ĵ.:6$81wd4_R/UlG@ppzmN o{=Aq9C\],Q;$#5 ~ZBV $W"`6F*`ב<1׍3o87:>|FB9& >7k.BޘZ)EY+4pxHe~ki$_?ɪ`IA QFMw:.@3Ӻw CZQݦa6ؑmu{.,O`\~ˁLlByVۛ05՘s7%aʥ!k,5D]I- vڍCvhtg?*BF) j U)0 0pF{L_afdj%BRaU%nW81w ӧrǶSITf>b0|_GyN,(o㣼`4!!j{ݍbC}kSKܢTz/6{U4Z6E8VAoҍsjq 6@emf8TE^bhb Qp>u1gڣ }#!7 |#[FU觙HH\"HD9 =hi;D%4{=Yl鰖]r+ \ ޶z}qᨏ(Łࢾ96yc^!eߍ&mCĀ6ui+KnWb J.”)M֑@R/.pLHCbtCaqtS^;`%tfA69靃^[^̓VI_gb@hpS 0C86'CUc5'<+fX=(Q20=Gp[ N >8Mh;Z_)&el`3fڈsn杛įW~n۳ˬ(j(4UE^1+-AaKJ_vN=!>J Qǥ4'g*3BOJ'eq,#.#`0%9.wt t\閤 fn[q?A٣\;ݒ[ŨYD;[E0ũt 0jB߈ޑ r%v/hH>04 s(h!Msvns0y 6חSp=Iu$8,kZ͚;gFX琹^ [m>5L]ꗭpZD̀/}%%?2c۟+Q96#l_Q\V]H'BCǒqd釯gbf |n+83TЖU&.K32msne ߛg(c!(ɷWd5rY1u7p5w:bcJ#i={s@?erV_~6慚sSJmo=@UϿsxTET0qw84ޭg^CX苽2t gޣ%"ˢ( 7ٱTpjN` gNB]?X_xuLҾ0-"y*T#瑍T*\#ॉ An@=ȋ gL&1~4P̶grF _濙H3z^s9PBM8T8 X|[}`~1͂ * fuPe)w"tǞsA%LQes-(l ի][WΓ|bPQpc%3Uµ goR=\'D1A[AOEi@aSB~1o!WI-ZoyHGBs_ {359[H R)ޗDUۘ*z'Wڛmۓnڼ9N%|pD-KG. 6f˧ʡB-D,`tIrUf2OWMQ,.DܬL_z%x:vePٔBJ=}$}dRY i4ۅ!X}5`bsW;o7bn1Tg:/ւ?_j&n}TӾqlEEUzNn ֽ4/!Kn*\f6ƛ<]|Е>Yo&^9W/rL9Tk#ڟ㹘A%&cr+q2 *1~tm%!+YP=3w(Q>2 /rM4h׸.I?{~JPU *b}wdP+VJ44ΒLI$zB0)#h(I(\!|MmGgXWKB-O;f8UVE)uoۍB̯ nc5 i<-#׻6j`F!>6"( eLN,T`dŨA_#CMdO3-,Ji.YI{z~1܌^/S x3\> stream xڭTeX. `pAfF@J;i A@AJn?~:YF j^= g4\]?ԾP:*X{@ZXMu(wG;.kdA>SE`]hég?Ly ח??׵|{A3"-{A ]jm,i+A=QM.s9K`_o1zX,& r$YݭWxvb]jFFu'4iR?">O)lRmҼp'i~jCOj?+-XtG^b̘Mh(ܢ[@.)#IY;P+$t+2 9ɛ/M*DV g .V7rɩAщyiLv1 cZj 鸧)YX" J9GvIP.{"E.whYj0V r5x̋7GRss\\Z̒2pK;uOb4(Eęj*7cC/Rܢ~:W1~sdx@cCE7n¿BC=Gc޻ʏ\ɩI[8Ēi1NV.l*nͲ^HZ3Ժ#qwl/(rU=L9|',"ÃDyr;2Wީ#͆EOm"Hc:[]TSSN+8::wc{)^d|XAi6K29䡘Oc T.g4fE߸J@…t]{?SࣷM˗hJ?gJt#^fHfM4ib۠E¸c)vpb}oS[ߎ sJUMQhFR-AѺ|~MWk[ѻH9o'jP`eE܍k$S08}Fy۪_$Ê]$Ԯl-Dyem)kO~ w8Lȫ$clkE*b<t\E}J i{K=qXm/ֆTeð~q7Hb }fD GR^s"V9v٧I4/.V^'EG~Y?uJԊ{i[\}@K#])h8}⇇! D4HpXĞb<k-F3tBKDҏ+Wn>Ov:ͩYʲ#˟KA>i?, lNff%![> sKªJU T_ȗqn7⽓%{`xU>o^^;NU"9zꥹ(բ{ǀ Eâ 9Α[3-V6U# ˉ n.u[$TAGazJm{~?}f:ēO4:ÏWv)m}1-5+1}e,_bo̵ !ި6M!b<#s0k'Kڴ ?.`rFe3BwMcp{#2ToGrv^J}J 6Y[c똚DrA 1ԥc7dE%8'\#QU15w#nTi̒.c3x~4@zXLaPq|E~ßAg—xBaʳ`DYxPwy'sDI (! \@ly5(C:1nBbQ$d& 0B}x&K[y3m"@@mcgv[3]rm?G@oOz?qY ;-}8_0Wy]Ė[ zE;X~5Y2_OsмEڒ b~Vk)P?;9}r:@_.KPl.z#w[`3lw+V$z(P.sq (OTt議ˊ|5$+mM5xPXטd%JiOʧe]>Zt\\{ tr 4ǡ(KdžBt4lڊQrii^TU >DAq 70^P۬I0)d v^V'8={Jj&adԀ.i.h}c?u}w/JÓhyРp%S]jrU$w@7^+a5Cb 7o͌x:QDonN3$X2>'ߨdMl;psZwnvFRTF YqLӚb!o |uUѦnƳ%RǑdՊb< 4i!o;I:jvWk~[ّ̂Ur`/ 5Pś !{bjegʒ//Azis93$y]21bqEң4.kCGի-J/R c?wؗ TEɂ.{s*b,'ZcJV]lI8օ$AC:lRYXLGlUBxKƆ1UfyR/K+d:У3~Yjh2/BzVP L!L )k/\ҬQALQІ5Br}J65ۗDf#eA=Q *jv cxr ,=R*t4!v!=Q3CqjEU]/.j3gu ѿ5M)\ GA2br=-U3#Oܱ،=) ̧Wm8 cၽe2d)s'l)ŸjN5c7x[9TiZcO S{p1JZgW+5JG4sy [lƈn`j|"=Nr֜:fB]YSǕ_c}?fD;Gĩ*R6D74Y{Rk?y3'Zm٨9ufU\~z8ݪm8"b9)_ 9Hϼס? '?&~.Rv+EX(`'x7|F K2ʗRrC矀L;57t9[L5K (-7e۞ʚP~_G#EѢ6ՌYY>p˽yRTs0.6*f#gꂂeEh=Ǚ&g&2ojB_4컩 6~]a|i6#ܖ4@mW|p{R~E,X)A~8 E)%4t1+7|K;yBruk.\5!ӚHvqq'u*g[i<;]PPD%Pu+ kɏ\Y%|e2 j}*qv 7'Υ*}ˊ8A2 1e .UQhԼk-;HA5SZHBr]UnDԥ.-ԠocAH5jWL<ÏW7B$jF2AM?r::zR푒*;zł }Cõ׿l] >aR()чu:xvI%~ӱSQf#@Ble]jm;9vZE+;}9MZMyΩ7L˶?>QL 6)tҬe` !%RVKb6{C{5X Ȍ|S6q*ȵ\ tD|ȰޕzԿKA,3?|t  V(etgYmq_P1F,tjtwzZ |CvL%]T:nBp$ͳ8x}@)+\fjK p͗i X5Qŷv/d}V6Ee%ĿNq$B鈳B>COiB䃨c\ˈMF:s37kGlf9Hqmpdek)JňD}Lbww;]m澵&U4wQ(tscMþabnŸ>URidA3QQgJ*ւ-O_QCɁ&-I3$q6)Y4@^dVx cv]7jI˓eѷ+Yq * 2cɈ] ⊻#$Cz2>T\|bd:hEzΐjP$YrrRtΟ1jhRƋPr>W<_J`g_˧0fvT.xT4ېxZj]HlP&VCzauQ=.?F.·>k5*3 puNj8.8eu9Lۥ<V&&v@t/pЙgEn|w䒞[pNcZa=}|uVPI ;)%X?eg$ܴa(ܼiۉRa¯24oyKr{F#5r \,7P:Y=啃'6}xđ^h~TT9 nh38cLn22|/>7@0Yμ9xe;CY1ܷMmc%K%!z?/LfjuQ`zy>[]&;嬪|+6\3Ɵ*,O rnH+}5F^ a)SPbUΌ{A^ ie{P*C( 18Q'-g=vqԑgw DZSXś+DY! endstream endobj 121 0 obj << /Length1 1626 /Length2 10526 /Length3 0 /Length 11363 /Filter /FlateDecode >> stream xڭveTۖ-;Ep=xR{p =8]B\=Qc|{\sEM$f6J!Ll̬%N ̧4\HN@l/iILJD ;x8, :M5mzFƏ0O[3@ ;!oDu ,@@'%&@ht2ڂ 33`v0ۛj͙ K`pvҀf@\@';7 t2l]"fM a{S;C͜@[UIX@ zso`3Z慘;Z@9o. {2pZ8`ް?Ml=_@g33[mK=_ `c?}@Dп01źH,J`[INe-[_5o>+=2&wqRL@8_} &o#|F4hY,Ll]d HLlӰ%?\@{&YԵe4@%hx8qVu F\bb0qpݽ7B|ܬ>CɿyV48o}y/0Rf`Fbboiem&ߗ<@; iyl&la q((woU?U07Lz:<1vOH|({1iywY KPӏ6aYv?Ns8!SP8v`4@a$|x߻C̘H-`|HatUoJsAOnY9-C:_&K?7U7?GKT86 ̓BgPЌ﹍i aby/QYBaكqD[*?)Ε8j&_=2Cⳝ-PDž7o>^%4zgWoZ mUHe\DY1Xt8Ve__6^3ݎр9;ySÙc1i掞bOoLrRhM,$PtBD%-rPEq-aq࿅ _ ԕ-xYHz~GmYhdgRV*+kDnd\&+:tDe]f5ZҲcU}k<,SgmuAEe1f3eW?Lgy;LEOYQem5*dy%8g1+x7cB|YiT 7.zn.u+1h#A'r!><~FŘw?7be6)+x:]gR%K߷U~|ֵIs,8B('?D@HQJs 8tp]%~'bX- wp˺T_ʜyD}`U駏>;syp*]fCS?w68N# uW.fTJ2wUAVIv勚ʕB9;Aﮩ/ZWL^dҷ!#3hJ\D-x9s1 ېǏb?<߽^ byR "] Yn ;҄=)+GqЭW|-9˖  dzMckWӈ ,Ϣj(os `#!y_3ct쵼UGA\×kBڀ*" {놪>+:6&ŗh(%r_] 裬Ŧ!5.@1%aÕS ׹nC=m8S3e=mKNkUALU4o)62V3|? h9߳&+qǿ]=]ˆʼnյ0({Ks,^\ؠGE.hnx =Rugeォ;TO/ZU@[8魯R:i܅NVFv,,&:.`0GK>$OO62nSS9O^1sM})!dcGʷ$J5n!uiaXJY4JYB'_c>NXoc(-=>y.k!v&g+Q-u1ݏߴ]?:"޴D*U  f ~ kiꓷ)ʋS1kc&⾡o[LBD}z5#7||Oa ߌuD5J)fP;`Kl\cf/Ti#<9}isjVwJ!Ү&RAg˲/Xr<O#Bɮ٪CTb`%C5hq-HO䫝?^R+o|skM%kZ:I ;m8HW3Ѿ 'Q9t$8|W$bYFtO2Qf9l2Ӟ^۠S]Wi [B61˰n冫iSzw,+)3OO%*vPɢw,X(ti`.|[Wj1f7͇<J̡;L)e#eSy&s14C$9"#1#. H[OjYד7r5_{f>}Lߋ.?$νw7"רKoZ>Z6KJ>k\)|_ZŒ-탗b؛Ee7D> z-پ%m9F\ٖ+#&XCxvM;o>Pe&-g&?m;<Ʌsjd`呮6%v6mh+̜7C4:|reO*M{юՈ`)6v+ń-Lӌ,fآ}3m e%J8s.67ҕgad9C5ȧhcApqȹgɉZ) ,D 7qTǠnM?Egrĵ$ hT* '%ܨ}q֯sɉm 3q_cZCjrv%[bXz04C+`\7-$*$X}|)-Yy_<)4d<2d3bvMZ\ޅi?8wG/ʻ$Fe{K4V9ѫ{pn$Hۂݭl6,|(z˹[UPXM>/C9&ZOU膝MM/}K0pNwyhi7XQm+nS1դ.o KcfцaΊcS.bA^%)&:,^1v7mY 4{zʃJL"zCeRq=ߞukGM^Gyd-xP!I1%ǰXFȉf&Go2:dհcYV:@_p^~wKU>MF5JUt~ɰeۑi|\g )cpUw7#|RadmV+/+py;ӣ._ aW>bS"ԧOFjκhAO*B^x;V6T} ixX:ظ Y"J`΂W˜Sxh.۵I.vv, vE&UqP'wlvSǾD'Vy s?ݬw(L%eY!} Y@w _ jc>M rƔ|ѕ@y7v'SUb+VB(?vֶ=jsח]FOY'*9}>H[9.\3d6kG F=Gs#eoe燕ZhTEYBpaFRC6jSsg?KB/;9ձJ/z[/(Ԇ 2q(67(MOH]S*%FʫO ?7ѧY`QC8e lЄZ+}7> /ʲ/b,*]ac\]>/yj}qw2@ S2 #4)uB!fh(d<~+J=5O<˧XK~͕4CRDPĚN9* $oj;"77Y}L"~J^ݞդ]pCW4.h<s#!tVYQfŲM#o3.zU E(rD)HhJ{XsEu~Bqh]~Ŗowj{L;̪rٿKĿ |芅1"r)mY(̍~!iBA#UPKkX3e^R*^ M=G݇zmDw-ܛ{hvUbd4vwHVFrtNtG,~9yyX!y'&̘ aݢc0"ydubxqd+"#> 2LÖ;l R1SHW >,AT'wMfRʀ]hz_)VӑɄfKnnVUӑ72`Ҕfk  YMɉeME0( 2 })^YV©J d[w3kc'wڏVY[1/=|ːԹ0>LjSޗS3^f:%ohM#R~P wS#Ot<2 U8q*p1*]1Пh!-U7>%Qͪ.W?&ǽK= INQ kW(I,ƞ ^ӧ5^XzJ͓ $TĴ 22KW+.W__0*McJ@ T/Sk/po*Q\<*^qؓAzE2=?Hq|1B~J\d ER[PxQMofc4~zxv(i vԜHGs$ |Dx\M2UN(RpU:Q ,5{ٝ};APm R3,=(`6@a6^6!_sȻϛxj΂;"&).&t^a&e9Y.u>aһBaGpkܔO<:;Է~QAC/^Fdc eb9v[ > )*WNDp^czC5T %e{b25 շb{h-f`R!-S/1+T`٪n^+%gE`(ǖRkxWcq#>R?J+h@ş+Jܵ\\g.TwPI;&"_WqT b24Є*_RqMaL(? k*eg'~P̉Sc$|iA :.Te9W1+JEKU{Vu&3JB䉂T,MjF'j(re3n㒉ew$#=*촾n0Zޙ::m|ucIi]VW}}@M -ih1z\U62#GދRpݓ}To;Gu,%N{yN[hk!6n4h!~gx*6c?_F,vF1ْ?6xҡ45kuǼ}7aiINM~+.4W'%-VI#qG]vR6wUvgNo\L9*N?9|ŧb\ِ9-j?}EEbyk8~ؤ鶃Pn.h$3,dM._1P m\VKuހv96&55nβP-96zEpO@\9왢smdԁ3s#D=sD bI,ts5H|郝oChB GN2CKR*=GMGiN @4 Ni .pfvXgWRˤ~I/vP iÿl\Q<=[P endstream endobj 123 0 obj << /Length1 1630 /Length2 18041 /Length3 0 /Length 18878 /Filter /FlateDecode >> stream xڬSfݶ%"ö̰m۶mȰm[m7SܪzX9cEJ$H+hdk`,fkDH16pvT唢U06u ;;ڈ;sT"Ɔ&&#''' )@ @JIMM_Lhnj blekgmlQdf 012ʩPQ41vз9X m)&6FHKp364ffhl`g`m`0uзq'[? +!;ۿul ʉ;O'3}b;UlMZ:SҿtajmNnN20;Y_i8;ۘW4cS}#+cGǿ0 ׷r3s'Gc+:F1 65gVmLl 9_ gf(&odkc026u@2;P'ߑ9.}bVV2;wEcѷ6rywkUwAӿ01[h(ffl$gdh0ѷ۳ɕmmrhNX21_Ӌ*kHQ/ G5ҶFyFH Ie`{&/ :K;94_'#jchk(:6tvpKߪ76v36Y]5HLweݠTTWmYQL8xfy Au8ڋaEޓb|MLWIN}@>\5zAjLApwR^Aҏإ0>,|pldx:'['(] ͅݱr1E9Q}ə1f1[xA` V*46(p\xFIBsI|m+2s31rgq Lx_* H*3,u8|~cI:NP@UJiurü栴ьG< !TQOo e,1{<8 )BSsëiM1]5Woءȿ6 sIuZz4DYf%Kvu_JB$k", 56hFhTf dD%qgY0\SC",cjQ$ƀuMN%ՠX&/ +RS * Iymvdv^..qyU]AνM6f\ S̊ ,G USQ$pr]ܔ,'lHU%{~W /bF) vsTAzrq Cc|,c4s>! ^T@`66R ٓ1ʓYk|Jͫz9bavԵq3`ٍt]7볠滐/Gb]9 ֺm=9 +] XiFMӑ(=5b$P݂_1=d,:o8V0Bd#*ŒS׊NHxO22x*,iJ,o[֩*&eFv6O7ןMSgR cx48+̳ԬVi>:B6\=RZ3%J?AO^,bR+]{ivb27t)D38.k=ypw^!da.$C?m8ݾ{;DA 5Ψ_J$ 5Kș[ˢSlKJtzeIZM>_6#]" \S)>3>-ds9ezj \,K){G ( J+la#K&*o \`?@1˴E{5.w ſ.wE(c#8A31Q[)l{ZX)_jU8&`$$/Os/xifp3gp`nkV@PS.Zy4Ӓ/\+Hh u\n|]nRN˕]Gqxp@-,í̛9{#<ø)%pϣ0E$ FuF73 ; z'*PY\b3ֽ|/>~^F L'Rx eQ Ͻ6#pFI|E*DyUX|["l([7nj+(F53|H_H3#OsW8V@LqQ1c*aA@ WtQb[g T5FU9 qeХs$¡WjbC+Vƃ횬Η#Bzn $E$|)gCE ..{, !-U01il'T+')D]lIo V Ҭ- ^Y8[im-3 >:t{Bg_6>sǁƨa۠&L or uB6݈MhBg+˜[q5UX@ {j!3^Dlcػ= eE$M> D;EO&!ԍ;T-bK/DtvsnϗCۼe>6|`wG!u+Z?tC.s`9EDKG(]R"z9@R(yIvj@(5e-SMT%"TۼQʮD6%ԯc4ה* 5fJoٔZJYw^=#3?x5 Nha5:^+gdf2_= 1txl LcjQxz O*O/ @>Z#Mh&z=Ck؆ )!ĺ2g*& %` P- iKiEb9O GwoYekf1>^X9L:RU{}y|3r ŠE ZyƝ&jǏ:u݌k_%ʦ,q L>TGk{Rx+k#>9$ޘyTTwT#=HJܬ&@ₖx{Cz}IuFy&գ!˙tk qowS;ϵ0PKхRrM Baik޳Srx'8ܕK:R8j_KZ5":&dgt:w8O)Q M\IbTZѯ"34ݪ=sMHJl~FX.|VDpZxb#))T%MJ;{언X|@ ^7}.rM9OꢍⶭCR^n~iLZ![IḎ 1_qầϵDcc7 ‡COk|@}B&U/ˊg5hqDkFlF]~KGl|Ce& غ *>wAz]V+*]qOɼ>S^7W!#m=e`_c' UYih2gˋEDx0dU8hކB PkQM=Zvzɪ@/Fl'a^ p%AFd|ҝ3?]TL[ޛ{fM,\ԝ)`c|)S7,qK|BR."?F)T֥iZQLi<Jf}5LN>O]Ua7ⓗh.d;.J#_a!I^>UFjE۸eCb$Teanmc/acW,#w<YAIfҡ>ǔ6%!D>Q E'LLf>He|(԰~~@x Ţنhq`5>If.pp d4c蜲xOSXU3-d4u ι 0M]H鵿]n!"uIJHC1nbu\Yq%)NL7ςBP!\V6I_^!~gT%t7^Ioq9QeSaTZ7=u֝rhIb6-k<ΠѬs`yC඀xĜvi5&d5|eI@A{5ܧ :翸KFIޓHA46FKgz,Lo|_ۗma{kxi>Uޥc/x|ւvq6H>M=%9Vso)=1],"v]*{?"ަ-" &BPU?jiZZ,(ӭ@IG!(;~cph:Tm;v?Eq8z}9ynj_VE@Z0 <H+ ex)VhB}%n5ؔr4~٤zJH.̯/{) ?AcOKχ +wֈ)3/n;~d\ntr;}*PJnT%\aW, uYuŊܙ[`ހ>WSeFr{ k@Sc 'j| S=n??S⮏h;NZ ;r<lѱT<RN*o%QSGZ ˟DFóP{q8YR.[aѩXvDV5}.aIp}%0 hDzZ>I(5%AH< jN@wiۓ$PC3vM!Vyd@Jw6 [!iA 2,1obk-!~(zxiRolq)%@ U\\[FܫV'y41)[Veo-vƵJLK^v*H0|h=Mtľ,aF +6OvKE;Cgw_G6m!E%ir _u4N|ړ\G~kJ.+[ }}Ah &5zk#bGZY7-Ƙ"?B'+#j{[[z7t܎O<~ {CLS~ISw#߁__.Щ%5XBڹiݔxTz8s<ۺT>-t,[itfrWs¹ mq^ ƷE X1D1* \-iyXb[ ̷)^7|D3qǵ b؄ĤfmMnb̏P>~ڙՈC +- aGʙ^B)MhDZֱ}XIV.y]X[ʇ#8Jysz[<hqXH@80P#|:9'̝vQhvqԶ(X Q2#㨝 scybև}ü̼m  Su{ )a4:5KN᜔,:zQmذP^Až7EҪ\&(OQ##íxzg0jʞu`񝚖ʻa'F$%}Di lJh=V ,xԄdT{5/Nʑ6gHY#Sgܮȳ&73XNJ([`̗KP[$A=rzɆ^<Ԍa}(E ,ApyOCx-Oؚ`I >Y_i;/nmD_8x~wψ;5PNOUeT;l =gqa0],B4uY1VAyɭ$B*;9whQÌ8Q׭T*a\*9ۉǧ}MTm44չN[Y_Kbf.ݮntk.3Oxf-:퉅Ae_?4+_:1ky̖6շZ$3`s-aJ] @lnsXfjfWKIvs+jZk8EI~T0ϝw$+vU38G\<,_"o 8le%4{ZcCq6?u*+[:77`yP2;1^Ӫ~8/5ʫjXW]>:?c1/S<|ݮ2=kHuy'e@>6b00@9Lt@gW"e%m{͗騹XZ+Bu0߬>)u {KsD"/XJt&p}vK$HrL 8#]Q~6 sRgJwYFixyXC0!d&K i+֣ze] W%ahB/@vP5u.)/r|wA%'Gy)JHj*|o.LJZo1nuO;)!Nߊ9 շl7xwWhC+pCv,,PRϋWѼêi>/}#r9(Sow)cnӛXDk۹V:(Q QkZ&3t(9妖ZD d 6ԓ [8 (]uvt;)(ڀ]WaFvf By7zJNӋv2jZWD\ 6nri妆S E<_Z>.]'|qrHvX"G$1~w"W3pXTm0^0\L|1Qav%Sb*]f"igg]&]kٺK5 -H%xYUۘ"Wn"^ -{Va"=ptK-r׉Mu) r@l.OğiPşT^١ƻ[[}KXy;S GgXWjvQ !u(~~BcE K9[7<3Zc+m%_,Md*n4Ee_4@+237E1Ԉ1"8vq*gλr/=?;BQ!NE0n[Zpa°p"&S-!O1:shj{1 }fhF,zKE6v)wpURL eHl ?W+/0o&ʯc7s.`:T7QyG{›`F Ck;?*NV2|'>xśEy?'*0u݉ O9!7W*bbNj-;ϧ0)Lծ*;=WCt$ w ]n'HZ>5 B4'Ǣٛ.N2!PrOr][z!֍w5 -4s m d<6A'`n'jʔzh@^2HCJWjzNo i2;پ'UmoM-69 )}[z^$y֝GiԐrF֩AC\\p_J\X055@EK$R[ҸJ}l2"8#xjn/hzDfA~xT`[D0_=Aj_3%eS]5a7=Y/̔^q'ԩ%ز5p0k>?bn0e*HvgϗVi܋MҀ%1 KTKZO?ߍ}E<.apk2 :#GUtrQH IuK&SeRB;)~ dl ea+H!zM #,G\GF%Ԇ|H]PN;7}xODwOȋPcꕧq+tx$±*3XBϹb I2]L8[8U*O:&b*BmRE NOzdYMꀢNIEPK*ؘIS#A]*dFt?3 JH[rY#,&fY? 0.W1O4 :9è9:^~_C94*ppmWR|";iXV)%UgQMkiиDek"0\dt5Ée"wWؽ?sR]tQ:5ba"IDֵs\du\ۑ:h箷˴o_~U,k9RrB z^wy`9X^ghgG@ >}Dd[;h!|)uuɡl^+X-G\0O8՟ 3'E顜H,ln4w2+qKZf:S^94y&)r}QY4RxZcCFI[-XI!lVƊ=e0.4;5v50bFߐy3Q< 9:X#&6zņ?dZk8媌f6hVR5kwA$<3fimqPav\ϡʻ};?d"йQYS w `(#D>^E?<$9%P hn9-zwÛ; 1k;!$:c0@HٛCi4rsCYY桢qDщlG2sBj`Q4=--R8 Yy鞪ݧ٧{YHC~ls<.`*Բ9Veu>*߹w \lb(W]@KY# LU7™,XN?FfL(]jF 1òN ;Wt&rxl~5uNKRqQ݌Iß6O;jz8R!v\%S1W=$zbn.[جҦ/4" 8^ra^簦Syw E>hLilͰb4 ]n;i}:x93/Ũ#[fSEGg4+9~K4tv C(3> eFFY<yvN:k6Nr'~ &Hq 6:a&IT퇗N Y/s;(W71[|$l9rzz'BPsܴFe<:ӭ+|.]{v ǡ|K; 5*ov;FAPND [QZԔ^^gf4I\.BV=rbq-5 )}U Vܿ!^.k)B}6TvrZ[l|xYlYߕH`!_ASO'w  sp9liŏ}xt5ԁ}-z1scOt&Mʱ$SscXVi ''LA0-i-MPOe4ah|!Z\V;J3VHbE|bNo@{ źKӸ;=5VHN`qwZr b[}u~d}؟6Bt#paKV m̉2NVg앸TRNHQQbg8Sv2>aM‚j̾fB})p!SF)UPuU^dS I-$:+J hM봰|`)kx)vIVtwLv%,S-w(\I4NxMO yD9Fs\A_HC Dwsfii+@E_E^@|#S|cg |* RR ]Xn4XzIc}ldO1/G+y_MW?<鳒_$_E^H,P=Cnʈ{ĦX#SscYcy;G۶:)/Hpҍ|Յ9#dvwy :_J wܑ5G} B [-_c )ZvyԼp99 ܽ[2*Xg+mLR% *UΐiLPh,.<L3661 E3HJ-z7ض>Kݻ El'Xіsa: }F֬ pvtXQ2*,"9؀JuzL_boZJDkU9tQ:y/Z[\NU[nOy.i Z\ORO}bvʃ&A΁[Mvu -g5%l;uT*Ss8igTjG⇰i:7ǷCF)K9Z>"ܚdM9=Ox_zBD0L &[_p`ˏA݂zI^]"EW Z?c'STnbhX1i݋-w"3y>}x٢u|Hd3Cl{t㩘߭nJB}w0)q+Gw*OI-GË x8{;VӤ"`ү,$W-7NW"ttX-;s-`X鴇nhh?mua~ cM?DJ39>aFf"[6%^5굀z5oIEa%""̝, ';eyڽ[y-[r U2L9d^u޶e}G(G;&#O.* 0~$5bU:vX^B&Z-rDm2lPZH/Bs+!12I=o;&l [b LG̹6g~d>>O f i7S+WH&7:aH-MFFjFp&Qnn(̂/j?·XG:(/PjnuM)*L6q!͙jsN5p59H 7uBsre)1V~ZZJ'C $hpį=?]B23j]f@B+uKwdBڢzs.Tcv!lCY4B$& gr)/uE'VXEWp4 ?v8op9i!ENZ !T"HٞBO>y~h;=X҂Da)O"f4jKzB.$XF29/V>ENZ=5P)VPdtO_F߁)(]UT63vG4/G\ I\llVH  )*=MCt9Nd0#cA^gN富2IŹTtoRf4b^&֍E5#@ItZsd ,7 B;[qz *6tQOX@%BtHTXyXcz xzP;}*8`tk_Wl&lJdod9"Yl͒8W 1 ?ud 1MϮMc.*|bL/P@KM?~wZp(TC;Jvp.6L j(3~wGW( Ň<͑oTk706 f&bO[ZNӗ?̇k}]N7{_r5*EaBMQ()CYlҟ ͇{8AO%XK>vĖB2Ud8qW:@CB݃Ei[ֵEd] ?)<5H|jx&d2V9!+IOrE2Z_m_9^*Jy}^#{%)ɾ$̝@, @LB3|ytx@`՛ۥghܗΑ\[CN8n6퓾,s6VGܱ`Yq? 哫i|)MT.ZJV>I0T I~Qmjܕ-~yoſ0#gAJI֯"pJ<{|9Qy ۿ-y5g΋ϠԚ`"#j8[ [NӕIv Uc8Q&?aq7“(@\~P86S D g!i~y)~煉N;jЉ{wP5>WuYR`MW䨣>*V,iYM͜\D``ӻFx7wղe쯕ƌ16~YxE|s1}gq8>yB(VnWEqq/6"k]kݧBXE2l;dB vtEwPNjy_mr,_ +ЄK&C֗ }g&cD|yCh%VxL6_{4qz;SѰE _ƚCFGUĝJZ10Mwn͂XHGjGf =^2Gv= '׃8N kۭ@>8]l'LO$;x<ђUjUbpL/sAUhp)\U #1|jrrQ:oΧql!!VN Y2e}<4O;s3/D2W̓:$g jQyĦ2y3 Gry^8}+I]7QOD;rBX }S`4{O%f=% 92{\&gu_KМ΍?b灯|/SIxע]aI/\[8v7wQE@jaX# 1 %Ҧ,m3d}ؿܒLeG*[ў Ր7HDO, c./. x̜`3 'LH59Yo:gM}H( VmFpWME<7%da0珓YJE!ո`:PeG^ÃԖtOiD}by#L!0a.5\ʗ_Z@=lWqÝlvGjzP^ogp-vٿ9t/vA ‘+N-kΎ,ݹڡ}jO>fgUhmGn?ФZ IdTf`Z|(M\FjMB%oD6+jЄ҆ S8ݐᡒt>!j@zfzc\%|K;s>LTM 2]c05H| 'm+/y)}uǍj@%IK TUP<>xB,.,6ybGۓ39_k=So88$,ЩS7|BL~Kl&Ջ il#ծ-n-+D\T1nŜoչ|! Y|FG 7V܏VgIzjj&^VRoޯS9 ~v pX >4Ƿ]QMʰqPExߌR01._wn֨UD { ]i6b:ZT%xޥRFr1rKgM6@#0գ0J/Xs񵹤'ɂr~ |cMW1*~?YplV1~s첫g9ծN,G=eGtԀ`_ À0=>_GZwq훴u*9/XQCQ"yL3 ^]uW+ ^/F J3lwf_~46: MaLn kB Z 퀅y.`R&ּxT ^] r{M5Ui A䚡"gc6)nQv<:6@ѢUCr@?4fK8*n nKA Wa~eL&:9IE٤RQKXp%LZWmXdC!^ hXY13[CnXPcٛD;)'M=|)U}Z15 Pgw1[P3Rト})~tVtƏv͟>QKI=t#p$&A$%Wo$ 6 ;lU"M okm[YeW9Zͥ'{|pI@L1Jx9"~/6h4]Lk$?p:Fҙ3 jz}ҽ* ^)Ű;9b_陆bpD]bvQE}vxfpx=*#S>T%d㧍txj$XFU,06޳5BpYyHM5gM=̓kx' 7h23)c XcG[ tF 1OK: \"cJI+]S| /\9GTBB%Ffyr%,)ټ4V '8ԺWu,eTڷYRdY5 Kyt'?b3ԘjN>`SEg"GKcJ^5͡P&R.@iIru8U^%k; 2Ve!=z|%ƫY+OZwsu:2ʟt_\":fXMmů¿KE歓[t64C4*pxH?+i)zqTœ4L𜍟3:iLwܳP<ǒ;SLMbA*[fZdn;R _9Iҧ8ZZ^͊Z,FU=S.E]msp44{5BN59 ?/ΚxՄ{j@`{P}u+ly6qd 4h.}bΟRTx$Tℾ:{_.25 bU,}/:A>0ȥ r7'KH0ǴB[]EJOO6zJ6= ˍ ۦShY7;ח_A('1mXݘVs}(M]h38߼Gh^y/iy)Vɹ$3cZh^j:`""s3Q5Uۜ.n)Aug߿b3Zк\$U|PV>^#WZ<&&97<]mk,YI&n7ЁajU˷@q]4-M9~  }G?:v{W>۸.#+W]ff#:,*J ).bM} 6k[>k % s5ٜF].dA]$&,7@WqD%e΢zD|NgYz6; 6j\j1{̈́t7ṵ>Ybrok8$]گ`a?0KC(!hSų=̚(qs] vM ?ٷXڊVA?wdg2CSx( _q)#-&EG %n4\57PybG,q=E#ݴY EL/69zT/&eIL’Cxѣ쑨BA(9]9M endstream endobj 125 0 obj << /Length1 1647 /Length2 11470 /Length3 0 /Length 12312 /Filter /FlateDecode >> stream xڭvUT]- n]o`;[p 5]/}aYU߬(HTLvN ,<WgG v_TN6 dg+fhb@S++˗/Q;{wZ]E_L&|x:,l.@;@[*pA6@$ZRA :|lb2ȁL@?G{) f KE:|9:~|@ c[;plMmJCnnwBv_?t`JvN {'GT%1diWlGЇ`gaifgWI>`>N [GX&@#4Aʀ0v0::~|`u;_7qo1gD`aidWHۚX!7sQ34Iڸ̀L vN!3H_zwCK8(hǢ1|ecckL/W ߭5?0]¶ 1p0rC r͔@Nsc[nkt?H~?Mf 2 f^oW$%*Llۿ>IHvfy JD 1o 卝@n]fFffϿN#nkjgW:ۚ} R:;8|06翇t",ۙY:Ucgt@שUum|)7z fy>wd#C;؅eCՙ<%&C[l `2(FN=y>+ɬ9bPC8w~OGA~gc\نZ^tLppG;4y ݽOOkxD Ʌs3-ih#ukuพHcݒe=y(? %_,4u3AzZmb5[ډەqe2 a:Ꝉr/F|nhdgqUlw]8Us̋ WtH+inUYFzΤs-MDi* v; G7p ~MV9u@ ~Q] ,pbz⋶Vd<<۽6s|B~A;O JUQ.1׊jN7LVXgfWzgr+ wۥ}ϾCGf5"ܤq7S8u')i+gƻ\@Rvq4yt e>.7MdQ&TcClN)Zn8&TZRtmԼB暋b3}%Rj%|Qz ſC )<4ᛌ$LcK@Lm͠U@FxA"B7>CId5ˀKǣX+G #IoԢ]A)N$3#-0My~JJdlCAd*d&'|cs}oW+Ys 3Æ1Uk3-5?=9|`%ZAo5'H?Բl#^CXNbfVUf'YLx'D/lG$ ^;qīͯ>;h[:F}qzq)K)[ kBdi I- #z ̗Òq PzĖ+]i'V؄5EBu)kH}:*xNmS< ߹&sT10cdwx qc;!=%p  1{OHæ/6E=Ɔ:VPYݴX,ry/z.?4Йl>=VQ csk3 @lXum 2|]` ǮI6d@7k7&`I=r =}:vfmT#aZ8E "&޾Z2K&1NPBE@Hߧ MH-YxkฟGѱCv=@tF_f'_7P:0IIhOE &^FgGtiqJ {ROh&N:Ź2H$zE/",ݧ8Hɰߴ!`҄{y MZpc5A,S ]Ϟ^S0j |ȓ$D 3 #;%LՒJ z"õQTk}`WqDvreEa F~: 7LO^wDa$A[ʸh$Sevݕ O-TJr'm/%`k`?-uHDO2E(%=ͪoWlsb(S!f6 Uo[ %9+}@Pg]W_bb!ptaW,ME+lF*0Reh/d6jrBOЕs!8;{ P 'e&.œ+GqTɘ$}C=Tu:QG\-ܤ:F5Wz\HG9O(tBPsAz  pQ.c.*6a:8{3fYwQ>nzW.meN;D (jz֪cY1}ds?U\3/NJfg 9K:VtyB;ހLՄpxdӢE]F`"Syt!L I:)xM,;>HDԬ[(QFMs˫*Ђ,xkawr-I)AsE@GĬXa0! Xjm F喾/ 'gVvuƢCfdYu|=lƛ#aX5Ƶ^`mBR5}6 H((Hq̠UY>aFAnn-kiIˍV$X'&:9e>woĔ Sݰ.gA"!8-]6?X;`s 9;s-|ffOa)9_yw.y81SQ]8omD[F;ɲj {#2XՋ|Zf  mPj8{J ]]W#x=L6 #SzlЃ[ n .aNJҠwYd(ID נ2@=< B,;="un:^')ay~"U܂M?f)UR𙣞UçeſǬ:0Y)WieH+܆}7N:i?OO䶒%وޖȨeEnj\~Wamd+Hdސ(Q=₀a2NðXH}<67%)ƀ;Hᖏ?b*qodU7u= ?+th5FK`д/>D49@k9 a9au+&"mI:h/7k 0~}ڍ+&_#{ɺy N#dtO3D;|y6ׁCfkoD6ϸsY?dp'u_ϡ%em3]P7;޸>ɮ&ԈZxZ&PRIVRn^ÊNu@3 j(Ō:~nUy.;mFHr, &|&Б>t30iݜvi>㹟:ᛵW"BG>xKh-}#8q+v>bkAX3=h(жOqI -$15 х,jÒWE 8)kN_tKk맷ʣ8Z-NC 3ekiSk] W`}fdH ][!aEN֍sCrnfʕYy][ruJ_z9(xLE)k__gMd'a ʄcM'b)L>"<,@ҪmAns][;M+5ky#O9PQIΧ(^J쌅*RݯHrVq Xw̨ukę4*&EЊp.I^"/0h31 zXȮOçF5H2R\o7"g2<k(i3V.[-O{W^-razǮ_M~7Ĕ3 |>B6ӶocjeB(C `!=jQiU>ACNf~-zgHkTCPYdKL_wx%ht❻dZLO6Y/YHbTDp1byNP?$D5eMb8n#UTNE.CR;é2AIhR=21 H/Ėmhػ yõ٣hˠdt n5@NY)`Uot##yK;NBsx Z<9.)ԏ)c]B|Fj# Q x bKc J<ґ LS2Ȅ_'(3A#]69pKW$,G48iw5K +Z\g$ K,5%Ν.*_!ȯ1aB ;+WD*NwL8ey&0FP&"H|#}wxo7$Xvi,꣧x.)Ίz,^bfQ%K8_;ER#q{>MZ~^a=w8lzSNd7޾R;([*aAcjP/lO58\Yۭ) +Խ[vX#$ UgT6,A, Fguxܠ#go_#kC^H9Y"?.)uC-Tc.ѝ5QusoƋ!T؛~2i/P*zu7t+;Y61F^H~66M"fIm0U`qpy:wNRvgvdlK8o-^^ĝar&U_,]K}S7-n8\~@BvXCBG" q>K>a?N+ :,WG$tK3TLX}k 6x^wTs*qNۼ,z;yy]361 >"{ ݞCc5ض)S7QrM7b3"| Y!MWb!ķ-Mt_ ; 9킠{f=>LAfF7}|WSVH8Vr᱗ɭ&\=U?hױ cTsN@1a3ǧLџ\_6:0dmG+24l/3:֑4Xoy$G<|VU *.I{Dw's|dM6dw}'r2.v-/+gV @"]E,[uo0:@GUL͙}-ƬT<L r<7,\0ʔ[Ni9vXj\kF-ɰM 62|n/_zʶs^h T,}Z_LR3cjsE&˃Uc;̑tx{v?c֣nlªEшg=j7]IlhwM.q젤M3FZ 'fh 'Z]~9Mnܴ6*vC _F.1-I2+!P?[,[=#Kgb'/'b,Շ*N(zBZr)#7GV먲 scd/h7\cv~63`Zjg?PqM>- {x/ҙH~V8hT?JJdR<控!SHDG_XxX Pe"w zj3yWJ,*º/7P(^4"8&Bֹ0qo( l+!c]'WhIJ=xnkh|Y"Tj1܊> / n^ߊytx3}.7rЙyi@ nq&;(%-B!:[FB%[B}}Yc(:}@TlVm6Pk@a)=}ZTMP96JD}S@ES#-B 1?9An'Db'wH÷+wR6}GKoNXVL~=!}BB[$8&1y|ؾ(BQx:lK^!\10Xo rv/}/)8ܚT#gv(B$[]:ɧ 5;bndxZӡH7Zx0(P#S=樗 =!Dk]+3󝯊-"3szt'59虀2?I`ު UΦ}Oj%XۛSKű*i%)܎n}I*{oaMtFYCGv<,XRhB$fiRy)ӽ*C9%BDv&E5/rAZvƟ{5 :<м#d oZRWC-!1T0"pWis'l?$\ !: $57kU‘9Y"dJM댳װȵ z KUo!"/Xd#Upj+E//rx8Gڴ j8ϜƋ 7Kx}:j6_OM =*[ ^G-I4}x]d  TUMI5fs֝&qrds_Π&|5ON)*^hhvޝH]hMw Pq崌F|Wn2@Nw`ȘjJe}(a J  ୒b֫bDytaIX1`y!3D&%JJ;E|ɠѶ=:Cv2]gfZ{Ð4jdZhga7I*XU{ N؏1X3կnB n2MԶZA]$a[@xg0ˈ!%3}zԐsytYgejo[1ch \aXCV>d,$}!N`WHl8MHuxjV =URÃl,&CGƄqZdWKT$;vZ2;۷m<~pi9T\w1_{[(m#AJQ7}Y"5ٖT^(4y}J no $T˨4R2޽`e!ֿ:ͅ0oҐ!.Р;/W廬F]հv}ѯr@y2܄.j}k(RcR;խ "Pmv)j"I5:wlePҕI&Y󺭉z&ž:3-5gHD!8s%^fm+=ha$z!xLN")(pu4aL'N'uL~]X fFxDG5q !^o%*5oӤ,tpCثXzeWF١woh1S7+Tjk5k=`ոJAY"~ȗgYՀh=_f";"&Go&:UT")*A%H-g*mwE2B övIsyBD(Hƶz~1ms\edRӧѰn9vD?;fqR#.K`넻tPB:|vA9{+J..Khf"ҫKϡz6Hb>w4lOrsv l \ھ*%eum|EXr8+Arm &cV>4 7ˋv!K  H>qN-֧?{e6>dNF'ŸPLFQm4#R^5tՉJ|FoR)Kp[R>/틂s V3\4z1KYwtŽ`j`r(jWV^Z3}Z <]oS.E[+G|5J$ete[} G:({ #H| 0${|؟` Ih=T)spL!y42 Y&* FU_퓱amhF Ξ,H3+җ$ ˌc.7V@I`gv L-/G$g"?^ed~#.NdA}^/hD1t#C0f270&4Mn*0dڻEEP1#J%ygAy'R{4mL_>x)?)%e ># PA<7a1/ gHJOQQv]_V£jQ4Qц7kgKNݑr 嶮4Un隵g!q%bHd"EQϿ\}LrVRG(F\X};x.iښyTꂼ0 \#(犓~ѯhi4û[21 QzΨ֣g.=U5-zɧ]r1 J$C!$AcJcb})5"2yT5狒~8[ >6k5\J^_n+ENMwOtS"byR0e2pa_TjW) 0U ROMwK>(*;5h8Q#Oj%;|C],`>%td&i 0b5'do@׀Q N{ༀl|OZ<~0fp%T-Rz&&_vd0|*I6EKk`~;PTAw6ps0,)uK^ MLsG |zLv>CuH$I#0byƥ! _!Kt7[׏4)w5RpFa9( lup&*B/z5:v~f!zmסDeIQChY.#/ MJ1*z0Hf8/V{hMJ3\|Z qMHD2X{P3^%\Lʄ1  k ם>tH "Q s>[Xc;d?oYx t-+pD:m0N  endstream endobj 3 0 obj << /Type /ObjStm /N 100 /First 807 /Length 3663 /Filter /FlateDecode >> stream x[rF}W1-a0-Vɲe;cGRl'hSC_HJݗ-s9}2%,18,`K WpЉ..\&'ҊDDe'd3hi,1hPRkXN\7q8E+1Op=hZ(p}A-OfaNw.ј,фG+`HtSP -&pPvÑ'( $r=CHM P*Cc V%JxX05! P(bVy A0diD@f-,yA'Zɬ6LBP<u6K`; % GCHHH%$080Tq׏Fˉ ! kd<ʢX "8BQ&è異NhwL pE5 \$j9Ժy@F]X[lnͨGQg]OYZ ^(Kv8>_԰ǎXyI;yGgŷ451zfI 4۟L sDTSlupաB:Tj]Qt5F1(T|u zxeߌ&_{Y1 Vb)`ZfF&UbK -?Nl?)VW'RE))q)(nG%ĈTd4ѴzT|CcUڧjJO-%hʦFۡ Zd CGPXo%JmHTRD8Ljj$Ai.A 2(00QڹO)Ƨ^QYZHS<iqu:I(I?}f`ajv~=zMtP\i>/^M?""X"DSiwx}}N/\1;.SJ 2prP8=/jvgM* 6zTi4b@Ӱ4X(֠J,DFRb|f#PB !M@NKհ6p`!qp]bQ)Hև"ԧ(K|Du6Iࢷ!XǬzH|+tP`]Y'4Vh7P^yJ?;xچo?oj-MDdWF:DCcB{˃GCDH)#V%)BNmIyZ\峫Q~^~v6ds]h#y8*O ƥvm2YlQ泽Y~wsd{#42Kt}Gn;lt]֬:Sqإ@N߉NԬ415XnkJMenkF:!@Y(5A+Dz~#>*]U׻^_akt) dM>2`qv^!G.<33,ܰ??%6Y@:B[zPָ4GslF5mݷ#lo t-Ux;dwC꼼s/C( ">5d= HzX` EdKb`?bTl_CiȦ1pzQ+(1":@}FmDm#fsp5>jm ͱm@{}n`ls6`07u>|d+CV7pBBF,(6Y}q-7sE#դJRCMYT ]7jU mO;utzEO}yCzyi~-REʨ7[YKiHQSs_~)%o<}l"JUv)0xuWf3/]󹕘R.b^,{,4R,ȸXlkFO:2q~>x?.,ʷ޳b<\+ݞ*◳-(MkіNtY#jp-܈MRHo'mzP =:ޑJwm j E4ƾ 9dRqrv]Ӌ|"MXlJU{Ϊ3V9[]}z5_V-@/*2@߲r!ڌȘmʴmsa{vJ 2lP\^ِHh;qKƊINQ1 <(,oW}ggE@{_*$&-H!^]I.ii<] it@KEJYQѕ^AûW7vT\\7{iApū ɛNH\ ӎ"a?/`;?| W\ud/JkQqh\T 2 +k0bbͨ"<sXPbRV"WnL-`d2d.KS̄LvUmuT-a]F,t/&b8CYkwĶDZ_gHHO*#t=T geMօd榶xN.rGT:6ӥ/tV14IF4m]͟j篴Mճ~׳C=7Ѭ%&{Muq4_5'ů<!\opl7Ј٘Rx[8%;P8 mcֽ ܠ̴ B&vj[]d1mMWЉ"vDgݶnخT[̣ۖdj gmlElQ { Pz#@u􅸤O 47D/Wn1c*kLI A' :vaա>)ʅ[3?Ru=˯}d endstream endobj 135 0 obj << /Producer (pdfTeX-1.40.21) /Author(\376\377\000L\000i\000s\000a\000n\000d\000r\000o\000\040\000D\000a\000l\000c\000i\000n)/Title(\376\377\000P\000E\000T\000S\000c\000\040\000f\000o\000r\000\040\000P\000y\000t\000h\000o\000n)/Subject()/Creator(LaTeX with hyperref)/Keywords() /CreationDate (D:20210617193048-05'00') /ModDate (D:20210617193048-05'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) kpathsea version 6.3.2) >> endobj 128 0 obj << /Type /ObjStm /N 14 /First 102 /Length 486 /Filter /FlateDecode >> stream x}Qo@ )LJg`*UNtR"۷9SgYA*@ŀQ A PH@ADXG A' t!I.B҇D$Uivu5 ]3Yp+XqՇ}Ck\_}M }G%އ>Nubvu@6|b'm VmLU[vמ--wb,'t\4ׂd=lC5<_ܕ+;MX,\ |ݲ/02w:_ZT*j/Q^$$vyhn숬z;=Cn5֔/D"WcOj UջW?eȘL肦 0AOݼI=W7/~sfw\K-'o6_VW }8Ο;6V?+QqTsW,m[8*`Z endstream endobj 136 0 obj << /Type /XRef /Index [0 137] /Size 137 /W [1 3 1] /Root 134 0 R /Info 135 0 R /ID [<900F0490C0B171F0905BE3B56DF53830> <900F0490C0B171F0905BE3B56DF53830>] /Length 333 /Filter /FlateDecode >> stream xҹ2asBB,"%-}_"h:*c(464Z!w~SBqERٓ~(i:B(K(_EœR(r TBTC  h&BJ l5C N Z.:b*I0Ч~H1L,Ă66s0˰O곥 MK[*/iK*?vT|vU-B!aKva76a#uf1T. endstream endobj startxref 106416 %%EOF petsc4py-3.15.1/docs/usrman/0000755000175000017500000000000014062764472016027 5ustar balaybalay00000000000000petsc4py-3.15.1/docs/usrman/tutorial.html0000644000175000017500000000762214062764422020562 0ustar balaybalay00000000000000 Tutorial — PETSc for Python 3.15.1 documentation

Tutorial

XXX To be written … Any contribution welcome!

petsc4py-3.15.1/docs/usrman/genindex.html0000644000175000017500000000525114062764422020514 0ustar balaybalay00000000000000 Index — PETSc for Python 3.15.1 documentation

Index

petsc4py-3.15.1/docs/usrman/citing.html0000644000175000017500000001060614062764422020170 0ustar balaybalay00000000000000 Citations — PETSc for Python 3.15.1 documentation

Citations

If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project.

  • L. Dalcin, P. Kler, R. Paz, and A. Cosimo, Parallel Distributed Computing using Python, Advances in Water Resources, 34(9):1124-1139, 2011. http://dx.doi.org/10.1016/j.advwatres.2011.04.013

  • S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, PETSc Users Manual, ANL-95/11 - Revision 3.15, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf

petsc4py-3.15.1/docs/usrman/index.html0000644000175000017500000001561714062764422020031 0ustar balaybalay00000000000000 PETSc for Python — PETSc for Python 3.15.1 documentation

PETSc for Python

Author

Lisandro Dalcin

Contact

dalcinl@gmail.com

Web Site

https://gitlab.com/petsc/petsc

Date

Jun 17, 2021

Abstract

This document describes petsc4py, a Python port to the PETSc libraries.

PETSc (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication.

This package provides an important subset of PETSc functionalities and uses NumPy to efficiently manage input and output of array data.

A good friend of petsc4py is:

  • mpi4py: Python bindings for MPI, the Message Passing Interface.

Other projects depends on petsc4py:

  • slepc4py: Python bindings for SLEPc, the Scalable Library for Eigenvalue Problem Computations.

petsc4py-3.15.1/docs/usrman/objects.inv0000644000175000017500000000056014062764422020172 0ustar balaybalay00000000000000# Sphinx inventory version 2 # Project: PETSc for Python # Version: 3.1 # The remainder of this file is compressed using zlib. xڍ=K1F qZb2;MB2{^7]g>BB;HV; WIi1I:D fgɾҰ!I>l4; Gxj%"*;6+^aeuNZƟJ Overview — PETSc for Python 3.15.1 documentation

Overview

PETSc is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication.

PETSc is intended for use in large-scale application projects [petsc-efficient], and several ongoing computational science projects are built around the PETSc libraries. With strict attention to component interoperability, PETSc facilitates the integration of independently developed application modules, which often most naturally employ different coding styles and data structures.

PETSc is easy to use for beginners [petsc-user-ref]. Moreover, its careful design allows advanced users to have detailed control over the solution process. PETSc includes an expanding suite of parallel linear and nonlinear equation solvers that are easily used in application codes written in C, C++, and Fortran. PETSc provides many of the mechanisms needed within parallel application codes, such as simple parallel matrix and vector assembly routines that allow the overlap of communication and computation.

petsc-user-ref

S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, PETSc Users Manual, ANL-95/11 - Revision 3.15, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf

petsc-efficient

Satish Balay, Victor Eijkhout, William D. Gropp, Lois Curfman McInnes and Barry F. Smith. Efficient Management of Parallelism in Object Oriented Numerical Software Libraries. Modern Software Tools in Scientific Computing. E. Arge, A. M. Bruaset and H. P. Langtangen, editors. 163–202. Birkhauser Press. 1997.

Components

PETSc is designed with an object-oriented style. Almost all user-visible types are abstract interfaces with implementations that may be chosen at runtime. Those objects are managed through handles to opaque data structures which are created, accessed and destroyed by calling appropriate library routines.

PETSc consists of a variety of components. Each component manipulates a particular family of objects and the operations one would like to perform on these objects. These components provide the functionality required for many parallel solutions of PDEs.

Vec

Provides the vector operations required for setting up and solving large-scale linear and nonlinear problems. Includes easy-to-use parallel scatter and gather operations, as well as special-purpose code for handling ghost points for regular data structures.

Mat

A large suite of data structures and code for the manipulation of parallel sparse matrices. Includes four different parallel matrix data structures, each appropriate for a different class of problems.

PC

A collection of sequential and parallel preconditioners, including (sequential) ILU(k), LU, and (both sequential and parallel) block Jacobi, overlapping additive Schwarz methods and (through BlockSolve95) ILU(0) and ICC(0).

KSP

Parallel implementations of many popular Krylov subspace iterative methods, including GMRES, CG, CGS, Bi-CG-Stab, two variants of TFQMR, CR, and LSQR. All are coded so that they are immediately usable with any preconditioners and any matrix data structures, including matrix-free methods.

SNES

Data-structure-neutral implementations of Newton-like methods for nonlinear systems. Includes both line search and trust region techniques with a single interface. Employs by default the above data structures and linear solvers. Users can set custom monitoring routines, convergence criteria, etc.

TS

Code for the time evolution of solutions of PDEs. In addition, provides pseudo-transient continuation techniques for computing steady-state solutions.

petsc4py-3.15.1/docs/usrman/install.html0000644000175000017500000001613214062764422020361 0ustar balaybalay00000000000000 Installation — PETSc for Python 3.15.1 documentation

Installation

Using pip

You can use pip to install petsc4py and its dependencies (mpi4py is optional but highly recommended):

$ python -m pip install [--user] numpy mpi4py  (or pip install [--user] numpy mpi4py)
$ python -m pip install [--user] petsc petsc4py (or pip install [--user] petsc petsc4py)

Using setuptools

You can also install dependencies manually and then invoke setuptools from the petsc4py source directory:

$ python setup.py build $ python setup.py install

You may use the –install-lib argument to the install command to alter the site-packages directory where the package is to be installed.

From PETSc source

If you already have downloaded PETSc source and have installed the dependencies of petsc4py, then to build the petsc4py module along with PETSc, add the –with-petsc4py=1 argument to the configure command when building PETSc:

$ ./configure –with-petsc4py=1 $ make $ make install

This will install PETSc and the petsc4py module into the PETSc directory under the prefix specified to the PETSc configure command.

If you wish to make the module importable without having to set the PYTHONPATH environment variable, you may add a shortcut to the system-wide site-packages directory creating a special .pth file with exactly one line of Python code. This can be done by the following command, where the system-wide path is assumed to be /usr/lib/pythonX/site-packages (replace X with your python version):

$ echo

“import sys, os;” “p = os.getenv(‘PETSC_DIR’);” “a = os.getenv(‘PETSC_ARCH’) or ‘’;” “p = p and os.path.join(p, a, ‘lib’);” “p and (p in sys.path or sys.path.append(p))” > /usr/lib/pythonX/site-packages/petsc4py.pth

petsc4py-3.15.1/docs/usrman/manual.html0000644000175000017500000001312514062764422020167 0ustar balaybalay00000000000000 PETSc for Python — PETSc for Python 3.15.1 documentation

PETSc for Python

Abstract

This document describes petsc4py, a Python port to the PETSc libraries.

PETSc (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication.

This package provides an important subset of PETSc functionalities and uses NumPy to efficiently manage input and output of array data.

A good friend of petsc4py is:

  • mpi4py: Python bindings for MPI, the Message Passing Interface.

Other projects depends on petsc4py:

  • slepc4py: Python bindings for SLEPc, the Scalable Library for Eigenvalue Problem Computations.

petsc4py-3.15.1/docs/usrman/search.html0000644000175000017500000000600114062764422020152 0ustar balaybalay00000000000000 Search — PETSc for Python 3.15.1 documentation

Search

Please activate JavaScript to enable the search functionality.

Searching for multiple words only shows matches that contain all words.

petsc4py-3.15.1/docs/usrman/_static/0000755000175000017500000000000014062764472017455 5ustar balaybalay00000000000000petsc4py-3.15.1/docs/usrman/_static/doctools.js0000644000175000017500000002257014062763246021645 0ustar balaybalay00000000000000/* * doctools.js * ~~~~~~~~~~~ * * Sphinx JavaScript utilities for all documentation. * * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /** * select a different prefix for underscore */ $u = _.noConflict(); /** * make the code below compatible with browsers without * an installed firebug like debugger if (!window.console || !console.firebug) { var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {}; } */ /** * small helper function to urldecode strings * * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL */ jQuery.urldecode = function(x) { if (!x) { return x } return decodeURIComponent(x.replace(/\+/g, ' ')); }; /** * small helper function to urlencode strings */ jQuery.urlencode = encodeURIComponent; /** * This function returns the parsed url parameters of the * current request. Multiple values per key are supported, * it will always return arrays of strings for the value parts. */ jQuery.getQueryParameters = function(s) { if (typeof s === 'undefined') s = document.location.search; var parts = s.substr(s.indexOf('?') + 1).split('&'); var result = {}; for (var i = 0; i < parts.length; i++) { var tmp = parts[i].split('=', 2); var key = jQuery.urldecode(tmp[0]); var value = jQuery.urldecode(tmp[1]); if (key in result) result[key].push(value); else result[key] = [value]; } return result; }; /** * highlight a given string on a jquery object by wrapping it in * span elements with the given class name. */ jQuery.fn.highlightText = function(text, className) { function highlight(node, addItems) { if (node.nodeType === 3) { var val = node.nodeValue; var pos = val.toLowerCase().indexOf(text); if (pos >= 0 && !jQuery(node.parentNode).hasClass(className) && !jQuery(node.parentNode).hasClass("nohighlight")) { var span; var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); if (isInSVG) { span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); } else { span = document.createElement("span"); span.className = className; } span.appendChild(document.createTextNode(val.substr(pos, text.length))); node.parentNode.insertBefore(span, node.parentNode.insertBefore( document.createTextNode(val.substr(pos + text.length)), node.nextSibling)); node.nodeValue = val.substr(0, pos); if (isInSVG) { var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); var bbox = node.parentElement.getBBox(); rect.x.baseVal.value = bbox.x; rect.y.baseVal.value = bbox.y; rect.width.baseVal.value = bbox.width; rect.height.baseVal.value = bbox.height; rect.setAttribute('class', className); addItems.push({ "parent": node.parentNode, "target": rect}); } } } else if (!jQuery(node).is("button, select, textarea")) { jQuery.each(node.childNodes, function() { highlight(this, addItems); }); } } var addItems = []; var result = this.each(function() { highlight(this, addItems); }); for (var i = 0; i < addItems.length; ++i) { jQuery(addItems[i].parent).before(addItems[i].target); } return result; }; /* * backward compatibility for jQuery.browser * This will be supported until firefox bug is fixed. */ if (!jQuery.browser) { jQuery.uaMatch = function(ua) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || []; return { browser: match[ 1 ] || "", version: match[ 2 ] || "0" }; }; jQuery.browser = {}; jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; } /** * Small JavaScript module for the documentation. */ var Documentation = { init : function() { this.fixFirefoxAnchorBug(); this.highlightSearchWords(); this.initIndexTable(); if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { this.initOnKeyListeners(); } }, /** * i18n support */ TRANSLATIONS : {}, PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, LOCALE : 'unknown', // gettext and ngettext don't access this so that the functions // can safely bound to a different name (_ = Documentation.gettext) gettext : function(string) { var translated = Documentation.TRANSLATIONS[string]; if (typeof translated === 'undefined') return string; return (typeof translated === 'string') ? translated : translated[0]; }, ngettext : function(singular, plural, n) { var translated = Documentation.TRANSLATIONS[singular]; if (typeof translated === 'undefined') return (n == 1) ? singular : plural; return translated[Documentation.PLURALEXPR(n)]; }, addTranslations : function(catalog) { for (var key in catalog.messages) this.TRANSLATIONS[key] = catalog.messages[key]; this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); this.LOCALE = catalog.locale; }, /** * add context elements like header anchor links */ addContextElements : function() { $('div[id] > :header:first').each(function() { $('\u00B6'). attr('href', '#' + this.id). attr('title', _('Permalink to this headline')). appendTo(this); }); $('dt[id]').each(function() { $('\u00B6'). attr('href', '#' + this.id). attr('title', _('Permalink to this definition')). appendTo(this); }); }, /** * workaround a firefox stupidity * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 */ fixFirefoxAnchorBug : function() { if (document.location.hash && $.browser.mozilla) window.setTimeout(function() { document.location.href += ''; }, 10); }, /** * highlight the search words provided in the url in the text */ highlightSearchWords : function() { var params = $.getQueryParameters(); var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; if (terms.length) { var body = $('div.body'); if (!body.length) { body = $('body'); } window.setTimeout(function() { $.each(terms, function() { body.highlightText(this.toLowerCase(), 'highlighted'); }); }, 10); $('') .appendTo($('#searchbox')); } }, /** * init the domain index toggle buttons */ initIndexTable : function() { var togglers = $('img.toggler').click(function() { var src = $(this).attr('src'); var idnum = $(this).attr('id').substr(7); $('tr.cg-' + idnum).toggle(); if (src.substr(-9) === 'minus.png') $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); else $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); }).css('display', ''); if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { togglers.click(); } }, /** * helper function to hide the search marks again */ hideSearchWords : function() { $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); }, /** * make the url absolute */ makeURL : function(relativeURL) { return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; }, /** * get the current relative url */ getCurrentURL : function() { var path = document.location.pathname; var parts = path.split(/\//); $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { if (this === '..') parts.pop(); }); var url = parts.join('/'); return path.substring(url.lastIndexOf('/') + 1, path.length - 1); }, initOnKeyListeners: function() { $(document).keydown(function(event) { var activeElementType = document.activeElement.tagName; // don't navigate when in search box, textarea, dropdown or button if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { switch (event.keyCode) { case 37: // left var prevHref = $('link[rel="prev"]').prop('href'); if (prevHref) { window.location.href = prevHref; return false; } case 39: // right var nextHref = $('link[rel="next"]').prop('href'); if (nextHref) { window.location.href = nextHref; return false; } } } }); } }; // quick alias for translations _ = Documentation.gettext; $(document).ready(function() { Documentation.init(); }); petsc4py-3.15.1/docs/usrman/_static/basic.css0000644000175000017500000003306514062764422021252 0ustar balaybalay00000000000000/* * basic.css * ~~~~~~~~~ * * Sphinx stylesheet -- basic theme. * * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ /* -- main layout ----------------------------------------------------------- */ div.clearer { clear: both; } div.section::after { display: block; content: ''; clear: left; } /* -- relbar ---------------------------------------------------------------- */ div.related { width: 100%; font-size: 90%; } div.related h3 { display: none; } div.related ul { margin: 0; padding: 0 0 0 10px; list-style: none; } div.related li { display: inline; } div.related li.right { float: right; margin-right: 5px; } /* -- sidebar --------------------------------------------------------------- */ div.sphinxsidebarwrapper { padding: 10px 5px 0 10px; } div.sphinxsidebar { float: left; width: 230px; margin-left: -100%; font-size: 90%; word-wrap: break-word; overflow-wrap : break-word; } div.sphinxsidebar ul { list-style: none; } div.sphinxsidebar ul ul, div.sphinxsidebar ul.want-points { margin-left: 20px; list-style: square; } div.sphinxsidebar ul ul { margin-top: 0; margin-bottom: 0; } div.sphinxsidebar form { margin-top: 10px; } div.sphinxsidebar input { border: 1px solid #98dbcc; font-family: sans-serif; font-size: 1em; } div.sphinxsidebar #searchbox form.search { overflow: hidden; } div.sphinxsidebar #searchbox input[type="text"] { float: left; width: 80%; padding: 0.25em; box-sizing: border-box; } div.sphinxsidebar #searchbox input[type="submit"] { float: left; width: 20%; border-left: none; padding: 0.25em; box-sizing: border-box; } img { border: 0; max-width: 100%; } /* -- search page ----------------------------------------------------------- */ ul.search { margin: 10px 0 0 20px; padding: 0; } ul.search li { padding: 5px 0 5px 20px; background-image: url(file.png); background-repeat: no-repeat; background-position: 0 7px; } ul.search li a { font-weight: bold; } ul.search li div.context { color: #888; margin: 2px 0 0 30px; text-align: left; } ul.keywordmatches li.goodmatch a { font-weight: bold; } /* -- index page ------------------------------------------------------------ */ table.contentstable { width: 90%; margin-left: auto; margin-right: auto; } table.contentstable p.biglink { line-height: 150%; } a.biglink { font-size: 1.3em; } span.linkdescr { font-style: italic; padding-top: 5px; font-size: 90%; } /* -- general index --------------------------------------------------------- */ table.indextable { width: 100%; } table.indextable td { text-align: left; vertical-align: top; } table.indextable ul { margin-top: 0; margin-bottom: 0; list-style-type: none; } table.indextable > tbody > tr > td > ul { padding-left: 0em; } table.indextable tr.pcap { height: 10px; } table.indextable tr.cap { margin-top: 10px; background-color: #f2f2f2; } img.toggler { margin-right: 3px; margin-top: 3px; cursor: pointer; } div.modindex-jumpbox { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin: 1em 0 1em 0; padding: 0.4em; } div.genindex-jumpbox { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; margin: 1em 0 1em 0; padding: 0.4em; } /* -- domain module index --------------------------------------------------- */ table.modindextable td { padding: 2px; border-collapse: collapse; } /* -- general body styles --------------------------------------------------- */ div.body { min-width: 450px; max-width: 800px; } div.body p, div.body dd, div.body li, div.body blockquote { -moz-hyphens: auto; -ms-hyphens: auto; -webkit-hyphens: auto; hyphens: auto; } a.headerlink { visibility: hidden; } a.brackets:before, span.brackets > a:before{ content: "["; } a.brackets:after, span.brackets > a:after { content: "]"; } h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink, h5:hover > a.headerlink, h6:hover > a.headerlink, dt:hover > a.headerlink, caption:hover > a.headerlink, p.caption:hover > a.headerlink, div.code-block-caption:hover > a.headerlink { visibility: visible; } div.body p.caption { text-align: inherit; } div.body td { text-align: left; } .first { margin-top: 0 !important; } p.rubric { margin-top: 30px; font-weight: bold; } img.align-left, figure.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } img.align-right, figure.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } img.align-center, figure.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } img.align-default, figure.align-default, .figure.align-default { display: block; margin-left: auto; margin-right: auto; } .align-left { text-align: left; } .align-center { text-align: center; } .align-default { text-align: center; } .align-right { text-align: right; } /* -- sidebars -------------------------------------------------------------- */ div.sidebar, aside.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; padding: 7px; background-color: #ffe; width: 40%; float: right; clear: right; overflow-x: auto; } p.sidebar-title { font-weight: bold; } div.admonition, div.topic, blockquote { clear: left; } /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; padding: 7px; margin: 10px 0 10px 0; } p.topic-title { font-size: 1.1em; font-weight: bold; margin-top: 10px; } /* -- admonitions ----------------------------------------------------------- */ div.admonition { margin-top: 10px; margin-bottom: 10px; padding: 7px; } div.admonition dt { font-weight: bold; } p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; } div.body p.centered { text-align: center; margin-top: 25px; } /* -- content of sidebars/topics/admonitions -------------------------------- */ div.sidebar > :last-child, aside.sidebar > :last-child, div.topic > :last-child, div.admonition > :last-child { margin-bottom: 0; } div.sidebar::after, aside.sidebar::after, div.topic::after, div.admonition::after, blockquote::after { display: block; content: ''; clear: both; } /* -- tables ---------------------------------------------------------------- */ table.docutils { margin-top: 10px; margin-bottom: 10px; border: 0; border-collapse: collapse; } table.align-center { margin-left: auto; margin-right: auto; } table.align-default { margin-left: auto; margin-right: auto; } table caption span.caption-number { font-style: italic; } table caption span.caption-text { } table.docutils td, table.docutils th { padding: 1px 8px 1px 5px; border-top: 0; border-left: 0; border-right: 0; border-bottom: 1px solid #aaa; } table.footnote td, table.footnote th { border: 0 !important; } th { text-align: left; padding-right: 5px; } table.citation { border-left: solid 1px gray; margin-left: 1px; } table.citation td { border-bottom: none; } th > :first-child, td > :first-child { margin-top: 0px; } th > :last-child, td > :last-child { margin-bottom: 0px; } /* -- figures --------------------------------------------------------------- */ div.figure, figure { margin: 0.5em; padding: 0.5em; } div.figure p.caption, figcaption { padding: 0.3em; } div.figure p.caption span.caption-number, figcaption span.caption-number { font-style: italic; } div.figure p.caption span.caption-text, figcaption span.caption-text { } /* -- field list styles ----------------------------------------------------- */ table.field-list td, table.field-list th { border: 0 !important; } .field-list ul { margin: 0; padding-left: 1em; } .field-list p { margin: 0; } .field-name { -moz-hyphens: manual; -ms-hyphens: manual; -webkit-hyphens: manual; hyphens: manual; } /* -- hlist styles ---------------------------------------------------------- */ table.hlist { margin: 1em 0; } table.hlist td { vertical-align: top; } /* -- other body styles ----------------------------------------------------- */ ol.arabic { list-style: decimal; } ol.loweralpha { list-style: lower-alpha; } ol.upperalpha { list-style: upper-alpha; } ol.lowerroman { list-style: lower-roman; } ol.upperroman { list-style: upper-roman; } :not(li) > ol > li:first-child > :first-child, :not(li) > ul > li:first-child > :first-child { margin-top: 0px; } :not(li) > ol > li:last-child > :last-child, :not(li) > ul > li:last-child > :last-child { margin-bottom: 0px; } ol.simple ol p, ol.simple ul p, ul.simple ol p, ul.simple ul p { margin-top: 0; } ol.simple > li:not(:first-child) > p, ul.simple > li:not(:first-child) > p { margin-top: 0; } ol.simple p, ul.simple p { margin-bottom: 0; } dl.footnote > dt, dl.citation > dt { float: left; margin-right: 0.5em; } dl.footnote > dd, dl.citation > dd { margin-bottom: 0em; } dl.footnote > dd:after, dl.citation > dd:after { content: ""; clear: both; } dl.field-list { display: grid; grid-template-columns: fit-content(30%) auto; } dl.field-list > dt { font-weight: bold; word-break: break-word; padding-left: 0.5em; padding-right: 5px; } dl.field-list > dt:after { content: ":"; } dl.field-list > dd { padding-left: 0.5em; margin-top: 0em; margin-left: 0em; margin-bottom: 0em; } dl { margin-bottom: 15px; } dd > :first-child { margin-top: 0px; } dd ul, dd table { margin-bottom: 10px; } dd { margin-top: 3px; margin-bottom: 10px; margin-left: 30px; } dl > dd:last-child, dl > dd:last-child > :last-child { margin-bottom: 0; } dt:target, span.highlighted { background-color: #fbe54e; } rect.highlighted { fill: #fbe54e; } dl.glossary dt { font-weight: bold; font-size: 1.1em; } .optional { font-size: 1.3em; } .sig-paren { font-size: larger; } .versionmodified { font-style: italic; } .system-message { background-color: #fda; padding: 5px; border: 3px solid red; } .footnote:target { background-color: #ffa; } .line-block { display: block; margin-top: 1em; margin-bottom: 1em; } .line-block .line-block { margin-top: 0; margin-bottom: 0; margin-left: 1.5em; } .guilabel, .menuselection { font-family: sans-serif; } .accelerator { text-decoration: underline; } .classifier { font-style: oblique; } .classifier:before { font-style: normal; margin: 0.5em; content: ":"; } abbr, acronym { border-bottom: dotted 1px; cursor: help; } /* -- code displays --------------------------------------------------------- */ pre { overflow: auto; overflow-y: hidden; /* fixes display issues on Chrome browsers */ } pre, div[class*="highlight-"] { clear: both; } span.pre { -moz-hyphens: none; -ms-hyphens: none; -webkit-hyphens: none; hyphens: none; } div[class*="highlight-"] { margin: 1em 0; } td.linenos pre { border: 0; background-color: transparent; color: #aaa; } table.highlighttable { display: block; } table.highlighttable tbody { display: block; } table.highlighttable tr { display: flex; } table.highlighttable td { margin: 0; padding: 0; } table.highlighttable td.linenos { padding-right: 0.5em; } table.highlighttable td.code { flex: 1; overflow: hidden; } .highlight .hll { display: block; } div.highlight pre, table.highlighttable pre { margin: 0; } div.code-block-caption + div { margin-top: 0; } div.code-block-caption { margin-top: 1em; padding: 2px 5px; font-size: small; } div.code-block-caption code { background-color: transparent; } table.highlighttable td.linenos, span.linenos, div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ user-select: none; } div.code-block-caption span.caption-number { padding: 0.1em 0.3em; font-style: italic; } div.code-block-caption span.caption-text { } div.literal-block-wrapper { margin: 1em 0; } code.descname { background-color: transparent; font-weight: bold; font-size: 1.2em; } code.descclassname { background-color: transparent; } code.xref, a code { background-color: transparent; font-weight: bold; } h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { background-color: transparent; } .viewcode-link { float: right; } .viewcode-back { float: right; font-family: sans-serif; } div.viewcode-block:target { margin: -1px -10px; padding: 0 10px; } /* -- math display ---------------------------------------------------------- */ img.math { vertical-align: middle; } div.body div.math p { text-align: center; } span.eqno { float: right; } span.eqno a.headerlink { position: absolute; z-index: 1; } div.math:hover a.headerlink { visibility: visible; } /* -- printout stylesheet --------------------------------------------------- */ @media print { div.document, div.documentwrapper, div.bodywrapper { margin: 0 !important; width: 100%; } div.sphinxsidebar, div.related, div.footer, #top-link { display: none; } }petsc4py-3.15.1/docs/usrman/_static/file.png0000644000175000017500000000043614062763246021103 0ustar balaybalay00000000000000PNG  IHDRaIDATxR){l ۶f=@ :3~箄rX$AX-D ~ lj(P%8<<9:: PO&$ l~X&EW^4wQ}^ͣ i0/H/@F)Dzq+j[SU5h/oY G&Lfs|{3%U+S`AFIENDB`petsc4py-3.15.1/docs/usrman/_static/language_data.js0000644000175000017500000002514614062764422022572 0ustar balaybalay00000000000000/* * language_data.js * ~~~~~~~~~~~~~~~~ * * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; /* Non-minified version is copied as a separate JS file, is available */ /** * Porter Stemmer */ var Stemmer = function() { var step2list = { ational: 'ate', tional: 'tion', enci: 'ence', anci: 'ance', izer: 'ize', bli: 'ble', alli: 'al', entli: 'ent', eli: 'e', ousli: 'ous', ization: 'ize', ation: 'ate', ator: 'ate', alism: 'al', iveness: 'ive', fulness: 'ful', ousness: 'ous', aliti: 'al', iviti: 'ive', biliti: 'ble', logi: 'log' }; var step3list = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' }; var c = "[^aeiou]"; // consonant var v = "[aeiouy]"; // vowel var C = c + "[^aeiouy]*"; // consonant sequence var V = v + "[aeiou]*"; // vowel sequence var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 var s_v = "^(" + C + ")?" + v; // vowel in stem this.stemWord = function (w) { var stem; var suffix; var firstch; var origword = w; if (w.length < 3) return w; var re; var re2; var re3; var re4; firstch = w.substr(0,1); if (firstch == "y") w = firstch.toUpperCase() + w.substr(1); // Step 1a re = /^(.+?)(ss|i)es$/; re2 = /^(.+?)([^s])s$/; if (re.test(w)) w = w.replace(re,"$1$2"); else if (re2.test(w)) w = w.replace(re2,"$1$2"); // Step 1b re = /^(.+?)eed$/; re2 = /^(.+?)(ed|ing)$/; if (re.test(w)) { var fp = re.exec(w); re = new RegExp(mgr0); if (re.test(fp[1])) { re = /.$/; w = w.replace(re,""); } } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1]; re2 = new RegExp(s_v); if (re2.test(stem)) { w = stem; re2 = /(at|bl|iz)$/; re3 = new RegExp("([^aeiouylsz])\\1$"); re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re2.test(w)) w = w + "e"; else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } else if (re4.test(w)) w = w + "e"; } } // Step 1c re = /^(.+?)y$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(s_v); if (re.test(stem)) w = stem + "i"; } // Step 2 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step2list[suffix]; } // Step 3 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); if (re.test(stem)) w = stem + step3list[suffix]; } // Step 4 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; re2 = /^(.+?)(s|t)(ion)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); if (re.test(stem)) w = stem; } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1] + fp[2]; re2 = new RegExp(mgr1); if (re2.test(stem)) w = stem; } // Step 5 re = /^(.+?)e$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); re2 = new RegExp(meq1); re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) w = stem; } re = /ll$/; re2 = new RegExp(mgr1); if (re.test(w) && re2.test(w)) { re = /.$/; w = w.replace(re,""); } // and turn initial Y back to y if (firstch == "y") w = firstch.toLowerCase() + w.substr(1); return w; } } var splitChars = (function() { var result = {}; var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; var i, j, start, end; for (i = 0; i < singles.length; i++) { result[singles[i]] = true; } var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; for (i = 0; i < ranges.length; i++) { start = ranges[i][0]; end = ranges[i][1]; for (j = start; j <= end; j++) { result[j] = true; } } return result; })(); function splitQuery(query) { var result = []; var start = -1; for (var i = 0; i < query.length; i++) { if (splitChars[query.charCodeAt(i)]) { if (start !== -1) { result.push(query.slice(start, i)); start = -1; } } else if (start === -1) { start = i; } } if (start !== -1) { result.push(query.slice(start)); } return result; } petsc4py-3.15.1/docs/usrman/_static/underscore.js0000644000175000017500000004563614062763246022200 0ustar balaybalay00000000000000!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n=n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ // Underscore.js 1.12.0 // https://underscorejs.org // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. var n="1.12.0",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,g=isFinite,d=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function $(n){return function(r){return null==r?void 0:r[n]}}var G=$("byteLength"),H=J(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:K(!1),Y=$("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},Kn=Ln(Cn),Jn=Ln(_n(Cn)),$n=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Gn=/(.)^/,Hn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qn=/\\|'|\r|\n|\u2028|\u2029/g;function Xn(n){return"\\"+Hn[n]}var Yn=0;function Zn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var nr=j((function(n,r){var t=nr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)er(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var cr=nr(fr,2);function lr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),C))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Fn(t,u,4),e,o)}}var wr=_r(1),Ar=_r(-1);function xr(n,r,t){var e=[];return r=qn(r,t),mr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Sr(n,r,t){r=qn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=0;o=0}var Er=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),jr(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Br(n,r){return jr(n,Rn(r))}function Nr(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ao&&(o=e);else r=qn(r,t),mr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Ir(n,r,t){if(null==r||t)return tr(n)||(n=jn(n)),n[Wn(n.length-1)];var e=tr(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Fn(e,r[1])),r=an(n)):(e=Pr,r=er(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=jr(er(r,!1,!1),String),e=function(n,t){return!Mr(r,t)}),qr(n,e,t)}));function Wr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function zr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:Wr(n,n.length-r)}function Lr(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=er(r,!0,!0),xr(n,(function(n){return!Mr(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o=function(r,t){e=null,t&&(u=n.apply(r,t))},i=j((function(i){if(e&&clearTimeout(e),t){var a=!e;e=setTimeout(o,r),a&&(u=n.apply(this,i))}else e=or(o,r,this,i);return u}));return i.cancel=function(){clearTimeout(e),e=null},i},wrap:function(n,r){return nr(r,n)},negate:ar,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:fr,once:cr,findKey:lr,findIndex:pr,findLastIndex:vr,sortedIndex:hr,indexOf:gr,lastIndexOf:dr,find:br,detect:br,findWhere:function(n,r){return br(n,Dn(r))},each:mr,forEach:mr,map:jr,collect:jr,reduce:wr,foldl:wr,inject:wr,reduceRight:Ar,foldr:Ar,filter:xr,select:xr,reject:function(n,r,t){return xr(n,ar(qn(r)),t)},every:Sr,all:Sr,some:Or,any:Or,contains:Mr,includes:Mr,include:Mr,invoke:Er,pluck:Br,where:function(n,r){return xr(n,Dn(r))},max:Nr,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t= 0 && sizeProperty <= MAX_ARRAY_INDEX; } } // Internal helper to generate a function to obtain property `key` from `obj`. function shallowProperty(key) { return function(obj) { return obj == null ? void 0 : obj[key]; }; } // Internal helper to obtain the `byteLength` property of an object. var getByteLength = shallowProperty('byteLength'); // Internal helper to determine whether we should spend extensive checks against // `ArrayBuffer` et al. var isBufferLike = createSizePropertyCheck(getByteLength); // Is a given value a typed array? var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; function isTypedArray(obj) { // `ArrayBuffer.isView` is the most future-proof, so use it when available. // Otherwise, fall back on the above regular expression. return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); } var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); // Internal helper to obtain the `length` property of an object. var getLength = shallowProperty('length'); // Internal helper to create a simple lookup structure. // `collectNonEnumProps` used to depend on `_.contains`, but this led to // circular imports. `emulatedSet` is a one-off solution that only works for // arrays of strings. function emulatedSet(keys) { var hash = {}; for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; return { contains: function(key) { return hash[key]; }, push: function(key) { hash[key] = true; return keys.push(key); } }; } // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't // be iterated by `for key in ...` and thus missed. Extends `keys` in place if // needed. function collectNonEnumProps(obj, keys) { keys = emulatedSet(keys); var nonEnumIdx = nonEnumerableProps.length; var constructor = obj.constructor; var proto = isFunction$1(constructor) && constructor.prototype || ObjProto; // Constructor is a special case. var prop = 'constructor'; if (has(obj, prop) && !keys.contains(prop)) keys.push(prop); while (nonEnumIdx--) { prop = nonEnumerableProps[nonEnumIdx]; if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { keys.push(prop); } } } // Retrieve the names of an object's own properties. // Delegates to **ECMAScript 5**'s native `Object.keys`. function keys(obj) { if (!isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) if (has(obj, key)) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; } // Is a given array, string, or object empty? // An "empty" object has no enumerable own-properties. function isEmpty(obj) { if (obj == null) return true; // Skip the more expensive `toString`-based type checks if `obj` has no // `.length`. var length = getLength(obj); if (typeof length == 'number' && ( isArray(obj) || isString(obj) || isArguments$1(obj) )) return length === 0; return getLength(keys(obj)) === 0; } // Returns whether an object has a given set of `key:value` pairs. function isMatch(object, attrs) { var _keys = keys(attrs), length = _keys.length; if (object == null) return !length; var obj = Object(object); for (var i = 0; i < length; i++) { var key = _keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return false; } return true; } // If Underscore is called as a function, it returns a wrapped object that can // be used OO-style. This wrapper holds altered versions of all functions added // through `_.mixin`. Wrapped objects may be chained. function _(obj) { if (obj instanceof _) return obj; if (!(this instanceof _)) return new _(obj); this._wrapped = obj; } _.VERSION = VERSION; // Extracts the result from a wrapped and chained object. _.prototype.value = function() { return this._wrapped; }; // Provide unwrapping proxies for some methods used in engine operations // such as arithmetic and JSON stringification. _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; _.prototype.toString = function() { return String(this._wrapped); }; // Internal function to wrap or shallow-copy an ArrayBuffer, // typed array or DataView to a new view, reusing the buffer. function toBufferView(bufferSource) { return new Uint8Array( bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, getByteLength(bufferSource) ); } // We use this string twice, so give it a name for minification. var tagDataView = '[object DataView]'; // Internal recursive comparison function for `_.isEqual`. function eq(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a === 1 / b; // `null` or `undefined` only equal to itself (strict comparison). if (a == null || b == null) return false; // `NaN`s are equivalent, but non-reflexive. if (a !== a) return b !== b; // Exhaust primitive checks var type = typeof a; if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; return deepEq(a, b, aStack, bStack); } // Internal recursive comparison function for `_.isEqual`. function deepEq(a, b, aStack, bStack) { // Unwrap any wrapped objects. if (a instanceof _) a = a._wrapped; if (b instanceof _) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); if (className !== toString.call(b)) return false; // Work around a bug in IE 10 - Edge 13. if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { if (!isDataView$1(b)) return false; className = tagDataView; } switch (className) { // These types are compared by value. case '[object RegExp]': // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. return '' + a === '' + b; case '[object Number]': // `NaN`s are equivalent, but non-reflexive. // Object(NaN) is equivalent to NaN. if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values. return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. return +a === +b; case '[object Symbol]': return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); case '[object ArrayBuffer]': case tagDataView: // Coerce to typed array so we can fall through. return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); } var areArrays = className === '[object Array]'; if (!areArrays && isTypedArray$1(a)) { var byteLength = getByteLength(a); if (byteLength !== getByteLength(b)) return false; if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; areArrays = true; } if (!areArrays) { if (typeof a != 'object' || typeof b != 'object') return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s // from different frames are. var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && isFunction$1(bCtor) && bCtor instanceof bCtor) && ('constructor' in a && 'constructor' in b)) { return false; } } // Assume equality for cyclic structures. The algorithm for detecting cyclic // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. // Initializing stack of traversed objects. // It's done here since we only need them for objects and arrays comparison. aStack = aStack || []; bStack = bStack || []; var length = aStack.length; while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. if (aStack[length] === a) return bStack[length] === b; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); // Recursively compare objects and arrays. if (areArrays) { // Compare array lengths to determine if a deep comparison is necessary. length = a.length; if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties. while (length--) { if (!eq(a[length], b[length], aStack, bStack)) return false; } } else { // Deep compare objects. var _keys = keys(a), key; length = _keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality. if (keys(b).length !== length) return false; while (length--) { // Deep compare each member key = _keys[length]; if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; } } // Remove the first object from the stack of traversed objects. aStack.pop(); bStack.pop(); return true; } // Perform a deep comparison to check if two objects are equal. function isEqual(a, b) { return eq(a, b); } // Retrieve all the enumerable property names of an object. function allKeys(obj) { if (!isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; } // Since the regular `Object.prototype.toString` type tests don't work for // some types in IE 11, we use a fingerprinting heuristic instead, based // on the methods. It's not great, but it's the best we got. // The fingerprint method lists are defined below. function ie11fingerprint(methods) { var length = getLength(methods); return function(obj) { if (obj == null) return false; // `Map`, `WeakMap` and `Set` have no enumerable keys. var keys = allKeys(obj); if (getLength(keys)) return false; for (var i = 0; i < length; i++) { if (!isFunction$1(obj[methods[i]])) return false; } // If we are testing against `WeakMap`, we need to ensure that // `obj` doesn't have a `forEach` method in order to distinguish // it from a regular `Map`. return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); }; } // In the interest of compact minification, we write // each string in the fingerprints only once. var forEachName = 'forEach', hasName = 'has', commonInit = ['clear', 'delete'], mapTail = ['get', hasName, 'set']; // `Map`, `WeakMap` and `Set` each have slightly different // combinations of the above sublists. var mapMethods = commonInit.concat(forEachName, mapTail), weakMapMethods = commonInit.concat(mapTail), setMethods = ['add'].concat(commonInit, forEachName, hasName); var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); var isWeakSet = tagTester('WeakSet'); // Retrieve the values of an object's properties. function values(obj) { var _keys = keys(obj); var length = _keys.length; var values = Array(length); for (var i = 0; i < length; i++) { values[i] = obj[_keys[i]]; } return values; } // Convert an object into a list of `[key, value]` pairs. // The opposite of `_.object` with one argument. function pairs(obj) { var _keys = keys(obj); var length = _keys.length; var pairs = Array(length); for (var i = 0; i < length; i++) { pairs[i] = [_keys[i], obj[_keys[i]]]; } return pairs; } // Invert the keys and values of an object. The values must be serializable. function invert(obj) { var result = {}; var _keys = keys(obj); for (var i = 0, length = _keys.length; i < length; i++) { result[obj[_keys[i]]] = _keys[i]; } return result; } // Return a sorted list of the function names available on the object. function functions(obj) { var names = []; for (var key in obj) { if (isFunction$1(obj[key])) names.push(key); } return names.sort(); } // An internal function for creating assigner functions. function createAssigner(keysFunc, defaults) { return function(obj) { var length = arguments.length; if (defaults) obj = Object(obj); if (length < 2 || obj == null) return obj; for (var index = 1; index < length; index++) { var source = arguments[index], keys = keysFunc(source), l = keys.length; for (var i = 0; i < l; i++) { var key = keys[i]; if (!defaults || obj[key] === void 0) obj[key] = source[key]; } } return obj; }; } // Extend a given object with all the properties in passed-in object(s). var extend = createAssigner(allKeys); // Assigns a given object with all the own properties in the passed-in // object(s). // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) var extendOwn = createAssigner(keys); // Fill in a given object with default properties. var defaults = createAssigner(allKeys, true); // Create a naked function reference for surrogate-prototype-swapping. function ctor() { return function(){}; } // An internal function for creating a new object that inherits from another. function baseCreate(prototype) { if (!isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); var Ctor = ctor(); Ctor.prototype = prototype; var result = new Ctor; Ctor.prototype = null; return result; } // Creates an object that inherits from the given prototype object. // If additional properties are provided then they will be added to the // created object. function create(prototype, props) { var result = baseCreate(prototype); if (props) extendOwn(result, props); return result; } // Create a (shallow-cloned) duplicate of an object. function clone(obj) { if (!isObject(obj)) return obj; return isArray(obj) ? obj.slice() : extend({}, obj); } // Invokes `interceptor` with the `obj` and then returns `obj`. // The primary purpose of this method is to "tap into" a method chain, in // order to perform operations on intermediate results within the chain. function tap(obj, interceptor) { interceptor(obj); return obj; } // Normalize a (deep) property `path` to array. // Like `_.iteratee`, this function can be customized. function toPath(path) { return isArray(path) ? path : [path]; } _.toPath = toPath; // Internal wrapper for `_.toPath` to enable minification. // Similar to `cb` for `_.iteratee`. function toPath$1(path) { return _.toPath(path); } // Internal function to obtain a nested property in `obj` along `path`. function deepGet(obj, path) { var length = path.length; for (var i = 0; i < length; i++) { if (obj == null) return void 0; obj = obj[path[i]]; } return length ? obj : void 0; } // Get the value of the (deep) property on `path` from `object`. // If any property in `path` does not exist or if the value is // `undefined`, return `defaultValue` instead. // The `path` is normalized through `_.toPath`. function get(object, path, defaultValue) { var value = deepGet(object, toPath$1(path)); return isUndefined(value) ? defaultValue : value; } // Shortcut function for checking if an object has a given property directly on // itself (in other words, not on a prototype). Unlike the internal `has` // function, this public version can also traverse nested properties. function has$1(obj, path) { path = toPath$1(path); var length = path.length; for (var i = 0; i < length; i++) { var key = path[i]; if (!has(obj, key)) return false; obj = obj[key]; } return !!length; } // Keep the identity function around for default iteratees. function identity(value) { return value; } // Returns a predicate for checking whether an object has a given set of // `key:value` pairs. function matcher(attrs) { attrs = extendOwn({}, attrs); return function(obj) { return isMatch(obj, attrs); }; } // Creates a function that, when passed an object, will traverse that object’s // properties down the given `path`, specified as an array of keys or indices. function property(path) { path = toPath$1(path); return function(obj) { return deepGet(obj, path); }; } // Internal function that returns an efficient (for current engines) version // of the passed-in callback, to be repeatedly applied in other Underscore // functions. function optimizeCb(func, context, argCount) { if (context === void 0) return func; switch (argCount == null ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; // The 2-argument case is omitted because we’re not using it. case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; } // An internal function to generate callbacks that can be applied to each // element in a collection, returning the desired result — either `_.identity`, // an arbitrary callback, a property matcher, or a property accessor. function baseIteratee(value, context, argCount) { if (value == null) return identity; if (isFunction$1(value)) return optimizeCb(value, context, argCount); if (isObject(value) && !isArray(value)) return matcher(value); return property(value); } // External wrapper for our callback generator. Users may customize // `_.iteratee` if they want additional predicate/iteratee shorthand styles. // This abstraction hides the internal-only `argCount` argument. function iteratee(value, context) { return baseIteratee(value, context, Infinity); } _.iteratee = iteratee; // The function we call internally to generate a callback. It invokes // `_.iteratee` if overridden, otherwise `baseIteratee`. function cb(value, context, argCount) { if (_.iteratee !== iteratee) return _.iteratee(value, context); return baseIteratee(value, context, argCount); } // Returns the results of applying the `iteratee` to each element of `obj`. // In contrast to `_.map` it returns an object. function mapObject(obj, iteratee, context) { iteratee = cb(iteratee, context); var _keys = keys(obj), length = _keys.length, results = {}; for (var index = 0; index < length; index++) { var currentKey = _keys[index]; results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } return results; } // Predicate-generating function. Often useful outside of Underscore. function noop(){} // Generates a function for a given object that returns a given property. function propertyOf(obj) { if (obj == null) return noop; return function(path) { return get(obj, path); }; } // Run a function **n** times. function times(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; } // Return a random integer between `min` and `max` (inclusive). function random(min, max) { if (max == null) { max = min; min = 0; } return min + Math.floor(Math.random() * (max - min + 1)); } // A (possibly faster) way to get the current timestamp as an integer. var now = Date.now || function() { return new Date().getTime(); }; // Internal helper to generate functions for escaping and unescaping strings // to/from HTML interpolation. function createEscaper(map) { var escaper = function(match) { return map[match]; }; // Regexes for identifying a key that needs to be escaped. var source = '(?:' + keys(map).join('|') + ')'; var testRegexp = RegExp(source); var replaceRegexp = RegExp(source, 'g'); return function(string) { string = string == null ? '' : '' + string; return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; } // Internal list of HTML entities for escaping. var escapeMap = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '`': '`' }; // Function for escaping strings to HTML interpolation. var _escape = createEscaper(escapeMap); // Internal list of HTML entities for unescaping. var unescapeMap = invert(escapeMap); // Function for unescaping strings from HTML interpolation. var _unescape = createEscaper(unescapeMap); // By default, Underscore uses ERB-style template delimiters. Change the // following template settings to use alternative delimiters. var templateSettings = _.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; // When customizing `_.templateSettings`, if you don't want to define an // interpolation, evaluation or escaping regex, we need one that is // guaranteed not to match. var noMatch = /(.)^/; // Certain characters need to be escaped so that they can be put into a // string literal. var escapes = { "'": "'", '\\': '\\', '\r': 'r', '\n': 'n', '\u2028': 'u2028', '\u2029': 'u2029' }; var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; function escapeChar(match) { return '\\' + escapes[match]; } // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. // NB: `oldSettings` only exists for backwards compatibility. function template(text, settings, oldSettings) { if (!settings && oldSettings) settings = oldSettings; settings = defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join('|') + '|$', 'g'); // Compile the template source, escaping string literals appropriately. var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { source += text.slice(index, offset).replace(escapeRegExp, escapeChar); index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } // Adobe VMs need the match returned to produce the correct offset. return match; }); source += "';\n"; // If a variable is not specified, place data values in local scope. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + 'return __p;\n'; var render; try { render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; } var template = function(data) { return render.call(this, data, _); }; // Provide the compiled source as a convenience for precompilation. var argument = settings.variable || 'obj'; template.source = 'function(' + argument + '){\n' + source + '}'; return template; } // Traverses the children of `obj` along `path`. If a child is a function, it // is invoked with its parent as context. Returns the value of the final // child, or `fallback` if any child is undefined. function result(obj, path, fallback) { path = toPath$1(path); var length = path.length; if (!length) { return isFunction$1(fallback) ? fallback.call(obj) : fallback; } for (var i = 0; i < length; i++) { var prop = obj == null ? void 0 : obj[path[i]]; if (prop === void 0) { prop = fallback; i = length; // Ensure we don't continue iterating. } obj = isFunction$1(prop) ? prop.call(obj) : prop; } return obj; } // Generate a unique integer id (unique within the entire client session). // Useful for temporary DOM ids. var idCounter = 0; function uniqueId(prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; } // Start chaining a wrapped Underscore object. function chain(obj) { var instance = _(obj); instance._chain = true; return instance; } // Internal function to execute `sourceFunc` bound to `context` with optional // `args`. Determines whether to execute a function as a constructor or as a // normal function. function executeBound(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype); var result = sourceFunc.apply(self, args); if (isObject(result)) return result; return self; } // Partially apply a function by creating a version that has had some of its // arguments pre-filled, without changing its dynamic `this` context. `_` acts // as a placeholder by default, allowing any combination of arguments to be // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. var partial = restArguments(function(func, boundArgs) { var placeholder = partial.placeholder; var bound = function() { var position = 0, length = boundArgs.length; var args = Array(length); for (var i = 0; i < length; i++) { args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; } while (position < arguments.length) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; }); partial.placeholder = _; // Create a function bound to a given object (assigning `this`, and arguments, // optionally). var bind = restArguments(function(func, context, args) { if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); var bound = restArguments(function(callArgs) { return executeBound(func, bound, context, this, args.concat(callArgs)); }); return bound; }); // Internal helper for collection methods to determine whether a collection // should be iterated as an array or as an object. // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 var isArrayLike = createSizePropertyCheck(getLength); // Internal implementation of a recursive `flatten` function. function flatten(input, depth, strict, output) { output = output || []; if (!depth && depth !== 0) { depth = Infinity; } else if (depth <= 0) { return output.concat(input); } var idx = output.length; for (var i = 0, length = getLength(input); i < length; i++) { var value = input[i]; if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { // Flatten current level of array or arguments object. if (depth > 1) { flatten(value, depth - 1, strict, output); idx = output.length; } else { var j = 0, len = value.length; while (j < len) output[idx++] = value[j++]; } } else if (!strict) { output[idx++] = value; } } return output; } // Bind a number of an object's methods to that object. Remaining arguments // are the method names to be bound. Useful for ensuring that all callbacks // defined on an object belong to it. var bindAll = restArguments(function(obj, keys) { keys = flatten(keys, false, false); var index = keys.length; if (index < 1) throw new Error('bindAll must be passed function names'); while (index--) { var key = keys[index]; obj[key] = bind(obj[key], obj); } return obj; }); // Memoize an expensive function by storing its results. function memoize(func, hasher) { var memoize = function(key) { var cache = memoize.cache; var address = '' + (hasher ? hasher.apply(this, arguments) : key); if (!has(cache, address)) cache[address] = func.apply(this, arguments); return cache[address]; }; memoize.cache = {}; return memoize; } // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. var delay = restArguments(function(func, wait, args) { return setTimeout(function() { return func.apply(null, args); }, wait); }); // Defers a function, scheduling it to run after the current call stack has // cleared. var defer = partial(delay, _, 1); // Returns a function, that, when invoked, will only be triggered at most once // during a given window of time. Normally, the throttled function will run // as much as it can, without ever going more than once per `wait` duration; // but if you'd like to disable the execution on the leading edge, pass // `{leading: false}`. To disable execution on the trailing edge, ditto. function throttle(func, wait, options) { var timeout, context, args, result; var previous = 0; if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : now(); timeout = null; result = func.apply(context, args); if (!timeout) context = args = null; }; var throttled = function() { var _now = now(); if (!previous && options.leading === false) previous = _now; var remaining = wait - (_now - previous); context = this; args = arguments; if (remaining <= 0 || remaining > wait) { if (timeout) { clearTimeout(timeout); timeout = null; } previous = _now; result = func.apply(context, args); if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; throttled.cancel = function() { clearTimeout(timeout); previous = 0; timeout = context = args = null; }; return throttled; } // When a sequence of calls of the returned function ends, the argument // function is triggered. The end of a sequence is defined by the `wait` // parameter. If `immediate` is passed, the argument function will be // triggered at the beginning of the sequence instead of at the end. function debounce(func, wait, immediate) { var timeout, previous, args, result, context; var later = function() { var passed = now() - previous; if (wait > passed) { timeout = setTimeout(later, wait - passed); } else { timeout = null; if (!immediate) result = func.apply(context, args); // This check is needed because `func` can recursively invoke `debounced`. if (!timeout) args = context = null; } }; var debounced = restArguments(function(_args) { context = this; args = _args; previous = now(); if (!timeout) { timeout = setTimeout(later, wait); if (immediate) result = func.apply(context, args); } return result; }); debounced.cancel = function() { clearTimeout(timeout); timeout = args = context = null; }; return debounced; } // Returns the first function passed as an argument to the second, // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. function wrap(func, wrapper) { return partial(wrapper, func); } // Returns a negated version of the passed-in predicate. function negate(predicate) { return function() { return !predicate.apply(this, arguments); }; } // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. function compose() { var args = arguments; var start = args.length - 1; return function() { var i = start; var result = args[start].apply(this, arguments); while (i--) result = args[i].call(this, result); return result; }; } // Returns a function that will only be executed on and after the Nth call. function after(times, func) { return function() { if (--times < 1) { return func.apply(this, arguments); } }; } // Returns a function that will only be executed up to (but not including) the // Nth call. function before(times, func) { var memo; return function() { if (--times > 0) { memo = func.apply(this, arguments); } if (times <= 1) func = null; return memo; }; } // Returns a function that will be executed at most one time, no matter how // often you call it. Useful for lazy initialization. var once = partial(before, 2); // Returns the first key on an object that passes a truth test. function findKey(obj, predicate, context) { predicate = cb(predicate, context); var _keys = keys(obj), key; for (var i = 0, length = _keys.length; i < length; i++) { key = _keys[i]; if (predicate(obj[key], key, obj)) return key; } } // Internal function to generate `_.findIndex` and `_.findLastIndex`. function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, array)) return index; } return -1; }; } // Returns the first index on an array-like that passes a truth test. var findIndex = createPredicateIndexFinder(1); // Returns the last index on an array-like that passes a truth test. var findLastIndex = createPredicateIndexFinder(-1); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. function sortedIndex(array, obj, iteratee, context) { iteratee = cb(iteratee, context, 1); var value = iteratee(obj); var low = 0, high = getLength(array); while (low < high) { var mid = Math.floor((low + high) / 2); if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; } // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; } } else if (sortedIndex && idx && length) { idx = sortedIndex(array, item); return array[idx] === item ? idx : -1; } if (item !== item) { idx = predicateFind(slice.call(array, i, length), isNaN$1); return idx >= 0 ? idx + i : -1; } for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { if (array[idx] === item) return idx; } return -1; }; } // Return the position of the first occurrence of an item in an array, // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. var indexOf = createIndexFinder(1, findIndex, sortedIndex); // Return the position of the last occurrence of an item in an array, // or -1 if the item is not included in the array. var lastIndexOf = createIndexFinder(-1, findLastIndex); // Return the first value which passes a truth test. function find(obj, predicate, context) { var keyFinder = isArrayLike(obj) ? findIndex : findKey; var key = keyFinder(obj, predicate, context); if (key !== void 0 && key !== -1) return obj[key]; } // Convenience version of a common use case of `_.find`: getting the first // object containing specific `key:value` pairs. function findWhere(obj, attrs) { return find(obj, matcher(attrs)); } // The cornerstone for collection functions, an `each` // implementation, aka `forEach`. // Handles raw objects in addition to array-likes. Treats all // sparse array-likes as if they were dense. function each(obj, iteratee, context) { iteratee = optimizeCb(iteratee, context); var i, length; if (isArrayLike(obj)) { for (i = 0, length = obj.length; i < length; i++) { iteratee(obj[i], i, obj); } } else { var _keys = keys(obj); for (i = 0, length = _keys.length; i < length; i++) { iteratee(obj[_keys[i]], _keys[i], obj); } } return obj; } // Return the results of applying the iteratee to each element. function map(obj, iteratee, context) { iteratee = cb(iteratee, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, results = Array(length); for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; } // Internal helper to create a reducing function, iterating left or right. function createReduce(dir) { // Wrap code that reassigns argument variables in a separate function than // the one that accesses `arguments.length` to avoid a perf hit. (#1991) var reducer = function(obj, iteratee, memo, initial) { var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, index = dir > 0 ? 0 : length - 1; if (!initial) { memo = obj[_keys ? _keys[index] : index]; index += dir; } for (; index >= 0 && index < length; index += dir) { var currentKey = _keys ? _keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }; return function(obj, iteratee, memo, context) { var initial = arguments.length >= 3; return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); }; } // **Reduce** builds up a single result from a list of values, aka `inject`, // or `foldl`. var reduce = createReduce(1); // The right-associative version of reduce, also known as `foldr`. var reduceRight = createReduce(-1); // Return all the elements that pass a truth test. function filter(obj, predicate, context) { var results = []; predicate = cb(predicate, context); each(obj, function(value, index, list) { if (predicate(value, index, list)) results.push(value); }); return results; } // Return all the elements for which a truth test fails. function reject(obj, predicate, context) { return filter(obj, negate(cb(predicate)), context); } // Determine whether all of the elements pass a truth test. function every(obj, predicate, context) { predicate = cb(predicate, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return false; } return true; } // Determine if at least one element in the object passes a truth test. function some(obj, predicate, context) { predicate = cb(predicate, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return true; } return false; } // Determine if the array or object contains a given item (using `===`). function contains(obj, item, fromIndex, guard) { if (!isArrayLike(obj)) obj = values(obj); if (typeof fromIndex != 'number' || guard) fromIndex = 0; return indexOf(obj, item, fromIndex) >= 0; } // Invoke a method (with arguments) on every item in a collection. var invoke = restArguments(function(obj, path, args) { var contextPath, func; if (isFunction$1(path)) { func = path; } else { path = toPath$1(path); contextPath = path.slice(0, -1); path = path[path.length - 1]; } return map(obj, function(context) { var method = func; if (!method) { if (contextPath && contextPath.length) { context = deepGet(context, contextPath); } if (context == null) return void 0; method = context[path]; } return method == null ? method : method.apply(context, args); }); }); // Convenience version of a common use case of `_.map`: fetching a property. function pluck(obj, key) { return map(obj, property(key)); } // Convenience version of a common use case of `_.filter`: selecting only // objects containing specific `key:value` pairs. function where(obj, attrs) { return filter(obj, matcher(attrs)); } // Return the maximum element (or element-based computation). function max(obj, iteratee, context) { var result = -Infinity, lastComputed = -Infinity, value, computed; if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value != null && value > result) { result = value; } } } else { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); if (computed > lastComputed || computed === -Infinity && result === -Infinity) { result = v; lastComputed = computed; } }); } return result; } // Return the minimum element (or element-based computation). function min(obj, iteratee, context) { var result = Infinity, lastComputed = Infinity, value, computed; if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value != null && value < result) { result = value; } } } else { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); if (computed < lastComputed || computed === Infinity && result === Infinity) { result = v; lastComputed = computed; } }); } return result; } // Sample **n** random values from a collection using the modern version of the // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). // If **n** is not specified, returns a single random element. // The internal `guard` argument allows it to work with `_.map`. function sample(obj, n, guard) { if (n == null || guard) { if (!isArrayLike(obj)) obj = values(obj); return obj[random(obj.length - 1)]; } var sample = isArrayLike(obj) ? clone(obj) : values(obj); var length = getLength(sample); n = Math.max(Math.min(n, length), 0); var last = length - 1; for (var index = 0; index < n; index++) { var rand = random(index, last); var temp = sample[index]; sample[index] = sample[rand]; sample[rand] = temp; } return sample.slice(0, n); } // Shuffle a collection. function shuffle(obj) { return sample(obj, Infinity); } // Sort the object's values by a criterion produced by an iteratee. function sortBy(obj, iteratee, context) { var index = 0; iteratee = cb(iteratee, context); return pluck(map(obj, function(value, key, list) { return { value: value, index: index++, criteria: iteratee(value, key, list) }; }).sort(function(left, right) { var a = left.criteria; var b = right.criteria; if (a !== b) { if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } return left.index - right.index; }), 'value'); } // An internal function used for aggregate "group by" operations. function group(behavior, partition) { return function(obj, iteratee, context) { var result = partition ? [[], []] : {}; iteratee = cb(iteratee, context); each(obj, function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); }); return result; }; } // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. var groupBy = group(function(result, value, key) { if (has(result, key)) result[key].push(value); else result[key] = [value]; }); // Indexes the object's values by a criterion, similar to `_.groupBy`, but for // when you know that your index values will be unique. var indexBy = group(function(result, value, key) { result[key] = value; }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. var countBy = group(function(result, value, key) { if (has(result, key)) result[key]++; else result[key] = 1; }); // Split a collection into two arrays: one whose elements all pass the given // truth test, and one whose elements all do not pass the truth test. var partition = group(function(result, value, pass) { result[pass ? 0 : 1].push(value); }, true); // Safely create a real, live array from anything iterable. var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; function toArray(obj) { if (!obj) return []; if (isArray(obj)) return slice.call(obj); if (isString(obj)) { // Keep surrogate pair characters together. return obj.match(reStrSymbol); } if (isArrayLike(obj)) return map(obj, identity); return values(obj); } // Return the number of elements in a collection. function size(obj) { if (obj == null) return 0; return isArrayLike(obj) ? obj.length : keys(obj).length; } // Internal `_.pick` helper function to determine whether `key` is an enumerable // property name of `obj`. function keyInObj(value, key, obj) { return key in obj; } // Return a copy of the object only containing the allowed properties. var pick = restArguments(function(obj, keys) { var result = {}, iteratee = keys[0]; if (obj == null) return result; if (isFunction$1(iteratee)) { if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); keys = allKeys(obj); } else { iteratee = keyInObj; keys = flatten(keys, false, false); obj = Object(obj); } for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i]; var value = obj[key]; if (iteratee(value, key, obj)) result[key] = value; } return result; }); // Return a copy of the object without the disallowed properties. var omit = restArguments(function(obj, keys) { var iteratee = keys[0], context; if (isFunction$1(iteratee)) { iteratee = negate(iteratee); if (keys.length > 1) context = keys[1]; } else { keys = map(flatten(keys, false, false), String); iteratee = function(value, key) { return !contains(keys, key); }; } return pick(obj, iteratee, context); }); // Returns everything but the last entry of the array. Especially useful on // the arguments object. Passing **n** will return all the values in // the array, excluding the last N. function initial(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); } // Get the first element of an array. Passing **n** will return the first N // values in the array. The **guard** check allows it to work with `_.map`. function first(array, n, guard) { if (array == null || array.length < 1) return n == null || guard ? void 0 : []; if (n == null || guard) return array[0]; return initial(array, array.length - n); } // Returns everything but the first entry of the `array`. Especially useful on // the `arguments` object. Passing an **n** will return the rest N values in the // `array`. function rest(array, n, guard) { return slice.call(array, n == null || guard ? 1 : n); } // Get the last element of an array. Passing **n** will return the last N // values in the array. function last(array, n, guard) { if (array == null || array.length < 1) return n == null || guard ? void 0 : []; if (n == null || guard) return array[array.length - 1]; return rest(array, Math.max(0, array.length - n)); } // Trim out all falsy values from an array. function compact(array) { return filter(array, Boolean); } // Flatten out an array, either recursively (by default), or up to `depth`. // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. function flatten$1(array, depth) { return flatten(array, depth, false); } // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. var difference = restArguments(function(array, rest) { rest = flatten(rest, true, true); return filter(array, function(value){ return !contains(rest, value); }); }); // Return a version of the array that does not contain the specified value(s). var without = restArguments(function(array, otherArrays) { return difference(array, otherArrays); }); // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // The faster algorithm will not work with an iteratee if the iteratee // is not a one-to-one function, so providing an iteratee will disable // the faster algorithm. function uniq(array, isSorted, iteratee, context) { if (!isBoolean(isSorted)) { context = iteratee; iteratee = isSorted; isSorted = false; } if (iteratee != null) iteratee = cb(iteratee, context); var result = []; var seen = []; for (var i = 0, length = getLength(array); i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; if (isSorted && !iteratee) { if (!i || seen !== computed) result.push(value); seen = computed; } else if (iteratee) { if (!contains(seen, computed)) { seen.push(computed); result.push(value); } } else if (!contains(result, value)) { result.push(value); } } return result; } // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. var union = restArguments(function(arrays) { return uniq(flatten(arrays, true, true)); }); // Produce an array that contains every item shared between all the // passed-in arrays. function intersection(array) { var result = []; var argsLength = arguments.length; for (var i = 0, length = getLength(array); i < length; i++) { var item = array[i]; if (contains(result, item)) continue; var j; for (j = 1; j < argsLength; j++) { if (!contains(arguments[j], item)) break; } if (j === argsLength) result.push(item); } return result; } // Complement of zip. Unzip accepts an array of arrays and groups // each array's elements on shared indices. function unzip(array) { var length = array && max(array, getLength).length || 0; var result = Array(length); for (var index = 0; index < length; index++) { result[index] = pluck(array, index); } return result; } // Zip together multiple lists into a single array -- elements that share // an index go together. var zip = restArguments(unzip); // Converts lists into objects. Pass either a single array of `[key, value]` // pairs, or two parallel arrays of the same length -- one of keys, and one of // the corresponding values. Passing by pairs is the reverse of `_.pairs`. function object(list, values) { var result = {}; for (var i = 0, length = getLength(list); i < length; i++) { if (values) { result[list[i]] = values[i]; } else { result[list[i][0]] = list[i][1]; } } return result; } // Generate an integer Array containing an arithmetic progression. A port of // the native Python `range()` function. See // [the Python documentation](https://docs.python.org/library/functions.html#range). function range(start, stop, step) { if (stop == null) { stop = start || 0; start = 0; } if (!step) { step = stop < start ? -1 : 1; } var length = Math.max(Math.ceil((stop - start) / step), 0); var range = Array(length); for (var idx = 0; idx < length; idx++, start += step) { range[idx] = start; } return range; } // Chunk a single array into multiple arrays, each containing `count` or fewer // items. function chunk(array, count) { if (count == null || count < 1) return []; var result = []; var i = 0, length = array.length; while (i < length) { result.push(slice.call(array, i, i += count)); } return result; } // Helper function to continue chaining intermediate results. function chainResult(instance, obj) { return instance._chain ? _(obj).chain() : obj; } // Add your own custom functions to the Underscore object. function mixin(obj) { each(functions(obj), function(name) { var func = _[name] = obj[name]; _.prototype[name] = function() { var args = [this._wrapped]; push.apply(args, arguments); return chainResult(this, func.apply(_, args)); }; }); return _; } // Add all mutator `Array` functions to the wrapper. each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; if (obj != null) { method.apply(obj, arguments); if ((name === 'shift' || name === 'splice') && obj.length === 0) { delete obj[0]; } } return chainResult(this, obj); }; }); // Add all accessor `Array` functions to the wrapper. each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; if (obj != null) obj = method.apply(obj, arguments); return chainResult(this, obj); }; }); // Named Exports var allExports = { __proto__: null, VERSION: VERSION, restArguments: restArguments, isObject: isObject, isNull: isNull, isUndefined: isUndefined, isBoolean: isBoolean, isElement: isElement, isString: isString, isNumber: isNumber, isDate: isDate, isRegExp: isRegExp, isError: isError, isSymbol: isSymbol, isArrayBuffer: isArrayBuffer, isDataView: isDataView$1, isArray: isArray, isFunction: isFunction$1, isArguments: isArguments$1, isFinite: isFinite$1, isNaN: isNaN$1, isTypedArray: isTypedArray$1, isEmpty: isEmpty, isMatch: isMatch, isEqual: isEqual, isMap: isMap, isWeakMap: isWeakMap, isSet: isSet, isWeakSet: isWeakSet, keys: keys, allKeys: allKeys, values: values, pairs: pairs, invert: invert, functions: functions, methods: functions, extend: extend, extendOwn: extendOwn, assign: extendOwn, defaults: defaults, create: create, clone: clone, tap: tap, get: get, has: has$1, mapObject: mapObject, identity: identity, constant: constant, noop: noop, toPath: toPath, property: property, propertyOf: propertyOf, matcher: matcher, matches: matcher, times: times, random: random, now: now, escape: _escape, unescape: _unescape, templateSettings: templateSettings, template: template, result: result, uniqueId: uniqueId, chain: chain, iteratee: iteratee, partial: partial, bind: bind, bindAll: bindAll, memoize: memoize, delay: delay, defer: defer, throttle: throttle, debounce: debounce, wrap: wrap, negate: negate, compose: compose, after: after, before: before, once: once, findKey: findKey, findIndex: findIndex, findLastIndex: findLastIndex, sortedIndex: sortedIndex, indexOf: indexOf, lastIndexOf: lastIndexOf, find: find, detect: find, findWhere: findWhere, each: each, forEach: each, map: map, collect: map, reduce: reduce, foldl: reduce, inject: reduce, reduceRight: reduceRight, foldr: reduceRight, filter: filter, select: filter, reject: reject, every: every, all: every, some: some, any: some, contains: contains, includes: contains, include: contains, invoke: invoke, pluck: pluck, where: where, max: max, min: min, shuffle: shuffle, sample: sample, sortBy: sortBy, groupBy: groupBy, indexBy: indexBy, countBy: countBy, partition: partition, toArray: toArray, size: size, pick: pick, omit: omit, first: first, head: first, take: first, initial: initial, last: last, rest: rest, tail: rest, drop: rest, compact: compact, flatten: flatten$1, without: without, uniq: uniq, unique: uniq, union: union, intersection: intersection, difference: difference, unzip: unzip, transpose: unzip, zip: zip, object: object, range: range, chunk: chunk, mixin: mixin, 'default': _ }; // Default Export // Add all of the Underscore functions to the wrapper object. var _$1 = mixin(allExports); // Legacy Node.js API. _$1._ = _$1; return _$1; }))); //# sourceMappingURL=underscore.js.map petsc4py-3.15.1/docs/usrman/_static/jquery-3.5.1.js0000644000175000017500000106161614062763246022005 0ustar balaybalay00000000000000/*! * jQuery JavaScript Library v3.5.1 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2020-05-04T22:49Z */ ( function( global, factory ) { "use strict"; if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common // enough that all such attempts are guarded in a try block. "use strict"; var arr = []; var getProto = Object.getPrototypeOf; var slice = arr.slice; var flat = arr.flat ? function( array ) { return arr.flat.call( array ); } : function( array ) { return arr.concat.apply( [], array ); }; var push = arr.push; var indexOf = arr.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var fnToString = hasOwn.toString; var ObjectFunctionString = fnToString.call( Object ); var support = {}; var isFunction = function isFunction( obj ) { // Support: Chrome <=57, Firefox <=52 // In some browsers, typeof returns "function" for HTML elements // (i.e., `typeof document.createElement( "object" ) === "function"`). // We don't want to classify *any* DOM node as a function. return typeof obj === "function" && typeof obj.nodeType !== "number"; }; var isWindow = function isWindow( obj ) { return obj != null && obj === obj.window; }; var document = window.document; var preservedScriptAttributes = { type: true, src: true, nonce: true, noModule: true }; function DOMEval( code, node, doc ) { doc = doc || document; var i, val, script = doc.createElement( "script" ); script.text = code; if ( node ) { for ( i in preservedScriptAttributes ) { // Support: Firefox 64+, Edge 18+ // Some browsers don't support the "nonce" property on scripts. // On the other hand, just using `getAttribute` is not enough as // the `nonce` attribute is reset to an empty string whenever it // becomes browsing-context connected. // See https://github.com/whatwg/html/issues/2369 // See https://html.spec.whatwg.org/#nonce-attributes // The `node.getAttribute` check was added for the sake of // `jQuery.globalEval` so that it can fake a nonce-containing node // via an object. val = node[ i ] || node.getAttribute && node.getAttribute( i ); if ( val ) { script.setAttribute( i, val ); } } } doc.head.appendChild( script ).parentNode.removeChild( script ); } function toType( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android <=2.3 only (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; } /* global Symbol */ // Defining this global in .eslintrc.json would create a danger of using the global // unguarded in another place, it seems safer to define global only for this module var version = "3.5.1", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { // Return all the elements in a clean array if ( num == null ) { return slice.call( this ); } // Return just the one element from the set return num < 0 ? this[ num + this.length ] : this[ num ]; }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. each: function( callback ) { return jQuery.each( this, callback ); }, map: function( callback ) { return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); } ) ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, even: function() { return this.pushStack( jQuery.grep( this, function( _elem, i ) { return ( i + 1 ) % 2; } ) ); }, odd: function() { return this.pushStack( jQuery.grep( this, function( _elem, i ) { return i % 2; } ) ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { return this.prevObject || this.constructor(); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: arr.sort, splice: arr.splice }; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // Skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !isFunction( target ) ) { target = {}; } // Extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( ( options = arguments[ i ] ) != null ) { // Extend the base object for ( name in options ) { copy = options[ name ]; // Prevent Object.prototype pollution // Prevent never-ending loop if ( name === "__proto__" || target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = Array.isArray( copy ) ) ) ) { src = target[ name ]; // Ensure proper type for the source value if ( copyIsArray && !Array.isArray( src ) ) { clone = []; } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { clone = {}; } else { clone = src; } copyIsArray = false; // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend( { // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, isPlainObject: function( obj ) { var proto, Ctor; // Detect obvious negatives // Use toString instead of jQuery.type to catch host objects if ( !obj || toString.call( obj ) !== "[object Object]" ) { return false; } proto = getProto( obj ); // Objects with no prototype (e.g., `Object.create( null )`) are plain if ( !proto ) { return true; } // Objects with prototype are plain iff they were constructed by a global Object function Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, // Evaluates a script in a provided context; falls back to the global one // if not specified. globalEval: function( code, options, doc ) { DOMEval( code, { nonce: options && options.nonce }, doc ); }, each: function( obj, callback ) { var length, i = 0; if ( isArrayLike( obj ) ) { length = obj.length; for ( ; i < length; i++ ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } else { for ( i in obj ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } return obj; }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { return arr == null ? -1 : indexOf.call( arr, elem, i ); }, // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; for ( ; j < len; j++ ) { first[ i++ ] = second[ j ]; } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var length, value, i = 0, ret = []; // Go through the array, translating each of the items to their new values if ( isArrayLike( elems ) ) { length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return flat( ret ); }, // A global GUID counter for objects guid: 1, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support } ); if ( typeof Symbol === "function" ) { jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; } // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( _i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function isArrayLike( obj ) { // Support: real iOS 8.2 only (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE var length = !!obj && "length" in obj && obj.length, type = toType( obj ); if ( isFunction( obj ) || isWindow( obj ) ) { return false; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.3.5 * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://js.foundation/ * * Date: 2020-03-14 */ ( function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // Instance methods hasOwn = ( {} ).hasOwnProperty, arr = [], pop = arr.pop, pushNative = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // https://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[ i ] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + "ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] // or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rdescend = new RegExp( whitespace + "|>" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + identifier + ")" ), "CLASS": new RegExp( "^\\.(" + identifier + ")" ), "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rhtml = /HTML$/i, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, // CSS escapes // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), funescape = function( escape, nonHex ) { var high = "0x" + escape.slice( 1 ) - 0x10000; return nonHex ? // Strip the backslash prefix from a non-hex escape sequence nonHex : // Replace a hexadecimal escape sequence with the encoded Unicode code point // Support: IE <=11+ // For values outside the Basic Multilingual Plane (BMP), manually construct a // surrogate pair high < 0 ? String.fromCharCode( high + 0x10000 ) : String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // CSS string/identifier serialization // https://drafts.csswg.org/cssom/#common-serializing-idioms rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, fcssescape = function( ch, asCodePoint ) { if ( asCodePoint ) { // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER if ( ch === "\0" ) { return "\uFFFD"; } // Control characters and (dependent upon position) numbers get escaped as code points return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } // Other potentially-special ASCII characters get backslash-escaped return "\\" + ch; }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }, inDisabledFieldset = addCombinator( function( elem ) { return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; }, { dir: "parentNode", next: "legend" } ); // Optimize for push.apply( _, NodeList ) try { push.apply( ( arr = slice.call( preferredDoc.childNodes ) ), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply // eslint-disable-next-line no-unused-expressions arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { pushNative.apply( target, slice.call( els ) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( ( target[ j++ ] = els[ i++ ] ) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, // nodeType defaults to 9, since context defaults to document nodeType = context ? context.nodeType : 9; results = results || []; // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { setDocument( context ); context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { // ID selector if ( ( m = match[ 1 ] ) ) { // Document context if ( nodeType === 9 ) { if ( ( elem = context.getElementById( m ) ) ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } // Element context } else { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && ( elem = newContext.getElementById( m ) ) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Type selector } else if ( match[ 2 ] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll if ( support.qsa && !nonnativeSelectorCache[ selector + " " ] && ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && // Support: IE 8 only // Exclude object elements ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { newSelector = selector; newContext = context; // qSA considers elements outside a scoping root when evaluating child or // descendant combinators, which is not what we want. // In such cases, we work around the behavior by prefixing every selector in the // list with an ID selector referencing the scope context. // The technique has to be used as well when a leading combinator is used // as such selectors are not recognized by querySelectorAll. // Thanks to Andrew Dupont for this technique. if ( nodeType === 1 && ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; // We can use :scope instead of the ID hack if the browser // supports it & if we're not changing the context. if ( newContext !== context || !support.scope ) { // Capture the context ID, setting it first if necessary if ( ( nid = context.getAttribute( "id" ) ) ) { nid = nid.replace( rcssescape, fcssescape ); } else { context.setAttribute( "id", ( nid = expando ) ); } } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; while ( i-- ) { groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + toSelector( groups[ i ] ); } newSelector = groups.join( "," ); } try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch ( qsaError ) { nonnativeSelectorCache( selector, true ); } finally { if ( nid === expando ) { context.removeAttribute( "id" ); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return ( cache[ key + " " ] = value ); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created element and returns a boolean result */ function assert( fn ) { var el = document.createElement( "fieldset" ); try { return !!fn( el ); } catch ( e ) { return false; } finally { // Remove from its parent by default if ( el.parentNode ) { el.parentNode.removeChild( el ); } // release memory in IE el = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split( "|" ), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[ i ] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex; // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( ( cur = cur.nextSibling ) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return ( name === "input" || name === "button" ) && elem.type === type; }; } /** * Returns a function to use in pseudos for :enabled/:disabled * @param {Boolean} disabled true for :disabled; false for :enabled */ function createDisabledPseudo( disabled ) { // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable return function( elem ) { // Only certain elements can match :enabled or :disabled // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled if ( "form" in elem ) { // Check for inherited disabledness on relevant non-disabled elements: // * listed form-associated elements in a disabled fieldset // https://html.spec.whatwg.org/multipage/forms.html#category-listed // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled // * option elements in a disabled optgroup // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled // All such elements have a "form" property. if ( elem.parentNode && elem.disabled === false ) { // Option elements defer to a parent optgroup if present if ( "label" in elem ) { if ( "label" in elem.parentNode ) { return elem.parentNode.disabled === disabled; } else { return elem.disabled === disabled; } } // Support: IE 6 - 11 // Use the isDisabled shortcut property to check for disabled fieldset ancestors return elem.isDisabled === disabled || // Where there is no isDisabled, check manually /* jshint -W018 */ elem.isDisabled !== !disabled && inDisabledFieldset( elem ) === disabled; } return elem.disabled === disabled; // Try to winnow out elements that can't be disabled before trusting the disabled property. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't // even exist on them, let alone have a boolean value. } else if ( "label" in elem ) { return elem.disabled === disabled; } // Remaining elements are neither :enabled nor :disabled return false; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction( function( argument ) { argument = +argument; return markFunction( function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ ( j = matchIndexes[ i ] ) ] ) { seed[ j ] = !( matches[ j ] = seed[ j ] ); } } } ); } ); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { var namespace = elem.namespaceURI, docElem = ( elem.ownerDocument || elem ).documentElement; // Support: IE <=8 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes // https://bugs.jquery.com/ticket/4833 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Update global variables document = doc; docElem = document.documentElement; documentIsHTML = !isXML( document ); // Support: IE 9 - 11+, Edge 12 - 18+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( preferredDoc != document && ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { // Support: IE 11, Edge if ( subWindow.addEventListener ) { subWindow.addEventListener( "unload", unloadHandler, false ); // Support: IE 9 - 10 only } else if ( subWindow.attachEvent ) { subWindow.attachEvent( "onunload", unloadHandler ); } } // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, // Safari 4 - 5 only, Opera <=11.6 - 12.x only // IE/Edge & older browsers don't support the :scope pseudo-class. // Support: Safari 6.0 only // Safari 6.0 supports :scope but it's an alias of :root there. support.scope = assert( function( el ) { docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); return typeof el.querySelectorAll !== "undefined" && !el.querySelectorAll( ":scope fieldset div" ).length; } ); /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) support.attributes = assert( function( el ) { el.className = "i"; return !el.getAttribute( "className" ); } ); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert( function( el ) { el.appendChild( document.createComment( "" ) ); return !el.getElementsByTagName( "*" ).length; } ); // Support: IE<9 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programmatically-set names, // so use a roundabout getElementsByName test support.getById = assert( function( el ) { docElem.appendChild( el ).id = expando; return !document.getElementsByName || !document.getElementsByName( expando ).length; } ); // ID filter and find if ( support.getById ) { Expr.filter[ "ID" ] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute( "id" ) === attrId; }; }; Expr.find[ "ID" ] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var elem = context.getElementById( id ); return elem ? [ elem ] : []; } }; } else { Expr.filter[ "ID" ] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode( "id" ); return node && node.value === attrId; }; }; // Support: IE 6 - 7 only // getElementById is not reliable as a find shortcut Expr.find[ "ID" ] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var node, i, elems, elem = context.getElementById( id ); if ( elem ) { // Verify the id attribute node = elem.getAttributeNode( "id" ); if ( node && node.value === id ) { return [ elem ]; } // Fall back on getElementsByName elems = context.getElementsByName( id ); i = 0; while ( ( elem = elems[ i++ ] ) ) { node = elem.getAttributeNode( "id" ); if ( node && node.value === id ) { return [ elem ]; } } } return []; } }; } // Tag Expr.find[ "TAG" ] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); // DocumentFragment nodes don't have gEBTN } else if ( support.qsa ) { return context.querySelectorAll( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( ( elem = results[ i++ ] ) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See https://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert( function( el ) { var input; // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // https://bugs.jquery.com/ticket/12359 docElem.appendChild( el ).innerHTML = "" + ""; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !el.querySelectorAll( "[selected]" ).length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push( "~=" ); } // Support: IE 11+, Edge 15 - 18+ // IE 11/Edge don't find elements on a `[name='']` query in some cases. // Adding a temporary attribute to the document before the selection works // around the issue. // Interestingly, IE 10 & older don't seem to have the issue. input = document.createElement( "input" ); input.setAttribute( "name", "" ); el.appendChild( input ); if ( !el.querySelectorAll( "[name='']" ).length ) { rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + "*(?:''|\"\")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !el.querySelectorAll( ":checked" ).length ) { rbuggyQSA.push( ":checked" ); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibling-combinator selector` fails if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push( ".#.+[+~]" ); } // Support: Firefox <=3.6 - 5 only // Old Firefox doesn't throw on a badly-escaped identifier. el.querySelectorAll( "\\\f" ); rbuggyQSA.push( "[\\r\\n\\f]" ); } ); assert( function( el ) { el.innerHTML = "" + ""; // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = document.createElement( "input" ); input.setAttribute( "type", "hidden" ); el.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( el.querySelectorAll( "[name=d]" ).length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Support: IE9-11+ // IE's :disabled selector does not pick up the children of disabled fieldsets docElem.appendChild( el ).disabled = true; if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Support: Opera 10 - 11 only // Opera 10-11 does not throw on post-comma invalid pseudos el.querySelectorAll( "*,:x" ); rbuggyQSA.push( ",.*:" ); } ); } if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector ) ) ) ) { assert( function( el ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( el, "*" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( el, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); } ); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 ) ); } : function( a, b ) { if ( b ) { while ( ( b = b.parentNode ) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { // Choose the first element that is related to our preferred document // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( a == document || a.ownerDocument == preferredDoc && contains( preferredDoc, a ) ) { return -1; } // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( b == document || b.ownerDocument == preferredDoc && contains( preferredDoc, b ) ) { return 1; } // Maintain original order return sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. /* eslint-disable eqeqeq */ return a == document ? -1 : b == document ? 1 : /* eslint-enable eqeqeq */ aup ? -1 : bup ? 1 : sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( ( cur = cur.parentNode ) ) { ap.unshift( cur ); } cur = b; while ( ( cur = cur.parentNode ) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[ i ] === bp[ i ] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[ i ], bp[ i ] ) : // Otherwise nodes in our document sort first // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. /* eslint-disable eqeqeq */ ap[ i ] == preferredDoc ? -1 : bp[ i ] == preferredDoc ? 1 : /* eslint-enable eqeqeq */ 0; }; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { setDocument( elem ); if ( support.matchesSelector && documentIsHTML && !nonnativeSelectorCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch ( e ) { nonnativeSelectorCache( expr, true ); } } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( ( context.ownerDocument || context ) != document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( ( elem.ownerDocument || elem ) != document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : ( val = elem.getAttributeNode( name ) ) && val.specified ? val.value : null; }; Sizzle.escape = function( sel ) { return ( sel + "" ).replace( rcssescape, fcssescape ); }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( ( elem = results[ i++ ] ) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( ( node = elem[ i++ ] ) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[ 1 ] = match[ 1 ].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ).replace( runescape, funescape ); if ( match[ 2 ] === "~=" ) { match[ 3 ] = " " + match[ 3 ] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[ 1 ] = match[ 1 ].toLowerCase(); if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[ 3 ] ) { Sizzle.error( match[ 0 ] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[ 4 ] = +( match[ 4 ] ? match[ 5 ] + ( match[ 6 ] || 1 ) : 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); // other types prohibit arguments } else if ( match[ 3 ] ) { Sizzle.error( match[ 0 ] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[ 6 ] && match[ 2 ]; if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { return null; } // Accept quoted arguments as-is if ( match[ 3 ] ) { match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) ( excess = tokenize( unquoted, true ) ) && // advance to the next closing parenthesis ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { // excess is a negative index match[ 0 ] = match[ 0 ].slice( 0, excess ); match[ 2 ] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || ( pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute( "class" ) || "" ); } ); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; /* eslint-disable max-len */ return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; /* eslint-enable max-len */ }; }, "CHILD": function( type, what, _argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, _context, xml ) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( ( node = node[ dir ] ) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index // ...in a gzip-friendly way node = parent; outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || ( outerCache[ node.uniqueID ] = {} ); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( ( node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start ( diff = nodeIndex = 0 ) || start.pop() ) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } } else { // Use previously-cached element index if available if ( useCache ) { // ...in a gzip-friendly way node = elem; outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || ( outerCache[ node.uniqueID ] = {} ); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex; } // xml :nth-child(...) // or :nth-last-child(...) or :nth(-last)?-of-type(...) if ( diff === false ) { // Use the same loop as above to seek `elem` from the start while ( ( node = ++nodeIndex && node && node[ dir ] || ( diff = nodeIndex = 0 ) || start.pop() ) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || ( outerCache[ node.uniqueID ] = {} ); uniqueCache[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction( function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf( seed, matched[ i ] ); seed[ idx ] = !( matches[ idx ] = matched[ i ] ); } } ) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction( function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction( function( seed, matches, _context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( ( elem = unmatched[ i ] ) ) { seed[ i ] = !( matches[ i ] = elem ); } } } ) : function( elem, _context, xml ) { input[ 0 ] = elem; matcher( input, null, xml, results ); // Don't keep the element (issue #299) input[ 0 ] = null; return !results.pop(); }; } ), "has": markFunction( function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; } ), "contains": markFunction( function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; }; } ), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test( lang || "" ) ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( ( elemLang = documentIsHTML ? elem.lang : elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); return false; }; } ), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && ( !document.hasFocus || document.hasFocus() ) && !!( elem.type || elem.href || ~elem.tabIndex ); }, // Boolean properties "enabled": createDisabledPseudo( false ), "disabled": createDisabledPseudo( true ), "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return ( nodeName === "input" && !!elem.checked ) || ( nodeName === "option" && !!elem.selected ); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { // eslint-disable-next-line no-unused-expressions elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos[ "empty" ]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( ( attr = elem.getAttribute( "type" ) ) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo( function() { return [ 0 ]; } ), "last": createPositionalPseudo( function( _matchIndexes, length ) { return [ length - 1 ]; } ), "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; } ), "even": createPositionalPseudo( function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; } ), "odd": createPositionalPseudo( function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; } ), "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument > length ? length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; } ), "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; } ) } }; Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || ( match = rcomma.exec( soFar ) ) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[ 0 ].length ) || soFar; } groups.push( ( tokens = [] ) ); } matched = false; // Combinators if ( ( match = rcombinators.exec( soFar ) ) ) { matched = match.shift(); tokens.push( { value: matched, // Cast descendant combinators to space type: match[ 0 ].replace( rtrim, " " ) } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || ( match = preFilters[ type ]( match ) ) ) ) { matched = match.shift(); tokens.push( { value: matched, type: type, matches: match } ); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[ i ].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, skip = combinator.next, key = skip || dir, checkNonElements = base && key === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } return false; } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || ( elem[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ elem.uniqueID ] || ( outerCache[ elem.uniqueID ] = {} ); if ( skip && skip === elem.nodeName.toLowerCase() ) { elem = elem[ dir ] || elem; } else if ( ( oldCache = uniqueCache[ key ] ) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return ( newCache[ 2 ] = oldCache[ 2 ] ); } else { // Reuse newcache so results back-propagate to previous elements uniqueCache[ key ] = newCache; // A match means we're done; a fail means we have to keep checking if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { return true; } } } } } return false; }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[ i ]( elem, context, xml ) ) { return false; } } return true; } : matchers[ 0 ]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[ i ], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( ( elem = unmatched[ i ] ) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction( function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( ( elem = temp[ i ] ) ) { matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( ( elem = matcherOut[ i ] ) ) { // Restore matcherIn since elem is not yet a final match temp.push( ( matcherIn[ i ] = elem ) ); } } postFinder( null, ( matcherOut = [] ), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( ( elem = matcherOut[ i ] ) && ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { seed[ temp ] = !( results[ temp ] = elem ); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } } ); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[ 0 ].type ], implicitRelative = leadingRelative || Expr.relative[ " " ], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( ( checkContext = context ).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; } else { matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[ j ].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens .slice( 0, i - 1 ) .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), len = elems.length; if ( outermost ) { // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq outermostContext = context == document || context || outermost; } // Add elements passing elementMatchers directly to results // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { if ( byElement && elem ) { j = 0; // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( !context && elem.ownerDocument != document ) { setDocument( elem ); xml = !documentIsHTML; } while ( ( matcher = elementMatchers[ j++ ] ) ) { if ( matcher( elem, context || document, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( ( elem = !matcher && elem ) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // `i` is now the count of elements visited above, and adding it to `matchedCount` // makes the latter nonnegative. matchedCount += i; // Apply set filters to unmatched elements // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` // equals `i`), unless we didn't visit _any_ elements in the above loop because we have // no element matchers and no seed. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that // case, which will result in a "00" `matchedCount` that differs from `i` but is also // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( ( matcher = setMatchers[ j++ ] ) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !( unmatched[ i ] || setMatched[ i ] ) ) { setMatched[ i ] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[ i ] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( ( selector = compiled.selector || selector ) ); results = results || []; // Try to minimize operations if there is only one selector in the list and no seed // (the latter of which guarantees us context) if ( match.length === 1 ) { // Reduce context if the leading compound selector is an ID tokens = match[ 0 ] = match[ 0 ].slice( 0 ); if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { context = ( Expr.find[ "ID" ]( token.matches[ 0 ] .replace( runescape, funescape ), context ) || [] )[ 0 ]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[ i ]; // Abort if we hit a combinator if ( Expr.relative[ ( type = token.type ) ] ) { break; } if ( ( find = Expr.find[ type ] ) ) { // Search, expanding context for leading sibling combinators if ( ( seed = find( token.matches[ 0 ].replace( runescape, funescape ), rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || context ) ) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert( function( el ) { // Should return 1, but returns 4 (following) return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; } ); // Support: IE<8 // Prevent attribute/property "interpolation" // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert( function( el ) { el.innerHTML = ""; return el.firstChild.getAttribute( "href" ) === "#"; } ) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } } ); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert( function( el ) { el.innerHTML = ""; el.firstChild.setAttribute( "value", "" ); return el.firstChild.getAttribute( "value" ) === ""; } ) ) { addHandle( "value", function( elem, _name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } } ); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert( function( el ) { return el.getAttribute( "disabled" ) == null; } ) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : ( val = elem.getAttributeNode( name ) ) && val.specified ? val.value : null; } } ); } return Sizzle; } )( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; // Deprecated jQuery.expr[ ":" ] = jQuery.expr.pseudos; jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; jQuery.escapeSelector = Sizzle.escape; var dir = function( elem, dir, until ) { var matched = [], truncate = until !== undefined; while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; }; var siblings = function( n, elem ) { var matched = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { matched.push( n ); } } return matched; }; var rneedsContext = jQuery.expr.match.needsContext; function nodeName( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }; var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { return !!qualifier.call( elem, i, elem ) !== not; } ); } // Single element if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; } ); } // Arraylike of elements (jQuery, arguments, Array) if ( typeof qualifier !== "string" ) { return jQuery.grep( elements, function( elem ) { return ( indexOf.call( qualifier, elem ) > -1 ) !== not; } ); } // Filtered directly for both simple and complex selectors return jQuery.filter( qualifier, elements, not ); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } if ( elems.length === 1 && elem.nodeType === 1 ) { return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; } return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; } ) ); }; jQuery.fn.extend( { find: function( selector ) { var i, ret, len = this.length, self = this; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } } ) ); } ret = this.pushStack( [] ); for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } return len > 1 ? jQuery.uniqueSort( ret ) : ret; }, filter: function( selector ) { return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } } ); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) // Shortcut simple #id case for speed rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Method init() accepts an alternate rootjQuery // so migrate can support jQuery.sub (gh-2101) root = root || rootjQuery; // Handle HTML strings if ( typeof selector === "string" ) { if ( selector[ 0 ] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) if ( match[ 1 ] ) { context = context instanceof jQuery ? context[ 0 ] : context; // Option to run scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[ 2 ] ); if ( elem ) { // Inject the element directly into the jQuery object this[ 0 ] = elem; this.length = 1; } return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( isFunction( selector ) ) { return root.ready !== undefined ? root.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // Methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend( { has: function( target ) { var targets = jQuery( target, this ), l = targets.length; return this.filter( function() { var i = 0; for ( ; i < l; i++ ) { if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } } ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery( selectors ); // Positional selectors never match, since there's no _selection_ context if ( !rneedsContext.test( selectors ) ) { for ( ; i < l; i++ ) { for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && ( targets ? targets.index( cur ) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector( cur, selectors ) ) ) { matched.push( cur ); break; } } } } return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within the set index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // Index in selector if ( typeof elem === "string" ) { return indexOf.call( jQuery( elem ), this[ 0 ] ); } // Locate the position of the desired element return indexOf.call( this, // If it receives a jQuery object, the first element is used elem.jquery ? elem[ 0 ] : elem ); }, add: function( selector, context ) { return this.pushStack( jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); } } ); function sibling( cur, dir ) { while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} return cur; } jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return dir( elem, "parentNode" ); }, parentsUntil: function( elem, _i, until ) { return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return dir( elem, "previousSibling" ); }, nextUntil: function( elem, _i, until ) { return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, _i, until ) { return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return siblings( elem.firstChild ); }, contents: function( elem ) { if ( elem.contentDocument != null && // Support: IE 11+ // elements with no `data` attribute has an object // `contentDocument` with a `null` prototype. getProto( elem.contentDocument ) ) { return elem.contentDocument; } // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only // Treat the template element as a regular one in browsers that // don't support it. if ( nodeName( elem, "template" ) ) { elem = elem.content || elem; } return jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var matched = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { matched = jQuery.filter( selector, matched ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { jQuery.uniqueSort( matched ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { matched.reverse(); } } return this.pushStack( matched ); }; } ); var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); // Convert String-formatted options into Object-formatted ones function createOptions( options ) { var object = {}; jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { object[ flag ] = true; } ); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? createOptions( options ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value for non-forgettable lists memory, // Flag to know if list was already fired fired, // Flag to prevent firing locked, // Actual callback list list = [], // Queue of execution data for repeatable lists queue = [], // Index of currently firing callback (modified by add/remove as needed) firingIndex = -1, // Fire callbacks fire = function() { // Enforce single-firing locked = locked || options.once; // Execute callbacks for all pending executions, // respecting firingIndex overrides and runtime changes fired = firing = true; for ( ; queue.length; firingIndex = -1 ) { memory = queue.shift(); while ( ++firingIndex < list.length ) { // Run callback and check for early termination if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && options.stopOnFalse ) { // Jump to end and forget the data so .add doesn't re-fire firingIndex = list.length; memory = false; } } } // Forget the data if we're done with it if ( !options.memory ) { memory = false; } firing = false; // Clean up if we're done firing for good if ( locked ) { // Keep an empty list if we have data for future add calls if ( memory ) { list = []; // Otherwise, this object is spent } else { list = ""; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // If we have memory from a past run, we should fire after adding if ( memory && !firing ) { firingIndex = list.length - 1; queue.push( memory ); } ( function add( args ) { jQuery.each( args, function( _, arg ) { if ( isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && toType( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments ); if ( memory && !firing ) { fire(); } } return this; }, // Remove a callback from the list remove: function() { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( index <= firingIndex ) { firingIndex--; } } } ); return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : list.length > 0; }, // Remove all callbacks from the list empty: function() { if ( list ) { list = []; } return this; }, // Disable .fire and .add // Abort any current/pending executions // Clear all callbacks and values disable: function() { locked = queue = []; list = memory = ""; return this; }, disabled: function() { return !list; }, // Disable .fire // Also disable .add unless we have memory (since it would have no effect) // Abort any pending executions lock: function() { locked = queue = []; if ( !memory && !firing ) { list = memory = ""; } return this; }, locked: function() { return !!locked; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; queue.push( args ); if ( !firing ) { fire(); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; function Identity( v ) { return v; } function Thrower( ex ) { throw ex; } function adoptValue( value, resolve, reject, noValue ) { var method; try { // Check for promise aspect first to privilege synchronous behavior if ( value && isFunction( ( method = value.promise ) ) ) { method.call( value ).done( resolve ).fail( reject ); // Other thenables } else if ( value && isFunction( ( method = value.then ) ) ) { method.call( value, resolve, reject ); // Other non-thenables } else { // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: // * false: [ value ].slice( 0 ) => resolve( value ) // * true: [ value ].slice( 1 ) => resolve() resolve.apply( undefined, [ value ].slice( noValue ) ); } // For Promises/A+, convert exceptions into rejections // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in // Deferred#then to conditionally suppress rejection. } catch ( value ) { // Support: Android 4.0 only // Strict mode functions invoked without .call/.apply get global-object context reject.apply( undefined, [ value ] ); } } jQuery.extend( { Deferred: function( func ) { var tuples = [ // action, add listener, callbacks, // ... .then handlers, argument index, [final state] [ "notify", "progress", jQuery.Callbacks( "memory" ), jQuery.Callbacks( "memory" ), 2 ], [ "resolve", "done", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), 0, "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), 1, "rejected" ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, "catch": function( fn ) { return promise.then( null, fn ); }, // Keep pipe for back-compat pipe: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( _i, tuple ) { // Map tuples (progress, done, fail) to arguments (done, fail, progress) var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; // deferred.progress(function() { bind to newDefer or newDefer.notify }) // deferred.done(function() { bind to newDefer or newDefer.resolve }) // deferred.fail(function() { bind to newDefer or newDefer.reject }) deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && isFunction( returned.promise ) ) { returned.promise() .progress( newDefer.notify ) .done( newDefer.resolve ) .fail( newDefer.reject ); } else { newDefer[ tuple[ 0 ] + "With" ]( this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); }, then: function( onFulfilled, onRejected, onProgress ) { var maxDepth = 0; function resolve( depth, deferred, handler, special ) { return function() { var that = this, args = arguments, mightThrow = function() { var returned, then; // Support: Promises/A+ section 2.3.3.3.3 // https://promisesaplus.com/#point-59 // Ignore double-resolution attempts if ( depth < maxDepth ) { return; } returned = handler.apply( that, args ); // Support: Promises/A+ section 2.3.1 // https://promisesaplus.com/#point-48 if ( returned === deferred.promise() ) { throw new TypeError( "Thenable self-resolution" ); } // Support: Promises/A+ sections 2.3.3.1, 3.5 // https://promisesaplus.com/#point-54 // https://promisesaplus.com/#point-75 // Retrieve `then` only once then = returned && // Support: Promises/A+ section 2.3.4 // https://promisesaplus.com/#point-64 // Only check objects and functions for thenability ( typeof returned === "object" || typeof returned === "function" ) && returned.then; // Handle a returned thenable if ( isFunction( then ) ) { // Special processors (notify) just wait for resolution if ( special ) { then.call( returned, resolve( maxDepth, deferred, Identity, special ), resolve( maxDepth, deferred, Thrower, special ) ); // Normal processors (resolve) also hook into progress } else { // ...and disregard older resolution values maxDepth++; then.call( returned, resolve( maxDepth, deferred, Identity, special ), resolve( maxDepth, deferred, Thrower, special ), resolve( maxDepth, deferred, Identity, deferred.notifyWith ) ); } // Handle all other returned values } else { // Only substitute handlers pass on context // and multiple values (non-spec behavior) if ( handler !== Identity ) { that = undefined; args = [ returned ]; } // Process the value(s) // Default process is resolve ( special || deferred.resolveWith )( that, args ); } }, // Only normal processors (resolve) catch and reject exceptions process = special ? mightThrow : function() { try { mightThrow(); } catch ( e ) { if ( jQuery.Deferred.exceptionHook ) { jQuery.Deferred.exceptionHook( e, process.stackTrace ); } // Support: Promises/A+ section 2.3.3.3.4.1 // https://promisesaplus.com/#point-61 // Ignore post-resolution exceptions if ( depth + 1 >= maxDepth ) { // Only substitute handlers pass on context // and multiple values (non-spec behavior) if ( handler !== Thrower ) { that = undefined; args = [ e ]; } deferred.rejectWith( that, args ); } } }; // Support: Promises/A+ section 2.3.3.3.1 // https://promisesaplus.com/#point-57 // Re-resolve promises immediately to dodge false rejection from // subsequent errors if ( depth ) { process(); } else { // Call an optional hook to record the stack, in case of exception // since it's otherwise lost when execution goes async if ( jQuery.Deferred.getStackHook ) { process.stackTrace = jQuery.Deferred.getStackHook(); } window.setTimeout( process ); } }; } return jQuery.Deferred( function( newDefer ) { // progress_handlers.add( ... ) tuples[ 0 ][ 3 ].add( resolve( 0, newDefer, isFunction( onProgress ) ? onProgress : Identity, newDefer.notifyWith ) ); // fulfilled_handlers.add( ... ) tuples[ 1 ][ 3 ].add( resolve( 0, newDefer, isFunction( onFulfilled ) ? onFulfilled : Identity ) ); // rejected_handlers.add( ... ) tuples[ 2 ][ 3 ].add( resolve( 0, newDefer, isFunction( onRejected ) ? onRejected : Thrower ) ); } ).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 5 ]; // promise.progress = list.add // promise.done = list.add // promise.fail = list.add promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { list.add( function() { // state = "resolved" (i.e., fulfilled) // state = "rejected" state = stateString; }, // rejected_callbacks.disable // fulfilled_callbacks.disable tuples[ 3 - i ][ 2 ].disable, // rejected_handlers.disable // fulfilled_handlers.disable tuples[ 3 - i ][ 3 ].disable, // progress_callbacks.lock tuples[ 0 ][ 2 ].lock, // progress_handlers.lock tuples[ 0 ][ 3 ].lock ); } // progress_handlers.fire // fulfilled_handlers.fire // rejected_handlers.fire list.add( tuple[ 3 ].fire ); // deferred.notify = function() { deferred.notifyWith(...) } // deferred.resolve = function() { deferred.resolveWith(...) } // deferred.reject = function() { deferred.rejectWith(...) } deferred[ tuple[ 0 ] ] = function() { deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); return this; }; // deferred.notifyWith = list.fireWith // deferred.resolveWith = list.fireWith // deferred.rejectWith = list.fireWith deferred[ tuple[ 0 ] + "With" ] = list.fireWith; } ); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( singleValue ) { var // count of uncompleted subordinates remaining = arguments.length, // count of unprocessed arguments i = remaining, // subordinate fulfillment data resolveContexts = Array( i ), resolveValues = slice.call( arguments ), // the master Deferred master = jQuery.Deferred(), // subordinate callback factory updateFunc = function( i ) { return function( value ) { resolveContexts[ i ] = this; resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( !( --remaining ) ) { master.resolveWith( resolveContexts, resolveValues ); } }; }; // Single- and empty arguments are adopted like Promise.resolve if ( remaining <= 1 ) { adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, !remaining ); // Use .then() to unwrap secondary thenables (cf. gh-3000) if ( master.state() === "pending" || isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { return master.then(); } } // Multiple arguments are aggregated like Promise.all array elements while ( i-- ) { adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); } return master.promise(); } } ); // These usually indicate a programmer mistake during development, // warn about them ASAP rather than swallowing them by default. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; jQuery.Deferred.exceptionHook = function( error, stack ) { // Support: IE 8 - 9 only // Console exists when dev tools are open, which can happen at any time if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); } }; jQuery.readyException = function( error ) { window.setTimeout( function() { throw error; } ); }; // The deferred used on DOM ready var readyList = jQuery.Deferred(); jQuery.fn.ready = function( fn ) { readyList .then( fn ) // Wrap jQuery.readyException in a function so that the lookup // happens at the time of error handling instead of callback // registration. .catch( function( error ) { jQuery.readyException( error ); } ); return this; }; jQuery.extend( { // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); } } ); jQuery.ready.then = readyList.then; // The ready event handler and self cleanup method function completed() { document.removeEventListener( "DOMContentLoaded", completed ); window.removeEventListener( "load", completed ); jQuery.ready(); } // Catch cases where $(document).ready() is called // after the browser event has already occurred. // Support: IE <=9 - 10 only // Older IE sometimes signals "interactive" too soon if ( document.readyState === "complete" || ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); } else { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed ); } // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; // Sets many values if ( toType( key ) === "object" ) { chainable = true; for ( i in key ) { access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, _key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < len; i++ ) { fn( elems[ i ], key, raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) ); } } } if ( chainable ) { return elems; } // Gets if ( bulk ) { return fn.call( elems ); } return len ? fn( elems[ 0 ], key ) : emptyGet; }; // Matches dashed string for camelizing var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g; // Used by camelCase as callback to replace() function fcamelCase( _all, letter ) { return letter.toUpperCase(); } // Convert dashed to camelCase; used by the css and data modules // Support: IE <=9 - 11, Edge 12 - 15 // Microsoft forgot to hump their vendor prefix (#9572) function camelCase( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); } var acceptData = function( owner ) { // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; function Data() { this.expando = jQuery.expando + Data.uid++; } Data.uid = 1; Data.prototype = { cache: function( owner ) { // Check if the owner object already has a cache var value = owner[ this.expando ]; // If not, create one if ( !value ) { value = {}; // We can accept data for non-element nodes in modern browsers, // but we should not, see #8335. // Always return an empty object. if ( acceptData( owner ) ) { // If it is a node unlikely to be stringify-ed or looped over // use plain assignment if ( owner.nodeType ) { owner[ this.expando ] = value; // Otherwise secure it in a non-enumerable property // configurable must be true to allow the property to be // deleted when data is removed } else { Object.defineProperty( owner, this.expando, { value: value, configurable: true } ); } } } return value; }, set: function( owner, data, value ) { var prop, cache = this.cache( owner ); // Handle: [ owner, key, value ] args // Always use camelCase key (gh-2257) if ( typeof data === "string" ) { cache[ camelCase( data ) ] = value; // Handle: [ owner, { properties } ] args } else { // Copy the properties one-by-one to the cache object for ( prop in data ) { cache[ camelCase( prop ) ] = data[ prop ]; } } return cache; }, get: function( owner, key ) { return key === undefined ? this.cache( owner ) : // Always use camelCase key (gh-2257) owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; }, access: function( owner, key, value ) { // In cases where either: // // 1. No key was specified // 2. A string key was specified, but no value provided // // Take the "read" path and allow the get method to determine // which value to return, respectively either: // // 1. The entire cache object // 2. The data stored at the key // if ( key === undefined || ( ( key && typeof key === "string" ) && value === undefined ) ) { return this.get( owner, key ); } // When the key is not a string, or both a key and value // are specified, set or extend (existing objects) with either: // // 1. An object of properties // 2. A key and value // this.set( owner, key, value ); // Since the "set" path can have two possible entry points // return the expected data based on which path was taken[*] return value !== undefined ? value : key; }, remove: function( owner, key ) { var i, cache = owner[ this.expando ]; if ( cache === undefined ) { return; } if ( key !== undefined ) { // Support array or space separated string of keys if ( Array.isArray( key ) ) { // If key is an array of keys... // We always set camelCase keys, so remove that. key = key.map( camelCase ); } else { key = camelCase( key ); // If a key with the spaces exists, use it. // Otherwise, create an array by matching non-whitespace key = key in cache ? [ key ] : ( key.match( rnothtmlwhite ) || [] ); } i = key.length; while ( i-- ) { delete cache[ key[ i ] ]; } } // Remove the expando if there's no more data if ( key === undefined || jQuery.isEmptyObject( cache ) ) { // Support: Chrome <=35 - 45 // Webkit & Blink performance suffers when deleting properties // from DOM nodes, so set to undefined instead // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) if ( owner.nodeType ) { owner[ this.expando ] = undefined; } else { delete owner[ this.expando ]; } } }, hasData: function( owner ) { var cache = owner[ this.expando ]; return cache !== undefined && !jQuery.isEmptyObject( cache ); } }; var dataPriv = new Data(); var dataUser = new Data(); // Implementation Summary // // 1. Enforce API surface and semantic compatibility with 1.9.x branch // 2. Improve the module's maintainability by reducing the storage // paths to a single mechanism. // 3. Use the same single mechanism to support "private" and "user" data. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) // 5. Avoid exposing implementation details on user objects (eg. expando properties) // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g; function getData( data ) { if ( data === "true" ) { return true; } if ( data === "false" ) { return false; } if ( data === "null" ) { return null; } // Only convert to a number if it doesn't change the string if ( data === +data + "" ) { return +data; } if ( rbrace.test( data ) ) { return JSON.parse( data ); } return data; } function dataAttr( elem, key, data ) { var name; // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = getData( data ); } catch ( e ) {} // Make sure we set the data so it isn't changed later dataUser.set( elem, key, data ); } else { data = undefined; } } return data; } jQuery.extend( { hasData: function( elem ) { return dataUser.hasData( elem ) || dataPriv.hasData( elem ); }, data: function( elem, name, data ) { return dataUser.access( elem, name, data ); }, removeData: function( elem, name ) { dataUser.remove( elem, name ); }, // TODO: Now that all calls to _data and _removeData have been replaced // with direct calls to dataPriv methods, these can be deprecated. _data: function( elem, name, data ) { return dataPriv.access( elem, name, data ); }, _removeData: function( elem, name ) { dataPriv.remove( elem, name ); } } ); jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], attrs = elem && elem.attributes; // Gets all values if ( key === undefined ) { if ( this.length ) { data = dataUser.get( elem ); if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE 11 only // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } dataPriv.set( elem, "hasDataAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each( function() { dataUser.set( this, key ); } ); } return access( this, function( value ) { var data; // The calling jQuery object (element matches) is not empty // (and therefore has an element appears at this[ 0 ]) and the // `value` parameter was not undefined. An empty jQuery object // will result in `undefined` for elem = this[ 0 ] which will // throw an exception if an attempt to read a data cache is made. if ( elem && value === undefined ) { // Attempt to get data from the cache // The key will always be camelCased in Data data = dataUser.get( elem, key ); if ( data !== undefined ) { return data; } // Attempt to "discover" the data in // HTML5 custom data-* attrs data = dataAttr( elem, key ); if ( data !== undefined ) { return data; } // We tried really hard, but the data doesn't exist. return; } // Set the data... this.each( function() { // We always store the camelCased key dataUser.set( this, key, value ); } ); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each( function() { dataUser.remove( this, key ); } ); } } ); jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = dataPriv.get( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || Array.isArray( data ) ) { queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // Clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // Not public - generate a queueHooks object, or return the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { empty: jQuery.Callbacks( "once memory" ).add( function() { dataPriv.remove( elem, [ type + "queue", key ] ); } ) } ); } } ); jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : this.each( function() { var queue = jQuery.queue( this, type, data ); // Ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } } ); }, dequeue: function( type ) { return this.each( function() { jQuery.dequeue( this, type ); } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } } ); var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var documentElement = document.documentElement; var isAttached = function( elem ) { return jQuery.contains( elem.ownerDocument, elem ); }, composed = { composed: true }; // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only // Check attachment across shadow DOM boundaries when possible (gh-3504) // Support: iOS 10.0-10.2 only // Early iOS 10 versions support `attachShadow` but not `getRootNode`, // leading to errors. We need to check for `getRootNode`. if ( documentElement.getRootNode ) { isAttached = function( elem ) { return jQuery.contains( elem.ownerDocument, elem ) || elem.getRootNode( composed ) === elem.ownerDocument; }; } var isHiddenWithinTree = function( elem, el ) { // isHiddenWithinTree might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; // Inline style trumps all return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style // Support: Firefox <=43 - 45 // Disconnected elements can have computed display: none, so first confirm that elem is // in the document. isAttached( elem ) && jQuery.css( elem, "display" ) === "none"; }; function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale, maxIterations = 20, currentValue = tween ? function() { return tween.cur(); } : function() { return jQuery.css( elem, prop, "" ); }, initial = currentValue(), unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches initialInUnit = elem.nodeType && ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { // Support: Firefox <=54 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) initial = initial / 2; // Trust units reported by jQuery.css unit = unit || initialInUnit[ 3 ]; // Iteratively approximate from a nonzero starting point initialInUnit = +initial || 1; while ( maxIterations-- ) { // Evaluate and update our best guess (doubling guesses that zero out). // Finish if the scale equals or crosses 1 (making the old*new product non-positive). jQuery.style( elem, prop, initialInUnit + unit ); if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { maxIterations = 0; } initialInUnit = initialInUnit / scale; } initialInUnit = initialInUnit * 2; jQuery.style( elem, prop, initialInUnit + unit ); // Make sure we update the tween properties later on valueParts = valueParts || []; } if ( valueParts ) { initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified adjusted = valueParts[ 1 ] ? initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : +valueParts[ 2 ]; if ( tween ) { tween.unit = unit; tween.start = initialInUnit; tween.end = adjusted; } } return adjusted; } var defaultDisplayMap = {}; function getDefaultDisplay( elem ) { var temp, doc = elem.ownerDocument, nodeName = elem.nodeName, display = defaultDisplayMap[ nodeName ]; if ( display ) { return display; } temp = doc.body.appendChild( doc.createElement( nodeName ) ); display = jQuery.css( temp, "display" ); temp.parentNode.removeChild( temp ); if ( display === "none" ) { display = "block"; } defaultDisplayMap[ nodeName ] = display; return display; } function showHide( elements, show ) { var display, elem, values = [], index = 0, length = elements.length; // Determine new display value for elements that need to change for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } display = elem.style.display; if ( show ) { // Since we force visibility upon cascade-hidden elements, an immediate (and slow) // check is required in this first loop unless we have a nonempty display value (either // inline or about-to-be-restored) if ( display === "none" ) { values[ index ] = dataPriv.get( elem, "display" ) || null; if ( !values[ index ] ) { elem.style.display = ""; } } if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { values[ index ] = getDefaultDisplay( elem ); } } else { if ( display !== "none" ) { values[ index ] = "none"; // Remember what we're overwriting dataPriv.set( elem, "display", display ); } } } // Set the display of the elements in a second loop to avoid constant reflow for ( index = 0; index < length; index++ ) { if ( values[ index ] != null ) { elements[ index ].style.display = values[ index ]; } } return elements; } jQuery.fn.extend( { show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each( function() { if ( isHiddenWithinTree( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } } ); } } ); var rcheckableType = ( /^(?:checkbox|radio)$/i ); var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); ( function() { var fragment = document.createDocumentFragment(), div = fragment.appendChild( document.createElement( "div" ) ), input = document.createElement( "input" ); // Support: Android 4.0 - 4.3 only // Check state lost if the name is set (#11217) // Support: Windows Web Apps (WWA) // `name` and `type` must use .setAttribute for WWA (#14901) input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); // Support: Android <=4.1 only // Older WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE <=11 only // Make sure textarea (and checkbox) defaultValue is properly cloned div.innerHTML = ""; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // Support: IE <=9 only // IE <=9 replaces "; support.option = !!div.lastChild; } )(); // We have to close these tags to support XHTML (#13200) var wrapMap = { // XHTML parsers do not magically insert elements in the // same way that tag soup parsers do. So we cannot shorten // this by omitting or other required elements. thead: [ 1, "", "
" ], col: [ 2, "", "
" ], tr: [ 2, "", "
" ], td: [ 3, "", "
" ], _default: [ 0, "", "" ] }; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // Support: IE <=9 only if ( !support.option ) { wrapMap.optgroup = wrapMap.option = [ 1, "" ]; } function getAll( context, tag ) { // Support: IE <=9 - 11 only // Use typeof to avoid zero-argument method invocation on host objects (#15151) var ret; if ( typeof context.getElementsByTagName !== "undefined" ) { ret = context.getElementsByTagName( tag || "*" ); } else if ( typeof context.querySelectorAll !== "undefined" ) { ret = context.querySelectorAll( tag || "*" ); } else { ret = []; } if ( tag === undefined || tag && nodeName( context, tag ) ) { return jQuery.merge( [ context ], ret ); } return ret; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; for ( ; i < l; i++ ) { dataPriv.set( elems[ i ], "globalEval", !refElements || dataPriv.get( refElements[ i ], "globalEval" ) ); } } var rhtml = /<|&#?\w+;/; function buildFragment( elems, context, scripts, selection, ignored ) { var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( toType( elem ) === "object" ) { // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; // Descend through wrappers to the right content j = wrap[ 0 ]; while ( j-- ) { tmp = tmp.lastChild; } // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, tmp.childNodes ); // Remember the top-level container tmp = fragment.firstChild; // Ensure the created nodes are orphaned (#12392) tmp.textContent = ""; } } } // Remove wrapper from fragment fragment.textContent = ""; i = 0; while ( ( elem = nodes[ i++ ] ) ) { // Skip elements already in the context collection (trac-4087) if ( selection && jQuery.inArray( elem, selection ) > -1 ) { if ( ignored ) { ignored.push( elem ); } continue; } attached = isAttached( elem ); // Append to fragment tmp = getAll( fragment.appendChild( elem ), "script" ); // Preserve script evaluation history if ( attached ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( ( elem = tmp[ j++ ] ) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } return fragment; } var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; } function returnFalse() { return false; } // Support: IE <=9 - 11+ // focus() and blur() are asynchronous, except when they are no-op. // So expect focus to be synchronous when the element is already active, // and blur to be synchronous when the element is not already active. // (focus and blur are always synchronous in other supported browsers, // this just defines when we can count on it). function expectSync( elem, type ) { return ( elem === safeActiveElement() ) === ( type === "focus" ); } // Support: IE <=9 only // Accessing document.activeElement can throw unexpectedly // https://bugs.jquery.com/ticket/13393 function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } function on( elem, types, selector, data, fn, one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { on( elem, type, selector, data, types[ type ], one ); } return elem; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return elem; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return elem.each( function() { jQuery.event.add( this, types, fn, data, selector ); } ); } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get( elem ); // Only attach events to objects that accept data if ( !acceptData( elem ) ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Ensure that invalid selectors throw exceptions at attach time // Evaluate against documentElement in case elem is a non-element node (e.g., document) if ( selector ) { jQuery.find.matchesSelector( documentElement, selector ); } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !( events = elemData.events ) ) { events = elemData.events = Object.create( null ); } if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply( elem, arguments ) : undefined; }; } // Handle multiple events separated by a space types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend( { type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); if ( !elemData || !( events = elemData.events ) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[ 2 ] && new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove data and the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { dataPriv.remove( elem, "handle events" ); } }, dispatch: function( nativeEvent ) { var i, j, ret, matched, handleObj, handlerQueue, args = new Array( arguments.length ), // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( nativeEvent ), handlers = ( dataPriv.get( this, "events" ) || Object.create( null ) )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[ 0 ] = event; for ( i = 1; i < arguments.length; i++ ) { args[ i ] = arguments[ i ]; } event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( ( handleObj = matched.handlers[ j++ ] ) && !event.isImmediatePropagationStopped() ) { // If the event is namespaced, then each handler is only invoked if it is // specially universal or its namespaces are a superset of the event's. if ( !event.rnamespace || handleObj.namespace === false || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers if ( delegateCount && // Support: IE <=9 // Black-hole SVG instance trees (trac-13180) cur.nodeType && // Support: Firefox <=42 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click // Support: IE 11 only // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) !( event.type === "click" && event.button >= 1 ) ) { for ( ; cur !== this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { matchedHandlers = []; matchedSelectors = {}; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matchedSelectors[ sel ] === undefined ) { matchedSelectors[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matchedSelectors[ sel ] ) { matchedHandlers.push( handleObj ); } } if ( matchedHandlers.length ) { handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); } } } } // Add the remaining (directly-bound) handlers cur = this; if ( delegateCount < handlers.length ) { handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, addProp: function( name, hook ) { Object.defineProperty( jQuery.Event.prototype, name, { enumerable: true, configurable: true, get: isFunction( hook ) ? function() { if ( this.originalEvent ) { return hook( this.originalEvent ); } } : function() { if ( this.originalEvent ) { return this.originalEvent[ name ]; } }, set: function( value ) { Object.defineProperty( this, name, { enumerable: true, configurable: true, writable: true, value: value } ); } } ); }, fix: function( originalEvent ) { return originalEvent[ jQuery.expando ] ? originalEvent : new jQuery.Event( originalEvent ); }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, click: { // Utilize native event to ensure correct state for checkable inputs setup: function( data ) { // For mutual compressibility with _default, replace `this` access with a local var. // `|| data` is dead code meant only to preserve the variable through minification. var el = this || data; // Claim the first handler if ( rcheckableType.test( el.type ) && el.click && nodeName( el, "input" ) ) { // dataPriv.set( el, "click", ... ) leverageNative( el, "click", returnTrue ); } // Return false to allow normal processing in the caller return false; }, trigger: function( data ) { // For mutual compressibility with _default, replace `this` access with a local var. // `|| data` is dead code meant only to preserve the variable through minification. var el = this || data; // Force setup before triggering a click if ( rcheckableType.test( el.type ) && el.click && nodeName( el, "input" ) ) { leverageNative( el, "click" ); } // Return non-false to allow normal event-path propagation return true; }, // For cross-browser consistency, suppress native .click() on links // Also prevent it if we're currently inside a leveraged native-event stack _default: function( event ) { var target = event.target; return rcheckableType.test( target.type ) && target.click && nodeName( target, "input" ) && dataPriv.get( target, "click" ) || nodeName( target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } } }; // Ensure the presence of an event listener that handles manually-triggered // synthetic events by interrupting progress until reinvoked in response to // *native* events that it fires directly, ensuring that state changes have // already occurred before other listeners are invoked. function leverageNative( el, type, expectSync ) { // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add if ( !expectSync ) { if ( dataPriv.get( el, type ) === undefined ) { jQuery.event.add( el, type, returnTrue ); } return; } // Register the controller as a special universal handler for all event namespaces dataPriv.set( el, type, false ); jQuery.event.add( el, type, { namespace: false, handler: function( event ) { var notAsync, result, saved = dataPriv.get( this, type ); if ( ( event.isTrigger & 1 ) && this[ type ] ) { // Interrupt processing of the outer synthetic .trigger()ed event // Saved data should be false in such cases, but might be a leftover capture object // from an async native handler (gh-4350) if ( !saved.length ) { // Store arguments for use when handling the inner native event // There will always be at least one argument (an event object), so this array // will not be confused with a leftover capture object. saved = slice.call( arguments ); dataPriv.set( this, type, saved ); // Trigger the native event and capture its result // Support: IE <=9 - 11+ // focus() and blur() are asynchronous notAsync = expectSync( this, type ); this[ type ](); result = dataPriv.get( this, type ); if ( saved !== result || notAsync ) { dataPriv.set( this, type, false ); } else { result = {}; } if ( saved !== result ) { // Cancel the outer synthetic event event.stopImmediatePropagation(); event.preventDefault(); return result.value; } // If this is an inner synthetic event for an event with a bubbling surrogate // (focus or blur), assume that the surrogate already propagated from triggering the // native event and prevent that from happening again here. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the // bubbling surrogate propagates *after* the non-bubbling base), but that seems // less bad than duplication. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { event.stopPropagation(); } // If this is a native event triggered above, everything is now in order // Fire an inner synthetic event with the original arguments } else if ( saved.length ) { // ...and capture the result dataPriv.set( this, type, { value: jQuery.event.trigger( // Support: IE <=9 - 11+ // Extend with the prototype to reset the above stopImmediatePropagation() jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), saved.slice( 1 ), this ) } ); // Abort handling of the native event event.stopImmediatePropagation(); } } } ); } jQuery.removeEvent = function( elem, type, handle ) { // This "if" is needed for plain objects if ( elem.removeEventListener ) { elem.removeEventListener( type, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: Android <=2.3 only src.returnValue === false ? returnTrue : returnFalse; // Create target properties // Support: Safari <=6 - 7 only // Target should not be a text node (#504, #13143) this.target = ( src.target && src.target.nodeType === 3 ) ? src.target.parentNode : src.target; this.currentTarget = src.currentTarget; this.relatedTarget = src.relatedTarget; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || Date.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, isSimulated: false, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( e && !this.isSimulated ) { e.preventDefault(); } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopPropagation(); } }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Includes all common event props including KeyEvent and MouseEvent specific props jQuery.each( { altKey: true, bubbles: true, cancelable: true, changedTouches: true, ctrlKey: true, detail: true, eventPhase: true, metaKey: true, pageX: true, pageY: true, shiftKey: true, view: true, "char": true, code: true, charCode: true, key: true, keyCode: true, button: true, buttons: true, clientX: true, clientY: true, offsetX: true, offsetY: true, pointerId: true, pointerType: true, screenX: true, screenY: true, targetTouches: true, toElement: true, touches: true, which: function( event ) { var button = event.button; // Add which for key events if ( event.which == null && rkeyEvent.test( event.type ) ) { return event.charCode != null ? event.charCode : event.keyCode; } // Add which for click: 1 === left; 2 === middle; 3 === right if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { if ( button & 1 ) { return 1; } if ( button & 2 ) { return 3; } if ( button & 4 ) { return 2; } return 0; } return event.which; } }, jQuery.event.addProp ); jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { jQuery.event.special[ type ] = { // Utilize native event if possible so blur/focus sequence is correct setup: function() { // Claim the first handler // dataPriv.set( this, "focus", ... ) // dataPriv.set( this, "blur", ... ) leverageNative( this, type, expectSync ); // Return false to allow normal processing in the caller return false; }, trigger: function() { // Force setup before trigger leverageNative( this, type ); // Return non-false to allow normal event-path propagation return true; }, delegateType: delegateType }; } ); // Create mouseenter/leave events using mouseover/out and event-time checks // so that event delegation works in jQuery. // Do the same for pointerenter/pointerleave and pointerover/pointerout // // Support: Safari 7 only // Safari sends mouseenter too often; see: // https://bugs.chromium.org/p/chromium/issues/detail?id=470258 // for the description of the bug (it existed in older Chrome versions as well). jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; } ); jQuery.fn.extend( { on: function( types, selector, data, fn ) { return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each( function() { jQuery.event.remove( this, types, fn, selector ); } ); } } ); var // Support: IE <=10 - 11, Edge 12 - 13 only // In IE/Edge using regex groups here causes severe slowdowns. // See https://connect.microsoft.com/IE/feedback/details/1736512/ rnoInnerhtml = /\s*$/g; // Prefer a tbody over its parent table for containing new rows function manipulationTarget( elem, content ) { if ( nodeName( elem, "table" ) && nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { return jQuery( elem ).children( "tbody" )[ 0 ] || elem; } return elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { elem.type = elem.type.slice( 5 ); } else { elem.removeAttribute( "type" ); } return elem; } function cloneCopyEvent( src, dest ) { var i, l, type, pdataOld, udataOld, udataCur, events; if ( dest.nodeType !== 1 ) { return; } // 1. Copy private data: events, handlers, etc. if ( dataPriv.hasData( src ) ) { pdataOld = dataPriv.get( src ); events = pdataOld.events; if ( events ) { dataPriv.remove( dest, "handle events" ); for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } } // 2. Copy user data if ( dataUser.hasData( src ) ) { udataOld = dataUser.access( src ); udataCur = jQuery.extend( {}, udataOld ); dataUser.set( dest, udataCur ); } } // Fix IE bugs, see support tests function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button. if ( nodeName === "input" && rcheckableType.test( src.type ) ) { dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays args = flat( args ); var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[ 0 ], valueIsFunction = isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( valueIsFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return collection.each( function( index ) { var self = collection.eq( index ); if ( valueIsFunction ) { args[ 0 ] = value.call( this, index, self.html() ); } domManip( self, args, callback, ignored ); } ); } if ( l ) { fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } // Require either new content or an interest in ignored elements to invoke the callback if ( first || ignored ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item // instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( collection[ i ], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !dataPriv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl && !node.noModule ) { jQuery._evalUrl( node.src, { nonce: node.nonce || node.getAttribute( "nonce" ) }, doc ); } } else { DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); } } } } } } return collection; } function remove( elem, selector, keepData ) { var node, nodes = selector ? jQuery.filter( selector, elem ) : elem, i = 0; for ( ; ( node = nodes[ i ] ) != null; i++ ) { if ( !keepData && node.nodeType === 1 ) { jQuery.cleanData( getAll( node ) ); } if ( node.parentNode ) { if ( keepData && isAttached( node ) ) { setGlobalEval( getAll( node, "script" ) ); } node.parentNode.removeChild( node ); } } return elem; } jQuery.extend( { htmlPrefilter: function( html ) { return html; }, clone: function( elem, dataAndEvents, deepDataAndEvents ) { var i, l, srcElements, destElements, clone = elem.cloneNode( true ), inPage = isAttached( elem ); // Fix IE cloning issues if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); for ( i = 0, l = srcElements.length; i < l; i++ ) { fixInput( srcElements[ i ], destElements[ i ] ); } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0, l = srcElements.length; i < l; i++ ) { cloneCopyEvent( srcElements[ i ], destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } // Return the cloned set return clone; }, cleanData: function( elems ) { var data, elem, type, special = jQuery.event.special, i = 0; for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { if ( acceptData( elem ) ) { if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Support: Chrome <=35 - 45+ // Assign undefined instead of using delete, see Data#remove elem[ dataPriv.expando ] = undefined; } if ( elem[ dataUser.expando ] ) { // Support: Chrome <=35 - 45+ // Assign undefined instead of using delete, see Data#remove elem[ dataUser.expando ] = undefined; } } } } } ); jQuery.fn.extend( { detach: function( selector ) { return remove( this, selector, true ); }, remove: function( selector ) { return remove( this, selector ); }, text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().each( function() { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.textContent = value; } } ); }, null, value, arguments.length ); }, append: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } } ); }, prepend: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } } ); }, before: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } } ); }, after: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } } ); }, empty: function() { var elem, i = 0; for ( ; ( elem = this[ i ] ) != null; i++ ) { if ( elem.nodeType === 1 ) { // Prevent memory leaks jQuery.cleanData( getAll( elem, false ) ); // Remove any remaining nodes elem.textContent = ""; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); } ); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined && elem.nodeType === 1 ) { return elem.innerHTML; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { elem = this[ i ] || {}; // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch ( e ) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var ignored = []; // Make the changes, replacing each non-ignored context element with the new content return domManip( this, arguments, function( elem ) { var parent = this.parentNode; if ( jQuery.inArray( this, ignored ) < 0 ) { jQuery.cleanData( getAll( this ) ); if ( parent ) { parent.replaceChild( elem, this ); } } // Force callback invocation }, ignored ); } } ); jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, ret = [], insert = jQuery( selector ), last = insert.length - 1, i = 0; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); // Support: Android <=4.0 only, PhantomJS 1 only // .get() because push.apply(_, arraylike) throws on ancient WebKit push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; } ); var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); var getStyles = function( elem ) { // Support: IE <=11 only, Firefox <=30 (#15098, #14150) // IE throws on elements created in popups // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" var view = elem.ownerDocument.defaultView; if ( !view || !view.opener ) { view = window; } return view.getComputedStyle( elem ); }; var swap = function( elem, options, callback ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.call( elem ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); ( function() { // Executing both pixelPosition & boxSizingReliable tests require only one layout // so they're executed at the same time to save the second computation. function computeStyleTests() { // This is a singleton, we need to execute it only once if ( !div ) { return; } container.style.cssText = "position:absolute;left:-11111px;width:60px;" + "margin-top:1px;padding:0;border:0"; div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + "margin:auto;border:1px;padding:1px;" + "width:60%;top:1%"; documentElement.appendChild( container ).appendChild( div ); var divStyle = window.getComputedStyle( div ); pixelPositionVal = divStyle.top !== "1%"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 // Some styles come back with percentage values, even though they shouldn't div.style.right = "60%"; pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; // Support: IE 9 - 11 only // Detect misreporting of content dimensions for box-sizing:border-box elements boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; // Support: IE 9 only // Detect overflow:scroll screwiness (gh-3699) // Support: Chrome <=64 // Don't get tricked when zoom affects offsetWidth (gh-4029) div.style.position = "absolute"; scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; documentElement.removeChild( container ); // Nullify the div so it wouldn't be stored in the memory and // it will also be a sign that checks already performed div = null; } function roundPixelMeasures( measure ) { return Math.round( parseFloat( measure ) ); } var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document.createElement( "div" ), div = document.createElement( "div" ); // Finish early in limited (non-browser) environments if ( !div.style ) { return; } // Support: IE <=9 - 11 only // Style of cloned element affects source element cloned (#8908) div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; jQuery.extend( support, { boxSizingReliable: function() { computeStyleTests(); return boxSizingReliableVal; }, pixelBoxStyles: function() { computeStyleTests(); return pixelBoxStylesVal; }, pixelPosition: function() { computeStyleTests(); return pixelPositionVal; }, reliableMarginLeft: function() { computeStyleTests(); return reliableMarginLeftVal; }, scrollboxSize: function() { computeStyleTests(); return scrollboxSizeVal; }, // Support: IE 9 - 11+, Edge 15 - 18+ // IE/Edge misreport `getComputedStyle` of table rows with width/height // set in CSS while `offset*` properties report correct values. // Behavior in IE 9 is more subtle than in newer versions & it passes // some versions of this test; make sure not to make it pass there! reliableTrDimensions: function() { var table, tr, trChild, trStyle; if ( reliableTrDimensionsVal == null ) { table = document.createElement( "table" ); tr = document.createElement( "tr" ); trChild = document.createElement( "div" ); table.style.cssText = "position:absolute;left:-11111px"; tr.style.height = "1px"; trChild.style.height = "9px"; documentElement .appendChild( table ) .appendChild( tr ) .appendChild( trChild ); trStyle = window.getComputedStyle( tr ); reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; documentElement.removeChild( table ); } return reliableTrDimensionsVal; } } ); } )(); function curCSS( elem, name, computed ) { var width, minWidth, maxWidth, ret, // Support: Firefox 51+ // Retrieving style before computed somehow // fixes an issue with getting wrong values // on detached elements style = elem.style; computed = computed || getStyles( elem ); // getPropertyValue is needed for: // .css('filter') (IE 9 only, #12537) // .css('--customProperty) (#3144) if ( computed ) { ret = computed.getPropertyValue( name ) || computed[ name ]; if ( ret === "" && !isAttached( elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Android Browser returns percentage for some values, // but width seems to be reliably pixels. // This is against the CSSOM draft spec: // https://drafts.csswg.org/cssom/#resolved-values if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret !== undefined ? // Support: IE <=9 - 11 only // IE returns zIndex value as an integer. ret + "" : ret; } function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { if ( conditionFn() ) { // Hook not needed (or it's not possible to use it due // to missing dependency), remove it. delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. return ( this.get = hookFn ).apply( this, arguments ); } }; } var cssPrefixes = [ "Webkit", "Moz", "ms" ], emptyStyle = document.createElement( "div" ).style, vendorProps = {}; // Return a vendor-prefixed property or undefined function vendorPropName( name ) { // Check for vendor prefixed names var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in emptyStyle ) { return name; } } } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property function finalPropName( name ) { var final = jQuery.cssProps[ name ] || vendorProps[ name ]; if ( final ) { return final; } if ( name in emptyStyle ) { return name; } return vendorProps[ name ] = vendorPropName( name ) || name; } var // Swappable if display is none or starts with table // except "table", "table-cell", or "table-caption" // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rcustomProp = /^--/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }; function setPositiveNumber( _elem, value, subtract ) { // Any relative (+/-) values have already been // normalized at this point var matches = rcssNum.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : value; } function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { var i = dimension === "width" ? 1 : 0, extra = 0, delta = 0; // Adjustment may not be necessary if ( box === ( isBorderBox ? "border" : "content" ) ) { return 0; } for ( ; i < 4; i += 2 ) { // Both box models exclude margin if ( box === "margin" ) { delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); } // If we get here with a content-box, we're seeking "padding" or "border" or "margin" if ( !isBorderBox ) { // Add padding delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // For "border" or "margin", add border if ( box !== "padding" ) { delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); // But still keep track of it otherwise } else { extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } // If we get here with a border-box (content + padding + border), we're seeking "content" or // "padding" or "margin" } else { // For "content", subtract padding if ( box === "content" ) { delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // For "content" or "padding", subtract border if ( box !== "margin" ) { delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } // Account for positive content-box scroll gutter when requested by providing computedVal if ( !isBorderBox && computedVal >= 0 ) { // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border // Assuming integer scroll gutter, subtract the rest and round down delta += Math.max( 0, Math.ceil( elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - computedVal - delta - extra - 0.5 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter // Use an explicit zero to avoid NaN (gh-3964) ) ) || 0; } return delta; } function getWidthOrHeight( elem, dimension, extra ) { // Start with computed style var styles = getStyles( elem ), // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). // Fake content-box until we know it's needed to know the true value. boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS( elem, dimension, styles ), offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); // Support: Firefox <=54 // Return a confounding non-pixel value or feign ignorance, as appropriate. if ( rnumnonpx.test( val ) ) { if ( !extra ) { return val; } val = "auto"; } // Support: IE 9 - 11 only // Use offsetWidth/offsetHeight for when box sizing is unreliable. // In those cases, the computed value can be trusted to be border-box. if ( ( !support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+ // IE/Edge misreport `getComputedStyle` of table rows with width/height // set in CSS while `offset*` properties report correct values. // Interestingly, in some cases IE 9 doesn't suffer from this issue. !support.reliableTrDimensions() && nodeName( elem, "tr" ) || // Fall back to offsetWidth/offsetHeight when value is "auto" // This happens for inline elements with no explicit setting (gh-3571) val === "auto" || // Support: Android <=4.1 - 4.3 only // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && // Make sure the element is visible & connected elem.getClientRects().length ) { isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // Where available, offsetWidth/offsetHeight approximate border box dimensions. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the // retrieved value as a content box dimension. valueIsBorderBox = offsetProp in elem; if ( valueIsBorderBox ) { val = elem[ offsetProp ]; } } // Normalize "" and auto val = parseFloat( val ) || 0; // Adjust for the element's box model return ( val + boxModelAdjustment( elem, dimension, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles, // Provide the current computed size to request scroll gutter calculation (gh-3589) val ) ) + "px"; } jQuery.extend( { // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "animationIterationCount": true, "columnCount": true, "fillOpacity": true, "flexGrow": true, "flexShrink": true, "fontWeight": true, "gridArea": true, "gridColumn": true, "gridColumnEnd": true, "gridColumnStart": true, "gridRow": true, "gridRowEnd": true, "gridRowStart": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: {}, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = camelCase( name ), isCustomProp = rcustomProp.test( name ), style = elem.style; // Make sure that we're working with the right name. We don't // want to query the value if it is a CSS custom property // since they are user-defined. if ( !isCustomProp ) { name = finalPropName( origName ); } // Gets hook for the prefixed version, then unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // Convert "+=" or "-=" to relative numbers (#7345) if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { value = adjustCSS( elem, name, ret ); // Fixes bug #9237 type = "number"; } // Make sure that null and NaN values aren't set (#7116) if ( value == null || value !== value ) { return; } // If a number was passed in, add the unit (except for certain CSS properties) // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append // "px" to a few hardcoded values. if ( type === "number" && !isCustomProp ) { value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); } // background-* props affect original clone's values if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !( "set" in hooks ) || ( value = hooks.set( elem, value, extra ) ) !== undefined ) { if ( isCustomProp ) { style.setProperty( name, value ); } else { style[ name ] = value; } } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var val, num, hooks, origName = camelCase( name ), isCustomProp = rcustomProp.test( name ); // Make sure that we're working with the right name. We don't // want to modify the value if it is a CSS custom property // since they are user-defined. if ( !isCustomProp ) { name = finalPropName( origName ); } // Try prefixed name followed by the unprefixed name hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } // Convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Make numeric if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || isFinite( num ) ? num || 0 : val; } return val; } } ); jQuery.each( [ "height", "width" ], function( _i, dimension ) { jQuery.cssHooks[ dimension ] = { get: function( elem, computed, extra ) { if ( computed ) { // Certain elements can have dimension info if we invisibly show them // but it must have a current display style that would benefit return rdisplayswap.test( jQuery.css( elem, "display" ) ) && // Support: Safari 8+ // Table columns in Safari have non-zero offsetWidth & zero // getBoundingClientRect().width unless display is changed. // Support: IE <=11 only // Running getBoundingClientRect on a disconnected node // in IE throws an error. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? swap( elem, cssShow, function() { return getWidthOrHeight( elem, dimension, extra ); } ) : getWidthOrHeight( elem, dimension, extra ); } }, set: function( elem, value, extra ) { var matches, styles = getStyles( elem ), // Only read styles.position if the test has a chance to fail // to avoid forcing a reflow. scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", subtract = extra ? boxModelAdjustment( elem, dimension, extra, isBorderBox, styles ) : 0; // Account for unreliable border-box dimensions by comparing offset* to computed and // faking a content-box to get border and padding (gh-3699) if ( isBorderBox && scrollboxSizeBuggy ) { subtract -= Math.ceil( elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - parseFloat( styles[ dimension ] ) - boxModelAdjustment( elem, dimension, "border", false, styles ) - 0.5 ); } // Convert to pixels if value adjustment is needed if ( subtract && ( matches = rcssNum.exec( value ) ) && ( matches[ 3 ] || "px" ) !== "px" ) { elem.style[ dimension ] = value; value = jQuery.css( elem, dimension ); } return setPositiveNumber( elem, value, subtract ); } }; } ); jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, function( elem, computed ) { if ( computed ) { return ( parseFloat( curCSS( elem, "marginLeft" ) ) || elem.getBoundingClientRect().left - swap( elem, { marginLeft: 0 }, function() { return elem.getBoundingClientRect().left; } ) ) + "px"; } } ); // These hooks are used by animate to expand properties jQuery.each( { margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // Assumes a single number if not a string parts = typeof value === "string" ? value.split( " " ) : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( prefix !== "margin" ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } } ); jQuery.fn.extend( { css: function( name, value ) { return access( this, function( elem, name, value ) { var styles, len, map = {}, i = 0; if ( Array.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); } } ); function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || jQuery.easing._default; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; // Use a property on the element directly when it is not a DOM element, // or when there is no matching style property that exists. if ( tween.elem.nodeType !== 1 || tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { return tween.elem[ tween.prop ]; } // Passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails. // Simple values such as "10px" are parsed to Float; // complex values such as "rotate(1rad)" are returned as-is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // Use step hook for back compat. // Use cssHook if its there. // Use .style if available and use plain properties where available. if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.nodeType === 1 && ( jQuery.cssHooks[ tween.prop ] || tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 only // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p * Math.PI ) / 2; }, _default: "swing" }; jQuery.fx = Tween.prototype.init; // Back compat <1.8 extension point jQuery.fx.step = {}; var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; function schedule() { if ( inProgress ) { if ( document.hidden === false && window.requestAnimationFrame ) { window.requestAnimationFrame( schedule ); } else { window.setTimeout( schedule, jQuery.fx.interval ); } jQuery.fx.tick(); } } // Animations created synchronously will run synchronously function createFxNow() { window.setTimeout( function() { fxNow = undefined; } ); return ( fxNow = Date.now() ); } // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, i = 0, attrs = { height: type }; // If we include width, step value is 1 to do all cssExpand values, // otherwise step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } function createTween( value, prop, animation ) { var tween, collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { // We're done with this property return tween; } } } function defaultPrefilter( elem, props, opts ) { var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree( elem ), dataShow = dataPriv.get( elem, "fxshow" ); // Queue-skipping animations hijack the fx hooks if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always( function() { // Ensure the complete handler is called before this completes anim.always( function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } } ); } ); } // Detect show/hide animations for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.test( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { // Pretend to be hidden if this is a "show" and // there is still data from a stopped show/hide if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { hidden = true; // Ignore all other no-op show/hide data } else { continue; } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } // Bail out if this is a no-op like .hide().hide() propTween = !jQuery.isEmptyObject( props ); if ( !propTween && jQuery.isEmptyObject( orig ) ) { return; } // Restrict "overflow" and "display" styles during box animations if ( isBox && elem.nodeType === 1 ) { // Support: IE <=9 - 11, Edge 12 - 15 // Record all 3 overflow attributes because IE does not infer the shorthand // from identically-valued overflowX and overflowY and Edge just mirrors // the overflowX value there. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Identify a display type, preferring old show/hide data over the CSS cascade restoreDisplay = dataShow && dataShow.display; if ( restoreDisplay == null ) { restoreDisplay = dataPriv.get( elem, "display" ); } display = jQuery.css( elem, "display" ); if ( display === "none" ) { if ( restoreDisplay ) { display = restoreDisplay; } else { // Get nonempty value(s) by temporarily forcing visibility showHide( [ elem ], true ); restoreDisplay = elem.style.display || restoreDisplay; display = jQuery.css( elem, "display" ); showHide( [ elem ] ); } } // Animate inline elements as inline-block if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { if ( jQuery.css( elem, "float" ) === "none" ) { // Restore the original display value at the end of pure show/hide animations if ( !propTween ) { anim.done( function() { style.display = restoreDisplay; } ); if ( restoreDisplay == null ) { display = style.display; restoreDisplay = display === "none" ? "" : display; } } style.display = "inline-block"; } } } if ( opts.overflow ) { style.overflow = "hidden"; anim.always( function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; } ); } // Implement show/hide animations propTween = false; for ( prop in orig ) { // General show/hide setup for this element animation if ( !propTween ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); } // Store hidden/visible for toggle so `.stop().toggle()` "reverses" if ( toggle ) { dataShow.hidden = !hidden; } // Show elements before animating them if ( hidden ) { showHide( [ elem ], true ); } /* eslint-disable no-loop-func */ anim.done( function() { /* eslint-enable no-loop-func */ // The final step of a "hide" animation is actually hiding the element if ( !hidden ) { showHide( [ elem ] ); } dataPriv.remove( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } } ); } // Per-property setup propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = propTween.start; if ( hidden ) { propTween.end = propTween.start; propTween.start = 0; } } } } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( Array.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // Not quite $.extend, this won't overwrite existing keys. // Reusing 'index' because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always( function() { // Don't match elem in the :animated selector delete tick.elem; } ), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // Support: Android 2.3 only // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ] ); // If there's more to do, yield if ( percent < 1 && length ) { return remaining; } // If this was an empty animation, synthesize a final progress notification if ( !length ) { deferred.notifyWith( elem, [ animation, 1, 0 ] ); } // Resolve the animation and report its conclusion deferred.resolveWith( elem, [ animation ] ); return false; }, animation = deferred.promise( { elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {}, easing: jQuery.easing._default }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // If we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length; index++ ) { animation.tweens[ index ].run( 1 ); } // Resolve when we played the last frame; otherwise, reject if ( gotoEnd ) { deferred.notifyWith( elem, [ animation, 1, 0 ] ); deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } } ), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length; index++ ) { result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { if ( isFunction( result.stop ) ) { jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = result.stop.bind( result ); } return result; } } jQuery.map( props, createTween, animation ); if ( isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } // Attach callbacks from options animation .progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue } ) ); return animation; } jQuery.Animation = jQuery.extend( Animation, { tweeners: { "*": [ function( prop, value ) { var tween = this.createTween( prop, value ); adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); return tween; } ] }, tweener: function( props, callback ) { if ( isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.match( rnothtmlwhite ); } var prop, index = 0, length = props.length; for ( ; index < length; index++ ) { prop = props[ index ]; Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; Animation.tweeners[ prop ].unshift( callback ); } }, prefilters: [ defaultPrefilter ], prefilter: function( callback, prepend ) { if ( prepend ) { Animation.prefilters.unshift( callback ); } else { Animation.prefilters.push( callback ); } } } ); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !isFunction( easing ) && easing }; // Go to the end state if fx are off if ( jQuery.fx.off ) { opt.duration = 0; } else { if ( typeof opt.duration !== "number" ) { if ( opt.duration in jQuery.fx.speeds ) { opt.duration = jQuery.fx.speeds[ opt.duration ]; } else { opt.duration = jQuery.fx.speeds._default; } } } // Normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.fn.extend( { fadeTo: function( speed, to, easing, callback ) { // Show any hidden elements after setting opacity to 0 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() // Animate to the value specified .end().animate( { opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || dataPriv.get( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue ) { this.queue( type || "fx", [] ); } return this.each( function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && ( type == null || timers[ index ].queue === type ) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // Start the next in the queue if the last step wasn't forced. // Timers currently will call their complete callbacks, which // will dequeue but only if they were gotoEnd. if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } } ); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each( function() { var index, data = dataPriv.get( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // Enable finishing flag on private data data.finish = true; // Empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // Look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // Look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // Turn off finishing flag delete data.finish; } ); } } ); jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; } ); // Generate shortcuts for custom animations jQuery.each( { slideDown: genFx( "show" ), slideUp: genFx( "hide" ), slideToggle: genFx( "toggle" ), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; } ); jQuery.timers = []; jQuery.fx.tick = function() { var timer, i = 0, timers = jQuery.timers; fxNow = Date.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Run the timer and safely remove it when done (allowing for external removal) if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { jQuery.timers.push( timer ); jQuery.fx.start(); }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( inProgress ) { return; } inProgress = true; schedule(); }; jQuery.fx.stop = function() { inProgress = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Based off of the plugin by Clint Helfers, with permission. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = window.setTimeout( next, time ); hooks.stop = function() { window.clearTimeout( timeout ); }; } ); }; ( function() { var input = document.createElement( "input" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); input.type = "checkbox"; // Support: Android <=4.3 only // Default value for a checkbox should be "on" support.checkOn = input.value !== ""; // Support: IE <=11 only // Must access selectedIndex to make default options select support.optSelected = opt.selected; // Support: IE <=11 only // An input loses its value after becoming a radio input = document.createElement( "input" ); input.value = "t"; input.type = "radio"; support.radioValue = input.value === "t"; } )(); var boolHook, attrHandle = jQuery.expr.attrHandle; jQuery.fn.extend( { attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each( function() { jQuery.removeAttr( this, name ); } ); } } ); jQuery.extend( { attr: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set attributes on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === "undefined" ) { return jQuery.prop( elem, name, value ); } // Attribute hooks are determined by the lowercase version // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { hooks = jQuery.attrHooks[ name.toLowerCase() ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); return; } if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } elem.setAttribute( name, value + "" ); return value; } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && nodeName( elem, "input" ) ) { var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, removeAttr: function( elem, value ) { var name, i = 0, // Attribute names can contain non-HTML whitespace characters // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 attrNames = value && value.match( rnothtmlwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( ( name = attrNames[ i++ ] ) ) { elem.removeAttribute( name ); } } } } ); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else { elem.setAttribute( name, name ); } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; attrHandle[ name ] = function( elem, name, isXML ) { var ret, handle, lowercaseName = name.toLowerCase(); if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ lowercaseName ]; attrHandle[ lowercaseName ] = ret; ret = getter( elem, name, isXML ) != null ? lowercaseName : null; attrHandle[ lowercaseName ] = handle; } return ret; }; } ); var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend( { prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { return this.each( function() { delete this[ jQuery.propFix[ name ] || name ]; } ); } } ); jQuery.extend( { prop: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set properties on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } return ( elem[ name ] = value ); } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } return elem[ name ]; }, propHooks: { tabIndex: { get: function( elem ) { // Support: IE <=9 - 11 only // elem.tabIndex doesn't always return the // correct value when it hasn't been explicitly set // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); if ( tabindex ) { return parseInt( tabindex, 10 ); } if ( rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ) { return 0; } return -1; } } }, propFix: { "for": "htmlFor", "class": "className" } } ); // Support: IE <=11 only // Accessing the selectedIndex property // forces the browser to respect setting selected // on the option // The getter ensures a default option is selected // when in an optgroup // eslint rule "no-unused-expressions" is disabled for this code // since it considers such accessions noop if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { /* eslint no-unused-expressions: "off" */ var parent = elem.parentNode; if ( parent && parent.parentNode ) { parent.parentNode.selectedIndex; } return null; }, set: function( elem ) { /* eslint no-unused-expressions: "off" */ var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } }; } jQuery.each( [ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; } ); // Strip and collapse whitespace according to HTML spec // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace function stripAndCollapse( value ) { var tokens = value.match( rnothtmlwhite ) || []; return tokens.join( " " ); } function getClass( elem ) { return elem.getAttribute && elem.getAttribute( "class" ) || ""; } function classesToArray( value ) { if ( Array.isArray( value ) ) { return value; } if ( typeof value === "string" ) { return value.match( rnothtmlwhite ) || []; } return []; } jQuery.fn.extend( { addClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); } ); } classes = classesToArray( value ); if ( classes.length ) { while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // Only assign if different to avoid unneeded rendering. finalValue = stripAndCollapse( cur ); if ( curValue !== finalValue ) { elem.setAttribute( "class", finalValue ); } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); } ); } if ( !arguments.length ) { return this.attr( "class", "" ); } classes = classesToArray( value ); if ( classes.length ) { while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) > -1 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // Only assign if different to avoid unneeded rendering. finalValue = stripAndCollapse( cur ); if ( curValue !== finalValue ) { elem.setAttribute( "class", finalValue ); } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isValidValue = type === "string" || Array.isArray( value ); if ( typeof stateVal === "boolean" && isValidValue ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( isFunction( value ) ) { return this.each( function( i ) { jQuery( this ).toggleClass( value.call( this, i, getClass( this ), stateVal ), stateVal ); } ); } return this.each( function() { var className, i, self, classNames; if ( isValidValue ) { // Toggle individual class names i = 0; self = jQuery( this ); classNames = classesToArray( value ); while ( ( className = classNames[ i++ ] ) ) { // Check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( value === undefined || type === "boolean" ) { className = getClass( this ); if ( className ) { // Store className if set dataPriv.set( this, "__className__", className ); } // If the element has a class name or if we're passed `false`, // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. if ( this.setAttribute ) { this.setAttribute( "class", className || value === false ? "" : dataPriv.get( this, "__className__" ) || "" ); } } } ); }, hasClass: function( selector ) { var className, elem, i = 0; className = " " + selector + " "; while ( ( elem = this[ i++ ] ) ) { if ( elem.nodeType === 1 && ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { return true; } } return false; } } ); var rreturn = /\r/g; jQuery.fn.extend( { val: function( value ) { var hooks, ret, valueIsFunction, elem = this[ 0 ]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && ( ret = hooks.get( elem, "value" ) ) !== undefined ) { return ret; } ret = elem.value; // Handle most common string cases if ( typeof ret === "string" ) { return ret.replace( rreturn, "" ); } // Handle cases where value is null/undef or number return ret == null ? "" : ret; } return; } valueIsFunction = isFunction( value ); return this.each( function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( valueIsFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( Array.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; } ); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } } ); } } ); jQuery.extend( { valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE <=10 - 11 only // option.text throws exceptions (#14686, #14858) // Strip and collapse whitespace // https://html.spec.whatwg.org/#strip-and-collapse-whitespace stripAndCollapse( jQuery.text( elem ) ); } }, select: { get: function( elem ) { var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length; if ( index < 0 ) { i = max; } else { i = one ? index : 0; } // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // Support: IE <=9 only // IE8-9 doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup !option.disabled && ( !option.parentNode.disabled || !nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; /* eslint-disable no-cond-assign */ if ( option.selected = jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { optionSet = true; } /* eslint-enable no-cond-assign */ } // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } } } ); // Radios and checkboxes getter/setter jQuery.each( [ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( Array.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { return elem.getAttribute( "value" ) === null ? "on" : elem.value; }; } } ); // Return jQuery for attributes-only inclusion support.focusin = "onfocusin" in window; var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function( e ) { e.stopPropagation(); }; jQuery.extend( jQuery.event, { trigger: function( event, data, elem, onlyHandlers ) { var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; cur = lastElement = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf( "." ) > -1 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split( "." ); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf( ":" ) < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join( "." ); event.rnamespace = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === ( elem.ownerDocument || document ) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { lastElement = cur; event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && dataPriv.get( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( ( !special._default || special._default.apply( eventPath.pop(), data ) === false ) && acceptData( elem ) ) { // Call a native DOM method on the target with the same name as the event. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; if ( event.isPropagationStopped() ) { lastElement.addEventListener( type, stopPropagationCallback ); } elem[ type ](); if ( event.isPropagationStopped() ) { lastElement.removeEventListener( type, stopPropagationCallback ); } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, // Piggyback on a donor event to simulate a different one // Used only for `focus(in | out)` events simulate: function( type, elem, event ) { var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true } ); jQuery.event.trigger( e, null, elem ); } } ); jQuery.fn.extend( { trigger: function( type, data ) { return this.each( function() { jQuery.event.trigger( type, data, this ); } ); }, triggerHandler: function( type, data ) { var elem = this[ 0 ]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } } ); // Support: Firefox <=44 // Firefox doesn't have focus(in | out) events // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 // // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 // focus(in | out) events fire after focus & blur events, // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 if ( !support.focusin ) { jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); }; jQuery.event.special[ fix ] = { setup: function() { // Handle: regular nodes (via `this.ownerDocument`), window // (via `this.document`) & document (via `this`). var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); dataPriv.remove( doc, fix ); } else { dataPriv.access( doc, fix, attaches ); } } }; } ); } var location = window.location; var nonce = { guid: Date.now() }; var rquery = ( /\?/ ); // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml; if ( !data || typeof data !== "string" ) { return null; } // Support: IE 9 - 11 only // IE throws on parseFromString with invalid input. try { xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); } catch ( e ) { xml = undefined; } if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }; var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( Array.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", v, traditional, add ); } } ); } else if ( !traditional && toType( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, valueOrFunction ) { // If value is a function, invoke it and use its return value var value = isFunction( valueOrFunction ) ? valueOrFunction() : valueOrFunction; s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value == null ? "" : value ); }; if ( a == null ) { return ""; } // If an array was passed in, assume that it is an array of form elements. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); } ); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ); }; jQuery.fn.extend( { serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map( function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; } ) .filter( function() { var type = this.type; // Use .is( ":disabled" ) so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); } ) .map( function( _i, elem ) { var val = jQuery( this ).val(); if ( val == null ) { return null; } if ( Array.isArray( val ) ) { return jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ); } return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ).get(); } } ); var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat( "*" ), // Anchor tag for parsing the document origin originAnchor = document.createElement( "a" ); originAnchor.href = location.href; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; if ( isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( ( dataType = dataTypes[ i++ ] ) ) { // Prepend if requested if ( dataType[ 0 ] === "+" ) { dataType = dataType.slice( 1 ) || "*"; ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); // Otherwise append } else { ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } } ); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s.throws ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } jQuery.extend( { // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: location.href, type: "GET", isLocal: rlocalProtocol.test( location.protocol ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": JSON.parse, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var transport, // URL without anti-cache param cacheURL, // Response headers responseHeadersString, responseHeaders, // timeout handle timeoutTimer, // Url cleanup var urlAnchor, // Request state (becomes false upon send and true upon completion) completed, // To know if global events are to be dispatched fireGlobals, // Loop variable i, // uncached part of the url uncached, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( completed ) { if ( !responseHeaders ) { responseHeaders = {}; while ( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[ 1 ].toLowerCase() + " " ] = ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) .concat( match[ 2 ] ); } } match = responseHeaders[ key.toLowerCase() + " " ]; } return match == null ? null : match.join( ", " ); }, // Raw string getAllResponseHeaders: function() { return completed ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { if ( completed == null ) { name = requestHeadersNames[ name.toLowerCase() ] = requestHeadersNames[ name.toLowerCase() ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( completed == null ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( completed ) { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } else { // Lazy-add the new callbacks in a way that preserves old ones for ( code in map ) { statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ); // Add protocol if not provided (prefilters might expect it) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || location.href ) + "" ) .replace( rprotocol, location.protocol + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; // A cross-domain request is in order when the origin doesn't match the current origin. if ( s.crossDomain == null ) { urlAnchor = document.createElement( "a" ); // Support: IE <=8 - 11, Edge 12 - 15 // IE throws exception on accessing the href property if url is malformed, // e.g. http://example.com:80x/ try { urlAnchor.href = s.url; // Support: IE <=8 - 11 only // Anchor's host property isn't correctly set when s.url is relative urlAnchor.href = urlAnchor.href; s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host; } catch ( e ) { // If there is an error parsing the URL, assume it is crossDomain, // it can be rejected by the transport if it is invalid s.crossDomain = true; } } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( completed ) { return jqXHR; } // We can fire global events as of now if asked to // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) fireGlobals = jQuery.event && s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on // Remove hash to simplify url manipulation cacheURL = s.url.replace( rhash, "" ); // More options handling for requests with no content if ( !s.hasContent ) { // Remember the hash so we can put it back uncached = s.url.slice( cacheURL.length ); // If data is available and should be processed, append data to url if ( s.data && ( s.processData || typeof s.data === "string" ) ) { cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add or update anti-cache param if needed if ( s.cache === false ) { cacheURL = cacheURL.replace( rantiCache, "$1" ); uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + uncached; } // Put hash and anti-cache on the URL that will be requested (gh-1732) s.url = cacheURL + uncached; // Change '%20' to '+' if this is encoded form body content (gh-2658) } else if ( s.data && s.processData && ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { s.data = s.data.replace( r20, "+" ); } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? s.accepts[ s.dataTypes[ 0 ] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { // Abort if not done already and return return jqXHR.abort(); } // Aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds completeDeferred.add( s.complete ); jqXHR.done( s.success ); jqXHR.fail( s.error ); // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // If request was aborted inside ajaxSend, stop there if ( completed ) { return jqXHR; } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = window.setTimeout( function() { jqXHR.abort( "timeout" ); }, s.timeout ); } try { completed = false; transport.send( requestHeaders, done ); } catch ( e ) { // Rethrow post-completion exceptions if ( completed ) { throw e; } // Propagate others as results done( -1, e ); } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Ignore repeat invocations if ( completed ) { return; } completed = true; // Clear timeout if it exists if ( timeoutTimer ) { window.clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Use a noop converter for missing script if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { s.converters[ "text script" ] = function() {}; } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader( "Last-Modified" ); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader( "etag" ); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // Extract error from statusText and normalize for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } } ); jQuery.each( [ "get", "post" ], function( _i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // Shift arguments if data argument was omitted if ( isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } // The url can be an options object (which then must have .url) return jQuery.ajax( jQuery.extend( { url: url, type: method, dataType: type, data: data, success: callback }, jQuery.isPlainObject( url ) && url ) ); }; } ); jQuery.ajaxPrefilter( function( s ) { var i; for ( i in s.headers ) { if ( i.toLowerCase() === "content-type" ) { s.contentType = s.headers[ i ] || ""; } } } ); jQuery._evalUrl = function( url, options, doc ) { return jQuery.ajax( { url: url, // Make this explicit, since user can override this through ajaxSetup (#11264) type: "GET", dataType: "script", cache: true, async: false, global: false, // Only evaluate the response if it is successful (gh-4126) // dataFilter is not invoked for failure responses, so using it instead // of the default converter is kludgy but it works. converters: { "text script": function() {} }, dataFilter: function( response ) { jQuery.globalEval( response, options, doc ); } } ); }; jQuery.fn.extend( { wrapAll: function( html ) { var wrap; if ( this[ 0 ] ) { if ( isFunction( html ) ) { html = html.call( this[ 0 ] ); } // The elements to wrap the target around wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); if ( this[ 0 ].parentNode ) { wrap.insertBefore( this[ 0 ] ); } wrap.map( function() { var elem = this; while ( elem.firstElementChild ) { elem = elem.firstElementChild; } return elem; } ).append( this ); } return this; }, wrapInner: function( html ) { if ( isFunction( html ) ) { return this.each( function( i ) { jQuery( this ).wrapInner( html.call( this, i ) ); } ); } return this.each( function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } } ); }, wrap: function( html ) { var htmlIsFunction = isFunction( html ); return this.each( function( i ) { jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); } ); }, unwrap: function( selector ) { this.parent( selector ).not( "body" ).each( function() { jQuery( this ).replaceWith( this.childNodes ); } ); return this; } } ); jQuery.expr.pseudos.hidden = function( elem ) { return !jQuery.expr.pseudos.visible( elem ); }; jQuery.expr.pseudos.visible = function( elem ) { return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); }; jQuery.ajaxSettings.xhr = function() { try { return new window.XMLHttpRequest(); } catch ( e ) {} }; var xhrSuccessStatus = { // File protocol always yields status code 0, assume 200 0: 200, // Support: IE <=9 only // #1450: sometimes IE returns 1223 when it should be 204 1223: 204 }, xhrSupported = jQuery.ajaxSettings.xhr(); support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); support.ajax = xhrSupported = !!xhrSupported; jQuery.ajaxTransport( function( options ) { var callback, errorCallback; // Cross domain only allowed if supported through XMLHttpRequest if ( support.cors || xhrSupported && !options.crossDomain ) { return { send: function( headers, complete ) { var i, xhr = options.xhr(); xhr.open( options.type, options.url, options.async, options.username, options.password ); // Apply custom fields if provided if ( options.xhrFields ) { for ( i in options.xhrFields ) { xhr[ i ] = options.xhrFields[ i ]; } } // Override mime type if needed if ( options.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( options.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Set headers for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } // Callback callback = function( type ) { return function() { if ( callback ) { callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null; if ( type === "abort" ) { xhr.abort(); } else if ( type === "error" ) { // Support: IE <=9 only // On a manual native abort, IE9 throws // errors on any property access that is not readyState if ( typeof xhr.status !== "number" ) { complete( 0, "error" ); } else { complete( // File: protocol always yields status 0; see #8605, #14207 xhr.status, xhr.statusText ); } } else { complete( xhrSuccessStatus[ xhr.status ] || xhr.status, xhr.statusText, // Support: IE <=9 only // IE9 has no XHR2 but throws on binary (trac-11426) // For XHR2 non-text, let the caller handle it (gh-2498) ( xhr.responseType || "text" ) !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText }, xhr.getAllResponseHeaders() ); } } }; }; // Listen to events xhr.onload = callback(); errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); // Support: IE 9 only // Use onreadystatechange to replace onabort // to handle uncaught aborts if ( xhr.onabort !== undefined ) { xhr.onabort = errorCallback; } else { xhr.onreadystatechange = function() { // Check readyState before timeout as it changes if ( xhr.readyState === 4 ) { // Allow onerror to be called first, // but that will not handle a native abort // Also, save errorCallback to a variable // as xhr.onerror cannot be accessed window.setTimeout( function() { if ( callback ) { errorCallback(); } } ); } }; } // Create the abort callback callback = callback( "abort" ); try { // Do send the request (this may raise an exception) xhr.send( options.hasContent && options.data || null ); } catch ( e ) { // #14683: Only rethrow if this hasn't been notified as an error yet if ( callback ) { throw e; } } }, abort: function() { if ( callback ) { callback(); } } }; } } ); // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) jQuery.ajaxPrefilter( function( s ) { if ( s.crossDomain ) { s.contents.script = false; } } ); // Install script dataType jQuery.ajaxSetup( { accepts: { script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } } ); // Handle cache's special case and crossDomain jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; } } ); // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { // This transport only deals with cross domain or forced-by-attrs requests if ( s.crossDomain || s.scriptAttrs ) { var script, callback; return { send: function( _, complete ) { script = jQuery( "
Package petsc4py :: Module PETSc :: Class PC :: Class GASMType
[hide private]
[frames] | no frames]

Class GASMType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BASIC = 3
  INTERPOLATE = 2
  NONE = 0
  RESTRICT = 1
  __qualname__ = 'PCGASMType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_option_2.png0000644000175000017500000000237314062764465024327 0ustar balaybalay00000000000000PNG  IHDRG$'bKGDIDAThmLSWɫebĆB`e"Qb&b(PCc3QBD.|`*h L@M3Y0 MAFf6(+;+n/I{syοϹ۫Cq xH ##呛ʑ@-"-)yB85՜$nLzP$'{J ds$zyRp8z.D=ׯzTr._Jj~>V+Z-g͢nݥKQZ]ͥ~A j$~Jޚ6*KX8'7a4-qiL$#"hܲϕsSXV4YYdlol5infqY6 t8_T$ ޾Ɲ;)-͛x2C.su0Igs~وj2l6jeGSgfՒSZʉv\H5 ٳGGy.`R]_n7-gP\UGYS[6_aZ 89qn: ߹Ñ:S{@RNfbh(NKֆkxkM JA`߸&*V=:ֲ2vtLJ:4+XzvKz̝1>I&&-=9_:ϐ ~͙ɓbC.ǎ~j*<B&έ!ALvgH|&q=n.)E}3V\ۇ)=]rϜ9ϟ47cJK5/屽JTgE|Nq MUU( tj5'ab&T*%PTYɉvwbcYy˗cX&h%K$~!د]c@'<4Svk#qhܑ:~%N!,$ֆU h@w lib

Module lib


Functions

Import
ImportPETSc
getInitArgs
getPathArch
getPathArchPETSc

Variables

__package__
__warningregistry__

[hide private] petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DM.BoundaryType-class.html0000644000175000017500000002205314062764457025401 0ustar balaybalay00000000000000 petsc4py.PETSc.DM.BoundaryType
Package petsc4py :: Module PETSc :: Class DM :: Class BoundaryType
[hide private]
[frames] | no frames]

Class BoundaryType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  GHOSTED = 1
  MIRROR = 2
  NONE = 0
  PERIODIC = 3
  TWIST = 4
  __qualname__ = 'DMBoundaryType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_structure.png0000644000175000017500000000237714062764462024637 0ustar balaybalay00000000000000PNG  IHDRU$wibKGDIDAThkLZg:PDP.K`/]kݬlDZM46x: ڥ:qT-e&kVvSM`F;dւ0eH ɎOo}<<9n c bc;GH$eb'`V*]'K.]II>[*r b}o6n tɔfW6/\)#GvӧwL656=6^}}ƍ$=x0F\$[ffr7QHNN:#ǏKD^ldztZ4ع ,L_eմ.,/(F,Ll͝+*Ήcj/cGPxN,N>u_FGIX+, P*6 Wd{N1Zo4Zm@g0|I+(pQ0[,s8GÇ LMykg#c}}ryӵk!9w/$QL&-gKy~~jbtݹCml|vr[VWW,(*gK}GDZ۷#tq;wΘZߋD/^CVRΜqF#%0;3/64p8BWׯ葻1@.M++D&k]lvxh(:= -K"wq8>ykojimsm ۻ:=>&ƱGC"WVJL̔&ZxW(\1 5EfG!H 7{{ujqW+,l~i |.xDGX$q<='>!&ڳV(8 ZmcII4VLIqBa2gf13;/[:'#EKK.FBG"Xm6JD&}=.B rwW"K&϶l`ݿ߰R`ipiGm/T-$M?-IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.MGCycleType-class.html0000644000175000017500000002040014062764463025072 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.MGCycleType
Package petsc4py :: Module PETSc :: Class PC :: Class MGCycleType
[hide private]
[frames] | no frames]

Class MGCycleType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  V = 1
  W = 2
  __qualname__ = 'PCMGCycleType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_assemblyty.png0000644000175000017500000000355214062764462024767 0ustar balaybalay00000000000000PNG  IHDRw$#bKGDIDATx}LTWg1bKT:VRA#b-n@.J,dcSЦnQF-mEbڢKK-#HQ?8 ܪ' {s;32lF9)HrH1>iii[Y%\;њcD<\$~'jV͍ IHBkoW^]q]k}opc\ܟjJZ::(~q۷ijia쫖.ekٲ'RtEC4sqOFČ&F4s+z-5}EE|֮\Hqu5 4voڄ˄;wx9ʓj5 <qp{9RJśgh$+-K9y`6٘dRҺu:';wQn+nphJԞ9t6YÊhz֯\\˩L͙ |Dj;vd$&T(ҕ+A_!]El^ڿ=3Iٹa{{;tHx>765YBO>`ۊ://'e |}Yf}b v* H%iv <=< W''Ath(__`Sknm:uwMq1L޻0؈G"+,!gx}0=p_HttwQ)cCb͍d~DžqsqZߏ˩ 'qy!/;##LT>MVZQQEFHFCLX6N67Wվ>]]vp@`U* pOĄsʢ'ht efj?Q1&UT܊zI:qJ4TJ%寽 x,kjljN*Ϸrڴ㍁hcyqqx{pIo+fL&\Uc~wucb„#35.(=RI|d$t04ǔͭXEŋpsCdL&Z- SSIھ\JZ7o橔1>8|Z 9T;ϖ, ӧE V4s\;F2׎̵cnε{EBd6+#-v̘+\~f#kH1jBxwIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.ViewerHDF5-class.html0000644000175000017500000005323014062764465024325 0ustar balaybalay00000000000000 petsc4py.PETSc.ViewerHDF5
Package petsc4py :: Module PETSc :: Class ViewerHDF5
[hide private]
[frames] | no frames]

Class ViewerHDF5


Nested Classes [hide private]

Inherited from Viewer: Format, Mode, Size, Type

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, name, mode=None, comm=None)
 
getGroup(self)
 
getTimestep(self)
 
incrementTimestep(self)
 
popGroup(self)
 
pushGroup(self, group)
 
setTimestep(self, timestep)

Inherited from Viewer: ASCII, BINARY, DRAW, STDERR, STDOUT, __call__, addASCIITab, clearDraw, createASCII, createBinary, createDraw, createHDF5, createMPIIO, createVTK, destroy, flush, getASCIITab, getFileMode, getFileName, getFormat, getType, popASCIISynchronized, popASCIITab, popFormat, printfASCII, printfASCIISynchronized, pushASCIISynchronized, pushASCIITab, pushFormat, setASCIITab, setDrawInfo, setFileMode, setFileName, setType, subtractASCIITab, useASCIITabs, view

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, name, mode=None, comm=None)

 
Overrides: Viewer.create

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.GAMGType-class.html0000644000175000017500000002153514062764463024334 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.GAMGType
Package petsc4py :: Module PETSc :: Class PC :: Class GAMGType
[hide private]
[frames] | no frames]

Class GAMGType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  AGG = 'agg'
  CLASSICAL = 'classical'
  GEO = 'geo'
  __qualname__ = 'PCGAMGType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.LogClass-class.html0000644000175000017500000003172014062764461024160 0ustar balaybalay00000000000000 petsc4py.PETSc.LogClass
Package petsc4py :: Module PETSc :: Class LogClass
[hide private]
[frames] | no frames]

Class LogClass


Instance Methods [hide private]
 
__int__() <==> int(x)
 
__long__() <==> long(x)
a new object with type S, a subtype of T
__new__(S, ...)
 
activate(self)
 
deactivate(self)
 
getActive(self)
 
getName(self)
 
setActive(self, flag)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  active
  id
  name

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_fe.png0000644000175000017500000000326214062764461023162 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDgIDATxoHSkǿGNQhg/%fXQ$ً^TD"zQ z+2BŴ?j+fHZ6}m;ÞG "'I rp9 g\.:;;QK\  V+آVDKV5hs.Àa @ Vl6ĉp8Ç{|>crrRrdA9Xf ڠVa4p8zj\xxzA'}ahhHr;!̅ 2 / 6-ZN'v*))Ss7BV ׯ_$ݻ߿lق;w`HMMhċ/ QZZ ˅m۶p p1T*֑rby};uTNR zdX\.Àa0rSs$|0Y|$of0H #cxIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_convergedr_2.png0000644000175000017500000000451614062764464025155 0ustar balaybalay00000000000000PNG  IHDR$SbKGD IDATx}TTe?0K )H, ȫRR&uӊ[= *Ц(ytCA aDyyFdmpj(is9e ! pw~>f,3tP\\Z1VhkKдi?e,=Z˴%h4/"eB7$3YtF0h|_TlˣWDǪqB{{yq^x Μ?)D8…(,-`ceElHX+]]dO̝ ZWNr%ogcHǞ11ڭ[rscL0lCscQ͸dԩ$k,XiCΕ.>ܿ3{j```JkGf_wo/998|b"(JZVy.zJ¥ROL$cf{x4:Zd~5m#I>;xD,3P./ת˃MHdz|ں{7,MM~ ¥Qwn+))<D,&.4GRa""6,-ǥfyjBkGJ cdDY\NAI HKoo o4R oqtͺ܀<+*"NUV2А 9Mmmh2zzj =Ȉ]]8-k149#)ߟZܹ$EEfQ6nNlHȨ ɨf"4(ר('ubDZ`Lbce4tO-Ұ05SQӃ-sV"#QP'&&>(xG+O rq=}}H57U#n#j~` 7ߌ}9-_NNVace#|(;}m~^yU'e2zG044^~> 䫲2x'1!!$;''`/ҩP₳=ݰ?p#'Or/KK9[]}W=Ŝ|}={= Ũ'ϝƆšXYQ.Sc$xuuʣ99*.^~n|]#k*xK/1orml$v|~hՆ)R),\x'3+lgGBR{HL-,兙:U&$HO_߈i6wi)h͜,KKlK2{e2v})yҒF32zQ_D}_ Oj388CNNH;Q*hk50~SP$?P Hxl,Eeei ׮eB$^e޽4BX{sE ^5^KJ7oh`mJ ' ZZhn.BB,ښZZ'۷sJ׳6%% NO4MٳĦt|BY|G^OHL njᕰ0瓘&]OD#qq!$&KUUtvuwF#gKKٟfj.=Օg mlG2d..;,($ׯs,?-11ann2,ښ&1\.珦&X[GNN8u5Au:\%4*kt:z::[|}3j[qD9M^m fc //|<=-gLq1?\F* ;Ԑu$Ck/lf܋-HwwؙT"AŞM]ў_gRI\d${K̶m|a!3gZĴj5֑ЫDwaޛoMu]BBx}byKc塡}jw |>-d όMDAq1ON\]OOf3zZZ[077\ƶ6.UU1\.G^ +rz{3\.tQ/>RN'Ǐgf~Seh\#,tllc$赦VՒPM?}ށͰ#D3 ;B4ÎͰ#nΖ[~0 petsc4py.PETSc.Section
Package petsc4py :: Module PETSc :: Class Section
[hide private]
[frames] | no frames]

Class Section


Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
addConstraintDof(self, point, numDof)
 
addDof(self, point, numDof)
 
addFieldConstraintDof(self, point, field, numDof)
 
addFieldDof(self, point, field, numDof)
 
clone(self)
 
create(self, comm=None)
 
createGlobalSection(self, SF sf)
 
destroy(self)
 
getChart(self)
 
getConstrainedStorageSize(self)
 
getConstraintDof(self, point)
 
getConstraintIndices(self, point)
 
getDof(self, point)
 
getFieldComponents(self, field)
 
getFieldConstraintDof(self, point, field)
 
getFieldConstraintIndices(self, point, field)
 
getFieldDof(self, point, field)
 
getFieldName(self, field)
 
getFieldOffset(self, point, field)
 
getMaxDof(self)
 
getNumFields(self)
 
getOffset(self, point)
 
getOffsetRange(self)
 
getStorageSize(self)
 
reset(self)
 
setChart(self, pStart, pEnd)
 
setConstraintDof(self, point, numDof)
 
setConstraintIndices(self, point, indices)
 
setDof(self, point, numDof)
 
setFieldComponents(self, field, numComp)
 
setFieldConstraintDof(self, point, field, numDof)
 
setFieldConstraintIndices(self, point, field, indices)
 
setFieldDof(self, point, field, numDof)
 
setFieldName(self, field, fieldName)
 
setFieldOffset(self, point, field, offset)
 
setNumFields(self, numFields)
 
setOffset(self, point, offset)
 
setUp(self)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, getType, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/api-objects.txt0000644000175000017500000126216614062764465020751 0ustar balaybalay00000000000000petsc4py petsc4py-module.html petsc4py.__credits__ petsc4py-module.html#__credits__ petsc4py.get_include petsc4py-module.html#get_include petsc4py.init petsc4py-module.html#init petsc4py.__package__ petsc4py-module.html#__package__ petsc4py.get_config petsc4py-module.html#get_config petsc4py.PETSc petsc4py.PETSc-module.html petsc4py.PETSc.DEFAULT petsc4py.PETSc-module.html#DEFAULT petsc4py.PETSc.COMM_NULL petsc4py.PETSc-module.html#COMM_NULL petsc4py.PETSc.__pyx_capi__ petsc4py.PETSc-module.html#__pyx_capi__ petsc4py.PETSc.__arch__ petsc4py.PETSc-module.html#__arch__ petsc4py.PETSc.DECIDE petsc4py.PETSc-module.html#DECIDE petsc4py.PETSc.COMM_WORLD petsc4py.PETSc-module.html#COMM_WORLD petsc4py.PETSc.DETERMINE petsc4py.PETSc-module.html#DETERMINE petsc4py.PETSc.NINFINITY petsc4py.PETSc-module.html#NINFINITY petsc4py.PETSc._finalize petsc4py.PETSc-module.html#_finalize petsc4py.PETSc.INFINITY petsc4py.PETSc-module.html#INFINITY petsc4py.PETSc.__warningregistry__ petsc4py.PETSc-module.html#__warningregistry__ petsc4py.PETSc._initialize petsc4py.PETSc-module.html#_initialize petsc4py.PETSc.__type_registry__ petsc4py.PETSc-module.html#__type_registry__ petsc4py.PETSc.__package__ petsc4py.PETSc-module.html#__package__ petsc4py.PETSc.COMM_SELF petsc4py.PETSc-module.html#COMM_SELF petsc4py.PETSc.PINFINITY petsc4py.PETSc-module.html#PINFINITY petsc4py.lib petsc4py.lib-module.html petsc4py.lib.getInitArgs petsc4py.lib-module.html#getInitArgs petsc4py.lib.getPathArch petsc4py.lib-module.html#getPathArch petsc4py.lib.ImportPETSc petsc4py.lib-module.html#ImportPETSc petsc4py.lib.__warningregistry__ petsc4py.lib-module.html#__warningregistry__ petsc4py.lib.__package__ petsc4py.lib-module.html#__package__ petsc4py.lib.Import petsc4py.lib-module.html#Import petsc4py.lib.getPathArchPETSc petsc4py.lib-module.html#getPathArchPETSc petsc4py.PETSc.AO petsc4py.PETSc.AO-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.AO.Type petsc4py.PETSc.AO.Type-class.html petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.AO.__new__ petsc4py.PETSc.AO-class.html#__new__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.AO.createMemoryScalable petsc4py.PETSc.AO-class.html#createMemoryScalable petsc4py.PETSc.AO.destroy petsc4py.PETSc.AO-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.AO.getType petsc4py.PETSc.AO-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.AO.petsc2app petsc4py.PETSc.AO-class.html#petsc2app petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.AO.createMapping petsc4py.PETSc.AO-class.html#createMapping petsc4py.PETSc.AO.createBasic petsc4py.PETSc.AO-class.html#createBasic petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.AO.app2petsc petsc4py.PETSc.AO-class.html#app2petsc petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.AO.view petsc4py.PETSc.AO-class.html#view petsc4py.PETSc.AO.Type petsc4py.PETSc.AO.Type-class.html petsc4py.PETSc.AO.Type.MAPPING petsc4py.PETSc.AO.Type-class.html#MAPPING petsc4py.PETSc.AO.Type.__qualname__ petsc4py.PETSc.AO.Type-class.html#__qualname__ petsc4py.PETSc.AO.Type.MEMORYSCALABLE petsc4py.PETSc.AO.Type-class.html#MEMORYSCALABLE petsc4py.PETSc.AO.Type.BASIC petsc4py.PETSc.AO.Type-class.html#BASIC petsc4py.PETSc.AO.Type.ADVANCED petsc4py.PETSc.AO.Type-class.html#ADVANCED petsc4py.PETSc.Comm petsc4py.PETSc.Comm-class.html petsc4py.PETSc.Comm.tompi4py petsc4py.PETSc.Comm-class.html#tompi4py petsc4py.PETSc.Comm.rank petsc4py.PETSc.Comm-class.html#rank petsc4py.PETSc.Comm.getSize petsc4py.PETSc.Comm-class.html#getSize petsc4py.PETSc.Comm.Dup petsc4py.PETSc.Comm-class.html#Dup petsc4py.PETSc.Comm.__lt__ petsc4py.PETSc.Comm-class.html#__lt__ petsc4py.PETSc.Comm.size petsc4py.PETSc.Comm-class.html#size petsc4py.PETSc.Comm.__new__ petsc4py.PETSc.Comm-class.html#__new__ petsc4py.PETSc.Comm.Barrier petsc4py.PETSc.Comm-class.html#Barrier petsc4py.PETSc.Comm.Clone petsc4py.PETSc.Comm-class.html#Clone petsc4py.PETSc.Comm.Free petsc4py.PETSc.Comm-class.html#Free petsc4py.PETSc.Comm.fortran petsc4py.PETSc.Comm-class.html#fortran petsc4py.PETSc.Comm.duplicate petsc4py.PETSc.Comm-class.html#duplicate petsc4py.PETSc.Comm.destroy petsc4py.PETSc.Comm-class.html#destroy petsc4py.PETSc.Comm.__ne__ petsc4py.PETSc.Comm-class.html#__ne__ petsc4py.PETSc.Comm.barrier petsc4py.PETSc.Comm-class.html#barrier petsc4py.PETSc.Comm.Get_rank petsc4py.PETSc.Comm-class.html#Get_rank petsc4py.PETSc.Comm.Get_size petsc4py.PETSc.Comm-class.html#Get_size petsc4py.PETSc.Comm.__gt__ petsc4py.PETSc.Comm-class.html#__gt__ petsc4py.PETSc.Comm.__eq__ petsc4py.PETSc.Comm-class.html#__eq__ petsc4py.PETSc.Comm.__nonzero__ petsc4py.PETSc.Comm-class.html#__nonzero__ petsc4py.PETSc.Comm.getRank petsc4py.PETSc.Comm-class.html#getRank petsc4py.PETSc.Comm.__le__ petsc4py.PETSc.Comm-class.html#__le__ petsc4py.PETSc.Comm.__ge__ petsc4py.PETSc.Comm-class.html#__ge__ petsc4py.PETSc.DM petsc4py.PETSc.DM-class.html petsc4py.PETSc.DM.getLGMap petsc4py.PETSc.DM-class.html#getLGMap petsc4py.PETSc.DM.getStratumIS petsc4py.PETSc.DM-class.html#getStratumIS petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DM.restoreLocalVec petsc4py.PETSc.DM-class.html#restoreLocalVec petsc4py.PETSc.DM.getLabel petsc4py.PETSc.DM-class.html#getLabel petsc4py.PETSc.DM.adaptMetric petsc4py.PETSc.DM-class.html#adaptMetric petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.DM.createGlobalVec petsc4py.PETSc.DM-class.html#createGlobalVec petsc4py.PETSc.DM.createDS petsc4py.PETSc.DM-class.html#createDS petsc4py.PETSc.DM.clearLabelStratum petsc4py.PETSc.DM-class.html#clearLabelStratum petsc4py.PETSc.DM.getGlobalSection petsc4py.PETSc.DM-class.html#getGlobalSection petsc4py.PETSc.DM.createMatrix petsc4py.PETSc.DM-class.html#createMatrix petsc4py.PETSc.DM.viewFromOptions petsc4py.PETSc.DM-class.html#viewFromOptions petsc4py.PETSc.DM.getBasicAdjacency petsc4py.PETSc.DM-class.html#getBasicAdjacency petsc4py.PETSc.DM.addField petsc4py.PETSc.DM-class.html#addField petsc4py.PETSc.DM.removeLabel petsc4py.PETSc.DM-class.html#removeLabel petsc4py.PETSc.DM.getLocalVec petsc4py.PETSc.DM-class.html#getLocalVec petsc4py.PETSc.DM.coarsen petsc4py.PETSc.DM-class.html#coarsen petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DM.copyFields petsc4py.PETSc.DM-class.html#copyFields petsc4py.PETSc.DM.getLabelValue petsc4py.PETSc.DM-class.html#getLabelValue petsc4py.PETSc.DM.getStratumSize petsc4py.PETSc.DM-class.html#getStratumSize petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.DM.getLabelIdIS petsc4py.PETSc.DM-class.html#getLabelIdIS petsc4py.PETSc.DM.setOptionsPrefix petsc4py.PETSc.DM-class.html#setOptionsPrefix petsc4py.PETSc.DM.setFieldAdjacency petsc4py.PETSc.DM-class.html#setFieldAdjacency petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DM.createGlobalVector petsc4py.PETSc.DM-class.html#createGlobalVector petsc4py.PETSc.DM.getDefaultSF petsc4py.PETSc.DM-class.html#getDefaultSF petsc4py.PETSc.DM.setNumFields petsc4py.PETSc.DM-class.html#setNumFields petsc4py.PETSc.DM.setFromOptions petsc4py.PETSc.DM-class.html#setFromOptions petsc4py.PETSc.DM.setSectionSF petsc4py.PETSc.DM-class.html#setSectionSF petsc4py.PETSc.DM.destroy petsc4py.PETSc.DM-class.html#destroy petsc4py.PETSc.DM.setDimension petsc4py.PETSc.DM-class.html#setDimension petsc4py.PETSc.DM.hasLabel petsc4py.PETSc.DM-class.html#hasLabel petsc4py.PETSc.DM.ds petsc4py.PETSc.DM-class.html#ds petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.DM.setAppCtx petsc4py.PETSc.DM-class.html#setAppCtx petsc4py.PETSc.DM.setGlobalSection petsc4py.PETSc.DM-class.html#setGlobalSection petsc4py.PETSc.DM.createFieldDecomposition petsc4py.PETSc.DM-class.html#createFieldDecomposition petsc4py.PETSc.DM.getCoordinateDim petsc4py.PETSc.DM-class.html#getCoordinateDim petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.DM.view petsc4py.PETSc.DM-class.html#view petsc4py.PETSc.DM.getDefaultSection petsc4py.PETSc.DM-class.html#getDefaultSection petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DM.createRestriction petsc4py.PETSc.DM-class.html#createRestriction petsc4py.PETSc.DM.setField petsc4py.PETSc.DM-class.html#setField petsc4py.PETSc.DM.localizeCoordinates petsc4py.PETSc.DM-class.html#localizeCoordinates petsc4py.PETSc.DM.getBlockSize petsc4py.PETSc.DM-class.html#getBlockSize petsc4py.PETSc.DM.refineHierarchy petsc4py.PETSc.DM-class.html#refineHierarchy petsc4py.PETSc.DM.Type petsc4py.PETSc.DM.Type-class.html petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.DM.getCoordinates petsc4py.PETSc.DM-class.html#getCoordinates petsc4py.PETSc.DM.createInterpolation petsc4py.PETSc.DM-class.html#createInterpolation petsc4py.PETSc.DM.getDimension petsc4py.PETSc.DM-class.html#getDimension petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.DM.setVecType petsc4py.PETSc.DM-class.html#setVecType petsc4py.PETSc.DM.globalToLocal petsc4py.PETSc.DM-class.html#globalToLocal petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DM.setDefaultSF petsc4py.PETSc.DM-class.html#setDefaultSF petsc4py.PETSc.DM.setType petsc4py.PETSc.DM-class.html#setType petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.DM.getLabelName petsc4py.PETSc.DM-class.html#getLabelName petsc4py.PETSc.DM.createSectionSF petsc4py.PETSc.DM-class.html#createSectionSF petsc4py.PETSc.DM.setUp petsc4py.PETSc.DM-class.html#setUp petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.DM.getDS petsc4py.PETSc.DM-class.html#getDS petsc4py.PETSc.DM.getPointSF petsc4py.PETSc.DM-class.html#getPointSF petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.DM.setSNESJacobian petsc4py.PETSc.DM-class.html#setSNESJacobian petsc4py.PETSc.DM.createLabel petsc4py.PETSc.DM-class.html#createLabel petsc4py.PETSc.DM.getMatrix petsc4py.PETSc.DM-class.html#getMatrix petsc4py.PETSc.DM.getDefaultGlobalSection petsc4py.PETSc.DM-class.html#getDefaultGlobalSection petsc4py.PETSc.DM.clearLabelValue petsc4py.PETSc.DM-class.html#clearLabelValue petsc4py.PETSc.DM.convert petsc4py.PETSc.DM-class.html#convert petsc4py.PETSc.DM.setDefaultGlobalSection petsc4py.PETSc.DM-class.html#setDefaultGlobalSection petsc4py.PETSc.DM.getCoordinatesLocal petsc4py.PETSc.DM-class.html#getCoordinatesLocal petsc4py.PETSc.DM.getLabelOutput petsc4py.PETSc.DM-class.html#getLabelOutput petsc4py.PETSc.DM.appctx petsc4py.PETSc.DM-class.html#appctx petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.DM.load petsc4py.PETSc.DM-class.html#load petsc4py.PETSc.DM.getRefineLevel petsc4py.PETSc.DM-class.html#getRefineLevel petsc4py.PETSc.DM.setLabelValue petsc4py.PETSc.DM-class.html#setLabelValue petsc4py.PETSc.DM.setCoordinates petsc4py.PETSc.DM-class.html#setCoordinates petsc4py.PETSc.DM.adaptLabel petsc4py.PETSc.DM-class.html#adaptLabel petsc4py.PETSc.DM.createMat petsc4py.PETSc.DM-class.html#createMat petsc4py.PETSc.DM.createLocalVector petsc4py.PETSc.DM-class.html#createLocalVector petsc4py.PETSc.DM.getCoordinateSection petsc4py.PETSc.DM-class.html#getCoordinateSection petsc4py.PETSc.DM.setMatType petsc4py.PETSc.DM-class.html#setMatType petsc4py.PETSc.DM.addCoarsenHook petsc4py.PETSc.DM-class.html#addCoarsenHook petsc4py.PETSc.DM.getSection petsc4py.PETSc.DM-class.html#getSection petsc4py.PETSc.DM.create petsc4py.PETSc.DM-class.html#create petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DM.getCoordinateDM petsc4py.PETSc.DM-class.html#getCoordinateDM petsc4py.PETSc.DM.getNumLabels petsc4py.PETSc.DM-class.html#getNumLabels petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DM.createInjection petsc4py.PETSc.DM-class.html#createInjection petsc4py.PETSc.DM.setSNESFunction petsc4py.PETSc.DM-class.html#setSNESFunction petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.DM.getType petsc4py.PETSc.DM-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DM.getAppCtx petsc4py.PETSc.DM-class.html#getAppCtx petsc4py.PETSc.DM.setPointSF petsc4py.PETSc.DM-class.html#setPointSF petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.DM.copyDS petsc4py.PETSc.DM-class.html#copyDS petsc4py.PETSc.DM.getField petsc4py.PETSc.DM-class.html#getField petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.DM.getCoarsenLevel petsc4py.PETSc.DM-class.html#getCoarsenLevel petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.DM.setCoordinateDim petsc4py.PETSc.DM-class.html#setCoordinateDim petsc4py.PETSc.DM.setRefineLevel petsc4py.PETSc.DM-class.html#setRefineLevel petsc4py.PETSc.DM.setSection petsc4py.PETSc.DM-class.html#setSection petsc4py.PETSc.DM.refine petsc4py.PETSc.DM-class.html#refine petsc4py.PETSc.DM.createLocalVec petsc4py.PETSc.DM-class.html#createLocalVec petsc4py.PETSc.DM.restoreGlobalVec petsc4py.PETSc.DM-class.html#restoreGlobalVec petsc4py.PETSc.DM.getGlobalVec petsc4py.PETSc.DM-class.html#getGlobalVec petsc4py.PETSc.DM.setKSPComputeOperators petsc4py.PETSc.DM-class.html#setKSPComputeOperators petsc4py.PETSc.DM.localToLocal petsc4py.PETSc.DM-class.html#localToLocal petsc4py.PETSc.DM.__new__ petsc4py.PETSc.DM-class.html#__new__ petsc4py.PETSc.DM.getLabelSize petsc4py.PETSc.DM-class.html#getLabelSize petsc4py.PETSc.DM.localToGlobal petsc4py.PETSc.DM-class.html#localToGlobal petsc4py.PETSc.DM.getLocalBoundingBox petsc4py.PETSc.DM-class.html#getLocalBoundingBox petsc4py.PETSc.DM.coarsenHierarchy petsc4py.PETSc.DM-class.html#coarsenHierarchy petsc4py.PETSc.DM.getBoundingBox petsc4py.PETSc.DM-class.html#getBoundingBox petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.DM.createDefaultSF petsc4py.PETSc.DM-class.html#createDefaultSF petsc4py.PETSc.DM.setCoordinatesLocal petsc4py.PETSc.DM-class.html#setCoordinatesLocal petsc4py.PETSc.DM.clone petsc4py.PETSc.DM-class.html#clone petsc4py.PETSc.DM.setDefaultSection petsc4py.PETSc.DM-class.html#setDefaultSection petsc4py.PETSc.DM.clearDS petsc4py.PETSc.DM-class.html#clearDS petsc4py.PETSc.DM.getFieldAdjacency petsc4py.PETSc.DM-class.html#getFieldAdjacency petsc4py.PETSc.DM.copyDisc petsc4py.PETSc.DM-class.html#copyDisc petsc4py.PETSc.DM.setBasicAdjacency petsc4py.PETSc.DM-class.html#setBasicAdjacency petsc4py.PETSc.DM.setLabelOutput petsc4py.PETSc.DM-class.html#setLabelOutput petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DM.getNumFields petsc4py.PETSc.DM-class.html#getNumFields petsc4py.PETSc.DM.getSectionSF petsc4py.PETSc.DM-class.html#getSectionSF petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DM.BoundaryType.__qualname__ petsc4py.PETSc.DM.BoundaryType-class.html#__qualname__ petsc4py.PETSc.DM.BoundaryType.NONE petsc4py.PETSc.DM.BoundaryType-class.html#NONE petsc4py.PETSc.DM.BoundaryType.TWIST petsc4py.PETSc.DM.BoundaryType-class.html#TWIST petsc4py.PETSc.DM.BoundaryType.PERIODIC petsc4py.PETSc.DM.BoundaryType-class.html#PERIODIC petsc4py.PETSc.DM.BoundaryType.MIRROR petsc4py.PETSc.DM.BoundaryType-class.html#MIRROR petsc4py.PETSc.DM.BoundaryType.GHOSTED petsc4py.PETSc.DM.BoundaryType-class.html#GHOSTED petsc4py.PETSc.DM.Type petsc4py.PETSc.DM.Type-class.html petsc4py.PETSc.DM.Type.NETWORK petsc4py.PETSc.DM.Type-class.html#NETWORK petsc4py.PETSc.DM.Type.DA petsc4py.PETSc.DM.Type-class.html#DA petsc4py.PETSc.DM.Type.SLICED petsc4py.PETSc.DM.Type-class.html#SLICED petsc4py.PETSc.DM.Type.SWARM petsc4py.PETSc.DM.Type-class.html#SWARM petsc4py.PETSc.DM.Type.P8EST petsc4py.PETSc.DM.Type-class.html#P8EST petsc4py.PETSc.DM.Type.SHELL petsc4py.PETSc.DM.Type-class.html#SHELL petsc4py.PETSc.DM.Type.FOREST petsc4py.PETSc.DM.Type-class.html#FOREST petsc4py.PETSc.DM.Type.P4EST petsc4py.PETSc.DM.Type-class.html#P4EST petsc4py.PETSc.DM.Type.REDUNDANT petsc4py.PETSc.DM.Type-class.html#REDUNDANT petsc4py.PETSc.DM.Type.PLEX petsc4py.PETSc.DM.Type-class.html#PLEX petsc4py.PETSc.DM.Type.PATCH petsc4py.PETSc.DM.Type-class.html#PATCH petsc4py.PETSc.DM.Type.PRODUCT petsc4py.PETSc.DM.Type-class.html#PRODUCT petsc4py.PETSc.DM.Type.STAG petsc4py.PETSc.DM.Type-class.html#STAG petsc4py.PETSc.DM.Type.COMPOSITE petsc4py.PETSc.DM.Type-class.html#COMPOSITE petsc4py.PETSc.DM.Type.MOAB petsc4py.PETSc.DM.Type-class.html#MOAB petsc4py.PETSc.DM.Type.__qualname__ petsc4py.PETSc.DM.Type-class.html#__qualname__ petsc4py.PETSc.DMComposite petsc4py.PETSc.DMComposite-class.html petsc4py.PETSc.DM.getLGMap petsc4py.PETSc.DM-class.html#getLGMap petsc4py.PETSc.DM.getStratumIS petsc4py.PETSc.DM-class.html#getStratumIS petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DM.restoreLocalVec petsc4py.PETSc.DM-class.html#restoreLocalVec petsc4py.PETSc.DM.getLabel petsc4py.PETSc.DM-class.html#getLabel petsc4py.PETSc.DM.createRestriction petsc4py.PETSc.DM-class.html#createRestriction petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.DM.createGlobalVec petsc4py.PETSc.DM-class.html#createGlobalVec petsc4py.PETSc.DM.createDS petsc4py.PETSc.DM-class.html#createDS petsc4py.PETSc.DM.setField petsc4py.PETSc.DM-class.html#setField petsc4py.PETSc.DM.getGlobalSection petsc4py.PETSc.DM-class.html#getGlobalSection petsc4py.PETSc.DM.createMatrix petsc4py.PETSc.DM-class.html#createMatrix petsc4py.PETSc.DM.viewFromOptions petsc4py.PETSc.DM-class.html#viewFromOptions petsc4py.PETSc.DM.getBasicAdjacency petsc4py.PETSc.DM-class.html#getBasicAdjacency petsc4py.PETSc.DM.addField petsc4py.PETSc.DM-class.html#addField petsc4py.PETSc.DM.removeLabel petsc4py.PETSc.DM-class.html#removeLabel petsc4py.PETSc.DM.getLocalVec petsc4py.PETSc.DM-class.html#getLocalVec petsc4py.PETSc.DM.coarsen petsc4py.PETSc.DM-class.html#coarsen petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DM.copyFields petsc4py.PETSc.DM-class.html#copyFields petsc4py.PETSc.DM.getLabelValue petsc4py.PETSc.DM-class.html#getLabelValue petsc4py.PETSc.DM.setCoordinateDim petsc4py.PETSc.DM-class.html#setCoordinateDim petsc4py.PETSc.DM.getStratumSize petsc4py.PETSc.DM-class.html#getStratumSize petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.DM.getLabelIdIS petsc4py.PETSc.DM-class.html#getLabelIdIS petsc4py.PETSc.DM.setOptionsPrefix petsc4py.PETSc.DM-class.html#setOptionsPrefix petsc4py.PETSc.DM.setFieldAdjacency petsc4py.PETSc.DM-class.html#setFieldAdjacency petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DM.createGlobalVector petsc4py.PETSc.DM-class.html#createGlobalVector petsc4py.PETSc.DM.getDefaultSF petsc4py.PETSc.DM-class.html#getDefaultSF petsc4py.PETSc.DM.setNumFields petsc4py.PETSc.DM-class.html#setNumFields petsc4py.PETSc.DM.setFromOptions petsc4py.PETSc.DM-class.html#setFromOptions petsc4py.PETSc.DM.setSectionSF petsc4py.PETSc.DM-class.html#setSectionSF petsc4py.PETSc.DM.getBoundingBox petsc4py.PETSc.DM-class.html#getBoundingBox petsc4py.PETSc.DM.setDimension petsc4py.PETSc.DM-class.html#setDimension petsc4py.PETSc.DM.hasLabel petsc4py.PETSc.DM-class.html#hasLabel petsc4py.PETSc.DMComposite.getAccess petsc4py.PETSc.DMComposite-class.html#getAccess petsc4py.PETSc.DM.ds petsc4py.PETSc.DM-class.html#ds petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.DM.setAppCtx petsc4py.PETSc.DM-class.html#setAppCtx petsc4py.PETSc.DM.setGlobalSection petsc4py.PETSc.DM-class.html#setGlobalSection petsc4py.PETSc.DM.createFieldDecomposition petsc4py.PETSc.DM-class.html#createFieldDecomposition petsc4py.PETSc.DM.getCoordinateDim petsc4py.PETSc.DM-class.html#getCoordinateDim petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.DM.view petsc4py.PETSc.DM-class.html#view petsc4py.PETSc.DM.getDefaultSection petsc4py.PETSc.DM-class.html#getDefaultSection petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DM.adaptMetric petsc4py.PETSc.DM-class.html#adaptMetric petsc4py.PETSc.DM.localizeCoordinates petsc4py.PETSc.DM-class.html#localizeCoordinates petsc4py.PETSc.DM.getBlockSize petsc4py.PETSc.DM-class.html#getBlockSize petsc4py.PETSc.DM.refineHierarchy petsc4py.PETSc.DM-class.html#refineHierarchy petsc4py.PETSc.DM.Type petsc4py.PETSc.DM.Type-class.html petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.DM.getCoordinates petsc4py.PETSc.DM-class.html#getCoordinates petsc4py.PETSc.DM.createInterpolation petsc4py.PETSc.DM-class.html#createInterpolation petsc4py.PETSc.DM.clearLabelStratum petsc4py.PETSc.DM-class.html#clearLabelStratum petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.DM.setVecType petsc4py.PETSc.DM-class.html#setVecType petsc4py.PETSc.DM.globalToLocal petsc4py.PETSc.DM-class.html#globalToLocal petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DM.setDefaultSF petsc4py.PETSc.DM-class.html#setDefaultSF petsc4py.PETSc.DM.addCoarsenHook petsc4py.PETSc.DM-class.html#addCoarsenHook petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.DM.getLabelName petsc4py.PETSc.DM-class.html#getLabelName petsc4py.PETSc.DM.createSectionSF petsc4py.PETSc.DM-class.html#createSectionSF petsc4py.PETSc.DM.setUp petsc4py.PETSc.DM-class.html#setUp petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.DM.getDS petsc4py.PETSc.DM-class.html#getDS petsc4py.PETSc.DM.getPointSF petsc4py.PETSc.DM-class.html#getPointSF petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.DMComposite.getLocalISs petsc4py.PETSc.DMComposite-class.html#getLocalISs petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.DM.setSNESJacobian petsc4py.PETSc.DM-class.html#setSNESJacobian petsc4py.PETSc.DM.createLabel petsc4py.PETSc.DM-class.html#createLabel petsc4py.PETSc.DM.getMatrix petsc4py.PETSc.DM-class.html#getMatrix petsc4py.PETSc.DM.getDefaultGlobalSection petsc4py.PETSc.DM-class.html#getDefaultGlobalSection petsc4py.PETSc.DM.clearLabelValue petsc4py.PETSc.DM-class.html#clearLabelValue petsc4py.PETSc.DM.convert petsc4py.PETSc.DM-class.html#convert petsc4py.PETSc.DM.setDefaultGlobalSection petsc4py.PETSc.DM-class.html#setDefaultGlobalSection petsc4py.PETSc.DM.getCoordinatesLocal petsc4py.PETSc.DM-class.html#getCoordinatesLocal petsc4py.PETSc.DM.getLabelOutput petsc4py.PETSc.DM-class.html#getLabelOutput petsc4py.PETSc.DM.appctx petsc4py.PETSc.DM-class.html#appctx petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.DM.getFieldAdjacency petsc4py.PETSc.DM-class.html#getFieldAdjacency petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.DM.load petsc4py.PETSc.DM-class.html#load petsc4py.PETSc.DM.setLabelValue petsc4py.PETSc.DM-class.html#setLabelValue petsc4py.PETSc.DM.setCoordinates petsc4py.PETSc.DM-class.html#setCoordinates petsc4py.PETSc.DM.adaptLabel petsc4py.PETSc.DM-class.html#adaptLabel petsc4py.PETSc.DM.createMat petsc4py.PETSc.DM-class.html#createMat petsc4py.PETSc.DM.createLocalVector petsc4py.PETSc.DM-class.html#createLocalVector petsc4py.PETSc.DM.getCoordinateSection petsc4py.PETSc.DM-class.html#getCoordinateSection petsc4py.PETSc.DM.setMatType petsc4py.PETSc.DM-class.html#setMatType petsc4py.PETSc.DM.setType petsc4py.PETSc.DM-class.html#setType petsc4py.PETSc.DM.getSection petsc4py.PETSc.DM-class.html#getSection petsc4py.PETSc.DMComposite.create petsc4py.PETSc.DMComposite-class.html#create petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DM.getCoordinateDM petsc4py.PETSc.DM-class.html#getCoordinateDM petsc4py.PETSc.DM.getNumLabels petsc4py.PETSc.DM-class.html#getNumLabels petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DM.getDimension petsc4py.PETSc.DM-class.html#getDimension petsc4py.PETSc.DM.createInjection petsc4py.PETSc.DM-class.html#createInjection petsc4py.PETSc.DM.setSNESFunction petsc4py.PETSc.DM-class.html#setSNESFunction petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.DM.getType petsc4py.PETSc.DM-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DM.getAppCtx petsc4py.PETSc.DM-class.html#getAppCtx petsc4py.PETSc.DM.setPointSF petsc4py.PETSc.DM-class.html#setPointSF petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.DM.copyDS petsc4py.PETSc.DM-class.html#copyDS petsc4py.PETSc.DMComposite.getEntries petsc4py.PETSc.DMComposite-class.html#getEntries petsc4py.PETSc.DM.getField petsc4py.PETSc.DM-class.html#getField petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.DM.setDefaultSection petsc4py.PETSc.DM-class.html#setDefaultSection petsc4py.PETSc.DM.getCoarsenLevel petsc4py.PETSc.DM-class.html#getCoarsenLevel petsc4py.PETSc.DMComposite.scatter petsc4py.PETSc.DMComposite-class.html#scatter petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.DM.getRefineLevel petsc4py.PETSc.DM-class.html#getRefineLevel petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.DM.setRefineLevel petsc4py.PETSc.DM-class.html#setRefineLevel petsc4py.PETSc.DM.setSection petsc4py.PETSc.DM-class.html#setSection petsc4py.PETSc.DM.refine petsc4py.PETSc.DM-class.html#refine petsc4py.PETSc.DM.createLocalVec petsc4py.PETSc.DM-class.html#createLocalVec petsc4py.PETSc.DM.getNumFields petsc4py.PETSc.DM-class.html#getNumFields petsc4py.PETSc.DMComposite.getNumberDM petsc4py.PETSc.DMComposite-class.html#getNumberDM petsc4py.PETSc.DM.getGlobalVec petsc4py.PETSc.DM-class.html#getGlobalVec petsc4py.PETSc.DM.setKSPComputeOperators petsc4py.PETSc.DM-class.html#setKSPComputeOperators petsc4py.PETSc.DMComposite.getLGMaps petsc4py.PETSc.DMComposite-class.html#getLGMaps petsc4py.PETSc.DMComposite.__new__ petsc4py.PETSc.DMComposite-class.html#__new__ petsc4py.PETSc.DMComposite.getNumber petsc4py.PETSc.DMComposite-class.html#getNumber petsc4py.PETSc.DM.getLabelSize petsc4py.PETSc.DM-class.html#getLabelSize petsc4py.PETSc.DM.localToGlobal petsc4py.PETSc.DM-class.html#localToGlobal petsc4py.PETSc.DM.getLocalBoundingBox petsc4py.PETSc.DM-class.html#getLocalBoundingBox petsc4py.PETSc.DM.coarsenHierarchy petsc4py.PETSc.DM-class.html#coarsenHierarchy petsc4py.PETSc.DM.destroy petsc4py.PETSc.DM-class.html#destroy petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.DM.createDefaultSF petsc4py.PETSc.DM-class.html#createDefaultSF petsc4py.PETSc.DM.setCoordinatesLocal petsc4py.PETSc.DM-class.html#setCoordinatesLocal petsc4py.PETSc.DM.clone petsc4py.PETSc.DM-class.html#clone petsc4py.PETSc.DMComposite.addDM petsc4py.PETSc.DMComposite-class.html#addDM petsc4py.PETSc.DM.clearDS petsc4py.PETSc.DM-class.html#clearDS petsc4py.PETSc.DM.localToLocal petsc4py.PETSc.DM-class.html#localToLocal petsc4py.PETSc.DM.copyDisc petsc4py.PETSc.DM-class.html#copyDisc petsc4py.PETSc.DMComposite.getGlobalISs petsc4py.PETSc.DMComposite-class.html#getGlobalISs petsc4py.PETSc.DM.setBasicAdjacency petsc4py.PETSc.DM-class.html#setBasicAdjacency petsc4py.PETSc.DM.setLabelOutput petsc4py.PETSc.DM-class.html#setLabelOutput petsc4py.PETSc.DMComposite.gather petsc4py.PETSc.DMComposite-class.html#gather petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DM.restoreGlobalVec petsc4py.PETSc.DM-class.html#restoreGlobalVec petsc4py.PETSc.DM.getSectionSF petsc4py.PETSc.DM-class.html#getSectionSF petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.DMDA petsc4py.PETSc.DMDA-class.html petsc4py.PETSc.DM.getLGMap petsc4py.PETSc.DM-class.html#getLGMap petsc4py.PETSc.DMDA.proc_sizes petsc4py.PETSc.DMDA-class.html#proc_sizes petsc4py.PETSc.DMDA.StencilType petsc4py.PETSc.DMDA.StencilType-class.html petsc4py.PETSc.DM.getStratumIS petsc4py.PETSc.DM-class.html#getStratumIS petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.DMDA.setRefinementFactor petsc4py.PETSc.DMDA-class.html#setRefinementFactor petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DM.restoreLocalVec petsc4py.PETSc.DM-class.html#restoreLocalVec petsc4py.PETSc.DM.getLabel petsc4py.PETSc.DM-class.html#getLabel petsc4py.PETSc.DM.adaptMetric petsc4py.PETSc.DM-class.html#adaptMetric petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.DM.createGlobalVec petsc4py.PETSc.DM-class.html#createGlobalVec petsc4py.PETSc.DMDA.getRanges petsc4py.PETSc.DMDA-class.html#getRanges petsc4py.PETSc.DMDA.stencil_width petsc4py.PETSc.DMDA-class.html#stencil_width petsc4py.PETSc.DM.getGlobalSection petsc4py.PETSc.DM-class.html#getGlobalSection petsc4py.PETSc.DM.createMatrix petsc4py.PETSc.DM-class.html#createMatrix petsc4py.PETSc.DM.viewFromOptions petsc4py.PETSc.DM-class.html#viewFromOptions petsc4py.PETSc.DM.getBasicAdjacency petsc4py.PETSc.DM-class.html#getBasicAdjacency petsc4py.PETSc.DM.addField petsc4py.PETSc.DM-class.html#addField petsc4py.PETSc.DM.removeLabel petsc4py.PETSc.DM-class.html#removeLabel petsc4py.PETSc.DM.getLocalVec petsc4py.PETSc.DM-class.html#getLocalVec petsc4py.PETSc.DM.coarsen petsc4py.PETSc.DM-class.html#coarsen petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DM.copyFields petsc4py.PETSc.DM-class.html#copyFields petsc4py.PETSc.DM.getLabelSize petsc4py.PETSc.DM-class.html#getLabelSize petsc4py.PETSc.DM.getLabelValue petsc4py.PETSc.DM-class.html#getLabelValue petsc4py.PETSc.DM.setCoordinateDim petsc4py.PETSc.DM-class.html#setCoordinateDim petsc4py.PETSc.DM.getStratumSize petsc4py.PETSc.DM-class.html#getStratumSize petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.DM.getLabelIdIS petsc4py.PETSc.DM-class.html#getLabelIdIS petsc4py.PETSc.DM.setOptionsPrefix petsc4py.PETSc.DM-class.html#setOptionsPrefix petsc4py.PETSc.DMDA.createNaturalVec petsc4py.PETSc.DMDA-class.html#createNaturalVec petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DMDA.setSizes petsc4py.PETSc.DMDA-class.html#setSizes petsc4py.PETSc.DM.getLocalBoundingBox petsc4py.PETSc.DM-class.html#getLocalBoundingBox petsc4py.PETSc.DM.getDefaultSF petsc4py.PETSc.DM-class.html#getDefaultSF petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.DM.setNumFields petsc4py.PETSc.DM-class.html#setNumFields petsc4py.PETSc.DM.setFromOptions petsc4py.PETSc.DM-class.html#setFromOptions petsc4py.PETSc.DM.setSectionSF petsc4py.PETSc.DM-class.html#setSectionSF petsc4py.PETSc.DM.getBoundingBox petsc4py.PETSc.DM-class.html#getBoundingBox petsc4py.PETSc.DM.setDimension petsc4py.PETSc.DM-class.html#setDimension petsc4py.PETSc.DM.hasLabel petsc4py.PETSc.DM-class.html#hasLabel petsc4py.PETSc.DMDA.ElementType petsc4py.PETSc.DMDA.ElementType-class.html petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.DM.ds petsc4py.PETSc.DM-class.html#ds petsc4py.PETSc.DMDA.setElementType petsc4py.PETSc.DMDA-class.html#setElementType petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.DMDA.dim petsc4py.PETSc.DMDA-class.html#dim petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.DM.setAppCtx petsc4py.PETSc.DM-class.html#setAppCtx petsc4py.PETSc.DM.setGlobalSection petsc4py.PETSc.DM-class.html#setGlobalSection petsc4py.PETSc.DMDA.sizes petsc4py.PETSc.DMDA-class.html#sizes petsc4py.PETSc.DMDA.corners petsc4py.PETSc.DMDA-class.html#corners petsc4py.PETSc.DMDA.boundary_type petsc4py.PETSc.DMDA-class.html#boundary_type petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.DMDA.getOwnershipRanges petsc4py.PETSc.DMDA-class.html#getOwnershipRanges petsc4py.PETSc.DM.createFieldDecomposition petsc4py.PETSc.DM-class.html#createFieldDecomposition petsc4py.PETSc.DMDA.getRefinementFactor petsc4py.PETSc.DMDA-class.html#getRefinementFactor petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.DMDA.getSizes petsc4py.PETSc.DMDA-class.html#getSizes petsc4py.PETSc.DM.view petsc4py.PETSc.DM-class.html#view petsc4py.PETSc.DM.getSection petsc4py.PETSc.DM-class.html#getSection petsc4py.PETSc.DM.getDefaultSection petsc4py.PETSc.DM-class.html#getDefaultSection petsc4py.PETSc.DMDA.getGhostCorners petsc4py.PETSc.DMDA-class.html#getGhostCorners petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DM.getCoordinateDim petsc4py.PETSc.DM-class.html#getCoordinateDim petsc4py.PETSc.DM.createRestriction petsc4py.PETSc.DM-class.html#createRestriction petsc4py.PETSc.DM.setField petsc4py.PETSc.DM-class.html#setField petsc4py.PETSc.DMDA.globalToNatural petsc4py.PETSc.DMDA-class.html#globalToNatural petsc4py.PETSc.DM.localizeCoordinates petsc4py.PETSc.DM-class.html#localizeCoordinates petsc4py.PETSc.DM.getBlockSize petsc4py.PETSc.DM-class.html#getBlockSize petsc4py.PETSc.DM.refineHierarchy petsc4py.PETSc.DM-class.html#refineHierarchy petsc4py.PETSc.DM.Type petsc4py.PETSc.DM.Type-class.html petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.DM.getCoordinates petsc4py.PETSc.DM-class.html#getCoordinates petsc4py.PETSc.DM.createDS petsc4py.PETSc.DM-class.html#createDS petsc4py.PETSc.DMDA.setProcSizes petsc4py.PETSc.DMDA-class.html#setProcSizes petsc4py.PETSc.DMDA.setUniformCoordinates petsc4py.PETSc.DMDA-class.html#setUniformCoordinates petsc4py.PETSc.DM.clearLabelStratum petsc4py.PETSc.DM-class.html#clearLabelStratum petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.DM.localToGlobal petsc4py.PETSc.DM-class.html#localToGlobal petsc4py.PETSc.DM.setVecType petsc4py.PETSc.DM-class.html#setVecType petsc4py.PETSc.DMDA.setBoundaryType petsc4py.PETSc.DMDA-class.html#setBoundaryType petsc4py.PETSc.DM.globalToLocal petsc4py.PETSc.DM-class.html#globalToLocal petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DM.setDefaultSF petsc4py.PETSc.DM-class.html#setDefaultSF petsc4py.PETSc.DM.addCoarsenHook petsc4py.PETSc.DM-class.html#addCoarsenHook petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.DMDA.getDof petsc4py.PETSc.DMDA-class.html#getDof petsc4py.PETSc.DM.getLabelName petsc4py.PETSc.DM-class.html#getLabelName petsc4py.PETSc.DM.createSectionSF petsc4py.PETSc.DM-class.html#createSectionSF petsc4py.PETSc.DM.setUp petsc4py.PETSc.DM-class.html#setUp petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.DM.getDS petsc4py.PETSc.DM-class.html#getDS petsc4py.PETSc.DM.getPointSF petsc4py.PETSc.DM-class.html#getPointSF petsc4py.PETSc.DMDA.ranges petsc4py.PETSc.DMDA-class.html#ranges petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.DMDA.ghost_corners petsc4py.PETSc.DMDA-class.html#ghost_corners petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.DM.setSNESJacobian petsc4py.PETSc.DM-class.html#setSNESJacobian petsc4py.PETSc.DMDA.getScatter petsc4py.PETSc.DMDA-class.html#getScatter petsc4py.PETSc.DM.createLabel petsc4py.PETSc.DM-class.html#createLabel petsc4py.PETSc.DM.getMatrix petsc4py.PETSc.DM-class.html#getMatrix petsc4py.PETSc.DM.getDefaultGlobalSection petsc4py.PETSc.DM-class.html#getDefaultGlobalSection petsc4py.PETSc.DM.clearLabelValue petsc4py.PETSc.DM-class.html#clearLabelValue petsc4py.PETSc.DM.convert petsc4py.PETSc.DM-class.html#convert petsc4py.PETSc.DM.setDefaultGlobalSection petsc4py.PETSc.DM-class.html#setDefaultGlobalSection petsc4py.PETSc.DM.getCoordinatesLocal petsc4py.PETSc.DM-class.html#getCoordinatesLocal petsc4py.PETSc.DM.getLabelOutput petsc4py.PETSc.DM-class.html#getLabelOutput petsc4py.PETSc.DM.appctx petsc4py.PETSc.DM-class.html#appctx petsc4py.PETSc.DMDA.setFieldName petsc4py.PETSc.DMDA-class.html#setFieldName petsc4py.PETSc.DMDA.getBoundaryType petsc4py.PETSc.DMDA-class.html#getBoundaryType petsc4py.PETSc.DMDA.getElements petsc4py.PETSc.DMDA-class.html#getElements petsc4py.PETSc.DMDA.getProcSizes petsc4py.PETSc.DMDA-class.html#getProcSizes petsc4py.PETSc.DM.load petsc4py.PETSc.DM-class.html#load petsc4py.PETSc.DMDA.setStencilType petsc4py.PETSc.DMDA-class.html#setStencilType petsc4py.PETSc.DM.setLabelValue petsc4py.PETSc.DM-class.html#setLabelValue petsc4py.PETSc.DMDA.ghost_ranges petsc4py.PETSc.DMDA-class.html#ghost_ranges petsc4py.PETSc.DM.setCoordinates petsc4py.PETSc.DM-class.html#setCoordinates petsc4py.PETSc.DMDA.setStencil petsc4py.PETSc.DMDA-class.html#setStencil petsc4py.PETSc.DM.adaptLabel petsc4py.PETSc.DM-class.html#adaptLabel petsc4py.PETSc.DM.createMat petsc4py.PETSc.DM-class.html#createMat petsc4py.PETSc.DM.createLocalVector petsc4py.PETSc.DM-class.html#createLocalVector petsc4py.PETSc.DMDA.setCoordinateName petsc4py.PETSc.DMDA-class.html#setCoordinateName petsc4py.PETSc.DM.getNumFields petsc4py.PETSc.DM-class.html#getNumFields petsc4py.PETSc.DMDA.getStencil petsc4py.PETSc.DMDA-class.html#getStencil petsc4py.PETSc.DM.getCoordinateSection petsc4py.PETSc.DM-class.html#getCoordinateSection petsc4py.PETSc.DM.setMatType petsc4py.PETSc.DM-class.html#setMatType petsc4py.PETSc.DM.setType petsc4py.PETSc.DM-class.html#setType petsc4py.PETSc.DMDA.stencil petsc4py.PETSc.DMDA-class.html#stencil petsc4py.PETSc.DMDA.getElementType petsc4py.PETSc.DMDA-class.html#getElementType petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DM.getCoordinateDM petsc4py.PETSc.DM-class.html#getCoordinateDM petsc4py.PETSc.DMDA.duplicate petsc4py.PETSc.DMDA-class.html#duplicate petsc4py.PETSc.DM.getNumLabels petsc4py.PETSc.DM-class.html#getNumLabels petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DM.getDimension petsc4py.PETSc.DM-class.html#getDimension petsc4py.PETSc.DM.createInjection petsc4py.PETSc.DM-class.html#createInjection petsc4py.PETSc.DM.setSNESFunction petsc4py.PETSc.DM-class.html#setSNESFunction petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.DMDA.setDof petsc4py.PETSc.DMDA-class.html#setDof petsc4py.PETSc.DMDA.getStencilWidth petsc4py.PETSc.DMDA-class.html#getStencilWidth petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DM.getAppCtx petsc4py.PETSc.DM-class.html#getAppCtx petsc4py.PETSc.DM.setPointSF petsc4py.PETSc.DM-class.html#setPointSF petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.DM.copyDS petsc4py.PETSc.DM-class.html#copyDS petsc4py.PETSc.DM.getField petsc4py.PETSc.DM-class.html#getField petsc4py.PETSc.DMDA.getFieldName petsc4py.PETSc.DMDA-class.html#getFieldName petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.DMDA.getDim petsc4py.PETSc.DMDA-class.html#getDim petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.DM.getCoarsenLevel petsc4py.PETSc.DM-class.html#getCoarsenLevel petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.DM.getRefineLevel petsc4py.PETSc.DM-class.html#getRefineLevel petsc4py.PETSc.DM.setRefineLevel petsc4py.PETSc.DM-class.html#setRefineLevel petsc4py.PETSc.DM.setSection petsc4py.PETSc.DM-class.html#setSection petsc4py.PETSc.DM.refine petsc4py.PETSc.DM-class.html#refine petsc4py.PETSc.DM.createLocalVec petsc4py.PETSc.DM-class.html#createLocalVec petsc4py.PETSc.DMDA.getInterpolationType petsc4py.PETSc.DMDA-class.html#getInterpolationType petsc4py.PETSc.DMDA.create petsc4py.PETSc.DMDA-class.html#create petsc4py.PETSc.DM.getGlobalVec petsc4py.PETSc.DM-class.html#getGlobalVec petsc4py.PETSc.DM.setKSPComputeOperators petsc4py.PETSc.DM-class.html#setKSPComputeOperators petsc4py.PETSc.DM.localToLocal petsc4py.PETSc.DM-class.html#localToLocal petsc4py.PETSc.DMDA.__new__ petsc4py.PETSc.DMDA-class.html#__new__ petsc4py.PETSc.DM.setFieldAdjacency petsc4py.PETSc.DM-class.html#setFieldAdjacency petsc4py.PETSc.DMDA.getAO petsc4py.PETSc.DMDA-class.html#getAO petsc4py.PETSc.DMDA.InterpolationType petsc4py.PETSc.DMDA.InterpolationType-class.html petsc4py.PETSc.DMDA.setInterpolationType petsc4py.PETSc.DMDA-class.html#setInterpolationType petsc4py.PETSc.DMDA.stencil_type petsc4py.PETSc.DMDA-class.html#stencil_type petsc4py.PETSc.DM.coarsenHierarchy petsc4py.PETSc.DM-class.html#coarsenHierarchy petsc4py.PETSc.DM.destroy petsc4py.PETSc.DM-class.html#destroy petsc4py.PETSc.DMDA.getGhostRanges petsc4py.PETSc.DMDA-class.html#getGhostRanges petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.DM.getType petsc4py.PETSc.DM-class.html#getType petsc4py.PETSc.DMDA.setDim petsc4py.PETSc.DMDA-class.html#setDim petsc4py.PETSc.DMDA.getStencilType petsc4py.PETSc.DMDA-class.html#getStencilType petsc4py.PETSc.DM.createDefaultSF petsc4py.PETSc.DM-class.html#createDefaultSF petsc4py.PETSc.DM.setCoordinatesLocal petsc4py.PETSc.DM-class.html#setCoordinatesLocal petsc4py.PETSc.DM.clone petsc4py.PETSc.DM-class.html#clone petsc4py.PETSc.DM.setDefaultSection petsc4py.PETSc.DM-class.html#setDefaultSection petsc4py.PETSc.DMDA.getVecArray petsc4py.PETSc.DMDA-class.html#getVecArray petsc4py.PETSc.DM.clearDS petsc4py.PETSc.DM-class.html#clearDS petsc4py.PETSc.DM.getFieldAdjacency petsc4py.PETSc.DM-class.html#getFieldAdjacency petsc4py.PETSc.DM.copyDisc petsc4py.PETSc.DM-class.html#copyDisc petsc4py.PETSc.DMDA.createNaturalVector petsc4py.PETSc.DMDA-class.html#createNaturalVector petsc4py.PETSc.DMDA.setStencilWidth petsc4py.PETSc.DMDA-class.html#setStencilWidth petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.DM.setBasicAdjacency petsc4py.PETSc.DM-class.html#setBasicAdjacency petsc4py.PETSc.DMDA.naturalToGlobal petsc4py.PETSc.DMDA-class.html#naturalToGlobal petsc4py.PETSc.DM.createInterpolation petsc4py.PETSc.DM-class.html#createInterpolation petsc4py.PETSc.DM.setLabelOutput petsc4py.PETSc.DM-class.html#setLabelOutput petsc4py.PETSc.DM.createGlobalVector petsc4py.PETSc.DM-class.html#createGlobalVector petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.DMDA.dof petsc4py.PETSc.DMDA-class.html#dof petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DM.restoreGlobalVec petsc4py.PETSc.DM-class.html#restoreGlobalVec petsc4py.PETSc.DM.getSectionSF petsc4py.PETSc.DM-class.html#getSectionSF petsc4py.PETSc.DMDA.getCoordinateName petsc4py.PETSc.DMDA-class.html#getCoordinateName petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.DMDA.getCorners petsc4py.PETSc.DMDA-class.html#getCorners petsc4py.PETSc.DMDA.ElementType petsc4py.PETSc.DMDA.ElementType-class.html petsc4py.PETSc.DMDA.ElementType.Q1 petsc4py.PETSc.DMDA.ElementType-class.html#Q1 petsc4py.PETSc.DMDA.ElementType.P1 petsc4py.PETSc.DMDA.ElementType-class.html#P1 petsc4py.PETSc.DMDA.ElementType.__qualname__ petsc4py.PETSc.DMDA.ElementType-class.html#__qualname__ petsc4py.PETSc.DMDA.InterpolationType petsc4py.PETSc.DMDA.InterpolationType-class.html petsc4py.PETSc.DMDA.InterpolationType.Q1 petsc4py.PETSc.DMDA.InterpolationType-class.html#Q1 petsc4py.PETSc.DMDA.InterpolationType.Q0 petsc4py.PETSc.DMDA.InterpolationType-class.html#Q0 petsc4py.PETSc.DMDA.InterpolationType.__qualname__ petsc4py.PETSc.DMDA.InterpolationType-class.html#__qualname__ petsc4py.PETSc.DMDA.StencilType petsc4py.PETSc.DMDA.StencilType-class.html petsc4py.PETSc.DMDA.StencilType.BOX petsc4py.PETSc.DMDA.StencilType-class.html#BOX petsc4py.PETSc.DMDA.StencilType.STAR petsc4py.PETSc.DMDA.StencilType-class.html#STAR petsc4py.PETSc.DMDA.StencilType.__qualname__ petsc4py.PETSc.DMDA.StencilType-class.html#__qualname__ petsc4py.PETSc.DMLabel petsc4py.PETSc.DMLabel-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.DMLabel.__new__ petsc4py.PETSc.DMLabel-class.html#__new__ petsc4py.PETSc.DMLabel.create petsc4py.PETSc.DMLabel-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DMLabel.destroy petsc4py.PETSc.DMLabel-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.getType petsc4py.PETSc.Object-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DMLabel.insertIS petsc4py.PETSc.DMLabel-class.html#insertIS petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.view petsc4py.PETSc.Object-class.html#view petsc4py.PETSc.DMPlex petsc4py.PETSc.DMPlex-class.html petsc4py.PETSc.DM.createInjection petsc4py.PETSc.DM-class.html#createInjection petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.DM.getLGMap petsc4py.PETSc.DM-class.html#getLGMap petsc4py.PETSc.DMPlex.setSupportSize petsc4py.PETSc.DMPlex-class.html#setSupportSize petsc4py.PETSc.DMPlex.setSupport petsc4py.PETSc.DMPlex-class.html#setSupport petsc4py.PETSc.DM.getStratumIS petsc4py.PETSc.DM-class.html#getStratumIS petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.DMPlex.distribute petsc4py.PETSc.DMPlex-class.html#distribute petsc4py.PETSc.DMPlex.constructGhostCells petsc4py.PETSc.DMPlex-class.html#constructGhostCells petsc4py.PETSc.DMPlex.createExodus petsc4py.PETSc.DMPlex-class.html#createExodus petsc4py.PETSc.DMPlex.getChart petsc4py.PETSc.DMPlex-class.html#getChart petsc4py.PETSc.DM.getLabel petsc4py.PETSc.DM-class.html#getLabel petsc4py.PETSc.DM.adaptMetric petsc4py.PETSc.DM-class.html#adaptMetric petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.DM.createGlobalVec petsc4py.PETSc.DM-class.html#createGlobalVec petsc4py.PETSc.DM.createDS petsc4py.PETSc.DM-class.html#createDS petsc4py.PETSc.DM.clearLabelStratum petsc4py.PETSc.DM-class.html#clearLabelStratum petsc4py.PETSc.DMPlex.permute petsc4py.PETSc.DMPlex-class.html#permute petsc4py.PETSc.DMPlex.createPointNumbering petsc4py.PETSc.DMPlex-class.html#createPointNumbering petsc4py.PETSc.DM.getGlobalSection petsc4py.PETSc.DM-class.html#getGlobalSection petsc4py.PETSc.DMPlex.getSupport petsc4py.PETSc.DMPlex-class.html#getSupport petsc4py.PETSc.DM.viewFromOptions petsc4py.PETSc.DM-class.html#viewFromOptions petsc4py.PETSc.DM.getBasicAdjacency petsc4py.PETSc.DM-class.html#getBasicAdjacency petsc4py.PETSc.DM.addField petsc4py.PETSc.DM-class.html#addField petsc4py.PETSc.DM.removeLabel petsc4py.PETSc.DM-class.html#removeLabel petsc4py.PETSc.DM.getLocalVec petsc4py.PETSc.DM-class.html#getLocalVec petsc4py.PETSc.DMPlex.setVecClosure petsc4py.PETSc.DMPlex-class.html#setVecClosure petsc4py.PETSc.DMPlex.setConeOrientation petsc4py.PETSc.DMPlex-class.html#setConeOrientation petsc4py.PETSc.DM.coarsen petsc4py.PETSc.DM-class.html#coarsen petsc4py.PETSc.DM.setLabelValue petsc4py.PETSc.DM-class.html#setLabelValue petsc4py.PETSc.DMPlex.getDepthStratum petsc4py.PETSc.DMPlex-class.html#getDepthStratum petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.DM.getLabelValue petsc4py.PETSc.DM-class.html#getLabelValue petsc4py.PETSc.DM.setCoordinateDim petsc4py.PETSc.DM-class.html#setCoordinateDim petsc4py.PETSc.DM.getStratumSize petsc4py.PETSc.DM-class.html#getStratumSize petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.DM.getLabelIdIS petsc4py.PETSc.DM-class.html#getLabelIdIS petsc4py.PETSc.DM.setOptionsPrefix petsc4py.PETSc.DM-class.html#setOptionsPrefix petsc4py.PETSc.DM.setFieldAdjacency petsc4py.PETSc.DM-class.html#setFieldAdjacency petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DM.createGlobalVector petsc4py.PETSc.DM-class.html#createGlobalVector petsc4py.PETSc.DM.getDefaultSF petsc4py.PETSc.DM-class.html#getDefaultSF petsc4py.PETSc.DMPlex.getRefinementUniform petsc4py.PETSc.DMPlex-class.html#getRefinementUniform petsc4py.PETSc.DM.setNumFields petsc4py.PETSc.DM-class.html#setNumFields petsc4py.PETSc.DM.setFromOptions petsc4py.PETSc.DM-class.html#setFromOptions petsc4py.PETSc.DMPlex.setPartitioner petsc4py.PETSc.DMPlex-class.html#setPartitioner petsc4py.PETSc.DM.setSectionSF petsc4py.PETSc.DM-class.html#setSectionSF petsc4py.PETSc.DM.getBoundingBox petsc4py.PETSc.DM-class.html#getBoundingBox petsc4py.PETSc.DM.setDimension petsc4py.PETSc.DM-class.html#setDimension petsc4py.PETSc.DM.hasLabel petsc4py.PETSc.DM-class.html#hasLabel petsc4py.PETSc.DM.ds petsc4py.PETSc.DM-class.html#ds petsc4py.PETSc.DMPlex.createClosureIndex petsc4py.PETSc.DMPlex-class.html#createClosureIndex petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.DM.setAppCtx petsc4py.PETSc.DM-class.html#setAppCtx petsc4py.PETSc.DM.setGlobalSection petsc4py.PETSc.DM-class.html#setGlobalSection petsc4py.PETSc.DM.createFieldDecomposition petsc4py.PETSc.DM-class.html#createFieldDecomposition petsc4py.PETSc.DMPlex.createExodusFromFile petsc4py.PETSc.DMPlex-class.html#createExodusFromFile petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DMPlex.getHeightStratum petsc4py.PETSc.DMPlex-class.html#getHeightStratum petsc4py.PETSc.DMPlex.getJoin petsc4py.PETSc.DMPlex-class.html#getJoin petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.DM.restoreLocalVec petsc4py.PETSc.DM-class.html#restoreLocalVec petsc4py.PETSc.DMPlex.createFromCellList petsc4py.PETSc.DMPlex-class.html#createFromCellList petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.DMPlex.stratify petsc4py.PETSc.DMPlex-class.html#stratify petsc4py.PETSc.DM.view petsc4py.PETSc.DM-class.html#view petsc4py.PETSc.DM.getDefaultSection petsc4py.PETSc.DM-class.html#getDefaultSection petsc4py.PETSc.DMPlex.getDepth petsc4py.PETSc.DMPlex-class.html#getDepth petsc4py.PETSc.DMPlex.getRefinementLimit petsc4py.PETSc.DMPlex-class.html#getRefinementLimit petsc4py.PETSc.DMPlex.getOrdering petsc4py.PETSc.DMPlex-class.html#getOrdering petsc4py.PETSc.DM.getCoordinateDim petsc4py.PETSc.DM-class.html#getCoordinateDim petsc4py.PETSc.DMPlex.getAdjacency petsc4py.PETSc.DMPlex-class.html#getAdjacency petsc4py.PETSc.DM.createRestriction petsc4py.PETSc.DM-class.html#createRestriction petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.DMPlex.getConeSize petsc4py.PETSc.DMPlex-class.html#getConeSize petsc4py.PETSc.DMPlex.createSquareBoundary petsc4py.PETSc.DMPlex-class.html#createSquareBoundary petsc4py.PETSc.DM.localizeCoordinates petsc4py.PETSc.DM-class.html#localizeCoordinates petsc4py.PETSc.DM.getBlockSize petsc4py.PETSc.DM-class.html#getBlockSize petsc4py.PETSc.DM.refineHierarchy petsc4py.PETSc.DM-class.html#refineHierarchy petsc4py.PETSc.DM.Type petsc4py.PETSc.DM.Type-class.html petsc4py.PETSc.DMPlex.orient petsc4py.PETSc.DMPlex-class.html#orient petsc4py.PETSc.DM.getCoordinates petsc4py.PETSc.DM-class.html#getCoordinates petsc4py.PETSc.DMPlex.createFromFile petsc4py.PETSc.DMPlex-class.html#createFromFile petsc4py.PETSc.DM.createInterpolation petsc4py.PETSc.DM-class.html#createInterpolation petsc4py.PETSc.DM.setField petsc4py.PETSc.DM-class.html#setField petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.DM.setVecType petsc4py.PETSc.DM-class.html#setVecType petsc4py.PETSc.DM.globalToLocal petsc4py.PETSc.DM-class.html#globalToLocal petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DM.setDefaultSF petsc4py.PETSc.DM-class.html#setDefaultSF petsc4py.PETSc.DMPlex.markBoundaryFaces petsc4py.PETSc.DMPlex-class.html#markBoundaryFaces petsc4py.PETSc.DMPlex.uninterpolate petsc4py.PETSc.DMPlex-class.html#uninterpolate petsc4py.PETSc.DMPlex.setMatClosure petsc4py.PETSc.DMPlex-class.html#setMatClosure petsc4py.PETSc.DMPlex.rebalanceSharedPoints petsc4py.PETSc.DMPlex-class.html#rebalanceSharedPoints petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.DM.getLabelName petsc4py.PETSc.DM-class.html#getLabelName petsc4py.PETSc.DM.createSectionSF petsc4py.PETSc.DM-class.html#createSectionSF petsc4py.PETSc.DM.setUp petsc4py.PETSc.DM-class.html#setUp petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.DMPlex.interpolate petsc4py.PETSc.DMPlex-class.html#interpolate petsc4py.PETSc.DM.getPointSF petsc4py.PETSc.DM-class.html#getPointSF petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.DM.createMatrix petsc4py.PETSc.DM-class.html#createMatrix petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.DM.getDS petsc4py.PETSc.DM-class.html#getDS petsc4py.PETSc.DM.setSNESJacobian petsc4py.PETSc.DM-class.html#setSNESJacobian petsc4py.PETSc.DMPlex.getVecClosure petsc4py.PETSc.DMPlex-class.html#getVecClosure petsc4py.PETSc.DMPlex.getCone petsc4py.PETSc.DMPlex-class.html#getCone petsc4py.PETSc.DMPlex.setTriangleOptions petsc4py.PETSc.DMPlex-class.html#setTriangleOptions petsc4py.PETSc.DMPlex.generate petsc4py.PETSc.DMPlex-class.html#generate petsc4py.PETSc.DM.getMatrix petsc4py.PETSc.DM-class.html#getMatrix petsc4py.PETSc.DM.getDefaultGlobalSection petsc4py.PETSc.DM-class.html#getDefaultGlobalSection petsc4py.PETSc.DMPlex.getPointGlobal petsc4py.PETSc.DMPlex-class.html#getPointGlobal petsc4py.PETSc.DM.convert petsc4py.PETSc.DM-class.html#convert petsc4py.PETSc.DM.setDefaultGlobalSection petsc4py.PETSc.DM-class.html#setDefaultGlobalSection petsc4py.PETSc.DMPlex.setAdjacencyUseAnchors petsc4py.PETSc.DMPlex-class.html#setAdjacencyUseAnchors petsc4py.PETSc.DM.getLabelOutput petsc4py.PETSc.DM-class.html#getLabelOutput petsc4py.PETSc.DM.appctx petsc4py.PETSc.DM-class.html#appctx petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.DMPlex.distributeOverlap petsc4py.PETSc.DMPlex-class.html#distributeOverlap petsc4py.PETSc.DMPlex.insertCone petsc4py.PETSc.DMPlex-class.html#insertCone petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.DM.load petsc4py.PETSc.DM-class.html#load petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.DMPlex.getSupportSize petsc4py.PETSc.DMPlex-class.html#getSupportSize petsc4py.PETSc.DMPlex.getMaxSizes petsc4py.PETSc.DMPlex-class.html#getMaxSizes petsc4py.PETSc.DM.setCoordinates petsc4py.PETSc.DM-class.html#setCoordinates petsc4py.PETSc.DM.adaptLabel petsc4py.PETSc.DM-class.html#adaptLabel petsc4py.PETSc.DM.createMat petsc4py.PETSc.DM-class.html#createMat petsc4py.PETSc.DM.createLocalVector petsc4py.PETSc.DM-class.html#createLocalVector petsc4py.PETSc.DM.getNumFields petsc4py.PETSc.DM-class.html#getNumFields petsc4py.PETSc.DM.getCoordinateSection petsc4py.PETSc.DM-class.html#getCoordinateSection petsc4py.PETSc.DM.setMatType petsc4py.PETSc.DM-class.html#setMatType petsc4py.PETSc.DM.setType petsc4py.PETSc.DM-class.html#setType petsc4py.PETSc.DM.getSection petsc4py.PETSc.DM-class.html#getSection petsc4py.PETSc.DMPlex.getCellNumbering petsc4py.PETSc.DMPlex-class.html#getCellNumbering petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DMPlex.create petsc4py.PETSc.DMPlex-class.html#create petsc4py.PETSc.DM.setSection petsc4py.PETSc.DM-class.html#setSection petsc4py.PETSc.DMPlex.computeCellGeometryFVM petsc4py.PETSc.DMPlex-class.html#computeCellGeometryFVM petsc4py.PETSc.DM.createLabel petsc4py.PETSc.DM-class.html#createLabel petsc4py.PETSc.DM.getCoordinateDM petsc4py.PETSc.DM-class.html#getCoordinateDM petsc4py.PETSc.DMPlex.isDistributed petsc4py.PETSc.DMPlex-class.html#isDistributed petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DM.getNumLabels petsc4py.PETSc.DM-class.html#getNumLabels petsc4py.PETSc.DMPlex.createSection petsc4py.PETSc.DMPlex-class.html#createSection petsc4py.PETSc.DM.getDimension petsc4py.PETSc.DM-class.html#getDimension petsc4py.PETSc.DMPlex.vecGetClosure petsc4py.PETSc.DMPlex-class.html#vecGetClosure petsc4py.PETSc.DM.setSNESFunction petsc4py.PETSc.DM-class.html#setSNESFunction petsc4py.PETSc.DMPlex.getPointLocalField petsc4py.PETSc.DMPlex-class.html#getPointLocalField petsc4py.PETSc.DM.copyFields petsc4py.PETSc.DM-class.html#copyFields petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.DM.clearLabelValue petsc4py.PETSc.DM-class.html#clearLabelValue petsc4py.PETSc.DMPlex.getVertexNumbering petsc4py.PETSc.DMPlex-class.html#getVertexNumbering petsc4py.PETSc.DM.getType petsc4py.PETSc.DM-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DMPlex.setRefinementUniform petsc4py.PETSc.DMPlex-class.html#setRefinementUniform petsc4py.PETSc.DM.setPointSF petsc4py.PETSc.DM-class.html#setPointSF petsc4py.PETSc.DMPlex.createCubeBoundary petsc4py.PETSc.DMPlex-class.html#createCubeBoundary petsc4py.PETSc.DMPlex.getTransitiveClosure petsc4py.PETSc.DMPlex-class.html#getTransitiveClosure petsc4py.PETSc.DM.copyDS petsc4py.PETSc.DM-class.html#copyDS petsc4py.PETSc.DM.getCoordinatesLocal petsc4py.PETSc.DM-class.html#getCoordinatesLocal petsc4py.PETSc.DMPlex.getPointGlobalField petsc4py.PETSc.DMPlex-class.html#getPointGlobalField petsc4py.PETSc.DM.getField petsc4py.PETSc.DM-class.html#getField petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DMPlex.setConeSize petsc4py.PETSc.DMPlex-class.html#setConeSize petsc4py.PETSc.DMPlex.insertConeOrientation petsc4py.PETSc.DMPlex-class.html#insertConeOrientation petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.DMPlex.getMeet petsc4py.PETSc.DMPlex-class.html#getMeet petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.DM.getCoarsenLevel petsc4py.PETSc.DM-class.html#getCoarsenLevel petsc4py.PETSc.DM.getAppCtx petsc4py.PETSc.DM-class.html#getAppCtx petsc4py.PETSc.DM.addCoarsenHook petsc4py.PETSc.DM-class.html#addCoarsenHook petsc4py.PETSc.DM.getRefineLevel petsc4py.PETSc.DM-class.html#getRefineLevel petsc4py.PETSc.DM.setRefineLevel petsc4py.PETSc.DM-class.html#setRefineLevel petsc4py.PETSc.DMPlex.createCGNSFromFile petsc4py.PETSc.DMPlex-class.html#createCGNSFromFile petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.DMPlex.createCohesiveSubmesh petsc4py.PETSc.DMPlex-class.html#createCohesiveSubmesh petsc4py.PETSc.DMPlex.symmetrize petsc4py.PETSc.DMPlex-class.html#symmetrize petsc4py.PETSc.DMPlex.distributeField petsc4py.PETSc.DMPlex-class.html#distributeField petsc4py.PETSc.DMPlex.getPartitioner petsc4py.PETSc.DMPlex-class.html#getPartitioner petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DM.refine petsc4py.PETSc.DM-class.html#refine petsc4py.PETSc.DM.createLocalVec petsc4py.PETSc.DM-class.html#createLocalVec petsc4py.PETSc.DM.restoreGlobalVec petsc4py.PETSc.DM-class.html#restoreGlobalVec petsc4py.PETSc.DMPlex.getPointLocal petsc4py.PETSc.DMPlex-class.html#getPointLocal petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.DM.getGlobalVec petsc4py.PETSc.DM-class.html#getGlobalVec petsc4py.PETSc.DM.setKSPComputeOperators petsc4py.PETSc.DM-class.html#setKSPComputeOperators petsc4py.PETSc.DM.localToLocal petsc4py.PETSc.DM-class.html#localToLocal petsc4py.PETSc.DMPlex.__new__ petsc4py.PETSc.DMPlex-class.html#__new__ petsc4py.PETSc.DM.getLabelSize petsc4py.PETSc.DM-class.html#getLabelSize petsc4py.PETSc.DM.localToGlobal petsc4py.PETSc.DM-class.html#localToGlobal petsc4py.PETSc.DM.getLocalBoundingBox petsc4py.PETSc.DM-class.html#getLocalBoundingBox petsc4py.PETSc.DM.coarsenHierarchy petsc4py.PETSc.DM-class.html#coarsenHierarchy petsc4py.PETSc.DM.destroy petsc4py.PETSc.DM-class.html#destroy petsc4py.PETSc.DMPlex.getConeOrientation petsc4py.PETSc.DMPlex-class.html#getConeOrientation petsc4py.PETSc.DMPlex.createGmsh petsc4py.PETSc.DMPlex-class.html#createGmsh petsc4py.PETSc.DMPlex.setChart petsc4py.PETSc.DMPlex-class.html#setChart petsc4py.PETSc.DMPlex.setRefinementLimit petsc4py.PETSc.DMPlex-class.html#setRefinementLimit petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.DM.createDefaultSF petsc4py.PETSc.DM-class.html#createDefaultSF petsc4py.PETSc.DM.setCoordinatesLocal petsc4py.PETSc.DM-class.html#setCoordinatesLocal petsc4py.PETSc.DM.clone petsc4py.PETSc.DM-class.html#clone petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.DM.setDefaultSection petsc4py.PETSc.DM-class.html#setDefaultSection petsc4py.PETSc.DM.clearDS petsc4py.PETSc.DM-class.html#clearDS petsc4py.PETSc.DMPlex.getAdjacencyUseAnchors petsc4py.PETSc.DMPlex-class.html#getAdjacencyUseAnchors petsc4py.PETSc.DM.getFieldAdjacency petsc4py.PETSc.DM-class.html#getFieldAdjacency petsc4py.PETSc.DM.copyDisc petsc4py.PETSc.DM-class.html#copyDisc petsc4py.PETSc.DM.setBasicAdjacency petsc4py.PETSc.DM-class.html#setBasicAdjacency petsc4py.PETSc.DM.setLabelOutput petsc4py.PETSc.DM-class.html#setLabelOutput petsc4py.PETSc.DMPlex.createBoxMesh petsc4py.PETSc.DMPlex-class.html#createBoxMesh petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DMPlex.setTetGenOptions petsc4py.PETSc.DMPlex-class.html#setTetGenOptions petsc4py.PETSc.DMPlex.createCoarsePointIS petsc4py.PETSc.DMPlex-class.html#createCoarsePointIS petsc4py.PETSc.DMPlex.createCGNS petsc4py.PETSc.DMPlex-class.html#createCGNS petsc4py.PETSc.DM.getSectionSF petsc4py.PETSc.DM-class.html#getSectionSF petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.DMPlex.setCone petsc4py.PETSc.DMPlex-class.html#setCone petsc4py.PETSc.DMShell petsc4py.PETSc.DMShell-class.html petsc4py.PETSc.DM.load petsc4py.PETSc.DM-class.html#load petsc4py.PETSc.DM.getLGMap petsc4py.PETSc.DM-class.html#getLGMap petsc4py.PETSc.DM.getStratumIS petsc4py.PETSc.DM-class.html#getStratumIS petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DMShell.setGlobalToLocal petsc4py.PETSc.DMShell-class.html#setGlobalToLocal petsc4py.PETSc.DM.restoreLocalVec petsc4py.PETSc.DM-class.html#restoreLocalVec petsc4py.PETSc.DMShell.setCreateSubDM petsc4py.PETSc.DMShell-class.html#setCreateSubDM petsc4py.PETSc.DM.getLabel petsc4py.PETSc.DM-class.html#getLabel petsc4py.PETSc.DM.adaptMetric petsc4py.PETSc.DM-class.html#adaptMetric petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.DM.createGlobalVec petsc4py.PETSc.DM-class.html#createGlobalVec petsc4py.PETSc.DM.createDS petsc4py.PETSc.DM-class.html#createDS petsc4py.PETSc.DM.setField petsc4py.PETSc.DM-class.html#setField petsc4py.PETSc.DMShell.setCoarsen petsc4py.PETSc.DMShell-class.html#setCoarsen petsc4py.PETSc.DM.getGlobalSection petsc4py.PETSc.DM-class.html#getGlobalSection petsc4py.PETSc.DM.createMatrix petsc4py.PETSc.DM-class.html#createMatrix petsc4py.PETSc.DM.viewFromOptions petsc4py.PETSc.DM-class.html#viewFromOptions petsc4py.PETSc.DM.getBasicAdjacency petsc4py.PETSc.DM-class.html#getBasicAdjacency petsc4py.PETSc.DM.addField petsc4py.PETSc.DM-class.html#addField petsc4py.PETSc.DMShell.setCreateDomainDecompositionScatters petsc4py.PETSc.DMShell-class.html#setCreateDomainDecompositionScatters petsc4py.PETSc.DM.removeLabel petsc4py.PETSc.DM-class.html#removeLabel petsc4py.PETSc.DM.getLocalVec petsc4py.PETSc.DM-class.html#getLocalVec petsc4py.PETSc.DM.coarsen petsc4py.PETSc.DM-class.html#coarsen petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DM.copyFields petsc4py.PETSc.DM-class.html#copyFields petsc4py.PETSc.DM.getLabelValue petsc4py.PETSc.DM-class.html#getLabelValue petsc4py.PETSc.DM.setCoordinateDim petsc4py.PETSc.DM-class.html#setCoordinateDim petsc4py.PETSc.DM.getStratumSize petsc4py.PETSc.DM-class.html#getStratumSize petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.DM.getLabelIdIS petsc4py.PETSc.DM-class.html#getLabelIdIS petsc4py.PETSc.DM.setOptionsPrefix petsc4py.PETSc.DM-class.html#setOptionsPrefix petsc4py.PETSc.DM.setFieldAdjacency petsc4py.PETSc.DM-class.html#setFieldAdjacency petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DM.createGlobalVector petsc4py.PETSc.DM-class.html#createGlobalVector petsc4py.PETSc.DMShell.setCreateInterpolation petsc4py.PETSc.DMShell-class.html#setCreateInterpolation petsc4py.PETSc.DM.setNumFields petsc4py.PETSc.DM-class.html#setNumFields petsc4py.PETSc.DM.setFromOptions petsc4py.PETSc.DM-class.html#setFromOptions petsc4py.PETSc.DMShell.setGlobalToLocalVecScatter petsc4py.PETSc.DMShell-class.html#setGlobalToLocalVecScatter petsc4py.PETSc.DM.setSectionSF petsc4py.PETSc.DM-class.html#setSectionSF petsc4py.PETSc.DM.getBoundingBox petsc4py.PETSc.DM-class.html#getBoundingBox petsc4py.PETSc.DM.setDimension petsc4py.PETSc.DM-class.html#setDimension petsc4py.PETSc.DM.hasLabel petsc4py.PETSc.DM-class.html#hasLabel petsc4py.PETSc.DM.ds petsc4py.PETSc.DM-class.html#ds petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.DM.setAppCtx petsc4py.PETSc.DM-class.html#setAppCtx petsc4py.PETSc.DM.setGlobalSection petsc4py.PETSc.DM-class.html#setGlobalSection petsc4py.PETSc.DM.createFieldDecomposition petsc4py.PETSc.DM-class.html#createFieldDecomposition petsc4py.PETSc.DM.getCoordinateDim petsc4py.PETSc.DM-class.html#getCoordinateDim petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.DMShell.setRefine petsc4py.PETSc.DMShell-class.html#setRefine petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.DMShell.setCreateInjection petsc4py.PETSc.DMShell-class.html#setCreateInjection petsc4py.PETSc.DM.view petsc4py.PETSc.DM-class.html#view petsc4py.PETSc.DM.getDefaultSection petsc4py.PETSc.DM-class.html#getDefaultSection petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DMShell.setLocalToGlobal petsc4py.PETSc.DMShell-class.html#setLocalToGlobal petsc4py.PETSc.DM.localizeCoordinates petsc4py.PETSc.DM-class.html#localizeCoordinates petsc4py.PETSc.DM.getBlockSize petsc4py.PETSc.DM-class.html#getBlockSize petsc4py.PETSc.DM.refineHierarchy petsc4py.PETSc.DM-class.html#refineHierarchy petsc4py.PETSc.DM.Type petsc4py.PETSc.DM.Type-class.html petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.DM.getCoordinates petsc4py.PETSc.DM-class.html#getCoordinates petsc4py.PETSc.DM.createInterpolation petsc4py.PETSc.DM-class.html#createInterpolation petsc4py.PETSc.DM.clearLabelStratum petsc4py.PETSc.DM-class.html#clearLabelStratum petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.DM.setVecType petsc4py.PETSc.DM-class.html#setVecType petsc4py.PETSc.DMShell.setCreateGlobalVector petsc4py.PETSc.DMShell-class.html#setCreateGlobalVector petsc4py.PETSc.DM.globalToLocal petsc4py.PETSc.DM-class.html#globalToLocal petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DM.setDefaultSF petsc4py.PETSc.DM-class.html#setDefaultSF petsc4py.PETSc.DM.setCoordinatesLocal petsc4py.PETSc.DM-class.html#setCoordinatesLocal petsc4py.PETSc.DM.addCoarsenHook petsc4py.PETSc.DM-class.html#addCoarsenHook petsc4py.PETSc.DMShell.setCreateMatrix petsc4py.PETSc.DMShell-class.html#setCreateMatrix petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.DM.getLabelName petsc4py.PETSc.DM-class.html#getLabelName petsc4py.PETSc.DM.createSectionSF petsc4py.PETSc.DM-class.html#createSectionSF petsc4py.PETSc.DM.setUp petsc4py.PETSc.DM-class.html#setUp petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.DM.getDS petsc4py.PETSc.DM-class.html#getDS petsc4py.PETSc.DM.getPointSF petsc4py.PETSc.DM-class.html#getPointSF petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.DM.setSNESJacobian petsc4py.PETSc.DM-class.html#setSNESJacobian petsc4py.PETSc.DM.createRestriction petsc4py.PETSc.DM-class.html#createRestriction petsc4py.PETSc.DM.createLabel petsc4py.PETSc.DM-class.html#createLabel petsc4py.PETSc.DM.getMatrix petsc4py.PETSc.DM-class.html#getMatrix petsc4py.PETSc.DM.getDefaultGlobalSection petsc4py.PETSc.DM-class.html#getDefaultGlobalSection petsc4py.PETSc.DM.clearLabelValue petsc4py.PETSc.DM-class.html#clearLabelValue petsc4py.PETSc.DM.convert petsc4py.PETSc.DM-class.html#convert petsc4py.PETSc.DM.setDefaultGlobalSection petsc4py.PETSc.DM-class.html#setDefaultGlobalSection petsc4py.PETSc.DM.getCoordinatesLocal petsc4py.PETSc.DM-class.html#getCoordinatesLocal petsc4py.PETSc.DM.getLabelOutput petsc4py.PETSc.DM-class.html#getLabelOutput petsc4py.PETSc.DM.appctx petsc4py.PETSc.DM-class.html#appctx petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.DMShell.setLocalToLocal petsc4py.PETSc.DMShell-class.html#setLocalToLocal petsc4py.PETSc.DM.setLabelValue petsc4py.PETSc.DM-class.html#setLabelValue petsc4py.PETSc.DMShell.setMatrix petsc4py.PETSc.DMShell-class.html#setMatrix petsc4py.PETSc.DM.setCoordinates petsc4py.PETSc.DM-class.html#setCoordinates petsc4py.PETSc.DM.adaptLabel petsc4py.PETSc.DM-class.html#adaptLabel petsc4py.PETSc.DM.createMat petsc4py.PETSc.DM-class.html#createMat petsc4py.PETSc.DM.createLocalVector petsc4py.PETSc.DM-class.html#createLocalVector petsc4py.PETSc.DM.getCoordinateSection petsc4py.PETSc.DM-class.html#getCoordinateSection petsc4py.PETSc.DM.setMatType petsc4py.PETSc.DM-class.html#setMatType petsc4py.PETSc.DM.setType petsc4py.PETSc.DM-class.html#setType petsc4py.PETSc.DM.getSection petsc4py.PETSc.DM-class.html#getSection petsc4py.PETSc.DMShell.create petsc4py.PETSc.DMShell-class.html#create petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DMShell.setLocalToGlobalVecScatter petsc4py.PETSc.DMShell-class.html#setLocalToGlobalVecScatter petsc4py.PETSc.DM.getCoordinateDM petsc4py.PETSc.DM-class.html#getCoordinateDM petsc4py.PETSc.DMShell.setCreateRestriction petsc4py.PETSc.DMShell-class.html#setCreateRestriction petsc4py.PETSc.DM.getNumLabels petsc4py.PETSc.DM-class.html#getNumLabels petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DM.getDimension petsc4py.PETSc.DM-class.html#getDimension petsc4py.PETSc.DM.createInjection petsc4py.PETSc.DM-class.html#createInjection petsc4py.PETSc.DM.setSNESFunction petsc4py.PETSc.DM-class.html#setSNESFunction petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.DMShell.setLocalVector petsc4py.PETSc.DMShell-class.html#setLocalVector petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.DMShell.setCreateFieldDecomposition petsc4py.PETSc.DMShell-class.html#setCreateFieldDecomposition petsc4py.PETSc.DM.getType petsc4py.PETSc.DM-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DM.getAppCtx petsc4py.PETSc.DM-class.html#getAppCtx petsc4py.PETSc.DM.setPointSF petsc4py.PETSc.DM-class.html#setPointSF petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.DM.copyDS petsc4py.PETSc.DM-class.html#copyDS petsc4py.PETSc.DM.getField petsc4py.PETSc.DM-class.html#getField petsc4py.PETSc.DMShell.setCreateLocalVector petsc4py.PETSc.DMShell-class.html#setCreateLocalVector petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.DM.getCoarsenLevel petsc4py.PETSc.DM-class.html#getCoarsenLevel petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.DM.refine petsc4py.PETSc.DM-class.html#refine petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.DM.getRefineLevel petsc4py.PETSc.DM-class.html#getRefineLevel petsc4py.PETSc.DM.setRefineLevel petsc4py.PETSc.DM-class.html#setRefineLevel petsc4py.PETSc.DM.setSection petsc4py.PETSc.DM-class.html#setSection petsc4py.PETSc.DMShell.setCreateDomainDecomposition petsc4py.PETSc.DMShell-class.html#setCreateDomainDecomposition petsc4py.PETSc.DM.createLocalVec petsc4py.PETSc.DM-class.html#createLocalVec petsc4py.PETSc.DM.getNumFields petsc4py.PETSc.DM-class.html#getNumFields petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.DM.getGlobalVec petsc4py.PETSc.DM-class.html#getGlobalVec petsc4py.PETSc.DM.setKSPComputeOperators petsc4py.PETSc.DM-class.html#setKSPComputeOperators petsc4py.PETSc.DM.localToLocal petsc4py.PETSc.DM-class.html#localToLocal petsc4py.PETSc.DMShell.__new__ petsc4py.PETSc.DMShell-class.html#__new__ petsc4py.PETSc.DM.getLabelSize petsc4py.PETSc.DM-class.html#getLabelSize petsc4py.PETSc.DM.localToGlobal petsc4py.PETSc.DM-class.html#localToGlobal petsc4py.PETSc.DM.getLocalBoundingBox petsc4py.PETSc.DM-class.html#getLocalBoundingBox petsc4py.PETSc.DM.coarsenHierarchy petsc4py.PETSc.DM-class.html#coarsenHierarchy petsc4py.PETSc.DM.destroy petsc4py.PETSc.DM-class.html#destroy petsc4py.PETSc.DMShell.setLocalToLocalVecScatter petsc4py.PETSc.DMShell-class.html#setLocalToLocalVecScatter petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.DMShell.setGlobalVector petsc4py.PETSc.DMShell-class.html#setGlobalVector petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.DM.createDefaultSF petsc4py.PETSc.DM-class.html#createDefaultSF petsc4py.PETSc.DM.getDefaultSF petsc4py.PETSc.DM-class.html#getDefaultSF petsc4py.PETSc.DM.clone petsc4py.PETSc.DM-class.html#clone petsc4py.PETSc.DM.setDefaultSection petsc4py.PETSc.DM-class.html#setDefaultSection petsc4py.PETSc.DM.clearDS petsc4py.PETSc.DM-class.html#clearDS petsc4py.PETSc.DM.getFieldAdjacency petsc4py.PETSc.DM-class.html#getFieldAdjacency petsc4py.PETSc.DM.copyDisc petsc4py.PETSc.DM-class.html#copyDisc petsc4py.PETSc.DM.setBasicAdjacency petsc4py.PETSc.DM-class.html#setBasicAdjacency petsc4py.PETSc.DM.setLabelOutput petsc4py.PETSc.DM-class.html#setLabelOutput petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DM.restoreGlobalVec petsc4py.PETSc.DM-class.html#restoreGlobalVec petsc4py.PETSc.DM.getSectionSF petsc4py.PETSc.DM-class.html#getSectionSF petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.DMStag petsc4py.PETSc.DMStag-class.html petsc4py.PETSc.DM.createInjection petsc4py.PETSc.DM-class.html#createInjection petsc4py.PETSc.DMStag.getBoundaryTypes petsc4py.PETSc.DMStag-class.html#getBoundaryTypes petsc4py.PETSc.DM.getLGMap petsc4py.PETSc.DM-class.html#getLGMap petsc4py.PETSc.DM.load petsc4py.PETSc.DM-class.html#load petsc4py.PETSc.DMStag.setBoundaryTypes petsc4py.PETSc.DMStag-class.html#setBoundaryTypes petsc4py.PETSc.DMStag.global_sizes petsc4py.PETSc.DMStag-class.html#global_sizes petsc4py.PETSc.DMStag.StencilType petsc4py.PETSc.DMStag.StencilType-class.html petsc4py.PETSc.DM.getStratumIS petsc4py.PETSc.DM-class.html#getStratumIS petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.DMStag.local_sizes petsc4py.PETSc.DMStag-class.html#local_sizes petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DM.restoreLocalVec petsc4py.PETSc.DM-class.html#restoreLocalVec petsc4py.PETSc.DM.getLabel petsc4py.PETSc.DM-class.html#getLabel petsc4py.PETSc.DM.createRestriction petsc4py.PETSc.DM-class.html#createRestriction petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.DM.createGlobalVec petsc4py.PETSc.DM-class.html#createGlobalVec petsc4py.PETSc.DM.createDS petsc4py.PETSc.DM-class.html#createDS petsc4py.PETSc.DM.clearLabelStratum petsc4py.PETSc.DM-class.html#clearLabelStratum petsc4py.PETSc.DMStag.proc_sizes petsc4py.PETSc.DMStag-class.html#proc_sizes petsc4py.PETSc.DM.getGlobalSection petsc4py.PETSc.DM-class.html#getGlobalSection petsc4py.PETSc.DM.createMatrix petsc4py.PETSc.DM-class.html#createMatrix petsc4py.PETSc.DM.viewFromOptions petsc4py.PETSc.DM-class.html#viewFromOptions petsc4py.PETSc.DM.getBasicAdjacency petsc4py.PETSc.DM-class.html#getBasicAdjacency petsc4py.PETSc.DM.addField petsc4py.PETSc.DM-class.html#addField petsc4py.PETSc.DM.removeLabel petsc4py.PETSc.DM-class.html#removeLabel petsc4py.PETSc.DM.getLocalVec petsc4py.PETSc.DM-class.html#getLocalVec petsc4py.PETSc.DM.coarsen petsc4py.PETSc.DM-class.html#coarsen petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DM.copyFields petsc4py.PETSc.DM-class.html#copyFields petsc4py.PETSc.DM.getLabelValue petsc4py.PETSc.DM-class.html#getLabelValue petsc4py.PETSc.DM.setCoordinateDim petsc4py.PETSc.DM-class.html#setCoordinateDim petsc4py.PETSc.DM.getStratumSize petsc4py.PETSc.DM-class.html#getStratumSize petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.DM.getLabelIdIS petsc4py.PETSc.DM-class.html#getLabelIdIS petsc4py.PETSc.DM.setOptionsPrefix petsc4py.PETSc.DM-class.html#setOptionsPrefix petsc4py.PETSc.DM.setFieldAdjacency petsc4py.PETSc.DM-class.html#setFieldAdjacency petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DM.createGlobalVector petsc4py.PETSc.DM-class.html#createGlobalVector petsc4py.PETSc.DM.getLocalBoundingBox petsc4py.PETSc.DM-class.html#getLocalBoundingBox petsc4py.PETSc.DM.getDefaultSF petsc4py.PETSc.DM-class.html#getDefaultSF petsc4py.PETSc.DMStag.setUniformCoordinatesProduct petsc4py.PETSc.DMStag-class.html#setUniformCoordinatesProduct petsc4py.PETSc.DM.setNumFields petsc4py.PETSc.DM-class.html#setNumFields petsc4py.PETSc.DM.setFromOptions petsc4py.PETSc.DM-class.html#setFromOptions petsc4py.PETSc.DMStag.migrateVec petsc4py.PETSc.DMStag-class.html#migrateVec petsc4py.PETSc.DM.setSectionSF petsc4py.PETSc.DM-class.html#setSectionSF petsc4py.PETSc.DM.getBoundingBox petsc4py.PETSc.DM-class.html#getBoundingBox petsc4py.PETSc.DM.setDimension petsc4py.PETSc.DM-class.html#setDimension petsc4py.PETSc.DM.hasLabel petsc4py.PETSc.DM-class.html#hasLabel petsc4py.PETSc.DM.ds petsc4py.PETSc.DM-class.html#ds petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.DMStag.dim petsc4py.PETSc.DMStag-class.html#dim petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.DM.setAppCtx petsc4py.PETSc.DM-class.html#setAppCtx petsc4py.PETSc.DM.setGlobalSection petsc4py.PETSc.DM-class.html#setGlobalSection petsc4py.PETSc.DM.createFieldDecomposition petsc4py.PETSc.DM-class.html#createFieldDecomposition petsc4py.PETSc.DM.getCoordinateDim petsc4py.PETSc.DM-class.html#getCoordinateDim petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.DMStag.getOwnershipRanges petsc4py.PETSc.DMStag-class.html#getOwnershipRanges petsc4py.PETSc.DMStag.corners petsc4py.PETSc.DMStag-class.html#corners petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.DM.view petsc4py.PETSc.DM-class.html#view petsc4py.PETSc.DMStag.setCoordinateDMType petsc4py.PETSc.DMStag-class.html#setCoordinateDMType petsc4py.PETSc.DM.getDefaultSection petsc4py.PETSc.DM-class.html#getDefaultSection petsc4py.PETSc.DMStag.setGlobalSizes petsc4py.PETSc.DMStag-class.html#setGlobalSizes petsc4py.PETSc.DMStag.getGhostCorners petsc4py.PETSc.DMStag-class.html#getGhostCorners petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DM.adaptMetric petsc4py.PETSc.DM-class.html#adaptMetric petsc4py.PETSc.DM.setField petsc4py.PETSc.DM-class.html#setField petsc4py.PETSc.DM.localizeCoordinates petsc4py.PETSc.DM-class.html#localizeCoordinates petsc4py.PETSc.DM.getBlockSize petsc4py.PETSc.DM-class.html#getBlockSize petsc4py.PETSc.DM.refineHierarchy petsc4py.PETSc.DM-class.html#refineHierarchy petsc4py.PETSc.DMStag.get1dCoordinatecArrays petsc4py.PETSc.DMStag-class.html#get1dCoordinatecArrays petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.DM.getCoordinates petsc4py.PETSc.DM-class.html#getCoordinates petsc4py.PETSc.DMStag.getProductCoordinateLocationSlot petsc4py.PETSc.DMStag-class.html#getProductCoordinateLocationSlot petsc4py.PETSc.DMStag.setUniformCoordinates petsc4py.PETSc.DMStag-class.html#setUniformCoordinates petsc4py.PETSc.DMStag.stencil_width petsc4py.PETSc.DMStag-class.html#stencil_width petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.DM.setVecType petsc4py.PETSc.DM-class.html#setVecType petsc4py.PETSc.DM.globalToLocal petsc4py.PETSc.DM-class.html#globalToLocal petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DM.setDefaultSF petsc4py.PETSc.DM-class.html#setDefaultSF petsc4py.PETSc.DM.addCoarsenHook petsc4py.PETSc.DM-class.html#addCoarsenHook petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.DMStag.getDof petsc4py.PETSc.DMStag-class.html#getDof petsc4py.PETSc.DM.getLabelName petsc4py.PETSc.DM-class.html#getLabelName petsc4py.PETSc.DM.createSectionSF petsc4py.PETSc.DM-class.html#createSectionSF petsc4py.PETSc.DM.setUp petsc4py.PETSc.DM-class.html#setUp petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.DM.getDS petsc4py.PETSc.DM-class.html#getDS petsc4py.PETSc.DM.getPointSF petsc4py.PETSc.DM-class.html#getPointSF petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.DMStag.ghost_corners petsc4py.PETSc.DMStag-class.html#ghost_corners petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.DM.setSNESJacobian petsc4py.PETSc.DM-class.html#setSNESJacobian petsc4py.PETSc.DM.createLabel petsc4py.PETSc.DM-class.html#createLabel petsc4py.PETSc.DM.getMatrix petsc4py.PETSc.DM-class.html#getMatrix petsc4py.PETSc.DMStag.getGlobalSizes petsc4py.PETSc.DMStag-class.html#getGlobalSizes petsc4py.PETSc.DM.getDefaultGlobalSection petsc4py.PETSc.DM-class.html#getDefaultGlobalSection petsc4py.PETSc.DM.clearLabelValue petsc4py.PETSc.DM-class.html#clearLabelValue petsc4py.PETSc.DMStag.getLocationSlot petsc4py.PETSc.DMStag-class.html#getLocationSlot petsc4py.PETSc.DM.setDefaultGlobalSection petsc4py.PETSc.DM-class.html#setDefaultGlobalSection petsc4py.PETSc.DM.getCoordinatesLocal petsc4py.PETSc.DM-class.html#getCoordinatesLocal petsc4py.PETSc.DM.getLabelOutput petsc4py.PETSc.DM-class.html#getLabelOutput petsc4py.PETSc.DM.appctx petsc4py.PETSc.DM-class.html#appctx petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.DMStag.getProcSizes petsc4py.PETSc.DMStag-class.html#getProcSizes petsc4py.PETSc.DMStag.setUniformCoordinatesExplicit petsc4py.PETSc.DMStag-class.html#setUniformCoordinatesExplicit petsc4py.PETSc.DMStag.setStencilType petsc4py.PETSc.DMStag-class.html#setStencilType petsc4py.PETSc.DM.setLabelValue petsc4py.PETSc.DM-class.html#setLabelValue petsc4py.PETSc.DM.setCoordinates petsc4py.PETSc.DM-class.html#setCoordinates petsc4py.PETSc.DM.adaptLabel petsc4py.PETSc.DM-class.html#adaptLabel petsc4py.PETSc.DM.createMat petsc4py.PETSc.DM-class.html#createMat petsc4py.PETSc.DM.createLocalVector petsc4py.PETSc.DM-class.html#createLocalVector petsc4py.PETSc.DM.getCoordinateSection petsc4py.PETSc.DM-class.html#getCoordinateSection petsc4py.PETSc.DM.setMatType petsc4py.PETSc.DM-class.html#setMatType petsc4py.PETSc.DMStag.boundary_types petsc4py.PETSc.DMStag-class.html#boundary_types petsc4py.PETSc.DM.setType petsc4py.PETSc.DM-class.html#setType petsc4py.PETSc.DM.getSection petsc4py.PETSc.DM-class.html#getSection petsc4py.PETSc.DMStag.StencilLocation petsc4py.PETSc.DMStag.StencilLocation-class.html petsc4py.PETSc.DMStag.create petsc4py.PETSc.DMStag-class.html#create petsc4py.PETSc.DM.setSection petsc4py.PETSc.DM-class.html#setSection petsc4py.PETSc.DMStag.setProcSizes petsc4py.PETSc.DMStag-class.html#setProcSizes petsc4py.PETSc.DM.getCoordinateDM petsc4py.PETSc.DM-class.html#getCoordinateDM petsc4py.PETSc.DM.getNumLabels petsc4py.PETSc.DM-class.html#getNumLabels petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DM.getDimension petsc4py.PETSc.DM-class.html#getDimension petsc4py.PETSc.DMStag.getLocalSizes petsc4py.PETSc.DMStag-class.html#getLocalSizes petsc4py.PETSc.DM.setSNESFunction petsc4py.PETSc.DM-class.html#setSNESFunction petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.DMStag.setDof petsc4py.PETSc.DMStag-class.html#setDof petsc4py.PETSc.DMStag.getStencilWidth petsc4py.PETSc.DMStag-class.html#getStencilWidth petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DM.convert petsc4py.PETSc.DM-class.html#convert petsc4py.PETSc.DM.getAppCtx petsc4py.PETSc.DM-class.html#getAppCtx petsc4py.PETSc.DM.setPointSF petsc4py.PETSc.DM-class.html#setPointSF petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.DM.copyDS petsc4py.PETSc.DM-class.html#copyDS petsc4py.PETSc.DM.getField petsc4py.PETSc.DM-class.html#getField petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.DMStag.getDim petsc4py.PETSc.DMStag-class.html#getDim petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.DMStag.entries_per_element petsc4py.PETSc.DMStag-class.html#entries_per_element petsc4py.PETSc.DM.getCoarsenLevel petsc4py.PETSc.DM-class.html#getCoarsenLevel petsc4py.PETSc.DMStag.getLocationDof petsc4py.PETSc.DMStag-class.html#getLocationDof petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.DM.getRefineLevel petsc4py.PETSc.DM-class.html#getRefineLevel petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.DM.setRefineLevel petsc4py.PETSc.DM-class.html#setRefineLevel petsc4py.PETSc.DMStag.VecSplitToDMDA petsc4py.PETSc.DMStag-class.html#VecSplitToDMDA petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DM.refine petsc4py.PETSc.DM-class.html#refine petsc4py.PETSc.DM.createLocalVec petsc4py.PETSc.DM-class.html#createLocalVec petsc4py.PETSc.DMStag.getIsFirstRank petsc4py.PETSc.DMStag-class.html#getIsFirstRank petsc4py.PETSc.DM.getNumFields petsc4py.PETSc.DM-class.html#getNumFields petsc4py.PETSc.DM.getGlobalVec petsc4py.PETSc.DM-class.html#getGlobalVec petsc4py.PETSc.DM.setKSPComputeOperators petsc4py.PETSc.DM-class.html#setKSPComputeOperators petsc4py.PETSc.DM.localToLocal petsc4py.PETSc.DM-class.html#localToLocal petsc4py.PETSc.DMStag.__new__ petsc4py.PETSc.DMStag-class.html#__new__ petsc4py.PETSc.DM.Type petsc4py.PETSc.DM.Type-class.html petsc4py.PETSc.DM.getLabelSize petsc4py.PETSc.DM-class.html#getLabelSize petsc4py.PETSc.DM.localToGlobal petsc4py.PETSc.DM-class.html#localToGlobal petsc4py.PETSc.DMStag.stencil_type petsc4py.PETSc.DMStag-class.html#stencil_type petsc4py.PETSc.DM.coarsenHierarchy petsc4py.PETSc.DM-class.html#coarsenHierarchy petsc4py.PETSc.DM.destroy petsc4py.PETSc.DM-class.html#destroy petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.DM.getType petsc4py.PETSc.DM-class.html#getType petsc4py.PETSc.DMStag.getStencilType petsc4py.PETSc.DMStag-class.html#getStencilType petsc4py.PETSc.DM.createDefaultSF petsc4py.PETSc.DM-class.html#createDefaultSF petsc4py.PETSc.DM.setCoordinatesLocal petsc4py.PETSc.DM-class.html#setCoordinatesLocal petsc4py.PETSc.DM.clone petsc4py.PETSc.DM-class.html#clone petsc4py.PETSc.DMStag.getEntriesPerElement petsc4py.PETSc.DMStag-class.html#getEntriesPerElement petsc4py.PETSc.DM.setDefaultSection petsc4py.PETSc.DM-class.html#setDefaultSection petsc4py.PETSc.DMStag.getVecArray petsc4py.PETSc.DMStag-class.html#getVecArray petsc4py.PETSc.DM.clearDS petsc4py.PETSc.DM-class.html#clearDS petsc4py.PETSc.DM.getFieldAdjacency petsc4py.PETSc.DM-class.html#getFieldAdjacency petsc4py.PETSc.DM.copyDisc petsc4py.PETSc.DM-class.html#copyDisc petsc4py.PETSc.DMStag.setStencilWidth petsc4py.PETSc.DMStag-class.html#setStencilWidth petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.DM.setBasicAdjacency petsc4py.PETSc.DM-class.html#setBasicAdjacency petsc4py.PETSc.DM.createInterpolation petsc4py.PETSc.DM-class.html#createInterpolation petsc4py.PETSc.DM.setLabelOutput petsc4py.PETSc.DM-class.html#setLabelOutput petsc4py.PETSc.DMStag.setOwnershipRanges petsc4py.PETSc.DMStag-class.html#setOwnershipRanges petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DM.restoreGlobalVec petsc4py.PETSc.DM-class.html#restoreGlobalVec petsc4py.PETSc.DMStag.createCompatibleDMStag petsc4py.PETSc.DMStag-class.html#createCompatibleDMStag petsc4py.PETSc.DM.getSectionSF petsc4py.PETSc.DM-class.html#getSectionSF petsc4py.PETSc.DMStag.getIsLastRank petsc4py.PETSc.DMStag-class.html#getIsLastRank petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.DMStag.getCorners petsc4py.PETSc.DMStag-class.html#getCorners petsc4py.PETSc.DMStag.dofs petsc4py.PETSc.DMStag-class.html#dofs petsc4py.PETSc.DMStag.StencilLocation petsc4py.PETSc.DMStag.StencilLocation-class.html petsc4py.PETSc.DMStag.StencilLocation.BACK_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_LEFT petsc4py.PETSc.DMStag.StencilLocation.UP_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#UP_RIGHT petsc4py.PETSc.DMStag.StencilLocation.BACK petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK petsc4py.PETSc.DMStag.StencilLocation.DOWN petsc4py.PETSc.DMStag.StencilLocation-class.html#DOWN petsc4py.PETSc.DMStag.StencilLocation.BACK_DOWN_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_DOWN_RIGHT petsc4py.PETSc.DMStag.StencilLocation.BACK_UP petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_UP petsc4py.PETSc.DMStag.StencilLocation.FRONT_UP petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_UP petsc4py.PETSc.DMStag.StencilLocation.FRONT_DOWN_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_DOWN_RIGHT petsc4py.PETSc.DMStag.StencilLocation.BACK_DOWN_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_DOWN_LEFT petsc4py.PETSc.DMStag.StencilLocation.NULLLOC petsc4py.PETSc.DMStag.StencilLocation-class.html#NULLLOC petsc4py.PETSc.DMStag.StencilLocation.BACK_DOWN petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_DOWN petsc4py.PETSc.DMStag.StencilLocation.FRONT_UP_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_UP_RIGHT petsc4py.PETSc.DMStag.StencilLocation.FRONT_UP_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_UP_LEFT petsc4py.PETSc.DMStag.StencilLocation.BACK_UP_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_UP_RIGHT petsc4py.PETSc.DMStag.StencilLocation.FRONT petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT petsc4py.PETSc.DMStag.StencilLocation.FRONT_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_LEFT petsc4py.PETSc.DMStag.StencilLocation.FRONT_DOWN_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_DOWN_LEFT petsc4py.PETSc.DMStag.StencilLocation.DOWN_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#DOWN_LEFT petsc4py.PETSc.DMStag.StencilLocation.LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#LEFT petsc4py.PETSc.DMStag.StencilLocation.UP_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#UP_LEFT petsc4py.PETSc.DMStag.StencilLocation.BACK_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_RIGHT petsc4py.PETSc.DMStag.StencilLocation.ELEMENT petsc4py.PETSc.DMStag.StencilLocation-class.html#ELEMENT petsc4py.PETSc.DMStag.StencilLocation.DOWN_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#DOWN_RIGHT petsc4py.PETSc.DMStag.StencilLocation.FRONT_RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_RIGHT petsc4py.PETSc.DMStag.StencilLocation.RIGHT petsc4py.PETSc.DMStag.StencilLocation-class.html#RIGHT petsc4py.PETSc.DMStag.StencilLocation.UP petsc4py.PETSc.DMStag.StencilLocation-class.html#UP petsc4py.PETSc.DMStag.StencilLocation.__qualname__ petsc4py.PETSc.DMStag.StencilLocation-class.html#__qualname__ petsc4py.PETSc.DMStag.StencilLocation.BACK_UP_LEFT petsc4py.PETSc.DMStag.StencilLocation-class.html#BACK_UP_LEFT petsc4py.PETSc.DMStag.StencilLocation.FRONT_DOWN petsc4py.PETSc.DMStag.StencilLocation-class.html#FRONT_DOWN petsc4py.PETSc.DMStag.StencilType petsc4py.PETSc.DMStag.StencilType-class.html petsc4py.PETSc.DMStag.StencilType.BOX petsc4py.PETSc.DMStag.StencilType-class.html#BOX petsc4py.PETSc.DMStag.StencilType.NONE petsc4py.PETSc.DMStag.StencilType-class.html#NONE petsc4py.PETSc.DMStag.StencilType.STAR petsc4py.PETSc.DMStag.StencilType-class.html#STAR petsc4py.PETSc.DMStag.StencilType.__qualname__ petsc4py.PETSc.DMStag.StencilType-class.html#__qualname__ petsc4py.PETSc.DMSwarm petsc4py.PETSc.DMSwarm-class.html petsc4py.PETSc.DMSwarm.vectorDefineField petsc4py.PETSc.DMSwarm-class.html#vectorDefineField petsc4py.PETSc.DM.getLGMap petsc4py.PETSc.DM-class.html#getLGMap petsc4py.PETSc.DM.getStratumIS petsc4py.PETSc.DM-class.html#getStratumIS petsc4py.PETSc.DMSwarm.sortGetNumberOfPointsPerCell petsc4py.PETSc.DMSwarm-class.html#sortGetNumberOfPointsPerCell petsc4py.PETSc.DMSwarm.viewFieldsXDMF petsc4py.PETSc.DMSwarm-class.html#viewFieldsXDMF petsc4py.PETSc.DMSwarm.getSize petsc4py.PETSc.DMSwarm-class.html#getSize petsc4py.PETSc.DMSwarm.finalizeFieldRegister petsc4py.PETSc.DMSwarm-class.html#finalizeFieldRegister petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DM.restoreLocalVec petsc4py.PETSc.DM-class.html#restoreLocalVec petsc4py.PETSc.DM.getLabel petsc4py.PETSc.DM-class.html#getLabel petsc4py.PETSc.DM.adaptMetric petsc4py.PETSc.DM-class.html#adaptMetric petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.DM.createGlobalVec petsc4py.PETSc.DM-class.html#createGlobalVec petsc4py.PETSc.DM.createDS petsc4py.PETSc.DM-class.html#createDS petsc4py.PETSc.DM.clearLabelStratum petsc4py.PETSc.DM-class.html#clearLabelStratum petsc4py.PETSc.DM.getGlobalSection petsc4py.PETSc.DM-class.html#getGlobalSection petsc4py.PETSc.DMSwarm.sortGetAccess petsc4py.PETSc.DMSwarm-class.html#sortGetAccess petsc4py.PETSc.DM.viewFromOptions petsc4py.PETSc.DM-class.html#viewFromOptions petsc4py.PETSc.DM.getBasicAdjacency petsc4py.PETSc.DM-class.html#getBasicAdjacency petsc4py.PETSc.DM.addField petsc4py.PETSc.DM-class.html#addField petsc4py.PETSc.DM.removeLabel petsc4py.PETSc.DM-class.html#removeLabel petsc4py.PETSc.DM.getLocalVec petsc4py.PETSc.DM-class.html#getLocalVec petsc4py.PETSc.DMSwarm.setCellDM petsc4py.PETSc.DMSwarm-class.html#setCellDM petsc4py.PETSc.DMSwarm.sortGetPointsPerCell petsc4py.PETSc.DMSwarm-class.html#sortGetPointsPerCell petsc4py.PETSc.DM.coarsen petsc4py.PETSc.DM-class.html#coarsen petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DMSwarm.setLocalSizes petsc4py.PETSc.DMSwarm-class.html#setLocalSizes petsc4py.PETSc.DM.copyFields petsc4py.PETSc.DM-class.html#copyFields petsc4py.PETSc.DM.getLabelValue petsc4py.PETSc.DM-class.html#getLabelValue petsc4py.PETSc.DM.setCoordinateDim petsc4py.PETSc.DM-class.html#setCoordinateDim petsc4py.PETSc.DM.getStratumSize petsc4py.PETSc.DM-class.html#getStratumSize petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.DM.getLabelIdIS petsc4py.PETSc.DM-class.html#getLabelIdIS petsc4py.PETSc.DM.setOptionsPrefix petsc4py.PETSc.DM-class.html#setOptionsPrefix petsc4py.PETSc.DM.setFieldAdjacency petsc4py.PETSc.DM-class.html#setFieldAdjacency petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DM.createGlobalVector petsc4py.PETSc.DM-class.html#createGlobalVector petsc4py.PETSc.DM.getDefaultSF petsc4py.PETSc.DM-class.html#getDefaultSF petsc4py.PETSc.DM.setNumFields petsc4py.PETSc.DM-class.html#setNumFields petsc4py.PETSc.DM.setFromOptions petsc4py.PETSc.DM-class.html#setFromOptions petsc4py.PETSc.DM.setSectionSF petsc4py.PETSc.DM-class.html#setSectionSF petsc4py.PETSc.DMSwarm.PICLayoutType petsc4py.PETSc.DMSwarm.PICLayoutType-class.html petsc4py.PETSc.DM.setDimension petsc4py.PETSc.DM-class.html#setDimension petsc4py.PETSc.DM.hasLabel petsc4py.PETSc.DM-class.html#hasLabel petsc4py.PETSc.DM.ds petsc4py.PETSc.DM-class.html#ds petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.DM.setAppCtx petsc4py.PETSc.DM-class.html#setAppCtx petsc4py.PETSc.DMSwarm.sortGetSizes petsc4py.PETSc.DMSwarm-class.html#sortGetSizes petsc4py.PETSc.DM.createFieldDecomposition petsc4py.PETSc.DM-class.html#createFieldDecomposition petsc4py.PETSc.DM.getCoordinateDim petsc4py.PETSc.DM-class.html#getCoordinateDim petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.DM.view petsc4py.PETSc.DM-class.html#view petsc4py.PETSc.DM.getDefaultSection petsc4py.PETSc.DM-class.html#getDefaultSection petsc4py.PETSc.DMSwarm.sortRestoreAccess petsc4py.PETSc.DMSwarm-class.html#sortRestoreAccess petsc4py.PETSc.DM.createRestriction petsc4py.PETSc.DM-class.html#createRestriction petsc4py.PETSc.DM.localizeCoordinates petsc4py.PETSc.DM-class.html#localizeCoordinates petsc4py.PETSc.DMSwarm.collectViewCreate petsc4py.PETSc.DMSwarm-class.html#collectViewCreate petsc4py.PETSc.DM.refineHierarchy petsc4py.PETSc.DM-class.html#refineHierarchy petsc4py.PETSc.DMSwarm.Type petsc4py.PETSc.DMSwarm.Type-class.html petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.DM.getCoordinates petsc4py.PETSc.DM-class.html#getCoordinates petsc4py.PETSc.DM.createInterpolation petsc4py.PETSc.DM-class.html#createInterpolation petsc4py.PETSc.DM.setField petsc4py.PETSc.DM-class.html#setField petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.DM.localToGlobal petsc4py.PETSc.DM-class.html#localToGlobal petsc4py.PETSc.DM.setVecType petsc4py.PETSc.DM-class.html#setVecType petsc4py.PETSc.DM.globalToLocal petsc4py.PETSc.DM-class.html#globalToLocal petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DM.setDefaultSF petsc4py.PETSc.DM-class.html#setDefaultSF petsc4py.PETSc.DMSwarm.projectFields petsc4py.PETSc.DMSwarm-class.html#projectFields petsc4py.PETSc.DM.addCoarsenHook petsc4py.PETSc.DM-class.html#addCoarsenHook petsc4py.PETSc.DM.clone petsc4py.PETSc.DM-class.html#clone petsc4py.PETSc.DMSwarm.removePoint petsc4py.PETSc.DMSwarm-class.html#removePoint petsc4py.PETSc.DM.getLabelName petsc4py.PETSc.DM-class.html#getLabelName petsc4py.PETSc.DMSwarm.setPointCoordinates petsc4py.PETSc.DMSwarm-class.html#setPointCoordinates petsc4py.PETSc.DM.createSectionSF petsc4py.PETSc.DM-class.html#createSectionSF petsc4py.PETSc.DM.setUp petsc4py.PETSc.DM-class.html#setUp petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.DM.getDS petsc4py.PETSc.DM-class.html#getDS petsc4py.PETSc.DM.getPointSF petsc4py.PETSc.DM-class.html#getPointSF petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.DM.createMatrix petsc4py.PETSc.DM-class.html#createMatrix petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.DM.setSNESJacobian petsc4py.PETSc.DM-class.html#setSNESJacobian petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.DM.createLabel petsc4py.PETSc.DM-class.html#createLabel petsc4py.PETSc.DM.getMatrix petsc4py.PETSc.DM-class.html#getMatrix petsc4py.PETSc.DM.getDefaultGlobalSection petsc4py.PETSc.DM-class.html#getDefaultGlobalSection petsc4py.PETSc.DM.clearLabelValue petsc4py.PETSc.DM-class.html#clearLabelValue petsc4py.PETSc.DM.convert petsc4py.PETSc.DM-class.html#convert petsc4py.PETSc.DM.setDefaultGlobalSection petsc4py.PETSc.DM-class.html#setDefaultGlobalSection petsc4py.PETSc.DM.getCoordinatesLocal petsc4py.PETSc.DM-class.html#getCoordinatesLocal petsc4py.PETSc.DMSwarm.getLocalSize petsc4py.PETSc.DMSwarm-class.html#getLocalSize petsc4py.PETSc.DM.getLabelOutput petsc4py.PETSc.DM-class.html#getLabelOutput petsc4py.PETSc.DM.appctx petsc4py.PETSc.DM-class.html#appctx petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.DMSwarm.insertPointUsingCellDM petsc4py.PETSc.DMSwarm-class.html#insertPointUsingCellDM petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.DM.load petsc4py.PETSc.DM-class.html#load petsc4py.PETSc.DM.getBoundingBox petsc4py.PETSc.DM-class.html#getBoundingBox petsc4py.PETSc.DM.setLabelValue petsc4py.PETSc.DM-class.html#setLabelValue petsc4py.PETSc.DM.setCoordinates petsc4py.PETSc.DM-class.html#setCoordinates petsc4py.PETSc.DMSwarm.registerField petsc4py.PETSc.DMSwarm-class.html#registerField petsc4py.PETSc.DMSwarm.restoreField petsc4py.PETSc.DMSwarm-class.html#restoreField petsc4py.PETSc.DM.adaptLabel petsc4py.PETSc.DM-class.html#adaptLabel petsc4py.PETSc.DM.createMat petsc4py.PETSc.DM-class.html#createMat petsc4py.PETSc.DM.createLocalVector petsc4py.PETSc.DM-class.html#createLocalVector petsc4py.PETSc.DMSwarm.destroyGlobalVectorFromField petsc4py.PETSc.DMSwarm-class.html#destroyGlobalVectorFromField petsc4py.PETSc.DM.getCoordinateSection petsc4py.PETSc.DM-class.html#getCoordinateSection petsc4py.PETSc.DM.setMatType petsc4py.PETSc.DM-class.html#setMatType petsc4py.PETSc.DMSwarm.setType petsc4py.PETSc.DMSwarm-class.html#setType petsc4py.PETSc.DM.getSection petsc4py.PETSc.DM-class.html#getSection petsc4py.PETSc.DMSwarm.create petsc4py.PETSc.DMSwarm-class.html#create petsc4py.PETSc.DM.BoundaryType petsc4py.PETSc.DM.BoundaryType-class.html petsc4py.PETSc.DM.getCoordinateDM petsc4py.PETSc.DM-class.html#getCoordinateDM petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DM.getNumLabels petsc4py.PETSc.DM-class.html#getNumLabels petsc4py.PETSc.DMSwarm.getCellDM petsc4py.PETSc.DMSwarm-class.html#getCellDM petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DM.setGlobalSection petsc4py.PETSc.DM-class.html#setGlobalSection petsc4py.PETSc.DM.getDimension petsc4py.PETSc.DM-class.html#getDimension petsc4py.PETSc.DM.createInjection petsc4py.PETSc.DM-class.html#createInjection petsc4py.PETSc.DM.setSNESFunction petsc4py.PETSc.DM-class.html#setSNESFunction petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.DM.getType petsc4py.PETSc.DM-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DMSwarm.setPointCoordinatesCellwise petsc4py.PETSc.DMSwarm-class.html#setPointCoordinatesCellwise petsc4py.PETSc.DM.getAppCtx petsc4py.PETSc.DM-class.html#getAppCtx petsc4py.PETSc.DM.setPointSF petsc4py.PETSc.DM-class.html#setPointSF petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.DM.copyDS petsc4py.PETSc.DM-class.html#copyDS petsc4py.PETSc.DMSwarm.setPointsUniformCoordinates petsc4py.PETSc.DMSwarm-class.html#setPointsUniformCoordinates petsc4py.PETSc.DMSwarm.getField petsc4py.PETSc.DMSwarm-class.html#getField petsc4py.PETSc.DMSwarm.CollectType petsc4py.PETSc.DMSwarm.CollectType-class.html petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.DM.getCoarsenLevel petsc4py.PETSc.DM-class.html#getCoarsenLevel petsc4py.PETSc.DMSwarm.initializeFieldRegister petsc4py.PETSc.DMSwarm-class.html#initializeFieldRegister petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.DM.getRefineLevel petsc4py.PETSc.DM-class.html#getRefineLevel petsc4py.PETSc.DMSwarm.createLocalVectorFromField petsc4py.PETSc.DMSwarm-class.html#createLocalVectorFromField petsc4py.PETSc.DM.setRefineLevel petsc4py.PETSc.DM-class.html#setRefineLevel petsc4py.PETSc.DM.setSection petsc4py.PETSc.DM-class.html#setSection petsc4py.PETSc.DMSwarm.migrate petsc4py.PETSc.DMSwarm-class.html#migrate petsc4py.PETSc.DM.getBlockSize petsc4py.PETSc.DM-class.html#getBlockSize petsc4py.PETSc.DMSwarm.collectViewDestroy petsc4py.PETSc.DMSwarm-class.html#collectViewDestroy petsc4py.PETSc.DM.refine petsc4py.PETSc.DM-class.html#refine petsc4py.PETSc.DM.createLocalVec petsc4py.PETSc.DM-class.html#createLocalVec petsc4py.PETSc.DM.getNumFields petsc4py.PETSc.DM-class.html#getNumFields petsc4py.PETSc.DM.getGlobalVec petsc4py.PETSc.DM-class.html#getGlobalVec petsc4py.PETSc.DM.setKSPComputeOperators petsc4py.PETSc.DM-class.html#setKSPComputeOperators petsc4py.PETSc.DM.localToLocal petsc4py.PETSc.DM-class.html#localToLocal petsc4py.PETSc.DMSwarm.__new__ petsc4py.PETSc.DMSwarm-class.html#__new__ petsc4py.PETSc.DMSwarm.sortGetIsValid petsc4py.PETSc.DMSwarm-class.html#sortGetIsValid petsc4py.PETSc.DMSwarm.createGlobalVectorFromField petsc4py.PETSc.DMSwarm-class.html#createGlobalVectorFromField petsc4py.PETSc.DM.getLabelSize petsc4py.PETSc.DM-class.html#getLabelSize petsc4py.PETSc.DMSwarm.addNPoints petsc4py.PETSc.DMSwarm-class.html#addNPoints petsc4py.PETSc.DM.getLocalBoundingBox petsc4py.PETSc.DM-class.html#getLocalBoundingBox petsc4py.PETSc.DM.coarsenHierarchy petsc4py.PETSc.DM-class.html#coarsenHierarchy petsc4py.PETSc.DM.destroy petsc4py.PETSc.DM-class.html#destroy petsc4py.PETSc.DMSwarm.addPoint petsc4py.PETSc.DMSwarm-class.html#addPoint petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.DM.createDefaultSF petsc4py.PETSc.DM-class.html#createDefaultSF petsc4py.PETSc.DM.setCoordinatesLocal petsc4py.PETSc.DM-class.html#setCoordinatesLocal petsc4py.PETSc.DMSwarm.copyPoint petsc4py.PETSc.DMSwarm-class.html#copyPoint petsc4py.PETSc.DM.setDefaultSection petsc4py.PETSc.DM-class.html#setDefaultSection petsc4py.PETSc.DM.clearDS petsc4py.PETSc.DM-class.html#clearDS petsc4py.PETSc.DMSwarm.destroyLocalVectorFromField petsc4py.PETSc.DMSwarm-class.html#destroyLocalVectorFromField petsc4py.PETSc.DM.getFieldAdjacency petsc4py.PETSc.DM-class.html#getFieldAdjacency petsc4py.PETSc.DM.copyDisc petsc4py.PETSc.DM-class.html#copyDisc petsc4py.PETSc.DM.setBasicAdjacency petsc4py.PETSc.DM-class.html#setBasicAdjacency petsc4py.PETSc.DMSwarm.MigrateType petsc4py.PETSc.DMSwarm.MigrateType-class.html petsc4py.PETSc.DMSwarm.viewXDMF petsc4py.PETSc.DMSwarm-class.html#viewXDMF petsc4py.PETSc.DM.setLabelOutput petsc4py.PETSc.DM-class.html#setLabelOutput petsc4py.PETSc.DMSwarm.removePointAtIndex petsc4py.PETSc.DMSwarm-class.html#removePointAtIndex petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DM.restoreGlobalVec petsc4py.PETSc.DM-class.html#restoreGlobalVec petsc4py.PETSc.DM.getSectionSF petsc4py.PETSc.DM-class.html#getSectionSF petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.DMSwarm.CollectType petsc4py.PETSc.DMSwarm.CollectType-class.html petsc4py.PETSc.DMSwarm.CollectType.COLLECT_GENERAL petsc4py.PETSc.DMSwarm.CollectType-class.html#COLLECT_GENERAL petsc4py.PETSc.DMSwarm.CollectType.__qualname__ petsc4py.PETSc.DMSwarm.CollectType-class.html#__qualname__ petsc4py.PETSc.DMSwarm.CollectType.COLLECT_USER petsc4py.PETSc.DMSwarm.CollectType-class.html#COLLECT_USER petsc4py.PETSc.DMSwarm.CollectType.COLLECT_DMDABOUNDINGBOX petsc4py.PETSc.DMSwarm.CollectType-class.html#COLLECT_DMDABOUNDINGBOX petsc4py.PETSc.DMSwarm.CollectType.COLLECT_BASIC petsc4py.PETSc.DMSwarm.CollectType-class.html#COLLECT_BASIC petsc4py.PETSc.DMSwarm.MigrateType petsc4py.PETSc.DMSwarm.MigrateType-class.html petsc4py.PETSc.DMSwarm.MigrateType.MIGRATE_BASIC petsc4py.PETSc.DMSwarm.MigrateType-class.html#MIGRATE_BASIC petsc4py.PETSc.DMSwarm.MigrateType.MIGRATE_DMCELLEXACT petsc4py.PETSc.DMSwarm.MigrateType-class.html#MIGRATE_DMCELLEXACT petsc4py.PETSc.DMSwarm.MigrateType.MIGRATE_DMCELLNSCATTER petsc4py.PETSc.DMSwarm.MigrateType-class.html#MIGRATE_DMCELLNSCATTER petsc4py.PETSc.DMSwarm.MigrateType.__qualname__ petsc4py.PETSc.DMSwarm.MigrateType-class.html#__qualname__ petsc4py.PETSc.DMSwarm.MigrateType.MIGRATE_USER petsc4py.PETSc.DMSwarm.MigrateType-class.html#MIGRATE_USER petsc4py.PETSc.DMSwarm.PICLayoutType petsc4py.PETSc.DMSwarm.PICLayoutType-class.html petsc4py.PETSc.DMSwarm.PICLayoutType.LAYOUT_SUBDIVISION petsc4py.PETSc.DMSwarm.PICLayoutType-class.html#LAYOUT_SUBDIVISION petsc4py.PETSc.DMSwarm.PICLayoutType.LAYOUT_GAUSS petsc4py.PETSc.DMSwarm.PICLayoutType-class.html#LAYOUT_GAUSS petsc4py.PETSc.DMSwarm.PICLayoutType.__qualname__ petsc4py.PETSc.DMSwarm.PICLayoutType-class.html#__qualname__ petsc4py.PETSc.DMSwarm.PICLayoutType.LAYOUT_REGULAR petsc4py.PETSc.DMSwarm.PICLayoutType-class.html#LAYOUT_REGULAR petsc4py.PETSc.DMSwarm.Type petsc4py.PETSc.DMSwarm.Type-class.html petsc4py.PETSc.DMSwarm.Type.PIC petsc4py.PETSc.DMSwarm.Type-class.html#PIC petsc4py.PETSc.DMSwarm.Type.__qualname__ petsc4py.PETSc.DMSwarm.Type-class.html#__qualname__ petsc4py.PETSc.DMSwarm.Type.BASIC petsc4py.PETSc.DMSwarm.Type-class.html#BASIC petsc4py.PETSc.DS petsc4py.PETSc.DS-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.DS.getSpatialDimension petsc4py.PETSc.DS-class.html#getSpatialDimension petsc4py.PETSc.DS.getTotalComponents petsc4py.PETSc.DS-class.html#getTotalComponents petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.DS.getComponents petsc4py.PETSc.DS-class.html#getComponents petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.DS.Type petsc4py.PETSc.DS.Type-class.html petsc4py.PETSc.DS.setType petsc4py.PETSc.DS-class.html#setType petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.DS.__new__ petsc4py.PETSc.DS-class.html#__new__ petsc4py.PETSc.DS.getFieldIndex petsc4py.PETSc.DS-class.html#getFieldIndex petsc4py.PETSc.DS.create petsc4py.PETSc.DS-class.html#create petsc4py.PETSc.DS.getTotalDimensions petsc4py.PETSc.DS-class.html#getTotalDimensions petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.DS.destroy petsc4py.PETSc.DS-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.DS.setUp petsc4py.PETSc.DS-class.html#setUp petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.DS.setDiscretisation petsc4py.PETSc.DS-class.html#setDiscretisation petsc4py.PETSc.DS.getType petsc4py.PETSc.DS-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.DS.getDimensions petsc4py.PETSc.DS-class.html#getDimensions petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.DS.setFromOptions petsc4py.PETSc.DS-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.DS.getCoordinateDimension petsc4py.PETSc.DS-class.html#getCoordinateDimension petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.DS.getNumFields petsc4py.PETSc.DS-class.html#getNumFields petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.DS.view petsc4py.PETSc.DS-class.html#view petsc4py.PETSc.DS.Type petsc4py.PETSc.DS.Type-class.html petsc4py.PETSc.DS.Type.__qualname__ petsc4py.PETSc.DS.Type-class.html#__qualname__ petsc4py.PETSc.DS.Type.BASIC petsc4py.PETSc.DS.Type-class.html#BASIC petsc4py.PETSc.Error petsc4py.PETSc.Error-class.html petsc4py.PETSc.Error.__str__ petsc4py.PETSc.Error-class.html#__str__ petsc4py.PETSc.Error.__init__ petsc4py.PETSc.Error-class.html#__init__ petsc4py.PETSc.Error._traceback_ petsc4py.PETSc.Error-class.html#_traceback_ petsc4py.PETSc.Error.__nonzero__ petsc4py.PETSc.Error-class.html#__nonzero__ petsc4py.PETSc.Error.__qualname__ petsc4py.PETSc.Error-class.html#__qualname__ petsc4py.PETSc.Error.__repr__ petsc4py.PETSc.Error-class.html#__repr__ petsc4py.PETSc.FE petsc4py.PETSc.FE-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.FE.Type petsc4py.PETSc.FE.Type-class.html petsc4py.PETSc.FE.setType petsc4py.PETSc.FE-class.html#setType petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.FE.__new__ petsc4py.PETSc.FE-class.html#__new__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.FE.destroy petsc4py.PETSc.FE-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.getType petsc4py.PETSc.Object-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.FE.createDefault petsc4py.PETSc.FE-class.html#createDefault petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.FE.getQuadrature petsc4py.PETSc.FE-class.html#getQuadrature petsc4py.PETSc.FE.setFaceQuadrature petsc4py.PETSc.FE-class.html#setFaceQuadrature petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.FE.setQuadrature petsc4py.PETSc.FE-class.html#setQuadrature petsc4py.PETSc.FE.getFaceQuadrature petsc4py.PETSc.FE-class.html#getFaceQuadrature petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.FE.create petsc4py.PETSc.FE-class.html#create petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.view petsc4py.PETSc.Object-class.html#view petsc4py.PETSc.FE.Type petsc4py.PETSc.FE.Type-class.html petsc4py.PETSc.FE.Type.COMPOSITE petsc4py.PETSc.FE.Type-class.html#COMPOSITE petsc4py.PETSc.FE.Type.OPENCL petsc4py.PETSc.FE.Type-class.html#OPENCL petsc4py.PETSc.FE.Type.__qualname__ petsc4py.PETSc.FE.Type-class.html#__qualname__ petsc4py.PETSc.FE.Type.BASIC petsc4py.PETSc.FE.Type-class.html#BASIC petsc4py.PETSc.IS petsc4py.PETSc.IS-class.html petsc4py.PETSc.IS.getSize petsc4py.PETSc.IS-class.html#getSize petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.IS.invertPermutation petsc4py.PETSc.IS-class.html#invertPermutation petsc4py.PETSc.IS.__enter__ petsc4py.PETSc.IS-class.html#__enter__ petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.IS.getStride petsc4py.PETSc.IS-class.html#getStride petsc4py.PETSc.IS.__exit__ petsc4py.PETSc.IS-class.html#__exit__ petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.IS.createStride petsc4py.PETSc.IS-class.html#createStride petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.IS.setBlockSize petsc4py.PETSc.IS-class.html#setBlockSize petsc4py.PETSc.IS.setPermutation petsc4py.PETSc.IS-class.html#setPermutation petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.IS.setIndices petsc4py.PETSc.IS-class.html#setIndices petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.IS.sorted petsc4py.PETSc.IS-class.html#sorted petsc4py.PETSc.IS.difference petsc4py.PETSc.IS-class.html#difference petsc4py.PETSc.IS.setStride petsc4py.PETSc.IS-class.html#setStride petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.IS.sizes petsc4py.PETSc.IS-class.html#sizes petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.IS.indices petsc4py.PETSc.IS-class.html#indices petsc4py.PETSc.IS.createGeneral petsc4py.PETSc.IS-class.html#createGeneral petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.IS.getSizes petsc4py.PETSc.IS-class.html#getSizes petsc4py.PETSc.IS.view petsc4py.PETSc.IS-class.html#view petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.IS.getBlockSize petsc4py.PETSc.IS-class.html#getBlockSize petsc4py.PETSc.IS.Type petsc4py.PETSc.IS.Type-class.html petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.IS.setType petsc4py.PETSc.IS-class.html#setType petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.IS.complement petsc4py.PETSc.IS-class.html#complement petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.IS.isSorted petsc4py.PETSc.IS-class.html#isSorted petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.IS.getLocalSize petsc4py.PETSc.IS-class.html#getLocalSize petsc4py.PETSc.IS.equal petsc4py.PETSc.IS-class.html#equal petsc4py.PETSc.IS.createBlock petsc4py.PETSc.IS-class.html#createBlock petsc4py.PETSc.IS.permutation petsc4py.PETSc.IS-class.html#permutation petsc4py.PETSc.IS.load petsc4py.PETSc.IS-class.html#load petsc4py.PETSc.IS.array petsc4py.PETSc.IS-class.html#array petsc4py.PETSc.IS.block_size petsc4py.PETSc.IS-class.html#block_size petsc4py.PETSc.IS.toGeneral petsc4py.PETSc.IS-class.html#toGeneral petsc4py.PETSc.IS.size petsc4py.PETSc.IS-class.html#size petsc4py.PETSc.IS.union petsc4py.PETSc.IS-class.html#union petsc4py.PETSc.IS.create petsc4py.PETSc.IS-class.html#create petsc4py.PETSc.IS.duplicate petsc4py.PETSc.IS-class.html#duplicate petsc4py.PETSc.IS.identity petsc4py.PETSc.IS-class.html#identity petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.IS.setIdentity petsc4py.PETSc.IS-class.html#setIdentity petsc4py.PETSc.IS.sort petsc4py.PETSc.IS-class.html#sort petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.IS.getType petsc4py.PETSc.IS-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.IS.renumber petsc4py.PETSc.IS-class.html#renumber petsc4py.PETSc.IS.isPermutation petsc4py.PETSc.IS-class.html#isPermutation petsc4py.PETSc.IS.copy petsc4py.PETSc.IS-class.html#copy petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.IS.getInfo petsc4py.PETSc.IS-class.html#getInfo petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.IS.embed petsc4py.PETSc.IS-class.html#embed petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.IS.local_size petsc4py.PETSc.IS-class.html#local_size petsc4py.PETSc.IS.allGather petsc4py.PETSc.IS-class.html#allGather petsc4py.PETSc.IS.__new__ petsc4py.PETSc.IS-class.html#__new__ petsc4py.PETSc.IS.getBlockIndices petsc4py.PETSc.IS-class.html#getBlockIndices petsc4py.PETSc.IS.setBlockIndices petsc4py.PETSc.IS-class.html#setBlockIndices petsc4py.PETSc.IS.destroy petsc4py.PETSc.IS-class.html#destroy petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.IS.__array_interface__ petsc4py.PETSc.IS-class.html#__array_interface__ petsc4py.PETSc.IS.getIndices petsc4py.PETSc.IS-class.html#getIndices petsc4py.PETSc.IS.expand petsc4py.PETSc.IS-class.html#expand petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.IS.isIdentity petsc4py.PETSc.IS-class.html#isIdentity petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.IS.sum petsc4py.PETSc.IS-class.html#sum petsc4py.PETSc.IS.Type petsc4py.PETSc.IS.Type-class.html petsc4py.PETSc.IS.Type.GENERAL petsc4py.PETSc.IS.Type-class.html#GENERAL petsc4py.PETSc.IS.Type.__qualname__ petsc4py.PETSc.IS.Type-class.html#__qualname__ petsc4py.PETSc.IS.Type.STRIDE petsc4py.PETSc.IS.Type-class.html#STRIDE petsc4py.PETSc.IS.Type.BLOCK petsc4py.PETSc.IS.Type-class.html#BLOCK petsc4py.PETSc.InsertMode petsc4py.PETSc.InsertMode-class.html petsc4py.PETSc.InsertMode.ADD_ALL petsc4py.PETSc.InsertMode-class.html#ADD_ALL petsc4py.PETSc.InsertMode.MAX_VALUES petsc4py.PETSc.InsertMode-class.html#MAX_VALUES petsc4py.PETSc.InsertMode.INSERT petsc4py.PETSc.InsertMode-class.html#INSERT petsc4py.PETSc.InsertMode.NOT_SET_VALUES petsc4py.PETSc.InsertMode-class.html#NOT_SET_VALUES petsc4py.PETSc.InsertMode.INSERT_BC_VALUES petsc4py.PETSc.InsertMode-class.html#INSERT_BC_VALUES petsc4py.PETSc.InsertMode.INSERT_BC petsc4py.PETSc.InsertMode-class.html#INSERT_BC petsc4py.PETSc.InsertMode.ADD petsc4py.PETSc.InsertMode-class.html#ADD petsc4py.PETSc.InsertMode.INSERT_ALL_VALUES petsc4py.PETSc.InsertMode-class.html#INSERT_ALL_VALUES petsc4py.PETSc.InsertMode.ADD_BC petsc4py.PETSc.InsertMode-class.html#ADD_BC petsc4py.PETSc.InsertMode.MAX petsc4py.PETSc.InsertMode-class.html#MAX petsc4py.PETSc.InsertMode.ADD_ALL_VALUES petsc4py.PETSc.InsertMode-class.html#ADD_ALL_VALUES petsc4py.PETSc.InsertMode.__qualname__ petsc4py.PETSc.InsertMode-class.html#__qualname__ petsc4py.PETSc.InsertMode.INSERT_VALUES petsc4py.PETSc.InsertMode-class.html#INSERT_VALUES petsc4py.PETSc.InsertMode.ADD_BC_VALUES petsc4py.PETSc.InsertMode-class.html#ADD_BC_VALUES petsc4py.PETSc.InsertMode.ADD_VALUES petsc4py.PETSc.InsertMode-class.html#ADD_VALUES petsc4py.PETSc.InsertMode.INSERT_ALL petsc4py.PETSc.InsertMode-class.html#INSERT_ALL petsc4py.PETSc.KSP petsc4py.PETSc.KSP-class.html petsc4py.PETSc.KSP.getPCSide petsc4py.PETSc.KSP-class.html#getPCSide petsc4py.PETSc.KSP.setDM petsc4py.PETSc.KSP-class.html#setDM petsc4py.PETSc.KSP.setComputeSingularValues petsc4py.PETSc.KSP-class.html#setComputeSingularValues petsc4py.PETSc.KSP.setTolerances petsc4py.PETSc.KSP-class.html#setTolerances petsc4py.PETSc.KSP.setMonitor petsc4py.PETSc.KSP-class.html#setMonitor petsc4py.PETSc.KSP.cancelMonitor petsc4py.PETSc.KSP-class.html#cancelMonitor petsc4py.PETSc.KSP.max_it petsc4py.PETSc.KSP-class.html#max_it petsc4py.PETSc.KSP.setInitialGuessNonzero petsc4py.PETSc.KSP-class.html#setInitialGuessNonzero petsc4py.PETSc.KSP.setNormType petsc4py.PETSc.KSP-class.html#setNormType petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.KSP.its petsc4py.PETSc.KSP-class.html#its petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.KSP.monitor petsc4py.PETSc.KSP-class.html#monitor petsc4py.PETSc.KSP.setGMRESRestart petsc4py.PETSc.KSP-class.html#setGMRESRestart petsc4py.PETSc.KSP.setOperators petsc4py.PETSc.KSP-class.html#setOperators petsc4py.PETSc.KSP.getConvergenceHistory petsc4py.PETSc.KSP-class.html#getConvergenceHistory petsc4py.PETSc.KSP.rtol petsc4py.PETSc.KSP-class.html#rtol petsc4py.PETSc.KSP.setDMActive petsc4py.PETSc.KSP-class.html#setDMActive petsc4py.PETSc.KSP.getWorkVecs petsc4py.PETSc.KSP-class.html#getWorkVecs petsc4py.PETSc.KSP.__call__ petsc4py.PETSc.KSP-class.html#__call__ petsc4py.PETSc.KSP.getConvergedReason petsc4py.PETSc.KSP-class.html#getConvergedReason petsc4py.PETSc.KSP.norm petsc4py.PETSc.KSP-class.html#norm petsc4py.PETSc.KSP.guess_nonzero petsc4py.PETSc.KSP-class.html#guess_nonzero petsc4py.PETSc.KSP.vec_sol petsc4py.PETSc.KSP-class.html#vec_sol petsc4py.PETSc.KSP.dm petsc4py.PETSc.KSP-class.html#dm petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.KSP.setOptionsPrefix petsc4py.PETSc.KSP-class.html#setOptionsPrefix petsc4py.PETSc.KSP.callConvergenceTest petsc4py.PETSc.KSP-class.html#callConvergenceTest petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.KSP.setFromOptions petsc4py.PETSc.KSP-class.html#setFromOptions petsc4py.PETSc.KSP.NormType petsc4py.PETSc.KSP.NormType-class.html petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.KSP.setAppCtx petsc4py.PETSc.KSP-class.html#setAppCtx petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.KSP.setConvergenceHistory petsc4py.PETSc.KSP-class.html#setConvergenceHistory petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.KSP.setUpOnBlocks petsc4py.PETSc.KSP-class.html#setUpOnBlocks petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.KSP.divtol petsc4py.PETSc.KSP-class.html#divtol petsc4py.PETSc.KSP.view petsc4py.PETSc.KSP-class.html#view petsc4py.PETSc.KSP.computeEigenvalues petsc4py.PETSc.KSP-class.html#computeEigenvalues petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.KSP.pc_side petsc4py.PETSc.KSP-class.html#pc_side petsc4py.PETSc.KSP.getNormType petsc4py.PETSc.KSP-class.html#getNormType petsc4py.PETSc.KSP.guess_knoll petsc4py.PETSc.KSP-class.html#guess_knoll petsc4py.PETSc.KSP.norm_type petsc4py.PETSc.KSP-class.html#norm_type petsc4py.PETSc.KSP.ConvergedReason petsc4py.PETSc.KSP.ConvergedReason-class.html petsc4py.PETSc.KSP.setInitialGuessKnoll petsc4py.PETSc.KSP-class.html#setInitialGuessKnoll petsc4py.PETSc.KSP.Type petsc4py.PETSc.KSP.Type-class.html petsc4py.PETSc.KSP.setComputeEigenvalues petsc4py.PETSc.KSP-class.html#setComputeEigenvalues petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.KSP.setComputeOperators petsc4py.PETSc.KSP-class.html#setComputeOperators petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.KSP.setUp petsc4py.PETSc.KSP-class.html#setUp petsc4py.PETSc.KSP.createPython petsc4py.PETSc.KSP-class.html#createPython petsc4py.PETSc.KSP.getDM petsc4py.PETSc.KSP-class.html#getDM petsc4py.PETSc.KSP.getOptionsPrefix petsc4py.PETSc.KSP-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.KSP.setComputeRHS petsc4py.PETSc.KSP-class.html#setComputeRHS petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.KSP.buildSolution petsc4py.PETSc.KSP-class.html#buildSolution petsc4py.PETSc.KSP.setResidualNorm petsc4py.PETSc.KSP-class.html#setResidualNorm petsc4py.PETSc.KSP.computeExtremeSingularValues petsc4py.PETSc.KSP-class.html#computeExtremeSingularValues petsc4py.PETSc.KSP.solveTranspose petsc4py.PETSc.KSP-class.html#solveTranspose petsc4py.PETSc.KSP.getComputeEigenvalues petsc4py.PETSc.KSP-class.html#getComputeEigenvalues petsc4py.PETSc.KSP.reason petsc4py.PETSc.KSP-class.html#reason petsc4py.PETSc.KSP.setPCSide petsc4py.PETSc.KSP-class.html#setPCSide petsc4py.PETSc.KSP.buildResidual petsc4py.PETSc.KSP-class.html#buildResidual petsc4py.PETSc.KSP.vec_rhs petsc4py.PETSc.KSP-class.html#vec_rhs petsc4py.PETSc.KSP.getPythonContext petsc4py.PETSc.KSP-class.html#getPythonContext petsc4py.PETSc.KSP.setType petsc4py.PETSc.KSP-class.html#setType petsc4py.PETSc.KSP.getOperators petsc4py.PETSc.KSP-class.html#getOperators petsc4py.PETSc.KSP.getResidualNorm petsc4py.PETSc.KSP-class.html#getResidualNorm petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.KSP.create petsc4py.PETSc.KSP-class.html#create petsc4py.PETSc.KSP.pc petsc4py.PETSc.KSP-class.html#pc petsc4py.PETSc.KSP.setPC petsc4py.PETSc.KSP-class.html#setPC petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.KSP.getComputeSingularValues petsc4py.PETSc.KSP-class.html#getComputeSingularValues petsc4py.PETSc.KSP.getType petsc4py.PETSc.KSP-class.html#getType petsc4py.PETSc.KSP.getMonitor petsc4py.PETSc.KSP-class.html#getMonitor petsc4py.PETSc.KSP.getAppCtx petsc4py.PETSc.KSP-class.html#getAppCtx petsc4py.PETSc.KSP.atol petsc4py.PETSc.KSP-class.html#atol petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.KSP.reset petsc4py.PETSc.KSP-class.html#reset petsc4py.PETSc.KSP.getRhs petsc4py.PETSc.KSP-class.html#getRhs petsc4py.PETSc.KSP.getPC petsc4py.PETSc.KSP-class.html#getPC petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.KSP.setConvergenceTest petsc4py.PETSc.KSP-class.html#setConvergenceTest petsc4py.PETSc.KSP.getIterationNumber petsc4py.PETSc.KSP-class.html#getIterationNumber petsc4py.PETSc.KSP.appctx petsc4py.PETSc.KSP-class.html#appctx petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.KSP.history petsc4py.PETSc.KSP-class.html#history petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.KSP.getConvergenceTest petsc4py.PETSc.KSP-class.html#getConvergenceTest petsc4py.PETSc.KSP.setConvergedReason petsc4py.PETSc.KSP-class.html#setConvergedReason petsc4py.PETSc.KSP.getSolution petsc4py.PETSc.KSP-class.html#getSolution petsc4py.PETSc.KSP.diverged petsc4py.PETSc.KSP-class.html#diverged petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.KSP.setUseFischerGuess petsc4py.PETSc.KSP-class.html#setUseFischerGuess petsc4py.PETSc.KSP.__new__ petsc4py.PETSc.KSP-class.html#__new__ petsc4py.PETSc.KSP.logConvergenceHistory petsc4py.PETSc.KSP-class.html#logConvergenceHistory petsc4py.PETSc.KSP.getInitialGuessKnoll petsc4py.PETSc.KSP-class.html#getInitialGuessKnoll petsc4py.PETSc.KSP.converged petsc4py.PETSc.KSP-class.html#converged petsc4py.PETSc.KSP.destroy petsc4py.PETSc.KSP-class.html#destroy petsc4py.PETSc.KSP.getInitialGuessNonzero petsc4py.PETSc.KSP-class.html#getInitialGuessNonzero petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.KSP.getTolerances petsc4py.PETSc.KSP-class.html#getTolerances petsc4py.PETSc.KSP.setIterationNumber petsc4py.PETSc.KSP-class.html#setIterationNumber petsc4py.PETSc.KSP.mat_pc petsc4py.PETSc.KSP-class.html#mat_pc petsc4py.PETSc.KSP.setPythonType petsc4py.PETSc.KSP-class.html#setPythonType petsc4py.PETSc.KSP.iterating petsc4py.PETSc.KSP-class.html#iterating petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.KSP.mat_op petsc4py.PETSc.KSP-class.html#mat_op petsc4py.PETSc.KSP.solve petsc4py.PETSc.KSP-class.html#solve petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.KSP.setPythonContext petsc4py.PETSc.KSP-class.html#setPythonContext petsc4py.PETSc.KSP.ConvergedReason petsc4py.PETSc.KSP.ConvergedReason-class.html petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_MAX_IT petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_MAX_IT petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_INDEFINITE_PC petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_INDEFINITE_PC petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_ATOL petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_ATOL petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_BREAKDOWN petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_BREAKDOWN petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_NONSYMMETRIC petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_NONSYMMETRIC petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_INDEFINITE_MAT petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_INDEFINITE_MAT petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_CG_CONSTRAINED petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_CG_CONSTRAINED petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_DTOL petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_DTOL petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_BREAKDOWN_BICG petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_BREAKDOWN_BICG petsc4py.PETSc.KSP.ConvergedReason.ITERATING petsc4py.PETSc.KSP.ConvergedReason-class.html#ITERATING petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_ITS petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_ITS petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_NULL petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_NULL petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_ATOL_NORMAL petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_ATOL_NORMAL petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_RTOL_NORMAL petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_RTOL_NORMAL petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_STEP_LENGTH petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_STEP_LENGTH petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_RTOL petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_RTOL petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_HAPPY_BREAKDOWN petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_HAPPY_BREAKDOWN petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_PCSETUP_FAILED petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_PCSETUP_FAILED petsc4py.PETSc.KSP.ConvergedReason.DIVERGED_NANORINF petsc4py.PETSc.KSP.ConvergedReason-class.html#DIVERGED_NANORINF petsc4py.PETSc.KSP.ConvergedReason.__qualname__ petsc4py.PETSc.KSP.ConvergedReason-class.html#__qualname__ petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_ITERATING petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_ITERATING petsc4py.PETSc.KSP.ConvergedReason.CONVERGED_CG_NEG_CURVE petsc4py.PETSc.KSP.ConvergedReason-class.html#CONVERGED_CG_NEG_CURVE petsc4py.PETSc.KSP.NormType petsc4py.PETSc.KSP.NormType-class.html petsc4py.PETSc.KSP.NormType.PRECONDITIONED petsc4py.PETSc.KSP.NormType-class.html#PRECONDITIONED petsc4py.PETSc.KSP.NormType.DEFAULT petsc4py.PETSc.KSP.NormType-class.html#DEFAULT petsc4py.PETSc.KSP.NormType.NORM_NONE petsc4py.PETSc.KSP.NormType-class.html#NORM_NONE petsc4py.PETSc.KSP.NormType.UNPRECONDITIONED petsc4py.PETSc.KSP.NormType-class.html#UNPRECONDITIONED petsc4py.PETSc.KSP.NormType.NONE petsc4py.PETSc.KSP.NormType-class.html#NONE petsc4py.PETSc.KSP.NormType.NO petsc4py.PETSc.KSP.NormType-class.html#NO petsc4py.PETSc.KSP.NormType.NORM_DEFAULT petsc4py.PETSc.KSP.NormType-class.html#NORM_DEFAULT petsc4py.PETSc.KSP.NormType.NATURAL petsc4py.PETSc.KSP.NormType-class.html#NATURAL petsc4py.PETSc.KSP.NormType.NORM_NATURAL petsc4py.PETSc.KSP.NormType-class.html#NORM_NATURAL petsc4py.PETSc.KSP.NormType.NORM_UNPRECONDITIONED petsc4py.PETSc.KSP.NormType-class.html#NORM_UNPRECONDITIONED petsc4py.PETSc.KSP.NormType.NORM_PRECONDITIONED petsc4py.PETSc.KSP.NormType-class.html#NORM_PRECONDITIONED petsc4py.PETSc.KSP.NormType.__qualname__ petsc4py.PETSc.KSP.NormType-class.html#__qualname__ petsc4py.PETSc.KSP.Type petsc4py.PETSc.KSP.Type-class.html petsc4py.PETSc.KSP.Type.PIPEFGMRES petsc4py.PETSc.KSP.Type-class.html#PIPEFGMRES petsc4py.PETSc.KSP.Type.TFQMR petsc4py.PETSc.KSP.Type-class.html#TFQMR petsc4py.PETSc.KSP.Type.PYTHON petsc4py.PETSc.KSP.Type-class.html#PYTHON petsc4py.PETSc.KSP.Type.PIPECR petsc4py.PETSc.KSP.Type-class.html#PIPECR petsc4py.PETSc.KSP.Type.IBCGS petsc4py.PETSc.KSP.Type-class.html#IBCGS petsc4py.PETSc.KSP.Type.PIPECGRR petsc4py.PETSc.KSP.Type-class.html#PIPECGRR petsc4py.PETSc.KSP.Type.STCG petsc4py.PETSc.KSP.Type-class.html#STCG petsc4py.PETSc.KSP.Type.QCG petsc4py.PETSc.KSP.Type-class.html#QCG petsc4py.PETSc.KSP.Type.PIPELCG petsc4py.PETSc.KSP.Type-class.html#PIPELCG petsc4py.PETSc.KSP.Type.PIPECG petsc4py.PETSc.KSP.Type-class.html#PIPECG petsc4py.PETSc.KSP.Type.PGMRES petsc4py.PETSc.KSP.Type-class.html#PGMRES petsc4py.PETSc.KSP.Type.CGLS petsc4py.PETSc.KSP.Type-class.html#CGLS petsc4py.PETSc.KSP.Type.LGMRES petsc4py.PETSc.KSP.Type-class.html#LGMRES petsc4py.PETSc.KSP.Type.PIPEPRCG petsc4py.PETSc.KSP.Type-class.html#PIPEPRCG petsc4py.PETSc.KSP.Type.CGNE petsc4py.PETSc.KSP.Type-class.html#CGNE petsc4py.PETSc.KSP.Type.MINRES petsc4py.PETSc.KSP.Type-class.html#MINRES petsc4py.PETSc.KSP.Type.FCG petsc4py.PETSc.KSP.Type-class.html#FCG petsc4py.PETSc.KSP.Type.HPDDM petsc4py.PETSc.KSP.Type-class.html#HPDDM petsc4py.PETSc.KSP.Type.CGS petsc4py.PETSc.KSP.Type-class.html#CGS petsc4py.PETSc.KSP.Type.FBCGS petsc4py.PETSc.KSP.Type-class.html#FBCGS petsc4py.PETSc.KSP.Type.DGMRES petsc4py.PETSc.KSP.Type-class.html#DGMRES petsc4py.PETSc.KSP.Type.TCQMR petsc4py.PETSc.KSP.Type-class.html#TCQMR petsc4py.PETSc.KSP.Type.LSQR petsc4py.PETSc.KSP.Type-class.html#LSQR petsc4py.PETSc.KSP.Type.GLTR petsc4py.PETSc.KSP.Type-class.html#GLTR petsc4py.PETSc.KSP.Type.CG petsc4py.PETSc.KSP.Type-class.html#CG petsc4py.PETSc.KSP.Type.BCGS petsc4py.PETSc.KSP.Type-class.html#BCGS petsc4py.PETSc.KSP.Type.TSIRM petsc4py.PETSc.KSP.Type-class.html#TSIRM petsc4py.PETSc.KSP.Type.GCR petsc4py.PETSc.KSP.Type-class.html#GCR petsc4py.PETSc.KSP.Type.FGMRES petsc4py.PETSc.KSP.Type-class.html#FGMRES petsc4py.PETSc.KSP.Type.GROPPCG petsc4py.PETSc.KSP.Type-class.html#GROPPCG petsc4py.PETSc.KSP.Type.CR petsc4py.PETSc.KSP.Type-class.html#CR petsc4py.PETSc.KSP.Type.FBCGSR petsc4py.PETSc.KSP.Type-class.html#FBCGSR petsc4py.PETSc.KSP.Type.CHEBYSHEV petsc4py.PETSc.KSP.Type-class.html#CHEBYSHEV petsc4py.PETSc.KSP.Type.SYMMLQ petsc4py.PETSc.KSP.Type-class.html#SYMMLQ petsc4py.PETSc.KSP.Type.PIPEGCR petsc4py.PETSc.KSP.Type-class.html#PIPEGCR petsc4py.PETSc.KSP.Type.PIPEFCG petsc4py.PETSc.KSP.Type-class.html#PIPEFCG petsc4py.PETSc.KSP.Type.BCGSL petsc4py.PETSc.KSP.Type-class.html#BCGSL petsc4py.PETSc.KSP.Type.BICG petsc4py.PETSc.KSP.Type-class.html#BICG petsc4py.PETSc.KSP.Type.__qualname__ petsc4py.PETSc.KSP.Type-class.html#__qualname__ petsc4py.PETSc.KSP.Type.FETIDP petsc4py.PETSc.KSP.Type-class.html#FETIDP petsc4py.PETSc.KSP.Type.LCD petsc4py.PETSc.KSP.Type-class.html#LCD petsc4py.PETSc.KSP.Type.PREONLY petsc4py.PETSc.KSP.Type-class.html#PREONLY petsc4py.PETSc.KSP.Type.GMRES petsc4py.PETSc.KSP.Type-class.html#GMRES petsc4py.PETSc.KSP.Type.RICHARDSON petsc4py.PETSc.KSP.Type-class.html#RICHARDSON petsc4py.PETSc.KSP.Type.NASH petsc4py.PETSc.KSP.Type-class.html#NASH petsc4py.PETSc.KSP.Type.PIPECG2 petsc4py.PETSc.KSP.Type-class.html#PIPECG2 petsc4py.PETSc.KSP.Type.PIPEBCGS petsc4py.PETSc.KSP.Type-class.html#PIPEBCGS petsc4py.PETSc.LGMap petsc4py.PETSc.LGMap-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.LGMap.createSF petsc4py.PETSc.LGMap-class.html#createSF petsc4py.PETSc.LGMap.getSize petsc4py.PETSc.LGMap-class.html#getSize petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.LGMap.getBlockSize petsc4py.PETSc.LGMap-class.html#getBlockSize petsc4py.PETSc.LGMap.apply petsc4py.PETSc.LGMap-class.html#apply petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.LGMap.block_size petsc4py.PETSc.LGMap-class.html#block_size petsc4py.PETSc.LGMap.Type petsc4py.PETSc.LGMap.Type-class.html petsc4py.PETSc.LGMap.setType petsc4py.PETSc.LGMap-class.html#setType petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.LGMap.__new__ petsc4py.PETSc.LGMap-class.html#__new__ petsc4py.PETSc.LGMap.applyBlockInverse petsc4py.PETSc.LGMap-class.html#applyBlockInverse petsc4py.PETSc.LGMap.getBlockIndices petsc4py.PETSc.LGMap-class.html#getBlockIndices petsc4py.PETSc.LGMap.create petsc4py.PETSc.LGMap-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.LGMap.applyInverse petsc4py.PETSc.LGMap-class.html#applyInverse petsc4py.PETSc.LGMap.__call__ petsc4py.PETSc.LGMap-class.html#__call__ petsc4py.PETSc.LGMap.destroy petsc4py.PETSc.LGMap-class.html#destroy petsc4py.PETSc.Object.getType petsc4py.PETSc.Object-class.html#getType petsc4py.PETSc.LGMap.size petsc4py.PETSc.LGMap-class.html#size petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.LGMap.applyIS petsc4py.PETSc.LGMap-class.html#applyIS petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.LGMap.applyBlock petsc4py.PETSc.LGMap-class.html#applyBlock petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.LGMap.getBlockInfo petsc4py.PETSc.LGMap-class.html#getBlockInfo petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.LGMap.indices petsc4py.PETSc.LGMap-class.html#indices petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.LGMap.setFromOptions petsc4py.PETSc.LGMap-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.LGMap.getIndices petsc4py.PETSc.LGMap-class.html#getIndices petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.LGMap.info petsc4py.PETSc.LGMap-class.html#info petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.LGMap.getInfo petsc4py.PETSc.LGMap-class.html#getInfo petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.LGMap.createIS petsc4py.PETSc.LGMap-class.html#createIS petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.LGMap.MapMode petsc4py.PETSc.LGMap.MapMode-class.html petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.LGMap.block_indices petsc4py.PETSc.LGMap-class.html#block_indices petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.LGMap.block_info petsc4py.PETSc.LGMap-class.html#block_info petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.LGMap.view petsc4py.PETSc.LGMap-class.html#view petsc4py.PETSc.LGMap.MapMode petsc4py.PETSc.LGMap.MapMode-class.html petsc4py.PETSc.LGMap.MapMode.DROP petsc4py.PETSc.LGMap.MapMode-class.html#DROP petsc4py.PETSc.LGMap.MapMode.MASK petsc4py.PETSc.LGMap.MapMode-class.html#MASK petsc4py.PETSc.LGMap.MapMode.__qualname__ petsc4py.PETSc.LGMap.MapMode-class.html#__qualname__ petsc4py.PETSc.LGMap.Type petsc4py.PETSc.LGMap.Type-class.html petsc4py.PETSc.LGMap.Type.HASH petsc4py.PETSc.LGMap.Type-class.html#HASH petsc4py.PETSc.LGMap.Type.__qualname__ petsc4py.PETSc.LGMap.Type-class.html#__qualname__ petsc4py.PETSc.LGMap.Type.BASIC petsc4py.PETSc.LGMap.Type-class.html#BASIC petsc4py.PETSc.Log petsc4py.PETSc.Log-class.html petsc4py.PETSc.Log.getTime petsc4py.PETSc.Log-class.html#getTime petsc4py.PETSc.Log.logFlops petsc4py.PETSc.Log-class.html#logFlops petsc4py.PETSc.Log.getCPUTime petsc4py.PETSc.Log-class.html#getCPUTime petsc4py.PETSc.Log.__new__ petsc4py.PETSc.Log-class.html#__new__ petsc4py.PETSc.Log.Class petsc4py.PETSc.Log-class.html#Class petsc4py.PETSc.Log.Stage petsc4py.PETSc.Log-class.html#Stage petsc4py.PETSc.Log.begin petsc4py.PETSc.Log-class.html#begin petsc4py.PETSc.Log.EventDecorator petsc4py.PETSc.Log-class.html#EventDecorator petsc4py.PETSc.Log.getFlops petsc4py.PETSc.Log-class.html#getFlops petsc4py.PETSc.Log.addFlops petsc4py.PETSc.Log-class.html#addFlops petsc4py.PETSc.Log.Event petsc4py.PETSc.Log-class.html#Event petsc4py.PETSc.Log.view petsc4py.PETSc.Log-class.html#view petsc4py.PETSc.LogClass petsc4py.PETSc.LogClass-class.html petsc4py.PETSc.LogClass.__int__ petsc4py.PETSc.LogClass-class.html#__int__ petsc4py.PETSc.LogClass.activate petsc4py.PETSc.LogClass-class.html#activate petsc4py.PETSc.LogClass.id petsc4py.PETSc.LogClass-class.html#id petsc4py.PETSc.LogClass.__new__ petsc4py.PETSc.LogClass-class.html#__new__ petsc4py.PETSc.LogClass.deactivate petsc4py.PETSc.LogClass-class.html#deactivate petsc4py.PETSc.LogClass.getName petsc4py.PETSc.LogClass-class.html#getName petsc4py.PETSc.LogClass.getActive petsc4py.PETSc.LogClass-class.html#getActive petsc4py.PETSc.LogClass.setActive petsc4py.PETSc.LogClass-class.html#setActive petsc4py.PETSc.LogClass.active petsc4py.PETSc.LogClass-class.html#active petsc4py.PETSc.LogClass.name petsc4py.PETSc.LogClass-class.html#name petsc4py.PETSc.LogClass.__long__ petsc4py.PETSc.LogClass-class.html#__long__ petsc4py.PETSc.LogEvent petsc4py.PETSc.LogEvent-class.html petsc4py.PETSc.LogEvent.__int__ petsc4py.PETSc.LogEvent-class.html#__int__ petsc4py.PETSc.LogEvent.activate petsc4py.PETSc.LogEvent-class.html#activate petsc4py.PETSc.LogEvent.getPerfInfo petsc4py.PETSc.LogEvent-class.html#getPerfInfo petsc4py.PETSc.LogEvent.getActiveAll petsc4py.PETSc.LogEvent-class.html#getActiveAll petsc4py.PETSc.LogEvent.active_all petsc4py.PETSc.LogEvent-class.html#active_all petsc4py.PETSc.LogEvent.id petsc4py.PETSc.LogEvent-class.html#id petsc4py.PETSc.LogEvent.end petsc4py.PETSc.LogEvent-class.html#end petsc4py.PETSc.LogEvent.__new__ petsc4py.PETSc.LogEvent-class.html#__new__ petsc4py.PETSc.LogEvent.deactivate petsc4py.PETSc.LogEvent-class.html#deactivate petsc4py.PETSc.LogEvent.getName petsc4py.PETSc.LogEvent-class.html#getName petsc4py.PETSc.LogEvent.__enter__ petsc4py.PETSc.LogEvent-class.html#__enter__ petsc4py.PETSc.LogEvent.getActive petsc4py.PETSc.LogEvent-class.html#getActive petsc4py.PETSc.LogEvent.setActive petsc4py.PETSc.LogEvent-class.html#setActive petsc4py.PETSc.LogEvent.begin petsc4py.PETSc.LogEvent-class.html#begin petsc4py.PETSc.LogEvent.__exit__ petsc4py.PETSc.LogEvent-class.html#__exit__ petsc4py.PETSc.LogEvent.setActiveAll petsc4py.PETSc.LogEvent-class.html#setActiveAll petsc4py.PETSc.LogEvent.active petsc4py.PETSc.LogEvent-class.html#active petsc4py.PETSc.LogEvent.name petsc4py.PETSc.LogEvent-class.html#name petsc4py.PETSc.LogEvent.__long__ petsc4py.PETSc.LogEvent-class.html#__long__ petsc4py.PETSc.LogStage petsc4py.PETSc.LogStage-class.html petsc4py.PETSc.LogStage.__int__ petsc4py.PETSc.LogStage-class.html#__int__ petsc4py.PETSc.LogStage.activate petsc4py.PETSc.LogStage-class.html#activate petsc4py.PETSc.LogStage.pop petsc4py.PETSc.LogStage-class.html#pop petsc4py.PETSc.LogStage.getVisible petsc4py.PETSc.LogStage-class.html#getVisible petsc4py.PETSc.LogStage.visible petsc4py.PETSc.LogStage-class.html#visible petsc4py.PETSc.LogStage.id petsc4py.PETSc.LogStage-class.html#id petsc4py.PETSc.LogStage.__new__ petsc4py.PETSc.LogStage-class.html#__new__ petsc4py.PETSc.LogStage.deactivate petsc4py.PETSc.LogStage-class.html#deactivate petsc4py.PETSc.LogStage.getName petsc4py.PETSc.LogStage-class.html#getName petsc4py.PETSc.LogStage.__enter__ petsc4py.PETSc.LogStage-class.html#__enter__ petsc4py.PETSc.LogStage.getActive petsc4py.PETSc.LogStage-class.html#getActive petsc4py.PETSc.LogStage.setActive petsc4py.PETSc.LogStage-class.html#setActive petsc4py.PETSc.LogStage.__exit__ petsc4py.PETSc.LogStage-class.html#__exit__ petsc4py.PETSc.LogStage.active petsc4py.PETSc.LogStage-class.html#active petsc4py.PETSc.LogStage.name petsc4py.PETSc.LogStage-class.html#name petsc4py.PETSc.LogStage.push petsc4py.PETSc.LogStage-class.html#push petsc4py.PETSc.LogStage.__long__ petsc4py.PETSc.LogStage-class.html#__long__ petsc4py.PETSc.LogStage.setVisible petsc4py.PETSc.LogStage-class.html#setVisible petsc4py.PETSc.Mat petsc4py.PETSc.Mat-class.html petsc4py.PETSc.Mat.setPreallocationCSR petsc4py.PETSc.Mat-class.html#setPreallocationCSR petsc4py.PETSc.Mat.load petsc4py.PETSc.Mat-class.html#load petsc4py.PETSc.Mat.getLGMap petsc4py.PETSc.Mat-class.html#getLGMap petsc4py.PETSc.Mat.setDM petsc4py.PETSc.Mat-class.html#setDM petsc4py.PETSc.Mat.getOwnershipIS petsc4py.PETSc.Mat-class.html#getOwnershipIS petsc4py.PETSc.Mat.copy petsc4py.PETSc.Mat-class.html#copy petsc4py.PETSc.Mat.getNestISs petsc4py.PETSc.Mat-class.html#getNestISs petsc4py.PETSc.Mat.getOwnershipRangesColumn petsc4py.PETSc.Mat-class.html#getOwnershipRangesColumn petsc4py.PETSc.Mat.getSize petsc4py.PETSc.Mat-class.html#getSize petsc4py.PETSc.Mat.getRowIJ petsc4py.PETSc.Mat-class.html#getRowIJ petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Mat.Stencil petsc4py.PETSc._Mat_Stencil-class.html petsc4py.PETSc.Mat.setValuesBlockedIJV petsc4py.PETSc.Mat-class.html#setValuesBlockedIJV petsc4py.PETSc.Mat.setDiagonal petsc4py.PETSc.Mat-class.html#setDiagonal petsc4py.PETSc.Mat.__rdiv__ petsc4py.PETSc.Mat-class.html#__rdiv__ petsc4py.PETSc.Mat.__rmul__ petsc4py.PETSc.Mat-class.html#__rmul__ petsc4py.PETSc.Mat.createAIJCRL petsc4py.PETSc.Mat-class.html#createAIJCRL petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Mat.permute petsc4py.PETSc.Mat-class.html#permute petsc4py.PETSc.Mat.imagPart petsc4py.PETSc.Mat-class.html#imagPart petsc4py.PETSc.Mat.multHermitianAdd petsc4py.PETSc.Mat-class.html#multHermitianAdd petsc4py.PETSc.Mat.setPreallocationDense petsc4py.PETSc.Mat-class.html#setPreallocationDense petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Mat.setNearNullSpace petsc4py.PETSc.Mat-class.html#setNearNullSpace petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Mat.OrderingType petsc4py.PETSc.Mat.OrderingType-class.html petsc4py.PETSc.Mat.isHermitianKnown petsc4py.PETSc.Mat-class.html#isHermitianKnown petsc4py.PETSc.Mat.setPythonContext petsc4py.PETSc.Mat-class.html#setPythonContext petsc4py.PETSc.Mat.createSBAIJ petsc4py.PETSc.Mat-class.html#createSBAIJ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Mat.__call__ petsc4py.PETSc.Mat-class.html#__call__ petsc4py.PETSc.Mat.getMumpsRinfog petsc4py.PETSc.Mat-class.html#getMumpsRinfog petsc4py.PETSc.Mat.norm petsc4py.PETSc.Mat-class.html#norm petsc4py.PETSc.Mat.setValuesIJV petsc4py.PETSc.Mat-class.html#setValuesIJV petsc4py.PETSc.Mat.createSubMatrices petsc4py.PETSc.Mat-class.html#createSubMatrices petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Mat.isStructurallySymmetric petsc4py.PETSc.Mat-class.html#isStructurallySymmetric petsc4py.PETSc.Mat.setOptionsPrefix petsc4py.PETSc.Mat-class.html#setOptionsPrefix petsc4py.PETSc.Mat.setValuesLocal petsc4py.PETSc.Mat-class.html#setValuesLocal petsc4py.PETSc.Mat.reorderForNonzeroDiagonal petsc4py.PETSc.Mat-class.html#reorderForNonzeroDiagonal petsc4py.PETSc.Mat.setSizes petsc4py.PETSc.Mat-class.html#setSizes petsc4py.PETSc.Mat.factorNumericCholesky petsc4py.PETSc.Mat-class.html#factorNumericCholesky petsc4py.PETSc.Mat.setBlockSize petsc4py.PETSc.Mat-class.html#setBlockSize petsc4py.PETSc.Mat.owner_ranges petsc4py.PETSc.Mat-class.html#owner_ranges petsc4py.PETSc.Mat.getNestSize petsc4py.PETSc.Mat-class.html#getNestSize petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Mat.Option petsc4py.PETSc.Mat.Option-class.html petsc4py.PETSc.Mat.setFromOptions petsc4py.PETSc.Mat-class.html#setFromOptions petsc4py.PETSc.Mat.destroy petsc4py.PETSc.Mat-class.html#destroy petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Mat.getVecLeft petsc4py.PETSc.Mat-class.html#getVecLeft petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Mat.__delitem__ petsc4py.PETSc.Mat-class.html#__delitem__ petsc4py.PETSc.Mat.setValueBlockedStagStencil petsc4py.PETSc.Mat-class.html#setValueBlockedStagStencil petsc4py.PETSc.Mat.realPart petsc4py.PETSc.Mat-class.html#realPart petsc4py.PETSc.Mat.factorSymbolicLU petsc4py.PETSc.Mat-class.html#factorSymbolicLU petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Mat.isAssembled petsc4py.PETSc.Mat-class.html#isAssembled petsc4py.PETSc.Mat.isHermitian petsc4py.PETSc.Mat-class.html#isHermitian petsc4py.PETSc.Mat.factorSymbolicICC petsc4py.PETSc.Mat-class.html#factorSymbolicICC petsc4py.PETSc.Mat.getInfo petsc4py.PETSc.Mat-class.html#getInfo petsc4py.PETSc.Mat.assembled petsc4py.PETSc.Mat-class.html#assembled petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Mat.getOwnershipRanges petsc4py.PETSc.Mat-class.html#getOwnershipRanges petsc4py.PETSc.Mat.retrieveValues petsc4py.PETSc.Mat-class.html#retrieveValues petsc4py.PETSc.Mat.setUnfactored petsc4py.PETSc.Mat-class.html#setUnfactored petsc4py.PETSc.Mat.createDense petsc4py.PETSc.Mat-class.html#createDense petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Mat.createNest petsc4py.PETSc.Mat-class.html#createNest petsc4py.PETSc.Mat.createVecLeft petsc4py.PETSc.Mat-class.html#createVecLeft petsc4py.PETSc.Mat.isSymmetric petsc4py.PETSc.Mat-class.html#isSymmetric petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Mat.getValuesCSR petsc4py.PETSc.Mat-class.html#getValuesCSR petsc4py.PETSc.Mat.view petsc4py.PETSc.Mat-class.html#view petsc4py.PETSc.Mat.setISPreallocation petsc4py.PETSc.Mat-class.html#setISPreallocation petsc4py.PETSc.Mat.getOrdering petsc4py.PETSc.Mat-class.html#getOrdering petsc4py.PETSc.Mat.setValuesBlockedLocalRCV petsc4py.PETSc.Mat-class.html#setValuesBlockedLocalRCV petsc4py.PETSc.Mat.solveForward petsc4py.PETSc.Mat-class.html#solveForward petsc4py.PETSc.Mat.getISLocalMat petsc4py.PETSc.Mat-class.html#getISLocalMat petsc4py.PETSc.Mat.createAIJ petsc4py.PETSc.Mat-class.html#createAIJ petsc4py.PETSc.Mat.__truediv__ petsc4py.PETSc.Mat-class.html#__truediv__ petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Mat.getBlockSize petsc4py.PETSc.Mat-class.html#getBlockSize petsc4py.PETSc.Mat.getNearNullSpace petsc4py.PETSc.Mat-class.html#getNearNullSpace petsc4py.PETSc.Mat.multHermitian petsc4py.PETSc.Mat-class.html#multHermitian petsc4py.PETSc.Mat.scale petsc4py.PETSc.Mat-class.html#scale petsc4py.PETSc.Mat.getTransposeNullSpace petsc4py.PETSc.Mat-class.html#getTransposeNullSpace petsc4py.PETSc.Mat.setPreallocationNNZ petsc4py.PETSc.Mat-class.html#setPreallocationNNZ petsc4py.PETSc.Mat.createScatter petsc4py.PETSc.Mat-class.html#createScatter petsc4py.PETSc.Mat.createVecRight petsc4py.PETSc.Mat-class.html#createVecRight petsc4py.PETSc.Mat.zeroRowsLocal petsc4py.PETSc.Mat-class.html#zeroRowsLocal petsc4py.PETSc.Mat.symmetric petsc4py.PETSc.Mat-class.html#symmetric petsc4py.PETSc.Mat.assemblyEnd petsc4py.PETSc.Mat-class.html#assemblyEnd petsc4py.PETSc.Mat.isTranspose petsc4py.PETSc.Mat-class.html#isTranspose petsc4py.PETSc.Mat.createVecs petsc4py.PETSc.Mat-class.html#createVecs petsc4py.PETSc.Mat.setType petsc4py.PETSc.Mat-class.html#setType petsc4py.PETSc.Mat.setBlockSizes petsc4py.PETSc.Mat-class.html#setBlockSizes petsc4py.PETSc.Mat.matTransposeMult petsc4py.PETSc.Mat-class.html#matTransposeMult petsc4py.PETSc.Mat.getBlockSizes petsc4py.PETSc.Mat-class.html#getBlockSizes petsc4py.PETSc.Mat.setValue petsc4py.PETSc.Mat-class.html#setValue petsc4py.PETSc.Mat.getRow petsc4py.PETSc.Mat-class.html#getRow petsc4py.PETSc.Mat.matMult petsc4py.PETSc.Mat-class.html#matMult petsc4py.PETSc.Mat.setUp petsc4py.PETSc.Mat-class.html#setUp petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Mat.transpose petsc4py.PETSc.Mat-class.html#transpose petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Mat.createPython petsc4py.PETSc.Mat-class.html#createPython petsc4py.PETSc.Mat.PtAP petsc4py.PETSc.Mat-class.html#PtAP petsc4py.PETSc.Mat.getDM petsc4py.PETSc.Mat-class.html#getDM petsc4py.PETSc.Mat.setISLocalMat petsc4py.PETSc.Mat-class.html#setISLocalMat petsc4py.PETSc.Mat.__setitem__ petsc4py.PETSc.Mat-class.html#__setitem__ petsc4py.PETSc.Mat.SolverType petsc4py.PETSc.Mat.SolverType-class.html petsc4py.PETSc.Mat.createLRC petsc4py.PETSc.Mat-class.html#createLRC petsc4py.PETSc.Mat.assemblyBegin petsc4py.PETSc.Mat-class.html#assemblyBegin petsc4py.PETSc.Mat.setValuesBlocked petsc4py.PETSc.Mat-class.html#setValuesBlocked petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Mat.assemble petsc4py.PETSc.Mat-class.html#assemble petsc4py.PETSc.Mat.factorILU petsc4py.PETSc.Mat-class.html#factorILU petsc4py.PETSc.Mat.owner_range petsc4py.PETSc.Mat-class.html#owner_range petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Mat.convert petsc4py.PETSc.Mat-class.html#convert petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Mat.createSubMatrixVirtual petsc4py.PETSc.Mat-class.html#createSubMatrixVirtual petsc4py.PETSc.Mat.__imul__ petsc4py.PETSc.Mat-class.html#__imul__ petsc4py.PETSc.Mat.getLocalSize petsc4py.PETSc.Mat-class.html#getLocalSize petsc4py.PETSc.Mat.zeroRowsColumnsLocal petsc4py.PETSc.Mat-class.html#zeroRowsColumnsLocal petsc4py.PETSc.Mat.shift petsc4py.PETSc.Mat-class.html#shift petsc4py.PETSc.Mat.getColumnVector petsc4py.PETSc.Mat-class.html#getColumnVector petsc4py.PETSc.Mat.getLocalSubMatrix petsc4py.PETSc.Mat-class.html#getLocalSubMatrix petsc4py.PETSc.Mat.local_size petsc4py.PETSc.Mat-class.html#local_size petsc4py.PETSc.Mat.getPythonContext petsc4py.PETSc.Mat-class.html#getPythonContext petsc4py.PETSc.Mat.setValueStagStencil petsc4py.PETSc.Mat-class.html#setValueStagStencil petsc4py.PETSc.Mat.chop petsc4py.PETSc.Mat-class.html#chop petsc4py.PETSc.Mat.setValueLocal petsc4py.PETSc.Mat-class.html#setValueLocal petsc4py.PETSc.Mat.setMumpsCntl petsc4py.PETSc.Mat-class.html#setMumpsCntl petsc4py.PETSc.Mat.__mul__ petsc4py.PETSc.Mat-class.html#__mul__ petsc4py.PETSc.Mat.factorCholesky petsc4py.PETSc.Mat-class.html#factorCholesky petsc4py.PETSc.Mat.getDiagonalBlock petsc4py.PETSc.Mat-class.html#getDiagonalBlock petsc4py.PETSc.Mat.solveBackward petsc4py.PETSc.Mat-class.html#solveBackward petsc4py.PETSc.Mat.getVecRight petsc4py.PETSc.Mat-class.html#getVecRight petsc4py.PETSc.Mat.setValuesBlockedLocalIJV petsc4py.PETSc.Mat-class.html#setValuesBlockedLocalIJV petsc4py.PETSc.Mat.createNormal petsc4py.PETSc.Mat-class.html#createNormal petsc4py.PETSc.Mat.setNullSpace petsc4py.PETSc.Mat-class.html#setNullSpace petsc4py.PETSc.Mat.getColumnIJ petsc4py.PETSc.Mat-class.html#getColumnIJ petsc4py.PETSc.Mat.zeroRows petsc4py.PETSc.Mat-class.html#zeroRows petsc4py.PETSc.Mat.matSolve petsc4py.PETSc.Mat-class.html#matSolve petsc4py.PETSc.Mat.diagonalScale petsc4py.PETSc.Mat-class.html#diagonalScale petsc4py.PETSc.Mat.block_sizes petsc4py.PETSc.Mat-class.html#block_sizes petsc4py.PETSc.Mat.FactorShiftType petsc4py.PETSc.Mat.FactorShiftType-class.html petsc4py.PETSc.Mat.setStencil petsc4py.PETSc.Mat-class.html#setStencil petsc4py.PETSc.Mat.hermitian petsc4py.PETSc.Mat-class.html#hermitian petsc4py.PETSc.Mat.__rsub__ petsc4py.PETSc.Mat-class.html#__rsub__ petsc4py.PETSc.Mat.setValuesRCV petsc4py.PETSc.Mat-class.html#setValuesRCV petsc4py.PETSc.Mat.block_size petsc4py.PETSc.Mat-class.html#block_size petsc4py.PETSc.Mat.getValues petsc4py.PETSc.Mat-class.html#getValues petsc4py.PETSc.Mat.isSymmetricKnown petsc4py.PETSc.Mat-class.html#isSymmetricKnown petsc4py.PETSc.Mat.size petsc4py.PETSc.Mat-class.html#size petsc4py.PETSc.Mat.invertBlockDiagonal petsc4py.PETSc.Mat-class.html#invertBlockDiagonal petsc4py.PETSc.Mat.setTransposeNullSpace petsc4py.PETSc.Mat-class.html#setTransposeNullSpace petsc4py.PETSc.Mat.AssemblyType petsc4py.PETSc.Mat.AssemblyType-class.html petsc4py.PETSc.Mat.create petsc4py.PETSc.Mat-class.html#create petsc4py.PETSc.Mat.factorICC petsc4py.PETSc.Mat-class.html#factorICC petsc4py.PETSc.Mat.SORType petsc4py.PETSc.Mat.SORType-class.html petsc4py.PETSc.Mat.duplicate petsc4py.PETSc.Mat-class.html#duplicate petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Mat.mult petsc4py.PETSc.Mat-class.html#mult petsc4py.PETSc.Mat.factorSymbolicILU petsc4py.PETSc.Mat-class.html#factorSymbolicILU petsc4py.PETSc.Mat.getMumpsCntl petsc4py.PETSc.Mat-class.html#getMumpsCntl petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Mat.__itruediv__ petsc4py.PETSc.Mat-class.html#__itruediv__ petsc4py.PETSc.Mat.__isub__ petsc4py.PETSc.Mat-class.html#__isub__ petsc4py.PETSc.Mat.multTranspose petsc4py.PETSc.Mat-class.html#multTranspose petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Mat.setLGMap petsc4py.PETSc.Mat-class.html#setLGMap petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Mat.aypx petsc4py.PETSc.Mat-class.html#aypx petsc4py.PETSc.Mat.getMumpsInfo petsc4py.PETSc.Mat-class.html#getMumpsInfo petsc4py.PETSc.Mat.getType petsc4py.PETSc.Mat-class.html#getType petsc4py.PETSc.Mat.setValuesBlockedRCV petsc4py.PETSc.Mat-class.html#setValuesBlockedRCV petsc4py.PETSc.Mat.createAIJWithArrays petsc4py.PETSc.Mat-class.html#createAIJWithArrays petsc4py.PETSc.Mat.getNullSpace petsc4py.PETSc.Mat-class.html#getNullSpace petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Mat.setValuesLocalIJV petsc4py.PETSc.Mat-class.html#setValuesLocalIJV petsc4py.PETSc.Mat.solveTranspose petsc4py.PETSc.Mat-class.html#solveTranspose petsc4py.PETSc.Mat.setValues petsc4py.PETSc.Mat-class.html#setValues petsc4py.PETSc.Mat.setValuesLocalRCV petsc4py.PETSc.Mat-class.html#setValuesLocalRCV petsc4py.PETSc.Mat.increaseOverlap petsc4py.PETSc.Mat-class.html#increaseOverlap petsc4py.PETSc.Mat.getMumpsIcntl petsc4py.PETSc.Mat-class.html#getMumpsIcntl petsc4py.PETSc.Mat.getDenseLocalMatrix petsc4py.PETSc.Mat-class.html#getDenseLocalMatrix petsc4py.PETSc.Mat.setMumpsIcntl petsc4py.PETSc.Mat-class.html#setMumpsIcntl petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Mat.getNestSubMatrix petsc4py.PETSc.Mat-class.html#getNestSubMatrix petsc4py.PETSc.Mat.getDiagonal petsc4py.PETSc.Mat-class.html#getDiagonal petsc4py.PETSc.Mat.factorSymbolicCholesky petsc4py.PETSc.Mat-class.html#factorSymbolicCholesky petsc4py.PETSc.Mat.setValueStencil petsc4py.PETSc.Mat-class.html#setValueStencil petsc4py.PETSc.Mat.__iadd__ petsc4py.PETSc.Mat-class.html#__iadd__ petsc4py.PETSc.Mat.getValue petsc4py.PETSc.Mat-class.html#getValue petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Mat.getDenseArray petsc4py.PETSc.Mat-class.html#getDenseArray petsc4py.PETSc.Mat.solveTransposeAdd petsc4py.PETSc.Mat-class.html#solveTransposeAdd petsc4py.PETSc.Mat.transposeMatMult petsc4py.PETSc.Mat-class.html#transposeMatMult petsc4py.PETSc.Mat.getRowSum petsc4py.PETSc.Mat-class.html#getRowSum petsc4py.PETSc.Mat.__sub__ petsc4py.PETSc.Mat-class.html#__sub__ petsc4py.PETSc.Mat.structsymm petsc4py.PETSc.Mat-class.html#structsymm petsc4py.PETSc.Mat.getRedundantMatrix petsc4py.PETSc.Mat-class.html#getRedundantMatrix petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Mat.__rtruediv__ petsc4py.PETSc.Mat-class.html#__rtruediv__ petsc4py.PETSc.Mat.zeroEntries petsc4py.PETSc.Mat-class.html#zeroEntries petsc4py.PETSc.Mat.equal petsc4py.PETSc.Mat-class.html#equal petsc4py.PETSc.Mat.multTransposeAdd petsc4py.PETSc.Mat-class.html#multTransposeAdd petsc4py.PETSc.Mat.conjugate petsc4py.PETSc.Mat-class.html#conjugate petsc4py.PETSc.Mat.getOptionsPrefix petsc4py.PETSc.Mat-class.html#getOptionsPrefix petsc4py.PETSc.Mat.factorNumericLU petsc4py.PETSc.Mat-class.html#factorNumericLU petsc4py.PETSc.Mat.axpy petsc4py.PETSc.Mat-class.html#axpy petsc4py.PETSc.Mat.setValuesBlockedCSR petsc4py.PETSc.Mat-class.html#setValuesBlockedCSR petsc4py.PETSc.Mat.setValuesBlockedLocal petsc4py.PETSc.Mat-class.html#setValuesBlockedLocal petsc4py.PETSc.Mat.setValuesLocalCSR petsc4py.PETSc.Mat-class.html#setValuesLocalCSR petsc4py.PETSc.Mat.Type petsc4py.PETSc.Mat.Type-class.html petsc4py.PETSc.Mat.setOption petsc4py.PETSc.Mat-class.html#setOption petsc4py.PETSc.Mat.__div__ petsc4py.PETSc.Mat-class.html#__div__ petsc4py.PETSc.Mat.fixISLocalEmpty petsc4py.PETSc.Mat-class.html#fixISLocalEmpty petsc4py.PETSc.Mat.__pos__ petsc4py.PETSc.Mat-class.html#__pos__ petsc4py.PETSc.Mat.SOR petsc4py.PETSc.Mat-class.html#SOR petsc4py.PETSc.Mat.sizes petsc4py.PETSc.Mat-class.html#sizes petsc4py.PETSc.Mat.createTranspose petsc4py.PETSc.Mat-class.html#createTranspose petsc4py.PETSc.Mat.setValueBlockedStencil petsc4py.PETSc.Mat-class.html#setValueBlockedStencil petsc4py.PETSc.Mat.getNestLocalISs petsc4py.PETSc.Mat-class.html#getNestLocalISs petsc4py.PETSc.Mat.getOwnershipRangeColumn petsc4py.PETSc.Mat-class.html#getOwnershipRangeColumn petsc4py.PETSc.Mat.setValuesBlockedLocalCSR petsc4py.PETSc.Mat-class.html#setValuesBlockedLocalCSR petsc4py.PETSc.Mat.Structure petsc4py.PETSc.Mat.Structure-class.html petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Mat.factorLU petsc4py.PETSc.Mat-class.html#factorLU petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Mat.getMumpsRinfo petsc4py.PETSc.Mat-class.html#getMumpsRinfo petsc4py.PETSc.Mat.InfoType petsc4py.PETSc.Mat.InfoType-class.html petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Mat.__idiv__ petsc4py.PETSc.Mat-class.html#__idiv__ petsc4py.PETSc.Mat.getOwnershipRange petsc4py.PETSc.Mat-class.html#getOwnershipRange petsc4py.PETSc.Mat.createBAIJ petsc4py.PETSc.Mat-class.html#createBAIJ petsc4py.PETSc.Mat.__add__ petsc4py.PETSc.Mat-class.html#__add__ petsc4py.PETSc.Mat.solveAdd petsc4py.PETSc.Mat-class.html#solveAdd petsc4py.PETSc.Mat.getSizes petsc4py.PETSc.Mat-class.html#getSizes petsc4py.PETSc.Mat.__new__ petsc4py.PETSc.Mat-class.html#__new__ petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Mat.setPythonType petsc4py.PETSc.Mat-class.html#setPythonType petsc4py.PETSc.Mat.__radd__ petsc4py.PETSc.Mat-class.html#__radd__ petsc4py.PETSc.Mat.restoreISLocalMat petsc4py.PETSc.Mat-class.html#restoreISLocalMat petsc4py.PETSc.Mat.getMumpsInfog petsc4py.PETSc.Mat-class.html#getMumpsInfog petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Mat.storeValues petsc4py.PETSc.Mat-class.html#storeValues petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Mat.createSubMatrix petsc4py.PETSc.Mat-class.html#createSubMatrix petsc4py.PETSc.Mat.__getitem__ petsc4py.PETSc.Mat-class.html#__getitem__ petsc4py.PETSc.Mat.solve petsc4py.PETSc.Mat-class.html#solve petsc4py.PETSc.Mat.__neg__ petsc4py.PETSc.Mat-class.html#__neg__ petsc4py.PETSc.Mat.getVecs petsc4py.PETSc.Mat-class.html#getVecs petsc4py.PETSc.Mat.zeroRowsColumns petsc4py.PETSc.Mat-class.html#zeroRowsColumns petsc4py.PETSc.Mat.multAdd petsc4py.PETSc.Mat-class.html#multAdd petsc4py.PETSc.Mat.getInertia petsc4py.PETSc.Mat-class.html#getInertia petsc4py.PETSc.Mat.setValuesCSR petsc4py.PETSc.Mat-class.html#setValuesCSR petsc4py.PETSc.Mat.getLRCMats petsc4py.PETSc.Mat-class.html#getLRCMats petsc4py.PETSc.Mat.restoreLocalSubMatrix petsc4py.PETSc.Mat-class.html#restoreLocalSubMatrix petsc4py.PETSc.Mat.AssemblyType petsc4py.PETSc.Mat.AssemblyType-class.html petsc4py.PETSc.Mat.AssemblyType.FINAL_ASSEMBLY petsc4py.PETSc.Mat.AssemblyType-class.html#FINAL_ASSEMBLY petsc4py.PETSc.Mat.AssemblyType.__qualname__ petsc4py.PETSc.Mat.AssemblyType-class.html#__qualname__ petsc4py.PETSc.Mat.AssemblyType.FLUSH_ASSEMBLY petsc4py.PETSc.Mat.AssemblyType-class.html#FLUSH_ASSEMBLY petsc4py.PETSc.Mat.AssemblyType.FLUSH petsc4py.PETSc.Mat.AssemblyType-class.html#FLUSH petsc4py.PETSc.Mat.AssemblyType.FINAL petsc4py.PETSc.Mat.AssemblyType-class.html#FINAL petsc4py.PETSc.Mat.FactorShiftType petsc4py.PETSc.Mat.FactorShiftType-class.html petsc4py.PETSc.Mat.FactorShiftType.NONZERO petsc4py.PETSc.Mat.FactorShiftType-class.html#NONZERO petsc4py.PETSc.Mat.FactorShiftType.POSITIVE_DEFINITE petsc4py.PETSc.Mat.FactorShiftType-class.html#POSITIVE_DEFINITE petsc4py.PETSc.Mat.FactorShiftType.NONE petsc4py.PETSc.Mat.FactorShiftType-class.html#NONE petsc4py.PETSc.Mat.FactorShiftType.__qualname__ petsc4py.PETSc.Mat.FactorShiftType-class.html#__qualname__ petsc4py.PETSc.Mat.FactorShiftType.NZ petsc4py.PETSc.Mat.FactorShiftType-class.html#NZ petsc4py.PETSc.Mat.FactorShiftType.PD petsc4py.PETSc.Mat.FactorShiftType-class.html#PD petsc4py.PETSc.Mat.FactorShiftType.INBLOCKS petsc4py.PETSc.Mat.FactorShiftType-class.html#INBLOCKS petsc4py.PETSc.Mat.InfoType petsc4py.PETSc.Mat.InfoType-class.html petsc4py.PETSc.Mat.InfoType.GLOBAL_SUM petsc4py.PETSc.Mat.InfoType-class.html#GLOBAL_SUM petsc4py.PETSc.Mat.InfoType.__qualname__ petsc4py.PETSc.Mat.InfoType-class.html#__qualname__ petsc4py.PETSc.Mat.InfoType.GLOBAL_MAX petsc4py.PETSc.Mat.InfoType-class.html#GLOBAL_MAX petsc4py.PETSc.Mat.InfoType.LOCAL petsc4py.PETSc.Mat.InfoType-class.html#LOCAL petsc4py.PETSc.Mat.Option petsc4py.PETSc.Mat.Option-class.html petsc4py.PETSc.Mat.Option.IGNORE_OFF_PROC_ENTRIES petsc4py.PETSc.Mat.Option-class.html#IGNORE_OFF_PROC_ENTRIES petsc4py.PETSc.Mat.Option.IGNORE_ZERO_ENTRIES petsc4py.PETSc.Mat.Option-class.html#IGNORE_ZERO_ENTRIES petsc4py.PETSc.Mat.Option.SYMMETRIC petsc4py.PETSc.Mat.Option-class.html#SYMMETRIC petsc4py.PETSc.Mat.Option.SUBMAT_SINGLEIS petsc4py.PETSc.Mat.Option-class.html#SUBMAT_SINGLEIS petsc4py.PETSc.Mat.Option.ROW_ORIENTED petsc4py.PETSc.Mat.Option-class.html#ROW_ORIENTED petsc4py.PETSc.Mat.Option.OPTION_MIN petsc4py.PETSc.Mat.Option-class.html#OPTION_MIN petsc4py.PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR petsc4py.PETSc.Mat.Option-class.html#NEW_NONZERO_LOCATION_ERR petsc4py.PETSc.Mat.Option.USE_HASH_TABLE petsc4py.PETSc.Mat.Option-class.html#USE_HASH_TABLE petsc4py.PETSc.Mat.Option.SPD petsc4py.PETSc.Mat.Option-class.html#SPD petsc4py.PETSc.Mat.Option.STRUCTURALLY_SYMMETRIC petsc4py.PETSc.Mat.Option-class.html#STRUCTURALLY_SYMMETRIC petsc4py.PETSc.Mat.Option.KEEP_NONZERO_PATTERN petsc4py.PETSc.Mat.Option-class.html#KEEP_NONZERO_PATTERN petsc4py.PETSc.Mat.Option.USE_INODES petsc4py.PETSc.Mat.Option-class.html#USE_INODES petsc4py.PETSc.Mat.Option.SYMMETRY_ETERNAL petsc4py.PETSc.Mat.Option-class.html#SYMMETRY_ETERNAL petsc4py.PETSc.Mat.Option.NEW_NONZERO_LOCATIONS petsc4py.PETSc.Mat.Option-class.html#NEW_NONZERO_LOCATIONS petsc4py.PETSc.Mat.Option.ERROR_LOWER_TRIANGULAR petsc4py.PETSc.Mat.Option-class.html#ERROR_LOWER_TRIANGULAR petsc4py.PETSc.Mat.Option.OPTION_MAX petsc4py.PETSc.Mat.Option-class.html#OPTION_MAX petsc4py.PETSc.Mat.Option.SUBSET_OFF_PROC_ENTRIES petsc4py.PETSc.Mat.Option-class.html#SUBSET_OFF_PROC_ENTRIES petsc4py.PETSc.Mat.Option.SORTED_FULL petsc4py.PETSc.Mat.Option-class.html#SORTED_FULL petsc4py.PETSc.Mat.Option.IGNORE_LOWER_TRIANGULAR petsc4py.PETSc.Mat.Option-class.html#IGNORE_LOWER_TRIANGULAR petsc4py.PETSc.Mat.Option.FORCE_DIAGONAL_ENTRIES petsc4py.PETSc.Mat.Option-class.html#FORCE_DIAGONAL_ENTRIES petsc4py.PETSc.Mat.Option.NO_OFF_PROC_ENTRIES petsc4py.PETSc.Mat.Option-class.html#NO_OFF_PROC_ENTRIES petsc4py.PETSc.Mat.Option.UNUSED_NONZERO_LOCATION_ERR petsc4py.PETSc.Mat.Option-class.html#UNUSED_NONZERO_LOCATION_ERR petsc4py.PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR petsc4py.PETSc.Mat.Option-class.html#NEW_NONZERO_ALLOCATION_ERR petsc4py.PETSc.Mat.Option.__qualname__ petsc4py.PETSc.Mat.Option-class.html#__qualname__ petsc4py.PETSc.Mat.Option.HERMITIAN petsc4py.PETSc.Mat.Option-class.html#HERMITIAN petsc4py.PETSc.Mat.Option.GETROW_UPPERTRIANGULAR petsc4py.PETSc.Mat.Option-class.html#GETROW_UPPERTRIANGULAR petsc4py.PETSc.Mat.Option.STRUCTURE_ONLY petsc4py.PETSc.Mat.Option-class.html#STRUCTURE_ONLY petsc4py.PETSc.Mat.Option.NO_OFF_PROC_ZERO_ROWS petsc4py.PETSc.Mat.Option-class.html#NO_OFF_PROC_ZERO_ROWS petsc4py.PETSc.Mat.OrderingType petsc4py.PETSc.Mat.OrderingType-class.html petsc4py.PETSc.Mat.OrderingType.RCM petsc4py.PETSc.Mat.OrderingType-class.html#RCM petsc4py.PETSc.Mat.OrderingType.WBM petsc4py.PETSc.Mat.OrderingType-class.html#WBM petsc4py.PETSc.Mat.OrderingType.SPECTRAL petsc4py.PETSc.Mat.OrderingType-class.html#SPECTRAL petsc4py.PETSc.Mat.OrderingType.OWD petsc4py.PETSc.Mat.OrderingType-class.html#OWD petsc4py.PETSc.Mat.OrderingType.ND petsc4py.PETSc.Mat.OrderingType-class.html#ND petsc4py.PETSc.Mat.OrderingType.AMD petsc4py.PETSc.Mat.OrderingType-class.html#AMD petsc4py.PETSc.Mat.OrderingType.QMD petsc4py.PETSc.Mat.OrderingType-class.html#QMD petsc4py.PETSc.Mat.OrderingType.ROWLENGTH petsc4py.PETSc.Mat.OrderingType-class.html#ROWLENGTH petsc4py.PETSc.Mat.OrderingType.NATURAL petsc4py.PETSc.Mat.OrderingType-class.html#NATURAL petsc4py.PETSc.Mat.OrderingType.__qualname__ petsc4py.PETSc.Mat.OrderingType-class.html#__qualname__ petsc4py.PETSc.Mat.SORType petsc4py.PETSc.Mat.SORType-class.html petsc4py.PETSc.Mat.SORType.APPLY_LOWER petsc4py.PETSc.Mat.SORType-class.html#APPLY_LOWER petsc4py.PETSc.Mat.SORType.ZERO_INITIAL_GUESS petsc4py.PETSc.Mat.SORType-class.html#ZERO_INITIAL_GUESS petsc4py.PETSc.Mat.SORType.EISENSTAT petsc4py.PETSc.Mat.SORType-class.html#EISENSTAT petsc4py.PETSc.Mat.SORType.SYMMETRY_SWEEP petsc4py.PETSc.Mat.SORType-class.html#SYMMETRY_SWEEP petsc4py.PETSc.Mat.SORType.APPLY_UPPER petsc4py.PETSc.Mat.SORType-class.html#APPLY_UPPER petsc4py.PETSc.Mat.SORType.LOCAL_SYMMETRIC_SWEEP petsc4py.PETSc.Mat.SORType-class.html#LOCAL_SYMMETRIC_SWEEP petsc4py.PETSc.Mat.SORType.LOCAL_FORWARD_SWEEP petsc4py.PETSc.Mat.SORType-class.html#LOCAL_FORWARD_SWEEP petsc4py.PETSc.Mat.SORType.FORWARD_SWEEP petsc4py.PETSc.Mat.SORType-class.html#FORWARD_SWEEP petsc4py.PETSc.Mat.SORType.BACKWARD_SWEEP petsc4py.PETSc.Mat.SORType-class.html#BACKWARD_SWEEP petsc4py.PETSc.Mat.SORType.__qualname__ petsc4py.PETSc.Mat.SORType-class.html#__qualname__ petsc4py.PETSc.Mat.SORType.LOCAL_BACKWARD_SWEEP petsc4py.PETSc.Mat.SORType-class.html#LOCAL_BACKWARD_SWEEP petsc4py.PETSc.Mat.SolverType petsc4py.PETSc.Mat.SolverType-class.html petsc4py.PETSc.Mat.SolverType.PASTIX petsc4py.PETSc.Mat.SolverType-class.html#PASTIX petsc4py.PETSc.Mat.SolverType.BAS petsc4py.PETSc.Mat.SolverType-class.html#BAS petsc4py.PETSc.Mat.SolverType.SUPERLU_DIST petsc4py.PETSc.Mat.SolverType-class.html#SUPERLU_DIST petsc4py.PETSc.Mat.SolverType.SCALAPACK petsc4py.PETSc.Mat.SolverType-class.html#SCALAPACK petsc4py.PETSc.Mat.SolverType.SUPERLU petsc4py.PETSc.Mat.SolverType-class.html#SUPERLU petsc4py.PETSc.Mat.SolverType.UMFPACK petsc4py.PETSc.Mat.SolverType-class.html#UMFPACK petsc4py.PETSc.Mat.SolverType.CUDA petsc4py.PETSc.Mat.SolverType-class.html#CUDA petsc4py.PETSc.Mat.SolverType.SPARSEELEMENTAL petsc4py.PETSc.Mat.SolverType-class.html#SPARSEELEMENTAL petsc4py.PETSc.Mat.SolverType.MATLAB petsc4py.PETSc.Mat.SolverType-class.html#MATLAB petsc4py.PETSc.Mat.SolverType.MKL_CPARDISO petsc4py.PETSc.Mat.SolverType-class.html#MKL_CPARDISO petsc4py.PETSc.Mat.SolverType.ELEMENTAL petsc4py.PETSc.Mat.SolverType-class.html#ELEMENTAL petsc4py.PETSc.Mat.SolverType.PETSC petsc4py.PETSc.Mat.SolverType-class.html#PETSC petsc4py.PETSc.Mat.SolverType.KLU petsc4py.PETSc.Mat.SolverType-class.html#KLU petsc4py.PETSc.Mat.SolverType.MUMPS petsc4py.PETSc.Mat.SolverType-class.html#MUMPS petsc4py.PETSc.Mat.SolverType.MKL_PARDISO petsc4py.PETSc.Mat.SolverType-class.html#MKL_PARDISO petsc4py.PETSc.Mat.SolverType.ESSL petsc4py.PETSc.Mat.SolverType-class.html#ESSL petsc4py.PETSc.Mat.SolverType.LUSOL petsc4py.PETSc.Mat.SolverType-class.html#LUSOL petsc4py.PETSc.Mat.SolverType.STRUMPACK petsc4py.PETSc.Mat.SolverType-class.html#STRUMPACK petsc4py.PETSc.Mat.SolverType.__qualname__ petsc4py.PETSc.Mat.SolverType-class.html#__qualname__ petsc4py.PETSc.Mat.SolverType.CHOLMOD petsc4py.PETSc.Mat.SolverType-class.html#CHOLMOD petsc4py.PETSc.Mat.SolverType.CUSPARSE petsc4py.PETSc.Mat.SolverType-class.html#CUSPARSE petsc4py.PETSc.Mat.Structure petsc4py.PETSc.Mat.Structure-class.html petsc4py.PETSc.Mat.Structure.SUBSET petsc4py.PETSc.Mat.Structure-class.html#SUBSET petsc4py.PETSc.Mat.Structure.UNKNOWN petsc4py.PETSc.Mat.Structure-class.html#UNKNOWN petsc4py.PETSc.Mat.Structure.SAME_NZ petsc4py.PETSc.Mat.Structure-class.html#SAME_NZ petsc4py.PETSc.Mat.Structure.SUBSET_NZ petsc4py.PETSc.Mat.Structure-class.html#SUBSET_NZ petsc4py.PETSc.Mat.Structure.DIFFERENT petsc4py.PETSc.Mat.Structure-class.html#DIFFERENT petsc4py.PETSc.Mat.Structure.DIFFERENT_NZ petsc4py.PETSc.Mat.Structure-class.html#DIFFERENT_NZ petsc4py.PETSc.Mat.Structure.SAME_NONZERO_PATTERN petsc4py.PETSc.Mat.Structure-class.html#SAME_NONZERO_PATTERN petsc4py.PETSc.Mat.Structure.UNKNOWN_NONZERO_PATTERN petsc4py.PETSc.Mat.Structure-class.html#UNKNOWN_NONZERO_PATTERN petsc4py.PETSc.Mat.Structure.UNKNOWN_NZ petsc4py.PETSc.Mat.Structure-class.html#UNKNOWN_NZ petsc4py.PETSc.Mat.Structure.DIFFERENT_NONZERO_PATTERN petsc4py.PETSc.Mat.Structure-class.html#DIFFERENT_NONZERO_PATTERN petsc4py.PETSc.Mat.Structure.SAME petsc4py.PETSc.Mat.Structure-class.html#SAME petsc4py.PETSc.Mat.Structure.__qualname__ petsc4py.PETSc.Mat.Structure-class.html#__qualname__ petsc4py.PETSc.Mat.Structure.SUBSET_NONZERO_PATTERN petsc4py.PETSc.Mat.Structure-class.html#SUBSET_NONZERO_PATTERN petsc4py.PETSc.Mat.Type petsc4py.PETSc.Mat.Type-class.html petsc4py.PETSc.Mat.Type.HYPRE petsc4py.PETSc.Mat.Type-class.html#HYPRE petsc4py.PETSc.Mat.Type.MPIAIJCUSPARSE petsc4py.PETSc.Mat.Type-class.html#MPIAIJCUSPARSE petsc4py.PETSc.Mat.Type.MPISBAIJ petsc4py.PETSc.Mat.Type-class.html#MPISBAIJ petsc4py.PETSc.Mat.Type.LMVMDIAGBBROYDEN petsc4py.PETSc.Mat.Type-class.html#LMVMDIAGBBROYDEN petsc4py.PETSc.Mat.Type.BAIJMKL petsc4py.PETSc.Mat.Type-class.html#BAIJMKL petsc4py.PETSc.Mat.Type.SHELL petsc4py.PETSc.Mat.Type-class.html#SHELL petsc4py.PETSc.Mat.Type.SUBMATRIX petsc4py.PETSc.Mat.Type-class.html#SUBMATRIX petsc4py.PETSc.Mat.Type.TRANSPOSEMAT petsc4py.PETSc.Mat.Type-class.html#TRANSPOSEMAT petsc4py.PETSc.Mat.Type.CONSTANTDIAGONAL petsc4py.PETSc.Mat.Type-class.html#CONSTANTDIAGONAL petsc4py.PETSc.Mat.Type.MPIAIJ petsc4py.PETSc.Mat.Type-class.html#MPIAIJ petsc4py.PETSc.Mat.Type.LMVMSR1 petsc4py.PETSc.Mat.Type-class.html#LMVMSR1 petsc4py.PETSc.Mat.Type.FFT petsc4py.PETSc.Mat.Type-class.html#FFT petsc4py.PETSc.Mat.Type.__qualname__ petsc4py.PETSc.Mat.Type-class.html#__qualname__ petsc4py.PETSc.Mat.Type.AIJSELL petsc4py.PETSc.Mat.Type-class.html#AIJSELL petsc4py.PETSc.Mat.Type.SEQMAIJ petsc4py.PETSc.Mat.Type-class.html#SEQMAIJ petsc4py.PETSc.Mat.Type.MAIJ petsc4py.PETSc.Mat.Type-class.html#MAIJ petsc4py.PETSc.Mat.Type.SEQAIJ petsc4py.PETSc.Mat.Type-class.html#SEQAIJ petsc4py.PETSc.Mat.Type.NORMAL petsc4py.PETSc.Mat.Type-class.html#NORMAL petsc4py.PETSc.Mat.Type.MPIAIJMKL petsc4py.PETSc.Mat.Type-class.html#MPIAIJMKL petsc4py.PETSc.Mat.Type.NEST petsc4py.PETSc.Mat.Type-class.html#NEST petsc4py.PETSc.Mat.Type.AIJCUSPARSE petsc4py.PETSc.Mat.Type-class.html#AIJCUSPARSE petsc4py.PETSc.Mat.Type.MPIAIJSELL petsc4py.PETSc.Mat.Type-class.html#MPIAIJSELL petsc4py.PETSc.Mat.Type.MPISELL petsc4py.PETSc.Mat.Type-class.html#MPISELL petsc4py.PETSc.Mat.Type.SCATTER petsc4py.PETSc.Mat.Type-class.html#SCATTER petsc4py.PETSc.Mat.Type.LMVMBROYDEN petsc4py.PETSc.Mat.Type-class.html#LMVMBROYDEN petsc4py.PETSc.Mat.Type.AIJPERM petsc4py.PETSc.Mat.Type-class.html#AIJPERM petsc4py.PETSc.Mat.Type.SBAIJ petsc4py.PETSc.Mat.Type-class.html#SBAIJ petsc4py.PETSc.Mat.Type.LMVMBFGS petsc4py.PETSc.Mat.Type-class.html#LMVMBFGS petsc4py.PETSc.Mat.Type.SEQSBAIJ petsc4py.PETSc.Mat.Type-class.html#SEQSBAIJ petsc4py.PETSc.Mat.Type.MPIAIJPERM petsc4py.PETSc.Mat.Type-class.html#MPIAIJPERM petsc4py.PETSc.Mat.Type.LOCALREF petsc4py.PETSc.Mat.Type-class.html#LOCALREF petsc4py.PETSc.Mat.Type.LRC petsc4py.PETSc.Mat.Type-class.html#LRC petsc4py.PETSc.Mat.Type.BLOCKMAT petsc4py.PETSc.Mat.Type-class.html#BLOCKMAT petsc4py.PETSc.Mat.Type.COMPOSITE petsc4py.PETSc.Mat.Type-class.html#COMPOSITE petsc4py.PETSc.Mat.Type.MPIKAIJ petsc4py.PETSc.Mat.Type-class.html#MPIKAIJ petsc4py.PETSc.Mat.Type.AIJVIENNACL petsc4py.PETSc.Mat.Type-class.html#AIJVIENNACL petsc4py.PETSc.Mat.Type.LMVMSYMBROYDEN petsc4py.PETSc.Mat.Type-class.html#LMVMSYMBROYDEN petsc4py.PETSc.Mat.Type.HARA petsc4py.PETSc.Mat.Type-class.html#HARA petsc4py.PETSc.Mat.Type.SEQAIJCRL petsc4py.PETSc.Mat.Type-class.html#SEQAIJCRL petsc4py.PETSc.Mat.Type.MPIAIJVIENNACL petsc4py.PETSc.Mat.Type-class.html#MPIAIJVIENNACL petsc4py.PETSc.Mat.Type.HYPRESTRUCT petsc4py.PETSc.Mat.Type-class.html#HYPRESTRUCT petsc4py.PETSc.Mat.Type.SEQKAIJ petsc4py.PETSc.Mat.Type-class.html#SEQKAIJ petsc4py.PETSc.Mat.Type.MPIADJ petsc4py.PETSc.Mat.Type-class.html#MPIADJ petsc4py.PETSc.Mat.Type.KAIJ petsc4py.PETSc.Mat.Type-class.html#KAIJ petsc4py.PETSc.Mat.Type.MPIDENSE petsc4py.PETSc.Mat.Type-class.html#MPIDENSE petsc4py.PETSc.Mat.Type.MPIBAIJMKL petsc4py.PETSc.Mat.Type-class.html#MPIBAIJMKL petsc4py.PETSc.Mat.Type.DUMMY petsc4py.PETSc.Mat.Type-class.html#DUMMY petsc4py.PETSc.Mat.Type.AIJMKL petsc4py.PETSc.Mat.Type-class.html#AIJMKL petsc4py.PETSc.Mat.Type.DENSE petsc4py.PETSc.Mat.Type-class.html#DENSE petsc4py.PETSc.Mat.Type.ELEMENTAL petsc4py.PETSc.Mat.Type-class.html#ELEMENTAL petsc4py.PETSc.Mat.Type.LMVMDFP petsc4py.PETSc.Mat.Type-class.html#LMVMDFP petsc4py.PETSc.Mat.Type.HYPRESSTRUCT petsc4py.PETSc.Mat.Type-class.html#HYPRESSTRUCT petsc4py.PETSc.Mat.Type.SEQSELL petsc4py.PETSc.Mat.Type-class.html#SEQSELL petsc4py.PETSc.Mat.Type.SEQBAIJ petsc4py.PETSc.Mat.Type-class.html#SEQBAIJ petsc4py.PETSc.Mat.Type.SEQAIJPERM petsc4py.PETSc.Mat.Type-class.html#SEQAIJPERM petsc4py.PETSc.Mat.Type.FFTW petsc4py.PETSc.Mat.Type-class.html#FFTW petsc4py.PETSc.Mat.Type.MFFD petsc4py.PETSc.Mat.Type-class.html#MFFD petsc4py.PETSc.Mat.Type.SCHURCOMPLEMENT petsc4py.PETSc.Mat.Type-class.html#SCHURCOMPLEMENT petsc4py.PETSc.Mat.Type.SEQDENSECUDA petsc4py.PETSc.Mat.Type-class.html#SEQDENSECUDA petsc4py.PETSc.Mat.Type.PREALLOCATOR petsc4py.PETSc.Mat.Type-class.html#PREALLOCATOR petsc4py.PETSc.Mat.Type.NORMALHERMITIAN petsc4py.PETSc.Mat.Type-class.html#NORMALHERMITIAN petsc4py.PETSc.Mat.Type.SEQAIJSELL petsc4py.PETSc.Mat.Type-class.html#SEQAIJSELL petsc4py.PETSc.Mat.Type.PYTHON petsc4py.PETSc.Mat.Type-class.html#PYTHON petsc4py.PETSc.Mat.Type.LMVMBADBROYDEN petsc4py.PETSc.Mat.Type-class.html#LMVMBADBROYDEN petsc4py.PETSc.Mat.Type.AIJ petsc4py.PETSc.Mat.Type-class.html#AIJ petsc4py.PETSc.Mat.Type.MPIMAIJ petsc4py.PETSc.Mat.Type-class.html#MPIMAIJ petsc4py.PETSc.Mat.Type.BAIJ petsc4py.PETSc.Mat.Type-class.html#BAIJ petsc4py.PETSc.Mat.Type.MPIBAIJ petsc4py.PETSc.Mat.Type-class.html#MPIBAIJ petsc4py.PETSc.Mat.Type.SEQAIJCUSPARSE petsc4py.PETSc.Mat.Type-class.html#SEQAIJCUSPARSE petsc4py.PETSc.Mat.Type.AIJCRL petsc4py.PETSc.Mat.Type-class.html#AIJCRL petsc4py.PETSc.Mat.Type.IS petsc4py.PETSc.Mat.Type-class.html#IS petsc4py.PETSc.Mat.Type.LMVM petsc4py.PETSc.Mat.Type-class.html#LMVM petsc4py.PETSc.Mat.Type.SEQAIJMKL petsc4py.PETSc.Mat.Type-class.html#SEQAIJMKL petsc4py.PETSc.Mat.Type.SEQCUFFT petsc4py.PETSc.Mat.Type-class.html#SEQCUFFT petsc4py.PETSc.Mat.Type.SEQBAIJMKL petsc4py.PETSc.Mat.Type-class.html#SEQBAIJMKL petsc4py.PETSc.Mat.Type.MPIAIJCRL petsc4py.PETSc.Mat.Type-class.html#MPIAIJCRL petsc4py.PETSc.Mat.Type.SELL petsc4py.PETSc.Mat.Type-class.html#SELL petsc4py.PETSc.Mat.Type.SEQAIJVIENNACL petsc4py.PETSc.Mat.Type-class.html#SEQAIJVIENNACL petsc4py.PETSc.Mat.Type.SAME petsc4py.PETSc.Mat.Type-class.html#SAME petsc4py.PETSc.Mat.Type.SEQDENSE petsc4py.PETSc.Mat.Type-class.html#SEQDENSE petsc4py.PETSc.Mat.Type.LMVMSYMBADBROYDEN petsc4py.PETSc.Mat.Type-class.html#LMVMSYMBADBROYDEN petsc4py.PETSc.NormType petsc4py.PETSc.NormType-class.html petsc4py.PETSc.NormType.FRB petsc4py.PETSc.NormType-class.html#FRB petsc4py.PETSc.NormType.NORM_MAX petsc4py.PETSc.NormType-class.html#NORM_MAX petsc4py.PETSc.NormType.INFINITY petsc4py.PETSc.NormType-class.html#INFINITY petsc4py.PETSc.NormType.FROBENIUS petsc4py.PETSc.NormType-class.html#FROBENIUS petsc4py.PETSc.NormType.NORM_FROBENIUS petsc4py.PETSc.NormType-class.html#NORM_FROBENIUS petsc4py.PETSc.NormType.NORM_1_AND_2 petsc4py.PETSc.NormType-class.html#NORM_1_AND_2 petsc4py.PETSc.NormType.N1 petsc4py.PETSc.NormType-class.html#N1 petsc4py.PETSc.NormType.N2 petsc4py.PETSc.NormType-class.html#N2 petsc4py.PETSc.NormType.N12 petsc4py.PETSc.NormType-class.html#N12 petsc4py.PETSc.NormType.NORM_1 petsc4py.PETSc.NormType-class.html#NORM_1 petsc4py.PETSc.NormType.NORM_2 petsc4py.PETSc.NormType-class.html#NORM_2 petsc4py.PETSc.NormType.MAX petsc4py.PETSc.NormType-class.html#MAX petsc4py.PETSc.NormType.NORM_INFINITY petsc4py.PETSc.NormType-class.html#NORM_INFINITY petsc4py.PETSc.NormType.__qualname__ petsc4py.PETSc.NormType-class.html#__qualname__ petsc4py.PETSc.NormType.INF petsc4py.PETSc.NormType-class.html#INF petsc4py.PETSc.NullSpace petsc4py.PETSc.NullSpace-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.NullSpace.getVecs petsc4py.PETSc.NullSpace-class.html#getVecs petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.NullSpace.hasConstant petsc4py.PETSc.NullSpace-class.html#hasConstant petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.NullSpace.setFunction petsc4py.PETSc.NullSpace-class.html#setFunction petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.NullSpace.__new__ petsc4py.PETSc.NullSpace-class.html#__new__ petsc4py.PETSc.NullSpace.create petsc4py.PETSc.NullSpace-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.NullSpace.__call__ petsc4py.PETSc.NullSpace-class.html#__call__ petsc4py.PETSc.NullSpace.destroy petsc4py.PETSc.NullSpace-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.getType petsc4py.PETSc.Object-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.NullSpace.test petsc4py.PETSc.NullSpace-class.html#test petsc4py.PETSc.NullSpace.createRigidBody petsc4py.PETSc.NullSpace-class.html#createRigidBody petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.NullSpace.getFunction petsc4py.PETSc.NullSpace-class.html#getFunction petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.NullSpace.remove petsc4py.PETSc.NullSpace-class.html#remove petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.NullSpace.view petsc4py.PETSc.NullSpace-class.html#view petsc4py.PETSc.Object petsc4py.PETSc.Object-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Object.__new__ petsc4py.PETSc.Object-class.html#__new__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Object.destroy petsc4py.PETSc.Object-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.getType petsc4py.PETSc.Object-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.view petsc4py.PETSc.Object-class.html#view petsc4py.PETSc.Options petsc4py.PETSc.Options-class.html petsc4py.PETSc.Options.prefixPush petsc4py.PETSc.Options-class.html#prefixPush petsc4py.PETSc.Options.getString petsc4py.PETSc.Options-class.html#getString petsc4py.PETSc.Options.getAll petsc4py.PETSc.Options-class.html#getAll petsc4py.PETSc.Options.delValue petsc4py.PETSc.Options-class.html#delValue petsc4py.PETSc.Options.prefix petsc4py.PETSc.Options-class.html#prefix petsc4py.PETSc.Options.__init__ petsc4py.PETSc.Options-class.html#__init__ petsc4py.PETSc.Options.__new__ petsc4py.PETSc.Options-class.html#__new__ petsc4py.PETSc.Options.__contains__ petsc4py.PETSc.Options-class.html#__contains__ petsc4py.PETSc.Options.create petsc4py.PETSc.Options-class.html#create petsc4py.PETSc.Options.hasName petsc4py.PETSc.Options-class.html#hasName petsc4py.PETSc.Options.prefixPop petsc4py.PETSc.Options-class.html#prefixPop petsc4py.PETSc.Options.destroy petsc4py.PETSc.Options-class.html#destroy petsc4py.PETSc.Options.getReal petsc4py.PETSc.Options-class.html#getReal petsc4py.PETSc.Options.setValue petsc4py.PETSc.Options-class.html#setValue petsc4py.PETSc.Options.__getitem__ petsc4py.PETSc.Options-class.html#__getitem__ petsc4py.PETSc.Options.getBool petsc4py.PETSc.Options-class.html#getBool petsc4py.PETSc.Options.getInt petsc4py.PETSc.Options-class.html#getInt petsc4py.PETSc.Options.__setitem__ petsc4py.PETSc.Options-class.html#__setitem__ petsc4py.PETSc.Options.__delitem__ petsc4py.PETSc.Options-class.html#__delitem__ petsc4py.PETSc.Options.clear petsc4py.PETSc.Options-class.html#clear petsc4py.PETSc.Options.insertString petsc4py.PETSc.Options-class.html#insertString petsc4py.PETSc.Options.getScalar petsc4py.PETSc.Options-class.html#getScalar petsc4py.PETSc.Options.view petsc4py.PETSc.Options-class.html#view petsc4py.PETSc.PC petsc4py.PETSc.PC-class.html petsc4py.PETSc.PC.setDM petsc4py.PETSc.PC-class.html#setDM petsc4py.PETSc.PC.getMGRScale petsc4py.PETSc.PC-class.html#getMGRScale petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.PC.setGASMType petsc4py.PETSc.PC-class.html#setGASMType petsc4py.PETSc.PC.setGASMOverlap petsc4py.PETSc.PC-class.html#setGASMOverlap petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.PC.setBDDCLevels petsc4py.PETSc.PC-class.html#setBDDCLevels petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.PC.setPatchComputeFunction petsc4py.PETSc.PC-class.html#setPatchComputeFunction petsc4py.PETSc.PC.setMGRScale petsc4py.PETSc.PC-class.html#setMGRScale petsc4py.PETSc.PC.setOperators petsc4py.PETSc.PC-class.html#setOperators petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.PC.__call__ petsc4py.PETSc.PC-class.html#__call__ petsc4py.PETSc.PC.setPatchComputeFunctionInteriorFacets petsc4py.PETSc.PC-class.html#setPatchComputeFunctionInteriorFacets petsc4py.PETSc.PC.setOptionsPrefix petsc4py.PETSc.PC-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.PC.getMGLevels petsc4py.PETSc.PC-class.html#getMGLevels petsc4py.PETSc.PC.setBDDCCoarseningRatio petsc4py.PETSc.PC-class.html#setBDDCCoarseningRatio petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.PC.setFromOptions petsc4py.PETSc.PC-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.PC.setASMTotalSubdomains petsc4py.PETSc.PC-class.html#setASMTotalSubdomains petsc4py.PETSc.PC.ASMType petsc4py.PETSc.PC.ASMType-class.html petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.PC.setFactorSolverType petsc4py.PETSc.PC-class.html#setFactorSolverType petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.PC.setASMType petsc4py.PETSc.PC-class.html#setASMType petsc4py.PETSc.PC.getCompositePC petsc4py.PETSc.PC-class.html#getCompositePC petsc4py.PETSc.PC.GAMGType petsc4py.PETSc.PC.GAMGType-class.html petsc4py.PETSc.PC.setPatchComputeOperator petsc4py.PETSc.PC-class.html#setPatchComputeOperator petsc4py.PETSc.PC.setUpOnBlocks petsc4py.PETSc.PC-class.html#setUpOnBlocks petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.PC.view petsc4py.PETSc.PC-class.html#view petsc4py.PETSc.PC.getMGType petsc4py.PETSc.PC-class.html#getMGType petsc4py.PETSc.PC.setBDDCDirichletBoundariesLocal petsc4py.PETSc.PC-class.html#setBDDCDirichletBoundariesLocal petsc4py.PETSc.PC.getASMSubKSP petsc4py.PETSc.PC-class.html#getASMSubKSP petsc4py.PETSc.PC.setBDDCDofsSplitting petsc4py.PETSc.PC-class.html#setBDDCDofsSplitting petsc4py.PETSc.PC.getMGCoarseSolve petsc4py.PETSc.PC-class.html#getMGCoarseSolve petsc4py.PETSc.PC.applySymmetricRight petsc4py.PETSc.PC-class.html#applySymmetricRight petsc4py.PETSc.PC.getKSP petsc4py.PETSc.PC-class.html#getKSP petsc4py.PETSc.PC.Type petsc4py.PETSc.PC.Type-class.html petsc4py.PETSc.PC.setMGInterpolation petsc4py.PETSc.PC-class.html#setMGInterpolation petsc4py.PETSc.PC.getFieldSplitSchurGetSubKSP petsc4py.PETSc.PC-class.html#getFieldSplitSchurGetSubKSP petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.PC.setBDDCDirichletBoundaries petsc4py.PETSc.PC-class.html#setBDDCDirichletBoundaries petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.PC.setMGType petsc4py.PETSc.PC-class.html#setMGType petsc4py.PETSc.PC.setBDDCPrimalVerticesLocalIS petsc4py.PETSc.PC-class.html#setBDDCPrimalVerticesLocalIS petsc4py.PETSc.PC.MGType petsc4py.PETSc.PC.MGType-class.html petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.PC.setBDDCDivergenceMat petsc4py.PETSc.PC-class.html#setBDDCDivergenceMat petsc4py.PETSc.PC.setUp petsc4py.PETSc.PC-class.html#setUp petsc4py.PETSc.PC.createPython petsc4py.PETSc.PC-class.html#createPython petsc4py.PETSc.PC.getDM petsc4py.PETSc.PC-class.html#getDM petsc4py.PETSc.PC.MGCycleType petsc4py.PETSc.PC.MGCycleType-class.html petsc4py.PETSc.PC.getOptionsPrefix petsc4py.PETSc.PC-class.html#getOptionsPrefix petsc4py.PETSc.PC.setFieldSplitSchurFactType petsc4py.PETSc.PC-class.html#setFieldSplitSchurFactType petsc4py.PETSc.PC.setMGCycleType petsc4py.PETSc.PC-class.html#setMGCycleType petsc4py.PETSc.PC.setCompositeType petsc4py.PETSc.PC-class.html#setCompositeType petsc4py.PETSc.PC.setASMOverlap petsc4py.PETSc.PC-class.html#setASMOverlap petsc4py.PETSc.PC.getMGInterpolation petsc4py.PETSc.PC-class.html#getMGInterpolation petsc4py.PETSc.PC.setUseAmat petsc4py.PETSc.PC-class.html#setUseAmat petsc4py.PETSc.PC.setFieldSplitType petsc4py.PETSc.PC-class.html#setFieldSplitType petsc4py.PETSc.PC.setFactorSetUpSolverType petsc4py.PETSc.PC-class.html#setFactorSetUpSolverType petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.PC.getFactorSolverType petsc4py.PETSc.PC-class.html#getFactorSolverType petsc4py.PETSc.PC.setMGR petsc4py.PETSc.PC-class.html#setMGR petsc4py.PETSc.PC.setBDDCPrimalVerticesIS petsc4py.PETSc.PC-class.html#setBDDCPrimalVerticesIS petsc4py.PETSc.PC.setBDDCNeumannBoundariesLocal petsc4py.PETSc.PC-class.html#setBDDCNeumannBoundariesLocal petsc4py.PETSc.PC.setMGX petsc4py.PETSc.PC-class.html#setMGX petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.PC.getPythonContext petsc4py.PETSc.PC-class.html#getPythonContext petsc4py.PETSc.PC.setBDDCChangeOfBasisMat petsc4py.PETSc.PC-class.html#setBDDCChangeOfBasisMat petsc4py.PETSc.PC.setGAMGSmooths petsc4py.PETSc.PC-class.html#setGAMGSmooths petsc4py.PETSc.PC.setCoordinates petsc4py.PETSc.PC-class.html#setCoordinates petsc4py.PETSc.PC.setBDDCDiscreteGradient petsc4py.PETSc.PC-class.html#setBDDCDiscreteGradient petsc4py.PETSc.PC.GASMType petsc4py.PETSc.PC.GASMType-class.html petsc4py.PETSc.PC.setFieldSplitFields petsc4py.PETSc.PC-class.html#setFieldSplitFields petsc4py.PETSc.PC.setHYPRESetBetaPoissonMatrix petsc4py.PETSc.PC-class.html#setHYPRESetBetaPoissonMatrix petsc4py.PETSc.PC.setASMLocalSubdomains petsc4py.PETSc.PC-class.html#setASMLocalSubdomains petsc4py.PETSc.PC.apply petsc4py.PETSc.PC-class.html#apply petsc4py.PETSc.PC.setFactorLevels petsc4py.PETSc.PC-class.html#setFactorLevels petsc4py.PETSc.PC.setGAMGLevels petsc4py.PETSc.PC-class.html#setGAMGLevels petsc4py.PETSc.PC.setType petsc4py.PETSc.PC-class.html#setType petsc4py.PETSc.PC.SchurFactType petsc4py.PETSc.PC.SchurFactType-class.html petsc4py.PETSc.PC.getOperators petsc4py.PETSc.PC-class.html#getOperators petsc4py.PETSc.PC.create petsc4py.PETSc.PC-class.html#create petsc4py.PETSc.PC.setBDDCNeumannBoundaries petsc4py.PETSc.PC-class.html#setBDDCNeumannBoundaries petsc4py.PETSc.PC.getFieldSplitSubKSP petsc4py.PETSc.PC-class.html#getFieldSplitSubKSP petsc4py.PETSc.PC.setFactorPivot petsc4py.PETSc.PC-class.html#setFactorPivot petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.PC.getMGRestriction petsc4py.PETSc.PC-class.html#getMGRestriction petsc4py.PETSc.PC.setMGRhs petsc4py.PETSc.PC-class.html#setMGRhs petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.PC.PatchConstructType petsc4py.PETSc.PC.PatchConstructType-class.html petsc4py.PETSc.PC.getType petsc4py.PETSc.PC-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.PC.getMGSmootherDown petsc4py.PETSc.PC-class.html#getMGSmootherDown petsc4py.PETSc.PC.setPatchComputeOperatorInteriorFacets petsc4py.PETSc.PC-class.html#setPatchComputeOperatorInteriorFacets petsc4py.PETSc.PC.setMGCycleTypeOnLevel petsc4py.PETSc.PC-class.html#setMGCycleTypeOnLevel petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.PC.setMGLevels petsc4py.PETSc.PC-class.html#setMGLevels petsc4py.PETSc.PC.reset petsc4py.PETSc.PC-class.html#reset petsc4py.PETSc.PC.setFactorShift petsc4py.PETSc.PC-class.html#setFactorShift petsc4py.PETSc.PC.applyTranspose petsc4py.PETSc.PC-class.html#applyTranspose petsc4py.PETSc.PC.setHYPRESetAlphaPoissonMatrix petsc4py.PETSc.PC-class.html#setHYPRESetAlphaPoissonMatrix petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.PC.setGAMGType petsc4py.PETSc.PC-class.html#setGAMGType petsc4py.PETSc.PC.applySymmetricLeft petsc4py.PETSc.PC-class.html#applySymmetricLeft petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.PC.setPatchDiscretisationInfo petsc4py.PETSc.PC-class.html#setPatchDiscretisationInfo petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.PC.setHYPREType petsc4py.PETSc.PC-class.html#setHYPREType petsc4py.PETSc.PC.setHYPREDiscreteGradient petsc4py.PETSc.PC-class.html#setHYPREDiscreteGradient petsc4py.PETSc.PC.getMGSmootherUp petsc4py.PETSc.PC-class.html#getMGSmootherUp petsc4py.PETSc.PC.setReusePreconditioner petsc4py.PETSc.PC-class.html#setReusePreconditioner petsc4py.PETSc.PC.setFieldSplitIS petsc4py.PETSc.PC-class.html#setFieldSplitIS petsc4py.PETSc.PC.getHYPREType petsc4py.PETSc.PC-class.html#getHYPREType petsc4py.PETSc.PC.SchurPreType petsc4py.PETSc.PC.SchurPreType-class.html petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.PC.setMGRestriction petsc4py.PETSc.PC-class.html#setMGRestriction petsc4py.PETSc.PC.setHYPREDiscreteCurl petsc4py.PETSc.PC-class.html#setHYPREDiscreteCurl petsc4py.PETSc.PC.__new__ petsc4py.PETSc.PC-class.html#__new__ petsc4py.PETSc.PC.getMGSmoother petsc4py.PETSc.PC-class.html#getMGSmoother petsc4py.PETSc.PC.destroy petsc4py.PETSc.PC-class.html#destroy petsc4py.PETSc.PC.setPatchConstructType petsc4py.PETSc.PC-class.html#setPatchConstructType petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.PC.setHYPRESetEdgeConstantVectors petsc4py.PETSc.PC-class.html#setHYPRESetEdgeConstantVectors petsc4py.PETSc.PC.CompositeType petsc4py.PETSc.PC.CompositeType-class.html petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.PC.setPatchCellNumbering petsc4py.PETSc.PC-class.html#setPatchCellNumbering petsc4py.PETSc.PC.getFactorMatrix petsc4py.PETSc.PC-class.html#getFactorMatrix petsc4py.PETSc.PC.setFactorOrdering petsc4py.PETSc.PC-class.html#setFactorOrdering petsc4py.PETSc.PC.addCompositePCType petsc4py.PETSc.PC-class.html#addCompositePCType petsc4py.PETSc.PC.Side petsc4py.PETSc.PC.Side-class.html petsc4py.PETSc.PC.setPythonType petsc4py.PETSc.PC-class.html#setPythonType petsc4py.PETSc.PC.setFieldSplitSchurPreType petsc4py.PETSc.PC-class.html#setFieldSplitSchurPreType petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.PC.setBDDCDofsSplittingLocal petsc4py.PETSc.PC-class.html#setBDDCDofsSplittingLocal petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.PC.setPythonContext petsc4py.PETSc.PC-class.html#setPythonContext petsc4py.PETSc.PC.ASMType petsc4py.PETSc.PC.ASMType-class.html petsc4py.PETSc.PC.ASMType.__qualname__ petsc4py.PETSc.PC.ASMType-class.html#__qualname__ petsc4py.PETSc.PC.ASMType.NONE petsc4py.PETSc.PC.ASMType-class.html#NONE petsc4py.PETSc.PC.ASMType.INTERPOLATE petsc4py.PETSc.PC.ASMType-class.html#INTERPOLATE petsc4py.PETSc.PC.ASMType.RESTRICT petsc4py.PETSc.PC.ASMType-class.html#RESTRICT petsc4py.PETSc.PC.ASMType.BASIC petsc4py.PETSc.PC.ASMType-class.html#BASIC petsc4py.PETSc.PC.CompositeType petsc4py.PETSc.PC.CompositeType-class.html petsc4py.PETSc.PC.CompositeType.SCHUR petsc4py.PETSc.PC.CompositeType-class.html#SCHUR petsc4py.PETSc.PC.CompositeType.ADDITIVE petsc4py.PETSc.PC.CompositeType-class.html#ADDITIVE petsc4py.PETSc.PC.CompositeType.SYMMETRIC_MULTIPLICATIVE petsc4py.PETSc.PC.CompositeType-class.html#SYMMETRIC_MULTIPLICATIVE petsc4py.PETSc.PC.CompositeType.__qualname__ petsc4py.PETSc.PC.CompositeType-class.html#__qualname__ petsc4py.PETSc.PC.CompositeType.MULTIPLICATIVE petsc4py.PETSc.PC.CompositeType-class.html#MULTIPLICATIVE petsc4py.PETSc.PC.CompositeType.SPECIAL petsc4py.PETSc.PC.CompositeType-class.html#SPECIAL petsc4py.PETSc.PC.GAMGType petsc4py.PETSc.PC.GAMGType-class.html petsc4py.PETSc.PC.GAMGType.CLASSICAL petsc4py.PETSc.PC.GAMGType-class.html#CLASSICAL petsc4py.PETSc.PC.GAMGType.AGG petsc4py.PETSc.PC.GAMGType-class.html#AGG petsc4py.PETSc.PC.GAMGType.__qualname__ petsc4py.PETSc.PC.GAMGType-class.html#__qualname__ petsc4py.PETSc.PC.GAMGType.GEO petsc4py.PETSc.PC.GAMGType-class.html#GEO petsc4py.PETSc.PC.GASMType petsc4py.PETSc.PC.GASMType-class.html petsc4py.PETSc.PC.GASMType.__qualname__ petsc4py.PETSc.PC.GASMType-class.html#__qualname__ petsc4py.PETSc.PC.GASMType.NONE petsc4py.PETSc.PC.GASMType-class.html#NONE petsc4py.PETSc.PC.GASMType.INTERPOLATE petsc4py.PETSc.PC.GASMType-class.html#INTERPOLATE petsc4py.PETSc.PC.GASMType.RESTRICT petsc4py.PETSc.PC.GASMType-class.html#RESTRICT petsc4py.PETSc.PC.GASMType.BASIC petsc4py.PETSc.PC.GASMType-class.html#BASIC petsc4py.PETSc.PC.MGCycleType petsc4py.PETSc.PC.MGCycleType-class.html petsc4py.PETSc.PC.MGCycleType.__qualname__ petsc4py.PETSc.PC.MGCycleType-class.html#__qualname__ petsc4py.PETSc.PC.MGCycleType.W petsc4py.PETSc.PC.MGCycleType-class.html#W petsc4py.PETSc.PC.MGCycleType.V petsc4py.PETSc.PC.MGCycleType-class.html#V petsc4py.PETSc.PC.MGType petsc4py.PETSc.PC.MGType-class.html petsc4py.PETSc.PC.MGType.KASKADE petsc4py.PETSc.PC.MGType-class.html#KASKADE petsc4py.PETSc.PC.MGType.FULL petsc4py.PETSc.PC.MGType-class.html#FULL petsc4py.PETSc.PC.MGType.ADDITIVE petsc4py.PETSc.PC.MGType-class.html#ADDITIVE petsc4py.PETSc.PC.MGType.__qualname__ petsc4py.PETSc.PC.MGType-class.html#__qualname__ petsc4py.PETSc.PC.MGType.MULTIPLICATIVE petsc4py.PETSc.PC.MGType-class.html#MULTIPLICATIVE petsc4py.PETSc.PC.PatchConstructType petsc4py.PETSc.PC.PatchConstructType-class.html petsc4py.PETSc.PC.PatchConstructType.STAR petsc4py.PETSc.PC.PatchConstructType-class.html#STAR petsc4py.PETSc.PC.PatchConstructType.PYTHON petsc4py.PETSc.PC.PatchConstructType-class.html#PYTHON petsc4py.PETSc.PC.PatchConstructType.__qualname__ petsc4py.PETSc.PC.PatchConstructType-class.html#__qualname__ petsc4py.PETSc.PC.PatchConstructType.PARDECOMP petsc4py.PETSc.PC.PatchConstructType-class.html#PARDECOMP petsc4py.PETSc.PC.PatchConstructType.USER petsc4py.PETSc.PC.PatchConstructType-class.html#USER petsc4py.PETSc.PC.PatchConstructType.VANKA petsc4py.PETSc.PC.PatchConstructType-class.html#VANKA petsc4py.PETSc.PC.SchurFactType petsc4py.PETSc.PC.SchurFactType-class.html petsc4py.PETSc.PC.SchurFactType.UPPER petsc4py.PETSc.PC.SchurFactType-class.html#UPPER petsc4py.PETSc.PC.SchurFactType.LOWER petsc4py.PETSc.PC.SchurFactType-class.html#LOWER petsc4py.PETSc.PC.SchurFactType.FULL petsc4py.PETSc.PC.SchurFactType-class.html#FULL petsc4py.PETSc.PC.SchurFactType.DIAG petsc4py.PETSc.PC.SchurFactType-class.html#DIAG petsc4py.PETSc.PC.SchurFactType.__qualname__ petsc4py.PETSc.PC.SchurFactType-class.html#__qualname__ petsc4py.PETSc.PC.SchurPreType petsc4py.PETSc.PC.SchurPreType-class.html petsc4py.PETSc.PC.SchurPreType.FULL petsc4py.PETSc.PC.SchurPreType-class.html#FULL petsc4py.PETSc.PC.SchurPreType.A11 petsc4py.PETSc.PC.SchurPreType-class.html#A11 petsc4py.PETSc.PC.SchurPreType.SELF petsc4py.PETSc.PC.SchurPreType-class.html#SELF petsc4py.PETSc.PC.SchurPreType.__qualname__ petsc4py.PETSc.PC.SchurPreType-class.html#__qualname__ petsc4py.PETSc.PC.SchurPreType.USER petsc4py.PETSc.PC.SchurPreType-class.html#USER petsc4py.PETSc.PC.SchurPreType.SELFP petsc4py.PETSc.PC.SchurPreType-class.html#SELFP petsc4py.PETSc.PC.Side petsc4py.PETSc.PC.Side-class.html petsc4py.PETSc.PC.Side.SYMMETRIC petsc4py.PETSc.PC.Side-class.html#SYMMETRIC petsc4py.PETSc.PC.Side.RIGHT petsc4py.PETSc.PC.Side-class.html#RIGHT petsc4py.PETSc.PC.Side.L petsc4py.PETSc.PC.Side-class.html#L petsc4py.PETSc.PC.Side.__qualname__ petsc4py.PETSc.PC.Side-class.html#__qualname__ petsc4py.PETSc.PC.Side.S petsc4py.PETSc.PC.Side-class.html#S petsc4py.PETSc.PC.Side.R petsc4py.PETSc.PC.Side-class.html#R petsc4py.PETSc.PC.Side.LEFT petsc4py.PETSc.PC.Side-class.html#LEFT petsc4py.PETSc.PC.Type petsc4py.PETSc.PC.Type-class.html petsc4py.PETSc.PC.Type.HYPRE petsc4py.PETSc.PC.Type-class.html#HYPRE petsc4py.PETSc.PC.Type.GASM petsc4py.PETSc.PC.Type-class.html#GASM petsc4py.PETSc.PC.Type.KSP petsc4py.PETSc.PC.Type-class.html#KSP petsc4py.PETSc.PC.Type.CHOWILUVIENNACL petsc4py.PETSc.PC.Type-class.html#CHOWILUVIENNACL petsc4py.PETSc.PC.Type.GALERKIN petsc4py.PETSc.PC.Type-class.html#GALERKIN petsc4py.PETSc.PC.Type.PYTHON petsc4py.PETSc.PC.Type-class.html#PYTHON petsc4py.PETSc.PC.Type.SYSPFMG petsc4py.PETSc.PC.Type-class.html#SYSPFMG petsc4py.PETSc.PC.Type.PATCH petsc4py.PETSc.PC.Type-class.html#PATCH petsc4py.PETSc.PC.Type.GAMG petsc4py.PETSc.PC.Type-class.html#GAMG petsc4py.PETSc.PC.Type.HARA petsc4py.PETSc.PC.Type-class.html#HARA petsc4py.PETSc.PC.Type.ILU petsc4py.PETSc.PC.Type-class.html#ILU petsc4py.PETSc.PC.Type.BFBT petsc4py.PETSc.PC.Type-class.html#BFBT petsc4py.PETSc.PC.Type.PBJACOBI petsc4py.PETSc.PC.Type-class.html#PBJACOBI petsc4py.PETSc.PC.Type.EISENSTAT petsc4py.PETSc.PC.Type-class.html#EISENSTAT petsc4py.PETSc.PC.Type.ROWSCALINGVIENNACL petsc4py.PETSc.PC.Type-class.html#ROWSCALINGVIENNACL petsc4py.PETSc.PC.Type.NONE petsc4py.PETSc.PC.Type-class.html#NONE petsc4py.PETSc.PC.Type.SHELL petsc4py.PETSc.PC.Type-class.html#SHELL petsc4py.PETSc.PC.Type.LSC petsc4py.PETSc.PC.Type-class.html#LSC petsc4py.PETSc.PC.Type.NN petsc4py.PETSc.PC.Type-class.html#NN petsc4py.PETSc.PC.Type.BJACOBI petsc4py.PETSc.PC.Type-class.html#BJACOBI petsc4py.PETSc.PC.Type.BDDC petsc4py.PETSc.PC.Type-class.html#BDDC petsc4py.PETSc.PC.Type.LU petsc4py.PETSc.PC.Type-class.html#LU petsc4py.PETSc.PC.Type.HPDDM petsc4py.PETSc.PC.Type-class.html#HPDDM petsc4py.PETSc.PC.Type.HMG petsc4py.PETSc.PC.Type-class.html#HMG petsc4py.PETSc.PC.Type.KACZMARZ petsc4py.PETSc.PC.Type-class.html#KACZMARZ petsc4py.PETSc.PC.Type.ASM petsc4py.PETSc.PC.Type-class.html#ASM petsc4py.PETSc.PC.Type.EXOTIC petsc4py.PETSc.PC.Type-class.html#EXOTIC petsc4py.PETSc.PC.Type.SAVIENNACL petsc4py.PETSc.PC.Type-class.html#SAVIENNACL petsc4py.PETSc.PC.Type.ICC petsc4py.PETSc.PC.Type-class.html#ICC petsc4py.PETSc.PC.Type.SVD petsc4py.PETSc.PC.Type-class.html#SVD petsc4py.PETSc.PC.Type.REDISTRIBUTE petsc4py.PETSc.PC.Type-class.html#REDISTRIBUTE petsc4py.PETSc.PC.Type.FIELDSPLIT petsc4py.PETSc.PC.Type-class.html#FIELDSPLIT petsc4py.PETSc.PC.Type.PFMG petsc4py.PETSc.PC.Type-class.html#PFMG petsc4py.PETSc.PC.Type.REDUNDANT petsc4py.PETSc.PC.Type-class.html#REDUNDANT petsc4py.PETSc.PC.Type.CP petsc4py.PETSc.PC.Type-class.html#CP petsc4py.PETSc.PC.Type.TELESCOPE petsc4py.PETSc.PC.Type-class.html#TELESCOPE petsc4py.PETSc.PC.Type.MG petsc4py.PETSc.PC.Type-class.html#MG petsc4py.PETSc.PC.Type.SPAI petsc4py.PETSc.PC.Type-class.html#SPAI petsc4py.PETSc.PC.Type.CHOLESKY petsc4py.PETSc.PC.Type-class.html#CHOLESKY petsc4py.PETSc.PC.Type.MAT petsc4py.PETSc.PC.Type-class.html#MAT petsc4py.PETSc.PC.Type.COMPOSITE petsc4py.PETSc.PC.Type-class.html#COMPOSITE petsc4py.PETSc.PC.Type.ML petsc4py.PETSc.PC.Type-class.html#ML petsc4py.PETSc.PC.Type.DEFLATION petsc4py.PETSc.PC.Type-class.html#DEFLATION petsc4py.PETSc.PC.Type.SOR petsc4py.PETSc.PC.Type-class.html#SOR petsc4py.PETSc.PC.Type.__qualname__ petsc4py.PETSc.PC.Type-class.html#__qualname__ petsc4py.PETSc.PC.Type.VPBJACOBI petsc4py.PETSc.PC.Type-class.html#VPBJACOBI petsc4py.PETSc.PC.Type.LMVM petsc4py.PETSc.PC.Type-class.html#LMVM petsc4py.PETSc.PC.Type.JACOBI petsc4py.PETSc.PC.Type-class.html#JACOBI petsc4py.PETSc.PC.Type.PARMS petsc4py.PETSc.PC.Type-class.html#PARMS petsc4py.PETSc.PC.Type.TFS petsc4py.PETSc.PC.Type-class.html#TFS petsc4py.PETSc.Partitioner petsc4py.PETSc.Partitioner-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Partitioner.Type petsc4py.PETSc.PartitionerType-class.html petsc4py.PETSc.Partitioner.setType petsc4py.PETSc.Partitioner-class.html#setType petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Partitioner.__new__ petsc4py.PETSc.Partitioner-class.html#__new__ petsc4py.PETSc.Partitioner.create petsc4py.PETSc.Partitioner-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Partitioner.destroy petsc4py.PETSc.Partitioner-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Partitioner.setUp petsc4py.PETSc.Partitioner-class.html#setUp petsc4py.PETSc.Partitioner.getType petsc4py.PETSc.Partitioner-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Partitioner.setFromOptions petsc4py.PETSc.Partitioner-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Partitioner.reset petsc4py.PETSc.Partitioner-class.html#reset petsc4py.PETSc.Partitioner.setShellPartition petsc4py.PETSc.Partitioner-class.html#setShellPartition petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Partitioner.view petsc4py.PETSc.Partitioner-class.html#view petsc4py.PETSc.PartitionerType petsc4py.PETSc.PartitionerType-class.html petsc4py.PETSc.PartitionerType.CHACO petsc4py.PETSc.PartitionerType-class.html#CHACO petsc4py.PETSc.PartitionerType.MATPARTITIONING petsc4py.PETSc.PartitionerType-class.html#MATPARTITIONING petsc4py.PETSc.PartitionerType.SIMPLE petsc4py.PETSc.PartitionerType-class.html#SIMPLE petsc4py.PETSc.PartitionerType.SHELL petsc4py.PETSc.PartitionerType-class.html#SHELL petsc4py.PETSc.PartitionerType.PARMETIS petsc4py.PETSc.PartitionerType-class.html#PARMETIS petsc4py.PETSc.PartitionerType.PTSCOTCH petsc4py.PETSc.PartitionerType-class.html#PTSCOTCH petsc4py.PETSc.PartitionerType.GATHER petsc4py.PETSc.PartitionerType-class.html#GATHER petsc4py.PETSc.PartitionerType.__qualname__ petsc4py.PETSc.PartitionerType-class.html#__qualname__ petsc4py.PETSc.Quad petsc4py.PETSc.Quad-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Quad.__new__ petsc4py.PETSc.Quad-class.html#__new__ petsc4py.PETSc.Quad.create petsc4py.PETSc.Quad-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Quad.destroy petsc4py.PETSc.Quad-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.getType petsc4py.PETSc.Object-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.view petsc4py.PETSc.Object-class.html#view petsc4py.PETSc.Random petsc4py.PETSc.Random-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Random.getSeed petsc4py.PETSc.Random-class.html#getSeed petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Random.getValueReal petsc4py.PETSc.Random-class.html#getValueReal petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Random.Type petsc4py.PETSc.Random.Type-class.html petsc4py.PETSc.Random.setType petsc4py.PETSc.Random-class.html#setType petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Random.__new__ petsc4py.PETSc.Random-class.html#__new__ petsc4py.PETSc.Random.create petsc4py.PETSc.Random-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Random.__call__ petsc4py.PETSc.Random-class.html#__call__ petsc4py.PETSc.Random.destroy petsc4py.PETSc.Random-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Random.getInterval petsc4py.PETSc.Random-class.html#getInterval petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Random.setInterval petsc4py.PETSc.Random-class.html#setInterval petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Random.getType petsc4py.PETSc.Random-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Random.setFromOptions petsc4py.PETSc.Random-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Random.interval petsc4py.PETSc.Random-class.html#interval petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Random.getValue petsc4py.PETSc.Random-class.html#getValue petsc4py.PETSc.Random.setSeed petsc4py.PETSc.Random-class.html#setSeed petsc4py.PETSc.Random.seed petsc4py.PETSc.Random-class.html#seed petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Random.view petsc4py.PETSc.Random-class.html#view petsc4py.PETSc.Random.Type petsc4py.PETSc.Random.Type-class.html petsc4py.PETSc.Random.Type.RANDER48 petsc4py.PETSc.Random.Type-class.html#RANDER48 petsc4py.PETSc.Random.Type.RAND petsc4py.PETSc.Random.Type-class.html#RAND petsc4py.PETSc.Random.Type.RANDOM123 petsc4py.PETSc.Random.Type-class.html#RANDOM123 petsc4py.PETSc.Random.Type.RAND48 petsc4py.PETSc.Random.Type-class.html#RAND48 petsc4py.PETSc.Random.Type.__qualname__ petsc4py.PETSc.Random.Type-class.html#__qualname__ petsc4py.PETSc.Random.Type.SPRNG petsc4py.PETSc.Random.Type-class.html#SPRNG petsc4py.PETSc.SF petsc4py.PETSc.SF-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.SF.gatherBegin petsc4py.PETSc.SF-class.html#gatherBegin petsc4py.PETSc.SF.setGraph petsc4py.PETSc.SF-class.html#setGraph petsc4py.PETSc.SF.createInverse petsc4py.PETSc.SF-class.html#createInverse petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.SF.scatterBegin petsc4py.PETSc.SF-class.html#scatterBegin petsc4py.PETSc.SF.reduceEnd petsc4py.PETSc.SF-class.html#reduceEnd petsc4py.PETSc.SF.createEmbeddedRootSF petsc4py.PETSc.SF-class.html#createEmbeddedRootSF petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.SF.gatherEnd petsc4py.PETSc.SF-class.html#gatherEnd petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.SF.Type petsc4py.PETSc.SF.Type-class.html petsc4py.PETSc.SF.fetchAndOpBegin petsc4py.PETSc.SF-class.html#fetchAndOpBegin petsc4py.PETSc.SF.setType petsc4py.PETSc.SF-class.html#setType petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.SF.scatterEnd petsc4py.PETSc.SF-class.html#scatterEnd petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.SF.__new__ petsc4py.PETSc.SF-class.html#__new__ petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.SF.bcastBegin petsc4py.PETSc.SF-class.html#bcastBegin petsc4py.PETSc.SF.create petsc4py.PETSc.SF-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.SF.createEmbeddedLeafSF petsc4py.PETSc.SF-class.html#createEmbeddedLeafSF petsc4py.PETSc.SF.destroy petsc4py.PETSc.SF-class.html#destroy petsc4py.PETSc.SF.reduceBegin petsc4py.PETSc.SF-class.html#reduceBegin petsc4py.PETSc.SF.getMulti petsc4py.PETSc.SF-class.html#getMulti petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.SF.setUp petsc4py.PETSc.SF-class.html#setUp petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.SF.getGraph petsc4py.PETSc.SF-class.html#getGraph petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.SF.computeDegree petsc4py.PETSc.SF-class.html#computeDegree petsc4py.PETSc.SF.getType petsc4py.PETSc.SF-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.SF.setFromOptions petsc4py.PETSc.SF-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.SF.bcastEnd petsc4py.PETSc.SF-class.html#bcastEnd petsc4py.PETSc.SF.reset petsc4py.PETSc.SF-class.html#reset petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.SF.setRankOrder petsc4py.PETSc.SF-class.html#setRankOrder petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.SF.fetchAndOpEnd petsc4py.PETSc.SF-class.html#fetchAndOpEnd petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.SF.view petsc4py.PETSc.SF-class.html#view petsc4py.PETSc.SF.Type petsc4py.PETSc.SF.Type-class.html petsc4py.PETSc.SF.Type.BASIC petsc4py.PETSc.SF.Type-class.html#BASIC petsc4py.PETSc.SF.Type.ALLTOALL petsc4py.PETSc.SF.Type-class.html#ALLTOALL petsc4py.PETSc.SF.Type.ALLGATHER petsc4py.PETSc.SF.Type-class.html#ALLGATHER petsc4py.PETSc.SF.Type.NEIGHBOR petsc4py.PETSc.SF.Type-class.html#NEIGHBOR petsc4py.PETSc.SF.Type.GATHERV petsc4py.PETSc.SF.Type-class.html#GATHERV petsc4py.PETSc.SF.Type.GATHER petsc4py.PETSc.SF.Type-class.html#GATHER petsc4py.PETSc.SF.Type.ALLGATHERV petsc4py.PETSc.SF.Type-class.html#ALLGATHERV petsc4py.PETSc.SF.Type.__qualname__ petsc4py.PETSc.SF.Type-class.html#__qualname__ petsc4py.PETSc.SF.Type.WINDOW petsc4py.PETSc.SF.Type-class.html#WINDOW petsc4py.PETSc.SNES petsc4py.PETSc.SNES-class.html petsc4py.PETSc.SNES.setFASLevels petsc4py.PETSc.SNES-class.html#setFASLevels petsc4py.PETSc.SNES.setDM petsc4py.PETSc.SNES-class.html#setDM petsc4py.PETSc.SNES.setTolerances petsc4py.PETSc.SNES-class.html#setTolerances petsc4py.PETSc.SNES.getConvergenceHistory petsc4py.PETSc.SNES-class.html#getConvergenceHistory petsc4py.PETSc.SNES.cancelMonitor petsc4py.PETSc.SNES-class.html#cancelMonitor petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.SNES.max_it petsc4py.PETSc.SNES-class.html#max_it petsc4py.PETSc.SNES.computeNGS petsc4py.PETSc.SNES-class.html#computeNGS petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.SNES.setUseFD petsc4py.PETSc.SNES-class.html#setUseFD petsc4py.PETSc.SNES.getObjective petsc4py.PETSc.SNES-class.html#getObjective petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.SNES.its petsc4py.PETSc.SNES-class.html#its petsc4py.PETSc.SNES.getFASCycleSNES petsc4py.PETSc.SNES-class.html#getFASCycleSNES petsc4py.PETSc.SNES.setUpdate petsc4py.PETSc.SNES-class.html#setUpdate petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.SNES.monitor petsc4py.PETSc.SNES-class.html#monitor petsc4py.PETSc.SNES.setPatchComputeFunction petsc4py.PETSc.SNES-class.html#setPatchComputeFunction petsc4py.PETSc.SNES.getMaxKSPFailures petsc4py.PETSc.SNES-class.html#getMaxKSPFailures petsc4py.PETSc.SNES.setMonitor petsc4py.PETSc.SNES-class.html#setMonitor petsc4py.PETSc.SNES.rtol petsc4py.PETSc.SNES-class.html#rtol petsc4py.PETSc.SNES.getConvergedReason petsc4py.PETSc.SNES-class.html#getConvergedReason petsc4py.PETSc.SNES.norm petsc4py.PETSc.SNES-class.html#norm petsc4py.PETSc.SNES.getCompositeSNES petsc4py.PETSc.SNES-class.html#getCompositeSNES petsc4py.PETSc.SNES.dm petsc4py.PETSc.SNES-class.html#dm petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.SNES.NormSchedule petsc4py.PETSc.SNES.NormSchedule-class.html petsc4py.PETSc.SNES.setOptionsPrefix petsc4py.PETSc.SNES-class.html#setOptionsPrefix petsc4py.PETSc.SNES.callConvergenceTest petsc4py.PETSc.SNES-class.html#callConvergenceTest petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.SNES.getMaxStepFailures petsc4py.PETSc.SNES-class.html#getMaxStepFailures petsc4py.PETSc.SNES.getLinearSolveIterations petsc4py.PETSc.SNES-class.html#getLinearSolveIterations petsc4py.PETSc.SNES.stol petsc4py.PETSc.SNES-class.html#stol petsc4py.PETSc.SNES.setFromOptions petsc4py.PETSc.SNES-class.html#setFromOptions petsc4py.PETSc.SNES.getNGS petsc4py.PETSc.SNES-class.html#getNGS petsc4py.PETSc.SNES.destroy petsc4py.PETSc.SNES-class.html#destroy petsc4py.PETSc.SNES.setMaxNonlinearStepFailures petsc4py.PETSc.SNES-class.html#setMaxNonlinearStepFailures petsc4py.PETSc.SNES.getSolutionUpdate petsc4py.PETSc.SNES-class.html#getSolutionUpdate petsc4py.PETSc.SNES.getNASMSNES petsc4py.PETSc.SNES-class.html#getNASMSNES petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.SNES.setAppCtx petsc4py.PETSc.SNES-class.html#setAppCtx petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.SNES.use_mf petsc4py.PETSc.SNES-class.html#use_mf petsc4py.PETSc.SNES.setConvergenceHistory petsc4py.PETSc.SNES-class.html#setConvergenceHistory petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.SNES.getFASSmoother petsc4py.PETSc.SNES-class.html#getFASSmoother petsc4py.PETSc.SNES.setPatchComputeOperator petsc4py.PETSc.SNES-class.html#setPatchComputeOperator petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.SNES.setMaxFunctionEvaluations petsc4py.PETSc.SNES-class.html#setMaxFunctionEvaluations petsc4py.PETSc.SNES.setFASInterpolation petsc4py.PETSc.SNES-class.html#setFASInterpolation petsc4py.PETSc.SNES.getFunctionNorm petsc4py.PETSc.SNES-class.html#getFunctionNorm petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.SNES.ConvergedReason petsc4py.PETSc.SNES.ConvergedReason-class.html petsc4py.PETSc.SNES.setJacobian petsc4py.PETSc.SNES-class.html#setJacobian petsc4py.PETSc.SNES.setFASRScale petsc4py.PETSc.SNES-class.html#setFASRScale petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.SNES.getStepFailures petsc4py.PETSc.SNES-class.html#getStepFailures petsc4py.PETSc.SNES.setMaxKSPFailures petsc4py.PETSc.SNES-class.html#setMaxKSPFailures petsc4py.PETSc.SNES.Type petsc4py.PETSc.SNES.Type-class.html petsc4py.PETSc.SNES.setObjective petsc4py.PETSc.SNES-class.html#setObjective petsc4py.PETSc.SNES.setPatchCellNumbering petsc4py.PETSc.SNES-class.html#setPatchCellNumbering petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.SNES.iterating petsc4py.PETSc.SNES-class.html#iterating petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.SNES.getFASInterpolation petsc4py.PETSc.SNES-class.html#getFASInterpolation petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.SNES.setParamsEW petsc4py.PETSc.SNES-class.html#setParamsEW petsc4py.PETSc.SNES.getFASInjection petsc4py.PETSc.SNES-class.html#getFASInjection petsc4py.PETSc.SNES.computeJacobian petsc4py.PETSc.SNES-class.html#computeJacobian petsc4py.PETSc.SNES.setUp petsc4py.PETSc.SNES-class.html#setUp petsc4py.PETSc.SNES.setUseEW petsc4py.PETSc.SNES-class.html#setUseEW petsc4py.PETSc.SNES.setSolution petsc4py.PETSc.SNES-class.html#setSolution petsc4py.PETSc.SNES.getTolerances petsc4py.PETSc.SNES-class.html#getTolerances petsc4py.PETSc.SNES.getDM petsc4py.PETSc.SNES-class.html#getDM petsc4py.PETSc.SNES.setFASRestriction petsc4py.PETSc.SNES-class.html#setFASRestriction petsc4py.PETSc.SNES.reason petsc4py.PETSc.SNES-class.html#reason petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.SNES.createPython petsc4py.PETSc.SNES-class.html#createPython petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.SNES.ksp petsc4py.PETSc.SNES-class.html#ksp petsc4py.PETSc.SNES.computeFunction petsc4py.PETSc.SNES-class.html#computeFunction petsc4py.PETSc.SNES.setUseMF petsc4py.PETSc.SNES-class.html#setUseMF petsc4py.PETSc.SNES.getFunction petsc4py.PETSc.SNES-class.html#getFunction petsc4py.PETSc.SNES.appctx petsc4py.PETSc.SNES-class.html#appctx petsc4py.PETSc.SNES.setNPC petsc4py.PETSc.SNES-class.html#setNPC petsc4py.PETSc.SNES.getConvergenceTest petsc4py.PETSc.SNES-class.html#getConvergenceTest petsc4py.PETSc.SNES.getFASLevels petsc4py.PETSc.SNES-class.html#getFASLevels petsc4py.PETSc.SNES.setIterationNumber petsc4py.PETSc.SNES-class.html#setIterationNumber petsc4py.PETSc.SNES.view petsc4py.PETSc.SNES-class.html#view petsc4py.PETSc.SNES.vec_rhs petsc4py.PETSc.SNES-class.html#vec_rhs petsc4py.PETSc.SNES.getPythonContext petsc4py.PETSc.SNES-class.html#getPythonContext petsc4py.PETSc.SNES.getMaxFunctionEvaluations petsc4py.PETSc.SNES-class.html#getMaxFunctionEvaluations petsc4py.PETSc.SNES.setNGS petsc4py.PETSc.SNES-class.html#setNGS petsc4py.PETSc.SNES.setMaxStepFailures petsc4py.PETSc.SNES-class.html#setMaxStepFailures petsc4py.PETSc.SNES.getJacobian petsc4py.PETSc.SNES-class.html#getJacobian petsc4py.PETSc.SNES.getFunctionEvaluations petsc4py.PETSc.SNES-class.html#getFunctionEvaluations petsc4py.PETSc.SNES.setInitialGuess petsc4py.PETSc.SNES-class.html#setInitialGuess petsc4py.PETSc.SNES.setLineSearchPreCheck petsc4py.PETSc.SNES-class.html#setLineSearchPreCheck petsc4py.PETSc.SNES.setType petsc4py.PETSc.SNES-class.html#setType petsc4py.PETSc.SNES.setFunction petsc4py.PETSc.SNES-class.html#setFunction petsc4py.PETSc.SNES.getFASRestriction petsc4py.PETSc.SNES-class.html#getFASRestriction petsc4py.PETSc.SNES.getUpdate petsc4py.PETSc.SNES-class.html#getUpdate petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.SNES.create petsc4py.PETSc.SNES-class.html#create petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.SNES.getParamsEW petsc4py.PETSc.SNES-class.html#getParamsEW petsc4py.PETSc.SNES.setMaxLinearSolveFailures petsc4py.PETSc.SNES-class.html#setMaxLinearSolveFailures petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.SNES.getFASSmootherUp petsc4py.PETSc.SNES-class.html#getFASSmootherUp petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.SNES.getInitialGuess petsc4py.PETSc.SNES-class.html#getInitialGuess petsc4py.PETSc.SNES.getType petsc4py.PETSc.SNES-class.html#getType petsc4py.PETSc.SNES.getMonitor petsc4py.PETSc.SNES-class.html#getMonitor petsc4py.PETSc.SNES.getAppCtx petsc4py.PETSc.SNES-class.html#getAppCtx petsc4py.PETSc.SNES.hasNPC petsc4py.PETSc.SNES-class.html#hasNPC petsc4py.PETSc.SNES.atol petsc4py.PETSc.SNES-class.html#atol petsc4py.PETSc.SNES.getFASSmootherDown petsc4py.PETSc.SNES-class.html#getFASSmootherDown petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.SNES.setFunctionNorm petsc4py.PETSc.SNES-class.html#setFunctionNorm petsc4py.PETSc.SNES.reset petsc4py.PETSc.SNES-class.html#reset petsc4py.PETSc.SNES.getRhs petsc4py.PETSc.SNES-class.html#getRhs petsc4py.PETSc.SNES.setVariableBounds petsc4py.PETSc.SNES-class.html#setVariableBounds petsc4py.PETSc.SNES.max_funcs petsc4py.PETSc.SNES-class.html#max_funcs petsc4py.PETSc.SNES.computeObjective petsc4py.PETSc.SNES-class.html#computeObjective petsc4py.PETSc.SNES.setConvergenceTest petsc4py.PETSc.SNES-class.html#setConvergenceTest petsc4py.PETSc.SNES.setPatchDiscretisationInfo petsc4py.PETSc.SNES-class.html#setPatchDiscretisationInfo petsc4py.PETSc.SNES.getIterationNumber petsc4py.PETSc.SNES-class.html#getIterationNumber petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.SNES.history petsc4py.PETSc.SNES-class.html#history petsc4py.PETSc.SNES.setKSP petsc4py.PETSc.SNES-class.html#setKSP petsc4py.PETSc.SNES.use_ew petsc4py.PETSc.SNES-class.html#use_ew petsc4py.PETSc.SNES.getVIInactiveSet petsc4py.PETSc.SNES-class.html#getVIInactiveSet petsc4py.PETSc.SNES.vec_sol petsc4py.PETSc.SNES-class.html#vec_sol petsc4py.PETSc.SNES.setConvergedReason petsc4py.PETSc.SNES-class.html#setConvergedReason petsc4py.PETSc.SNES.getCompositeNumber petsc4py.PETSc.SNES-class.html#getCompositeNumber petsc4py.PETSc.SNES.getSolution petsc4py.PETSc.SNES-class.html#getSolution petsc4py.PETSc.SNES.diverged petsc4py.PETSc.SNES-class.html#diverged petsc4py.PETSc.SNES.getOptionsPrefix petsc4py.PETSc.SNES-class.html#getOptionsPrefix petsc4py.PETSc.SNES.getNonlinearStepFailures petsc4py.PETSc.SNES-class.html#getNonlinearStepFailures petsc4py.PETSc.SNES.__new__ petsc4py.PETSc.SNES-class.html#__new__ petsc4py.PETSc.SNES.logConvergenceHistory petsc4py.PETSc.SNES-class.html#logConvergenceHistory petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.SNES.getUseMF petsc4py.PETSc.SNES-class.html#getUseMF petsc4py.PETSc.SNES.converged petsc4py.PETSc.SNES-class.html#converged petsc4py.PETSc.SNES.getUseEW petsc4py.PETSc.SNES-class.html#getUseEW petsc4py.PETSc.SNES.setPatchConstructType petsc4py.PETSc.SNES-class.html#setPatchConstructType petsc4py.PETSc.SNES.vec_upd petsc4py.PETSc.SNES-class.html#vec_upd petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.SNES.getFASCoarseSolve petsc4py.PETSc.SNES-class.html#getFASCoarseSolve petsc4py.PETSc.SNES.getKSP petsc4py.PETSc.SNES-class.html#getKSP petsc4py.PETSc.SNES.setNormSchedule petsc4py.PETSc.SNES-class.html#setNormSchedule petsc4py.PETSc.SNES.getNPC petsc4py.PETSc.SNES-class.html#getNPC petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.SNES.getNormSchedule petsc4py.PETSc.SNES-class.html#getNormSchedule petsc4py.PETSc.SNES.npc petsc4py.PETSc.SNES-class.html#npc petsc4py.PETSc.SNES.getNASMNumber petsc4py.PETSc.SNES-class.html#getNASMNumber petsc4py.PETSc.SNES.setFASInjection petsc4py.PETSc.SNES-class.html#setFASInjection petsc4py.PETSc.SNES.getLinearSolveFailures petsc4py.PETSc.SNES-class.html#getLinearSolveFailures petsc4py.PETSc.SNES.getKSPFailures petsc4py.PETSc.SNES-class.html#getKSPFailures petsc4py.PETSc.SNES.setPythonType petsc4py.PETSc.SNES-class.html#setPythonType petsc4py.PETSc.SNES.getMaxLinearSolveFailures petsc4py.PETSc.SNES-class.html#getMaxLinearSolveFailures petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.SNES.getUseFD petsc4py.PETSc.SNES-class.html#getUseFD petsc4py.PETSc.SNES.setResetCounters petsc4py.PETSc.SNES-class.html#setResetCounters petsc4py.PETSc.SNES.solve petsc4py.PETSc.SNES-class.html#solve petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.SNES.setPythonContext petsc4py.PETSc.SNES-class.html#setPythonContext petsc4py.PETSc.SNES.getMaxNonlinearStepFailures petsc4py.PETSc.SNES-class.html#getMaxNonlinearStepFailures petsc4py.PETSc.SNES.use_fd petsc4py.PETSc.SNES-class.html#use_fd petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.SNES.ConvergedReason petsc4py.PETSc.SNES.ConvergedReason-class.html petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_JACOBIAN_DOMAIN petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_JACOBIAN_DOMAIN petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_MAX_IT petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_MAX_IT petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_FNORM_NAN petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_FNORM_NAN petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_INNER petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_INNER petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_LINE_SEARCH petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_LINE_SEARCH petsc4py.PETSc.SNES.ConvergedReason.CONVERGED_FNORM_ABS petsc4py.PETSc.SNES.ConvergedReason-class.html#CONVERGED_FNORM_ABS petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_TR_DELTA petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_TR_DELTA petsc4py.PETSc.SNES.ConvergedReason.ITERATING petsc4py.PETSc.SNES.ConvergedReason-class.html#ITERATING petsc4py.PETSc.SNES.ConvergedReason.CONVERGED_ITS petsc4py.PETSc.SNES.ConvergedReason-class.html#CONVERGED_ITS petsc4py.PETSc.SNES.ConvergedReason.CONVERGED_SNORM_RELATIVE petsc4py.PETSc.SNES.ConvergedReason-class.html#CONVERGED_SNORM_RELATIVE petsc4py.PETSc.SNES.ConvergedReason.CONVERGED_FNORM_RELATIVE petsc4py.PETSc.SNES.ConvergedReason-class.html#CONVERGED_FNORM_RELATIVE petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_LOCAL_MIN petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_LOCAL_MIN petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_DTOL petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_DTOL petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_FUNCTION_COUNT petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_FUNCTION_COUNT petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_FUNCTION_DOMAIN petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_FUNCTION_DOMAIN petsc4py.PETSc.SNES.ConvergedReason.__qualname__ petsc4py.PETSc.SNES.ConvergedReason-class.html#__qualname__ petsc4py.PETSc.SNES.ConvergedReason.CONVERGED_ITERATING petsc4py.PETSc.SNES.ConvergedReason-class.html#CONVERGED_ITERATING petsc4py.PETSc.SNES.ConvergedReason.DIVERGED_LINEAR_SOLVE petsc4py.PETSc.SNES.ConvergedReason-class.html#DIVERGED_LINEAR_SOLVE petsc4py.PETSc.SNES.NormSchedule petsc4py.PETSc.SNES.NormSchedule-class.html petsc4py.PETSc.SNES.NormSchedule.NORM_INITIAL_FINAL_ONLY petsc4py.PETSc.SNES.NormSchedule-class.html#NORM_INITIAL_FINAL_ONLY petsc4py.PETSc.SNES.NormSchedule.DEFAULT petsc4py.PETSc.SNES.NormSchedule-class.html#DEFAULT petsc4py.PETSc.SNES.NormSchedule.NORM_NONE petsc4py.PETSc.SNES.NormSchedule-class.html#NORM_NONE petsc4py.PETSc.SNES.NormSchedule.NONE petsc4py.PETSc.SNES.NormSchedule-class.html#NONE petsc4py.PETSc.SNES.NormSchedule.INITIAL_ONLY petsc4py.PETSc.SNES.NormSchedule-class.html#INITIAL_ONLY petsc4py.PETSc.SNES.NormSchedule.FINAL_ONLY petsc4py.PETSc.SNES.NormSchedule-class.html#FINAL_ONLY petsc4py.PETSc.SNES.NormSchedule.NORM_INITIAL_ONLY petsc4py.PETSc.SNES.NormSchedule-class.html#NORM_INITIAL_ONLY petsc4py.PETSc.SNES.NormSchedule.NORM_DEFAULT petsc4py.PETSc.SNES.NormSchedule-class.html#NORM_DEFAULT petsc4py.PETSc.SNES.NormSchedule.INITIAL_FINAL_ONLY petsc4py.PETSc.SNES.NormSchedule-class.html#INITIAL_FINAL_ONLY petsc4py.PETSc.SNES.NormSchedule.ALWAYS petsc4py.PETSc.SNES.NormSchedule-class.html#ALWAYS petsc4py.PETSc.SNES.NormSchedule.NORM_ALWAYS petsc4py.PETSc.SNES.NormSchedule-class.html#NORM_ALWAYS petsc4py.PETSc.SNES.NormSchedule.__qualname__ petsc4py.PETSc.SNES.NormSchedule-class.html#__qualname__ petsc4py.PETSc.SNES.NormSchedule.NORM_FINAL_ONLY petsc4py.PETSc.SNES.NormSchedule-class.html#NORM_FINAL_ONLY petsc4py.PETSc.SNES.Type petsc4py.PETSc.SNES.Type-class.html petsc4py.PETSc.SNES.Type.NEWTONTR petsc4py.PETSc.SNES.Type-class.html#NEWTONTR petsc4py.PETSc.SNES.Type.PYTHON petsc4py.PETSc.SNES.Type-class.html#PYTHON petsc4py.PETSc.SNES.Type.PATCH petsc4py.PETSc.SNES.Type-class.html#PATCH petsc4py.PETSc.SNES.Type.NASM petsc4py.PETSc.SNES.Type-class.html#NASM petsc4py.PETSc.SNES.Type.NGS petsc4py.PETSc.SNES.Type-class.html#NGS petsc4py.PETSc.SNES.Type.NEWTONLS petsc4py.PETSc.SNES.Type-class.html#NEWTONLS petsc4py.PETSc.SNES.Type.ASPIN petsc4py.PETSc.SNES.Type-class.html#ASPIN petsc4py.PETSc.SNES.Type.SHELL petsc4py.PETSc.SNES.Type-class.html#SHELL petsc4py.PETSc.SNES.Type.FAS petsc4py.PETSc.SNES.Type-class.html#FAS petsc4py.PETSc.SNES.Type.ANDERSON petsc4py.PETSc.SNES.Type-class.html#ANDERSON petsc4py.PETSc.SNES.Type.NRICHARDSON petsc4py.PETSc.SNES.Type-class.html#NRICHARDSON petsc4py.PETSc.SNES.Type.VINEWTONRSLS petsc4py.PETSc.SNES.Type-class.html#VINEWTONRSLS petsc4py.PETSc.SNES.Type.MS petsc4py.PETSc.SNES.Type-class.html#MS petsc4py.PETSc.SNES.Type.KSPONLY petsc4py.PETSc.SNES.Type-class.html#KSPONLY petsc4py.PETSc.SNES.Type.VINEWTONSSLS petsc4py.PETSc.SNES.Type-class.html#VINEWTONSSLS petsc4py.PETSc.SNES.Type.COMPOSITE petsc4py.PETSc.SNES.Type-class.html#COMPOSITE petsc4py.PETSc.SNES.Type.__qualname__ petsc4py.PETSc.SNES.Type-class.html#__qualname__ petsc4py.PETSc.SNES.Type.KSPTRANSPOSEONLY petsc4py.PETSc.SNES.Type-class.html#KSPTRANSPOSEONLY petsc4py.PETSc.SNES.Type.NGMRES petsc4py.PETSc.SNES.Type-class.html#NGMRES petsc4py.PETSc.SNES.Type.NCG petsc4py.PETSc.SNES.Type-class.html#NCG petsc4py.PETSc.SNES.Type.QN petsc4py.PETSc.SNES.Type-class.html#QN petsc4py.PETSc.Scatter petsc4py.PETSc.Scatter-class.html petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Scatter.toAll petsc4py.PETSc.Scatter-class.html#toAll petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Scatter.toZero petsc4py.PETSc.Scatter-class.html#toZero petsc4py.PETSc.Scatter.scatterBegin petsc4py.PETSc.Scatter-class.html#scatterBegin petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Scatter.Type petsc4py.PETSc.Scatter.Type-class.html petsc4py.PETSc.Scatter.setType petsc4py.PETSc.Scatter-class.html#setType petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Scatter.scatterEnd petsc4py.PETSc.Scatter-class.html#scatterEnd petsc4py.PETSc.Scatter.end petsc4py.PETSc.Scatter-class.html#end petsc4py.PETSc.Scatter.__new__ petsc4py.PETSc.Scatter-class.html#__new__ petsc4py.PETSc.Scatter.create petsc4py.PETSc.Scatter-class.html#create petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Scatter.__call__ petsc4py.PETSc.Scatter-class.html#__call__ petsc4py.PETSc.Scatter.destroy petsc4py.PETSc.Scatter-class.html#destroy petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Scatter.begin petsc4py.PETSc.Scatter-class.html#begin petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Scatter.setUp petsc4py.PETSc.Scatter-class.html#setUp petsc4py.PETSc.Scatter.getType petsc4py.PETSc.Scatter-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Scatter.setFromOptions petsc4py.PETSc.Scatter-class.html#setFromOptions petsc4py.PETSc.Scatter.Mode petsc4py.PETSc.ScatterMode-class.html petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Scatter.copy petsc4py.PETSc.Scatter-class.html#copy petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Scatter.scatter petsc4py.PETSc.Scatter-class.html#scatter petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Scatter.view petsc4py.PETSc.Scatter-class.html#view petsc4py.PETSc.Scatter.Type petsc4py.PETSc.Scatter.Type-class.html petsc4py.PETSc.Scatter.Type.BASIC petsc4py.PETSc.Scatter.Type-class.html#BASIC petsc4py.PETSc.Scatter.Type.ALLTOALL petsc4py.PETSc.Scatter.Type-class.html#ALLTOALL petsc4py.PETSc.Scatter.Type.ALLGATHER petsc4py.PETSc.Scatter.Type-class.html#ALLGATHER petsc4py.PETSc.Scatter.Type.NEIGHBOR petsc4py.PETSc.Scatter.Type-class.html#NEIGHBOR petsc4py.PETSc.Scatter.Type.GATHERV petsc4py.PETSc.Scatter.Type-class.html#GATHERV petsc4py.PETSc.Scatter.Type.GATHER petsc4py.PETSc.Scatter.Type-class.html#GATHER petsc4py.PETSc.Scatter.Type.ALLGATHERV petsc4py.PETSc.Scatter.Type-class.html#ALLGATHERV petsc4py.PETSc.Scatter.Type.__qualname__ petsc4py.PETSc.Scatter.Type-class.html#__qualname__ petsc4py.PETSc.Scatter.Type.WINDOW petsc4py.PETSc.Scatter.Type-class.html#WINDOW petsc4py.PETSc.ScatterMode petsc4py.PETSc.ScatterMode-class.html petsc4py.PETSc.ScatterMode.REVERSE petsc4py.PETSc.ScatterMode-class.html#REVERSE petsc4py.PETSc.ScatterMode.SCATTER_FORWARD petsc4py.PETSc.ScatterMode-class.html#SCATTER_FORWARD petsc4py.PETSc.ScatterMode.REVERSE_LOCAL petsc4py.PETSc.ScatterMode-class.html#REVERSE_LOCAL petsc4py.PETSc.ScatterMode.SCATTER_LOCAL petsc4py.PETSc.ScatterMode-class.html#SCATTER_LOCAL petsc4py.PETSc.ScatterMode.SCATTER_FORWARD_LOCAL petsc4py.PETSc.ScatterMode-class.html#SCATTER_FORWARD_LOCAL petsc4py.PETSc.ScatterMode.SCATTER_REVERSE petsc4py.PETSc.ScatterMode-class.html#SCATTER_REVERSE petsc4py.PETSc.ScatterMode.SCATTER_REVERSE_LOCAL petsc4py.PETSc.ScatterMode-class.html#SCATTER_REVERSE_LOCAL petsc4py.PETSc.ScatterMode.FORWARD petsc4py.PETSc.ScatterMode-class.html#FORWARD petsc4py.PETSc.ScatterMode.__qualname__ petsc4py.PETSc.ScatterMode-class.html#__qualname__ petsc4py.PETSc.ScatterMode.FORWARD_LOCAL petsc4py.PETSc.ScatterMode-class.html#FORWARD_LOCAL petsc4py.PETSc.Section petsc4py.PETSc.Section-class.html petsc4py.PETSc.Section.setFieldConstraintIndices petsc4py.PETSc.Section-class.html#setFieldConstraintIndices petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Section.getChart petsc4py.PETSc.Section-class.html#getChart petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Section.addConstraintDof petsc4py.PETSc.Section-class.html#addConstraintDof petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Section.getConstraintIndices petsc4py.PETSc.Section-class.html#getConstraintIndices petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Section.setOffset petsc4py.PETSc.Section-class.html#setOffset petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Section.setNumFields petsc4py.PETSc.Section-class.html#setNumFields petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Section.setConstraintDof petsc4py.PETSc.Section-class.html#setConstraintDof petsc4py.PETSc.Section.addDof petsc4py.PETSc.Section-class.html#addDof petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Section.getFieldComponents petsc4py.PETSc.Section-class.html#getFieldComponents petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Section.view petsc4py.PETSc.Section-class.html#view petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Section.setFieldComponents petsc4py.PETSc.Section-class.html#setFieldComponents petsc4py.PETSc.Section.setChart petsc4py.PETSc.Section-class.html#setChart petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Section.setConstraintIndices petsc4py.PETSc.Section-class.html#setConstraintIndices petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Section.getDof petsc4py.PETSc.Section-class.html#getDof petsc4py.PETSc.Section.setUp petsc4py.PETSc.Section-class.html#setUp petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Section.createGlobalSection petsc4py.PETSc.Section-class.html#createGlobalSection petsc4py.PETSc.Section.setFieldName petsc4py.PETSc.Section-class.html#setFieldName petsc4py.PETSc.Section.setFieldConstraintDof petsc4py.PETSc.Section-class.html#setFieldConstraintDof petsc4py.PETSc.Section.addFieldConstraintDof petsc4py.PETSc.Section-class.html#addFieldConstraintDof petsc4py.PETSc.Section.getStorageSize petsc4py.PETSc.Section-class.html#getStorageSize petsc4py.PETSc.Section.getFieldConstraintIndices petsc4py.PETSc.Section-class.html#getFieldConstraintIndices petsc4py.PETSc.Section.getOffsetRange petsc4py.PETSc.Section-class.html#getOffsetRange petsc4py.PETSc.Section.create petsc4py.PETSc.Section-class.html#create petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Section.setDof petsc4py.PETSc.Section-class.html#setDof petsc4py.PETSc.Object.getType petsc4py.PETSc.Object-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Section.getFieldOffset petsc4py.PETSc.Section-class.html#getFieldOffset petsc4py.PETSc.Section.reset petsc4py.PETSc.Section-class.html#reset petsc4py.PETSc.Section.getOffset petsc4py.PETSc.Section-class.html#getOffset petsc4py.PETSc.Section.getFieldName petsc4py.PETSc.Section-class.html#getFieldName petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Section.__new__ petsc4py.PETSc.Section-class.html#__new__ petsc4py.PETSc.Section.getFieldConstraintDof petsc4py.PETSc.Section-class.html#getFieldConstraintDof petsc4py.PETSc.Section.getMaxDof petsc4py.PETSc.Section-class.html#getMaxDof petsc4py.PETSc.Section.setFieldOffset petsc4py.PETSc.Section-class.html#setFieldOffset petsc4py.PETSc.Section.setFieldDof petsc4py.PETSc.Section-class.html#setFieldDof petsc4py.PETSc.Section.destroy petsc4py.PETSc.Section-class.html#destroy petsc4py.PETSc.Section.getConstraintDof petsc4py.PETSc.Section-class.html#getConstraintDof petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Section.getConstrainedStorageSize petsc4py.PETSc.Section-class.html#getConstrainedStorageSize petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Section.clone petsc4py.PETSc.Section-class.html#clone petsc4py.PETSc.Section.getFieldDof petsc4py.PETSc.Section-class.html#getFieldDof petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Section.getNumFields petsc4py.PETSc.Section-class.html#getNumFields petsc4py.PETSc.Section.addFieldDof petsc4py.PETSc.Section-class.html#addFieldDof petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Sys petsc4py.PETSc.Sys-class.html petsc4py.PETSc.Sys.pushErrorHandler petsc4py.PETSc.Sys-class.html#pushErrorHandler petsc4py.PETSc.Sys.getDefaultComm petsc4py.PETSc.Sys-class.html#getDefaultComm petsc4py.PETSc.Sys.popSignalHandler petsc4py.PETSc.Sys-class.html#popSignalHandler petsc4py.PETSc.Sys.sleep petsc4py.PETSc.Sys-class.html#sleep petsc4py.PETSc.Sys.Print petsc4py.PETSc.Sys-class.html#Print petsc4py.PETSc.Sys.syncFlush petsc4py.PETSc.Sys-class.html#syncFlush petsc4py.PETSc.Sys.getVersion petsc4py.PETSc.Sys-class.html#getVersion petsc4py.PETSc.Sys.__new__ petsc4py.PETSc.Sys-class.html#__new__ petsc4py.PETSc.Sys.isFinalized petsc4py.PETSc.Sys-class.html#isFinalized petsc4py.PETSc.Sys.splitOwnership petsc4py.PETSc.Sys-class.html#splitOwnership petsc4py.PETSc.Sys.infoAllow petsc4py.PETSc.Sys-class.html#infoAllow petsc4py.PETSc.Sys.isInitialized petsc4py.PETSc.Sys-class.html#isInitialized petsc4py.PETSc.Sys.getVersionInfo petsc4py.PETSc.Sys-class.html#getVersionInfo petsc4py.PETSc.Sys.setDefaultComm petsc4py.PETSc.Sys-class.html#setDefaultComm petsc4py.PETSc.Sys.popErrorHandler petsc4py.PETSc.Sys-class.html#popErrorHandler petsc4py.PETSc.Sys.hasExternalPackage petsc4py.PETSc.Sys-class.html#hasExternalPackage petsc4py.PETSc.Sys.syncPrint petsc4py.PETSc.Sys-class.html#syncPrint petsc4py.PETSc.Sys.registerCitation petsc4py.PETSc.Sys-class.html#registerCitation petsc4py.PETSc.TAO petsc4py.PETSc.TAO-class.html petsc4py.PETSc.TAO.setBRGNRegularizerWeight petsc4py.PETSc.TAO-class.html#setBRGNRegularizerWeight petsc4py.PETSc.TAO.setMonitor petsc4py.PETSc.TAO-class.html#setMonitor petsc4py.PETSc.TAO.cancelMonitor petsc4py.PETSc.TAO-class.html#cancelMonitor petsc4py.PETSc.TAO.setGradient petsc4py.PETSc.TAO-class.html#setGradient petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.TAO.computeObjectiveGradient petsc4py.PETSc.TAO-class.html#computeObjectiveGradient petsc4py.PETSc.TAO.getBRGNDampingVector petsc4py.PETSc.TAO-class.html#getBRGNDampingVector petsc4py.PETSc.TAO.computeConstraints petsc4py.PETSc.TAO-class.html#computeConstraints petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.TAO.its petsc4py.PETSc.TAO-class.html#its petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.TAO.ksp petsc4py.PETSc.TAO-class.html#ksp petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.TAO.Reason petsc4py.PETSc.TAO.Reason-class.html petsc4py.PETSc.TAO.reason petsc4py.PETSc.TAO-class.html#reason petsc4py.PETSc.TAO.getConvergedReason petsc4py.PETSc.TAO-class.html#getConvergedReason petsc4py.PETSc.TAO.getGradientNorm petsc4py.PETSc.TAO-class.html#getGradientNorm petsc4py.PETSc.TAO.setConstraintTolerances petsc4py.PETSc.TAO-class.html#setConstraintTolerances petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.TAO.setOptionsPrefix petsc4py.PETSc.TAO-class.html#setOptionsPrefix petsc4py.PETSc.TAO.setBRGNSmoothL1Epsilon petsc4py.PETSc.TAO-class.html#setBRGNSmoothL1Epsilon petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.TAO.getObjectiveValue petsc4py.PETSc.TAO-class.html#getObjectiveValue petsc4py.PETSc.TAO.setType petsc4py.PETSc.TAO-class.html#setType petsc4py.PETSc.TAO.converged petsc4py.PETSc.TAO-class.html#converged petsc4py.PETSc.TAO.setFromOptions petsc4py.PETSc.TAO-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.TAO.setConstraints petsc4py.PETSc.TAO-class.html#setConstraints petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.TAO.setAppCtx petsc4py.PETSc.TAO-class.html#setAppCtx petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.TAO.solution petsc4py.PETSc.TAO-class.html#solution petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.TAO.view petsc4py.PETSc.TAO-class.html#view petsc4py.PETSc.TAO.ctol petsc4py.PETSc.TAO-class.html#ctol petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.TAO.setJacobian petsc4py.PETSc.TAO-class.html#setJacobian petsc4py.PETSc.TAO.setGradientNorm petsc4py.PETSc.TAO-class.html#setGradientNorm petsc4py.PETSc.TAO.Type petsc4py.PETSc.TAO.Type-class.html petsc4py.PETSc.TAO.setObjective petsc4py.PETSc.TAO-class.html#setObjective petsc4py.PETSc.TAO.iterating petsc4py.PETSc.TAO-class.html#iterating petsc4py.PETSc.TAO.getGradient petsc4py.PETSc.TAO-class.html#getGradient petsc4py.PETSc.TAO.gradient petsc4py.PETSc.TAO-class.html#gradient petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.TAO.ftol petsc4py.PETSc.TAO-class.html#ftol petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.TAO.computeJacobian petsc4py.PETSc.TAO-class.html#computeJacobian petsc4py.PETSc.TAO.setUp petsc4py.PETSc.TAO-class.html#setUp petsc4py.PETSc.TAO.getLMVMH0 petsc4py.PETSc.TAO-class.html#getLMVMH0 petsc4py.PETSc.TAO.getOptionsPrefix petsc4py.PETSc.TAO-class.html#getOptionsPrefix petsc4py.PETSc.TAO.setInitialTrustRegionRadius petsc4py.PETSc.TAO-class.html#setInitialTrustRegionRadius petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.TAO.setJacobianDesign petsc4py.PETSc.TAO-class.html#setJacobianDesign petsc4py.PETSc.TAO.appctx petsc4py.PETSc.TAO-class.html#appctx petsc4py.PETSc.TAO.getConvergenceTest petsc4py.PETSc.TAO-class.html#getConvergenceTest petsc4py.PETSc.TAO.gnorm petsc4py.PETSc.TAO-class.html#gnorm petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.TAO.setHessian petsc4py.PETSc.TAO-class.html#setHessian petsc4py.PETSc.TAO.getConstraintTolerances petsc4py.PETSc.TAO-class.html#getConstraintTolerances petsc4py.PETSc.TAO.setLMVMH0 petsc4py.PETSc.TAO-class.html#setLMVMH0 petsc4py.PETSc.TAO.setTolerances petsc4py.PETSc.TAO-class.html#setTolerances petsc4py.PETSc.TAO.setInitial petsc4py.PETSc.TAO-class.html#setInitial petsc4py.PETSc.TAO.getSolutionNorm petsc4py.PETSc.TAO-class.html#getSolutionNorm petsc4py.PETSc.TAO.setBRGNDictionaryMatrix petsc4py.PETSc.TAO-class.html#setBRGNDictionaryMatrix petsc4py.PETSc.TAO.getFunctionValue petsc4py.PETSc.TAO-class.html#getFunctionValue petsc4py.PETSc.TAO.getVariableBounds petsc4py.PETSc.TAO-class.html#getVariableBounds petsc4py.PETSc.TAO.create petsc4py.PETSc.TAO-class.html#create petsc4py.PETSc.TAO.setJacobianResidual petsc4py.PETSc.TAO-class.html#setJacobianResidual petsc4py.PETSc.TAO.setJacobianState petsc4py.PETSc.TAO-class.html#setJacobianState petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.TAO.function petsc4py.PETSc.TAO-class.html#function petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.TAO.setResidual petsc4py.PETSc.TAO-class.html#setResidual petsc4py.PETSc.TAO.getType petsc4py.PETSc.TAO-class.html#getType petsc4py.PETSc.TAO.getMonitor petsc4py.PETSc.TAO-class.html#getMonitor petsc4py.PETSc.TAO.computeDualVariables petsc4py.PETSc.TAO-class.html#computeDualVariables petsc4py.PETSc.TAO.getAppCtx petsc4py.PETSc.TAO-class.html#getAppCtx petsc4py.PETSc.TAO.computeVariableBounds petsc4py.PETSc.TAO-class.html#computeVariableBounds petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.TAO.computeHessian petsc4py.PETSc.TAO-class.html#computeHessian petsc4py.PETSc.TAO.getLMVMH0KSP petsc4py.PETSc.TAO-class.html#getLMVMH0KSP petsc4py.PETSc.TAO.setVariableBounds petsc4py.PETSc.TAO-class.html#setVariableBounds petsc4py.PETSc.TAO.computeResidual petsc4py.PETSc.TAO-class.html#computeResidual petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.TAO.computeObjective petsc4py.PETSc.TAO-class.html#computeObjective petsc4py.PETSc.TAO.setConvergenceTest petsc4py.PETSc.TAO-class.html#setConvergenceTest petsc4py.PETSc.TAO.getIterationNumber petsc4py.PETSc.TAO-class.html#getIterationNumber petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.TAO.setObjectiveGradient petsc4py.PETSc.TAO-class.html#setObjectiveGradient petsc4py.PETSc.TAO.setConvergedReason petsc4py.PETSc.TAO-class.html#setConvergedReason petsc4py.PETSc.TAO.getSolution petsc4py.PETSc.TAO-class.html#getSolution petsc4py.PETSc.TAO.diverged petsc4py.PETSc.TAO-class.html#diverged petsc4py.PETSc.TAO.__new__ petsc4py.PETSc.TAO-class.html#__new__ petsc4py.PETSc.TAO.setBRGNRegularizerHessian petsc4py.PETSc.TAO-class.html#setBRGNRegularizerHessian petsc4py.PETSc.TAO.getBRGNSubsolver petsc4py.PETSc.TAO-class.html#getBRGNSubsolver petsc4py.PETSc.TAO.objective petsc4py.PETSc.TAO-class.html#objective petsc4py.PETSc.TAO.destroy petsc4py.PETSc.TAO-class.html#destroy petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.TAO.getKSP petsc4py.PETSc.TAO-class.html#getKSP petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.TAO.getTolerances petsc4py.PETSc.TAO-class.html#getTolerances petsc4py.PETSc.TAO.getSolutionStatus petsc4py.PETSc.TAO-class.html#getSolutionStatus petsc4py.PETSc.TAO.setBRGNRegularizerObjectiveGradient petsc4py.PETSc.TAO-class.html#setBRGNRegularizerObjectiveGradient petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.TAO.gtol petsc4py.PETSc.TAO-class.html#gtol petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.TAO.setStateDesignIS petsc4py.PETSc.TAO-class.html#setStateDesignIS petsc4py.PETSc.TAO.solve petsc4py.PETSc.TAO-class.html#solve petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.TAO.computeGradient petsc4py.PETSc.TAO-class.html#computeGradient petsc4py.PETSc.TAO.cnorm petsc4py.PETSc.TAO-class.html#cnorm petsc4py.PETSc.TAO.Reason petsc4py.PETSc.TAO.Reason-class.html petsc4py.PETSc.TAO.Reason.CONVERGED_MINF petsc4py.PETSc.TAO.Reason-class.html#CONVERGED_MINF petsc4py.PETSc.TAO.Reason.CONVERGED_GATOL petsc4py.PETSc.TAO.Reason-class.html#CONVERGED_GATOL petsc4py.PETSc.TAO.Reason.CONVERGED_GRTOL petsc4py.PETSc.TAO.Reason-class.html#CONVERGED_GRTOL petsc4py.PETSc.TAO.Reason.ITERATING petsc4py.PETSc.TAO.Reason-class.html#ITERATING petsc4py.PETSc.TAO.Reason.DIVERGED_TR_REDUCTION petsc4py.PETSc.TAO.Reason-class.html#DIVERGED_TR_REDUCTION petsc4py.PETSc.TAO.Reason.DIVERGED_USER petsc4py.PETSc.TAO.Reason-class.html#DIVERGED_USER petsc4py.PETSc.TAO.Reason.CONVERGED_STEPTOL petsc4py.PETSc.TAO.Reason-class.html#CONVERGED_STEPTOL petsc4py.PETSc.TAO.Reason.DIVERGED_NAN petsc4py.PETSc.TAO.Reason-class.html#DIVERGED_NAN petsc4py.PETSc.TAO.Reason.DIVERGED_MAXITS petsc4py.PETSc.TAO.Reason-class.html#DIVERGED_MAXITS petsc4py.PETSc.TAO.Reason.CONTINUE_ITERATING petsc4py.PETSc.TAO.Reason-class.html#CONTINUE_ITERATING petsc4py.PETSc.TAO.Reason.__qualname__ petsc4py.PETSc.TAO.Reason-class.html#__qualname__ petsc4py.PETSc.TAO.Reason.CONVERGED_GTTOL petsc4py.PETSc.TAO.Reason-class.html#CONVERGED_GTTOL petsc4py.PETSc.TAO.Reason.CONVERGED_USER petsc4py.PETSc.TAO.Reason-class.html#CONVERGED_USER petsc4py.PETSc.TAO.Reason.CONVERGED_ITERATING petsc4py.PETSc.TAO.Reason-class.html#CONVERGED_ITERATING petsc4py.PETSc.TAO.Reason.DIVERGED_LS_FAILURE petsc4py.PETSc.TAO.Reason-class.html#DIVERGED_LS_FAILURE petsc4py.PETSc.TAO.Reason.DIVERGED_MAXFCN petsc4py.PETSc.TAO.Reason-class.html#DIVERGED_MAXFCN petsc4py.PETSc.TAO.Type petsc4py.PETSc.TAO.Type-class.html petsc4py.PETSc.TAO.Type.BQNKLS petsc4py.PETSc.TAO.Type-class.html#BQNKLS petsc4py.PETSc.TAO.Type.BMRM petsc4py.PETSc.TAO.Type-class.html#BMRM petsc4py.PETSc.TAO.Type.BNCG petsc4py.PETSc.TAO.Type-class.html#BNCG petsc4py.PETSc.TAO.Type.ASFLS petsc4py.PETSc.TAO.Type-class.html#ASFLS petsc4py.PETSc.TAO.Type.TRON petsc4py.PETSc.TAO.Type-class.html#TRON petsc4py.PETSc.TAO.Type.NLS petsc4py.PETSc.TAO.Type-class.html#NLS petsc4py.PETSc.TAO.Type.SHELL petsc4py.PETSc.TAO.Type-class.html#SHELL petsc4py.PETSc.TAO.Type.NM petsc4py.PETSc.TAO.Type-class.html#NM petsc4py.PETSc.TAO.Type.GPCG petsc4py.PETSc.TAO.Type-class.html#GPCG petsc4py.PETSc.TAO.Type.BNLS petsc4py.PETSc.TAO.Type-class.html#BNLS petsc4py.PETSc.TAO.Type.BNTL petsc4py.PETSc.TAO.Type-class.html#BNTL petsc4py.PETSc.TAO.Type.SSILS petsc4py.PETSc.TAO.Type-class.html#SSILS petsc4py.PETSc.TAO.Type.OWLQN petsc4py.PETSc.TAO.Type-class.html#OWLQN petsc4py.PETSc.TAO.Type.BNTR petsc4py.PETSc.TAO.Type-class.html#BNTR petsc4py.PETSc.TAO.Type.BQPIP petsc4py.PETSc.TAO.Type-class.html#BQPIP petsc4py.PETSc.TAO.Type.SSFLS petsc4py.PETSc.TAO.Type-class.html#SSFLS petsc4py.PETSc.TAO.Type.ADMM petsc4py.PETSc.TAO.Type-class.html#ADMM petsc4py.PETSc.TAO.Type.PDIPM petsc4py.PETSc.TAO.Type-class.html#PDIPM petsc4py.PETSc.TAO.Type.CG petsc4py.PETSc.TAO.Type-class.html#CG petsc4py.PETSc.TAO.Type.LMVM petsc4py.PETSc.TAO.Type-class.html#LMVM petsc4py.PETSc.TAO.Type.BLMVM petsc4py.PETSc.TAO.Type-class.html#BLMVM petsc4py.PETSc.TAO.Type.BQNLS petsc4py.PETSc.TAO.Type-class.html#BQNLS petsc4py.PETSc.TAO.Type.ASILS petsc4py.PETSc.TAO.Type-class.html#ASILS petsc4py.PETSc.TAO.Type.ALMM petsc4py.PETSc.TAO.Type-class.html#ALMM petsc4py.PETSc.TAO.Type.BQNKTR petsc4py.PETSc.TAO.Type-class.html#BQNKTR petsc4py.PETSc.TAO.Type.NTR petsc4py.PETSc.TAO.Type-class.html#NTR petsc4py.PETSc.TAO.Type.IPM petsc4py.PETSc.TAO.Type-class.html#IPM petsc4py.PETSc.TAO.Type.__qualname__ petsc4py.PETSc.TAO.Type-class.html#__qualname__ petsc4py.PETSc.TAO.Type.BQNKTL petsc4py.PETSc.TAO.Type-class.html#BQNKTL petsc4py.PETSc.TAO.Type.NTL petsc4py.PETSc.TAO.Type-class.html#NTL petsc4py.PETSc.TAO.Type.LCL petsc4py.PETSc.TAO.Type-class.html#LCL petsc4py.PETSc.TAO.Type.BRGN petsc4py.PETSc.TAO.Type-class.html#BRGN petsc4py.PETSc.TAO.Type.POUNDERS petsc4py.PETSc.TAO.Type-class.html#POUNDERS petsc4py.PETSc.TS petsc4py.PETSc.TS-class.html petsc4py.PETSc.TS.getConvergedReason petsc4py.PETSc.TS-class.html#getConvergedReason petsc4py.PETSc.TS.setDM petsc4py.PETSc.TS-class.html#setDM petsc4py.PETSc.TS.computeRHSJacobian petsc4py.PETSc.TS-class.html#computeRHSJacobian petsc4py.PETSc.TS.ExactFinalTime petsc4py.PETSc.TS.ExactFinalTime-class.html petsc4py.PETSc.TS.getTime petsc4py.PETSc.TS-class.html#getTime petsc4py.PETSc.TS.cancelMonitor petsc4py.PETSc.TS-class.html#cancelMonitor petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.TS.getEquationType petsc4py.PETSc.TS-class.html#getEquationType petsc4py.PETSc.TS.computeRHSFunction petsc4py.PETSc.TS-class.html#computeRHSFunction petsc4py.PETSc.TS.setIJacobianP petsc4py.PETSc.TS-class.html#setIJacobianP petsc4py.PETSc.TS.setTheta petsc4py.PETSc.TS-class.html#setTheta petsc4py.PETSc.TS.getTimeStep petsc4py.PETSc.TS-class.html#getTimeStep petsc4py.PETSc.TS.setExactFinalTime petsc4py.PETSc.TS-class.html#setExactFinalTime petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.TS.monitor petsc4py.PETSc.TS-class.html#monitor petsc4py.PETSc.TS.getStepRejections petsc4py.PETSc.TS-class.html#getStepRejections petsc4py.PETSc.TS.setMonitor petsc4py.PETSc.TS-class.html#setMonitor petsc4py.PETSc.TS.rtol petsc4py.PETSc.TS-class.html#rtol petsc4py.PETSc.TS.computeRHSFunctionLinear petsc4py.PETSc.TS-class.html#computeRHSFunctionLinear petsc4py.PETSc.TS.computeRHSJacobianConstant petsc4py.PETSc.TS-class.html#computeRHSJacobianConstant petsc4py.PETSc.TS.createQuadratureTS petsc4py.PETSc.TS-class.html#createQuadratureTS petsc4py.PETSc.TS.vec_sol petsc4py.PETSc.TS-class.html#vec_sol petsc4py.PETSc.TS.setEventHandler petsc4py.PETSc.TS-class.html#setEventHandler petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.TS.setOptionsPrefix petsc4py.PETSc.TS-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.TS.ProblemType petsc4py.PETSc.TS.ProblemType-class.html petsc4py.PETSc.TS.getI2Jacobian petsc4py.PETSc.TS-class.html#getI2Jacobian petsc4py.PETSc.TS.setFromOptions petsc4py.PETSc.TS-class.html#setFromOptions petsc4py.PETSc.TS.destroy petsc4py.PETSc.TS-class.html#destroy petsc4py.PETSc.TS.setMaxSNESFailures petsc4py.PETSc.TS-class.html#setMaxSNESFailures petsc4py.PETSc.TS.getRHSFunction petsc4py.PETSc.TS-class.html#getRHSFunction petsc4py.PETSc.TS.setCostGradients petsc4py.PETSc.TS-class.html#setCostGradients petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.TS.setSaveTrajectory petsc4py.PETSc.TS-class.html#setSaveTrajectory petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.TS.setAppCtx petsc4py.PETSc.TS-class.html#setAppCtx petsc4py.PETSc.TS.setEventTolerances petsc4py.PETSc.TS-class.html#setEventTolerances petsc4py.PETSc.TS.step_number petsc4py.PETSc.TS-class.html#step_number petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.TS.adjointSolve petsc4py.PETSc.TS-class.html#adjointSolve petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.TS.setStepNumber petsc4py.PETSc.TS-class.html#setStepNumber petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.TS.ExactFinalTimeOption petsc4py.PETSc.TS.ExactFinalTime-class.html petsc4py.PETSc.TS.adjointSetUp petsc4py.PETSc.TS-class.html#adjointSetUp petsc4py.PETSc.TS.setPythonContext petsc4py.PETSc.TS-class.html#setPythonContext petsc4py.PETSc.TS.computeI2Function petsc4py.PETSc.TS-class.html#computeI2Function petsc4py.PETSc.TS.ConvergedReason petsc4py.PETSc.TS.ConvergedReason-class.html petsc4py.PETSc.TS.getKSPIterations petsc4py.PETSc.TS-class.html#getKSPIterations petsc4py.PETSc.TS.getSNESFailures petsc4py.PETSc.TS-class.html#getSNESFailures petsc4py.PETSc.TS.computeIFunction petsc4py.PETSc.TS-class.html#computeIFunction petsc4py.PETSc.TS.time_step petsc4py.PETSc.TS-class.html#time_step petsc4py.PETSc.TS.Type petsc4py.PETSc.TS.Type-class.html petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.TS.iterating petsc4py.PETSc.TS-class.html#iterating petsc4py.PETSc.TS.setErrorIfStepFails petsc4py.PETSc.TS-class.html#setErrorIfStepFails petsc4py.PETSc.TS.getRHSJacobian petsc4py.PETSc.TS-class.html#getRHSJacobian petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.TS.setMaxSteps petsc4py.PETSc.TS-class.html#setMaxSteps petsc4py.PETSc.TS.setI2Jacobian petsc4py.PETSc.TS-class.html#setI2Jacobian petsc4py.PETSc.TS.getIFunction petsc4py.PETSc.TS-class.html#getIFunction petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.TS.getMaxTime petsc4py.PETSc.TS-class.html#getMaxTime petsc4py.PETSc.TS.getPostStep petsc4py.PETSc.TS-class.html#getPostStep petsc4py.PETSc.TS.restartStep petsc4py.PETSc.TS-class.html#restartStep petsc4py.PETSc.TS.setUp petsc4py.PETSc.TS-class.html#setUp petsc4py.PETSc.TS.view petsc4py.PETSc.TS-class.html#view petsc4py.PETSc.TS.interpolate petsc4py.PETSc.TS-class.html#interpolate petsc4py.PETSc.TS.getDM petsc4py.PETSc.TS-class.html#getDM petsc4py.PETSc.TS.step petsc4py.PETSc.TS-class.html#step petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.TS.setI2Function petsc4py.PETSc.TS-class.html#setI2Function petsc4py.PETSc.TS.setSolution petsc4py.PETSc.TS-class.html#setSolution petsc4py.PETSc.TS.setThetaEndpoint petsc4py.PETSc.TS-class.html#setThetaEndpoint petsc4py.PETSc.TS.setAlphaParams petsc4py.PETSc.TS-class.html#setAlphaParams petsc4py.PETSc.TS.setPostStep petsc4py.PETSc.TS-class.html#setPostStep petsc4py.PETSc.TS.ksp petsc4py.PETSc.TS-class.html#ksp petsc4py.PETSc.TS.createPython petsc4py.PETSc.TS-class.html#createPython petsc4py.PETSc.TS.getRKType petsc4py.PETSc.TS-class.html#getRKType petsc4py.PETSc.TS.getStepNumber petsc4py.PETSc.TS-class.html#getStepNumber petsc4py.PETSc.TS.getARKIMEXType petsc4py.PETSc.TS-class.html#getARKIMEXType petsc4py.PETSc.TS.appctx petsc4py.PETSc.TS-class.html#appctx petsc4py.PETSc.TS.setRKType petsc4py.PETSc.TS-class.html#setRKType petsc4py.PETSc.TS.reason petsc4py.PETSc.TS-class.html#reason petsc4py.PETSc.TS.setProblemType petsc4py.PETSc.TS-class.html#setProblemType petsc4py.PETSc.TS.computeIJacobian petsc4py.PETSc.TS-class.html#computeIJacobian petsc4py.PETSc.TS.setMaxStepRejections petsc4py.PETSc.TS-class.html#setMaxStepRejections petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.TS.adjointSetSteps petsc4py.PETSc.TS-class.html#adjointSetSteps petsc4py.PETSc.TS.computeIJacobianP petsc4py.PETSc.TS-class.html#computeIJacobianP petsc4py.PETSc.TS.load petsc4py.PETSc.TS-class.html#load petsc4py.PETSc.TS.setTolerances petsc4py.PETSc.TS-class.html#setTolerances petsc4py.PETSc.TS.getPythonContext petsc4py.PETSc.TS-class.html#getPythonContext petsc4py.PETSc.TS.getQuadratureTS petsc4py.PETSc.TS-class.html#getQuadratureTS petsc4py.PETSc.TS.getIJacobian petsc4py.PETSc.TS-class.html#getIJacobian petsc4py.PETSc.TS.setMaxTime petsc4py.PETSc.TS-class.html#setMaxTime petsc4py.PETSc.TS.computeI2Jacobian petsc4py.PETSc.TS-class.html#computeI2Jacobian petsc4py.PETSc.TS.setRHSFunction petsc4py.PETSc.TS-class.html#setRHSFunction petsc4py.PETSc.TS.problem_type petsc4py.PETSc.TS-class.html#problem_type petsc4py.PETSc.TS.setType petsc4py.PETSc.TS-class.html#setType petsc4py.PETSc.TS.getSNES petsc4py.PETSc.TS-class.html#getSNES petsc4py.PETSc.TS.getCostIntegral petsc4py.PETSc.TS-class.html#getCostIntegral petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.TS.create petsc4py.PETSc.TS-class.html#create petsc4py.PETSc.TS.getAlphaParams petsc4py.PETSc.TS-class.html#getAlphaParams petsc4py.PETSc.TS.setRHSJacobianP petsc4py.PETSc.TS-class.html#setRHSJacobianP petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.TS.getSolution2 petsc4py.PETSc.TS-class.html#getSolution2 petsc4py.PETSc.TS.snes petsc4py.PETSc.TS-class.html#snes petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.TS.getProblemType petsc4py.PETSc.TS-class.html#getProblemType petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.TS.getType petsc4py.PETSc.TS-class.html#getType petsc4py.PETSc.TS.getMonitor petsc4py.PETSc.TS-class.html#getMonitor petsc4py.PETSc.TS.getAppCtx petsc4py.PETSc.TS-class.html#getAppCtx petsc4py.PETSc.TS.atol petsc4py.PETSc.TS-class.html#atol petsc4py.PETSc.TS.rollBack petsc4py.PETSc.TS-class.html#rollBack petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.TS.reset petsc4py.PETSc.TS-class.html#reset petsc4py.PETSc.TS.RKType petsc4py.PETSc.TS.RKType-class.html petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.TS.max_steps petsc4py.PETSc.TS-class.html#max_steps petsc4py.PETSc.TS.getCostGradients petsc4py.PETSc.TS-class.html#getCostGradients petsc4py.PETSc.TS.getSolveTime petsc4py.PETSc.TS-class.html#getSolveTime petsc4py.PETSc.TS.getI2Function petsc4py.PETSc.TS-class.html#getI2Function petsc4py.PETSc.TS.setIJacobian petsc4py.PETSc.TS-class.html#setIJacobian petsc4py.PETSc.TS.setTimeStep petsc4py.PETSc.TS-class.html#setTimeStep petsc4py.PETSc.TS.getThetaEndpoint petsc4py.PETSc.TS-class.html#getThetaEndpoint petsc4py.PETSc.TS.adjointStep petsc4py.PETSc.TS-class.html#adjointStep petsc4py.PETSc.TS.setConvergedReason petsc4py.PETSc.TS-class.html#setConvergedReason petsc4py.PETSc.TS.getTheta petsc4py.PETSc.TS-class.html#getTheta petsc4py.PETSc.TS.getSolution petsc4py.PETSc.TS-class.html#getSolution petsc4py.PETSc.TS.dm petsc4py.PETSc.TS-class.html#dm petsc4py.PETSc.TS.diverged petsc4py.PETSc.TS-class.html#diverged petsc4py.PETSc.TS.getOptionsPrefix petsc4py.PETSc.TS-class.html#getOptionsPrefix petsc4py.PETSc.TS.computeRHSJacobianP petsc4py.PETSc.TS-class.html#computeRHSJacobianP petsc4py.PETSc.TS.getPreStep petsc4py.PETSc.TS-class.html#getPreStep petsc4py.PETSc.TS.setSolution2 petsc4py.PETSc.TS-class.html#setSolution2 petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.TS.setIFunction petsc4py.PETSc.TS-class.html#setIFunction petsc4py.PETSc.TS.converged petsc4py.PETSc.TS-class.html#converged petsc4py.PETSc.TS.setRHSJacobian petsc4py.PETSc.TS-class.html#setRHSJacobian petsc4py.PETSc.TS.getPrevTime petsc4py.PETSc.TS-class.html#getPrevTime petsc4py.PETSc.TS.equation_type petsc4py.PETSc.TS-class.html#equation_type petsc4py.PETSc.TS.setEquationType petsc4py.PETSc.TS-class.html#setEquationType petsc4py.PETSc.TS.EquationType petsc4py.PETSc.TS.EquationType-class.html petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.TS.setARKIMEXType petsc4py.PETSc.TS-class.html#setARKIMEXType petsc4py.PETSc.TS.getKSP petsc4py.PETSc.TS-class.html#getKSP petsc4py.PETSc.TS.ARKIMEXType petsc4py.PETSc.TS.ARKIMEXType-class.html petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.TS.clone petsc4py.PETSc.TS-class.html#clone petsc4py.PETSc.TS.getNumEvents petsc4py.PETSc.TS-class.html#getNumEvents petsc4py.PETSc.TS.getTolerances petsc4py.PETSc.TS-class.html#getTolerances petsc4py.PETSc.TS.getSNESIterations petsc4py.PETSc.TS-class.html#getSNESIterations petsc4py.PETSc.TS.setAlphaRadius petsc4py.PETSc.TS-class.html#setAlphaRadius petsc4py.PETSc.TS.setTime petsc4py.PETSc.TS-class.html#setTime petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.TS.__new__ petsc4py.PETSc.TS-class.html#__new__ petsc4py.PETSc.TS.getMaxSteps petsc4py.PETSc.TS-class.html#getMaxSteps petsc4py.PETSc.TS.setPythonType petsc4py.PETSc.TS-class.html#setPythonType petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.TS.solve petsc4py.PETSc.TS-class.html#solve petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.TS.max_time petsc4py.PETSc.TS-class.html#max_time petsc4py.PETSc.TS.time petsc4py.PETSc.TS-class.html#time petsc4py.PETSc.TS.setPreStep petsc4py.PETSc.TS-class.html#setPreStep petsc4py.PETSc.TS.ARKIMEXType petsc4py.PETSc.TS.ARKIMEXType-class.html petsc4py.PETSc.TS.ARKIMEXType.ARKIMEX1BEE petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEX1BEE petsc4py.PETSc.TS.ARKIMEXType.ARKIMEXARS443 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEXARS443 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEXBPR3 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEXBPR3 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEXPRSSP2 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEXPRSSP2 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEXARS122 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEXARS122 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEXL2 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEXL2 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEX2D petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEX2D petsc4py.PETSc.TS.ARKIMEXType.ARKIMEX2E petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEX2E petsc4py.PETSc.TS.ARKIMEXType.ARKIMEX2C petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEX2C petsc4py.PETSc.TS.ARKIMEXType.ARKIMEXA2 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEXA2 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEX5 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEX5 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEX4 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEX4 petsc4py.PETSc.TS.ARKIMEXType.ARKIMEX3 petsc4py.PETSc.TS.ARKIMEXType-class.html#ARKIMEX3 petsc4py.PETSc.TS.ARKIMEXType.__qualname__ petsc4py.PETSc.TS.ARKIMEXType-class.html#__qualname__ petsc4py.PETSc.TS.ConvergedReason petsc4py.PETSc.TS.ConvergedReason-class.html petsc4py.PETSc.TS.ConvergedReason.DIVERGED_STEP_REJECTED petsc4py.PETSc.TS.ConvergedReason-class.html#DIVERGED_STEP_REJECTED petsc4py.PETSc.TS.ConvergedReason.CONVERGED_USER petsc4py.PETSc.TS.ConvergedReason-class.html#CONVERGED_USER petsc4py.PETSc.TS.ConvergedReason.CONVERGED_TIME petsc4py.PETSc.TS.ConvergedReason-class.html#CONVERGED_TIME petsc4py.PETSc.TS.ConvergedReason.CONVERGED_EVENT petsc4py.PETSc.TS.ConvergedReason-class.html#CONVERGED_EVENT petsc4py.PETSc.TS.ConvergedReason.ITERATING petsc4py.PETSc.TS.ConvergedReason-class.html#ITERATING petsc4py.PETSc.TS.ConvergedReason.CONVERGED_ITS petsc4py.PETSc.TS.ConvergedReason-class.html#CONVERGED_ITS petsc4py.PETSc.TS.ConvergedReason.CONVERGED_ITERATING petsc4py.PETSc.TS.ConvergedReason-class.html#CONVERGED_ITERATING petsc4py.PETSc.TS.ConvergedReason.DIVERGED_NONLINEAR_SOLVE petsc4py.PETSc.TS.ConvergedReason-class.html#DIVERGED_NONLINEAR_SOLVE petsc4py.PETSc.TS.ConvergedReason.__qualname__ petsc4py.PETSc.TS.ConvergedReason-class.html#__qualname__ petsc4py.PETSc.TS.EquationType petsc4py.PETSc.TS.EquationType-class.html petsc4py.PETSc.TS.EquationType.DAE_IMPLICIT_INDEX3 petsc4py.PETSc.TS.EquationType-class.html#DAE_IMPLICIT_INDEX3 petsc4py.PETSc.TS.EquationType.DAE_IMPLICIT_INDEX1 petsc4py.PETSc.TS.EquationType-class.html#DAE_IMPLICIT_INDEX1 petsc4py.PETSc.TS.EquationType.DAE_IMPLICIT_INDEX2 petsc4py.PETSc.TS.EquationType-class.html#DAE_IMPLICIT_INDEX2 petsc4py.PETSc.TS.EquationType.DAE_SEMI_EXPLICIT_INDEXHI petsc4py.PETSc.TS.EquationType-class.html#DAE_SEMI_EXPLICIT_INDEXHI petsc4py.PETSc.TS.EquationType.__qualname__ petsc4py.PETSc.TS.EquationType-class.html#__qualname__ petsc4py.PETSc.TS.EquationType.ODE_EXPLICIT petsc4py.PETSc.TS.EquationType-class.html#ODE_EXPLICIT petsc4py.PETSc.TS.EquationType.EXPLICIT petsc4py.PETSc.TS.EquationType-class.html#EXPLICIT petsc4py.PETSc.TS.EquationType.DAE_SEMI_EXPLICIT_INDEX1 petsc4py.PETSc.TS.EquationType-class.html#DAE_SEMI_EXPLICIT_INDEX1 petsc4py.PETSc.TS.EquationType.DAE_SEMI_EXPLICIT_INDEX3 petsc4py.PETSc.TS.EquationType-class.html#DAE_SEMI_EXPLICIT_INDEX3 petsc4py.PETSc.TS.EquationType.DAE_SEMI_EXPLICIT_INDEX2 petsc4py.PETSc.TS.EquationType-class.html#DAE_SEMI_EXPLICIT_INDEX2 petsc4py.PETSc.TS.EquationType.DAE_IMPLICIT_INDEXHI petsc4py.PETSc.TS.EquationType-class.html#DAE_IMPLICIT_INDEXHI petsc4py.PETSc.TS.EquationType.UNSPECIFIED petsc4py.PETSc.TS.EquationType-class.html#UNSPECIFIED petsc4py.PETSc.TS.EquationType.IMPLICIT petsc4py.PETSc.TS.EquationType-class.html#IMPLICIT petsc4py.PETSc.TS.EquationType.ODE_IMPLICIT petsc4py.PETSc.TS.EquationType-class.html#ODE_IMPLICIT petsc4py.PETSc.TS.ExactFinalTime petsc4py.PETSc.TS.ExactFinalTime-class.html petsc4py.PETSc.TS.ExactFinalTime.MATCHSTEP petsc4py.PETSc.TS.ExactFinalTime-class.html#MATCHSTEP petsc4py.PETSc.TS.ExactFinalTime.INTERPOLATE petsc4py.PETSc.TS.ExactFinalTime-class.html#INTERPOLATE petsc4py.PETSc.TS.ExactFinalTime.__qualname__ petsc4py.PETSc.TS.ExactFinalTime-class.html#__qualname__ petsc4py.PETSc.TS.ExactFinalTime.UNSPECIFIED petsc4py.PETSc.TS.ExactFinalTime-class.html#UNSPECIFIED petsc4py.PETSc.TS.ExactFinalTime.STEPOVER petsc4py.PETSc.TS.ExactFinalTime-class.html#STEPOVER petsc4py.PETSc.TS.ProblemType petsc4py.PETSc.TS.ProblemType-class.html petsc4py.PETSc.TS.ProblemType.NONLINEAR petsc4py.PETSc.TS.ProblemType-class.html#NONLINEAR petsc4py.PETSc.TS.ProblemType.LINEAR petsc4py.PETSc.TS.ProblemType-class.html#LINEAR petsc4py.PETSc.TS.ProblemType.__qualname__ petsc4py.PETSc.TS.ProblemType-class.html#__qualname__ petsc4py.PETSc.TS.RKType petsc4py.PETSc.TS.RKType-class.html petsc4py.PETSc.TS.RKType.RK5F petsc4py.PETSc.TS.RKType-class.html#RK5F petsc4py.PETSc.TS.RKType.RK7VR petsc4py.PETSc.TS.RKType-class.html#RK7VR petsc4py.PETSc.TS.RKType.RK4 petsc4py.PETSc.TS.RKType-class.html#RK4 petsc4py.PETSc.TS.RKType.RK3 petsc4py.PETSc.TS.RKType-class.html#RK3 petsc4py.PETSc.TS.RKType.RK2A petsc4py.PETSc.TS.RKType-class.html#RK2A petsc4py.PETSc.TS.RKType.RK5DP petsc4py.PETSc.TS.RKType-class.html#RK5DP petsc4py.PETSc.TS.RKType.RK5BS petsc4py.PETSc.TS.RKType-class.html#RK5BS petsc4py.PETSc.TS.RKType.RK8VR petsc4py.PETSc.TS.RKType-class.html#RK8VR petsc4py.PETSc.TS.RKType.RK6VR petsc4py.PETSc.TS.RKType-class.html#RK6VR petsc4py.PETSc.TS.RKType.RK1FE petsc4py.PETSc.TS.RKType-class.html#RK1FE petsc4py.PETSc.TS.RKType.__qualname__ petsc4py.PETSc.TS.RKType-class.html#__qualname__ petsc4py.PETSc.TS.RKType.RK3BS petsc4py.PETSc.TS.RKType-class.html#RK3BS petsc4py.PETSc.TS.Type petsc4py.PETSc.TS.Type-class.html petsc4py.PETSc.TS.Type.BE petsc4py.PETSc.TS.Type-class.html#BE petsc4py.PETSc.TS.Type.PYTHON petsc4py.PETSc.TS.Type-class.html#PYTHON petsc4py.PETSc.TS.Type.MIMEX petsc4py.PETSc.TS.Type-class.html#MIMEX petsc4py.PETSc.TS.Type.GLLE petsc4py.PETSc.TS.Type-class.html#GLLE petsc4py.PETSc.TS.Type.FE petsc4py.PETSc.TS.Type-class.html#FE petsc4py.PETSc.TS.Type.BASICSYMPLECTIC petsc4py.PETSc.TS.Type-class.html#BASICSYMPLECTIC petsc4py.PETSc.TS.Type.EULER petsc4py.PETSc.TS.Type-class.html#EULER petsc4py.PETSc.TS.Type.RADAU5 petsc4py.PETSc.TS.Type-class.html#RADAU5 petsc4py.PETSc.TS.Type.PSEUDO petsc4py.PETSc.TS.Type-class.html#PSEUDO petsc4py.PETSc.TS.Type.ARKIMEX petsc4py.PETSc.TS.Type-class.html#ARKIMEX petsc4py.PETSc.TS.Type.BEULER petsc4py.PETSc.TS.Type-class.html#BEULER petsc4py.PETSc.TS.Type.TH petsc4py.PETSc.TS.Type-class.html#TH petsc4py.PETSc.TS.Type.CRANK_NICOLSON petsc4py.PETSc.TS.Type-class.html#CRANK_NICOLSON petsc4py.PETSc.TS.Type.RK petsc4py.PETSc.TS.Type-class.html#RK petsc4py.PETSc.TS.Type.ALPHA2 petsc4py.PETSc.TS.Type-class.html#ALPHA2 petsc4py.PETSc.TS.Type.BDF petsc4py.PETSc.TS.Type-class.html#BDF petsc4py.PETSc.TS.Type.CN petsc4py.PETSc.TS.Type-class.html#CN petsc4py.PETSc.TS.Type.SUNDIALS petsc4py.PETSc.TS.Type-class.html#SUNDIALS petsc4py.PETSc.TS.Type.RUNGE_KUTTA petsc4py.PETSc.TS.Type-class.html#RUNGE_KUTTA petsc4py.PETSc.TS.Type.EIMEX petsc4py.PETSc.TS.Type-class.html#EIMEX petsc4py.PETSc.TS.Type.THETA petsc4py.PETSc.TS.Type-class.html#THETA petsc4py.PETSc.TS.Type.DISCGRAD petsc4py.PETSc.TS.Type-class.html#DISCGRAD petsc4py.PETSc.TS.Type.MPRK petsc4py.PETSc.TS.Type-class.html#MPRK petsc4py.PETSc.TS.Type.GLEE petsc4py.PETSc.TS.Type-class.html#GLEE petsc4py.PETSc.TS.Type.SSP petsc4py.PETSc.TS.Type-class.html#SSP petsc4py.PETSc.TS.Type.__qualname__ petsc4py.PETSc.TS.Type-class.html#__qualname__ petsc4py.PETSc.TS.Type.ALPHA petsc4py.PETSc.TS.Type-class.html#ALPHA petsc4py.PETSc.TS.Type.ROSW petsc4py.PETSc.TS.Type-class.html#ROSW petsc4py.PETSc.Vec petsc4py.PETSc.Vec-class.html petsc4py.PETSc.Vec.getLGMap petsc4py.PETSc.Vec-class.html#getLGMap petsc4py.PETSc.Vec.mDotBegin petsc4py.PETSc.Vec-class.html#mDotBegin petsc4py.PETSc.Vec.createShared petsc4py.PETSc.Vec-class.html#createShared petsc4py.PETSc.Vec.getCLMemHandle petsc4py.PETSc.Vec-class.html#getCLMemHandle petsc4py.PETSc.Vec.getSize petsc4py.PETSc.Vec-class.html#getSize petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Vec.owner_range petsc4py.PETSc.Vec-class.html#owner_range petsc4py.PETSc.Vec.__rdiv__ petsc4py.PETSc.Vec-class.html#__rdiv__ petsc4py.PETSc.Vec.__rmul__ petsc4py.PETSc.Vec-class.html#__rmul__ petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Vec.permute petsc4py.PETSc.Vec-class.html#permute petsc4py.PETSc.Vec.ghostUpdateBegin petsc4py.PETSc.Vec-class.html#ghostUpdateBegin petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Vec.copy petsc4py.PETSc.Vec-class.html#copy petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Vec.pointwiseMaxAbs petsc4py.PETSc.Vec-class.html#pointwiseMaxAbs petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Vec.__enter__ petsc4py.PETSc.Vec-class.html#__enter__ petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Vec.array_r petsc4py.PETSc.Vec-class.html#array_r petsc4py.PETSc.Vec.swap petsc4py.PETSc.Vec-class.html#swap petsc4py.PETSc.Vec.array_w petsc4py.PETSc.Vec-class.html#array_w petsc4py.PETSc.Vec.pointwiseMult petsc4py.PETSc.Vec-class.html#pointwiseMult petsc4py.PETSc.Vec.norm petsc4py.PETSc.Vec-class.html#norm petsc4py.PETSc.Vec.mDot petsc4py.PETSc.Vec-class.html#mDot petsc4py.PETSc.Vec.__exit__ petsc4py.PETSc.Vec-class.html#__exit__ petsc4py.PETSc.Vec.tDot petsc4py.PETSc.Vec-class.html#tDot petsc4py.PETSc.Vec.setValuesBlockedLocal petsc4py.PETSc.Vec-class.html#setValuesBlockedLocal petsc4py.PETSc.Vec.setValuesLocal petsc4py.PETSc.Vec-class.html#setValuesLocal petsc4py.PETSc.Vec.sqrtabs petsc4py.PETSc.Vec-class.html#sqrtabs petsc4py.PETSc.Vec.dotEnd petsc4py.PETSc.Vec-class.html#dotEnd petsc4py.PETSc.Vec.setBlockSize petsc4py.PETSc.Vec-class.html#setBlockSize petsc4py.PETSc.Vec.owner_ranges petsc4py.PETSc.Vec-class.html#owner_ranges petsc4py.PETSc.Vec.setFromOptions petsc4py.PETSc.Vec-class.html#setFromOptions petsc4py.PETSc.Vec.strideScatter petsc4py.PETSc.Vec-class.html#strideScatter petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Vec.__delitem__ petsc4py.PETSc.Vec-class.html#__delitem__ petsc4py.PETSc.Vec.mDotEnd petsc4py.PETSc.Vec-class.html#mDotEnd petsc4py.PETSc.Vec.getArray petsc4py.PETSc.Vec-class.html#getArray petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Vec.sizes petsc4py.PETSc.Vec-class.html#sizes petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Vec.createCUDAWithArrays petsc4py.PETSc.Vec-class.html#createCUDAWithArrays petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Vec.normEnd petsc4py.PETSc.Vec-class.html#normEnd petsc4py.PETSc.Vec.getOwnershipRanges petsc4py.PETSc.Vec-class.html#getOwnershipRanges petsc4py.PETSc.Vec.strideScale petsc4py.PETSc.Vec-class.html#strideScale petsc4py.PETSc.Vec.strideGather petsc4py.PETSc.Vec-class.html#strideGather petsc4py.PETSc.Vec.pointwiseDivide petsc4py.PETSc.Vec-class.html#pointwiseDivide petsc4py.PETSc.Vec.createNest petsc4py.PETSc.Vec-class.html#createNest petsc4py.PETSc.Vec.setMPIGhost petsc4py.PETSc.Vec-class.html#setMPIGhost petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Vec.getSizes petsc4py.PETSc.Vec-class.html#getSizes petsc4py.PETSc.Vec.view petsc4py.PETSc.Vec-class.html#view petsc4py.PETSc.Vec.set petsc4py.PETSc.Vec-class.html#set petsc4py.PETSc.Vec.getCUDAHandle petsc4py.PETSc.Vec-class.html#getCUDAHandle petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Vec.createSeq petsc4py.PETSc.Vec-class.html#createSeq petsc4py.PETSc.Vec.__truediv__ petsc4py.PETSc.Vec-class.html#__truediv__ petsc4py.PETSc.Vec.getBlockSize petsc4py.PETSc.Vec-class.html#getBlockSize petsc4py.PETSc.Vec.Type petsc4py.PETSc.Vec.Type-class.html petsc4py.PETSc.Vec.scale petsc4py.PETSc.Vec-class.html#scale petsc4py.PETSc.Vec.Option petsc4py.PETSc.Vec.Option-class.html petsc4py.PETSc.Vec.createViennaCLWithArrays petsc4py.PETSc.Vec-class.html#createViennaCLWithArrays petsc4py.PETSc.Vec.sum petsc4py.PETSc.Vec-class.html#sum petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Vec.normBegin petsc4py.PETSc.Vec-class.html#normBegin petsc4py.PETSc.Vec.abs petsc4py.PETSc.Vec-class.html#abs petsc4py.PETSc.Vec.mtDotBegin petsc4py.PETSc.Vec-class.html#mtDotBegin petsc4py.PETSc.Vec.strideMax petsc4py.PETSc.Vec-class.html#strideMax petsc4py.PETSc.Vec.setType petsc4py.PETSc.Vec-class.html#setType petsc4py.PETSc.Vec.getCLContextHandle petsc4py.PETSc.Vec-class.html#getCLContextHandle petsc4py.PETSc.Vec.axpby petsc4py.PETSc.Vec-class.html#axpby petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Vec.setValue petsc4py.PETSc.Vec-class.html#setValue petsc4py.PETSc.Vec.createWithArray petsc4py.PETSc.Vec-class.html#createWithArray petsc4py.PETSc.Vec.restoreSubVector petsc4py.PETSc.Vec-class.html#restoreSubVector petsc4py.PETSc.Vec.assemblyEnd petsc4py.PETSc.Vec-class.html#assemblyEnd petsc4py.PETSc.Vec.setUp petsc4py.PETSc.Vec-class.html#setUp petsc4py.PETSc.Vec.attachDLPackInfo petsc4py.PETSc.Vec-class.html#attachDLPackInfo petsc4py.PETSc.Vec.assemblyBegin petsc4py.PETSc.Vec-class.html#assemblyBegin petsc4py.PETSc.Vec.__setitem__ petsc4py.PETSc.Vec-class.html#__setitem__ petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Vec.strideMin petsc4py.PETSc.Vec-class.html#strideMin petsc4py.PETSc.Vec.setValuesBlocked petsc4py.PETSc.Vec-class.html#setValuesBlocked petsc4py.PETSc.Vec.tDotEnd petsc4py.PETSc.Vec-class.html#tDotEnd petsc4py.PETSc.Vec.assemble petsc4py.PETSc.Vec-class.html#assemble petsc4py.PETSc.Vec.isset petsc4py.PETSc.Vec-class.html#isset petsc4py.PETSc.Vec.log petsc4py.PETSc.Vec-class.html#log petsc4py.PETSc.Vec.createGhostWithArray petsc4py.PETSc.Vec-class.html#createGhostWithArray petsc4py.PETSc.Vec.isaxpy petsc4py.PETSc.Vec-class.html#isaxpy petsc4py.PETSc.Vec.bindToCPU petsc4py.PETSc.Vec-class.html#bindToCPU petsc4py.PETSc.Vec.getLocalSize petsc4py.PETSc.Vec-class.html#getLocalSize petsc4py.PETSc.Vec.shift petsc4py.PETSc.Vec-class.html#shift petsc4py.PETSc.Vec.equal petsc4py.PETSc.Vec-class.html#equal petsc4py.PETSc.Vec.chop petsc4py.PETSc.Vec-class.html#chop petsc4py.PETSc.Vec.setValueLocal petsc4py.PETSc.Vec-class.html#setValueLocal petsc4py.PETSc.Vec.__mul__ petsc4py.PETSc.Vec-class.html#__mul__ petsc4py.PETSc.Vec.maxpy petsc4py.PETSc.Vec-class.html#maxpy petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Vec.load petsc4py.PETSc.Vec-class.html#load petsc4py.PETSc.Vec.getCLQueueHandle petsc4py.PETSc.Vec-class.html#getCLQueueHandle petsc4py.PETSc.Vec.strideSum petsc4py.PETSc.Vec-class.html#strideSum petsc4py.PETSc.Vec.getSubVector petsc4py.PETSc.Vec-class.html#getSubVector petsc4py.PETSc.Vec.__getitem__ petsc4py.PETSc.Vec-class.html#__getitem__ petsc4py.PETSc.Vec.__rsub__ petsc4py.PETSc.Vec-class.html#__rsub__ petsc4py.PETSc.Vec.array petsc4py.PETSc.Vec-class.html#array petsc4py.PETSc.Vec.block_size petsc4py.PETSc.Vec-class.html#block_size petsc4py.PETSc.Vec.restoreCUDAHandle petsc4py.PETSc.Vec-class.html#restoreCUDAHandle petsc4py.PETSc.Vec.size petsc4py.PETSc.Vec-class.html#size petsc4py.PETSc.Vec.buffer_w petsc4py.PETSc.Vec-class.html#buffer_w petsc4py.PETSc.Vec.restoreCLMemHandle petsc4py.PETSc.Vec-class.html#restoreCLMemHandle petsc4py.PETSc.Vec.buffer_r petsc4py.PETSc.Vec-class.html#buffer_r petsc4py.PETSc.Vec.create petsc4py.PETSc.Vec-class.html#create petsc4py.PETSc.Vec.__abs__ petsc4py.PETSc.Vec-class.html#__abs__ petsc4py.PETSc.Vec.maxPointwiseDivide petsc4py.PETSc.Vec-class.html#maxPointwiseDivide petsc4py.PETSc.Vec.duplicate petsc4py.PETSc.Vec-class.html#duplicate petsc4py.PETSc.Vec.getNestSubVecs petsc4py.PETSc.Vec-class.html#getNestSubVecs petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Vec.__itruediv__ petsc4py.PETSc.Vec-class.html#__itruediv__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Vec.__isub__ petsc4py.PETSc.Vec-class.html#__isub__ petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Vec.setValuesStagStencil petsc4py.PETSc.Vec-class.html#setValuesStagStencil petsc4py.PETSc.Vec.aypx petsc4py.PETSc.Vec-class.html#aypx petsc4py.PETSc.Vec.getType petsc4py.PETSc.Vec-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Vec.setRandom petsc4py.PETSc.Vec-class.html#setRandom petsc4py.PETSc.Vec.setValues petsc4py.PETSc.Vec-class.html#setValues petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Vec.setLGMap petsc4py.PETSc.Vec-class.html#setLGMap petsc4py.PETSc.Vec.createMPI petsc4py.PETSc.Vec-class.html#createMPI petsc4py.PETSc.Vec.tDotBegin petsc4py.PETSc.Vec-class.html#tDotBegin petsc4py.PETSc.Vec.reciprocal petsc4py.PETSc.Vec-class.html#reciprocal petsc4py.PETSc.Vec.__iadd__ petsc4py.PETSc.Vec-class.html#__iadd__ petsc4py.PETSc.Vec.getValue petsc4py.PETSc.Vec-class.html#getValue petsc4py.PETSc.Vec.dotBegin petsc4py.PETSc.Vec-class.html#dotBegin petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Vec.__sub__ petsc4py.PETSc.Vec-class.html#__sub__ petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Vec.ghostUpdate petsc4py.PETSc.Vec-class.html#ghostUpdate petsc4py.PETSc.Vec.__rtruediv__ petsc4py.PETSc.Vec-class.html#__rtruediv__ petsc4py.PETSc.Vec.zeroEntries petsc4py.PETSc.Vec-class.html#zeroEntries petsc4py.PETSc.Vec.pointwiseMin petsc4py.PETSc.Vec-class.html#pointwiseMin petsc4py.PETSc.Vec.conjugate petsc4py.PETSc.Vec-class.html#conjugate petsc4py.PETSc.Vec.local_size petsc4py.PETSc.Vec-class.html#local_size petsc4py.PETSc.Vec.getOffloadMask petsc4py.PETSc.Vec-class.html#getOffloadMask petsc4py.PETSc.Vec.ghostUpdateEnd petsc4py.PETSc.Vec-class.html#ghostUpdateEnd petsc4py.PETSc.Vec.getOptionsPrefix petsc4py.PETSc.Vec-class.html#getOptionsPrefix petsc4py.PETSc.Vec.getValuesStagStencil petsc4py.PETSc.Vec-class.html#getValuesStagStencil petsc4py.PETSc.Vec.axpy petsc4py.PETSc.Vec-class.html#axpy petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Vec.normalize petsc4py.PETSc.Vec-class.html#normalize petsc4py.PETSc.Vec.pointwiseMax petsc4py.PETSc.Vec-class.html#pointwiseMax petsc4py.PETSc.Vec.setOptionsPrefix petsc4py.PETSc.Vec-class.html#setOptionsPrefix petsc4py.PETSc.Vec.min petsc4py.PETSc.Vec-class.html#min petsc4py.PETSc.Vec.setOption petsc4py.PETSc.Vec-class.html#setOption petsc4py.PETSc.Vec.toDLPack petsc4py.PETSc.Vec-class.html#toDLPack petsc4py.PETSc.Vec.__pos__ petsc4py.PETSc.Vec-class.html#__pos__ petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Vec.waxpy petsc4py.PETSc.Vec-class.html#waxpy petsc4py.PETSc.Vec.destroy petsc4py.PETSc.Vec-class.html#destroy petsc4py.PETSc.Vec.createGhost petsc4py.PETSc.Vec-class.html#createGhost petsc4py.PETSc.Vec.mtDotEnd petsc4py.PETSc.Vec-class.html#mtDotEnd petsc4py.PETSc.Vec.setSizes petsc4py.PETSc.Vec-class.html#setSizes petsc4py.PETSc.Vec.resetArray petsc4py.PETSc.Vec-class.html#resetArray petsc4py.PETSc.Vec.createWithDLPack petsc4py.PETSc.Vec-class.html#createWithDLPack petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Vec.clearDLPackInfo petsc4py.PETSc.Vec-class.html#clearDLPackInfo petsc4py.PETSc.Vec.getValues petsc4py.PETSc.Vec-class.html#getValues petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Vec.buffer petsc4py.PETSc.Vec-class.html#buffer petsc4py.PETSc.Vec.max petsc4py.PETSc.Vec-class.html#max petsc4py.PETSc.Vec.__idiv__ petsc4py.PETSc.Vec-class.html#__idiv__ petsc4py.PETSc.Vec.getOwnershipRange petsc4py.PETSc.Vec-class.html#getOwnershipRange petsc4py.PETSc.Vec.strideNorm petsc4py.PETSc.Vec-class.html#strideNorm petsc4py.PETSc.Vec.__imul__ petsc4py.PETSc.Vec-class.html#__imul__ petsc4py.PETSc.Vec.__add__ petsc4py.PETSc.Vec-class.html#__add__ petsc4py.PETSc.Vec.__array_interface__ petsc4py.PETSc.Vec-class.html#__array_interface__ petsc4py.PETSc.Vec.mtDot petsc4py.PETSc.Vec-class.html#mtDot petsc4py.PETSc.Vec.getBuffer petsc4py.PETSc.Vec-class.html#getBuffer petsc4py.PETSc.Vec.__new__ petsc4py.PETSc.Vec-class.html#__new__ petsc4py.PETSc.Vec.placeArray petsc4py.PETSc.Vec-class.html#placeArray petsc4py.PETSc.Vec.__radd__ petsc4py.PETSc.Vec-class.html#__radd__ petsc4py.PETSc.Vec.setNestSubVecs petsc4py.PETSc.Vec-class.html#setNestSubVecs petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Vec.__div__ petsc4py.PETSc.Vec-class.html#__div__ petsc4py.PETSc.Vec.__neg__ petsc4py.PETSc.Vec-class.html#__neg__ petsc4py.PETSc.Vec.exp petsc4py.PETSc.Vec-class.html#exp petsc4py.PETSc.Vec.setArray petsc4py.PETSc.Vec-class.html#setArray petsc4py.PETSc.Vec.localForm petsc4py.PETSc.Vec-class.html#localForm petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Vec.dot petsc4py.PETSc.Vec-class.html#dot petsc4py.PETSc.Vec.Option petsc4py.PETSc.Vec.Option-class.html petsc4py.PETSc.Vec.Option.IGNORE_NEGATIVE_INDICES petsc4py.PETSc.Vec.Option-class.html#IGNORE_NEGATIVE_INDICES petsc4py.PETSc.Vec.Option.IGNORE_OFF_PROC_ENTRIES petsc4py.PETSc.Vec.Option-class.html#IGNORE_OFF_PROC_ENTRIES petsc4py.PETSc.Vec.Option.__qualname__ petsc4py.PETSc.Vec.Option-class.html#__qualname__ petsc4py.PETSc.Vec.Type petsc4py.PETSc.Vec.Type-class.html petsc4py.PETSc.Vec.Type.MPICUDA petsc4py.PETSc.Vec.Type-class.html#MPICUDA petsc4py.PETSc.Vec.Type.KOKKOS petsc4py.PETSc.Vec.Type-class.html#KOKKOS petsc4py.PETSc.Vec.Type.SEQCUDA petsc4py.PETSc.Vec.Type-class.html#SEQCUDA petsc4py.PETSc.Vec.Type.SEQ petsc4py.PETSc.Vec.Type-class.html#SEQ petsc4py.PETSc.Vec.Type.CUDA petsc4py.PETSc.Vec.Type-class.html#CUDA petsc4py.PETSc.Vec.Type.SEQVIENNACL petsc4py.PETSc.Vec.Type-class.html#SEQVIENNACL petsc4py.PETSc.Vec.Type.SEQKOKKOS petsc4py.PETSc.Vec.Type-class.html#SEQKOKKOS petsc4py.PETSc.Vec.Type.STANDARD petsc4py.PETSc.Vec.Type-class.html#STANDARD petsc4py.PETSc.Vec.Type.MPIKOKKOS petsc4py.PETSc.Vec.Type-class.html#MPIKOKKOS petsc4py.PETSc.Vec.Type.MPI petsc4py.PETSc.Vec.Type-class.html#MPI petsc4py.PETSc.Vec.Type.__qualname__ petsc4py.PETSc.Vec.Type-class.html#__qualname__ petsc4py.PETSc.Vec.Type.MPIVIENNACL petsc4py.PETSc.Vec.Type-class.html#MPIVIENNACL petsc4py.PETSc.Vec.Type.NEST petsc4py.PETSc.Vec.Type-class.html#NEST petsc4py.PETSc.Vec.Type.SHARED petsc4py.PETSc.Vec.Type-class.html#SHARED petsc4py.PETSc.Vec.Type.VIENNACL petsc4py.PETSc.Vec.Type-class.html#VIENNACL petsc4py.PETSc.Viewer petsc4py.PETSc.Viewer-class.html petsc4py.PETSc.Viewer.printfASCII petsc4py.PETSc.Viewer-class.html#printfASCII petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Viewer.printfASCIISynchronized petsc4py.PETSc.Viewer-class.html#printfASCIISynchronized petsc4py.PETSc.Viewer.createVTK petsc4py.PETSc.Viewer-class.html#createVTK petsc4py.PETSc.Viewer.popASCIITab petsc4py.PETSc.Viewer-class.html#popASCIITab petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Viewer.__call__ petsc4py.PETSc.Viewer-class.html#__call__ petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Viewer.createDraw petsc4py.PETSc.Viewer-class.html#createDraw petsc4py.PETSc.Viewer.BINARY petsc4py.PETSc.Viewer-class.html#BINARY petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Viewer.createBinary petsc4py.PETSc.Viewer-class.html#createBinary petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Viewer.pushASCIITab petsc4py.PETSc.Viewer-class.html#pushASCIITab petsc4py.PETSc.Viewer.popFormat petsc4py.PETSc.Viewer-class.html#popFormat petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Viewer.ASCII petsc4py.PETSc.Viewer-class.html#ASCII petsc4py.PETSc.Viewer.view petsc4py.PETSc.Viewer-class.html#view petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.Viewer.flush petsc4py.PETSc.Viewer-class.html#flush petsc4py.PETSc.Viewer.Type petsc4py.PETSc.Viewer.Type-class.html petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Viewer.popASCIISynchronized petsc4py.PETSc.Viewer-class.html#popASCIISynchronized petsc4py.PETSc.Viewer.createHDF5 petsc4py.PETSc.Viewer-class.html#createHDF5 petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Viewer.getFormat petsc4py.PETSc.Viewer-class.html#getFormat petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Viewer.STDERR petsc4py.PETSc.Viewer-class.html#STDERR petsc4py.PETSc.Viewer.setASCIITab petsc4py.PETSc.Viewer-class.html#setASCIITab petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Viewer.pushFormat petsc4py.PETSc.Viewer-class.html#pushFormat petsc4py.PETSc.Viewer.setType petsc4py.PETSc.Viewer-class.html#setType petsc4py.PETSc.Viewer.getASCIITab petsc4py.PETSc.Viewer-class.html#getASCIITab petsc4py.PETSc.Viewer.create petsc4py.PETSc.Viewer-class.html#create petsc4py.PETSc.Viewer.clearDraw petsc4py.PETSc.Viewer-class.html#clearDraw petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Viewer.DRAW petsc4py.PETSc.Viewer-class.html#DRAW petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Viewer.getType petsc4py.PETSc.Viewer-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Viewer.setDrawInfo petsc4py.PETSc.Viewer-class.html#setDrawInfo petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Viewer.getFileName petsc4py.PETSc.Viewer-class.html#getFileName petsc4py.PETSc.Viewer.createASCII petsc4py.PETSc.Viewer-class.html#createASCII petsc4py.PETSc.Viewer.pushASCIISynchronized petsc4py.PETSc.Viewer-class.html#pushASCIISynchronized petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Viewer.Size petsc4py.PETSc.Viewer.Size-class.html petsc4py.PETSc.Viewer.getFileMode petsc4py.PETSc.Viewer-class.html#getFileMode petsc4py.PETSc.Viewer.STDOUT petsc4py.PETSc.Viewer-class.html#STDOUT petsc4py.PETSc.Viewer.addASCIITab petsc4py.PETSc.Viewer-class.html#addASCIITab petsc4py.PETSc.Viewer.__new__ petsc4py.PETSc.Viewer-class.html#__new__ petsc4py.PETSc.Viewer.Format petsc4py.PETSc.Viewer.Format-class.html petsc4py.PETSc.Viewer.setFileMode petsc4py.PETSc.Viewer-class.html#setFileMode petsc4py.PETSc.Viewer.destroy petsc4py.PETSc.Viewer-class.html#destroy petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.Viewer.useASCIITabs petsc4py.PETSc.Viewer-class.html#useASCIITabs petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Viewer.Mode petsc4py.PETSc.Viewer.Mode-class.html petsc4py.PETSc.Viewer.createMPIIO petsc4py.PETSc.Viewer-class.html#createMPIIO petsc4py.PETSc.Viewer.subtractASCIITab petsc4py.PETSc.Viewer-class.html#subtractASCIITab petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Viewer.setFileName petsc4py.PETSc.Viewer-class.html#setFileName petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc.Viewer.Format petsc4py.PETSc.Viewer.Format-class.html petsc4py.PETSc.Viewer.Format.NOFORMAT petsc4py.PETSc.Viewer.Format-class.html#NOFORMAT petsc4py.PETSc.Viewer.Format.DRAW_LG petsc4py.PETSc.Viewer.Format-class.html#DRAW_LG petsc4py.PETSc.Viewer.Format.ASCII_VTK_COORDS petsc4py.PETSc.Viewer.Format-class.html#ASCII_VTK_COORDS petsc4py.PETSc.Viewer.Format.ASCII_PYTHON petsc4py.PETSc.Viewer.Format-class.html#ASCII_PYTHON petsc4py.PETSc.Viewer.Format.DEFAULT petsc4py.PETSc.Viewer.Format-class.html#DEFAULT petsc4py.PETSc.Viewer.Format.DRAW_BASIC petsc4py.PETSc.Viewer.Format-class.html#DRAW_BASIC petsc4py.PETSc.Viewer.Format.ASCII_INDEX petsc4py.PETSc.Viewer.Format-class.html#ASCII_INDEX petsc4py.PETSc.Viewer.Format.ASCII_IMPL petsc4py.PETSc.Viewer.Format-class.html#ASCII_IMPL petsc4py.PETSc.Viewer.Format.HDF5_PETSC petsc4py.PETSc.Viewer.Format-class.html#HDF5_PETSC petsc4py.PETSc.Viewer.Format.ASCII_MATRIXMARKET petsc4py.PETSc.Viewer.Format-class.html#ASCII_MATRIXMARKET petsc4py.PETSc.Viewer.Format.VTK_VTS petsc4py.PETSc.Viewer.Format-class.html#VTK_VTS petsc4py.PETSc.Viewer.Format.VTK_VTR petsc4py.PETSc.Viewer.Format-class.html#VTK_VTR petsc4py.PETSc.Viewer.Format.VTK_VTU petsc4py.PETSc.Viewer.Format-class.html#VTK_VTU petsc4py.PETSc.Viewer.Format.NATIVE petsc4py.PETSc.Viewer.Format-class.html#NATIVE petsc4py.PETSc.Viewer.Format.DRAW_LG_XRANGE petsc4py.PETSc.Viewer.Format-class.html#DRAW_LG_XRANGE petsc4py.PETSc.Viewer.Format.ASCII_LATEX petsc4py.PETSc.Viewer.Format-class.html#ASCII_LATEX petsc4py.PETSc.Viewer.Format.ASCII_GLVIS petsc4py.PETSc.Viewer.Format-class.html#ASCII_GLVIS petsc4py.PETSc.Viewer.Format.ASCII_VTK petsc4py.PETSc.Viewer.Format-class.html#ASCII_VTK petsc4py.PETSc.Viewer.Format.DRAW_CONTOUR petsc4py.PETSc.Viewer.Format-class.html#DRAW_CONTOUR petsc4py.PETSc.Viewer.Format.ASCII_CSV petsc4py.PETSc.Viewer.Format-class.html#ASCII_CSV petsc4py.PETSc.Viewer.Format.LOAD_BALANCE petsc4py.PETSc.Viewer.Format-class.html#LOAD_BALANCE petsc4py.PETSc.Viewer.Format.ASCII_INFO petsc4py.PETSc.Viewer.Format-class.html#ASCII_INFO petsc4py.PETSc.Viewer.Format.ASCII_MATLAB petsc4py.PETSc.Viewer.Format-class.html#ASCII_MATLAB petsc4py.PETSc.Viewer.Format.ASCII_FACTOR_INFO petsc4py.PETSc.Viewer.Format-class.html#ASCII_FACTOR_INFO petsc4py.PETSc.Viewer.Format.HDF5_XDMF petsc4py.PETSc.Viewer.Format-class.html#HDF5_XDMF petsc4py.PETSc.Viewer.Format.ASCII_XML petsc4py.PETSc.Viewer.Format-class.html#ASCII_XML petsc4py.PETSc.Viewer.Format.ASCII_SYMMODU petsc4py.PETSc.Viewer.Format-class.html#ASCII_SYMMODU petsc4py.PETSc.Viewer.Format.HDF5_VIZ petsc4py.PETSc.Viewer.Format-class.html#HDF5_VIZ petsc4py.PETSc.Viewer.Format.HDF5_MAT petsc4py.PETSc.Viewer.Format-class.html#HDF5_MAT petsc4py.PETSc.Viewer.Format.ASCII_VTK_CELL petsc4py.PETSc.Viewer.Format-class.html#ASCII_VTK_CELL petsc4py.PETSc.Viewer.Format.ASCII_INFO_DETAIL petsc4py.PETSc.Viewer.Format-class.html#ASCII_INFO_DETAIL petsc4py.PETSc.Viewer.Format.ASCII_MATHEMATICA petsc4py.PETSc.Viewer.Format-class.html#ASCII_MATHEMATICA petsc4py.PETSc.Viewer.Format.ASCII_PCICE petsc4py.PETSc.Viewer.Format-class.html#ASCII_PCICE petsc4py.PETSc.Viewer.Format.__qualname__ petsc4py.PETSc.Viewer.Format-class.html#__qualname__ petsc4py.PETSc.Viewer.Format.FAILED petsc4py.PETSc.Viewer.Format-class.html#FAILED petsc4py.PETSc.Viewer.Format.ASCII_COMMON petsc4py.PETSc.Viewer.Format-class.html#ASCII_COMMON petsc4py.PETSc.Viewer.Format.ASCII_DENSE petsc4py.PETSc.Viewer.Format-class.html#ASCII_DENSE petsc4py.PETSc.Viewer.Format.DRAW_PORTS petsc4py.PETSc.Viewer.Format-class.html#DRAW_PORTS petsc4py.PETSc.Viewer.Format.BINARY_MATLAB petsc4py.PETSc.Viewer.Format-class.html#BINARY_MATLAB petsc4py.PETSc.Viewer.Mode petsc4py.PETSc.Viewer.Mode-class.html petsc4py.PETSc.Viewer.Mode.READ petsc4py.PETSc.Viewer.Mode-class.html#READ petsc4py.PETSc.Viewer.Mode.APPEND petsc4py.PETSc.Viewer.Mode-class.html#APPEND petsc4py.PETSc.Viewer.Mode.APPEND_UPDATE petsc4py.PETSc.Viewer.Mode-class.html#APPEND_UPDATE petsc4py.PETSc.Viewer.Mode.A petsc4py.PETSc.Viewer.Mode-class.html#A petsc4py.PETSc.Viewer.Mode.UPDATE petsc4py.PETSc.Viewer.Mode-class.html#UPDATE petsc4py.PETSc.Viewer.Mode.WRITE petsc4py.PETSc.Viewer.Mode-class.html#WRITE petsc4py.PETSc.Viewer.Mode.U petsc4py.PETSc.Viewer.Mode-class.html#U petsc4py.PETSc.Viewer.Mode.W petsc4py.PETSc.Viewer.Mode-class.html#W petsc4py.PETSc.Viewer.Mode.__qualname__ petsc4py.PETSc.Viewer.Mode-class.html#__qualname__ petsc4py.PETSc.Viewer.Mode.R petsc4py.PETSc.Viewer.Mode-class.html#R petsc4py.PETSc.Viewer.Mode.AU petsc4py.PETSc.Viewer.Mode-class.html#AU petsc4py.PETSc.Viewer.Mode.UA petsc4py.PETSc.Viewer.Mode-class.html#UA petsc4py.PETSc.Viewer.Size petsc4py.PETSc.Viewer.Size-class.html petsc4py.PETSc.Viewer.Size.HALF_SIZE petsc4py.PETSc.Viewer.Size-class.html#HALF_SIZE petsc4py.PETSc.Viewer.Size.FULL_SIZE petsc4py.PETSc.Viewer.Size-class.html#FULL_SIZE petsc4py.PETSc.Viewer.Size.FULL petsc4py.PETSc.Viewer.Size-class.html#FULL petsc4py.PETSc.Viewer.Size.THIRD petsc4py.PETSc.Viewer.Size-class.html#THIRD petsc4py.PETSc.Viewer.Size.HALF petsc4py.PETSc.Viewer.Size-class.html#HALF petsc4py.PETSc.Viewer.Size.QUARTER petsc4py.PETSc.Viewer.Size-class.html#QUARTER petsc4py.PETSc.Viewer.Size.QUARTER_SIZE petsc4py.PETSc.Viewer.Size-class.html#QUARTER_SIZE petsc4py.PETSc.Viewer.Size.__qualname__ petsc4py.PETSc.Viewer.Size-class.html#__qualname__ petsc4py.PETSc.Viewer.Size.THIRD_SIZE petsc4py.PETSc.Viewer.Size-class.html#THIRD_SIZE petsc4py.PETSc.Viewer.Type petsc4py.PETSc.Viewer.Type-class.html petsc4py.PETSc.Viewer.Type.HDF5 petsc4py.PETSc.Viewer.Type-class.html#HDF5 petsc4py.PETSc.Viewer.Type.SAWS petsc4py.PETSc.Viewer.Type-class.html#SAWS petsc4py.PETSc.Viewer.Type.ADIOS2 petsc4py.PETSc.Viewer.Type-class.html#ADIOS2 petsc4py.PETSc.Viewer.Type.MATLAB petsc4py.PETSc.Viewer.Type-class.html#MATLAB petsc4py.PETSc.Viewer.Type.ADIOS petsc4py.PETSc.Viewer.Type-class.html#ADIOS petsc4py.PETSc.Viewer.Type.DRAW petsc4py.PETSc.Viewer.Type-class.html#DRAW petsc4py.PETSc.Viewer.Type.STRING petsc4py.PETSc.Viewer.Type-class.html#STRING petsc4py.PETSc.Viewer.Type.VTK petsc4py.PETSc.Viewer.Type-class.html#VTK petsc4py.PETSc.Viewer.Type.MATHEMATICA petsc4py.PETSc.Viewer.Type-class.html#MATHEMATICA petsc4py.PETSc.Viewer.Type.GLVIS petsc4py.PETSc.Viewer.Type-class.html#GLVIS petsc4py.PETSc.Viewer.Type.VU petsc4py.PETSc.Viewer.Type-class.html#VU petsc4py.PETSc.Viewer.Type.BINARY petsc4py.PETSc.Viewer.Type-class.html#BINARY petsc4py.PETSc.Viewer.Type.SOCKET petsc4py.PETSc.Viewer.Type-class.html#SOCKET petsc4py.PETSc.Viewer.Type.EXODUSII petsc4py.PETSc.Viewer.Type-class.html#EXODUSII petsc4py.PETSc.Viewer.Type.__qualname__ petsc4py.PETSc.Viewer.Type-class.html#__qualname__ petsc4py.PETSc.Viewer.Type.ASCII petsc4py.PETSc.Viewer.Type-class.html#ASCII petsc4py.PETSc.ViewerHDF5 petsc4py.PETSc.ViewerHDF5-class.html petsc4py.PETSc.Viewer.printfASCII petsc4py.PETSc.Viewer-class.html#printfASCII petsc4py.PETSc.Object.getAttr petsc4py.PETSc.Object-class.html#getAttr petsc4py.PETSc.Object.query petsc4py.PETSc.Object-class.html#query petsc4py.PETSc.Object.__lt__ petsc4py.PETSc.Object-class.html#__lt__ petsc4py.PETSc.ViewerHDF5.getGroup petsc4py.PETSc.ViewerHDF5-class.html#getGroup petsc4py.PETSc.Object.getTabLevel petsc4py.PETSc.Object-class.html#getTabLevel petsc4py.PETSc.Viewer.printfASCIISynchronized petsc4py.PETSc.Viewer-class.html#printfASCIISynchronized petsc4py.PETSc.Viewer.createVTK petsc4py.PETSc.Viewer-class.html#createVTK petsc4py.PETSc.Viewer.popASCIITab petsc4py.PETSc.Viewer-class.html#popASCIITab petsc4py.PETSc.Object.fortran petsc4py.PETSc.Object-class.html#fortran petsc4py.PETSc.Viewer.__call__ petsc4py.PETSc.Viewer-class.html#__call__ petsc4py.PETSc.Object.handle petsc4py.PETSc.Object-class.html#handle petsc4py.PETSc.Object.setOptionsPrefix petsc4py.PETSc.Object-class.html#setOptionsPrefix petsc4py.PETSc.Object.__deepcopy__ petsc4py.PETSc.Object-class.html#__deepcopy__ petsc4py.PETSc.Object.setFromOptions petsc4py.PETSc.Object-class.html#setFromOptions petsc4py.PETSc.Object.__gt__ petsc4py.PETSc.Object-class.html#__gt__ petsc4py.PETSc.Viewer.createDraw petsc4py.PETSc.Viewer-class.html#createDraw petsc4py.PETSc.Viewer.BINARY petsc4py.PETSc.Viewer-class.html#BINARY petsc4py.PETSc.Object.__nonzero__ petsc4py.PETSc.Object-class.html#__nonzero__ petsc4py.PETSc.Object.name petsc4py.PETSc.Object-class.html#name petsc4py.PETSc.Viewer.createBinary petsc4py.PETSc.Viewer-class.html#createBinary petsc4py.PETSc.Object.getClassId petsc4py.PETSc.Object-class.html#getClassId petsc4py.PETSc.Object.prefix petsc4py.PETSc.Object-class.html#prefix petsc4py.PETSc.Viewer.pushASCIITab petsc4py.PETSc.Viewer-class.html#pushASCIITab petsc4py.PETSc.Viewer.popFormat petsc4py.PETSc.Viewer-class.html#popFormat petsc4py.PETSc.Object.__copy__ petsc4py.PETSc.Object-class.html#__copy__ petsc4py.PETSc.Viewer.ASCII petsc4py.PETSc.Viewer-class.html#ASCII petsc4py.PETSc.Viewer.view petsc4py.PETSc.Viewer-class.html#view petsc4py.PETSc.Object.decRef petsc4py.PETSc.Object-class.html#decRef petsc4py.PETSc.ViewerHDF5.popGroup petsc4py.PETSc.ViewerHDF5-class.html#popGroup petsc4py.PETSc.Viewer.flush petsc4py.PETSc.Viewer-class.html#flush petsc4py.PETSc.Viewer.Type petsc4py.PETSc.Viewer.Type-class.html petsc4py.PETSc.Object.getName petsc4py.PETSc.Object-class.html#getName petsc4py.PETSc.Object.incrementTabLevel petsc4py.PETSc.Object-class.html#incrementTabLevel petsc4py.PETSc.Object.__ne__ petsc4py.PETSc.Object-class.html#__ne__ petsc4py.PETSc.Viewer.popASCIISynchronized petsc4py.PETSc.Viewer-class.html#popASCIISynchronized petsc4py.PETSc.Viewer.createHDF5 petsc4py.PETSc.Viewer-class.html#createHDF5 petsc4py.PETSc.Object.getOptionsPrefix petsc4py.PETSc.Object-class.html#getOptionsPrefix petsc4py.PETSc.Object.compose petsc4py.PETSc.Object-class.html#compose petsc4py.PETSc.Object.comm petsc4py.PETSc.Object-class.html#comm petsc4py.PETSc.Object.viewFromOptions petsc4py.PETSc.Object-class.html#viewFromOptions petsc4py.PETSc.Viewer.getFormat petsc4py.PETSc.Viewer-class.html#getFormat petsc4py.PETSc.ViewerHDF5.incrementTimestep petsc4py.PETSc.ViewerHDF5-class.html#incrementTimestep petsc4py.PETSc.Object.getDict petsc4py.PETSc.Object-class.html#getDict petsc4py.PETSc.Viewer.STDERR petsc4py.PETSc.Viewer-class.html#STDERR petsc4py.PETSc.Viewer.setASCIITab petsc4py.PETSc.Viewer-class.html#setASCIITab petsc4py.PETSc.Object.classid petsc4py.PETSc.Object-class.html#classid petsc4py.PETSc.Viewer.pushFormat petsc4py.PETSc.Viewer-class.html#pushFormat petsc4py.PETSc.Viewer.setType petsc4py.PETSc.Viewer-class.html#setType petsc4py.PETSc.Viewer.getASCIITab petsc4py.PETSc.Viewer-class.html#getASCIITab petsc4py.PETSc.ViewerHDF5.create petsc4py.PETSc.ViewerHDF5-class.html#create petsc4py.PETSc.Viewer.clearDraw petsc4py.PETSc.Viewer-class.html#clearDraw petsc4py.PETSc.Object.type petsc4py.PETSc.Object-class.html#type petsc4py.PETSc.Viewer.DRAW petsc4py.PETSc.Viewer-class.html#DRAW petsc4py.PETSc.Object.getRefCount petsc4py.PETSc.Object-class.html#getRefCount petsc4py.PETSc.Object.incRef petsc4py.PETSc.Object-class.html#incRef petsc4py.PETSc.Object.setName petsc4py.PETSc.Object-class.html#setName petsc4py.PETSc.Viewer.getType petsc4py.PETSc.Viewer-class.html#getType petsc4py.PETSc.Object.refcount petsc4py.PETSc.Object-class.html#refcount petsc4py.PETSc.Viewer.setDrawInfo petsc4py.PETSc.Viewer-class.html#setDrawInfo petsc4py.PETSc.Object.__eq__ petsc4py.PETSc.Object-class.html#__eq__ petsc4py.PETSc.Viewer.getFileName petsc4py.PETSc.Viewer-class.html#getFileName petsc4py.PETSc.Viewer.createASCII petsc4py.PETSc.Viewer-class.html#createASCII petsc4py.PETSc.Viewer.pushASCIISynchronized petsc4py.PETSc.Viewer-class.html#pushASCIISynchronized petsc4py.PETSc.Object.__le__ petsc4py.PETSc.Object-class.html#__le__ petsc4py.PETSc.ViewerHDF5.getTimestep petsc4py.PETSc.ViewerHDF5-class.html#getTimestep petsc4py.PETSc.Object.getClassName petsc4py.PETSc.Object-class.html#getClassName petsc4py.PETSc.Object.__ge__ petsc4py.PETSc.Object-class.html#__ge__ petsc4py.PETSc.Viewer.Size petsc4py.PETSc.Viewer.Size-class.html petsc4py.PETSc.Viewer.getFileMode petsc4py.PETSc.Viewer-class.html#getFileMode petsc4py.PETSc.Viewer.STDOUT petsc4py.PETSc.Viewer-class.html#STDOUT petsc4py.PETSc.Viewer.addASCIITab petsc4py.PETSc.Viewer-class.html#addASCIITab petsc4py.PETSc.ViewerHDF5.__new__ petsc4py.PETSc.ViewerHDF5-class.html#__new__ petsc4py.PETSc.Viewer.Format petsc4py.PETSc.Viewer.Format-class.html petsc4py.PETSc.Viewer.setFileMode petsc4py.PETSc.Viewer-class.html#setFileMode petsc4py.PETSc.Viewer.destroy petsc4py.PETSc.Viewer-class.html#destroy petsc4py.PETSc.Object.stateIncrease petsc4py.PETSc.Object-class.html#stateIncrease petsc4py.PETSc.ViewerHDF5.pushGroup petsc4py.PETSc.ViewerHDF5-class.html#pushGroup petsc4py.PETSc.Viewer.useASCIITabs petsc4py.PETSc.Viewer-class.html#useASCIITabs petsc4py.PETSc.Object.setAttr petsc4py.PETSc.Object-class.html#setAttr petsc4py.PETSc.Viewer.Mode petsc4py.PETSc.Viewer.Mode-class.html petsc4py.PETSc.Viewer.createMPIIO petsc4py.PETSc.Viewer-class.html#createMPIIO petsc4py.PETSc.Viewer.subtractASCIITab petsc4py.PETSc.Viewer-class.html#subtractASCIITab petsc4py.PETSc.ViewerHDF5.setTimestep petsc4py.PETSc.ViewerHDF5-class.html#setTimestep petsc4py.PETSc.Object.getComm petsc4py.PETSc.Object-class.html#getComm petsc4py.PETSc.Viewer.setFileName petsc4py.PETSc.Viewer-class.html#setFileName petsc4py.PETSc.Object.setTabLevel petsc4py.PETSc.Object-class.html#setTabLevel petsc4py.PETSc.Object.klass petsc4py.PETSc.Object-class.html#klass petsc4py.PETSc._DMComposite_access petsc4py.PETSc._DMComposite_access-class.html petsc4py.PETSc._DMComposite_access.__exit__ petsc4py.PETSc._DMComposite_access-class.html#__exit__ petsc4py.PETSc._DMComposite_access.__new__ petsc4py.PETSc._DMComposite_access-class.html#__new__ petsc4py.PETSc._DMComposite_access.__enter__ petsc4py.PETSc._DMComposite_access-class.html#__enter__ petsc4py.PETSc._DMDA_Vec_array petsc4py.PETSc._DMDA_Vec_array-class.html petsc4py.PETSc._DMDA_Vec_array.shape petsc4py.PETSc._DMDA_Vec_array-class.html#shape petsc4py.PETSc._DMDA_Vec_array.array petsc4py.PETSc._DMDA_Vec_array-class.html#array petsc4py.PETSc._DMDA_Vec_array.__new__ petsc4py.PETSc._DMDA_Vec_array-class.html#__new__ petsc4py.PETSc._DMDA_Vec_array.__enter__ petsc4py.PETSc._DMDA_Vec_array-class.html#__enter__ petsc4py.PETSc._DMDA_Vec_array.__exit__ petsc4py.PETSc._DMDA_Vec_array-class.html#__exit__ petsc4py.PETSc._DMDA_Vec_array.__getitem__ petsc4py.PETSc._DMDA_Vec_array-class.html#__getitem__ petsc4py.PETSc._DMDA_Vec_array.strides petsc4py.PETSc._DMDA_Vec_array-class.html#strides petsc4py.PETSc._DMDA_Vec_array.__setitem__ petsc4py.PETSc._DMDA_Vec_array-class.html#__setitem__ petsc4py.PETSc._DMDA_Vec_array.__delitem__ petsc4py.PETSc._DMDA_Vec_array-class.html#__delitem__ petsc4py.PETSc._DMDA_Vec_array.sizes petsc4py.PETSc._DMDA_Vec_array-class.html#sizes petsc4py.PETSc._DMDA_Vec_array.starts petsc4py.PETSc._DMDA_Vec_array-class.html#starts petsc4py.PETSc._IS_buffer petsc4py.PETSc._IS_buffer-class.html petsc4py.PETSc._IS_buffer.__exit__ petsc4py.PETSc._IS_buffer-class.html#__exit__ petsc4py.PETSc._IS_buffer.__new__ petsc4py.PETSc._IS_buffer-class.html#__new__ petsc4py.PETSc._IS_buffer.__enter__ petsc4py.PETSc._IS_buffer-class.html#__enter__ petsc4py.PETSc._IS_buffer.__array_interface__ petsc4py.PETSc._IS_buffer-class.html#__array_interface__ petsc4py.PETSc._Mat_Stencil petsc4py.PETSc._Mat_Stencil-class.html petsc4py.PETSc._Mat_Stencil.index petsc4py.PETSc._Mat_Stencil-class.html#index petsc4py.PETSc._Mat_Stencil.c petsc4py.PETSc._Mat_Stencil-class.html#c petsc4py.PETSc._Mat_Stencil.__new__ petsc4py.PETSc._Mat_Stencil-class.html#__new__ petsc4py.PETSc._Mat_Stencil.i petsc4py.PETSc._Mat_Stencil-class.html#i petsc4py.PETSc._Mat_Stencil.k petsc4py.PETSc._Mat_Stencil-class.html#k petsc4py.PETSc._Mat_Stencil.j petsc4py.PETSc._Mat_Stencil-class.html#j petsc4py.PETSc._Mat_Stencil.field petsc4py.PETSc._Mat_Stencil-class.html#field petsc4py.PETSc._Vec_LocalForm petsc4py.PETSc._Vec_LocalForm-class.html petsc4py.PETSc._Vec_LocalForm.__exit__ petsc4py.PETSc._Vec_LocalForm-class.html#__exit__ petsc4py.PETSc._Vec_LocalForm.__new__ petsc4py.PETSc._Vec_LocalForm-class.html#__new__ petsc4py.PETSc._Vec_LocalForm.__enter__ petsc4py.PETSc._Vec_LocalForm-class.html#__enter__ petsc4py.PETSc._Vec_LocalForm.__init__ petsc4py.PETSc._Vec_LocalForm-class.html#__init__ petsc4py.PETSc._Vec_buffer petsc4py.PETSc._Vec_buffer-class.html petsc4py.PETSc._Vec_buffer.__exit__ petsc4py.PETSc._Vec_buffer-class.html#__exit__ petsc4py.PETSc._Vec_buffer.__new__ petsc4py.PETSc._Vec_buffer-class.html#__new__ petsc4py.PETSc._Vec_buffer.__enter__ petsc4py.PETSc._Vec_buffer-class.html#__enter__ petsc4py.PETSc._Vec_buffer.__array_interface__ petsc4py.PETSc._Vec_buffer-class.html#__array_interface__ petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.TAO-class.html0000644000175000017500000017747614062764464023122 0ustar balaybalay00000000000000 petsc4py.PETSc.TAO
Package petsc4py :: Module PETSc :: Class TAO
[hide private]
[frames] | no frames]

Class TAO


TAO Solver
Nested Classes [hide private]
  Reason
TAO Solver Termination Reasons
  Type
TAO Solver Types
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
cancelMonitor(self)
 
computeConstraints(self, Vec x, Vec c)
 
computeDualVariables(self, Vec xl, Vec xu)
 
computeGradient(self, Vec x, Vec g)
 
computeHessian(self, Vec x, Mat H, Mat P=None)
 
computeJacobian(self, Vec x, Mat J, Mat P=None)
 
computeObjective(self, Vec x)
 
computeObjectiveGradient(self, Vec x, Vec g)
 
computeResidual(self, Vec x, Vec f)
 
computeVariableBounds(self, Vec xl, Vec xu)
 
create(self, comm=None)
 
destroy(self)
 
getAppCtx(self)
 
getBRGNDampingVector(self)
 
getBRGNSubsolver(self)
 
getConstraintTolerances(self)
 
getConvergedReason(self)
 
getConvergenceTest(self)
 
getFunctionValue(self)
 
getGradient(self)
 
getGradientNorm(self)
 
getIterationNumber(self)
 
getKSP(self)
 
getLMVMH0(self)
 
getLMVMH0KSP(self)
 
getMonitor(self)
 
getObjectiveValue(self)
 
getOptionsPrefix(self)
 
getSolution(self)
 
getSolutionNorm(self)
 
getSolutionStatus(self)
 
getTolerances(self)
 
getType(self)
 
getVariableBounds(self)
 
setAppCtx(self, appctx)
 
setBRGNDictionaryMatrix(self, Mat D)
 
setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None)
 
setBRGNRegularizerObjectiveGradient(self, objgrad, args=None, kargs=None)
 
setBRGNRegularizerWeight(self, weight)
 
setBRGNSmoothL1Epsilon(self, epsilon)
 
setConstraintTolerances(self, catol=None, crtol=None)
 
setConstraints(self, constraints, Vec C=None, args=None, kargs=None)
 
setConvergedReason(self, reason)
 
setConvergenceTest(self, converged, args=None, kargs=None)
 
setFromOptions(self)
 
setGradient(self, gradient, args=None, kargs=None)
 
setGradientNorm(self, Mat mat)
 
setHessian(self, hessian, Mat H=None, Mat P=None, args=None, kargs=None)
 
setInitial(self, Vec x)
 
setInitialTrustRegionRadius(self, radius)
 
setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)
 
setJacobianDesign(self, jacobian_design, Mat J=None, args=None, kargs=None)
 
setJacobianResidual(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)
 
setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, args=None, kargs=None)
 
setLMVMH0(self, Mat mat)
 
setMonitor(self, monitor, args=None, kargs=None)
 
setObjective(self, objective, args=None, kargs=None)
 
setObjectiveGradient(self, objgrad, args=None, kargs=None)
 
setOptionsPrefix(self, prefix)
 
setResidual(self, residual, Vec R=None, args=None, kargs=None)
 
setStateDesignIS(self, IS state=None, IS design=None)
 
setTolerances(self, gatol=None, grtol=None, gttol=None)
 
setType(self, tao_type)
 
setUp(self)
 
setVariableBounds(self, varbounds, args=None, kargs=None)
 
solve(self, Vec x=None)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  appctx
  cnorm
  converged
  ctol
  diverged
  ftol
  function
  gnorm
  gradient
  gtol
  iterating
  its
  ksp
  objective
  reason
  solution

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getOptionsPrefix(self)

 
Overrides: Object.getOptionsPrefix

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_6.png0000644000175000017500000000154414062764461023777 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc._IS_buffer-class.html0000644000175000017500000002355114062764465024463 0ustar balaybalay00000000000000 petsc4py.PETSc._IS_buffer
Package petsc4py :: Module PETSc :: Class _IS_buffer
[hide private]
[frames] | no frames]

Class _IS_buffer


Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, *exc)
a new object with type S, a subtype of T
__new__(S, ...)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  __array_interface__

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DS.Type-class.html0000644000175000017500000002007514062764461023700 0ustar balaybalay00000000000000 petsc4py.PETSc.DS.Type
Package petsc4py :: Module PETSc :: Class DS :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BASIC = 'basic'
  __qualname__ = 'DSType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Viewer.Mode-class.html0000644000175000017500000002473014062764465024604 0ustar balaybalay00000000000000 petsc4py.PETSc.Viewer.Mode
Package petsc4py :: Module PETSc :: Class Viewer :: Class Mode
[hide private]
[frames] | no frames]

Class Mode


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  A = 2
  APPEND = 2
  APPEND_UPDATE = 4
  AU = 4
  R = 0
  READ = 0
  U = 3
  UA = 4
  UPDATE = 3
  W = 1
  WRITE = 1
  __qualname__ = 'FileMode'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.AssemblyType-class.html0000644000175000017500000002151114062764462025610 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.AssemblyType
Package petsc4py :: Module PETSc :: Class Mat :: Class AssemblyType
[hide private]
[frames] | no frames]

Class AssemblyType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  FINAL = 0
  FINAL_ASSEMBLY = 0
  FLUSH = 1
  FLUSH_ASSEMBLY = 1
  __qualname__ = 'MatAssemblyType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.PatchConstructType-class.html0000644000175000017500000002212714062764463026563 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.PatchConstructType
Package petsc4py :: Module PETSc :: Class PC :: Class PatchConstructType
[hide private]
[frames] | no frames]

Class PatchConstructType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  PARDECOMP = 2
  PYTHON = 4
  STAR = 0
  USER = 3
  VANKA = 1
  __qualname__ = 'PCPatchConstructType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_pc.png0000644000175000017500000000370014062764462023170 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDuIDATx}Lǿ%kQEM!0ɠlݙs&I J3bt!Y d2ƛ.A V7fxK/N+ /- /ǮBZ4$|rNi8qo#e\^/ASS|2l޼yj!V%gtn)Vv6\.krV+*++ZÇh4:oܸ]vMvddiii +xENWWV^'O"&&0XjΜ900 ӶD 8"tvvz܏wِAjl6AA d"^O wDEEQcc03SZ[[Q__ǏC,@TB8}vl۶ zeepQdgg@VV dzgPXX:O ˪+V@XXشJ98ɄcݺuAvv6.]ݎW˗7ʕ+غu+f!99===ͅhDjj*dسg<i~[͖A,]m}PPxSH$Byy9֬Y| ׮]COOa:t* b~c<}ňD``9reWzN( @TT KII'\okkX,Zvb@bb|ѢE8Cprp8AMM CCC..e .\.GeeK?R\O2sd2JKK{n:7a( qi(ˡR\S*w, ;wB"33/_ƃ7oڵk166lp8<ٳLR-[F~~~GDDiʕKdJOO! ""@'TJ*ljȑ#$J)>>$ 9c̤83{M+=zDsrL499Iw%{]( ^aX\ʭV+T\x!D"Z~.>zʝ;w Z D2n) ?0eg/0rp9 nw+H$d>9?ׯ_Fv7st:l 9l\.Àa0rp9 \.Àa0rp9 \.Àa0rp9 lf /$%%!<<| d3ygt s&}&uǎy#ֆ\ + /+\.`r7%$8ɇO?ŏ.YFFyI bsrmmPa hz>B_FÖ{Km-  El,+` v=!T!2 D&CiAN}=Z[Nx8JO²`PQf}wrcqcr? ش ? ,ݎa;`lbz{!_"Ao *A))~O REEؘ3!V)- t6mu ~=/X_L)zgzDp}뜳Oq0~ş_Z>%OnAw7NtثѠ~~†+`8w{5l+.b""P<"LIffԲ5\.Àa0#JHF> 9 4s%""bN|¯Nr 1 φO ~IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.LGMap.Type-class.html0000644000175000017500000002071214062764461024330 0ustar balaybalay00000000000000 petsc4py.PETSc.LGMap.Type
Package petsc4py :: Module PETSc :: Class LGMap :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BASIC = 'basic'
  HASH = 'hash'
  __qualname__ = 'LGMapType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Viewer.Type-class.html0000644000175000017500000003247514062764465024646 0ustar balaybalay00000000000000 petsc4py.PETSc.Viewer.Type
Package petsc4py :: Module PETSc :: Class Viewer :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ADIOS = 'adios'
  ADIOS2 = 'adios2'
  ASCII = 'ascii'
  BINARY = 'binary'
  DRAW = 'draw'
  EXODUSII = 'exodusii'
  GLVIS = 'glvis'
  HDF5 = 'hdf5'
  MATHEMATICA = 'mathematica'
  MATLAB = 'matlab'
  SAWS = 'saws'
  SOCKET = 'socket'
  STRING = 'string'
  VTK = 'vtk'
  VU = 'vu'
  __qualname__ = 'ViewerType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_stenciltyp_2.png0000644000175000017500000000320114062764460025177 0ustar balaybalay00000000000000PNG  IHDRe$cQbKGD6IDAThyPg_rpH(A*ahG2#r[#PG["(#X=ڱS*3l'`}O}'*bPl0o;"/t(BXeRXX(HQ_͗6XF_}k@^Vff.5MQEES2~D"/t(BkIbqIUtɛ?4 #cpd;223trrs[2MUnW+<EG砛X,v9v(gVn n&1o#j**ʯ 577[ryV~fWlK[C ;KKd{{>6{% tvJ8rh(+陙O""buu@(t ink;aX ,5ĉף082K99W HrxǑII7 ?+~u^X &.00&-\FƯ <(=uH.ë}\] xcpيoɌLJ*ar}v 隦%RWqeCCkG1zt4857GXv _?kǎƋ7oRttҢ\X,]]<Ou--47kx|z7"Qbx5찍 8ܷ eo3/ąkM6o--uu`0019y7%EoFdYbv*03$ںⴿUUو>" Zq"~P:Ơs˕`UNHD8BPVFX̿*dZlL-'/_jhhmDňa@]Ee?@ݿYDssW)fFFDa0aNS(g-xB6Smmgo/<|!0P81|?,VWoYY%@Q\ ‰ob38R#kթ2[<>K`08{c֢~_z--} |aHcn-uu]]pYY$Y}0HANgo/m&MMԬDYYҷp#SFFcB!E?߸Ӄb T|?r O^22֭)DzTa)]OiJXX C@f"Q^iiL@%%%>(G&=6uvDɏGZ YZx@Ff0wv}>С б@om;T%Qߖ%EYBQ_PE^UIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_compositet.png0000644000175000017500000000363114062764463024760 0ustar balaybalay00000000000000PNG  IHDR|$ġsbKGDNIDATh}PSW|\ W!@>p+Jph—#,:EtJКqaء]wѭhJӊCQ7jmB0-($$Gf!I׹ys93c6k/On[`0wx~vzf.y˗ 5GlvB-_~%^|w:}Ms{q݀'t7` ɆS>{"2rGNByΜh^EŅ{`8 ϰht47PY))X,ԹsGdEnRh[EH:II8h?<\iW9 }l&{X.?7|W'˗EA+WƢޛ7M&H pA[x{wR)8`+*F񉉚>2,(hGNN7ظQ*%\o"fV+ްam|7Kv\)qqvCDٻ}' ;ϟ~ĉk}}˘܌""쎨Qo"qH3F+ImI`kI͹tŲ.ݾzf7*/33]]o<- xڢ{[f URboJ?hiJI }E"+TR ٥Kŵ095uu֭(|^t4nN_ I-,18hwD,'O|BZr^sn=~d]\7x.;=--Ubdfooܲem||/ٳCP}MM:~XikV Ęֽ3BB<><8؏Ls -m|bu߾ٞ3~_Y9pl X]Kds3#1@&,>-ݻ8<+Vr(>>2* DAгa%JJ۹3c\6;-\ޑOR?F @mb\~ɑ%5f!/RϞھu b__Vkt~~jt:ٌZ-Ǯ@h#2YXfWD$F1++-קa ҥ,Ks}OGg\1fYvᶶm"]h4G>T9#jR ǎ |R5GFgg t(;[R&'mfFHsGF~Q„334/9XȒ1O(hDee^SSڶ-;=1%%klahwRS7[~T3<8on~VQUXHPfKcg΄ jmVّtz=ee>݂Р Ç\$7Qd)#!A&80%5c696=3s=f3r^TheooʕX,l6ÏFxӳù]ZW8}ZRp8fyPHdRM<}4,P$qhOdh`18HP!!oϡCW=rdɑ],9/pxf<V_SIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Viewer-class.html0000644000175000017500000011607214062764465023722 0ustar balaybalay00000000000000 petsc4py.PETSc.Viewer
Package petsc4py :: Module PETSc :: Class Viewer
[hide private]
[frames] | no frames]

Class Viewer


Nested Classes [hide private]
  Format
  Mode
  Size
  Type
Instance Methods [hide private]
 
ASCII(type cls, name, comm=None)
 
BINARY(type cls, comm=None)
 
DRAW(type cls, comm=None)
 
STDERR(type cls, comm=None)
 
STDOUT(type cls, comm=None)
 
__call__(...) <==> x(...)
a new object with type S, a subtype of T
__new__(S, ...)
 
addASCIITab(self, tabs)
 
clearDraw(self)
 
create(self, comm=None)
 
createASCII(self, name, mode=None, comm=None)
 
createBinary(self, name, mode=None, comm=None)
 
createDraw(self, display=None, title=None, position=None, size=None, comm=None)
 
createHDF5(self, name, mode=None, comm=None)
 
createMPIIO(self, name, mode=None, comm=None)
 
createVTK(self, name, mode=None, comm=None)
 
destroy(self)
 
flush(self)
 
getASCIITab(self)
 
getFileMode(self)
 
getFileName(self)
 
getFormat(self)
 
getType(self)
 
popASCIISynchronized(self)
 
popASCIITab(self)
 
popFormat(self)
 
printfASCII(self, msg)
 
printfASCIISynchronized(self, msg)
 
pushASCIISynchronized(self)
 
pushASCIITab(self)
 
pushFormat(self, format)
 
setASCIITab(self, tabs)
 
setDrawInfo(self, display=None, title=None, position=None, size=None)
 
setFileMode(self, mode)
 
setFileName(self, name)
 
setType(self, vwr_type)
 
subtractASCIITab(self, tabs)
 
useASCIITabs(self, flag)
 
view(self, obj=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

view(self, obj=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Error-class.html0000644000175000017500000003341314062764461023543 0ustar balaybalay00000000000000 petsc4py.PETSc.Error
Package petsc4py :: Module PETSc :: Class Error
[hide private]
[frames] | no frames]

Class Error


Instance Methods [hide private]
 
__init__(self, int ierr=0)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__nonzero__(self)
 
__repr__(self)
 
__str__(self)

Inherited from exceptions.RuntimeError: __new__

Inherited from exceptions.BaseException: __delattr__, __getattribute__, __getitem__, __getslice__, __reduce__, __setattr__, __setstate__, __unicode__

Inherited from object: __format__, __hash__, __reduce_ex__, __sizeof__, __subclasshook__

Class Variables [hide private]
  __qualname__ = 'Error'
  _traceback_ = []
Properties [hide private]

Inherited from exceptions.BaseException: args, message

Inherited from object: __class__

Method Details [hide private]

__init__(self, int ierr=0)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__

__repr__(self)
(Representation operator)

 
Overrides: object.__repr__

__str__(self)
(Informal representation operator)

 
Overrides: object.__str__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_log.png0000644000175000017500000000126714062764461023354 0ustar balaybalay00000000000000PNG  IHDR5$bKGDlIDATXc? L`}H`V;i . bqުn8 ޽xi)`QQqo^ L#@?G;+|!|{nIHFFj(*200m{Oxھ~^[Yޞ$c~rN'itǏk̞kRMNmطkz{Yܞz5i2{cojbddvu%dߍLY!\+]sPCCSQq''8|||<<~ ~ >gs#.z͇6ntt:|G={2L&3e-.vJMUyiKb@3SwaId77=ܷe?"qsgz{zPF\\\XVV!/߾RR  rskiO^ e+WzeK *x1TCh>lJL(}XK0QtO^"::~@`< ueͥ IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMSwarm.MigrateType-class.html0000644000175000017500000002162414062764460026215 0ustar balaybalay00000000000000 petsc4py.PETSc.DMSwarm.MigrateType
Package petsc4py :: Module PETSc :: Class DMSwarm :: Class MigrateType
[hide private]
[frames] | no frames]

Class MigrateType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  MIGRATE_BASIC = 0
  MIGRATE_DMCELLEXACT = 2
  MIGRATE_DMCELLNSCATTER = 1
  MIGRATE_USER = 3
  __qualname__ = 'DMSwarmMigrateType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.LogStage-class.html0000644000175000017500000004062214062764461024157 0ustar balaybalay00000000000000 petsc4py.PETSc.LogStage
Package petsc4py :: Module PETSc :: Class LogStage
[hide private]
[frames] | no frames]

Class LogStage


Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, *exc)
 
__int__() <==> int(x)
 
__long__() <==> long(x)
a new object with type S, a subtype of T
__new__(S, ...)
 
activate(self)
 
deactivate(self)
 
getActive(self)
 
getName(self)
 
getVisible(self)
 
pop(self)
 
push(self)
 
setActive(self, flag)
 
setVisible(self, flag)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  active
  id
  name
  visible

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/help.html0000644000175000017500000002602314062764457017614 0ustar balaybalay00000000000000 Help
 
[hide private]
[frames] | no frames]

API Documentation

This document contains the API (Application Programming Interface) documentation for PETSc for Python. Documentation for the Python objects defined by the project is divided into separate pages for each package, module, and class. The API documentation also includes two pages containing information about the project as a whole: a trees page, and an index page.

Object Documentation

Each Package Documentation page contains:

  • A description of the package.
  • A list of the modules and sub-packages contained by the package.
  • A summary of the classes defined by the package.
  • A summary of the functions defined by the package.
  • A summary of the variables defined by the package.
  • A detailed description of each function defined by the package.
  • A detailed description of each variable defined by the package.

Each Module Documentation page contains:

  • A description of the module.
  • A summary of the classes defined by the module.
  • A summary of the functions defined by the module.
  • A summary of the variables defined by the module.
  • A detailed description of each function defined by the module.
  • A detailed description of each variable defined by the module.

Each Class Documentation page contains:

  • A class inheritance diagram.
  • A list of known subclasses.
  • A description of the class.
  • A summary of the methods defined by the class.
  • A summary of the instance variables defined by the class.
  • A summary of the class (static) variables defined by the class.
  • A detailed description of each method defined by the class.
  • A detailed description of each instance variable defined by the class.
  • A detailed description of each class (static) variable defined by the class.

Project Documentation

The Trees page contains the module and class hierarchies:

  • The module hierarchy lists every package and module, with modules grouped into packages. At the top level, and within each package, modules and sub-packages are listed alphabetically.
  • The class hierarchy lists every class, grouped by base class. If a class has more than one base class, then it will be listed under each base class. At the top level, and under each base class, classes are listed alphabetically.

The Index page contains indices of terms and identifiers:

  • The term index lists every term indexed by any object's documentation. For each term, the index provides links to each place where the term is indexed.
  • The identifier index lists the (short) name of every package, module, class, method, function, variable, and parameter. For each identifier, the index provides a short description, and a link to its documentation.

The Table of Contents

The table of contents occupies the two frames on the left side of the window. The upper-left frame displays the project contents, and the lower-left frame displays the module contents:

Project
Contents
...
API
Documentation
Frame


Module
Contents
 
...
 

The project contents frame contains a list of all packages and modules that are defined by the project. Clicking on an entry will display its contents in the module contents frame. Clicking on a special entry, labeled "Everything," will display the contents of the entire project.

The module contents frame contains a list of every submodule, class, type, exception, function, and variable defined by a module or package. Clicking on an entry will display its documentation in the API documentation frame. Clicking on the name of the module, at the top of the frame, will display the documentation for the module itself.

The "frames" and "no frames" buttons below the top navigation bar can be used to control whether the table of contents is displayed or not.

The Navigation Bar

A navigation bar is located at the top and bottom of every page. It indicates what type of page you are currently viewing, and allows you to go to related pages. The following table describes the labels on the navigation bar. Note that not some labels (such as [Parent]) are not displayed on all pages.

Label Highlighted when... Links to...
[Parent] (never highlighted) the parent of the current package
[Package] viewing a package the package containing the current object
[Module] viewing a module the module containing the current object
[Class] viewing a class the class containing the current object
[Trees] viewing the trees page the trees page
[Index] viewing the index page the index page
[Help] viewing the help page the help page

The "show private" and "hide private" buttons below the top navigation bar can be used to control whether documentation for private objects is displayed. Private objects are usually defined as objects whose (short) names begin with a single underscore, but do not end with an underscore. For example, "_x", "__pprint", and "epydoc.epytext._tokenize" are private objects; but "re.sub", "__init__", and "type_" are not. However, if a module defines the "__all__" variable, then its contents are used to decide which objects are private.

A timestamp below the bottom navigation bar indicates when each page was last updated.

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_piclayoutt.png0000644000175000017500000000367714062764460024776 0ustar balaybalay00000000000000PNG  IHDRy$"7bKGDtIDAThmPSg!1@" dh^*. F!c nwaɀEpDyَ ˺TV .jKŲաh7`kuF@j`?i&)\;6Ow}?Osuypy.Qdʆg]sHuu^׺F/rKyntu%EErʕ۷]{zF`Qsr<(h[jGRH$YJ r41QV]ݬRo|<ۚL!SoC7Tv}|PnKxݬRrb⊊[[nuv"c՛6Q)h S}uu-UUd2\,N!ʕJy,VU˃ٸx\`3^@(/c*\X8~H saw r^{gV'jk`X3~ ;T^M$~{BG{ʪ:1&&Q(g7<khdh2 kMU*r(H$r!+W)75- º#WE)Ma8_@Y^~ThWqXmCd//'2:u:,Igy,B9}Rfb5xۻw ^ܾf}deQ)$(?~!b^/-(ټ/'')6: /lQѡrN\܋>>~e@*V S*/b6[ffq/!&f+c0X&"55_hc2|I=H ؊#,|ӧu=2PX&s!~g>k,FEd'%X, 6ϋv+d,0[,ߑa;̛HD>=<y\bgCqpssXvA"0=O믙"|Tz2~=+>'h ]:G95zF7hoODࠃ뻧9ӳ͵Qõ5zF!=ͅIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMStag.StencilType-class.html0000644000175000017500000002105614062764460026032 0ustar balaybalay00000000000000 petsc4py.PETSc.DMStag.StencilType
Package petsc4py :: Module PETSc :: Class DMStag :: Class StencilType
[hide private]
[frames] | no frames]

Class StencilType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BOX = 2
  NONE = 0
  STAR = 1
  __qualname__ = 'DMStagStencilType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_collecttyp.png0000644000175000017500000000325214062764460024750 0ustar balaybalay00000000000000PNG  IHDRe$cQbKGD_IDATh{LSWO_@P)0 PA|d &> FÂα!]4(R-: D*UQK*țBwR7kH*QĬ=sLNN=3 zP29=9@ X_ONN?FGOOX%"$Ș!i*+kD_k&@cc9A}c?9`3*M buW 6{{cXAEŹoll|V]*sUV8: ^vwDJ]J<~܁*:v v+óSy?nxV_~>Dگ~`B^rG6ʄB ߰MIQzili!lT3{{ zeXmd/lܻWt^?@Xm\ↅu]+io_ vs*5!,}28l:+Wͻw=184tZ(?5/:ϴ"4 V,@gg[[Z)I Q/;8 $DC11^X`|yH4=X"!_=nn|RX1$.d>ߟ9f3.ZI:)T##Ĥ(*~܁_qTU).ܪ>@\~U [[e ".,/qVW7IOzGE)!?VeHRgn Ј2PPBP <.1)uO$06>ݮ]ALff|QQ,:Eg5k"6m׊:yoNkK./2u-$Ʋt>r$;) ~%"QɓіFrd%vv)fThkL}M@UMRZ4+v|5TbwSBг63*ie|xI*e,\8VUMk!:;4u7p$7&!+K\T$iopl:]sBLHQeePb"@ ¢Cb!2P\4쑦C!vgl o\K*uB\Vv02R+0Z"bҙ?oߪ HE5GXu㆖!}k_V,]HGON߷uV/tB/t ~@IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_size.png0000644000175000017500000000156114062764465023546 0ustar balaybalay00000000000000PNG  IHDR9$2bKGD&IDATXc?L[i#v j*R` Ɉ[)˗/]BVK=UtqNz㥥hC) 6Kz%~߾M@]DK۷UU{fΤ#p2%CRT4YY{Od```ff pߤeZX000 tt\_^D@`i{;  $?';۷!ne``g``xCDy3^P3e \_OXŋJJQ:**4w+3SMjjĉwv453b``3g4[rr_-.,_Pkwﺤ3GCQne``ȏprZkS:ϗ\^icW om`1o?64xٳOvcpuK+h?~C^R$>$>ۏӧ>ܾM&,]zrnNKnA~C$uSiMMOvbddd``IMYW""peoN//)8TI.l~U>aŸ7u I=55uAD쌌ݻ'uyIɔƕ;wj5}d+VȈARDd]_+ ¨9s^{v޵{BDVvuMp̔xq^TV3"7!:Ya V [iFJ0V,uK0tO^"::B88+J:V Ccb¥IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_error.png0000644000175000017500000002311214062764461023715 0ustar balaybalay00000000000000PNG  IHDRw-bKGD IDATxyX/zddQT0Trh^5LD@35bJW+0YYivKj^D\VbR}\9d|?3̙yw29癣Ek &B.Ȟ {:uAxl=z􀳳BDbS<==FMjp 'B.Ȟ {"5z֥cΜ9 m:LRi...xWѮ]O^{5ܹsrCCCV:Z8%/_ް6[gbٲe4hjjj???c͚5VoLL  )S(-m:ǡE֌h CBB}:th;h ~Zǣh}rVTT>V^~ p1̝;555hxxx ôi"''GeyXjyԩSE!-- o&N8,L0A*3??k֬ ((()Sp%̞=SN_-mw9̟??G[na|zz:~m_/V]:pK3ɓ`[u8|pn޼߿?r:88pܹymmz(,,ą {nL4 7nP+cgg---ܹsiiixg033ʺT:qx\}׿7oDnn.ѫW/,^AAA___/c".....8vn߾ |2Əbbǎb|JgΪzm?~<""" ݻkȦM0p@aҤIXd {ߗč qet033õkp=4Y>QG[>\xٳ߿? ]]]YRR“'OҒ$?#F`UU7nHBSWW6lPY^HH{1cưO>466ѣ]\\hooϐ In۶M0400… YUU%u,X333477#;u-[H988WW(իHvЁ;w$IfddΎ6666l8i$ۗ7nh|0&}xJHHhA]vY111LHH민}4_QQ0nCnn.-U兄ё555۷YSS#^^^Ψ(fgggΜQ*111LKKUVV2,,ҲX$\޼yQQQU*/**J}gϞeXX4?^:ҥKLLL$I0&&MXdLLRO%%%8hZדzàұcG+zuЦ2zh=kkǡM!dO\=rADkJw-LT~xL\5k|||?LЈW/BBPPfΜMyj1 {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"i1q7oƅ 4U,:u 077o<:4r///DFF* <DFFBc1B%88fhbL.Ȟ {"쉐 'Bހ{bĉ-V_~~>Ziд6%%%#F@JJ &&&-ގP8::*-СCIM!P]]tiO>ӧOIMiJhh( cccL:+WMZoXh}1ݑ@ii).\SSSa())UQ<==qqqѣGݻw̌,--/ښ<~8vʰ0&$$p̙:u|}} ?JڵkLLLԮN0$矙M6Ȉ<|0uttn:000Ǐ>C a\\oݺE[[[nڴ~# 6duQñd|ժURZ6i$nܸ$yEƆaaa$I~Giiiܹs|}}9zhfϞ͕+W6yP͛Ǖ+W*m7x`ô`MMZnիWё/^dMM X^^`?Ԇ<44iiiJSQQ^[u5G[uXZZJץaÆgE.]0f@bb"2kU^qe߾}dSRR;;;iݻ+z.ÁiӦW^^~euՎ:u$ޖ5j-,,tR oooO?d`߾}tbbbTFff&yTUU,Ν;Jʪ6v޽v v<{||<8( wNr*M-LKKK?ɜ7oG17|Ì PWW.]bbb"XXXHR944_ٳ$7\9}4ll.ٍ;H}}}8ǎ#IN>+V[lLBܺu+mmmP(„rܹ9s& duu5ǎˎ;2))I頒?P(8rH^x$<)))|h``@###399q3lBƿOh 燢"|׭ݔ'“_`,[> 4O'''v3OS<5!1cFk74'B.Ȟ {"i3%%.VxJ4é4H?7CF?TBPPfΜMyj1 {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 OILOTӌQ멶>>>pvvVgUAhQ$IGGGz{{ʊ}>gu먯Or͚5{G333ٳ^oǏ ijjnݺ1..Ne9BBAstppPYwܹsgcXX.S7uU:xGŕ+W$Օ$yvڕ񴶶fhh(KKK٣G޽$C333?~fbUUkjjl2:$`_^jWm+**hccM6$+**ιs|$EqڴiϧI1bRnܸVVVl׮ :u8anٲEi>h]YYY400Ttuueyyr|||P(4 0@*Ϋ۪C._sNjkkKgf___pŊ$dfdd4Y^QQvFC믿ROOO)433# Lk0aٽ{wgzzZ}B>x7ںu+LKKK&%%r,,,dtt4hggG__&?F_R8*#IpM՝WuU:<==}vl߾兊 ȑ#QPPAx0ҥ rеkW311366vw,йsghkkKLLL+jۥWbؾ};lmm1}tԫK,Aaa!O>Fdd$4k׮#n݊J7Ԯ|>ݻ]Z娫{m5EwWlll> =zox":v순,]}VZI&ʒvr0`^z&{Ϟ=Jhuݻw~mw8s ƍnN{s̑kiiCRSS#11Qڟ7[n!;;[ ŋ.v*Qyu Be___O>77ހ~mo~g˗/ǵkװk.DGG,xp077۷|tA:ǣO>Xh<<<燜]_}}۰a0vXDFFL:`}fk_5^uDEEa@`` Jm477Gǎc7O1jԨzwR6tP8;;+VݻwCP]fSJMMő#GaR?4&h͛[o᧟~ɓ'wALL ʰ~z'|---DFFpwwG@@7Y^矱zj|%K$?>|8 ;vk`\pImD׮]qioAVV"""ЫW/n>|[qΜ98s p>}nnn8{.p q ܽ{;v@߾}qim㏘2e <||6l2 .]He6VڢSNغukƍPM{u5I|feC+hi!((myy9Uo,)<=ɧl?Zm6۷G@@ Ek7Exµ﮴kN΅ 4͞A]"쉐 'B.ȞZ[lC-,T===aeemy*:u x ~,gbL.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {"쉐 'B.Ȟ {j=… HNNn<5.\M O;{zzMP{ b1]1&O\=rADk?Vg8q'O"`Jڷo[[[X9SNm1c`ݺu:YYYXbׇqOaaa裏`gg())A@@FX[b 6Z6[RT'===YHV}:>sddd>lܸQZo/ƍXd <<>^eXv- / 44TiѾ\S%yyy2d0w\xPRRcӦMƝ;wzj꫈ŨQ`aaiӦa޽QY^BB/_x̙3%%%prrBqq1>ck۷o q5ݻwN:a޼yqF*dffb׮]8x -ZnݺaԩHOOǞ={I&a :u*++s\~]i4ږ&/33_~%Ο? ի2d1w\$%%_Wٿ/^q)Mdddѣرc-[lFQ+1 2| Ir޽ttt_Wi… oJ_r|}}iooj鵱c?v &$9w\JՋGÇi``"]taDD|MN4eee$K.͛ Cpwttt#mll3gHڵ'OVȈM;|0MLLvQOO999$ɐZYYʆ 4w`` X\\|S}]w]u=pY.<_cܸqҲܻw+7 do&`РAعs򴵵1rHk71c͛M1663f̐utt[n< :uֆ`?>,--1j(L4 /nUV_~|ڵ .D||Zgڢ :t044tajdd$xɓ1p&رck[[zjZ\__ӦMuQQQ( 6 ;wFAAnEEN< &۲e rssа6.??_:Ν3g/@ll,mh]C ågϞ}6<SZi,oQuQм5˘|ĉ_`hh{{{ocǎݻwQYYyaذa,X2L<vBQQ`۶mXt)ttt,?4r;IDAT P-#++ gֻ]+,YKKKK:uTwMM ~w5YF=Ю];ڵk¶oUۿGןkMi3ٳqy<3ݻ7ܹUVk׮E.]ꫯ}ЫW/#77*1rH̘1zzz{./^ ڸh";w< q=l޼qFzjԩSFqqLX[[#$$D'kL޽q8;;>wkkkTTTRe?5Waaa*okOJOɋ/2##CZvYfffJ SRR#]h*ח˖-cyy9\´4mrssɊ ڵkJ1&&J\tIiH$ye^zU#Ɋ Iw$ƂzrU^|Y///gLL ÙǨ(lKcWwFEEIpbXXXI>8KZ uc(Z:///C_uk7EhA5kZC6 Z͇O0!⫶쉐 'B.Ȟ {"}wjζBP 8͙5k|||MuVBPPz4B!dO\=rAD!dO\=rAD!dO\=rAD!dO\=rAD!dO\=rAD!dO\=rADk4)-{H-\IgggXYY5{=O:'LJK?j4Apּy݌?-ul޷D!^'v3 AD!dOYp5.rS##d|?.^|Qiﹷe"ɠS'\$**+AWGVx4bLތҳa%=v={*f׳'<£cݮ]p')I鵄TX7D>RdכkjTn>n$'[P_.\G`[ !+i֭Xuk?Ν!|6mm`en}Gzvvs5#B\WJ(gᆱ]C 'B.Ȟ {"쉐 'B.Ȟ {>yN֠A Aę\=q&r|Z=Z O,DApE=rAt܃o9NCIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_10.png0000644000175000017500000000154414062764463024054 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/index.html0000644000175000017500000000111514062764465017765 0ustar balaybalay00000000000000 PETSc for Python petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_13.png0000644000175000017500000000154414062764464024060 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.FE-class.html0000644000175000017500000004520714062764461022750 0ustar balaybalay00000000000000 petsc4py.PETSc.FE
Package petsc4py :: Module PETSc :: Class FE
[hide private]
[frames] | no frames]

Class FE


Nested Classes [hide private]
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, comm=None)
 
createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None)
 
destroy(self)
 
getFaceQuadrature(self)
 
getQuadrature(self)
 
setFaceQuadrature(self, Quad quad)
 
setQuadrature(self, Quad quad)
 
setType(self, fe_type)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, getType, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, view, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_mgtype.png0000644000175000017500000000263214062764463024077 0ustar balaybalay00000000000000PNG  IHDRQ$~AbKGDOIDATh}LSgO Q)PhBQR PH+X@>Ff2'ӱ vQة1ˠBkq4JS`Bfصiݚt,>ϓsl6A|^]+r8 __\`QFпxVv` ||ِ~ر4>?{3, ꛛGG sp83'4Tں?;?lu`t~xP/\08l11[##=??x`2_989-!U+ryJ|ڢoT>ߢөԡiɍHL0vF(mbn)AEGK[[ɹPzj yF*Uդ%KDqOwwG;YeGGF+X !!dQ&EFOR-ܹ0&3F[z5.NLNfPBΔX.DdG; B.W\^DY޴ ?~Uk4YTr>H,F=+N?YWy3/"_ծ Syee2Ν3V231}4xפNWQT .B]UES --]8Ѭ .-(XYuHbaH #pԶÙ݈DD@@HֳX"R"Ʒvehl6t&?%E[+YIzy`ՃnnnL??==h4Gs}pB&[D"Ѳ!,:}9=Msyy6š@CQ?:}OL$H;,R jL!<[##Gl興興xE̮+f3:T3~+xl̎?K@.̮tXIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.KSP-class.html0000644000175000017500000017442214062764461023115 0ustar balaybalay00000000000000 petsc4py.PETSc.KSP
Package petsc4py :: Module PETSc :: Class KSP
[hide private]
[frames] | no frames]

Class KSP


Nested Classes [hide private]
  ConvergedReason
  NormType
  Type
Instance Methods [hide private]
 
__call__(...) <==> x(...)
a new object with type S, a subtype of T
__new__(S, ...)
 
buildResidual(self, Vec r=None)
 
buildSolution(self, Vec x=None)
 
callConvergenceTest(self, its, rnorm)
 
cancelMonitor(self)
 
computeEigenvalues(self)
 
computeExtremeSingularValues(self)
 
create(self, comm=None)
 
createPython(self, context=None, comm=None)
 
destroy(self)
 
getAppCtx(self)
 
getComputeEigenvalues(self)
 
getComputeSingularValues(self)
 
getConvergedReason(self)
 
getConvergenceHistory(self)
 
getConvergenceTest(self)
 
getDM(self)
 
getInitialGuessKnoll(self)
 
getInitialGuessNonzero(self)
 
getIterationNumber(self)
 
getMonitor(self)
 
getNormType(self)
 
getOperators(self)
 
getOptionsPrefix(self)
 
getPC(self)
 
getPCSide(self)
 
getPythonContext(self)
 
getResidualNorm(self)
 
getRhs(self)
 
getSolution(self)
 
getTolerances(self)
 
getType(self)
 
getWorkVecs(self, right=None, left=None)
 
logConvergenceHistory(self, rnorm)
 
monitor(self, its, rnorm)
 
reset(self)
 
setAppCtx(self, appctx)
 
setComputeEigenvalues(self, bool flag)
 
setComputeOperators(self, operators, args=None, kargs=None)
 
setComputeRHS(self, rhs, args=None, kargs=None)
 
setComputeSingularValues(self, bool flag)
 
setConvergedReason(self, reason)
 
setConvergenceHistory(self, length=None, reset=False)
 
setConvergenceTest(self, converged, args=None, kargs=None)
 
setDM(self, DM dm)
 
setDMActive(self, bool flag)
 
setFromOptions(self)
 
setGMRESRestart(self, restart)
 
setInitialGuessKnoll(self, bool flag)
 
setInitialGuessNonzero(self, bool flag)
 
setIterationNumber(self, its)
 
setMonitor(self, monitor, args=None, kargs=None)
 
setNormType(self, normtype)
 
setOperators(self, Mat A=None, Mat P=None)
 
setOptionsPrefix(self, prefix)
 
setPC(self, PC pc)
 
setPCSide(self, side)
 
setPythonContext(self, context)
 
setPythonType(self, py_type)
 
setResidualNorm(self, rnorm)
 
setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None)
 
setType(self, ksp_type)
 
setUp(self)
 
setUpOnBlocks(self)
 
setUseFischerGuess(self, model, size)
 
solve(self, Vec b, Vec x)
 
solveTranspose(self, Vec b, Vec x)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  appctx
  atol
  converged
  diverged
  divtol
  dm
  guess_knoll
  guess_nonzero
  history
  iterating
  its
  mat_op
  mat_pc
  max_it
  norm
  norm_type
  pc
  pc_side
  reason
  rtol
  vec_rhs
  vec_sol

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getOptionsPrefix(self)

 
Overrides: Object.getOptionsPrefix

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for__mat_stenc.png0000644000175000017500000000317014062764465024706 0ustar balaybalay00000000000000PNG  IHDRm$ #bKGD-IDAThkLYPl+B, RQHAA|!GCvaQ$"~Y TS7ݲP Nt?4iP эt̜ޙh46vp#4z۵|e#6&g|-HeZh\Ѐ~'O~J**ju ؀ (ݝ9.reF+k4G.\ӫ(˙\.F`R(,uKק ~P( ] 2Yb\n(>>ϧ۳CC5uuS̝"fffTP"HPh.up Ǐ]]?{UՀ\>YE]\}<.nkPPvt>*Sǧ)AAez>ugCcbv̾X>~MAA H|ڪp֯31QNoJL< FFBbbbc\*J;wn}||J^ޛw`@.׮逥A~~?QTWo ОSْȰy!Ri޽($ˠi:w(?/22Gd"nHHxX_#$hnS56VQ[o^:H:sÇJp25kZr@ UB4{772n$ق:wWWA #,7oJ$ 9DY[XLsƀrA}}nQ>?%e ˭ijAZ^nkm ,ֻ3 />0=gb~Qwkѕ}&/ɧ^gͰp V)LY{[4}8s͚I˖;;TL@ѵ{ /)ظrN/Y/;͝|5k~޻hyNdǎ_,iDH+AQZzrE{f퍍󢢾Lt+(77O,+Z_300psrzlطopAyI;v/Y{t!~~LKI 'MPBDܹ<r}!~~EiiVsBZl5}A] II &Nx떲 i_Q]WI:{9>dffVdpLK䄣.){cc8Y% 33\Y%.&A]A`cetc-|4222 e)`xS8sFݝ5 .h՟X`b|4A[##O]0<#h8R#uh8R`g_16 ˗XDGS FSP0&CH0HPJIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Object-class.html0000644000175000017500000010004314062764462023653 0ustar balaybalay00000000000000 petsc4py.PETSc.Object
Package petsc4py :: Module PETSc :: Class Object
[hide private]
[frames] | no frames]

Class Object


Instance Methods [hide private]
 
__copy__(self)
 
__deepcopy__(self, dict memo)
 
__eq__(y)
x==y
 
__ge__(y)
x>=y
 
__gt__(y)
x>y
 
__le__(y)
x<=y
 
__lt__(y)
x<y
 
__ne__(y)
x!=y
a new object with type S, a subtype of T
__new__(S, ...)
 
__nonzero__()
x != 0
 
compose(self, name, Object obj)
 
decRef(self)
 
destroy(self)
 
getAttr(self, name)
 
getClassId(self)
 
getClassName(self)
 
getComm(self)
 
getDict(self)
 
getName(self)
 
getOptionsPrefix(self)
 
getRefCount(self)
 
getTabLevel(self)
 
getType(self)
 
incRef(self)
 
incrementTabLevel(self, tab, Object parent=None)
 
query(self, name)
 
setAttr(self, name, attr)
 
setFromOptions(self)
 
setName(self, name)
 
setOptionsPrefix(self, prefix)
 
setTabLevel(self, level)
 
stateIncrease(self)
 
view(self, Viewer viewer=None)
 
viewFromOptions(self, name, Object prefix=None)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  classid
  comm
  fortran
  handle
  klass
  name
  prefix
  refcount
  type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DM-class.html0000644000175000017500000024365114062764457022766 0ustar balaybalay00000000000000 petsc4py.PETSc.DM
Package petsc4py :: Module PETSc :: Class DM
[hide private]
[frames] | no frames]

Class DM


Nested Classes [hide private]
  BoundaryType
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
adaptLabel(self, label)
 
adaptMetric(self, Vec metric, label=None)
 
addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None)
 
addField(self, Object field, label=None)
 
clearDS(self)
 
clearLabelStratum(self, name, value)
 
clearLabelValue(self, name, point, value)
 
clone(self)
 
coarsen(self, comm=None)
 
coarsenHierarchy(self, nlevels)
 
convert(self, dm_type)
 
copyDS(self, DM dm)
 
copyDisc(self, DM dm)
 
copyFields(self, DM dm)
 
create(self, comm=None)
 
createDS(self)
 
createDefaultSF(self, Section localsec, Section globalsec)
 
createFieldDecomposition(self)
 
createGlobalVec(self)
 
createGlobalVector(self)
 
createInjection(self, DM dm)
 
createInterpolation(self, DM dm)
 
createLabel(self, name)
 
createLocalVec(self)
 
createLocalVector(self)
 
createMat(self)
 
createMatrix(self)
 
createRestriction(self, DM dm)
 
createSectionSF(self, Section localsec, Section globalsec)
 
destroy(self)
 
getAppCtx(self)
 
getBasicAdjacency(self)
 
getBlockSize(self)
 
getBoundingBox(self)
 
getCoarsenLevel(self)
 
getCoordinateDM(self)
 
getCoordinateDim(self)
 
getCoordinateSection(self)
 
getCoordinates(self)
 
getCoordinatesLocal(self)
 
getDS(self)
 
getDefaultGlobalSection(self)
 
getDefaultSF(self)
 
getDefaultSection(self)
 
getDimension(self)
 
getField(self, index)
 
getFieldAdjacency(self, field)
 
getGlobalSection(self)
 
getGlobalVec(self)
 
getLGMap(self)
 
getLabel(self, name)
 
getLabelIdIS(self, name)
 
getLabelName(self, index)
 
getLabelOutput(self, name)
 
getLabelSize(self, name)
 
getLabelValue(self, name, point)
 
getLocalBoundingBox(self)
 
getLocalVec(self)
 
getMatrix(self)
 
getNumFields(self)
 
getNumLabels(self)
 
getPointSF(self)
 
getRefineLevel(self)
 
getSection(self)
 
getSectionSF(self)
 
getStratumIS(self, name, value)
 
getStratumSize(self, name, value)
 
getType(self)
 
globalToLocal(self, Vec vg, Vec vl, addv=None)
 
hasLabel(self, name)
 
load(self, Viewer viewer)
 
localToGlobal(self, Vec vl, Vec vg, addv=None)
 
localToLocal(self, Vec vl, Vec vlg, addv=None)
 
localizeCoordinates(self)
 
refine(self, comm=None)
 
refineHierarchy(self, nlevels)
 
removeLabel(self, name)
 
restoreGlobalVec(self, Vec vg)
 
restoreLocalVec(self, Vec vl)
 
setAppCtx(self, appctx)
 
setBasicAdjacency(self, useCone, useClosure)
 
setCoordinateDim(self, dim)
 
setCoordinates(self, Vec c)
 
setCoordinatesLocal(self, Vec c)
 
setDefaultGlobalSection(self, Section sec)
 
setDefaultSF(self, SF sf)
 
setDefaultSection(self, Section sec)
 
setDimension(self, dim)
 
setField(self, index, Object field, label=None)
 
setFieldAdjacency(self, field, useCone, useClosure)
 
setFromOptions(self)
 
setGlobalSection(self, Section sec)
 
setKSPComputeOperators(self, operators, args=None, kargs=None)
 
setLabelOutput(self, name, output)
 
setLabelValue(self, name, point, value)
 
setMatType(self, mat_type)
Set matrix type to be used by DM.createMat
 
setNumFields(self, numFields)
 
setOptionsPrefix(self, prefix)
 
setPointSF(self, SF sf)
 
setRefineLevel(self, level)
 
setSNESFunction(self, function, args=None, kargs=None)
 
setSNESJacobian(self, jacobian, args=None, kargs=None)
 
setSection(self, Section sec)
 
setSectionSF(self, SF sf)
 
setType(self, dm_type)
 
setUp(self)
 
setVecType(self, vec_type)
 
view(self, Viewer viewer=None)
 
viewFromOptions(self, name, Object obj=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  appctx
  ds

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

view(self, Viewer viewer=None)

 
Overrides: Object.view

viewFromOptions(self, name, Object obj=None)

 
Overrides: Object.viewFromOptions

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_ksp.png0000644000175000017500000000421314062764461023362 0ustar balaybalay00000000000000PNG  IHDRG[!bKGD@IDATx{P?Gs" P(L8I@"H->ϞV-A13kD*:#j5395f|T Knhx@;Hv hEKs2J%GMJJJ8|gҩL>yhBff~tW dZ !~WfffI9 J%GBɩcƢINNМ%Z,[UUExx8 N!r1b < 6l;wk4guܺuz̴iB׋z˅BV޽(**FQ%Ν;׮2i+yyy:u7j- Ӳ3ggh4_z֯_ԩSYb&˗3i$)// 66GpB;fmx4h-懆WTTIJe7nfԩ>|N>ͫW|H޽)(( 88؜޳gOkmZj9466˶={ @EEEd"Gyfnݺ{n߿o6V9...`:d70am@MM iiiDGG[1Lɼy$**Grm._رcy왹|ccM/ڤڵK '''ѿ bbbē'OBF/|||ӧӧ/^Bc,B!֭['D@@ptt0m[6wܽ{Wjr/^|)]&yM!DMM͵5&IǏ[ՉQVVx*Ν;Bш:>W/ʕ+3^cgcճE:te J%G#J3.I39:N.[q;٭kbƌtp@ϑHPr$(9 J%G#AɑHPr$(9 J%G#AɑHPr$(9 J%G#Aɑ]e\x.8pFo)mXH8`hk;dW&G ̱E,6ezBB˴[ww ~ZIPr$(9l*McMߎWp0'j׭kxG&4666b,4AAM(sǖv Y4ƎɔE&#)a~~߾G))׳{3?Odz})7v_VƯ+WgZƇPg…Dt[9zs^PV͟O{+-iv!!L QÃI_GF򏯾jS/_$\ūWh ,2Ƚvy?.5[Px^:j?Jnu+lns9 ]{Ç3/9"/| ܎Dta&'W~9aah0PS[ˁ  ÀKUHAl;xyz=JKQT/G]'w8' |69ߝ#Fҥ,ްQTRo?bH^~wʸ3"w':|8W y&so\qU:{{3 y˪U]޾_ G)) 8Օj9-nnΞ511QZǥ/ڊHPr$(9 J%GB9Gs$ [a7t:]2G %Gm7poaIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMSwarm-class.html0000644000175000017500000014046514062764460023771 0ustar balaybalay00000000000000 petsc4py.PETSc.DMSwarm
Package petsc4py :: Module PETSc :: Class DMSwarm
[hide private]
[frames] | no frames]

Class DMSwarm


Nested Classes [hide private]
  CollectType
  MigrateType
  PICLayoutType
  Type

Inherited from DM: BoundaryType

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
addNPoints(self, npoints)
 
addPoint(self)
 
collectViewCreate(self)
 
collectViewDestroy(self)
 
copyPoint(self, pi, pj)
 
create(self, comm=None)
 
createGlobalVectorFromField(self, fieldname)
 
createLocalVectorFromField(self, fieldname)
 
destroyGlobalVectorFromField(self, fieldname)
 
destroyLocalVectorFromField(self, fieldname)
 
finalizeFieldRegister(self)
 
getCellDM(self)
 
getField(self, fieldname)
 
getLocalSize(self)
 
getSize(self)
 
initializeFieldRegister(self)
 
insertPointUsingCellDM(self, layoutType, fill_param)
 
migrate(self, remove_sent_points=False)
 
projectFields(self, fieldnames, reuse=False)
 
registerField(self, fieldname, blocksize, dtype=ScalarType)
 
removePoint(self)
 
removePointAtIndex(self, index)
 
restoreField(self, fieldname)
 
setCellDM(self, DM dm)
 
setLocalSizes(self, nlocal, buffer)
 
setPointCoordinates(self, coordinates, redundant=False, mode=None)
 
setPointCoordinatesCellwise(self, coordinates)
 
setPointsUniformCoordinates(self, min, max, npoints, mode=None)
 
setType(self, dmswarm_type)
 
sortGetAccess(self)
 
sortGetIsValid(self)
 
sortGetNumberOfPointsPerCell(self, e)
 
sortGetPointsPerCell(self, e)
 
sortGetSizes(self)
 
sortRestoreAccess(self)
 
vectorDefineField(self, fieldname)
 
viewFieldsXDMF(self, filename, fieldnames)
 
viewXDMF(self, filename)

Inherited from DM: adaptLabel, adaptMetric, addCoarsenHook, addField, clearDS, clearLabelStratum, clearLabelValue, clone, coarsen, coarsenHierarchy, convert, copyDS, copyDisc, copyFields, createDS, createDefaultSF, createFieldDecomposition, createGlobalVec, createGlobalVector, createInjection, createInterpolation, createLabel, createLocalVec, createLocalVector, createMat, createMatrix, createRestriction, createSectionSF, destroy, getAppCtx, getBasicAdjacency, getBlockSize, getBoundingBox, getCoarsenLevel, getCoordinateDM, getCoordinateDim, getCoordinateSection, getCoordinates, getCoordinatesLocal, getDS, getDefaultGlobalSection, getDefaultSF, getDefaultSection, getDimension, getFieldAdjacency, getGlobalSection, getGlobalVec, getLGMap, getLabel, getLabelIdIS, getLabelName, getLabelOutput, getLabelSize, getLabelValue, getLocalBoundingBox, getLocalVec, getMatrix, getNumFields, getNumLabels, getPointSF, getRefineLevel, getSection, getSectionSF, getStratumIS, getStratumSize, getType, globalToLocal, hasLabel, load, localToGlobal, localToLocal, localizeCoordinates, refine, refineHierarchy, removeLabel, restoreGlobalVec, restoreLocalVec, setAppCtx, setBasicAdjacency, setCoordinateDim, setCoordinates, setCoordinatesLocal, setDefaultGlobalSection, setDefaultSF, setDefaultSection, setDimension, setField, setFieldAdjacency, setFromOptions, setGlobalSection, setKSPComputeOperators, setLabelOutput, setLabelValue, setMatType, setNumFields, setOptionsPrefix, setPointSF, setRefineLevel, setSNESFunction, setSNESJacobian, setSection, setSectionSF, setUp, setVecType, view, viewFromOptions

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from DM: appctx, ds

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, comm=None)

 
Overrides: DM.create

getField(self, fieldname)

 
Overrides: DM.getField

setType(self, dmswarm_type)

 
Overrides: DM.setType

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Partitioner-class.html0000644000175000017500000005137214062764463024760 0ustar balaybalay00000000000000 petsc4py.PETSc.Partitioner
Package petsc4py :: Module PETSc :: Class Partitioner
[hide private]
[frames] | no frames]

Class Partitioner


Nested Classes [hide private]
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, comm=None)
 
destroy(self)
 
getType(self)
 
reset(self)
 
setFromOptions(self)
 
setShellPartition(self, numProcs, sizes=None, points=None)
 
setType(self, part_type)
 
setUp(self)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dmcomposit.png0000644000175000017500000000730614062764460024750 0ustar balaybalay00000000000000PNG  IHDRur`bKGD{IDATxyXg#r "ZhK*x<E+Tvb=V-JU>rZED(* !B +?f*B>>ﯙwfy/  xA~EFR#-l\]]̔K.RRRVV@_ pA~E~vwނ"(ɼƬuV.;5N Jaaa2lڵ GGGlbhh\{9~xFFҊ~~| ر7Mw/o߶1hGGGX x;v1 q|˖-ĚoVXXXNN}ݺu***poMLL><'jڇfHf===kkkaÆ -ڳg9UV-]t۶mIIIm۶;w.88NX,M6M!>F>sΝ;1Z@GGB {{˗/K$\biVV@ hD?q|͇RJ͓C5-Bbd܈;aMMMlccPTTTLL `xxX(r\sssb;,+111!!A1MLD"\.722"ZZZꉉjjj]]]lUUJ~$BeSNEEEI$@DDDeeѣG+_s% ,͵=ydddaDիW7('ܖ:88hhhXXXPT/i4ڪUϟofffeeq'_ǹ\m}}=㹹FFFvvvZZZ2 cc#G(E~ >|XZZ* a7nq0+q\&UUUQrCX\^^ب 2^S 'b<鬬ݱT*BH/?ܴIYt,߾]VVhlkgdE)+$ۇ۷Ȩ,.޶#r) f65u>|HΦ}ljvڵ/xƤa76JK#o^~O8sBs$2啚GΦ{yӣrcǎbXy璂Ლao/I' Dn]a>~X,6*7&AS{;Z44DbSS#Jy,@"V<^s(,?6[UEl>pjj/^յ;fnb? w[˟֚3N p]UUftttD"y+d|>Tr|}drc_bb}}D;04o 2 ~} CCaoZo>l0KA93CA.477c0&BE^=56kϙ3n:`Wl'j22~Ν3YYDbggKˉ.76xXZ7.](۷ڸq܄LhcTTݜ8˫MzUa[ZONc}Y1D=fk~z]-[Z FDy{o;kpy))GC]=`76Gcѣ>..L{KK}"/99 tu554Y3t]ݵvmknIL NNNpꛛ? ab/ggr…D[Fz9;FFUiilͻwoqwNO7'4:{TffH=wΚPWrv&NC*쬩AW,`2kj3fV׿xS6'Ohlgg""AJ-G';\Pܜwے%p/lݟ̽uø8~a'9C\^66%k"7wb|^3./\~ݭxw1AJ*+ljKzdx}Po/,[1lYj(t^_eIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMSwarm.CollectType-class.html0000644000175000017500000002161614062764460026213 0ustar balaybalay00000000000000 petsc4py.PETSc.DMSwarm.CollectType
Package petsc4py :: Module PETSc :: Class DMSwarm :: Class CollectType
[hide private]
[frames] | no frames]

Class CollectType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  COLLECT_BASIC = 0
  COLLECT_DMDABOUNDINGBOX = 1
  COLLECT_GENERAL = 2
  COLLECT_USER = 3
  __qualname__ = 'DMSwarmCollectType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_mapmode.png0000644000175000017500000000271414062764461024213 0ustar balaybalay00000000000000PNG  IHDRY$mbKGDIDAThmLSgO)P* -LyaQ!2P eΌJ'5˦~(D>,BE٦2PU( (mƶAĶ&l>{ssF#`\'yas Lc}aMώr|*dPh&;*JpCR3jEi"v0yaf/ CbAeeoNL,(P88ԹUUO: 6{ahnm&q|b⇚ $2X*~Ya E" ƜzOfZélقkjJIՅ##UVvyyxlwj"]twߞkM(q>C,$޴)NT(cb SS'/\hc0r"CBl-ξ}}r9ׯzUl^^֌`-}׮ǃ/B䐀↛7 j۶[֭G$l;0hV>W΍kjЃ}tKJQC֢ ".>^xJI^^ӭ[ 5ߚA$ŋ@71Q_Q@&)+W1N99SՁdr…?= iirrfGǟmm <=AԣeOה; FΟ/)AL;G* ZTPLF$XqF(|gODD80nrԝxtL5eX=3m~/Vvthۢ"~'Hَ~ޑYYjF#FcB<<ijI^^/jtnntM:֊r#W.>vN>p痍 ~bD&3 h 0*+S*96z{;>W]fW+H$𨿿Ǐ͒EJ5 Vd_A+/)'&k?Zgut^@~" ˗OTU=S*#CB,B鼽{ 4,+% NN_DoLi7J~ԝ;dPUkk98O8hsd?>$z/[a0woҥWWԃ^i듏쯨謭Kx<>FCzg(ЎR)*Հ\Lk5L&1s n  33-9o|#1P̠bͰf3Ì`}a 慙(bfIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_15.png0000644000175000017500000000154414062764464024062 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_ds.png0000644000175000017500000000400114062764460023165 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATx{LT;.] TLna6@0P|6b]э1ZE-u7.1VjLv 1& ZAWXDy#>fON; Œ3y|9{sG#(Fd3pe Jw^ RYY\JjjA #`B$QgHPr$(9 vc2(,,$++ ^ώ;hll_|k׎ض 288ht]4773|+HHHyqaFa̙6qFlh9caB l}`0'&a4Edd+… cj#9oJmm-gϞe߾}hZbcc)((***XjFl6gٺu+===lٲ˗yfʢlm`Ӫ9s?byllepMMMdHNNAΝ;XbgΜaʕ͛71Jzz:m6شiѶ jtuu1mڴQ˽ӧ8q"Rѐς ,+++9<~ؾ};IIIhZI\z5'00VNavj*JCCXͰ8oUڵkhZz%Ɣ)S'**3gmJ Kˡ;-]ʝ̞|~͊Ǐt|w,1yzCŀ ^/?OJ"25?˹Q~mt9/7ϩ/I~ƽv6l73t9?)S|]Lc$hl}!%yy(-Ko>yĘ~6a[rΪvhn]Lf3]}}!h{eepǎՒΪO>O}ļP̃} -O38 [EqqLs**:mD?r ɓy\^X#usr<'f38(9 J%G#Aɑ`}&2y$jH̉yq~I2N iJwo+FWIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_viewerhdf5.png0000644000175000017500000000762214062764465024650 0ustar balaybalay00000000000000PNG  IHDRkĶFsbKGDGIDATx{Pמǿ Eu{\py* #HK1L)Ws )#1M%EfDoDQ`: Diϧs}_! 85=`&",UyeѢE5N8"))xp~$KRR_%hɢ&",8Y8p/_0lݺ|\׺---BGGPuwH(Ywޅ <[[[8|0xt?֮]AvuГ묁KˆL&SK$2rH"JIjj*qppPgWU4iP7:"=={W*X,ƞ={L,]RSSe2>sb())QojjB\\qF466/_Ga͚58w#ƍ{-Ŋ/[*bӦM󃭭-BCCqittt ##r4,^:::Aii)d2D"rxzzlSSSbΜ9C2ٽcc>njzqIX]v]~NNP]]hO>Gx!5&&>ɓaeeѣGs57Bcd B0i$=SZ|>aaa؃`hh*FBbb#H$*w[ZZcǎf&)tuu! q=Jxff&B!5$1s)mۆիW#99Y1ܽ{AAAGtt4 Ob׮] TjO,͛hjj´i`ee+V )) _pmիWVE!7n"ѤBHjj*1c:u*:u*122">>>Bw}GFM숾> $Ϟ=#sNO@ ;vPߟL6r> 8YTTTBxcc#q";J!ӧ@inH^^U<,zbee+++nƌJexxz݆\\\Tp1s`~:<==@0ݳ=ٳ,`(ɢ&"8?|188%䇏=Ş={e\#|D"Add$bYtdQELE0YdQELE0YdQELE0YdQELE0YdQELE0YdQELE0YdQgu?ö9s?mdlYb._i>Gq^zofsE0YdQE!x?Tʖ,Y(ɓqҥƠ1}t8qB)сYqF}v G5QQQH$J4tuu! xbmmmmC?Cd)k@rr2 2e0ڊիWcر \.G\\m888(e '|g}>}:Ξ= WWWl߾}(?d$%% 3ٶm!\N,,,ȏ?(U$_t)  XELLLHWWill$D 'ONb``@O!B̝;WypMd޽̜9BȥKy[VKK "%%%Gd2122"$888::rebbbB/ˉP($𘹖Q###R$''#$$#GTY( ___\p=,X$֭[ahhmmИnw^ϯu님TVV ꫯx"R)!Q\\\q҂ޱcǠ '''{b puu61k,5r7x<$%%"yq&X&`(ɢ&",`(ɢNo7rټQ]]$E \N)_84hɢ&",`(ɢ&",`(ɢ&",`(ɢ&",`(ɢ&",`(ɢ&",`(ɢOvUU!~z {@3a"|$s(sp賌YdQELE ZVbJ .)e.\wrވ>>H:wN%aءpXx{czh(C @ܼT12azhҲe.qq0`X~TXLq'V~ SB0#Pr`79[VFFx?k TP[6TVX|;֭Ô~׻SUI[J}Wjϟ3hkor8뚚jbYYś6:0+n!۾_v!˗c7a~mm?FК5y|˺)"Piklzx D)vJ.~w7nMPccU7E-E"FjN¥k"ʺxofGXV[_98q څ,,D㿾둞HҠ r|ݱWElЯ=} /wלeoU|47G;˗5GD x:a݌12RװpS*u?StvuZLLLMP,OggC|B!l'LQ>>ZZ/_gΠ]&̈́ 7{6NgduuEvQџ^U55HLIwk=u :3g ׯa4Gm!j|'a>B֯Dz Qv8?`ܹ_Ί=D7`+oEpUUqHP~׮E+mcpq̰FbJ dz8&D*»!_$CH"""z &",`(ɢ&"(70Krϛ)Bebg0agocv&,?2(]IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Quad-class.html0000644000175000017500000003375714062764463023361 0ustar balaybalay00000000000000 petsc4py.PETSc.Quad
Package petsc4py :: Module PETSc :: Class Quad
[hide private]
[frames] | no frames]

Class Quad


Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, comm=None)
 
destroy(self)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, getType, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, view, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.TS.ConvergedReason-class.html0000644000175000017500000002400214062764464026060 0ustar balaybalay00000000000000 petsc4py.PETSc.TS.ConvergedReason
Package petsc4py :: Module PETSc :: Class TS :: Class ConvergedReason
[hide private]
[frames] | no frames]

Class ConvergedReason


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CONVERGED_EVENT = 4
  CONVERGED_ITERATING = 0
  CONVERGED_ITS = 2
  CONVERGED_TIME = 1
  CONVERGED_USER = 3
  DIVERGED_NONLINEAR_SOLVE = -1
  DIVERGED_STEP_REJECTED = -2
  ITERATING = 0
  __qualname__ = 'TSConvergedReason'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.LogEvent-class.html0000644000175000017500000004220614062764461024175 0ustar balaybalay00000000000000 petsc4py.PETSc.LogEvent
Package petsc4py :: Module PETSc :: Class LogEvent
[hide private]
[frames] | no frames]

Class LogEvent


Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, *exc)
 
__int__() <==> int(x)
 
__long__() <==> long(x)
a new object with type S, a subtype of T
__new__(S, ...)
 
activate(self)
 
begin(self, *objs)
 
deactivate(self)
 
end(self, *objs)
 
getActive(self)
 
getActiveAll(self)
 
getName(self)
 
getPerfInfo(self, stage=None)
 
setActive(self, flag)
 
setActiveAll(self, flag)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  active
  active_all
  id
  name

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_2.png0000644000175000017500000000154414062764457024000 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.Type-class.html0000644000175000017500000006403514062764463023702 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.Type
Package petsc4py :: Module PETSc :: Class PC :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ASM = 'asm'
  BDDC = 'bddc'
  BFBT = 'bfbt'
  BJACOBI = 'bjacobi'
  CHOLESKY = 'cholesky'
  CHOWILUVIENNACL = 'chowiluviennacl'
  COMPOSITE = 'composite'
  CP = 'cp'
  DEFLATION = 'deflation'
  EISENSTAT = 'eisenstat'
  EXOTIC = 'exotic'
  FIELDSPLIT = 'fieldsplit'
  GALERKIN = 'galerkin'
  GAMG = 'gamg'
  GASM = 'gasm'
  HARA = 'hara'
  HMG = 'hmg'
  HPDDM = 'hpddm'
  HYPRE = 'hypre'
  ICC = 'icc'
  ILU = 'ilu'
  JACOBI = 'jacobi'
  KACZMARZ = 'kaczmarz'
  KSP = 'ksp'
  LMVM = 'lmvm'
  LSC = 'lsc'
  LU = 'lu'
  MAT = 'mat'
  MG = 'mg'
  ML = 'ml'
  NN = 'nn'
  NONE = 'none'
  PARMS = 'parms'
  PATCH = 'patch'
  PBJACOBI = 'pbjacobi'
  PFMG = 'pfmg'
  PYTHON = 'python'
  REDISTRIBUTE = 'redistribute'
  REDUNDANT = 'redundant'
  ROWSCALINGVIENNACL = 'rowscalingviennacl'
  SAVIENNACL = 'saviennacl'
  SHELL = 'shell'
  SOR = 'sor'
  SPAI = 'spai'
  SVD = 'svd'
  SYSPFMG = 'syspfmg'
  TELESCOPE = 'telescope'
  TFS = 'tfs'
  VPBJACOBI = 'vpbjacobi'
  __qualname__ = 'PCType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_gamgtype.png0000644000175000017500000000323614062764463024410 0ustar balaybalay00000000000000PNG  IHDRe$cQbKGDSIDATh{LSwO[K[c4 -"`Qyj i _APgd˲NÉ@P)1dHUq  b+hǍ7]A6Y?|s X1.6~a`Ļ=:_ؘ1Ur7o/}qVU>VJz 7g"ZGlX†/lLvF5!a!mpA.?!gDqפ3?G/,qvU~sLp6pPhoksd-oKd=J%ΜR -!5//.$dcCCWڎggVPhhw9|wj*r(v͇ź̡H̯wе`K՞n@ZBHǟj4ٳ@,zx ŵJx4R~ȯ E2' gɟ&%dlf={:X&[f_rŞJfr/<{ݛJ\ၵwzPr__cdcg*k x||XX&3 _GH45_&WU!kEKKJٳS׬pq̔]vR޸E"w>;X0_=2>Bo,).(>sZ=FCb($RLp!K$RXs< tuwXSx<FGsqrB ԫn]LHN x<DE^ rR)$;'&&mB!A}[^%(SHAAM.)MeeJfH:T* w#bА-xyb,92ۍ.D"11<g.F⿋>0`"Ggc Va Sދ{x~Xo[:V6~a6tyIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_4.png0000644000175000017500000000154414062764461023775 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DS-class.html0000644000175000017500000006044014062764460022757 0ustar balaybalay00000000000000 petsc4py.PETSc.DS
Package petsc4py :: Module PETSc :: Class DS
[hide private]
[frames] | no frames]

Class DS


Nested Classes [hide private]
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, comm=None)
 
destroy(self)
 
getComponents(self)
 
getCoordinateDimension(self)
 
getDimensions(self)
 
getFieldIndex(self, Object disc)
 
getNumFields(self)
 
getSpatialDimension(self)
 
getTotalComponents(self)
 
getTotalDimensions(self)
 
getType(self)
 
setDiscretisation(self, f, disc)
 
setFromOptions(self)
 
setType(self, ds_type)
 
setUp(self)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Scatter.Type-class.html0000644000175000017500000002542414062764464025005 0ustar balaybalay00000000000000 petsc4py.PETSc.Scatter.Type
Package petsc4py :: Module PETSc :: Class Scatter :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ALLGATHER = 'allgather'
  ALLGATHERV = 'allgatherv'
  ALLTOALL = 'alltoall'
  BASIC = 'basic'
  GATHER = 'gather'
  GATHERV = 'gatherv'
  NEIGHBOR = 'neighbor'
  WINDOW = 'window'
  __qualname__ = 'ScatterType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_convergedr_3.png0000644000175000017500000000451614062764464025156 0ustar balaybalay00000000000000PNG  IHDR$SbKGD IDATx}TTe?0K )H, ȫRR&uӊ[= *Ц(ytCA aDyyFdmpj(is9e ! pw~>f,3tP\\Z1VhkKдi?e,=Z˴%h4/"eB7$3YtF0h|_TlˣWDǪqB{{yq^x Μ?)D8…(,-`ceElHX+]]dO̝ ZWNr%ogcHǞ11ڭ[rscL0lCscQ͸dԩ$k,XiCΕ.>ܿ3{j```JkGf_wo/998|b"(JZVy.zJ¥ROL$cf{x4:Zd~5m#I>;xD,3P./ת˃MHdz|ں{7,MM~ ¥Qwn+))<D,&.4GRa""6,-ǥfyjBkGJ cdDY\NAI HKoo o4R oqtͺ܀<+*"NUV2А 9Mmmh2zzj =Ȉ]]8-k149#)ߟZܹ$EEfQ6nNlHȨ ɨf"4(ר('ubDZ`Lbce4tO-Ұ05SQӃ-sV"#QP'&&>(xG+O rq=}}H57U#n#j~` 7ߌ}9-_NNVace#|(;}m~^yU'e2zG044^~> 䫲2x'1!!$;''`/ҩP₳=ݰ?p#'Or/KK9[]}W=Ŝ|}={= Ũ'ϝƆšXYQ.Sc$xuuʣ99*.^~n|]#k*xK/1orml$v|~hՆ)R),\x'3+lgGBR{HL-,兙:U&$HO_߈i6wi)h͜,KKlK2{e2v})yҒF32zQ_D}_ Oj388CNNH;Q*hk50 petsc4py.PETSc.TS.Type
Package petsc4py :: Module PETSc :: Class TS :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ALPHA = 'alpha'
  ALPHA2 = 'alpha2'
  ARKIMEX = 'arkimex'
  BASICSYMPLECTIC = 'basicsymplectic'
  BDF = 'bdf'
  BE = 'beuler'
  BEULER = 'beuler'
  CN = 'cn'
  CRANK_NICOLSON = 'cn'
  DISCGRAD = 'discgrad'
  EIMEX = 'eimex'
  EULER = 'euler'
  FE = 'euler'
  GLEE = 'glee'
  GLLE = 'glle'
  MIMEX = 'mimex'
  MPRK = 'mprk'
  PSEUDO = 'pseudo'
  PYTHON = 'python'
  RADAU5 = 'radau5'
  RK = 'rk'
  ROSW = 'rosw'
  RUNGE_KUTTA = 'rk'
  SSP = 'ssp'
  SUNDIALS = 'sundials'
  TH = 'theta'
  THETA = 'theta'
  __qualname__ = 'TSType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_gasmtype.png0000644000175000017500000000362014062764463024421 0ustar balaybalay00000000000000PNG  IHDRd$obKGDEIDAThmPSWnI[z'@h@`  (U ؒuZ\g Eڨ*:&eLlR; 2++J+d?;;ԛe&ɇssV Y"a5V`kޱyVq<"+>P+UϘxѧKVIIJJ.CX",̞$,.-ioڵi~8=Um*IX$JEԮth|}SBh4ng3UUORZ_whKU19;?Ւʚ_X"֟==׿cǪL?< b㿩FD&)a^uo/㓓 2߰[ -8?xk-Jr,::Ġ /==_\UI;SSh4~~ﭷ +.n˾co$W܉u_}ehBB07nkAss'ϟ?VR9q8?^ueJe N FF&~UnJ>8VgƮі2^^YIxᱱ+CCꚾ"hgy9VTܼDr}th4ڛ"99+֕*6 AҢeJ%&B,>$9u꫁O:''ӳ=&fH|ݏKX[;yy\qkkƶm<< /@jQ/ϧɱݼI4q`޾ j]k(1qlbА2bc훚vsvBaZLL[W us&p4 %)"B],{{֭ISQ1<6)y㣏<֯dž673KWNtu9;8ʆ,BB6㓓+F# A@ǼK$s  A-+Bwn0g0P`nܟ ʆ[n..<އ--":[;.W~{hz1Eq"CB>u:mxgjޞh`Yّ22;!8,ZX\;B'+ n$ɔ/ȑ.KTjXaK˿~7+aÇoݽۡp>>l&3`FL5L]zG{{fRQ_}`ٻ]^_LMOgfgۑ룣EBadp0)̼40p޽𠠅X1OHk ONP\naM ouccΤ$\O07??  }X(WU滑9H(dMii [V U* vwGo`U*:Yq2#,lcrkd/XWG}<^VkN%pnqR75#>Aʂ6))+߳Wnю$n8==oqat]܀DҜ>M&lk73361Ņ؅$66z($EDh7s8@P_~-?#cn~|ܜwNۙ3[H$;vntqtd3emY`ccaVN࣢Ӫ1Xbg\^Y9y(/|VtI^~x2/QOỶ ݽJ   ?,X",ؘ"b$֣00; {ğͲbDBlzrEYE棧t IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_boundaryty.png0000644000175000017500000000361714062764457025001 0ustar balaybalay00000000000000PNG  IHDRu$8bKGDDIDATh{PSwO!  )$(2(*gB-PZtmaA,R2EӕlntVnؠiH$4$!g?4KI6.s?{~͙;I.fqqPN`k_P}v.k˗/$E׾8螞q[V]}U,Vk,> _uv 3v> z|``vnN|3gݺuS@NKn4b#h΋D56f%$d޾ ϕ᧦q BYYN SSE7liH pbyCcc56-0PUZ-* U\3++32x IIW~TF0Sӥ[#" _Q!76䦦tخiٳ>^^HXPJ"}ynn{_}&&>3n\@J@"Zig+mm= |T^~:zz7lNJ@vIAh6Ñ)KO_=[jHzAeGEIrV ~ qS\I$$!J&SdAYٮ@:`Vbݻٵ+6// ^iτC<^dNNMM!s;wV ii==<8ey$)NX3G]v̅ *:,(dq1L-/򊏗Wp|tt Xo˹s ?C<^^Z8Z]-3.diT=z,?d$h&ֻ{2Gff$A7띖ueRV`X=ҕDҾ>,ˠӑFx_Vˉ\+y24(c.Q((0ݿibxd`~abK Y&J i6ՑD{Ewn~xVD:`~x`mQQnB/k_P} }pwwEYFG-xwlΓ]A׾T_orl1IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.LGMap.MapMode-class.html0000644000175000017500000002035614062764461024735 0ustar balaybalay00000000000000 petsc4py.PETSc.LGMap.MapMode
Package petsc4py :: Module PETSc :: Class LGMap :: Class MapMode
[hide private]
[frames] | no frames]

Class MapMode


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DROP = 1
  MASK = 0
  __qualname__ = 'GLMapMode'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.SNES.Type-class.html0000644000175000017500000003641714062764464024154 0ustar balaybalay00000000000000 petsc4py.PETSc.SNES.Type
Package petsc4py :: Module PETSc :: Class SNES :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ANDERSON = 'anderson'
  ASPIN = 'aspin'
  COMPOSITE = 'composite'
  FAS = 'fas'
  KSPONLY = 'ksponly'
  KSPTRANSPOSEONLY = 'ksptransposeonly'
  MS = 'ms'
  NASM = 'nasm'
  NCG = 'ncg'
  NEWTONLS = 'newtonls'
  NEWTONTR = 'newtontr'
  NGMRES = 'ngmres'
  NGS = 'ngs'
  NRICHARDSON = 'nrichardson'
  PATCH = 'patch'
  PYTHON = 'python'
  QN = 'qn'
  SHELL = 'shell'
  VINEWTONRSLS = 'vinewtonrsls'
  VINEWTONSSLS = 'vinewtonssls'
  __qualname__ = 'SNESType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_arkimextyp.png0000644000175000017500000000415214062764464024767 0ustar balaybalay00000000000000PNG  IHDRy$"7bKGDIDATh{PSWObHyd2 ,cJQ_2yHy(+X ĮeKhxD+8(CPC#%!a!3?~߹7 bii hP ȷ=CYm WՇrACyz~{Q֮ej;KHt匚>4ZCA^%"QF1iiP@6m tu,Tgtwǎ]\^^_?&(H*z$響33jzzfn`eŤPh6k8\8PTD"Ri8CKK*K*+y<Qy*#ccw[Zr>jeu j]M 5}x޳ e@$: m䇝p Eʢs\ [**GbWU[ZY?vH |fiz,jj b||BvvC[ۙdu GFQQ.y…zLMc#07?^Xi\\Bv F. ?DswWU) Uf="ɯNX]O9`n~_}{l@Ni{X|gf®`&L;vEP+d sJKvMcc{O+AVIoLLUC/6 &F#" $"T!CC;;:}OtFMqq?$^nnp?xv]]Rn'b0>T:.$іL&l$mGhawؐH+OěB,1ߖL. f2H$`zfE7Eza4 ).A U)ȿpEVuu׏F b2!|xG;GQN#eYX [55,CΫ^;:JJxQQ).hR`1=;w DӇ߮WXMxX]Η7cdl JQER7UUd"qԦܮ75Z{ClpfޱPRҳ 89"bc=f{`PRR}Q T^jgaA"'&'`\"bmHˉpG̺u̚uGo]NNbmiWfxD΋"+KY"m IĤ73;ˋ\<}op7VgR(}+(05=^nnTGǮq KM]aRƚ.r'}v==c,d"Nsr6S  xy|u=%{ 7}WtXF N%u+KzS(mP݃0KBk??//$A"\/C8]ݘ eTƚkH?]zF\CN֛td%+ss,,`}cq6Hp).(0>T` k))fa\}Q=lחD `h}߭VVSSxUOGڵgP(C,:zD U7pxcfm-2x|'tܲjؒɰ.u6N Ǧc쩜L 7++z!囪,jx{75xyOOɪ5!4gj9NGG[{ՌFkZ}hV ~ְ&^P`E󿧷BՆf]C/?mԖcIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.OrderingType-class.html0000644000175000017500000002614514062764462025612 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.OrderingType
Package petsc4py :: Module PETSc :: Class Mat :: Class OrderingType
[hide private]
[frames] | no frames]

Class OrderingType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  AMD = 'amd'
  NATURAL = 'natural'
  ND = 'nd'
  OWD = '1wd'
  QMD = 'qmd'
  RCM = 'rcm'
  ROWLENGTH = 'rowlength'
  SPECTRAL = 'spectral'
  WBM = 'wbm'
  __qualname__ = 'MatOrderingType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.IS.Type-class.html0000644000175000017500000002150114062764461023700 0ustar balaybalay00000000000000 petsc4py.PETSc.IS.Type
Package petsc4py :: Module PETSc :: Class IS :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BLOCK = 'block'
  GENERAL = 'general'
  STRIDE = 'stride'
  __qualname__ = 'ISType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.NullSpace-class.html0000644000175000017500000005014514062764462024342 0ustar balaybalay00000000000000 petsc4py.PETSc.NullSpace
Package petsc4py :: Module PETSc :: Class NullSpace
[hide private]
[frames] | no frames]

Class NullSpace


Instance Methods [hide private]
 
__call__(...) <==> x(...)
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, constant=False, vectors=(), comm=None)
 
createRigidBody(self, Vec coords)
 
destroy(self)
 
getFunction(self)
 
getVecs(self)
 
hasConstant(self)
 
remove(self, Vec vec)
 
setFunction(self, function, args=None, kargs=None)
 
test(self, Mat mat)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, getType, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.TS.EquationType-class.html0000644000175000017500000002665714062764464025445 0ustar balaybalay00000000000000 petsc4py.PETSc.TS.EquationType
Package petsc4py :: Module PETSc :: Class TS :: Class EquationType
[hide private]
[frames] | no frames]

Class EquationType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DAE_IMPLICIT_INDEX1 = 1100
  DAE_IMPLICIT_INDEX2 = 1200
  DAE_IMPLICIT_INDEX3 = 1300
  DAE_IMPLICIT_INDEXHI = 1500
  DAE_SEMI_EXPLICIT_INDEX1 = 100
  DAE_SEMI_EXPLICIT_INDEX2 = 200
  DAE_SEMI_EXPLICIT_INDEX3 = 300
  DAE_SEMI_EXPLICIT_INDEXHI = 500
  EXPLICIT = 0
  IMPLICIT = 1000
  ODE_EXPLICIT = 1
  ODE_IMPLICIT = 1001
  UNSPECIFIED = -1
  __qualname__ = 'TSEquationType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.SNES.ConvergedReason-class.html0000644000175000017500000003113114062764464026303 0ustar balaybalay00000000000000 petsc4py.PETSc.SNES.ConvergedReason
Package petsc4py :: Module PETSc :: Class SNES :: Class ConvergedReason
[hide private]
[frames] | no frames]

Class ConvergedReason


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CONVERGED_FNORM_ABS = 2
  CONVERGED_FNORM_RELATIVE = 3
  CONVERGED_ITERATING = 0
  CONVERGED_ITS = 5
  CONVERGED_SNORM_RELATIVE = 4
  DIVERGED_DTOL = -9
  DIVERGED_FNORM_NAN = -4
  DIVERGED_FUNCTION_COUNT = -2
  DIVERGED_FUNCTION_DOMAIN = -1
  DIVERGED_INNER = -7
  DIVERGED_JACOBIAN_DOMAIN = -10
  DIVERGED_LINEAR_SOLVE = -3
  DIVERGED_LINE_SEARCH = -6
  DIVERGED_LOCAL_MIN = -8
  DIVERGED_MAX_IT = -5
  DIVERGED_TR_DELTA = -11
  ITERATING = 0
  __qualname__ = 'SNESConvergedReason'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type.png0000644000175000017500000000154414062764457023557 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.TS.ARKIMEXType-class.html0000644000175000017500000003124414062764464024744 0ustar balaybalay00000000000000 petsc4py.PETSc.TS.ARKIMEXType
Package petsc4py :: Module PETSc :: Class TS :: Class ARKIMEXType
[hide private]
[frames] | no frames]

Class ARKIMEXType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ARKIMEX1BEE = '1bee'
  ARKIMEX2C = '2c'
  ARKIMEX2D = '2d'
  ARKIMEX2E = '2e'
  ARKIMEX3 = '3'
  ARKIMEX4 = '4'
  ARKIMEX5 = '5'
  ARKIMEXA2 = 'a2'
  ARKIMEXARS122 = 'ars122'
  ARKIMEXARS443 = 'ars443'
  ARKIMEXBPR3 = 'bpr3'
  ARKIMEXL2 = 'l2'
  ARKIMEXPRSSP2 = 'prssp2'
  __qualname__ = 'TSARKIMEXType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_random.png0000644000175000017500000000476314062764463024061 0ustar balaybalay00000000000000PNG  IHDRQ[ iPbKGD IDATx{LSYǿ-E+ֶVT qVlY"* "# &C&^j&D]b *.3>F-,%a0* a8UI=ns/įہ." 6cAA=h4(ʗg^t:]Swt w |Ld\Dp`w=$̟?8{`X,Fkkkš.cDFF"!!FXX, ñj*jmR yyy(**W/׋m6TTT BHOLL?2իW1~/z|pjСCIvkOOOI&l&T^^NAdZ(66 V%KPBB>}ZH줝;w҂ (!!***hǎNP]s]]ԭ}~Ѝ-[ &`֬YHKKCJJ =deeaƍ qA@||<CB~ŋV+V#')++#d2_~ݻw ϓ#L&3gP{{;^=zr9֒ݻwO_(&&ކ˘R p-v߸qGӦMlZs玐VSSV!##ֆzBt{#vjbApppЀ#G L&؝!H ߿*bx{{ Gٵk݋4ZZZj*TVVbBޭ[jeL2#F7nz=T*T*vލdL<VZVcΜ90 =-a1|}}ёƌCbl6ҨQHT'F""aL$"*--1cƐ'J7o^'LFLdX(##r9eeekW2 T__onZꨲRVD""BUUUd4æ,L׮].uF}nJJ]E">>^1`x6??sT^IK=B-M." "/wbtʔŋ?Z~uk4^=meHNJ1\DpEd\DpEd\DpEd\DpEd\DpEd\DpEd]>#),,|~&W\H$znjSJK}FGd =~4 k/ hTV(R@̙vsmwgpEdUX^.܋D"˱|<^t);a2 mifR˱|xyx 6.k23q%_}6QSؙݻ1"(#^H"SR(V R)\@DJJ ^^׆INE0R&Cbt4fLsT+ > D|D;&f Fd[>.puELX%VM,IIX ęK飏pEDB,aR 3򹣰9:~OO|^^h3/^(,.ennGĦXT`M̛>~|۷ajoGƞ=0:c &pvWw B[6iuAQr9_`cgUa׉eİahhnFcK `~mf3u:ܬCe\x{kC8S%%`G|fea?ߞ!u]E;:3f`Z E+Wb͸[_ǡu~>ϛ~M|t&'z= Identifier Index
 
[hide private]
[frames] | no frames]

Identifier Index

[ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ ]

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

Z

_



petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Scatter-class.html0000644000175000017500000006414314062764464024066 0ustar balaybalay00000000000000 petsc4py.PETSc.Scatter
Package petsc4py :: Module PETSc :: Class Scatter
[hide private]
[frames] | no frames]

Class Scatter


Nested Classes [hide private]
  Mode
  Type
Instance Methods [hide private]
 
__call__(...) <==> x(...)
a new object with type S, a subtype of T
__new__(S, ...)
 
begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None)
 
copy(self)
 
create(self, Vec vec_from, IS is_from, Vec vec_to, IS is_to)
 
destroy(self)
 
end(self, Vec vec_from, Vec vec_to, addv=None, mode=None)
 
getType(self)
 
scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None)
 
scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None)
 
scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None)
 
setFromOptions(self)
 
setType(self, scatter_type)
 
setUp(self)
 
toAll(type cls, Vec vec)
 
toZero(type cls, Vec vec)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMSwarm.PICLayoutType-class.html0000644000175000017500000002120014062764460026424 0ustar balaybalay00000000000000 petsc4py.PETSc.DMSwarm.PICLayoutType
Package petsc4py :: Module PETSc :: Class DMSwarm :: Class PICLayoutType
[hide private]
[frames] | no frames]

Class PICLayoutType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  LAYOUT_GAUSS = 1
  LAYOUT_REGULAR = 0
  LAYOUT_SUBDIVISION = 2
  __qualname__ = 'DMSwarmPICLayoutType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.SF-class.html0000644000175000017500000010126514062764463022765 0ustar balaybalay00000000000000 petsc4py.PETSc.SF
Package petsc4py :: Module PETSc :: Class SF
[hide private]
[frames] | no frames]

Class SF


Nested Classes [hide private]
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op)
 
bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op)
 
computeDegree(self)
 
create(self, comm=None)
 
createEmbeddedLeafSF(self, selected)
 
createEmbeddedRootSF(self, selected)
 
createInverse(self)
 
destroy(self)
 
fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op)
 
fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op)
 
gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata)
 
gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata)
 
getGraph(self)
nleaves can be determined from the size of local
 
getMulti(self)
 
getType(self)
 
reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op)
 
reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op)
 
reset(self)
 
scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata)
 
scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata)
 
setFromOptions(self)
 
setGraph(self, nroots, local, remote)
The nleaves argument is determined from the size of local and/or remote.
 
setRankOrder(self, flag)
 
setType(self, sf_type)
 
setUp(self)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setGraph(self, nroots, local, remote)

 
The nleaves argument is determined from the size of local and/or remote. local may be None, meaning contiguous storage. remote should be 2*nleaves long as (rank, index) pairs.

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_sys.png0000644000175000017500000000176414062764464023416 0ustar balaybalay00000000000000PNG  IHDR7$-sbKGDIDATX]L[eSGNHai`#s$q&Ŷ$5f&̘dە 3!ټĎM heYbMfLM'dlVahSʓOޏAe̤__'XNVҕ? $I,IIP~=y%,mI,f3}HIҤm=-Wҕk 2@ Ri+Q~(2rǺxCn.NdY҂lLK&K$ۋ)*m@vzSTR(͛ rZ+)y֪ռk85y0ӳ|00@tzŴ\dkOTonۍe^={kЈ"[YsO,#4>Jxa~Lls13H (jl ;vp9Ŗ6naz}>9y5j4حV.|vΝ|x]''hmE#zByh$Otfy99 Ǡ?>x@ƍ貳($+zNm8|mjZt^RhT2o^ʆ*lPxQQVjʳ*d\ r(ֶY'ĝ;M0ML]#* hZp<IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.AO.Type-class.html0000644000175000017500000002234114062764457023674 0ustar balaybalay00000000000000 petsc4py.PETSc.AO.Type
Package petsc4py :: Module PETSc :: Class AO :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ADVANCED = 'advanced'
  BASIC = 'basic'
  MAPPING = 'mapping'
  MEMORYSCALABLE = 'memoryscalable'
  __qualname__ = 'AOType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/toc-everything.html0000644000175000017500000004024614062764457021636 0ustar balaybalay00000000000000 Everything

Everything


All Classes

petsc4py.PETSc.AO
petsc4py.PETSc.AO.Type
petsc4py.PETSc.Comm
petsc4py.PETSc.DM
petsc4py.PETSc.DM.BoundaryType
petsc4py.PETSc.DM.Type
petsc4py.PETSc.DMComposite
petsc4py.PETSc.DMDA
petsc4py.PETSc.DMDA.ElementType
petsc4py.PETSc.DMDA.InterpolationType
petsc4py.PETSc.DMDA.StencilType
petsc4py.PETSc.DMLabel
petsc4py.PETSc.DMPlex
petsc4py.PETSc.DMShell
petsc4py.PETSc.DMStag
petsc4py.PETSc.DMStag.StencilLocation
petsc4py.PETSc.DMStag.StencilType
petsc4py.PETSc.DMSwarm
petsc4py.PETSc.DMSwarm.CollectType
petsc4py.PETSc.DMSwarm.MigrateType
petsc4py.PETSc.DMSwarm.PICLayoutType
petsc4py.PETSc.DMSwarm.Type
petsc4py.PETSc.DS
petsc4py.PETSc.DS.Type
petsc4py.PETSc.Error
petsc4py.PETSc.FE
petsc4py.PETSc.FE.Type
petsc4py.PETSc.IS
petsc4py.PETSc.IS.Type
petsc4py.PETSc.InsertMode
petsc4py.PETSc.KSP
petsc4py.PETSc.KSP.ConvergedReason
petsc4py.PETSc.KSP.NormType
petsc4py.PETSc.KSP.Type
petsc4py.PETSc.LGMap
petsc4py.PETSc.LGMap.MapMode
petsc4py.PETSc.LGMap.Type
petsc4py.PETSc.Log
petsc4py.PETSc.LogClass
petsc4py.PETSc.LogEvent
petsc4py.PETSc.LogStage
petsc4py.PETSc.Mat
petsc4py.PETSc.Mat.AssemblyType
petsc4py.PETSc.Mat.FactorShiftType
petsc4py.PETSc.Mat.InfoType
petsc4py.PETSc.Mat.Option
petsc4py.PETSc.Mat.OrderingType
petsc4py.PETSc.Mat.SORType
petsc4py.PETSc.Mat.SolverType
petsc4py.PETSc.Mat.Structure
petsc4py.PETSc.Mat.Type
petsc4py.PETSc.NormType
petsc4py.PETSc.NullSpace
petsc4py.PETSc.Object
petsc4py.PETSc.Options
petsc4py.PETSc.PC
petsc4py.PETSc.PC.ASMType
petsc4py.PETSc.PC.CompositeType
petsc4py.PETSc.PC.GAMGType
petsc4py.PETSc.PC.GASMType
petsc4py.PETSc.PC.MGCycleType
petsc4py.PETSc.PC.MGType
petsc4py.PETSc.PC.PatchConstructType
petsc4py.PETSc.PC.SchurFactType
petsc4py.PETSc.PC.SchurPreType
petsc4py.PETSc.PC.Side
petsc4py.PETSc.PC.Type
petsc4py.PETSc.Partitioner
petsc4py.PETSc.PartitionerType
petsc4py.PETSc.Quad
petsc4py.PETSc.Random
petsc4py.PETSc.Random.Type
petsc4py.PETSc.SF
petsc4py.PETSc.SF.Type
petsc4py.PETSc.SNES
petsc4py.PETSc.SNES.ConvergedReason
petsc4py.PETSc.SNES.NormSchedule
petsc4py.PETSc.SNES.Type
petsc4py.PETSc.Scatter
petsc4py.PETSc.Scatter.Type
petsc4py.PETSc.ScatterMode
petsc4py.PETSc.Section
petsc4py.PETSc.Sys
petsc4py.PETSc.TAO
petsc4py.PETSc.TAO.Reason
petsc4py.PETSc.TAO.Type
petsc4py.PETSc.TS
petsc4py.PETSc.TS.ARKIMEXType
petsc4py.PETSc.TS.ConvergedReason
petsc4py.PETSc.TS.EquationType
petsc4py.PETSc.TS.ExactFinalTime
petsc4py.PETSc.TS.ProblemType
petsc4py.PETSc.TS.RKType
petsc4py.PETSc.TS.Type
petsc4py.PETSc.Vec
petsc4py.PETSc.Vec.Option
petsc4py.PETSc.Vec.Type
petsc4py.PETSc.Viewer
petsc4py.PETSc.Viewer.Format
petsc4py.PETSc.Viewer.Mode
petsc4py.PETSc.Viewer.Size
petsc4py.PETSc.Viewer.Type
petsc4py.PETSc.ViewerHDF5

All Functions

petsc4py.get_config
petsc4py.get_include
petsc4py.init
petsc4py.lib.Import
petsc4py.lib.ImportPETSc
petsc4py.lib.getInitArgs
petsc4py.lib.getPathArch
petsc4py.lib.getPathArchPETSc

All Variables

petsc4py.PETSc.COMM_NULL
petsc4py.PETSc.COMM_SELF
petsc4py.PETSc.COMM_WORLD
petsc4py.PETSc.DECIDE
petsc4py.PETSc.DEFAULT
petsc4py.PETSc.DETERMINE
petsc4py.PETSc.INFINITY
petsc4py.PETSc.NINFINITY
petsc4py.PETSc.PINFINITY
petsc4py.PETSc.__arch__
petsc4py.PETSc.__package__
petsc4py.PETSc.__pyx_capi__
petsc4py.PETSc.__type_registry__
petsc4py.PETSc.__warningregistry__
petsc4py.__credits__
petsc4py.__package__
petsc4py.lib.__package__
petsc4py.lib.__warningregistry__

[hide private] petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Options-class.html0000644000175000017500000005331014062764462024104 0ustar balaybalay00000000000000 petsc4py.PETSc.Options
Package petsc4py :: Module PETSc :: Class Options
[hide private]
[frames] | no frames]

Class Options


Options(prefix=None)
Instance Methods [hide private]
 
__contains__(y)
y in x
 
__delitem__(y)
del x[y]
 
__getitem__(y)
x[y]
 
__init__(prefix=None)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(S, ...)
 
__setitem__(i, y)
x[i]=y
 
clear(self)
 
create(self)
 
delValue(self, name)
 
destroy(self)
 
getAll(self)
 
getBool(self, name, default=None)
 
getInt(self, name, default=None)
 
getReal(self, name, default=None)
 
getScalar(self, name, default=None)
 
getString(self, name, default=None)
 
hasName(self, name)
 
insertString(self, string)
 
prefixPop(self)
 
prefixPush(self, prefix)
 
setValue(self, name, value)
 
view(self, Viewer viewer=None)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  prefix

Inherited from object: __class__

Method Details [hide private]

__init__(prefix=None)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMComposite-class.html0000644000175000017500000007621714062764460024645 0ustar balaybalay00000000000000 petsc4py.PETSc.DMComposite
Package petsc4py :: Module PETSc :: Class DMComposite
[hide private]
[frames] | no frames]

Class DMComposite


Nested Classes [hide private]

Inherited from DM: BoundaryType, Type

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
addDM(self, DM dm, *args)
Add DM to composite
 
create(self, comm=None)
 
gather(self, Vec gvec, imode, lvecs)
Gather split local vectors into coupled global vector
 
getAccess(self, Vec gvec, locs=None)
Get access to specified parts of global vector.
 
getEntries(self)
Get tuple of sub-DMs contained in the DMComposite
 
getGlobalISs(self)
 
getLGMaps(self)
 
getLocalISs(self)
 
getNumber(self)
Get number of sub-DMs contained in the DMComposite
 
getNumberDM(self)
Get number of sub-DMs contained in the DMComposite
 
scatter(self, Vec gvec, lvecs)
Scatter coupled global vector into split local vectors

Inherited from DM: adaptLabel, adaptMetric, addCoarsenHook, addField, clearDS, clearLabelStratum, clearLabelValue, clone, coarsen, coarsenHierarchy, convert, copyDS, copyDisc, copyFields, createDS, createDefaultSF, createFieldDecomposition, createGlobalVec, createGlobalVector, createInjection, createInterpolation, createLabel, createLocalVec, createLocalVector, createMat, createMatrix, createRestriction, createSectionSF, destroy, getAppCtx, getBasicAdjacency, getBlockSize, getBoundingBox, getCoarsenLevel, getCoordinateDM, getCoordinateDim, getCoordinateSection, getCoordinates, getCoordinatesLocal, getDS, getDefaultGlobalSection, getDefaultSF, getDefaultSection, getDimension, getField, getFieldAdjacency, getGlobalSection, getGlobalVec, getLGMap, getLabel, getLabelIdIS, getLabelName, getLabelOutput, getLabelSize, getLabelValue, getLocalBoundingBox, getLocalVec, getMatrix, getNumFields, getNumLabels, getPointSF, getRefineLevel, getSection, getSectionSF, getStratumIS, getStratumSize, getType, globalToLocal, hasLabel, load, localToGlobal, localToLocal, localizeCoordinates, refine, refineHierarchy, removeLabel, restoreGlobalVec, restoreLocalVec, setAppCtx, setBasicAdjacency, setCoordinateDim, setCoordinates, setCoordinatesLocal, setDefaultGlobalSection, setDefaultSF, setDefaultSection, setDimension, setField, setFieldAdjacency, setFromOptions, setGlobalSection, setKSPComputeOperators, setLabelOutput, setLabelValue, setMatType, setNumFields, setOptionsPrefix, setPointSF, setRefineLevel, setSNESFunction, setSNESJacobian, setSection, setSectionSF, setType, setUp, setVecType, view, viewFromOptions

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from DM: appctx, ds

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, comm=None)

 
Overrides: DM.create

getAccess(self, Vec gvec, locs=None)

 

Get access to specified parts of global vector.

Use via 'with' context manager (PEP 343).

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_17.png0000644000175000017500000000154414062764465024065 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.SNES-class.html0000644000175000017500000027023414062764463023230 0ustar balaybalay00000000000000 petsc4py.PETSc.SNES
Package petsc4py :: Module PETSc :: Class SNES
[hide private]
[frames] | no frames]

Class SNES


Nested Classes [hide private]
  ConvergedReason
  NormSchedule
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
callConvergenceTest(self, its, xnorm, ynorm, fnorm)
 
cancelMonitor(self)
 
computeFunction(self, Vec x, Vec f)
 
computeJacobian(self, Vec x, Mat J, Mat P=None)
 
computeNGS(self, Vec x, Vec b=None)
 
computeObjective(self, Vec x)
 
create(self, comm=None)
 
createPython(self, context=None, comm=None)
 
destroy(self)
 
getAppCtx(self)
 
getCompositeNumber(self)
 
getCompositeSNES(self, n)
 
getConvergedReason(self)
 
getConvergenceHistory(self)
 
getConvergenceTest(self)
 
getDM(self)
 
getFASCoarseSolve(self)
 
getFASCycleSNES(self, level)
 
getFASInjection(self, level)
 
getFASInterpolation(self, level)
 
getFASLevels(self)
 
getFASRestriction(self, level)
 
getFASSmoother(self, level)
 
getFASSmootherDown(self, level)
 
getFASSmootherUp(self, level)
 
getFunction(self)
 
getFunctionEvaluations(self)
 
getFunctionNorm(self)
 
getInitialGuess(self)
 
getIterationNumber(self)
 
getJacobian(self)
 
getKSP(self)
 
getKSPFailures(self)
 
getLinearSolveFailures(self)
 
getLinearSolveIterations(self)
 
getMaxFunctionEvaluations(self)
 
getMaxKSPFailures(self)
 
getMaxLinearSolveFailures(self)
 
getMaxNonlinearStepFailures(self)
 
getMaxStepFailures(self)
 
getMonitor(self)
 
getNASMNumber(self)
 
getNASMSNES(self, n)
 
getNGS(self)
 
getNPC(self)
 
getNonlinearStepFailures(self)
 
getNormSchedule(self)
 
getObjective(self)
 
getOptionsPrefix(self)
 
getParamsEW(self)
 
getPythonContext(self)
 
getRhs(self)
 
getSolution(self)
 
getSolutionUpdate(self)
 
getStepFailures(self)
 
getTolerances(self)
 
getType(self)
 
getUpdate(self)
 
getUseEW(self)
 
getUseFD(self)
 
getUseMF(self)
 
getVIInactiveSet(self)
 
hasNPC(self)
 
logConvergenceHistory(self, norm, linear_its=0)
 
monitor(self, its, rnorm)
 
reset(self)
 
setAppCtx(self, appctx)
 
setConvergedReason(self, reason)
 
setConvergenceHistory(self, length=None, reset=False)
 
setConvergenceTest(self, converged, args=None, kargs=None)
 
setDM(self, DM dm)
 
setFASInjection(self, level, Mat mat)
 
setFASInterpolation(self, level, Mat mat)
 
setFASLevels(self, levels, comms=None)
 
setFASRScale(self, level, Vec vec)
 
setFASRestriction(self, level, Mat mat)
 
setFromOptions(self)
 
setFunction(self, function, Vec f, args=None, kargs=None)
 
setFunctionNorm(self, norm)
 
setInitialGuess(self, initialguess, args=None, kargs=None)
 
setIterationNumber(self, its)
 
setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)
 
setKSP(self, KSP ksp)
 
setLineSearchPreCheck(self, precheck, args=None, kargs=None)
 
setMaxFunctionEvaluations(self, max_funcs)
 
setMaxKSPFailures(self, max_fails)
 
setMaxLinearSolveFailures(self, max_fails)
 
setMaxNonlinearStepFailures(self, max_fails)
 
setMaxStepFailures(self, max_fails)
 
setMonitor(self, monitor, args=None, kargs=None)
 
setNGS(self, ngs, args=None, kargs=None)
 
setNPC(self, SNES snes)
 
setNormSchedule(self, normsched)
 
setObjective(self, objective, args=None, kargs=None)
 
setOptionsPrefix(self, prefix)
 
setParamsEW(self, version=None, rtol_0=None, rtol_max=None, gamma=None, alpha=None, alpha2=None, threshold=None)
 
setPatchCellNumbering(self, Section sec)
 
setPatchComputeFunction(self, function, args=None, kargs=None)
 
setPatchComputeOperator(self, operator, args=None, kargs=None)
 
setPatchConstructType(self, typ, operator=None, args=None, kargs=None)
 
setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes)
 
setPythonContext(self, context)
 
setPythonType(self, py_type)
 
setResetCounters(self, reset=True)
 
setSolution(self, Vec vec)
 
setTolerances(self, rtol=None, atol=None, stol=None, max_it=None)
 
setType(self, snes_type)
 
setUp(self)
 
setUpdate(self, update, args=None, kargs=None)
 
setUseEW(self, flag=True, *targs, **kargs)
 
setUseFD(self, flag=True)
 
setUseMF(self, flag=True)
 
setVariableBounds(self, Vec xl, Vec xu)
 
solve(self, Vec b, Vec x)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  appctx
  atol
  converged
  diverged
  dm
  history
  iterating
  its
  ksp
  max_funcs
  max_it
  norm
  npc
  reason
  rtol
  stol
  use_ew
  use_fd
  use_mf
  vec_rhs
  vec_sol
  vec_upd

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getOptionsPrefix(self)

 
Overrides: Object.getOptionsPrefix

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for__vec_buffe.png0000644000175000017500000000264614062764465024664 0ustar balaybalay00000000000000PNG  IHDRe$cQbKGD[IDAThmLSgOk:[(H۔ŠTKd"%A1h ePTH$d4&i.,b+YQ BJ)ZR(o%a5 >sϹ}\`O>v10ЁE|Z6(2a_ JTjKhǽN"_I<ეIĞGt`~ Vkj'JֶO+ܯ:uY.--{E"Z#b##{ʋXKر?V8tSO6ͥuurrxZ#[,8(&-WNuZZ(멁8Yܶ~N~gfÍǏW66>Sw.N^06>|N@eod]R[}ΝST66JҺ:X@`wnX:zP\]ݥTa0}ۥTed@αc={Q\")zίx.:%S;A:0Ёqoow!zAžoam Ё/t :MTM\IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dmlabel.png0000644000175000017500000000501314062764460024163 0ustar balaybalay00000000000000PNG  IHDRU[*bKGD IDATx{PSWǿ7)BjD2,ՙT*lТE-P(-uƑeYtkkڔjXM´vXQ&U!!3s{|rI"DTp t2y$$$ <<;x6DPlϩ R2KeI=p֬Yٳg#77ǎbIIIhoowҥKa6+ջn̙3:ÇGFFyDQDEEzzzܶP(0lذc׮]/Sn݊JTVV"$$D*_r%LDdffޱ~qx,Ѫ­ߋaQ)((zxAAƒn'tYZr%effRII HDDK,!$i޼yȑ#Ryoo/m߾^xtTYYIDDŤT*)**6o̬`z[Vb̙n3f@MMtϟ?ǏGjj*~zlFSSo&˗c߾}˗O?VEPPpdggC ##/2.w:;;kjj]tPYY ??? &З_~I]]]@FQw=z4ד\.˗/K 6Pyy9-^}:4⩧r{ \8ǘ0a@S{[+{Ab u sϏ.\*Tp,hUKb &.^!;;k׮Fc'$$xT_9yA`ܹs:;Tp R2Ke.\*Tp R2Ke.\*Tp R2Ke.\*T\ȣ_:u u.h4 ~{'~Vn{՟&6-\8W|6v[!!Ц0KA R2+Rc xz:+j5m3-Vz2`Db"?QƓ'q 6H-X Gx=Eh-BTF'2[SLJeԠ@( FR|<*-ENNr} 㽕ʐlNaf2!~|LdUR"ňw#g;vpϽ*F$&"a"||]0 ٚ@s[NUUṛ߉WK;|c=8˯j={: GORW'D(\oǡonX?d9h=XQ?OGզ/xm Qq#"J+`a+mۆa~~nkSRw-mٰ7j4¨.+ -òwĉ!Z-r貲_L&k`dP-\ff󎄛ܛzE2/6{% tvJ8rh(+陙O""buu@(t ink;aX ,5ĉף082K99W HrxǑII7 ?+~u^X &.00&-\FƯ <(=uH.ë}\] xcpيoɌLJ*ar}v 隦%RWqeCCkG1zt4857GXv _?kǎƋ7oRttҢ\X,]]<Ou--47kx|z7"Qbx5찍 8ܷ eo3/ąkM6o--uu`0019y7%EoFdYbv*03$ںⴿUUو>" Zq"~P:Ơs˕`UNHD8BPVFX̿*dZlL-'/_jhhmDňa@]Ee?@ݿYDssW)fFFDa0aNS(g-xB6Smmgo/<|!0P81|?,VWoYY%@Q\ ‰ob38R#kթ2[<>K`08{c֢~_z--} |aHcn-uu]]pYY$Y}0HANgo/m&MMԬDYYҷp#SFFcB!E?߸Ӄb T|?r O^22֭)DzTa)]OiJXX C@f"Q^iiL@%%%>(G&=6uvDɏGZ YZx@Ff0wv}>С б@om;T%Qߖ%EYBQ_PE^UIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc._Mat_Stencil-class.html0000644000175000017500000002354714062764465025026 0ustar balaybalay00000000000000 petsc4py.PETSc._Mat_Stencil
Package petsc4py :: Module PETSc :: Class _Mat_Stencil
[hide private]
[frames] | no frames]

Class _Mat_Stencil


Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  c
  field
  i
  index
  j
  k

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_problemtyp.png0000644000175000017500000000322314062764464024765 0ustar balaybalay00000000000000PNG  IHDRm$ #bKGDHIDATh{LSW}\V>Pkԕ2DZ@0|$"2#1(c&ȣ > -Bd!'" X7kJ7+~:{_=Rf3ku @Hf \>01H 񒻳yʇB{Gǃ:+цMHJ$ߗ?ؽJ$kb }$Gb?mG4e{6[&Kg9q}}ի9Xu7;J:~J8[<bqR ]]/],3T[CC*wŋe2((-}͛`'x|DVFӜ''wtu9OL\b Zilò`phD(v!%Lr̭28-/eh7:5Fg9+Wzzٳcݺ,d&DE̓/mkX Hg3׮Ѱ~L&ܻp6\fP&p\aDC>q"oƍ<}f>ɧNzzx|xCjΝE0?.IKHYes"jN~˧99'%m$vw-}I"NX%$UV  r_Nח}0`dedi^.(ШTA]z۴i@H/>nL X|IɋW| )) R4:$=L?:wqA9p8NÚ>9zdt -XPRQQӧ&lq16 ӿHLD/:;yh LA,=Qt_oTRQq?/=\]1(t'fA`hĞI\.tbhUYLD(~nxex QQXJemccTH&pu-u NRsͫj~߶hܝ͝[*  VKR`cXX'mEtVޫDb{Ll&e>gw2S8{Mmm4M>9slni:p8^R)Vur\Dh 8,:R(˞*2#ߕZwlh*Z Hd` &L&YPz玕˭0|q!}$Gb }$̃q`wtP)pCOA<rH7h4ɩ#IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_tao.png0000644000175000017500000000410414062764464023352 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATx{LSYǿe]d0@ a 8Pjh]\IXq4'N|$.ˎCvt 8L1BfU CБD%(>Zc;W Ж;܄=ɹs*!"^`&0rzl6x͛7tWw8@?mEDCӍۛÀa0rLjEII h`/ollĎ;5k0<[M^̟? s9s.R"kkkQSSl'O Z T V g۷oǣGtRHRfpL&z*NGG  44TV^bJh4ÇvsAyyMbddzO8}4rł@Qlِd())}||jq}Q2 AAA6 spڵ gϞ& 6lB@ff&'O jZt=R۷ob 22!!!ΆNCrr2.^w_kӧ###6LƤח-ZD^^^IDD$X"""(""͛G*Ћ/H./jz/r|{I L8o֣er^I488(Q[[ҭ[h4^CD444DMMM^aX?~,[Vjhh ;r½{H"j%r$Yn޼h4x{{{:N?EPN!93.Àa0i%H3r_t:yCB43zlٲ3$a0rp9 \.Àa0rp9 \.Àa0rp9 \.Àa0]fuuunKPQQ~ޏ1a&P{|+I3)-$#QQm|բu$'6* iS*TV \`FFGmSsjN54˗Ϋ?ZܹooDd8ᇈݙ:71b LclP*况Y>>\il`|'"9|N?v{:.Կ  We&v\\qkn!OaQ` VEEArO~H$ ""<*۰lWUall Bxy * {ՖPݚzm?q~)UVbKr2}CAe. }׭9zLN#F.Gؒ%xZR"BBs'998dM/)<|@/!V >r?TWq(;+e2|'h nqԕ^=y0b_tyLa0rp9 \)s6`=gɒ%uz·Nr bws֐IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_partitione.png0000644000175000017500000000503114062764463024744 0ustar balaybalay00000000000000PNG  IHDR][(bKGD IDATx{PSWǿ! #jGSX]DeW".j}A,:n;U 8::UǕ@׷ȨXuh!k|(w@r9G/ǹwn"""p̊"\:tXAFF)U( Hw@FmJ(g&)/JD'6Sk:tp LѣG3g">>ϟb:hhh0vɒ%7W&қh!!!t5k/_AKK>b1gT;wđ#Gꣻ}qUlقBU'ڇ\z#Gձzf/'| ۛZ-ׯSLL RJJ z""Zx1T*]zz:͝;Vھ};͞=mF<<3Kg.&H'6S`QT".+WB.}lBaT{QۥmC$ATbΜ9S23Kg.\:tp 3Kg.\:tp 3Kg.\:tp 3cu,yyy&{'W31vks{"3/yڕ{{cՂ"8p`ҥ 챤20KgH82qmB%5E(+/OcL{L *ΝCŹs "Aw AU\ u)0t;;pkt4n "457VWC׶}SXzCVy GFO0d%% ~~3punR<@Hl,2ΞţJ-7nw" P(0ϰq@Um-(sO{aqqдt#L_~~P|P~b2/4T֢wwС.Q̯MCɓ8- @V:g$۶ s:Z-[ؼjVlڄ mK6h48v"23?.е h2p1$b8~d߄Ec#,-,`mekX5>*U55fk/\_.`T?/\A0Qw!96Ύ5 S <\4j۲epvtV̝&[xΛgxKK|0\*kw6:O`k+!rwGfvZn~QU[ mF4i~0";\AҞ=P\ۖ醺%%umV d2䵻W:I{Y.jaii ms3Z(]Vj_RlV@>xDu]bX8s[ Q1ۇg55/8>]XnE"=<0Srx}9<.oO :_COsp&5YYpFؾfͯho4gxLo Oo~၁0}l̉A 1~\:tp 3KgodfgC4n9s33WNu]"7 tX='} IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_factorshif.png0000644000175000017500000000430014062764462024713 0ustar balaybalay00000000000000PNG  IHDR}$+cMbKGDuIDAThTSHB!ϐ APA"?"nTDN"H *EcCDPv:q8H* 4J?zpYMbR@PJNYYj~tncK;0pMCw_wHI .HIn.H_9*IJUQWWY_L*tqYR,")iQ 8pDNjр䜜VoXbge5YY . ƫ/rC ٹ4+kT}sRT`06 㧟XXxg Xd TU=zd߶m@gU룍tupף9WT*'KJ*rs+W@Tp5+3bxK2/}$Ȝ@3z{#>xT*_g\CC)avmڿ D|.?yr}RҾ'Ҟ %ffV76ȋ\ !#X>~СoZ[ x]]h_= y@%KξxF/.>u<ҞR(B:o'䜽t)b-^y @^ollza?o&J^bEu0?~|bzs3$xvVVI11g_Z޼&2FF OD]lo{w]SӦP<V|<2Wf댟nÍOL߾=%3]IÝ;8,G@DP?ԑFaT)X^[+˳LTp%%~bb6YsjSSٳT+}B~̞knu%ok72okK&$qᄰXn TUń|lOmmcEE$"--55榦fxVPpر8g;ruM~788<: D˖!efjsK`1b]^p!d/al,`Þ==UU8<]s062n,@kkuź"DO>]^&߾>">{3-2jtnwv}ךBY $"Q sŕ@2\*EGFGɦHզ5508opA&ux/qrrѐKã* I\*531!::NMEOkuzfm6mM }}J. Xr$~J>> .q|}ջg2'&8+STKKEf[!eDIƙ3[QTZX^2_]=J`} RT |6o>tkov6.gHأ tpa0nl\蘽w>#*),,ܶazDbCQFB.r꯾99hƗ BCQсJ-|%"ž144Lw>{K##LL6*;F6?ttZZҬ5{"@; vI$ ;;+ss4PDS`T&ml%hrj&pwo5@"BMk+v_,&6jk X;:$ KG>Ν䰺19'aOqzdr}bfHjkRRlƍ⨾Sc.^w{d yDTTWHDz8,v[ɖd`\FZ@ò)\UՁ8ӟLxEߋ77s88.*89g3z{_!3L(~AnfhkA_썡1OsAn L]]D~IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc._DMDA_Vec_array-class.html0000644000175000017500000003070514062764465025316 0ustar balaybalay00000000000000 petsc4py.PETSc._DMDA_Vec_array
Package petsc4py :: Module PETSc :: Class _DMDA_Vec_array
[hide private]
[frames] | no frames]

Class _DMDA_Vec_array


Instance Methods [hide private]
 
__delitem__(y)
del x[y]
 
__enter__(self)
 
__exit__(self, *exc)
 
__getitem__(y)
x[y]
a new object with type S, a subtype of T
__new__(S, ...)
 
__setitem__(i, y)
x[i]=y

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  array
  shape
  sizes
  starts
  strides

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_normtype.png0000644000175000017500000000272514062764461024450 0ustar balaybalay00000000000000PNG  IHDR]$d>bKGDIDAThmLSWO_.mi/ДbKQ*(`ThAP^tC3ccD,""oY?bU i&q۰VMnr><{ڋc.̗`w`kgjkk+~A8] R烃mKLxxmYٜAcss[QG`N6($$dRZm/owNz$.^`^^wid޾왰99 ¸\Xzdnéf:F!yc <<\HdϞ񉉚F8L?z^T_/q3D$(Uwdd \,+Wı|~Wof/e0Gljr!IFGpST&EHx>MnR(i"Qgw il ٸ%&\q`ev 4stS9L&& ^KRtc…_:E FkQsTV2,A,;{bq|c"DR]h'܀gfnNJzK;^˺('EjcEF"!D$"_!9N;Nⴤ)FCCBÅN"Bq,>ߍ-, iJ "zhqy4g]'1wjY藹t0_Aw <DQw_|AI툛ĐIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_schurfactt.png0000644000175000017500000000402614062764463024737 0ustar balaybalay00000000000000PNG  IHDRy$"7bKGDIDAThmPSWD%*pcEڵ`W*ؕHyKU*. jpvCҝEeaD@4&˫@hH]&!Yo}y{nF][kaڀhky5kÁX*7l2|)occ}}Z.]2HIo,MMZq1F kác^FS\B*R{x,,"SR_G"H$oD5V\iv~,suuAA <-(ؽm.Zo'OtXhgWQ);wnݼPY_̏>`P(}KzEZV_-)al޳ǟﯭًb2|7L*3Z*} z0(w\=%z@JJ/ffɼdq׮}:%F$'kx069^Rԩg4vt,٣I :TQqR%&O#ݻ Pr8>}~,k^fXg؜7ӃA<<~w/_,p!t0:\ii]K\X W7wvݱc ?2|Aᇒ؈29<1Q883mpoo'B&rP}|;bfFMʃw:8D$'C*25px8 MBSH_딘wCCuvܼIcgfܻwğss!!>ldb%%}}_$⢳Ԙ>>fS*;AåyH$$H$bu cxBse}}Lx)@P]`or8ﺻׯ ̏?f),7V G"1-..-.'"ӧ[@ah| Jt;p{|D |ӊCϟOt] /()ѯ8HzMMD ~'8<>\M -^gFbbuXdtlvP`o׊R nȗde899L=̻fsy_lvqq"k<=;hJq4zV\iD:FS*3/_^P*Krscm@"fdrN0hRxBKZ 狆jKBE.G8.HˏSR鍚L./Kf`N'NIT őHpNC* ^z=Dgd\201=MKq1gEG"q@"MJr&'F`6ٽ*U<o2tD1yxG":bzvv@"lhgm XPN y*a1hB SSiNj#y<{[[W9?X r$ss~RffZy^>߅Lp"垮po?Æ2h=/"s"V4):=PUUkY@ZYZY-խ֭^l=]{9I۴ jͥyH-E˦v}EkS*%b1JZ%owO-]]L&޳-hxqNȷjA4Z e|{ǵ1zm8^׆Cdz/zoFbplLj/Op6qm8^׆?C vIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for__vec_local.png0000644000175000017500000000321714062764465024662 0ustar balaybalay00000000000000PNG  IHDR$!ZbKGDDIDATh{LSWOKKPmP,9£>R((jxhhUf@'4XP.ÙLj&D RV*BWaܥ#2ZW;sN533` w3O.vdF=D y| H s<8^JYSӐ='Ex?a?Ёmq%DE-F9.33 A?Fb죡G32kU~kJ(-UUXT{hhDÇХC5vjz̵@ErArՍBыUt45@1h<}jE㥥.w 廝;ffZ9QZ We$%ANkԔ|ˌ@رiSThnrvlNN^II"qğo23=L&FӪ/@{rRLL˳gB t:`X{ɰ4Dk^M)'6n\fdF)2xVqodr޽{zxF8*56f:ŠѨ+Vܩ;w.!:0=%"†HRk;tz)ۛ[]ao::wz-LM>42rdÚ5X Ja!`sxxZ^^o_Ux ŭbABT+̵kyxkJKg1 b14U X,۱))4? RYa4=$bE+L).yHfV|qt«7oLLtvx{Cex"<}"c`5*x rrrgvNtXuub1}==P,<ຖopѡ5I66_6D"_(Hum@> `5)$ٜt;;Qod#f$&:wŅd<_.geEd $>2r-h&xi ;6)uλ@~tBL:]o*8P<&QH$UppxC,vZb{--SJH/Dd[ًNKssG{{x[W`]` ʊdcwT=6 BM)ZZ虙PI<=8ܻs&!;rL&Գ֢KAءseK$7`,r~~GÞښA/H{vgaB~A<xXIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Comm-class.html0000644000175000017500000004602014062764457023350 0ustar balaybalay00000000000000 petsc4py.PETSc.Comm
Package petsc4py :: Module PETSc :: Class Comm
[hide private]
[frames] | no frames]

Class Comm


Instance Methods [hide private]
 
Barrier(self)
 
Clone(self)
 
Dup(self)
 
Free(self)
 
Get_rank(self)
 
Get_size(self)
 
__eq__(y)
x==y
 
__ge__(y)
x>=y
 
__gt__(y)
x>y
 
__le__(y)
x<=y
 
__lt__(y)
x<y
 
__ne__(y)
x!=y
a new object with type S, a subtype of T
__new__(S, ...)
 
__nonzero__()
x != 0
 
barrier(self)
 
destroy(self)
 
duplicate(self)
 
getRank(self)
 
getSize(self)
 
tompi4py(self)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  fortran
  rank
  size

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_orderingty.png0000644000175000017500000000347314062764462024763 0ustar balaybalay00000000000000PNG  IHDRm$ #bKGDIDATh}LSWV mAAa +E@Sh\}6M7]TT&QATsS"Ma5(U)e+(h\'{{9-% Τq{'9b#F ;𲽼b#6FJ_7CC_Wچ'q -/,|!^IΪյ;v8s x؀ g.\kl4D".w*+M[WG_s墢پgO}S8EQٹ"'R.g7~m^Jʁ?\?v#?'.QdCBTUwww$13/o̙gv&H19ZRl$ 0_|R"snO rMMW a\~ܹKK?~tjR&%t5K.-{w@;' `6] N\TdX۸',tsj*<6>/.nXk0QQ#}?Idmh(>;߷Xe!Baիt*u jX\g~j3tXܨ>ػw…~ӦI+,q΁2rEN.-.ΝL^N%p~}m6umt=5А,#ҥ5]G<էʭ[ ARa2oɓUǏ^{t~>Ɔ%'ͻwwx ?:xp_n.!:mh ''2<ɢnl>@ (d2\<*USKK@pjU\XecD~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.LGMap-class.html0000644000175000017500000006742614062764461023425 0ustar balaybalay00000000000000 petsc4py.PETSc.LGMap
Package petsc4py :: Module PETSc :: Class LGMap
[hide private]
[frames] | no frames]

Class LGMap


Nested Classes [hide private]
  MapMode
  Type
Instance Methods [hide private]
 
__call__(...) <==> x(...)
a new object with type S, a subtype of T
__new__(S, ...)
 
apply(self, indices, result=None)
 
applyBlock(self, indices, result=None)
 
applyBlockInverse(self, indices, mode=None)
 
applyIS(self, IS iset)
 
applyInverse(self, indices, mode=None)
 
create(self, indices, bsize=None, comm=None)
 
createIS(self, IS iset)
 
createSF(self, SF sf, start)
 
destroy(self)
 
getBlockIndices(self)
 
getBlockInfo(self)
 
getBlockSize(self)
 
getIndices(self)
 
getInfo(self)
 
getSize(self)
 
setFromOptions(self)
 
setType(self, lgmap_type)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, getType, incRef, incrementTabLevel, query, setAttr, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  block_indices
  block_info
  block_size
  indices
  info
  size

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

setFromOptions(self)

 
Overrides: Object.setFromOptions

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dmplex.png0000644000175000017500000000545614062764460024067 0ustar balaybalay00000000000000PNG  IHDRPǨbKGD IDATx{PφBDTKiy ҄J@yiXjR0VEKB% `Ն(㝠z!<#%J$t/~ߜ{9`y;`ix}Z޽0quu@ 5IX,H$򊿿ŋݛΎN*wgjKNNj߳gNLKK3~"3ILmႂtA'|P(JKK ))i׮]mmmjǏ>bljjڵk׺uN8?--m֬YG%H'O;w{jg04d 6msɀ$M^^_|rAAA|>v˖-YYY</R{{T{[[۲e+W 1X, }}}#e2T* C|Fz8 c[8***!!{ŨQ"HwjԎР}BB5gΜ AV[^^m'&&&>>\zuÆ YYYK.!{XüeeeNNN^^^ fwttY&??ddod8lQFGG?*<{?X0`0TjFF aaa0 ޽FR0c.K=<z^R!FT0Jq KnA-jưpl>fj >>>K,A D666h`0I]]]]]] -H 痢曌[^ IIIIIIpX!!3!T-8q{Zl>GQQ嫶kwxwxwxwxwxwxc\jx3 .`ȅQ0Aaaannn\.*6MXSlyG `aB0!wys455fʂ +p\\\B---h,B)..6L/ mmmyST&9༼l4622p>000uKi5"`tttss3QH(&%%,6dɒ_ RԸ8WD" Ѷ`dN7.en,*X&tGGGԲfT*E"Qbb3`>?LJ "7ް?:::88p__ߙ3g._\[[;) =xR\zYA0o 2 6ZSS/OJGPÿ `C;`}%HLŪ"sز qr!!!!!!X K-jt1)k:́FOXq8E99w߷By$յ0!`qG/X g^⋆VL94ggk[PA^4@IXAAXt,SRsz}W_Y ЏSS8:*("u]xfgӝ!X<GVSSmHfw>cGKII?H$룢"o$᪛7`L0̾?5Duꦵkw|ѨV͓?-z.Z16 lC~C.5o!ƻwѨkuuGG18lbJh\둠2xڕٔ46v#0 tn 8rggR0jnLfW_\ȍDzuW__ooEwڄŠeDHyh D~ٳK~}{÷ C\5͙fR.GX!H O¼y._n t3/o :hC[uud;8-9^/,$a0^÷[[EeeGbEMyq8ǏdzXLZQ#͖r?wNb}WEE=H;8F6DG{znؐH`- ۍɜZ-;8D/-m.?ujU@?^g66gysC ?! ~”@TN}WD/΄.\Xsn9bu]e]|n IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.TS-class.html0000644000175000017500000027261514062764464023014 0ustar balaybalay00000000000000 petsc4py.PETSc.TS
Package petsc4py :: Module PETSc :: Class TS
[hide private]
[frames] | no frames]

Class TS


Nested Classes [hide private]
  ARKIMEXType
  ConvergedReason
  EquationType
  ExactFinalTime
  ExactFinalTimeOption
  ProblemType
  RKType
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
adjointSetSteps(self, adjoint_steps)
 
adjointSetUp(self)
 
adjointSolve(self)
 
adjointStep(self)
 
cancelMonitor(self)
 
clone(self)
 
computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f)
 
computeI2Jacobian(self, t, Vec x, Vec xdot, Vec xdotdot, v, a, Mat J, Mat P=None)
 
computeIFunction(self, t, Vec x, Vec xdot, Vec f, imex=False)
 
computeIJacobian(self, t, Vec x, Vec xdot, a, Mat J, Mat P=None, imex=False)
 
computeIJacobianP(self, t, Vec x, Vec xdot, a, Mat J, imex=False)
 
computeRHSFunction(self, t, Vec x, Vec f)
 
computeRHSFunctionLinear(self, t, Vec x, Vec f)
 
computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None)
 
computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None)
 
computeRHSJacobianP(self, t, Vec x, Mat J)
 
create(self, comm=None)
 
createPython(self, context=None, comm=None)
 
createQuadratureTS(self, forward=True)
 
destroy(self)
 
getARKIMEXType(self)
 
getAlphaParams(self)
 
getAppCtx(self)
 
getConvergedReason(self)
 
getCostGradients(self)
 
getCostIntegral(self)
 
getDM(self)
 
getEquationType(self)
 
getI2Function(self)
 
getI2Jacobian(self)
 
getIFunction(self)
 
getIJacobian(self)
 
getKSP(self)
 
getKSPIterations(self)
 
getMaxSteps(self)
 
getMaxTime(self)
 
getMonitor(self)
 
getNumEvents(self)
 
getOptionsPrefix(self)
 
getPostStep(self)
 
getPreStep(self)
 
getPrevTime(self)
 
getProblemType(self)
 
getPythonContext(self)
 
getQuadratureTS(self)
 
getRHSFunction(self)
 
getRHSJacobian(self)
 
getRKType(self)
 
getSNES(self)
 
getSNESFailures(self)
 
getSNESIterations(self)
 
getSolution(self)
 
getSolution2(self)
 
getSolveTime(self)
 
getStepNumber(self)
 
getStepRejections(self)
 
getTheta(self)
 
getThetaEndpoint(self)
 
getTime(self)
 
getTimeStep(self)
 
getTolerances(self)
 
getType(self)
 
interpolate(self, t, Vec u)
 
load(self, Viewer viewer)
 
monitor(self, step, time, Vec u=None)
 
reset(self)
 
restartStep(self)
 
rollBack(self)
 
setARKIMEXType(self, ts_type)
 
setAlphaParams(self, alpha_m=None, alpha_f=None, gamma=None)
 
setAlphaRadius(self, radius)
 
setAppCtx(self, appctx)
 
setConvergedReason(self, reason)
 
setCostGradients(self, vl, vm=None)
 
setDM(self, DM dm)
 
setEquationType(self, eqtype)
 
setErrorIfStepFails(self, flag=True)
 
setEventHandler(self, direction, terminate, eventhandler, postevent=None, args=None, kargs=None)
 
setEventTolerances(self, tol=None, vtol=None)
 
setExactFinalTime(self, option)
 
setFromOptions(self)
 
setI2Function(self, function, Vec f=None, args=None, kargs=None)
 
setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)
 
setIFunction(self, function, Vec f=None, args=None, kargs=None)
 
setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)
 
setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None)
 
setMaxSNESFailures(self, n)
 
setMaxStepRejections(self, n)
 
setMaxSteps(self, max_steps)
 
setMaxTime(self, max_time)
 
setMonitor(self, monitor, args=None, kargs=None)
 
setOptionsPrefix(self, prefix)
 
setPostStep(self, poststep, args=None, kargs=None)
 
setPreStep(self, prestep, args=None, kargs=None)
 
setProblemType(self, ptype)
 
setPythonContext(self, context)
 
setPythonType(self, py_type)
 
setRHSFunction(self, function, Vec f=None, args=None, kargs=None)
 
setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)
 
setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None)
 
setRKType(self, ts_type)
 
setSaveTrajectory(self)
 
setSolution(self, Vec u)
 
setSolution2(self, Vec u, Vec v)
 
setStepNumber(self, step_number)
 
setTheta(self, theta)
 
setThetaEndpoint(self, flag=True)
 
setTime(self, t)
 
setTimeStep(self, time_step)
 
setTolerances(self, rtol=None, atol=None)
 
setType(self, ts_type)
 
setUp(self)
 
solve(self, Vec u)
 
step(self)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  appctx
  atol
  converged
  diverged
  dm
  equation_type
  iterating
  ksp
  max_steps
  max_time
  problem_type
  reason
  rtol
  snes
  step_number
  time
  time_step
  vec_sol

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getOptionsPrefix(self)

 
Overrides: Object.getOptionsPrefix

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_convergedr.png0000644000175000017500000000451614062764461024731 0ustar balaybalay00000000000000PNG  IHDR$SbKGD IDATx}TTe?0K )H, ȫRR&uӊ[= *Ц(ytCA aDyyFdmpj(is9e ! pw~>f,3tP\\Z1VhkKдi?e,=Z˴%h4/"eB7$3YtF0h|_TlˣWDǪqB{{yq^x Μ?)D8…(,-`ceElHX+]]dO̝ ZWNr%ogcHǞ11ڭ[rscL0lCscQ͸dԩ$k,XiCΕ.>ܿ3{j```JkGf_wo/998|b"(JZVy.zJ¥ROL$cf{x4:Zd~5m#I>;xD,3P./ת˃MHdz|ں{7,MM~ ¥Qwn+))<D,&.4GRa""6,-ǥfyjBkGJ cdDY\NAI HKoo o4R oqtͺ܀<+*"NUV2А 9Mmmh2zzj =Ȉ]]8-k149#)ߟZܹ$EEfQ6nNlHȨ ɨf"4(ר('ubDZ`Lbce4tO-Ұ05SQӃ-sV"#QP'&&>(xG+O rq=}}H57U#n#j~` 7ߌ}9-_NNVace#|(;}m~^yU'e2zG044^~> 䫲2x'1!!$;''`/ҩP₳=ݰ?p#'Or/KK9[]}W=Ŝ|}={= Ũ'ϝƆšXYQ.Sc$xuuʣ99*.^~n|]#k*xK/1orml$v|~hՆ)R),\x'3+lgGBR{HL-,兙:U&$HO_߈i6wi)h͜,KKlK2{e2v})yҒF32zQ_D}_ Oj388CNNH;Q*hk50 petsc4py.PETSc.PC.SchurFactType
Package petsc4py :: Module PETSc :: Class PC :: Class SchurFactType
[hide private]
[frames] | no frames]

Class SchurFactType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DIAG = 0
  FULL = 3
  LOWER = 1
  UPPER = 2
  __qualname__ = 'PCFieldSplitSchurFactType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_sf.png0000644000175000017500000000364314062764463023205 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDXIDATxmLTWCP; D,#?؎E4 $jVR BbiѐJ ~P! FcژU!+uF3U ":׻`N3=~9o_992""pf2\.͆foUrrrf&4 oiEDhk.Àa Bt:>|Eokkݻg;66LNN("6l@MM bbbh`X~z>}022Yd2X8q;9!55t:9N׍H-"J&|ׯϫ9sW^^\.wFRRF#//& it:q1dee ===B}ݎRddd###B>JhZݎ8DEEa׮]GZZ.]wnݺ-[B)O_jcr #BAG488HDD&֬YCKK.%FC444D˗DDt) xR(jibb=J ) ***(..L&ӜfESGG={%}ddիWKVUț.h||]ʽnSkk+ ;jmm9+p=dp8$]_y)HNNNC@@q㷕T*<|åG/0rp9 nV2L8|rtZ+o1ͅ9l\.Àa0rp9 \.Àa0rp9 \.Àa0rp9 |fE@nܸhhhMЃF7zxL2,χz:1㵵hQ׭CvjMB?V \OG^N__ac/nʢ"|cdJ*g|b{@ ><hiAvq1?kj6&ƥ}WpۋAee{3w| py9BB*ex3TNlT6';ЗHƜtA\+-EbyJ tEE8QW، 99%$\)C/99sf&~y6rd}Pn/'IGN[o/n3"UFgyׯr)vyK*|Ԅgkj)m~5n~yz= 22 eNH:WEFs z=HOGr8WY6?Xݾ-aDV \.Àa0eS\,F3>9 x2F=IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Sys-class.html0000644000175000017500000004555114062764464023241 0ustar balaybalay00000000000000 petsc4py.PETSc.Sys
Package petsc4py :: Module PETSc :: Class Sys
[hide private]
[frames] | no frames]

Class Sys


Instance Methods [hide private]
 
Print(type cls, *args, **kargs)
a new object with type S, a subtype of T
__new__(S, ...)
 
getDefaultComm(type cls)
 
getVersion(type cls, devel=False, date=False, author=False)
 
getVersionInfo(type cls)
 
hasExternalPackage(type cls, package)
 
infoAllow(type cls, flag, filename=None, mode='w')
 
isFinalized(type cls)
 
isInitialized(type cls)
 
popErrorHandler(type cls)
 
popSignalHandler(type cls)
 
pushErrorHandler(type cls, errhandler)
 
registerCitation(type cls, citation)
 
setDefaultComm(type cls, comm)
 
sleep(type cls, seconds=1)
 
splitOwnership(type cls, size, bsize=None, comm=None)
 
syncFlush(type cls, comm=None)
 
syncPrint(type cls, *args, **kargs)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_format.png0000644000175000017500000000163714062764465024070 0ustar balaybalay00000000000000PNG  IHDRI$J{bKGDTIDATXc?0LQ Q [VZp7L!qqK==;. b񛥞ުn8j`KKsXAt#dK}\*9jzUOM."%*J='puR57# pww 6<NF2|{nIHFFj(*)frEE/ύf 'G^TDŽ%Kam۞Eݽ˛fiT_܎$3ެ +}~9٫W-NIGAtۏ7XK|-5֮6lxꕄHerr/';{o?zne"/)M'ajk03=a>[WULCQPCPCÇO_3yno?}s?~,ac¹םRSMM__^IFB'QoG.\8}*ÛmniI _ quxO/N4{RS”파H2J11SzN]A!yc:K:a V ߆&~K{KacFE AAq1ܲsXjϟ]  " a   ~[Waラyߵ         | AAAAAO!a     )$LAAĪ>G~> Ub>xu$  0MAA~~_Bwqk\.N9NDFe%}ʟ_~[JAA_AAAoycb{]~W_W{{]|Z_:AA|0MAA OTirBGW_/߼nE$}i߾MEEǽxzUWUqr}Y|L+Q>-H~kg  `<  b;<|ˮ]j֯}odKwo)-ݻcת|AADpCi  XmL E FFi㸇[v8 3swklv/zڲ㸄o[׮}z޶gT*m-PMT66֧GAA?$LAAj#/=]$hǕ]֭s\CCx50`X~׿93ΎNNlhHjTl  8H&  FJO/+/tզM(맧5gf.&* ە!!ROoLLfC,ffAAʘ&  U?Wqd}G\.~/862Sڬ55yyOPPr՞pc  AA Y_P͟?9Q֮=䓚(ͦG''S+*D"L*=߳D7Oj BUկnSOuV~u奧!!qv  BH&  ɦ/<1550:2ٱeۺu}##SFcAfT"ŽCZ{znwAf&2=vmhSWWdXXFR^r0ǻFAA;$LAAj&&""&"E$m[Tjv(SIQVr|[ggH  U eLAA|3qek"AArLAAտ򊿫@AA| 4AAAAASH&     | AAAAAO!a     )!AAA%UX, AAD`A4AA\)㦦\.̌n8pFn̠lZf3evvelZQ6L6 ep8  Jm9+ JOb8""eDT* CY.jϷ Q*"##E"Zf;,f  "!a  bWZ. F/NLLYb4F嚝u:z8p8i28^lnnw:/H$9"H$Wf;q>Z'D"ar[bD"\.9+b Y=m5/ xZ`8.Z-= DEE]pR AA}OAE/ t[߫˘v:p:Zf4qnvl6<╨dBrv;t^|diZфc ,^Y hX,`H8N"D"\P(_RV qE"QXXX,f*D" H$R4&&"JOQլJ2L; ϞzG   AA,~Sf p9WbX+/YFqn`0?-)g@baOCs!Ic;+ -&D". %}v\.8JJ뿨j߹\.-H\.X,VT̏ xT*u6 fś'c;93_K _\|~s~7vuCM##![k vh2)rlX̌{; He ?מ  i D}^`ea^/ | F$EFFL^~/$NS"r|nW*L;bj:N&<{C*D"T*u:LGԋK~@R[v#HjJH$2s"R lFvl ai6p8"1 Ǚf-Jo]pe3;DN'n[C6ޔv5\/?$$6UH%RiDD\.P`n Sb8$$dffb`gq&NMMfh0F^7 QT* ă*T*UtttLLVMLLLNNȈt'O|wbcc?[o}ot߾}'N8zt\\\jjjXXnFq:6mxxjZ։ &d2Y昝Z6jvt:qQT*d8Ṕ3]"b|B,7]`( |4mqPq34;U*RD"( V"` Fewb7Qg6Q{ľ^nnf 2KrY*/R%Z$2n|8pQD2,44o¿8ϧ3+zDDDc' i LCk IiPx7aJM.uP=^vʺ|S!fe1HT*15Ljt̨T*i0Yv;6:jBaVeo@5*J8C2`9RKs& ̌d/aJ RP(QQQᑑ&"""222""#""[R8 sv(haرch4;v(//LLL8Nw}FT*MMM<~Tfff<=999>>n0 {࿆c^RE|Hy%22R c` Zp \z=ejj|z+P(æ@ՕPQq̿Fy-,[u L.K"VZa- |B_@ 5On759Tִbq\ZPȓ`@*:cwfffc|13;Ա {]u bBR݆D"'P i bgB'Ei1;l6㯐Jnpkb"3%L Juar0LSeR)_M=@.N)bW|DRAN*o0q0]Pjȅaaa**$$$<<<<<2$Z-+4Z,ᡡ!^Y䯅d,gggy _+G gN# [,LDzeTZ @Dx9= aaaaaaLnh4Pa u aOJ%S ʸ\LLL@qh;44IDEE1ŖYYYE?~5MEEEUUUEEqwn6_{+RWHǎm6,۷oDx]]]` 999,>8Y0,lg+3 {^Ԭppq>d2BԆr 9,LxU{p ؂#f2<<}~6 ,\֘͜^1JYP5񑑑a!&&&>>^U\(@rqp8p!F20U*C /P>ǧ5w3=βPdc7ЀJk b xGFFJ$4qXArA4A0S3U^eȣSSSm@.Yh9L 4_3MPTB&i;5 czz-MMM91/._CY-_B.KRl6L@9;; &V \}0<4M/`U$..ni0<lws߽B]̢X\84Pf/VcccCCCِ\.6P"̨)4T`cZM&&xY,d[Gl&N] X7˦ Ŭ' ގ -Θ=A a b5055eZa}4^t LOOC{e44Vш?Sg/Tṃ:a%\.Дa%^̢<iaSPR)tx1vBgWTБ!?HDe3 *}n1tJqM d2a>;ZV(R4<<\&AY7^893́_l<*̦el|)1 #–s'22u@ARWXg 8R(111111XS8ѩ^FI8NN722TcccCCC:nbbXRiZV7gA^ʛn)99yjii9tЖ-[~C?Olwuu;vرcoTfffyyyyyݻcljcc#<̌/\(qT R5 ƮP8ƹqyWfQ$S~yESbb^t/4n6 B9K IŨ|DD­pA#킡1?0b/zJsr7R88ɟ Cz=(Ĥ縸8D T>؂-/{0S8!Pe-fAqfФt:NІZmBBFILL䛝5M"AfB7::^K IDAT.Gbbb|||BB’"ҐDtG=t[o533pXW[o-`믿~mڵ_RN{=;&$$TTT޽{ΝKnZ6///'''777777///333(&,|`aD>a,Ĝy\.Q N2P(X dkd++R\\bkܾٺ$Y#2,σ#ܗ r)=\hU"*Rt:J(SUC]يchbPؤD-f\6@t7Oin1 `5;cjJB$[4fb8GVvmX@+KR9c Z( DT*g&e2Yll,CBBAVZ@3~~  xM:995 칑enwaebz((:555999>>):)q=!tYac0c؀np@ hkob0zzzݍr__SU*UZZbcc###+^/Р=䙅et2>cQ4%Z/ (qqq_|Y ,n>SSS/s:4;;;zzzp1WT^##rΞ=皚Ruʛo9))iIo'TVVO222.ܹsG9zhMM******6nx>[͢{zz %$$EEET z~xxxppp``Y9|xI `_/&&ꫯ.//*/ XK,644p'˓!RDoo/j(CCCKR,'=333+++==}᛾jJ|=<<^̂^ SSSks###[}Ah4NLL` 3?BTb)ge]0se}Y -"bſeeI+-[x4F@ _Zx |^(>dKeZb~*GAH&"*4{]BaR@/4368UmvvYZgE^3) |+rOfc%6YXCS}/1,f t>fOR\@TTT<~e60ł4n,˓ @c?+\؈LBUTT2,uTWWڵR:v3b cccL}gL$`A||n/1 "M866Ɵ>*˭V+Nձt飢~`h-ngk0" bVHKKKKKCV]34m6 &C;QXZծt@ccc}}}SSS}}}ss3&;xulذay?f}k_{ז,w+tHΞ8q"ӧU*֭[[PPv%V766M+'_Mc Q/Cm6j$pHKKcW􄄄$IqttM KNNjbN {^g5kDy[uBB*/%Q6<۟mT&e[,ۚx*pEGGxcOa_`k+|IM.{:X뱱J|q4$9oX"ōEȜ1\ i t:Y`dd-OR)n|+G{vM[ ʞQŘ&'/`$m;xR?ѝ].~qm0oh%,,,&&Z}%Tݻwl3337tSMM;wG0^y啯|+^{s=i-zzz~cǎSSSrf*dZϪ _@ELOYKFFF"oB_^ &c``?\ddd~n]IOOYzC x>t:Rh)))}0κHN'j=Oij,$ݠxm!뽭>3Bz:}4Q\vvW>bLX֊QP[jx͖b^{:Ap$L,xݔ?[čs-1vНљg KHH`˅xb5ƮA3Tf:: s/dZsb̗ }7z l6_c\211&ne.{؋Y;jQ^0_2w?xeVoARRb DG%V1$LĪezzzpppttt``m2HP!çHWHNNKJJjCh?ȏWz˫rEX,0c*k__ Nǚ!!!PЉgZ?9 +{ 046 T&Bc3Va9FY|_n].R,((]ysiL`BHJJ~ Vw$_ܜ(RUhOH'˳7ltaZG8ruuot:׮]Ba^޽{455]{2999>\FGG?Zc|׮]3l R㱥r,K3330$999//V+ꔇ] pDXi偤eeeeddQb~qk D̜nN[VR,P,kZ2LdE]0%ogf,τԕ\eIxqlZ02?S"%vXN:V <—0Mh@oo/vxxu5r`z3QOP0%=99{4`xA8N.'&&&''c";`'h4EƯ_]P@"g8;aKgv#?cpp4{%tg,Σhp.Et:}4_ݘJLذaC&''y`ƷJ_z{q+ (Qp՝~Եk׮Yfڵk׮]24/Y___QQospeePuuƍ}ܯQZX|WUU_>6οwww~Vj:S.ݍV̈D L(---..~.7Mh3󃫁t:GFFzzzx`9\E\\\PSSSV%LܬZ1==0L<"R)^M*ZmpIAJ?TT*@ގTߜtlddue2/L@ K&\0Bb[=O/qK" a ׇ,^v㉏OIIH> Tg/Qeÿ* m;kllw_{A|7qGG[fpA4ɔ2w(@qJJMMec fߛXJb/t:덄'%%aQBQ7<{ٳgaXbqzz:x WTn~*4yɕM^MMM$ |0腄 9;;;++ Xx.l>{spdBk֬Yn]0C/^ nff&۷o)p 7n|dҗtKرC o߾NSSS!7AGW(f ɗ}-a_022·T0#3 )Q0||L?lnnd_gWm2 )Vb[.Y&>7FA4A:iLfhZ2hZEis پ#~Q `20WGڻ>3I466611 0Vh_Yv===hc"dk0dz¤$0θ~6?Ja.r^Ԟ8L!qPRRRw xfutt`0VF_ KSsP(rrrtrrr5"Es!!!X*r8|tVHKKXn`zC#^P(IMMe7L+=k]2?770Z)0$L0~MQ'i 9PXuxx8Ye_.:hHxMxx8Eo $''^qd螞 3rx=tg>虁2_KKK0ǝ>}>CC6!!a7nLHHX隬/YvCCCWW;??0// [ Vq/ha,ϟ8DAff8Zd}5TVVݻ?s==# 9/<<&8\QHLL K8_FahhMLLb**Dh R=}yHLLKu:]kkk[[A*&''%sIOOOLL ?֭+/////_v1#H,}͚5AS+hD=nv=22k6mڸq|n/$1Xn5 &Uwvv" MD*=Ze ds_sZg!ӜwBZẈj寤v 1ꜜ6fff/ǤiD"QRRDj~A d0VHII;/!a ޖV\ДņUpsss'.̚dX}CKp#y08J=˛KJJmh4bq9HfPC[ELNII{-:G{{;'Zfkbbc]]]'N@SV `ƍ,Ѻ:COdDci慅4pSN 9M(`s}'Nd999̿ex ػwoAA8}{O?o}ݛniÆ }a6kjjx^x˯dnLOOc\gϚfTԗ_~yB}j۩SNFa"MZ[[ +&&0ƙ `0^rXabqrr2_Zew%ĬL̳]`u4 uG|-}}}9 ׁ1<<{섛-&&&w $dQt:H7bXբ>B)*> q8N`+ظƣ/`ͱzX ERRCR %ؘ 8ЭV3yyl@Xbze2YFFFnnn^^OJJw}LMMCEߌyyy?ݪgΜ1Jr6m6mڔ^4CCC,V-Ktu|/Τ&Xsrrط1,mmm555.+##c֭[lٲeKII :x㍖j>/w>\.fyرLf,8>\0813oY|AAA d:{,\.l۶lӦMcewf=H.gggeJBj^.LaT#;;;==}upq#_"`#??PӒb<LT+O:v&1ά:}?裏FFF$I^^TvH$iiiLOي”vhmmu:`6Ϝ9㣣2lÆ W^y'{SSSLܱcG ޽{VlRYYy 7 M]q5 eׯA`>O>`0T 6lٲe֭7ovTkk+s455!<*,,sHYzdd$LL*((X4 >d~?%X )@&x,((HKK fGI|ft3aGWggg?"#""0Mק^LO?ĉ~i}}=v+)))------((P?زeV&Cm}l"h2XEkk+laxz^u/8ӧOOMMD %%%k֬B[ny9n3㸱'N?~FXfR|ymsر{O?moo8.--9֯_N׷nOϞ= "44Y֭+..Fc7k=LMM9H.摝-H.8?w}ĉΝs8IIIPXlٲ~z" ׷D"F/NOO7pɱm۶yNYવx}/v{MMl޽{wm#G[|d*,,ܳgϵ^m۶lAqa20TvZLYn|DA-J24//*hy睑T>\.Ɂ =A */j<677cRzƍucרs [jdkז]q^FXͤꦦ&Rf͚͛7oٲ%##r}QO>H$BIQQQII׉ԁvt-zi" x饗/|>܁O>zt?cҶlٲvZ`O>drΜ9|'2 cзr ʷʋ/x 7477]WW҂QT&i/طo}!H֮]{eA-../QA$m޼ٗ陞gq|G}tfX\ZZyf,T\\V=gǪ8`0еae]6_d|֞>}l6GFF^~ׯb^@ۯfӧ?SN9svǯ_:o^m~ p_{N:t:KJJvرy沲BV@ؘfj\.O5uq^\G--M%j~G=|psssXXΝ;ٳgA1#W r:::"}ĄL&+))M 2Xaڵů 9 777l6XY\\~zzl`3`0`AKKK}}ɓ'׺;v%р:#F96sϜ9S[[k45Ͷm۶o߾{nRv>s̹sv{||/Kee\.H$wy3<յ7|7<11 /|_joG}?4͋8.55B~;G}a\8_lhhxD"J*++я~t%ϊVU{|QTaÆ{祗^X[Xeߒdz饗p6lя~;X,%Oq?ĉ|L*⢢o~O?tcc\~-{ƍ2$$$ݻg?>~ y[nHff&njܣU/:qG_Xs=~-x޲2և^y?_zk6XydO:d2BQ^^㏏,}%g+?nll޽{yk&~Vٳ>}ݷk׮(re]v]wW^y塇曙r7tF >PW%'OݻvD"QYYٽ޻gϞRW*Yno~M w CZZu]dǎM: @otuu%$$TUUۿ۽ڢ'NO~o;wNVܹnw"$==;;-|C޵kЪIGNgKK ©kkk?]uU:'&&PD.cBv,X}I͗Hn [&''O:uԩӧOn~!111118VSS)O?펌ܱcdRƍ7nx\o8(JL8v?ѣG7r]%k.<9s < VQ ?۶m ^GDD.mvNEE<coFee-ܲu=\aa?|mi4Wgٸ\WZ,=ݻܹ3ƫ"Q*O<::ji>LWqdZMAHLL׿FުwT*ŏ{wrH@,c{0=p'wرcǎ_{bx۶m۶m{GRE$a͡ff>+uIn߾}tX#wd6Mzn U9wOlAA4^'   R a>~_D7z뭙W]uU`JJJDs0 DYYY+E"Qoo+l/$III/~ Do~כL&J4D"d<{b??W\qcY8`0s=۷oǪǽ+>>..wo(y_TzbDXyQRRUP®v+ǦM_{D>(ޫEЋH*^V]{G@*`P4E"< >a3s3Ghy-nvvӧOXTXעʺd:q艎vppQRRrssKMM'ObOd }};weY^`q2twOHH`qhllz%3S_|]6#H_%&&ё8pZ}uD******4BєΝ;RNE((( H׮]gWӀ_ō=ZRR͛fZnX߿ʕ+EEET*xݻw'>|]v?~[߾}#O:!rrrlmmg̘Q\\ƒP{{Ǐ=͛'NP(WWW]YBBB@ڍ^=lٲÇv~_7))Fyzz_;vQ߿ss)SyeZѼ%%%L'UrttP('Ou5 ݻJ^^ۜ9s](Y2C|04APkwn9/j=n:H}uE***pc3fΝ;'O"jjj$NFFFu Xn۷N쭪OEEŋ/))))\@̙/}?,,HWW|ڵl,[A(e233bccmmmږ.]qݻw[XXrp"""!yy &_z0 3f 7<<l+npETTTnjLOd2ǎá999,1tũT{(öؼy]dFBBB =ΙRRRjkkO>-;wnjjŋ4eees믿Baaa˖-9s&BHAAի***EEE{pBBB:{]sZZOCCLUU5::Gv?8_[[KsHJJ_O)q׎9sΝ;mllVZo۷аa{!Yh4J$#!̾ݽ{wtt52n8 5k8::JIIxNRRr8pӧ_x,ϙXƿ{ ~PzPcc#)kZ[[9gp~_f= 'G,((HOOoٲeG9|0B(//oΝ uuk:99IHH ~"ᡯQlE&ƏY[[Ȱ`憧x~ƶdӀ!+++7oL1___[PPp̙111oo`ߐ///v<|B_|' K2g ===b bjj*..@jjjΝ3~ˋz %T*xʉ'\R1UUUekk;mڴ#G):::Ġv222_~eqGԑݾ}{۶m$$$RRRLMM񿎎޽xXD IDATL>[RR"...!!綶6~~'NJHH̚5~+?7nz>qtԩ0 ֥K.ŎuUVM0AXXX__dq===qqiӦ\zhoo///ONN^z5 .*Տk{~Çwee%t"B(55uҤI#G400~:Bnȑ.]"#F+Bdԩ&Ld^vܹ3a"$͟?_DD޽{G]vUUU2e˖Xg/($$yٲeRRRwW7n9rĉ}HHuuu׮]+--ž3gyiw ,ZMMŋ^l۶-00֭d֭[qSӋ?~̨emm}ii1q֭&&&6l|߾}r±c*HII3\\\l ?}4++ w#mooz*BINNO19X[ZZ\]]gΜY\\|ƍ#G+))EDDpӑΝ;WXѻwSNlڴi֬YLOћ7o>{ׯv疓Ess3n999{USSSWW(LfW9YcZ !rd[[[͛O>988>|xժUqqq/_DDDdff&'''$$ܸq۷ocƌ?p֭[###wPMLL&H$ccm`\rŋ/^crr7OXǏ"066L&:ujLjժ#Gyxx8::~ O,++;vRaaԩSo|waWO&&&;t\jYYYǎ[jիWϘ1c˖-B˗//--}Ht:|ŋ9&%]WC >>><<<'ǎ /**6lG JKK_x+//onnN18?w>|xB('')^*|q…yyy̙3#""Z[[B ^i8YBB(bz3*ZQQA P畕NNNmmmyyy4D"u0///wa(9'*accÁ#0P---EEǏ#BBB<==Ynbbgkk+..Ԅ[XX\R^^~nݺpႫMLLkemmDGGǏܹeCr)S0N-X+V >{VXX ҥKXt)iRSS~~~+˝]]][ZZq׿0Q/NaAAnv;ɓ׬Y#//yu'ϯYRMMĉFn9Yر|cc搐^^^@));w9rƌ򵵵Lyʕŋ;;;lܸQMM-""!qFiii___qqk׊Ι38rg.8wX&rLZ' m̷oO:588uUSSӭ[=s3g5f5jNr![LkttU\\t9EEEcc}OB[nԨQgϮĺɝ;wƌq c2e ~0,,FJJ;wƎh"2y766q@7=SN%֭÷✝`ٶmcmqA L‰ ÛӉx!  #WH{{{ddYsa==I&?NP__8::LN;Fhcn޼9..ƍo'7$ysrDPJJׯ foo,__ߕ+W\|||ݻa5k ~HR555,Y#"];FhEEElA(++ gϞpAM2۷w ϟOe ZZZs;ݿQ2E@@WnZUU) ##=vqͣ2T$HK.qzL/֬YӧDgg.w!t%pF*sss2|Q|.{QԀb@lĉ---...*JKK3ihh())^ž={ _|y bzaa!:??_UUUNNnŊP(v/..mnn&+pp8~w)vvvZsՐp^^_~8i<(W7~AxeGGC(!!!gg琐Pycc޽{bcc'L@E49vuw>|ʁWݙ0aœ9s/_NAh/_zd8(**2=Y(((OlnڴO&&&ǎxe'X^4RPPoDlᇓ _|{L{ڌ3|pG?ƍ_ϟ?QWWwqq#6ZZZ_?~Q/?!:["%dRRׯ7l]Lp̙[nLO~~~ǏONNذaCRRם,Hs֭tOaў04 MVXX___{…y1]Cii#G>~dff3Kr&==]v?999ׯߴi^0o޼lذUt%""___E`WLw…ziӦ jMF@@=b8M`ӧO\qb=ZUUP(K.eqBï.\X^^sݞL&?HmL q 55W^Ըkkk^zܹ{ewXY~ʕ+;aÆZZZfff>|PAAOo*aaarrro޼QQQY|9Nxw5~ƩS?pرs*((߼y344!xb77cJKK9ãQm۶pª3f̘1# ] qqcǎh///KKK11hgcZZZ{qƘ1c,<==o>w\==>gHd_~yyffmfff\\N-k cڼN RVV^v'PTT4&&޽{jjjfZ~9svh۶mw܉prrRUU믿=t?b,X`~~~88۷i5mmm׮]Ù,+fmmMy```-lm5"MMͅ ߿WW˗/o޼kjj:qDuuu' 8 ۵LWN jmmwtt2eʎ;SpΝ3fO򪭭ǏGFFZXX888<e]fͪ#_0TPRRwUTT^ƙg[WWǴ_wSNmjji& fgXeW ^^^^^^ rػ6hm{6kC^ǏhqL2p¹`˖-V/ahԂ8 {XbG~ǽgɟyrV_ ={o8u\棠|; 0 ˻h"AAAvqqrz@A`\i{O" ~`PA`4Ai ?$((h1996'TTT(**עX2VTu\VymZ^`o/44VШI1hZ 6(f~[48@```4h6-?xyy.00pl~ rfaG cu 04jF?5U߫-5>K4ܲ\}_4#z+s8uWDZGN[[[FFFZZ}h$%UVVVLVSS>|8@?48++D䴴 i4J6lhssR^^N&333KKKB<<PUUSQQ)((5j>;nܸ;w.]֭[v277P( իWBBBG600(.....ޅ2Ai~ J` ]\\WRRqa}}} ꔔwIIIY[[ٹ=yKQQURR" 6\xqՉ %**JZZQLL?ϯօ cttvvviiigg'BH\\\__DeeeEEEQ('OtttٹL0/V>}˗f5kjXX 1Xrbbbkk1B^UUUIIׯ_B ݫ555EEE|AiFה8K "ѺļqqqQQQ߯]\\\]]鿥}'Oܹs]H$zxxY[[3פ$#--D"𷝝 2-zzz0"ׁ4>D#MMM返 MLtaNHH4111c08ŋ7n`]f??w޽7oc?~P(111eee8H]1I5440M`z] 0 +C>h9Xs?~L$}d9A~~ۗ/_MMM{Rxvm۶͞=BBB?_\\LO}}ɓ윝zO>tQZZֆTUUO]}F.`ttt{!˫B$}f3-- |i4w;G3 zݻwow%=#==ɓ'T*HH=eʔ#GP1RVVс^ (uuu8WXXHRBrrr8]e,ղ ~W\}ҥaÆh1B!!!Ǐy|ԯ_566:c_PԲ":ŭÇkt]A`~۷w1Lq(**022w###yxx\]]{J]|k"OtO455͙3'::ԩS .B޿ iLH3 IDATWSSKڽ:++!ǧзZ[[/i~fǠ߾}S1hF᫭P(555rrrݍ|]uuu^^^^y󦛛[ SNoݺu'O҈111?&r}JHHSQ]2зZSSSRRr0@`VF&zmcc#BHPPPCC>iD97oxxx""" =ݻ? NHH411Aɓ' + _~E]RWi1lb<2LVWWWSSch;stdddTTT}}H|gΜiddҗ"Rƍ%777?볳>a{G{hYZZ74!ijjjii1b0K 0 ~Rmmm1輼f} ZOOoZ9_~-((8i$o555:~.\xԩ>f`ӧOO>=s挟@|ѣG>}srrRRRoryyyѷh]:::PUUE....))hJJJQBl ÇȆ")Sb%KܺuCDGG:dɒSN BR(VbM%w?"$Bq½64jȄ1蜜,g`` $$4%d-$$4qD;;;WWW}}j ;;"-7n\pp@ׯ_p׼8Hmii9p={HBB*++ :QQQ\%ӀuvvD999yyy?~D iGWWWGGG[[[LL}}LLLTTTlllcc#ѥi29O6M@@ 22RWWw{xx򆅅l %::|ĈǏ)˗/8BM&ZapKï! hmm蜜ܼVLq:""ϟGEE޻Dh777==A+FppߤI3^|y///Ç d2gvqqdgg!$..N<_rB`ӀC544a8b8>>>eeeFFF222.466Bwvqq!4۶m[hɓ'ٛȢ}ǎ޴i<ũTpɓ'T*U]]uҤIڥw!j&F__:V@`pz_#l H4 G9իWÇ0a˴iTUURօ \-e͛K,}6{ |L$&ٍ=wX*(۷o޽eff655.qx쬤Ç %&&DhAAA6ݽ$88ښ%aaa.y)Bw^een-J-**yozЈ#p===]]]---Cjkk+,, Mt$7 d2#W]\\<<<]:zTDDDUUgVVֵk<<<]FDB覦&bJ;;;qqqv>|UCvttkkkZZZ|||./ LDd h4~~~%%%uuu]5X[XXt;w,XΝ;.NVZu%f=###222***--D"5m[~~>qHu5j{iK]^BHLLLCC>#.///_~MJJP(֮NNNJJJ.#k֬9vWϯ^͛FG}1..B<|A1cƐH$v?QԂU`@`""999---nP5"99^ss9s}znn͛7]]]]ё#O>mkk#R;::k8Phii7 . L͘1dggGB:::8_м޽˞ í522ÇmmmvvvL0$aX: z=Y?Ľ k^^^ccciHDwTiii"&4mذaG666666622b,3!O by %?YYY>}BIJJ5J__[OOOOOO^^ŢƏo VGrr?/IHHڞ8qYAAKvN-]nygK-Nq!T]]C rCIHH؈#k9}x=|pSSSSSSbʗ/_rrr޾}~zfbbbUUU>nD&iNႃݻ%..sq8;;9~hQܸ!mmmMMM͛4nܸ^CPZ3X/L;wܹs]Bꀀ4ZB cǎ;v,1,##ǩ]VRRBČm?iC= L4iҭ[]!ɗ/_vppWLK,YdI@@Y]6SQQQQQqss~933ǩ[6Oy&~RDDD&M4i$ŋ]tjj/_kbX-,!!gJ}΢MMMaaޔx‚e$GOOOJJx!##CUUUEE~ϟH$333ֳc'NĞ}l_njjG3bJMNN: JZBBB__qzzzcc#Cjjjtuueee>khhT)y򥶶*?3-[xbmmmuuTVGGog>}UMM ʕ+fff666Gc5...+ sVVV_lܹseddlmm?|}ꕕժUg8qwg<==(ʠU.]gٲe˖-sttǣZYYutt ~]]]-[t҉']vxwVVV^寿F577͜9S[[{޽?˗/{Rٳg ^pCCC999===mmmC"$$$Z>D*++Ceee 닋{{{ST1.:tg"""zzz"""#Go?'O&H tŊ$  ---iii*++yyy_xA?q͚5!555i9s駜:uf FG!ty!!!lٲe*?#'''??ںxF=~777788xƍAAAuuuuuuww^Jw o߾ůmmm_~ͮBdddNNNIIyyyMF%,,gbJxxHgζ N_!Bh۶m999999fZdI[[~8::666^ti111Ļbbbw%hD;vVTTԸ0Diٳg[ZZegg577/YuAAAaƸ8УGƌÖ /_^{cZ@@ZZZ1 w>BBB 6:tD"!֭[w}ͯ^"zﶷ'&&R<<,==!T__ҒVTTD_}ȑ#B""";w;HHCCCJJJ~~>7644dff1)4~rss g޼y_"Z[[322233(vJJʗ/_rrrRSSrrr\a̙4 %--=qDǏ Y1 0UXX8B 3kJJ 񯷷wxxx{{;744 .((xݬYg߻wSs͙3G]]}SN1667o B/_3gθq<==GmeeU__tQT*x̙ Z#00)<<f͚h"p,YYY333 A>}ŋSp;w̜9sԩmmm7I8YaWx7ص YXXP Hej?~|[[[ZZaXZZ9sڵk>}B ?x@II 9z9s(**INNN򋹹91118mnn@<(''7wѣGO<8}ނ q~i?QQQK.%H̲`{EGG+**ڪkܹ.]255MLL?̙3mmm <8qDgggmmm'z}rr27,,wޝ={6 5g5 jPUUUd|~^[rrr277711)))bii)񯖖"~ݻwЂ999ÇguQ(좢W"Z[[=zG[˗//..lkkۻw/Eƾx{轢:r䈴iaa_իYYYEEEwŰ!=zGDD;˗/===G<b!!!!!!gΜٶm.6} ^z… USTTliixzzw,BCC===رcÆ ;v쐖655ݽ{wss3nvvvVVVNN/]Z`SqqqyyܹsfZݻwMMM}||lmm\Z@O8ɓ/_lڴ)%%%;;ٳϞ=F''gϞ˗/)));JJJjkkܹxb//oYYYyyyuuuLLLvvvEEEGG&tpp BFGG<[X.8Cɓ'?bϛ"ɇ%QPPXzu/F}uCBBt11&ǝÇ'M4~xcccg.\ٵ522CX!4r 6DGG3]rcc/^|̙jcaa#F$$$EEE˺P BJJw  a_a==/_())EDDpŐn=oXbbɓ'O|/$$$<}4::hE~ɝ={ӧO۷ofxhETTJUU511_|kttɓBc`` ##ٳ[[[ss󄄄D%%%]]݇.Z(55֭[eee7ܹs 7{l~~~84ͣ366V\\ܜ]~VKHHtYK'?`QBPCiy"&&Ghlѣ^ xyyM8̙3v"5۷ȏӧO9rA\\.))I pvbB<<dc(##7on߾=33s[neZhsSp为O vss{ɭ[>};;;T*"9S!jժkvSRR %;;[^^>Ȅ ZZZ0455mڴ#G^xjPPІ BxcfKRTի]v򚙙yxxfXssٳKKK'N+''#}L:ѣG555555qqqbbb?ƍVVVDj(8bڴiK,IJJA.j?k(AggoDv銊P:::n˳&bU222^^^۶m Ý[[[^|rGG///Bŋ=)ûw*++qD]]]ٻ={fkkn: 1bĭ[p]C$,,ݝ~7l`aa!""ғٟ)((DzJMMD">|'~/Kñ~߿gS "GDDdgg˱cBQPkk+Nk899߿Ǐ[nݳgOee}JKKBͣ$0FrȮ tEpw?}?ܻ{NKK (((8uꔫ+Ǐ777h"{% 222ׯ_vZ}}}jju|ˊ)))?yxx(8o߾˗/򆇇#.JSSʕ+!!!FFFOF ZZZٳڵkfff666Gv횄Ç??UDDBGOOVVV]qq &K.=s挛BHRR`1{]]ݒ%KҥK'N ~Wۡb ZYYH$mŋ8v-[,Z^/WZEQ=z4N8gBtg{CBBFpB&ǍGܮ 8c.^I믿"p Gc9uꔭǏ={&##w^ooo<;q;sLHHڵkg̘q__o^`Ayyy8~-Z-^Mcǎ_~hoƍ#Ȍ3FFF622bp>'''kkk'''NfffW3`Kw?|… << petsc4py.PETSc.Mat.FactorShiftType
Package petsc4py :: Module PETSc :: Class Mat :: Class FactorShiftType
[hide private]
[frames] | no frames]

Class FactorShiftType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  INBLOCKS = 3
  NONE = 0
  NONZERO = 1
  NZ = 1
  PD = 2
  POSITIVE_DEFINITE = 2
  __qualname__ = 'MatFactorShiftType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class-tree.html0000644000175000017500000004611714062764457020734 0ustar balaybalay00000000000000 Class Hierarchy
 
[hide private]
[frames] | no frames]
[ Module Hierarchy | Class Hierarchy ]

Class Hierarchy

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMSwarm.Type-class.html0000644000175000017500000002034614062764460024704 0ustar balaybalay00000000000000 petsc4py.PETSc.DMSwarm.Type
Package petsc4py :: Module PETSc :: Class DMSwarm :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BASIC = 0
  PIC = 1
  __qualname__ = 'DMSwarmType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.SNES.NormSchedule-class.html0000644000175000017500000002576014062764464025622 0ustar balaybalay00000000000000 petsc4py.PETSc.SNES.NormSchedule
Package petsc4py :: Module PETSc :: Class SNES :: Class NormSchedule
[hide private]
[frames] | no frames]

Class NormSchedule


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ALWAYS = 1
  DEFAULT = -1
  FINAL_ONLY = 3
  INITIAL_FINAL_ONLY = 4
  INITIAL_ONLY = 2
  NONE = 0
  NORM_ALWAYS = 1
  NORM_DEFAULT = -1
  NORM_FINAL_ONLY = 3
  NORM_INITIAL_FINAL_ONLY = 4
  NORM_INITIAL_ONLY = 2
  NORM_NONE = 0
  __qualname__ = 'SNESNormSchedule'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc._Vec_buffer-class.html0000644000175000017500000002356014062764465024665 0ustar balaybalay00000000000000 petsc4py.PETSc._Vec_buffer
Package petsc4py :: Module PETSc :: Class _Vec_buffer
[hide private]
[frames] | no frames]

Class _Vec_buffer


Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, *exc)
a new object with type S, a subtype of T
__new__(S, ...)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  __array_interface__

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMStag-class.html0000644000175000017500000014236014062764460023572 0ustar balaybalay00000000000000 petsc4py.PETSc.DMStag
Package petsc4py :: Module PETSc :: Class DMStag
[hide private]
[frames] | no frames]

Class DMStag


Nested Classes [hide private]
  StencilLocation
  StencilType

Inherited from DM: BoundaryType, Type

Instance Methods [hide private]
 
VecSplitToDMDA(self, Vec vec, loc, c)
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, dim, dofs=None, sizes=None, boundary_types=None, stencil_type=None, stencil_width=None, proc_sizes=None, ownership_ranges=None, comm=None, setUp=False)
 
createCompatibleDMStag(self, dofs)
 
get1dCoordinatecArrays(self)
 
getBoundaryTypes(self)
 
getCorners(self)
 
getDim(self)
 
getDof(self)
 
getEntriesPerElement(self)
 
getGhostCorners(self)
 
getGlobalSizes(self)
 
getIsFirstRank(self)
 
getIsLastRank(self)
 
getLocalSizes(self)
 
getLocationDof(self, loc)
 
getLocationSlot(self, loc, c)
 
getOwnershipRanges(self)
 
getProcSizes(self)
 
getProductCoordinateLocationSlot(self, loc)
 
getStencilType(self)
 
getStencilWidth(self)
 
getVecArray(self, Vec vec)
 
migrateVec(self, Vec vec, DM dmTo, Vec vecTo)
 
setBoundaryTypes(self, boundary_types)
 
setCoordinateDMType(self, dmtype)
 
setDof(self, dofs)
 
setGlobalSizes(self, sizes)
 
setOwnershipRanges(self, ranges)
 
setProcSizes(self, sizes)
 
setStencilType(self, stenciltype)
 
setStencilWidth(self, swidth)
 
setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)
 
setUniformCoordinatesExplicit(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)
 
setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)

Inherited from DM: adaptLabel, adaptMetric, addCoarsenHook, addField, clearDS, clearLabelStratum, clearLabelValue, clone, coarsen, coarsenHierarchy, convert, copyDS, copyDisc, copyFields, createDS, createDefaultSF, createFieldDecomposition, createGlobalVec, createGlobalVector, createInjection, createInterpolation, createLabel, createLocalVec, createLocalVector, createMat, createMatrix, createRestriction, createSectionSF, destroy, getAppCtx, getBasicAdjacency, getBlockSize, getBoundingBox, getCoarsenLevel, getCoordinateDM, getCoordinateDim, getCoordinateSection, getCoordinates, getCoordinatesLocal, getDS, getDefaultGlobalSection, getDefaultSF, getDefaultSection, getDimension, getField, getFieldAdjacency, getGlobalSection, getGlobalVec, getLGMap, getLabel, getLabelIdIS, getLabelName, getLabelOutput, getLabelSize, getLabelValue, getLocalBoundingBox, getLocalVec, getMatrix, getNumFields, getNumLabels, getPointSF, getRefineLevel, getSection, getSectionSF, getStratumIS, getStratumSize, getType, globalToLocal, hasLabel, load, localToGlobal, localToLocal, localizeCoordinates, refine, refineHierarchy, removeLabel, restoreGlobalVec, restoreLocalVec, setAppCtx, setBasicAdjacency, setCoordinateDim, setCoordinates, setCoordinatesLocal, setDefaultGlobalSection, setDefaultSF, setDefaultSection, setDimension, setField, setFieldAdjacency, setFromOptions, setGlobalSection, setKSPComputeOperators, setLabelOutput, setLabelValue, setMatType, setNumFields, setOptionsPrefix, setPointSF, setRefineLevel, setSNESFunction, setSNESJacobian, setSection, setSectionSF, setType, setUp, setVecType, view, viewFromOptions

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  boundary_types
  corners
  dim
  dofs
  entries_per_element
  ghost_corners
  global_sizes
  local_sizes
  proc_sizes
  stencil_type
  stencil_width

Inherited from DM: appctx, ds

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, dim, dofs=None, sizes=None, boundary_types=None, stencil_type=None, stencil_width=None, proc_sizes=None, ownership_ranges=None, comm=None, setUp=False)

 
Overrides: DM.create

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Log-class.html0000644000175000017500000004001314062764461023165 0ustar balaybalay00000000000000 petsc4py.PETSc.Log
Package petsc4py :: Module PETSc :: Class Log
[hide private]
[frames] | no frames]

Class Log


Instance Methods [hide private]
 
Class(type cls, name)
 
Event(type cls, name, klass=None)
 
EventDecorator(type cls, name=None, klass=None)
Decorate a function with a PETSc event.
 
Stage(type cls, name)
a new object with type S, a subtype of T
__new__(S, ...)
 
addFlops(type cls, flops)
 
begin(type cls, all=False)
 
getCPUTime(type cls)
 
getFlops(type cls)
 
getTime(type cls)
 
logFlops(type cls, flops)
 
view(type cls, Viewer viewer=None)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

EventDecorator(type cls, name=None, klass=None)

 
Decorate a function with a PETSc event.

        If no event name is specified it will default to the name of the function.
        
        Usage:
            @EventDecorator("My Function")
            def myfunc():
                ...

            or

            @EventDecorator()
            def myfunc():
                ...
        

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_16.png0000644000175000017500000000154414062764465024064 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Vec.Type-class.html0000644000175000017500000003177414062764465024123 0ustar balaybalay00000000000000 petsc4py.PETSc.Vec.Type
Package petsc4py :: Module PETSc :: Class Vec :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CUDA = 'cuda'
  KOKKOS = 'kokkos'
  MPI = 'mpi'
  MPICUDA = 'mpicuda'
  MPIKOKKOS = 'mpikokkos'
  MPIVIENNACL = 'mpiviennacl'
  NEST = 'nest'
  SEQ = 'seq'
  SEQCUDA = 'seqcuda'
  SEQKOKKOS = 'seqkokkos'
  SEQVIENNACL = 'seqviennacl'
  SHARED = 'shared'
  STANDARD = 'standard'
  VIENNACL = 'viennacl'
  __qualname__ = 'VecType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_vec.png0000644000175000017500000000411114062764465023343 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATx}LG5.!S0r@$W hY*De`5`(jN?r1L-qDDjBfE=F=Y=hX>>t{YM#AɑHPr$ N222HIIA׳gFڵk[Ϻ,\JgH9555̙3CCdd$F3g dOOOؼy3UUUVcu@Xxr+ƌ#`AAAjwx{{˗/sޖ2Ο?ρje񄅅nDbb"=ؿ?qqqܹJsvҥKٶm& ?~̦M8s挵`XUTT0}t&OgyXXsl߾(|||n.\WXlZ GGG"##s]]]RWWʕ+1k.غu+!!!v j4773~~ijj8q,RѐsE{nbbbjdeef=zĴijxyylm!o1+IUUx{{[躃_x?.%G#rWtt[Bt:q) Ikh [xH\DS46;wwg&Yx~a! a{:AcwhΝZ$t<|Ȓᇄ^ѓ'\QA8ϛD޼i;sd$ &δutjvjet4[/,d}|<uu415:?P[_N54 c{lupڟ>@׳;A~~W /GIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.AO-class.html0000644000175000017500000005001314062764457022751 0ustar balaybalay00000000000000 petsc4py.PETSc.AO
Package petsc4py :: Module PETSc :: Class AO
[hide private]
[frames] | no frames]

Class AO


Nested Classes [hide private]
  Type
Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
app2petsc(self, indices)
 
createBasic(self, app, petsc=None, comm=None)
 
createMapping(self, app, petsc=None, comm=None)
 
createMemoryScalable(self, app, petsc=None, comm=None)
 
destroy(self)
 
getType(self)
 
petsc2app(self, indices)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.SolverType-class.html0000644000175000017500000003656414062764462025321 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.SolverType
Package petsc4py :: Module PETSc :: Class Mat :: Class SolverType
[hide private]
[frames] | no frames]

Class SolverType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BAS = 'bas'
  CHOLMOD = 'cholmod'
  CUDA = 'cuda'
  CUSPARSE = 'cusparse'
  ELEMENTAL = 'elemental'
  ESSL = 'essl'
  KLU = 'klu'
  LUSOL = 'lusol'
  MATLAB = 'matlab'
  MKL_CPARDISO = 'mkl_cpardiso'
  MKL_PARDISO = 'mkl_pardiso'
  MUMPS = 'mumps'
  PASTIX = 'pastix'
  PETSC = 'petsc'
  SCALAPACK = 'scalapack'
  SPARSEELEMENTAL = 'sparseelemental'
  STRUMPACK = 'strumpack'
  SUPERLU = 'superlu'
  SUPERLU_DIST = 'superlu_dist'
  UMFPACK = 'umfpack'
  __qualname__ = 'MatSolverType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/crarr.png0000644000175000017500000000052414062764457017613 0ustar balaybalay00000000000000PNG  IHDR eE,tEXtCreation TimeTue 22 Aug 2006 00:43:10 -0500` XtIME)} pHYsnu>gAMA aEPLTEðf4sW ЊrD`@bCܖX{`,lNo@xdE螊dƴ~TwvtRNS@fMIDATxc`@0&+(;; /EXؑ? n  b;'+Y#(r<"IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.KSP.NormType-class.html0000644000175000017500000002523514062764461024666 0ustar balaybalay00000000000000 petsc4py.PETSc.KSP.NormType
Package petsc4py :: Module PETSc :: Class KSP :: Class NormType
[hide private]
[frames] | no frames]

Class NormType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DEFAULT = -1
  NATURAL = 3
  NO = 0
  NONE = 0
  NORM_DEFAULT = -1
  NORM_NATURAL = 3
  NORM_NONE = 0
  NORM_PRECONDITIONED = 1
  NORM_UNPRECONDITIONED = 2
  PRECONDITIONED = 1
  UNPRECONDITIONED = 2
  __qualname__ = 'KSPNormType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_8.png0000644000175000017500000000154414062764461024001 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.lib-module.html0000644000175000017500000003076014062764457022472 0ustar balaybalay00000000000000 petsc4py.lib
Package petsc4py :: Package lib
[hide private]
[frames] | no frames]

Package lib

Extension modules for different PETSc configurations.

PETSc can be configured with different options (eg. debug/optimized, single/double precisionm, C/C++ compilers, external packages). Each configuration variant is associated to a name, frequently available as an environmental variable named PETSC_ARCH.

This package is a holds all the available variants of the PETSc extension module built agaist specific PETSc configurations. It also provides a convenience function using of the builtin imp module for easily importing any of the available extension modules depending on the value of a user-provided configuration name, the PETSC_ARCH environmental variable, or a configuration file.

Functions [hide private]
 
ImportPETSc(arch=None)
Import the PETSc extension module for a given configuration name.
 
getPathArchPETSc(arch=None)
Undocumented.
 
Import(pkg, name, path, arch)
Import helper for PETSc-based extension modules.
 
getPathArch(path, arch, rcvar='PETSC_ARCH', rcfile='petsc.cfg')
Undocumented.
 
getInitArgs(args)
Undocumented.
Variables [hide private]
  __package__ = 'petsc4py.lib'
  __warningregistry__ = {('numpy.ndarray size changed, may indic...
Variables Details [hide private]

__warningregistry__

Value:
{('numpy.ndarray size changed, may indicate binary incompatibility. Ex\
pected 16 from C header, got 80 from PyObject',
  <type 'exceptions.RuntimeWarning'>,
  58): True}

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_logclass.png0000644000175000017500000000262214062764461024376 0ustar balaybalay00000000000000PNG  IHDRX$jbKGDGIDAThmLSWǟRJvZY-8ZEh'a2.t_6#UK3膲aC4Ms*"C-Ti/i>ܻk%ߧsy{νܖx8 _@@!vt1-^B򗘱”Oeʸ3O!LIvJR$UU???Iķ n n #vefG {'L>bd ,F\yO|c+/p*_*Eק3 [QQ_iaW͘#S/n}J?{ѯk-69ajjc{!D; o0&_:u&Ѻub.www,񪊊4ڳ%8+r-)*U?\6JM/,T 8]#fV*_=J$s8\nNf椀7k?ޒa2s+*4&$Vs\E gE)VY.'HGÁaq" 4jǾm۶Q)M"Vk©ԏ fEF.[p`hzj1⯇ӓI!!H73-M9"5KL$`2Ym6~KjU*?/+*4*j4:26K\B ؾqD gk0t'#"""< Ŋ9--׮*]}}+KKӛjjZ[L&R(M55/\Dшʞ%b 8Fq0b|LPyV ݸѫVD:gOc.^x<\* Q$R=nwɓI(" ?HTn(b((?t("+pC{͚YKry\~ٷrrfEF>jwR([ׯ1TD}9M"O.J&ƬVFÌf04hټo32!N=rM11qg@{h#a~?5)H hϠӑQn_|ӧoXVĒ:Fx^?@ޞ`xwdfO0LF\@ CT B$%hT$XsWW^Wh8XQJ1777%s:_|EFF 57IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.KSP.Type-class.html0000644000175000017500000006155014062764461024032 0ustar balaybalay00000000000000 petsc4py.PETSc.KSP.Type
Package petsc4py :: Module PETSc :: Class KSP :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BCGS = 'bcgs'
  BCGSL = 'bcgsl'
  BICG = 'bicg'
  CG = 'cg'
  CGLS = 'cgls'
  CGNE = 'cgne'
  CGS = 'cgs'
  CHEBYSHEV = 'chebyshev'
  CR = 'cr'
  DGMRES = 'dgmres'
  FBCGS = 'fbcgs'
  FBCGSR = 'fbcgsr'
  FCG = 'fcg'
  FETIDP = 'fetidp'
  FGMRES = 'fgmres'
  GCR = 'gcr'
  GLTR = 'gltr'
  GMRES = 'gmres'
  GROPPCG = 'groppcg'
  HPDDM = 'hpddm'
  IBCGS = 'ibcgs'
  LCD = 'lcd'
  LGMRES = 'lgmres'
  LSQR = 'lsqr'
  MINRES = 'minres'
  NASH = 'nash'
  PGMRES = 'pgmres'
  PIPEBCGS = 'pipebcgs'
  PIPECG = 'pipecg'
  PIPECG2 = 'pipecg2'
  PIPECGRR = 'pipecgrr'
  PIPECR = 'pipecr'
  PIPEFCG = 'pipefcg'
  PIPEFGMRES = 'pipefgmres'
  PIPEGCR = 'pipegcr'
  PIPELCG = 'pipelcg'
  PIPEPRCG = 'pipeprcg'
  PREONLY = 'preonly'
  PYTHON = 'python'
  QCG = 'qcg'
  RICHARDSON = 'richardson'
  STCG = 'stcg'
  SYMMLQ = 'symmlq'
  TCQMR = 'tcqmr'
  TFQMR = 'tfqmr'
  TSIRM = 'tsirm'
  __qualname__ = 'KSPType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.KSP.ConvergedReason-class.html0000644000175000017500000003330414062764461026171 0ustar balaybalay00000000000000 petsc4py.PETSc.KSP.ConvergedReason
Package petsc4py :: Module PETSc :: Class KSP :: Class ConvergedReason
[hide private]
[frames] | no frames]

Class ConvergedReason


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CONVERGED_ATOL = 3
  CONVERGED_ATOL_NORMAL = 9
  CONVERGED_CG_CONSTRAINED = 6
  CONVERGED_CG_NEG_CURVE = 5
  CONVERGED_HAPPY_BREAKDOWN = 8
  CONVERGED_ITERATING = 0
  CONVERGED_ITS = 4
  CONVERGED_RTOL = 2
  CONVERGED_RTOL_NORMAL = 1
  CONVERGED_STEP_LENGTH = 7
  DIVERGED_BREAKDOWN = -5
  DIVERGED_BREAKDOWN_BICG = -6
  DIVERGED_DTOL = -4
  DIVERGED_INDEFINITE_MAT = -10
  DIVERGED_INDEFINITE_PC = -8
  DIVERGED_MAX_IT = -3
  DIVERGED_NANORINF = -9
  DIVERGED_NONSYMMETRIC = -7
  DIVERGED_NULL = -2
  DIVERGED_PCSETUP_FAILED = -11
  ITERATING = 0
  __qualname__ = 'KSPConvergedReason'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.FE.Type-class.html0000644000175000017500000002151114062764461023660 0ustar balaybalay00000000000000 petsc4py.PETSc.FE.Type
Package petsc4py :: Module PETSc :: Class FE :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BASIC = 'basic'
  COMPOSITE = 'composite'
  OPENCL = 'opencl'
  __qualname__ = 'FEType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/epydoc.js0000644000175000017500000002452514062764457017624 0ustar balaybalay00000000000000function toggle_private() { // Search for any private/public links on this page. Store // their old text in "cmd," so we will know what action to // take; and change their text to the opposite action. var cmd = "?"; var elts = document.getElementsByTagName("a"); for(var i=0; i...
"; elt.innerHTML = s; } } function toggle(id) { elt = document.getElementById(id+"-toggle"); if (elt.innerHTML == "-") collapse(id); else expand(id); return false; } function highlight(id) { var elt = document.getElementById(id+"-def"); if (elt) elt.className = "py-highlight-hdr"; var elt = document.getElementById(id+"-expanded"); if (elt) elt.className = "py-highlight"; var elt = document.getElementById(id+"-collapsed"); if (elt) elt.className = "py-highlight"; } function num_lines(s) { var n = 1; var pos = s.indexOf("\n"); while ( pos > 0) { n += 1; pos = s.indexOf("\n", pos+1); } return n; } // Collapse all blocks that mave more than `min_lines` lines. function collapse_all(min_lines) { var elts = document.getElementsByTagName("div"); for (var i=0; i 0) if (elt.id.substring(split, elt.id.length) == "-expanded") if (num_lines(elt.innerHTML) > min_lines) collapse(elt.id.substring(0, split)); } } function expandto(href) { var start = href.indexOf("#")+1; if (start != 0 && start != href.length) { if (href.substring(start, href.length) != "-") { collapse_all(4); pos = href.indexOf(".", start); while (pos != -1) { var id = href.substring(start, pos); expand(id); pos = href.indexOf(".", pos+1); } var id = href.substring(start, href.length); expand(id); highlight(id); } } } function kill_doclink(id) { var parent = document.getElementById(id); parent.removeChild(parent.childNodes.item(0)); } function auto_kill_doclink(ev) { if (!ev) var ev = window.event; if (!this.contains(ev.toElement)) { var parent = document.getElementById(this.parentID); parent.removeChild(parent.childNodes.item(0)); } } function doclink(id, name, targets_id) { var elt = document.getElementById(id); // If we already opened the box, then destroy it. // (This case should never occur, but leave it in just in case.) if (elt.childNodes.length > 1) { elt.removeChild(elt.childNodes.item(0)); } else { // The outer box: relative + inline positioning. var box1 = document.createElement("div"); box1.style.position = "relative"; box1.style.display = "inline"; box1.style.top = 0; box1.style.left = 0; // A shadow for fun var shadow = document.createElement("div"); shadow.style.position = "absolute"; shadow.style.left = "-1.3em"; shadow.style.top = "-1.3em"; shadow.style.background = "#404040"; // The inner box: absolute positioning. var box2 = document.createElement("div"); box2.style.position = "relative"; box2.style.border = "1px solid #a0a0a0"; box2.style.left = "-.2em"; box2.style.top = "-.2em"; box2.style.background = "white"; box2.style.padding = ".3em .4em .3em .4em"; box2.style.fontStyle = "normal"; box2.onmouseout=auto_kill_doclink; box2.parentID = id; // Get the targets var targets_elt = document.getElementById(targets_id); var targets = targets_elt.getAttribute("targets"); var links = ""; target_list = targets.split(","); for (var i=0; i" + target[0] + ""; } // Put it all together. elt.insertBefore(box1, elt.childNodes.item(0)); //box1.appendChild(box2); box1.appendChild(shadow); shadow.appendChild(box2); box2.innerHTML = "Which "+name+" do you want to see documentation for?" + ""; } return false; } function get_anchor() { var href = location.href; var start = href.indexOf("#")+1; if ((start != 0) && (start != href.length)) return href.substring(start, href.length); } function redirect_url(dottedName) { // Scan through each element of the "pages" list, and check // if "name" matches with any of them. for (var i=0; i-m" or "-c"; // extract the portion & compare it to dottedName. var pagename = pages[i].substring(0, pages[i].length-2); if (pagename == dottedName.substring(0,pagename.length)) { // We've found a page that matches `dottedName`; // construct its URL, using leftover `dottedName` // content to form an anchor. var pagetype = pages[i].charAt(pages[i].length-1); var url = pagename + ((pagetype=="m")?"-module.html": "-class.html"); if (dottedName.length > pagename.length) url += "#" + dottedName.substring(pagename.length+1, dottedName.length); return url; } } } petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Viewer.Format-class.html0000644000175000017500000004352114062764465025147 0ustar balaybalay00000000000000 petsc4py.PETSc.Viewer.Format
Package petsc4py :: Module PETSc :: Class Viewer :: Class Format
[hide private]
[frames] | no frames]

Class Format


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ASCII_COMMON = 6
  ASCII_CSV = 21
  ASCII_DENSE = 9
  ASCII_FACTOR_INFO = 16
  ASCII_GLVIS = 20
  ASCII_IMPL = 3
  ASCII_INDEX = 8
  ASCII_INFO = 4
  ASCII_INFO_DETAIL = 5
  ASCII_LATEX = 17
  ASCII_MATHEMATICA = 2
  ASCII_MATLAB = 1
  ASCII_MATRIXMARKET = 10
  ASCII_PCICE = 14
  ASCII_PYTHON = 15
  ASCII_SYMMODU = 7
  ASCII_VTK = 11
  ASCII_VTK_CELL = 12
  ASCII_VTK_COORDS = 13
  ASCII_XML = 18
  BINARY_MATLAB = 30
  DEFAULT = 0
  DRAW_BASIC = 22
  DRAW_CONTOUR = 25
  DRAW_LG = 23
  DRAW_LG_XRANGE = 24
  DRAW_PORTS = 26
  FAILED = 38
  HDF5_MAT = 35
  HDF5_PETSC = 32
  HDF5_VIZ = 33
  HDF5_XDMF = 34
  LOAD_BALANCE = 37
  NATIVE = 31
  NOFORMAT = 36
  VTK_VTR = 28
  VTK_VTS = 27
  VTK_VTU = 29
  __qualname__ = 'ViewerFormat'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Vec-class.html0000644000175000017500000036212114062764465023174 0ustar balaybalay00000000000000 petsc4py.PETSc.Vec
Package petsc4py :: Module PETSc :: Class Vec
[hide private]
[frames] | no frames]

Class Vec


Nested Classes [hide private]
  Option
  Type
Instance Methods [hide private]
 
__abs__() <==> abs(x)
 
__add__(y)
x+y
 
__delitem__(y)
del x[y]
 
__div__(y)
x/y
 
__enter__(self)
 
__exit__(self, *exc)
 
__getitem__(y)
x[y]
 
__iadd__(y)
x+=y
 
__idiv__(y)
x/=y
 
__imul__(y)
x*=y
 
__isub__(y)
x-=y
 
__itruediv__(y)
x/=y
 
__mul__(y)
x*y
 
__neg__()
-x
a new object with type S, a subtype of T
__new__(S, ...)
 
__pos__()
+x
 
__radd__(y)
y+x
 
__rdiv__(y)
y/x
 
__rmul__(y)
y*x
 
__rsub__(y)
y-x
 
__rtruediv__(y)
y/x
 
__setitem__(i, y)
x[i]=y
 
__sub__(y)
x-y
 
__truediv__(y)
x/y
 
abs(self)
 
assemble(self)
 
assemblyBegin(self)
 
assemblyEnd(self)
 
attachDLPackInfo(self, Vec vec=None, dltensor=None)
Attach the tensor information from an input vector (vec) or a DLPack tensor if it is not available in current vector.
 
axpby(self, alpha, beta, Vec y)
 
axpy(self, alpha, Vec x)
 
aypx(self, alpha, Vec x)
 
bindToCPU(self, flg)
If *flg* is *True*, all subsequent operations of *self* would be performed on CPU.
 
chop(self, tol)
 
clearDLPackInfo(self)
Clear the tensor information See also :meth:`Vec.attachDLPackInfo`.
 
conjugate(self)
 
copy(self, Vec result=None)
 
create(self, comm=None)
 
createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None)
Returns an instance of :class:`Vec`, a VECCUDA with user provided memory spaces for CPU and GPU arrays.
 
createGhost(self, ghosts, size, bsize=None, comm=None)
 
createGhostWithArray(self, ghosts, array, size=None, bsize=None, comm=None)
 
createMPI(self, size, bsize=None, comm=None)
 
createNest(self, vecs, isets=None, comm=None)
 
createSeq(self, size, bsize=None, comm=None)
 
createShared(self, size, bsize=None, comm=None)
 
createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None)
Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory spaces for CPU and GPU arrays.
 
createWithArray(self, array, size=None, bsize=None, comm=None)
 
createWithDLPack(self, dltensor, size=None, bsize=None, comm=None)
Returns an instance :class:`Vec`, a PETSc vector from a DLPack object sharing the same memory.
 
destroy(self)
 
dot(self, Vec vec)
 
dotBegin(self, Vec vec)
 
dotEnd(self, Vec vec)
 
duplicate(self, array=None)
 
equal(self, Vec vec)
 
exp(self)
 
getArray(self, readonly=False)
 
getBlockSize(self)
 
getBuffer(self, readonly=False)
 
getCLContextHandle(self)
Returns a Vec's CL Context as :class:`int`.
 
getCLMemHandle(self, mode='rw')
Returns a Vec's CL buffer as :class:`int`.
 
getCLQueueHandle(self)
Returns a Vec's CL Context as :class:`int`.
 
getCUDAHandle(self, mode='rw')
 
getLGMap(self)
 
getLocalSize(self)
 
getNestSubVecs(self)
 
getOffloadMask(self)
Returns :class:`int` of the Vec's PetscOffloadMask enum value.
 
getOptionsPrefix(self)
 
getOwnershipRange(self)
 
getOwnershipRanges(self)
 
getSize(self)
 
getSizes(self)
 
getSubVector(self, IS iset, Vec subvec=None)
 
getType(self)
 
getValue(self, index)
 
getValues(self, indices, values=None)
 
getValuesStagStencil(self, indices, values=None)
 
ghostUpdate(self, addv=None, mode=None)
 
ghostUpdateBegin(self, addv=None, mode=None)
 
ghostUpdateEnd(self, addv=None, mode=None)
 
isaxpy(self, IS idx, alpha, Vec x)
 
isset(self, IS idx, alpha)
 
load(self, Viewer viewer)
 
localForm(self)
Intended for use in context manager:
 
log(self)
 
mDot(self, vecs, out=None)
 
mDotBegin(self, vecs, out=None)
 
mDotEnd(self, vecs, out=None)
 
max(self)
 
maxPointwiseDivide(self, Vec vec)
 
maxpy(self, alphas, vecs)
 
min(self)
 
mtDot(self, vecs, out=None)
 
mtDotBegin(self, vecs, out=None)
 
mtDotEnd(self, vecs, out=None)
 
norm(self, norm_type=None)
 
normBegin(self, norm_type=None)
 
normEnd(self, norm_type=None)
 
normalize(self)
 
permute(self, IS order, invert=False)
 
placeArray(self, array)
 
pointwiseDivide(self, Vec x, Vec y)
 
pointwiseMax(self, Vec x, Vec y)
 
pointwiseMaxAbs(self, Vec x, Vec y)
 
pointwiseMin(self, Vec x, Vec y)
 
pointwiseMult(self, Vec x, Vec y)
 
reciprocal(self)
 
resetArray(self, force=False)
 
restoreCLMemHandle(self)
To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes.
 
restoreCUDAHandle(self, handle, mode='rw')
 
restoreSubVector(self, IS iset, Vec subvec)
 
scale(self, alpha)
 
set(self, alpha)
 
setArray(self, array)
 
setBlockSize(self, bsize)
 
setFromOptions(self)
 
setLGMap(self, LGMap lgmap)
 
setMPIGhost(self, ghosts)
Alternative to createGhost()
 
setNestSubVecs(self, sx, idxm=None)
 
setOption(self, option, flag)
 
setOptionsPrefix(self, prefix)
 
setRandom(self, Random random=None)
 
setSizes(self, size, bsize=None)
 
setType(self, vec_type)
 
setUp(self)
 
setValue(self, index, value, addv=None)
 
setValueLocal(self, index, value, addv=None)
 
setValues(self, indices, values, addv=None)
 
setValuesBlocked(self, indices, values, addv=None)
 
setValuesBlockedLocal(self, indices, values, addv=None)
 
setValuesLocal(self, indices, values, addv=None)
 
setValuesStagStencil(self, indices, values, addv=None)
 
shift(self, alpha)
 
sqrtabs(self)
 
strideGather(self, field, Vec vec, addv=None)
 
strideMax(self, field)
 
strideMin(self, field)
 
strideNorm(self, field, norm_type=None)
 
strideScale(self, field, alpha)
 
strideScatter(self, field, Vec vec, addv=None)
 
strideSum(self, field)
 
sum(self)
 
swap(self, Vec vec)
 
tDot(self, Vec vec)
 
tDotBegin(self, Vec vec)
 
tDotEnd(self, Vec vec)
 
toDLPack(self)
Return a DLPack tensor.
 
view(self, Viewer viewer=None)
 
waxpy(self, alpha, Vec x, Vec y)
 
zeroEntries(self)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  __array_interface__
  array
  array_r
Vec array (read-only)
  array_w
Vec array (writable)
  block_size
  buffer
  buffer_r
Vec buffer (read-only)
  buffer_w
Vec buffer (writable)
  local_size
  owner_range
  owner_ranges
  size
  sizes

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

attachDLPackInfo(self, Vec vec=None, dltensor=None)

 
Attach the tensor information from an input vector (vec) or a
DLPack tensor if it is not available in current vector. The input
vector is typically created with createWithDlpack(). This operation
does not copy the data from the input parameters, it simply uses
their meta information.

Note that the auxiliary tensor information is required when converting
a PETSc vector to a DLPack object.

See also :meth:`Vec.clearDLPackInfo`.

:arg vec: A :class:'Vec' containing auxiliary tensor information
:arg dltensor: A DLPack tensor object

bindToCPU(self, flg)

 
If *flg* is *True*, all subsequent operations of *self* would be
performed on CPU. If *flg* is *False*, all subsequent operations of
*self* would be offloaded to the device, provided that the VecType is
capable of offloading.

:arg flg: An instance of :class:`bool`.

createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None)

 
Returns an instance of :class:`Vec`, a VECCUDA with user provided
memory spaces for CPU and GPU arrays.

:arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if
    *None*.
:arg cudahandle: Address of the array on the GPU. Will be lazily
    allocated if *None*.
:arg size: A :class:`int` denoting the size of the Vec.
:arg bsize: A :class:`int` denoting the block size.

createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None)

 
Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory
spaces for CPU and GPU arrays.

:arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if
    *None*.
:arg viennaclvechandle: Address of the array on the GPU. Will be lazily
    allocated if *None*.
:arg size: A :class:`int` denoting the size of the Vec.
:arg size: A :class:`int` denoting the block size.

createWithDLPack(self, dltensor, size=None, bsize=None, comm=None)

 
Returns an instance :class:`Vec`, a PETSc vector from a DLPack object
sharing the same memory.
This operation does not modify the storage of the original tensor and
should be used with contiguous tensors only. If the tensor is stored in
row-major order (e.g. PyTorch tensors), the resulting vector will look
like an unrolled tensor using row-major order.

:arg dltensor: An object with a __dlpack__ method or a DLPack tensor object (for backward compatibility)
:arg size: A :class:`int` denoting the size of the Vec.
:arg bsize: A :class:`int` denoting the block size.

destroy(self)

 
Overrides: Object.destroy

getCLContextHandle(self)

 
Returns a Vec's CL Context as :class:`int`.

To interface with :mod:`pyopencl` refer
:meth:`pyopencl.Context.from_int_ptr`

getCLMemHandle(self, mode='rw')

 
Returns a Vec's CL buffer as :class:`int`.

To interface with :mod:`pyopencl` refer
:meth:`pyopencl.MemoryObject.from_int_ptr`.

:arg mode: An instance of class:`str` denoting the intended access
    usage to the CL buffer. Can be one of 'r'(read-only), 'w'
    (write-only) or 'rw' (read-write). See also
    :meth:`Vec.restoreCLMemHandle`.

getCLQueueHandle(self)

 
Returns a Vec's CL Context as :class:`int`.

To interface with :mod:`pyopencl` refer
:meth:`pyopencl.Context.from_int_ptr`

getOptionsPrefix(self)

 
Overrides: Object.getOptionsPrefix

getType(self)

 
Overrides: Object.getType

restoreCLMemHandle(self)

 
To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes.
See also :meth:`Vec.getCLMemHandle`.

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

toDLPack(self)

 
Return a DLPack tensor. Error out if the tensor information is missing.
buildTensorInfo() can be used to get tensor information from an input
vector that already has tensor information. This input vector is
typically created with createWithDlpack().

One can do the following to convert vector X to a DLPack tensor whose
anxiliary information inherits from Y.
  X.buildTensorInfo(Y)
  X.toDLPack()

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_snes.png0000644000175000017500000000413314062764463023540 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATx}Lǿe7#L[,119/!2epc5-*ʋ)Pjx+TD[sP{om{B3h瓜?9w>y#0lr \&CaޛNƹeNIII7P([Wl;!oEQ(v&vϡP`r(098c4Q^^tr8p\҂;w<`0@"`bbt89ZVBEEBCC!JhrJoQcHMMŶm۠VXO+Ʉ"$%%!//z=rss cdff…  ӪK.Eppo>_HJJ¹s011Wŋ7[n@ T*ŝ;w`2 N-[@ 66___deea o+Gz??? ={3gΘEx<c͚5NgnwttL&GUUw؁Gaɒ% rvX8aTzD"@HHvZY>\n=|X,6,Xjg`bLNNBTZ} >}z^"""P^^n-@``C{/<]v|jHHHH$BZZ```Ǐ2̢twwC#<<BP(q]͛7n:<}|䤳C/<ڨ:uOOODHZZ VɲeHXX # .$RA<Bȉ'$D&qB!ӓDFFwwwRPP`!>>Z=ir޽{<_{z~\qHKL{^=m֪No0`htԢ θɣ|Ip0ڪu>޳z=g ~>^^8myyVu "??ڿ_\{bqR*= g o.ZƱ2;v ~I… 116q[aWZZTZ@啕 5=y]]ٳ7a_aX\R:}ݍYGΝkqttu++ >_sK zgɒ$.77=]g򊚚[g8y=FA`&DE,)Bf0o es9X"A&?UVGGh.HXL>ٹT&C:ñƼ噙4k4P/|sӦn{y'mIq7^NٺE|Ikjd[j'b L:f2Z̛joq&h^R^ÙVTX"A75ug'J,#CP$贴?;: FUsQjX}LsB]Oʸ8nV72"+?飕4W%%Poju-тqK:Fh~|GFLf  (I\9"6xGǷR,$y]cu8Hy߾k]n}.B3P٪2@EFJ?LI9#UO,&0`竪xH 7"b֭==gOl4/)/OOH zbb2mj)orr`GϟG&xɣ;lhm],m߾mZw)8>~xX|p&ARYON6b2}z7$&"NB,qn::󦶶f yaXIznFq-*<\}{0ɜ6 *v`p0ǛBIK$KM АZ[|t'juGWlkclN.]z'M&SGw',+,tsq LbhZTx)n IݵiTSKӧyzv, ۘD$rD+)6n ȁ,+*^uu ٳgotڨN"q32!_A/0 OT*IR & MM8;Wb&O\VO!UӨV_ _ii Mtwt://Dجѐ]\)UA yAh(3\R*U'MqPի{=hXFL>T!gՀ=ٖXR3?LIy d&(Kv'&^\0fg`3$^={Ƌ%18a ,`v0;hIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_14.png0000644000175000017500000000154414062764464024061 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC-class.html0000644000175000017500000024426114062764462022762 0ustar balaybalay00000000000000 petsc4py.PETSc.PC
Package petsc4py :: Module PETSc :: Class PC
[hide private]
[frames] | no frames]

Class PC


Nested Classes [hide private]
  ASMType
  CompositeType
  GAMGType
  GASMType
  MGCycleType
  MGType
  PatchConstructType
  SchurFactType
  SchurPreType
  Side
  Type
Instance Methods [hide private]
 
__call__(...) <==> x(...)
a new object with type S, a subtype of T
__new__(S, ...)
 
addCompositePCType(self, pc_type)
 
apply(self, Vec x, Vec y)
 
applySymmetricLeft(self, Vec x, Vec y)
 
applySymmetricRight(self, Vec x, Vec y)
 
applyTranspose(self, Vec x, Vec y)
 
create(self, comm=None)
 
createPython(self, context=None, comm=None)
 
destroy(self)
 
getASMSubKSP(self)
 
getCompositePC(self, n)
 
getDM(self)
 
getFactorMatrix(self)
 
getFactorSolverType(self)
 
getFieldSplitSchurGetSubKSP(self)
 
getFieldSplitSubKSP(self)
 
getHYPREType(self)
 
getKSP(self)
 
getMGCoarseSolve(self)
 
getMGInterpolation(self, level)
 
getMGLevels(self)
 
getMGRScale(self, level)
 
getMGRestriction(self, level)
 
getMGSmoother(self, level)
 
getMGSmootherDown(self, level)
 
getMGSmootherUp(self, level)
 
getMGType(self)
 
getOperators(self)
 
getOptionsPrefix(self)
 
getPythonContext(self)
 
getType(self)
 
reset(self)
 
setASMLocalSubdomains(self, nsd, is_=None, is_local=None)
 
setASMOverlap(self, overlap)
 
setASMTotalSubdomains(self, nsd, is_=None, is_local=None)
 
setASMType(self, asmtype)
 
setBDDCChangeOfBasisMat(self, Mat T, interior=False)
 
setBDDCCoarseningRatio(self, cratio)
 
setBDDCDirichletBoundaries(self, IS bndr)
 
setBDDCDirichletBoundariesLocal(self, IS bndr)
 
setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True)
 
setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None)
 
setBDDCDofsSplitting(self, isfields)
 
setBDDCDofsSplittingLocal(self, isfields)
 
setBDDCLevels(self, levels)
 
setBDDCNeumannBoundaries(self, IS bndr)
 
setBDDCNeumannBoundariesLocal(self, IS bndr)
 
setBDDCPrimalVerticesIS(self, IS primv)
 
setBDDCPrimalVerticesLocalIS(self, IS primv)
 
setCompositeType(self, ctype)
 
setCoordinates(self, coordinates)
 
setDM(self, DM dm)
 
setFactorLevels(self, levels)
 
setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None)
 
setFactorPivot(self, zeropivot=None, inblocks=None)
 
setFactorSetUpSolverType(self)
 
setFactorShift(self, shift_type=None, amount=None)
 
setFactorSolverType(self, solver)
 
setFieldSplitFields(self, bsize, *fields)
 
setFieldSplitIS(self, *fields)
 
setFieldSplitSchurFactType(self, ctype)
 
setFieldSplitSchurPreType(self, ptype, Mat pre=None)
 
setFieldSplitType(self, ctype)
 
setFromOptions(self)
 
setGAMGLevels(self, levels)
 
setGAMGSmooths(self, smooths)
 
setGAMGType(self, gamgtype)
 
setGASMOverlap(self, overlap)
 
setGASMType(self, gasmtype)
 
setHYPREDiscreteCurl(self, Mat mat)
 
setHYPREDiscreteGradient(self, Mat mat)
 
setHYPRESetAlphaPoissonMatrix(self, Mat mat)
 
setHYPRESetBetaPoissonMatrix(self, Mat mat=None)
 
setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None)
 
setHYPREType(self, hypretype)
 
setMGCycleType(self, cycle_type)
 
setMGCycleTypeOnLevel(self, level, cycle_type)
 
setMGInterpolation(self, level, Mat mat)
 
setMGLevels(self, levels)
 
setMGR(self, level, Vec r)
 
setMGRScale(self, level, Vec rscale)
 
setMGRestriction(self, level, Mat mat)
 
setMGRhs(self, level, Vec rhs)
 
setMGType(self, mgtype)
 
setMGX(self, level, Vec x)
 
setOperators(self, Mat A=None, Mat P=None)
 
setOptionsPrefix(self, prefix)
 
setPatchCellNumbering(self, Section sec)
 
setPatchComputeFunction(self, function, args=None, kargs=None)
 
setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None)
 
setPatchComputeOperator(self, operator, args=None, kargs=None)
 
setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None)
 
setPatchConstructType(self, typ, operator=None, args=None, kargs=None)
 
setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes)
 
setPythonContext(self, context)
 
setPythonType(self, py_type)
 
setReusePreconditioner(self, flag)
 
setType(self, pc_type)
 
setUp(self)
 
setUpOnBlocks(self)
 
setUseAmat(self, flag)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getOptionsPrefix(self)

 
Overrides: Object.getOptionsPrefix

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMLabel-class.html0000644000175000017500000003530514062764460023713 0ustar balaybalay00000000000000 petsc4py.PETSc.DMLabel
Package petsc4py :: Module PETSc :: Class DMLabel
[hide private]
[frames] | no frames]

Class DMLabel


Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, name, comm=None)
 
destroy(self)
 
insertIS(self, IS iset, value)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, getType, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, view, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dmda.png0000644000175000017500000000502114062764460023467 0ustar balaybalay00000000000000PNG  IHDRHibKGD IDATxkPYoC0 C9| KYĠZf*DGD)(kRAS#A`U< R&zmNvrOsso} )b00A*⾾O>]v֭sL\\'M/\J9 ɞc0a´{Q*o~ⅥѣGmll7nܘINNVƫ38GL$yyy;vx{{߿ۻեUҒN/C c܏gddFsqٳgϦ迈P(]j.3˳OMME-]|YT!@MM :9O>900[ZZٓV8VlJ$a!!!ffs|WX/H"NNN~zpp066Ç777޽{rr}秤,_ҥKfffvvv8ijx {zzη3!+++&) :xL&E丸\v rl9177wss G߈mܸsm6chh(rSSB`@.KRDT~:3bwQ,K$/_vdA˖-p8؋UǑLeeedd$踸&oذdsNLL ַݝJXW^EEEݼysbb}1 h40 ]LOO9sFڮ\ŋjgϲlyfpIIIpp0 &99ӓF;wwq\:F+**` R*8{fgg%Ikk j뛚jllD0gϞ `[ett۸R("`0ZNNNNNNX 2bb[[n۷o Bktx%>ˆ)h,*Da"Ͻ3wVVԩSh|0\;=HaDF4HaDF4HaDF4HaDF4HaDF4HaDF4LV"驹O#wձ"A7*嵵xӠcJҢ@ нad1R Ɖ'EGGGCBB dXt|a#1+JHֆR%%%h4tppɉpz4,, {B?F?xGAZLv*.~,1<8#cC;ᄏ[Ye4# > a93= Zܰn3- {7 a׮ 619ib֒GlGSQONMi4o-_avw1+ܰ{UUjaU7<\G_ud0t:h,nJUX^.zktwqYzuÇ==?t;5UI?܉J~gΘ-zp {^Zy)eŅF{J O䄆R)-a S)l;ܰ'ꫥ梨":G}9+ F쏌~H\̌@{W_ߩÇ-0 L?ۤRx$c˟AF4HaDd-pT7}>g $rÔh̙K;,]cSd-%uIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_solvertype.png0000644000175000017500000000316214062764462025004 0ustar balaybalay00000000000000PNG  IHDRa$+bKGD'IDAThkLSgҖR˵ E( L )KAQffV.HQb +Љ"рK(" R@ Hgkmjv~>9>99(\ދާ. H3G\O]gDii4Q(^.._ȣVq\\Jϟ_>;jj9""f4xEFryPXY_F"qupTXmjjիzzZlvsGhnfRrs*+#"ںC;h\}Sn^7z8;ì={xNdG2,<;;h@tpٳEKgL&ES|Z<ݭP[<}^OLMF$&}^%%BSŠmIIqiiu pz~#^:yϿ ssr+a0ą=bc{^Pl\Ay𺡭y[R1&, &$煍GC||QQ(<khhr}31GHL!@=2Fn\V]]x27X~V).`|xx̫.$^s`u1 :bJbc}\]={o|zzGoAlXo0#V^dM&a\$3?H:;;-@P*`JOE&'~gg  Gz !C11շ?D",#%z^_v8??~Mݻo \X_A 6_[ʯZ{Tظ/#cBV3^K$ȉIScc18:z_/wR+p/԰3(kלVV 7œrj\"114,_+G~4w 2H.ZZ**^^{w<soHuK$6ԩw?0_ߞą+q$LdݸA9 Z1ˍ>zQ,,bDfc1uTjÛJ˗Q{"#{MB0#@;F߿ߚLxj[bLdjJc <r8 xUU7oj͚ D^/mf;ReecbqhApDGm50@\`nfV_P!;Jc2-D30PG41ZY0ht}A}QQ33P߯_@v \z~#)T]7"ܔ^MMnnCk2Y1Yaxr<QQw ? U CP*J~i뛚t,WXѽ>jkUD?͏Fx# if5ZET; iF> f4黈IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_interpolat.png0000644000175000017500000000345414062764460024753 0ustar balaybalay00000000000000PNG  IHDR$:bKGDIDATh{LSWOi/()4m)By`8AP@)2 `PY&ũ3Id:IDuq0*m|v>uw][Cx?{8{Z-@fs-?d,({JG=(`XEwp})MBa˗zFsqHx۳R}^%BX2P adΘOSml2>Ӽ^sl{`}&i9~k^<;Y;ǝ&d9`LS8)M!~x:yˑ!!<=UO_ݲ@"WN2&۷y<י0=9ڞ?|xWvF͌ xdHd ;wd<gƍ_UXx83(ϟo]\V^hѐD9/޽JKBź:OM29e͚P۷h㮍ݘL]/VVvvRS֬ !7~M1*0s,-,2*:*3-ˍ5 s^Rojp]h())аv{ %'99p^Bx8>KK{եP*s灁L曑UU123Uju`r򣎎M$ҲĎO*?)QQ,:=<#CקwL 4cTat,: w"aT01REYYl6U,b*@XHِɍo]fgcܑoKKO=:t)lD>:ΎeQET&|> {60p ~onE"sg/_ ~2ܲN~zQz ڜ*{T& Cda:`v}7;I(Aºݻg^Q#hHlNWW?^IJҥ5:7/Dqs{z񴙰cB6 H:%NExjM9%>@2/4InLՙOu7M/ Q  =(K">Xŭ]~IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc._DMComposite_access-class.html0000644000175000017500000002324514062764465026323 0ustar balaybalay00000000000000 petsc4py.PETSc._DMComposite_access
Package petsc4py :: Module PETSc :: Class _DMComposite_access
[hide private]
[frames] | no frames]

Class _DMComposite_access


Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, *exc)
a new object with type S, a subtype of T
__new__(S, ...)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_section.png0000644000175000017500000000502214062764464024233 0ustar balaybalay00000000000000PNG  IHDRM[66bKGD IDATxyPWǿ TqkgBbdg1(YkJe<"[Z^ HJ!dW(  1r?.F@͠POU~>"""p:N'¥11` )))o"nB}'P;x:LNN[G4444LZZZ"##5k… BLBTk.\J`.ٳg1cѷo_@bԩXd @!33amm޽{Ǟ={p hv'e˖-G~~> $_x1<<} Œ%KPPP[ AӁ_cر⎎:t(! ɰo>Z tHJJ4ijp}[S1ZMdffFNNNdbbBӭIRۓT*%FCD$ӈrrrɉR)I$dTTTDDDdkkK...ԧO $VKDD111$)66Sw]"%>$ZMzu:eggQii)%җFDj4 566@yyyT\\ܢFC%%%ʹ#59ְnq\$ !*UUUz0SSS1:1zV9r$kꯥ`mdntiOcAѼڥBG&{f699Kpp0VX\V(^nH$Brr2f͚Si1111111111111111111111111ⵄԷG\|"m\K[HDF^P[Cr777Mҭ\PmGkSA鲤z2|x211`iUXLKOO[rbi!6{7lSUx8=ӧ3c c_\,V3وZ ~ VV1˗QY Ů}3f\,vvwiE>>iat)z{C1>:%Įh4ϟKOOx̝,Z 2)~EWx=#O)O 3VFΆbw J%&| oJKIDFbΝ8GX4mn!pLY Fd'w,__:UW7"ӔJv4V͛qvq2+ t0rsq"M(<~?<?ja/]“|ہ1KgFBj*ΝØ#6}:`mh(-CǯW{{k0a8t$ ہ ?TV,-/ǵb<=1c\\64f N{gu5U*k] CIY.D9zuԌ a߾g{z6{0{Z<~DD@N Fd(aS=/X2k_ޭa'֝;ܿ'dqpvtUܯ@޵kٸwspr9Jʰ!<s<=s=1[B թJ%nݽ퉉KDZ&z :;#b&8cUlc 8㏐N9UaGA"oŎD8T8۶@? ΞիfGJz:U*DaڵEJZz٥||bOrT^ޓ b'\\\\\\mLȀhԨ7K4Z3_s'&3|x21` C?x`WIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dmshell.png0000644000175000017500000000640614062764460024222 0ustar balaybalay00000000000000PNG  IHDRSbKGD IDATx{PTG( 5>@\YDn @B-Inŵ,1\SI$2ue@Qp(qtUD  J"0h˾8a G𦿪~ݧs8  vP2%dJdX+Q\\l\$ .eO222{ B_+##cj9S&JDL(vvArr2lڴ*K_~{̙3N[)ʬ!44;w2ydbbb駟fpܹ^t3grJ*++v;3BllHLLxff>|"88x@oooq̙m8L&N:{g^הF"""ؾ}%VXXȋ/ /@nn.`}wtt; (++lo6Y~= ,^dxW9y򤭺 0|2&MbܸqGDDXdTWWn:x(((`ɒ%8::CEESWWŋ"** 7x777֬YìYl]`Jss3}?@VVEN#==gyR",޺u4ݻ?)))ܸqz=[uL???U'ك###5/]^'11gԨQf;99~Y]76FWWVw^n߾;}غu+rٌ&6bرc&޽{v&^XX/9͍zW^ylyyIJey&vt5EDDP^^l@jj*̝;'NW_pyse.[up bϞ=C8;;c ;;;l2qM!_L:UL:U=ZĈV$q=!~pqqӧO">>^ܽ{W!o-Ӆغu%s ___ehds&I|xKK|W\Ֆ2M;wNSfYNooo>L3{b00 VqWWW_SڊNCYb#Gdƌ~ѣ ;88͐qEHLLam(AAA\~}Cv|Q2%dJDɔ)_)[fxx#aRRRN|fff&-b L(Q2%dJDɔ)%S"JDL(Q2%dJDɔ)%S"JDL(Q2%dJDɔ)%S"JDL(m())$b4 zj)%%%={Vfxzz-M,K Ɓd7+[<ΙQ2%dJDɔȠlnn̍t͛-StXqyʐ3O>MCCդ[u9|G999tww?tdHtww@RRǏgTTTX긹a0(((l{!C!!'_hFQ3moo'''ǝb I>>>hbIII>|زDD^^;v0Rbʔ)S?~P?x ?NO̚^III8p.;Yg2\… *3dggǤI0a d;CBloGҥK6mU]___Xf IIIm e%fϞ ӦM#997Yh46Η yO-Ө2Q2%dJDɔ)%S"JD̔tgϞeѢE}"PC})%S"JDL(Q2%dJDɔ)%S"JDL(Q2%dJDɔ)%S"JDL(Q2%dJDɔ)g$>0/ Yj6Տh0Hcc|Ǚ.82gJDɔ))2ϕSh2Y^+4XUkYEM &z_ʽvMn M?QId^Ri7ٌ 3ӓw%JIŅƂôz5Wkjŕf\f hj"&,}[s\oDu潽߯oXlqqIM-M=!XEM 74X3h.,<;orsi{cs^?)'QQ*|DEY~?Abt46r$.#GO{ukiT^=N\;w$짱h~d$_ibXNIzh YݶŖ@oݪio[)sϋ˒uu|<6|ƆMeM8񞞖C D̘ ]ٳ^9rJ^O|׿Shjm tf:ǏJk[v׶2eUg99sfo3ݝ7qz."~[^}椦j։Ï{2r(4PQϋl[Q^]ͯǏ'Ks(?_֔_Ύ  g Z xۨQ܌YYvewQd56?'C۶Yz{3w =[>2F O~ pvrbߖ-89qpL6ZPQ$51VC ٙVbT~ N~ӧg0ˋ-+WlKӏ{עs)(-#*$??ذ3)(-Eru?c\aÈ y||8f vv޵={}5/vdV` MD,e`5yG݂Fcϩj"LL(Q2%dJDɔH̺F[eO%.QvG3 < :=A2Q2%5^IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_ao.png0000644000175000017500000000377014062764457023200 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATx}Lǿe+a NtR \E,ХF2;. "!&3Y2-&%s-KD A‹S@-0U[?.Z^Z6w<>>P(>l6d2f36mшDݻw#!!adƜ9s&;w./^K"E"|rոqf߾>:tJb%%%#q֭x1BCC!???gr"""J1 H$b >}FbT*{٣Gfg͚Rg0!NˉZoprsse3gDDD }||PRRvJDDD ((١{N@@;۷Fkk+֭[dff:;;QTT@~~>JCr݃bT*EHHhWp-Z Ϟ=rvHe6&ϟ@瓗effRgg't:p ٳgB^"K""*..&???"___R*s"":qRTTy{{Snn=CJJ IRto(w״QCC=}ԡիWt]2LrX,rJy3D"9<1rd2͛(((pgO3hZC|}.Àa0rp9 \.Àa0rp9 \.Àa0rp9 \)*++seLK .tX=)mZ=!'Ʉh=#Y\Jڞ=NᴜAAP'';.-r= Ql,1MZ۱1'JI.lnH&9`\:,IOG?~<~Uؕ}'xN>40&,f_?᯾h}h׬K*)8H%h7|Ř6R׬~4r.tشv-3=L&`ϸbRUrjFfڏ?fOp` D\}Pz)084 r^ҥ0:m0/BE ?> }~ΆFGBt4 DQQRfNE]{{PNN"́ذkz{ECo!KKCR\Pq(^ sFBT?4z=~5JKqgah(N~ 2F? o< N"b0rp9 \.9e Ql+x|0Qծ1md):͂a..ߝW9IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.CompositeType-class.html0000644000175000017500000002215314062764463025560 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.CompositeType
Package petsc4py :: Module PETSc :: Class PC :: Class CompositeType
[hide private]
[frames] | no frames]

Class CompositeType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ADDITIVE = 0
  MULTIPLICATIVE = 1
  SCHUR = 4
  SPECIAL = 3
  SYMMETRIC_MULTIPLICATIVE = 2
  __qualname__ = 'PCCompositeType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_schurprety.png0000644000175000017500000000375214062764463025006 0ustar balaybalay00000000000000PNG  IHDRs$bKGDIDATx{PdWX@Atr5+ۢFEzIZbRxoUѨE#:xiFNQSCG"ĀE.V..k~y{;+NCH@!iAbZ' (92-)ǀ9e"/_6i3)#9oߏ@ϱ5ʤMf-AL Bӂ0fvNt.ddHfsL!pذ뙻r%iG w{cX]ZKv~Qk~~ⅈ!N^ٳ ⛢"B/'i۩oSs37oj#;?a>>)T=|HS|u5֬I@bj*y \ Sr01MMMHի~}'OrY}#_Ʒ߲66Uؼ+ׯ$^W1[L^bS\-bѣ+' Ʀ&&DFR^U;3gRXZʔ%K YmSnj!T`C\ȠA˜~,̉&ZG) F}ZEzV °t)wJJ:>JJҷ\N^a!2?hJ izz2;:K=U^ȚrBޜ:4de m@BAŋE"NU7|@eM bvXi5V-\w8_ڦj u] :\Φ<-~}Bp0ٽ{M U(XCR0ooSSYF^Ѡpᣏ8P7!>=US) RFF625Քrq#F}lm9{7ۦQ~~zm]? Og^p0b gGG>yE"~fVQ]C1%662(˗Yx1s-!AoTj @8^W1[+YYnvҰZŊO'OrcoOك~WGLK:>7h۴Uv;L=Ӝ}${yq$&ޅi^p0;'/wwt:P8:8+f>5w.GMm-rܜ,jʐ k~@[$))^"ѯ;J%5*2ww66`g~9 w77557?sgGGݟ+c\k23YK^r2X[[ѭxIxx8Ν)fqqrɤݩO]vDϬqüO>thE"멽D?F™T6u8bceeLfx=E2n3$X3 lv;ٗ RFmAr9ArKΨ2-AL BӂĴ Lnu^f.fbRNxY ]P !iA``IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_mgcycletyp.png0000644000175000017500000000414514062764463024753 0ustar balaybalay00000000000000PNG  IHDRs$bKGDIDATx{PSW? !Ĉ"E@tXbEΪ(>F*uhQj<A].+m J dd`fL{oι(J%zt$_;==LBo.| @z ^O[:1y梧$efji5s܈$nLu F:LBoYY;ϣ[ťm F>=v T0da3f0^\Ç%&WT/:gcaf|UWE޽j.GƒWTfl 9趙JLn.gؼt)C R~ )74- AQ_Op@VV3*(|@/{B,,メ!|ʷ 8KG&NÆp$- @$vIYm3U;;ʐuoE&WV"61!/0X4c..EG31wE&#iz=A1~bd˻Tm2C??Hss3A~~TS)YY̜2EmfM]%&r*ϜICc#558x8Fܩ`61ᝠ 55FDZҒxlg6Fv>̅e2quph)$3ޞӧ+`t|ƌ^g q(*-zEВ99~dub"couؘU!=`~[[Gձ),.F&9>7nfS\VƤE+ȾtSڵv۪M֖$99L捈ϟ^g鱞) 6q"ɧN9w.Y/"!Ru$m#%+K}64PH_v5q#EW"q$-9$fd-[xXy3iq##}ח?̦8bbo]ՄJQ_Ww3CL|Ǐ3Ą/n;bFFXR]v]itU H4.u5xe|u  ׈rrX !=`mlpaCu XYXp gҸƧ))\.)%K/Пc=vR)_}S^ټJꑞ#4686448V'e`M"i?jj˴4ַgjQa,G,U=]hiЧѝ*/F\!4_SLy$Ozt'19gK3h7SЛC!N.3=D7nnM=/aVh3|yLBo7SΎ9uIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_quad.png0000644000175000017500000000437714062764463023534 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATx{LTWQDJ_ 1ETW\-V&E7.&*H5>*H#h(.q@:M܄s9ߗsA%(Ƒ^AOF#A#:[hY(^#==]mVB_őhR9999l&T cӦM\²eZ`00}tlM2&L]3f [o~jjjozJq\b1{NG aaaEA}"++Kvݎ).^ءk$^^ʹsؾ};jڢ.<<RRRe,ZHUcc#IIIn:n޼i^׳vZ̙Ú5k ::ǏéSM mUXXѣ>|xJKKg̙3P?NSSϟŋ̝;gϲpB ֭[466Nc0m46l؀3L8ڴV:Juu5 jŅ*={FFFYJb֭L<|~NN.\@әۭ%!!j5iii,YByy9#GDVM oooYubM:;wZ_PPZ&,,\#y&~~~~qakSha2j-l "11'OXzlQ7q}l:tg37of;v(++c@ee%{h4uVBBB, Cףh`ҥɓ'}6׮]cƌՙ7L֦:0I9pG"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"G"GteWnnnȑ#]ĉqsskbnߵۙV &{2^0MN8܂XS[NxP藊r[IPHPH9:>NN'"7p!SSi섭g._淡6o:ayy72QnnlY}=ٹϓ?}mm`grs?v1k$Ǝ;xc}=߻]v6d2qIzl=.%pra >à)SM@qq^+{?,[ӤII]{MܾSs3M 1KۉNHёZ-|Ew;#Ʀ&Bbb;b_~+G'D>sڻLIHŅ<`3յ|sO#>;|ef"T}zFq1Ӣzq1ÆEݫZرLV>}ӬYunQhz>>yf啕qJ6EGT_Kw:RWv+/e |J^19GN(77" .^ Ni] {zL4xA\9CݳgLymߟUIIWUqo[`r\]\(@ɪ$~{QQh4DoX4e !+V9{6Ç a[l,?AA:EJ\33Wv6;vp ܹNN&q*[`F!""9q՝/*7nri"[yj~[ݻ[tS"G"G"G"G"GBTGD9#߿ݥ=ftD:-C#u b~Y}6IENDB`petsc4py-3.15.1/docs/apiref/frames.html0000644000175000017500000000111514062764457020134 0ustar balaybalay00000000000000 PETSc for Python petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.NormType-class.html0000644000175000017500000002636614062764462024241 0ustar balaybalay00000000000000 petsc4py.PETSc.NormType
Package petsc4py :: Module PETSc :: Class NormType
[hide private]
[frames] | no frames]

Class NormType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  FRB = 2
  FROBENIUS = 2
  INF = 3
  INFINITY = 3
  MAX = 3
  N1 = 0
  N12 = 4
  N2 = 1
  NORM_1 = 0
  NORM_1_AND_2 = 4
  NORM_2 = 1
  NORM_FROBENIUS = 2
  NORM_INFINITY = 3
  NORM_MAX = 3
  __qualname__ = 'NormType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Random-class.html0000644000175000017500000005625714062764463023707 0ustar balaybalay00000000000000 petsc4py.PETSc.Random
Package petsc4py :: Module PETSc :: Class Random
[hide private]
[frames] | no frames]

Class Random


Nested Classes [hide private]
  Type
Instance Methods [hide private]
 
__call__(...) <==> x(...)
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, comm=None)
 
destroy(self)
 
getInterval(self)
 
getSeed(self)
 
getType(self)
 
getValue(self)
 
getValueReal(self)
 
setFromOptions(self)
 
setInterval(self, interval)
 
setSeed(self, seed=None)
 
setType(self, rnd_type)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  interval
  seed

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.Side-class.html0000644000175000017500000002227114062764463023641 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.Side
Package petsc4py :: Module PETSc :: Class PC :: Class Side
[hide private]
[frames] | no frames]

Class Side


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  L = 0
  LEFT = 0
  R = 1
  RIGHT = 1
  S = 2
  SYMMETRIC = 2
  __qualname__ = 'PCSide'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_normschedu.png0000644000175000017500000000401714062764464024741 0ustar balaybalay00000000000000PNG  IHDRw$#bKGDIDATxkPW * L D^&1fAY˙uuh$>VѨ)-G@ERQ"ncDy 1Ю %&;տ={^GI5k 5bDq3x>+ q1#G=}묋/ ^}=}:'v~%1&nniو5bDqRľG Oz=__7ofުUl9x۷_ ?Ǒ綷? NAĽźX ʺ ((-5D>ٴ?11mmӻ Y ׮=l{G %<ڶ6.fe:{}Z/άر>l/N#.)S0s&a119u緄čY?FEq"4<~D cgGE8+i4,&~&$08lj\'Ob.Qx82GRP}}R)7 q*i4JL֏?2Y`ҥX[Y ҇=vz{hm;ռ<&GxHS'L~e%) ݓ n¹!xcT<&O'}Y @e3t({XguMGg'J%7X{XA}e˜1rDBmN3ښhj`jJZx,a|T)@W(WU(8RVOm^^̚Ŧŋ|z5ϝ̌9˗s:߅S[_Oh` ?r0%V.t[|C` |}OqqKȠ{"0@*KJbJEsk+#"usQC:79e sfo!Z&ח39FEu5GfUDIMOBf& 䶶į_OȬY$=DW;v˶nam-,wws:wJJ6Kٔ3lc>MHQ8@xHaa+yyOٵe0q[ywɀ͍ |ĉ8+XYZ]u 'j42V.OJ[[4!LrӦ q-d2AG 99 ~`&5k_EM VXZXgSw_ urtdR>cnhld!¹`Bf&پt!LFZ͞/Au5 [ﲳqvtD"3IϮ0pV(zBҁ9\Oij\4MMo^"ehjI>{V3css~wi_*כhXKGg':0}$||8ss4-nSXնm;GstK4m[..J^^\TMX\MV(Z8=xst|j~q!q91uONajc&ԩDx,\X²2vDF2A=6b(}ٞ|Tʰ0,`, `-gŸ99QZQIoL@»Beg₅L~ 8f`klj#9|8еp%/<<011rsySSSz=rrqusrrqA& k)./g5cr-Ool Q6 @47ݒ3`me޾[zWV2~<x,vq1uu8ۣmk‚VV\gO}OwBCC9qO]Wף/qō#F׈5bDqQ\#F׈uj~>ak׾κ^-X>luq1F(?oF@IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.TS.RKType-class.html0000644000175000017500000002734114062764464024163 0ustar balaybalay00000000000000 petsc4py.PETSc.TS.RKType
Package petsc4py :: Module PETSc :: Class TS :: Class RKType
[hide private]
[frames] | no frames]

Class RKType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  RK1FE = '1fe'
  RK2A = '2a'
  RK3 = '3'
  RK3BS = '3bs'
  RK4 = '4'
  RK5BS = '5bs'
  RK5DP = '5dp'
  RK5F = '5f'
  RK6VR = '6vr'
  RK7VR = '7vr'
  RK8VR = '8vr'
  __qualname__ = 'TSRKType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_3.png0000644000175000017500000000154414062764460023773 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_migratetyp.png0000644000175000017500000000336014062764460024753 0ustar balaybalay00000000000000PNG  IHDRh$bKGDIDAThkPWOaDHBTTX Ƣ,HP+ t PTт:EgJ>8 8APPD1#釭i bӹޜ=߽ I!>TpBsDz_y|.΄ STܸ}9pSg;I`ƍ?9B8dgV;7"fON6oڷ2;%nr9=&iiUUF.[8&NĜ/5n:IN))Q;qD@V^MVAFrD [8 wy~~ܲeX>;0n̘vIN犊N~TWkbH5n KA>::҂d?WTԮRFGԴ21m޽7lݼҍ]gwf-V Ϟ'`vo_TTUm;wN9lւlcp~U; JJn+\t@Vt܏lm1Ę9U /_ +()l1g\=};D (_vu,]=mZټz@*,DQYnܞŲъ+*7^dme(E9w_(\m[Um[*dtuݿu-ޝ9FbLBP'cNŐʚ(KKO5e$QӝSS>4p[aͦ'OtPdY/WZf&c8"=i "1 W!VtJ7;_ޝvmI0RTKKgȶmb|BP W]x٩鰋׮R1a4`K))<6[\b[74eݻla2+ʺGZ-3jkU*'.מZs`HšoeezgJ.ZI=uJ5&ћB=P 8O@XmѢtF3 K petsc4py.PETSc.TS.ProblemType
Package petsc4py :: Module PETSc :: Class TS :: Class ProblemType
[hide private]
[frames] | no frames]

Class ProblemType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  LINEAR = 0
  NONLINEAR = 1
  __qualname__ = 'TSProblemType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMDA.StencilType-class.html0000644000175000017500000002042714062764460025421 0ustar balaybalay00000000000000 petsc4py.PETSc.DMDA.StencilType
Package petsc4py :: Module PETSc :: Class DMDA :: Class StencilType
[hide private]
[frames] | no frames]

Class StencilType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BOX = 1
  STAR = 0
  __qualname__ = 'DMDAStencilType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc-module.html0000644000175000017500000007515114062764457022645 0ustar balaybalay00000000000000 petsc4py.PETSc
Package petsc4py :: Module PETSc
[hide private]
[frames] | no frames]

Module PETSc

Portable, Extensible Toolkit for Scientific Computation
Classes [hide private]
  AO
  Comm
  DA
  DM
  DMComposite
  DMDA
  DMLabel
  DMPlex
  DMShell
  DMStag
  DMSwarm
  DS
  Error
  FE
  IS
  InsertMode
  KSP
  LGMap
  Log
  LogClass
  LogEvent
  LogStage
  Mat
  NormType
  NullSpace
  Object
  Options
Options(prefix=None)
  PC
  Partitioner
  PartitionerType
  Quad
  Random
  SF
  SNES
  Scatter
  ScatterMode
  Section
  Sys
  TAO
TAO Solver
  TS
  Vec
  Viewer
  ViewerHDF5
  _DMComposite_access
  _DMDA_Vec_array
  _IS_buffer
  _Mat_Stencil
  _Vec_LocalForm
_Vec_LocalForm(Vec gvec) Context manager for Vec local form
  _Vec_buffer
Functions [hide private]
 
_finalize()
 
_initialize(args=None, comm=None)
Variables [hide private]
  COMM_NULL = <petsc4py.PETSc.Comm object at 0x7fe2de05b1d0>
  COMM_SELF = <petsc4py.PETSc.Comm object at 0x7fe2de071bd0>
  COMM_WORLD = <petsc4py.PETSc.Comm object at 0x7fe2de071c10>
  DECIDE = -1
  DEFAULT = -2
  DETERMINE = -1
  INFINITY = 4.49423283716e+307
  NINFINITY = -4.49423283716e+307
  PINFINITY = 4.49423283716e+307
  __arch__ = 'arch-pydoc'
  __package__ = 'petsc4py'
  __pyx_capi__ = {'GetComm': <capsule object "MPI_Comm (PyObject...
  __type_registry__ = {0: None, 1211212: <type 'petsc4py.PETSc.O...
  __warningregistry__ = {('numpy.ndarray size changed, may indic...
Variables Details [hide private]

__pyx_capi__

Value:
{'GetComm': <capsule object "MPI_Comm (PyObject *, MPI_Comm)" at 0x7fe\
2f6528420>,
 'GetCommDefault': <capsule object "MPI_Comm (void)" at 0x7fe2f6528480\
>,
 'PyPetscAO_Get': <capsule object "AO (PyObject *)" at 0x7fe2f6528bd0>\
,
 'PyPetscAO_New': <capsule object "PyObject *(AO)" at 0x7fe2f6528ba0>,
 'PyPetscComm_Get': <capsule object "MPI_Comm (PyObject *)" at 0x7fe2f\
...

__type_registry__

Value:
{0: None,
 1211212: <type 'petsc4py.PETSc.Object'>,
 1211220: <type 'petsc4py.PETSc.Viewer'>,
 1211221: <type 'petsc4py.PETSc.Random'>,
 1211222: <type 'petsc4py.PETSc.IS'>,
 1211223: <type 'petsc4py.PETSc.LGMap'>,
 1211224: <type 'petsc4py.PETSc.Section'>,
 1211226: <type 'petsc4py.PETSc.AO'>,
...

__warningregistry__

Value:
{('numpy.ndarray size changed, may indicate binary incompatibility. Ex\
pected 16 from C header, got 80 from PyObject',
  <type 'exceptions.RuntimeWarning'>,
  4): True}

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PartitionerType-class.html0000644000175000017500000002461514062764463025622 0ustar balaybalay00000000000000 petsc4py.PETSc.PartitionerType
Package petsc4py :: Module PETSc :: Class PartitionerType
[hide private]
[frames] | no frames]

Class PartitionerType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  CHACO = 'chaco'
  GATHER = 'gather'
  MATPARTITIONING = 'matpartitioning'
  PARMETIS = 'parmetis'
  PTSCOTCH = 'ptscotch'
  SHELL = 'shell'
  SIMPLE = 'simple'
  __qualname__ = 'PartitionerType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.Option-class.html0000644000175000017500000003634514062764462024452 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.Option
Package petsc4py :: Module PETSc :: Class Mat :: Class Option
[hide private]
[frames] | no frames]

Class Option


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ERROR_LOWER_TRIANGULAR = 13
  FORCE_DIAGONAL_ENTRIES = 3
  GETROW_UPPERTRIANGULAR = 14
  HERMITIAN = 9
  IGNORE_LOWER_TRIANGULAR = 12
  IGNORE_OFF_PROC_ENTRIES = 4
  IGNORE_ZERO_ENTRIES = 7
  KEEP_NONZERO_PATTERN = 6
  NEW_NONZERO_ALLOCATION_ERR = 19
  NEW_NONZERO_LOCATIONS = 18
  NEW_NONZERO_LOCATION_ERR = 11
  NO_OFF_PROC_ENTRIES = 17
  NO_OFF_PROC_ZERO_ROWS = 16
  OPTION_MAX = 25
  OPTION_MIN = -3
  ROW_ORIENTED = -1
  SORTED_FULL = 23
  SPD = 15
  STRUCTURALLY_SYMMETRIC = 2
  STRUCTURE_ONLY = 22
  SUBMAT_SINGLEIS = 21
  SUBSET_OFF_PROC_ENTRIES = 20
  SYMMETRIC = 1
  SYMMETRY_ETERNAL = 10
  UNUSED_NONZERO_LOCATION_ERR = -2
  USE_HASH_TABLE = 5
  USE_INODES = 8
  __qualname__ = 'MatOption'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.SORType-class.html0000644000175000017500000002472614062764462024507 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.SORType
Package petsc4py :: Module PETSc :: Class Mat :: Class SORType
[hide private]
[frames] | no frames]

Class SORType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  APPLY_LOWER = 128
  APPLY_UPPER = 64
  BACKWARD_SWEEP = 2
  EISENSTAT = 32
  FORWARD_SWEEP = 1
  LOCAL_BACKWARD_SWEEP = 8
  LOCAL_FORWARD_SWEEP = 4
  LOCAL_SYMMETRIC_SWEEP = 12
  SYMMETRY_SWEEP = 3
  ZERO_INITIAL_GUESS = 16
  __qualname__ = 'MatSORType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dm.png0000644000175000017500000003056014062764457023176 0ustar balaybalay00000000000000PNG  IHDRS=~bKGD IDATxwXTg6{QPł %5q5Y7fSmM4l%F bD#(4*J" PD@;' * ޟ9s99+WDHH>>>Xzuu5>CݻSSS,X#GΝ;̜9ZZZ̄7zCCC`ڄ-$ 0dȐFgddի`ԨQsGT*Enn-''%ee>R)$NN0C䄫EEmm"z1"vgkѣ(8r??Ⱦ~ns#ݸ?ݺ{.]j3;aܻ77mrlݿ_n?#~ܶ}qqtum3{::燘ӧ嶇4 "bcݖ#g)",CnAܶC2IIѣՑE"zF1"A: x{SǸ^@7==LQ[P~mFG̙։1"v#:t/QNND|b"'$] 9$g#vťEV~>q#an``}% &{yՏ>˜G}}WWWTVVbѢEرc>!66pt022nܸ!#??555b뇁ԯ""j)"RNuu5_)''A "$$$ ::׮]C>} ooo'ODpp0/4Ӵn:,_SN]񈍍ŁPXXCCCxxx/"틂!77W-RУGXXXoݺukND)"z7aJMME^^tptt lmm˗/ɓ'Q[[ '''x{{#GƟ;,]'OƖ-[еkW̙3aaaH 0@ǍGee%ooox{{ry]HwÚ,ُ -΍~Lx!?Y$ 젧'^yy9p미~XCٳQ>jjjo`׿>#\ ܸq{쁧>|SNMH$bP wwwr̝; >#O|͝;wXիӃ\=)ϊTVVQl* d?,6D)H֏IQ&E6YZZ>uP\\cǎO222رc[Hff&۷...>wAvZ{5k;Q kJOOǃ4=Q$wҥFDrLwbLdddʕ+ akkA=Ө" ;p7w}%K $$7on 33&MBii)"""0b{~w1?aÆ5ى^U[m dDQ{PXS ̬СCaddԪ_>|8Z܏j,^۶mêUSsaوƆ 0VK͛8y$bcc{ƸqQvTWjYXXIPH 0"jKMt4I=`hjj,ooƍ011۪5ƅ }vZ QX`֯_mmV?NV111\zm*e~WVVt"4h,,,Tr:(SDMQ˗/ҥK(--x,`j9Re"/^D`` 444~8::1 +ggg*]SSd1?Q\3*CKɂ?=zޒZjݺux70|lذAmMEwoaӦM;wn~ѣGq]qJ ooo5Z:={ jfl"b0E-{-8qQQQBIII *,\;vPYG檭ᅬ5k`…ذaښN7hɛ֖Z e,ͮ1gGz)-- 0`rttlďmIQs=QFpppP[Lٳjˋ"vBhh(\]]CCCugђ7 `رc;E'۷o#++ blF.]M`kk)\R)򐞞.6ǥ!##wFڶrMq2ZYLqԡdYZZِ )*++!Kiii⤖)n666-[jjjpqͻOWw6儇cܹ=z4}zL6 Ν?`ugI[9r%%%055o߾ΦJi~Ȑ!\Z)jJJJh\FFjkkh׿ab"˶Ç#66Q퓿?|||ecBCCU6*`ŊXv-z-^ޏ[FѣeYQ<9vvv͢`0ECiNh uNj4@{1Z>]pA:'B|J̟?{_~%K;K-}v,\عsgUOђ7k1DUxڬA֐!C:lj ȖLiX˔"v4m}ȑ# goԱ)4irssOOOugI)6XݸqbccqAO>G ]JJJ!v]KSSS1x`90WaT?SZ&GGG9UYYx… ӃsssugΜ9 WztPXX)Sضmԝ%o2 !ԈZE/_,NRګW/ <rèPj3 嚚*so;;;;m/Ywww;-{n̛7cǎݻ;]sHUU.]͛7w~TOKlZDH$%o:zTE].^7o_cS5Y)z7c[nspvS ٲ!zzzD@@@ٺ) `ʕXr%^u|w^/oFnDc\\8J077W9(Kި +99o8 fq Nuu58M=k:NUPyy9fϞCoQr,p)Gطo_7/ױwooo?ffff .\ Z ֿ`ذamZglsJMfZ^EEN>X߿iiiׇ:1qD#""R*((ɓ۷# @Yj `PUU%ߪ-ld# f%''kŤ$jLٳӦMSWh7M*4٣Gڊq(OMϧPC-=** GAUU{մ0L:U%iYɚ{xҒ7,>.[ҥKHMM4h~u)|orUϰ0憔_b$ ޽ ݻ8$$$ّGkI"rssuoBk\SSS̙3s j׮]XQԲMMMX[['O߻wIIIHNNFRRbbb_ѣG,u GƎ;8I+355Ŗ-[kK… pBڵ 3gTw:={Snj\|III7osl`0у*}vug M` t爈ԤUjΟ? p'NÆ k\zz:n޼#FȭE&J XYYupgjxMM N:%>Ѐ=#_II aaa4J̙3H$>|S)"5Jѩ>lmm1v?ʕ+((( jXPZZ:ݸq֭[ǠA-ryܹ۟sDFk`gg'X[[ ڂ SSS#z)TWW7J^ ۶l"CٳЫW/AOOOO7uBEEE#88Xn4IΝ;R,,,D"7Ny_ll@oFQQ!XXX4+M C[VU*__###Nz-tMسg puPSS>=BXXXIҥBn;;;V֭/lݺUnѣG 7Jc5eeeĉD"XYY }|5}~VVVBlll{).]*hkk ,TUUQŽqT}Sۻǔ=HKKCff&1uTxzz p1m(**7|{Aqq1w^[+*ӯ_?\tI|?C9j;QQQHKKCnn.n޼ MMML8Qn===rۧpҿIS6{/x4ܾ}3g… QUUs(^|E!==ؼy3/^ &'W;b ܾ}ׯ_GVVnܸ7=jshZϚ5 cǎEqq1RSSqUc…>ҽqXG%}ttt'_sFDDͥQSS˗c͚5'Ųe믿ʽ.\׊j$%%!##C|իHJJT*P74%%HLLDvv=DIDATvsRt \$$$RT\󨬬Dbb k LNNknl O?!11Ǐw FoX]%K 22ʾH$xWQRRkvv6.^(ω'PYYj$ NE?{N5?}4z +++qۅ #񦩩~VVVqqFAT*EFF [:e}uu5.^ɓ'9t׿{ES꒒$$$ 33QJJJddd(ѵEOOOǕ+W/^˗/322Drr2RRR,v@@BBܶ۷555ⶽ{"88X|k׮)JGaÆ o&&&={6y桶1uT 6 SN/I&aȑP`puuŔ)S ܻwǨ? 3f_~ܾ}^^^&+++þ}ĠׯfΜ"44T۝1,޽{gϞ[ݻ1c ?UUUAu6-}5EvRoS嵪 ʕ+gSڭF|ĈBbbM5;v,6mڄm۶СCr _GEEgφ133C ^x&&&3g1fƍaffӧk3Qe?p-Z$wi̛7Dtt40i$xyyB̙37o +`ƌ򂯯/ O>F„ `cc%TL3X[[Lõk:jPl)Xl8xvv6?[^}}}G"<< @bb"Μ9GRRRxb䠠UUU裏{Çٳy&\?Q|044ʕ+;wॗ^֭[qedgg#)) }W}ST&MG5zS9U?s!??SL>|}};]S_C-}$%%!""شi{=xzz6q>ϟc֭sV7333TTT6 L2E޽{1e׮X˗/NJ+`hh`bŋc>L| 6L YL₩S^^^/ եꫯpI8w[o!!!op6ӧOxPTT !!&Lg}+V 77o߆v-HKK Հ]z(**BLL RSSqu"66UJrrHDDD`ҤIr# PVVF*(9ѣGcĈj+^y>|Xo>C.>|(o&˗#::077Gii)}aشi˱cǠ}}}8q>|88vTB>}&EDD}>󵵵ѥKc֬YЀ6Z3BTjjLՁFee\n7k 4Bܻwo~Y={Ɵŏ=СC]]]066nԞ͛7![|7[uFiiiMpɓovR{PW%'˨VXSY%tR!..ƚ5kRy#C8::I3۷of̑#GIII yYY/^,7%Kp/Pwݣd."##cjk{r\@]m ::ZPyy9&NܹR&&&jlu͝ҢQu?~<=*^^^ñc0auիr46~^&~:vڅ{6z}Ŏ;OOO{!22RvQYY[OLg˖-r={vvvkPPP 6qLjCAA@>}^^^Xlceee}}}رC ~Whkk7;Add$0iҤFM<˗/Ǯ]p$ߓ&MݻU7wʼIԩS òe0w\}1,n:MkDlػwoѣGc֬Yr}㖖H$XvؿҥK8{Ct&ʔ{MMM^Z*ӥKuKH5~"33SvvvrApee3jիWΝ;xwqm̝;=z~Z yyy077ˍL%&&"""†  vn($$ofn:a̘1>}:AݻQTT?@݇|iӦa֬YHHH޽{~xmmmrsszjǧc\r-½{зo_ܹ ߜɓ/w'_FFF>NaHOOGee%.\M6>S8Ѧ!w}WI57]vW.؂ P^^ګ~5kyy9̙ 6`„ >|8>s->^{quDDD@bI&{b |XhΝ;gggTWWc}}}},]/"y<|Wƒ%KZ|ۣ,NNN ^{5XZZ͛ظq#BCCj###\~?#m6ܻwϟDze'`…Ν;i& VGa``+++XXXEEE@ee%voáC0j(h+~z9V^sH$xxxߢMcǎQ&<<<*}ҥKX~=N:Z?8w6N>kb˖-033CBBp}xxxIkKuwwAaժUزe 455o>@ǰ?cСظq#@WWWnV?۶m1n8?~m6 G[k;F[[hl_Ϟ=1rHEi&qs޽&IXn@l޼5j*NM33& H$hhh4Y^{7-[wAhhhZuevXt\`,~5 nnn(^:˚f͚%fDDD@__?suuR`jj*=#** `ժUx饗Çݑoذ^^^8vN> ###|G ӬƦM޽{;M-[ÇܹC~~~3t$*zzz O`KWW111믑'"..+V@JJ ^x\?###СCHH3f촢;f@ П5>ܧ jkkA*@tRi3bsG!333>|:|}}k.8::vAX%C}QxDDD@]T||р:dX3EDDDSDDDDJ`0EDDDSDDDDJhzĮ}:s;s3U_&yi{_ȭlOm徱,q70*/#FP}F033SiK`q9UOMSgokyDCDDDYL)q%IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_ts.png0000644000175000017500000000357714062764464023232 0ustar balaybalay00000000000000PNG  IHDRG[!bKGD4IDATx}LSYe,UA ")FXĝ:bqi&5Yuf!1ęABFR7 &4ىnaϱ]5|Lw+;ݙ$7is{smz@4D;10r{3t:\J~~ d"+&.4\.@09(..^DZc`}mmmؽ{wĄP rn:>}jXv-Ν;p\hooX_"`Aql1{l$^O^El Bjw$$$͛7gUߙsޖ\~Rԯ,//վXSS QPP`zDnn.vQVVr߿W^ [VXjk4_>͛7#11|2&&&p z uV466bǎdjs^/t:}vv9h:tׯ[-XdɌK.ŋpOD"AUU6l໿p:v>}GBA*h4x-qΝx1V\ T B`@9JoUzJHHH{6n܈ J}GaѢEZ.\`0#AQ՘lvttϟGEE`ddįv#&&/`(Je2F#>NDD'N \N)))I(99,[Z3ߧz_rQww7MMMQoo/9_ٛrƨ゚qJ~qC4<ZPM~TX&OCF~:6_&82ݩS]l,a"7PZ9ѾϑR)}/v n7jze p_EBjfüwJKÒ&e2[,ȀA{t4,J|k0UV"I@mC~e .56<Qi j5*>/|UQr䴸Vƫ0l`a_ ?errBV訯ǡon7gOQP69ֺ8\ q6հ\.Àa0r_R"D3?9 X"iNr 솘_ PqwBIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.SchurPreType-class.html0000644000175000017500000002205314062764463025350 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.SchurPreType
Package petsc4py :: Module PETSc :: Class PC :: Class SchurPreType
[hide private]
[frames] | no frames]

Class SchurPreType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  A11 = 2
  FULL = 4
  SELF = 0
  SELFP = 1
  USER = 3
  __qualname__ = 'PCFieldSplitSchurPreType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMDA-class.html0000644000175000017500000015351314062764460023162 0ustar balaybalay00000000000000 petsc4py.PETSc.DMDA
Package petsc4py :: Module PETSc :: Class DMDA
[hide private]
[frames] | no frames]

Class DMDA


Nested Classes [hide private]
  ElementType
  InterpolationType
  StencilType

Inherited from DM: BoundaryType, Type

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, dim=None, dof=None, sizes=None, proc_sizes=None, boundary_type=None, stencil_type=None, stencil_width=None, bool setup=True, ownership_ranges=None, comm=None)
 
createNaturalVec(self)
 
createNaturalVector(self)
 
duplicate(self, dof=None, boundary_type=None, stencil_type=None, stencil_width=None)
 
getAO(self)
 
getBoundaryType(self)
 
getCoordinateName(self, index)
 
getCorners(self)
 
getDim(self)
 
getDof(self)
 
getElementType(self)
 
getElements(self, elem_type=None)
 
getFieldName(self, field)
 
getGhostCorners(self)
 
getGhostRanges(self)
 
getInterpolationType(self)
 
getOwnershipRanges(self)
 
getProcSizes(self)
 
getRanges(self)
 
getRefinementFactor(self)
 
getScatter(self)
 
getSizes(self)
 
getStencil(self)
 
getStencilType(self)
 
getStencilWidth(self)
 
getVecArray(self, Vec vec)
 
globalToNatural(self, Vec vg, Vec vn, addv=None)
 
naturalToGlobal(self, Vec vn, Vec vg, addv=None)
 
setBoundaryType(self, boundary_type)
 
setCoordinateName(self, index, name)
 
setDim(self, dim)
 
setDof(self, dof)
 
setElementType(self, elem_type)
 
setFieldName(self, field, name)
 
setInterpolationType(self, interp_type)
 
setProcSizes(self, proc_sizes)
 
setRefinementFactor(self, refine_x=2, refine_y=2, refine_z=2)
 
setSizes(self, sizes)
 
setStencil(self, stencil_type, stencil_width)
 
setStencilType(self, stencil_type)
 
setStencilWidth(self, stencil_width)
 
setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)

Inherited from DM: adaptLabel, adaptMetric, addCoarsenHook, addField, clearDS, clearLabelStratum, clearLabelValue, clone, coarsen, coarsenHierarchy, convert, copyDS, copyDisc, copyFields, createDS, createDefaultSF, createFieldDecomposition, createGlobalVec, createGlobalVector, createInjection, createInterpolation, createLabel, createLocalVec, createLocalVector, createMat, createMatrix, createRestriction, createSectionSF, destroy, getAppCtx, getBasicAdjacency, getBlockSize, getBoundingBox, getCoarsenLevel, getCoordinateDM, getCoordinateDim, getCoordinateSection, getCoordinates, getCoordinatesLocal, getDS, getDefaultGlobalSection, getDefaultSF, getDefaultSection, getDimension, getField, getFieldAdjacency, getGlobalSection, getGlobalVec, getLGMap, getLabel, getLabelIdIS, getLabelName, getLabelOutput, getLabelSize, getLabelValue, getLocalBoundingBox, getLocalVec, getMatrix, getNumFields, getNumLabels, getPointSF, getRefineLevel, getSection, getSectionSF, getStratumIS, getStratumSize, getType, globalToLocal, hasLabel, load, localToGlobal, localToLocal, localizeCoordinates, refine, refineHierarchy, removeLabel, restoreGlobalVec, restoreLocalVec, setAppCtx, setBasicAdjacency, setCoordinateDim, setCoordinates, setCoordinatesLocal, setDefaultGlobalSection, setDefaultSF, setDefaultSection, setDimension, setField, setFieldAdjacency, setFromOptions, setGlobalSection, setKSPComputeOperators, setLabelOutput, setLabelValue, setMatType, setNumFields, setOptionsPrefix, setPointSF, setRefineLevel, setSNESFunction, setSNESJacobian, setSection, setSectionSF, setType, setUp, setVecType, view, viewFromOptions

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  boundary_type
  corners
  dim
  dof
  ghost_corners
  ghost_ranges
  proc_sizes
  ranges
  sizes
  stencil
  stencil_type
  stencil_width

Inherited from DM: appctx, ds

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, dim=None, dof=None, sizes=None, proc_sizes=None, boundary_type=None, stencil_type=None, stencil_width=None, bool setup=True, ownership_ranges=None, comm=None)

 
Overrides: DM.create

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_stencilloc.png0000644000175000017500000000301014062764460024715 0ustar balaybalay00000000000000PNG  IHDRy$"7bKGDIDAThmLSghJZ]g!œ6RA&T>Oš 2?m"%3B ;2JVR ml 9DOOΝy{α0 5vYcakX,6Ƌk X>[yQ($͓f<ז IE`5vYcdm0.VU}v`Hb◧N5p[~SFGzNHg|ysJĬmd7o5r@_㲥Pd5n4cgkxp8R ʕJ_>$'';6AylقJӬs/Q6`\^MYN\9xpىɌ>|W r_kke2hjm##4re͛޹}*w/s}| 6g0>p4ڭNٳ O6%^T $<-MTVb0T*&~1/ϊHWg#GNK٢ ]o͛wBDT=,>kV'&]&ˍ_b=ͥ׋ڙ3}|,V\P=IЖB9QR (q˗ ݍ=.D4qq1՜LfȅTaaaHx؁gx؁gx؁gfHM㠢G0S{z=,GDp󩬮Fli҄愆<3ͬ۱iiFzjldW^2/::n|hW*y#=mkQ~>J%Ұ0-X5]_|k#>- Pvuq?OJ$biBQ!!ܿ#G8[QdwwRbbIlqa!RSՎ]RHJZS d ]Ӆ j.WUQHo_!oImCH][r%vb1,!tT{z8}qd XP y=˟w(aalxyֺyH$|\X_$omm/*bOAQQxF3~=JJl,&&^k55:is!s |^\  @JL̰*_zMM͡Om-Ұ0L䄕HDRW\^l̡]z5}}d_ό@r9EFj#&<TSPRXƍ{wݻlj\\Uyyn}=6VVM[g'q4+k1.WW؜>mzzS$2LJ\W({֎r a,(~wMVXY=џԔ3fPTVƦK)./Pe:~ƘGpJB7{̌.dT圩 petsc4py.PETSc.TAO.Type
Package petsc4py :: Module PETSc :: Class TAO :: Class Type
[hide private]
[frames] | no frames]

Class Type

TAO Solver Types
Class Variables [hide private]
  ADMM = 'admm'
  ALMM = 'almm'
  ASFLS = 'asfls'
  ASILS = 'asils'
  BLMVM = 'blmvm'
  BMRM = 'bmrm'
  BNCG = 'bncg'
  BNLS = 'bnls'
  BNTL = 'bntl'
  BNTR = 'bntr'
  BQNKLS = 'bqnkls'
  BQNKTL = 'bqnktl'
  BQNKTR = 'bqnktr'
  BQNLS = 'bqnls'
  BQPIP = 'bqpip'
  BRGN = 'brgn'
  CG = 'cg'
  GPCG = 'gpcg'
  IPM = 'ipm'
  LCL = 'lcl'
  LMVM = 'lmvm'
  NLS = 'nls'
  NM = 'nm'
  NTL = 'ntl'
  NTR = 'ntr'
  OWLQN = 'owlqn'
  PDIPM = 'pdipm'
  POUNDERS = 'pounders'
  SHELL = 'shell'
  SSFLS = 'ssfls'
  SSILS = 'ssils'
  TRON = 'tron'
  __qualname__ = 'TAOType'
petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.SF.Type-class.html0000644000175000017500000002536114062764463023707 0ustar balaybalay00000000000000 petsc4py.PETSc.SF.Type
Package petsc4py :: Module PETSc :: Class SF :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ALLGATHER = 'allgather'
  ALLGATHERV = 'allgatherv'
  ALLTOALL = 'alltoall'
  BASIC = 'basic'
  GATHER = 'gather'
  GATHERV = 'gatherv'
  NEIGHBOR = 'neighbor'
  WINDOW = 'window'
  __qualname__ = 'SFType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_logevent.png0000644000175000017500000000273714062764461024421 0ustar balaybalay00000000000000PNG  IHDRW$~bKGDIDATh{LSgBEJJBIQ&@ʐ X$I 21 CCet14(BT\:܆Nx[3 e^HuDP?a@fΓ}7_眯tuuu!";7Q\n/R+W@ xyx8/xcHqN IH{ۂ (s_NKc /󳲨}])s`V{%mo׮8f &Yd2yMHOJW?+~~$tɓ$tȟ=5;v03#1UUYƚY>3wɓe :degfrgl.*"a2>je%-f3SVQ\Kw/kRȒl;g))\3LyTITj*>8JFص-طwҬOۑ,.-rཥK1^@r|<21 bϳ8;}t4:yy|`ÕJVdm Fmm|ޞ9ӦQ={F{GYYH$fDE:_ܣHX:FT;rqq_Ω2;PbcinmeΝ|z5l^ɡ\ZJ͛$LL*MT\Su5H-6mp0F+!H[>>Vs=y'x]d$:/{See OGGsd" MIںu|{h|vtvV}a (^RP@L?Q^^T߽>5 {;;r-cܹhjo GmGՕ8N0+ |ݢEPuSHNӧ}ѰpzZNϚH@&{Wly+?qmP2f37n0Ԅ ^O@LDe2c@M]MMcnkTU0kU-/grHv[jR񬽝o`Ô~bW,11^6Yvpuq![w;{60z4^ #T*FT=.=|Hfe{iA&#< _qà=j4RS MM] C VJ6gPק>=}0SqQ@DqDW@Dq ˗r@ѫwM^ۂXumrDW@DqOM*dsIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_partitione_2.png0000644000175000017500000000340014062764463025163 0ustar balaybalay00000000000000PNG  IHDRy$"7bKGDIDAThmLSg\ZZ( 6-R(b Xq a'*H|"AT&j0v8 V鰼/(tUtֱ5ty9'>} ֟/k>u/!.\0؋k Jl_OO[hmk3xyALZlr#C;p~=${751nǦ(HT۷_R$eeUFXGG/Kx]-O$B!TYg^SS;[cqO_ܺr% dVKm*p֭%b1`O"_AM}}sڝםЦRmضZe%t҄WV֮JK{RmHO/xfEI9rDoFPk4j|irr 9Ρ3f|q uM>xѢ"4ɕ{&ee|9$11jǎw|('.^ ݧZŋR)͖)[[ݒSuh_/wߪbN7;:ACCTp̌lx2>=}q@/)+D&Dݻ D yhT״m}y4qNB+.>\X0UPVQa6FY:u^ut{z܉v˥RLN$/)śH L&Bhl\T$iL"`Åi}:]FbHT89V]z#"QWOOZn[5eP<%ETNus+,-H@C\ǍCeS(22Fj^D@"9Y0IFZqSL"y{_؋GG  x&T|J.B&͙S\^Êd>4=Xq G^Otu;cxѣkޝ`L 5 IpP ]4!\ nH b>n^oeej5J$gD"gVh|>nH1`֬55>ם?^,5_ +j5Ùdٵl8 K†}QC+.VyF!zY˖=*>}sff7FN̞=5gq ykyAAEX9맅7N&DD a , k#$8<*?$U,N8!yfo::>xAC&SɓϷ]rPBcvv7D><<*(HvqA+ҩԛǐU[[J762t.D. hɓ51ŞBIEs3@fb,Z0eʇlH$(B&Ϙ:vv }̊`OIn@b I"M(F6tJKYc4j`f-fUXL",0vQπ}|^\n$;;p;\+MmmfT ӧ _Θkk O3 IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMShell-class.html0000644000175000017500000012060014062764460023734 0ustar balaybalay00000000000000 petsc4py.PETSc.DMShell
Package petsc4py :: Module PETSc :: Class DMShell
[hide private]
[frames] | no frames]

Class DMShell


Nested Classes [hide private]

Inherited from DM: BoundaryType, Type

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
create(self, comm=None)
 
setCoarsen(self, coarsen, args=None, kargs=None)
 
setCreateDomainDecomposition(self, decomp, args=None, kargs=None)
 
setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None)
 
setCreateFieldDecomposition(self, decomp, args=None, kargs=None)
 
setCreateGlobalVector(self, create_gvec, args=None, kargs=None)
 
setCreateInjection(self, create_injection, args=None, kargs=None)
 
setCreateInterpolation(self, create_interpolation, args=None, kargs=None)
 
setCreateLocalVector(self, create_lvec, args=None, kargs=None)
 
setCreateMatrix(self, create_matrix, args=None, kargs=None)
 
setCreateRestriction(self, create_restriction, args=None, kargs=None)
 
setCreateSubDM(self, create_subdm, args=None, kargs=None)
 
setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)
 
setGlobalToLocalVecScatter(self, Scatter gtol)
 
setGlobalVector(self, Vec gv)
 
setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)
 
setLocalToGlobalVecScatter(self, Scatter ltog)
 
setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)
 
setLocalToLocalVecScatter(self, Scatter ltol)
 
setLocalVector(self, Vec lv)
 
setMatrix(self, Mat mat)
 
setRefine(self, refine, args=None, kargs=None)

Inherited from DM: adaptLabel, adaptMetric, addCoarsenHook, addField, clearDS, clearLabelStratum, clearLabelValue, clone, coarsen, coarsenHierarchy, convert, copyDS, copyDisc, copyFields, createDS, createDefaultSF, createFieldDecomposition, createGlobalVec, createGlobalVector, createInjection, createInterpolation, createLabel, createLocalVec, createLocalVector, createMat, createMatrix, createRestriction, createSectionSF, destroy, getAppCtx, getBasicAdjacency, getBlockSize, getBoundingBox, getCoarsenLevel, getCoordinateDM, getCoordinateDim, getCoordinateSection, getCoordinates, getCoordinatesLocal, getDS, getDefaultGlobalSection, getDefaultSF, getDefaultSection, getDimension, getField, getFieldAdjacency, getGlobalSection, getGlobalVec, getLGMap, getLabel, getLabelIdIS, getLabelName, getLabelOutput, getLabelSize, getLabelValue, getLocalBoundingBox, getLocalVec, getMatrix, getNumFields, getNumLabels, getPointSF, getRefineLevel, getSection, getSectionSF, getStratumIS, getStratumSize, getType, globalToLocal, hasLabel, load, localToGlobal, localToLocal, localizeCoordinates, refine, refineHierarchy, removeLabel, restoreGlobalVec, restoreLocalVec, setAppCtx, setBasicAdjacency, setCoordinateDim, setCoordinates, setCoordinatesLocal, setDefaultGlobalSection, setDefaultSF, setDefaultSection, setDimension, setField, setFieldAdjacency, setFromOptions, setGlobalSection, setKSPComputeOperators, setLabelOutput, setLabelValue, setMatType, setNumFields, setOptionsPrefix, setPointSF, setRefineLevel, setSNESFunction, setSNESJacobian, setSection, setSectionSF, setType, setUp, setVecType, view, viewFromOptions

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from DM: appctx, ds

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, comm=None)

 
Overrides: DM.create

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.TAO.Reason-class.html0000644000175000017500000002263014062764464024325 0ustar balaybalay00000000000000 petsc4py.PETSc.TAO.Reason
Package petsc4py :: Module PETSc :: Class TAO :: Class Reason
[hide private]
[frames] | no frames]

Class Reason

TAO Solver Termination Reasons
Class Variables [hide private]
  CONTINUE_ITERATING = 0
  CONVERGED_GATOL = 3
  CONVERGED_GRTOL = 4
  CONVERGED_GTTOL = 5
  CONVERGED_ITERATING = 0
  CONVERGED_MINF = 7
  CONVERGED_STEPTOL = 6
  CONVERGED_USER = 8
  DIVERGED_LS_FAILURE = -6
  DIVERGED_MAXFCN = -5
  DIVERGED_MAXITS = -2
  DIVERGED_NAN = -4
  DIVERGED_TR_REDUCTION = -7
  DIVERGED_USER = -8
  ITERATING = 0
  __qualname__ = 'TAOConvergedReason'
petsc4py-3.15.1/docs/apiref/redirect.html0000644000175000017500000001052214062764465020461 0ustar balaybalay00000000000000Epydoc Redirect Page

Epydoc Auto-redirect page

When javascript is enabled, this page will redirect URLs of the form redirect.html#dotted.name to the documentation for the object with the given fully-qualified dotted name.

 

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_7.png0000644000175000017500000000154414062764461024000 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/toc-petsc4py.PETSc-module.html0000644000175000017500000001613014062764457023420 0ustar balaybalay00000000000000 PETSc

Module PETSc


Classes

AO
Comm
DA
DM
DMComposite
DMDA
DMLabel
DMPlex
DMShell
DMStag
DMSwarm
DS
Error
FE
IS
InsertMode
KSP
LGMap
Log
LogClass
LogEvent
LogStage
Mat
NormType
NullSpace
Object
Options
PC
Partitioner
PartitionerType
Quad
Random
SF
SNES
Scatter
ScatterMode
Section
Sys
TAO
TS
Vec
Viewer
ViewerHDF5

Functions

Variables

COMM_NULL
COMM_SELF
COMM_WORLD
DECIDE
DEFAULT
DETERMINE
INFINITY
NINFINITY
PINFINITY
__arch__
__package__
__pyx_capi__
__type_registry__
__warningregistry__

[hide private] petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Viewer.Size-class.html0000644000175000017500000002344114062764465024630 0ustar balaybalay00000000000000 petsc4py.PETSc.Viewer.Size
Package petsc4py :: Module PETSc :: Class Viewer :: Class Size
[hide private]
[frames] | no frames]

Class Size


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  FULL = -3
  FULL_SIZE = -3
  HALF = -4
  HALF_SIZE = -4
  QUARTER = -6
  QUARTER_SIZE = -6
  THIRD = -5
  THIRD_SIZE = -5
  __qualname__ = 'DrawSize'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_patchconst.png0000644000175000017500000000463714062764463024747 0ustar balaybalay00000000000000PNG  IHDR$dxbKGD TIDATxiXSW_ 1 a(K$@XFP!B DA #Hd":P\)UܪUqypS`jDİ$d>Lit{Ytr9`` ZfSt`hZN5D8KxKn>ioW 1{ē[Ir婊 6j Zff|#MꛛdW}}/ك) >y}ejlY-U\R=34U\-ž?=>sڴeea+V/DWeH*vR#2)nn~S\u#2G*2̛1i #>08xDt=HDXH4*3LׯGXXJOW"#/^\pd4~Ij3B"hgF`tٹ089y՗ozD$\+pqa1 ɦol7ODTZqfr^,# E͝{ڵ|PĹ}{eai?޻VwCf jđJq8R֭ZυF{Mi0'T=MKܾ ($$ 廢Кwg@GWo矓DzɒE!!$a>̙`q8; ňL>\^l g/YQx<䦤xx;wꚚllWq8b4?6[*mIKӑr܀DZfnbK?~쭭QIi=~ZU5+fPpϢ,.?tuu@n6++-ņdUUO._612&/g[#dsѐ$DpqϯZ=Ui& e}"X^ wLXQF{X"!Hkx3:6asdWWgq8HyoyL LJm9~LOτp3aW=ZoD VTZùQ\m)ř^^{JKky<<qz:l060x*H'J{uu~6naaJ7§OUU.43fajzŦ_mh%FFHSB_7kkNV}Oůe"L}\W.##MHdl`@"]deW̨QoLHܫg2-LMkxtS!`ƍ?>^,M 222mOr\.]H:FuywgYjl=thRD@^$!<pʚkV͠HOP̼yhK$I,cD"g͎B[ĥKI*4j ={KqCpNJ|iZb0|bG4SRWm :#WB&с 7{+斖O?Pu$OCC۰X&&M--[I!Ƙ75&Y:i8榪Y1RL")pA; ŋGvtu99$$ef-L]@QL.?|Ľ:K33k ?  ol4=ڎB p=<<<\9RT ƌ171Lsu :aSDB'!A(dN(b1O ZZ"YV77D[+z˱ Q$C2|.ࠁ>T5+f@ZZp޽7~ʌSx#V*H65[[0PHA*M _ FZZ;35;4Cv 㑹AHDGg$H Y^^mW(}tNFGj Zf%~`??9}vH-3RK %+1;XIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Vec.Option-class.html0000644000175000017500000002045614062764465024445 0ustar balaybalay00000000000000 petsc4py.PETSc.Vec.Option
Package petsc4py :: Module PETSc :: Class Vec :: Class Option
[hide private]
[frames] | no frames]

Class Option


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  IGNORE_NEGATIVE_INDICES = 1
  IGNORE_OFF_PROC_ENTRIES = 0
  __qualname__ = 'VecOption'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMDA.InterpolationType-class.html0000644000175000017500000002050214062764460026641 0ustar balaybalay00000000000000 petsc4py.PETSc.DMDA.InterpolationType
Package petsc4py :: Module PETSc :: Class DMDA :: Class InterpolationType
[hide private]
[frames] | no frames]

Class InterpolationType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  Q0 = 0
  Q1 = 1
  __qualname__ = 'DMDAInterpolationType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_rktype.png0000644000175000017500000000236714062764464024116 0ustar balaybalay00000000000000PNG  IHDRP$*-bKGDIDAThc?HLzQwadd(w S#;!@F\RON:8~ғ/xROoUw7]D[VZzn4G=<~kFFfX9 33$mŋDNvvjH@!oKnۻa8sZZ_CF D͛k3 h@F\YWii..x4v/\_߼߿ܹS[Yy| ~~ ~t5<=uTTp* g_>.;?w׫,#3e {ɓnPPx5k&-["+뛗1}NEyy߸ גK,ٺ?=MKsfgoؿvԞ">p>\k[Y]wO )+w$é񰒌g1945M[,psrz\yG @^RrŎLLLғ+*33uEyxp*9IzrE0??HMjg pԩp)s]ݓKp 50҂~]_Mׯ""p^nszYYF}}C\\nܿ/ϯ(-M󰁺:$YDij"s۷WbddTWP@4"p0gȺ88E4uZZd{ =p#ÌȃԐn ӢaF=<4HvIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_option.png0000644000175000017500000000237314062764462024103 0ustar balaybalay00000000000000PNG  IHDRG$'bKGDIDAThmLSWɫebĆB`e"Qb&b(PCc3QBD.|`*h L@M3Y0 MAFf6(+;+n/I{syοϹ۫Cq xH ##呛ʑ@-"-)yB85՜$nLzP$'{J ds$zyRp8z.D=ׯzTr._Jj~>V+Z-g͢nݥKQZ]ͥ~A j$~Jޚ6*KX8'7a4-qiL$#"hܲϕsSXV4YYdlol5infqY6 t8_T$ ޾Ɲ;)-͛x2C.su0Igs~وj2l6jeGSgfՒSZʉv\H5 ٳGGy.`R]_n7-gP\UGYS[6_aZ 89qn: ߹Ñ:S{@RNfbh(NKֆkxkM JA`߸&*V=:ֲ2vtLJ:4+XzvKz̝1>I&&-=9_:ϐ ~͙ɓbC.ǎ~j*<B&έ!ALvgH|&q=n.)E}3V\ۇ)=]rϜ9ϟ47cJK5/屽JTgE|Nq MUU( tj5'ab&T*%PTYɉvwbcYy˗cX&h%K$~!د]c@'<4Svk#qhܑ:~%N!,$ֆU h@w petsc4py

Module petsc4py


Functions

get_config
get_include
init

Variables

__credits__
__package__

[hide private] petsc4py-3.15.1/docs/apiref/class_hierarchy_for_nullspace.png0000644000175000017500000000545014062764462024560 0ustar balaybalay00000000000000PNG  IHDR][(bKGD IDATx}PTǿˋ(r7u wUK"ĠҠ($cfXeAҡT$:\,"wM3] BL!2}Pa<3s~9=C@DIEFxKm;(**b#B"vx\3Vʋ\.= 5xK^:p&JHNNƹs瘘Z:;;GvÆ TYgҥbժU Vka˖-Fϣo>1eQ\\UE닣o>TUU L{\\<==퍐-W^ AQ_,h4233iiiJ*)..BBB(++4 EGGB`+,,pӧO3tA X"" BڻwhLjyillD{{;-[6b|ҥeJDD.\???d2[ ܿw}pwwGLL ;AAABCCaffD۷o#,, bAAAX~$_-;5@#kkk 555***bbϟ'CCC&ggg:s )1땔5445773;wRyy9EEEQjjhLjMDy&\\\oܸ;;;̞=Ė,YF[n1mL&Czz: ---=lll&ĤJ6mb1rrr=, 9sKKK&nll @__H_CGGǐɉ3>dFaϞ=xaaa1oh6վe/7"*%3`rr(O ŋ1g de1\U*!^f^^ĕj&v]u+fy{Cn>˱K֤ 7%?&7Ӗܔ\X`o_yykl΅テʓ'yZ#]* x=0L&þ|\Gܿ͛187JJ|9^>mڄQwA|y+ER}y>)>/'qQK$8P54Mfld]`oceN Y`mnSccֆ3gEYXX`Gt4ǟߢK{6r,,pt3^&&18Oq|#^^x ;9aGt4cMr2"_y0 v Bnn>{B'Y[[ ܕlhj‚A& Į^ s2Ix K9}:2oGbFV,^ӧ33=ȾAs,0++]*LN56CyZ80\++!W^aca7W;=rW&("0(:{i=c}}8\\ UO:EM#Y&$҂ʟ~BXꊅB!Kt4rUbTCۋ. Yr9ݍ5~~XYKKֆ`_~>g΄X&Gk[{xFFrU+~&4{.L14d^23Cx!8Y}‘#pYRS@*ʤ$ petsc4py.PETSc.TS.ExactFinalTime
Package petsc4py :: Module PETSc :: Class TS :: Class ExactFinalTime
[hide private]
[frames] | no frames]

Class ExactFinalTime


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  INTERPOLATE = 2
  MATCHSTEP = 3
  STEPOVER = 1
  UNSPECIFIED = 0
  __qualname__ = 'TSExactFinalTime'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.InsertMode-class.html0000644000175000017500000002716514062764461024532 0ustar balaybalay00000000000000 petsc4py.PETSc.InsertMode
Package petsc4py :: Module PETSc :: Class InsertMode
[hide private]
[frames] | no frames]

Class InsertMode


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ADD = 2
  ADD_ALL = 6
  ADD_ALL_VALUES = 6
  ADD_BC = 8
  ADD_BC_VALUES = 8
  ADD_VALUES = 2
  INSERT = 1
  INSERT_ALL = 5
  INSERT_ALL_VALUES = 5
  INSERT_BC = 7
  INSERT_BC_VALUES = 7
  INSERT_VALUES = 1
  MAX = 3
  MAX_VALUES = 3
  NOT_SET_VALUES = 0
  __qualname__ = 'InsertMode'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/toc.html0000644000175000017500000000312114062764457017443 0ustar balaybalay00000000000000 Table of Contents

Table of Contents


Everything

Modules

petsc4py
petsc4py.PETSc
petsc4py.lib

[hide private] petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.ASMType-class.html0000644000175000017500000002137114062764462024236 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.ASMType
Package petsc4py :: Module PETSc :: Class PC :: Class ASMType
[hide private]
[frames] | no frames]

Class ASMType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BASIC = 3
  INTERPOLATE = 2
  NONE = 0
  RESTRICT = 1
  __qualname__ = 'PCASMType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py-module.html0000644000175000017500000003070114062764457021720 0ustar balaybalay00000000000000 petsc4py
Package petsc4py
[hide private]
[frames] | no frames]

Package petsc4py

This package is an interface to PETSc libraries.

PETSc (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication.


Version: 3.15.1

Author: Lisandro Dalcin

Submodules [hide private]
  • petsc4py.PETSc: Portable, Extensible Toolkit for Scientific Computation
  • petsc4py.lib: Extension modules for different PETSc configurations.

Functions [hide private]
 
init(args=None, arch=None, comm=None)
Initialize PETSc.
 
get_include()
Return the directory in the package that contains header files.
 
get_config()
Return a dictionary with information about PETSc.
Variables [hide private]
  __credits__ = 'PETSc Team <petsc-maint@mcs.anl.gov>'
  __package__ = None
Function Details [hide private]

init(args=None, arch=None, comm=None)

 

Initialize PETSc.

This function should be called only once, typically at the very beginning of the bootstrap script of an application.
Parameters:
  • args - command-line arguments, usually the 'sys.argv' list.
  • arch - specific configuration to use.
  • comm - MPI commmunicator

get_include()

 

Return the directory in the package that contains header files.

Extension modules that need to compile against petsc4py should use this function to locate the appropriate include directory. Using Python distutils (or perhaps NumPy distutils):

import petsc4py
Extension('extension_name', ...
          include_dirs=[..., petsc4py.get_include()])

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dmstag.png0000644000175000017500000000572414062764460024053 0ustar balaybalay00000000000000PNG  IHDRQ4bKGD IDATx{PSWOK%"RV<4B@q"-jqV˶ S]-H Hy)DbU`!,̈{uu~ߜsɹ{ 0 Ah6\36]=hkgghOuRVV׌ p*P]]}ĉ&( ܊ |>_]U^ԠY*FEE%''o޼922R&߿?55APssҊ,Jս`sUff$j۲e ^\\bg\gU5CdjjZZZžhxL+W aرc<IYZZzСZ"/]tN?s Yվ=<<<== ^u)9 777##c޽l6xuejj;22K###y@ @ 8blnn[XXpssH$FFF\. Zk5Rɓ'4MgoouV]ACCCHppppnn.++yHd &;;[E_FUt: ??_ў`0/^rb744-((A3NNN̠"⢢a|rQQQVVD"̤vuu! .\Ξ=oZZZ"v2rT*JzjZZ'AHQ<I$* GD?r]\\400ػw(Jww7 xa;88P(*0˵rqq144d22 [[[>գٳg<O$޽ pWW=aLݽf\\\looT,[(ƚ>:P???LVbt 꺺(cEQnnnjs=ku:~kIlkXԌkkUeeer+66ɓt:]_9 6 35`nĵ^xQH$%4%2*Σ7nP./BPP*Z[[˫34dWt^,g\365FGGDŽXDr"K`` @֜Woɟ~ڵkt:]*hP$Okkk655%H ֭[hlppWUU>ݯ9: >rQ R\QQi7}P(D"ⶶzK>h[3@XV=4uMM͞={LLL4탶5 Q(EKtt4Y;hYT*eaaa]v߻wy߾}ZpCgggD"MLLi~%Doiiyy0zQTTA~U^蠗+c###.c665c\36f |jo[4ƪ]E_lwep׌ p׌ p׌ p׌ p׌ p׌ yپU\^^coo|||Xq]_+bY!!O?վ+>&=}kA rf2o?EDرck@l7\LŽGra2YR I686 hml$%=쯩mm e$&N3 p–!ijghӁSwVV';D%%?~KGվsde65F]^_+#wF2Y? 212},z{X<32LW\'*G=9"0ӃY!!UMMKr91:89ӣ_miH;;'PUݾ'rlfdx;(9C||@'47+z4ۑHq4:lG"![8>>:9tqIOt[}Oϟgg/PTrwpdd}/)魬,hT[h736VBC]pUeaFw2`Ώ._f$&Bx^G77o-,,H$uLY?;8'+oCBP޳"ћF$%.?Çb'OBdcax&+榦ycOkkFD(׿O(dj1bi`/;Bsw`?eegCqtG%PJ>!T44!ȕ҈Зޘ Iˋ EgTj"I?zoSo:5$~<>2"kMذ&i"q&}}3gxNksTVh(_xh}T`afvȑذ_|qՒڄG&&,͕ud3v-'^(.㏉DT&#s]㊠kIbw4v$ҭ㹹t:iuū024W\lϹukZkpUjgöm:uJB^vVfl+ySŕ+M[WׯXk`Y=bFJJ} sd0%IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_type_12.png0000644000175000017500000000154414062764463024056 0ustar balaybalay00000000000000PNG  IHDR=$٥bKGDIDATXc?L2 #v j*Sjx` Ɉ[)/_&ݖzz$ݻ t2n,?(;{ 3f``X}/8٩4dw;@n_;D XA…\ -.ʝ;7͝ln KxQSI)SGE /edXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVa#u&ڽ{ZJJ˶obbbb``Ǧe%$ ʺ,>t]\]?~R?}ʮq7';ݻ6wd$&&3֬t+ KPQD<sMIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_dmswarm.png0000644000175000017500000000632214062764460024241 0ustar balaybalay00000000000000PNG  IHDR].9#[bKGD IDATx{P S42mF"*!v. ,:2S[zqZ:NB(^`D RLQv{݉xZ $iowO=d9 $LC'0M^`/h=Py___'''- Do뗂9vg /h4 ڵkݺuiiiTPVq;'$$HR%-zRf͚Vׯ_ATUU;TO9vXqqΒƼW===t*//oddl_b۶m<mygaii?.IydP(|xÆ IIIn"I/ppp`X|/v8.D-[,YD dff~ J?~ HOO_f 11"޽{\.722r֭:Qmm- 755@WWR*aww/*Jss2jkII]{{Yww7ܳgOyy9vu+a ݻfggy'Zmmmܷo ) T@퓕_F^fϞrsrr5|>Z~䉣#R3g Ы L&Mkqȑ#JRRRtdJ.妦N&/gΜL RSSS]]=4t[#tX_`/h4 x΢EMccc u! c*4'Op\JEo쬫W =h*1KKK{{{GGG>?7֐ܹs,͛H$rO.Ţ}RdWSS1Y \e2QQQ)SZZzj ^X,f$::bFR4~~~CCCW\ZvA3gϞ=zHP\z5<='Sess`~wz^`/h4  @E&/h4  {A^`/h4  {A^`/h4  {A^`/h4/܇5=Т"gggC%u/RWk(4ϧ>CQT^6.4  f"^<oFFr8~4Fe_|SPXnc syٰ{o\`ǎ H7^ۻ7\\Eo=s𠗛[LZ}ɒ$_|:\]T Wd2k++Wg_VIC_FJ{T|xQye5N_wmk/φ̞ TS:[Q7x߫ͱǗ/W}U9OL$"߿~Xtƿuww"F[YXtUT,rt"}wR Aį_OO,u7LMGFn4.~?!!bbqth(ظ10b2Wyx'9bv7dMM ;9]ɪjk\߲eURiD6lhhݡ_@ƻ2m|BŬYTpDaޅ ?-Evvr%=e}?֮=Μ1@߷JywIUPK[ZR}Ry? p?ϟ_,/GoEAJ " &&V"޺KnA^ၰuUUeSiMMOv88jRS{.|@3'QAAn맯_qY8.e)FF?*0߿ b.-߿n×oz.ץ[ݻ32vO%%SWIR,XVV6y 17>HceiR… zDK*%'<6@]gTQZzrE{f퍍>}BS)$Kv+,\͇<3|ӧ^i))x]QZ7+HKKRDkB~v.Doܿ/ϟc/6QZ2D@!-vc|LqSm3 -PV(Kg0:t 0(Xh`X9A22 !8>,`4P@MF)IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat-class.html0000644000175000017500000046500514062764462023202 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat
Package petsc4py :: Module PETSc :: Class Mat
[hide private]
[frames] | no frames]

Class Mat


Nested Classes [hide private]
  AssemblyType
  FactorShiftType
  InfoType
  Option
  OrderingType
  SORType
  SolverType
  Stencil
  Structure
  Type
Instance Methods [hide private]
 
PtAP(self, Mat P, Mat result=None, fill=None)
 
SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1)
 
__add__(y)
x+y
 
__call__(...) <==> x(...)
 
__delitem__(y)
del x[y]
 
__div__(y)
x/y
 
__getitem__(y)
x[y]
 
__iadd__(y)
x+=y
 
__idiv__(y)
x/=y
 
__imul__(y)
x*=y
 
__isub__(y)
x-=y
 
__itruediv__(y)
x/=y
 
__mul__(y)
x*y
 
__neg__()
-x
a new object with type S, a subtype of T
__new__(S, ...)
 
__pos__()
+x
 
__radd__(y)
y+x
 
__rdiv__(y)
y/x
 
__rmul__(y)
y*x
 
__rsub__(y)
y-x
 
__rtruediv__(y)
y/x
 
__setitem__(i, y)
x[i]=y
 
__sub__(y)
x-y
 
__truediv__(y)
x/y
 
assemble(self, assembly=None)
 
assemblyBegin(self, assembly=None)
 
assemblyEnd(self, assembly=None)
 
axpy(self, alpha, Mat X, structure=None)
 
aypx(self, alpha, Mat X, structure=None)
 
chop(self, tol)
 
conjugate(self, Mat out=None)
 
convert(self, mat_type=None, Mat out=None)
 
copy(self, Mat result=None, structure=None)
 
create(self, comm=None)
 
createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None)
 
createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None)
 
createAIJWithArrays(self, size, csr, bsize=None, comm=None)
 
createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None)
 
createDense(self, size, bsize=None, array=None, comm=None)
 
createLRC(self, Mat A, Mat U, Vec c, Mat V)
 
createNest(self, mats, isrows=None, iscols=None, comm=None)
 
createNormal(self, Mat mat)
 
createPython(self, size, context=None, comm=None)
 
createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None)
 
createScatter(self, Scatter scatter, comm=None)
 
createSubMatrices(self, isrows, iscols=None, submats=None)
 
createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None)
 
createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None)
 
createTranspose(self, Mat mat)
 
createVecLeft(self)
 
createVecRight(self)
 
createVecs(self, side=None)
 
destroy(self)
 
diagonalScale(self, Vec L=None, Vec R=None)
 
duplicate(self, copy=False)
 
equal(self, Mat mat)
 
factorCholesky(self, IS isperm, options=None)
 
factorICC(self, IS isperm, options=None)
 
factorILU(self, IS isrow, IS iscol, options=None)
 
factorLU(self, IS isrow, IS iscol, options=None)
 
factorNumericCholesky(self, Mat mat, options=None)
 
factorNumericLU(self, Mat mat, options=None)
 
factorSymbolicCholesky(self, IS isperm, options=None)
 
factorSymbolicICC(self, IS isperm, options=None)
 
factorSymbolicILU(self, IS isrow, IS iscol, options=None)
 
factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None)
 
fixISLocalEmpty(self, fix)
 
getBlockSize(self)
 
getBlockSizes(self)
 
getColumnIJ(self, symmetric=False, compressed=False)
 
getColumnVector(self, column, Vec result=None)
 
getDM(self)
 
getDenseArray(self)
 
getDenseLocalMatrix(self)
 
getDiagonal(self, Vec result=None)
 
getDiagonalBlock(self)
 
getISLocalMat(self)
 
getInertia(self)
 
getInfo(self, info=None)
 
getLGMap(self)
 
getLRCMats(self)
 
getLocalSize(self)
 
getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None)
 
getMumpsCntl(self, icntl)
 
getMumpsIcntl(self, icntl)
 
getMumpsInfo(self, icntl)
 
getMumpsInfog(self, icntl)
 
getMumpsRinfo(self, icntl)
 
getMumpsRinfog(self, icntl)
 
getNearNullSpace(self)
 
getNestISs(self)
 
getNestLocalISs(self)
 
getNestSize(self)
 
getNestSubMatrix(self, i, j)
 
getNullSpace(self)
 
getOptionsPrefix(self)
 
getOrdering(self, ord_type)
 
getOwnershipIS(self)
 
getOwnershipRange(self)
 
getOwnershipRangeColumn(self)
 
getOwnershipRanges(self)
 
getOwnershipRangesColumn(self)
 
getPythonContext(self)
 
getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None)
 
getRow(self, row)
 
getRowIJ(self, symmetric=False, compressed=False)
 
getRowSum(self, Vec result=None)
 
getSize(self)
 
getSizes(self)
 
getTransposeNullSpace(self)
 
getType(self)
 
getValue(self, row, col)
 
getValues(self, rows, cols, values=None)
 
getValuesCSR(self)
 
getVecLeft(self)
 
getVecRight(self)
 
getVecs(self, side=None)
 
imagPart(self, Mat out=None)
 
increaseOverlap(self, IS iset, overlap=1)
 
invertBlockDiagonal(self)
 
isAssembled(self)
 
isHermitian(self, tol=0)
 
isHermitianKnown(self)
 
isStructurallySymmetric(self)
 
isSymmetric(self, tol=0)
 
isSymmetricKnown(self)
 
isTranspose(self, Mat mat=None, tol=0)
 
load(self, Viewer viewer)
 
matMult(self, Mat mat, Mat result=None, fill=None)
 
matSolve(self, Mat B, Mat X)
 
matTransposeMult(self, Mat mat, Mat result=None, fill=None)
 
mult(self, Vec x, Vec y)
 
multAdd(self, Vec x, Vec v, Vec y)
 
multHermitian(self, Vec x, Vec y)
 
multHermitianAdd(self, Vec x, Vec v, Vec y)
 
multTranspose(self, Vec x, Vec y)
 
multTransposeAdd(self, Vec x, Vec v, Vec y)
 
norm(self, norm_type=None)
 
permute(self, IS row, IS col)
 
realPart(self, Mat out=None)
 
reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0)
 
restoreISLocalMat(self, Mat local)
 
restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat)
 
retrieveValues(self)
 
scale(self, alpha)
 
setBlockSize(self, bsize)
 
setBlockSizes(self, row_bsize, col_bsize)
 
setDM(self, DM dm)
 
setDiagonal(self, Vec diag, addv=None)
 
setFromOptions(self)
 
setISLocalMat(self, Mat local)
 
setISPreallocation(self, nnz, onnz)
 
setLGMap(self, LGMap rmap, LGMap cmap=None)
 
setMumpsCntl(self, icntl, val)
 
setMumpsIcntl(self, icntl, ival)
 
setNearNullSpace(self, NullSpace nsp)
 
setNullSpace(self, NullSpace nsp)
 
setOption(self, option, flag)
 
setOptionsPrefix(self, prefix)
 
setPreallocationCSR(self, csr)
 
setPreallocationDense(self, array)
 
setPreallocationNNZ(self, nnz)
 
setPythonContext(self, context)
 
setPythonType(self, py_type)
 
setSizes(self, size, bsize=None)
 
setStencil(self, dims, starts=None, dof=1)
 
setTransposeNullSpace(self, NullSpace nsp)
 
setType(self, mat_type)
 
setUnfactored(self)
 
setUp(self)
 
setValue(self, row, col, value, addv=None)
 
setValueBlockedStagStencil(self, row, col, value, addv=None)
 
setValueBlockedStencil(self, row, col, value, addv=None)
 
setValueLocal(self, row, col, value, addv=None)
 
setValueStagStencil(self, row, col, value, addv=None)
 
setValueStencil(self, row, col, value, addv=None)
 
setValues(self, rows, cols, values, addv=None)
 
setValuesBlocked(self, rows, cols, values, addv=None)
 
setValuesBlockedCSR(self, I, J, V, addv=None)
 
setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None)
 
setValuesBlockedLocal(self, rows, cols, values, addv=None)
 
setValuesBlockedLocalCSR(self, I, J, V, addv=None)
 
setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None)
 
setValuesBlockedLocalRCV(self, R, C, V, addv=None)
 
setValuesBlockedRCV(self, R, C, V, addv=None)
 
setValuesCSR(self, I, J, V, addv=None)
 
setValuesIJV(self, I, J, V, addv=None, rowmap=None)
 
setValuesLocal(self, rows, cols, values, addv=None)
 
setValuesLocalCSR(self, I, J, V, addv=None)
 
setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None)
 
setValuesLocalRCV(self, R, C, V, addv=None)
 
setValuesRCV(self, R, C, V, addv=None)
 
shift(self, alpha)
 
solve(self, Vec b, Vec x)
 
solveAdd(self, Vec b, Vec y, Vec x)
 
solveBackward(self, Vec b, Vec x)
 
solveForward(self, Vec b, Vec x)
 
solveTranspose(self, Vec b, Vec x)
 
solveTransposeAdd(self, Vec b, Vec y, Vec x)
 
storeValues(self)
 
transpose(self, Mat out=None)
 
transposeMatMult(self, Mat mat, Mat result=None, fill=None)
 
view(self, Viewer viewer=None)
 
zeroEntries(self)
 
zeroRows(self, rows, diag=1, Vec x=None, Vec b=None)
 
zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None)
 
zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None)
 
zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  assembled
  block_size
  block_sizes
  hermitian
  local_size
  owner_range
  owner_ranges
  size
  sizes
  structsymm
  symmetric

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getOptionsPrefix(self)

 
Overrides: Object.getOptionsPrefix

getType(self)

 
Overrides: Object.getType

setFromOptions(self)

 
Overrides: Object.setFromOptions

setOptionsPrefix(self, prefix)

 
Overrides: Object.setOptionsPrefix

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.PC.MGType-class.html0000644000175000017500000002136714062764463024127 0ustar balaybalay00000000000000 petsc4py.PETSc.PC.MGType
Package petsc4py :: Module PETSc :: Class PC :: Class MGType
[hide private]
[frames] | no frames]

Class MGType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  ADDITIVE = 1
  FULL = 2
  KASKADE = 3
  MULTIPLICATIVE = 0
  __qualname__ = 'PCMGType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc._Vec_LocalForm-class.html0000644000175000017500000002576214062764465025300 0ustar balaybalay00000000000000 petsc4py.PETSc._Vec_LocalForm
Package petsc4py :: Module PETSc :: Class _Vec_LocalForm
[hide private]
[frames] | no frames]

Class _Vec_LocalForm


_Vec_LocalForm(Vec gvec) Context manager for Vec local form
Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, *exc)
 
__init__(Vec gvec)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(S, ...)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(Vec gvec)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_infotype.png0000644000175000017500000000240514062764462024424 0ustar balaybalay00000000000000PNG  IHDRQ$~AbKGDIDAThc?L~!?hZ ͑,B2zzw -/_&ϖzz$ջw/-Ei{#`AÌB||yQQ\s{077o[[4׮ ҳ!Wޕƣn4qaaC L);;Smme۷?~<1 g 3Apѣp)QQL)͛ ww׈欬E>neyӒކGǏ_t/Xp-9 H EELs.g``o^^oqWܩa~>n??gss_OXŋJJQ:**:2?rvv*[o_I|h~tɟܹi}cLsedXa=yҭ[ >~fͤe˂Ude}v;_Pԩ(//vVVlJ l νv^;/ݻ~9٫W-T^fM\M͵{mǏM'JH@u-X}'v 1~~]]t3:!LJ&uSmmff`þ}&p{ڮٽ,!aþ}G,IJ=lob2c͚KnA~Cgf&DOpϟ0B\][fVVVUU~ ?}PTQSFi&q67?rW|0oFwKK*ll=]rE{f퍍4prܘs`\x")a~S,D0+,,Ç2H-߿#WI/79sn=|̬,#I!..7W&YKI .ahi!6Fa``@so^n,psrbH<}gȺ886um3=hFFj`P3G~Rt) cp'/_bqxG/V0y#s8eIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.ScatterMode-class.html0000644000175000017500000002416414062764464024672 0ustar balaybalay00000000000000 petsc4py.PETSc.ScatterMode
Package petsc4py :: Module PETSc :: Class ScatterMode
[hide private]
[frames] | no frames]

Class ScatterMode


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  FORWARD = 0
  FORWARD_LOCAL = 2
  REVERSE = 1
  REVERSE_LOCAL = 3
  SCATTER_FORWARD = 0
  SCATTER_FORWARD_LOCAL = 2
  SCATTER_LOCAL = 2
  SCATTER_REVERSE = 1
  SCATTER_REVERSE_LOCAL = 3
  __qualname__ = 'ScatterMode'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Random.Type-class.html0000644000175000017500000002315114062764463024612 0ustar balaybalay00000000000000 petsc4py.PETSc.Random.Type
Package petsc4py :: Module PETSc :: Class Random :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  RAND = 'rand'
  RAND48 = 'rand48'
  RANDER48 = 'rander48'
  RANDOM123 = 'random123'
  SPRNG = 'sprng'
  __qualname__ = 'RandomType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_scatter.png0000644000175000017500000000471614062764464024245 0ustar balaybalay00000000000000PNG  IHDRK[;xqbKGD IDATx}PEv@4 Į|h$Nm2n:5EN:ڈ5/&F&46 z^W ynN33s9*iOȲ$ ˒z=2 **A }~]OC!ğⓑq75K , Ȳ$ ˒euttm6∈wE,YfMFggòUQQĉپ};xꩧHMM+ ͎#112Ӎ=gI!$$DDDD`үh< ˅VǏ]gΜATa쫪ޞRC a޽JW,&Ϗ.4M7fY~=& >ܤoxyym6A/bҟNNNJf988vZ-[ƾ}ם f͚/԰sNZ[[ټy3jd{;w<==qqqadddƁ(..f\z8R3n=g1|pRȑ#555B!ZC :TFQ[[+.bNJ%jhkkBaRׯ7&<==Vs}yt[\xQVu551f 'ݍyasS4br:jco75bq1 !ߟ'剗^ĿU55 c[ooL*?cp{y\11̚enZ=ҭvVXdHMZ3せ̤hnkw ˒,K, Ȳ$ ˒,Kd>l|搹|dIۑqX uG , w!CB n]IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_logstage.png0000644000175000017500000000275614062764461024404 0ustar balaybalay00000000000000PNG  IHDRX$jbKGDIDAThmLSWǟBk)Rh #PW ( H`nh}LM" Eԉ 3&˪c/@RZ(mMI7+{s9' @)F@0l`0Ǽ`9?a;3rq}W_ Z1SIɜti~Hݷ͛/ѡa5j +s+I>ys( `0_kkGGW^ ETĽT*_y] g!vǎ[oe9T&C: Aן8 h:YqqHݾaL fxIeeDuWZ7 *7ry|XȈg\XhyUX|hhWq1<^б ?ILr &DDLi'/^tbrZ[)4K[gO Ȑ>{6Ӆge |vH,ށ[˲2nffљ3wx|0_mD& \i.d̄O+nܪ ߽[\WᢶnmDTX\ZMU(NUUEka0uL>32"#/ܪ;rٹlUL&uc0HDZbӦ̄ϯںN}f!|j|ѣcDLkkklNdrq#gogfzbrI99]ׯhfA"[ZGP@T:SDb1>;0@vp@Aqt57Ucc0Vc/^-EEs>B{ K#ZZ"ʢmTҔ*Hf((0  HavCB561 *?^xwںN}}T aAASSO@_]͠,1J --L:>N6I$==zު`xPГQ/ww7cn@Šq0ɢk+*J =X,YOOJTԧII66%99ܙL!$"^eej^^Yu5NT*4/ǏXrwzwyy׬9ZYpӪ3LfY~~ﹺvEg#cy8a, |>ol4nfx8,vLtu\\\@(!'9,??*$ȠR!өT7| 46I$,LjR' ōLN>io_hѰJeUPѴvvRd6ʜͻOܑTʀqG"1b,_"vӳW]|F(p+|}A>>k+LoD!=?+79y۳O;ۿQ o;V 7a5j +sg5Aa&P#L (*lO~IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_mat.png0000644000175000017500000000374714062764461023361 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATxmLTWE #YuF 02P$4Y?H/kMhD&"1v&ձ"HaB 쇮2 t{~_Ν{n8(X 3\.@OOjjj"%%55uvfo&.N7l9 \.LLLYYYh48s F0vލIg" tBCCR`4m6L&l/#''ccu=jh4dZ VXAd0HPկPuu]mPQQQ .@"ʴZ-bbbPPP`UUU!##`0Z8wqIڛf8q{c`2YYYÑ#Gp]G UKK 6oތ 6Yc\gg'?x"99n$*++1== ػw/ݻt@RVa4 8uqQDEE9:,s|[ ֮];ou000GYYM Ν;mkjjp}}5N>DH$Ibvv6z{{i&H$apL&z+ͤr"avBaa~ss3$ 4-K^P*ʕ+q G0/Q*^e;<<ׯ#//044$*7|}}!PTT$/^ū Pfo?rssqaܼyՅ$rdffqe(󑘘(/&&mmm0Gpp0<Nܾ}O<455!..o޼rtHÎWk׮Q@@IRZ~=yxxPff&`-[PXXњ5kHR X,DDtU󣈈JHcccDDtYJAޔg!!!`0,8o֫ir3jllQd2QKK }?~LrFGGATfիWuS&&&z_"/ѣGFR#ᷕrtww/us3g90rp9 Apg˒Yrr<@AA{>?G#-- $a0rp9 \.Àa0rp9 \.Àa0rp9 \.Àa`ήRWZqFaC,ZC] ˙Eoںpf..!vr~Z.rNOCP(9)i] nmG<T*cL*+;Ulu$^^h Uqpm9f)*JH|wHjSSBx,NzFB1rsEwr-ee!9ٝ)p8=7پRQ<==aZ1fNx3>nztm}Uo[]YBT?ۇѱ1Fe?'q[rû4Z]3 ?G^oOS~Àa0rp9 |(-/!_33Gպ"mwestz?Xp9 fC̯kʏV*IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.Structure-class.html0000644000175000017500000002573414062764462025202 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.Structure
Package petsc4py :: Module PETSc :: Class Mat :: Class Structure
[hide private]
[frames] | no frames]

Class Structure


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DIFFERENT = 0
  DIFFERENT_NONZERO_PATTERN = 0
  DIFFERENT_NZ = 0
  SAME = 2
  SAME_NONZERO_PATTERN = 2
  SAME_NZ = 2
  SUBSET = 1
  SUBSET_NONZERO_PATTERN = 1
  SUBSET_NZ = 1
  UNKNOWN = 3
  UNKNOWN_NONZERO_PATTERN = 3
  UNKNOWN_NZ = 3
  __qualname__ = 'MatStructure'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMStag.StencilLocation-class.html0000644000175000017500000003625214062764460026665 0ustar balaybalay00000000000000 petsc4py.PETSc.DMStag.StencilLocation
Package petsc4py :: Module PETSc :: Class DMStag :: Class StencilLocation
[hide private]
[frames] | no frames]

Class StencilLocation


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BACK = 5
  BACK_DOWN = 2
  BACK_DOWN_LEFT = 1
  BACK_DOWN_RIGHT = 3
  BACK_LEFT = 4
  BACK_RIGHT = 6
  BACK_UP = 8
  BACK_UP_LEFT = 7
  BACK_UP_RIGHT = 9
  DOWN = 11
  DOWN_LEFT = 10
  DOWN_RIGHT = 12
  ELEMENT = 14
  FRONT = 23
  FRONT_DOWN = 20
  FRONT_DOWN_LEFT = 19
  FRONT_DOWN_RIGHT = 21
  FRONT_LEFT = 22
  FRONT_RIGHT = 24
  FRONT_UP = 26
  FRONT_UP_LEFT = 25
  FRONT_UP_RIGHT = 27
  LEFT = 13
  NULLLOC = 0
  RIGHT = 15
  UP = 17
  UP_LEFT = 16
  UP_RIGHT = 18
  __qualname__ = 'DMStagStencilLocation'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/epydoc.css0000644000175000017500000003722714062764457020003 0ustar balaybalay00000000000000 /* Epydoc CSS Stylesheet * * This stylesheet can be used to customize the appearance of epydoc's * HTML output. * */ /* Default Colors & Styles * - Set the default foreground & background color with 'body'; and * link colors with 'a:link' and 'a:visited'. * - Use bold for decision list terms. * - The heading styles defined here are used for headings *within* * docstring descriptions. All headings used by epydoc itself use * either class='epydoc' or class='toc' (CSS styles for both * defined below). */ body { background: #ffffff; color: #000000; } p { margin-top: 0.5em; margin-bottom: 0.5em; } a:link { color: #0000ff; } a:visited { color: #204080; } dt { font-weight: bold; } h1 { font-size: +140%; font-style: italic; font-weight: bold; } h2 { font-size: +125%; font-style: italic; font-weight: bold; } h3 { font-size: +110%; font-style: italic; font-weight: normal; } code { font-size: 100%; } /* N.B.: class, not pseudoclass */ a.link { font-family: monospace; } /* Page Header & Footer * - The standard page header consists of a navigation bar (with * pointers to standard pages such as 'home' and 'trees'); a * breadcrumbs list, which can be used to navigate to containing * classes or modules; options links, to show/hide private * variables and to show/hide frames; and a page title (using *

). The page title may be followed by a link to the * corresponding source code (using 'span.codelink'). * - The footer consists of a navigation bar, a timestamp, and a * pointer to epydoc's homepage. */ h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; } h2.epydoc { font-size: +130%; font-weight: bold; } h3.epydoc { font-size: +115%; font-weight: bold; margin-top: 0.2em; } td h3.epydoc { font-size: +115%; font-weight: bold; margin-bottom: 0; } table.navbar { background: #a0c0ff; color: #000000; border: 2px groove #c0d0d0; } table.navbar table { color: #000000; } th.navbar-select { background: #70b0ff; color: #000000; } table.navbar a { text-decoration: none; } table.navbar a:link { color: #0000ff; } table.navbar a:visited { color: #204080; } span.breadcrumbs { font-size: 85%; font-weight: bold; } span.options { font-size: 70%; } span.codelink { font-size: 85%; } td.footer { font-size: 85%; } /* Table Headers * - Each summary table and details section begins with a 'header' * row. This row contains a section title (marked by * 'span.table-header') as well as a show/hide private link * (marked by 'span.options', defined above). * - Summary tables that contain user-defined groups mark those * groups using 'group header' rows. */ td.table-header { background: #70b0ff; color: #000000; border: 1px solid #608090; } td.table-header table { color: #000000; } td.table-header table a:link { color: #0000ff; } td.table-header table a:visited { color: #204080; } span.table-header { font-size: 120%; font-weight: bold; } th.group-header { background: #c0e0f8; color: #000000; text-align: left; font-style: italic; font-size: 115%; border: 1px solid #608090; } /* Summary Tables (functions, variables, etc) * - Each object is described by a single row of the table with * two cells. The left cell gives the object's type, and is * marked with 'code.summary-type'. The right cell gives the * object's name and a summary description. * - CSS styles for the table's header and group headers are * defined above, under 'Table Headers' */ table.summary { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; margin-bottom: 0.5em; } td.summary { border: 1px solid #608090; } code.summary-type { font-size: 85%; } table.summary a:link { color: #0000ff; } table.summary a:visited { color: #204080; } /* Details Tables (functions, variables, etc) * - Each object is described in its own div. * - A single-row summary table w/ table-header is used as * a header for each details section (CSS style for table-header * is defined above, under 'Table Headers'). */ table.details { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; margin: .2em 0 0 0; } table.details table { color: #000000; } table.details a:link { color: #0000ff; } table.details a:visited { color: #204080; } /* Fields */ dl.fields { margin-left: 2em; margin-top: 1em; margin-bottom: 1em; } dl.fields dd ul { margin-left: 0em; padding-left: 0em; } dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; } div.fields { margin-left: 2em; } div.fields p { margin-bottom: 0.5em; } /* Index tables (identifier index, term index, etc) * - link-index is used for indices containing lists of links * (namely, the identifier index & term index). * - index-where is used in link indices for the text indicating * the container/source for each link. * - metadata-index is used for indices containing metadata * extracted from fields (namely, the bug index & todo index). */ table.link-index { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; } td.link-index { border-width: 0px; } table.link-index a:link { color: #0000ff; } table.link-index a:visited { color: #204080; } span.index-where { font-size: 70%; } table.metadata-index { border-collapse: collapse; background: #e8f0f8; color: #000000; border: 1px solid #608090; margin: .2em 0 0 0; } td.metadata-index { border-width: 1px; border-style: solid; } table.metadata-index a:link { color: #0000ff; } table.metadata-index a:visited { color: #204080; } /* Function signatures * - sig* is used for the signature in the details section. * - .summary-sig* is used for the signature in the summary * table, and when listing property accessor functions. * */ .sig-name { color: #006080; } .sig-arg { color: #008060; } .sig-default { color: #602000; } .summary-sig { font-family: monospace; } .summary-sig-name { color: #006080; font-weight: bold; } table.summary a.summary-sig-name:link { color: #006080; font-weight: bold; } table.summary a.summary-sig-name:visited { color: #006080; font-weight: bold; } .summary-sig-arg { color: #006040; } .summary-sig-default { color: #501800; } /* Subclass list */ ul.subclass-list { display: inline; } ul.subclass-list li { display: inline; } /* To render variables, classes etc. like functions */ table.summary .summary-name { color: #006080; font-weight: bold; font-family: monospace; } table.summary a.summary-name:link { color: #006080; font-weight: bold; font-family: monospace; } table.summary a.summary-name:visited { color: #006080; font-weight: bold; font-family: monospace; } /* Variable values * - In the 'variable details' sections, each varaible's value is * listed in a 'pre.variable' box. The width of this box is * restricted to 80 chars; if the value's repr is longer than * this it will be wrapped, using a backslash marked with * class 'variable-linewrap'. If the value's repr is longer * than 3 lines, the rest will be ellided; and an ellipsis * marker ('...' marked with 'variable-ellipsis') will be used. * - If the value is a string, its quote marks will be marked * with 'variable-quote'. * - If the variable is a regexp, it is syntax-highlighted using * the re* CSS classes. */ pre.variable { padding: .5em; margin: 0; background: #dce4ec; color: #000000; border: 1px solid #708890; } .variable-linewrap { color: #604000; font-weight: bold; } .variable-ellipsis { color: #604000; font-weight: bold; } .variable-quote { color: #604000; font-weight: bold; } .variable-group { color: #008000; font-weight: bold; } .variable-op { color: #604000; font-weight: bold; } .variable-string { color: #006030; } .variable-unknown { color: #a00000; font-weight: bold; } .re { color: #000000; } .re-char { color: #006030; } .re-op { color: #600000; } .re-group { color: #003060; } .re-ref { color: #404040; } /* Base tree * - Used by class pages to display the base class hierarchy. */ pre.base-tree { font-size: 80%; margin: 0; } /* Frames-based table of contents headers * - Consists of two frames: one for selecting modules; and * the other listing the contents of the selected module. * - h1.toc is used for each frame's heading * - h2.toc is used for subheadings within each frame. */ h1.toc { text-align: center; font-size: 105%; margin: 0; font-weight: bold; padding: 0; } h2.toc { font-size: 100%; font-weight: bold; margin: 0.5em 0 0 -0.3em; } /* Syntax Highlighting for Source Code * - doctest examples are displayed in a 'pre.py-doctest' block. * If the example is in a details table entry, then it will use * the colors specified by the 'table pre.py-doctest' line. * - Source code listings are displayed in a 'pre.py-src' block. * Each line is marked with 'span.py-line' (used to draw a line * down the left margin, separating the code from the line * numbers). Line numbers are displayed with 'span.py-lineno'. * The expand/collapse block toggle button is displayed with * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not * modify the font size of the text.) * - If a source code page is opened with an anchor, then the * corresponding code block will be highlighted. The code * block's header is highlighted with 'py-highlight-hdr'; and * the code block's body is highlighted with 'py-highlight'. * - The remaining py-* classes are used to perform syntax * highlighting (py-string for string literals, py-name for names, * etc.) */ pre.py-doctest { padding: .5em; margin: 1em; background: #e8f0f8; color: #000000; border: 1px solid #708890; } table pre.py-doctest { background: #dce4ec; color: #000000; } pre.py-src { border: 2px solid #000000; background: #f0f0f0; color: #000000; } .py-line { border-left: 2px solid #000000; margin-left: .2em; padding-left: .4em; } .py-lineno { font-style: italic; font-size: 90%; padding-left: .5em; } a.py-toggle { text-decoration: none; } div.py-highlight-hdr { border-top: 2px solid #000000; border-bottom: 2px solid #000000; background: #d8e8e8; } div.py-highlight { border-bottom: 2px solid #000000; background: #d0e0e0; } .py-prompt { color: #005050; font-weight: bold;} .py-more { color: #005050; font-weight: bold;} .py-string { color: #006030; } .py-comment { color: #003060; } .py-keyword { color: #600000; } .py-output { color: #404040; } .py-name { color: #000050; } .py-name:link { color: #000050 !important; } .py-name:visited { color: #000050 !important; } .py-number { color: #005000; } .py-defname { color: #000060; font-weight: bold; } .py-def-name { color: #000060; font-weight: bold; } .py-base-class { color: #000060; } .py-param { color: #000060; } .py-docstring { color: #006030; } .py-decorator { color: #804020; } /* Use this if you don't want links to names underlined: */ /*a.py-name { text-decoration: none; }*/ /* Graphs & Diagrams * - These CSS styles are used for graphs & diagrams generated using * Graphviz dot. 'img.graph-without-title' is used for bare * diagrams (to remove the border created by making the image * clickable). */ img.graph-without-title { border: none; } img.graph-with-title { border: 1px solid #000000; } span.graph-title { font-weight: bold; } span.graph-caption { } /* General-purpose classes * - 'p.indent-wrapped-lines' defines a paragraph whose first line * is not indented, but whose subsequent lines are. * - The 'nomargin-top' class is used to remove the top margin (e.g. * from lists). The 'nomargin' class is used to remove both the * top and bottom margin (but not the left or right margin -- * for lists, that would cause the bullets to disappear.) */ p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em; margin: 0; } .nomargin-top { margin-top: 0; } .nomargin { margin-top: 0; margin-bottom: 0; } /* HTML Log */ div.log-block { padding: 0; margin: .5em 0 .5em 0; background: #e8f0f8; color: #000000; border: 1px solid #000000; } div.log-error { padding: .1em .3em .1em .3em; margin: 4px; background: #ffb0b0; color: #000000; border: 1px solid #000000; } div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; background: #ffffb0; color: #000000; border: 1px solid #000000; } div.log-info { padding: .1em .3em .1em .3em; margin: 4px; background: #b0ffb0; color: #000000; border: 1px solid #000000; } h2.log-hdr { background: #70b0ff; color: #000000; margin: 0; padding: 0em 0.5em 0em 0.5em; border-bottom: 1px solid #000000; font-size: 110%; } p.log { font-weight: bold; margin: .5em 0 .5em 0; } tr.opt-changed { color: #000000; font-weight: bold; } tr.opt-default { color: #606060; } pre.log { margin: 0; padding: 0; padding-left: 1em; } petsc4py-3.15.1/docs/apiref/class_hierarchy_for_mode.png0000644000175000017500000000205314062764465023515 0ustar balaybalay00000000000000PNG  IHDRA$YbKGDIDATXc?L*Q?  [HV;{8 B xKROoUw7]D2X{R4ᐖF08~cJJR}=x ))/߾%Ɛy6/YBո~p̙6=z.Ǐ+W8sǯ_r[j5.@fZ2\{7Q-%%*9dl%޽(6]woW!܏_t/Xp-9 H EE/^t-XKGS6߿',]zEM%(OO2Cf|us;z´+! :꒞~}2CfnolE3>o<{LG_'._WS-tu!ׯ>k|/~7U99߿߸__QZsWVZjժP 9`˝llp6=R6B(" " )"TImAF08Rt) c`'/_bqh?V0aX>IENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_exactfinal.png0000644000175000017500000000303614062764464024710 0ustar balaybalay00000000000000PNG  IHDR{$E]bKGDIDATx}Py_iW\Mю"nh9'%[ҡsZ1!ƅLytcCd W&8 uV%*i?!~ k7~?hhhh@B o+0"B2[L4 mj_6E"Bf OOsjG3i')6 âO}2."$Ed0Y]t4EEMڷ`|)Z 22߶owFDplǓ:ۓ׷8_k Y.ٽ;~?V."K~=!S֬:v'Ekj8E0v>Gpef`me%H@Jj4B{%0K>HF#\ą wYicBC Xq+*Xy3/Xx=x+WRz.a11>w @Ee%~d2MglX{4ۜedd0!!=zpxokё/j . \qшFpFW\;cNGeUUc̺zA56 &xٙիٗ&H|fvΝ|ڤ..fz:@ag3**ԍMN˘1t}8.II3WXFWWqY^KѨTx__zq)B^f<>ԉ’>׏ķxC jS/VKJJʳ] bB2[DHfl!-"$Ed0yS%3')KSD+cⲲfAxqdfK~f"_9̊QOIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_comm.png0000644000175000017500000000156314062764457023532 0ustar balaybalay00000000000000PNG  IHDRH$1bKGD(IDATXc?pLZQ 5add(wP ## @F\RON!t˗hX%zzzOH,`` +?=`%۔)ocxhhj*%ԁ۔)% #'8>0:@|i|P'!mKeUT֮eܵK%[|ω&FF :^ZUsMtHU_ ۶JM)̠++ffl݊ 䗔]"|F=Cg.\/)1((+/AA-mmeop8*i$&)'`Y .7gWTԃs,.ct$^N{=*/]Rpℙqʙ3ho@|e`pn^}]kH9 K-ի^nn啑|9ͼ}ae%km=s[]޶{ѱ?-Ϸ05 e2%Ri-<D C"<{V,Dx?mgmG\p+j(/^|';Xaaʻ-[n~%z߾11\6[P]U[rB:%ILUHā2D;k ꮗ[Um7o@PRXWdD$Y[k֖f@RfcKּz.*yh K㽣bc*&YWT͛0~_LLvQj(@12J~~lr2t%%cZ#}07XaCD3"y]ڻJe˄+t_64 vXXCSS7_ zRhP}PKutd"qټ[6.[v}12V,֣PF'+7W*8\ϟOTTmsf<]]\=<ݝ3cɬ rxSS$NRZZTiƒkrrzq9(; 7oёpȅ$m]r?V^G&8.U 3{sW]NqX'i' r}>|:5734%Nm\K8n`4/(dZ,/|^_?!:{Ԭ\c-!2jA`δiGy >-6~I LvKN~![iM͌ɓ cH1r^v"ߙ3};wϚ!hlmDZa0Գׯk.xfj4K$j@O?Z{zzmF,D$߻]*-8YL"2GoW+ѣQg={{wBd1j;R[UDMfHJ巇 ID̙1LssSǧm=tݻcЬc낂`k˗=F,x ɒO٨:H"ܢK{E0ɩKDb`Xhkv3sc%1Z׉D*fRXX-"慇Ke2T59vhFR{(ر z p%mK_yhzy$&3y&p+:^$\x1%Ξ}+OA%HN_:ghX'폍%ql;y3֭ܨ񦦂91͝f58CC#OlIU {t+:][DRLE6OFi~B8OxXRU%ɐ)\sޞL$v>y0qJьɓջZ(T*,,z]* tndzuttzzzx<-+ngWPZRp85> *@_,, tu@PZQ1it:N*=Zc/ Ӛ#KMUU[`cZ۫B8CCdTQ;Ϗ}8hu]Ti#u0BiUվ~֧m^v8!kA/BYNN:tA{VX` +*ϊCCSO {&ތ¶ ΉX``u_qXĀIrIENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DMDA.ElementType-class.html0000644000175000017500000002042214062764460025404 0ustar balaybalay00000000000000 petsc4py.PETSc.DMDA.ElementType
Package petsc4py :: Module PETSc :: Class DMDA :: Class ElementType
[hide private]
[frames] | no frames]

Class ElementType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  P1 = 0
  Q1 = 1
  __qualname__ = 'DMDAElementType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.DM.Type-class.html0000644000175000017500000003244514062764457023703 0ustar balaybalay00000000000000 petsc4py.PETSc.DM.Type
Package petsc4py :: Module PETSc :: Class DM :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  COMPOSITE = 'composite'
  DA = 'da'
  FOREST = 'forest'
  MOAB = 'moab'
  NETWORK = 'network'
  P4EST = 'p4est'
  P8EST = 'p8est'
  PATCH = 'patch'
  PLEX = 'plex'
  PRODUCT = 'product'
  REDUNDANT = 'redundant'
  SHELL = 'shell'
  SLICED = 'sliced'
  STAG = 'stag'
  SWARM = 'swarm'
  __qualname__ = 'DMType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_viewer.png0000644000175000017500000000756514062764465024107 0ustar balaybalay00000000000000PNG  IHDRkĶFsbKGD*IDATxyPgǿ2\RB8$h9#J`6*QS[ViO5ī\֐xTeL$ f9"TFDCCy~Da"4̫離yv"""pXH3p,bP+ ?^D"\$YYY[D* KVVЇY,e1\C蝬N߿˖-C\\l\^VV?ؖ{;蕬̚5 3BBB 퍌 @SSDr?>TUU yv5BCC)..4ʥR)3)''t>SQQѠb^eDrc޽044ؖ xb|g ;w… a\|Y܌#&&k׮ESS`ٲeի+Ⱥt0u~vuu5֭[08;;c…8~8QPPJE^^add\~]]]B@RRr96m„ f̞={X>P{68Xaaau%bE"v ϟٳgP(>z7oFTT qaH]|9ݻfffB YnnnW}/RUUOOOJcJ"..N]VWWsss\|q!33SWC 닞H>O[ZZpl߾CͰ(;v,ܰ~r###>|w(/,,&M!&L[bʕV;555X`<==P*ؽ{74 իW WWWaŊBxx8N>7nd2ϟ6u|OO0zu| YYY M2 (%%J%䐻; ?BBBÇ@ɓ'DDt!233#211(joo'";v yxxX,۷N#xTd=֭[tzFySS]tz{{ʕ+T]],"V*//TZZJ<(RjllpCY/bgg;;>;wwwm>H$H$Rǧ6ƏYf)4z3g /"((qqq#A3kxzzv!(͙&e1\CpY !ϭ:B7rScctvu!+-E}C}|PT" ffxZ::oM,@_5 3f@Oÿ{"7OرGV(`2n"EVn.ؿq#45a071AJlK`Qл%ED`eS´|^XN}=nO?E xd2T+vsCqŕ{iwCBֆ`IoSS1>t)mlwZyn}]20ɸqOL07i"H&DZzC8=stބޝYpY e1\CpY e1٧n⍁Y !ș'D%%%B]cY4=krr2LMMaee^N< YVLL z{{Q?SCmJp6mڄk׮A.hlloÆ vƲo>͛7BThoȲ TQh;* ى/겒444ϝ;wWk/Q*bl߾ӦM_|1ป7o2L@'sVrr2N8'OT*N8WS*?zSNaԩHNN#VX"֭[Bo߾lݺގsݻZ㛚`رuUj,Jr@cFYYF͛7ۋ&477#** prrB|||)i0tvveggٳgԔ:::HPѣHT9>>k.JOO@"" GGGruu%"\h'})SbjjJVRoSzzzPUUL&#"Z]v X͗b1>D3Ͼyyy066 QQQ{NBdd$сBYw{Hk8?#6g ג/EZ[[a4U3LMM₂x{{lll|ryΒ$%%!&&>2>(QTTlذsAAAvZܽ{Wk3,u Wq@4|ޮLVPP̐Frabb#Gܟ>}Z=dddNNN7o?K.!44EEE"H'cR(ıcsNr&c...WL-Z;v )) F$0!66K.EUU>sdd$Ñ7o6n܈`4~(TTTGoo/nܸ/{!Hx$&&B&o:J'K,9QF>>>Ȁ\.Ǚ3g0|8̙31|4^,#((H~~~8qbzxx`ڴiYfGzz:\Tdffj͜9S7---!LtuuA&᭷ F8ÀWb.!,b.!>Ʉo2 B>g-G;666Zk}5gf .!, petsc4py.PETSc.DMPlex
Package petsc4py :: Module PETSc :: Class DMPlex
[hide private]
[frames] | no frames]

Class DMPlex


Nested Classes [hide private]

Inherited from DM: BoundaryType, Type

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(S, ...)
 
computeCellGeometryFVM(self, cell)
 
constructGhostCells(self, labelName=None)
 
create(self, comm=None)
 
createBoxMesh(self, faces, lower=(0, 0, 0), upper=(1, 1, 1), simplex=True, periodic=False, interpolate=True, comm=None)
 
createCGNS(self, cgid, interpolate=True, comm=None)
 
createCGNSFromFile(self, filename, interpolate=True, comm=None)
 
createClosureIndex(self, Section sec)
 
createCoarsePointIS(self)
 
createCohesiveSubmesh(self, hasLagrange, value)
 
createCubeBoundary(self, lower, upper, faces)
 
createExodus(self, exoid, interpolate=True, comm=None)
 
createExodusFromFile(self, filename, interpolate=True, comm=None)
 
createFromCellList(self, dim, cells, coords, interpolate=True, comm=None)
 
createFromFile(self, filename, interpolate=True, comm=None)
 
createGmsh(self, Viewer viewer, interpolate=True, comm=None)
 
createPointNumbering(self)
 
createSection(self, numComp, numDof, bcField=None, bcComps=None, bcPoints=None, IS perm=None)
 
createSquareBoundary(self, lower, upper, edges)
 
distribute(self, overlap=0)
 
distributeField(self, SF sf, Section sec, Vec vec, Section newsec=None, Vec newvec=None)
 
distributeOverlap(self, overlap=0)
 
generate(self, DMPlex boundary, name=None, interpolate=True)
 
getAdjacency(self, p)
 
getAdjacencyUseAnchors(self)
 
getCellNumbering(self)
 
getChart(self)
 
getCone(self, p)
 
getConeOrientation(self, p)
 
getConeSize(self, p)
 
getDepth(self)
 
getDepthStratum(self, svalue)
 
getHeightStratum(self, svalue)
 
getJoin(self, points)
 
getMaxSizes(self)
 
getMeet(self, points)
 
getOrdering(self, otype)
 
getPartitioner(self)
 
getPointGlobal(self, point)
 
getPointGlobalField(self, point, field)
 
getPointLocal(self, point)
 
getPointLocalField(self, point, field)
 
getRefinementLimit(self)
 
getRefinementUniform(self)
 
getSupport(self, p)
 
getSupportSize(self, p)
 
getTransitiveClosure(self, p, useCone=True)
 
getVecClosure(self, Section sec, Vec vec, point)
 
getVertexNumbering(self)
 
insertCone(self, p, conePos, conePoint)
 
insertConeOrientation(self, p, conePos, coneOrientation)
 
interpolate(self)
 
isDistributed(self)
 
markBoundaryFaces(self, label, value=None)
 
orient(self)
 
permute(self, IS perm)
 
rebalanceSharedPoints(self, entityDepth=0, useInitialGuess=True, parallel=True)
 
setAdjacencyUseAnchors(self, useAnchors=True)
 
setChart(self, pStart, pEnd)
 
setCone(self, p, cone, orientation=None)
 
setConeOrientation(self, p, orientation)
 
setConeSize(self, p, size)
 
setMatClosure(self, Section sec, Section gsec, Mat mat, point, values, addv=None)
 
setPartitioner(self, Partitioner part)
 
setRefinementLimit(self, refinementLimit)
 
setRefinementUniform(self, refinementUniform=True)
 
setSupport(self, p, supp)
 
setSupportSize(self, p, size)
 
setTetGenOptions(self, opts)
 
setTriangleOptions(self, opts)
 
setVecClosure(self, Section sec, Vec vec, point, values, addv=None)
 
stratify(self)
 
symmetrize(self)
 
uninterpolate(self)
 
vecGetClosure(self, Section sec, Vec vec, p)

Inherited from DM: adaptLabel, adaptMetric, addCoarsenHook, addField, clearDS, clearLabelStratum, clearLabelValue, clone, coarsen, coarsenHierarchy, convert, copyDS, copyDisc, copyFields, createDS, createDefaultSF, createFieldDecomposition, createGlobalVec, createGlobalVector, createInjection, createInterpolation, createLabel, createLocalVec, createLocalVector, createMat, createMatrix, createRestriction, createSectionSF, destroy, getAppCtx, getBasicAdjacency, getBlockSize, getBoundingBox, getCoarsenLevel, getCoordinateDM, getCoordinateDim, getCoordinateSection, getCoordinates, getCoordinatesLocal, getDS, getDefaultGlobalSection, getDefaultSF, getDefaultSection, getDimension, getField, getFieldAdjacency, getGlobalSection, getGlobalVec, getLGMap, getLabel, getLabelIdIS, getLabelName, getLabelOutput, getLabelSize, getLabelValue, getLocalBoundingBox, getLocalVec, getMatrix, getNumFields, getNumLabels, getPointSF, getRefineLevel, getSection, getSectionSF, getStratumIS, getStratumSize, getType, globalToLocal, hasLabel, load, localToGlobal, localToLocal, localizeCoordinates, refine, refineHierarchy, removeLabel, restoreGlobalVec, restoreLocalVec, setAppCtx, setBasicAdjacency, setCoordinateDim, setCoordinates, setCoordinatesLocal, setDefaultGlobalSection, setDefaultSF, setDefaultSection, setDimension, setField, setFieldAdjacency, setFromOptions, setGlobalSection, setKSPComputeOperators, setLabelOutput, setLabelValue, setMatType, setNumFields, setOptionsPrefix, setPointSF, setRefineLevel, setSNESFunction, setSNESJacobian, setSection, setSectionSF, setType, setUp, setVecType, view, viewFromOptions

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setName, setTabLevel, stateIncrease

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from DM: appctx, ds

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

create(self, comm=None)

 
Overrides: DM.create

petsc4py-3.15.1/docs/apiref/module-tree.html0000644000175000017500000001076614062764457021115 0ustar balaybalay00000000000000 Module Hierarchy
 
[hide private]
[frames] | no frames]
[ Module Hierarchy | Class Hierarchy ]

Module Hierarchy

  • petsc4py: This package is an interface to PETSc libraries.
    • petsc4py.PETSc: Portable, Extensible Toolkit for Scientific Computation
    • petsc4py.lib: Extension modules for different PETSc configurations.
petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.InfoType-class.html0000644000175000017500000002101514062764462024723 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.InfoType
Package petsc4py :: Module PETSc :: Class Mat :: Class InfoType
[hide private]
[frames] | no frames]

Class InfoType


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  GLOBAL_MAX = 2
  GLOBAL_SUM = 3
  LOCAL = 1
  __qualname__ = 'MatInfoType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_sortype.png0000644000175000017500000000317314062764462024277 0ustar balaybalay00000000000000PNG  IHDRY$mbKGD0IDATh{LSwO "ub)+,)P[0C!xQt†F0( <6"L0Wx8@ZdJ?nҒRQ0[?z~;b$ jB K,aϲ KWׅ &e%o3*ѱܹ9ҪQR[ۜ gT_#2ZPk!CAG$Iy}}Ecpmtvn~-O h4 KMC dbNKkꒋbl`mK-gfUTslξ>={RS}\]`pt40>^d=ho2$#\h673 ~{;+6.'xkqAi-b 7@ޔ &9fݺT-MM\R[yT h -[:z{2E-b <ׇjNN ɼZV^Ppȑ廑MM544:mHqqY]`euA@ @q~a!ɓ--C[[+;5X^TԱ S?poenN21[Vc @VdrfQ:{۷٥ ||͹qqMM_f㴴|cb TwܺysIMM]KK눱qFb?Z 0[oJ @++`A$.:0?u [Z;l, 3/ngssݻYY7ϞU6/ ለΞz0oG/_34D@oP6Dsr||8#u"riiGoƱ y ZԵD:5RS`@G[C^˗E"QqMM_8=]pNGK2jhhlmUlc2O_`eE%A)DF xmm;*2']3e>7?.Z\EǢ"ȑF[K$޻7̙zX }hȀQdR(|_,6׮q8RP]Z 33o`{]BAvgVsKKKki'֖D>8ݻrF:݃NH?ݺXyZPk!C #x1FXBu!C 2pH'bIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_is.png0000644000175000017500000000352114062764461023201 0ustar balaybalay00000000000000PNG  IHDRG[!bKGDIDATxoHTYǿ6Z1Xaf؋`rcmԅ1{О"zvmw#1 vMd{p zQISJcls̚va9sv/Ϟ;ϜsϽ9*""pf!wJa0n񠽽]\dpfj1 Êj ۛ=Àa0LGCCJJJ`Xp\`yWWv=ԔTH$rn:PRROW\, >Z `n7|fjJܹs'ׯ_`ٻr&&&;?:;;ixx8$FGG;*R%rdddb 22RtB=[EѣGr1+%0rp9 ag+J!P$3䤧3@mm,2l6lݺ Isp9 \.Àa0rp9 \.Àa0rp9 \.Àa0r^x!:7nv躀.D#vf}glȿ`RH`rQ kHY8؈^TadeIY地_*i}|X1rp9 dSݡ! >23[Zoޔ+= 9ڳq11 ܱQ2m}t +DD͛=8S.4YRd)lSPy}+/5/E e ,̄e~hj0>.k^,,UXբn6ofrR,B go-/E eǏψ qѶ"Ӊ/N:'|M<ɄAJp9 \.Àa sNaY9 D+VHQi·Nr ͂?nFqBIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_scattermod.png0000644000175000017500000000347114062764464024742 0ustar balaybalay00000000000000PNG  IHDRk$ĵbKGDIDATh}T?Hh)PAL }BU$ U H4d(nv<I;?jcwxqպsZ #S8_ZE(df,fs99_}O͓'&Ʉ=P2V 0t,{pJ5̲#Dq zZ29fQgEuBB2hGfYv5k8L&TTpozB&Nd̙8ÏF))}|8cǠ|}T_HaN<<5G&=)iGFdfXӓy0LĭYC6×7nX bqTPx*+qgg&&rMz^HHUL ΟEE#ub"()-GI~f&q?HwYX};mmJ$f*,Y,FTޑ#t*8DLJqHpH,׳gi,-e+(tvw5XHDHF#m?c?$O&//ν{CH|L _!{{Si'P=E66e;R2j2j l+(`Qz: ~ūW>yG/`?yy|@Sk+]]C:ZD"~a'goRރIOJ,U*-_ܸGhnSMf[٬jRv[347yر= TUQpfk4ܹwsWR/wwjjkԄqlqgr5z&2A*e8PͣbFFLJӦQuy?&6<9 %ee\Xt:JJKm3TlY UZ-7_Xˋco$Ih}e&Ht^? \y3qDNƼ<K]~fbAq-ľ*?HKH@P*䦧mHFLƍ&DGr"GbM|zΝ;n'::͛j%..5kˉR{ѣ{-NhGqԷX,|'8mmmeݺu$&&jNmm-hZ&NR4@PPeNϜ9Vh4:b/_fȑ={N{シ{JuWqfիlܸfb ''/:ŋ _.9LJ 6xb<8TWW3{l"""HKKݻwNff&NPYYIss3'Ofĉ<撐Ç8}4\vͱ7ڏT#{~~~K777&B狩SP*F%zhii 6M!DvvK$&&!o]lܸёCBBl6O2,9TY$PeIʒ@%*KU, TY$PeIʒ@%*KU, TY$PeIʒ@%*KU, \~<{7S4QӦw2!Aʊ*k?&a@[QC TY$PDGO?\u5)+VWT))0n޺&2Iglz:H.*/fG֥:.͍ f^HMeݎܺե鯾r]ijBd,\8_ dر$.Y?zQ^#S8qf͘j Ȫmhן{Υ̠qb^܇}  czرf̟5۶pb!.=5k9s& ۱q.*1c[[ilm%hxdMnshik3۪?/[Ƽ={([BPq~ 9xf"PYutolc۹h4Uw s߈:9o/7z4>>==K+ҟ5%8 \tv](/GǙ3]I#=JO"b"RR>w.koǭ*c)\ThPY);ۥr}=rH:l6?STg;PE6oƷ7j[/\`B/Pl6lmo)6ۛի /Fjb"cnj v1ץF1>oӧ3id1l0lv;6:t \d'6K|K;K C@1Y[%Vw(99޶G?9|UUB*?㥅 {,bųɬJO'ؼ|9S￟ L;ann<Ēyڝ7 ~[SXXy3& Y4of2;Ϣ~U&cU'MbJ@ʒ@%*K^/J *ߣ, \Fd<.!!z#*K>upNj{IENDB`petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.Mat.Type-class.html0000644000175000017500000011457014062764462024120 0ustar balaybalay00000000000000 petsc4py.PETSc.Mat.Type
Package petsc4py :: Module PETSc :: Class Mat :: Class Type
[hide private]
[frames] | no frames]

Class Type


Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  AIJ = 'aij'
  AIJCRL = 'aijcrl'
  AIJCUSPARSE = 'aijcusparse'
  AIJMKL = 'aijmkl'
  AIJPERM = 'aijperm'
  AIJSELL = 'aijsell'
  AIJVIENNACL = 'aijviennacl'
  BAIJ = 'baij'
  BAIJMKL = 'baijmkl'
  BLOCKMAT = 'blockmat'
  COMPOSITE = 'composite'
  CONSTANTDIAGONAL = 'constantdiagonal'
  DENSE = 'dense'
  DUMMY = 'dummy'
  ELEMENTAL = 'elemental'
  FFT = 'fft'
  FFTW = 'fftw'
  HARA = 'hara'
  HYPRE = 'hypre'
  HYPRESSTRUCT = 'hypresstruct'
  HYPRESTRUCT = 'hyprestruct'
  IS = 'is'
  KAIJ = 'kaij'
  LMVM = 'lmvm'
  LMVMBADBROYDEN = 'lmvmbadbroyden'
  LMVMBFGS = 'lmvmbfgs'
  LMVMBROYDEN = 'lmvmbroyden'
  LMVMDFP = 'lmvmdfp'
  LMVMDIAGBBROYDEN = 'lmvmdiagbroyden'
  LMVMSR1 = 'lmvmsr1'
  LMVMSYMBADBROYDEN = 'lmvmsymbadbroyden'
  LMVMSYMBROYDEN = 'lmvmsymbroyden'
  LOCALREF = 'localref'
  LRC = 'lrc'
  MAIJ = 'maij'
  MFFD = 'mffd'
  MPIADJ = 'mpiadj'
  MPIAIJ = 'mpiaij'
  MPIAIJCRL = 'mpiaijcrl'
  MPIAIJCUSPARSE = 'mpiaijcusparse'
  MPIAIJMKL = 'mpiaijmkl'
  MPIAIJPERM = 'mpiaijperm'
  MPIAIJSELL = 'mpiaijsell'
  MPIAIJVIENNACL = 'mpiaijviennacl'
  MPIBAIJ = 'mpibaij'
  MPIBAIJMKL = 'mpibaijmkl'
  MPIDENSE = 'mpidense'
  MPIKAIJ = 'mpikaij'
  MPIMAIJ = 'mpimaij'
  MPISBAIJ = 'mpisbaij'
  MPISELL = 'mpisell'
  NEST = 'nest'
  NORMAL = 'normal'
  NORMALHERMITIAN = 'normalh'
  PREALLOCATOR = 'preallocator'
  PYTHON = 'python'
  SAME = 'same'
  SBAIJ = 'sbaij'
  SCATTER = 'scatter'
  SCHURCOMPLEMENT = 'schurcomplement'
  SELL = 'sell'
  SEQAIJ = 'seqaij'
  SEQAIJCRL = 'seqaijcrl'
  SEQAIJCUSPARSE = 'seqaijcusparse'
  SEQAIJMKL = 'seqaijmkl'
  SEQAIJPERM = 'seqaijperm'
  SEQAIJSELL = 'seqaijsell'
  SEQAIJVIENNACL = 'seqaijviennacl'
  SEQBAIJ = 'seqbaij'
  SEQBAIJMKL = 'seqbaijmkl'
  SEQCUFFT = 'seqcufft'
  SEQDENSE = 'seqdense'
  SEQDENSECUDA = 'seqdensecuda'
  SEQKAIJ = 'seqkaij'
  SEQMAIJ = 'seqmaij'
  SEQSBAIJ = 'seqsbaij'
  SEQSELL = 'seqsell'
  SHELL = 'shell'
  SUBMATRIX = 'submatrix'
  TRANSPOSEMAT = 'transpose'
  __qualname__ = 'MatType'
Properties [hide private]

Inherited from object: __class__

petsc4py-3.15.1/docs/apiref/petsc4py.PETSc.IS-class.html0000644000175000017500000012255614062764461022774 0ustar balaybalay00000000000000 petsc4py.PETSc.IS
Package petsc4py :: Module PETSc :: Class IS
[hide private]
[frames] | no frames]

Class IS


Nested Classes [hide private]
  Type
Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, *exc)
a new object with type S, a subtype of T
__new__(S, ...)
 
allGather(self)
 
complement(self, nmin, nmax)
 
copy(self, IS result=None)
 
create(self, comm=None)
 
createBlock(self, bsize, indices, comm=None)
 
createGeneral(self, indices, comm=None)
 
createStride(self, size, first=0, step=0, comm=None)
 
destroy(self)
 
difference(self, IS iset)
 
duplicate(self)
 
embed(self, IS iset, drop)
 
equal(self, IS iset)
 
expand(self, IS iset)
 
getBlockIndices(self)
 
getBlockSize(self)
 
getIndices(self)
 
getInfo(self)
 
getLocalSize(self)
 
getSize(self)
 
getSizes(self)
 
getStride(self)
 
getType(self)
 
invertPermutation(self, nlocal=None)
 
isIdentity(self)
 
isPermutation(self)
 
isSorted(self)
 
load(self, Viewer viewer)
 
renumber(self, IS mult=None)
 
setBlockIndices(self, bsize, indices)
 
setBlockSize(self, bs)
 
setIdentity(self)
 
setIndices(self, indices)
 
setPermutation(self)
 
setStride(self, size, first=0, step=1)
 
setType(self, is_type)
 
sort(self)
 
sum(self, IS iset)
 
toGeneral(self)
 
union(self, IS iset)
 
view(self, Viewer viewer=None)

Inherited from Object: __copy__, __deepcopy__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__, __nonzero__, compose, decRef, getAttr, getClassId, getClassName, getComm, getDict, getName, getOptionsPrefix, getRefCount, getTabLevel, incRef, incrementTabLevel, query, setAttr, setFromOptions, setName, setOptionsPrefix, setTabLevel, stateIncrease, viewFromOptions

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  __array_interface__
  array
  block_size
  identity
  indices
  local_size
  permutation
  size
  sizes
  sorted

Inherited from Object: classid, comm, fortran, handle, klass, name, prefix, refcount, type

Inherited from object: __class__

Method Details [hide private]

__new__(S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

destroy(self)

 
Overrides: Object.destroy

getType(self)

 
Overrides: Object.getType

view(self, Viewer viewer=None)

 
Overrides: Object.view

petsc4py-3.15.1/docs/apiref/class_hierarchy_for_options.png0000644000175000017500000000247614062764462024272 0ustar balaybalay00000000000000PNG  IHDRM$C ubKGDIDAThoLSWrӖAt`Q0Ե6N![Ќ0@Q)!E‡2 !VHT $`F@o]KKEXpchglqߧ{{9ssl x+ ޴׌BG[-;J ~L[y]<\$:ɏQTU-+ŋ2or,ܟ--? f6%MNf1pB8yֽqƝztZ2NOS{{\lk{I Z=Kz򍡡++=xȗHttds8̐MzzDJcy,9޼d׮ml45]]~¾4allNYٸ^_PQQ^Xȍ[Rɩ:48@*d,%%H (JW ܨlmM8a"=hU*55 tGw~@&3=un!&S,edh>j=RQP(9ӬRQ4Q&c1jW=~~z h[kj~N]'ϠRłU* ߞ<9Tg;}ܻ7<:jو>>wp8r=71juGZ6T=d¶mãNUEGlˋ3ّvASo3SRoKq9g\LjUܾP4Y,7n|lL&2 d0컓f34A<˫qgQ4)/UF2#G:լRN'.(`X`2*`nh XC~=xOoZZD|.^dK$^^I|aD33vR RH$\UZG YbqUQz֭/]`Q&@dXL.9qbKDf&رzFt鉉w6͎ߵ.骊|#'dřb1hd1D__!uE Ѱ55ju8FSW/dQd"{rr|)bE=J!0fN ʠRuPyӓmsvD pv ;d.k~/oK#;8Zr,VKN'PGNԵ+ +SVK=r,;FMݗIENDB`petsc4py-3.15.1/docs/apiref/class_hierarchy_for_side.png0000644000175000017500000000210714062764463023513 0ustar balaybalay00000000000000PNG  IHDR;$7BbKGDIDATh]LSg05`TYX5af e)DnƌdbT #1rcƸ d51AܧQ#,LPжC`CBNaY/97y{#x<BC`9Y1,0+jn6 HNH 73s9CGߘ_:$QvXH`o.ǃo\AvF;vqF(滦SYZ9~ ~t,((ݳǃk$~ 78)OE̺n>p3l@O\{z=F# '` J*~YBx[wkn:2k6ិrMOSn^\F aaԔS@}65͛DIzrQ B7O# 7SJq191AqAiII4;F<{lW@*?=)"zѻQx;kz_{z|zuf0/3f3>1kxr XҒghnSTTD{{! 2 ld4?W9@Rʊ`%}\A{rjYr<.`]R3b6X CF`IENDB`petsc4py-3.15.1/docs/petsc4py.10000644000175000017500000002153714062764471016366 0ustar balaybalay00000000000000.\" Man page generated from reStructuredText. . .TH "PETSC4PY" "1" "Jun 17, 2021" "3.1" "PETSc for Python" .SH NAME petsc4py \- PETSc for Python . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .INDENT 0.0 .TP .B Author Lisandro Dalcin .TP .B Contact \fI\%dalcinl@gmail.com\fP .TP .B Web Site \fI\%https://gitlab.com/petsc/petsc\fP .TP .B Date Jun 17, 2021 .UNINDENT .SS Abstract .sp This document describes \fI\%petsc4py\fP, a \fI\%Python\fP port to the \fI\%PETSc\fP libraries. .sp \fI\%PETSc\fP (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the \fI\%MPI\fP standard for all message\-passing communication. .sp This package provides an important subset of PETSc functionalities and uses \fI\%NumPy\fP to efficiently manage input and output of array data. .sp A \fIgood friend\fP of petsc4py is: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fI\%mpi4py\fP: Python bindings for \fI\%MPI\fP, the \fIMessage Passing Interface\fP\&. .UNINDENT .UNINDENT .UNINDENT .sp Other projects depends on petsc4py: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fI\%slepc4py\fP: Python bindings for \fI\%SLEPc\fP, the \fIScalable Library for Eigenvalue Problem Computations\fP\&. .UNINDENT .UNINDENT .UNINDENT .SH CONTENTS .SS Overview .sp \fI\%PETSc\fP is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the \fI\%MPI\fP standard for all message\-passing communication. .sp PETSc is intended for use in large\-scale application projects [petsc\-efficient], and several ongoing computational science projects are built around the PETSc libraries. With strict attention to component interoperability, PETSc facilitates the integration of independently developed application modules, which often most naturally employ different coding styles and data structures. .sp PETSc is easy to use for beginners [petsc\-user\-ref]\&. Moreover, its careful design allows advanced users to have detailed control over the solution process. PETSc includes an expanding suite of parallel linear and nonlinear equation solvers that are easily used in application codes written in C, C++, and Fortran. PETSc provides many of the mechanisms needed within parallel application codes, such as simple parallel matrix and vector assembly routines that allow the overlap of communication and computation. .IP [petsc-user-ref] 5 S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, \fIPETSc Users Manual\fP, ANL\-95/11 \- Revision 3.15, 2021. \fI\%http://www.mcs.anl.gov/petsc/petsc\-current/docs/manual.pdf\fP .IP [petsc-efficient] 5 Satish Balay, Victor Eijkhout, William D. Gropp, Lois Curfman McInnes and Barry F. Smith. Efficient Management of Parallelism in Object Oriented Numerical Software Libraries. Modern Software Tools in Scientific Computing. E. Arge, A. M. Bruaset and H. P. Langtangen, editors. 163–202. Birkhauser Press. 1997. .SS Components .sp PETSc is designed with an object\-oriented style. Almost all user\-visible types are abstract interfaces with implementations that may be chosen at runtime. Those objects are managed through handles to opaque data structures which are created, accessed and destroyed by calling appropriate library routines. .sp PETSc consists of a variety of components. Each component manipulates a particular family of objects and the operations one would like to perform on these objects. These components provide the functionality required for many parallel solutions of PDEs. .INDENT 0.0 .TP .B Vec Provides the vector operations required for setting up and solving large\-scale linear and nonlinear problems. Includes easy\-to\-use parallel scatter and gather operations, as well as special\-purpose code for handling ghost points for regular data structures. .TP .B Mat A large suite of data structures and code for the manipulation of parallel sparse matrices. Includes four different parallel matrix data structures, each appropriate for a different class of problems. .TP .B PC A collection of sequential and parallel preconditioners, including (sequential) ILU(k), LU, and (both sequential and parallel) block Jacobi, overlapping additive Schwarz methods and (through BlockSolve95) ILU(0) and ICC(0). .TP .B KSP Parallel implementations of many popular Krylov subspace iterative methods, including GMRES, CG, CGS, Bi\-CG\-Stab, two variants of TFQMR, CR, and LSQR. All are coded so that they are immediately usable with any preconditioners and any matrix data structures, including matrix\-free methods. .TP .B SNES Data\-structure\-neutral implementations of Newton\-like methods for nonlinear systems. Includes both line search and trust region techniques with a single interface. Employs by default the above data structures and linear solvers. Users can set custom monitoring routines, convergence criteria, etc. .TP .B TS Code for the time evolution of solutions of PDEs. In addition, provides pseudo\-transient continuation techniques for computing steady\-state solutions. .UNINDENT .SS Installation .SS Using \fBpip\fP .sp You can use \fBpip\fP to install \fBpetsc4py\fP and its dependencies (\fBmpi4py\fP is optional but highly recommended): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ python \-m pip install [\-\-user] numpy mpi4py (or pip install [\-\-user] numpy mpi4py) $ python \-m pip install [\-\-user] petsc petsc4py (or pip install [\-\-user] petsc petsc4py) .ft P .fi .UNINDENT .UNINDENT .SS Using \fBsetuptools\fP .sp You can also install dependencies manually and then invoke setuptools from the \fIpetsc4py\fP source directory: .INDENT 0.0 .INDENT 3.5 $ python setup.py build $ python setup.py install .UNINDENT .UNINDENT .sp You may use the \fI–install\-lib\fP argument to the \fIinstall\fP command to alter the \fIsite\-packages\fP directory where the package is to be installed. .SS From PETSc source .sp If you already have downloaded PETSc source and have installed the dependencies of \fIpetsc4py\fP, then to build the \fIpetsc4py\fP module along with PETSc, add the \fI–with\-petsc4py=1\fP argument to the configure command when building PETSc: .INDENT 0.0 .INDENT 3.5 $ ./configure –with\-petsc4py=1 $ make $ make install .UNINDENT .UNINDENT .sp This will install PETSc and the \fIpetsc4py\fP module into the PETSc directory under the prefix specified to the PETSc configure command. .sp If you wish to make the module importable without having to set the \fIPYTHONPATH\fP environment variable, you may add a shortcut to the system\-wide \fIsite\-packages\fP directory creating a special \fI\&.pth\fP file with exactly one line of Python code. This can be done by the following command, where the system\-wide path is assumed to be \fI/usr/lib/pythonX/site\-packages\fP (replace \fIX\fP with your python version): .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B $ echo “import sys, os;” “p = os.getenv(‘PETSC_DIR’);” “a = os.getenv(‘PETSC_ARCH’) or ‘’;” “p = p and os.path.join(p, a, ‘lib’);” “p and (p in sys.path or sys.path.append(p))” > /usr/lib/pythonX/site\-packages/petsc4py.pth .UNINDENT .UNINDENT .UNINDENT .SS Tutorial .sp XXX To be written … Any contribution welcome! .SS Citations .sp If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project. .INDENT 0.0 .IP \(bu 2 L. Dalcin, P. Kler, R. Paz, and A. Cosimo, \fIParallel Distributed Computing using Python\fP, Advances in Water Resources, 34(9):1124\-1139, 2011. \fI\%http://dx.doi.org/10.1016/j.advwatres.2011.04.013\fP .IP \(bu 2 S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, \fIPETSc Users Manual\fP, ANL\-95/11 \- Revision 3.15, 2021. \fI\%http://www.mcs.anl.gov/petsc/petsc\-current/docs/manual.pdf\fP .UNINDENT .SH AUTHOR Lisandro Dalcin .SH COPYRIGHT 2021, Lisandro Dalcin .\" Generated by docutils manpage writer. . petsc4py-3.15.1/docs/LICENSE.html0000644000175000017500000002272014062764420016466 0ustar balaybalay00000000000000 LICENSE: PETSc for Python

LICENSE: PETSc for Python

Author: Lisandro Dalcin
Contact: dalcinl@gmail.com

Copyright (c) 2021, Lisandro Dalcin. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

petsc4py-3.15.1/docs/source/0000755000175000017500000000000014062764472016022 5ustar balaybalay00000000000000petsc4py-3.15.1/docs/source/manual.rst0000644000175000017500000000020013750315427020014 0ustar balaybalay00000000000000================ PETSc for Python ================ .. include:: abstract.txt .. include:: toctree.txt .. include:: links.txt petsc4py-3.15.1/docs/source/index.rst0000644000175000017500000000043114030740317017644 0ustar balaybalay00000000000000================ PETSc for Python ================ :Author: Lisandro Dalcin :Contact: dalcinl@gmail.com :Web Site: https://gitlab.com/petsc/petsc :Date: |today| .. include:: abstract.txt Contents ======== .. include:: toctree.txt .. include:: links.txt petsc4py-3.15.1/docs/source/abstract.txt0000644000175000017500000000154313750315427020364 0ustar balaybalay00000000000000.. topic:: Abstract This document describes petsc4py_, a Python_ port to the PETSc_ libraries. PETSc_ (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI_ standard for all message-passing communication. This package provides an important subset of PETSc functionalities and uses NumPy_ to efficiently manage input and output of array data. A *good friend* of petsc4py is: * mpi4py_: Python bindings for MPI_, the *Message Passing Interface*. Other projects depends on petsc4py: * slepc4py_: Python bindings for SLEPc_, the *Scalable Library for Eigenvalue Problem Computations*. .. Local Variables: .. mode: rst .. End: petsc4py-3.15.1/docs/source/tutorial.rst0000644000175000017500000000010313750315427020404 0ustar balaybalay00000000000000Tutorial ======== XXX To be written ... Any contribution welcome! petsc4py-3.15.1/docs/source/install.rst0000644000175000017500000000351514062763234020221 0ustar balaybalay00000000000000Installation ============ .. _petsc4py_install: Using **pip** ------------- You can use :program:`pip` to install :mod:`petsc4py` and its dependencies (:mod:`mpi4py` is optional but highly recommended):: $ python -m pip install [--user] numpy mpi4py (or pip install [--user] numpy mpi4py) $ python -m pip install [--user] petsc petsc4py (or pip install [--user] petsc petsc4py) Using **setuptools** -------------------- You can also install dependencies manually and then invoke setuptools from the `petsc4py` source directory: $ python setup.py build $ python setup.py install You may use the `--install-lib` argument to the `install` command to alter the `site-packages` directory where the package is to be installed. From PETSc source ----------------- If you already have downloaded PETSc source and have installed the dependencies of `petsc4py`, then to build the `petsc4py` module along with PETSc, add the `--with-petsc4py=1` argument to the configure command when building PETSc: $ ./configure --with-petsc4py=1 $ make $ make install This will install PETSc and the `petsc4py` module into the PETSc directory under the prefix specified to the PETSc configure command. If you wish to make the module importable without having to set the `PYTHONPATH` environment variable, you may add a shortcut to the system-wide `site-packages` directory creating a special `.pth` file with exactly one line of Python code. This can be done by the following command, where the system-wide path is assumed to be `/usr/lib/pythonX/site-packages` (replace `X` with your python version): $ echo \ "import sys, os;" \ "p = os.getenv('PETSC_DIR');" \ "a = os.getenv('PETSC_ARCH') or '';" \ "p = p and os.path.join(p, a, 'lib');" \ "p and (p in sys.path or sys.path.append(p))" \ > /usr/lib/pythonX/site-packages/petsc4py.pth petsc4py-3.15.1/docs/source/citing.rst0000644000175000017500000000137014030740317020015 0ustar balaybalay00000000000000Citations ========= If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project. * L. Dalcin, P. Kler, R. Paz, and A. Cosimo, *Parallel Distributed Computing using Python*, Advances in Water Resources, 34(9):1124-1139, 2011. http://dx.doi.org/10.1016/j.advwatres.2011.04.013 * S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, *PETSc Users Manual*, ANL-95/11 - Revision 3.15, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf petsc4py-3.15.1/docs/source/links.txt0000644000175000017500000000070313750315427017676 0ustar balaybalay00000000000000.. _MPI: http://www.mpi-forum.org .. _MPICH: http://www.mpich.org/ .. _Open MPI: http://www.open-mpi.org .. _PETSc: http://www.mcs.anl.gov/petsc/ .. _SLEPc: http://slepc.upv.es .. _Python: http://www.python.org .. _NumPy: http://www.numpy.org .. _mpi4py: http://github.com/mpi4py/mpi4py .. _petsc4py: http://gitlab.com/petsc/petsc4py .. _slepc4py: http://gitlab.com/slepc/slepc4py petsc4py-3.15.1/docs/source/conf.py0000644000175000017500000001431714006551172017314 0ustar balaybalay00000000000000# -*- coding: utf-8 -*- # # PETSc for Python documentation build configuration file, created by # sphinx-quickstart on Sun Oct 1 15:52:05 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) def get_version(): import sys, os, re here = os.path.dirname(__file__) pardir = [os.path.pardir] * 2 topdir = os.path.join(here, *pardir) srcdir = os.path.join(topdir, 'src') with open(os.path.join(srcdir, '__init__.py')) as f: m = re.search(r"__version__\s*=\s*'(.*)'", f.read()) return m.groups()[0] pkg_version = get_version() # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [] # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] templates_path = [] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'PETSc for Python' copyright = u'2021, Lisandro Dalcin' author = u'Lisandro Dalcin' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = pkg_version[:3] # The full version, including alpha/beta/rc tags. release = pkg_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] html_static_path = [] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars # html_sidebars = { # '**': [ # 'about.html', # 'navigation.html', # 'relations.html', # needs 'show_related': True theme option to display # 'searchbox.html', # 'donate.html', # ] # } # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'petsc4py-man' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', 'papersize': 'a4', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', #'printmodindex': '', #'printindex': '', #'preamble' : '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('manual', 'petsc4py.tex', project, author, 'howto'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'petsc4py', project, [author], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'petsc4py', project, author, 'petsc4py', project+u'.', 'Miscellaneous'), ] # -- Options for Epub output ---------------------------------------------- # Bibliographic Dublin Core info. epub_title = project epub_author = author epub_publisher = author epub_copyright = copyright # The unique identifier of the text. This can be a ISBN number # or the project homepage. # # epub_identifier = '' # A unique identification for the text. # # epub_uid = '' # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html'] petsc4py-3.15.1/docs/source/toctree.txt0000644000175000017500000000016513750315427020225 0ustar balaybalay00000000000000.. toctree:: :maxdepth: 2 overview install tutorial citing .. Local Variables: .. mode: rst .. End: petsc4py-3.15.1/docs/source/make.bat0000644000175000017500000000144613750315427017427 0ustar balaybalay00000000000000@ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=python -msphinx ) set SOURCEDIR=. set BUILDDIR=_build set SPHINXPROJ=petsc4py if "%1" == "" goto help %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The Sphinx module was not found. Make sure you have Sphinx installed, echo.then set the SPHINXBUILD environment variable to point to the full echo.path of the 'sphinx-build' executable. Alternatively you may add the echo.Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% :end popd petsc4py-3.15.1/docs/source/Makefile0000644000175000017500000000114113750315427017452 0ustar balaybalay00000000000000# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = python -msphinx SPHINXPROJ = petsc4py SOURCEDIR = . BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) petsc4py-3.15.1/docs/source/overview.rst0000644000175000017500000001004114030740317020401 0ustar balaybalay00000000000000Overview ======== PETSc_ is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI_ standard for all message-passing communication. PETSc is intended for use in large-scale application projects [petsc-efficient]_, and several ongoing computational science projects are built around the PETSc libraries. With strict attention to component interoperability, PETSc facilitates the integration of independently developed application modules, which often most naturally employ different coding styles and data structures. PETSc is easy to use for beginners [petsc-user-ref]_. Moreover, its careful design allows advanced users to have detailed control over the solution process. PETSc includes an expanding suite of parallel linear and nonlinear equation solvers that are easily used in application codes written in C, C++, and Fortran. PETSc provides many of the mechanisms needed within parallel application codes, such as simple parallel matrix and vector assembly routines that allow the overlap of communication and computation. .. [petsc-user-ref] S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, *PETSc Users Manual*, ANL-95/11 - Revision 3.15, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf .. [petsc-efficient] Satish Balay, Victor Eijkhout, William D. Gropp, Lois Curfman McInnes and Barry F. Smith. Efficient Management of Parallelism in Object Oriented Numerical Software Libraries. Modern Software Tools in Scientific Computing. E. Arge, A. M. Bruaset and H. P. Langtangen, editors. 163--202. Birkhauser Press. 1997. .. include:: links.txt Components ---------- PETSc is designed with an object-oriented style. Almost all user-visible types are abstract interfaces with implementations that may be chosen at runtime. Those objects are managed through handles to opaque data structures which are created, accessed and destroyed by calling appropriate library routines. PETSc consists of a variety of components. Each component manipulates a particular family of objects and the operations one would like to perform on these objects. These components provide the functionality required for many parallel solutions of PDEs. :Vec: Provides the vector operations required for setting up and solving large-scale linear and nonlinear problems. Includes easy-to-use parallel scatter and gather operations, as well as special-purpose code for handling ghost points for regular data structures. :Mat: A large suite of data structures and code for the manipulation of parallel sparse matrices. Includes four different parallel matrix data structures, each appropriate for a different class of problems. :PC: A collection of sequential and parallel preconditioners, including (sequential) ILU(k), LU, and (both sequential and parallel) block Jacobi, overlapping additive Schwarz methods and (through BlockSolve95) ILU(0) and ICC(0). :KSP: Parallel implementations of many popular Krylov subspace iterative methods, including GMRES, CG, CGS, Bi-CG-Stab, two variants of TFQMR, CR, and LSQR. All are coded so that they are immediately usable with any preconditioners and any matrix data structures, including matrix-free methods. :SNES: Data-structure-neutral implementations of Newton-like methods for nonlinear systems. Includes both line search and trust region techniques with a single interface. Employs by default the above data structures and linear solvers. Users can set custom monitoring routines, convergence criteria, etc. :TS: Code for the time evolution of solutions of PDEs. In addition, provides pseudo-transient continuation techniques for computing steady-state solutions. petsc4py-3.15.1/docs/petsc4py.info0000644000175000017500000002613314062764472017157 0ustar balaybalay00000000000000This is petsc4py.info, produced by makeinfo version 6.7 from petsc4py.texi. PETSc for Python 3.15.1, Jun 17, 2021 Lisandro Dalcin Copyright © 2021, Lisandro Dalcin INFO-DIR-SECTION Miscellaneous START-INFO-DIR-ENTRY * petsc4py: (petsc4py.info). PETSc for Python. END-INFO-DIR-ENTRY Generated by Sphinx 3.5.4.  File: petsc4py.info, Node: Top, Next: Contents, Up: (dir) PETSc for Python **************** PETSc for Python 3.15.1, Jun 17, 2021 Lisandro Dalcin Copyright © 2021, Lisandro Dalcin Author: Lisandro Dalcin Contact: Web Site: ‘https://gitlab.com/petsc/petsc’ Date: Jun 17, 2021 Abstract ======== This document describes petsc4py(1), a Python(2) port to the PETSc(3) libraries. PETSc(4) (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI(5) standard for all message-passing communication. This package provides an important subset of PETSc functionalities and uses NumPy(6) to efficiently manage input and output of array data. A `good friend' of petsc4py is: * mpi4py(7): Python bindings for MPI(8), the `Message Passing Interface'. Other projects depends on petsc4py: * slepc4py(9): Python bindings for SLEPc(10), the `Scalable Library for Eigenvalue Problem Computations'. * Menu: * Contents:: — The Detailed Node Listing — Contents * Overview:: * Installation:: * Tutorial:: * Citations:: Overview * Components:: Installation * Using pip:: * Using setuptools:: * From PETSc source:: ---------- Footnotes ---------- (1) http://gitlab.com/petsc/petsc4py (2) http://www.python.org (3) http://www.mcs.anl.gov/petsc/ (4) http://www.mcs.anl.gov/petsc/ (5) http://www.mpi-forum.org (6) http://www.numpy.org (7) http://github.com/mpi4py/mpi4py (8) http://www.mpi-forum.org (9) http://gitlab.com/slepc/slepc4py (10) http://slepc.upv.es  File: petsc4py.info, Node: Contents, Prev: Top, Up: Top 1 Contents ********** * Menu: * Overview:: * Installation:: * Tutorial:: * Citations::  File: petsc4py.info, Node: Overview, Next: Installation, Up: Contents 1.1 Overview ============ PETSc(1) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI(2) standard for all message-passing communication. PETSc is intended for use in large-scale application projects *note [petsc-efficient]: 5, and several ongoing computational science projects are built around the PETSc libraries. With strict attention to component interoperability, PETSc facilitates the integration of independently developed application modules, which often most naturally employ different coding styles and data structures. PETSc is easy to use for beginners *note [petsc-user-ref]: 6. Moreover, its careful design allows advanced users to have detailed control over the solution process. PETSc includes an expanding suite of parallel linear and nonlinear equation solvers that are easily used in application codes written in C, C++, and Fortran. PETSc provides many of the mechanisms needed within parallel application codes, such as simple parallel matrix and vector assembly routines that allow the overlap of communication and computation. (petsc-user-ref) S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, `PETSc Users Manual', ANL-95/11 - Revision 3.15, 2021. ‘http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf’ (petsc-efficient) Satish Balay, Victor Eijkhout, William D. Gropp, Lois Curfman McInnes and Barry F. Smith. Efficient Management of Parallelism in Object Oriented Numerical Software Libraries. Modern Software Tools in Scientific Computing. E. Arge, A. M. Bruaset and H. P. Langtangen, editors. 163–202. Birkhauser Press. 1997. * Menu: * Components:: ---------- Footnotes ---------- (1) http://www.mcs.anl.gov/petsc/ (2) http://www.mpi-forum.org  File: petsc4py.info, Node: Components, Up: Overview 1.1.1 Components ---------------- PETSc is designed with an object-oriented style. Almost all user-visible types are abstract interfaces with implementations that may be chosen at runtime. Those objects are managed through handles to opaque data structures which are created, accessed and destroyed by calling appropriate library routines. PETSc consists of a variety of components. Each component manipulates a particular family of objects and the operations one would like to perform on these objects. These components provide the functionality required for many parallel solutions of PDEs. Vec: Provides the vector operations required for setting up and solving large-scale linear and nonlinear problems. Includes easy-to-use parallel scatter and gather operations, as well as special-purpose code for handling ghost points for regular data structures. Mat: A large suite of data structures and code for the manipulation of parallel sparse matrices. Includes four different parallel matrix data structures, each appropriate for a different class of problems. PC: A collection of sequential and parallel preconditioners, including (sequential) ILU(k), LU, and (both sequential and parallel) block Jacobi, overlapping additive Schwarz methods and (through BlockSolve95) ILU(0) and ICC(0). KSP: Parallel implementations of many popular Krylov subspace iterative methods, including GMRES, CG, CGS, Bi-CG-Stab, two variants of TFQMR, CR, and LSQR. All are coded so that they are immediately usable with any preconditioners and any matrix data structures, including matrix-free methods. SNES: Data-structure-neutral implementations of Newton-like methods for nonlinear systems. Includes both line search and trust region techniques with a single interface. Employs by default the above data structures and linear solvers. Users can set custom monitoring routines, convergence criteria, etc. TS: Code for the time evolution of solutions of PDEs. In addition, provides pseudo-transient continuation techniques for computing steady-state solutions.  File: petsc4py.info, Node: Installation, Next: Tutorial, Prev: Overview, Up: Contents 1.2 Installation ================ * Menu: * Using pip:: * Using setuptools:: * From PETSc source::  File: petsc4py.info, Node: Using pip, Next: Using setuptools, Up: Installation 1.2.1 Using `pip' ----------------- You can use ‘pip’ to install ‘petsc4py’ and its dependencies (‘mpi4py’ is optional but highly recommended): $ python -m pip install [--user] numpy mpi4py (or pip install [--user] numpy mpi4py) $ python -m pip install [--user] petsc petsc4py (or pip install [--user] petsc petsc4py)  File: petsc4py.info, Node: Using setuptools, Next: From PETSc source, Prev: Using pip, Up: Installation 1.2.2 Using `setuptools' ------------------------ You can also install dependencies manually and then invoke setuptools from the ‘petsc4py’ source directory: $ python setup.py build $ python setup.py install You may use the ‘–install-lib’ argument to the ‘install’ command to alter the ‘site-packages’ directory where the package is to be installed.  File: petsc4py.info, Node: From PETSc source, Prev: Using setuptools, Up: Installation 1.2.3 From PETSc source ----------------------- If you already have downloaded PETSc source and have installed the dependencies of ‘petsc4py’, then to build the ‘petsc4py’ module along with PETSc, add the ‘–with-petsc4py=1’ argument to the configure command when building PETSc: $ ./configure –with-petsc4py=1 $ make $ make install This will install PETSc and the ‘petsc4py’ module into the PETSc directory under the prefix specified to the PETSc configure command. If you wish to make the module importable without having to set the ‘PYTHONPATH’ environment variable, you may add a shortcut to the system-wide ‘site-packages’ directory creating a special ‘.pth’ file with exactly one line of Python code. This can be done by the following command, where the system-wide path is assumed to be ‘/usr/lib/pythonX/site-packages’ (replace ‘X’ with your python version): $ echo “import sys, os;” “p = os.getenv(‘PETSC_DIR’);” “a = os.getenv(‘PETSC_ARCH’) or ‘’;” “p = p and os.path.join(p, a, ‘lib’);” “p and (p in sys.path or sys.path.append(p))” > /usr/lib/pythonX/site-packages/petsc4py.pth  File: petsc4py.info, Node: Tutorial, Next: Citations, Prev: Installation, Up: Contents 1.3 Tutorial ============ XXX To be written … Any contribution welcome!  File: petsc4py.info, Node: Citations, Prev: Tutorial, Up: Contents 1.4 Citations ============= If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project. * L. Dalcin, P. Kler, R. Paz, and A. Cosimo, `Parallel Distributed Computing using Python', Advances in Water Resources, 34(9):1124-1139, 2011. ‘http://dx.doi.org/10.1016/j.advwatres.2011.04.013’ * S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, `PETSc Users Manual', ANL-95/11 - Revision 3.15, 2021. ‘http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf’  Tag Table: Node: Top335 Ref: index doc541 Ref: 0541 Ref: Top-Footnote-11752 Ref: Top-Footnote-21793 Ref: Top-Footnote-31823 Ref: Top-Footnote-41861 Ref: Top-Footnote-51899 Ref: Top-Footnote-61932 Ref: Top-Footnote-71961 Ref: Top-Footnote-82001 Ref: Top-Footnote-92034 Ref: Top-Footnote-102075 Node: Contents2104 Ref: index contents2166 Ref: 12166 Ref: index petsc-for-python2166 Ref: 22166 Node: Overview2256 Ref: overview doc2332 Ref: 32332 Ref: overview overview2332 Ref: 42332 Ref: overview petsc-user-ref3509 Ref: 63509 Ref: overview petsc-efficient3911 Ref: 53911 Ref: Overview-Footnote-14308 Ref: Overview-Footnote-24346 Node: Components4379 Ref: overview components4436 Ref: 74436 Ref: overview slepc4py4436 Ref: 84436 Node: Installation6504 Ref: install doc6597 Ref: 96597 Ref: install installation6597 Ref: a6597 Node: Using pip6699 Ref: install petsc4py-install6784 Ref: b6784 Ref: install using-pip6784 Ref: c6784 Node: Using setuptools7128 Ref: install using-setuptools7239 Ref: d7239 Node: From PETSc source7616 Ref: install from-petsc-source7709 Ref: e7709 Node: Tutorial8932 Ref: tutorial doc9026 Ref: f9026 Ref: tutorial tutorial9026 Ref: 109026 Node: Citations9102 Ref: citing doc9175 Ref: 119175 Ref: citing citations9175 Ref: 129175  End Tag Table  Local Variables: coding: utf-8 End: petsc4py-3.15.1/demo/0000755000175000017500000000000014062764472014516 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/dmplex/0000755000175000017500000000000014062764472016007 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/dmplex/adaptivity.py0000644000175000017500000000144313750315427020534 0ustar balaybalay00000000000000import sys,petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import numpy as np OptDB = PETSc.Options() dim = OptDB.getInt('dim', 2) plex = PETSc.DMPlex().createBoxMesh([4]*dim, simplex=True) plex.view() dim = plex.getDimension() vStart, vEnd = plex.getDepthStratum(0) numVertices = vEnd-vStart # Create a metric tensor field corresponding to a uniform mesh size of 0.1 metric_array = np.zeros([numVertices,dim,dim]) for met in metric_array: met[:,:] = np.diag([100]*dim) metric = PETSc.Vec().createWithArray(metric_array) # Call adapt routine - boundary label None by default newplex = plex.adapt(metric) newplex.view() # Write to VTK file viewer = PETSc.Viewer().createVTK('mesh_base.vtk', 'w') viewer(plex) viewer = PETSc.Viewer().createVTK('mesh_adapt.vtk', 'w') viewer(newplex) petsc4py-3.15.1/demo/dmplex/distribute_field.py0000644000175000017500000000342213750315427021676 0ustar balaybalay00000000000000# -*- coding: utf-8 -*- """ Created on Fri Dec 25 17:03:18 2015 @author: ale """ import sys,petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import numpy as np dim = 2 if not PETSc.COMM_WORLD.rank: coords = np.asarray([[0.0, 0.0], [0.5, 0.0], [1.0, 0.0], [0.0, 0.5], [0.5, 0.5], [1.0, 0.5], [0.0, 1.0], [0.5, 1.0], [1.0, 1.0]], dtype=float) cells = np.asarray([[0,1,4,3], [1,2,5,4], [3,4,7,6], [4,5,8,7]], dtype=PETSc.IntType) else: coords = np.zeros((0, 2), dtype=float) cells = np.zeros((0, 4), dtype=PETSc.IntType) plex = PETSc.DMPlex().createFromCellList(dim, cells, coords, comm=PETSc.COMM_WORLD) pStart, pEnd = plex.getChart() plex.view() print("pStart, pEnd: ", pStart, pEnd) # Create section with 1 field with 1 DoF per vertex, edge amd cell numComp = 1 # Start with an empty vector numDof = [0] * 3 # Field defined on vertexes numDof[0] = 1 # Field defined on edges numDof[1] = 1 # Field defined on cells numDof[2] = 1 plex.setNumFields(1) origSect = plex.createSection(numComp, numDof) origSect.setFieldName(0, 'TestField') origSect.setUp() origSect.view() plex.setSection(origSect) origVec = plex.createGlobalVec() origVec.view() origVec.setValues(list(range(pStart, pEnd)),list(range(pStart,pEnd))) origVec.assemblyBegin() origVec.assemblyEnd() origVec.view() if PETSc.COMM_WORLD.size > 1: sf = plex.distribute() sf.view() newSect, newVec = plex.distributeField(sf, origSect, origVec) else: newSect = origSect newVec = origVec newSect.view() newVec.view() petsc4py-3.15.1/demo/perftest/0000755000175000017500000000000014062764472016352 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/perftest/makefile.f2py0000644000175000017500000000042313750315427020723 0ustar balaybalay00000000000000# -*- makefile -*- MODULE=App .PHONY:all all: ${MODULE}.so F2PY = f2py F2PY_FLAGS = --quiet F2PY_FLAGS += --noarch --f90flags='' F2PY_FLAGS += -DF2PY_REPORT_ON_ARRAY_COPY=1 ${MODULE}.so: ${MODULE}.pyf ${MODULE}.f90 ${F2PY} ${F2PY_FLAGS} -m ${MODULE} -c $< ${MODULE}.f90 petsc4py-3.15.1/demo/perftest/makefile0000644000175000017500000000101613750315427020043 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC= PYTHON=python .PHONY:test test: run clean .PHONY:run run: run_py run_cc SCRIPT=driver MODULE=App .PHONY:run_py run_py: ${MODULE}.so ${MPIEXEC} ${PYTHON} ${SCRIPT}.py EXECUTABLE=driver .PHONY:run_cc run_cc: ${EXECUTABLE}.exe ${MPIEXEC} ./${EXECUTABLE}.exe ${MODULE}.so: ${MAKE} -f makefile.f2py ${EXECUTABLE}.exe: ${MAKE} -f makefile.petsc \ PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} .PHONY:clean clean: ${RM} -r __pycache__ *.py[co] ${RM} ${MODULE}.so ${EXECUTABLE}.exe petsc4py-3.15.1/demo/perftest/App.f900000644000175000017500000000573113750315427017413 0ustar balaybalay00000000000000subroutine formFunction_C(nx, ny, nz, h, t, x, xdot, f) & bind(C, name="formFunction") use ISO_C_BINDING, only: C_INT, C_DOUBLE implicit none integer(kind=C_INT), intent(in) :: nx, ny, nz real(kind=C_DOUBLE), intent(in) :: h(3), t real(kind=C_DOUBLE), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz) real(kind=C_DOUBLE), intent(inout) :: f(nx,ny,nz) call formfunction_f(nx, ny, nz, h, t, x, xdot, f) end subroutine formFunction_C subroutine formInitial_C(nx, ny, nz, h, t, x) & bind(C, name="formInitial") use ISO_C_BINDING, only: C_INT, C_DOUBLE implicit none integer(kind=C_INT), intent(in) :: nx, ny, nz real(kind=C_DOUBLE), intent(in) :: h(3), t real(kind=C_DOUBLE), intent(inout) :: x(nx,ny,nz) call forminitial_f(nx, ny, nz, h, t, x) end subroutine formInitial_C subroutine evalK (P, K) real(kind=8), intent(in) :: P real(kind=8), intent(out) :: K if (P >= 0.0) then K = 1.0 else K = 1.0/(1+P**2) end if end subroutine evalK subroutine fillK (P, K) real(kind=8), intent(in) :: P(-1:1) real(kind=8), intent(out) :: K(-1:1) real(kind=8) Ka, Kb call evalK((P(-1)+P( 0))/2.0, Ka) call evalK((P( 0)+P( 1))/2.0, Kb) K(-1) = -Ka K( 0) = Ka + Kb K(+1) = -Kb end subroutine fillK subroutine forminitial_f(nx, ny, nz, h, t, x) implicit none integer, intent(in) :: nx, ny, nz real(kind=8), intent(in) :: h(3), t real(kind=8), intent(inout) :: x(nx,ny,nz) ! x(:,:,:) = 0.0 end subroutine forminitial_f subroutine formfunction_f(nx, ny, nz, h, t, x, xdot, f) implicit none integer, intent(in) :: nx, ny, nz real(kind=8), intent(in) :: h(3), t real(kind=8), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz) real(kind=8), intent(inout) :: f(nx,ny,nz) ! integer :: i,j,k,ii(-1:1),jj(-1:1),kk(-1:1) real(kind=8) :: K1(-1:1), K2(-1:1), K3(-1:1) real(kind=8) :: P1(-1:1), P2(-1:1), P3(-1:1) ! do k=1,nz do j=1,ny do i=1,nx ! ii = (/i-1, i, i+1/) if (i == 1) then ii(-1) = i else if (i == nx) then ii(+1) = i endif ! jj = (/j-1, j, j+1/) if (j == 1) then jj(-1) = j else if (j == ny) then jj(+1) = j end if ! kk = (/k-1, k, k+1/) if (k == 1) then kk(-1) = k else if (k == nz) then kk(+1) = k end if ! P1 = x(ii,j,k) P2 = x(i,jj,k) P3 = x(i,j,kk) call fillK(P1,K1) call fillK(P2,K2) call fillK(P3,K3) f(i,j,k) = & xdot(i,j,k) + & sum(K1*P1)/h(1)**2 + & sum(K2*P2)/h(2)**2 + & sum(K3*P3)/h(3)**2 ! end do !i end do !j end do !k ! i = nx/4+1 j = ny/4+1 k = nz/2+1 f(i,j,k:nz) = f(i,j,k:nz) + 300.0 ! end subroutine formfunction_f petsc4py-3.15.1/demo/perftest/driver.py0000644000175000017500000000671713750315427020225 0ustar balaybalay00000000000000#!/usr/bin/env python import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import numpy as np try: from matplotlib import pylab except ImportError: pylab = None # this user class is an application # context for the nonlinear problem # at hand; it contains some parametes # and knows how to compute residuals class AppCtx: def __init__(self, nx, ny, nz): self.n = np.array([nx, ny, nz], dtype='i') self.h = np.array([1.0/(n-1) for n in self.n], dtype='d') from App import formFunction from App import formInitial self._formFunction = formFunction self._formInitial = formInitial def formInitial(self, t, X): xx = X.getArray(readonly=0).reshape(self.n, order='f') self._formInitial(self.h, t, xx) def formFunction(self, ts, t, X, Xdot, F): n = self.n h = self.h x = X.getArray(readonly=1).reshape(n, order='f') xdot = Xdot.getArray(readonly=1).reshape(n, order='f') f = F[...].reshape(n, order='f') self._formFunction(h, t, x, xdot, f) def plot(self, t, x): nx, ny, nz = self.n from numpy import mgrid # U = x.getArray(readonly=1).reshape(nx,ny,nz, order='f') # X, Y = mgrid[0:1:1j*nx,0:1:1j*ny] Z = U[:,:,nz//2] pylab.figure(0) pylab.contourf(X,Y,Z) pylab.colorbar() pylab.plot(X.ravel(),Y.ravel(),'.k') pylab.title('z=0.50') pylab.xlabel('x') pylab.ylabel('y') pylab.axis('equal') # X, Y = mgrid[0:1:1j*nx,0:1:1j*nz] Z = U[:,ny//4,:] pylab.figure(1) pylab.contourf(X,Y,Z) pylab.colorbar() pylab.plot(X.ravel(),Y.ravel(),'.k') pylab.title('y=0.25') pylab.xlabel('x') pylab.ylabel('z') pylab.axis('equal') # X, Y = mgrid[0:1:1j*ny,0:1:1j*nz] Z = U[nx//2,:,:] pylab.figure(2) pylab.contourf(X,Y,Z) pylab.colorbar() pylab.plot(X.ravel(),Y.ravel(),'.k') pylab.title('x=0.50') pylab.xlabel('y') pylab.ylabel('z') pylab.axis('equal') def run_test(nx,ny,nz,samples,plot=False): ts = PETSc.TS().create() ts.setType('theta') ts.setTheta(1.0) ts.setTimeStep(0.01) ts.setTime(0.0) ts.setMaxTime(1.0) ts.setMaxSteps(10) eft = PETSc.TS.ExactFinalTime.STEPOVER ts.setExactFinalTime(eft) x = PETSc.Vec().createSeq(nx*ny*nz) ts.setSolution(x) app = AppCtx(nx, ny, nz) f = PETSc.Vec().createSeq(nx*ny*nz) ts.setIFunction(app.formFunction, f) ts.snes.setUseMF(1) ts.snes.ksp.setType('cg') ts.setFromOptions() ts.setUp() wt = 1e300 for i in range(samples): app.formInitial(0, x) t1 = PETSc.Log.getTime() ts.solve(x) t2 = PETSc.Log.getTime() wt = min(wt,t2-t1) if plot and pylab: app.plot(ts.time, x) return wt OptDB = PETSc.Options() start = OptDB.getInt('start', 12) step = OptDB.getInt('step', 4) stop = OptDB.getInt('stop', start) samples = OptDB.getInt('samples', 1) plot = OptDB.getBool('plot', False) if plot and not pylab: PETSc.Sys.Print("matplotlib not available") for n in range(start, stop+step, step): nx = ny = nz = n+1 wt = run_test(nx,ny,nz,samples,plot) PETSc.Sys.Print("Grid %3d x %3d x %3d -> %f seconds (%2d samples)" % (nx,ny,nz,wt,samples)) if plot and pylab: pylab.show() petsc4py-3.15.1/demo/perftest/makefile.petsc0000644000175000017500000000071113750315427021161 0ustar balaybalay00000000000000# -*- makefile -*- EXECUTABLE=driver .PHONY:all all: ${EXECUTABLE}.exe SOURCEC=${EXECUTABLE}.c SOURCEF=App.f90 OBJSC=${SOURCEC:.c=.o} OBJSF=${SOURCEF:.f90=.o} ${EXECUTABLE}.exe: ${SOURCEC} ${SOURCEF} ${PETSC_FCOMPILE} ${PETSC_COMPILE} ${CLINKER} -o $@ ${OBJSC} ${OBJSF} ${PETSC_TS_LIB} ${RM} ${OBJSC} ${OBJSF} include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules OBJSC=${SOURCEC:.c=.o} OBJSF=${SOURCEF:.f90=.o} petsc4py-3.15.1/demo/perftest/App.pyf0000644000175000017500000000156513750315427017614 0ustar balaybalay00000000000000! -*- f90 -*- python module App interface subroutine formFunction(nx, ny, nz, h, t, x, xdot, f) intent(c) formFunction integer, intent(in), intent(hide) :: nx = shape(x,0) integer, intent(in), intent(hide) :: ny = shape(x,1) integer, intent(in), intent(hide) :: nz = shape(x,2) real(kind=8), intent(in) :: h(3), t real(kind=8), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz) real(kind=8), intent(inout) :: f(nx,ny,nz) end subroutine formFunction subroutine formInitial(nx, ny, nz, h, t, x) intent(c) formInitial integer, intent(in), intent(hide) :: nx = shape(x,0) integer, intent(in), intent(hide) :: ny = shape(x,1) integer, intent(in), intent(hide) :: nz = shape(x,2) real(kind=8), intent(in) :: h(3), t real(kind=8), intent(inout) :: x(nx,ny,nz) end subroutine formFunction end python module App petsc4py-3.15.1/demo/perftest/driver.c0000644000175000017500000001013213750315427020001 0ustar balaybalay00000000000000#include EXTERN_C_BEGIN extern void formInitial(int*,int*,int*,double*, double*,double*); extern void formFunction(const int*,const int*,const int*,const double*, const double*,const double[],const double[],double[]); EXTERN_C_END typedef struct AppCtx { PetscInt nx,ny,nz; PetscScalar h[3]; } AppCtx; PetscErrorCode FormInitial(PetscReal t, Vec X, void *ctx) { PetscScalar *x; AppCtx *app = (AppCtx*) ctx; PetscErrorCode ierr; PetscFunctionBegin; ierr = VecGetArray(X,&x);CHKERRQ(ierr); /**/ formInitial(&app->nx,&app->ny,&app->nz,app->h,&t,x); /**/ ierr = VecRestoreArray(X,&x);CHKERRQ(ierr); PetscFunctionReturn(0); } PetscErrorCode FormFunction(TS ts, PetscReal t, Vec X, Vec Xdot,Vec F, void *ctx) { const PetscScalar *x; const PetscScalar *xdot; PetscScalar *f; AppCtx *app = (AppCtx*) ctx; PetscErrorCode ierr; PetscFunctionBegin; ierr = VecGetArrayRead(X,&x);CHKERRQ(ierr); ierr = VecGetArrayRead(Xdot,&xdot);CHKERRQ(ierr); ierr = VecGetArray(F,&f);CHKERRQ(ierr); /**/ formFunction(&app->nx,&app->ny,&app->nz,app->h,&t,x,xdot,f); /**/ ierr = VecRestoreArrayRead(X,&x);CHKERRQ(ierr); ierr = VecRestoreArrayRead(Xdot,&xdot);CHKERRQ(ierr); ierr = VecRestoreArray(F,&f);CHKERRQ(ierr); PetscFunctionReturn(0); } PetscErrorCode RunTest(int nx, int ny, int nz, int loops, double *wt) { Vec x,f; TS ts; AppCtx _app,*app=&_app; double t1,t2; PetscErrorCode ierr; PetscFunctionBegin; app->nx = nx; app->h[0] = 1./(nx-1); app->ny = ny; app->h[1] = 1./(ny-1); app->nz = nz; app->h[2] = 1./(nz-1); ierr = VecCreate(PETSC_COMM_SELF,&x);CHKERRQ(ierr); ierr = VecSetSizes(x,nx*ny*nz,nx*ny*nz);CHKERRQ(ierr); ierr = VecSetUp(x);CHKERRQ(ierr); ierr = VecDuplicate(x,&f);CHKERRQ(ierr); ierr = TSCreate(PETSC_COMM_SELF,&ts);CHKERRQ(ierr); ierr = TSSetProblemType(ts,TS_NONLINEAR);CHKERRQ(ierr); ierr = TSSetType(ts,TSTHETA);CHKERRQ(ierr); ierr = TSThetaSetTheta(ts,1.0);CHKERRQ(ierr); ierr = TSSetTimeStep(ts,0.01);CHKERRQ(ierr); ierr = TSSetTime(ts,0.0);CHKERRQ(ierr); ierr = TSSetMaxTime(ts,1.0);CHKERRQ(ierr); ierr = TSSetMaxSteps(ts,10);CHKERRQ(ierr); ierr = TSSetExactFinalTime(ts,TS_EXACTFINALTIME_STEPOVER);CHKERRQ(ierr); ierr = TSSetSolution(ts,x);CHKERRQ(ierr); ierr = TSSetIFunction(ts,f,FormFunction,app);CHKERRQ(ierr); ierr = PetscOptionsSetValue(NULL,"-snes_mf","1");CHKERRQ(ierr); { SNES snes; KSP ksp; ierr = TSGetSNES(ts,&snes);CHKERRQ(ierr); ierr = SNESGetKSP(snes,&ksp);CHKERRQ(ierr); ierr = KSPSetType(ksp,KSPCG);CHKERRQ(ierr); } ierr = TSSetFromOptions(ts);CHKERRQ(ierr); ierr = TSSetUp(ts);CHKERRQ(ierr); *wt = 1e300; while (loops-- > 0) { ierr = FormInitial(0.0,x,app);CHKERRQ(ierr); ierr = PetscTime(&t1);CHKERRQ(ierr); ierr = TSSolve(ts,x);CHKERRQ(ierr); ierr = PetscTime(&t2);CHKERRQ(ierr); *wt = PetscMin(*wt,t2-t1); } ierr = VecDestroy(&x);CHKERRQ(ierr); ierr = VecDestroy(&f);CHKERRQ(ierr); ierr = TSDestroy(&ts);CHKERRQ(ierr); PetscFunctionReturn(0); } PetscErrorCode GetInt(const char* name, PetscInt *v, PetscInt defv) { PetscErrorCode ierr; PetscFunctionBegin; *v = defv; ierr = PetscOptionsGetInt(NULL,NULL,name,v,NULL);CHKERRQ(ierr); PetscFunctionReturn(0); } int main(int argc, char *argv[]) { double wt; PetscInt n,start,step,stop,samples; PetscErrorCode ierr; ierr = PetscInitialize(&argc,&argv,NULL,NULL);if (ierr) return ierr; ierr = GetInt("-start", &start, 12);CHKERRQ(ierr); ierr = GetInt("-step", &step, 4);CHKERRQ(ierr); ierr = GetInt("-stop", &stop, start);CHKERRQ(ierr); ierr = GetInt("-samples", &samples, 1);CHKERRQ(ierr); for (n=start; n<=stop; n+=step){ int nx=n+1, ny=n+1, nz=n+1; ierr = RunTest(nx,ny,nz,samples,&wt);CHKERRQ(ierr); ierr = PetscPrintf(PETSC_COMM_SELF, "Grid %3d x %3d x %3d -> %f seconds (%2d samples)\n", nx,ny,nz,wt,samples);CHKERRQ(ierr); } ierr = PetscFinalize();CHKERRQ(ierr); return 0; } petsc4py-3.15.1/demo/makefile0000644000175000017500000000040613750315427016211 0ustar balaybalay00000000000000.PHONY:all all: petsc ${MAKE} -C binary-io ${MAKE} -C kspsolve ${MAKE} -C bratu2d ${MAKE} -C bratu3d ${MAKE} -C poisson2d ${MAKE} -C poisson3d ${MAKE} -C perftest ${MAKE} -C wrap-swig ${MAKE} -C wrap-f2py .PHONY:petsc petsc: ${MAKE} -C petsc-examples petsc4py-3.15.1/demo/wrap-f2py/0000755000175000017500000000000014062764472016345 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/wrap-f2py/Bratu2D.F900000644000175000017500000001704013750315427020065 0ustar balaybalay00000000000000! --------------------------------------------------------------------- ! ! Solid Fuel Ignition (SFI) problem. This problem is modeled by ! the partial differential equation ! ! -Laplacian(u) - lambda * exp(u) = 0, 0 < x,y < 1, ! ! with boundary conditions ! ! u = 0 for x = 0, x = 1, y = 0, y = 1, ! ! A finite difference approximation with the usual 5-point stencil ! is used to discretize the boundary value problem to obtain a ! nonlinear system of equations. The problem is solved in a 2D ! rectangular domain, using distributed arrays (DAs) to partition ! the parallel grid. ! ! -------------------------------------------------------------------- #include module Bratu2D use petsc implicit none type gridinfo PetscInt mx,xs,xe,xm,gxs,gxe,gxm PetscInt my,ys,ye,ym,gys,gye,gym end type gridinfo contains subroutine GetGridInfo(da, grd, ierr) implicit none DM da type(gridinfo) grd PetscErrorCode ierr ! call DMDAGetInfo(da, PETSC_NULL_INTEGER, & & grd%mx, grd%my, PETSC_NULL_INTEGER, & & PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, & & PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, & & PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, & & PETSC_NULL_INTEGER,ierr);CHKERRQ(ierr) call DMDAGetCorners(da, & & grd%xs,grd%ys,PETSC_NULL_INTEGER, & & grd%xm,grd%ym,PETSC_NULL_INTEGER,ierr);CHKERRQ(ierr) call DMDAGetGhostCorners(da, & & grd%gxs,grd%gys,PETSC_NULL_INTEGER, & & grd%gxm,grd%gym,PETSC_NULL_INTEGER,ierr);CHKERRQ(ierr) grd%xs = grd%xs+1 grd%ys = grd%ys+1 grd%gxs = grd%gxs+1 grd%gys = grd%gys+1 grd%ye = grd%ys+grd%ym-1 grd%xe = grd%xs+grd%xm-1 grd%gye = grd%gys+grd%gym-1 grd%gxe = grd%gxs+grd%gxm-1 end subroutine GetGridInfo subroutine InitGuessLocal(grd, x, lambda, ierr) implicit none type(gridinfo) grd PetscScalar x(grd%xs:grd%xe,grd%ys:grd%ye) PetscReal lambda PetscErrorCode ierr ! PetscInt i, j PetscReal hx,hy,temp,temp1,one one = 1.0 hx = one/(dble(grd%mx-1)) hy = one/(dble(grd%my-1)) temp1 = lambda/(lambda+one) do j=grd%ys,grd%ye temp = dble(min(j-1,grd%my-j))*hy do i=grd%xs,grd%xe if (i==1 .or. j==1 .or. i==grd%mx .or. j==grd%my) then ! boundary points x(i,j) = 0.0 else ! interior grid points x(i,j) = temp1*sqrt(min(dble(min(i-1,grd%mx-i)*hx),dble(temp))) end if end do end do ierr = 0 end subroutine InitGuessLocal subroutine FunctionLocal(grd, x, f, lambda, ierr) implicit none type(gridinfo) grd PetscScalar x(grd%gxs:grd%gxe,grd%gys:grd%gye) PetscScalar f(grd%xs:grd%xe,grd%ys:grd%ye) PetscReal lambda PetscErrorCode ierr ! PetscInt i,j PetscReal hx,hy,hxdhy,hydhx,sc,one,two PetscScalar u,uxx,uyy one = 1.0 two = 2.0 hx = one/dble(grd%mx-1) hy = one/dble(grd%my-1) sc = hx*hy hxdhy = hx/hy hydhx = hy/hx do j=grd%ys,grd%ye do i=grd%xs,grd%xe if (i==1 .or. j==1 .or. i==grd%mx .or. j==grd%my) then ! boundary points f(i,j) = x(i,j) - 0.0 else ! interior grid points u = x(i,j) uxx = (two*u - x(i-1,j) - x(i+1,j)) * hydhx uyy = (two*u - x(i,j-1) - x(i,j+1)) * hxdhy f(i,j) = uxx + uyy - lambda*exp(u)*sc end if end do end do ierr = 0 end subroutine FunctionLocal subroutine JacobianLocal(grd, x, Jac, lambda, ierr) implicit none type(gridinfo) grd PetscScalar x(grd%gxs:grd%gxe,grd%gys:grd%gye) Mat Jac PetscReal lambda PetscErrorCode ierr ! PetscInt i,j,row(1),col(5) PetscInt ione,ifive PetscReal hx,hy,hxdhy,hydhx,sc,v(5),one,two ione = 1 ifive = 5 one = 1.0 two = 2.0 hx = one/dble(grd%mx-1) hy = one/dble(grd%my-1) sc = hx*hy hxdhy = hx/hy hydhx = hy/hx do j=grd%ys,grd%ye row = (j - grd%gys)*grd%gxm + grd%xs - grd%gxs - 1 do i=grd%xs,grd%xe row = row + 1 if (i==1 .or. j==1 .or. i==grd%mx .or. j==grd%my) then ! boundary points col(1) = row(1) v(1) = one call MatSetValuesLocal(Jac,ione,row,ione,col,v,INSERT_VALUES,ierr);CHKERRQ(ierr) else ! interior grid points v(1) = -hxdhy v(2) = -hydhx v(3) = two*(hydhx + hxdhy) - lambda*exp(x(i,j))*sc v(4) = -hydhx v(5) = -hxdhy col(1) = row(1) - grd%gxm col(2) = row(1) - 1 col(3) = row(1) col(4) = row(1) + 1 col(5) = row(1) + grd%gxm call MatSetValuesLocal(Jac,ione,row,ifive,col,v,INSERT_VALUES,ierr);CHKERRQ(ierr) end if end do end do end subroutine JacobianLocal end module Bratu2D ! -------------------------------------------------------------------- subroutine FormInitGuess(da, X, lambda, ierr) use Bratu2D implicit none DM da Vec X PetscReal lambda PetscErrorCode ierr ! type(gridinfo) :: grd PetscScalar,pointer :: xx(:) call VecGetArrayF90(X,xx,ierr);CHKERRQ(ierr) call GetGridInfo(da,grd,ierr);CHKERRQ(ierr) call InitGuessLocal(grd,xx,lambda,ierr);CHKERRQ(ierr) call VecRestoreArrayF90(X,xx,ierr);CHKERRQ(ierr) end subroutine FormInitGuess subroutine FormFunction(da, X, F, lambda, ierr) use Bratu2D implicit none DM da Vec X Vec F PetscReal lambda PetscErrorCode ierr ! type(gridinfo) :: grd Vec :: localX PetscScalar,pointer :: xx(:) PetscScalar,pointer :: ff(:) call DMGetLocalVector(da,localX,ierr);CHKERRQ(ierr) call DMGlobalToLocalBegin(da,X,INSERT_VALUES,localX,ierr);CHKERRQ(ierr) call DMGlobalToLocalEnd(da,X,INSERT_VALUES,localX,ierr);CHKERRQ(ierr) call VecGetArrayF90(localX,xx,ierr);CHKERRQ(ierr) call VecGetArrayF90(F,ff,ierr);CHKERRQ(ierr) call GetGridInfo(da,grd,ierr);CHKERRQ(ierr) call FunctionLocal(grd,xx,ff,lambda,ierr);CHKERRQ(ierr) call VecRestoreArrayF90(F,ff,ierr);CHKERRQ(ierr) call VecRestoreArrayF90(localX,xx,ierr);CHKERRQ(ierr) call DMRestoreLocalVector(da,localX,ierr);CHKERRQ(ierr) end subroutine FormFunction subroutine FormJacobian(da, X, J, lambda, ierr) use Bratu2D implicit none DM da Vec X Mat J PetscReal lambda PetscErrorCode ierr ! type(gridinfo) :: grd Vec :: localX PetscScalar,pointer :: xx(:) call DMGetLocalVector(da,localX,ierr);CHKERRQ(ierr) call DMGlobalToLocalBegin(da,X,INSERT_VALUES,localX,ierr);CHKERRQ(ierr) call DMGlobalToLocalEnd(da,X,INSERT_VALUES,localX,ierr);CHKERRQ(ierr) call VecGetArrayF90(localX,xx,ierr);CHKERRQ(ierr) call GetGridInfo(da,grd,ierr);CHKERRQ(ierr) call JacobianLocal(grd,xx,J,lambda,ierr);CHKERRQ(ierr) call VecRestoreArrayF90(localX,xx,ierr);CHKERRQ(ierr) call DMRestoreLocalVector(da,localX,ierr);CHKERRQ(ierr) call MatAssemblyBegin(J,MAT_FINAL_ASSEMBLY,ierr);CHKERRQ(ierr) call MatAssemblyEnd (J,MAT_FINAL_ASSEMBLY,ierr);CHKERRQ(ierr) end subroutine FormJacobian ! -------------------------------------------------------------------- ! Local Variables: ! mode: f90 ! End: petsc4py-3.15.1/demo/wrap-f2py/run_demo.py0000644000175000017500000000432313750315427020524 0ustar balaybalay00000000000000import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import Bratu2D as Bratu2D class App(object): def __init__(self, da, lambda_): assert da.getDim() == 2 self.da = da self.lambda_ = lambda_ def formInitGuess(self, snes, X): X.zeroEntries() # just in case da = self.da.fortran vec_X = X.fortran ierr = Bratu2D.FormInitGuess(da, vec_X, self.lambda_) if ierr: raise PETSc.Error(ierr) def formFunction(self, snes, X, F): F.zeroEntries() # just in case da = self.da.fortran vec_X = X.fortran vec_F = F.fortran ierr = Bratu2D.FormFunction(da, vec_X, vec_F, self.lambda_) if ierr: raise PETSc.Error(ierr) def formJacobian(self, snes, X, J, P): P.zeroEntries() # just in case da = self.da.fortran vec_X = X.fortran mat_P = P.fortran ierr = Bratu2D.FormJacobian(da, vec_X, mat_P, self.lambda_) if ierr: raise PETSc.Error(ierr) if J != P: J.assemble() # matrix-free operator return PETSc.Mat.Structure.SAME_NONZERO_PATTERN OptDB = PETSc.Options() N = OptDB.getInt('N', 16) lambda_ = OptDB.getReal('lambda', 6.0) do_plot = OptDB.getBool('plot', False) da = PETSc.DA().create([N, N], stencil_width=1) app = App(da, lambda_) snes = PETSc.SNES().create() F = da.createGlobalVec() snes.setFunction(app.formFunction, F) J = da.createMat() snes.setJacobian(app.formJacobian, J) snes.setFromOptions() X = da.createGlobalVec() app.formInitGuess(snes, X) snes.solve(None, X) U = da.createNaturalVec() da.globalToNatural(X, U) def plot(da, U): comm = da.getComm() scatter, U0 = PETSc.Scatter.toZero(U) scatter.scatter(U, U0, False, PETSc.Scatter.Mode.FORWARD) rank = comm.getRank() if rank == 0: solution = U0[...] solution = solution.reshape(da.sizes, order='f').copy() try: from matplotlib import pyplot pyplot.contourf(solution) pyplot.axis('equal') pyplot.show() except: pass comm.barrier() scatter.destroy() U0.destroy() if do_plot: plot(da, U) U.destroy() X.destroy() F.destroy() J.destroy() da.destroy() snes.destroy() petsc4py-3.15.1/demo/wrap-f2py/makefile0000644000175000017500000000114713750315427020043 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC= PYTHON=python .PHONY:test test: run clean SCRIPT=run_demo MODULE=Bratu2D .PHONY:build build: ${MODULE}.so .PHONY:run run: build ${PYTHON} ${SCRIPT}.py ${MODULE}.so: ${MODULE}.pyf ${MODULE}.F90 env \ F77="${FC}" F77FLAGS="${FC_FLAGS}" \ F90="${FC}" F90FLAGS="${FC_FLAGS}" \ LDSHARED="${FC_LINKER}" \ ${PYTHON} setup.py -q build_ext --inplace ${RM} -r build ${MODULE}module.c .PHONY:clean clean:: ${RM} ${MODULE}*.so ${RM} *.py[co] ${RM} -r __pycache__ include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules MPIEXEC= petsc4py-3.15.1/demo/wrap-f2py/.f2py_f2cmap0000644000175000017500000000004313750315427020446 0ustar balaybalay00000000000000{'integer':{'HANDLE_KIND':'long'}} petsc4py-3.15.1/demo/wrap-f2py/Bratu2Dmodule.h0000644000175000017500000000072513750315427021166 0ustar balaybalay00000000000000#define FormInitGuess forminitguess #define FormFunction formfunction #define FormJacobian formjacobian #define FormInitGuess_ forminitguess_ #define FormFunction_ formfunction_ #define FormJacobian_ formjacobian_ #define _FormInitGuess _forminitguess #define _FormFunction _formfunction #define _FormJacobian _formjacobian #define _FormInitGuess_ _forminitguess_ #define _FormFunction_ _formfunction_ #define _FormJacobian_ _formjacobian_ petsc4py-3.15.1/demo/wrap-f2py/setup.py0000644000175000017500000000404213750315427020052 0ustar balaybalay00000000000000#!/usr/bin/env python #$ python setup.py build_ext --inplace # a bit of monkeypatching ... try: from numpy.distutils.fcompiler import FCompiler def runtime_library_dir_option(self, dir): return self.c_compiler.runtime_library_dir_option(dir) FCompiler.runtime_library_dir_option = \ runtime_library_dir_option except Exception: pass def configuration(parent_package='',top_path=None): INCLUDE_DIRS = [] LIBRARY_DIRS = [] LIBRARIES = [] # PETSc import os PETSC_DIR = os.environ['PETSC_DIR'] PETSC_ARCH = os.environ.get('PETSC_ARCH', '') from os.path import join, isdir if PETSC_ARCH and isdir(join(PETSC_DIR, PETSC_ARCH)): INCLUDE_DIRS += [join(PETSC_DIR, PETSC_ARCH, 'include'), join(PETSC_DIR, 'include')] LIBRARY_DIRS += [join(PETSC_DIR, PETSC_ARCH, 'lib')] else: if PETSC_ARCH: pass # XXX should warn ... INCLUDE_DIRS += [join(PETSC_DIR, 'include')] LIBRARY_DIRS += [join(PETSC_DIR, 'lib')] LIBRARIES += [#'petscts', 'petscsnes', 'petscksp', #'petscdm', 'petscmat', 'petscvec', 'petsc'] # PETSc for Python import petsc4py INCLUDE_DIRS += [petsc4py.get_include()] # Configuration from numpy.distutils.misc_util import Configuration config = Configuration('', parent_package, top_path) config.add_extension('Bratu2D', sources = ['Bratu2D.pyf', 'Bratu2D.F90'], depends = ['Bratu2Dmodule.h'], f2py_options=['--quiet'], define_macros=[('F2PY_REPORT_ON_ARRAY_COPY',1)], include_dirs=INCLUDE_DIRS + [os.curdir], libraries=LIBRARIES, library_dirs=LIBRARY_DIRS, runtime_library_dirs=LIBRARY_DIRS) return config if __name__ == "__main__": from numpy.distutils.core import setup setup(**configuration(top_path='').todict()) petsc4py-3.15.1/demo/wrap-f2py/Bratu2D.pyf0000644000175000017500000000204313750315427020322 0ustar balaybalay00000000000000! -*- f90 -*- python module Bratu2D usercode ''' #include "Bratu2Dmodule.h" ''' interface subroutine FormInitGuess(dm, x, param, ierr) !integer, parameter :: HANDLE_KIND=4 integer(kind=HANDLE_KIND) dm ! DM integer(kind=HANDLE_KIND) x ! Vec real(kind=8) param integer, intent(out) :: ierr end subroutine FormInitGuess subroutine FormFunction(dm, x, f, param, ierr) !integer, parameter :: HANDLE_KIND=4 integer(kind=HANDLE_KIND) dm ! DM integer(kind=HANDLE_KIND) x ! Vec integer(kind=HANDLE_KIND) f ! Vec real(kind=8) param integer, intent(out) :: ierr end subroutine FormFunction subroutine FormJacobian(dm, x, J, param, ierr) !integer, parameter :: HANDLE_KIND=4 integer(kind=HANDLE_KIND) dm ! DM integer(kind=HANDLE_KIND) x ! Vec integer(kind=HANDLE_KIND) J ! Vec real(kind=8) param integer, intent(out) :: ierr end subroutine FormJacobian end interface end python module Bratu2D petsc4py-3.15.1/demo/poisson2d/0000755000175000017500000000000014062764472016436 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/poisson2d/makefile0000644000175000017500000000030513750315427020127 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC= PYTHON=python .PHONY:test test: run clean .PHONY:run run: ${MPIEXEC} ${PYTHON} poisson2d.py -nx 15 -ny 16 .PHONY:clean clean: ${RM} *.py[co] ${RM} -r __pycache__ petsc4py-3.15.1/demo/poisson2d/poisson2d.py0000644000175000017500000000520313750315427020723 0ustar balaybalay00000000000000# ------------------------------------------------------------------------ # # Poisson problem. This problem is modeled by the partial # differential equation # # -Laplacian(u) = 1, 0 < x,y < 1, # # with boundary conditions # # u = 0 for x = 0, x = 1, y = 0, y = 1 # # A finite difference approximation with the usual 7-point stencil # is used to discretize the boundary value problem to obtain a # nonlinear system of equations. The problem is solved in a 2D # rectangular domain, using distributed arrays (DAs) to partition # the parallel grid. # # ------------------------------------------------------------------------ try: range = xrange except: pass import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc class Poisson2D(object): def __init__(self, da): assert da.getDim() == 2 self.da = da self.localX = da.createLocalVec() def formRHS(self, B): b = self.da.getVecArray(B) mx, my = self.da.getSizes() hx, hy = [1.0/m for m in [mx, my]] (xs, xe), (ys, ye) = self.da.getRanges() for j in range(ys, ye): for i in range(xs, xe): b[i, j] = 1*hx*hy def mult(self, mat, X, Y): # self.da.globalToLocal(X, self.localX) x = self.da.getVecArray(self.localX) y = self.da.getVecArray(Y) # mx, my = self.da.getSizes() hx, hy = [1.0/m for m in [mx, my]] (xs, xe), (ys, ye) = self.da.getRanges() for j in range(ys, ye): for i in range(xs, xe): u = x[i, j] # center u_e = u_w = u_n = u_s = 0 if i > 0: u_w = x[i-1, j] # west if i < mx-1: u_e = x[i+1, j] # east if j > 0: u_s = x[i, j-1] # south if j < ny-1: u_n = x[i, j+1] # north u_xx = (-u_e + 2*u - u_w)*hy/hx u_yy = (-u_n + 2*u - u_s)*hx/hy y[i, j] = u_xx + u_yy OptDB = PETSc.Options() n = OptDB.getInt('n', 16) nx = OptDB.getInt('nx', n) ny = OptDB.getInt('ny', n) da = PETSc.DMDA().create([nx, ny], stencil_width=1) pde = Poisson2D(da) x = da.createGlobalVec() b = da.createGlobalVec() # A = da.createMat('python') A = PETSc.Mat().createPython( [x.getSizes(), b.getSizes()], comm=da.comm) A.setPythonContext(pde) A.setUp() ksp = PETSc.KSP().create() ksp.setOperators(A) ksp.setType('cg') pc = ksp.getPC() pc.setType('none') ksp.setFromOptions() pde.formRHS(b) ksp.solve(b, x) u = da.createNaturalVec() da.globalToNatural(x, u) if OptDB.getBool('plot', True): draw = PETSc.Viewer.DRAW(x.comm) OptDB['draw_pause'] = 1 draw(x) petsc4py-3.15.1/demo/taosolve/0000755000175000017500000000000014062764472016352 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/taosolve/rosenbrock.py0000644000175000017500000000706013750315427021071 0ustar balaybalay00000000000000""" This example demonstrates the use of TAO for Python to solve an unconstrained minimization problem on a single processor. We minimize the extended Rosenbrock function:: sum_{i=0}^{n/2-1} ( alpha*(x_{2i+1}-x_{2i}^2)^2 + (1-x_{2i})^2 ) """ try: range = xrange except NameError: pass # the two lines below are only # needed to build options database # from command line arguments import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc class AppCtx(object): """ Extended Rosenbrock function. """ def __init__(self, n=2, alpha=99.0): self.size = int(n) self.alpha = float(alpha) def formObjective(self, tao, x): #print 'AppCtx.formObjective()' alpha = self.alpha nn = self.size // 2 ff = 0.0 for i in range(nn): t1 = x[2*i+1] - x[2*i] * x[2*i] t2 = 1 - x[2*i]; ff += alpha*t1*t1 + t2*t2; return ff def formGradient(self, tao, x, G): #print 'AppCtx.formGradient()' alpha = self.alpha nn = self.size // 2 G.zeroEntries() for i in range(nn): t1 = x[2*i+1] - x[2*i] * x[2*i] t2 = 1 - x[2*i]; G[2*i] = -4*alpha*t1*x[2*i] - 2*t2; G[2*i+1] = 2*alpha*t1; def formObjGrad(self, tao, x, G): #print 'AppCtx.formObjGrad()' alpha = self.alpha nn = self.size // 2 ff = 0.0 G.zeroEntries() for i in range(nn): t1 = x[2*i+1] - x[2*i] * x[2*i] t2 = 1 - x[2*i]; ff += alpha*t1*t1 + t2*t2; G[2*i] = -4*alpha*t1*x[2*i] - 2*t2; G[2*i+1] = 2*alpha*t1; return ff def formHessian(self, tao, x, H, HP): #print 'AppCtx.formHessian()' alpha = self.alpha nn = self.size // 2 idx = [0, 0] v = [[0.0, 0.0], [0.0, 0.0]] H.zeroEntries() for i in range(nn): v[1][1] = 2*alpha v[0][0] = -4*alpha*(x[2*i+1]-3*x[2*i]*x[2*i]) + 2 v[1][0] = v[0][1] = -4.0*alpha*x[2*i]; idx[0] = 2*i idx[1] = 2*i+1 H[idx,idx] = v H.assemble() # access PETSc options database OptDB = PETSc.Options() # create user application context # and configure user parameters user = AppCtx() user.size = OptDB.getInt ( 'n', user.size) user.alpha = OptDB.getReal('alpha', user.alpha) # create solution vector x = PETSc.Vec().create(PETSc.COMM_SELF) x.setSizes(user.size) x.setFromOptions() # create Hessian matrix H = PETSc.Mat().create(PETSc.COMM_SELF) H.setSizes([user.size, user.size]) H.setFromOptions() H.setOption(PETSc.Mat.Option.SYMMETRIC, True) H.setUp() # pass the following to command line: # $ ... -methods nm,lmvm,nls,ntr,cg,blmvm,tron # to try many methods methods = OptDB.getString('methods', '') methods = methods.split(',') for meth in methods: # create TAO Solver tao = PETSc.TAO().create(PETSc.COMM_SELF) if meth: tao.setType(meth) tao.setFromOptions() # solve the problem tao.setObjectiveGradient(user.formObjGrad) tao.setObjective(user.formObjective) tao.setGradient(user.formGradient) tao.setHessian(user.formHessian, H) #app.getKSP().getPC().setFromOptions() x.set(0) # zero initial guess #tao.setInitial(x) tao.solve(x) tao.destroy() ## # this is just for testing ## x = app.getSolution() ## G = app.getGradient() ## H, HP = app.getHessian() ## f = tao.computeObjective(x) ## tao.computeGradient(x, G) ## f = tao.computeObjectiveGradient(x, G) ## tao.computeHessian(x, H, HP) petsc4py-3.15.1/demo/taosolve/chwirut.py0000644000175000017500000000346113750315427020410 0ustar balaybalay00000000000000import sys, petsc4py petsc4py.init(sys.argv) import numpy as np from petsc4py import PETSc class Chwirut(object): """ Finds the nonlinear least-squares solution to the model y = exp(-b1*x)/(b2+b3*x) + e """ def __init__(self): BETA = [0.2, 0.12, 0.08] NOBSERVATIONS = 100 NPARAMETERS = 3 np.random.seed(456) x = np.random.rand(NOBSERVATIONS) e = np.random.rand(NOBSERVATIONS) y = np.exp(-BETA[0]*x)/(BETA[1] + BETA[2]*x) + e self.NOBSERVATIONS = NOBSERVATIONS self.NPARAMETERS = NPARAMETERS self.x = x self.y = y def createVecs(self): X = PETSc.Vec().create(PETSc.COMM_SELF) X.setSizes(self.NPARAMETERS) F = PETSc.Vec().create(PETSc.COMM_SELF) F.setSizes(self.NOBSERVATIONS) return X, F def formInitialGuess(self, X): X[0] = 0.15 X[1] = 0.08 X[2] = 0.05 def formResidual(self, tao, X, F): x, y = self.x, self.y b1, b2, b3 = X.array F.array = y - np.exp(-b1*x)/(b2 + b3*x) def plotSolution(self, X): try: from matplotlib import pylab except ImportError: return b1, b2, b3 = X.array x, y = self.x, self.y u = np.linspace(x.min(), x.max(), 100) v = np.exp(-b1*u)/(b2+b3*u) pylab.plot(x, y, 'ro') pylab.plot(u, v, 'b-') pylab.show() OptDB = PETSc.Options() user = Chwirut() x, f = user.createVecs() x.setFromOptions() f.setFromOptions() tao = PETSc.TAO().create(PETSc.COMM_SELF) tao.setType(PETSc.TAO.Type.POUNDERS) tao.setResidual(user.formResidual, f) tao.setFromOptions() user.formInitialGuess(x) tao.solve(x) plot = OptDB.getBool('plot', False) if plot: user.plotSolution(x) x.destroy() f.destroy() tao.destroy() petsc4py-3.15.1/demo/wrap-swig/0000755000175000017500000000000014062764472016436 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/wrap-swig/run_demo.py0000644000175000017500000000357313750315427020623 0ustar balaybalay00000000000000import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import Bratu3D as Bratu3D class App(object): def __init__(self, da, lambda_): assert da.getDim() == 3 self.da = da self.params = Bratu3D.Params() self.params.lambda_ = lambda_ def formInitGuess(self, X): X.zeroEntries() # just in case Bratu3D.FormInitGuess(self.da, X, self.params) def formFunction(self, snes, X, F): F.zeroEntries() # just in case Bratu3D.FormFunction(self.da, X, F, self.params) def formJacobian(self, snes, X, J, P): P.zeroEntries() # just in case Bratu3D.FormJacobian(self.da, X, P, self.params) if J != P: J.assemble() # matrix-free operator return PETSc.Mat.Structure.SAME_NONZERO_PATTERN OptDB = PETSc.Options() N = OptDB.getInt('N', 16) lambda_ = OptDB.getReal('lambda', 6.0) do_plot = OptDB.getBool('plot', False) da = PETSc.DMDA().create([N, N, N], stencil_width=1) app = App(da, lambda_) snes = PETSc.SNES().create() F = da.createGlobalVec() snes.setFunction(app.formFunction, F) J = da.createMat() snes.setJacobian(app.formJacobian, J) snes.setFromOptions() X = da.createGlobalVec() app.formInitGuess(X) snes.solve(None, X) U = da.createNaturalVec() da.globalToNatural(X, U) def plot(da, U): scatter, U0 = PETSc.Scatter.toZero(U) scatter.scatter(U, U0, False, PETSc.Scatter.Mode.FORWARD) rank = PETSc.COMM_WORLD.getRank() if rank == 0: solution = U0[...].reshape(da.sizes, order='f').copy() try: from matplotlib import pyplot pyplot.contourf(solution[:, :, N//2]) pyplot.axis('equal') pyplot.show() except: pass PETSc.COMM_WORLD.barrier() scatter.destroy() U0.destroy() if do_plot: plot(da, U) U.destroy() X.destroy() F.destroy() J.destroy() da.destroy() snes.destroy() petsc4py-3.15.1/demo/wrap-swig/makefile0000644000175000017500000000112413750315427020127 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC= PYTHON=python .PHONY:test test: run clean SCRIPT=run_demo MODULE=Bratu3D .PHONY:build build: ${MODULE}.py _${MODULE}.so .PHONY:run run: build ${MPIEXEC} ${PYTHON} ${SCRIPT}.py ${MODULE}.py _${MODULE}.so: ${MODULE}.i ${MODULE}.c ${MODULE}.h CC=${CC} F90=${FC} LDSHARED='${CLINKER} -shared' \ ${PYTHON} setup.py -q build_ext --inplace ${RM} -r build ${MODULE}_wrap.c .PHONY:clean clean:: ${RM} ${MODULE}.py _${MODULE}*.so ${RM} *.py[co] ${RM} -r __pycache__ include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules MPIEXEC= petsc4py-3.15.1/demo/wrap-swig/Bratu3D.h0000644000175000017500000000046413750315427020052 0ustar balaybalay00000000000000#ifndef BRATU3D_H #define BRATU3D_H #include typedef struct Params { double lambda_; } Params; PetscErrorCode FormInitGuess(DM da, Vec x, Params *p); PetscErrorCode FormFunction(DM da, Vec x, Vec F, Params *p); PetscErrorCode FormJacobian(DM da, Vec x, Mat J, Params *p); #endif/*BRATU3D_H*/ petsc4py-3.15.1/demo/wrap-swig/Bratu3D.i0000644000175000017500000000021413750315427020044 0ustar balaybalay00000000000000%module Bratu3D %include petsc4py/petsc4py.i %{ #include "Bratu3D.h" %} %include Bratu3D.h /* * Local Variables: * mode: C * End: */ petsc4py-3.15.1/demo/wrap-swig/setup.py0000644000175000017500000000400013750315427020135 0ustar balaybalay00000000000000#!/usr/bin/env python #$ python setup.py build_ext --inplace # a bit of monkeypatching ... try: from numpy.distutils.fcompiler import FCompiler from numpy.distutils.unixccompiler import UnixCCompiler try: # Python 2 meth = UnixCCompiler.runtime_library_dir_option.im_func except AttributeError: # Python 3 meth = UnixCCompiler.runtime_library_dir_option FCompiler.runtime_library_dir_option = meth except Exception: pass def configuration(parent_package='',top_path=None): INCLUDE_DIRS = [] LIBRARY_DIRS = [] LIBRARIES = [] # PETSc import os PETSC_DIR = os.environ['PETSC_DIR'] PETSC_ARCH = os.environ.get('PETSC_ARCH', '') from os.path import join, isdir if PETSC_ARCH and isdir(join(PETSC_DIR, PETSC_ARCH)): INCLUDE_DIRS += [join(PETSC_DIR, PETSC_ARCH, 'include'), join(PETSC_DIR, 'include')] LIBRARY_DIRS += [join(PETSC_DIR, PETSC_ARCH, 'lib')] else: if PETSC_ARCH: pass # XXX should warn ... INCLUDE_DIRS += [join(PETSC_DIR, 'include')] LIBRARY_DIRS += [join(PETSC_DIR, 'lib')] LIBRARIES += [#'petscts', 'petscsnes', 'petscksp', #'petscdm', 'petscmat', 'petscvec', 'petsc'] # PETSc for Python import petsc4py INCLUDE_DIRS += [petsc4py.get_include()] # Configuration from numpy.distutils.misc_util import Configuration config = Configuration('', parent_package, top_path) config.add_extension('_Bratu3D', sources = ['Bratu3D.i', 'Bratu3D.c'], depends = ['Bratu3D.h'], include_dirs=INCLUDE_DIRS + [os.curdir], libraries=LIBRARIES, library_dirs=LIBRARY_DIRS, runtime_library_dirs=LIBRARY_DIRS) return config if __name__ == "__main__": from numpy.distutils.core import setup setup(**configuration(top_path='').todict()) petsc4py-3.15.1/demo/wrap-swig/Bratu3D.c0000644000175000017500000002152413750315427020045 0ustar balaybalay00000000000000/* ------------------------------------------------------------------------ Solid Fuel Ignition (SFI) problem. This problem is modeled by the partial differential equation -Laplacian(u) - lambda * exp(u) = 0, 0 < x,y,z < 1, with boundary conditions u = 0 for x = 0, x = 1, y = 0, y = 1, z = 0, z = 1 A finite difference approximation with the usual 7-point stencil is used to discretize the boundary value problem to obtain a nonlinear system of equations. The problem is solved in a 3D rectangular domain, using distributed arrays (DAs) to partition the parallel grid. ------------------------------------------------------------------------- */ #include "Bratu3D.h" PetscErrorCode FormInitGuess(DM da, Vec X, Params *p) { PetscInt i,j,k,Mx,My,Mz,xs,ys,zs,xm,ym,zm; PetscReal lambda,temp1,hx,hy,hz,tempk,tempj; PetscScalar ***x; PetscErrorCode ierr; PetscFunctionBegin; ierr = DMDAGetInfo(da,PETSC_IGNORE, &Mx,&My,&Mz, PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE, PETSC_IGNORE,PETSC_IGNORE, PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE, PETSC_IGNORE); lambda = p->lambda_; hx = 1.0/(PetscReal)(Mx-1); hy = 1.0/(PetscReal)(My-1); hz = 1.0/(PetscReal)(Mz-1); temp1 = lambda/(lambda + 1.0); /* Get a pointer to vector data. - For default PETSc vectors, VecGetArray() returns a pointer to the data array. Otherwise, the routine is implementation dependent. - You MUST call VecRestoreArray() when you no longer need access to the array. */ ierr = DMDAVecGetArray(da,X,&x);CHKERRQ(ierr); /* Get local grid boundaries (for 3-dimensional DMDA): - xs, ys, zs: starting grid indices (no ghost points) - xm, ym, zm: widths of local grid (no ghost points) */ ierr = DMDAGetCorners(da,&xs,&ys,&zs,&xm,&ym,&zm);CHKERRQ(ierr); /* Compute initial guess over the locally owned part of the grid */ for (k=zs; klambda_; hx = 1.0/(PetscReal)(Mx-1); hy = 1.0/(PetscReal)(My-1); hz = 1.0/(PetscReal)(Mz-1); sc = hx*hy*hz*lambda; hxhzdhy = hx*hz/hy; hyhzdhx = hy*hz/hx; hxhydhz = hx*hy/hz; ierr = DMGetLocalVector(da,&localX);CHKERRQ(ierr); /* Scatter ghost points to local vector,using the 2-step process DMGlobalToLocalBegin(),DMGlobalToLocalEnd(). By placing code between these two statements, computations can be done while messages are in transition. */ ierr = DMGlobalToLocalBegin(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); ierr = DMGlobalToLocalEnd(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); /* Get pointers to vector data. */ ierr = DMDAVecGetArray(da,localX,&x);CHKERRQ(ierr); ierr = DMDAVecGetArray(da,F,&f);CHKERRQ(ierr); /* Get local grid boundaries. */ ierr = DMDAGetCorners(da,&xs,&ys,&zs,&xm,&ym,&zm);CHKERRQ(ierr); /* Compute function over the locally owned part of the grid. */ for (k=zs; klambda_; hx = 1.0/(PetscReal)(Mx-1); hy = 1.0/(PetscReal)(My-1); hz = 1.0/(PetscReal)(Mz-1); sc = hx*hy*hz*lambda; hxhzdhy = hx*hz/hy; hyhzdhx = hy*hz/hx; hxhydhz = hx*hy/hz; ierr = DMGetLocalVector(da,&localX);CHKERRQ(ierr); /* Scatter ghost points to local vector, using the 2-step process DMGlobalToLocalBegin(), DMGlobalToLocalEnd(). By placing code between these two statements, computations can be done while messages are in transition. */ ierr = DMGlobalToLocalBegin(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); ierr = DMGlobalToLocalEnd(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); /* Get pointer to vector data. */ ierr = DMDAVecGetArray(da,localX,&x);CHKERRQ(ierr); /* Get local grid boundaries. */ ierr = DMDAGetCorners(da,&xs,&ys,&zs,&xm,&ym,&zm);CHKERRQ(ierr); /* Compute entries for the locally owned part of the Jacobian. - Currently, all PETSc parallel matrix formats are partitioned by contiguous chunks of rows across the processors. - Each processor needs to insert only elements that it owns locally (but any non-local elements will be sent to the appropriate processor during matrix assembly). - Here, we set all entries for a particular row at once. - We can set matrix entries either using either MatSetValuesLocal() or MatSetValues(), as discussed above. */ for (k=zs; k 0 : J = I-n; A[I,J] = offdx if i< m-1: J = I+n; A[I,J] = offdx if j> 0 : J = I-1; A[I,J] = offdy if j< n-1: J = I+1; A[I,J] = offdy # communicate off-processor values # and setup internal data structures # for performing parallel operations A.assemblyBegin() A.assemblyEnd() petsc4py-3.15.1/demo/kspsolve/petsc-cg.py0000644000175000017500000000133613750315427020441 0ustar balaybalay00000000000000def cg(A, b, x, imax=50, eps=1e-6): """ A, b, x : matrix, rhs, solution imax : maximum allowed iterations eps : tolerance for convergence """ # allocate work vectors r = b.duplicate() d = b.duplicate() q = b.duplicate() # initialization i = 0 A.mult(x, r) r.aypx(-1, b) r.copy(d) delta_0 = r.dot(r) delta = delta_0 # enter iteration loop while i < imax and \ delta > delta_0 * eps**2: A.mult(d, q) alpha = delta / d.dot(q) x.axpy(+alpha, d) r.axpy(-alpha, q) delta_old = delta delta = r.dot(r) beta = delta / delta_old d.aypx(beta, r) i = i + 1 return i, delta**0.5 petsc4py-3.15.1/demo/ode/0000755000175000017500000000000014062764472015265 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/ode/heat.py0000644000175000017500000001325613750315427016562 0ustar balaybalay00000000000000# Solves Heat equation on a periodic domain, using raw VecScatter from __future__ import division import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc from mpi4py import MPI import numpy class Heat(object): def __init__(self,comm,N): self.comm = comm self.N = N # global problem size self.h = 1/N # grid spacing on unit interval self.n = N // comm.size + int(comm.rank < (N % comm.size)) # owned part of global problem self.start = comm.exscan(self.n) if comm.rank == 0: self.start = 0 gindices = numpy.arange(self.start-1, self.start+self.n+1, dtype=int) % N # periodic self.mat = PETSc.Mat().create(comm=comm) size = (self.n, self.N) # local and global sizes self.mat.setSizes((size,size)) self.mat.setFromOptions() self.mat.setPreallocationNNZ((3,1)) # Conservative preallocation for 3 "local" columns and one non-local # Allow matrix insertion using local indices [0:n+2] lgmap = PETSc.LGMap().create(list(gindices), comm=comm) self.mat.setLGMap(lgmap, lgmap) # Global and local vectors self.gvec = self.mat.createVecRight() self.lvec = PETSc.Vec().create(comm=PETSc.COMM_SELF) self.lvec.setSizes(self.n+2) self.lvec.setUp() # Configure scatter from global to local isg = PETSc.IS().createGeneral(list(gindices), comm=comm) self.g2l = PETSc.Scatter().create(self.gvec, isg, self.lvec, None) self.tozero, self.zvec = PETSc.Scatter.toZero(self.gvec) self.history = [] if False: # Print some diagnostics print('[%d] local size %d, global size %d, starting offset %d' % (comm.rank, self.n, self.N, self.start)) self.gvec.setArray(numpy.arange(self.start,self.start+self.n)) self.gvec.view() self.g2l.scatter(self.gvec, self.lvec, PETSc.InsertMode.INSERT) for rank in range(comm.size): if rank == comm.rank: print('Contents of local Vec on rank %d' % rank) self.lvec.view() comm.barrier() def evalSolution(self, t, x): assert t == 0.0, "only for t=0.0" coord = numpy.arange(self.start, self.start+self.n) / self.N x.setArray((numpy.abs(coord-0.5) < 0.1) * 1.0) def evalFunction(self, ts, t, x, xdot, f): self.g2l.scatter(x, self.lvec, PETSc.InsertMode.INSERT) # lvec is a work vector h = self.h with self.lvec as u, xdot as udot: f.setArray(udot*h + 2*u[1:-1]/h - u[:-2]/h - u[2:]/h) # Scale equation by volume element def evalJacobian(self, ts, t, x, xdot, a, A, B): h = self.h for i in range(self.n): lidx = i + 1 gidx = self.start + i B.setValuesLocal([lidx], [lidx-1,lidx,lidx+1], [-1/h, a*h+2/h, -1/h]) B.assemble() if A != B: A.assemble() # If operator is different from preconditioning matrix return True # same nonzero pattern def monitor(self, ts, i, t, x): if self.history: lasti, lastt, lastx = self.history[-1] if i < lasti + 4 or t < lastt + 1e-4: return self.tozero.scatter(x, self.zvec, PETSc.InsertMode.INSERT) xx = self.zvec[:].tolist() self.history.append((i, t, xx)) def plotHistory(self): try: from matplotlib import pylab, rcParams except ImportError: print("matplotlib not available") raise SystemExit rcParams.update({'text.usetex':True, 'figure.figsize':(10,6)}) #rc('figure', figsize=(600,400)) pylab.title('Heat: TS \\texttt{%s}' % ts.getType()) x = numpy.arange(self.N) / self.N for i,t,u in self.history: pylab.plot(x, u, label='step=%d t=%8.2g'%(i,t)) pylab.xlabel('$x$') pylab.ylabel('$u$') pylab.legend(loc='upper right') pylab.savefig('heat-history.png') #pylab.show() OptDB = PETSc.Options() ode = Heat(MPI.COMM_WORLD, OptDB.getInt('n',100)) x = ode.gvec.duplicate() f = ode.gvec.duplicate() ts = PETSc.TS().create(comm=ode.comm) ts.setType(ts.Type.ROSW) # Rosenbrock-W. ARKIMEX is a nonlinearly implicit alternative. ts.setIFunction(ode.evalFunction, ode.gvec) ts.setIJacobian(ode.evalJacobian, ode.mat) ts.setMonitor(ode.monitor) ts.setTime(0.0) ts.setTimeStep(ode.h**2) ts.setMaxTime(1) ts.setMaxSteps(100) ts.setExactFinalTime(PETSc.TS.ExactFinalTime.INTERPOLATE) ts.setMaxSNESFailures(-1) # allow an unlimited number of failures (step will be rejected and retried) snes = ts.getSNES() # Nonlinear solver snes.setTolerances(max_it=10) # Stop nonlinear solve after 10 iterations (TS will retry with shorter step) ksp = snes.getKSP() # Linear solver ksp.setType(ksp.Type.CG) # Conjugate gradients pc = ksp.getPC() # Preconditioner if False: # Configure algebraic multigrid, could use run-time options instead pc.setType(pc.Type.GAMG) # PETSc's native AMG implementation, mostly based on smoothed aggregation OptDB['mg_coarse_pc_type'] = 'svd' # more specific multigrid options OptDB['mg_levels_pc_type'] = 'sor' ts.setFromOptions() # Apply run-time options, e.g. -ts_adapt_monitor -ts_type arkimex -snes_converged_reason ode.evalSolution(0.0, x) ts.solve(x) if ode.comm.rank == 0: print('steps %d (%d rejected, %d SNES fails), nonlinear its %d, linear its %d' % (ts.getStepNumber(), ts.getStepRejections(), ts.getSNESFailures(), ts.getSNESIterations(), ts.getKSPIterations())) if OptDB.getBool('plot_history', True) and ode.comm.rank == 0: ode.plotHistory() petsc4py-3.15.1/demo/ode/ce.py0000644000175000017500000000346513750315427016231 0ustar balaybalay00000000000000# Stiff scalar valued ODE problem with an exact solution import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc from math import sin, cos, exp class CE(object): n = 1 comm = PETSc.COMM_SELF def __init__(self, lambda_=1.0): self.lambda_ = lambda_ def evalSolution(self, t, x): l = self.lambda_ x[0] = l/(l*l+1)*(l*cos(t)+sin(t)) - l*l/(l*l+1)*exp(-l*t) x.assemble() def evalFunction(self, ts, t, x, xdot, f): l = self.lambda_ f[0] = xdot[0] + l*(x[0] - cos(t)) f.assemble() def evalJacobian(self, ts, t, x, xdot, a, A, B): J = B l = self.lambda_ J[0,0] = a + l J.assemble() if A != B: A.assemble() return True # same nonzero pattern OptDB = PETSc.Options() lambda_ = OptDB.getScalar('lambda', 10.0) ode = CE(lambda_) J = PETSc.Mat().createDense([ode.n,ode.n], comm=ode.comm) J.setUp() x = PETSc.Vec().createSeq(ode.n, comm=ode.comm) f = x.duplicate() ts = PETSc.TS().create(comm=ode.comm) ts.setProblemType(ts.ProblemType.NONLINEAR) ts.setType(ts.Type.GLLE) ts.setIFunction(ode.evalFunction, f) ts.setIJacobian(ode.evalJacobian, J) ts.setTime(0.0) ts.setTimeStep(0.001) ts.setMaxTime(10) ts.setMaxSteps(10000) ts.setExactFinalTime(PETSc.TS.ExactFinalTime.INTERPOLATE) class Monitor(object): def __init__(self, ode): self.ode = ode self.x = PETSc.Vec().createSeq(ode.n, comm=ode.comm) def __call__(self, ts, k, t, x): ode.evalSolution(t, self.x) self.x.axpy(-1, x) e = self.x.norm() h = ts.getTimeStep() PETSc.Sys.Print("step %3d t=%8.2e h=%8.2e error=%8.2e" % (k, t, h, e), comm=self.ode.comm) ts.setMonitor(Monitor(ode)) ts.setFromOptions() ode.evalSolution(0.0, x) ts.solve(x) del ode, J, x, f, ts petsc4py-3.15.1/demo/ode/orego.py0000644000175000017500000000727113750315427016754 0ustar balaybalay00000000000000# Oregonator: stiff 3-variable oscillatory ODE system from chemical reactions, # problem OREGO in Hairer&Wanner volume 2 # See also http://www.scholarpedia.org/article/Oregonator import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc class Orego(object): n = 3 comm = PETSc.COMM_SELF def evalSolution(self, t, x): assert t == 0.0, "only for t=0.0" x.setArray([1, 2, 3]) def evalFunction(self, ts, t, x, xdot, f): f.setArray([xdot[0] - 77.27*(x[1] + x[0]*(1 - 8.375e-6*x[0] - x[1])), xdot[1] - 1/77.27*(x[2] - (1 + x[0])*x[1]), xdot[2] - 0.161*(x[0] - x[2])]) def evalJacobian(self, ts, t, x, xdot, a, A, B): B[:,:] = [[a - 77.27*((1 - 8.375e-6*x[0] - x[1]) - 8.375e-6*x[0]), -77.27*(1 - x[0]), 0], [1/77.27*x[1], a + 1/77.27*(1 + x[0]), -1/77.27], [-0.161, 0, a + 0.161]] B.assemble() if A != B: A.assemble() return True # same nonzero pattern OptDB = PETSc.Options() ode = Orego() J = PETSc.Mat().createDense([ode.n, ode.n], comm=ode.comm) J.setUp() x = PETSc.Vec().createSeq(ode.n, comm=ode.comm) f = x.duplicate() ts = PETSc.TS().create(comm=ode.comm) ts.setType(ts.Type.ROSW) # Rosenbrock-W. ARKIMEX is a nonlinearly implicit alternative. ts.setIFunction(ode.evalFunction, f) ts.setIJacobian(ode.evalJacobian, J) history = [] def monitor(ts, i, t, x): xx = x[:].tolist() history.append((i, t, xx)) ts.setMonitor(monitor) ts.setTime(0.0) ts.setTimeStep(0.1) ts.setMaxTime(360) ts.setMaxSteps(2000) ts.setExactFinalTime(PETSc.TS.ExactFinalTime.INTERPOLATE) ts.setMaxSNESFailures(-1) # allow an unlimited number of failures (step will be rejected and retried) # Set a different tolerance on each variable. Can use a scalar or a vector for either or both atol and rtol. vatol = x.duplicate(array=[1e-2, 1e-1, 1e-4]) ts.setTolerances(atol=vatol,rtol=1e-3) # adaptive controller attempts to match this tolerance snes = ts.getSNES() # Nonlinear solver snes.setTolerances(max_it=10) # Stop nonlinear solve after 10 iterations (TS will retry with shorter step) ksp = snes.getKSP() # Linear solver ksp.setType(ksp.Type.PREONLY) # Just use the preconditioner without a Krylov method pc = ksp.getPC() # Preconditioner pc.setType(pc.Type.LU) # Use a direct solve ts.setFromOptions() # Apply run-time options, e.g. -ts_adapt_monitor -ts_type arkimex -snes_converged_reason ode.evalSolution(0.0, x) ts.solve(x) print('steps %d (%d rejected, %d SNES fails), nonlinear its %d, linear its %d' % (ts.getStepNumber(), ts.getStepRejections(), ts.getSNESFailures(), ts.getSNESIterations(), ts.getKSPIterations())) if OptDB.getBool('plot_history', True): try: from matplotlib import pylab from matplotlib import rc except ImportError: print("matplotlib not available") raise SystemExit import numpy as np ii = np.asarray([v[0] for v in history]) tt = np.asarray([v[1] for v in history]) xx = np.asarray([v[2] for v in history]) rc('text', usetex=True) pylab.suptitle('Oregonator: TS \\texttt{%s}' % ts.getType()) pylab.subplot(2,2,1) pylab.subplots_adjust(wspace=0.3) pylab.semilogy(ii[:-1], np.diff(tt), ) pylab.xlabel('step number') pylab.ylabel('timestep') for i in range(0,3): pylab.subplot(2,2,i+2) pylab.semilogy(tt, xx[:,i], "rgb"[i]) pylab.xlabel('time') pylab.ylabel('$x_%d$' % i) # pylab.savefig('orego-history.png') pylab.show() petsc4py-3.15.1/demo/ode/vanderpol.py0000644000175000017500000001122713750315427017627 0ustar balaybalay00000000000000# Testing TSAdjoint and matrix-free Jacobian import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc class VDP(object): n = 2 comm = PETSc.COMM_SELF def __init__(self, mu_=1.0e3,mf_=False): self.mu_ = mu_ self.mf_ = mf_ if self.mf_: self.J_ = PETSc.Mat().createDense([self.n,self.n], comm=self.comm) self.J_.setUp() self.Jp_ = PETSc.Mat().createDense([self.n,1], comm=self.comm) self.Jp_.setUp() def initialCondition(self, u): mu = self.mu_ u[0] = 2.0 u[1] = -2.0/3.0 + 10.0/(81.0*mu) - 292.0/(2187.0*mu*mu) u.assemble() def evalFunction(self, ts, t, u, f): mu = self.mu_ f[0] = u[1] f[1] = mu*((1.-u[0]*u[0])*u[1]-u[0]) f.assemble() def evalJacobian(self, ts, t, u, A, B): if not self.mf_: J = A else : J = self.J_ mu = self.mu_ J[0,0] = 0 J[1,0] = -mu*(2.0*u[1]*u[0]+1.) J[0,1] = 1.0 J[1,1] = mu*(1.0-u[0]*u[0]) J.assemble() if A != B: B.assemble() return True # same nonzero pattern def evalJacobianP(self, ts, t, u, C): if not self.mf_: Jp = C else: Jp = self.Jp_ Jp[0,0] = 0 Jp[1,0] = (1.-u[0]*u[0])*u[1]-u[0] Jp.assemble() return True def evalIFunction(self, ts, t, u, udot, f): mu = self.mu_ f[0] = udot[0]-u[1] f[1] = udot[1]-mu*((1.-u[0]*u[0])*u[1]-u[0]) f.assemble() def evalIJacobian(self, ts, t, u, udot, shift, A, B): if not self.mf_: J = A else : J = self.J_ mu = self.mu_ J[0,0] = shift J[1,0] = mu*(2.0*u[1]*u[0]+1.) J[0,1] = -1.0 J[1,1] = shift-mu*(1.0-u[0]*u[0]) J.assemble() if A != B: B.assemble() return True # same nonzero pattern def evalIJacobianP(self, ts, t, u, udot, shift, C): if not self.mf_: Jp = C else: Jp = self.Jp_ Jp[0,0] = 0 Jp[1,0] = u[0]-(1.-u[0]*u[0])*u[1] Jp.assemble() return True class JacShell: def __init__(self, ode): self.ode_ = ode def mult(self, A, x, y): "y <- A * x" self.ode_.J_.mult(x,y) def multTranspose(self, A, x, y): "y <- A' * x" self.ode_.J_.multTranspose(x, y) class JacPShell: def __init__(self, ode): self.ode_ = ode def multTranspose(self, A, x, y): "y <- A' * x" self.ode_.Jp_.multTranspose(x, y) OptDB = PETSc.Options() mu_ = OptDB.getScalar('mu', 1.0e3) mf_ = OptDB.getBool('mf', False) implicitform_ = OptDB.getBool('implicitform', False) ode = VDP(mu_,mf_) if not mf_: J = PETSc.Mat().createDense([ode.n,ode.n], comm=ode.comm) J.setUp() Jp = PETSc.Mat().createDense([ode.n,1], comm=ode.comm) Jp.setUp() else: J = PETSc.Mat().create() J.setSizes([ode.n,ode.n]) J.setType('python') shell = JacShell(ode) J.setPythonContext(shell) J.setUp() J.assemble() Jp = PETSc.Mat().create() Jp.setSizes([ode.n,1]) Jp.setType('python') shell = JacPShell(ode) Jp.setPythonContext(shell) Jp.setUp() Jp.assemble() u = PETSc.Vec().createSeq(ode.n, comm=ode.comm) f = u.duplicate() adj_u = [] adj_u.append(PETSc.Vec().createSeq(ode.n, comm=ode.comm)) adj_u.append(PETSc.Vec().createSeq(ode.n, comm=ode.comm)) adj_p = [] adj_p.append(PETSc.Vec().createSeq(1, comm=ode.comm)) adj_p.append(PETSc.Vec().createSeq(1, comm=ode.comm)) ts = PETSc.TS().create(comm=ode.comm) ts.setProblemType(ts.ProblemType.NONLINEAR) if implicitform_: ts.setType(ts.Type.CN) ts.setIFunction(ode.evalIFunction, f) ts.setIJacobian(ode.evalIJacobian, J) ts.setIJacobianP(ode.evalIJacobianP, Jp) else: ts.setType(ts.Type.RK) ts.setRHSFunction(ode.evalFunction, f) ts.setRHSJacobian(ode.evalJacobian, J) ts.setRHSJacobianP(ode.evalJacobianP, Jp) ts.setSaveTrajectory() ts.setTime(0.0) ts.setTimeStep(0.001) ts.setMaxTime(0.5) ts.setMaxSteps(1000) ts.setExactFinalTime(PETSc.TS.ExactFinalTime.MATCHSTEP) ts.setFromOptions() ode.initialCondition(u) ts.solve(u) adj_u[0][0] = 1 adj_u[0][1] = 0 adj_u[0].assemble() adj_u[1][0] = 0 adj_u[1][1] = 1 adj_u[1].assemble() adj_p[0][0] = 0 adj_p[0].assemble() adj_p[1][0] = 0 adj_p[1].assemble() ts.setCostGradients(adj_u,adj_p) ts.adjointSolve() adj_u[0].view() adj_u[1].view() adj_p[0].view() adj_p[1].view() def compute_derp(du,dp): print(du[1]*(-10.0/(81.0*mu_*mu_)+2.0*292.0/(2187.0*mu_*mu_*mu_))+dp[0]) compute_derp(adj_u[0],adj_p[0]) compute_derp(adj_u[1],adj_p[1]) del ode, J, Jp, u, f, ts, adj_u, adj_p petsc4py-3.15.1/demo/ode/rober.py0000644000175000017500000000430413750315427016744 0ustar balaybalay00000000000000# Stiff 3-variable ODE system from chemical reactions, # due to Robertson (1966), # problem ROBER in Hairer&Wanner, ODE 2, 1996 import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc class Rober(object): n = 3 comm = PETSc.COMM_SELF def evalSolution(self, t, x): assert t == 0.0, "only for t=0.0" x[:] = [1, 0, 0] x.assemble() def evalFunction(self, ts, t, x, xdot, f): f[:] = [xdot[0] + 0.04*x[0] - 1e4*x[1]*x[2], xdot[1] - 0.04*x[0] + 1e4*x[1]*x[2] + 3e7*x[1]**2, xdot[2] - 3e7*x[1]**2] f.assemble() def evalJacobian(self, ts, t, x, xdot, a, A, B): J = B J[:,:] = [[a + 0.04, -1e4*x[2], -1e4*x[1]], [-0.04, a + 1e4*x[2] + 3e7*2*x[1], 1e4*x[1]], [0, -3e7*2*x[1], a]] J.assemble() if A != B: A.assemble() return True # same nonzero pattern OptDB = PETSc.Options() ode = Rober() J = PETSc.Mat().createDense([ode.n, ode.n], comm=ode.comm) J.setUp() x = PETSc.Vec().createSeq(ode.n, comm=ode.comm) f = x.duplicate() ts = PETSc.TS().create(comm=ode.comm) ts.setProblemType(ts.ProblemType.NONLINEAR) ts.setType(ts.Type.THETA) ts.setIFunction(ode.evalFunction, f) ts.setIJacobian(ode.evalJacobian, J) history = [] def monitor(ts, i, t, x): xx = x[:].tolist() history.append((i, t, xx)) ts.setMonitor(monitor) ts.setTime(0.0) ts.setTimeStep(.001) ts.setMaxTime(1e30) ts.setMaxSteps(100) ts.setExactFinalTime(PETSc.TS.ExactFinalTime.INTERPOLATE) ts.setFromOptions() ode.evalSolution(0.0, x) ts.solve(x) del ode, J, x, ts try: from matplotlib import pylab except ImportError: print("matplotlib not available") raise SystemExit import numpy as np ii = np.asarray([v[0] for v in history]) tt = np.asarray([v[1] for v in history]) xx = np.asarray([v[2] for v in history]) pylab.suptitle('Rober') pylab.subplot(2,2,1) pylab.subplots_adjust(wspace=0.3) pylab.semilogy(ii[:-1], np.diff(tt), ) pylab.xlabel('step number') pylab.ylabel('timestep') for i in range(0,3): pylab.subplot(2,2,i+2) pylab.semilogx(tt, xx[:,i], "rgb"[i]) pylab.xlabel('t') pylab.ylabel('x%d' % i) pylab.show() petsc4py-3.15.1/demo/ode/bouncing_ball.py0000644000175000017500000000322514030740317020422 0ustar balaybalay00000000000000import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc class BouncingBall(object): n = 2 comm = PETSc.COMM_SELF def __init__(self): pass def initialCondition(self, u): u[0] = 0.0 u[1] = 20.0 u.assemble() def evalRHSFunction(self, ts, t, u, f): f[0] = u[1] f[1] = -9.8 f.assemble() def evalRHSJacobian(self, ts, t, u, A, B): J = A J[0,0] = 0.0 J[1,0] = 0.0 J[0,1] = 1.0 J[1,1] = 0.0 J.assemble() if A != B: B.assemble() return True # same nonzero pattern class Monitor(object): def __init__(self): pass def __call__(self, ts, k, t, x): PETSc.Sys.Print(f"Position at time {t}: {x[0]}") ode = BouncingBall() J = PETSc.Mat().create() J.setSizes([ode.n,ode.n]) J.setType('aij') J.setUp() J.assemble() u = PETSc.Vec().createSeq(ode.n, comm=ode.comm) f = u.duplicate() ts = PETSc.TS().create(comm=ode.comm) ts.setProblemType(ts.ProblemType.NONLINEAR) ts.setType(ts.Type.BEULER) ts.setRHSFunction(ode.evalRHSFunction, f) ts.setRHSJacobian(ode.evalRHSJacobian, J) #ts.setSaveTrajectory() ts.setTime(0.0) ts.setTimeStep(0.01) ts.setMaxTime(15.0) #ts.setMaxSteps(1000) ts.setExactFinalTime(PETSc.TS.ExactFinalTime.MATCHSTEP) #ts.setMonitor(Monitor()) direction = [-1] terminate = [False] def event(ts, t, X, fvalue): fvalue[0] = X[0] def postevent(ts, events, t, X, forward): X[0] = 0.0 X[1] = -0.9*X[1] X.assemble() ts.setEventHandler(direction, terminate, event, postevent) ts.setEventTolerances(1e-6, vtol=[1e-9]) ts.setFromOptions() ode.initialCondition(u) ts.solve(u) petsc4py-3.15.1/demo/wrap-cython/0000755000175000017500000000000014062764472016771 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/wrap-cython/run_demo.py0000644000175000017500000000243713750315427021154 0ustar balaybalay00000000000000import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import Bratu3D as Bratu3D OptDB = PETSc.Options() N = OptDB.getInt('N', 16) lambda_ = OptDB.getReal('lambda', 6.0) do_plot = OptDB.getBool('plot', False) da = PETSc.DMDA().create([N, N, N], stencil_width=1) #app = App(da, lambda_) snes = PETSc.SNES().create() F = da.createGlobalVec() snes.setFunction(Bratu3D.formFunction, F, args=(da, lambda_)) J = da.createMat() snes.setJacobian(Bratu3D.formJacobian, J, args=(da, lambda_)) snes.setFromOptions() X = da.createGlobalVec() Bratu3D.formInitGuess(X, da, lambda_) snes.solve(None, X) U = da.createNaturalVec() da.globalToNatural(X, U) def plot(da, U): scatter, U0 = PETSc.Scatter.toZero(U) scatter.scatter(U, U0, False, PETSc.Scatter.Mode.FORWARD) rank = PETSc.COMM_WORLD.getRank() if rank == 0: solution = U0[...].reshape(da.sizes, order='f').copy() try: from matplotlib import pyplot pyplot.contourf(solution[:, :, N//2]) pyplot.axis('equal') pyplot.show() except: pass PETSc.COMM_WORLD.barrier() scatter.destroy() U0.destroy() if do_plot: plot(da, U) U.destroy() X.destroy() F.destroy() J.destroy() da.destroy() snes.destroy() petsc4py-3.15.1/demo/wrap-cython/makefile0000644000175000017500000000103513750315427020463 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC= PYTHON=python .PHONY:test test: run clean SCRIPT=run_demo MODULE=Bratu3D .PHONY:build build: ${MODULE}.so .PHONY:run run: build ${MPIEXEC} ${PYTHON} ${SCRIPT}.py ${MODULE}.so: ${MODULE}.pyx ${MODULE}impl.h ${MODULE}impl.c CC=${CC} F90=${FC} \ ${PYTHON} setup.py -q build_ext --inplace ${RM} -r build ${MODULE}.c .PHONY:clean clean:: ${RM} ${MODULE}.c ${MODULE}*.so ${RM} *.py[co] ${RM} -r __pycache__ include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules MPIEXEC= petsc4py-3.15.1/demo/wrap-cython/Bratu3D.pyx0000644000175000017500000000227013750315427020773 0ustar balaybalay00000000000000from petsc4py.PETSc cimport Vec, PetscVec from petsc4py.PETSc cimport Mat, PetscMat from petsc4py.PETSc cimport DM, PetscDM from petsc4py.PETSc cimport SNES, PetscSNES from petsc4py.PETSc import Error cdef extern from "Bratu3Dimpl.h": ctypedef struct Params: double lambda_ int FormInitGuess(PetscDM da, PetscVec x, Params *p) int FormFunction (PetscDM da, PetscVec x, PetscVec F, Params *p) int FormJacobian (PetscDM da, PetscVec x, PetscMat J, Params *p) def formInitGuess(Vec x, DM da, double lambda_): cdef int ierr cdef Params p = {"lambda_" : lambda_} ierr = FormInitGuess(da.dm, x.vec, &p) if ierr != 0: raise Error(ierr) def formFunction(SNES snes, Vec x, Vec f, DM da, double lambda_): cdef int ierr cdef Params p = {"lambda_" : lambda_} ierr = FormFunction(da.dm, x.vec, f.vec, &p) if ierr != 0: raise Error(ierr) def formJacobian(SNES snes, Vec x, Mat J, Mat P, DM da, double lambda_): cdef int ierr cdef Params p = {"lambda_" : lambda_} ierr = FormJacobian(da.dm, x.vec, P.mat, &p) if ierr != 0: raise Error(ierr) if J != P: J.assemble() # for matrix-free operator return Mat.Structure.SAME_NONZERO_PATTERN petsc4py-3.15.1/demo/wrap-cython/setup.py0000644000175000017500000000272213750315427020501 0ustar balaybalay00000000000000#!/usr/bin/env python #$ python setup.py build_ext --inplace from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize import numpy import petsc4py def configure(): INCLUDE_DIRS = [] LIBRARY_DIRS = [] LIBRARIES = [] # PETSc import os PETSC_DIR = os.environ['PETSC_DIR'] PETSC_ARCH = os.environ.get('PETSC_ARCH', '') from os.path import join, isdir if PETSC_ARCH and isdir(join(PETSC_DIR, PETSC_ARCH)): INCLUDE_DIRS += [join(PETSC_DIR, PETSC_ARCH, 'include'), join(PETSC_DIR, 'include')] LIBRARY_DIRS += [join(PETSC_DIR, PETSC_ARCH, 'lib')] else: if PETSC_ARCH: pass # XXX should warn ... INCLUDE_DIRS += [join(PETSC_DIR, 'include')] LIBRARY_DIRS += [join(PETSC_DIR, 'lib')] LIBRARIES += ['petsc'] # PETSc for Python INCLUDE_DIRS += [petsc4py.get_include()] # NumPy INCLUDE_DIRS += [numpy.get_include()] return dict( include_dirs=INCLUDE_DIRS + [os.curdir], libraries=LIBRARIES, library_dirs=LIBRARY_DIRS, runtime_library_dirs=LIBRARY_DIRS, ) extensions = [ Extension('Bratu3D', sources = ['Bratu3D.pyx', 'Bratu3Dimpl.c'], depends = ['Bratu3Dimpl.h'], **configure()), ] setup(name = "Bratu3D", ext_modules = cythonize( extensions, include_path=[petsc4py.get_include()]), ) petsc4py-3.15.1/demo/wrap-cython/Bratu3Dimpl.h0000644000175000017500000000047013750315427021264 0ustar balaybalay00000000000000#ifndef BRATU3D_H #define BRATU3D_H #include typedef struct Params { double lambda_; } Params; PetscErrorCode FormInitGuess(DM da, Vec x, Params *p); PetscErrorCode FormFunction(DM da, Vec x, Vec F, Params *p); PetscErrorCode FormJacobian(DM da, Vec x, Mat J, Params *p); #endif /* !BRATU3D_H */ petsc4py-3.15.1/demo/wrap-cython/Bratu3Dimpl.c0000644000175000017500000002156013750315427021262 0ustar balaybalay00000000000000/* ------------------------------------------------------------------------ Solid Fuel Ignition (SFI) problem. This problem is modeled by the partial differential equation -Laplacian(u) - lambda * exp(u) = 0, 0 < x,y,z < 1, with boundary conditions u = 0 for x = 0, x = 1, y = 0, y = 1, z = 0, z = 1 A finite difference approximation with the usual 7-point stencil is used to discretize the boundary value problem to obtain a nonlinear system of equations. The problem is solved in a 3D rectangular domain, using distributed arrays (DAs) to partition the parallel grid. ------------------------------------------------------------------------- */ #include "Bratu3Dimpl.h" PetscErrorCode FormInitGuess(DM da, Vec X, Params *p) { PetscInt i,j,k,Mx,My,Mz,xs,ys,zs,xm,ym,zm; PetscReal lambda,temp1,hx,hy,hz,tempk,tempj; PetscScalar ***x; PetscErrorCode ierr; PetscFunctionBegin; ierr = DMDAGetInfo(da,PETSC_IGNORE, &Mx,&My,&Mz, PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE, PETSC_IGNORE,PETSC_IGNORE, PETSC_IGNORE,PETSC_IGNORE,PETSC_IGNORE, PETSC_IGNORE); lambda = p->lambda_; hx = 1.0/(PetscReal)(Mx-1); hy = 1.0/(PetscReal)(My-1); hz = 1.0/(PetscReal)(Mz-1); temp1 = lambda/(lambda + 1.0); /* Get a pointer to vector data. - For default PETSc vectors, VecGetArray() returns a pointer to the data array. Otherwise, the routine is implementation dependent. - You MUST call VecRestoreArray() when you no longer need access to the array. */ ierr = DMDAVecGetArray(da,X,&x);CHKERRQ(ierr); /* Get local grid boundaries (for 3-dimensional DMDA): - xs, ys, zs: starting grid indices (no ghost points) - xm, ym, zm: widths of local grid (no ghost points) */ ierr = DMDAGetCorners(da,&xs,&ys,&zs,&xm,&ym,&zm);CHKERRQ(ierr); /* Compute initial guess over the locally owned part of the grid */ for (k=zs; klambda_; hx = 1.0/(PetscReal)(Mx-1); hy = 1.0/(PetscReal)(My-1); hz = 1.0/(PetscReal)(Mz-1); sc = hx*hy*hz*lambda; hxhzdhy = hx*hz/hy; hyhzdhx = hy*hz/hx; hxhydhz = hx*hy/hz; /* */ ierr = DMGetLocalVector(da,&localX);CHKERRQ(ierr); /* Scatter ghost points to local vector,using the 2-step process DMGlobalToLocalBegin(),DMGlobalToLocalEnd(). By placing code between these two statements, computations can be done while messages are in transition. */ ierr = DMGlobalToLocalBegin(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); ierr = DMGlobalToLocalEnd(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); /* Get pointers to vector data. */ ierr = DMDAVecGetArray(da,localX,&x);CHKERRQ(ierr); ierr = DMDAVecGetArray(da,F,&f);CHKERRQ(ierr); /* Get local grid boundaries. */ ierr = DMDAGetCorners(da,&xs,&ys,&zs,&xm,&ym,&zm);CHKERRQ(ierr); /* Compute function over the locally owned part of the grid. */ for (k=zs; klambda_; hx = 1.0/(PetscReal)(Mx-1); hy = 1.0/(PetscReal)(My-1); hz = 1.0/(PetscReal)(Mz-1); sc = hx*hy*hz*lambda; hxhzdhy = hx*hz/hy; hyhzdhx = hy*hz/hx; hxhydhz = hx*hy/hz; /* */ ierr = DMGetLocalVector(da,&localX);CHKERRQ(ierr); /* Scatter ghost points to local vector, using the 2-step process DMGlobalToLocalBegin(), DMGlobalToLocalEnd(). By placing code between these two statements, computations can be done while messages are in transition. */ ierr = DMGlobalToLocalBegin(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); ierr = DMGlobalToLocalEnd(da,X,INSERT_VALUES,localX);CHKERRQ(ierr); /* Get pointer to vector data. */ ierr = DMDAVecGetArray(da,localX,&x);CHKERRQ(ierr); /* Get local grid boundaries. */ ierr = DMDAGetCorners(da,&xs,&ys,&zs,&xm,&ym,&zm);CHKERRQ(ierr); /* Compute entries for the locally owned part of the Jacobian. - Currently, all PETSc parallel matrix formats are partitioned by contiguous chunks of rows across the processors. - Each processor needs to insert only elements that it owns locally (but any non-local elements will be sent to the appropriate processor during matrix assembly). - Here, we set all entries for a particular row at once. - We can set matrix entries either using either MatSetValuesLocal() or MatSetValues(), as discussed above. */ for (k=zs; k0 : J = I-n; A[I,J] = -1 if i0 : J = I-1; A[I,J] = -1 if j x(2:m-1, 2:n-1) ! center uN => x(2:m-1, 1:n-2) ! north uS => x(2:m-1, 3:n ) ! south uW => x(1:m-2, 2:n-1) ! west uE => x(3:m, 2:n-1) ! east ! compute nonlinear function hx = 1.0/(m-1) ! x grid spacing hy = 1.0/(n-1) ! y grid spacing f(:,:) = x f(2:m-1, 2:n-1) = & (2*u - uE - uW) * (hy/hx) & + (2*u - uN - uS) * (hx/hy) & - alpha * exp(u) * (hx*hy) end subroutine bratu2d petsc4py-3.15.1/demo/bratu3d/0000755000175000017500000000000014062764472016062 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/bratu3d/makefile0000644000175000017500000000047613750315427017564 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC= PYTHON=python .PHONY:test test: run clean .PHONY:run run: run_fd run_mf .PHONY:run_fd run_fd: ${MPIEXEC} ${PYTHON} bratu3d.py -fd -nx 7 -ny 8 -nz 9 .PHONY:run_mf run_mf: ${MPIEXEC} ${PYTHON} bratu3d.py -mf -nx 9 -ny 8 -nz 7 .PHONY:clean clean: ${RM} *.py[co] ${RM} -r __pycache__ petsc4py-3.15.1/demo/bratu3d/bratu3d.py0000644000175000017500000001533213750315427017777 0ustar balaybalay00000000000000# ------------------------------------------------------------------------ # # Solid Fuel Ignition (SFI) problem. This problem is modeled by the # partial differential equation # # -Laplacian(u) - lambda * exp(u) = 0, 0 < x,y,z < 1, # # with boundary conditions # # u = 0 for x = 0, x = 1, y = 0, y = 1, z = 0, z = 1 # # A finite difference approximation with the usual 7-point stencil # is used to discretize the boundary value problem to obtain a # nonlinear system of equations. The problem is solved in a 3D # rectangular domain, using distributed arrays (DAs) to partition # the parallel grid. # # ------------------------------------------------------------------------ try: range = xrange except: pass import sys, petsc4py petsc4py.init(sys.argv) from numpy import exp, sqrt from petsc4py import PETSc class Bratu3D(object): def __init__(self, da, lambda_): assert da.getDim() == 3 self.da = da self.lambda_ = lambda_ self.localX = da.createLocalVec() def formInitGuess(self, snes, X): # x = self.da.getVecArray(X) # mx, my, mz = self.da.getSizes() hx, hy, hz = [1.0/(m-1) for m in [mx, my, mz]] lambda_ = self.lambda_ scale = lambda_/(lambda_ + 1.0) # (xs, xe), (ys, ye), (zs, ze) = self.da.getRanges() for k in range(zs, ze): min_k = min(k,mz-k-1)*hz for j in range(ys, ye): min_j = min(j,my-j-1)*hy for i in range(xs, xe): min_i = min(i,mx-i-1)*hx if (i==0 or j==0 or k==0 or i==mx-1 or j==my-1 or k==mz-1): # boundary points x[i, j, k] = 0.0 else: # interior points min_kij = min(min_i,min_j,min_k) x[i, j, k] = scale*sqrt(min_kij) def formFunction(self, snes, X, F): # self.da.globalToLocal(X, self.localX) x = self.da.getVecArray(self.localX) f = self.da.getVecArray(F) # mx, my, mz = self.da.getSizes() hx, hy, hz = [1.0/m for m in [mx, my, mz]] hxhyhz = hx*hy*hz hxhzdhy = hx*hz/hy; hyhzdhx = hy*hz/hx; hxhydhz = hx*hy/hz; lambda_ = self.lambda_ # (xs, xe), (ys, ye), (zs, ze) = self.da.getRanges() for k in range(zs, ze): for j in range(ys, ye): for i in range(xs, xe): if (i==0 or j==0 or k==0 or i==mx-1 or j==my-1 or k==mz-1): f[i, j, k] = x[i, j, k] - 0 else: u = x[ i , j , k ] # center u_e = x[i+1 , j , k ] # east u_w = x[i-1 , j , k ] # west u_n = x[ i , j+1 , k ] # north u_s = x[ i , j-1 , k ] # south u_u = x[ i , j , k+1] # up u_d = x[ i , j , k-1] # down u_xx = (-u_e + 2*u - u_w)*hyhzdhx u_yy = (-u_n + 2*u - u_s)*hxhzdhy u_zz = (-u_u + 2*u - u_d)*hxhydhz f[i, j, k] = u_xx + u_yy + u_zz \ - lambda_*exp(u)*hxhyhz def formJacobian(self, snes, X, J, P): # self.da.globalToLocal(X, self.localX) x = self.da.getVecArray(self.localX) # mx, my, mz = self.da.getSizes() hx, hy, hz = [1.0/m for m in [mx, my, mz]] hxhyhz = hx*hy*hz hxhzdhy = hx*hz/hy; hyhzdhx = hy*hz/hx; hxhydhz = hx*hy/hz; lambda_ = self.lambda_ # P.zeroEntries() row = PETSc.Mat.Stencil() col = PETSc.Mat.Stencil() # (xs, xe), (ys, ye), (zs, ze) = self.da.getRanges() for k in range(zs, ze): for j in range(ys, ye): for i in range(xs, xe): row.index = (i,j,k) row.field = 0 if (i==0 or j==0 or k==0 or i==mx-1 or j==my-1 or k==mz-1): P.setValueStencil(row, row, 1.0) else: u = x[i,j,k] diag = (2*(hyhzdhx+hxhzdhy+hxhydhz) - lambda_*exp(u)*hxhyhz) for index, value in [ ((i,j,k-1), -hxhydhz), ((i,j-1,k), -hxhzdhy), ((i-1,j,k), -hyhzdhx), ((i, j, k), diag), ((i+1,j,k), -hyhzdhx), ((i,j+1,k), -hxhzdhy), ((i,j,k+1), -hxhydhz), ]: col.index = index col.field = 0 P.setValueStencil(row, col, value) P.assemble() if J != P: J.assemble() # matrix-free operator return PETSc.Mat.Structure.SAME_NONZERO_PATTERN OptDB = PETSc.Options() n = OptDB.getInt('n', 16) nx = OptDB.getInt('nx', n) ny = OptDB.getInt('ny', n) nz = OptDB.getInt('nz', n) lambda_ = OptDB.getReal('lambda', 6.0) da = PETSc.DMDA().create([nx, ny, nz], stencil_width=1) pde = Bratu3D(da, lambda_) snes = PETSc.SNES().create() F = da.createGlobalVec() snes.setFunction(pde.formFunction, F) fd = OptDB.getBool('fd', False) mf = OptDB.getBool('mf', False) if mf: J = None snes.setUseMF() else: J = da.createMat() snes.setJacobian(pde.formJacobian, J) if fd: snes.setUseFD() snes.getKSP().setType('cg') snes.setFromOptions() X = da.createGlobalVec() pde.formInitGuess(snes, X) snes.solve(None, X) U = da.createNaturalVec() da.globalToNatural(X, U) if OptDB.getBool('plot_mpl', False): def plot_mpl(da, U): comm = da.getComm() rank = comm.getRank() scatter, U0 = PETSc.Scatter.toZero(U) scatter.scatter(U, U0, False, PETSc.Scatter.Mode.FORWARD) if rank == 0: try: from matplotlib import pylab except ImportError: PETSc.Sys.Print("matplotlib not available") else: from numpy import mgrid nx, ny, nz = da.sizes solution = U0[...].reshape(da.sizes, order='f') xx, yy = mgrid[0:1:1j*nx,0:1:1j*ny] pylab.contourf(xx, yy, solution[:, :, nz//2]) pylab.axis('equal') pylab.xlabel('X') pylab.ylabel('Y') pylab.title('Z/2') pylab.show() comm.barrier() plot_mpl(da, U) petsc4py-3.15.1/demo/petsc-examples/0000755000175000017500000000000014062764472017450 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/petsc-examples/makefile0000644000175000017500000000004013750315427021135 0ustar balaybalay00000000000000.PHONY:all all: ${MAKE} -C ksp petsc4py-3.15.1/demo/petsc-examples/ksp/0000755000175000017500000000000014062764472020245 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/petsc-examples/ksp/makefile0000644000175000017500000000022713750315427021741 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC=mpiexec -n 2 PYTHON=python3 scripts = ex2 ex23 all: $(scripts) $(scripts): ${PYTHON} $@.py ${MPIEXEC} ${PYTHON} $@.py petsc4py-3.15.1/demo/petsc-examples/ksp/ex2.py0000644000175000017500000001506413750315427021316 0ustar balaybalay00000000000000 ''' Ex2 from PETSc example files implemented for PETSc4py. https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex2.c.html By: Miguel Arriaga Solves a linear system in parallel with KSP. Input parameters include: -view_exact_sol : write exact solution vector to stdout -m : number of mesh points in x-direction -n : number of mesh points in y-direction Concepts: KSP^basic parallel example Concepts: KSP^Laplacian, 2d Concepts: Laplacian, 2d Processors: n Vec x,b,u; # approx solution, RHS, exact solution Mat A; # linear system matrix KSP ksp; # linear solver context PetscReal norm; # norm of solution error ''' import sys import petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import numpy as np comm = PETSc.COMM_WORLD size = comm.getSize() rank = comm.getRank() OptDB = PETSc.Options() m = OptDB.getInt('m', 8) n = OptDB.getInt('n', 7) ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compute the matrix and right-hand-side vector that define the linear system, Ax = b. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ''' ''' Create parallel matrix, specifying only its global dimensions. When using MatCreate(), the matrix format can be specified at runtime. Also, the parallel partitioning of the matrix is determined by PETSc at runtime. Performance tuning note: For problems of substantial size, preallocation of matrix memory is crucial for attaining good performance. See the matrix chapter of the users manual for details. ''' A = PETSc.Mat().create(comm=comm) A.setSizes((m*n,m*n)) A.setFromOptions() A.setPreallocationNNZ((5,5)) ''' Currently, all PETSc parallel matrix formats are partitioned by contiguous chunks of rows across the processors. Determine which rows of the matrix are locally owned. ''' Istart,Iend = A.getOwnershipRange() ''' Set matrix elements for the 2-D, five-point stencil in parallel. - Each processor needs to insert only elements that it owns locally (but any non-local elements will be sent to the appropriate processor during matrix assembly). - Always specify global rows and columns of matrix entries. Note: this uses the less common natural ordering that orders first all the unknowns for x = h then for x = 2h etc; Hence you see J = Ii +- n instead of J = I +- m as you might expect. The more standard ordering would first do all variables for y = h, then y = 2h etc. ''' for Ii in range(Istart,Iend): v = -1.0 i = int(Ii/n) j = int(Ii - i*n) if (i>0): J = Ii - n A.setValues(Ii,J,v,addv=True) if (i0): J = Ii - 1 A.setValues(Ii,J,v,addv=True) if (j -pc_type -ksp_monitor -ksp_rtol These options will override those specified above as long as KSPSetFromOptions() is called _after_ any other customization routines. ''' ksp.setFromOptions() ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Solve the linear system - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ''' ksp.solve(b,x) ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Check the solution and clean up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ''' x = x - u # x.axpy(-1.0,u) norm = x.norm(PETSc.NormType.NORM_2) its = ksp.getIterationNumber() ''' Print convergence information. PetscPrintf() produces a single print statement from all processes that share a communicator. An alternative is PetscFPrintf(), which prints to a file. ''' if norm > rtol*10: PETSc.Sys.Print("Norm of error {}, Iterations {}".format(norm,its),comm=comm) else: if size==1: PETSc.Sys.Print("- Serial OK",comm=comm) else: PETSc.Sys.Print("- Parallel OK",comm=comm) petsc4py-3.15.1/demo/petsc-examples/ksp/ex23.py0000644000175000017500000001204413750315427021374 0ustar balaybalay00000000000000 ''' Ex23 from PETSc example files implemented for PETSc4py. https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex23.c.html By: Miguel Arriaga Solves a tridiagonal linear system. Concepts: KSP^basic parallel example Processors: n Vec x, b, u; approx solution, RHS, exact solution Mat A; linear system matrix KSP ksp; linear solver context PC pc; preconditioner context PetscReal norm; norm of solution error ''' import sys import petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc import numpy as np comm = PETSc.COMM_WORLD size = comm.getSize() rank = comm.getRank() n = 12 # Size of problem tol = 1E-11 # Tolerance of Result. tol=1000.*PETSC_MACHINE_EPSILON; ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compute the matrix and right-hand-side vector that define the linear system, Ax = b. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create vectors. Note that we form 1 vector from scratch and then duplicate as needed. For this simple case let PETSc decide how many elements of the vector are stored on each processor. The second argument to VecSetSizes() below causes PETSc to decide. ''' x = PETSc.Vec().create(comm=comm) x.setSizes(n) x.setFromOptions() b = x.duplicate() u = x.duplicate() ''' Identify the starting and ending mesh points on each processor for the interior part of the mesh. We let PETSc decide above. ''' rstart,rend = x.getOwnershipRange() nlocal = x.getLocalSize() ''' Create matrix. When using MatCreate(), the matrix format can be specified at runtime. Performance tuning note: For problems of substantial size, preallocation of matrix memory is crucial for attaining good performance. See the matrix chapter of the users manual for details. We pass in nlocal as the "local" size of the matrix to force it to have the same parallel layout as the vector created above. ''' A = PETSc.Mat().create(comm=comm) A.setSizes(n,nlocal) A.setFromOptions() A.setUp() ''' Assemble matrix. The linear system is distributed across the processors by chunks of contiguous rows, which correspond to contiguous sections of the mesh on which the problem is discretized. For matrix assembly, each processor contributes entries for the part that it owns locally. ''' col = np.zeros(3,dtype='i4') value = np.zeros(3,dtype='f8') if not rstart: rstart = 1 i = 0; col[0] = 0; col[1] = 1; value[0] = 2.0; value[1] = -1.0 A.setValues(i,col[0:2],value[0:2]) if rend == n: rend = n-1 i = n-1; col[0] = n-2; col[1] = n-1; value[0] = -1.0; value[1] = 2.0 A.setValues(i,col[0:2],value[0:2]) ''' Set entries corresponding to the mesh interior ''' value[0] = -1.0; value[1] = 2.0; value[2] = -1.0 for i in range(rstart,rend): col[0] = i-1; col[1] = i; col[2] = i+1 A.setValues(i,col,value) ''' Assemble the matrix ''' A.assemblyBegin(A.AssemblyType.FINAL) A.assemblyEnd(A.AssemblyType.FINAL) ''' Set exact solution; then compute right-hand-side vector. ''' u.set(1.0) b = A(u) ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create the linear solver and set various options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ''' ''' Create linear solver context ''' ksp = PETSc.KSP().create() ''' Set operators. Here the matrix that defines the linear system also serves as the preconditioning matrix. ''' ksp.setOperators(A,A) ''' Set linear solver defaults for this problem (optional). - By extracting the KSP and PC contexts from the KSP context, we can then directly call any KSP and PC routines to set various options. - The following four statements are optional; all of these parameters could alternatively be specified at runtime via KSPSetFromOptions(); ''' pc = ksp.getPC() pc.setType('jacobi') ksp.setTolerances(rtol=1.e-7) ''' Set runtime options, e.g., -ksp_type -pc_type -ksp_monitor -ksp_rtol These options will override those specified above as long as KSPSetFromOptions() is called _after_ any other customization routines. ''' ksp.setFromOptions() ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Solve the linear system - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ''' ''' Solve linear system ''' ksp.solve(b,x) ''' View solver info; we could instead use the option -ksp_view to print this info to the screen at the conclusion of KSPSolve(). ''' # ksp.view() ''' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Check solution and clean up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ''' ''' Check the error ''' x = x - u # x.axpy(-1.0,u) norm = x.norm(PETSc.NormType.NORM_2) its = ksp.getIterationNumber() if norm > tol: PETSc.Sys.Print("Norm of error {}, Iterations {}\n".format(norm,its),comm=comm) else: if size==1: PETSc.Sys.Print("- Serial OK",comm=comm) else: PETSc.Sys.Print("- Parallel OK",comm=comm) petsc4py-3.15.1/demo/poisson3d/0000755000175000017500000000000014062764472016437 5ustar balaybalay00000000000000petsc4py-3.15.1/demo/poisson3d/del2mat.py0000644000175000017500000000150713750315427020337 0ustar balaybalay00000000000000# file: del2mat.py from numpy import zeros from del2lib import del2apply class Del2Mat: def __init__(self, n=1): self.N = (n, n, n) self.F = zeros([n+2]*3, order='f') def create(self, A): N = self.N mat_size = A.getSize() grid_eqs = N[0]*N[1]*N[2] assert mat_size[0] == grid_eqs assert mat_size[1] == grid_eqs def mult(self, A, x, y): "y <- A * x" N, F = self.N, self.F # get 3D arrays from vectos xx = x.getArray(readonly=1).reshape(N, order='f') yy = y.getArray(readonly=0).reshape(N, order='f') # call Fortran subroutine del2apply(F, xx, yy) def multTranspose(self, A, x, y): "y <- A' * x" self.mult(x, y) def getDiagonal(self, A, D): "D[i] <- A[i,i]" D[...] = 6.0 petsc4py-3.15.1/demo/poisson3d/makefile0000644000175000017500000000125313750315427020133 0ustar balaybalay00000000000000# -*- makefile -*- MPIEXEC= PYTHON=python F2PY = f2py F2PY_FLAGS = --quiet F2PY_FLAGS += --noarch --f90flags='' F2PY_FLAGS += -DF2PY_REPORT_ON_ARRAY_COPY=1 .PHONY:test test: run clean .PHONY:run run: run_py run_cc SCRIPT=poisson3d MODULE=del2lib .PHONY:run_py run_py: ${MODULE}.so ${MPIEXEC} ${PYTHON} ${SCRIPT}.py ${MODULE}.so: ${MODULE}.f90 ${F2PY} ${F2PY_FLAGS} -c $< -m ${MODULE} EXECUTABLE=poisson3d .PHONY:run_cc run_cc: ${EXECUTABLE}.exe ${MPIEXEC} ./${EXECUTABLE}.exe ${EXECUTABLE}.exe: ${MAKE} -f makefile.petsc \ PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} .PHONY:clean clean: ${RM} *.py[co] ${MODULE}*.so ${EXECUTABLE}.exe ${RM} -r __pycache__ petsc4py-3.15.1/demo/poisson3d/poisson3d.c0000644000175000017500000000365513750315427020530 0ustar balaybalay00000000000000#include #include #include #include #include "del2mat.h" #define DEL2MAT_MULT ((void(*)(void))Del2Mat_mult) #define DEL2MAT_DIAG ((void(*)(void))Del2Mat_diag) int main(int argc,char **argv) { PetscInt n; PetscScalar h; Del2Mat shell; Mat A; Vec x,b; KSP ksp; PC pc; PetscMPIInt size; /* PETSc initialization */ PetscInitialize(&argc, &argv, NULL, NULL); MPI_Comm_size(PETSC_COMM_WORLD,&size); if (size != 1) { PetscPrintf(PETSC_COMM_WORLD, "This a sequential example\n"); PetscFinalize(); return 1; } /* number of nodes in each direction * excluding those at the boundary */ n = 32; h = 1.0/(n+1); /* grid spacing */ /* setup linear system (shell) matrix */ MatCreate(PETSC_COMM_SELF, &A); MatSetSizes(A, n*n*n, n*n*n, n*n*n, n*n*n); MatSetType(A, MATSHELL); shell.N = n; PetscMalloc((n+2)*(n+2)*(n+2)*sizeof(PetscScalar),&shell.F); PetscMemzero(shell.F, (n+2)*(n+2)*(n+2)*sizeof(PetscScalar)); MatShellSetContext(A, (void**)&shell); MatShellSetOperation(A, MATOP_MULT, DEL2MAT_MULT); MatShellSetOperation(A, MATOP_MULT_TRANSPOSE, DEL2MAT_MULT); MatShellSetOperation(A, MATOP_GET_DIAGONAL, DEL2MAT_DIAG); MatSetUp(A); /* setup linear system vectors */ MatCreateVecs(A, &x, &b); VecSet(x, 0); VecSet(b, 1); /* setup Krylov linear solver */ KSPCreate(PETSC_COMM_SELF, &ksp); KSPGetPC(ksp, &pc); KSPSetType(ksp, KSPCG); /* use conjugate gradients */ PCSetType(pc, PCNONE); /* with no preconditioning */ KSPSetFromOptions(ksp); /* iteratively solve linear system of equations A*x=b */ KSPSetOperators(ksp,A,A); KSPSolve(ksp, b, x); /* scale solution vector to account for grid spacing */ VecScale(x, h*h); /* free memory and destroy objects */ PetscFree(shell.F); VecDestroy(&x); VecDestroy(&b); MatDestroy(&A); KSPDestroy(&ksp); /* finalize PETSc */ PetscFinalize(); return 0; } petsc4py-3.15.1/demo/poisson3d/makefile.petsc0000644000175000017500000000075513750315427021256 0ustar balaybalay00000000000000# -*- makefile -*- EXECUTABLE=poisson3d .PHONY:all all: ${EXECUTABLE}.exe SOURCEC=${EXECUTABLE}.c SOURCEF=del2lib.f90 SOURCEH=del2mat.h OBJSC=${SOURCEC:.c=.o} OBJSF=${SOURCEF:.f90=.o} ${EXECUTABLE}.exe: ${SOURCEC} ${SOURCEF} ${SOURCEH} ${PETSC_FCOMPILE} ${PETSC_COMPILE} ${CLINKER} -o $@ ${OBJSC} ${OBJSF} ${PETSC_TS_LIB} ${RM} ${OBJSC} ${OBJSF} include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules OBJSC=${SOURCEC:.c=.o} OBJSF=${SOURCEF:.f90=.o} petsc4py-3.15.1/demo/poisson3d/del2mat.h0000644000175000017500000000224413750315427020135 0ustar balaybalay00000000000000/* file: del2mat.h */ #ifndef DEL2MAT_H #define DEL2MAT_H #include #include #include /* external Fortran 90 subroutine */ #define Del2Apply del2apply_ EXTERN_C_BEGIN extern void Del2Apply(int*,double*,const double*,double*); EXTERN_C_END /* user data structure and routines * defining the matrix-free operator */ typedef struct { PetscInt N; PetscScalar *F; } Del2Mat; /* y <- A * x */ PetscErrorCode Del2Mat_mult(Mat A, Vec x, Vec y) { Del2Mat *ctx; const PetscScalar *xx; PetscScalar *yy; PetscErrorCode ierr; PetscFunctionBegin; ierr = MatShellGetContext(A,(void**)&ctx);CHKERRQ(ierr); /* get raw vector arrays */ ierr = VecGetArrayRead(x,&xx);CHKERRQ(ierr); ierr = VecGetArray(y,&yy);CHKERRQ(ierr); /* call external Fortran subroutine */ Del2Apply(&ctx->N,ctx->F,xx,yy); /* restore raw vector arrays */ ierr = VecRestoreArrayRead(x,&xx);CHKERRQ(ierr); ierr = VecRestoreArray(y,&yy);CHKERRQ(ierr); PetscFunctionReturn(0); } /*D_i <- A_ii */ PetscErrorCode Del2Mat_diag(Mat A, Vec D) { PetscErrorCode ierr; PetscFunctionBegin; ierr = VecSet(D,6.0);CHKERRQ(ierr); PetscFunctionReturn(0); } #endif petsc4py-3.15.1/demo/poisson3d/del2lib.f900000644000175000017500000000120213750315427020262 0ustar balaybalay00000000000000! file: del2lib.f90 ! to build a Python module, use this: ! $$ f2py -m del2lib -c del2lib.f90 subroutine del2apply (n, F, x, y) !f2py intent(hide) :: n=shape(F,0)-2 integer , intent(in) :: n real(kind=8) , intent(inout) :: F(0:n+1,0:n+1,0:n+1) real(kind=8) , intent(in) :: x(n,n,n) real(kind=8) , intent(inout) :: y(n,n,n) F(1:n,1:n,1:n) = x y(:,:,:) = 6.0 * F(1:n,1:n,1:n) & - F(0:n-1,1:n,1:n) & - F(2:n+1,1:n,1:n) & - F(1:n,0:n-1,1:n) & - F(1:n,2:n+1,1:n) & - F(1:n,1:n,0:n-1) & - F(1:n,1:n,2:n+1) end subroutine del2apply petsc4py-3.15.1/demo/poisson3d/poisson3d.py0000644000175000017500000000231213750315427020723 0ustar balaybalay00000000000000import sys, petsc4py petsc4py.init(sys.argv) from petsc4py import PETSc from del2mat import Del2Mat # this a sequential example assert PETSc.COMM_WORLD.getSize() == 1 # number of nodes in each direction # excluding those at the boundary n = 32 h = 1.0/(n+1) # grid spacing # setup linear system matrix A = PETSc.Mat().create() A.setSizes([n**3, n**3]) A.setType('python') shell = Del2Mat(n) # shell context A.setPythonContext(shell) A.setUp() # setup linear system vectors x, b = A.createVecs() x.set(0.0) b.set(1.0) # setup Krylov solver ksp = PETSc.KSP().create() pc = ksp.getPC() ksp.setType('cg') pc.setType('none') # iteratively solve linear # system of equations A*x=b ksp.setOperators(A) ksp.setFromOptions() ksp.solve(b, x) # scale solution vector to # account for grid spacing x.scale(h**2) OptDB = PETSc.Options() if OptDB.getBool('plot_mpl', False): try: from matplotlib import pylab except ImportError: PETSc.Sys.Print("matplotlib not available") else: from numpy import mgrid X, Y = mgrid[0:1:1j*n,0:1:1j*n] Z = x[...].reshape(n,n,n)[:,:,n/2-2] pylab.contourf(X, Y, Z) pylab.axis('equal') pylab.colorbar() pylab.show() petsc4py-3.15.1/README.rst0000644000175000017500000000146113750315427015256 0ustar balaybalay00000000000000================ PETSc for Python ================ Overview -------- Welcome to PETSc for Python. This package provides Python bindings for PETSc_, the *Portable, Extensible Toolkit for Scientific Computation*. Dependencies ------------ * A matching version of PETSc_ built with *shared/dynamic libraries*. * Python_ 2.7, 3.3 or above. * A recent NumPy_ release. * To work with the in-development version, you need Cython_. .. _PETSc: http://www.mcs.anl.gov/petsc/ .. _Python: http://www.python.org .. _NumPy: http://www.numpy.org .. _Cython: http://www.cython.org Documentation ------------- * http://petsc4py.readthedocs.org/, This does not contain the epydoc-generated API reference. * http://www.mcs.anl.gov/petsc/petsc4py-current/docs/, This is for the last release, not the in-development version. petsc4py-3.15.1/setup.cfg0000644000175000017500000000045514062764472015417 0ustar balaybalay00000000000000[config] petsc_dir = $PETSC_DIR petsc_arch = $PETSC_ARCH [build] debug = 0 [sdist] force_manifest = 1 [nosetests] where = test [bdist_rpm] packager = Lisandro Dalcin group = Libraries/Python doc_files = README.rst CHANGES.rst LICENSE.rst [egg_info] tag_build = tag_date = 0 petsc4py-3.15.1/LICENSE.rst0000644000175000017500000000263114006551172015375 0ustar balaybalay00000000000000========================= LICENSE: PETSc for Python ========================= :Author: Lisandro Dalcin :Contact: dalcinl@gmail.com Copyright (c) 2021, Lisandro Dalcin. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. petsc4py-3.15.1/setup.py0000755000175000017500000002243114062763234015304 0ustar balaybalay00000000000000#!/usr/bin/env python # Author: Lisandro Dalcin # Contact: dalcinl@gmail.com """ PETSc for Python """ import sys import os import re try: import setuptools except ImportError: setuptools = None pyver = sys.version_info[:2] if pyver < (2, 6) or (3, 0) <= pyver < (3, 2): raise RuntimeError("Python version 2.6, 2.7 or >= 3.2 required") if pyver == (2, 6) or pyver == (3, 2): sys.stderr.write( "WARNING: Python %d.%d is not supported.\n" % pyver) # -------------------------------------------------------------------- # Metadata # -------------------------------------------------------------------- topdir = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, topdir) from conf.metadata import metadata def name(): return 'petsc4py' def version(): with open(os.path.join(topdir, 'src', '__init__.py')) as f: m = re.search(r"__version__\s*=\s*'(.*)'", f.read()) return m.groups()[0] def description(): with open(os.path.join(topdir, 'DESCRIPTION.rst')) as f: return f.read() name = name() version = version() url = 'https://gitlab.com/petsc/petsc' pypiroot = 'https://pypi.io/packages/source/%s/%s/' % (name[0], name) download = pypiroot + '%(name)s-%(version)s.tar.gz' % vars() devstat = ['Development Status :: 5 - Production/Stable'] keywords = ['PETSc', 'MPI'] metadata['name'] = name metadata['version'] = version metadata['description'] = __doc__.strip() metadata['long_description'] = description() metadata['keywords'] += keywords metadata['classifiers'] += devstat metadata['url'] = url metadata['download_url'] = download metadata['provides'] = ['petsc4py'] metadata['requires'] = ['numpy'] # -------------------------------------------------------------------- # Extension modules # -------------------------------------------------------------------- def get_ext_modules(Extension): from os import walk from glob import glob from os.path import join glob_join = lambda *args: glob(join(*args)) depends = [] for pth, dirs, files in walk('src'): depends += glob_join(pth, '*.h') depends += glob_join(pth, '*.c') if 'PETSC_DIR' in os.environ: pd = os.environ['PETSC_DIR'] pa = os.environ.get('PETSC_ARCH', '') depends += glob_join(pd, 'include', '*.h') depends += glob_join(pd, 'include', 'petsc', 'private', '*.h') depends += glob_join(pd, pa, 'include', 'petscconf.h') try: import numpy numpy_includes = [numpy.get_include()] except ImportError: numpy_includes = [] return [Extension('petsc4py.lib.PETSc', sources=['src/PETSc.c', 'src/libpetsc4py.c', ], include_dirs=['src/include', ] + numpy_includes, depends=depends)] # -------------------------------------------------------------------- # Setup # -------------------------------------------------------------------- from conf.petscconf import setup, Extension from conf.petscconf import config, build, build_src, build_ext, install from conf.petscconf import clean, test, sdist CYTHON = '0.24' def run_setup(): setup_args = metadata.copy() if setuptools: setup_args['zip_safe'] = False setup_args['install_requires'] = ['numpy'] PETSC_DIR = os.environ.get('PETSC_DIR') if not (PETSC_DIR and os.path.isdir(PETSC_DIR)): vstr = setup_args['version'].split('.')[:2] x, y = int(vstr[0]), int(vstr[1]) PETSC = ">=%s.%s,<%s.%s" % (x, y, x, y+1) setup_args['install_requires'] += ['petsc'+PETSC] if setuptools: src = os.path.join('src', 'petsc4py.PETSc.c') has_src = os.path.exists(os.path.join(topdir, src)) has_git = os.path.isdir(os.path.join(topdir, '.git')) has_hg = os.path.isdir(os.path.join(topdir, '.hg')) suffix = os.path.join('src', 'binding', 'petsc4py') in_petsc = topdir.endswith(os.path.sep + suffix) if not has_src or has_git or has_hg or in_petsc: setup_args['setup_requires'] = ['Cython>='+CYTHON] # setup(packages = ['petsc4py', 'petsc4py.lib',], package_dir = {'petsc4py' : 'src', 'petsc4py.lib' : 'src/lib'}, package_data = {'petsc4py' : ['include/petsc4py/*.h', 'include/petsc4py/*.i', 'include/petsc4py/*.pxd', 'include/petsc4py/*.pxi', 'include/petsc4py/*.pyx', 'PETSc.pxd',], 'petsc4py.lib' : ['petsc.cfg'],}, ext_modules = get_ext_modules(Extension), cmdclass = {'config' : config, 'build' : build, 'build_src' : build_src, 'build_ext' : build_ext, 'install' : install, 'clean' : clean, 'test' : test, 'sdist' : sdist, }, **setup_args) def chk_cython(VERSION): from distutils import log from distutils.version import LooseVersion from distutils.version import StrictVersion warn = lambda msg='': sys.stderr.write(msg+'\n') # try: import Cython except ImportError: warn("*"*80) warn() warn(" You need to generate C source files with Cython!!") warn(" Download and install Cython ") warn() warn("*"*80) return False # try: CYTHON_VERSION = Cython.__version__ except AttributeError: from Cython.Compiler.Version import version as CYTHON_VERSION REQUIRED = VERSION m = re.match(r"(\d+\.\d+(?:\.\d+)?).*", CYTHON_VERSION) if m: Version = StrictVersion AVAILABLE = m.groups()[0] else: Version = LooseVersion AVAILABLE = CYTHON_VERSION if (REQUIRED is not None and Version(AVAILABLE) < Version(REQUIRED)): warn("*"*80) warn() warn(" You need to install Cython %s (you have version %s)" % (REQUIRED, CYTHON_VERSION)) warn(" Download and install Cython ") warn() warn("*"*80) return False # return True def run_cython(source, target=None, depends=(), includes=(), destdir_c=None, destdir_h=None, wdir=None, force=False, VERSION=None): from glob import glob from distutils import log from distutils import dep_util from distutils.errors import DistutilsError if target is None: target = os.path.splitext(source)[0]+'.c' cwd = os.getcwd() try: if wdir: os.chdir(wdir) alldeps = [source] for dep in depends: alldeps += glob(dep) if not (force or dep_util.newer_group(alldeps, target)): log.debug("skipping '%s' -> '%s' (up-to-date)", source, target) return finally: os.chdir(cwd) if not chk_cython(VERSION): raise DistutilsError("requires Cython>=%s" % VERSION) log.info("cythonizing '%s' -> '%s'", source, target) from conf.cythonize import cythonize err = cythonize(source, target, includes=includes, destdir_c=destdir_c, destdir_h=destdir_h, wdir=wdir) if err: raise DistutilsError( "Cython failure: '%s' -> '%s'" % (source, target)) def build_sources(cmd): from os.path import exists, isdir, join # petsc4py.PETSc source = 'petsc4py.PETSc.pyx' target = 'petsc4py.PETSc.c' depends = ['include/*/*.pxd', 'PETSc/*.pyx', 'PETSc/*.pxi'] includes = ['include'] destdir_h = os.path.join('include', 'petsc4py') run_cython(source, target, depends=depends, includes=includes, destdir_c=None, destdir_h=destdir_h, wdir='src', force=cmd.force, VERSION=CYTHON) # libpetsc4py source = os.path.join('libpetsc4py', 'libpetsc4py.pyx') depends = ['include/petsc4py/*.pxd', 'libpetsc4py/*.pyx', 'libpetsc4py/*.pxi'] includes = ['include'] run_cython(source, depends=depends, includes=includes, destdir_c=None, destdir_h=None, wdir='src', force=cmd.force, VERSION=CYTHON) build_src.run = build_sources def run_testsuite(cmd): from distutils.errors import DistutilsError sys.path.insert(0, 'test') try: from runtests import main finally: del sys.path[0] if cmd.dry_run: return args = cmd.args[:] or [] if cmd.verbose < 1: args.insert(0,'-q') if cmd.verbose > 1: args.insert(0,'-v') err = main(args) if err: raise DistutilsError("test") test.run = run_testsuite # -------------------------------------------------------------------- def main(): run_setup() if __name__ == '__main__': main() # -------------------------------------------------------------------- petsc4py-3.15.1/src/0000755000175000017500000000000014062764472014361 5ustar balaybalay00000000000000petsc4py-3.15.1/src/libpetsc4py.h0000644000175000017500000000137413750315427016774 0ustar balaybalay00000000000000#include /* #include "libpetsc4py/libpetsc4py.h" */ PETSC_EXTERN int import_libpetsc4py(void); PETSC_EXTERN PetscErrorCode MatPythonGetContext(Mat,void**); PETSC_EXTERN PetscErrorCode MatPythonSetContext(Mat,void*); PETSC_EXTERN PetscErrorCode PCPythonGetContext(PC,void**); PETSC_EXTERN PetscErrorCode PCPythonSetContext(PC,void*); PETSC_EXTERN PetscErrorCode KSPPythonGetContext(KSP,void**); PETSC_EXTERN PetscErrorCode KSPPythonSetContext(KSP,void*); PETSC_EXTERN PetscErrorCode SNESPythonGetContext(SNES,void**); PETSC_EXTERN PetscErrorCode SNESPythonSetContext(SNES,void*); PETSC_EXTERN PetscErrorCode TSPythonGetContext(TS,void**); PETSC_EXTERN PetscErrorCode TSPythonSetContext(TS,void*); PETSC_EXTERN PetscErrorCode PetscPythonRegisterAll(void); petsc4py-3.15.1/src/libpetsc4py.c0000644000175000017500000000026513750315427016765 0ustar balaybalay00000000000000#define MPICH_SKIP_MPICXX 1 #define OMPI_SKIP_MPICXX 1 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include #include #include "libpetsc4py/libpetsc4py.c" petsc4py-3.15.1/src/PETSc.pxd0000644000175000017500000000013613750315427016007 0ustar balaybalay00000000000000# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com include "include/petsc4py/PETSc.pxd" petsc4py-3.15.1/src/__main__.py0000644000175000017500000000400713750315427016447 0ustar balaybalay00000000000000# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com """ Command line access to the PETSc Options Database. This module provides command line access to PETSc Options Database. It outputs a listing of the many PETSc options indicating option names, default values and descriptions. Usage:: $ python -m petsc4py [vec|mat|pc|ksp|snes|ts|tao] [] """ def help(args=None): import sys, shlex # program name try: prog = sys.argv[0] except Exception: prog = getattr(sys, 'executable', 'python') # arguments if args is None: args = sys.argv[1:] elif isinstance(args, str): args = shlex.split(args) else: args = [str(a) for a in args] # import and initialize import petsc4py petsc4py.init([prog, '-help'] + args) from petsc4py import PETSc # help dispatcher COMM = PETSc.COMM_SELF if 'vec' in args: vec = PETSc.Vec().create(comm=COMM) vec.setSizes(0) vec.setFromOptions() vec.destroy() if 'mat' in args: mat = PETSc.Mat().create(comm=COMM) mat.setSizes([0, 0]) mat.setFromOptions() mat.destroy() if 'pc' in args: pc = PETSc.PC().create(comm=COMM) pc.setFromOptions() pc.destroy() if 'ksp' in args: ksp = PETSc.KSP().create(comm=COMM) ksp.setFromOptions() ksp.destroy() if 'snes' in args: snes = PETSc.SNES().create(comm=COMM) snes.setFromOptions() snes.destroy() if 'ts' in args: ts = PETSc.TS().create(comm=COMM) ts.setFromOptions() ts.destroy() if 'tao' in args: tao = PETSc.TAO().create(comm=COMM) tao.setFromOptions() tao.destroy() if 'dmda' in args: dmda = PETSc.DMDA().create(comm=COMM) dmda.setFromOptions() dmda.destroy() if 'dmplex' in args: dmplex = PETSc.DMPlex().create(comm=COMM) dmplex.setFromOptions() dmplex.destroy() if __name__ == '__main__': help() petsc4py-3.15.1/src/PETSc/0000755000175000017500000000000014062764472015277 5ustar balaybalay00000000000000petsc4py-3.15.1/src/PETSc/petscsys.pxi0000644000175000017500000000660714030740317017672 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef enum PetscDataType: PETSC_INT PETSC_REAL PETSC_SCALAR PETSC_COMPLEX PETSC_DATATYPE_UNKNOWN const char PETSC_AUTHOR_INFO[] int PetscGetVersion(char[],size_t) int PetscGetVersionNumber(PetscInt*,PetscInt*,PetscInt*,PetscInt*) int PetscInitialize(int*,char***,char[],char[]) int PetscInitializeNoArguments() int PetscFinalize() PetscBool PetscInitializeCalled PetscBool PetscFinalizeCalled ctypedef enum PetscErrorType: PETSC_ERROR_INITIAL PETSC_ERROR_REPEAT ctypedef int (*PetscErrorHandlerFunction)(MPI_Comm,int,char*,char*, int,PetscErrorType,char*,void*) PetscErrorHandlerFunction PetscAttachDebuggerErrorHandler PetscErrorHandlerFunction PetscEmacsClientErrorHandler PetscErrorHandlerFunction PetscTraceBackErrorHandler PetscErrorHandlerFunction PetscMPIAbortErrorHandler PetscErrorHandlerFunction PetscAbortErrorHandler PetscErrorHandlerFunction PetscIgnoreErrorHandler int PetscPushErrorHandler(PetscErrorHandlerFunction,void*) int PetscPopErrorHandler() int PetscPopSignalHandler() int PetscInfoAllow(PetscBool) int PetscInfoSetFile(char*,char*) int PetscErrorMessage(int,char*[],char**) int PetscSplitOwnership(MPI_Comm,PetscInt*,PetscInt*) int PetscSplitOwnershipBlock(MPI_Comm,PetscInt,PetscInt*,PetscInt*) FILE *PETSC_STDOUT FILE *PETSC_STDERR int PetscPrintf(MPI_Comm,char[],...) int PetscSynchronizedPrintf(MPI_Comm,char[],...) int PetscSynchronizedFlush(MPI_Comm,FILE*) int PetscSequentialPhaseBegin(MPI_Comm,int) int PetscSequentialPhaseEnd(MPI_Comm,int) int PetscSleep(int) int PetscCitationsRegister(const char[],PetscBool*) int PetscHasExternalPackage(const char[],PetscBool*) cdef inline int Sys_Sizes( object size, object bsize, PetscInt *_b, PetscInt *_n, PetscInt *_N, ) except -1: # get block size cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE if bsize is not None: bs = b = asInt(bsize) if bs == PETSC_DECIDE: bs = 1 # unpack and get local and global sizes cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE cdef object on, oN try: on, oN = size except (TypeError, ValueError): on = None; oN = size if on is not None: n = asInt(on) if oN is not None: N = asInt(oN) # check block, local, and and global sizes if (bs < 1): raise ValueError( "block size %d must be positive" % toInt(bs)) if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( "local and global sizes cannot be both 'DECIDE'") if (n > 0) and (n % bs): raise ValueError( "local size %d not divisible by block size %d" % (toInt(n), toInt(bs)) ) if (N > 0) and (N % bs): raise ValueError( "global size %d not divisible by block size %d" % (toInt(N), toInt(bs)) ) # return result to the caller if _b != NULL: _b[0] = b if _n != NULL: _n[0] = n if _N != NULL: _N[0] = N return 0 cdef inline int Sys_Layout( MPI_Comm comm, PetscInt bs, PetscInt *_n, PetscInt *_N, ) except -1: cdef PetscInt n = _n[0] cdef PetscInt N = _N[0] if bs < 0: bs = 1 if n > 0: n = n // bs if N > 0: N = N // bs CHKERR( PetscSplitOwnership(comm, &n, &N) ) _n[0] = n * bs _N[0] = N * bs return 0 petsc4py-3.15.1/src/PETSc/petscobj.pxi0000644000175000017500000001301713750315427017627 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef int PetscClassId int PetscObjectCreate(MPI_Comm,PetscObject*) int PetscObjectView(PetscObject,PetscViewer) int PetscObjectDestroy(PetscObject*) int PetscObjectGetReference(PetscObject,PetscInt*) int PetscObjectReference(PetscObject) int PetscObjectDereference(PetscObject) int PetscObjectSetOptionsPrefix(PetscObject,char[]) int PetscObjectGetOptionsPrefix(PetscObject,char*[]) int PetscObjectSetFromOptions(PetscObject) int PetscObjectViewFromOptions(PetscObject,PetscObject,char[]) int PetscObjectGetComm(PetscObject,MPI_Comm*) int PetscObjectGetClassId(PetscObject,PetscClassId*) int PetscObjectGetType(PetscObject,char*[]) int PetscObjectGetClassName(PetscObject,char*[]) int PetscObjectSetName(PetscObject,char[]) int PetscObjectGetName(PetscObject,char*[]) int PetscObjectStateIncrease(PetscObject) int PetscObjectTypeCompare(PetscObject,char[],PetscBool*) int PetscObjectCompose(PetscObject,char[],PetscObject) int PetscObjectQuery(PetscObject,char[],PetscObject*) int PetscObjectIncrementTabLevel(PetscObject,PetscObject,PetscInt) int PetscObjectGetTabLevel(PetscObject,PetscInt*) int PetscObjectSetTabLevel(PetscObject,PetscInt) # -------------------------------------------------------------------- cdef inline int PetscINCREF(PetscObject *obj) nogil: if obj == NULL: return 0 if obj[0] == NULL: return 0 return PetscObjectReference(obj[0]) cdef inline int PetscCLEAR(PetscObject* obj) nogil: if obj == NULL: return 0 if obj[0] == NULL: return 0 cdef PetscObject tmp tmp = obj[0]; obj[0] = NULL return PetscObjectDestroy(&tmp) cdef inline int PetscDEALLOC(PetscObject* obj) nogil: if obj == NULL: return 0 if obj[0] == NULL: return 0 cdef PetscObject tmp tmp = obj[0]; obj[0] = NULL if not (PetscInitializeCalled): return 0 if (PetscFinalizeCalled): return 0 return PetscObjectDestroy(&tmp) cdef inline int PetscINCSTATE(PetscObject *obj) nogil: if obj == NULL: return 0 if obj[0] == NULL: return 0 return PetscObjectStateIncrease(obj[0]) # -------------------------------------------------------------------- cdef extern from *: ctypedef struct PyObject void _Py_DecRef"Py_DECREF"(PyObject*) PyObject* PyDict_New() except NULL PyObject* PyDict_GetItem(PyObject*, PyObject*) except * int PyDict_SetItem(PyObject*, PyObject*, PyObject*) except -1 int PyDict_DelItem(PyObject*, PyObject*) except -1 cdef extern from * nogil: ctypedef struct _p_PetscObject: void *python_context int (*python_destroy)(void*) cdef inline void Py_DecRef(PyObject *ob) with gil: _Py_DecRef(ob) cdef int PetscDelPyDict(void* ptr) nogil: if ptr != NULL and Py_IsInitialized(): Py_DecRef(ptr) return 0 cdef object PetscGetPyDict(PetscObject obj, bint create): if obj.python_context != NULL: return obj.python_context if create: obj.python_destroy = PetscDelPyDict obj.python_context = PyDict_New() return obj.python_context return None cdef object PetscGetPyObj(PetscObject o, char name[]): cdef object dct = PetscGetPyDict(o, False) if dct is None: return None cdef object key = bytes2str(name) cdef PyObject *d = dct cdef PyObject *k = key cdef PyObject *v = NULL v = PyDict_GetItem(d, k) if v != NULL: return v return None cdef object PetscSetPyObj(PetscObject o, char name[], object p): cdef object dct if p is not None: dct = PetscGetPyDict(o, True) else: dct = PetscGetPyDict(o, False) if dct is None: return None cdef str key = bytes2str(name) cdef PyObject *d = dct cdef PyObject *k = key cdef PyObject *v = p PyDict_SetItem(d, k, v) if v == None: PyDict_DelItem(d, k) return None # -------------------------------------------------------------------- cdef extern from *: object PyLong_FromVoidPtr(void*) cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: return o # -------------------------------------------------------------------- cdef inline type subtype_DM(PetscDM dm): cdef PetscObject obj = dm if obj == NULL: return DM # --- cdef PetscBool match = PETSC_FALSE CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) if match == PETSC_TRUE: return DMDA CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) if match == PETSC_TRUE: return DMPlex CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) if match == PETSC_TRUE: return DMComposite CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) if match == PETSC_TRUE: return DMShell CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) if match == PETSC_TRUE: return DMStag CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) if match == PETSC_TRUE: return DMSwarm # --- return DM cdef inline type subtype_Object(PetscObject obj): cdef type klass = Object if obj == NULL: return klass cdef PetscClassId classid = 0 CHKERR( PetscObjectGetClassId(obj,&classid) ) if classid == PETSC_DM_CLASSID: klass = subtype_DM(obj) else: klass = PyPetscType_Lookup(classid) return klass # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/AO.pyx0000644000175000017500000001054213750315427016335 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class AOType(object): BASIC = S_(AOBASIC) ADVANCED = S_(AOADVANCED) MAPPING = S_(AOMAPPING) MEMORYSCALABLE = S_(AOMEMORYSCALABLE) # -------------------------------------------------------------------- cdef class AO(Object): Type = AOType def __cinit__(self): self.obj = &self.ao self.ao = NULL def view(self, Viewer viewer=None): cdef PetscViewer cviewer = NULL if viewer is not None: cviewer = viewer.vwr CHKERR( AOView(self.ao, cviewer) ) def destroy(self): CHKERR( AODestroy(&self.ao) ) return self def createBasic(self, app, petsc=None, comm=None): cdef PetscIS isapp = NULL, ispetsc = NULL cdef PetscInt napp = 0, *idxapp = NULL, cdef PetscInt npetsc = 0, *idxpetsc = NULL cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscAO newao = NULL if isinstance(app, IS): isapp = (app).iset if petsc is not None: ispetsc = (petsc).iset CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) else: app = iarray_i(app, &napp, &idxapp) if petsc is not None: petsc = iarray_i(petsc, &npetsc, &idxpetsc) assert napp == npetsc, "incompatible array sizes" CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) PetscCLEAR(self.obj); self.ao = newao return self def createMemoryScalable(self, app, petsc=None, comm=None): cdef PetscIS isapp = NULL, ispetsc = NULL cdef PetscInt napp = 0, *idxapp = NULL, cdef PetscInt npetsc = 0, *idxpetsc = NULL cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscAO newao = NULL if isinstance(app, IS): isapp = (app).iset if petsc is not None: ispetsc = (petsc).iset CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) else: app = iarray_i(app, &napp, &idxapp) if petsc is not None: petsc = iarray_i(petsc, &npetsc, &idxpetsc) assert napp == npetsc, "incompatible array sizes" CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) PetscCLEAR(self.obj); self.ao = newao return self def createMapping(self, app, petsc=None, comm=None): cdef PetscIS isapp = NULL, ispetsc = NULL cdef PetscInt napp = 0, *idxapp = NULL, cdef PetscInt npetsc = 0, *idxpetsc = NULL cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscAO newao = NULL if isinstance(app, IS): isapp = (app).iset if petsc is not None: ispetsc = (petsc).iset CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) else: app = iarray_i(app, &napp, &idxapp) if petsc is not None: petsc = iarray_i(petsc, &npetsc, &idxpetsc) assert napp == npetsc, "incompatible array sizes" CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) PetscCLEAR(self.obj); self.ao = newao return self def getType(self): cdef PetscAOType cval = NULL CHKERR( AOGetType(self.ao, &cval) ) return bytes2str(cval) def app2petsc(self, indices): cdef PetscIS iset = NULL cdef PetscInt nidx = 0, *idx = NULL if isinstance(indices, IS): iset = (indices).iset CHKERR( AOApplicationToPetscIS(self.ao, iset) ) else: indices = oarray_i(indices, &nidx, &idx) CHKERR( AOApplicationToPetsc(self.ao, nidx, idx) ) return indices def petsc2app(self, indices): cdef PetscIS iset = NULL cdef PetscInt nidx = 0, *idx = NULL if isinstance(indices, IS): iset = (indices).iset CHKERR( AOPetscToApplicationIS(self.ao, iset) ) else: indices = oarray_i(indices, &nidx, &idx) CHKERR( AOPetscToApplication(self.ao, nidx, idx) ) return indices # -------------------------------------------------------------------- del AOType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscdm.pxi0000644000175000017500000002320314030740317017443 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef const char* PetscDMType "DMType" PetscDMType DMDA_type "DMDA" PetscDMType DMCOMPOSITE PetscDMType DMSLICED PetscDMType DMSHELL PetscDMType DMPLEX PetscDMType DMREDUNDANT PetscDMType DMPATCH PetscDMType DMMOAB PetscDMType DMNETWORK PetscDMType DMFOREST PetscDMType DMP4EST PetscDMType DMP8EST PetscDMType DMSWARM PetscDMType DMPRODUCT PetscDMType DMSTAG ctypedef enum PetscDMBoundaryType"DMBoundaryType": DM_BOUNDARY_NONE DM_BOUNDARY_GHOSTED DM_BOUNDARY_MIRROR DM_BOUNDARY_PERIODIC DM_BOUNDARY_TWIST ctypedef int (*PetscDMCoarsenHook)(PetscDM, PetscDM, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscDMRestrictHook)(PetscDM, PetscMat, PetscVec, PetscMat, PetscDM, void*) except PETSC_ERR_PYTHON int DMCreate(MPI_Comm,PetscDM*) int DMClone(PetscDM,PetscDM*) int DMDestroy(PetscDM*) int DMView(PetscDM,PetscViewer) int DMLoad(PetscDM,PetscViewer) int DMSetType(PetscDM,PetscDMType) int DMGetType(PetscDM,PetscDMType*) int DMGetDimension(PetscDM,PetscInt*) int DMSetDimension(PetscDM,PetscInt) int DMSetOptionsPrefix(PetscDM,char[]) int DMSetFromOptions(PetscDM) int DMViewFromOptions(PetscDM,PetscObject,char[]) int DMSetUp(PetscDM) int DMGetAdjacency(PetscDM,PetscInt,PetscBool*,PetscBool*) int DMSetAdjacency(PetscDM,PetscInt,PetscBool,PetscBool) int DMGetBasicAdjacency(PetscDM,PetscBool*,PetscBool*) int DMSetBasicAdjacency(PetscDM,PetscBool,PetscBool) int DMSetNumFields(PetscDM,PetscInt) int DMGetNumFields(PetscDM,PetscInt*) int DMSetField(PetscDM,PetscInt,PetscDMLabel,PetscObject) int DMAddField(PetscDM,PetscDMLabel,PetscObject) int DMGetField(PetscDM,PetscInt,PetscDMLabel*,PetscObject*) int DMCopyFields(PetscDM,PetscDM) int DMCreateDS(PetscDM) int DMClearDS(PetscDM) int DMGetDS(PetscDM,PetscDS*) int DMCopyDS(PetscDM,PetscDM) int DMCopyDisc(PetscDM,PetscDM) int DMGetBlockSize(PetscDM,PetscInt*) int DMSetVecType(PetscDM,PetscVecType) int DMCreateLocalVector(PetscDM,PetscVec*) int DMCreateGlobalVector(PetscDM,PetscVec*) int DMGetLocalVector(PetscDM,PetscVec*) int DMRestoreLocalVector(PetscDM,PetscVec*) int DMGetGlobalVector(PetscDM,PetscVec*) int DMRestoreGlobalVector(PetscDM,PetscVec*) int DMSetMatType(PetscDM,PetscMatType) int DMCreateMatrix(PetscDM,PetscMat*) int DMGetCoordinateDM(PetscDM,PetscDM*) int DMGetCoordinateSection(PetscDM,PetscSection*) int DMSetCoordinates(PetscDM,PetscVec) int DMGetCoordinates(PetscDM,PetscVec*) int DMSetCoordinatesLocal(PetscDM,PetscVec) int DMGetCoordinatesLocal(PetscDM,PetscVec*) int DMGetCoordinateDim(PetscDM,PetscInt*) int DMSetCoordinateDim(PetscDM,PetscInt) int DMLocalizeCoordinates(PetscDM) int DMCreateInterpolation(PetscDM,PetscDM,PetscMat*,PetscVec*) int DMCreateInjection(PetscDM,PetscDM,PetscMat*) int DMCreateRestriction(PetscDM,PetscDM,PetscMat*) int DMConvert(PetscDM,PetscDMType,PetscDM*) int DMRefine(PetscDM,MPI_Comm,PetscDM*) int DMCoarsen(PetscDM,MPI_Comm,PetscDM*) int DMRefineHierarchy(PetscDM,PetscInt,PetscDM[]) int DMCoarsenHierarchy(PetscDM,PetscInt,PetscDM[]) int DMGetRefineLevel(PetscDM,PetscInt*) int DMSetRefineLevel(PetscDM,PetscInt) int DMGetCoarsenLevel(PetscDM,PetscInt*) int DMAdaptLabel(PetscDM,PetscDMLabel,PetscDM*) int DMAdaptMetric(PetscDM,PetscVec,PetscDMLabel,PetscDM*) int DMGlobalToLocalBegin(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMGlobalToLocalEnd(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMLocalToGlobalBegin(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMLocalToGlobalEnd(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMLocalToLocalBegin(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMLocalToLocalEnd(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMGetLocalToGlobalMapping(PetscDM,PetscLGMap*) int DMSetSection(PetscDM,PetscSection) int DMGetSection(PetscDM,PetscSection*) int DMSetGlobalSection(PetscDM,PetscSection) int DMGetGlobalSection(PetscDM,PetscSection*) int DMCreateSectionSF(PetscDM,PetscSection,PetscSection) int DMGetSectionSF(PetscDM,PetscSF*) int DMSetSectionSF(PetscDM,PetscSF) int DMGetPointSF(PetscDM,PetscSF*) int DMSetPointSF(PetscDM,PetscSF) int DMCreateLabel(PetscDM,const char[]) int DMGetLabelValue(PetscDM,const char[],PetscInt,PetscInt*) int DMSetLabelValue(PetscDM,const char[],PetscInt,PetscInt) int DMHasLabel(PetscDM,const char[],PetscBool*) int DMClearLabelValue(PetscDM,const char[],PetscInt,PetscInt) int DMGetLabelSize(PetscDM,const char[],PetscInt*) int DMGetLabelIdIS(PetscDM,const char[],PetscIS*) int DMGetStratumSize(PetscDM,const char[],PetscInt,PetscInt*) int DMGetStratumIS(PetscDM,const char[],PetscInt,PetscIS*) int DMClearLabelStratum(PetscDM,const char[],PetscInt) int DMSetLabelOutput(PetscDM,const char[],PetscBool) int DMGetLabelOutput(PetscDM,const char[],PetscBool*) int DMGetNumLabels(PetscDM,PetscInt*) int DMGetLabelName(PetscDM,PetscInt,const char**) int DMHasLabel(PetscDM,const char[],PetscBool*) int DMGetLabel(PetscDM,const char*,PetscDMLabel*) int DMAddLabel(PetscDM,PetscDMLabel) int DMRemoveLabel(PetscDM,const char[],PetscDMLabel*) int DMLabelDestroy(PetscDMLabel *) #int DMCopyLabels(PetscDM,PetscDM) int DMShellSetGlobalVector(PetscDM,PetscVec) int DMShellSetLocalVector(PetscDM,PetscVec) int DMKSPSetComputeOperators(PetscDM,PetscKSPComputeOpsFunction,void*) int DMCreateFieldDecomposition(PetscDM,PetscInt*,char***,PetscIS**,PetscDM**) int DMSNESSetFunction(PetscDM,PetscSNESFunctionFunction,void*) int DMSNESSetJacobian(PetscDM,PetscSNESJacobianFunction,void*) int DMCoarsenHookAdd(PetscDM,PetscDMCoarsenHook,PetscDMRestrictHook,void*) # -------------------------------------------------------------------- cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ except (-1): if boundary is None: return DM_BOUNDARY_NONE if boundary is False: return DM_BOUNDARY_NONE if boundary is True: return DM_BOUNDARY_PERIODIC if isinstance(boundary, str): if boundary == 'none': return DM_BOUNDARY_NONE elif boundary == 'ghosted': return DM_BOUNDARY_GHOSTED elif boundary == 'mirror': return DM_BOUNDARY_MIRROR elif boundary == 'periodic': return DM_BOUNDARY_PERIODIC elif boundary == 'twist': return DM_BOUNDARY_TWIST else: raise ValueError("unknown boundary type: %s" % boundary) return boundary cdef inline PetscInt asBoundary(object boundary, PetscDMBoundaryType *_x, PetscDMBoundaryType *_y, PetscDMBoundaryType *_z) except -1: cdef PetscInt dim = 0 cdef object x=None, y=None, z=None if (boundary is None or isinstance(boundary, str) or isinstance(boundary, int)): _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) else: _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE boundary = tuple(boundary) dim = len(boundary) if dim == 0: pass elif dim == 1: (x,) = boundary elif dim == 2: (x, y) = boundary elif dim == 3: (x, y, z) = boundary if dim >= 1: _x[0] = asBoundaryType(x) if dim >= 2: _y[0] = asBoundaryType(y) if dim >= 3: _z[0] = asBoundaryType(z) return dim cdef inline object toBoundary(PetscInt dim, PetscDMBoundaryType x, PetscDMBoundaryType y, PetscDMBoundaryType z): if dim == 0: return () elif dim == 1: return (x,) elif dim == 2: return (x, y) elif dim == 3: return (x, y, z) # ----------------------------------------------------------------------------- cdef inline DM ref_DM(PetscDM dm): cdef DM ob = DM() ob.dm = dm PetscINCREF(ob.obj) return ob # -------------------------------------------------------------------- cdef int DM_PyCoarsenHook( PetscDM fine, PetscDM coarse, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef DM Fine = ref_DM(fine) cdef DM Coarse = ref_DM(coarse) cdef object hooks = Fine.get_attr('__coarsenhooks__') assert hooks is not None and type(hooks) is list for hook in hooks: (hookop, args, kargs) = hook hookop(Fine, Coarse, *args, **kargs) return 0 cdef int DM_PyRestrictHook( PetscDM fine, PetscMat mrestrict, PetscVec rscale, PetscMat inject, PetscDM coarse, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef DM Fine = ref_DM(fine) cdef Mat Mrestrict = ref_Mat(mrestrict) cdef Vec Rscale = ref_Vec(rscale) cdef Mat Inject = ref_Mat(inject) cdef DM Coarse = ref_DM(coarse) cdef object hooks = Fine.get_attr('__restricthooks__') assert hooks is not None and type(hooks) is list for hook in hooks: (hookop, args, kargs) = hook hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) return 0 # ----------------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscdt.pxi0000644000175000017500000000613613750315427017470 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum int "PetscGaussLobattoLegendreCreateType": PETSCGAUSSLOBATTOLEGENDRE_VIA_LINEAR_ALGEBRA PETSCGAUSSLOBATTOLEGENDRE_VIA_NEWTON int PetscFECreateDefault(MPI_Comm, PetscInt, PetscInt, PetscBool, const char [], PetscInt, PetscFE*) int PetscQuadratureCreate(MPI_Comm, PetscQuadrature*) int PetscQuadratureDuplicate(PetscQuadrature, PetscQuadrature*) int PetscQuadratureGetOrder(PetscQuadrature, PetscInt*) int PetscQuadratureSetOrder(PetscQuadrature, PetscInt) int PetscQuadratureGetNumComponents(PetscQuadrature, PetscInt*) int PetscQuadratureSetNumComponents(PetscQuadrature, PetscInt) int PetscQuadratureGetData(PetscQuadrature, PetscInt*, PetscInt*, PetscInt*, const PetscReal *[], const PetscReal *[]) int PetscQuadratureSetData(PetscQuadrature, PetscInt, PetscInt, PetscInt, const PetscReal [], const PetscReal []) int PetscQuadratureView(PetscQuadrature, PetscViewer) int PetscQuadratureDestroy(PetscQuadrature *) int PetscQuadratureExpandComposite(PetscQuadrature, PetscInt, const PetscReal[], const PetscReal[], PetscQuadrature *) int PetscDTLegendreEval(PetscInt,const PetscReal*,PetscInt,const PetscInt*,PetscReal*,PetscReal*,PetscReal*) int PetscDTGaussQuadrature(PetscInt,PetscReal,PetscReal,PetscReal*,PetscReal*) int PetscDTGaussLobattoLegendreQuadrature(PetscInt,PetscGaussLobattoLegendreCreateType,PetscReal*,PetscReal*) int PetscDTReconstructPoly(PetscInt,PetscInt,const PetscReal*,PetscInt,const PetscReal*,PetscReal*) int PetscDTGaussTensorQuadrature(PetscInt,PetscInt,PetscInt,PetscReal,PetscReal,PetscQuadrature*) int PetscDTGaussJacobiQuadrature(PetscInt,PetscInt,PetscInt,PetscReal,PetscReal,PetscQuadrature*) int PetscDTTanhSinhTensorQuadrature(PetscInt, PetscInt, PetscReal, PetscReal, PetscQuadrature *) int PetscDTTanhSinhIntegrate(void (*)(PetscReal, PetscReal *), PetscReal, PetscReal, PetscInt, PetscReal *) int PetscDTTanhSinhIntegrateMPFR(void (*)(PetscReal, PetscReal *), PetscReal, PetscReal, PetscInt, PetscReal *) int PetscGaussLobattoLegendreIntegrate(PetscInt, PetscReal *, PetscReal *, const PetscReal *, PetscReal *) int PetscGaussLobattoLegendreElementLaplacianCreate(PetscInt, PetscReal *, PetscReal *, PetscReal ***) int PetscGaussLobattoLegendreElementLaplacianDestroy(PetscInt, PetscReal *, PetscReal *, PetscReal ***) int PetscGaussLobattoLegendreElementGradientCreate(PetscInt, PetscReal *, PetscReal *, PetscReal ***, PetscReal ***) int PetscGaussLobattoLegendreElementGradientDestroy(PetscInt, PetscReal *, PetscReal *, PetscReal ***, PetscReal ***) int PetscGaussLobattoLegendreElementAdvectionCreate(PetscInt, PetscReal *, PetscReal *, PetscReal ***) int PetscGaussLobattoLegendreElementAdvectionDestroy(PetscInt, PetscReal *, PetscReal *, PetscReal ***) int PetscGaussLobattoLegendreElementMassCreate(PetscInt, PetscReal *, PetscReal *, PetscReal ***) int PetscGaussLobattoLegendreElementMassDestroy(PetscInt, PetscReal *, PetscReal *, PetscReal ***) petsc4py-3.15.1/src/PETSc/DMPlex.pyx0000644000175000017500000006447114062763234017201 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class DMPlex(DM): def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDM newdm = NULL CHKERR( DMPlexCreate(ccomm, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createFromCellList(self, dim, cells, coords, interpolate=True, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool interp = interpolate cdef PetscDM newdm = NULL cdef PetscInt cdim = asInt(dim) cdef PetscInt numCells = 0 cdef PetscInt numCorners = 0 cdef PetscInt *cellVertices = NULL cdef PetscInt numVertices = 0 cdef PetscInt spaceDim= 0 cdef PetscReal *vertexCoords = NULL cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) if PyArray_NDIM(cells) != 2: raise ValueError( ("cell indices must have two dimensions: " "cells.ndim=%d") % (PyArray_NDIM(cells)) ) if PyArray_NDIM(coords) != 2: raise ValueError( ("coords vertices must have two dimensions: " "coords.ndim=%d") % (PyArray_NDIM(coords)) ) numCells = PyArray_DIM(cells, 0) numCorners = PyArray_DIM(cells, 1) numVertices = PyArray_DIM(coords, 0) spaceDim = PyArray_DIM(coords, 1) cellVertices = PyArray_DATA(cells) vertexCoords = PyArray_DATA(coords) CHKERR( DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices, numCorners, interp, cellVertices, spaceDim, vertexCoords, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), simplex=True, periodic=False, interpolate=True, comm=None): cdef Py_ssize_t i = 0 cdef PetscInt dim = 0, *cfaces = NULL faces = iarray_i(faces, &dim, &cfaces) assert dim >= 1 and dim <= 3 cdef PetscReal clower[3] clower[0] = clower[1] = clower[2] = 0 for i from 0 <= i < dim: clower[i] = lower[i] cdef PetscReal cupper[3] cupper[0] = cupper[1] = cupper[2] = 1 for i from 0 <= i < dim: cupper[i] = upper[i] cdef PetscDMBoundaryType btype[3]; asBoundary(periodic, &btype[0], &btype[1], &btype[2]) cdef PetscBool csimplex = simplex cdef PetscBool cinterp = interpolate cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDM newdm = NULL CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, clower, cupper, btype, cinterp, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createFromFile(self, filename, interpolate=True, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool interp = interpolate cdef PetscDM newdm = NULL cdef const char *cfile = NULL filename = str2bytes(filename, &cfile) CHKERR( DMPlexCreateFromFile(ccomm, cfile, interp, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createCGNS(self, cgid, interpolate=True, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool interp = interpolate cdef PetscDM newdm = NULL cdef PetscInt ccgid = asInt(cgid) CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createCGNSFromFile(self, filename, interpolate=True, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool interp = interpolate cdef PetscDM newdm = NULL cdef const char *cfile = NULL filename = str2bytes(filename, &cfile) CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createExodusFromFile(self, filename, interpolate=True, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool interp = interpolate cdef PetscDM newdm = NULL cdef const char *cfile = NULL filename = str2bytes(filename, &cfile) CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createExodus(self, exoid, interpolate=True, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool interp = interpolate cdef PetscDM newdm = NULL cdef PetscInt cexoid = asInt(exoid) CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createGmsh(self, Viewer viewer, interpolate=True, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool interp = interpolate cdef PetscDM newdm = NULL CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def createCohesiveSubmesh(self, hasLagrange, value): cdef PetscBool flag = hasLagrange cdef PetscInt cvalue = asInt(value) cdef DM subdm = DMPlex() CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) return subdm def getChart(self): cdef PetscInt pStart = 0, pEnd = 0 CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) return toInt(pStart), toInt(pEnd) def setChart(self, pStart, pEnd): cdef PetscInt cStart = asInt(pStart) cdef PetscInt cEnd = asInt(pEnd) CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) def getConeSize(self, p): cdef PetscInt cp = asInt(p) cdef PetscInt pStart = 0, pEnd = 0 CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) assert cp>=pStart and cp=pStart and cp=pStart and cp=pStart and cp=pStart and cp=pStart and cp=pStart and cp=pStart and cp=pStart and cp=pStart and cp=pStart and cpsec.sec, &ccomm) ) CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) if newvec.vec == NULL: CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) CHKERR( VecCreate(ccomm, &newvec.vec) ) CHKERR( DMPlexDistributeField(self.dm, sf.sf, sec.sec, vec.vec, newsec.sec, newvec.vec)) return (newsec, newvec) def createCoarsePointIS(self): cdef IS fpoint = IS() CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) return fpoint def createSection(self, numComp, numDof, bcField=None, bcComps=None, bcPoints=None, IS perm=None): # topological dimension cdef PetscInt dim = 0 CHKERR( DMGetDimension(self.dm, &dim) ) # components and DOFs cdef PetscInt ncomp = 0, ndof = 0 cdef PetscInt *icomp = NULL, *idof = NULL numComp = iarray_i(numComp, &ncomp, &icomp) numDof = iarray_i(numDof, &ndof, &idof) assert ndof == ncomp*(dim+1) # boundary conditions cdef PetscInt nbc = 0, i = 0 cdef PetscInt *bcfield = NULL cdef PetscIS *bccomps = NULL cdef PetscIS *bcpoints = NULL if bcField is not None: bcField = iarray_i(bcField, &nbc, &bcfield) if bcComps is not None: bcComps = list(bcComps) assert len(bcComps) == nbc tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) for i from 0 <= i < nbc: bccomps[i] = (bcComps[i]).iset if bcPoints is not None: bcPoints = list(bcPoints) assert len(bcPoints) == nbc tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) for i from 0 <= i < nbc: bcpoints[i] = (bcPoints[i]).iset else: raise ValueError("bcPoints is a required argument") else: assert bcComps is None assert bcPoints is None # optional chart permutations cdef PetscIS cperm = NULL if perm is not None: cperm = perm.iset # create section cdef Section sec = Section() CHKERR( DMPlexCreateSection(self.dm, NULL, icomp, idof, nbc, bcfield, bccomps, bcpoints, cperm, &sec.sec) ) return sec def getPointLocal(self, point): cdef PetscInt start = 0, end = 0 cdef PetscInt cpoint = asInt(point) CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) return toInt(start), toInt(end) def getPointLocalField(self, point, field): cdef PetscInt start = 0, end = 0 cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) return toInt(start), toInt(end) def getPointGlobal(self, point): cdef PetscInt start = 0, end = 0 cdef PetscInt cpoint = asInt(point) CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) return toInt(start), toInt(end) def getPointGlobalField(self, point, field): cdef PetscInt start = 0, end = 0 cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) return toInt(start), toInt(end) def createClosureIndex(self, Section sec or None): cdef PetscSection csec = sec.sec if sec is not None else NULL CHKERR( DMPlexCreateClosureIndex(self.dm, csec) ) # def setRefinementUniform(self, refinementUniform=True): cdef PetscBool flag = refinementUniform CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) def getRefinementUniform(self): cdef PetscBool flag = PETSC_FALSE CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) return toBool(flag) def setRefinementLimit(self, refinementLimit): cdef PetscReal rval = asReal(refinementLimit) CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) def getRefinementLimit(self): cdef PetscReal rval = 0.0 CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) return toReal(rval) def getOrdering(self, otype): cdef PetscMatOrderingType cval = NULL cdef PetscDMLabel label = NULL otype = str2bytes(otype, &cval) cdef IS perm = IS() CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) return perm def permute(self, IS perm): cdef DMPlex dm = type(self)() CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) return dm # def computeCellGeometryFVM(self, cell): cdef PetscInt cdim = 0 cdef PetscInt ccell = asInt(cell) CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) cdef PetscReal vol = 0, centroid[3], normal[3] CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) def constructGhostCells(self, labelName=None): cdef const char *cname = NULL labelName = str2bytes(labelName, &cname) cdef PetscInt numGhostCells = 0 cdef PetscDM dmGhosted = NULL CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) PetscCLEAR(self.obj); self.dm = dmGhosted return toInt(numGhostCells) petsc4py-3.15.1/src/PETSc/petscmem.pxi0000644000175000017500000000045313750315427017633 0ustar balaybalay00000000000000cdef extern from * nogil: int PetscMalloc(size_t,void*) int PetscFree(void*) int PetscMemcpy(void*,void*,size_t) int PetscMemmove(void*,void*,size_t) int PetscMemzero(void*,size_t) int PetscMemcmp(void*,void*,size_t,PetscBool*) int PetscStrallocpy(const char[],char*[]) petsc4py-3.15.1/src/PETSc/petsctao.pxi0000644000175000017500000004027214030740317017633 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscTAOType "TaoType" PetscTAOType TAOLMVM PetscTAOType TAONLS PetscTAOType TAONTR PetscTAOType TAONTL PetscTAOType TAOCG PetscTAOType TAOTRON PetscTAOType TAOOWLQN PetscTAOType TAOBMRM PetscTAOType TAOBLMVM PetscTAOType TAOBQNLS PetscTAOType TAOBNCG PetscTAOType TAOBNLS PetscTAOType TAOBNTR PetscTAOType TAOBNTL PetscTAOType TAOBQNKLS PetscTAOType TAOBQNKTR PetscTAOType TAOBQNKTL PetscTAOType TAOBQPIP PetscTAOType TAOGPCG PetscTAOType TAONM PetscTAOType TAOPOUNDERS PetscTAOType TAOBRGN PetscTAOType TAOLCL PetscTAOType TAOSSILS PetscTAOType TAOSSFLS PetscTAOType TAOASILS PetscTAOType TAOASFLS PetscTAOType TAOIPM PetscTAOType TAOPDIPM PetscTAOType TAOSHELL PetscTAOType TAOADMM PetscTAOType TAOALMM ctypedef enum PetscTAOConvergedReason "TaoConvergedReason": #iterating TAO_CONTINUE_ITERATING # converged TAO_CONVERGED_GATOL TAO_CONVERGED_GRTOL TAO_CONVERGED_GTTOL TAO_CONVERGED_STEPTOL TAO_CONVERGED_MINF TAO_CONVERGED_USER # diverged TAO_DIVERGED_MAXITS TAO_DIVERGED_NAN TAO_DIVERGED_MAXFCN TAO_DIVERGED_LS_FAILURE TAO_DIVERGED_TR_REDUCTION TAO_DIVERGED_USER int TaoView(PetscTAO,PetscViewer) int TaoDestroy(PetscTAO*) int TaoCreate(MPI_Comm,PetscTAO*) int TaoSetOptionsPrefix(PetscTAO, char[]) int TaoGetOptionsPrefix(PetscTAO, char*[]) int TaoSetFromOptions(PetscTAO) int TaoSetType(PetscTAO,PetscTAOType) int TaoGetType(PetscTAO,PetscTAOType*) int TaoSetUp(PetscTAO) int TaoSolve(PetscTAO) int TaoSetTolerances(PetscTAO,PetscReal,PetscReal,PetscReal) int TaoGetTolerances(PetscTAO,PetscReal*,PetscReal*,PetscReal*) int TaoSetConstraintTolerances(PetscTAO,PetscReal,PetscReal) int TaoGetConstraintTolerances(PetscTAO,PetscReal*,PetscReal*) int TaoSetFunctionLowerBound(PetscTAO,PetscReal) int TaoSetMaximumIterates(PetscTAO, PetscInt) int TaoSetMaximumFunctionEvaluations(PetscTAO, PetscInt) int TaoSetTrustRegionTolerance(PetscTAO,PetscReal) int TaoGetInitialTrustRegionRadius(PetscTAO,PetscReal*) int TaoGetTrustRegionRadius(PetscTAO,PetscReal*) int TaoSetTrustRegionRadius(PetscTAO,PetscReal) ctypedef int TaoConvergenceTest(PetscTAO,void*) except PETSC_ERR_PYTHON int TaoDefaultConvergenceTest(PetscTAO tao,void *dummy) except PETSC_ERR_PYTHON int TaoSetConvergenceTest(PetscTAO, TaoConvergenceTest*, void*) int TaoSetConvergedReason(PetscTAO,PetscTAOConvergedReason) int TaoGetConvergedReason(PetscTAO,PetscTAOConvergedReason*) int TaoGetSolutionStatus(PetscTAO,PetscInt*, PetscReal*,PetscReal*, PetscReal*,PetscReal*, PetscTAOConvergedReason*) ctypedef int TaoMonitor(PetscTAO,void*) except PETSC_ERR_PYTHON ctypedef int (*TaoMonitorDestroy)(void**) int TaoSetMonitor(PetscTAO,TaoMonitor,void*,TaoMonitorDestroy) int TaoCancelMonitors(PetscTAO) int TaoComputeObjective(PetscTAO,PetscVec,PetscReal*) int TaoComputeResidual(PetscTAO,PetscVec,PetscVec) int TaoComputeGradient(PetscTAO,PetscVec,PetscVec) int TaoComputeObjectiveAndGradient(PetscTAO,PetscVec,PetscReal*,PetscVec) int TaoComputeConstraints(PetscTAO,PetscVec,PetscVec) int TaoComputeDualVariables(PetscTAO,PetscVec,PetscVec) int TaoComputeVariableBounds(PetscTAO) int TaoComputeHessian (PetscTAO,PetscVec,PetscMat,PetscMat) int TaoComputeJacobian(PetscTAO,PetscVec,PetscMat,PetscMat) int TaoSetInitialVector(PetscTAO,PetscVec) int TaoSetConstraintsVec(PetscTAO,PetscVec) int TaoSetVariableBounds(PetscTAO,PetscVec,PetscVec) int TaoSetHessianMat(PetscTAO,PetscMat,PetscMat) int TaoSetJacobianMat(PetscTAO,PetscMat,PetscMat) int TaoGetSolutionVector(PetscTAO,PetscVec*) int TaoGetGradientVector(PetscTAO,PetscVec*) int TaoSetGradientNorm(PetscTAO,PetscMat) int TaoGetGradientNorm(PetscTAO,PetscMat*) int TaoLMVMSetH0(PetscTAO,PetscMat) int TaoLMVMGetH0(PetscTAO,PetscMat*) int TaoLMVMGetH0KSP(PetscTAO,PetscKSP*) int TaoGetVariableBounds(PetscTAO,PetscVec*,PetscVec*) #int TaoGetConstraintsVec(PetscTAO,PetscVec*) #int TaoGetVariableBoundVecs(PetscTAO,PetscVec*,PetscVec*) #int TaoGetHessianMat(PetscTAO,PetscMat*,PetscMat*) #int TaoGetJacobianMat(PetscTAO,PetscMat*,PetscMat*) ctypedef int TaoObjective(PetscTAO,PetscVec,PetscReal*,void*) except PETSC_ERR_PYTHON ctypedef int TaoResidual(PetscTAO,PetscVec,PetscVec,void*) except PETSC_ERR_PYTHON ctypedef int TaoGradient(PetscTAO,PetscVec,PetscVec,void*) except PETSC_ERR_PYTHON ctypedef int TaoObjGrad(PetscTAO,PetscVec,PetscReal*,PetscVec,void*) except PETSC_ERR_PYTHON ctypedef int TaoRegularizerObjGrad(PetscTAO,PetscVec,PetscReal*,PetscVec,void*) except PETSC_ERR_PYTHON ctypedef int TaoVarBounds(PetscTAO,PetscVec,PetscVec,void*) except PETSC_ERR_PYTHON ctypedef int TaoConstraints(PetscTAO,PetscVec,PetscVec,void*) except PETSC_ERR_PYTHON ctypedef int TaoHessian(PetscTAO,PetscVec, PetscMat,PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int TaoRegularizerHessian(PetscTAO,PetscVec,PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int TaoJacobian(PetscTAO,PetscVec, PetscMat,PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int TaoJacobianResidual(PetscTAO,PetscVec, PetscMat,PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int TaoJacobianState(PetscTAO,PetscVec, PetscMat,PetscMat,PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int TaoJacobianDesign(PetscTAO,PetscVec,PetscMat, void*) except PETSC_ERR_PYTHON int TaoSetObjectiveRoutine(PetscTAO,TaoObjective*,void*) int TaoSetResidualRoutine(PetscTAO,PetscVec,TaoResidual,void*) int TaoSetGradientRoutine(PetscTAO,TaoGradient*,void*) int TaoSetObjectiveAndGradientRoutine(PetscTAO,TaoObjGrad*,void*) int TaoSetVariableBoundsRoutine(PetscTAO,TaoVarBounds*,void*) int TaoSetConstraintsRoutine(PetscTAO,PetscVec,TaoConstraints*,void*) int TaoSetHessianRoutine(PetscTAO,PetscMat,PetscMat,TaoHessian*,void*) int TaoSetJacobianRoutine(PetscTAO,PetscMat,PetscMat,TaoJacobian*,void*) int TaoSetJacobianResidualRoutine(PetscTAO,PetscMat,PetscMat,TaoJacobianResidual*,void*) int TaoSetStateDesignIS(PetscTAO,PetscIS,PetscIS) int TaoSetJacobianStateRoutine(PetscTAO,PetscMat,PetscMat,PetscMat,TaoJacobianState*,void*) int TaoSetJacobianDesignRoutine(PetscTAO,PetscMat,TaoJacobianDesign*,void*) int TaoSetInitialTrustRegionRadius(PetscTAO,PetscReal) int TaoGetKSP(PetscTAO,PetscKSP*) int TaoBRGNGetSubsolver(PetscTAO,PetscTAO*) int TaoBRGNSetRegularizerObjectiveAndGradientRoutine(PetscTAO,TaoRegularizerObjGrad*,void*) int TaoBRGNSetRegularizerHessianRoutine(PetscTAO,PetscMat,TaoRegularizerHessian*,void*) int TaoBRGNSetRegularizerWeight(PetscTAO,PetscReal) int TaoBRGNSetL1SmoothEpsilon(PetscTAO,PetscReal) int TaoBRGNSetDictionaryMatrix(PetscTAO,PetscMat) int TaoBRGNGetDampingVector(PetscTAO,PetscVec*) # -------------------------------------------------------------------- cdef inline TAO ref_TAO(PetscTAO tao): cdef TAO ob = TAO() ob.tao = tao PetscINCREF(ob.obj) return ob # -------------------------------------------------------------------- cdef int TAO_Objective(PetscTAO _tao, PetscVec _x, PetscReal *_f, void *ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) context = tao.get_attr("__objective__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (objective, args, kargs) = context retv = objective(tao, x, *args, **kargs) _f[0] = asReal(retv) return 0 cdef int TAO_Residual(PetscTAO _tao, PetscVec _x, PetscVec _r, void *ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Vec r = ref_Vec(_r) context = tao.get_attr("__residual__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (residual, args, kargs) = context residual(tao, x, r, *args, **kargs) return 0 cdef int TAO_Gradient(PetscTAO _tao, PetscVec _x, PetscVec _g, void *ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Vec g = ref_Vec(_g) context = tao.get_attr("__gradient__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (gradient, args, kargs) = context gradient(tao, x, g, *args, **kargs) return 0 cdef int TAO_ObjGrad(PetscTAO _tao, PetscVec _x, PetscReal *_f, PetscVec _g, void *ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Vec g = ref_Vec(_g) context = tao.get_attr("__objgrad__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (objgrad, args, kargs) = context retv = objgrad(tao, x, g, *args, **kargs) _f[0] = asReal(retv) return 0 cdef int TAO_BRGNRegObjGrad(PetscTAO _tao, PetscVec _x, PetscReal *_f, PetscVec _g, void *ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Vec g = ref_Vec(_g) context = tao.get_attr("__brgnregobjgrad__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (objgrad, args, kargs) = context retv = objgrad(tao, x, g, *args, **kargs) _f[0] = asReal(retv) return 0 cdef int TAO_Constraints(PetscTAO _tao, PetscVec _x, PetscVec _r, void *ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Vec r = ref_Vec(_r) context = tao.get_attr("__constraints__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (constraints, args, kargs) = context constraints(tao, x, r, *args, **kargs) return 0 cdef int TAO_VarBounds(PetscTAO _tao, PetscVec _xl, PetscVec _xu, void *ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec xl = ref_Vec(_xl) cdef Vec xu = ref_Vec(_xu) context = tao.get_attr("__varbounds__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (varbounds, args, kargs) = context varbounds(tao, xl, xu, *args, **kargs) return 0 cdef int TAO_Hessian(PetscTAO _tao, PetscVec _x, PetscMat _H, PetscMat _P, void* ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Mat H = ref_Mat(_H) cdef Mat P = ref_Mat(_P) context = tao.get_attr("__hessian__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (hessian, args, kargs) = context hessian(tao, x, H, P, *args, **kargs) return 0 cdef int TAO_BRGNRegHessian(PetscTAO _tao, PetscVec _x, PetscMat _H, void* ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Mat H = ref_Mat(_H) context = tao.get_attr("__brgnreghessian__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (hessian, args, kargs) = context hessian(tao, x, H, *args, **kargs) return 0 cdef int TAO_Jacobian(PetscTAO _tao, PetscVec _x, PetscMat _J, PetscMat _P, void* ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Mat J = ref_Mat(_J) cdef Mat P = ref_Mat(_P) context = tao.get_attr("__jacobian__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(tao, x, J, P, *args, **kargs) return 0 cdef int TAO_JacobianResidual(PetscTAO _tao, PetscVec _x, PetscMat _J, PetscMat _P, void* ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Mat J = ref_Mat(_J) cdef Mat P = ref_Mat(_P) context = tao.get_attr("__jacobian_residual__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(tao, x, J, P, *args, **kargs) return 0 cdef int TAO_JacobianState(PetscTAO _tao, PetscVec _x, PetscMat _J, PetscMat _P, PetscMat _I, void* ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Mat J = ref_Mat(_J) cdef Mat P = ref_Mat(_P) cdef Mat I = ref_Mat(_I) context = tao.get_attr("__jacobian_state__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(tao, x, J, P, I, *args, **kargs) return 0 cdef int TAO_JacobianDesign(PetscTAO _tao, PetscVec _x, PetscMat _J, void* ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef Vec x = ref_Vec(_x) cdef Mat J = ref_Mat(_J) context = tao.get_attr("__jacobian_design__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(tao, x, J, *args, **kargs) return 0 cdef int TAO_Converged(PetscTAO _tao, void* ctx) except PETSC_ERR_PYTHON with gil: # call first the default convergence test CHKERR( TaoDefaultConvergenceTest(_tao, NULL) ) # call next the user-provided convergence test cdef TAO tao = ref_TAO(_tao) (converged, args, kargs) = tao.get_attr('__converged__') reason = converged(tao, *args, **kargs) if reason is None: return 0 # handle value of convergence reason cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING if reason is False or reason == -1: creason = TAO_DIVERGED_USER elif reason is True or reason == 1: creason = TAO_CONVERGED_USER else: creason = reason assert creason >= TAO_DIVERGED_USER assert creason <= TAO_CONVERGED_USER CHKERR( TaoSetConvergedReason(_tao, creason) ) return 0 cdef int TAO_Monitor(PetscTAO _tao, void* ctx) except PETSC_ERR_PYTHON with gil: cdef TAO tao = ref_TAO(_tao) cdef object monitorlist = tao.get_attr('__monitor__') if monitorlist is None: return 0 for (monitor, args, kargs) in monitorlist: monitor(tao, *args, **kargs) return 0 # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/DM.pyx0000644000175000017500000005427114030740317016335 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class DMType(object): DA = S_(DMDA_type) COMPOSITE = S_(DMCOMPOSITE) SLICED = S_(DMSLICED) SHELL = S_(DMSHELL) PLEX = S_(DMPLEX) REDUNDANT = S_(DMREDUNDANT) PATCH = S_(DMPATCH) MOAB = S_(DMMOAB) NETWORK = S_(DMNETWORK) FOREST = S_(DMFOREST) P4EST = S_(DMP4EST) P8EST = S_(DMP8EST) SWARM = S_(DMSWARM) PRODUCT = S_(DMPRODUCT) STAG = S_(DMSTAG) class DMBoundaryType(object): NONE = DM_BOUNDARY_NONE GHOSTED = DM_BOUNDARY_GHOSTED MIRROR = DM_BOUNDARY_MIRROR PERIODIC = DM_BOUNDARY_PERIODIC TWIST = DM_BOUNDARY_TWIST # -------------------------------------------------------------------- cdef class DM(Object): Type = DMType BoundaryType = DMBoundaryType # def __cinit__(self): self.obj = &self.dm self.dm = NULL def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( DMView(self.dm, vwr) ) def load(self, Viewer viewer): CHKERR( DMLoad(self.dm, viewer.vwr) ) return self def destroy(self): CHKERR( DMDestroy(&self.dm) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDM newdm = NULL CHKERR( DMCreate(ccomm, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def clone(self): cdef DM dm = type(self)() CHKERR( DMClone(self.dm, &dm.dm) ) return dm def setType(self, dm_type): cdef PetscDMType cval = NULL dm_type = str2bytes(dm_type, &cval) CHKERR( DMSetType(self.dm, cval) ) def getType(self): cdef PetscDMType cval = NULL CHKERR( DMGetType(self.dm, &cval) ) return bytes2str(cval) def getDimension(self): cdef PetscInt dim = 0 CHKERR( DMGetDimension(self.dm, &dim) ) return toInt(dim) def setDimension(self, dim): cdef PetscInt cdim = asInt(dim) CHKERR( DMSetDimension(self.dm, cdim) ) def getCoordinateDim(self): cdef PetscInt dim = 0 CHKERR( DMGetCoordinateDim(self.dm, &dim) ) return toInt(dim) def setCoordinateDim(self, dim): cdef PetscInt cdim = asInt(dim) CHKERR( DMSetCoordinateDim(self.dm, cdim) ) def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( DMSetOptionsPrefix(self.dm, cval) ) def setFromOptions(self): CHKERR( DMSetFromOptions(self.dm) ) def viewFromOptions(self, name, Object obj=None): cdef const char *cname = NULL _ = str2bytes(name, &cname) cdef PetscObject cobj = NULL if obj is not None: cobj = obj.obj[0] CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) def setUp(self): CHKERR( DMSetUp(self.dm) ) return self # --- application context --- def setAppCtx(self, appctx): self.set_attr('__appctx__', appctx) def getAppCtx(self): return self.get_attr('__appctx__') # def setBasicAdjacency(self, useCone, useClosure): cdef PetscBool uC = useCone cdef PetscBool uCl = useClosure CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) def getBasicAdjacency(self): cdef PetscBool uC = PETSC_FALSE cdef PetscBool uCl = PETSC_FALSE CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) return toBool(uC), toBool(uCl) def setFieldAdjacency(self, field, useCone, useClosure): cdef PetscInt f = asInt(field) cdef PetscBool uC = useCone cdef PetscBool uCl = useClosure CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) def getFieldAdjacency(self, field): cdef PetscInt f = asInt(field) cdef PetscBool uC = PETSC_FALSE cdef PetscBool uCl = PETSC_FALSE CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) return toBool(uC), toBool(uCl) # def setNumFields(self, numFields): cdef PetscInt cnum = asInt(numFields) CHKERR( DMSetNumFields(self.dm, cnum) ) def getNumFields(self): cdef PetscInt cnum = 0 CHKERR( DMGetNumFields(self.dm, &cnum) ) return toInt(cnum) def setField(self, index, Object field, label=None): cdef PetscInt cidx = asInt(index) cdef PetscObject cobj = field.obj[0] cdef PetscDMLabel clbl = NULL assert label is None CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) def getField(self, index): cdef PetscInt cidx = asInt(index) cdef PetscObject cobj = NULL cdef PetscDMLabel clbl = NULL CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) assert clbl == NULL cdef Object field = subtype_Object(cobj)() field.obj[0] = cobj PetscINCREF(field.obj) return (field, None) def addField(self, Object field, label=None): cdef PetscObject cobj = field.obj[0] cdef PetscDMLabel clbl = NULL assert label is None CHKERR( DMAddField(self.dm, clbl, cobj) ) def copyFields(self, DM dm): CHKERR( DMCopyFields(self.dm, dm.dm) ) def createDS(self): CHKERR( DMCreateDS(self.dm) ) def clearDS(self): CHKERR( DMClearDS(self.dm) ) def getDS(self): cdef DS ds = DS() CHKERR( DMGetDS(self.dm, &ds.ds) ) PetscINCREF(ds.obj) return ds def copyDS(self, DM dm): CHKERR( DMCopyDS(self.dm, dm.dm) ) def copyDisc(self, DM dm): CHKERR( DMCopyDisc(self.dm, dm.dm) ) # def getBlockSize(self): cdef PetscInt bs = 1 CHKERR( DMGetBlockSize(self.dm, &bs) ) return toInt(bs) def setVecType(self, vec_type): cdef PetscVecType vtype = NULL vec_type = str2bytes(vec_type, &vtype) CHKERR( DMSetVecType(self.dm, vtype) ) def createGlobalVec(self): cdef Vec vg = Vec() CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) return vg def createLocalVec(self): cdef Vec vl = Vec() CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) return vl def getGlobalVec(self): cdef Vec vg = Vec() CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) PetscINCREF(vg.obj) return vg def restoreGlobalVec(self, Vec vg): CHKERR( PetscObjectDereference(vg.vec) ) CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) def getLocalVec(self): cdef Vec vl = Vec() CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) PetscINCREF(vl.obj) return vl def restoreLocalVec(self, Vec vl): CHKERR( PetscObjectDereference(vl.vec) ) CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) def globalToLocal(self, Vec vg, Vec vl, addv=None): cdef PetscInsertMode im = insertmode(addv) CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) def localToGlobal(self, Vec vl, Vec vg, addv=None): cdef PetscInsertMode im = insertmode(addv) CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) def localToLocal(self, Vec vl, Vec vlg, addv=None): cdef PetscInsertMode im = insertmode(addv) CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) def getLGMap(self): cdef LGMap lgm = LGMap() CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) PetscINCREF(lgm.obj) return lgm # def getCoordinateDM(self): cdef DM cdm = type(self)() CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) PetscINCREF(cdm.obj) return cdm def getCoordinateSection(self): cdef Section sec = Section() CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) PetscINCREF(sec.obj) return sec def setCoordinates(self, Vec c): CHKERR( DMSetCoordinates(self.dm, c.vec) ) def getCoordinates(self): cdef Vec c = Vec() CHKERR( DMGetCoordinates(self.dm, &c.vec) ) PetscINCREF(c.obj) return c def setCoordinatesLocal(self, Vec c): CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) def getCoordinatesLocal(self): cdef Vec c = Vec() CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) PetscINCREF(c.obj) return c def getBoundingBox(self): cdef PetscInt i,dim=0 CHKERR( DMGetCoordinateDim(self.dm, &dim) ) cdef PetscReal gmin[3], gmax[3] CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) return tuple([(toReal(gmin[i]), toReal(gmax[i])) for i from 0 <= i < dim]) def getLocalBoundingBox(self): cdef PetscInt i,dim=0 CHKERR( DMGetCoordinateDim(self.dm, &dim) ) cdef PetscReal lmin[3], lmax[3] CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) return tuple([(toReal(lmin[i]), toReal(lmax[i])) for i from 0 <= i < dim]) def localizeCoordinates(self): CHKERR( DMLocalizeCoordinates(self.dm) ) # def setMatType(self, mat_type): """Set matrix type to be used by DM.createMat""" cdef PetscMatType mtype = NULL mat_type = str2bytes(mat_type, &mtype) CHKERR( DMSetMatType(self.dm, mtype) ) def createMat(self): cdef Mat mat = Mat() CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) return mat def createInterpolation(self, DM dm): cdef Mat A = Mat() cdef Vec scale = Vec() CHKERR( DMCreateInterpolation(self.dm, dm.dm, &A.mat, &scale.vec)) return(A, scale) def createInjection(self, DM dm): cdef Mat inject = Mat() CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) return inject def createRestriction(self, DM dm): cdef Mat mat = Mat() CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) return mat def convert(self, dm_type): cdef PetscDMType cval = NULL dm_type = str2bytes(dm_type, &cval) cdef PetscDM newdm = NULL CHKERR( DMConvert(self.dm, cval, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm return dm def refine(self, comm=None): cdef MPI_Comm dmcomm = MPI_COMM_NULL CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) dmcomm = def_Comm(comm, dmcomm) cdef PetscDM newdm = NULL CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm return dm def coarsen(self, comm=None): cdef MPI_Comm dmcomm = MPI_COMM_NULL CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) dmcomm = def_Comm(comm, dmcomm) cdef PetscDM newdm = NULL CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm return dm def refineHierarchy(self, nlevels): cdef PetscInt i, n = asInt(nlevels) cdef PetscDM *newdmf = NULL cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) cdef DM dmf = None cdef list hierarchy = [] for i from 0 <= i < n: dmf = subtype_DM(newdmf[i])() dmf.dm = newdmf[i] hierarchy.append(dmf) return hierarchy def coarsenHierarchy(self, nlevels): cdef PetscInt i, n = asInt(nlevels) cdef PetscDM *newdmc = NULL cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) cdef DM dmc = None cdef list hierarchy = [] for i from 0 <= i < n: dmc = subtype_DM(newdmc[i])() dmc.dm = newdmc[i] hierarchy.append(dmc) return hierarchy def getRefineLevel(self): cdef PetscInt n = 0 CHKERR( DMGetRefineLevel(self.dm, &n) ) return toInt(n) def setRefineLevel(self, level): cdef PetscInt clevel = asInt(level) CHKERR( DMSetRefineLevel(self.dm, clevel) ) def getCoarsenLevel(self): cdef PetscInt n = 0 CHKERR( DMGetCoarsenLevel(self.dm, &n) ) return toInt(n) # def adaptLabel(self, label): cdef const char *cval = NULL cdef PetscDMLabel clbl = NULL label = str2bytes(label, &cval) CHKERR( DMGetLabel(self.dm, cval, &clbl) ) cdef DM newdm = DMPlex() CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) return newdm def adaptMetric(self, Vec metric, label=None): cdef const char *cval = NULL cdef PetscDMLabel clbl = NULL label = str2bytes(label, &cval) if cval == NULL: cval = b"" # XXX Should be fixed upstream CHKERR( DMGetLabel(self.dm, cval, &clbl) ) cdef DM newdm = DMPlex() CHKERR( DMAdaptMetric(self.dm, metric.vec, clbl, &newdm.dm) ) return newdm def getLabel(self, name): cdef const char *cname = NULL cdef DMLabel dmlabel = DMLabel() name = str2bytes(name, &cname) CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) PetscINCREF(dmlabel.obj) return dmlabel # def setSection(self, Section sec): CHKERR( DMSetSection(self.dm, sec.sec) ) def getSection(self): cdef Section sec = Section() CHKERR( DMGetSection(self.dm, &sec.sec) ) PetscINCREF(sec.obj) return sec def setGlobalSection(self, Section sec): CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) def getGlobalSection(self): cdef Section sec = Section() CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) PetscINCREF(sec.obj) return sec setDefaultSection = setSection getDefaultSection = getSection setDefaultGlobalSection = setGlobalSection getDefaultGlobalSection = getGlobalSection def createSectionSF(self, Section localsec, Section globalsec): CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) def getSectionSF(self): cdef SF sf = SF() CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) PetscINCREF(sf.obj) return sf def setSectionSF(self, SF sf): CHKERR( DMSetSectionSF(self.dm, sf.sf) ) createDefaultSF = createSectionSF getDefaultSF = getSectionSF setDefaultSF = setSectionSF def getPointSF(self): cdef SF sf = SF() CHKERR( DMGetPointSF(self.dm, &sf.sf) ) PetscINCREF(sf.obj) return sf def setPointSF(self, SF sf): CHKERR( DMSetPointSF(self.dm, sf.sf) ) def getNumLabels(self): cdef PetscInt nLabels = 0 CHKERR( DMGetNumLabels(self.dm, &nLabels) ) return toInt(nLabels) def getLabelName(self, index): cdef PetscInt cindex = asInt(index) cdef const char *cname = NULL CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) return bytes2str(cname) def hasLabel(self, name): cdef PetscBool flag = PETSC_FALSE cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMHasLabel(self.dm, cname, &flag) ) return toBool(flag) def createLabel(self, name): cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMCreateLabel(self.dm, cname) ) def removeLabel(self, name): cdef const char *cname = NULL cdef PetscDMLabel clbl = NULL name = str2bytes(name, &cname) CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) # TODO: Once DMLabel is wrapped, this should return the label, like the C function. CHKERR( DMLabelDestroy(&clbl) ) def getLabelValue(self, name, point): cdef PetscInt cpoint = asInt(point), value = 0 cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) return toInt(value) def setLabelValue(self, name, point, value): cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) def clearLabelValue(self, name, point, value): cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) def getLabelSize(self, name): cdef PetscInt size = 0 cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMGetLabelSize(self.dm, cname, &size) ) return toInt(size) def getLabelIdIS(self, name): cdef const char *cname = NULL name = str2bytes(name, &cname) cdef IS lis = IS() CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) return lis def getStratumSize(self, name, value): cdef PetscInt size = 0 cdef PetscInt cvalue = asInt(value) cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) return toInt(size) def getStratumIS(self, name, value): cdef PetscInt cvalue = asInt(value) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef IS sis = IS() CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) return sis def clearLabelStratum(self, name, value): cdef PetscInt cvalue = asInt(value) cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) def setLabelOutput(self, name, output): cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscBool coutput = output CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) def getLabelOutput(self, name): cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscBool coutput = PETSC_FALSE CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) return coutput # backward compatibility createGlobalVector = createGlobalVec createLocalVector = createLocalVec getMatrix = createMatrix = createMat def setKSPComputeOperators(self, operators, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (operators, args, kargs) self.set_attr('__operators__', context) CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) def createFieldDecomposition(self): cdef PetscInt clen = 0 cdef PetscIS *cis = NULL cdef PetscDM *cdm = NULL cdef char** cnamelist = NULL CHKERR( DMCreateFieldDecomposition(self.dm, &clen, &cnamelist, &cis, &cdm) ) cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] cdef list dms = [] cdef list names = [] cdef DM dm = None for i from 0 <= i < clen: if cdm != NULL: dm = subtype_DM(cdm[i])() dm.dm = cdm[i] PetscINCREF(dm.obj) dms.append(dm) else: dms.append(None) name = bytes2str(cnamelist[i]) names.append(name) CHKERR( PetscFree(cnamelist[i]) ) CHKERR( ISDestroy(&cis[i]) ) CHKERR( DMDestroy(&cdm[i]) ) CHKERR( PetscFree(cis) ) CHKERR( PetscFree(cdm) ) CHKERR( PetscFree(cnamelist) ) return (names, isets, dms) def setSNESFunction(self, function, args=None, kargs=None): if function is not None: if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr('__function__', context) CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) else: CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) def setSNESJacobian(self, jacobian, args=None, kargs=None): if jacobian is not None: if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr('__jacobian__', context) CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) else: CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) def addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} if coarsenhook is not None: coarsencontext = (coarsenhook, args, kargs) coarsenhooks = self.get_attr('__coarsenhooks__') if coarsenhooks is None: coarsenhooks = [coarsencontext] CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) else: coarsenhooks.append(coarsencontext) self.set_attr('__coarsenhooks__', coarsenhooks) if restricthook is not None: restrictcontext = (restricthook, args, kargs) restricthooks = self.get_attr('__restricthooks__') if restricthooks is None: restricthooks = [restrictcontext] CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) else: restricthooks.append(restrictcontext) self.set_attr('__restricthooks__', restricthooks) # --- application context --- property appctx: def __get__(self): return self.getAppCtx() def __set__(self, value): self.setAppCtx(value) # --- discretization space --- property ds: def __get__(self): return self.getDS() def __set__(self, value): self.setDS(value) # -------------------------------------------------------------------- del DMType del DMBoundaryType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petsclog.pxi0000644000175000017500000000505713750315427017643 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef double PetscLogDouble ctypedef struct PetscEventPerfInfo: int count PetscLogDouble flops, time PetscLogDouble numMessages PetscLogDouble messageLength PetscLogDouble numReductions int PetscLogDefaultBegin() int PetscLogAllBegin() int PetscLogView(PetscViewer) int PetscLogFlops(PetscLogDouble) int PetscGetFlops(PetscLogDouble*) int PetscGetCPUTime(PetscLogDouble*) int PetscMallocGetCurrentUsage(PetscLogDouble*) int PetscMemoryGetCurrentUsage(PetscLogDouble*) int PetscTime(PetscLogDouble*) int PetscTimeSubtract(PetscLogDouble*) int PetscTimeAdd(PetscLogDouble*) ctypedef int PetscLogStage int PetscLogStageRegister(char[],PetscLogStage*) int PetscLogStagePush(PetscLogStage) int PetscLogStagePop() int PetscLogStageSetActive(PetscLogStage,PetscBool) int PetscLogStageGetActive(PetscLogStage,PetscBool*) int PetscLogStageSetVisible(PetscLogStage,PetscBool) int PetscLogStageGetVisible(PetscLogStage,PetscBool*) int PetscLogStageGetId(char[],PetscLogStage*) ctypedef int PetscLogClass "PetscClassId" int PetscLogClassRegister"PetscClassIdRegister"(char[],PetscLogClass*) int PetscLogClassActivate"PetscLogEventActivateClass"(PetscLogClass) int PetscLogClassDeactivate"PetscLogEventDeactivateClass"(PetscLogClass) ctypedef int PetscLogEvent int PetscLogEventRegister(char[],PetscLogClass,PetscLogEvent*) int PetscLogEventBegin(PetscLogEvent,PetscObject,PetscObject,PetscObject,PetscObject) int PetscLogEventEnd(PetscLogEvent,PetscObject,PetscObject,PetscObject,PetscObject) int PetscLogEventActivate(PetscLogEvent) int PetscLogEventDeactivate(PetscLogEvent) int PetscLogEventSetActiveAll(PetscLogEvent,PetscBool) int PetscLogEventGetPerfInfo(PetscLogStage,PetscLogEvent,PetscEventPerfInfo*) cdef extern from "custom.h" nogil: int PetscLogStageFindId(char[],PetscLogStage*) int PetscLogClassFindId(char[],PetscLogClass*) int PetscLogEventFindId(char[],PetscLogEvent*) int PetscLogStageFindName(PetscLogStage,char*[]) int PetscLogClassFindName(PetscLogClass,char*[]) int PetscLogEventFindName(PetscLogEvent,char*[]) cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: o[0] = o[1] = o[2] = o[3] = NULL cdef Py_ssize_t i=0, n = len(args) cdef Object tmp = None if n > 4: n = 4 for 0 <= i < n: tmp = args[i] if tmp is not None: o[i] = tmp.obj[0] return 0 petsc4py-3.15.1/src/PETSc/TS.pyx0000644000175000017500000010216614030740317016360 0ustar balaybalay00000000000000# ----------------------------------------------------------------------------- class TSType(object): # native EULER = S_(TSEULER) BEULER = S_(TSBEULER) BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) PSEUDO = S_(TSPSEUDO) CN = S_(TSCN) SUNDIALS = S_(TSSUNDIALS) RK = S_(TSRK) PYTHON = S_(TSPYTHON) THETA = S_(TSTHETA) ALPHA = S_(TSALPHA) ALPHA2 = S_(TSALPHA2) GLLE = S_(TSGLLE) GLEE = S_(TSGLEE) SSP = S_(TSSSP) ARKIMEX = S_(TSARKIMEX) ROSW = S_(TSROSW) EIMEX = S_(TSEIMEX) MIMEX = S_(TSMIMEX) BDF = S_(TSBDF) RADAU5 = S_(TSRADAU5) MPRK = S_(TSMPRK) DISCGRAD = S_(TSDISCGRAD) # aliases FE = EULER BE = BEULER TH = THETA CRANK_NICOLSON = CN RUNGE_KUTTA = RK class TSRKType(object): RK1FE = S_(TSRK1FE) RK2A = S_(TSRK2A) RK4 = S_(TSRK4) RK3BS = S_(TSRK3BS) RK3 = S_(TSRK3) RK5F = S_(TSRK5F) RK5DP = S_(TSRK5DP) RK5BS = S_(TSRK5BS) RK6VR = S_(TSRK6VR) RK7VR = S_(TSRK7VR) RK8VR = S_(TSRK8VR) class TSARKIMEXType(object): ARKIMEX1BEE = S_(TSARKIMEX1BEE) ARKIMEXA2 = S_(TSARKIMEXA2) ARKIMEXL2 = S_(TSARKIMEXL2) ARKIMEXARS122 = S_(TSARKIMEXARS122) ARKIMEX2C = S_(TSARKIMEX2C) ARKIMEX2D = S_(TSARKIMEX2D) ARKIMEX2E = S_(TSARKIMEX2E) ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) ARKIMEX3 = S_(TSARKIMEX3) ARKIMEXBPR3 = S_(TSARKIMEXBPR3) ARKIMEXARS443 = S_(TSARKIMEXARS443) ARKIMEX4 = S_(TSARKIMEX4) ARKIMEX5 = S_(TSARKIMEX5) class TSProblemType(object): LINEAR = TS_LINEAR NONLINEAR = TS_NONLINEAR class TSEquationType(object): UNSPECIFIED = TS_EQ_UNSPECIFIED EXPLICIT = TS_EQ_EXPLICIT ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI IMPLICIT = TS_EQ_IMPLICIT ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI class TSExactFinalTime(object): UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED STEPOVER = TS_EXACTFINALTIME_STEPOVER INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP class TSConvergedReason(object): # iterating CONVERGED_ITERATING = TS_CONVERGED_ITERATING ITERATING = TS_CONVERGED_ITERATING # converged CONVERGED_TIME = TS_CONVERGED_TIME CONVERGED_ITS = TS_CONVERGED_ITS CONVERGED_USER = TS_CONVERGED_USER CONVERGED_EVENT = TS_CONVERGED_EVENT # diverged DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE DIVERGED_STEP_REJECTED = TS_DIVERGED_STEP_REJECTED # ----------------------------------------------------------------------------- cdef class TS(Object): Type = TSType RKType = TSRKType ARKIMEXType = TSARKIMEXType ProblemType = TSProblemType EquationType = TSEquationType ExactFinalTime = TSExactFinalTime ExactFinalTimeOption = TSExactFinalTime ConvergedReason = TSConvergedReason # --- xxx --- def __cinit__(self): self.obj = &self.ts self.ts = NULL # --- xxx --- def view(self, Viewer viewer=None): cdef PetscViewer cviewer = NULL if viewer is not None: cviewer = viewer.vwr CHKERR( TSView(self.ts, cviewer) ) def load(self, Viewer viewer): CHKERR( TSLoad(self.ts, viewer.vwr) ) def destroy(self): CHKERR( TSDestroy(&self.ts) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscTS newts = NULL CHKERR( TSCreate(ccomm, &newts) ) PetscCLEAR(self.obj); self.ts = newts return self def clone(self): cdef TS ts = TS() CHKERR( TSClone(self.ts, &ts.ts) ) return ts def setType(self, ts_type): cdef PetscTSType cval = NULL ts_type = str2bytes(ts_type, &cval) CHKERR( TSSetType(self.ts, cval) ) def setRKType(self, ts_type): cdef PetscTSRKType cval = NULL ts_type = str2bytes(ts_type, &cval) CHKERR( TSRKSetType(self.ts, cval) ) def setARKIMEXType(self, ts_type): cdef PetscTSARKIMEXType cval = NULL ts_type = str2bytes(ts_type, &cval) CHKERR( TSARKIMEXSetType(self.ts, cval) ) def getType(self): cdef PetscTSType cval = NULL CHKERR( TSGetType(self.ts, &cval) ) return bytes2str(cval) def getRKType(self): cdef PetscTSRKType cval = NULL CHKERR( TSRKGetType(self.ts, &cval) ) return bytes2str(cval) def getARKIMEXType(self): cdef PetscTSARKIMEXType cval = NULL CHKERR( TSARKIMEXGetType(self.ts, &cval) ) return bytes2str(cval) def setProblemType(self, ptype): CHKERR( TSSetProblemType(self.ts, ptype) ) def getProblemType(self): cdef PetscTSProblemType ptype = TS_NONLINEAR CHKERR( TSGetProblemType(self.ts, &ptype) ) return ptype def setEquationType(self, eqtype): CHKERR( TSSetEquationType(self.ts, eqtype) ) def getEquationType(self): cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED CHKERR( TSGetEquationType(self.ts, &eqtype) ) return eqtype def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( TSSetOptionsPrefix(self.ts, cval) ) def getOptionsPrefix(self): cdef const char *cval = NULL CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( TSSetFromOptions(self.ts) ) # --- application context --- def setAppCtx(self, appctx): self.set_attr('__appctx__', appctx) def getAppCtx(self): return self.get_attr('__appctx__') # --- user RHS Function/Jacobian routines --- def setRHSFunction(self, function, Vec f=None, args=None, kargs=None): cdef PetscVec fvec=NULL if f is not None: fvec = f.vec if function is not None: if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr('__rhsfunction__', context) CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) else: CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) def setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat cdef PetscMat Pmat=Jmat if P is not None: Pmat = P.mat if jacobian is not None: if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr('__rhsjacobian__', context) CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) else: CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) def computeRHSFunction(self, t, Vec x, Vec f): cdef PetscReal time = asReal(t) CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) def computeRHSFunctionLinear(self, t, Vec x, Vec f): cdef PetscReal time = asReal(t) CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) def computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None): cdef PetscReal time = asReal(t) cdef PetscMat jmat = J.mat, pmat = J.mat if P is not None: pmat = P.mat CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) def computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None): cdef PetscReal time = asReal(t) cdef PetscMat jmat = J.mat, pmat = J.mat if P is not None: pmat = P.mat CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) def getRHSFunction(self): cdef Vec f = Vec() CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) PetscINCREF(f.obj) cdef object function = self.get_attr('__rhsfunction__') return (f, function) def getRHSJacobian(self): cdef Mat J = Mat(), P = Mat() CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) PetscINCREF(J.obj); PetscINCREF(P.obj) cdef object jacobian = self.get_attr('__rhsjacobian__') return (J, P, jacobian) # --- user Implicit Function/Jacobian routines --- def setIFunction(self, function, Vec f=None, args=None, kargs=None): cdef PetscVec fvec=NULL if f is not None: fvec = f.vec if function is not None: if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr('__ifunction__', context) CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) else: CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) def setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat cdef PetscMat Pmat=Jmat if P is not None: Pmat = P.mat if jacobian is not None: if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr('__ijacobian__', context) CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) else: CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) def setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None): cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat if jacobian is not None: if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr('__ijacobianp__', context) CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) else: CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) def computeIFunction(self, t, Vec x, Vec xdot, Vec f, imex=False): cdef PetscReal rval = asReal(t) cdef PetscBool bval = imex CHKERR( TSComputeIFunction(self.ts, rval, x.vec, xdot.vec, f.vec, bval) ) def computeIJacobian(self, t, Vec x, Vec xdot, a, Mat J, Mat P=None, imex=False): cdef PetscReal rval1 = asReal(t) cdef PetscReal rval2 = asReal(a) cdef PetscBool bval = imex cdef PetscMat jmat = J.mat, pmat = J.mat if P is not None: pmat = P.mat CHKERR( TSComputeIJacobian(self.ts, rval1, x.vec, xdot.vec, rval2, jmat, pmat, bval) ) def computeIJacobianP(self, t, Vec x, Vec xdot, a, Mat J, imex=False): cdef PetscReal rval1 = asReal(t) cdef PetscReal rval2 = asReal(a) cdef PetscBool bval = asBool(imex) cdef PetscMat jmat = J.mat CHKERR( TSComputeIJacobianP(self.ts, rval1, x.vec, xdot.vec, rval2, jmat, bval) ) def getIFunction(self): cdef Vec f = Vec() CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) PetscINCREF(f.obj) cdef object function = self.get_attr('__ifunction__') return (f, function) def getIJacobian(self): cdef Mat J = Mat(), P = Mat() CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) PetscINCREF(J.obj); PetscINCREF(P.obj) cdef object jacobian = self.get_attr('__ijacobian__') return (J, P, jacobian) def setI2Function(self, function, Vec f=None, args=None, kargs=None): cdef PetscVec fvec=NULL if f is not None: fvec = f.vec if function is not None: if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr('__i2function__', context) CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) else: CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) def setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat cdef PetscMat Pmat=Jmat if P is not None: Pmat = P.mat if jacobian is not None: if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr('__i2jacobian__', context) CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) else: CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) def computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f): cdef PetscReal rval = asReal(t) CHKERR( TSComputeI2Function(self.ts, rval, x.vec, xdot.vec, xdotdot.vec, f.vec) ) def computeI2Jacobian(self, t, Vec x, Vec xdot, Vec xdotdot, v, a, Mat J, Mat P=None): cdef PetscReal rval1 = asReal(t) cdef PetscReal rval2 = asReal(v) cdef PetscReal rval3 = asReal(a) cdef PetscMat jmat = J.mat, pmat = J.mat if P is not None: pmat = P.mat CHKERR( TSComputeI2Jacobian(self.ts, rval1, x.vec, xdot.vec, xdotdot.vec, rval2, rval3, jmat, pmat) ) def getI2Function(self): cdef Vec f = Vec() CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) PetscINCREF(f.obj) cdef object function = self.get_attr('__i2function__') return (f, function) def getI2Jacobian(self): cdef Mat J = Mat(), P = Mat() CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) PetscINCREF(J.obj); PetscINCREF(P.obj) cdef object jacobian = self.get_attr('__i2jacobian__') return (J, P, jacobian) # --- solution vector --- def setSolution(self, Vec u): CHKERR( TSSetSolution(self.ts, u.vec) ) def getSolution(self): cdef Vec u = Vec() CHKERR( TSGetSolution(self.ts, &u.vec) ) PetscINCREF(u.obj) return u def setSolution2(self, Vec u, Vec v): CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) def getSolution2(self): cdef Vec u = Vec() cdef Vec v = Vec() CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) PetscINCREF(u.obj) PetscINCREF(v.obj) return (u, v) # --- inner solver --- def getSNES(self): cdef SNES snes = SNES() CHKERR( TSGetSNES(self.ts, &snes.snes) ) PetscINCREF(snes.obj) return snes def getKSP(self): cdef KSP ksp = KSP() CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) PetscINCREF(ksp.obj) return ksp # --- discretization space --- def getDM(self): cdef PetscDM newdm = NULL CHKERR( TSGetDM(self.ts, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm PetscINCREF(dm.obj) return dm def setDM(self, DM dm): CHKERR( TSSetDM(self.ts, dm.dm) ) # --- customization --- def setTime(self, t): cdef PetscReal rval = asReal(t) CHKERR( TSSetTime(self.ts, rval) ) def getTime(self): cdef PetscReal rval = 0 CHKERR( TSGetTime(self.ts, &rval) ) return toReal(rval) def getPrevTime(self): cdef PetscReal rval = 0 CHKERR( TSGetPrevTime(self.ts, &rval) ) return toReal(rval) def getSolveTime(self): cdef PetscReal rval = 0 CHKERR( TSGetSolveTime(self.ts, &rval) ) return toReal(rval) def setTimeStep(self, time_step): cdef PetscReal rval = asReal(time_step) CHKERR( TSSetTimeStep(self.ts, rval) ) def getTimeStep(self): cdef PetscReal tstep = 0 CHKERR( TSGetTimeStep(self.ts, &tstep) ) return toReal(tstep) def setStepNumber(self, step_number): cdef PetscInt ival = asInt(step_number) CHKERR( TSSetStepNumber(self.ts, ival) ) def getStepNumber(self): cdef PetscInt ival = 0 CHKERR( TSGetStepNumber(self.ts, &ival) ) return toInt(ival) def setMaxTime(self, max_time): cdef PetscReal rval = asReal(max_time) CHKERR( TSSetMaxTime(self.ts, rval) ) def getMaxTime(self): cdef PetscReal rval = 0 CHKERR( TSGetMaxTime(self.ts, &rval) ) return toReal(rval) def setMaxSteps(self, max_steps): cdef PetscInt ival = asInt(max_steps) CHKERR( TSSetMaxSteps(self.ts, ival) ) def getMaxSteps(self): cdef PetscInt ival = 0 CHKERR( TSGetMaxSteps(self.ts, &ival) ) return toInt(ival) def getSNESIterations(self): cdef PetscInt n = 0 CHKERR( TSGetSNESIterations(self.ts, &n) ) return toInt(n) def getKSPIterations(self): cdef PetscInt n = 0 CHKERR( TSGetKSPIterations(self.ts, &n) ) return toInt(n) def setMaxStepRejections(self, n): cdef PetscInt rej = asInt(n) CHKERR( TSSetMaxStepRejections(self.ts, rej)) #def getMaxStepRejections(self): # cdef PetscInt n = 0 # CHKERR( TSGetMaxStepRejections(self.ts, &n)) # return toInt(n) def getStepRejections(self): cdef PetscInt n = 0 CHKERR( TSGetStepRejections(self.ts, &n) ) return toInt(n) def setMaxSNESFailures(self, n): cdef PetscInt fails = asInt(n) CHKERR( TSSetMaxSNESFailures(self.ts, fails)) #def getMaxSNESFailures(self, n): # cdef PetscInt n = 0 # CHKERR( TSGetMaxSNESFailures(self.ts, &n)) # return toInt(n) def getSNESFailures(self): cdef PetscInt n = 0 CHKERR( TSGetSNESFailures(self.ts, &n) ) return toInt(n) def setErrorIfStepFails(self, flag=True): cdef PetscBool bval = flag CHKERR( TSSetErrorIfStepFails(self.ts, bval)) def setTolerances(self, rtol=None, atol=None): cdef PetscReal rrtol = PETSC_DEFAULT cdef PetscReal ratol = PETSC_DEFAULT cdef PetscVec vrtol = NULL cdef PetscVec vatol = NULL if rtol is None: pass elif isinstance(rtol, Vec): vrtol = (rtol).vec else: rrtol = asReal(rtol) if atol is None: pass elif isinstance(atol, Vec): vatol = (atol).vec else: ratol = asReal(atol) CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) def getTolerances(self): cdef PetscReal rrtol = PETSC_DEFAULT cdef PetscReal ratol = PETSC_DEFAULT cdef PetscVec vrtol = NULL cdef PetscVec vatol = NULL CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) cdef object rtol = None if vrtol != NULL: rtol = ref_Vec(vrtol) else: rtol = toReal(rrtol) cdef object atol = None if vatol != NULL: atol = ref_Vec(vatol) else: atol = toReal(ratol) return (rtol, atol) def setExactFinalTime(self, option): cdef PetscTSExactFinalTimeOption oval = option CHKERR( TSSetExactFinalTime(self.ts, oval) ) def setConvergedReason(self, reason): cdef PetscTSConvergedReason cval = reason CHKERR( TSSetConvergedReason(self.ts, cval) ) def getConvergedReason(self): cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING CHKERR( TSGetConvergedReason(self.ts, &reason) ) return reason # --- monitoring --- def setMonitor(self, monitor, args=None, kargs=None): if monitor is None: return cdef object monitorlist = self.get_attr('__monitor__') if monitorlist is None: monitorlist = [] self.set_attr('__monitor__', monitorlist) CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) if args is None: args = () if kargs is None: kargs = {} context = (monitor, args, kargs) monitorlist.append(context) def getMonitor(self): return self.get_attr('__monitor__') def cancelMonitor(self): self.set_attr('__monitor__', None) CHKERR( TSMonitorCancel(self.ts) ) def monitor(self, step, time, Vec u=None): cdef PetscInt ival = asInt(step) cdef PetscReal rval = asReal(time) cdef PetscVec uvec = NULL if u is not None: uvec = u.vec if uvec == NULL: CHKERR( TSGetSolution(self.ts, &uvec) ) CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) # --- event handling --- def setEventHandler(self, direction, terminate, eventhandler, postevent=None, args=None, kargs=None): cdef PetscInt ndirs = 0 cdef PetscInt *idirs = NULL direction = iarray_i(direction, &ndirs, &idirs) cdef PetscInt nterm = 0 cdef PetscBool *iterm = NULL terminate = iarray_b(terminate, &nterm, &iterm) assert nterm == ndirs cdef PetscInt nevents = ndirs if eventhandler is not None: if args is None: args = () if kargs is None: kargs = {} self.set_attr('__eventhandler__', (eventhandler, args, kargs)) if postevent is not None: self.set_attr('__postevent__', (postevent, args, kargs)) CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) else: self.set_attr('__postevent__', None) CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, NULL, NULL) ) else: CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) def setEventTolerances(self, tol=None, vtol=None): cdef PetscInt nevents = 0 cdef PetscReal tolr = PETSC_DEFAULT cdef PetscInt ntolr = 0 cdef PetscReal *vtolr = NULL if tol is not None: tolr = asReal(tol) if vtol is not None: CHKERR( TSGetNumEvents(self.ts, &nevents) ) vtol = iarray_r(vtol, &ntolr, &vtolr) assert ntolr == nevents CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) def getNumEvents(self): cdef PetscInt nevents = 0 CHKERR( TSGetNumEvents(self.ts, &nevents) ) return toInt(nevents) # --- solving --- def setPreStep(self, prestep, args=None, kargs=None): if prestep is not None: if args is None: args = () if kargs is None: kargs = {} context = (prestep, args, kargs) self.set_attr('__prestep__', context) CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) else: self.set_attr('__prestep__', None) CHKERR( TSSetPreStep(self.ts, NULL) ) def getPreStep(self): return self.get_attr('__prestep__') def setPostStep(self, poststep, args=None, kargs=None): if poststep is not None: if args is None: args = () if kargs is None: kargs = {} context = (poststep, args, kargs) self.set_attr('__poststep__', context) CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) else: self.set_attr('__poststep__', None) CHKERR( TSSetPostStep(self.ts, NULL) ) def getPostStep(self): return self.get_attr('__poststep__') def setUp(self): CHKERR( TSSetUp(self.ts) ) def reset(self): CHKERR( TSReset(self.ts) ) def step(self): CHKERR( TSStep(self.ts) ) def restartStep(self): CHKERR( TSRestartStep(self.ts) ) def rollBack(self): CHKERR( TSRollBack(self.ts) ) def solve(self, Vec u): CHKERR( TSSolve(self.ts, u.vec) ) def interpolate(self, t, Vec u): cdef PetscReal rval = asReal(t) CHKERR( TSInterpolate(self.ts, rval, u.vec) ) # --- Adjoint methods --- def setSaveTrajectory(self): CHKERR(TSSetSaveTrajectory(self.ts)) def getCostIntegral(self): cdef Vec cost = Vec() CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) PetscINCREF(cost.obj) return cost def setCostGradients(self, vl, vm=None): cdef PetscInt n = 0; cdef PetscVec *vecl = NULL cdef PetscVec *vecm = NULL cdef mem1 = None, mem2 = None if isinstance(vl, Vec): vl = [vl] if isinstance(vm, Vec): vm = [vm] if vl is not None: n = len(vl) elif vm is not None: n = len(vm) if vl is not None: assert len(vl) == n mem1 = oarray_p(empty_p(n), NULL, &vecl) for i from 0 <= i < n: vecl[i] = (vl[i]).vec if vm is not None: assert len(vm) == n mem2 = oarray_p(empty_p(n), NULL, &vecm) for i from 0 <= i < n: vecm[i] = (vm[i]).vec self.set_attr('__costgradients_memory', (mem1, mem2)) CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) def getCostGradients(self): cdef PetscInt i = 0, n = 0 cdef PetscVec *vecl = NULL cdef PetscVec *vecm = NULL CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) cdef object vl = None, vm = None if vecl != NULL: vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] if vecm != NULL: vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] return (vl, vm) def setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None): cdef PetscMat Amat=NULL if A is not None: Amat = A.mat if jacobianp is not None: if args is None: args = () if kargs is None: kargs = {} context = (jacobianp, args, kargs) self.set_attr('__rhsjacobianp__', context) CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) else: CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) def createQuadratureTS(self, forward=True): cdef TS qts = TS() cdef PetscBool fwd = forward CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) PetscINCREF(qts.obj) return qts def getQuadratureTS(self): cdef TS qts = TS() cdef PetscBool fwd = PETSC_FALSE CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) PetscINCREF(qts.obj) return (toBool(fwd), qts) def setRHSJacobianP(self, rhsjacobianp, Mat A=None, args=None, kargs=None): cdef PetscMat Amat=NULL if A is not None: Amat = A.mat if rhsjacobianp is not None: if args is None: args = () if kargs is None: kargs = {} context = (rhsjacobianp, args, kargs) self.set_attr('__rhsjacobianp__', context) CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) else: CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) def computeRHSJacobianP(self, t, Vec x, Mat J): cdef PetscReal rval = asReal(t) CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) def adjointSetSteps(self, adjoint_steps): cdef PetscInt ival = asInt(adjoint_steps) CHKERR( TSAdjointSetSteps(self.ts, ival) ) def adjointSetUp(self): CHKERR(TSAdjointSetUp(self.ts)) def adjointSolve(self): CHKERR( TSAdjointSolve(self.ts) ) def adjointStep(self): CHKERR(TSAdjointStep(self.ts)) # --- Python --- def createPython(self, context=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscTS newts = NULL CHKERR( TSCreate(ccomm, &newts) ) PetscCLEAR(self.obj); self.ts = newts CHKERR( TSSetType(self.ts, TSPYTHON) ) CHKERR( TSPythonSetContext(self.ts, context) ) return self def setPythonContext(self, context): CHKERR( TSPythonSetContext(self.ts, context) ) def getPythonContext(self): cdef void *context = NULL CHKERR( TSPythonGetContext(self.ts, &context) ) if context == NULL: return None else: return context def setPythonType(self, py_type): cdef const char *cval = NULL py_type = str2bytes(py_type, &cval) CHKERR( TSPythonSetType(self.ts, cval) ) # --- Theta --- def setTheta(self, theta): cdef PetscReal rval = asReal(theta) CHKERR( TSThetaSetTheta(self.ts, rval) ) def getTheta(self): cdef PetscReal rval = 0 CHKERR( TSThetaGetTheta(self.ts, &rval) ) return toReal(rval) def setThetaEndpoint(self, flag=True): cdef PetscBool bval = flag CHKERR( TSThetaSetEndpoint(self.ts, bval) ) def getThetaEndpoint(self): cdef PetscBool flag = PETSC_FALSE CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) return toBool(flag) # --- Alpha --- def setAlphaRadius(self, radius): cdef PetscReal rval = asReal(radius) CHKERR( TSAlphaSetRadius(self.ts, rval) ) def setAlphaParams(self, alpha_m=None,alpha_f=None, gamma=None): cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) except PetscError: pass if alpha_m is not None: rval1 = asReal(alpha_m) if alpha_f is not None: rval2 = asReal(alpha_f) if gamma is not None: rval3 = asReal(gamma) CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) def getAlphaParams(self): cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) return (toReal(rval1), toReal(rval2), toReal(rval3)) # --- application context --- property appctx: def __get__(self): return self.getAppCtx() def __set__(self, value): self.setAppCtx(value) # --- discretization space --- property dm: def __get__(self): return self.getDM() def __set__(self, value): self.setDM(value) # --- xxx --- property problem_type: def __get__(self): return self.getProblemType() def __set__(self, value): self.setProblemType(value) property equation_type: def __get__(self): return self.getEquationType() def __set__(self, value): self.setEquationType(value) property snes: def __get__(self): return self.getSNES() property ksp: def __get__(self): return self.getKSP() property vec_sol: def __get__(self): return self.getSolution() # --- xxx --- property time: def __get__(self): return self.getTime() def __set__(self, value): self.setTime(value) property time_step: def __get__(self): return self.getTimeStep() def __set__(self, value): self.setTimeStep(value) property step_number: def __get__(self): return self.getStepNumber() def __set__(self, value): self.setStepNumber(value) property max_time: def __get__(self): return self.getMaxTime() def __set__(self, value): self.setMaxTime(value) property max_steps: def __get__(self): return self.getMaxSteps() def __set__(self, value): self.setMaxSteps(value) # --- convergence --- property rtol: def __get__(self): return self.getTolerances()[0] def __set__(self, value): self.setTolerances(rtol=value) property atol: def __get__(self): return self.getTolerances()[1] def __set__(self, value): self.setTolerances(atol=value) property reason: def __get__(self): return self.getConvergedReason() def __set__(self, value): self.setConvergedReason(value) property iterating: def __get__(self): return self.reason == 0 property converged: def __get__(self): return self.reason > 0 property diverged: def __get__(self): return self.reason < 0 # ----------------------------------------------------------------------------- del TSType del TSRKType del TSARKIMEXType del TSProblemType del TSEquationType del TSExactFinalTime del TSConvergedReason # ----------------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscsct.pxi0000644000175000017500000000167114030740317017641 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef PetscSFType PetscScatterType "VecScatterType" int VecScatterView(PetscScatter,PetscViewer) int VecScatterDestroy(PetscScatter*) int VecScatterSetUp(PetscScatter) int VecScatterCreate(PetscVec,PetscIS,PetscVec,PetscIS,PetscScatter*) int VecScatterSetFromOptions(PetscScatter) int VecScatterSetType(PetscScatter,PetscScatterType) int VecScatterGetType(PetscScatter,PetscScatterType*) int VecScatterCopy(PetscScatter, PetscScatter*) int VecScatterCreateToAll(PetscVec,PetscScatter*,PetscVec*) int VecScatterCreateToZero(PetscVec,PetscScatter*,PetscVec*) int VecScatterBegin(PetscScatter,PetscVec,PetscVec,PetscInsertMode,PetscScatterMode) int VecScatterEnd(PetscScatter,PetscVec,PetscVec,PetscInsertMode,PetscScatterMode) # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscksp.pxi0000644000175000017500000002310713750315427017653 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscKSPType "KSPType" PetscKSPType KSPRICHARDSON PetscKSPType KSPCHEBYSHEV PetscKSPType KSPCG PetscKSPType KSPGROPPCG PetscKSPType KSPPIPECG PetscKSPType KSPPIPECGRR PetscKSPType KSPPIPELCG PetscKSPType KSPPIPEPRCG PetscKSPType KSPPIPECG2 PetscKSPType KSPCGNE PetscKSPType KSPNASH PetscKSPType KSPSTCG PetscKSPType KSPGLTR PetscKSPType KSPFCG PetscKSPType KSPPIPEFCG PetscKSPType KSPGMRES PetscKSPType KSPPIPEFGMRES PetscKSPType KSPFGMRES PetscKSPType KSPLGMRES PetscKSPType KSPDGMRES PetscKSPType KSPPGMRES PetscKSPType KSPTCQMR PetscKSPType KSPBCGS PetscKSPType KSPIBCGS PetscKSPType KSPFBCGS PetscKSPType KSPFBCGSR PetscKSPType KSPBCGSL PetscKSPType KSPPIPEBCGS PetscKSPType KSPCGS PetscKSPType KSPTFQMR PetscKSPType KSPCR PetscKSPType KSPPIPECR PetscKSPType KSPLSQR PetscKSPType KSPPREONLY PetscKSPType KSPQCG PetscKSPType KSPBICG PetscKSPType KSPMINRES PetscKSPType KSPSYMMLQ PetscKSPType KSPLCD #PetscKSPType KSPPYTHON PetscKSPType KSPGCR PetscKSPType KSPPIPEGCR PetscKSPType KSPTSIRM PetscKSPType KSPCGLS PetscKSPType KSPFETIDP PetscKSPType KSPHPDDM ctypedef enum PetscKSPNormType "KSPNormType": KSP_NORM_DEFAULT KSP_NORM_NONE KSP_NORM_PRECONDITIONED KSP_NORM_UNPRECONDITIONED KSP_NORM_NATURAL ctypedef enum PetscKSPConvergedReason "KSPConvergedReason": # iterating KSP_CONVERGED_ITERATING # converged KSP_CONVERGED_RTOL_NORMAL KSP_CONVERGED_ATOL_NORMAL KSP_CONVERGED_RTOL KSP_CONVERGED_ATOL KSP_CONVERGED_ITS KSP_CONVERGED_CG_NEG_CURVE KSP_CONVERGED_CG_CONSTRAINED KSP_CONVERGED_STEP_LENGTH KSP_CONVERGED_HAPPY_BREAKDOWN # diverged KSP_DIVERGED_NULL KSP_DIVERGED_MAX_IT "KSP_DIVERGED_ITS" KSP_DIVERGED_DTOL KSP_DIVERGED_BREAKDOWN KSP_DIVERGED_BREAKDOWN_BICG KSP_DIVERGED_NONSYMMETRIC KSP_DIVERGED_INDEFINITE_PC KSP_DIVERGED_NANORINF KSP_DIVERGED_INDEFINITE_MAT KSP_DIVERGED_PC_FAILED ctypedef int (*PetscKSPCtxDel)(void*) ctypedef int (*PetscKSPConvergedFunction)(PetscKSP, PetscInt, PetscReal, PetscKSPConvergedReason*, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscKSPMonitorFunction)(PetscKSP, PetscInt, PetscReal, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscKSPComputeRHSFunction)(PetscKSP, PetscVec, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscKSPComputeOpsFunction)(PetscKSP, PetscMat, PetscMat, void*) except PETSC_ERR_PYTHON int KSPCreate(MPI_Comm,PetscKSP* CREATE) int KSPDestroy(PetscKSP*) int KSPView(PetscKSP,PetscViewer OPTIONAL) int KSPSetType(PetscKSP,PetscKSPType) int KSPGetType(PetscKSP,PetscKSPType*) int KSPSetOptionsPrefix(PetscKSP,char[]) int KSPAppendOptionsPrefix(PetscKSP,char[]) int KSPGetOptionsPrefix(PetscKSP,char*[]) int KSPSetFromOptions(PetscKSP) int KSPSetTolerances(PetscKSP,PetscReal,PetscReal,PetscReal,PetscInt) int KSPGetTolerances(PetscKSP,PetscReal*,PetscReal*,PetscReal*,PetscInt*) int KSPSetNormType(PetscKSP,PetscKSPNormType) int KSPGetNormType(PetscKSP,PetscKSPNormType*) int KSPSetPCSide(PetscKSP,PetscPCSide) int KSPGetPCSide(PetscKSP,PetscPCSide*) int KSPSetConvergenceTest(PetscKSP,PetscKSPConvergedFunction,void*,PetscKSPCtxDel) int KSPSetResidualHistory(PetscKSP,PetscReal[],PetscInt,PetscBool) int KSPGetResidualHistory(PetscKSP,PetscReal*[],PetscInt*) int KSPLogResidualHistory(PetscKSP,PetscReal) int KSPConvergedDefaultCreate(void**) int KSPConvergedDefaultDestroy(void*) int KSPConvergedDefault(PetscKSP,PetscInt,PetscReal,PetscKSPConvergedReason*,void*) except PETSC_ERR_PYTHON int KSPConvergedSkip(PetscKSP,PetscInt,PetscReal,PetscKSPConvergedReason*,void*) except PETSC_ERR_PYTHON int KSPMonitorSet(PetscKSP,PetscKSPMonitorFunction,void*,PetscKSPCtxDel) int KSPMonitorCancel(PetscKSP) int KSPMonitor(PetscKSP,PetscInt,PetscReal) int KSPSetInitialGuessNonzero(PetscKSP,PetscBool) int KSPGetInitialGuessNonzero(PetscKSP,PetscBool*) int KSPSetInitialGuessKnoll(PetscKSP,PetscBool) int KSPGetInitialGuessKnoll(PetscKSP,PetscBool*) int KSPSetUseFischerGuess(PetscKSP,PetscInt,PetscInt) int KSPGetComputeEigenvalues(PetscKSP,PetscBool*) int KSPSetComputeEigenvalues(PetscKSP,PetscBool) int KSPGetComputeSingularValues(PetscKSP,PetscBool*) int KSPSetComputeSingularValues(PetscKSP,PetscBool) int KSPSetComputeRHS(PetscKSP,PetscKSPComputeRHSFunction,void*) int KSPSetComputeOperators(PetscKSP,PetscKSPComputeOpsFunction,void*) int KSPSetOperators(PetscKSP,PetscMat,PetscMat) int KSPGetOperators(PetscKSP,PetscMat*,PetscMat*) int KSPGetOperatorsSet(PetscKSP,PetscBool*,PetscBool*) int KSPSetPC(PetscKSP,PetscPC) int KSPGetPC(PetscKSP,PetscPC*) int KSPGetDM(PetscKSP,PetscDM*) int KSPSetDM(PetscKSP,PetscDM) int KSPSetDMActive(PetscKSP,PetscBool) int KSPSetUp(PetscKSP) int KSPReset(PetscKSP) int KSPSetUpOnBlocks(PetscKSP) int KSPSolve(PetscKSP,PetscVec,PetscVec) int KSPSolveTranspose(PetscKSP,PetscVec,PetscVec) int KSPGetRhs(PetscKSP,PetscVec*) int KSPGetSolution(PetscKSP,PetscVec*) int KSPGetConvergedReason(PetscKSP,PetscKSPConvergedReason*) int KSPGetIterationNumber(PetscKSP,PetscInt*) int KSPGetResidualNorm(PetscKSP,PetscReal*) int KSPBuildSolution(PetscKSP,PetscVec,PetscVec*) int KSPBuildResidual(PetscKSP,PetscVec,PetscVec,PetscVec*) int KSPSetDiagonalScale(PetscKSP,PetscBool) int KSPGetDiagonalScale(PetscKSP,PetscBool*) int KSPSetDiagonalScaleFix(PetscKSP,PetscBool) int KSPGetDiagonalScaleFix(PetscKSP,PetscBool*) int KSPComputeExplicitOperator(PetscKSP,PetscMat*) int KSPComputeEigenvalues(PetscKSP,PetscInt,PetscReal[],PetscReal[],PetscInt*) int KSPComputeExtremeSingularValues(PetscKSP,PetscReal*,PetscReal*) int KSPCreateVecs(PetscKSP,PetscInt,PetscVec**,PetscInt,PetscVec**) int KSPGMRESSetRestart(PetscKSP,PetscInt) cdef extern from "custom.h" nogil: int KSPSetIterationNumber(PetscKSP,PetscInt) int KSPSetResidualNorm(PetscKSP,PetscReal) int KSPConvergenceTestCall(PetscKSP,PetscInt,PetscReal,PetscKSPConvergedReason*) int KSPSetConvergedReason(PetscKSP,PetscKSPConvergedReason) cdef extern from "libpetsc4py.h": PetscKSPType KSPPYTHON int KSPPythonSetContext(PetscKSP,void*) int KSPPythonGetContext(PetscKSP,void**) int KSPPythonSetType(PetscKSP,char[]) # ----------------------------------------------------------------------------- cdef inline KSP ref_KSP(PetscKSP ksp): cdef KSP ob = KSP() ob.ksp = ksp PetscINCREF(ob.obj) return ob # ----------------------------------------------------------------------------- cdef int KSP_Converged( PetscKSP ksp, PetscInt its, PetscReal rnm, PetscKSPConvergedReason *r, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef KSP Ksp = ref_KSP(ksp) (converged, args, kargs) = Ksp.get_attr('__converged__') reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) if reason is None: r[0] = KSP_CONVERGED_ITERATING elif reason is False: r[0] = KSP_CONVERGED_ITERATING elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? else: r[0] = reason return 0 # ----------------------------------------------------------------------------- cdef int KSP_Monitor( PetscKSP ksp, PetscInt its, PetscReal rnm, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef KSP Ksp = ref_KSP(ksp) cdef object monitorlist = Ksp.get_attr('__monitor__') if monitorlist is None: return 0 for (monitor, args, kargs) in monitorlist: monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int KSP_ComputeRHS( PetscKSP ksp, PetscVec rhs, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef KSP Ksp = ref_KSP(ksp) cdef Vec Rhs = ref_Vec(rhs) cdef object context = Ksp.get_attr('__rhs__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (computerhs, args, kargs) = context computerhs(Ksp, Rhs, *args, **kargs) return 0 cdef int KSP_ComputeOps( PetscKSP ksp, PetscMat A, PetscMat B, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef KSP Ksp = ref_KSP(ksp) cdef Mat Amat = ref_Mat(A) cdef Mat Bmat = ref_Mat(B) cdef object context = Ksp.get_attr('__operators__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (computeops, args, kargs) = context computeops(Ksp, Amat, Bmat, *args, **kargs) return 0 # ----------------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/PC.pyx0000644000175000017500000007051314030740317016334 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class PCType(object): NONE = S_(PCNONE) JACOBI = S_(PCJACOBI) SOR = S_(PCSOR) LU = S_(PCLU) SHELL = S_(PCSHELL) BJACOBI = S_(PCBJACOBI) VPBJACOBI = S_(PCVPBJACOBI) MG = S_(PCMG) EISENSTAT = S_(PCEISENSTAT) ILU = S_(PCILU) ICC = S_(PCICC) ASM = S_(PCASM) GASM = S_(PCGASM) KSP = S_(PCKSP) COMPOSITE = S_(PCCOMPOSITE) REDUNDANT = S_(PCREDUNDANT) SPAI = S_(PCSPAI) NN = S_(PCNN) CHOLESKY = S_(PCCHOLESKY) PBJACOBI = S_(PCPBJACOBI) MAT = S_(PCMAT) HYPRE = S_(PCHYPRE) PARMS = S_(PCPARMS) FIELDSPLIT = S_(PCFIELDSPLIT) TFS = S_(PCTFS) ML = S_(PCML) GALERKIN = S_(PCGALERKIN) EXOTIC = S_(PCEXOTIC) CP = S_(PCCP) BFBT = S_(PCBFBT) LSC = S_(PCLSC) PYTHON = S_(PCPYTHON) PFMG = S_(PCPFMG) SYSPFMG = S_(PCSYSPFMG) REDISTRIBUTE = S_(PCREDISTRIBUTE) SVD = S_(PCSVD) GAMG = S_(PCGAMG) CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) SAVIENNACL = S_(PCSAVIENNACL) BDDC = S_(PCBDDC) KACZMARZ = S_(PCKACZMARZ) TELESCOPE = S_(PCTELESCOPE) PATCH = S_(PCPATCH) LMVM = S_(PCLMVM) HMG = S_(PCHMG) DEFLATION = S_(PCDEFLATION) HPDDM = S_(PCHPDDM) HARA = S_(PCHARA) class PCSide(object): # native LEFT = PC_LEFT RIGHT = PC_RIGHT SYMMETRIC = PC_SYMMETRIC # aliases L = LEFT R = RIGHT S = SYMMETRIC class PCASMType(object): NONE = PC_ASM_NONE BASIC = PC_ASM_BASIC RESTRICT = PC_ASM_RESTRICT INTERPOLATE = PC_ASM_INTERPOLATE class PCGASMType(object): NONE = PC_GASM_NONE BASIC = PC_GASM_BASIC RESTRICT = PC_GASM_RESTRICT INTERPOLATE = PC_GASM_INTERPOLATE class PCMGType(object): MULTIPLICATIVE = PC_MG_MULTIPLICATIVE ADDITIVE = PC_MG_ADDITIVE FULL = PC_MG_FULL KASKADE = PC_MG_KASKADE class PCMGCycleType(object): V = PC_MG_CYCLE_V W = PC_MG_CYCLE_W class PCGAMGType(object): AGG = S_(PCGAMGAGG) GEO = S_(PCGAMGGEO) CLASSICAL = S_(PCGAMGCLASSICAL) class PCCompositeType(object): ADDITIVE = PC_COMPOSITE_ADDITIVE MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE SPECIAL = PC_COMPOSITE_SPECIAL SCHUR = PC_COMPOSITE_SCHUR class PCFieldSplitSchurPreType(object): SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 USER = PC_FIELDSPLIT_SCHUR_PRE_USER FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL class PCFieldSplitSchurFactType(object): DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL class PCPatchConstructType(object): STAR = PC_PATCH_STAR VANKA = PC_PATCH_VANKA PARDECOMP = PC_PATCH_PARDECOMP USER = PC_PATCH_USER PYTHON = PC_PATCH_PYTHON # -------------------------------------------------------------------- cdef class PC(Object): Type = PCType Side = PCSide ASMType = PCASMType GASMType = PCGASMType MGType = PCMGType MGCycleType = PCMGCycleType GAMGType = PCGAMGType CompositeType = PCCompositeType SchurFactType = PCFieldSplitSchurFactType SchurPreType = PCFieldSplitSchurPreType PatchConstructType = PCPatchConstructType # --- xxx --- def __cinit__(self): self.obj = &self.pc self.pc = NULL def __call__(self, x, y=None): if y is None: # XXX do this better y = self.getOperators()[0].createVecLeft() self.apply(x, y) return y # --- xxx --- def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PCView(self.pc, vwr) ) def destroy(self): CHKERR( PCDestroy(&self.pc) ) self.pc = NULL return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscPC newpc = NULL CHKERR( PCCreate(ccomm, &newpc) ) PetscCLEAR(self.obj); self.pc = newpc return self def setType(self, pc_type): cdef PetscPCType cval = NULL pc_type = str2bytes(pc_type, &cval) CHKERR( PCSetType(self.pc, cval) ) def getType(self): cdef PetscPCType cval = NULL CHKERR( PCGetType(self.pc, &cval) ) return bytes2str(cval) def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( PCSetOptionsPrefix(self.pc, cval) ) def getOptionsPrefix(self): cdef const char *cval = NULL CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( PCSetFromOptions(self.pc) ) def setOperators(self, Mat A=None, Mat P=None): cdef PetscMat amat=NULL if A is not None: amat = A.mat cdef PetscMat pmat=amat if P is not None: pmat = P.mat CHKERR( PCSetOperators(self.pc, amat, pmat) ) def getOperators(self): cdef Mat A = Mat(), P = Mat() CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) PetscINCREF(A.obj) PetscINCREF(P.obj) return (A, P) def setUseAmat(self, flag): cdef PetscBool cflag = PETSC_FALSE if flag: cflag = PETSC_TRUE CHKERR( PCSetUseAmat(self.pc, cflag) ) def setReusePreconditioner(self, flag): cdef PetscBool cflag = PETSC_FALSE if flag: cflag = PETSC_TRUE CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) def setUp(self): CHKERR( PCSetUp(self.pc) ) def reset(self): CHKERR( PCReset(self.pc) ) def setUpOnBlocks(self): CHKERR( PCSetUpOnBlocks(self.pc) ) def apply(self, Vec x, Vec y): CHKERR( PCApply(self.pc, x.vec, y.vec) ) def applyTranspose(self, Vec x, Vec y): CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) def applySymmetricLeft(self, Vec x, Vec y): CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) def applySymmetricRight(self, Vec x, Vec y): CHKERR( PCApplySymmetricRight(self.pc, x.vec, y.vec) ) # --- discretization space --- def getDM(self): cdef PetscDM newdm = NULL CHKERR( PCGetDM(self.pc, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm PetscINCREF(dm.obj) return dm def setDM(self, DM dm): CHKERR( PCSetDM(self.pc, dm.dm) ) def setCoordinates(self, coordinates): cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) if PyArray_NDIM(xyz) != 2: raise ValueError( ("coordinates must have two dimensions: " "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) cdef PetscInt nvtx = PyArray_DIM(xyz, 0) cdef PetscInt ndim = PyArray_DIM(xyz, 1) cdef PetscReal *coords = PyArray_DATA(xyz) CHKERR( PCSetCoordinates(self.pc, ndim, nvtx, coords) ) # --- Python --- def createPython(self, context=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscPC newpc = NULL CHKERR( PCCreate(ccomm, &newpc) ) PetscCLEAR(self.obj); self.pc = newpc CHKERR( PCSetType(self.pc, PCPYTHON) ) CHKERR( PCPythonSetContext(self.pc, context) ) return self def setPythonContext(self, context): CHKERR( PCPythonSetContext(self.pc, context) ) def getPythonContext(self): cdef void *context = NULL CHKERR( PCPythonGetContext(self.pc, &context) ) if context == NULL: return None else: return context def setPythonType(self, py_type): cdef const char *cval = NULL py_type = str2bytes(py_type, &cval) CHKERR( PCPythonSetType(self.pc, cval) ) # --- ASM --- def setASMType(self, asmtype): cdef PetscPCASMType cval = asmtype CHKERR( PCASMSetType(self.pc, cval) ) def setASMOverlap(self, overlap): cdef PetscInt ival = asInt(overlap) CHKERR( PCASMSetOverlap(self.pc, ival) ) def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): cdef PetscInt n = asInt(nsd) cdef PetscInt i = 0 cdef PetscIS *isets = NULL cdef PetscIS *isets_local = NULL if is_ is not None: assert len(is_) == nsd CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) for i in range(n): isets[i] = (is_[i]).iset if is_local is not None: assert len(is_local) == nsd CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) for i in range(n): isets_local[i] = (is_local[i]).iset CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) CHKERR( PetscFree(isets) ) CHKERR( PetscFree(isets_local) ) def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): cdef PetscInt n = asInt(nsd) cdef PetscInt i = 0 cdef PetscIS *isets = NULL cdef PetscIS *isets_local = NULL if is_ is not None: assert len(is_) == nsd CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) for i in range(n): isets[i] = (is_[i]).iset if is_local is not None: assert len(is_local) == nsd CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) for i in range(n): isets_local[i] = (is_local[i]).iset CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) CHKERR( PetscFree(isets) ) CHKERR( PetscFree(isets_local) ) def getASMSubKSP(self): cdef PetscInt i = 0, n = 0 cdef PetscKSP *p = NULL CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) return [ref_KSP(p[i]) for i from 0 <= i &cisfields) for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) def setBDDCDofsSplittingLocal(self, isfields): isfields = [isfields] if isinstance(isfields, IS) else list(isfields) cdef Py_ssize_t i, n = len(isfields) cdef PetscIS *cisfields = NULL cdef object tmp tmp = oarray_p(empty_p(n), NULL, &cisfields) for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset CHKERR( PCBDDCSetDofsSplittingLocal(self.pc, n, cisfields) ) # --- Patch --- def setPatchCellNumbering(self, Section sec not None): CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) def setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes): cdef PetscInt numSubSpaces = 0 cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 cdef PetscInt *nodesPerCell = NULL cdef const PetscInt **ccellNodeMaps = NULL cdef PetscDM *cdms = NULL cdef PetscInt *cbs = NULL cdef PetscInt *csubspaceOffsets = NULL cdef PetscInt *cghostBcNodes = NULL cdef PetscInt *cglobalBcNodes = NULL cdef PetscInt i = 0 bs = iarray_i(bs, &numSubSpaces, &cbs) ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) for i in range(numSubSpaces): cdms[i] = (dms[i]).dm _, nodes = asarray(cellNodeMaps[i]).shape cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) nodesPerCell[i] = asInt(nodes) # TODO: refactor on the PETSc side to take ISes? CHKERR( PCPatchSetDiscretisationInfo(self.pc, numSubSpaces, cdms, cbs, nodesPerCell, ccellNodeMaps, csubspaceOffsets, numGhostBcs, cghostBcNodes, numGlobalBcs, cglobalBcNodes) ) CHKERR( PetscFree(nodesPerCell) ) CHKERR( PetscFree(cdms) ) CHKERR( PetscFree(ccellNodeMaps) ) def setPatchComputeOperator(self, operator, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (operator, args, kargs) self.set_attr("__patch_compute_operator__", context) CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (operator, args, kargs) self.set_attr("__patch_compute_operator_interior_facets__", context) CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) def setPatchComputeFunction(self, function, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr("__patch_compute_function__", context) CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr("__patch_compute_function_interior_facets__", context) CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: raise ValueError("Must provide operator for USER or PYTHON type") if operator is not None: context = (operator, args, kargs) else: context = None self.set_attr("__patch_construction_operator__", context) CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, context) ) # -------------------------------------------------------------------- del PCType del PCSide del PCASMType del PCGASMType del PCMGType del PCMGCycleType del PCGAMGType del PCCompositeType del PCFieldSplitSchurPreType del PCFieldSplitSchurFactType del PCPatchConstructType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/DMLabel.pyx0000644000175000017500000000136413750315427017300 0ustar balaybalay00000000000000 cdef class DMLabel(Object): def __cinit__(self): self.obj = &self.dmlabel self.dmlabel = NULL def destroy(self): CHKERR( DMLabelDestroy(&self.dmlabel) ) return self def create(self, name, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) cdef PetscDMLabel newdmlabel = NULL cdef const char *cname = NULL name = str2bytes(name, &cname) CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) PetscCLEAR(self.obj); self.dmlabel = newdmlabel return self def insertIS(self, IS iset, value): cdef PetscInt cvalue = asInt(value) CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) return self petsc4py-3.15.1/src/PETSc/DT.pyx0000644000175000017500000000117013750315427016342 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class Quad(Object): def __cinit__(self): self.obj = &self.quad self.quad = NULL def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscQuadrature newquad = NULL CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) PetscCLEAR(self.obj); self.quad = newquad return self def destroy(self): CHKERR( PetscQuadratureDestroy(&self.quad) ) return self # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Options.pyx0000644000175000017500000001006313750315427017467 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class Options: cdef PetscOptions opt cdef object _prefix def __init__(self, prefix=None): self.opt = NULL self.prefix = prefix def __dealloc__(self): if self.opt == NULL: return CHKERR( PetscOptionsDestroy(&self.opt) ) def __contains__(self, item): return self.hasName(item) def __getitem__(self, item): return self.getString(item) def __setitem__(self, item, value): self.setValue(item, value) def __delitem__(self, item): self.delValue(item) property prefix: def __get__(self): return self._prefix def __set__(self, prefix): self._prefix = getprefix(prefix) def __del__(self): self._prefix = None # def create(self): if self.opt != NULL: return CHKERR( PetscOptionsCreate(&self.opt) ) return self def destroy(self): if self.opt == NULL: return CHKERR( PetscOptionsDestroy(&self.opt) ) return self def clear(self): if self.opt == NULL: return CHKERR( PetscOptionsClear(self.opt) ) return self def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PetscOptionsView(self.opt, vwr) ) def prefixPush(self, prefix): prefix = getprefix(prefix) cdef const char *cprefix = NULL prefix = str2bytes(prefix, &cprefix) CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) def prefixPop(self): CHKERR( PetscOptionsPrefixPop(self.opt) ) # def hasName(self, name): cdef const char *pr = NULL cdef const char *nm = NULL tmp = getpair(self.prefix, name, &pr, &nm) cdef PetscBool flag = PETSC_FALSE CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) return toBool(flag) def setValue(self, name, value): cdef const char *pr = NULL cdef const char *nm = NULL tmp = getpair(self.prefix, name, &pr, &nm) if pr == NULL: option = bytes2str(nm) else: option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) if type(value) is bool: value = str(value).lower() elif value is not None : value = str(value) cdef const char *key = NULL cdef const char *val = NULL option = str2bytes(option, &key) value = str2bytes(value, &val) CHKERR( PetscOptionsSetValue(self.opt, key, val) ) def delValue(self, name): cdef const char *pr = NULL cdef const char *nm = NULL tmp = getpair(self.prefix, name, &pr, &nm) if pr == NULL: option = bytes2str(nm) else: option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) cdef const char *key = NULL option = str2bytes(option, &key) CHKERR( PetscOptionsClearValue(self.opt, key) ) # def getBool(self, name, default=None): return getopt(self.opt, OPT_BOOL, self.prefix, name, default) def getInt(self, name, default=None): return getopt(self.opt, OPT_INT, self.prefix, name, default) def getReal(self, name, default=None): return getopt(self.opt, OPT_REAL, self.prefix, name, default) def getScalar(self, name, default=None): return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) def getString(self, name, default=None): return getopt(self.opt, OPT_STRING, self.prefix, name, default) # def insertString(self, string): cdef const char *cstring = NULL string = str2bytes(string, &cstring) CHKERR( PetscOptionsInsertString(self.opt, cstring) ) def getAll(self): cdef char *allopts = NULL CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) options = bytes2str(allopts) CHKERR( PetscFree(allopts) ) return parseopt(options, self.prefix) # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/cyclicgc.pxi0000644000175000017500000000234013750315427017573 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from "stdio.h" nogil: int printf(char *, ...) cdef extern from "Python.h": ctypedef struct PyObject ctypedef struct PyTypeObject ctypedef int visitproc(PyObject *, void *) ctypedef int traverseproc(PyObject *, visitproc, void *) ctypedef int inquiry(PyObject *) ctypedef struct PyTypeObject: char* tp_name traverseproc tp_traverse inquiry tp_clear PyTypeObject *Py_TYPE(PyObject *) cdef int tp_traverse(PyObject *o, visitproc visit, void *arg): ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) cdef PetscObject p = (o).obj[0] if p == NULL: return 0 cdef PyObject *d = p.python_context if d == NULL: return 0 return visit(d, arg) cdef int tp_clear(PyObject *o): ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) cdef PetscObject *p = (o).obj PetscDEALLOC(p) return 0 cdef inline void TypeEnableGC(PyTypeObject *t): ## printf("%s: enforcing GC support\n", t.tp_name) t.tp_traverse = tp_traverse t.tp_clear = tp_clear # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscvec.pxi0000644000175000017500000005350214062763234017635 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef const char* PetscVecType "VecType" PetscVecType VECSEQ PetscVecType VECMPI PetscVecType VECSTANDARD PetscVecType VECSHARED PetscVecType VECSEQVIENNACL PetscVecType VECMPIVIENNACL PetscVecType VECVIENNACL PetscVecType VECSEQCUDA PetscVecType VECMPICUDA PetscVecType VECCUDA PetscVecType VECNEST PetscVecType VECSEQKOKKOS PetscVecType VECMPIKOKKOS PetscVecType VECKOKKOS ctypedef enum PetscVecOption "VecOption": VEC_IGNORE_OFF_PROC_ENTRIES VEC_IGNORE_NEGATIVE_INDICES int VecView(PetscVec,PetscViewer) int VecDestroy(PetscVec*) int VecCreate(MPI_Comm,PetscVec*) int VecSetOptionsPrefix(PetscVec,char[]) int VecGetOptionsPrefix(PetscVec,char*[]) int VecSetFromOptions(PetscVec) int VecSetUp(PetscVec) int VecCreateSeq(MPI_Comm,PetscInt,PetscVec*) int VecCreateSeqWithArray(MPI_Comm,PetscInt,PetscInt,PetscScalar[],PetscVec*) int VecCreateSeqCUDAWithArrays(MPI_Comm,PetscInt,PetscInt,PetscScalar[],PetscScalar[],PetscVec*) int VecCreateSeqViennaCLWithArrays(MPI_Comm,PetscInt,PetscInt,PetscScalar[],PetscScalar[],PetscVec*) int VecCreateMPI(MPI_Comm,PetscInt,PetscInt,PetscVec*) int VecCreateMPIWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscScalar[],PetscVec*) int VecCreateMPICUDAWithArrays(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscScalar[],PetscScalar[],PetscVec*) int VecCreateMPIViennaCLWithArrays(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscScalar[],PetscScalar[],PetscVec*) int VecCreateGhost(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt[],PetscVec*) int VecCreateGhostWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt[],PetscScalar[],PetscVec*) int VecCreateGhostBlock(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt[],PetscVec*) int VecCreateGhostBlockWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt[],PetscScalar[],PetscVec*) int VecCreateShared(MPI_Comm,PetscInt,PetscInt,PetscVec*) int VecCreateNest(MPI_Comm,PetscInt,PetscIS[],PetscVec[],PetscVec*) int VecGetType(PetscVec,PetscVecType*) int VecSetType(PetscVec,PetscVecType) int VecSetOption(PetscVec,PetscVecOption,PetscBool) int VecSetSizes(PetscVec,PetscInt,PetscInt) int VecGetSize(PetscVec,PetscInt*) int VecGetLocalSize(PetscVec,PetscInt*) int VecSetBlockSize(PetscVec,PetscInt) int VecGetBlockSize(PetscVec,PetscInt*) int VecGetOwnershipRange(PetscVec,PetscInt*,PetscInt*) int VecGetOwnershipRanges(PetscVec,const PetscInt*[]) int VecGetArrayWrite(PetscVec,PetscScalar*[]) int VecRestoreArrayWrite(PetscVec,PetscScalar*[]) int VecGetArrayRead(PetscVec,const PetscScalar*[]) int VecRestoreArrayRead(PetscVec,const PetscScalar*[]) int VecGetArray(PetscVec,PetscScalar*[]) int VecRestoreArray(PetscVec,PetscScalar*[]) int VecPlaceArray(PetscVec,PetscScalar[]) int VecResetArray(PetscVec) int VecEqual(PetscVec,PetscVec,PetscBool*) int VecLoad(PetscVec,PetscViewer) int VecDuplicate(PetscVec,PetscVec*) int VecCopy(PetscVec,PetscVec) int VecChop(PetscVec,PetscReal) int VecDuplicateVecs(PetscVec,PetscInt,PetscVec*[]) int VecDestroyVecs(PetscInt,PetscVec*[]) int VecGetValues(PetscVec,PetscInt,PetscInt[],PetscScalar[]) int VecSetValue(PetscVec,PetscInt,PetscScalar,PetscInsertMode) int VecSetValues(PetscVec,PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int VecSetValuesBlocked(PetscVec,PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int VecSetLocalToGlobalMapping(PetscVec,PetscLGMap) int VecGetLocalToGlobalMapping(PetscVec,PetscLGMap*) int VecSetValueLocal(PetscVec,PetscInt,PetscScalar,PetscInsertMode) int VecSetValuesLocal(PetscVec,PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int VecSetValuesBlockedLocal(PetscVec,PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int VecDot(PetscVec,PetscVec,PetscScalar*) int VecDotBegin(PetscVec,PetscVec,PetscScalar*) int VecDotEnd(PetscVec,PetscVec,PetscScalar*) int VecTDot(PetscVec,PetscVec,PetscScalar*) int VecTDotBegin(PetscVec,PetscVec,PetscScalar*) int VecTDotEnd(PetscVec,PetscVec,PetscScalar*) int VecMDot(PetscVec,PetscInt,PetscVec[],PetscScalar*) int VecMDotBegin(PetscVec,PetscInt,PetscVec[],PetscScalar*) int VecMDotEnd(PetscVec,PetscInt,PetscVec[],PetscScalar*) int VecMTDot(PetscVec,PetscInt,PetscVec[],PetscScalar*) int VecMTDotBegin(PetscVec,PetscInt,PetscVec[],PetscScalar*) int VecMTDotEnd(PetscVec,PetscInt,PetscVec[],PetscScalar*) int VecNorm(PetscVec,PetscNormType,PetscReal*) int VecNormBegin(PetscVec,PetscNormType,PetscReal*) int VecNormEnd(PetscVec,PetscNormType,PetscReal*) int VecAssemblyBegin(PetscVec) int VecAssemblyEnd(PetscVec) int VecZeroEntries(PetscVec) int VecConjugate(PetscVec) int VecNormalize(PetscVec,PetscReal*) int VecSum(PetscVec,PetscScalar*) int VecMax(PetscVec,PetscInt*,PetscReal*) int VecMin(PetscVec,PetscInt*,PetscReal*) int VecScale(PetscVec,PetscScalar) int VecCopy(PetscVec,PetscVec) int VecSetRandom(PetscVec,PetscRandom) int VecSet(PetscVec,PetscScalar) int VecSwap(PetscVec,PetscVec) int VecAXPY(PetscVec,PetscScalar,PetscVec) int VecAXPBY(PetscVec,PetscScalar,PetscScalar,PetscVec) int VecAYPX(PetscVec,PetscScalar,PetscVec) int VecWAXPY(PetscVec,PetscScalar,PetscVec,PetscVec) int VecMAXPY(PetscVec,PetscInt,PetscScalar[],PetscVec[]) int VecPointwiseMax(PetscVec,PetscVec,PetscVec) int VecPointwiseMaxAbs(PetscVec,PetscVec,PetscVec) int VecPointwiseMin(PetscVec,PetscVec,PetscVec) int VecPointwiseMult(PetscVec,PetscVec,PetscVec) int VecPointwiseDivide(PetscVec,PetscVec,PetscVec) int VecMaxPointwiseDivide(PetscVec,PetscVec,PetscReal*) int VecShift(PetscVec,PetscScalar) int VecChop(PetscVec,PetscReal) int VecReciprocal(PetscVec) int VecPermute(PetscVec,PetscIS,PetscBool) int VecExp(PetscVec) int VecLog(PetscVec) int VecSqrtAbs(PetscVec) int VecAbs(PetscVec) int VecStrideSum(PetscVec,PetscInt,PetscScalar*) int VecStrideMin(PetscVec,PetscInt,PetscInt*,PetscReal*) int VecStrideMax(PetscVec,PetscInt,PetscInt*,PetscReal*) int VecStrideScale(PetscVec,PetscInt,PetscScalar) int VecStrideGather(PetscVec,PetscInt,PetscVec,PetscInsertMode) int VecStrideScatter(PetscVec,PetscInt,PetscVec,PetscInsertMode) int VecStrideNorm(PetscVec,PetscInt,PetscNormType,PetscReal*) int VecGhostGetLocalForm(PetscVec,PetscVec*) int VecGhostRestoreLocalForm(PetscVec,PetscVec*) int VecGhostUpdateBegin(PetscVec,PetscInsertMode,PetscScatterMode) int VecGhostUpdateEnd(PetscVec,PetscInsertMode,PetscScatterMode) int VecMPISetGhost(PetscVec,PetscInt,const PetscInt*) int VecGetSubVector(PetscVec,PetscIS,PetscVec*) int VecRestoreSubVector(PetscVec,PetscIS,PetscVec*) int VecNestGetSubVecs(PetscVec,PetscInt*,PetscVec**) int VecNestSetSubVecs(PetscVec,PetscInt,PetscInt*,PetscVec*) int VecISAXPY(PetscVec,PetscIS,PetscScalar,PetscVec) int VecISSet(PetscVec,PetscIS,PetscScalar) int VecCUDAGetArrayRead(PetscVec,const PetscScalar*[]) int VecCUDAGetArrayWrite(PetscVec,PetscScalar*[]) int VecCUDAGetArray(PetscVec,PetscScalar*[]) int VecCUDARestoreArrayRead(PetscVec,const PetscScalar*[]) int VecCUDARestoreArrayWrite(PetscVec,PetscScalar*[]) int VecCUDARestoreArray(PetscVec,PetscScalar*[]) int VecBindToCPU(PetscVec,PetscBool) int VecGetOffloadMask(PetscVec,PetscOffloadMask*) int VecViennaCLGetCLContext(PetscVec,Py_uintptr_t*) int VecViennaCLGetCLQueue(PetscVec,Py_uintptr_t*) int VecViennaCLGetCLMemRead(PetscVec,Py_uintptr_t*) int VecViennaCLGetCLMemWrite(PetscVec,Py_uintptr_t*) int VecViennaCLRestoreCLMemWrite(PetscVec) int VecViennaCLGetCLMem(PetscVec,Py_uintptr_t*) int VecViennaCLRestoreCLMem(PetscVec) int VecCreateSeqCUDAWithArray(MPI_Comm,PetscInt,PetscInt,const PetscScalar*,PetscVec*) int VecCreateMPICUDAWithArray(MPI_Comm,PetscInt,PetscInt,PetscInt,const PetscScalar*,PetscVec*) # -------------------------------------------------------------------- cdef inline Vec ref_Vec(PetscVec vec): cdef Vec ob = Vec() ob.vec = vec PetscINCREF(ob.obj) return ob # -------------------------------------------------------------------- # unary operations cdef Vec vec_pos(Vec self): cdef Vec vec = type(self)() CHKERR( VecDuplicate(self.vec, &vec.vec) ) CHKERR( VecCopy(self.vec, vec.vec) ) return vec cdef Vec vec_neg(Vec self): cdef Vec vec = vec_pos(self) CHKERR( VecScale(vec.vec, -1) ) return vec cdef Vec vec_abs(Vec self): cdef Vec vec = vec_pos(self) CHKERR( VecAbs(vec.vec) ) return vec # inplace binary operations cdef Vec vec_iadd(Vec self, other): cdef PetscScalar alpha = 1 cdef Vec vec if isinstance(other, Vec): alpha = 1; vec = other CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) elif isinstance(other, tuple) or isinstance(other, list): other, vec = other alpha = asScalar(other) CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) else: alpha = asScalar(other) CHKERR( VecShift(self.vec, alpha) ) return self cdef Vec vec_isub(Vec self, other): cdef PetscScalar alpha = 1 cdef Vec vec if isinstance(other, Vec): alpha = 1; vec = other CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) elif isinstance(other, tuple) or isinstance(other, list): other, vec = other alpha = asScalar(other) CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) else: alpha = asScalar(other) CHKERR( VecShift(self.vec, -alpha) ) return self cdef Vec vec_imul(Vec self, other): cdef PetscScalar alpha = 1 cdef Vec vec if isinstance(other, Vec): vec = other CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) else: alpha = asScalar(other) CHKERR( VecScale(self.vec, alpha) ) return self cdef Vec vec_idiv(Vec self, other): cdef PetscScalar one = 1 cdef PetscScalar alpha = 1 cdef Vec vec if isinstance(other, Vec): vec = other CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) else: alpha = asScalar(other) CHKERR( VecScale(self.vec, one/alpha) ) return self # binary operations cdef Vec vec_add(Vec self, other): return vec_iadd(vec_pos(self), other) cdef Vec vec_sub(Vec self, other): return vec_isub(vec_pos(self), other) cdef Vec vec_mul(Vec self, other): return vec_imul(vec_pos(self), other) cdef Vec vec_div(Vec self, other): return vec_idiv(vec_pos(self), other) # reflected binary operations cdef Vec vec_radd(Vec self, other): return vec_add(self, other) cdef Vec vec_rsub(Vec self, other): cdef Vec vec = vec_sub(self, other) CHKERR( VecScale(vec.vec, -1) ) return vec cdef Vec vec_rmul(Vec self, other): return vec_mul(self, other) cdef Vec vec_rdiv(Vec self, other): cdef Vec vec = vec_div(self, other) CHKERR( VecReciprocal(vec.vec) ) return vec # -------------------------------------------------------------------- cdef inline int Vec_Sizes(object size, object bsize, PetscInt *b, PetscInt *n, PetscInt *N) except -1: Sys_Sizes(size, bsize, b, n, N) return 0 # -------------------------------------------------------------------- ctypedef int VecSetValuesFcn(PetscVec, PetscInt,const PetscInt*, const PetscScalar*,PetscInsertMode) cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): cdef VecSetValuesFcn *setvalues = NULL if blocked and local: setvalues = VecSetValuesBlockedLocal elif blocked: setvalues = VecSetValuesBlocked elif local: setvalues = VecSetValuesLocal else: setvalues = VecSetValues return setvalues cdef inline int vecsetvalues(PetscVec V, object oi, object ov, object oim, int blocked, int local) except -1: # block size cdef PetscInt bs=1 if blocked: CHKERR( VecGetBlockSize(V, &bs) ) if bs < 1: bs = 1 # indices and values cdef PetscInt ni=0, nv=0 cdef PetscInt *i=NULL cdef PetscScalar *v=NULL cdef object tmp1 = iarray_i(oi, &ni, &i) cdef object tmp2 = iarray_s(ov, &nv, &v) if ni*bs != nv: raise ValueError( "incompatible array sizes: ni=%d, nv=%d, bs=%d" % (toInt(ni), toInt(nv), toInt(bs)) ) # VecSetValuesXXX function and insert mode cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local) cdef PetscInsertMode addv = insertmode(oim) # actual call CHKERR( setvalues(V, ni, i, v, addv) ) return 0 cdef object vecgetvalues(PetscVec vec, object oindices, object values): cdef PetscInt ni=0, nv=0 cdef PetscInt *i=NULL cdef PetscScalar *v=NULL cdef object indices = iarray_i(oindices, &ni, &i) if values is None: values = empty_s(ni) values.shape = indices.shape values = oarray_s(values, &nv, &v) if (ni != nv): raise ValueError( ("incompatible array sizes: " "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) CHKERR( VecGetValues(vec, ni, i, v) ) return values # -------------------------------------------------------------------- cdef inline _Vec_buffer vec_getbuffer_r(Vec self): cdef _Vec_buffer buf = _Vec_buffer(self) buf.readonly = 1 return buf cdef inline _Vec_buffer vec_getbuffer_w(Vec self): cdef _Vec_buffer buf = _Vec_buffer(self) buf.readonly = 0 return buf cdef inline ndarray vec_getarray_r(Vec self): return asarray(vec_getbuffer_r(self)) cdef inline ndarray vec_getarray_w(Vec self): return asarray(vec_getbuffer_w(self)) cdef inline int vec_setarray(Vec self, object o) except -1: cdef PetscInt na=0, nv=0, i=0 cdef PetscScalar *va=NULL, *vv=NULL cdef ndarray ary = iarray_s(o, &na, &va) CHKERR( VecGetLocalSize(self.vec, &nv) ) if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( "array size %d incompatible with vector local size %d" % (toInt(na), toInt(nv)) ) CHKERR( VecGetArray(self.vec, &vv) ) try: if PyArray_NDIM(ary) == 0: for i from 0 <= i < nv: vv[i] = va[0] else: CHKERR( PetscMemcpy(vv, va, nv*sizeof(PetscScalar)) ) finally: CHKERR( VecRestoreArray(self.vec, &vv) ) return 0 cdef object vec_getitem(Vec self, object i): cdef PetscInt N=0 if i is Ellipsis: return asarray(self) if isinstance(i, slice): CHKERR( VecGetSize(self.vec, &N) ) start, stop, stride = i.indices(toInt(N)) i = arange(start, stop, stride) return vecgetvalues(self.vec, i, None) cdef int vec_setitem(Vec self, object i, object v) except -1: cdef PetscInt N=0 if i is Ellipsis: return vec_setarray(self, v) if isinstance(i, slice): CHKERR( VecGetSize(self.vec, &N) ) start, stop, stride = i.indices(toInt(N)) i = arange(start, stop, stride) vecsetvalues(self.vec, i, v, None, 0, 0) return 0 # -------------------------------------------------------------------- cdef extern from "pep3118.h": int PyPetscBuffer_FillInfo(Py_buffer*, void*,PetscInt,char, int,int) except -1 void PyPetscBuffer_Release(Py_buffer*) # -------------------------------------------------------------------- cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: if ro: CHKERR( VecGetArrayRead(v, a) ) else: CHKERR( VecGetArray(v, a) ) return 0 cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: if ro: CHKERR( VecRestoreArrayRead(v, a) ) else: CHKERR( VecRestoreArray(v, a) ) return 0 cdef class _Vec_buffer: cdef PetscVec vec cdef PetscInt size cdef PetscScalar *data cdef bint readonly cdef bint hasarray def __cinit__(self, Vec vec, bint readonly=0): cdef PetscVec v = vec.vec CHKERR( PetscINCREF(&v) ) self.vec = v self.size = 0 self.data = NULL self.readonly = 1 if readonly else 0 self.hasarray = 0 def __dealloc__(self): if self.hasarray and self.vec != NULL: Vec_ReleaseArray(self.vec, &self.data, self.readonly) CHKERR( VecDestroy(&self.vec) ) # cdef int acquire(self) nogil except -1: if not self.hasarray and self.vec != NULL: CHKERR( VecGetLocalSize(self.vec, &self.size) ) Vec_AcquireArray(self.vec, &self.data, self.readonly) self.hasarray = 1 return 0 cdef int release(self) nogil except -1: if self.hasarray and self.vec != NULL: self.size = 0 Vec_ReleaseArray(self.vec, &self.data, self.readonly) self.hasarray = 0 return 0 # buffer interface (PEP 3118) cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: self.acquire() PyPetscBuffer_FillInfo(view, self.data, self.size, c's', self.readonly, flags) view.obj = self return 0 cdef int releasebuffer(self, Py_buffer *view) except -1: PyPetscBuffer_Release(view) self.release() return 0 def __getbuffer__(self, Py_buffer *view, int flags): self.acquirebuffer(view, flags) def __releasebuffer__(self, Py_buffer *view): self.releasebuffer(view) # 'with' statement (PEP 343) cdef object enter(self): self.acquire() return asarray(self) cdef object exit(self): self.release() return None def __enter__(self): return self.enter() def __exit__(self, *exc): return self.exit() # buffer interface (legacy) cdef Py_ssize_t getbuffer(self, void **p) except -1: cdef PetscInt n = 0 if p != NULL: self.acquire() p[0] = self.data n = self.size elif self.vec != NULL: CHKERR( VecGetLocalSize(self.vec, &n) ) return (n*sizeof(PetscScalar)) def __getsegcount__(self, Py_ssize_t *lenp): if lenp != NULL: lenp[0] = self.getbuffer(NULL) return 1 def __getreadbuffer__(self, Py_ssize_t idx, void **p): if idx != 0: raise SystemError( "accessing non-existent buffer segment") return self.getbuffer(p) def __getwritebuffer__(self, Py_ssize_t idx, void **p): if idx != 0: raise SystemError( "accessing non-existent buffer segment") if self.readonly: raise TypeError( "Object is not writable.") return self.getbuffer(p) # NumPy array interface (legacy) property __array_interface__: def __get__(self): cdef PetscInt n = 0 if self.vec != NULL: CHKERR( VecGetLocalSize(self.vec, &n) ) cdef object size = toInt(n) cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) return dict(version=3, data=self, shape=(size,), typestr=typestr) # -------------------------------------------------------------------- cdef class _Vec_LocalForm: "Context manager for `Vec` local form" cdef Vec gvec cdef Vec lvec def __init__(self, Vec gvec): self.gvec = gvec self.lvec = Vec() def __enter__(self): cdef PetscVec gvec = self.gvec.vec CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) return self.lvec def __exit__(self, *exc): cdef PetscVec gvec = self.gvec.vec CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) self.lvec.vec = NULL # -------------------------------------------------------------------- cdef extern from "Python.h": ctypedef void (*PyCapsule_Destructor)(object) bint PyCapsule_IsValid(object, const char*) void* PyCapsule_GetPointer(object, const char*) except? NULL int PyCapsule_SetName(object, const char*) except -1 object PyCapsule_New(void*, const char*, PyCapsule_Destructor) int PyCapsule_CheckExact(object) cdef extern from "stdlib.h" nogil: ctypedef signed long int64_t ctypedef unsigned long long uint64_t ctypedef unsigned char uint8_t ctypedef unsigned short uint16_t void free(void* ptr) void* malloc(size_t size) cdef struct DLDataType: uint8_t code uint8_t bits uint16_t lanes ctypedef struct DLContext: int device_type int device_id cdef enum DLDataTypeCode: kDLInt = 0 kDLUInt = 1 kDLFloat = 2 cdef struct DLTensor: void* data DLContext ctx int ndim DLDataType dtype int64_t* shape int64_t* strides uint64_t byte_offset cdef struct DLManagedTensor: DLTensor dl_tensor void* manager_ctx void (*manager_deleter)(DLManagedTensor*) nogil cdef void pycapsule_deleter(object dltensor): cdef DLManagedTensor* dlm_tensor = NULL try: dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') return # we do not call a used capsule's deleter except Exception: dlm_tensor = PyCapsule_GetPointer(dltensor, 'dltensor') manager_deleter(dlm_tensor) cdef void manager_deleter(DLManagedTensor* tensor) nogil: if tensor.manager_ctx is NULL: return free(tensor.dl_tensor.shape) CHKERR( PetscDEALLOC(&tensor.manager_ctx) ) free(tensor) tensor.manager_ctx = NULL # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscdmplex.pxi0000644000175000017500000001747714030740317020354 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: int DMPlexCreate(MPI_Comm,PetscDM*) int DMPlexCreateCohesiveSubmesh(PetscDM,PetscBool,const char[],PetscInt,PetscDM*) int DMPlexCreateFromCellListPetsc(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,PetscBool,PetscInt[],PetscInt,PetscReal[],PetscDM*) #int DMPlexCreateFromDAG(PetscDM,PetscInt,const PetscInt[],const PetscInt[],const PetscInt[],const PetscInt[],const PetscScalar[]) int DMPlexGetChart(PetscDM,PetscInt*,PetscInt*) int DMPlexSetChart(PetscDM,PetscInt,PetscInt) int DMPlexGetConeSize(PetscDM,PetscInt,PetscInt*) int DMPlexSetConeSize(PetscDM,PetscInt,PetscInt) int DMPlexGetCone(PetscDM,PetscInt,const PetscInt*[]) int DMPlexSetCone(PetscDM,PetscInt,const PetscInt[]) int DMPlexInsertCone(PetscDM,PetscInt,PetscInt,PetscInt) int DMPlexInsertConeOrientation(PetscDM,PetscInt,PetscInt,PetscInt) int DMPlexGetConeOrientation(PetscDM,PetscInt,const PetscInt*[]) int DMPlexSetConeOrientation(PetscDM,PetscInt,const PetscInt[]) int DMPlexGetSupportSize(PetscDM,PetscInt,PetscInt*) int DMPlexSetSupportSize(PetscDM,PetscInt,PetscInt) int DMPlexGetSupport(PetscDM,PetscInt,const PetscInt*[]) int DMPlexSetSupport(PetscDM,PetscInt,const PetscInt[]) #int DMPlexInsertSupport(PetscDM,PetscInt,PetscInt,PetscInt) #int DMPlexGetConeSection(PetscDM,PetscSection*) #int DMPlexGetSupportSection(PetscDM,PetscSection*) #int DMPlexGetCones(PetscDM,PetscInt*[]) #int DMPlexGetConeOrientations(PetscDM,PetscInt*[]) int DMPlexGetMaxSizes(PetscDM,PetscInt*,PetscInt*) int DMPlexSymmetrize(PetscDM) int DMPlexStratify(PetscDM) #int DMPlexEqual(PetscDM,PetscDM,PetscBool*) int DMPlexOrient(PetscDM) int DMPlexInterpolate(PetscDM,PetscDM*) int DMPlexUninterpolate(PetscDM,PetscDM*) #int DMPlexLoad(PetscViewer,PetscDM) #int DMPlexSetPreallocationCenterDimension(PetscDM,PetscInt) #int DMPlexGetPreallocationCenterDimension(PetscDM,PetscInt*) #int DMPlexPreallocateOperator(PetscDM,PetscInt,PetscSection,PetscSection,PetscInt[],PetscInt[],PetscInt[],PetscInt[],Mat,PetscBool) int DMPlexGetPointLocal(PetscDM,PetscInt,PetscInt*,PetscInt*) #int DMPlexPointLocalRef(PetscDM,PetscInt,PetscScalar*,void*) #int DMPlexPointLocalRead(PetscDM,PetscInt,const PetscScalar*,const void*) int DMPlexGetPointGlobal(PetscDM,PetscInt,PetscInt*,PetscInt*) #int DMPlexPointGlobalRef(PetscDM,PetscInt,PetscScalar*,void*) #int DMPlexPointGlobalRead(PetscDM,PetscInt,const PetscScalar*,const void*) int DMPlexGetPointLocalField(PetscDM,PetscInt,PetscInt,PetscInt*,PetscInt*) int DMPlexGetPointGlobalField(PetscDM,PetscInt,PetscInt,PetscInt*,PetscInt*) int DMPlexCreateClosureIndex(PetscDM,PetscSection) #int PetscSectionCreateGlobalSectionLabel(PetscSection,PetscSF,PetscBool,PetscDMLabel,PetscInt,PetscSection*) int DMPlexGetCellNumbering(PetscDM,PetscIS*) int DMPlexGetVertexNumbering(PetscDM,PetscIS*) int DMPlexCreatePointNumbering(PetscDM,PetscIS*) int DMPlexGetDepth(PetscDM,PetscInt*) #int DMPlexGetDepthLabel(PetscDM,PetscDMLabel*) int DMPlexGetDepthStratum(PetscDM,PetscInt,PetscInt*,PetscInt*) int DMPlexGetHeightStratum(PetscDM,PetscInt,PetscInt*,PetscInt*) int DMPlexGetMeet(PetscDM,PetscInt,const PetscInt[],PetscInt*,const PetscInt**) #int DMPlexGetFullMeet(PetscDM,PetscInt,const PetscInt[],PetscInt*,const PetscInt**) int DMPlexRestoreMeet(PetscDM,PetscInt,const PetscInt[],PetscInt*,const PetscInt**) int DMPlexGetJoin(PetscDM,PetscInt,const PetscInt[],PetscInt*,const PetscInt**) #int DMPlexGetFullJoin(PetscDM,PetscInt,const PetscInt[],PetscInt*,const PetscInt**) int DMPlexRestoreJoin(PetscDM,PetscInt,const PetscInt[],PetscInt*,const PetscInt**) int DMPlexGetTransitiveClosure(PetscDM,PetscInt,PetscBool,PetscInt*,PetscInt*[]) int DMPlexRestoreTransitiveClosure(PetscDM,PetscInt,PetscBool,PetscInt*,PetscInt*[]) int DMPlexVecGetClosure(PetscDM,PetscSection,PetscVec,PetscInt,PetscInt*,PetscScalar*[]) int DMPlexVecRestoreClosure(PetscDM,PetscSection,PetscVec,PetscInt,PetscInt*,PetscScalar*[]) int DMPlexVecSetClosure(PetscDM,PetscSection,PetscVec,PetscInt,PetscScalar[],PetscInsertMode) int DMPlexMatSetClosure(PetscDM,PetscSection,PetscSection,PetscMat,PetscInt,PetscScalar[],PetscInsertMode) int DMPlexGenerate(PetscDM,const char[],PetscBool ,PetscDM*) int DMPlexTriangleSetOptions(PetscDM,const char*) int DMPlexTetgenSetOptions(PetscDM,const char*) #int DMPlexCopyCoordinates(PetscDM,PetscDM) #int DMPlexCreateDoublet(MPI_Comm,PetscInt,PetscBool,PetscBool,PetscBool,PetscReal,PetscDM*) int DMPlexCreateSquareBoundary(PetscDM,const PetscReal[],const PetscReal[],const PetscInt[]) int DMPlexCreateCubeBoundary(PetscDM,const PetscReal[],const PetscReal[],const PetscInt[]) int DMPlexCreateBoxMesh(MPI_Comm,PetscInt,PetscBool,PetscInt[],PetscReal[],PetscReal[],PetscDMBoundaryType[],PetscBool,PetscDM*) int DMPlexCreateFromFile(MPI_Comm,const char[],PetscBool,PetscDM*) int DMPlexCreateCGNS(MPI_Comm,PetscInt,PetscBool,PetscDM*) int DMPlexCreateCGNSFromFile(MPI_Comm,const char[],PetscBool,PetscDM*) int DMPlexCreateExodus(MPI_Comm,PetscInt,PetscBool,PetscDM*) int DMPlexCreateExodusFromFile(MPI_Comm,const char[],PetscBool,PetscDM*) int DMPlexCreateGmsh(MPI_Comm,PetscViewer,PetscBool,PetscDM*) #int DMPlexCreateConeSection(PetscDM,PetscSection*) #int DMPlexInvertCell(PetscInt,PetscInt,int[]) #int DMPlexCheckSymmetry(PetscDM) #int DMPlexCheckSkeleton(PetscDM,PetscBool,PetscInt) #int DMPlexCheckFaces(PetscDM,PetscBool,PetscInt) int DMPlexSetAdjacencyUseAnchors(PetscDM,PetscBool) int DMPlexGetAdjacencyUseAnchors(PetscDM,PetscBool*) int DMPlexGetAdjacency(PetscDM,PetscInt,PetscInt*,PetscInt*[]) #int DMPlexCreateNeighborCSR(PetscDM,PetscInt,PetscInt*,PetscInt**,PetscInt**) int DMPlexRebalanceSharedPoints(PetscDM,PetscInt,PetscBool,PetscBool,PetscBool*) int DMPlexDistribute(PetscDM,PetscInt,PetscSF*,PetscDM*) int DMPlexDistributeOverlap(PetscDM,PetscInt,PetscSF*,PetscDM*) int DMPlexSetPartitioner(PetscDM,PetscPartitioner) int DMPlexGetPartitioner(PetscDM,PetscPartitioner*) int DMPlexDistributeField(PetscDM,PetscSF,PetscSection,PetscVec,PetscSection,PetscVec) #int DMPlexDistributeData(PetscDM,PetscSF,PetscSection,MPI_Datatype,void*,PetscSection,void**) int DMPlexIsDistributed(PetscDM,PetscBool*) int DMPlexGetOrdering(PetscDM,PetscMatOrderingType,PetscDMLabel,PetscIS*) int DMPlexPermute(PetscDM,PetscIS,PetscDM*) #int DMPlexCreateSubmesh(PetscDM,PetscDMLabel,PetscInt,PetscDM*) #int DMPlexCreateHybridMesh(PetscDM,PetscDMLabel,PetscDMLabel*,PetscDM*) #int DMPlexGetSubpointMap(PetscDM,PetscDMLabel*) #int DMPlexSetSubpointMap(PetscDM,PetscDMLabel) #int DMPlexCreateSubpointIS(PetscDM,PetscIS*) int DMPlexCreateCoarsePointIS(PetscDM,PetscIS*) int DMPlexMarkBoundaryFaces(PetscDM,PetscInt,PetscDMLabel) #int DMPlexLabelComplete(PetscDM,PetscDMLabel) #int DMPlexLabelCohesiveComplete(PetscDM,PetscDMLabel,PetscBool,PetscDM) int DMPlexGetRefinementLimit(PetscDM,PetscReal*) int DMPlexSetRefinementLimit(PetscDM,PetscReal) int DMPlexGetRefinementUniform(PetscDM,PetscBool*) int DMPlexSetRefinementUniform(PetscDM,PetscBool) #int DMPlexGetNumFaceVertices(PetscDM,PetscInt,PetscInt,PetscInt*) #int DMPlexGetOrientedFace(PetscDM,PetscInt,PetscInt,const PetscInt[],PetscInt,PetscInt[],PetscInt[],PetscInt[],PetscBool*) int DMPlexCreateSection(PetscDM,PetscDMLabel[],const PetscInt[],const PetscInt[],PetscInt,const PetscInt[],const PetscIS[],const PetscIS[],PetscIS,PetscSection*) int DMPlexComputeCellGeometryFVM(PetscDM,PetscInt,PetscReal*,PetscReal[],PetscReal[]) int DMPlexConstructGhostCells(PetscDM,const char[],PetscInt*,PetscDM*) petsc4py-3.15.1/src/PETSc/DMSwarm.pyx0000644000175000017500000002643013750315427017353 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class DMSwarmType(object): BASIC = DMSWARM_BASIC PIC = DMSWARM_PIC class DMSwarmMigrateType(object): MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT MIGRATE_USER = DMSWARM_MIGRATE_USER class DMSwarmCollectType(object): COLLECT_BASIC = DMSWARM_COLLECT_BASIC COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL COLLECT_USER = DMSWARM_COLLECT_USER class DMSwarmPICLayoutType(object): LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION cdef class DMSwarm(DM): Type = DMSwarmType MigrateType = DMSwarmMigrateType CollectType = DMSwarmCollectType PICLayoutType = DMSwarmPICLayoutType def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDM newdm = NULL CHKERR( DMCreate(ccomm, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm CHKERR( DMSetType(self.dm, DMSWARM) ) return self def createGlobalVectorFromField(self, fieldname): cdef const char *cfieldname = NULL cdef Vec vg = Vec() fieldname = str2bytes(fieldname, &cfieldname) CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) return vg def destroyGlobalVectorFromField(self, fieldname): cdef const char *cfieldname = NULL cdef PetscVec vec = NULL fieldname = str2bytes(fieldname, &cfieldname) CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) def createLocalVectorFromField(self, fieldname): cdef const char *cfieldname = NULL cdef Vec vl = Vec() fieldname = str2bytes(fieldname, &cfieldname) CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) return vl def destroyLocalVectorFromField(self, fieldname): cdef const char *cfieldname = NULL cdef PetscVec vec fieldname = str2bytes(fieldname, &cfieldname) CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) def initializeFieldRegister(self): CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) def finalizeFieldRegister(self): CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) def setLocalSizes(self, nlocal, buffer): cdef PetscInt cnlocal = asInt(nlocal) cdef PetscInt cbuffer = asInt(buffer) CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) return self def registerField(self, fieldname, blocksize, dtype=ScalarType): cdef const char *cfieldname = NULL cdef PetscInt cblocksize = asInt(blocksize) cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN if dtype == IntType: ctype = PETSC_INT if dtype == RealType: ctype = PETSC_REAL if dtype == ScalarType: ctype = PETSC_SCALAR if dtype == ComplexType: ctype = PETSC_COMPLEX assert ctype != PETSC_DATATYPE_UNKNOWN fieldname = str2bytes(fieldname, &cfieldname) CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) def getField(self, fieldname): cdef const char *cfieldname = NULL cdef PetscInt blocksize = 0 cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN cdef PetscReal *data = NULL cdef PetscInt nlocal = 0 fieldname = str2bytes(fieldname, &cfieldname) CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) cdef int typenum = -1 if ctype == PETSC_INT: typenum = NPY_PETSC_INT if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX assert typenum != -1 cdef npy_intp s = nlocal * blocksize return PyArray_SimpleNewFromData(1, &s, typenum, data) def restoreField(self, fieldname): cdef const char *cfieldname = NULL cdef PetscInt blocksize = 0 cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN fieldname = str2bytes(fieldname, &cfieldname) CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) def vectorDefineField(self, fieldname): cdef const char *cval = NULL fieldname = str2bytes(fieldname, &cval) CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) def addPoint(self): CHKERR( DMSwarmAddPoint(self.dm) ) def addNPoints(self, npoints): cdef PetscInt cnpoints = asInt(npoints) CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) def removePoint(self): CHKERR( DMSwarmRemovePoint(self.dm) ) def removePointAtIndex(self, index): cdef PetscInt cindex = asInt(index) CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) def copyPoint(self, pi, pj): cdef PetscInt cpi = asInt(pi) cdef PetscInt cpj = asInt(pj) CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) def getLocalSize(self): cdef PetscInt size = asInt(0) CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) return toInt(size) def getSize(self): cdef PetscInt size = asInt(0) CHKERR( DMSwarmGetSize(self.dm, &size) ) return toInt(size) def migrate(self, remove_sent_points=False): cdef PetscBool remove_pts = asBool(remove_sent_points) CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) def collectViewCreate(self): CHKERR( DMSwarmCollectViewCreate(self.dm) ) def collectViewDestroy(self): CHKERR( DMSwarmCollectViewDestroy(self.dm) ) def setCellDM(self, DM dm): CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) def getCellDM(self): cdef PetscDM newdm = NULL CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm PetscINCREF(dm.obj) return dm def setType(self, dmswarm_type): cdef PetscDMSwarmType cval = dmswarm_type CHKERR( DMSwarmSetType(self.dm, cval) ) def setPointsUniformCoordinates(self, min, max, npoints, mode=None): cdef PetscInt dim = asInt(0) CHKERR( DMGetDimension(self.dm, &dim) ) cdef PetscReal cmin[3] cmin[0] = cmin[1] = cmin[2] = asReal(0.) for i from 0 <= i < dim: cmin[i] = min[i] cdef PetscReal cmax[3] cmax[0] = cmax[1] = cmax[2] = asReal(0.) for i from 0 <= i < dim: cmax[i] = max[i] cdef PetscInt cnpoints[3] cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) for i from 0 <= i < dim: cnpoints[i] = npoints[i] cdef PetscInsertMode cmode = insertmode(mode) CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) return self def setPointCoordinates(self, coordinates, redundant=False, mode=None): cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) if PyArray_NDIM(xyz) != 2: raise ValueError( ("coordinates must have two dimensions: " "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) cdef PetscBool credundant = asBool(redundant) cdef PetscInsertMode cmode = insertmode(mode) cdef PetscReal *coords = PyArray_DATA(xyz) CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) def insertPointUsingCellDM(self, layoutType, fill_param): cdef PetscDMSwarmPICLayoutType clayoutType = layoutType cdef PetscInt cfill_param = asInt(fill_param) CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) def setPointCoordinatesCellwise(self, coordinates): cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) if PyArray_NDIM(xyz) != 2: raise ValueError( ("coordinates must have two dimensions: " "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) cdef PetscReal *coords = PyArray_DATA(xyz) CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) def viewFieldsXDMF(self, filename, fieldnames): cdef const char *cval = NULL cdef const char *cfilename = NULL filename = str2bytes(filename, &cfilename) cdef PetscInt cnfields = len(fieldnames) cdef const char** cfieldnames = NULL cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) fieldnames = list(fieldnames) for i from 0 <= i < cnfields: fieldnames[i] = str2bytes(fieldnames[i], &cval) cfieldnames[i] = cval CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) def viewXDMF(self, filename): cdef const char *cval = NULL filename = str2bytes(filename, &cval) CHKERR( DMSwarmViewXDMF(self.dm, cval) ) def sortGetAccess(self): CHKERR( DMSwarmSortGetAccess(self.dm) ) def sortRestoreAccess(self): CHKERR( DMSwarmSortRestoreAccess(self.dm) ) def sortGetPointsPerCell(self, e): cdef PetscInt ce = asInt(e) cdef PetscInt cnpoints = asInt(0) cdef PetscInt *cpidlist = NULL cdef list pidlist = [] CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) npoints = asInt(cnpoints) for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) return pidlist def sortGetNumberOfPointsPerCell(self, e): cdef PetscInt ce = asInt(e) cdef PetscInt npoints = asInt(0) CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) return toInt(npoints) def sortGetIsValid(self): cdef PetscBool isValid = asBool(False) CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) return toBool(isValid) def sortGetSizes(self): cdef PetscInt ncells = asInt(0) cdef PetscInt npoints = asInt(0) CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) return (toInt(ncells), toInt(npoints)) def projectFields(self, fieldnames, reuse=False): cdef PetscBool creuse = asBool(reuse) cdef const char *cval = NULL cdef PetscInt cnfields = len(fieldnames) cdef const char** cfieldnames = NULL cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) cdef PetscVec *cfieldvecs fieldnames = list(fieldnames) for i from 0 <= i < cnfields: fieldnames[i] = str2bytes(fieldnames[i], &cval) cfieldnames[i] = cval CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, &cfieldvecs, creuse) ) cdef list fieldvecs = [] for i from 0 <= i < cnfields: newVec = Vec() newVec.vec = cfieldvecs[i] fieldvecs.append(newVec) return fieldvecs del DMSwarmType del DMSwarmMigrateType del DMSwarmCollectType del DMSwarmPICLayoutType petsc4py-3.15.1/src/PETSc/Log.pyx0000644000175000017500000002360714030740317016555 0ustar balaybalay00000000000000# -------------------------------------------------------------------- import functools cdef class Log: @classmethod def Stage(cls, name): if not name: raise ValueError("empty name") cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscLogStage stageid = -1 cdef LogStage stage = get_LogStage(name) if stage is not None: return stage CHKERR( PetscLogStageFindId(cname, &stageid) ) if stageid == -1: CHKERR( PetscLogStageRegister(cname, &stageid) ) stage = reg_LogStage(name, stageid) return stage @classmethod def Class(cls, name): if not name: raise ValueError("empty name") cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscLogClass classid = -1 cdef LogClass klass = get_LogClass(name) if klass is not None: return klass CHKERR( PetscLogClassFindId(cname, &classid) ) if classid == -1: CHKERR( PetscLogClassRegister(cname, &classid) ) klass = reg_LogClass(name, classid) return klass @classmethod def Event(cls, name, klass=None): if not name: raise ValueError("empty name") cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscLogClass classid = PETSC_OBJECT_CLASSID cdef PetscLogEvent eventid = -1 if klass is not None: classid = klass cdef LogEvent event = get_LogEvent(name) if event is not None: return event CHKERR( PetscLogEventFindId(cname, &eventid) ) if eventid == -1: CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) event = reg_LogEvent(name, eventid) return event @classmethod def begin(cls, all=False): if all: CHKERR( PetscLogAllBegin() ) else: CHKERR( PetscLogDefaultBegin() ) @classmethod def view(cls, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD CHKERR( PetscLogView(vwr) ) @classmethod def logFlops(cls, flops): cdef PetscLogDouble cflops=flops CHKERR( PetscLogFlops(cflops) ) @classmethod def addFlops(cls, flops): cdef PetscLogDouble cflops=flops CHKERR( PetscLogFlops(cflops) ) @classmethod def getFlops(cls): cdef PetscLogDouble cflops=0 CHKERR( PetscGetFlops(&cflops) ) return cflops @classmethod def getTime(cls): cdef PetscLogDouble wctime=0 CHKERR( PetscTime(&wctime) ) return wctime @classmethod def getCPUTime(cls): cdef PetscLogDouble cputime=0 CHKERR( PetscGetCPUTime(&cputime) ) return cputime @classmethod def EventDecorator(cls, name=None, klass=None): """Decorate a function with a PETSc event. If no event name is specified it will default to the name of the function. Usage: @EventDecorator("My Function") def myfunc(): ... or @EventDecorator() def myfunc(): ... """ def decorator(func): @functools.wraps(func) def wrapped_func(*args, **kwargs): if name: name_ = name else: name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) with cls.Event(name_, klass): return func(*args, **kwargs) return wrapped_func return decorator # -------------------------------------------------------------------- cdef class LogStage: cdef readonly PetscLogStage id def __cinit__(self): self.id = 0 def __int__(self): return self.id def __enter__(self): self.push() return self def __exit__(self, *exc): self.pop() # def push(self): CHKERR( PetscLogStagePush(self.id) ) def pop(self): self # unused CHKERR( PetscLogStagePop() ) # def getName(self): cdef const char *cval = NULL CHKERR( PetscLogStageFindName(self.id, &cval) ) return bytes2str(cval) property name: def __get__(self): return self.getName() def __set__(self, value): self; value; # unused raise TypeError("readonly attribute") # def activate(self): CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) def deactivate(self): CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) def getActive(self): cdef PetscBool flag = PETSC_FALSE CHKERR( PetscLogStageGetActive(self.id, &flag) ) return toBool(flag) def setActive(self, flag): cdef PetscBool tval = PETSC_FALSE if flag: tval = PETSC_TRUE CHKERR( PetscLogStageSetActive(self.id, tval) ) property active: def __get__(self): return self.getActive() def __set__(self, value): self.setActive(value) # def getVisible(self): cdef PetscBool flag = PETSC_FALSE CHKERR( PetscLogStageGetVisible(self.id, &flag) ) return toBool(flag) def setVisible(self, flag): cdef PetscBool tval = PETSC_FALSE if flag: tval = PETSC_TRUE CHKERR( PetscLogStageSetVisible(self.id, tval) ) property visible: def __get__(self): return self.getVisible() def __set__(self, value): self.setVisible(value) cdef dict stage_registry = { } cdef LogStage get_LogStage(object name): return stage_registry.get(name) cdef LogStage reg_LogStage(object name, PetscLogStage stageid): cdef LogStage stage = LogStage() stage.id = stageid stage_registry[name] = stage return stage # -------------------------------------------------------------------- cdef class LogClass: cdef readonly PetscLogClass id def __cinit__(self): self.id = PETSC_OBJECT_CLASSID def __int__(self): return self.id # def getName(self): cdef const char *cval = NULL CHKERR( PetscLogClassFindName(self.id, &cval) ) return bytes2str(cval) property name: def __get__(self): return self.getName() def __set__(self, value): self; value; # unused raise TypeError("readonly attribute") # def activate(self): CHKERR( PetscLogClassActivate(self.id) ) def deactivate(self): CHKERR( PetscLogClassDeactivate(self.id) ) def getActive(self): self # unused raise NotImplementedError def setActive(self, flag): if flag: CHKERR( PetscLogClassActivate(self.id) ) else: CHKERR( PetscLogClassDeactivate(self.id) ) property active: def __get__(self): return self.getActive() def __set__(self, value): self.setActive(value) cdef dict class_registry = { } cdef LogClass get_LogClass(object name): return class_registry.get(name) cdef LogClass reg_LogClass(object name, PetscLogClass classid): cdef LogClass klass = LogClass() klass.id = classid class_registry[name] = klass return klass # -------------------------------------------------------------------- cdef class LogEvent: cdef readonly PetscLogEvent id def __cinit__(self): self.id = 0 def __int__(self): return self.id def __enter__(self): self.begin() return self def __exit__(self, *exc): self.end() # def begin(self, *objs): cdef PetscObject o[4] event_args2objs(objs, o) CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) def end(self, *objs): cdef PetscObject o[4] event_args2objs(objs, o) CHKERR( PetscLogEventEnd(self.id, o[0], o[1], o[2], o[3]) ) # def getName(self): cdef const char *cval = NULL CHKERR( PetscLogEventFindName(self.id, &cval) ) return bytes2str(cval) property name: def __get__(self): return self.getName() def __set__(self, value): self; value; # unused raise TypeError("readonly attribute") # def activate(self): CHKERR( PetscLogEventActivate(self.id) ) def deactivate(self): CHKERR( PetscLogEventDeactivate(self.id) ) def getActive(self): self # unused raise NotImplementedError def setActive(self, flag): if flag: CHKERR( PetscLogEventActivate(self.id) ) else: CHKERR( PetscLogEventDeactivate(self.id) ) property active: def __get__(self): return self.getActive() def __set__(self, value): self.setActive(value) def getActiveAll(self): self # unused raise NotImplementedError def setActiveAll(self, flag): cdef PetscBool tval = PETSC_FALSE if flag: tval = PETSC_TRUE CHKERR( PetscLogEventSetActiveAll(self.id, tval) ) property active_all: def __get__(self): self.getActiveAll() def __set__(self, value): self.setActiveAll(value) # def getPerfInfo(self, stage=None): cdef PetscEventPerfInfo info cdef PetscInt cstage = PETSC_DETERMINE if stage is not None: cstage = asInt(stage) CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) return info cdef dict event_registry = { } cdef LogEvent get_LogEvent(object name): return event_registry.get(name) cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): cdef LogEvent event = LogEvent() event.id = eventid event_registry[name] = event return event # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscdef.pxi0000644000175000017500000000473114030740317017606 0ustar balaybalay00000000000000cdef extern from * nogil: enum: PETSC_DECIDE enum: PETSC_DEFAULT enum: PETSC_DETERMINE PetscReal PETSC_INFINITY PetscReal PETSC_NINFINITY ctypedef enum PetscBool: PETSC_FALSE PETSC_TRUE ctypedef enum PetscInsertMode "InsertMode": PETSC_NOT_SET_VALUES "NOT_SET_VALUES" PETSC_INSERT_VALUES "INSERT_VALUES" PETSC_ADD_VALUES "ADD_VALUES" PETSC_MAX_VALUES "MAX_VALUES" PETSC_INSERT_ALL_VALUES "INSERT_ALL_VALUES" PETSC_ADD_ALL_VALUES "ADD_ALL_VALUES" PETSC_INSERT_BC_VALUES "INSERT_BC_VALUES" PETSC_ADD_BC_VALUES "ADD_BC_VALUES" ctypedef enum PetscScatterMode "ScatterMode": PETSC_SCATTER_FORWARD "SCATTER_FORWARD" PETSC_SCATTER_REVERSE "SCATTER_REVERSE" PETSC_SCATTER_FORWARD_LOCAL "SCATTER_FORWARD_LOCAL" PETSC_SCATTER_REVERSE_LOCAL "SCATTER_REVERSE_LOCAL" PETSC_SCATTER_LOCAL "SCATTER_LOCAL" ctypedef enum PetscNormType "NormType": PETSC_NORM_1 "NORM_1" PETSC_NORM_2 "NORM_2" PETSC_NORM_1_AND_2 "NORM_1_AND_2" PETSC_NORM_FROBENIUS "NORM_FROBENIUS" PETSC_NORM_INFINITY "NORM_INFINITY" PETSC_NORM_MAX "NORM_MAX" ctypedef enum PetscCopyMode: PETSC_COPY_VALUES PETSC_OWN_POINTER PETSC_USE_POINTER ctypedef enum PetscOffloadMask: PETSC_OFFLOAD_UNALLOCATED PETSC_OFFLOAD_CPU PETSC_OFFLOAD_GPU PETSC_OFFLOAD_BOTH PETSC_OFFLOAD_VECKOKKOS cdef extern from * nogil: enum: PETSC_ERR_MEM enum: PETSC_ERR_SUP enum: PETSC_ERR_ORDER enum: PETSC_ERR_LIB enum: PETSC_ERR_USER enum: PETSC_ERR_SYS cdef inline PetscInsertMode insertmode(object mode) \ except (-1): if mode is None: return PETSC_INSERT_VALUES elif mode is True: return PETSC_ADD_VALUES elif mode is False: return PETSC_INSERT_VALUES else: return mode cdef inline PetscScatterMode scattermode(object mode) \ except (-1): if mode is None: return PETSC_SCATTER_FORWARD if mode is False: return PETSC_SCATTER_FORWARD if mode is True: return PETSC_SCATTER_REVERSE if isinstance(mode, str): if mode == 'forward': return PETSC_SCATTER_FORWARD if mode == 'reverse': return PETSC_SCATTER_REVERSE else: raise ValueError("unknown scatter mode: %s" % mode) return mode petsc4py-3.15.1/src/PETSc/FE.pyx0000644000175000017500000000430413750315427016327 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class FEType(object): BASIC = S_(PETSCFEBASIC) OPENCL = S_(PETSCFEOPENCL) COMPOSITE = S_(PETSCFECOMPOSITE) # -------------------------------------------------------------------- cdef class FE(Object): Type = FEType def __cinit__(self): self.obj = &self.fe self.fe = NULL def destroy(self): CHKERR( PetscFEDestroy(&self.fe) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscFE newfe = NULL CHKERR( PetscFECreate(ccomm, &newfe) ) PetscCLEAR(self.obj); self.fe = newfe return self def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscFE newfe = NULL cdef PetscInt cdim = asInt(dim) cdef PetscInt cnc = asInt(nc) cdef PetscInt cqorder = asInt(qorder) cdef PetscBool cisSimplex = asBool(isSimplex) cdef const char *cprefix = NULL if prefix: prefix = str2bytes(prefix, &cprefix) CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) PetscCLEAR(self.obj); self.fe = newfe return self def getQuadrature(self): cdef Quad quad = Quad() CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) return quad def getFaceQuadrature(self): cdef Quad quad = Quad() CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) return quad def setQuadrature(self, Quad quad): CHKERR( PetscFESetQuadrature(self.fe, quad.quad) ) return self def setFaceQuadrature(self, Quad quad): CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) ) return self def setType(self, fe_type): cdef PetscFEType cval = NULL fe_type = str2bytes(fe_type, &cval) CHKERR( PetscFESetType(self.fe, cval) ) return self # -------------------------------------------------------------------- del FEType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/DMDA.pyx0000644000175000017500000004414013750315427016544 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class DMDAStencilType(object): STAR = DMDA_STENCIL_STAR BOX = DMDA_STENCIL_BOX class DMDAInterpolationType(object): Q0 = DMDA_INTERPOLATION_Q0 Q1 = DMDA_INTERPOLATION_Q1 class DMDAElementType(object): P1 = DMDA_ELEMENT_P1 Q1 = DMDA_ELEMENT_Q1 # -------------------------------------------------------------------- cdef class DMDA(DM): StencilType = DMDAStencilType InterpolationType = DMDAInterpolationType ElementType = DMDAElementType # def create(self, dim=None, dof=None, sizes=None, proc_sizes=None, boundary_type=None, stencil_type=None, stencil_width=None, bint setup=True, ownership_ranges=None, comm=None): # cdef object arg = None try: arg = tuple(dim) except TypeError: pass else: dim, sizes = None, arg # cdef PetscInt ndim = PETSC_DECIDE cdef PetscInt ndof = PETSC_DECIDE cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX cdef PetscInt swidth = PETSC_DECIDE # grid and proc sizes cdef object gsizes = sizes cdef object psizes = proc_sizes cdef PetscInt gdim = PETSC_DECIDE cdef PetscInt pdim = PETSC_DECIDE if sizes is not None: gdim = asDims(gsizes, &M, &N, &P) if psizes is not None: pdim = asDims(psizes, &m, &n, &p) if gdim>=0 and pdim>=0: assert gdim == pdim # dim and dof if dim is not None: ndim = asInt(dim) if dof is not None: ndof = asInt(dof) if ndim==PETSC_DECIDE: ndim = gdim if ndof==PETSC_DECIDE: ndof = 1 # vertex distribution if ownership_ranges is not None: ownership_ranges = asOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) # periodicity, stencil type & width if boundary_type is not None: asBoundary(boundary_type, &btx, &bty, &btz) if stencil_type is not None: stype = asStencil(stencil_type) if stencil_width is not None: swidth = asInt(stencil_width) if setup and swidth == PETSC_DECIDE: swidth = 0 # create the DMDA object cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDM newda = NULL CHKERR( DMDACreateND(ccomm, ndim, ndof, M, N, P, m, n, p, lx, ly, lz, btx, bty, btz, stype, swidth, &newda) ) if setup and ndim > 0: CHKERR( DMSetUp(newda) ) PetscCLEAR(self.obj); self.dm = newda return self def duplicate(self, dof=None, boundary_type=None, stencil_type=None, stencil_width=None): cdef PetscInt ndim = 0, ndof = 0 cdef PetscInt M = 1, N = 1, P = 1 cdef PetscInt m = 1, n = 1, p = 1 cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX cdef PetscInt swidth = PETSC_DECIDE CHKERR( DMDAGetInfo(self.dm, &ndim, &M, &N, &P, &m, &n, &p, &ndof, &swidth, &btx, &bty, &btz, &stype) ) cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) cdef MPI_Comm comm = MPI_COMM_NULL CHKERR( PetscObjectGetComm(self.dm, &comm) ) # if dof is not None: ndof = asInt(dof) if boundary_type is not None: asBoundary(boundary_type, &btx, &bty, &btz) if stencil_type is not None: stype = asStencil(stencil_type) if stencil_width is not None: swidth = asInt(stencil_width) # cdef DMDA da = DMDA() CHKERR( DMDACreateND(comm, ndim, ndof, M, N, P, m, n, p, lx, ly, lz, btx, bty, btz, stype, swidth, &da.dm) ) CHKERR( DMSetUp(da.dm) ) return da # def setDim(self, dim): return self.setDimension(dim) def getDim(self): return self.getDimension() def setDof(self, dof): cdef PetscInt ndof = asInt(dof) CHKERR( DMDASetDof(self.dm, ndof) ) def getDof(self): cdef PetscInt dof = 0 CHKERR( DMDAGetInfo(self.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dof, NULL, NULL, NULL, NULL, NULL) ) return toInt(dof) def setSizes(self, sizes): cdef tuple gsizes = tuple(sizes) cdef PetscInt gdim = PETSC_DECIDE cdef PetscInt M = 1 cdef PetscInt N = 1 cdef PetscInt P = 1 gdim = asDims(gsizes, &M, &N, &P) cdef PetscInt dim = PETSC_DECIDE CHKERR( DMDAGetDim(self.dm, &dim) ) if dim == PETSC_DECIDE: CHKERR( DMSetDimension(self.dm, gdim) ) CHKERR( DMDASetSizes(self.dm, M, N, P) ) def getSizes(self): cdef PetscInt dim = 0 cdef PetscInt M = PETSC_DECIDE cdef PetscInt N = PETSC_DECIDE cdef PetscInt P = PETSC_DECIDE CHKERR( DMDAGetInfo(self.dm, &dim, &M, &N, &P, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) ) return toDims(dim, M, N, P) def setProcSizes(self, proc_sizes): cdef tuple psizes = tuple(proc_sizes) cdef PetscInt pdim = PETSC_DECIDE cdef PetscInt m = PETSC_DECIDE cdef PetscInt n = PETSC_DECIDE cdef PetscInt p = PETSC_DECIDE pdim = asDims(psizes, &m, &n, &p) cdef PetscInt dim = PETSC_DECIDE CHKERR( DMDAGetDim(self.dm, &dim) ) if dim == PETSC_DECIDE: CHKERR( DMSetDimension(self.dm, pdim) ) CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) def getProcSizes(self): cdef PetscInt dim = 0 cdef PetscInt m = PETSC_DECIDE cdef PetscInt n = PETSC_DECIDE cdef PetscInt p = PETSC_DECIDE CHKERR( DMDAGetInfo(self.dm, &dim, NULL, NULL, NULL, &m, &n, &p, NULL, NULL, NULL, NULL, NULL, NULL) ) return toDims(dim, m, n, p) def setBoundaryType(self, boundary_type): cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE asBoundary(boundary_type, &btx, &bty, &btz) CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) def getBoundaryType(self): cdef PetscInt dim = 0 cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE CHKERR( DMDAGetInfo(self.dm, &dim, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &btx, &bty, &btz, NULL) ) return toDims(dim, btx, bty, btz) def setStencilType(self, stencil_type): cdef PetscDMDAStencilType stype = asStencil(stencil_type) CHKERR( DMDASetStencilType(self.dm, stype) ) def getStencilType(self): cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX CHKERR( DMDAGetInfo(self.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &stype) ) return stype def setStencilWidth(self, stencil_width): cdef PetscInt swidth = asInt(stencil_width) CHKERR( DMDASetStencilWidth(self.dm, swidth) ) def getStencilWidth(self): cdef PetscInt swidth = 0 CHKERR( DMDAGetInfo(self.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &swidth, NULL, NULL, NULL, NULL) ) return toInt(swidth) def setStencil(self, stencil_type, stencil_width): cdef PetscDMDAStencilType stype = asStencil(stencil_type) cdef PetscInt swidth = asInt(stencil_width) CHKERR( DMDASetStencilType(self.dm, stype) ) CHKERR( DMDASetStencilWidth(self.dm, swidth) ) def getStencil(self): cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX cdef PetscInt swidth = 0 CHKERR( DMDAGetInfo(self.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &swidth, NULL, NULL, NULL, &stype) ) return (toStencil(stype), toInt(swidth)) # def getRanges(self): cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 CHKERR( DMDAGetDim(self.dm, &dim) ) CHKERR( DMDAGetCorners(self.dm, &x, &y, &z, &m, &n, &p) ) return ((toInt(x), toInt(x+m)), (toInt(y), toInt(y+n)), (toInt(z), toInt(z+p)))[:dim] def getGhostRanges(self): cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 CHKERR( DMDAGetDim(self.dm, &dim) ) CHKERR( DMDAGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) return ((toInt(x), toInt(x+m)), (toInt(y), toInt(y+n)), (toInt(z), toInt(z+p)))[:dim] def getOwnershipRanges(self): cdef PetscInt dim=0, m=0, n=0, p=0 cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL CHKERR( DMDAGetInfo(self.dm, &dim, NULL, NULL, NULL, &m, &n, &p, NULL, NULL, NULL, NULL, NULL, NULL) ) CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) return toOwnershipRanges(dim, m, n, p, lx, ly, lz) def getCorners(self): cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 CHKERR( DMDAGetDim(self.dm, &dim) ) CHKERR( DMDAGetCorners(self.dm, &x, &y, &z, &m, &n, &p) ) return ((toInt(x), toInt(y), toInt(z))[:dim], (toInt(m), toInt(n), toInt(p))[:dim]) def getGhostCorners(self): cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 CHKERR( DMDAGetDim(self.dm, &dim) ) CHKERR( DMDAGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) return ((toInt(x), toInt(y), toInt(z))[:dim], (toInt(m), toInt(n), toInt(p))[:dim]) # def setFieldName(self, field, name): cdef PetscInt ival = asInt(field) cdef const char *cval = NULL name = str2bytes(name, &cval) CHKERR( DMDASetFieldName(self.dm, ival, cval) ) def getFieldName(self, field): cdef PetscInt ival = asInt(field) cdef const char *cval = NULL CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) return bytes2str(cval) # def getVecArray(self, Vec vec): return _DMDA_Vec_array(self, vec) # def setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) CHKERR( DMDASetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) def setCoordinateName(self, index, name): cdef PetscInt ival = asInt(index) cdef const char *cval = NULL name = str2bytes(name, &cval) CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) def getCoordinateName(self, index): cdef PetscInt ival = asInt(index) cdef const char *cval = NULL CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) return bytes2str(cval) # def createNaturalVec(self): cdef Vec vn = Vec() CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) return vn def globalToNatural(self, Vec vg, Vec vn, addv=None): cdef PetscInsertMode im = insertmode(addv) CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) def naturalToGlobal(self, Vec vn, Vec vg, addv=None): cdef PetscInsertMode im = insertmode(addv) CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) CHKERR( DMDANaturalToGlobalEnd (self.dm, vn.vec, im, vg.vec) ) # def getAO(self): cdef AO ao = AO() CHKERR( DMDAGetAO(self.dm, &ao.ao) ) PetscINCREF(ao.obj) return ao def getScatter(self): cdef Scatter l2g = Scatter() cdef Scatter g2l = Scatter() CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) PetscINCREF(l2g.obj) PetscINCREF(g2l.obj) return (l2g, g2l) # def setRefinementFactor(self, refine_x=2, refine_y=2, refine_z=2): cdef PetscInt refine[3] refine[0] = asInt(refine_x) refine[1] = asInt(refine_y) refine[2] = asInt(refine_z) CHKERR( DMDASetRefinementFactor(self.dm, refine[0], refine[1], refine[2]) ) def getRefinementFactor(self): cdef PetscInt i, dim = 0, refine[3] CHKERR( DMDAGetDim(self.dm, &dim) ) CHKERR( DMDAGetRefinementFactor(self.dm, &refine[0], &refine[1], &refine[2]) ) return tuple([toInt(refine[i]) for 0 <= i < dim]) def setInterpolationType(self, interp_type): cdef PetscDMDAInterpolationType ival = dainterpolationtype(interp_type) CHKERR( DMDASetInterpolationType(self.dm, ival) ) def getInterpolationType(self): cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) return ival # def setElementType(self, elem_type): cdef PetscDMDAElementType ival = daelementtype(elem_type) CHKERR( DMDASetElementType(self.dm, ival) ) def getElementType(self): cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 CHKERR( DMDAGetElementType(self.dm, &ival) ) return ival def getElements(self, elem_type=None): cdef PetscInt dim=0 cdef PetscDMDAElementType etype cdef PetscInt nel=0, nen=0 cdef const PetscInt *elems=NULL cdef object elements CHKERR( DMDAGetDim(self.dm, &dim) ) if elem_type is not None: etype = daelementtype(elem_type) CHKERR( DMDASetElementType(self.dm, etype) ) try: CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) elements = array_i(nel*nen, elems) elements.shape = (toInt(nel), toInt(nen)) finally: CHKERR( DMDARestoreElements(self.dm, &nel, &nen, &elems) ) return elements # property dim: def __get__(self): return self.getDim() property dof: def __get__(self): return self.getDof() property sizes: def __get__(self): return self.getSizes() property proc_sizes: def __get__(self): return self.getProcSizes() property boundary_type: def __get__(self): return self.getBoundaryType() property stencil: def __get__(self): return self.getStencil() property stencil_type: def __get__(self): return self.getStencilType() property stencil_width: def __get__(self): return self.getStencilWidth() property ranges: def __get__(self): return self.getRanges() property ghost_ranges: def __get__(self): return self.getGhostRanges() property corners: def __get__(self): return self.getCorners() property ghost_corners: def __get__(self): return self.getGhostCorners() # backward compatibility createNaturalVector = createNaturalVec # backward compatibility alias DA = DMDA # -------------------------------------------------------------------- del DMDAStencilType del DMDAInterpolationType del DMDAElementType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscfe.pxi0000644000175000017500000000126413750315427017450 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef const char* PetscFEType PetscFEType PETSCFEBASIC PetscFEType PETSCFEOPENCL PetscFEType PETSCFECOMPOSITE int PetscFECreate(MPI_Comm, PetscFE*) int PetscFECreateDefault(MPI_Comm, PetscInt, PetscInt, PetscBool, const char [], PetscInt, PetscFE*) int PetscFESetType(PetscFE, PetscFEType) int PetscFEGetQuadrature(PetscFE, PetscQuadrature*) int PetscFEGetFaceQuadrature(PetscFE, PetscQuadrature*) int PetscFESetQuadrature(PetscFE, PetscQuadrature) int PetscFESetFaceQuadrature(PetscFE, PetscQuadrature) int PetscFEDestroy(PetscFE*) petsc4py-3.15.1/src/PETSc/petscdmswarm.pxi0000644000175000017500000000606113750315427020530 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum PetscDMSwarmType "DMSwarmType": DMSWARM_BASIC DMSWARM_PIC ctypedef enum PetscDMSwarmMigrateType "DMSwarmMigrateType": DMSWARM_MIGRATE_BASIC DMSWARM_MIGRATE_DMCELLNSCATTER DMSWARM_MIGRATE_DMCELLEXACT DMSWARM_MIGRATE_USER ctypedef enum PetscDMSwarmCollectType "DMSwarmCollectType": DMSWARM_COLLECT_BASIC DMSWARM_COLLECT_DMDABOUNDINGBOX DMSWARM_COLLECT_GENERAL DMSWARM_COLLECT_USER ctypedef enum PetscDMSwarmPICLayoutType 'DMSwarmPICLayoutType': DMSWARMPIC_LAYOUT_REGULAR DMSWARMPIC_LAYOUT_GAUSS DMSWARMPIC_LAYOUT_SUBDIVISION int DMSwarmCreateGlobalVectorFromField(PetscDM,const char[],PetscVec*) int DMSwarmDestroyGlobalVectorFromField(PetscDM,const char[],PetscVec*) int DMSwarmCreateLocalVectorFromField(PetscDM,const char[],PetscVec*) int DMSwarmDestroyLocalVectorFromField(PetscDM,const char[],PetscVec*) int DMSwarmInitializeFieldRegister(PetscDM) int DMSwarmFinalizeFieldRegister(PetscDM) int DMSwarmSetLocalSizes(PetscDM,PetscInt,PetscInt) int DMSwarmRegisterPetscDatatypeField(PetscDM,const char[],PetscInt,PetscDataType) # int DMSwarmRegisterUserStructField(PetscDM,const char[],size_t) # int DMSwarmRegisterUserDatatypeField(PetscDM,const char[],size_t,PetscInt) int DMSwarmGetField(PetscDM,const char[],PetscInt*,PetscDataType*,void**) int DMSwarmRestoreField(PetscDM,const char[],PetscInt*,PetscDataType*,void**) int DMSwarmVectorDefineField(PetscDM,const char[]) int DMSwarmAddPoint(PetscDM) int DMSwarmAddNPoints(PetscDM,PetscInt) int DMSwarmRemovePoint(PetscDM) int DMSwarmRemovePointAtIndex(PetscDM,PetscInt) int DMSwarmCopyPoint(PetscDM,PetscInt,PetscInt) int DMSwarmGetLocalSize(PetscDM,PetscInt*) int DMSwarmGetSize(PetscDM,PetscInt*) int DMSwarmMigrate(PetscDM,PetscBool) int DMSwarmCollectViewCreate(PetscDM) int DMSwarmCollectViewDestroy(PetscDM) int DMSwarmSetCellDM(PetscDM,PetscDM) int DMSwarmGetCellDM(PetscDM,PetscDM*) int DMSwarmSetType(PetscDM, PetscDMSwarmType) int DMSwarmSetPointsUniformCoordinates(PetscDM,PetscReal[],PetscReal[],PetscInt[],PetscInsertMode) int DMSwarmSetPointCoordinates(PetscDM,PetscInt,PetscReal*,PetscBool,PetscInsertMode) int DMSwarmInsertPointsUsingCellDM(PetscDM,PetscDMSwarmPICLayoutType,PetscInt) int DMSwarmSetPointCoordinatesCellwise(PetscDM,PetscInt,PetscReal*) int DMSwarmViewFieldsXDMF(PetscDM,const char*,PetscInt,const char**) int DMSwarmViewXDMF(PetscDM,const char*) int DMSwarmSortGetAccess(PetscDM) int DMSwarmSortRestoreAccess(PetscDM) int DMSwarmSortGetPointsPerCell(PetscDM,PetscInt,PetscInt*,PetscInt**) int DMSwarmSortGetNumberOfPointsPerCell(PetscDM,PetscInt,PetscInt*) int DMSwarmSortGetIsValid(PetscDM,PetscBool*) int DMSwarmSortGetSizes(PetscDM,PetscInt*,PetscInt*) int DMSwarmProjectFields(PetscDM,PetscInt,const char**,PetscVec**,PetscBool) petsc4py-3.15.1/src/PETSc/Comm.pyx0000644000175000017500000000737213750315427016740 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class Comm: # def __cinit__(self, comm=None): self.comm = def_Comm(comm, MPI_COMM_NULL) self.isdup = 0 if self.comm != MPI_COMM_NULL: self.base = comm else: self.base = None def __dealloc__(self): if self.isdup: CHKERR( PetscCommDEALLOC(&self.comm) ) self.comm = MPI_COMM_NULL self.isdup = 0 self.base = None def __richcmp__(self, other, int op): if not isinstance(self, Comm): return NotImplemented if not isinstance(other, Comm): return NotImplemented if op!=2 and op!=3: raise TypeError("only '==' and '!='") cdef Comm s = self cdef Comm o = other cdef int eq = (op == 2) cdef MPI_Comm comm1 = s.comm cdef MPI_Comm comm2 = o.comm cdef int flag = 0 if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) else: if eq: return (comm1 == comm2) else: return (comm1 != comm2) def __nonzero__(self): return self.comm != MPI_COMM_NULL # def destroy(self): if self.comm == MPI_COMM_NULL: return if not self.isdup: raise ValueError("communicator not owned") CHKERR( PetscCommDestroy(&self.comm) ) self.comm = MPI_COMM_NULL self.isdup = 0 self.base = None def duplicate(self): if self.comm == MPI_COMM_NULL: raise ValueError("null communicator") cdef MPI_Comm newcomm = MPI_COMM_NULL CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) cdef Comm comm = type(self)() comm.comm = newcomm comm.isdup = 1 comm.base = self.base return comm def getSize(self): if self.comm == MPI_COMM_NULL: raise ValueError("null communicator") cdef int size=0 MPI_Comm_size(self.comm, &size) return size def getRank(self): if self.comm == MPI_COMM_NULL: raise ValueError("null communicator") cdef int rank=0 MPI_Comm_rank(self.comm, &rank) return rank def barrier(self): if self.comm == MPI_COMM_NULL: raise ValueError("null communicator") MPI_Barrier(self.comm) # --- properties --- property size: def __get__(self): return self.getSize() property rank: def __get__(self): return self.getRank() # --- Fortran support --- property fortran: def __get__(self): cdef MPI_Comm comm = self.comm return MPI_Comm_c2f(comm) # --- mpi4py support --- def tompi4py(self): cdef MPI_Comm comm = self.comm return mpi4py_Comm_New(comm) # --- mpi4py compatibility API --- Free = destroy Clone = duplicate Dup = duplicate Get_size = getSize Get_rank = getRank Barrier = barrier # -------------------------------------------------------------------- cdef Comm __COMM_NULL__ = Comm() cdef Comm __COMM_SELF__ = Comm() cdef Comm __COMM_WORLD__ = Comm() COMM_NULL = __COMM_NULL__ COMM_SELF = __COMM_SELF__ COMM_WORLD = __COMM_WORLD__ # -------------------------------------------------------------------- cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *: return def_Comm(comm, defv) cdef MPI_Comm GetCommDefault(): return PETSC_COMM_DEFAULT # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscdmshell.pxi0000644000175000017500000004265713750315427020521 0ustar balaybalay00000000000000ctypedef int (*PetscDMShellXToYFunction)(PetscDM, PetscVec, PetscInsertMode, PetscVec) except PETSC_ERR_PYTHON cdef extern from * nogil: ctypedef int (*PetscDMShellCreateVectorFunction)(PetscDM, PetscVec*) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateMatrixFunction)(PetscDM, PetscMat*) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellTransferFunction)(PetscDM, MPI_Comm, PetscDM*) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateInterpolationFunction)(PetscDM, PetscDM, PetscMat*, PetscVec*) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateInjectionFunction)(PetscDM, PetscDM, PetscMat*) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateRestrictionFunction)(PetscDM, PetscDM, PetscMat*) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateFieldDecompositionFunction)(PetscDM, PetscInt*, char***, PetscIS**, PetscDM**) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateDomainDecompositionFunction)(PetscDM, PetscInt*, char***, PetscIS**, PetscIS**, PetscDM**) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateDomainDecompositionScattersFunction)(PetscDM, PetscInt, PetscDM*, PetscScatter**, PetscScatter**, PetscScatter**) except PETSC_ERR_PYTHON ctypedef int (*PetscDMShellCreateSubDM)(PetscDM, PetscInt, PetscInt[], PetscIS*, PetscDM*) except PETSC_ERR_PYTHON int DMShellCreate(MPI_Comm,PetscDM*) int DMShellSetMatrix(PetscDM,PetscMat) int DMShellSetGlobalVector(PetscDM,PetscVec) int DMShellSetLocalVector(PetscDM,PetscVec) int DMShellSetCreateGlobalVector(PetscDM,PetscDMShellCreateVectorFunction) int DMShellSetCreateLocalVector(PetscDM,PetscDMShellCreateVectorFunction) int DMShellSetGlobalToLocal(PetscDM,PetscDMShellXToYFunction,PetscDMShellXToYFunction) int DMShellSetGlobalToLocalVecScatter(PetscDM,PetscScatter) int DMShellSetLocalToGlobal(PetscDM,PetscDMShellXToYFunction,PetscDMShellXToYFunction) int DMShellSetLocalToGlobalVecScatter(PetscDM,PetscScatter) int DMShellSetLocalToLocal(PetscDM,PetscDMShellXToYFunction,PetscDMShellXToYFunction) int DMShellSetLocalToLocalVecScatter(PetscDM,PetscScatter) int DMShellSetCreateMatrix(PetscDM,PetscDMShellCreateMatrixFunction) int DMShellSetCoarsen(PetscDM,PetscDMShellTransferFunction) int DMShellSetRefine(PetscDM,PetscDMShellTransferFunction) int DMShellSetCreateInterpolation(PetscDM,PetscDMShellCreateInterpolationFunction) int DMShellSetCreateInjection(PetscDM,PetscDMShellCreateInjectionFunction) int DMShellSetCreateRestriction(PetscDM,PetscDMShellCreateRestrictionFunction) int DMShellSetCreateFieldDecomposition(PetscDM,PetscDMShellCreateFieldDecompositionFunction) int DMShellSetCreateDomainDecomposition(PetscDM,PetscDMShellCreateDomainDecompositionFunction) int DMShellSetCreateDomainDecompositionScatters(PetscDM,PetscDMShellCreateDomainDecompositionScattersFunction) int DMShellSetCreateSubDM(PetscDM,PetscDMShellCreateSubDM) int VecGetDM(PetscVec,PetscDM*) int VecSetDM(PetscVec,PetscDM) int MatGetDM(PetscMat,PetscDM*) int MatSetDM(PetscMat,PetscDM) cdef int DMSHELL_CreateGlobalVector( PetscDM dm, PetscVec *v) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec vec Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__create_global_vector__') assert context is not None and type(context) is tuple (create_gvec, args, kargs) = context vec = create_gvec(Dm, *args, **kargs) PetscINCREF(vec.obj) v[0] = vec.vec cdef PetscDM odm = NULL CHKERR( VecGetDM(v[0], &odm) ) if odm == NULL: CHKERR( VecSetDM(v[0], dm) ) return 0 cdef int DMSHELL_CreateLocalVector( PetscDM dm, PetscVec *v) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec vec Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__create_local_vector__') assert context is not None and type(context) is tuple (create_lvec, args, kargs) = context vec = create_lvec(Dm, *args, **kargs) PetscINCREF(vec.obj) v[0] = vec.vec cdef PetscDM odm = NULL CHKERR( VecGetDM(v[0], &odm) ) if odm == NULL: CHKERR( VecSetDM(v[0], dm) ) return 0 cdef int DMSHELL_GlobalToLocalBegin( PetscDM dm, PetscVec g, PetscInsertMode mode, PetscVec l) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec gvec = ref_Vec(g) cdef Vec lvec = ref_Vec(l) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__g2l_begin__') assert context is not None and type(context) is tuple (begin, args, kargs) = context begin(Dm, gvec, mode, lvec, *args, **kargs) return 0 cdef int DMSHELL_GlobalToLocalEnd( PetscDM dm, PetscVec g, PetscInsertMode mode, PetscVec l) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec gvec = ref_Vec(g) cdef Vec lvec = ref_Vec(l) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__g2l_end__') assert context is not None and type(context) is tuple (end, args, kargs) = context end(Dm, gvec, mode, lvec, *args, **kargs) return 0 cdef int DMSHELL_LocalToGlobalBegin( PetscDM dm, PetscVec g, PetscInsertMode mode, PetscVec l) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec gvec = ref_Vec(g) cdef Vec lvec = ref_Vec(l) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__l2g_begin__') assert context is not None and type(context) is tuple (begin, args, kargs) = context begin(Dm, gvec, mode, lvec, *args, **kargs) return 0 cdef int DMSHELL_LocalToGlobalEnd( PetscDM dm, PetscVec g, PetscInsertMode mode, PetscVec l) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec gvec = ref_Vec(g) cdef Vec lvec = ref_Vec(l) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__l2g_end__') assert context is not None and type(context) is tuple (end, args, kargs) = context end(Dm, gvec, mode, lvec, *args, **kargs) return 0 cdef int DMSHELL_LocalToLocalBegin( PetscDM dm, PetscVec g, PetscInsertMode mode, PetscVec l) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec gvec = ref_Vec(g) cdef Vec lvec = ref_Vec(l) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__l2l_begin__') assert context is not None and type(context) is tuple (begin, args, kargs) = context begin(Dm, gvec, mode, lvec, *args, **kargs) return 0 cdef int DMSHELL_LocalToLocalEnd( PetscDM dm, PetscVec g, PetscInsertMode mode, PetscVec l) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Vec gvec = ref_Vec(g) cdef Vec lvec = ref_Vec(l) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__l2l_end__') assert context is not None and type(context) is tuple (end, args, kargs) = context end(Dm, gvec, mode, lvec, *args, **kargs) return 0 cdef int DMSHELL_CreateMatrix( PetscDM dm, PetscMat *cmat) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef Mat mat Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__create_matrix__') assert context is not None and type(context) is tuple (matrix, args, kargs) = context mat = matrix(Dm, *args, **kargs) PetscINCREF(mat.obj) cmat[0] = mat.mat cdef PetscDM odm = NULL CHKERR( MatGetDM(cmat[0], &odm) ) if odm == NULL: CHKERR( MatSetDM(cmat[0], dm) ) return 0 cdef int DMSHELL_Coarsen( PetscDM dm, MPI_Comm comm, PetscDM *dmc) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef DM Dmc cdef Comm Comm = new_Comm(comm) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__coarsen__') assert context is not None and type(context) is tuple (coarsen, args, kargs) = context Dmc = coarsen(Dm, Comm, *args, **kargs) PetscINCREF(Dmc.obj) dmc[0] = Dmc.dm return 0 cdef int DMSHELL_Refine( PetscDM dm, MPI_Comm comm, PetscDM *dmf) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef DM Dmf cdef Comm Comm = new_Comm(comm) Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__refine__') assert context is not None and type(context) is tuple (refine, args, kargs) = context Dmf = refine(Dm, Comm, *args, **kargs) PetscINCREF(Dmf.obj) dmf[0] = Dmf.dm return 0 cdef int DMSHELL_CreateInterpolation( PetscDM dmc, PetscDM dmf, PetscMat *cmat, PetscVec *cvec) except PETSC_ERR_PYTHON with gil: cdef DM Dmc = subtype_DM(dmc)() cdef DM Dmf = subtype_DM(dmf)() cdef Mat mat cdef Vec vec Dmc.dm = dmc PetscINCREF(Dmc.obj) Dmf.dm = dmf PetscINCREF(Dmf.obj) context = Dmc.get_attr('__create_interpolation__') assert context is not None and type(context) is tuple (interpolation, args, kargs) = context mat, vec = interpolation(Dmc, Dmf, *args, **kargs) PetscINCREF(mat.obj) cmat[0] = mat.mat if cvec == NULL: return 0 if vec is None: cvec[0] = NULL else: PetscINCREF(vec.obj) cvec[0] = vec.vec return 0 cdef int DMSHELL_CreateInjection( PetscDM dmc, PetscDM dmf, PetscMat *cmat) except PETSC_ERR_PYTHON with gil: cdef DM Dmc = subtype_DM(dmc)() cdef DM Dmf = subtype_DM(dmf)() cdef Mat mat Dmc.dm = dmc PetscINCREF(Dmc.obj) Dmf.dm = dmf PetscINCREF(Dmf.obj) context = Dmc.get_attr('__create_injection__') assert context is not None and type(context) is tuple (injection, args, kargs) = context mat = injection(Dmc, Dmf, *args, **kargs) PetscINCREF(mat.obj) cmat[0] = mat.mat return 0 cdef int DMSHELL_CreateRestriction( PetscDM dmf, PetscDM dmc, PetscMat *cmat) except PETSC_ERR_PYTHON with gil: cdef DM Dmf = subtype_DM(dmf)() cdef DM Dmc = subtype_DM(dmc)() cdef Mat mat Dmf.dm = dmf PetscINCREF(Dmf.obj) Dmc.dm = dmc PetscINCREF(Dmc.obj) context = Dmf.get_attr('__create_restriction__') assert context is not None and type(context) is tuple (restriction, args, kargs) = context mat = restriction(Dmf, Dmc, *args, **kargs) PetscINCREF(mat.obj) cmat[0] = mat.mat return 0 cdef int DMSHELL_CreateFieldDecomposition( PetscDM dm, PetscInt *clen, char ***namelist, PetscIS **islist, PetscDM **dmlist) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef int i cdef const char *cname = NULL Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__create_field_decomp__') assert context is not None and type(context) is tuple (decomp, args, kargs) = context names, ises, dms = decomp(Dm, *args, **kargs) if clen != NULL: if names is not None: clen[0] = len(names) elif ises is not None: clen[0] = len(ises) elif dms is not None: clen[0] = len(dms) else: clen[0] = 0 if namelist != NULL and names is not None: CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) for i in range(len(names)): names[i] = str2bytes(names[i], &cname) CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) if islist != NULL and ises is not None: CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) for i in range(len(ises)): islist[0][i] = (ises[i]).iset PetscINCREF((ises[i]).obj) if dmlist != NULL and dms is not None: CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) for i in range(len(dms)): dmlist[0][i] = (dms[i]).dm PetscINCREF((dms[i]).obj) return 0 cdef int DMSHELL_CreateDomainDecomposition( PetscDM dm, PetscInt *clen, char ***namelist, PetscIS **innerislist, PetscIS **outerislist, PetscDM **dmlist) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef int i cdef const char *cname = NULL Dm.dm = dm PetscINCREF(Dm.obj) context = Dm.get_attr('__create_domain_decomp__') assert context is not None and type(context) is tuple (decomp, args, kargs) = context names, innerises, outerises, dms = decomp(Dm, *args, **kargs) if clen != NULL: if names is not None: clen[0] = len(names) elif innerises is not None: clen[0] = len(innerises) elif outerises is not None: clen[0] = len(outerises) elif dms is not None: clen[0] = len(dms) else: clen[0] = 0 if namelist != NULL and names is not None: CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) for i in range(len(names)): names[i] = str2bytes(names[i], &cname) CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) if innerislist != NULL and innerises is not None: CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) for i in range(len(innerises)): innerislist[0][i] = (innerises[i]).iset PetscINCREF((innerises[i]).obj) if outerislist != NULL and outerises is not None: CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) for i in range(len(outerises)): outerislist[0][i] = (outerises[i]).iset PetscINCREF((outerises[i]).obj) if dmlist != NULL and dms is not None: CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) for i in range(len(dms)): dmlist[0][i] = (dms[i]).dm PetscINCREF((dms[i]).obj) return 0 cdef int DMSHELL_CreateDomainDecompositionScatters( PetscDM dm, PetscInt clen, PetscDM *subdms, PetscScatter** iscat, PetscScatter** oscat, PetscScatter** gscat) except PETSC_ERR_PYTHON with gil: cdef DM Dm = subtype_DM(dm)() cdef int i cdef const char *cname = NULL cdef DM subdm = None Dm.dm = dm PetscINCREF(Dm.obj) psubdms = [] for i from 0 <= i < clen: subdm = subtype_DM(subdms[i])() subdm.dm = subdms[i] PetscINCREF(subdm.obj) psubdms.append(subdm) context = Dm.get_attr('__create_domain_decomp_scatters__') assert context is not None and type(context) is tuple (scatters, args, kargs) = context (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) assert len(iscatter) == clen assert len(oscatter) == clen assert len(gscatter) == clen CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) for i in range(clen): iscat[0][i] = (iscatter[i]).sct PetscINCREF((iscatter[i]).obj) oscat[0][i] = (oscatter[i]).sct PetscINCREF((oscatter[i]).obj) gscat[0][i] = (gscatter[i]).sct PetscINCREF((gscatter[i]).obj) return 0 cdef int DMSHELL_CreateSubDM( PetscDM cdm, PetscInt numFields, const PetscInt cfields[], PetscIS *ciset, PetscDM *csubdm) except PETSC_ERR_PYTHON with gil: cdef DM dm = subtype_DM(cdm)() cdef IS iset cdef DM subdm dm.dm = cdm PetscINCREF(dm.obj) context = dm.get_attr('__create_subdm__') assert context is not None and type(context) is tuple (create_subdm, args, kargs) = context fields = array_i(numFields, cfields) iset, subdm = create_subdm(dm, fields, *args, **kargs) PetscINCREF(iset.obj) PetscINCREF(subdm.obj) ciset[0] = iset.iset csubdm[0] = subdm.dm petsc4py-3.15.1/src/PETSc/petscrand.pxi0000644000175000017500000000173513750315427020005 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscRandomType PetscRandomType PETSCRAND PetscRandomType PETSCRAND48 PetscRandomType PETSCSPRNG PetscRandomType PETSCRANDER48 PetscRandomType PETSCRANDOM123 int PetscRandomCreate(MPI_Comm,PetscRandom*) int PetscRandomDestroy(PetscRandom*) int PetscRandomView(PetscRandom,PetscViewer) int PetscRandomSetType(PetscRandom,PetscRandomType) int PetscRandomGetType(PetscRandom,PetscRandomType*) int PetscRandomSetFromOptions(PetscRandom) int PetscRandomGetValue(PetscRandom,PetscScalar*) int PetscRandomGetValueReal(PetscRandom,PetscReal*) int PetscRandomGetValueImaginary(PetscRandom,PetscScalar*) int PetscRandomGetInterval(PetscRandom,PetscScalar*,PetscScalar*) int PetscRandomSetInterval(PetscRandom,PetscScalar,PetscScalar) int PetscRandomSetSeed(PetscRandom,unsigned long) int PetscRandomGetSeed(PetscRandom,unsigned long*) int PetscRandomSeed(PetscRandom) petsc4py-3.15.1/src/PETSc/petscsec.pxi0000644000175000017500000000617213750315427017633 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: int PetscSectionCreate(MPI_Comm,PetscSection*) int PetscSectionClone(PetscSection,PetscSection*) int PetscSectionSetUp(PetscSection) int PetscSectionSetUpBC(PetscSection) int PetscSectionView(PetscSection,PetscViewer) int PetscSectionReset(PetscSection) int PetscSectionDestroy(PetscSection*) int PetscSectionGetNumFields(PetscSection,PetscInt*) int PetscSectionSetNumFields(PetscSection,PetscInt) int PetscSectionGetFieldName(PetscSection,PetscInt,const char*[]) int PetscSectionSetFieldName(PetscSection,PetscInt,const char[]) int PetscSectionGetFieldComponents(PetscSection,PetscInt,PetscInt*) int PetscSectionSetFieldComponents(PetscSection,PetscInt,PetscInt) int PetscSectionGetChart(PetscSection,PetscInt*,PetscInt*) int PetscSectionSetChart(PetscSection,PetscInt,PetscInt) int PetscSectionGetDof(PetscSection,PetscInt,PetscInt*) int PetscSectionSetDof(PetscSection,PetscInt,PetscInt) int PetscSectionAddDof(PetscSection,PetscInt,PetscInt) int PetscSectionGetFieldDof(PetscSection,PetscInt,PetscInt,PetscInt*) int PetscSectionSetFieldDof(PetscSection,PetscInt,PetscInt,PetscInt) int PetscSectionAddFieldDof(PetscSection,PetscInt,PetscInt,PetscInt) int PetscSectionGetConstraintDof(PetscSection,PetscInt,PetscInt*) int PetscSectionSetConstraintDof(PetscSection,PetscInt,PetscInt) int PetscSectionAddConstraintDof(PetscSection,PetscInt,PetscInt) int PetscSectionGetFieldConstraintDof(PetscSection,PetscInt,PetscInt,PetscInt*) int PetscSectionSetFieldConstraintDof(PetscSection,PetscInt,PetscInt,PetscInt) int PetscSectionAddFieldConstraintDof(PetscSection,PetscInt,PetscInt,PetscInt) int PetscSectionGetConstraintIndices(PetscSection,PetscInt,const PetscInt**) int PetscSectionSetConstraintIndices(PetscSection,PetscInt,const PetscInt*) int PetscSectionGetFieldConstraintIndices(PetscSection,PetscInt,PetscInt,const PetscInt**) int PetscSectionSetFieldConstraintIndices(PetscSection,PetscInt,PetscInt,const PetscInt*) int PetscSectionGetMaxDof(PetscSection,PetscInt*) int PetscSectionGetStorageSize(PetscSection,PetscInt*) int PetscSectionGetConstrainedStorageSize(PetscSection,PetscInt*) int PetscSectionGetOffset(PetscSection,PetscInt,PetscInt*) int PetscSectionSetOffset(PetscSection,PetscInt,PetscInt) int PetscSectionGetFieldOffset(PetscSection,PetscInt,PetscInt,PetscInt*) int PetscSectionSetFieldOffset(PetscSection,PetscInt,PetscInt,PetscInt) int PetscSectionGetOffsetRange(PetscSection,PetscInt*,PetscInt*) int PetscSectionCreateGlobalSection(PetscSection,PetscSF,PetscBool,PetscBool,PetscSection*) #int PetscSectionCreateGlobalSectionCensored(PetscSection,PetscSF,PetscBool,PetscInt,const PetscInt[],PetscSection*) int PetscSectionCreateSubsection(PetscSection,PetscInt,PetscInt[],PetscSection*) int PetscSectionCreateSubmeshSection(PetscSection,IS,PetscSection*) #int PetscSectionGetPointLayout(MPI_Comm,PetscSection,PetscLayout*) #int PetscSectionGetValueLayout(MPI_Comm,PetscSection,PetscLayout*) petsc4py-3.15.1/src/PETSc/DS.pyx0000644000175000017500000000567013750315427016352 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class DSType(object): BASIC = S_(PETSCDSBASIC) # -------------------------------------------------------------------- cdef class DS(Object): Type = DSType # def __cinit__(self): self.obj = &self.ds self.ds = NULL def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PetscDSView(self.ds, vwr) ) def destroy(self): CHKERR( PetscDSDestroy(&self.ds) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDS newds = NULL CHKERR( PetscDSCreate(ccomm, &newds) ) PetscCLEAR(self.obj); self.ds = newds return self def setType(self, ds_type): cdef PetscDSType cval = NULL ds_type = str2bytes(ds_type, &cval) CHKERR( PetscDSSetType(self.ds, cval) ) def getType(self): cdef PetscDSType cval = NULL CHKERR( PetscDSGetType(self.ds, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( PetscDSSetFromOptions(self.ds) ) def setUp(self): CHKERR( PetscDSSetUp(self.ds) ) return self # def getSpatialDimension(self): cdef PetscInt dim = 0 CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) return toInt(dim) def getCoordinateDimension(self): cdef PetscInt dim = 0 CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) return toInt(dim) def getNumFields(self): cdef PetscInt nf = 0 CHKERR( PetscDSGetNumFields(self.ds, &nf) ) return toInt(nf) def getFieldIndex(self, Object disc): cdef PetscInt field = 0 CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) return toInt(field) def getTotalDimensions(self): cdef PetscInt tdim = 0 CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) return toInt(tdim) def getTotalComponents(self): cdef PetscInt tcmp = 0 CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) return toInt(tcmp) def getDimensions(self): cdef PetscInt nf = 0, *dims = NULL CHKERR( PetscDSGetNumFields(self.ds, &nf) ) CHKERR( PetscDSGetDimensions(self.ds, &dims) ) return array_i(nf, dims) def getComponents(self): cdef PetscInt nf = 0, *cmps = NULL CHKERR( PetscDSGetNumFields(self.ds, &nf) ) CHKERR( PetscDSGetComponents(self.ds, &cmps) ) return array_i(nf, cmps) def setDiscretisation(self, f, disc): cdef PetscInt cf = asInt(f) cdef FE fe = disc CHKERR( PetscDSSetDiscretization(self.ds, cf, fe.fe) ) # -------------------------------------------------------------------- del DSType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscdmcomposite.pxi0000644000175000017500000000417013750315427021400 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: int DMCompositeCreate(MPI_Comm,PetscDM*) int DMCompositeAddDM(PetscDM,PetscDM) int DMCompositeGetNumberDM(PetscDM,PetscInt*) int DMCompositeScatterArray(PetscDM,PetscVec,PetscVec*) int DMCompositeGatherArray(PetscDM,PetscInsertMode,PetscVec,PetscVec*) int DMCompositeGetEntriesArray(PetscDM,PetscDM*) int DMCompositeGetAccessArray(PetscDM,PetscVec,PetscInt,const PetscInt*,PetscVec*) int DMCompositeRestoreAccessArray(PetscDM,PetscVec,PetscInt,const PetscInt*,PetscVec*) int DMCompositeGetGlobalISs(PetscDM,PetscIS**) int DMCompositeGetLocalISs(PetscDM,PetscIS**) int DMCompositeGetISLocalToGlobalMappings(PetscDM,PetscLGMap**) cdef class _DMComposite_access: cdef PetscDM dm cdef PetscVec gvec cdef PetscInt nlocs cdef PetscInt *locs cdef PetscVec *vecs cdef object locs_mem cdef object vecs_mem cdef object access def __cinit__(self, DM dm, Vec gvec, locs=None): self.dm = dm.dm CHKERR( PetscINCREF(&self.dm) ) self.gvec = gvec.vec CHKERR( PetscINCREF(&self.gvec) ) if locs is None: CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) locs = arange(0, self.nlocs, 1) self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) self.access = None def __dealloc__(self): CHKERR( DMDestroy(&self.dm) ) CHKERR( VecDestroy(&self.gvec) ) def __enter__(self): cdef Py_ssize_t i, n = self.nlocs CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] return tuple(self.access) def __exit__(self, *exc): cdef Py_ssize_t i, n = self.nlocs for i from 0 <= i < n: (self.access[i]).vec = NULL CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) self.access = None petsc4py-3.15.1/src/PETSc/CAPI.pyx0000644000175000017500000001675513750315427016566 0ustar balaybalay00000000000000#--------------------------------------------------------------------- cdef inline int setref(void *d, void *s) except -1: cdef PetscObject *dest = d cdef PetscObject source = s CHKERR( PetscINCREF(&source) ) dest[0] = source return 0 #--------------------------------------------------------------------- # -- Error -- cdef api int PyPetscError_Set(int ierr): return SETERR(ierr) # -- Comm -- cdef api object PyPetscComm_New(MPI_Comm arg): cdef Comm retv = Comm() retv.comm = arg return retv cdef api MPI_Comm PyPetscComm_Get(object arg) except *: cdef MPI_Comm retv = MPI_COMM_NULL cdef Comm ob = arg retv = ob.comm return retv cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: cdef MPI_Comm *retv = NULL cdef Comm ob = arg retv = &ob.comm return retv # -- Object -- cdef api object PyPetscObject_New(PetscObject arg): cdef Object retv = subtype_Object(arg)() setref(&retv.obj[0], arg) return retv cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: cdef PetscObject retv = NULL cdef Object ob = arg retv = ob.obj[0] return retv cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: cdef PetscObject *retv = NULL cdef Object ob = arg retv = ob.obj return retv # -- Viewer -- cdef api object PyPetscViewer_New(PetscViewer arg): cdef Viewer retv = Viewer() setref(&retv.vwr, arg) return retv cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: cdef PetscViewer retv = NULL cdef Viewer ob = arg retv = ob.vwr return retv # -- Random -- cdef api object PyPetscRandom_New(PetscRandom arg): cdef Random retv = Random() setref(&retv.rnd, arg) return retv cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: cdef PetscRandom retv = NULL cdef Random ob = arg retv = ob.rnd return retv # -- IS -- cdef api object PyPetscIS_New(PetscIS arg): cdef IS retv = IS() setref(&retv.iset, arg) return retv cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: cdef PetscIS retv = NULL cdef IS ob = arg retv = ob.iset return retv # -- LGMap -- cdef api object PyPetscLGMap_New(PetscLGMap arg): cdef LGMap retv = LGMap() setref(&retv.lgm, arg) return retv cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: cdef PetscLGMap retv = NULL cdef LGMap ob = arg retv = ob.lgm return retv # -- SF -- cdef api object PyPetscSF_New(PetscSF arg): cdef SF retv = SF() setref(&retv.sf, arg) return retv cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: cdef PetscSF retv = NULL cdef SF ob = arg retv = ob.sf return retv # -- Vec -- cdef api object PyPetscVec_New(PetscVec arg): cdef Vec retv = Vec() setref(&retv.vec, arg) return retv cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: cdef PetscVec retv = NULL cdef Vec ob = arg retv = ob.vec return retv # -- Scatter -- cdef api object PyPetscScatter_New(PetscScatter arg): cdef Scatter retv = Scatter() setref(&retv.sct, arg) return retv cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: cdef PetscScatter retv = NULL cdef Scatter ob = arg retv = ob.sct return retv # -- Section -- cdef api object PyPetscSection_New(PetscSection arg): cdef Section retv = Section() setref(&retv.sec, arg) return retv cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: cdef PetscSection retv = NULL cdef Section ob = arg retv = ob.sec return retv # -- Mat -- cdef api object PyPetscMat_New(PetscMat arg): cdef Mat retv = Mat() setref(&retv.mat, arg) return retv cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: cdef PetscMat retv = NULL cdef Mat ob = arg retv = ob.mat return retv # -- PC -- cdef api object PyPetscPC_New(PetscPC arg): cdef PC retv = PC() setref(&retv.pc, arg) return retv cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: cdef PetscPC retv = NULL cdef PC ob = arg retv = ob.pc return retv # -- KSP -- cdef api object PyPetscKSP_New(PetscKSP arg): cdef KSP retv = KSP() setref(&retv.ksp, arg) return retv cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: cdef PetscKSP retv = NULL cdef KSP ob = arg retv = ob.ksp return retv # -- SNES -- cdef api object PyPetscSNES_New(PetscSNES arg): cdef SNES retv = SNES() setref(&retv.snes, arg) return retv cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: cdef PetscSNES retv = NULL cdef SNES ob = arg retv = ob.snes return retv # -- TS -- cdef api object PyPetscTS_New(PetscTS arg): cdef TS retv = TS() setref(&retv.ts, arg) return retv cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: cdef PetscTS retv = NULL cdef TS ob = arg retv = ob.ts return retv # -- TAO -- cdef api object PyPetscTAO_New(PetscTAO arg): cdef TAO retv = TAO() setref(&retv.tao, arg) return retv cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: cdef PetscTAO retv = NULL cdef TAO ob = arg retv = ob.tao return retv # -- AO -- cdef api object PyPetscAO_New(PetscAO arg): cdef AO retv = AO() setref(&retv.ao, arg) return retv cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: cdef PetscAO retv = NULL cdef AO ob = arg retv = ob.ao return retv # -- DM -- cdef api object PyPetscDM_New(PetscDM arg): cdef DM retv = subtype_DM(arg)() setref(&retv.dm, arg) return retv cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: cdef PetscDM retv = NULL cdef DM ob = arg retv = ob.dm return retv # -- DS -- cdef api object PyPetscDS_New(PetscDS arg): cdef DS retv = DS() setref(&retv.ds, arg) return retv cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: cdef PetscDS retv = NULL cdef DS ob = arg retv = ob.ds return retv # -- Partitioner -- cdef api object PyPetscPartitioner_New(PetscPartitioner arg): cdef Partitioner retv = Partitioner() setref(&retv.part, arg) return retv cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: cdef PetscPartitioner retv = NULL cdef Partitioner ob = arg retv = ob.part return retv # -- FE -- cdef api object PyPetscFE_New(PetscFE arg): cdef FE retv = FE() setref(&retv.fe, arg) return retv cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: cdef PetscFE retv = NULL cdef FE ob = arg retv = ob.fe return retv # -- QUAD -- cdef api object PyPetscQuad_New(PetscQuadrature arg): cdef Quad retv = Quad() setref(&retv.quad, arg) return retv cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: cdef PetscQuadrature retv = NULL cdef Quad ob = arg retv = ob.quad return retv # -- DMLabel -- cdef api object PyPetscDMLabel_New(PetscDMLabel arg): cdef DMLabel retv = DMLabel() setref(&retv.dmlabel, arg) return retv cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: cdef PetscDMLabel retv = NULL cdef DMLabel ob = arg retv = ob.dmlabel return retv #--------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscpartitioner.pxi0000644000175000017500000000172013750315427021413 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscPartitionerType PetscPartitionerType PETSCPARTITIONERPARMETIS PetscPartitionerType PETSCPARTITIONERPTSCOTCH PetscPartitionerType PETSCPARTITIONERCHACO PetscPartitionerType PETSCPARTITIONERSIMPLE PetscPartitionerType PETSCPARTITIONERSHELL PetscPartitionerType PETSCPARTITIONERGATHER PetscPartitionerType PETSCPARTITIONERMATPARTITIONING int PetscPartitionerCreate(MPI_Comm,PetscPartitioner*) int PetscPartitionerDestroy(PetscPartitioner*) int PetscPartitionerView(PetscPartitioner,PetscViewer) int PetscPartitionerSetType(PetscPartitioner,PetscPartitionerType) int PetscPartitionerGetType(PetscPartitioner,PetscPartitionerType*) int PetscPartitionerSetFromOptions(PetscPartitioner) int PetscPartitionerSetUp(PetscPartitioner) int PetscPartitionerReset(PetscPartitioner) int PetscPartitionerShellSetPartition(PetscPartitioner,PetscInt,PetscInt*,PetscInt*) petsc4py-3.15.1/src/PETSc/petscts.pxi0000644000175000017500000005150414030740317017476 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscTSType "TSType" PetscTSType TSEULER PetscTSType TSBEULER PetscTSType TSBASICSYMPLECTIC PetscTSType TSPSEUDO PetscTSType TSCN PetscTSType TSSUNDIALS PetscTSType TSRK #PetscTSType TSPYTHON PetscTSType TSTHETA PetscTSType TSALPHA PetscTSType TSALPHA2 PetscTSType TSGLLE PetscTSType TSGLEE PetscTSType TSSSP PetscTSType TSARKIMEX PetscTSType TSROSW PetscTSType TSEIMEX PetscTSType TSMIMEX PetscTSType TSBDF PetscTSType TSRADAU5 PetscTSType TSMPRK PetscTSType TSDISCGRAD ctypedef enum PetscTSProblemType "TSProblemType": TS_LINEAR TS_NONLINEAR ctypedef enum PetscTSEquationType "TSEquationType": TS_EQ_UNSPECIFIED TS_EQ_EXPLICIT TS_EQ_ODE_EXPLICIT TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI TS_EQ_IMPLICIT TS_EQ_ODE_IMPLICIT TS_EQ_DAE_IMPLICIT_INDEX1 TS_EQ_DAE_IMPLICIT_INDEX2 TS_EQ_DAE_IMPLICIT_INDEX3 TS_EQ_DAE_IMPLICIT_INDEXHI ctypedef enum PetscTSConvergedReason "TSConvergedReason": # iterating TS_CONVERGED_ITERATING # converged TS_CONVERGED_TIME TS_CONVERGED_ITS TS_CONVERGED_USER TS_CONVERGED_EVENT # diverged TS_DIVERGED_NONLINEAR_SOLVE TS_DIVERGED_STEP_REJECTED ctypedef enum PetscTSExactFinalTimeOption "TSExactFinalTimeOption": TS_EXACTFINALTIME_UNSPECIFIED TS_EXACTFINALTIME_STEPOVER TS_EXACTFINALTIME_INTERPOLATE TS_EXACTFINALTIME_MATCHSTEP ctypedef int PetscTSCtxDel(void*) ctypedef int (*PetscTSFunctionFunction)(PetscTS, PetscReal, PetscVec, PetscVec, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSJacobianFunction)(PetscTS, PetscReal, PetscVec, PetscMat, PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSIFunctionFunction)(PetscTS, PetscReal, PetscVec, PetscVec, PetscVec, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSIJacobianFunction)(PetscTS, PetscReal, PetscVec, PetscVec, PetscReal, PetscMat, PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSIJacobianPFunction)(PetscTS, PetscReal, PetscVec, PetscVec, PetscReal, PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSI2FunctionFunction)(PetscTS, PetscReal, PetscVec, PetscVec, PetscVec, PetscVec, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSI2JacobianFunction)(PetscTS, PetscReal, PetscVec, PetscVec, PetscVec, PetscReal, PetscReal, PetscMat, PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSMonitorFunction)(PetscTS, PetscInt, PetscReal, PetscVec, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSPreStepFunction) (PetscTS) except PETSC_ERR_PYTHON ctypedef int (*PetscTSPostStepFunction) (PetscTS) except PETSC_ERR_PYTHON int TSCreate(MPI_Comm comm,PetscTS*) int TSClone(PetscTS,PetscTS*) int TSDestroy(PetscTS*) int TSView(PetscTS,PetscViewer) int TSLoad(PetscTS,PetscViewer) int TSSetProblemType(PetscTS,PetscTSProblemType) int TSGetProblemType(PetscTS,PetscTSProblemType*) int TSSetEquationType(PetscTS,PetscTSEquationType) int TSGetEquationType(PetscTS,PetscTSEquationType*) int TSSetType(PetscTS,PetscTSType) int TSGetType(PetscTS,PetscTSType*) int TSSetOptionsPrefix(PetscTS,char[]) int TSAppendOptionsPrefix(PetscTS,char[]) int TSGetOptionsPrefix(PetscTS,char*[]) int TSSetFromOptions(PetscTS) int TSSetSolution(PetscTS,PetscVec) int TSGetSolution(PetscTS,PetscVec*) int TS2SetSolution(PetscTS,PetscVec,PetscVec) int TS2GetSolution(PetscTS,PetscVec*,PetscVec*) int TSGetRHSFunction(PetscTS,PetscVec*,PetscTSFunctionFunction*,void*) int TSGetRHSJacobian(PetscTS,PetscMat*,PetscMat*,PetscTSJacobianFunction*,void**) int TSSetRHSFunction(PetscTS,PetscVec,PetscTSFunctionFunction,void*) int TSSetRHSJacobian(PetscTS,PetscMat,PetscMat,PetscTSJacobianFunction,void*) int TSSetIFunction(PetscTS,PetscVec,PetscTSIFunctionFunction,void*) int TSSetIJacobian(PetscTS,PetscMat,PetscMat,PetscTSIJacobianFunction,void*) int TSSetIJacobianP(PetscTS,PetscMat,PetscTSIJacobianPFunction,void*) int TSGetIFunction(PetscTS,PetscVec*,PetscTSIFunctionFunction*,void*) int TSGetIJacobian(PetscTS,PetscMat*,PetscMat*,PetscTSIJacobianFunction*,void**) int TSSetI2Function(PetscTS,PetscVec,PetscTSI2FunctionFunction,void*) int TSSetI2Jacobian(PetscTS,PetscMat,PetscMat,PetscTSI2JacobianFunction,void*) int TSGetI2Function(PetscTS,PetscVec*,PetscTSI2FunctionFunction*,void**) int TSGetI2Jacobian(PetscTS,PetscMat*,PetscMat*,PetscTSI2JacobianFunction*,void**) int TSGetKSP(PetscTS,PetscKSP*) int TSGetSNES(PetscTS,PetscSNES*) int TSGetDM(PetscTS,PetscDM*) int TSSetDM(PetscTS,PetscDM) int TSComputeRHSFunction(PetscTS,PetscReal,PetscVec,PetscVec) int TSComputeRHSFunctionLinear(PetscTS,PetscReal,PetscVec,PetscVec,void*) int TSComputeRHSJacobian(PetscTS,PetscReal,PetscVec,PetscMat,PetscMat) int TSComputeRHSJacobianConstant(PetscTS,PetscReal,PetscVec,PetscMat,PetscMat,void*) int TSComputeIFunction(PetscTS,PetscReal,PetscVec,PetscVec,PetscVec,PetscBool) int TSComputeIJacobian(PetscTS,PetscReal,PetscVec,PetscVec,PetscReal,PetscMat,PetscMat,PetscBool) int TSComputeIJacobianP(PetscTS,PetscReal,PetscVec,PetscVec,PetscReal,PetscMat,PetscBool) int TSComputeI2Function(PetscTS,PetscReal,PetscVec,PetscVec,PetscVec,PetscVec) int TSComputeI2Jacobian(PetscTS,PetscReal,PetscVec,PetscVec,PetscVec,PetscReal,PetscReal,PetscMat,PetscMat) int TSSetTime(PetscTS,PetscReal) int TSGetTime(PetscTS,PetscReal*) int TSGetPrevTime(PetscTS,PetscReal*) int TSGetSolveTime(PetscTS,PetscReal*) int TSSetTimeStep(PetscTS,PetscReal) int TSGetTimeStep(PetscTS,PetscReal*) int TSSetStepNumber(PetscTS,PetscInt) int TSGetStepNumber(PetscTS,PetscInt*) int TSSetMaxSteps(PetscTS,PetscInt) int TSGetMaxSteps(PetscTS,PetscInt*) int TSSetMaxTime(PetscTS,PetscReal) int TSGetMaxTime(PetscTS,PetscReal*) int TSSetExactFinalTime(PetscTS,PetscTSExactFinalTimeOption) int TSSetConvergedReason(PetscTS,PetscTSConvergedReason) int TSGetConvergedReason(PetscTS,PetscTSConvergedReason*) int TSGetSNESIterations(PetscTS,PetscInt*) int TSGetKSPIterations(PetscTS,PetscInt*) int TSGetStepRejections(PetscTS,PetscInt*) int TSSetMaxStepRejections(PetscTS,PetscInt) int TSGetSNESFailures(PetscTS,PetscInt*) int TSSetMaxSNESFailures(PetscTS,PetscInt) int TSSetErrorIfStepFails(PetscTS,PetscBool) int TSSetTolerances(PetscTS,PetscReal,PetscVec,PetscReal,PetscVec) int TSGetTolerances(PetscTS,PetscReal*,PetscVec*,PetscReal*,PetscVec*) int TSMonitorSet(PetscTS,PetscTSMonitorFunction,void*,PetscTSCtxDel*) int TSMonitorCancel(PetscTS) int TSMonitor(PetscTS,PetscInt,PetscReal,PetscVec) ctypedef int (*PetscTSEventHandler)(PetscTS,PetscReal,PetscVec,PetscScalar[],void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSPostEvent)(PetscTS,PetscInt,PetscInt[],PetscReal,PetscVec, PetscBool, void*) except PETSC_ERR_PYTHON int TSSetEventHandler(PetscTS, PetscInt, PetscInt[], PetscBool[], PetscTSEventHandler, PetscTSPostEvent, void*) int TSSetEventTolerances(PetscTS, PetscReal, PetscReal[]) int TSGetNumEvents(PetscTS, PetscInt*) ctypedef int (*PetscTSAdjointR)(PetscTS,PetscReal,PetscVec,PetscVec,void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSAdjointDRDY)(PetscTS,PetscReal,PetscVec,PetscVec[],void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSAdjointDRDP)(PetscTS,PetscReal,PetscVec,PetscVec[],void*) except PETSC_ERR_PYTHON ctypedef int (*PetscTSRHSJacobianP)(PetscTS,PetscReal,PetscVec,PetscMat,void*) except PETSC_ERR_PYTHON int TSSetSaveTrajectory(PetscTS) int TSSetCostGradients(PetscTS,PetscInt,PetscVec*,PetscVec*) int TSGetCostGradients(PetscTS,PetscInt*,PetscVec**,PetscVec**) int TSCreateQuadratureTS(PetscTS,PetscBool,PetscTS*) int TSGetQuadratureTS(PetscTS,PetscBool*,PetscTS*) int TSGetCostIntegral(PetscTS,PetscVec*) int TSSetRHSJacobianP(PetscTS,PetscMat,PetscTSRHSJacobianP,void*) int TSComputeRHSJacobianP(PetscTS,PetscReal,PetscVec,PetscMat) int TSAdjointSolve(PetscTS) int TSAdjointSetSteps(PetscTS,PetscInt) int TSAdjointStep(PetscTS) int TSAdjointSetUp(PetscTS) int TSAdjointComputeDRDPFunction(PetscTS,PetscReal,PetscVec,PetscVec*) int TSAdjointComputeDRDYFunction(PetscTS,PetscReal,PetscVec,PetscVec*) int TSAdjointCostIntegral(PetscTS) int TSForwardSetSensitivities(PetscTS,PetscInt,PetscVec*,PetscInt,PetscVec*) int TSForwardGetSensitivities(PetscTS,PetscInt*,PetscVec**,PetscInt*,PetscVec**) int TSForwardSetIntegralGradients(PetscTS,PetscInt,PetscVec *,PetscVec *) int TSForwardGetIntegralGradients(PetscTS,PetscInt*,PetscVec **,PetscVec **) int TSForwardSetRHSJacobianP(PetscTS,PetscVec*,PetscTSCostIntegrandFunction,void*) int TSForwardComputeRHSJacobianP(PetscTS,PetscReal,PetscVec,PetscVec*) int TSForwardSetUp(PetscTS) int TSForwardCostIntegral(PetscTS) int TSForwardStep(PetscTS) int TSSetPreStep(PetscTS, PetscTSPreStepFunction) int TSSetPostStep(PetscTS, PetscTSPostStepFunction) int TSSetUp(PetscTS) int TSReset(PetscTS) int TSStep(PetscTS) int TSRestartStep(PetscTS) int TSRollBack(PetscTS) int TSSolve(PetscTS,PetscVec) int TSInterpolate(PetscTS,PetscReal,PetscVec) int TSThetaSetTheta(PetscTS,PetscReal) int TSThetaGetTheta(PetscTS,PetscReal*) int TSThetaSetEndpoint(PetscTS,PetscBool) int TSThetaGetEndpoint(PetscTS,PetscBool*) int TSAlphaSetRadius(PetscTS,PetscReal) int TSAlphaSetParams(PetscTS,PetscReal,PetscReal,PetscReal) int TSAlphaGetParams(PetscTS,PetscReal*,PetscReal*,PetscReal*) ctypedef const char* PetscTSRKType "TSRKType" PetscTSRKType TSRK1FE PetscTSRKType TSRK2A PetscTSRKType TSRK3 PetscTSRKType TSRK3BS PetscTSRKType TSRK4 PetscTSRKType TSRK5F PetscTSRKType TSRK5DP PetscTSRKType TSRK5BS PetscTSRKType TSRK6VR PetscTSRKType TSRK7VR PetscTSRKType TSRK8VR int TSRKGetType(PetscTS ts,PetscTSRKType*) int TSRKSetType(PetscTS ts,PetscTSRKType) ctypedef const char* PetscTSARKIMEXType "TSARKIMEXType" PetscTSARKIMEXType TSARKIMEX1BEE PetscTSARKIMEXType TSARKIMEXA2 PetscTSARKIMEXType TSARKIMEXL2 PetscTSARKIMEXType TSARKIMEXARS122 PetscTSARKIMEXType TSARKIMEX2C PetscTSARKIMEXType TSARKIMEX2D PetscTSARKIMEXType TSARKIMEX2E PetscTSARKIMEXType TSARKIMEXPRSSP2 PetscTSARKIMEXType TSARKIMEX3 PetscTSARKIMEXType TSARKIMEXBPR3 PetscTSARKIMEXType TSARKIMEXARS443 PetscTSARKIMEXType TSARKIMEX4 PetscTSARKIMEXType TSARKIMEX5 int TSARKIMEXGetType(PetscTS ts,PetscTSRKType*) int TSARKIMEXSetType(PetscTS ts,PetscTSRKType) cdef extern from "custom.h" nogil: int TSSetTimeStepNumber(PetscTS,PetscInt) cdef extern from "libpetsc4py.h": PetscTSType TSPYTHON int TSPythonSetContext(PetscTS,void*) int TSPythonGetContext(PetscTS,void**) int TSPythonSetType(PetscTS,char[]) # ----------------------------------------------------------------------------- cdef inline TS ref_TS(PetscTS ts): cdef TS ob = TS() ob.ts = ts PetscINCREF(ob.obj) return ob # ----------------------------------------------------------------------------- cdef int TS_RHSFunction( PetscTS ts, PetscReal t, PetscVec x, PetscVec f, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Vec Fvec = ref_Vec(f) cdef object context = Ts.get_attr('__rhsfunction__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (function, args, kargs) = context function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) return 0 cdef int TS_RHSJacobian( PetscTS ts, PetscReal t, PetscVec x, PetscMat J, PetscMat P, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Mat Jmat = ref_Mat(J) cdef Mat Pmat = ref_Mat(P) cdef object context = Ts.get_attr('__rhsjacobian__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int TS_IFunction( PetscTS ts, PetscReal t, PetscVec x, PetscVec xdot, PetscVec f, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Vec XDvec = ref_Vec(xdot) cdef Vec Fvec = ref_Vec(f) cdef object context = Ts.get_attr('__ifunction__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (function, args, kargs) = context function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) return 0 cdef int TS_IJacobian( PetscTS ts, PetscReal t, PetscVec x, PetscVec xdot, PetscReal a, PetscMat J, PetscMat P, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Vec XDvec = ref_Vec(xdot) cdef Mat Jmat = ref_Mat(J) cdef Mat Pmat = ref_Mat(P) cdef object context = Ts.get_attr('__ijacobian__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) return 0 cdef int TS_IJacobianP( PetscTS ts, PetscReal t, PetscVec x, PetscVec xdot, PetscReal a, PetscMat J, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Vec XDvec = ref_Vec(xdot) cdef Mat Jmat = ref_Mat(J) cdef object context = Ts.get_attr('__ijacobianp__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) return 0 cdef int TS_I2Function( PetscTS ts, PetscReal t, PetscVec x, PetscVec xdot, PetscVec xdotdot, PetscVec f, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Vec XDvec = ref_Vec(xdot) cdef Vec XDDvec = ref_Vec(xdotdot) cdef Vec Fvec = ref_Vec(f) cdef object context = Ts.get_attr('__i2function__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (function, args, kargs) = context function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) return 0 cdef int TS_I2Jacobian( PetscTS ts, PetscReal t, PetscVec x, PetscVec xdot, PetscVec xdotdot, PetscReal v, PetscReal a, PetscMat J, PetscMat P, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Vec XDvec = ref_Vec(xdot) cdef Vec XDDvec = ref_Vec(xdotdot) cdef Mat Jmat = ref_Mat(J) cdef Mat Pmat = ref_Mat(P) cdef object context = Ts.get_attr('__i2jacobian__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int TS_Monitor( PetscTS ts, PetscInt step, PetscReal time, PetscVec u, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Vu = ref_Vec(u) cdef object monitorlist = Ts.get_attr('__monitor__') if monitorlist is None: return 0 for (monitor, args, kargs) in monitorlist: monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int TS_EventHandler( PetscTS ts, PetscReal time, PetscVec u, PetscScalar fvalue[], void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Vu = ref_Vec(u) cdef object context = Ts.get_attr('__eventhandler__') if context is None: return 0 (eventhandler, args, kargs) = context cdef PetscInt nevents = 0 CHKERR( TSGetNumEvents(ts, &nevents) ) cdef npy_intp s = nevents fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) return 0 cdef int TS_PostEvent( PetscTS ts, PetscInt nevents_zero, PetscInt events_zero[], PetscReal time, PetscVec u, PetscBool forward, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Vu = ref_Vec(u) cdef object context = Ts.get_attr('__postevent__') if context is None: return 0 (postevent, args, kargs) = context cdef npy_intp s = nevents_zero events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) return 0 cdef int TS_PreStep( PetscTS ts, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) (prestep, args, kargs) = Ts.get_attr('__prestep__') prestep(Ts, *args, **kargs) return 0 cdef int TS_PostStep( PetscTS ts, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) (poststep, args, kargs) = Ts.get_attr('__poststep__') poststep(Ts, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int TS_RHSJacobianP( PetscTS ts, PetscReal t, PetscVec x, PetscMat J, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef TS Ts = ref_TS(ts) cdef Vec Xvec = ref_Vec(x) cdef Mat Jmat = ref_Mat(J) cdef object context = Ts.get_attr('__rhsjacobianp__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobianp, args, kargs) = context jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) return 0 # ----------------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Const.pyx0000644000175000017500000000425013750315427017123 0ustar balaybalay00000000000000# -------------------------------------------------------------------- DECIDE = PETSC_DECIDE DEFAULT = PETSC_DEFAULT DETERMINE = PETSC_DETERMINE # -------------------------------------------------------------------- INFINITY = toReal(PETSC_INFINITY) NINFINITY = toReal(PETSC_NINFINITY) PINFINITY = toReal(PETSC_INFINITY) # -------------------------------------------------------------------- class InsertMode(object): # native NOT_SET_VALUES = PETSC_NOT_SET_VALUES INSERT_VALUES = PETSC_INSERT_VALUES ADD_VALUES = PETSC_ADD_VALUES MAX_VALUES = PETSC_MAX_VALUES INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES ADD_BC_VALUES = PETSC_ADD_BC_VALUES # aliases INSERT = INSERT_VALUES ADD = ADD_VALUES MAX = MAX_VALUES INSERT_ALL = INSERT_ALL_VALUES ADD_ALL = ADD_ALL_VALUES INSERT_BC = INSERT_BC_VALUES ADD_BC = ADD_BC_VALUES # -------------------------------------------------------------------- class ScatterMode(object): # native SCATTER_FORWARD = PETSC_SCATTER_FORWARD SCATTER_REVERSE = PETSC_SCATTER_REVERSE SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL SCATTER_LOCAL = PETSC_SCATTER_LOCAL # aliases FORWARD = SCATTER_FORWARD REVERSE = SCATTER_REVERSE FORWARD_LOCAL = SCATTER_FORWARD_LOCAL REVERSE_LOCAL = SCATTER_REVERSE_LOCAL # -------------------------------------------------------------------- class NormType(object): # native NORM_1 = PETSC_NORM_1 NORM_2 = PETSC_NORM_2 NORM_1_AND_2 = PETSC_NORM_1_AND_2 NORM_FROBENIUS = PETSC_NORM_FROBENIUS NORM_INFINITY = PETSC_NORM_INFINITY NORM_MAX = PETSC_NORM_MAX # aliases N1 = NORM_1 N2 = NORM_2 N12 = NORM_1_AND_2 MAX = NORM_MAX FROBENIUS = NORM_FROBENIUS INFINITY = NORM_INFINITY # extra aliases FRB = FROBENIUS INF = INFINITY # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscpc.pxi0000644000175000017500000003742514030740317017460 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscPCType "PCType" PetscPCType PCNONE PetscPCType PCJACOBI PetscPCType PCSOR PetscPCType PCLU PetscPCType PCSHELL PetscPCType PCBJACOBI PetscPCType PCMG PetscPCType PCEISENSTAT PetscPCType PCILU PetscPCType PCICC PetscPCType PCASM PetscPCType PCGASM PetscPCType PCKSP PetscPCType PCCOMPOSITE PetscPCType PCREDUNDANT PetscPCType PCSPAI PetscPCType PCNN PetscPCType PCCHOLESKY PetscPCType PCPBJACOBI PetscPCType PCVPBJACOBI PetscPCType PCMAT PetscPCType PCHYPRE PetscPCType PCPARMS PetscPCType PCFIELDSPLIT PetscPCType PCTFS PetscPCType PCML PetscPCType PCGALERKIN PetscPCType PCEXOTIC PetscPCType PCCP PetscPCType PCBFBT PetscPCType PCLSC #PetscPCType PCPYTHON PetscPCType PCPFMG PetscPCType PCSYSPFMG PetscPCType PCREDISTRIBUTE PetscPCType PCSVD PetscPCType PCGAMG PetscPCType PCCHOWILUVIENNACL PetscPCType PCROWSCALINGVIENNACL PetscPCType PCSAVIENNACL PetscPCType PCBDDC PetscPCType PCKACZMARZ PetscPCType PCTELESCOPE PetscPCType PCPATCH PetscPCType PCLMVM PetscPCType PCHMG PetscPCType PCDEFLATION PetscPCType PCHPDDM PetscPCType PCHARA ctypedef enum PetscPCSide "PCSide": PC_SIDE_DEFAULT PC_LEFT PC_RIGHT PC_SYMMETRIC ctypedef enum PetscPCASMType "PCASMType": PC_ASM_BASIC PC_ASM_RESTRICT PC_ASM_INTERPOLATE PC_ASM_NONE ctypedef enum PetscPCGASMType "PCGASMType": PC_GASM_BASIC PC_GASM_RESTRICT PC_GASM_INTERPOLATE PC_GASM_NONE ctypedef enum PetscPCMGType "PCMGType": PC_MG_MULTIPLICATIVE PC_MG_ADDITIVE PC_MG_FULL PC_MG_KASKADE ctypedef enum PetscPCMGCycleType "PCMGCycleType": PC_MG_CYCLE_V PC_MG_CYCLE_W ctypedef const char* PetscPCGAMGType "PCGAMGType" PetscPCGAMGType PCGAMGAGG PetscPCGAMGType PCGAMGGEO PetscPCGAMGType PCGAMGCLASSICAL ctypedef const char* PetscPCHYPREType "const char*" ctypedef enum PetscPCCompositeType "PCCompositeType": PC_COMPOSITE_ADDITIVE PC_COMPOSITE_MULTIPLICATIVE PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE PC_COMPOSITE_SPECIAL PC_COMPOSITE_SCHUR ctypedef enum PetscPCFieldSplitSchurPreType "PCFieldSplitSchurPreType": PC_FIELDSPLIT_SCHUR_PRE_SELF PC_FIELDSPLIT_SCHUR_PRE_SELFP PC_FIELDSPLIT_SCHUR_PRE_A11 PC_FIELDSPLIT_SCHUR_PRE_USER PC_FIELDSPLIT_SCHUR_PRE_FULL ctypedef enum PetscPCFieldSplitSchurFactType "PCFieldSplitSchurFactType": PC_FIELDSPLIT_SCHUR_FACT_DIAG PC_FIELDSPLIT_SCHUR_FACT_LOWER PC_FIELDSPLIT_SCHUR_FACT_UPPER PC_FIELDSPLIT_SCHUR_FACT_FULL ctypedef enum PetscPCPatchConstructType "PCPatchConstructType": PC_PATCH_STAR PC_PATCH_VANKA PC_PATCH_PARDECOMP PC_PATCH_USER PC_PATCH_PYTHON int PCCreate(MPI_Comm,PetscPC*) int PCDestroy(PetscPC*) int PCView(PetscPC,PetscViewer) int PCSetType(PetscPC,PetscPCType) int PCGetType(PetscPC,PetscPCType*) int PCSetOptionsPrefix(PetscPC,char[]) int PCAppendOptionsPrefix(PetscPC,char[]) int PCGetOptionsPrefix(PetscPC,char*[]) int PCSetFromOptions(PetscPC) int PCSetUp(PetscPC) int PCReset(PetscPC) int PCSetUpOnBlocks(PetscPC) int PCApply(PetscPC,PetscVec,PetscVec) int PCApplyTranspose(PetscPC,PetscVec,PetscVec) int PCApplySymmetricLeft(PetscPC,PetscVec,PetscVec) int PCApplySymmetricRight(PetscPC,PetscVec,PetscVec) int PCApplyRichardson(PetscPC,PetscVec,PetscVec,PetscVec,PetscReal,PetscReal,PetscReal,PetscInt) int PCApplyBAorAB(PetscPC,PetscPCSide,PetscVec,PetscVec,PetscVec) int PCApplyBAorABTranspose(PetscPC,PetscPCSide,PetscVec,PetscVec,PetscVec) #int PCApplyTransposeExists(PetscPC,PetscBool*) #int PCApplyRichardsonExists(PetscPC,PetscBool*) int PCGetDM(PetscPC,PetscDM*) int PCSetDM(PetscPC,PetscDM) int PCSetOperators(PetscPC,PetscMat,PetscMat) int PCGetOperators(PetscPC,PetscMat*,PetscMat*) int PCGetOperatorsSet(PetscPC,PetscBool*,PetscBool*) int PCSetCoordinates(PetscPC,PetscInt,PetscInt,PetscReal[]) int PCSetUseAmat(PetscPC,PetscBool) int PCComputeExplicitOperator(PetscPC,PetscMat*) int PCDiagonalScale(PetscPC,PetscBool*) int PCDiagonalScaleLeft(PetscPC,PetscVec,PetscVec) int PCDiagonalScaleRight(PetscPC,PetscVec,PetscVec) int PCDiagonalScaleSet(PetscPC,PetscVec) int PCASMSetType(PetscPC,PetscPCASMType) int PCASMSetOverlap(PetscPC,PetscInt) int PCASMSetLocalSubdomains(PetscPC,PetscInt,PetscIS[],PetscIS[]) int PCASMSetTotalSubdomains(PetscPC,PetscInt,PetscIS[],PetscIS[]) int PCASMGetSubKSP(PetscPC,PetscInt*,PetscInt*,PetscKSP*[]) int PCGASMSetType(PetscPC,PetscPCGASMType) int PCGASMSetOverlap(PetscPC,PetscInt) int PCGAMGSetType(PetscPC,PetscPCGAMGType) int PCGAMGSetNlevels(PetscPC,PetscInt) int PCGAMGSetNSmooths(PetscPC,PetscInt) int PCHYPREGetType(PetscPC,PetscPCHYPREType*) int PCHYPRESetType(PetscPC,PetscPCHYPREType) int PCHYPRESetDiscreteCurl(PetscPC,PetscMat); int PCHYPRESetDiscreteGradient(PetscPC,PetscMat); int PCHYPRESetAlphaPoissonMatrix(PetscPC,PetscMat); int PCHYPRESetBetaPoissonMatrix(PetscPC,PetscMat); int PCHYPRESetEdgeConstantVectors(PetscPC,PetscVec,PetscVec,PetscVec); int PCFactorGetMatrix(PetscPC,PetscMat*) int PCFactorSetZeroPivot(PetscPC,PetscReal) int PCFactorSetShiftType(PetscPC,PetscMatFactorShiftType) int PCFactorSetShiftAmount(PetscPC,PetscReal) int PCFactorSetMatSolverType(PetscPC,PetscMatSolverType) int PCFactorGetMatSolverType(PetscPC,PetscMatSolverType*) int PCFactorSetUpMatSolverType(PetscPC) int PCFactorSetFill(PetscPC,PetscReal) int PCFactorSetColumnPivot(PetscPC,PetscReal) int PCFactorReorderForNonzeroDiagonal(PetscPC,PetscReal) int PCFactorSetMatOrderingType(PetscPC,PetscMatOrderingType) int PCFactorSetReuseOrdering(PetscPC,PetscBool ) int PCFactorSetReuseFill(PetscPC,PetscBool ) int PCFactorSetUseInPlace(PetscPC) int PCFactorSetAllowDiagonalFill(PetscPC) int PCFactorSetPivotInBlocks(PetscPC,PetscBool ) int PCFactorSetLevels(PetscPC,PetscInt) int PCFactorSetDropTolerance(PetscPC,PetscReal,PetscReal,PetscInt) int PCFieldSplitSetType(PetscPC,PetscPCCompositeType) int PCFieldSplitSetBlockSize(PetscPC,PetscInt) int PCFieldSplitSetFields(PetscPC,char[],PetscInt,PetscInt*,PetscInt*) int PCFieldSplitSetIS(PetscPC,char[],PetscIS) int PCFieldSplitGetSubKSP(PetscPC,PetscInt*,PetscKSP*[]) int PCFieldSplitSchurGetSubKSP(PetscPC,PetscInt*,PetscKSP*[]) int PCFieldSplitSetSchurPre(PetscPC,PetscPCFieldSplitSchurPreType,PetscMat) int PCFieldSplitSetSchurFactType(PetscPC,PetscPCFieldSplitSchurFactType) #int PCFieldSplitGetSchurBlocks(PetscPC,PetscMat*,PetscMat*,PetscMat*,PetscMat*) int PCCompositeSetType(PetscPC,PetscPCCompositeType) int PCCompositeGetPC(PetscPC,PetscInt,PetscPC*) int PCCompositeAddPCType(PetscPC,PetscPCType) int PCCompositeAddPC(PetscPC,PetscPC) int PCKSPGetKSP(PetscPC,PetscKSP*) int PCSetReusePreconditioner(PetscPC,PetscBool) # --- MG --- int PCMGSetType(PetscPC,PetscPCMGType) int PCMGGetType(PetscPC,PetscPCMGType*) int PCMGSetInterpolation(PetscPC,PetscInt,PetscMat) int PCMGGetInterpolation(PetscPC,PetscInt,PetscMat*) int PCMGSetRestriction(PetscPC,PetscInt,PetscMat) int PCMGGetRestriction(PetscPC,PetscInt,PetscMat*) int PCMGSetRScale(PetscPC,PetscInt,PetscVec) int PCMGGetRScale(PetscPC,PetscInt,PetscVec*) int PCMGGetSmoother(PetscPC,PetscInt,PetscKSP*) int PCMGGetSmootherUp(PetscPC,PetscInt,PetscKSP*) int PCMGGetSmootherDown(PetscPC,PetscInt,PetscKSP*) int PCMGGetCoarseSolve(PetscPC,PetscKSP*) int PCMGSetRhs(PetscPC,PetscInt,PetscVec) int PCMGSetX(PetscPC,PetscInt,PetscVec) int PCMGSetR(PetscPC,PetscInt,PetscVec) int PCMGSetLevels(PetscPC,PetscInt,MPI_Comm*) int PCMGGetLevels(PetscPC,PetscInt*) int PCMGSetCycleType(PetscPC,PetscPCMGCycleType) int PCMGSetCycleTypeOnLevel(PetscPC,PetscInt,PetscPCMGCycleType) int PCBDDCSetDiscreteGradient(PetscPC,PetscMat,PetscInt,PetscInt,PetscBool,PetscBool) int PCBDDCSetDivergenceMat(PetscPC,PetscMat,PetscBool,PetscIS) int PCBDDCSetChangeOfBasisMat(PetscPC,PetscMat,PetscBool) int PCBDDCSetPrimalVerticesIS(PetscPC,PetscIS) int PCBDDCSetPrimalVerticesLocalIS(PetscPC,PetscIS) int PCBDDCSetCoarseningRatio(PetscPC,PetscInt) int PCBDDCSetLevels(PetscPC,PetscInt) int PCBDDCSetDirichletBoundaries(PetscPC,PetscIS) int PCBDDCSetDirichletBoundariesLocal(PetscPC,PetscIS) int PCBDDCSetNeumannBoundaries(PetscPC,PetscIS) int PCBDDCSetNeumannBoundariesLocal(PetscPC,PetscIS) int PCBDDCSetDofsSplitting(PetscPC,PetscInt,PetscIS[]) int PCBDDCSetDofsSplittingLocal(PetscPC,PetscInt,PetscIS[]) # --- Patch --- ctypedef int (*PetscPCPatchComputeOperator)(PetscPC, PetscInt, PetscVec, PetscMat, PetscIS, PetscInt, const PetscInt*, const PetscInt*, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscPCPatchComputeFunction)(PetscPC, PetscInt, PetscVec, PetscVec, PetscIS, PetscInt, const PetscInt*, const PetscInt*, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscPCPatchConstructOperator)(PetscPC, PetscInt*, PetscIS**, PetscIS*, void*) except PETSC_ERR_PYTHON int PCPatchSetCellNumbering(PetscPC, PetscSection) int PCPatchSetDiscretisationInfo(PetscPC, PetscInt, PetscDM*, PetscInt*, PetscInt*, const PetscInt**, const PetscInt*, PetscInt, const PetscInt*, PetscInt, const PetscInt*) int PCPatchSetComputeOperator(PetscPC, PetscPCPatchComputeOperator, void*) int PCPatchSetComputeOperatorInteriorFacets(PetscPC, PetscPCPatchComputeOperator, void*) int PCPatchSetComputeFunction(PetscPC, PetscPCPatchComputeFunction, void*) int PCPatchSetComputeFunctionInteriorFacets(PetscPC, PetscPCPatchComputeFunction, void*) int PCPatchSetConstructType(PetscPC, PetscPCPatchConstructType, PetscPCPatchConstructOperator, void*) # -------------------------------------------------------------------- cdef extern from "libpetsc4py.h": PetscPCType PCPYTHON int PCPythonSetContext(PetscPC,void*) int PCPythonGetContext(PetscPC,void**) int PCPythonSetType(PetscPC,char[]) # -------------------------------------------------------------------- cdef inline PC ref_PC(PetscPC pc): cdef PC ob = PC() ob.pc = pc PetscINCREF(ob.obj) return ob cdef int PCPatch_ComputeOperator( PetscPC pc, PetscInt point, PetscVec vec, PetscMat mat, PetscIS cells, PetscInt ndof, const PetscInt *dofmap, const PetscInt *dofmapWithAll, void *ctx) except PETSC_ERR_PYTHON with gil: cdef Vec Vec = ref_Vec(vec) cdef Mat Mat = ref_Mat(mat) cdef PC Pc = ref_PC(pc) cdef IS Is = ref_IS(cells) cdef object context = Pc.get_attr("__patch_compute_operator__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple (op, args, kargs) = context cdef PetscInt[:] pydofs = dofmap cdef PetscInt[:] pydofsWithAll if dofmapWithAll != NULL: pydofsWithAll = dofmapWithAll dofsall = asarray(pydofsWithAll) else: dofsall = None op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) return 0 cdef int PCPatch_ComputeFunction( PetscPC pc, PetscInt point, PetscVec vec, PetscVec out, PetscIS cells, PetscInt ndof, const PetscInt *dofmap, const PetscInt *dofmapWithAll, void *ctx) except PETSC_ERR_PYTHON with gil: cdef Vec Out = ref_Vec(out) cdef Vec Vec = ref_Vec(vec) cdef PC Pc = ref_PC(pc) cdef IS Is = ref_IS(cells) cdef object context = Pc.get_attr("__patch_compute_function__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple (op, args, kargs) = context cdef PetscInt[:] pydofs = dofmap cdef PetscInt[:] pydofsWithAll = dofmapWithAll op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) return 0 cdef int PCPatch_ComputeOperatorInteriorFacets( PetscPC pc, PetscInt point, PetscVec vec, PetscMat mat, PetscIS facets, PetscInt ndof, const PetscInt *dofmap, const PetscInt *dofmapWithAll, void *ctx) except PETSC_ERR_PYTHON with gil: cdef Vec Vec = ref_Vec(vec) cdef Mat Mat = ref_Mat(mat) cdef PC Pc = ref_PC(pc) cdef IS Is = ref_IS(facets) cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple (op, args, kargs) = context cdef PetscInt[:] pydofs = dofmap cdef PetscInt[:] pydofsWithAll if dofmapWithAll != NULL: pydofsWithAll = dofmapWithAll dofsall = asarray(pydofsWithAll) else: dofsall = None op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) return 0 cdef int PCPatch_ComputeFunctionInteriorFacets( PetscPC pc, PetscInt point, PetscVec vec, PetscVec out, PetscIS facets, PetscInt ndof, const PetscInt *dofmap, const PetscInt *dofmapWithAll, void *ctx) except PETSC_ERR_PYTHON with gil: cdef Vec Out = ref_Vec(out) cdef Vec Vec = ref_Vec(vec) cdef PC Pc = ref_PC(pc) cdef IS Is = ref_IS(facets) cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple (op, args, kargs) = context cdef PetscInt[:] pydofs = dofmap cdef PetscInt[:] pydofsWithAll = dofmapWithAll op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) return 0 cdef int PCPatch_UserConstructOperator( PetscPC pc, PetscInt *n, PetscIS **userIS, PetscIS *userIterationSet, void *ctx) except PETSC_ERR_PYTHON with gil: cdef PC Pc = ref_PC(pc) cdef PetscInt i cdef object context = Pc.get_attr("__patch_construction_operator__") if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple (op, args, kargs) = context (patches, iterationSet) = op(Pc, *args, **kargs) n[0] = len(patches) CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) for i in range(n[0]): userIS[0][i] = (patches[i]).iset PetscINCREF(&(userIS[0][i])) userIterationSet[0] = (iterationSet).iset PetscINCREF(&(userIterationSet[0])) return 0 petsc4py-3.15.1/src/PETSc/SNES.pyx0000644000175000017500000010327013750315427016607 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class SNESType(object): NEWTONLS = S_(SNESNEWTONLS) NEWTONTR = S_(SNESNEWTONTR) PYTHON = S_(SNESPYTHON) NRICHARDSON = S_(SNESNRICHARDSON) KSPONLY = S_(SNESKSPONLY) KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) VINEWTONRSLS = S_(SNESVINEWTONRSLS) VINEWTONSSLS = S_(SNESVINEWTONSSLS) NGMRES = S_(SNESNGMRES) QN = S_(SNESQN) SHELL = S_(SNESSHELL) NGS = S_(SNESNGS) NCG = S_(SNESNCG) FAS = S_(SNESFAS) MS = S_(SNESMS) NASM = S_(SNESNASM) ANDERSON = S_(SNESANDERSON) ASPIN = S_(SNESASPIN) COMPOSITE = S_(SNESCOMPOSITE) PATCH = S_(SNESPATCH) class SNESNormSchedule(object): # native NORM_DEFAULT = SNES_NORM_DEFAULT NORM_NONE = SNES_NORM_NONE NORM_ALWAYS = SNES_NORM_ALWAYS NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY # aliases DEFAULT = NORM_DEFAULT NONE = NORM_NONE ALWAYS = NORM_ALWAYS INITIAL_ONLY = NORM_INITIAL_ONLY FINAL_ONLY = NORM_FINAL_ONLY INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY class SNESConvergedReason(object): # iterating CONVERGED_ITERATING = SNES_CONVERGED_ITERATING ITERATING = SNES_CONVERGED_ITERATING # converged CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE CONVERGED_ITS = SNES_CONVERGED_ITS # diverged DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH DIVERGED_INNER = SNES_DIVERGED_INNER DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN DIVERGED_DTOL = SNES_DIVERGED_DTOL DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN DIVERGED_TR_DELTA = SNES_DIVERGED_TR_DELTA # -------------------------------------------------------------------- cdef class SNES(Object): Type = SNESType NormSchedule = SNESNormSchedule ConvergedReason = SNESConvergedReason # --- xxx --- def __cinit__(self): self.obj = &self.snes self.snes = NULL # --- xxx --- def view(self, Viewer viewer=None): cdef PetscViewer cviewer = NULL if viewer is not None: cviewer = viewer.vwr CHKERR( SNESView(self.snes, cviewer) ) def destroy(self): CHKERR( SNESDestroy(&self.snes) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscSNES newsnes = NULL CHKERR( SNESCreate(ccomm, &newsnes) ) PetscCLEAR(self.obj); self.snes = newsnes return self def setType(self, snes_type): cdef PetscSNESType cval = NULL snes_type = str2bytes(snes_type, &cval) CHKERR( SNESSetType(self.snes, cval) ) def getType(self): cdef PetscSNESType cval = NULL CHKERR( SNESGetType(self.snes, &cval) ) return bytes2str(cval) def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) def getOptionsPrefix(self): cdef const char *cval = NULL CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( SNESSetFromOptions(self.snes) ) # --- application context --- def setAppCtx(self, appctx): self.set_attr('__appctx__', appctx) def getAppCtx(self): return self.get_attr('__appctx__') # --- discretization space --- def getDM(self): cdef PetscDM newdm = NULL CHKERR( SNESGetDM(self.snes, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm PetscINCREF(dm.obj) return dm def setDM(self, DM dm): CHKERR( SNESSetDM(self.snes, dm.dm) ) # --- FAS --- def setFASInterpolation(self, level, Mat mat): cdef PetscInt clevel = asInt(level) CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) def getFASInterpolation(self, level): cdef PetscInt clevel = asInt(level) cdef Mat mat = Mat() CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) PetscINCREF(mat.obj) return mat def setFASRestriction(self, level, Mat mat): cdef PetscInt clevel = asInt(level) CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) def getFASRestriction(self, level): cdef PetscInt clevel = asInt(level) cdef Mat mat = Mat() CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) PetscINCREF(mat.obj) return mat def setFASInjection(self, level, Mat mat): cdef PetscInt clevel = asInt(level) CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) def getFASInjection(self, level): cdef PetscInt clevel = asInt(level) cdef Mat mat = Mat() CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) PetscINCREF(mat.obj) return mat def setFASRScale(self, level, Vec vec): cdef PetscInt clevel = asInt(level) CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) def setFASLevels(self, levels, comms=None): cdef PetscInt clevels = asInt(levels) cdef MPI_Comm *ccomms = NULL cdef Py_ssize_t i = 0 if comms is not None: if clevels != len(comms): raise ValueError("Must provide as many communicators as levels") CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) try: for i, comm in enumerate(comms): ccomms[i] = def_Comm(comm, MPI_COMM_NULL) CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) finally: CHKERR( PetscFree(ccomms) ) else: CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) def getFASLevels(self): cdef PetscInt levels = 0 CHKERR( SNESFASGetLevels(self.snes, &levels) ) return toInt(levels) def getFASCycleSNES(self, level): cdef PetscInt clevel = asInt(level) cdef SNES lsnes = SNES() CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) PetscINCREF(lsnes.obj) return lsnes def getFASCoarseSolve(self): cdef SNES smooth = SNES() CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) PetscINCREF(smooth.obj) return smooth def getFASSmoother(self, level): cdef PetscInt clevel = asInt(level) cdef SNES smooth = SNES() CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) PetscINCREF(smooth.obj) return smooth def getFASSmootherDown(self, level): cdef PetscInt clevel = asInt(level) cdef SNES smooth = SNES() CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) PetscINCREF(smooth.obj) return smooth def getFASSmootherUp(self, level): cdef PetscInt clevel = asInt(level) cdef SNES smooth = SNES() CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) PetscINCREF(smooth.obj) return smooth # --- nonlinear preconditioner --- def getNPC(self): cdef SNES snes = SNES() CHKERR( SNESGetNPC(self.snes, &snes.snes) ) PetscINCREF(snes.obj) return snes def hasNPC(self): cdef PetscBool flag = PETSC_FALSE CHKERR( SNESHasNPC(self.snes, &flag) ) return toBool(flag) def setNPC(self, SNES snes): CHKERR( SNESSetNPC(self.snes, snes.snes) ) # --- user Function/Jacobian routines --- def setLineSearchPreCheck(self, precheck, args=None, kargs=None): cdef PetscSNESLineSearch snesls = NULL SNESGetLineSearch(self.snes, &snesls) if precheck is not None: if args is None: args = () if kargs is None: kargs = {} context = (precheck, args, kargs) self.set_attr('__precheck__', context) CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) else: self.set_attr('__precheck__', None) CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) def setInitialGuess(self, initialguess, args=None, kargs=None): if initialguess is not None: if args is None: args = () if kargs is None: kargs = {} context = (initialguess, args, kargs) self.set_attr('__initialguess__', context) CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, context) ) else: self.set_attr('__initialguess__', None) CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) ) def getInitialGuess(self): return self.get_attr('__initialguess__') def setFunction(self, function, Vec f, args=None, kargs=None): cdef PetscVec fvec=NULL if f is not None: fvec = f.vec if function is not None: if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr('__function__', context) CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) else: CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) def getFunction(self): cdef Vec f = Vec() cdef void* ctx cdef int (*fun)(PetscSNES,PetscVec,PetscVec,void*) CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) PetscINCREF(f.obj) cdef object function = self.get_attr('__function__') cdef object context if function is not None: return (f, function) if ctx != NULL and SNES_Function == fun: context = ctx if context is not None: assert type(context) is tuple return (f, context) return (f, None) def setUpdate(self, update, args=None, kargs=None): if update is not None: if args is None: args = () if kargs is None: kargs = {} context = (update, args, kargs) self.set_attr('__update__', context) CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) else: self.set_attr('__update__', None) CHKERR( SNESSetUpdate(self.snes, NULL) ) def getUpdate(self): return self.get_attr('__update__') def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat cdef PetscMat Pmat=Jmat if P is not None: Pmat = P.mat if jacobian is not None: if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr('__jacobian__', context) CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) else: CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) def getJacobian(self): cdef Mat J = Mat() cdef Mat P = Mat() CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) PetscINCREF(J.obj) PetscINCREF(P.obj) cdef object jacobian = self.get_attr('__jacobian__') return (J, P, jacobian) def setObjective(self, objective, args=None, kargs=None): if objective is not None: if args is None: args = () if kargs is None: kargs = {} context = (objective, args, kargs) self.set_attr('__objective__', context) CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) else: CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) def getObjective(self): CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) cdef object objective = self.get_attr('__objective__') return objective def computeFunction(self, Vec x, Vec f): CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) def computeJacobian(self, Vec x, Mat J, Mat P=None): cdef PetscMat jmat = J.mat, pmat = J.mat if P is not None: pmat = P.mat CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) def computeObjective(self, Vec x): cdef PetscReal o = 0 CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) return toReal(o) def setNGS(self, ngs, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (ngs, args, kargs) self.set_attr('__ngs__', context) CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) def getNGS(self): CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) cdef object ngs = self.get_attr('__ngs__') return ngs def computeNGS(self, Vec x, Vec b=None): cdef PetscVec bvec = NULL if b is not None: bvec = b.vec CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) # --- tolerances and convergence --- def setTolerances(self, rtol=None, atol=None, stol=None, max_it=None): cdef PetscReal crtol, catol, cstol crtol = catol = cstol = PETSC_DEFAULT cdef PetscInt cmaxit = PETSC_DEFAULT if rtol is not None: crtol = asReal(rtol) if atol is not None: catol = asReal(atol) if stol is not None: cstol = asReal(stol) if max_it is not None: cmaxit = asInt(max_it) CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, cmaxit, PETSC_DEFAULT) ) def getTolerances(self): cdef PetscReal crtol=0, catol=0, cstol=0 cdef PetscInt cmaxit=0 CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, &cmaxit, NULL) ) return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) def setNormSchedule(self, normsched): CHKERR( SNESSetNormSchedule(self.snes, normsched) ) def getNormSchedule(self): cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) return normsched def setConvergenceTest(self, converged, args=None, kargs=None): if converged == "skip": self.set_attr('__converged__', None) CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) elif converged is None or converged == "default": self.set_attr('__converged__', None) CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) else: assert callable(converged) if args is None: args = () if kargs is None: kargs = {} context = (converged, args, kargs) self.set_attr('__converged__', context) CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) def getConvergenceTest(self): return self.get_attr('__converged__') def callConvergenceTest(self, its, xnorm, ynorm, fnorm): cdef PetscInt ival = asInt(its) cdef PetscReal rval1 = asReal(xnorm) cdef PetscReal rval2 = asReal(ynorm) cdef PetscReal rval3 = asReal(fnorm) cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING CHKERR( SNESConvergenceTestCall(self.snes, ival, rval1, rval2, rval3, &reason) ) return reason def setConvergenceHistory(self, length=None, reset=False): cdef PetscReal *rdata = NULL cdef PetscInt *idata = NULL cdef PetscInt size = 1000 cdef PetscBool flag = PETSC_FALSE if length is True: pass elif length is not None: size = asInt(length) if size < 0: size = 1000 if reset: flag = PETSC_TRUE cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) cdef object ihist = oarray_i(empty_i(size), NULL, &idata) self.set_attr('__history__', (rhist, ihist)) CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) def getConvergenceHistory(self): cdef PetscReal *rdata = NULL cdef PetscInt *idata = NULL cdef PetscInt size = 0 CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) cdef object rhist = array_r(size, rdata) cdef object ihist = array_i(size, idata) return (rhist, ihist) def logConvergenceHistory(self, norm, linear_its=0): cdef PetscReal rval = asReal(norm) cdef PetscInt ival = asInt(linear_its) CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) def setResetCounters(self, reset=True): cdef PetscBool flag = reset CHKERR( SNESSetCountersReset(self.snes, flag) ) # --- monitoring --- def setMonitor(self, monitor, args=None, kargs=None): if monitor is None: return cdef object monitorlist = self.get_attr('__monitor__') if monitorlist is None: monitorlist = [] self.set_attr('__monitor__', monitorlist) CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) if args is None: args = () if kargs is None: kargs = {} context = (monitor, args, kargs) monitorlist.append(context) def getMonitor(self): return self.get_attr('__monitor__') def cancelMonitor(self): CHKERR( SNESMonitorCancel(self.snes) ) self.set_attr('__monitor__', None) def monitor(self, its, rnorm): cdef PetscInt ival = asInt(its) cdef PetscReal rval = asReal(rnorm) CHKERR( SNESMonitor(self.snes, ival, rval) ) # --- more tolerances --- def setMaxFunctionEvaluations(self, max_funcs): cdef PetscReal r = PETSC_DEFAULT cdef PetscInt i = PETSC_DEFAULT cdef PetscInt ival = asInt(max_funcs) CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) def getMaxFunctionEvaluations(self): cdef PetscReal *r = NULL cdef PetscInt *i = NULL cdef PetscInt ival = 0 CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) return toInt(ival) def getFunctionEvaluations(self): cdef PetscInt ival = 0 CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) return toInt(ival) def setMaxStepFailures(self, max_fails): cdef PetscInt ival = asInt(max_fails) CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) def getMaxStepFailures(self): cdef PetscInt ival = 0 CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) return toInt(ival) def getStepFailures(self): cdef PetscInt ival = 0 CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) return toInt(ival) def setMaxKSPFailures(self, max_fails): cdef PetscInt ival = asInt(max_fails) CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) def getMaxKSPFailures(self): cdef PetscInt ival = 0 CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) return toInt(ival) def getKSPFailures(self): cdef PetscInt ival = 0 CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) return toInt(ival) setMaxNonlinearStepFailures = setMaxStepFailures getMaxNonlinearStepFailures = getMaxStepFailures getNonlinearStepFailures = getStepFailures setMaxLinearSolveFailures = setMaxKSPFailures getMaxLinearSolveFailures = getMaxKSPFailures getLinearSolveFailures = getKSPFailures # --- solving --- def setUp(self): CHKERR( SNESSetUp(self.snes) ) def reset(self): CHKERR( SNESReset(self.snes) ) def solve(self, Vec b or None, Vec x): cdef PetscVec rhs = NULL if b is not None: rhs = b.vec CHKERR( SNESSolve(self.snes, rhs, x.vec) ) def setConvergedReason(self, reason): cdef PetscSNESConvergedReason eval = reason CHKERR( SNESSetConvergedReason(self.snes, eval) ) def getConvergedReason(self): cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING CHKERR( SNESGetConvergedReason(self.snes, &reason) ) return reason def setIterationNumber(self, its): cdef PetscInt ival = asInt(its) CHKERR( SNESSetIterationNumber(self.snes, ival) ) def getIterationNumber(self): cdef PetscInt ival = 0 CHKERR( SNESGetIterationNumber(self.snes, &ival) ) return toInt(ival) def setFunctionNorm(self, norm): cdef PetscReal rval = asReal(norm) CHKERR( SNESSetFunctionNorm(self.snes, rval) ) def getFunctionNorm(self): cdef PetscReal rval = 0 CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) return toReal(rval) def getLinearSolveIterations(self): cdef PetscInt ival = 0 CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) return toInt(ival) def getRhs(self): cdef Vec vec = Vec() CHKERR( SNESGetRhs(self.snes, &vec.vec) ) PetscINCREF(vec.obj) return vec def getSolution(self): cdef Vec vec = Vec() CHKERR( SNESGetSolution(self.snes, &vec.vec) ) PetscINCREF(vec.obj) return vec def setSolution(self, Vec vec): CHKERR( SNESSetSolution(self.snes, vec.vec) ) def getSolutionUpdate(self): cdef Vec vec = Vec() CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) PetscINCREF(vec.obj) return vec # --- linear solver --- def setKSP(self, KSP ksp): CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) def getKSP(self): cdef KSP ksp = KSP() CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) PetscINCREF(ksp.obj) return ksp def setUseEW(self, flag=True, *targs, **kargs): cdef PetscBool bval = flag CHKERR( SNESKSPSetUseEW(self.snes, bval) ) if targs or kargs: self.setParamsEW(*targs, **kargs) def getUseEW(self): cdef PetscBool flag = PETSC_FALSE CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) return toBool(flag) def setParamsEW(self, version=None, rtol_0=None, rtol_max=None, gamma=None, alpha=None, alpha2=None, threshold=None): cdef PetscInt cversion = PETSC_DEFAULT cdef PetscReal crtol_0 = PETSC_DEFAULT cdef PetscReal crtol_max = PETSC_DEFAULT cdef PetscReal cgamma = PETSC_DEFAULT cdef PetscReal calpha = PETSC_DEFAULT cdef PetscReal calpha2 = PETSC_DEFAULT cdef PetscReal cthreshold = PETSC_DEFAULT if version is not None: cversion = asInt(version) if rtol_0 is not None: crtol_0 = asReal(rtol_0) if rtol_max is not None: crtol_max = asReal(rtol_max) if gamma is not None: cgamma = asReal(gamma) if alpha is not None: calpha = asReal(alpha) if alpha2 is not None: calpha2 = asReal(alpha2) if threshold is not None: cthreshold = asReal(threshold) CHKERR( SNESKSPSetParametersEW( self.snes, cversion, crtol_0, crtol_max, cgamma, calpha, calpha2, cthreshold) ) def getParamsEW(self): cdef PetscInt version=0 cdef PetscReal rtol_0=0, rtol_max=0 cdef PetscReal gamma=0, alpha=0, alpha2=0 cdef PetscReal threshold=0 CHKERR( SNESKSPGetParametersEW( self.snes, &version, &rtol_0, &rtol_max, &gamma, &alpha, &alpha2, &threshold) ) return {'version' : toInt(version), 'rtol_0' : toReal(rtol_0), 'rtol_max' : toReal(rtol_max), 'gamma' : toReal(gamma), 'alpha' : toReal(alpha), 'alpha2' : toReal(alpha2), 'threshold' : toReal(threshold),} # --- matrix free / finite diferences --- def setUseMF(self, flag=True): cdef PetscBool bval = flag CHKERR( SNESSetUseMFFD(self.snes, bval) ) def getUseMF(self): cdef PetscBool flag = PETSC_FALSE CHKERR( SNESGetUseMFFD(self.snes, &flag) ) return toBool(flag) def setUseFD(self, flag=True): cdef PetscBool bval = flag CHKERR( SNESSetUseFDColoring(self.snes, bval) ) def getUseFD(self): cdef PetscBool flag = PETSC_FALSE CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) return toBool(flag) # --- VI --- def setVariableBounds(self, Vec xl, Vec xu): CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) def getVIInactiveSet(self): cdef IS inact = IS() CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) PetscINCREF(inact.obj) return inact # --- Python --- def createPython(self, context=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscSNES newsnes = NULL CHKERR( SNESCreate(ccomm, &newsnes) ) PetscCLEAR(self.obj); self.snes = newsnes CHKERR( SNESSetType(self.snes, SNESPYTHON) ) CHKERR( SNESPythonSetContext(self.snes, context) ) return self def setPythonContext(self, context): CHKERR( SNESPythonSetContext(self.snes, context) ) def getPythonContext(self): cdef void *context = NULL CHKERR( SNESPythonGetContext(self.snes, &context) ) if context == NULL: return None else: return context def setPythonType(self, py_type): cdef const char *cval = NULL py_type = str2bytes(py_type, &cval) CHKERR( SNESPythonSetType(self.snes, cval) ) # --- Composite --- def getCompositeSNES(self, n): cdef PetscInt cn cdef SNES snes = SNES() cn = asInt(n) CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) PetscINCREF(snes.obj) return snes def getCompositeNumber(self): cdef PetscInt cn = 0 CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) return toInt(cn) # --- NASM --- def getNASMSNES(self, n): cdef PetscInt cn = asInt(n) cdef SNES snes = SNES() CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) PetscINCREF(snes.obj) return snes def getNASMNumber(self): cdef PetscInt cn = 0 CHKERR( SNESNASMGetNumber(self.snes, &cn) ) return toInt(cn) # --- Patch --- def setPatchCellNumbering(self, Section sec not None): CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) def setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes): cdef PetscInt numSubSpaces = 0 cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 cdef PetscInt *nodesPerCell = NULL cdef const PetscInt **ccellNodeMaps = NULL cdef PetscDM *cdms = NULL cdef PetscInt *cbs = NULL cdef PetscInt *csubspaceOffsets = NULL cdef PetscInt *cghostBcNodes = NULL cdef PetscInt *cglobalBcNodes = NULL cdef PetscInt i = 0 bs = iarray_i(bs, &numSubSpaces, &cbs) ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) for i in range(numSubSpaces): cdms[i] = (dms[i]).dm _, nodes = asarray(cellNodeMaps[i]).shape cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) nodesPerCell[i] = asInt(nodes) # TODO: refactor on the PETSc side to take ISes? CHKERR( SNESPatchSetDiscretisationInfo(self.snes, numSubSpaces, cdms, cbs, nodesPerCell, ccellNodeMaps, csubspaceOffsets, numGhostBcs, cghostBcNodes, numGlobalBcs, cglobalBcNodes) ) CHKERR( PetscFree(nodesPerCell) ) CHKERR( PetscFree(cdms) ) CHKERR( PetscFree(ccellNodeMaps) ) def setPatchComputeOperator(self, operator, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (operator, args, kargs) self.set_attr("__patch_compute_operator__", context) CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) def setPatchComputeFunction(self, function, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (function, args, kargs) self.set_attr("__patch_compute_function__", context) CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: raise ValueError("Must provide operator for USER or PYTHON type") if operator is not None: context = (operator, args, kargs) else: context = None self.set_attr("__patch_construction_operator__", context) CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, context) ) # --- application context --- property appctx: def __get__(self): return self.getAppCtx() def __set__(self, value): self.setAppCtx(value) # --- discretization space --- property dm: def __get__(self): return self.getDM() def __set__(self, value): self.setDM(value) # --- nonlinear preconditioner --- property npc: def __get__(self): return self.getNPC() def __set__(self, value): self.setNPC(value) # --- vectors --- property vec_sol: def __get__(self): return self.getSolution() property vec_upd: def __get__(self): return self.getSolutionUpdate() property vec_rhs: def __get__(self): return self.getRhs() # --- linear solver --- property ksp: def __get__(self): return self.getKSP() def __set__(self, value): self.setKSP(value) property use_ew: def __get__(self): return self.getUseEW() def __set__(self, value): self.setUseEW(value) # --- tolerances --- property rtol: def __get__(self): return self.getTolerances()[0] def __set__(self, value): self.setTolerances(rtol=value) property atol: def __get__(self): return self.getTolerances()[1] def __set__(self, value): self.setTolerances(atol=value) property stol: def __get__(self): return self.getTolerances()[2] def __set__(self, value): self.setTolerances(stol=value) property max_it: def __get__(self): return self.getTolerances()[3] def __set__(self, value): self.setTolerances(max_it=value) # --- more tolerances --- property max_funcs: def __get__(self): return self.getMaxFunctionEvaluations() def __set__(self, value): self.setMaxFunctionEvaluations(value) # --- iteration --- property its: def __get__(self): return self.getIterationNumber() def __set__(self, value): self.setIterationNumber(value) property norm: def __get__(self): return self.getFunctionNorm() def __set__(self, value): self.setFunctionNorm(value) property history: def __get__(self): return self.getConvergenceHistory() # --- convergence --- property reason: def __get__(self): return self.getConvergedReason() def __set__(self, value): self.setConvergedReason(value) property iterating: def __get__(self): return self.reason == 0 property converged: def __get__(self): return self.reason > 0 property diverged: def __get__(self): return self.reason < 0 # --- matrix free / finite diferences --- property use_mf: def __get__(self): return self.getUseMF() def __set__(self, value): self.setUseMF(value) property use_fd: def __get__(self): return self.getUseFD() def __set__(self, value): self.setUseFD(value) # -------------------------------------------------------------------- del SNESType del SNESNormSchedule del SNESConvergedReason # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/IS.pyx0000644000175000017500000004403013750315427016350 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class ISType(object): GENERAL = S_(ISGENERAL) BLOCK = S_(ISBLOCK) STRIDE = S_(ISSTRIDE) # -------------------------------------------------------------------- cdef class IS(Object): Type = ISType # def __cinit__(self): self.obj = &self.iset self.iset = NULL # buffer interface (PEP 3118) def __getbuffer__(self, Py_buffer *view, int flags): cdef _IS_buffer buf = _IS_buffer(self) buf.acquirebuffer(view, flags) def __releasebuffer__(self, Py_buffer *view): cdef _IS_buffer buf = <_IS_buffer>(view.obj) buf.releasebuffer(view) self # unused # 'with' statement (PEP 343) def __enter__(self): cdef _IS_buffer buf = _IS_buffer(self) self.set_attr('__buffer__', buf) return buf.enter() def __exit__(self, *exc): cdef _IS_buffer buf = self.get_attr('__buffer__') self.set_attr('__buffer__', None) return buf.exit() # def view(self, Viewer viewer=None): cdef PetscViewer cviewer = NULL if viewer is not None: cviewer = viewer.vwr CHKERR( ISView(self.iset, cviewer) ) def destroy(self): CHKERR( ISDestroy(&self.iset) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscIS newiset = NULL CHKERR( ISCreate(ccomm, &newiset) ) PetscCLEAR(self.obj); self.iset = newiset return self def setType(self, is_type): cdef PetscISType cval = NULL is_type = str2bytes(is_type, &cval) CHKERR( ISSetType(self.iset, cval) ) def getType(self): cdef PetscISType cval = NULL CHKERR( ISGetType(self.iset, &cval) ) return bytes2str(cval) def createGeneral(self, indices, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt nidx = 0, *idx = NULL cdef PetscCopyMode cm = PETSC_COPY_VALUES cdef PetscIS newiset = NULL indices = iarray_i(indices, &nidx, &idx) CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) PetscCLEAR(self.obj); self.iset = newiset return self def createBlock(self, bsize, indices, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs = asInt(bsize) cdef PetscInt nidx = 0, *idx = NULL cdef PetscCopyMode cm = PETSC_COPY_VALUES cdef PetscIS newiset = NULL indices = iarray_i(indices, &nidx, &idx) CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) PetscCLEAR(self.obj); self.iset = newiset return self def createStride(self, size, first=0, step=0, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt csize = asInt(size) cdef PetscInt cfirst = asInt(first) cdef PetscInt cstep = asInt(step) cdef PetscIS newiset = NULL CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) PetscCLEAR(self.obj); self.iset = newiset return self def duplicate(self): cdef IS iset = type(self)() CHKERR( ISDuplicate(self.iset, &iset.iset) ) return iset def copy(self, IS result=None): if result is None: result = type(self)() if result.iset == NULL: CHKERR( ISDuplicate(self.iset, &result.iset) ) CHKERR( ISCopy(self.iset, result.iset) ) return result def load(self, Viewer viewer): cdef MPI_Comm comm = MPI_COMM_NULL cdef PetscObject obj = (viewer.vwr) if self.iset == NULL: CHKERR( PetscObjectGetComm(obj, &comm) ) CHKERR( ISCreate(comm, &self.iset) ) CHKERR( ISLoad(self.iset, viewer.vwr) ) return self def allGather(self): cdef IS iset = IS() CHKERR( ISAllGather(self.iset, &iset.iset) ) return iset def toGeneral(self): CHKERR( ISToGeneral(self.iset) ) return self def invertPermutation(self, nlocal=None): cdef PetscInt cnlocal = PETSC_DECIDE if nlocal is not None: cnlocal = asInt(nlocal) cdef IS iset = IS() CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) return iset def getSize(self): cdef PetscInt N = 0 CHKERR( ISGetSize(self.iset, &N) ) return toInt(N) def getLocalSize(self): cdef PetscInt n = 0 CHKERR( ISGetLocalSize(self.iset, &n) ) return toInt(n) def getSizes(self): cdef PetscInt n = 0, N = 0 CHKERR( ISGetLocalSize(self.iset, &n) ) CHKERR( ISGetSize(self.iset, &N) ) return (toInt(n), toInt(N)) def getBlockSize(self): cdef PetscInt bs = 1 CHKERR( ISGetBlockSize(self.iset, &bs) ) return toInt(bs) def setBlockSize(self, bs): cdef PetscInt cbs = asInt(bs) CHKERR( ISSetBlockSize(self.iset, cbs) ) def sort(self): CHKERR( ISSort(self.iset) ) return self def isSorted(self): cdef PetscBool flag = PETSC_FALSE CHKERR( ISSorted(self.iset, &flag) ) return toBool(flag) def setPermutation(self): CHKERR( ISSetPermutation(self.iset) ) return self def isPermutation(self): cdef PetscBool flag = PETSC_FALSE CHKERR( ISPermutation(self.iset, &flag) ) return toBool(flag) def setIdentity(self): CHKERR( ISSetIdentity(self.iset) ) return self def isIdentity(self): cdef PetscBool flag = PETSC_FALSE CHKERR( ISIdentity(self.iset, &flag) ) return toBool(flag) def equal(self, IS iset): cdef PetscBool flag = PETSC_FALSE CHKERR( ISEqual(self.iset, iset.iset, &flag) ) return toBool(flag) def sum(self, IS iset): cdef IS out = IS() CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) return out def expand(self, IS iset): cdef IS out = IS() CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) return out def union(self, IS iset): # XXX review this cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE CHKERR( ISSorted(self.iset, &flag1) ) CHKERR( ISSorted(iset.iset, &flag2) ) cdef IS out = IS() if flag1==PETSC_TRUE and flag2==PETSC_TRUE: CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) else: CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) return out def difference(self, IS iset): cdef IS out = IS() CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) return out def complement(self, nmin, nmax): cdef PetscInt cnmin = asInt(nmin) cdef PetscInt cnmax = asInt(nmax) cdef IS out = IS() CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) return out def embed(self, IS iset, drop): cdef PetscBool bval = drop cdef IS out = IS() CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) return out def renumber(self, IS mult=None): cdef PetscIS mlt = NULL if mult is not None: mlt = mult.iset cdef IS out = IS() cdef PetscInt n = 0 CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) return (toInt(n), out) # def setIndices(self, indices): cdef PetscInt nidx = 0, *idx = NULL cdef PetscCopyMode cm = PETSC_COPY_VALUES indices = iarray_i(indices, &nidx, &idx) CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) def getIndices(self): cdef PetscInt size = 0 cdef const PetscInt *indices = NULL CHKERR( ISGetLocalSize(self.iset, &size) ) CHKERR( ISGetIndices(self.iset, &indices) ) cdef object oindices = None try: oindices = array_i(size, indices) finally: CHKERR( ISRestoreIndices(self.iset, &indices) ) return oindices def setBlockIndices(self, bsize, indices): cdef PetscInt bs = asInt(bsize) cdef PetscInt nidx = 0, *idx = NULL cdef PetscCopyMode cm = PETSC_COPY_VALUES indices = iarray_i(indices, &nidx, &idx) CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) def getBlockIndices(self): cdef PetscInt size = 0, bs = 1 cdef const PetscInt *indices = NULL CHKERR( ISGetLocalSize(self.iset, &size) ) CHKERR( ISGetBlockSize(self.iset, &bs) ) CHKERR( ISBlockGetIndices(self.iset, &indices) ) cdef object oindices = None try: oindices = array_i(size//bs, indices) finally: CHKERR( ISBlockRestoreIndices(self.iset, &indices) ) return oindices def setStride(self, size, first=0, step=1): cdef PetscInt csize = asInt(size) cdef PetscInt cfirst = asInt(first) cdef PetscInt cstep = asInt(step) CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) def getStride(self): cdef PetscInt size=0, first=0, step=0 CHKERR( ISGetLocalSize(self.iset, &size) ) CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) return (toInt(size), toInt(first), toInt(step)) def getInfo(self): cdef PetscInt first = 0, step = 0 CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) return (toInt(first), toInt(step)) # property permutation: def __get__(self): return self.isPermutation() property identity: def __get__(self): return self.isIdentity() property sorted: def __get__(self): return self.isSorted() # property sizes: def __get__(self): return self.getSizes() property size: def __get__(self): return self.getSize() property local_size: def __get__(self): return self.getLocalSize() property block_size: def __get__(self): return self.getBlockSize() property indices: def __get__(self): return self.getIndices() property array: def __get__(self): return asarray(self) # --- NumPy array interface (legacy) --- property __array_interface__: def __get__(self): cdef _IS_buffer buf = _IS_buffer(self) return buf.__array_interface__ # -------------------------------------------------------------------- class GLMapMode(object): MASK = PETSC_IS_GTOLM_MASK DROP = PETSC_IS_GTOLM_DROP class LGMapType(object): BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) # -------------------------------------------------------------------- cdef class LGMap(Object): MapMode = GLMapMode Type = LGMapType # def __cinit__(self): self.obj = &self.lgm self.lgm = NULL def __call__(self, indices, result=None): self.apply(indices, result) # def setType(self, lgmap_type): cdef PetscISLocalToGlobalMappingType cval = NULL lgmap_type = str2bytes(lgmap_type, &cval) CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) def setFromOptions(self): CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) def view(self, Viewer viewer=None): cdef PetscViewer cviewer = NULL if viewer is not None: cviewer = viewer.vwr CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) def destroy(self): CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) ) return self def create(self, indices, bsize=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs = 1, nidx = 0, *idx = NULL cdef PetscCopyMode cm = PETSC_COPY_VALUES cdef PetscLGMap newlgm = NULL if bsize is not None: bs = asInt(bsize) if bs == PETSC_DECIDE: bs = 1 indices = iarray_i(indices, &nidx, &idx) CHKERR( ISLocalToGlobalMappingCreate( ccomm, bs, nidx, idx, cm, &newlgm) ) PetscCLEAR(self.obj); self.lgm = newlgm return self def createIS(self, IS iset): cdef PetscLGMap newlgm = NULL CHKERR( ISLocalToGlobalMappingCreateIS( iset.iset, &newlgm) ) PetscCLEAR(self.obj); self.lgm = newlgm return self def createSF(self, SF sf, start): cdef PetscLGMap newlgm = NULL cdef PetscInt cstart = asInt(start) CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) PetscCLEAR(self.obj); self.lgm = newlgm return self def getSize(self): cdef PetscInt n = 0 CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) return toInt(n) def getBlockSize(self): cdef PetscInt bs = 1 CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) return toInt(bs) def getIndices(self): cdef PetscInt size = 0 cdef const PetscInt *indices = NULL CHKERR( ISLocalToGlobalMappingGetSize( self.lgm, &size) ) CHKERR( ISLocalToGlobalMappingGetIndices( self.lgm, &indices) ) cdef object oindices = None try: oindices = array_i(size, indices) finally: CHKERR( ISLocalToGlobalMappingRestoreIndices( self.lgm, &indices) ) return oindices def getBlockIndices(self): cdef PetscInt size = 0, bs = 1 cdef const PetscInt *indices = NULL CHKERR( ISLocalToGlobalMappingGetSize( self.lgm, &size) ) CHKERR( ISLocalToGlobalMappingGetBlockSize( self.lgm, &bs) ) CHKERR( ISLocalToGlobalMappingGetBlockIndices( self.lgm, &indices) ) cdef object oindices = None try: oindices = array_i(size//bs, indices) finally: CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( self.lgm, &indices) ) return oindices def getInfo(self): cdef PetscInt i, nproc = 0, *procs = NULL, cdef PetscInt *numprocs = NULL, **indices = NULL cdef object neighs = { } CHKERR( ISLocalToGlobalMappingGetInfo( self.lgm, &nproc, &procs, &numprocs, &indices) ) try: for i from 0 <= i < nproc: neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) finally: ISLocalToGlobalMappingRestoreInfo( self.lgm, &nproc, &procs, &numprocs, &indices) return neighs def getBlockInfo(self): cdef PetscInt i, nproc = 0, *procs = NULL, cdef PetscInt *numprocs = NULL, **indices = NULL cdef object neighs = { } CHKERR( ISLocalToGlobalMappingGetBlockInfo( self.lgm, &nproc, &procs, &numprocs, &indices) ) try: for i from 0 <= i < nproc: neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) finally: ISLocalToGlobalMappingRestoreBlockInfo( self.lgm, &nproc, &procs, &numprocs, &indices) return neighs # def apply(self, indices, result=None): cdef PetscInt niidx = 0, *iidx = NULL cdef PetscInt noidx = 0, *oidx = NULL indices = iarray_i(indices, &niidx, &iidx) if result is None: result = empty_i(niidx) result = oarray_i(result, &noidx, &oidx) assert niidx == noidx, "incompatible array sizes" CHKERR( ISLocalToGlobalMappingApply( self.lgm, niidx, iidx, oidx) ) return result def applyBlock(self, indices, result=None): cdef PetscInt niidx = 0, *iidx = NULL cdef PetscInt noidx = 0, *oidx = NULL indices = iarray_i(indices, &niidx, &iidx) if result is None: result = empty_i(niidx) result = oarray_i(result, &noidx, &oidx) assert niidx == noidx, "incompatible array sizes" CHKERR( ISLocalToGlobalMappingApplyBlock( self.lgm, niidx, iidx, oidx) ) return result def applyIS(self, IS iset): cdef IS result = IS() CHKERR( ISLocalToGlobalMappingApplyIS( self.lgm, iset.iset, &result.iset) ) return result def applyInverse(self, indices, mode=None): cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK if mode is not None: cmode = mode cdef PetscInt n = 0, *idx = NULL indices = iarray_i(indices, &n, &idx) cdef PetscInt nout = n, *idxout = NULL if cmode != PETSC_IS_GTOLM_MASK: CHKERR( ISGlobalToLocalMappingApply( self.lgm, cmode, n, idx, &nout, NULL) ) result = oarray_i(empty_i(nout), &nout, &idxout) CHKERR( ISGlobalToLocalMappingApply( self.lgm, cmode, n, idx, &nout, idxout) ) return result def applyBlockInverse(self, indices, mode=None): cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK if mode is not None: cmode = mode cdef PetscInt n = 0, *idx = NULL indices = iarray_i(indices, &n, &idx) cdef PetscInt nout = n, *idxout = NULL if cmode != PETSC_IS_GTOLM_MASK: CHKERR( ISGlobalToLocalMappingApply( self.lgm, cmode, n, idx, &nout, NULL) ) result = oarray_i(empty_i(nout), &nout, &idxout) CHKERR( ISGlobalToLocalMappingApplyBlock( self.lgm, cmode, n, idx, &nout, idxout) ) return result # property size: def __get__(self): return self.getSize() property block_size: def __get__(self): return self.getBlockSize() property indices: def __get__(self): return self.getIndices() property block_indices: def __get__(self): return self.getBlockIndices() property info: def __get__(self): return self.getInfo() property block_info: def __get__(self): return self.getBlockInfo() # -------------------------------------------------------------------- del ISType del GLMapMode del LGMapType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/DMShell.pyx0000644000175000017500000002147513750315427017335 0ustar balaybalay00000000000000cdef class DMShell(DM): def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDM newdm = NULL CHKERR( DMShellCreate(ccomm, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def setMatrix(self, Mat mat): CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) def setGlobalVector(self, Vec gv): CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) def setLocalVector(self, Vec lv): CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) def setCreateGlobalVector(self, create_gvec, args=None, kargs=None): if create_gvec is not None: if args is None: args = () if kargs is None: kargs = {} context = (create_gvec, args, kargs) self.set_attr('__create_global_vector__', context) CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) else: CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) def setCreateLocalVector(self, create_lvec, args=None, kargs=None): if create_lvec is not None: if args is None: args = () if kargs is None: kargs = {} context = (create_lvec, args, kargs) self.set_attr('__create_local_vector__', context) CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) else: CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) def setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None): cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL if begin is not None: if begin_args is None: begin_args = () if begin_kargs is None: begin_kargs = {} context = (begin, begin_args, begin_kargs) self.set_attr('__g2l_begin__', context) cbegin = &DMSHELL_GlobalToLocalBegin if end is not None: if end_args is None: end_args = () if end_kargs is None: end_kargs = {} context = (end, end_args, end_kargs) self.set_attr('__g2l_end__', context) cend = &DMSHELL_GlobalToLocalEnd CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) def setGlobalToLocalVecScatter(self, Scatter gtol): CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) def setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None): cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL if begin is not None: if begin_args is None: begin_args = () if begin_kargs is None: begin_kargs = {} context = (begin, begin_args, begin_kargs) self.set_attr('__l2g_begin__', context) cbegin = &DMSHELL_LocalToGlobalBegin if end is not None: if end_args is None: end_args = () if end_kargs is None: end_kargs = {} context = (end, end_args, end_kargs) self.set_attr('__l2g_end__', context) cend = &DMSHELL_LocalToGlobalEnd CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) def setLocalToGlobalVecScatter(self, Scatter ltog): CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) def setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None): cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL cbegin = NULL cend = NULL if begin is not None: if begin_args is None: begin_args = () if begin_kargs is None: begin_kargs = {} context = (begin, begin_args, begin_kargs) self.set_attr('__l2l_begin__', context) cbegin = &DMSHELL_LocalToLocalBegin if end is not None: if end_args is None: end_args = () if end_kargs is None: end_kargs = {} context = (end, end_args, end_kargs) self.set_attr('__l2l_end__', context) cend = &DMSHELL_LocalToLocalEnd CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) def setLocalToLocalVecScatter(self, Scatter ltol): CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) def setCreateMatrix(self, create_matrix, args=None, kargs=None): if create_matrix is not None: if args is None: args = () if kargs is None: kargs = {} context = (create_matrix, args, kargs) self.set_attr('__create_matrix__', context) CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) else: CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) def setCoarsen(self, coarsen, args=None, kargs=None): if coarsen is not None: if args is None: args = () if kargs is None: kargs = {} context = (coarsen, args, kargs) self.set_attr('__coarsen__', context) CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) else: CHKERR( DMShellSetCoarsen(self.dm, NULL) ) def setRefine(self, refine, args=None, kargs=None): if refine is not None: if args is None: args = () if kargs is None: kargs = {} context = (refine, args, kargs) self.set_attr('__refine__', context) CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) else: CHKERR( DMShellSetRefine(self.dm, NULL) ) def setCreateInterpolation(self, create_interpolation, args=None, kargs=None): if create_interpolation is not None: if args is None: args = () if kargs is None: kargs = {} context = (create_interpolation, args, kargs) self.set_attr('__create_interpolation__', context) CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) else: CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) def setCreateInjection(self, create_injection, args=None, kargs=None): if create_injection is not None: if args is None: args = () if kargs is None: kargs = {} context = (create_injection, args, kargs) self.set_attr('__create_injection__', context) CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) else: CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) def setCreateRestriction(self, create_restriction, args=None, kargs=None): if create_restriction is not None: if args is None: args = () if kargs is None: kargs = {} context = (create_restriction, args, kargs) self.set_attr('__create_restriction__', context) CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) else: CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) def setCreateFieldDecomposition(self, decomp, args=None, kargs=None): if decomp is not None: if args is None: args = () if kargs is None: kargs = {} context = (decomp, args, kargs) self.set_attr('__create_field_decomp__', context) CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) else: CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) def setCreateDomainDecomposition(self, decomp, args=None, kargs=None): if decomp is not None: if args is None: args = () if kargs is None: kargs = {} context = (decomp, args, kargs) self.set_attr('__create_domain_decomp__', context) CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) else: CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) def setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None): if scatter is not None: if args is None: args = () if kargs is None: kargs = {} context = (scatter, args, kargs) self.set_attr('__create_domain_decomp_scatters__', context) CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) else: CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) def setCreateSubDM(self, create_subdm, args=None, kargs=None): if create_subdm is not None: if args is None: args = () if kargs is None: kargs = {} context = (create_subdm, args, kargs) self.set_attr('__create_subdm__', context) CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) else: CHKERR( DMShellSetCreateSubDM(self.dm, NULL) ) petsc4py-3.15.1/src/PETSc/petscvwr.pxi0000644000175000017500000001367213750315427017702 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscViewerType PetscViewerType PETSCVIEWERSOCKET PetscViewerType PETSCVIEWERASCII PetscViewerType PETSCVIEWERBINARY PetscViewerType PETSCVIEWERSTRING PetscViewerType PETSCVIEWERDRAW PetscViewerType PETSCVIEWERVU PetscViewerType PETSCVIEWERMATHEMATICA PetscViewerType PETSCVIEWERHDF5 PetscViewerType PETSCVIEWERVTK PetscViewerType PETSCVIEWERMATLAB PetscViewerType PETSCVIEWERSAWS PetscViewerType PETSCVIEWERGLVIS PetscViewerType PETSCVIEWERADIOS PetscViewerType PETSCVIEWERADIOS2 PetscViewerType PETSCVIEWEREXODUSII ctypedef enum PetscViewerFormat: PETSC_VIEWER_DEFAULT PETSC_VIEWER_ASCII_MATLAB PETSC_VIEWER_ASCII_MATHEMATICA PETSC_VIEWER_ASCII_IMPL PETSC_VIEWER_ASCII_INFO PETSC_VIEWER_ASCII_INFO_DETAIL PETSC_VIEWER_ASCII_COMMON PETSC_VIEWER_ASCII_SYMMODU PETSC_VIEWER_ASCII_INDEX PETSC_VIEWER_ASCII_DENSE PETSC_VIEWER_ASCII_MATRIXMARKET PETSC_VIEWER_ASCII_VTK_DEPRECATED PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED PETSC_VIEWER_ASCII_PCICE PETSC_VIEWER_ASCII_PYTHON PETSC_VIEWER_ASCII_FACTOR_INFO PETSC_VIEWER_ASCII_LATEX PETSC_VIEWER_ASCII_XML PETSC_VIEWER_ASCII_GLVIS PETSC_VIEWER_ASCII_CSV PETSC_VIEWER_DRAW_BASIC PETSC_VIEWER_DRAW_LG PETSC_VIEWER_DRAW_LG_XRANGE PETSC_VIEWER_DRAW_CONTOUR PETSC_VIEWER_DRAW_PORTS PETSC_VIEWER_VTK_VTS PETSC_VIEWER_VTK_VTR PETSC_VIEWER_VTK_VTU PETSC_VIEWER_BINARY_MATLAB PETSC_VIEWER_NATIVE PETSC_VIEWER_HDF5_PETSC PETSC_VIEWER_HDF5_VIZ PETSC_VIEWER_HDF5_XDMF PETSC_VIEWER_HDF5_MAT PETSC_VIEWER_NOFORMAT PETSC_VIEWER_LOAD_BALANCE PETSC_VIEWER_FAILED ctypedef enum PetscFileMode: PETSC_FILE_MODE_READ "FILE_MODE_READ" PETSC_FILE_MODE_WRITE "FILE_MODE_WRITE" PETSC_FILE_MODE_APPEND "FILE_MODE_APPEND" PETSC_FILE_MODE_UPDATE "FILE_MODE_UPDATE" PETSC_FILE_MODE_APPEND_UPDATE "FILE_MODE_APPEND_UPDATE" enum: PETSC_DRAW_FULL_SIZE enum: PETSC_DRAW_HALF_SIZE enum: PETSC_DRAW_THIRD_SIZE enum: PETSC_DRAW_QUARTER_SIZE int PetscViewerView(PetscViewer,PetscViewer) int PetscViewerDestroy(PetscViewer*) int PetscViewerCreate(MPI_Comm,PetscViewer*) int PetscViewerSetType(PetscViewer,PetscViewerType) int PetscViewerGetType(PetscViewer,PetscViewerType*) int PetscViewerSetOptionsPrefix(PetscViewer,char[]) int PetscViewerAppendOptionsPrefix(PetscViewer,char[]) int PetscViewerGetOptionsPrefix(PetscViewer,char*[]) int PetscViewerSetFromOptions(PetscViewer) int PetscViewerSetUp(PetscViewer) int PetscViewerASCIIOpen(MPI_Comm,char[],PetscViewer*) int PetscViewerBinaryCreate(MPI_Comm comm,PetscViewer*) int PetscViewerBinaryOpen(MPI_Comm,char[],PetscFileMode,PetscViewer*) int PetscViewerDrawOpen(MPI_Comm,char[],char[],int,int,int,int,PetscViewer*) int PetscViewerBinarySetUseMPIIO(PetscViewer,PetscBool) int PetscViewerSetFormat(PetscViewer,PetscViewerFormat) int PetscViewerGetFormat(PetscViewer,PetscViewerFormat*) int PetscViewerPushFormat(PetscViewer,PetscViewerFormat) int PetscViewerPopFormat(PetscViewer) int PetscViewerASCIISetTab(PetscViewer,PetscInt) int PetscViewerASCIIGetTab(PetscViewer,PetscInt*) int PetscViewerASCIIAddTab(PetscViewer,PetscInt) int PetscViewerASCIISubtractTab(PetscViewer,PetscInt) int PetscViewerASCIIPushSynchronized(PetscViewer) int PetscViewerASCIIPopSynchronized(PetscViewer) int PetscViewerASCIIPushTab(PetscViewer) int PetscViewerASCIIPopTab(PetscViewer) int PetscViewerASCIIUseTabs(PetscViewer,PetscBool) int PetscViewerASCIIPrintf(PetscViewer,const char[],...) int PetscViewerASCIISynchronizedPrintf(PetscViewer,const char[],...) int PetscViewerFileGetName(PetscViewer,char*[]) int PetscViewerFileSetName(PetscViewer,char[]) int PetscViewerFileGetMode(PetscViewer,PetscFileMode*) int PetscViewerFileSetMode(PetscViewer,PetscFileMode) int PetscViewerFlush(PetscViewer) int PetscViewerDrawClear(PetscViewer) int PetscViewerDrawSetInfo(PetscViewer,char[],char[],int,int,int,int) int PetscViewerHDF5GetTimestep(PetscViewer,PetscInt*) int PetscViewerHDF5SetTimestep(PetscViewer,PetscInt) int PetscViewerHDF5IncrementTimestep(PetscViewer) int PetscViewerHDF5PushGroup(PetscViewer,char[]) int PetscViewerHDF5PopGroup(PetscViewer) int PetscViewerHDF5GetGroup(PetscViewer,char*[]) PetscViewer PETSC_VIEWER_STDOUT_(MPI_Comm) except? NULL PetscViewer PETSC_VIEWER_STDOUT_SELF PetscViewer PETSC_VIEWER_STDOUT_WORLD PetscViewer PETSC_VIEWER_STDERR_(MPI_Comm) except? NULL PetscViewer PETSC_VIEWER_STDERR_SELF PetscViewer PETSC_VIEWER_STDERR_WORLD PetscViewer PETSC_VIEWER_BINARY_(MPI_Comm) except? NULL PetscViewer PETSC_VIEWER_BINARY_SELF PetscViewer PETSC_VIEWER_BINARY_WORLD PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm) except? NULL PetscViewer PETSC_VIEWER_DRAW_SELF PetscViewer PETSC_VIEWER_DRAW_WORLD # --- cdef inline PetscFileMode filemode(object mode) except (-1): if mode is None: return PETSC_FILE_MODE_READ if isinstance(mode, str): if mode == 'r' : return PETSC_FILE_MODE_READ elif mode == 'w' : return PETSC_FILE_MODE_WRITE elif mode == 'a' : return PETSC_FILE_MODE_APPEND elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE elif mode == 'u' : return PETSC_FILE_MODE_UPDATE elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE return mode petsc4py-3.15.1/src/PETSc/Mat.pyx0000644000175000017500000017462214062763234016571 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class MatType(object): SAME = S_(MATSAME) MAIJ = S_(MATMAIJ) SEQMAIJ = S_(MATSEQMAIJ) MPIMAIJ = S_(MATMPIMAIJ) KAIJ = S_(MATKAIJ) SEQKAIJ = S_(MATSEQKAIJ) MPIKAIJ = S_(MATMPIKAIJ) IS = S_(MATIS) AIJ = S_(MATAIJ) SEQAIJ = S_(MATSEQAIJ) MPIAIJ = S_(MATMPIAIJ) AIJCRL = S_(MATAIJCRL) SEQAIJCRL = S_(MATSEQAIJCRL) MPIAIJCRL = S_(MATMPIAIJCRL) AIJCUSPARSE = S_(MATAIJCUSPARSE) SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) AIJVIENNACL = S_(MATAIJVIENNACL) SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) AIJPERM = S_(MATAIJPERM) SEQAIJPERM = S_(MATSEQAIJPERM) MPIAIJPERM = S_(MATMPIAIJPERM) AIJSELL = S_(MATAIJSELL) SEQAIJSELL = S_(MATSEQAIJSELL) MPIAIJSELL = S_(MATMPIAIJSELL) AIJMKL = S_(MATAIJMKL) SEQAIJMKL = S_(MATSEQAIJMKL) MPIAIJMKL = S_(MATMPIAIJMKL) BAIJMKL = S_(MATBAIJMKL) SEQBAIJMKL = S_(MATSEQBAIJMKL) MPIBAIJMKL = S_(MATMPIBAIJMKL) SHELL = S_(MATSHELL) DENSE = S_(MATDENSE) SEQDENSE = S_(MATSEQDENSE) SEQDENSECUDA = S_(MATSEQDENSECUDA) MPIDENSE = S_(MATMPIDENSE) ELEMENTAL = S_(MATELEMENTAL) BAIJ = S_(MATBAIJ) SEQBAIJ = S_(MATSEQBAIJ) MPIBAIJ = S_(MATMPIBAIJ) MPIADJ = S_(MATMPIADJ) SBAIJ = S_(MATSBAIJ) SEQSBAIJ = S_(MATSEQSBAIJ) MPISBAIJ = S_(MATMPISBAIJ) MFFD = S_(MATMFFD) NORMAL = S_(MATNORMAL) NORMALHERMITIAN = S_(MATNORMALHERMITIAN) LRC = S_(MATLRC) SCATTER = S_(MATSCATTER) BLOCKMAT = S_(MATBLOCKMAT) COMPOSITE = S_(MATCOMPOSITE) FFT = S_(MATFFT) FFTW = S_(MATFFTW) SEQCUFFT = S_(MATSEQCUFFT) TRANSPOSEMAT = S_(MATTRANSPOSEMAT) SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) PYTHON = S_(MATPYTHON) HYPRE = S_(MATHYPRE) HYPRESTRUCT = S_(MATHYPRESTRUCT) HYPRESSTRUCT = S_(MATHYPRESSTRUCT) SUBMATRIX = S_(MATSUBMATRIX) LOCALREF = S_(MATLOCALREF) NEST = S_(MATNEST) PREALLOCATOR = S_(MATPREALLOCATOR) SELL = S_(MATSELL) SEQSELL = S_(MATSEQSELL) MPISELL = S_(MATMPISELL) DUMMY = S_(MATDUMMY) LMVM = S_(MATLMVM) LMVMDFP = S_(MATLMVMDFP) LMVMBFGS = S_(MATLMVMBFGS) LMVMSR1 = S_(MATLMVMSR1) LMVMBROYDEN = S_(MATLMVMBROYDEN) LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) HARA = S_(MATHARA) class MatOption(object): OPTION_MIN = MAT_OPTION_MIN UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR ROW_ORIENTED = MAT_ROW_ORIENTED SYMMETRIC = MAT_SYMMETRIC STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES USE_HASH_TABLE = MAT_USE_HASH_TABLE KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES USE_INODES = MAT_USE_INODES HERMITIAN = MAT_HERMITIAN SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR SPD = MAT_SPD NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS STRUCTURE_ONLY = MAT_STRUCTURE_ONLY SORTED_FULL = MAT_SORTED_FULL OPTION_MAX = MAT_OPTION_MAX class MatAssemblyType(object): # native FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY # aliases FINAL = FINAL_ASSEMBLY FLUSH = FLUSH_ASSEMBLY class MatInfoType(object): LOCAL = MAT_LOCAL GLOBAL_MAX = MAT_GLOBAL_MAX GLOBAL_SUM = MAT_GLOBAL_SUM class MatStructure(object): # native SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN # aliases SAME = SAME_NZ = SAME_NONZERO_PATTERN SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN class MatOrderingType(object): NATURAL = S_(MATORDERINGNATURAL) ND = S_(MATORDERINGND) OWD = S_(MATORDERING1WD) RCM = S_(MATORDERINGRCM) QMD = S_(MATORDERINGQMD) ROWLENGTH = S_(MATORDERINGROWLENGTH) WBM = S_(MATORDERINGWBM) SPECTRAL = S_(MATORDERINGSPECTRAL) AMD = S_(MATORDERINGAMD) class MatSolverType(object): SUPERLU = S_(MATSOLVERSUPERLU) SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) STRUMPACK = S_(MATSOLVERSTRUMPACK) UMFPACK = S_(MATSOLVERUMFPACK) CHOLMOD = S_(MATSOLVERCHOLMOD) KLU = S_(MATSOLVERKLU) SPARSEELEMENTAL = S_(MATSOLVERSPARSEELEMENTAL) ELEMENTAL = S_(MATSOLVERELEMENTAL) SCALAPACK = S_(MATSOLVERSCALAPACK) ESSL = S_(MATSOLVERESSL) LUSOL = S_(MATSOLVERLUSOL) MUMPS = S_(MATSOLVERMUMPS) MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) PASTIX = S_(MATSOLVERPASTIX) MATLAB = S_(MATSOLVERMATLAB) PETSC = S_(MATSOLVERPETSC) BAS = S_(MATSOLVERBAS) CUSPARSE = S_(MATSOLVERCUSPARSE) CUDA = S_(MATSOLVERCUDA) class MatFactorShiftType(object): # native NONE = MAT_SHIFT_NONE NONZERO = MAT_SHIFT_NONZERO POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE INBLOCKS = MAT_SHIFT_INBLOCKS # aliases NZ = MAT_SHIFT_NONZERO PD = MAT_SHIFT_POSITIVE_DEFINITE class MatSORType(object): FORWARD_SWEEP = SOR_FORWARD_SWEEP BACKWARD_SWEEP = SOR_BACKWARD_SWEEP SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS EISENSTAT = SOR_EISENSTAT APPLY_UPPER = SOR_APPLY_UPPER APPLY_LOWER = SOR_APPLY_LOWER # -------------------------------------------------------------------- cdef class Mat(Object): Type = MatType Option = MatOption AssemblyType = MatAssemblyType InfoType = MatInfoType Structure = MatStructure OrderingType = MatOrderingType SolverType = MatSolverType FactorShiftType = MatFactorShiftType SORType = MatSORType # def __cinit__(self): self.obj = &self.mat self.mat = NULL # unary operations def __pos__(self): return mat_pos(self) def __neg__(self): return mat_neg(self) # inplace binary operations def __iadd__(self, other): return mat_iadd(self, other) def __isub__(self, other): return mat_isub(self, other) def __imul__(self, other): return mat_imul(self, other) def __idiv__(self, other): return mat_idiv(self, other) def __itruediv__(self, other): return mat_idiv(self, other) # binary operations def __add__(self, other): if isinstance(self, Mat): return mat_add(self, other) else: return mat_radd(other, self) def __sub__(self, other): if isinstance(self, Mat): return mat_sub(self, other) else: return mat_rsub(other, self) def __mul__(self, other): if isinstance(self, Mat): if isinstance(other, Vec): return mat_mul_vec(self, other) else: return mat_mul(self, other) else: return mat_rmul(other, self) def __div__(self, other): if isinstance(self, Mat): return mat_div(self, other) else: return mat_rdiv(other, self) def __truediv__(self, other): if isinstance(self, Mat): return mat_div(self, other) else: return mat_rdiv(other, self) # def __getitem__(self, ij): return mat_getitem(self, ij) def __setitem__(self, ij, v): mat_setitem(self, ij, v) def __call__(self, x, y=None): if y is None: y = self.createVecLeft() self.mult(x, y) return y # def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( MatView(self.mat, vwr) ) def destroy(self): CHKERR( MatDestroy(&self.mat) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscMat newmat = NULL CHKERR( MatCreate(ccomm, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat return self def setType(self, mat_type): cdef PetscMatType cval = NULL mat_type = str2bytes(mat_type, &cval) CHKERR( MatSetType(self.mat, cval) ) def setSizes(self, size, bsize=None): cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) CHKERR( MatSetSizes(self.mat, m, n, M, N) ) if rbs != PETSC_DECIDE: if cbs != PETSC_DECIDE: CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) else: CHKERR( MatSetBlockSize(self.mat, rbs) ) def setBlockSize(self, bsize): cdef PetscInt bs = asInt(bsize) CHKERR( MatSetBlockSize(self.mat, bs) ) def setBlockSizes(self, row_bsize, col_bsize): cdef PetscInt rbs = asInt(row_bsize) cdef PetscInt cbs = asInt(col_bsize) CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) # def createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None): # create matrix cdef PetscMat newmat = NULL Mat_Create(MATAIJ, comm, size, bsize, &newmat) PetscCLEAR(self.obj); self.mat = newmat # preallocate matrix Mat_AllocAIJ(self.mat, nnz, csr) return self def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # create matrix cdef PetscMat newmat = NULL Mat_Create(MATBAIJ, comm, size, bsize, &newmat) PetscCLEAR(self.obj); self.mat = newmat # preallocate matrix Mat_AllocAIJ(self.mat, nnz, csr) return self def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # create matrix cdef PetscMat newmat = NULL Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) PetscCLEAR(self.obj); self.mat = newmat # preallocate matrix Mat_AllocAIJ(self.mat, nnz, csr) return self def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None): # create matrix cdef PetscMat newmat = NULL Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) PetscCLEAR(self.obj); self.mat = newmat # preallocate matrix Mat_AllocAIJ(self.mat, nnz, csr) return self def setPreallocationNNZ(self, nnz): cdef PetscBool done = PETSC_FALSE CHKERR( MatIsPreallocated(self.mat, &done) ) # if done: raise Error(PETSC_ERR_ORDER) Mat_AllocAIJ_NNZ(self.mat, nnz) return self def setPreallocationCSR(self, csr): cdef PetscBool done = PETSC_FALSE CHKERR( MatIsPreallocated(self.mat, &done) ) # if done: raise Error(PETSC_ERR_ORDER) Mat_AllocAIJ_CSR(self.mat, csr) return self def createAIJWithArrays(self, size, csr, bsize=None, comm=None): # communicator cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # sizes and block sizes cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) if rbs == PETSC_DECIDE: rbs = 1 if cbs == PETSC_DECIDE: cbs = rbs Sys_Layout(ccomm, rbs, &m, &M) Sys_Layout(ccomm, cbs, &n, &N) # unpack CSR argument cdef object pi, pj, pv, poi, poj, pov try: (pi, pj, pv), (poi, poj, pov) = csr except (TypeError, ValueError): pi, pj, pv = csr poi = poj = pov = None # rows, cols, and values cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) if ni != m+1: raise ValueError( "A matrix with %d rows requires a row pointer of length %d (given: %d)" % (toInt(m), toInt(m+1), toInt(ni))) if poi is not None and poj is not None: poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) cdef PetscInt nv=0, nov=0 cdef PetscScalar *v=NULL, *ov=NULL pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) if nj != nv: raise ValueError( "Given %d column indices but %d non-zero values" % (toInt(nj), toInt(nv))) if pov is not None: pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) # create matrix cdef PetscMat newmat = NULL if comm_size(ccomm) == 1: CHKERR( MatCreateSeqAIJWithArrays( ccomm, m, n, i, j, v, &newmat) ) csr = (pi, pj, pv) else: if oi != NULL and oj != NULL and ov != NULL: CHKERR( MatCreateMPIAIJWithSplitArrays( ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) csr = ((pi, pj, pv), (poi, poj, pov)) else: CHKERR( MatCreateMPIAIJWithArrays( ccomm, m, n, M, N, i, j, v, &newmat) ) csr = None PetscCLEAR(self.obj); self.mat = newmat self.set_attr('__csr__', csr) return self # def createDense(self, size, bsize=None, array=None, comm=None): # create matrix cdef PetscMat newmat = NULL Mat_Create(MATDENSE, comm, size, bsize, &newmat) PetscCLEAR(self.obj); self.mat = newmat # preallocate matrix if array is not None: array = Mat_AllocDense(self.mat, array) self.set_attr('__array__', array) return self def setPreallocationDense(self, array): cdef PetscBool done = PETSC_FALSE CHKERR( MatIsPreallocated(self.mat, &done) ) # if done: raise Error(PETSC_ERR_ORDER) array = Mat_AllocDense(self.mat, array) self.set_attr('__array__', array) return self # def createScatter(self, Scatter scatter, comm=None): if comm is None: comm = scatter.getComm() cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscMat newmat = NULL CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat return self def createNormal(self, Mat mat): cdef PetscMat newmat = NULL CHKERR( MatCreateNormal(mat.mat, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat return self def createTranspose(self, Mat mat): cdef PetscMat newmat = NULL CHKERR( MatCreateTranspose(mat.mat, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat return self def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): cdef PetscMat Amat = NULL cdef PetscMat Umat = U.mat cdef PetscVec cvec = NULL cdef PetscMat Vmat = NULL cdef PetscMat newmat = NULL if A is not None: Amat = A.mat if c is not None: cvec = c.vec if V is not None: Vmat = V.mat CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat return self def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): if iscol is None: iscol = isrow cdef PetscMat newmat = NULL CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat return self def createNest(self, mats, isrows=None, iscols=None, comm=None): cdef object mat mats = [list(mat) for mat in mats] if isrows: isrows = list(isrows) assert len(isrows) == len(mats) else: isrows = None if iscols: iscols = list(iscols) assert len(iscols) == len(mats[0]) else: iscols = None cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef Py_ssize_t i, mr = len(mats) cdef Py_ssize_t j, mc = len(mats[0]) cdef PetscInt nr = mr cdef PetscInt nc = mc cdef PetscMat *cmats = NULL cdef PetscIS *cisrows = NULL cdef PetscIS *ciscols = NULL cdef object tmp1, tmp2, tmp3 tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) for i from 0 <= i < mr: for j from 0 <= j < mc: mat = mats[i][j] cmats[i*mc+j] = (mat).mat if mat is not None else NULL if isrows is not None: tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset if iscols is not None: tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset cdef PetscMat newmat = NULL CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat return self ##def createIS(self, size, LGMap lgmap, comm=None): ## # communicator and sizes ## if comm is None: comm = lgmap.getComm() ## cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) ## cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 ## Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) ## Sys_Layout(ccomm, rbs, &m, &M) ## Sys_Layout(ccomm, cbs, &n, &N) ## # create matrix ## cdef PetscMat newmat = NULL ## CHKERR( MatCreateIS(ccomm, m, n, M, N, lgmap.lgm, &newmat) ) ## PetscCLEAR(self.obj); self.mat = newmat ## return self def createPython(self, size, context=None, comm=None): # communicator and sizes cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) Sys_Layout(ccomm, rbs, &m, &M) Sys_Layout(ccomm, cbs, &n, &N) # create matrix cdef PetscMat newmat = NULL CHKERR( MatCreate(ccomm, &newmat) ) PetscCLEAR(self.obj); self.mat = newmat CHKERR( MatSetSizes(self.mat, m, n, M, N) ) CHKERR( MatSetType(self.mat, MATPYTHON) ) CHKERR( MatPythonSetContext(self.mat, context) ) return self def setPythonContext(self, context): CHKERR( MatPythonSetContext(self.mat, context) ) def getPythonContext(self): cdef void *context = NULL CHKERR( MatPythonGetContext(self.mat, &context) ) if context == NULL: return None else: return context def setPythonType(self, py_type): cdef const char *cval = NULL py_type = str2bytes(py_type, &cval) CHKERR( MatPythonSetType(self.mat, cval) ) # def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( MatSetOptionsPrefix(self.mat, cval) ) def getOptionsPrefix(self): cdef const char *cval = NULL CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( MatSetFromOptions(self.mat) ) def setUp(self): CHKERR( MatSetUp(self.mat) ) return self def setOption(self, option, flag): CHKERR( MatSetOption(self.mat, option, flag) ) def getType(self): cdef PetscMatType cval = NULL CHKERR( MatGetType(self.mat, &cval) ) return bytes2str(cval) def getSize(self): cdef PetscInt M = 0, N = 0 CHKERR( MatGetSize(self.mat, &M, &N) ) return (toInt(M), toInt(N)) def getLocalSize(self): cdef PetscInt m = 0, n = 0 CHKERR( MatGetLocalSize(self.mat, &m, &n) ) return (toInt(m), toInt(n)) def getSizes(self): cdef PetscInt m = 0, n = 0 cdef PetscInt M = 0, N = 0 CHKERR( MatGetLocalSize(self.mat, &m, &n) ) CHKERR( MatGetSize(self.mat, &M, &N) ) return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) def getBlockSize(self): cdef PetscInt bs = 0 CHKERR( MatGetBlockSize(self.mat, &bs) ) return toInt(bs) def getBlockSizes(self): cdef PetscInt rbs = 0, cbs = 0 CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) return (toInt(rbs), toInt(cbs)) def getOwnershipRange(self): cdef PetscInt ival1 = 0, ival2 = 0 CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) return (toInt(ival1), toInt(ival2)) def getOwnershipRanges(self): cdef const PetscInt *rowrng = NULL CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) cdef MPI_Comm comm = MPI_COMM_NULL CHKERR( PetscObjectGetComm(self.mat, &comm) ) cdef int size = -1 CHKERR( MPI_Comm_size(comm, &size) ) return array_i(size+1, rowrng) def getOwnershipRangeColumn(self): cdef PetscInt ival1 = 0, ival2 = 0 CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) return (toInt(ival1), toInt(ival2)) def getOwnershipRangesColumn(self): cdef const PetscInt *colrng = NULL CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) cdef MPI_Comm comm = MPI_COMM_NULL CHKERR( PetscObjectGetComm(self.mat, &comm) ) cdef int size = -1 CHKERR( MPI_Comm_size(comm, &size) ) return array_i(size+1, colrng) def getOwnershipIS(self): cdef IS rows = IS() cdef IS cols = IS() CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) return (rows, cols) def getInfo(self, info=None): cdef PetscMatInfoType itype = infotype(info) cdef PetscMatInfo cinfo CHKERR( MatGetInfo(self.mat, itype, &cinfo) ) return cinfo def duplicate(self, copy=False): cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES if copy: flag = MAT_COPY_VALUES if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN cdef Mat mat = type(self)() CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) return mat def copy(self, Mat result=None, structure=None): cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES cdef PetscMatStructure mstr = matstructure(structure) if result is None: result = type(self)() if result.mat == NULL: CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) else: CHKERR( MatCopy(self.mat, result.mat, mstr) ) return result def load(self, Viewer viewer): cdef MPI_Comm comm = MPI_COMM_NULL cdef PetscObject obj = (viewer.vwr) if self.mat == NULL: CHKERR( PetscObjectGetComm(obj, &comm) ) CHKERR( MatCreate(comm, &self.mat) ) CHKERR( MatLoad(self.mat, viewer.vwr) ) return self def convert(self, mat_type=None, Mat out=None): cdef PetscMatType mtype = MATSAME cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX mat_type = str2bytes(mat_type, &mtype) if mtype == NULL: mtype = MATSAME if out is None: out = self if out.mat == self.mat: reuse = MAT_INPLACE_MATRIX elif out.mat == NULL: reuse = MAT_INITIAL_MATRIX else: reuse = MAT_REUSE_MATRIX CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) return out def transpose(self, Mat out=None): cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX if out is None: out = self if out.mat == self.mat: reuse = MAT_INPLACE_MATRIX elif out.mat == NULL: reuse = MAT_INITIAL_MATRIX else: reuse = MAT_REUSE_MATRIX CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) return out def realPart(self, Mat out=None): if out is None: out = self elif out.mat == NULL: CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) CHKERR( MatRealPart(out.mat) ) return out def imagPart(self, Mat out=None): if out is None: out = self elif out.mat == NULL: CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) CHKERR( MatImaginaryPart(out.mat) ) return out def conjugate(self, Mat out=None): if out is None: out = self elif out.mat == NULL: CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) CHKERR( MatConjugate(out.mat) ) return out def permute(self, IS row, IS col): cdef Mat mat = Mat() CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) return mat def equal(self, Mat mat): cdef PetscBool flag = PETSC_FALSE CHKERR( MatEqual(self.mat, mat.mat, &flag) ) return toBool(flag) def isTranspose(self, Mat mat=None, tol=0): if mat is None: mat = self cdef PetscReal rval = asReal(tol) cdef PetscBool flag = PETSC_FALSE CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) return toBool(flag) def isSymmetric(self, tol=0): cdef PetscReal rval = asReal(tol) cdef PetscBool flag = PETSC_FALSE CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) return toBool(flag) def isSymmetricKnown(self): cdef PetscBool flag1 = PETSC_FALSE cdef PetscBool flag2 = PETSC_FALSE CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) return (toBool(flag1), toBool(flag2)) def isHermitian(self, tol=0): cdef PetscReal rval = asReal(tol) cdef PetscBool flag = PETSC_FALSE CHKERR( MatIsHermitian(self.mat, rval, &flag) ) return toBool(flag) def isHermitianKnown(self): cdef PetscBool flag1 = PETSC_FALSE cdef PetscBool flag2 = PETSC_FALSE CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) return (toBool(flag1), toBool(flag2)) def isStructurallySymmetric(self): cdef PetscBool flag = PETSC_FALSE CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) return toBool(flag) def zeroEntries(self): CHKERR( MatZeroEntries(self.mat) ) def getValue(self, row, col): cdef PetscInt ival1 = asInt(row) cdef PetscInt ival2 = asInt(col) cdef PetscScalar sval = 0 CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) return toScalar(sval) def getValues(self, rows, cols, values=None): return matgetvalues(self.mat, rows, cols, values) def getValuesCSR(self): # row ownership cdef PetscInt rstart=0, rend=0, nrows=0 CHKERR( MatGetOwnershipRange(self.mat, &rstart, &rend) ) nrows = rend - rstart # first pass: row pointer array cdef PetscInt *AI = NULL cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) cdef PetscInt irow=0, ncols=0 AI[0] = 0 for irow from 0 <= irow < nrows: CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) AI[irow+1] = AI[irow] + ncols CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) # second pass: column indices and values cdef PetscInt *AJ = NULL cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) cdef PetscScalar *AV = NULL cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) cdef const PetscInt *cols = NULL cdef const PetscScalar *vals = NULL for irow from 0 <= irow < nrows: CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) # return (ai, aj, av) def getRow(self, row): cdef PetscInt irow = asInt(row) cdef PetscInt ncols = 0 cdef const PetscInt *icols=NULL cdef const PetscScalar *svals=NULL CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) cdef object cols = array_i(ncols, icols) cdef object vals = array_s(ncols, svals) CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) return (cols, vals) def getRowIJ(self, symmetric=False, compressed=False): cdef PetscInt shift=0 cdef PetscBool symm=symmetric cdef PetscBool bcmp=compressed cdef PetscInt n=0 cdef const PetscInt *ia=NULL cdef const PetscInt *ja=NULL cdef PetscBool done=PETSC_FALSE CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) cdef object ai=None, aj=None if done != PETSC_FALSE: ai = array_i( n+1, ia) if done != PETSC_FALSE: aj = array_i(ia[n], ja) CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) return (ai, aj) def getColumnIJ(self, symmetric=False, compressed=False): cdef PetscInt shift=0 cdef PetscBool symm=symmetric, bcmp=compressed cdef PetscInt n=0 cdef const PetscInt *ia=NULL cdef const PetscInt *ja=NULL cdef PetscBool done=PETSC_FALSE CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) cdef object ai=None, aj=None if done != PETSC_FALSE: ai = array_i( n+1, ia) if done != PETSC_FALSE: aj = array_i(ia[n], ja) CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) return (ai, aj) def setValue(self, row, col, value, addv=None): cdef PetscInt ival1 = asInt(row) cdef PetscInt ival2 = asInt(col) cdef PetscScalar sval = asScalar(value) cdef PetscInsertMode caddv = insertmode(addv) CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) def setValues(self, rows, cols, values, addv=None): matsetvalues(self.mat, rows, cols, values, addv, 0, 0) def setValuesRCV(self, R, C, V, addv=None): matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) def setValuesIJV(self, I, J, V, addv=None, rowmap=None): matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) def setValuesCSR(self, I, J, V, addv=None): matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) def setValuesBlocked(self, rows, cols, values, addv=None): matsetvalues(self.mat, rows, cols, values, addv, 1, 0) def setValuesBlockedRCV(self, R, C, V, addv=None): matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None): matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) def setValuesBlockedCSR(self, I, J, V, addv=None): matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) def setLGMap(self, LGMap rmap, LGMap cmap=None): if cmap is None: cmap = rmap CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) def getLGMap(self): cdef LGMap cmap = LGMap() cdef LGMap rmap = LGMap() CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) PetscINCREF(cmap.obj) PetscINCREF(rmap.obj) return (rmap, cmap) def setValueLocal(self, row, col, value, addv=None): cdef PetscInt ival1 = asInt(row) cdef PetscInt ival2 = asInt(col) cdef PetscScalar sval = asScalar(value) cdef PetscInsertMode caddv = insertmode(addv) CHKERR( MatSetValuesLocal( self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) def setValuesLocal(self, rows, cols, values, addv=None): matsetvalues(self.mat, rows, cols, values, addv, 0, 1) def setValuesLocalRCV(self, R, C, V, addv=None): matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None): matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) def setValuesLocalCSR(self, I, J, V, addv=None): matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) def setValuesBlockedLocal(self, rows, cols, values, addv=None): matsetvalues(self.mat, rows, cols, values, addv, 1, 1) def setValuesBlockedLocalRCV(self, R, C, V, addv=None): matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None): matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) def setValuesBlockedLocalCSR(self, I, J, V, addv=None): matsetvalues_csr(self.mat, I, J, V, addv, 1, 1) # Stencil = _Mat_Stencil def setStencil(self, dims, starts=None, dof=1): cdef PetscInt ndim, ndof cdef PetscInt cdims[3], cstarts[3] cdims[0] = cdims[1] = cdims[2] = 1 cstarts[0] = cstarts[1] = cstarts[2] = 0 ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) ndof = asInt(dof) if starts is not None: asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) def setValueStencil(self, row, col, value, addv=None): cdef _Mat_Stencil r = row, c = col cdef PetscInsertMode im = insertmode(addv) matsetvaluestencil(self.mat, r, c, value, im, 0) def setValueStagStencil(self, row, col, value, addv=None): raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') def setValueBlockedStencil(self, row, col, value, addv=None): cdef _Mat_Stencil r = row, c = col cdef PetscInsertMode im = insertmode(addv) matsetvaluestencil(self.mat, r, c, value, im, 1) def setValueBlockedStagStencil(self, row, col, value, addv=None): raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): cdef PetscInt ni=0, *i=NULL cdef PetscScalar sval = asScalar(diag) cdef PetscVec xvec=NULL, bvec=NULL if x is not None: xvec = x.vec if b is not None: bvec = b.vec if isinstance(rows, IS): CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) else: rows = iarray_i(rows, &ni, &i) CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): cdef PetscInt ni=0, *i=NULL cdef PetscScalar sval = asScalar(diag) cdef PetscVec xvec=NULL, bvec=NULL if x is not None: xvec = x.vec if b is not None: bvec = b.vec if isinstance(rows, IS): CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) else: rows = iarray_i(rows, &ni, &i) CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): cdef PetscInt ni=0, *i=NULL cdef PetscScalar sval = asScalar(diag) cdef PetscVec xvec=NULL, bvec=NULL if x is not None: xvec = x.vec if b is not None: bvec = b.vec if isinstance(rows, IS): CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) else: rows = iarray_i(rows, &ni, &i) CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): cdef PetscInt ni=0, *i=NULL cdef PetscScalar sval = asScalar(diag) cdef PetscVec xvec=NULL, bvec=NULL if x is not None: xvec = x.vec if b is not None: bvec = b.vec if isinstance(rows, IS): CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) else: rows = iarray_i(rows, &ni, &i) CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) def storeValues(self): CHKERR( MatStoreValues(self.mat) ) def retrieveValues(self): CHKERR( MatRetrieveValues(self.mat) ) def assemblyBegin(self, assembly=None): cdef PetscMatAssemblyType flag = assemblytype(assembly) CHKERR( MatAssemblyBegin(self.mat, flag) ) def assemblyEnd(self, assembly=None): cdef PetscMatAssemblyType flag = assemblytype(assembly) CHKERR( MatAssemblyEnd(self.mat, flag) ) def assemble(self, assembly=None): cdef PetscMatAssemblyType flag = assemblytype(assembly) CHKERR( MatAssemblyBegin(self.mat, flag) ) CHKERR( MatAssemblyEnd(self.mat, flag) ) def isAssembled(self): cdef PetscBool flag = PETSC_FALSE CHKERR( MatAssembled(self.mat, &flag) ) return toBool(flag) # def createVecs(self, side=None): cdef Vec vecr, vecl if side is None: vecr = Vec(); vecl = Vec(); CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) return (vecr, vecl) elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): vecr = Vec() CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) return vecr elif side in ('l', 'L', 'left', 'Left', 'LEFT'): vecl = Vec() CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) return vecl else: raise ValueError("side '%r' not understood" % side) def createVecRight(self): cdef Vec vecr = Vec() CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) return vecr def createVecLeft(self): cdef Vec vecl = Vec() CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) return vecl getVecs = createVecs getVecRight = createVecRight getVecLeft = createVecLeft # def getColumnVector(self, column, Vec result=None): cdef PetscInt ival = asInt(column) if result is None: result = Vec() if result.vec == NULL: CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) return result def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): cdef PetscInt _nsubcomm = asInt(nsubcomm) cdef MPI_Comm _subcomm = MPI_COMM_NULL if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX if out is None: out = Mat() if out.mat != NULL: reuse = MAT_REUSE_MATRIX CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) return out def getDiagonal(self, Vec result=None): if result is None: result = Vec() if result.vec == NULL: CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) CHKERR( MatGetDiagonal(self.mat, result.vec) ) return result def getRowSum(self, Vec result=None): if result is None: result = Vec() if result.vec == NULL: CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) CHKERR( MatGetRowSum(self.mat, result.vec) ) return result def setDiagonal(self, Vec diag, addv=None): cdef PetscInsertMode caddv = insertmode(addv) CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) def diagonalScale(self, Vec L=None, Vec R=None): cdef PetscVec vecl=NULL, vecr=NULL if L is not None: vecl = L.vec if R is not None: vecr = R.vec CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) def invertBlockDiagonal(self): cdef PetscInt bs = 0, m = 0 cdef const PetscScalar *cibdiag = NULL CHKERR( MatGetBlockSize(self.mat, &bs) ) CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) cdef ndarray ibdiag = array_s(m*bs, cibdiag) ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) return ibdiag.transpose(0, 2, 1) # null space def setNullSpace(self, NullSpace nsp): CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) def getNullSpace(self): cdef NullSpace nsp = NullSpace() CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) PetscINCREF(nsp.obj) return nsp def setTransposeNullSpace(self, NullSpace nsp): CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) def getTransposeNullSpace(self): cdef NullSpace nsp = NullSpace() CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) PetscINCREF(nsp.obj) return nsp def setNearNullSpace(self, NullSpace nsp): CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) def getNearNullSpace(self): cdef NullSpace nsp = NullSpace() CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) PetscINCREF(nsp.obj) return nsp # matrix-vector product def mult(self, Vec x, Vec y): CHKERR( MatMult(self.mat, x.vec, y.vec) ) def multAdd(self, Vec x, Vec v, Vec y): CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) def multTranspose(self, Vec x, Vec y): CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) def multTransposeAdd(self, Vec x, Vec v, Vec y): CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) def multHermitian(self, Vec x, Vec y): CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) def multHermitianAdd(self, Vec x, Vec v, Vec y): CHKERR( MatMultHermitianAdd(self.mat, x.vec, v.vec, y.vec) ) # SOR def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1): cdef PetscReal comega = asReal(omega) cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP if sortype is not None: csortype = asInt(sortype) cdef PetscInt cshift = asInt(shift) cdef PetscInt cits = asInt(its) cdef PetscInt clits = asInt(lits) CHKERR( MatSOR(self.mat, b.vec, comega, csortype, cshift, cits, clits, x.vec) ) # def getDiagonalBlock(self): cdef Mat submat = Mat() CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) PetscINCREF(submat.obj) return submat def increaseOverlap(self, IS iset, overlap=1): cdef PetscInt ival = asInt(overlap) CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX cdef PetscIS ciscol = NULL if iscol is not None: ciscol = iscol.iset if submat is None: submat = Mat() if submat.mat != NULL: reuse = MAT_REUSE_MATRIX CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, reuse, &submat.mat) ) return submat def createSubMatrices(self, isrows, iscols=None, submats=None): if iscols is None: iscols = isrows isrows = [isrows] if isinstance(isrows, IS) else list(isrows) iscols = [iscols] if isinstance(iscols, IS) else list(iscols) assert len(isrows) == len(iscols) cdef Py_ssize_t i, n = len(isrows) cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX cdef PetscIS *cisrows = NULL cdef PetscIS *ciscols = NULL cdef PetscMat *cmats = NULL cdef object tmp1, tmp2 cdef Mat mat tmp1 = oarray_p(empty_p(n), NULL, &cisrows) for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset tmp2 = oarray_p(empty_p(n), NULL, &ciscols) for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset if submats is not None: reuse = MAT_REUSE_MATRIX submats = list(submats) assert len(submats) == len(isrows) CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) for i from 0 <= i < n: cmats[i] = (submats[i]).mat CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) for i from 0 <= i < n: PetscINCREF(&cmats[i]) if reuse == MAT_INITIAL_MATRIX: submats = [None] * n for i from 0 <= i < n: submats[i] = mat = Mat() mat.mat = cmats[i] CHKERR( MatDestroyMatrices(n, &cmats) ) return submats # def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None): if submat is None: submat = Mat() else: CHKERR( MatDestroy(&submat.mat) ) CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) return submat def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): CHKERR( MatRestoreLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) # def norm(self, norm_type=None): cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 cdef PetscNormType ntype = PETSC_NORM_FROBENIUS if norm_type is not None: ntype = norm_type cdef PetscReal rval[2] CHKERR( MatNorm(self.mat, ntype, rval) ) if ntype != norm_1_2: return toReal(rval[0]) else: return (toReal(rval[0]), toReal(rval[1])) def scale(self, alpha): cdef PetscScalar sval = asScalar(alpha) CHKERR( MatScale(self.mat, sval) ) def shift(self, alpha): cdef PetscScalar sval = asScalar(alpha) CHKERR( MatShift(self.mat, sval) ) def chop(self, tol): cdef PetscReal rval = asReal(tol) CHKERR( MatChop(self.mat, rval) ) def axpy(self, alpha, Mat X, structure=None): cdef PetscScalar sval = asScalar(alpha) cdef PetscMatStructure flag = matstructure(structure) CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) def aypx(self, alpha, Mat X, structure=None): cdef PetscScalar sval = asScalar(alpha) cdef PetscMatStructure flag = matstructure(structure) CHKERR( MatAYPX(self.mat, sval, X.mat, flag) ) # matrix-matrix product def matMult(self, Mat mat, Mat result=None, fill=None): cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX cdef PetscReal rval = 2 if result is None: result = Mat() elif result.mat != NULL: reuse = MAT_REUSE_MATRIX if fill is not None: rval = asReal(fill) CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) return result def matTransposeMult(self, Mat mat, Mat result=None, fill=None): cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX cdef PetscReal rval = 2 if result is None: result = Mat() elif result.mat != NULL: reuse = MAT_REUSE_MATRIX if fill is not None: rval = asReal(fill) CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) return result def transposeMatMult(self, Mat mat, Mat result=None, fill=None): cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX cdef PetscReal rval = 2 if result is None: result = Mat() elif result.mat != NULL: reuse = MAT_REUSE_MATRIX if fill is not None: rval = asReal(fill) CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) return result def PtAP(self, Mat P, Mat result=None, fill=None): cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX cdef PetscReal cfill = PETSC_DEFAULT if result is None: result = Mat() elif result.mat != NULL: reuse = MAT_REUSE_MATRIX if fill is not None: cfill = asReal(fill) CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) return result # XXX factorization def getOrdering(self, ord_type): cdef PetscMatOrderingType cval = NULL ord_type = str2bytes(ord_type, &cval) cdef IS rp = IS(), cp = IS() CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) return (rp, cp) def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): cdef PetscReal rval = asReal(atol) cdef PetscIS rp = isrow.iset, cp = iscol.iset CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) def factorLU(self, IS isrow, IS iscol, options=None): cdef PetscMatFactorInfo info matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None): self; mat; isrow; iscol; options; # unused raise NotImplementedError def factorNumericLU(self, Mat mat, options=None): self; mat; options; # unused raise NotImplementedError def factorILU(self, IS isrow, IS iscol, options=None): cdef PetscMatFactorInfo info matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) def factorSymbolicILU(self, IS isrow, IS iscol, options=None): self; isrow; iscol; options; # unused raise NotImplementedError def factorCholesky(self, IS isperm, options=None): cdef PetscMatFactorInfo info matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) def factorSymbolicCholesky(self, IS isperm, options=None): self; isperm; options; # unused raise NotImplementedError def factorNumericCholesky(self, Mat mat, options=None): self; mat; options; # unused raise NotImplementedError def factorICC(self, IS isperm, options=None): cdef PetscMatFactorInfo info matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) def factorSymbolicICC(self, IS isperm, options=None): self; isperm; options; # unused raise NotImplementedError def getInertia(self): cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) return (toInt(ival1), toInt(ival2), toInt(ival3)) def setUnfactored(self): CHKERR( MatSetUnfactored(self.mat) ) # IS def fixISLocalEmpty(self, fix): cdef PetscBool cfix = asBool(fix) CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) def getISLocalMat(self): cdef Mat local = Mat() CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) PetscINCREF(local.obj) return local def restoreISLocalMat(self, Mat local not None): CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) def setISLocalMat(self, Mat local not None): CHKERR( MatISSetLocalMat(self.mat, local.mat) ) def setISPreallocation(self, nnz, onnz): cdef PetscInt *cnnz = NULL cdef PetscInt *connz = NULL nnz = iarray_i(nnz, NULL, &cnnz) onnz = iarray_i(onnz, NULL, &connz) CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) return self # LRC def getLRCMats(self): cdef Mat A = Mat() cdef Mat U = Mat() cdef Vec c = Vec() cdef Mat V = Mat() CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) PetscINCREF(A.obj) PetscINCREF(U.obj) PetscINCREF(c.obj) PetscINCREF(V.obj) return (A, U, c, V) # MUMPS def setMumpsIcntl(self, icntl, ival): cdef PetscInt _icntl = asInt(icntl) cdef PetscInt _ival = asInt(ival) CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); def getMumpsIcntl(self, icntl): cdef PetscInt _icntl = asInt(icntl) cdef PetscInt ival = 0 CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); return toInt(ival) def setMumpsCntl(self, icntl, val): cdef PetscInt _icntl = asInt(icntl) cdef PetscReal _val = asReal(val) CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); def getMumpsCntl(self, icntl): cdef PetscInt _icntl = asInt(icntl) cdef PetscReal val = 0 CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); return toReal(val) def getMumpsInfo(self, icntl): cdef PetscInt _icntl = asInt(icntl) cdef PetscInt ival = 0 CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); return toInt(ival) def getMumpsInfog(self, icntl): cdef PetscInt _icntl = asInt(icntl) cdef PetscInt ival = 0 CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); return toInt(ival) def getMumpsRinfo(self, icntl): cdef PetscInt _icntl = asInt(icntl) cdef PetscReal val = 0 CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); return toReal(val) def getMumpsRinfog(self, icntl): cdef PetscInt _icntl = asInt(icntl) cdef PetscReal val = 0 CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); return toReal(val) # solve def solveForward(self, Vec b, Vec x): CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) def solveBackward(self, Vec b, Vec x): CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) def solve(self, Vec b, Vec x): CHKERR( MatSolve(self.mat, b.vec, x.vec) ) def solveTranspose(self, Vec b, Vec x): CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) def solveAdd(self, Vec b, Vec y, Vec x): CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) def solveTransposeAdd(self, Vec b, Vec y, Vec x): CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) def matSolve(self, Mat B, Mat X): CHKERR( MatMatSolve(self.mat, B.mat, X.mat) ) # dense matrices def getDenseArray(self): cdef PetscInt m=0, N=0, lda=0 cdef PetscScalar *data = NULL CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) CHKERR( MatGetSize(self.mat, NULL, &N) ) lda = m # CHKERR( MatDenseGetLDA(self.mat, &ld) ) CHKERR( MatDenseGetArray(self.mat, &data) ) cdef int typenum = NPY_PETSC_SCALAR cdef int itemsize = sizeof(PetscScalar) cdef int flags = NPY_ARRAY_FARRAY cdef npy_intp dims[2], strides[2] dims[0] = m; strides[0] = sizeof(PetscScalar); dims[1] = N; strides[1] = (lda*sizeof(PetscScalar)); array = PyArray_New(ndarray, 2, dims, typenum, strides, data, itemsize, flags, NULL) CHKERR( MatDenseRestoreArray(self.mat, &data) ) return array def getDenseLocalMatrix(self): cdef Mat mat = type(self)() CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) PetscINCREF(mat.obj) return mat # Nest def getNestSize(self): cdef PetscInt nrows, ncols CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) return toInt(nrows), toInt(ncols) def getNestISs(self): cdef PetscInt i, nrows =0, ncols = 0 cdef PetscIS *cisrows = NULL cdef PetscIS *ciscols = NULL CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] return isetsrows, isetscols def getNestLocalISs(self): cdef PetscInt i, nrows =0, ncols = 0 cdef PetscIS *cisrows = NULL cdef PetscIS *ciscols = NULL CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] return isetsrows, isetscols def getNestSubMatrix(self, i, j): cdef Mat submat = Mat() cdef PetscInt idxm = asInt(i) cdef PetscInt jdxm = asInt(j) CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) PetscINCREF(submat.obj) return submat # MatIS def getISLocalMat(self): cdef Mat localmat = type(self)() CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) PetscINCREF(localmat.obj) return localmat # DM def getDM(self): cdef PetscDM newdm = NULL CHKERR( MatGetDM(self.mat, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm PetscINCREF(dm.obj) return dm def setDM(self, DM dm): CHKERR( MatSetDM(self.mat, dm.dm) ) # property sizes: def __get__(self): return self.getSizes() def __set__(self, value): self.setSizes(value) property size: def __get__(self): return self.getSize() property local_size: def __get__(self): return self.getLocalSize() property block_size: def __get__(self): return self.getBlockSize() property block_sizes: def __get__(self): return self.getBlockSizes() property owner_range: def __get__(self): return self.getOwnershipRange() property owner_ranges: def __get__(self): return self.getOwnershipRanges() # property assembled: def __get__(self): return self.isAssembled() property symmetric: def __get__(self): return self.isSymmetric() property hermitian: def __get__(self): return self.isHermitian() property structsymm: def __get__(self): return self.isStructurallySymmetric() # -------------------------------------------------------------------- cdef class NullSpace(Object): # def __cinit__(self): self.obj = &self.nsp self.nsp = NULL def __call__(self, vec): self.remove(vec) # def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( MatNullSpaceView(self.nsp, vwr) ) def destroy(self): CHKERR( MatNullSpaceDestroy(&self.nsp) ) return self def create(self, constant=False, vectors=(), comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscBool has_const = PETSC_FALSE if constant: has_const = PETSC_TRUE cdef PetscInt i = 0, nv = len(vectors) cdef PetscVec *v = NULL cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) for i from 0 <= i < nv: v[i] = ((vectors[i])).vec cdef PetscNullSpace newnsp = NULL CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) PetscCLEAR(self.obj); self.nsp = newnsp return self def createRigidBody(self, Vec coords): cdef PetscNullSpace newnsp = NULL CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) PetscCLEAR(self.obj); self.nsp = newnsp return self def setFunction(self, function, args=None, kargs=None): if function is not None: CHKERR( MatNullSpaceSetFunction( self.nsp, NullSpace_Function, NULL) ) if args is None: args = () if kargs is None: kargs = {} self.set_attr('__function__', (function, args, kargs)) else: CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) self.set_attr('__function__', None) # def hasConstant(self): cdef PetscBool flag = PETSC_FALSE CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) return toBool(flag) def getVecs(self): cdef PetscInt i = 0, nv = 0 cdef const PetscVec *v = NULL CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) cdef Vec vec = None cdef list vectors = [] for i from 0 <= i < nv: vec = Vec() vec.vec = v[i] PetscINCREF(vec.obj) vectors.append(vec) return vectors def getFunction(self): return self.get_attr('__function__') # def remove(self, Vec vec): CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) def test(self, Mat mat): cdef PetscBool flag = PETSC_FALSE CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) return toBool(flag) # -------------------------------------------------------------------- del MatType del MatOption del MatAssemblyType del MatInfoType del MatStructure del MatOrderingType del MatSolverType del MatFactorShiftType del MatSORType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/TAO.pyx0000644000175000017500000005461614030740317016463 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class TAOType: """ TAO Solver Types """ LMVM = S_(TAOLMVM) NLS = S_(TAONLS) NTR = S_(TAONTR) NTL = S_(TAONTL) CG = S_(TAOCG) TRON = S_(TAOTRON) OWLQN = S_(TAOOWLQN) BMRM = S_(TAOBMRM) BLMVM = S_(TAOBLMVM) BQNLS = S_(TAOBQNLS) BNCG = S_(TAOBNCG) BNLS = S_(TAOBNLS) BNTR = S_(TAOBNTR) BNTL = S_(TAOBNTL) BQNKLS = S_(TAOBQNKLS) BQNKTR = S_(TAOBQNKTR) BQNKTL = S_(TAOBQNKTL) BQPIP = S_(TAOBQPIP) GPCG = S_(TAOGPCG) NM = S_(TAONM) POUNDERS = S_(TAOPOUNDERS) BRGN = S_(TAOBRGN) LCL = S_(TAOLCL) SSILS = S_(TAOSSILS) SSFLS = S_(TAOSSFLS) ASILS = S_(TAOASILS) ASFLS = S_(TAOASFLS) IPM = S_(TAOIPM) PDIPM = S_(TAOPDIPM) SHELL = S_(TAOSHELL) ADMM = S_(TAOADMM) ALMM = S_(TAOALMM) class TAOConvergedReason: """ TAO Solver Termination Reasons """ # iterating CONTINUE_ITERATING = TAO_CONTINUE_ITERATING # iterating CONVERGED_ITERATING = TAO_CONTINUE_ITERATING # iterating ITERATING = TAO_CONTINUE_ITERATING # iterating # converged CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min CONVERGED_USER = TAO_CONVERGED_USER # user defined # diverged DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # DIVERGED_NAN = TAO_DIVERGED_NAN # DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # DIVERGED_USER = TAO_DIVERGED_USER # user defined # -------------------------------------------------------------------- cdef class TAO(Object): """ TAO Solver """ Type = TAOType Reason = TAOConvergedReason def __cinit__(self): self.obj = &self.tao self.tao = NULL def view(self, Viewer viewer=None): """ """ cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( TaoView(self.tao, vwr) ) def destroy(self): """ """ CHKERR( TaoDestroy(&self.tao) ) return self def create(self, comm=None): """ """ cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscTAO newtao = NULL CHKERR( TaoCreate(ccomm, &newtao) ) PetscCLEAR(self.obj); self.tao = newtao return self def setType(self, tao_type): """ """ cdef PetscTAOType ctype = NULL tao_type = str2bytes(tao_type, &ctype) CHKERR( TaoSetType(self.tao, ctype) ) def getType(self): """ """ cdef PetscTAOType ctype = NULL CHKERR( TaoGetType(self.tao, &ctype) ) return bytes2str(ctype) def setOptionsPrefix(self, prefix): """ """ cdef const char *cprefix = NULL prefix = str2bytes(prefix, &cprefix) CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) def getOptionsPrefix(self): """ """ cdef const char *prefix = NULL CHKERR( TaoGetOptionsPrefix(self.tao, &prefix) ) return bytes2str(prefix) def setFromOptions(self): """ """ CHKERR( TaoSetFromOptions(self.tao) ) def setUp(self): """ """ CHKERR( TaoSetUp(self.tao) ) # def setInitialTrustRegionRadius(self, radius): cdef PetscReal cradius = asReal(radius) CHKERR( TaoSetInitialTrustRegionRadius(self.tao, cradius) ) # -------------- def setAppCtx(self, appctx): self.set_attr("__appctx__", appctx) def getAppCtx(self): return self.get_attr("__appctx__") def setInitial(self, Vec x): """ """ CHKERR( TaoSetInitialVector(self.tao, x.vec) ) def setObjective(self, objective, args=None, kargs=None): """ """ if args is None: args = () if kargs is None: kargs = {} context = (objective, args, kargs) self.set_attr("__objective__", context) CHKERR( TaoSetObjectiveRoutine(self.tao, TAO_Objective, context) ) def setResidual(self, residual, Vec R=None, args=None, kargs=None): """ """ cdef PetscVec Rvec = NULL if R is not None: Rvec = R.vec if args is None: args = () if kargs is None: kargs = {} context = (residual, args, kargs) self.set_attr("__residual__", context) CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) def setJacobianResidual(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): """ """ cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat cdef PetscMat Pmat = Jmat if P is not None: Pmat = P.mat if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr("__jacobian_residual__", context) CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) def setGradient(self, gradient, args=None, kargs=None): """ """ if args is None: args = () if kargs is None: kargs = {} context = (gradient, args, kargs) self.set_attr("__gradient__", context) CHKERR( TaoSetGradientRoutine(self.tao, TAO_Gradient, context) ) def setObjectiveGradient(self, objgrad, args=None, kargs=None): """ """ if args is None: args = () if kargs is None: kargs = {} context = (objgrad, args, kargs) self.set_attr("__objgrad__", context) CHKERR( TaoSetObjectiveAndGradientRoutine(self.tao, TAO_ObjGrad, context) ) def setVariableBounds(self, varbounds, args=None, kargs=None): """ """ cdef Vec xl=None, xu=None if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): ol, ou = varbounds xl = ol; xu = ou CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) return if isinstance(varbounds, Vec): ol = varbounds; ou = args xl = ol; xu = ou CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) return if args is None: args = () if kargs is None: kargs = {} context = (varbounds, args, kargs) self.set_attr("__varbounds__", context) CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) def setConstraints(self, constraints, Vec C=None, args=None, kargs=None): """ """ cdef PetscVec Cvec=NULL if C is not None: Cvec = C.vec if args is None: args = () if kargs is None: kargs = {} context = (constraints, args, kargs) self.set_attr("__constraints__", context) CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) def setHessian(self, hessian, Mat H=None, Mat P=None, args=None, kargs=None): cdef PetscMat Hmat=NULL if H is not None: Hmat = H.mat cdef PetscMat Pmat = Hmat if P is not None: Pmat = P.mat if args is None: args = () if kargs is None: kargs = {} context = (hessian, args, kargs) self.set_attr("__hessian__", context) CHKERR( TaoSetHessianRoutine(self.tao, Hmat, Pmat, TAO_Hessian, context) ) def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): """ """ cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat cdef PetscMat Pmat = Jmat if P is not None: Pmat = P.mat if args is None: args = () if kargs is None: kargs = {} context = (jacobian, args, kargs) self.set_attr("__jacobian__", context) CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) # def setStateDesignIS(self, IS state=None, IS design=None): """ """ cdef PetscIS s_is = NULL, d_is = NULL if state is not None: s_is = state.iset if design is not None: d_is = design.iset CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, args=None, kargs=None): """ """ cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat cdef PetscMat Pmat = Jmat if P is not None: Pmat = P.mat cdef PetscMat Imat = NULL if I is not None: Imat = I.mat if args is None: args = () if kargs is None: kargs = {} context = (jacobian_state, args, kargs) self.set_attr("__jacobian_state__", context) CHKERR( TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat, TAO_JacobianState, context) ) def setJacobianDesign(self, jacobian_design, Mat J=None, args=None, kargs=None): """ """ cdef PetscMat Jmat=NULL if J is not None: Jmat = J.mat if args is None: args = () if kargs is None: kargs = {} context = (jacobian_design, args, kargs) self.set_attr("__jacobian_design__", context) CHKERR( TaoSetJacobianDesignRoutine(self.tao, Jmat, TAO_JacobianDesign, context) ) # -------------- def computeObjective(self, Vec x): """ """ cdef PetscReal f = 0 CHKERR( TaoComputeObjective(self.tao, x.vec, &f) ) return toReal(f) def computeResidual(self, Vec x, Vec f): """ """ CHKERR( TaoComputeResidual(self.tao, x.vec, f.vec) ) def computeGradient(self, Vec x, Vec g): """ """ CHKERR( TaoComputeGradient(self.tao, x.vec, g.vec) ) def computeObjectiveGradient(self, Vec x, Vec g): """ """ cdef PetscReal f = 0 CHKERR( TaoComputeObjectiveAndGradient(self.tao, x.vec, &f, g.vec) ) return toReal(f) def computeDualVariables(self, Vec xl, Vec xu): """ """ CHKERR( TaoComputeDualVariables(self.tao, xl.vec, xu.vec) ) def computeVariableBounds(self, Vec xl, Vec xu): """ """ CHKERR( TaoComputeVariableBounds(self.tao) ) cdef PetscVec Lvec = NULL, Uvec = NULL CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) if xl.vec != NULL: if Lvec != NULL: CHKERR( VecCopy(Lvec, xl.vec) ) else: CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) if xu.vec != NULL: if Uvec != NULL: CHKERR( VecCopy(Uvec, xu.vec) ) else: CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) def computeConstraints(self, Vec x, Vec c): """ """ CHKERR( TaoComputeConstraints(self.tao, x.vec, c.vec) ) def computeHessian(self, Vec x, Mat H, Mat P=None): """ """ cdef PetscMat hmat = H.mat, pmat = H.mat if P is not None: pmat = P.mat CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) def computeJacobian(self, Vec x, Mat J, Mat P=None): """ """ cdef PetscMat jmat = J.mat, pmat = J.mat if P is not None: pmat = P.mat CHKERR( TaoComputeJacobian(self.tao, x.vec, jmat, pmat) ) # -------------- # def setTolerances(self, gatol=None, grtol=None, gttol=None): """ """ cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT if gatol is not None: _gatol = asReal(gatol) if grtol is not None: _grtol = asReal(grtol) if gttol is not None: _gttol = asReal(gttol) CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) def getTolerances(self): """ """ cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT CHKERR( TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol) ) return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) def setConstraintTolerances(self, catol=None, crtol=None): """ """ cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT if catol is not None: _catol = asReal(catol) if crtol is not None: _crtol = asReal(crtol) CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) def getConstraintTolerances(self): """ """ cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT CHKERR( TaoGetConstraintTolerances(self.tao, &_catol, &_crtol) ) return (toReal(_catol), toReal(_crtol)) def setConvergenceTest(self, converged, args=None, kargs=None): """ """ if converged is None: CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) self.set_attr('__converged__', None) else: if args is None: args = () if kargs is None: kargs = {} self.set_attr('__converged__', (converged, args, kargs)) CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) def getConvergenceTest(self): """ """ return self.get_attr('__converged__') def setConvergedReason(self, reason): """ """ cdef PetscTAOConvergedReason creason = reason CHKERR( TaoSetConvergedReason(self.tao, creason) ) def getConvergedReason(self): """ """ cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING CHKERR( TaoGetConvergedReason(self.tao, &creason) ) return creason def setMonitor(self, monitor, args=None, kargs=None): """ """ if monitor is None: return cdef object monitorlist = self.get_attr('__monitor__') if monitorlist is None: CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) if args is None: args = () if kargs is None: kargs = {} self.set_attr('__monitor__', [(monitor, args, kargs)]) else: monitorlist.append((monitor, args, kargs)) def getMonitor(self): """ """ return self.get_attr('__monitor__') def cancelMonitor(self): """ """ CHKERR( TaoCancelMonitors(self.tao) ) self.set_attr('__monitor__', None) # def solve(self, Vec x=None): """ """ if x is not None: CHKERR( TaoSetInitialVector(self.tao, x.vec) ) CHKERR( TaoSolve(self.tao) ) def getSolution(self): """ """ cdef Vec vec = Vec() CHKERR( TaoGetSolutionVector(self.tao, &vec.vec) ) PetscINCREF(vec.obj) return vec def getGradient(self): """ """ cdef Vec vec = Vec() CHKERR( TaoGetGradientVector(self.tao, &vec.vec) ) PetscINCREF(vec.obj) return vec def setGradientNorm(self, Mat mat): """ """ CHKERR( TaoSetGradientNorm(self.tao, mat.mat) ) def getGradientNorm(self): """ """ cdef Mat mat = Mat() CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) PetscINCREF(mat.obj) return mat def setLMVMH0(self, Mat mat): """ """ CHKERR( TaoLMVMSetH0(self.tao, mat.mat) ) def getLMVMH0(self): """ """ cdef Mat mat = Mat() CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) PetscINCREF(mat.obj) return mat def getLMVMH0KSP(self): """ """ cdef KSP ksp = KSP() CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) PetscINCREF(ksp.obj) return ksp def getVariableBounds(self): """ """ cdef Vec xl = Vec(), xu = Vec() CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) PetscINCREF(xl.obj); PetscINCREF(xu.obj) return (xl, xu) def getIterationNumber(self): """ """ cdef PetscInt its=0 CHKERR( TaoGetSolutionStatus(self.tao, &its, NULL, NULL, NULL, NULL, NULL) ) return toInt(its) def getObjectiveValue(self): """ """ cdef PetscReal fval=0 CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, NULL, NULL, NULL, NULL) ) return toReal(fval) getFunctionValue = getObjectiveValue def getConvergedReason(self): """ """ cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING CHKERR( TaoGetConvergedReason(self.tao, &reason) ) return reason def getSolutionNorm(self): """ """ cdef PetscReal gnorm=0 cdef PetscReal cnorm=0 cdef PetscReal fval=0 CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) return (toReal(fval), toReal(gnorm), toReal(cnorm)) def getSolutionStatus(self): """ """ cdef PetscInt its=0 cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING CHKERR( TaoGetSolutionStatus(self.tao, &its, &fval, &gnorm, &cnorm, &xdiff, &reason) ) return (toInt(its), toReal(fval), toReal(gnorm), toReal(cnorm), toReal(xdiff), reason) def getKSP(self): """ """ cdef KSP ksp = KSP() CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) PetscINCREF(ksp.obj) return ksp # BRGN routines def getBRGNSubsolver(self): """ """ cdef TAO subsolver = TAO() CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) PetscINCREF(subsolver.obj) return subsolver def setBRGNRegularizerObjectiveGradient(self, objgrad, args=None, kargs=None): """ """ if args is None: args = () if kargs is None: kargs = {} context = (objgrad, args, kargs) self.set_attr("__brgnregobjgrad__", context) CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) def setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None): cdef PetscMat Hmat=NULL if H is not None: Hmat = H.mat if args is None: args = () if kargs is None: kargs = {} context = (hessian, args, kargs) self.set_attr("__brgnreghessian__", context) CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) def setBRGNRegularizerWeight(self, weight): """ """ cdef PetscReal cweight = asReal(weight) CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) def setBRGNSmoothL1Epsilon(self, epsilon): """ """ cdef PetscReal ceps = asReal(epsilon) CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) def setBRGNDictionaryMatrix(self, Mat D): """ """ CHKERR( TaoBRGNSetDictionaryMatrix(self.tao, D.mat) ) def getBRGNDampingVector(self): """ """ cdef Vec damp = Vec() CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) PetscINCREF(damp.obj) return damp # --- application context --- property appctx: def __get__(self): return self.getAppCtx() def __set__(self, value): self.setAppCtx(value) # --- linear solver --- property ksp: def __get__(self): return self.getKSP() # --- tolerances --- property ftol: def __get__(self): return self.getFunctionTolerances() def __set__(self, value): if isinstance(value, (tuple, list)): self.setFunctionTolerances(*value) elif isinstance(value, dict): self.setFunctionTolerances(**value) else: raise TypeError("expecting tuple/list or dict") property gtol: def __get__(self): return self.getGradientTolerances() def __set__(self, value): if isinstance(value, (tuple, list)): self.getGradientTolerances(*value) elif isinstance(value, dict): self.getGradientTolerances(**value) else: raise TypeError("expecting tuple/list or dict") property ctol: def __get__(self): return self.getConstraintTolerances() def __set__(self, value): if isinstance(value, (tuple, list)): self.getConstraintTolerances(*value) elif isinstance(value, dict): self.getConstraintTolerances(**value) else: raise TypeError("expecting tuple/list or dict") # --- iteration --- property its: def __get__(self): return self.getIterationNumber() property gnorm: def __get__(self): return self.getSolutionNorm()[1] property cnorm: def __get__(self): return self.getSolutionNorm()[2] property solution: def __get__(self): return self.getSolution() property objective: def __get__(self): return self.getObjectiveValue() property function: def __get__(self): return self.getFunctionValue() property gradient: def __get__(self): return self.getGradient() # --- convergence --- property reason: def __get__(self): return self.getConvergedReason() property iterating: def __get__(self): return self.reason == 0 property converged: def __get__(self): return self.reason > 0 property diverged: def __get__(self): return self.reason < 0 # -------------------------------------------------------------------- del TAOType del TAOConvergedReason # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Object.pyx0000644000175000017500000001775713750315427017263 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class Object: # --- special methods --- def __cinit__(self): self.oval = NULL self.obj = &self.oval def __dealloc__(self): CHKERR( PetscDEALLOC(&self.obj[0]) ) self.obj = NULL def __richcmp__(self, other, int op): if not isinstance(self, Object): return NotImplemented if not isinstance(other, Object): return NotImplemented cdef Object s = self, o = other if op == 2: return (s.obj[0] == o.obj[0]) elif op == 3: return (s.obj[0] != o.obj[0]) else: raise TypeError("only '==' and '!='") def __nonzero__(self): return self.obj[0] != NULL def __copy__(self): cdef Object obj = type(self)() cdef PetscObject o = self.obj[0] if o != NULL: CHKERR( PetscObjectReference(o) ) obj.obj[0] = o return obj def __deepcopy__(self, dict memo): cdef object obj_copy = None try: obj_copy = self.copy except AttributeError: raise NotImplementedError memo # unused return obj_copy() # --- attribute management --- cdef object get_attr(self, char name[]): return PetscGetPyObj(self.obj[0], name) cdef object set_attr(self, char name[], object attr): return PetscSetPyObj(self.obj[0], name, attr) cdef object get_dict(self): return PetscGetPyDict(self.obj[0], True) # def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PetscObjectView(self.obj[0], vwr) ) def destroy(self): CHKERR( PetscObjectDestroy(&self.obj[0]) ) return self def getType(self): cdef const char *cval = NULL CHKERR( PetscObjectGetType(self.obj[0], &cval) ) return bytes2str(cval) # def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) def getOptionsPrefix(self): cdef const char *cval = NULL CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) def viewFromOptions(self, name, Object prefix=None): cdef PetscObject pobj = NULL cdef const char *cval = NULL pobj = prefix.obj[0] if prefix is not None else NULL name = str2bytes(name, &cval) CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) # def getComm(self): cdef Comm comm = Comm() CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) return comm def getName(self): cdef const char *cval = NULL CHKERR( PetscObjectGetName(self.obj[0], &cval) ) return bytes2str(cval) def setName(self, name): cdef const char *cval = NULL name = str2bytes(name, &cval) CHKERR( PetscObjectSetName(self.obj[0], cval) ) def getClassId(self): cdef PetscClassId classid = 0 CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) return classid def getClassName(self): cdef const char *cval = NULL CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) return bytes2str(cval) def getRefCount(self): if self.obj[0] == NULL: return 0 cdef PetscInt refcnt = 0 CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) return toInt(refcnt) # --- general support --- def compose(self, name, Object obj or None): cdef const char *cval = NULL cdef PetscObject cobj = NULL name = str2bytes(name, &cval) if obj is not None: cobj = obj.obj[0] CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) def query(self, name): cdef const char *cval = NULL cdef PetscObject cobj = NULL name = str2bytes(name, &cval) CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) if cobj == NULL: return None cdef Object obj = subtype_Object(cobj)() obj.obj[0] = cobj PetscINCREF(obj.obj) return obj def incRef(self): cdef PetscObject obj = self.obj[0] cdef PetscInt refct = 0 if obj != NULL: CHKERR( PetscObjectReference(obj) ) CHKERR( PetscObjectGetReference(obj, &refct) ) return (refct) def decRef(self): cdef PetscObject obj = self.obj[0] cdef PetscInt refct = 0 if obj != NULL: CHKERR( PetscObjectGetReference(obj, &refct) ) CHKERR( PetscObjectDereference(obj) ) if refct == 1: self.obj[0] = NULL refct -= 1 return (refct) def getAttr(self, name): cdef const char *cval = NULL name = str2bytes(name, &cval) return self.get_attr(cval) def setAttr(self, name, attr): cdef const char *cval = NULL name = str2bytes(name, &cval) self.set_attr(cval, attr) def getDict(self): return self.get_dict() def stateIncrease(self): PetscINCSTATE(self.obj) # --- tab level --- def incrementTabLevel(self, tab, Object parent=None): cdef PetscInt ctab = asInt(tab) cdef PetscObject cobj = NULL if parent is None else parent.obj[0] CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) def setTabLevel(self, level): cdef PetscInt clevel = asInt(level) CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) def getTabLevel(self): cdef PetscInt clevel = 0 CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) return toInt(clevel) # --- properties --- property type: def __get__(self): return self.getType() def __set__(self, value): self.setType(value) property prefix: def __get__(self): return self.getOptionsPrefix() def __set__(self, value): self.setOptionsPrefix(value) property comm: def __get__(self): return self.getComm() property name: def __get__(self): return self.getName() def __set__(self, value): self.setName(value) property classid: def __get__(self): return self.getClassId() property klass: def __get__(self): return self.getClassName() property refcount: def __get__(self): return self.getRefCount() # --- ctypes support --- property handle: def __get__(self): cdef PetscObject obj = self.obj[0] return PyLong_FromVoidPtr(obj) # --- Fortran support --- property fortran: def __get__(self): cdef PetscObject obj = self.obj[0] return Object_toFortran(obj) # -------------------------------------------------------------------- include "cyclicgc.pxi" cdef dict type_registry = { 0 : None } __type_registry__ = type_registry cdef int PyPetscType_Register(int classid, type cls) except -1: global type_registry cdef object key = classid cdef object value = cls cdef const char *dummy = NULL if key not in type_registry: type_registry[key] = cls reg_LogClass(str2bytes(cls.__name__, &dummy), classid) TypeEnableGC(cls) else: value = type_registry[key] if cls is not value: raise ValueError( "key: %d, cannot register: %s, " \ "already registered: %s" % (key, cls, value)) return 0 cdef type PyPetscType_Lookup(int classid): global type_registry cdef object key = classid cdef type cls = Object try: cls = type_registry[key] except KeyError: cls = Object return cls # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscmat.pxi0000644000175000017500000012561514062763234017646 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscMatType "MatType" PetscMatType MATSAME PetscMatType MATMAIJ PetscMatType MATSEQMAIJ PetscMatType MATMPIMAIJ PetscMatType MATKAIJ PetscMatType MATSEQKAIJ PetscMatType MATMPIKAIJ PetscMatType MATIS PetscMatType MATAIJ PetscMatType MATSEQAIJ PetscMatType MATMPIAIJ PetscMatType MATAIJCRL PetscMatType MATSEQAIJCRL PetscMatType MATMPIAIJCRL PetscMatType MATAIJCUSPARSE PetscMatType MATSEQAIJCUSPARSE PetscMatType MATMPIAIJCUSPARSE PetscMatType MATAIJVIENNACL PetscMatType MATSEQAIJVIENNACL PetscMatType MATMPIAIJVIENNACL PetscMatType MATAIJPERM PetscMatType MATSEQAIJPERM PetscMatType MATMPIAIJPERM PetscMatType MATAIJSELL PetscMatType MATSEQAIJSELL PetscMatType MATMPIAIJSELL PetscMatType MATAIJMKL PetscMatType MATSEQAIJMKL PetscMatType MATMPIAIJMKL PetscMatType MATBAIJMKL PetscMatType MATSEQBAIJMKL PetscMatType MATMPIBAIJMKL PetscMatType MATSHELL PetscMatType MATDENSE PetscMatType MATSEQDENSE PetscMatType MATSEQDENSECUDA PetscMatType MATMPIDENSE PetscMatType MATELEMENTAL PetscMatType MATBAIJ PetscMatType MATSEQBAIJ PetscMatType MATMPIBAIJ PetscMatType MATMPIADJ PetscMatType MATSBAIJ PetscMatType MATSEQSBAIJ PetscMatType MATMPISBAIJ PetscMatType MATMFFD PetscMatType MATNORMAL PetscMatType MATNORMALHERMITIAN PetscMatType MATLRC PetscMatType MATSCATTER PetscMatType MATBLOCKMAT PetscMatType MATCOMPOSITE PetscMatType MATFFT PetscMatType MATFFTW PetscMatType MATSEQCUFFT PetscMatType MATTRANSPOSEMAT PetscMatType MATSCHURCOMPLEMENT #PetscMatType MATPYTHON PetscMatType MATHYPRE PetscMatType MATHYPRESTRUCT PetscMatType MATHYPRESSTRUCT PetscMatType MATSUBMATRIX PetscMatType MATLOCALREF PetscMatType MATNEST PetscMatType MATPREALLOCATOR PetscMatType MATSELL PetscMatType MATSEQSELL PetscMatType MATMPISELL PetscMatType MATDUMMY PetscMatType MATLMVM PetscMatType MATLMVMDFP PetscMatType MATLMVMBFGS PetscMatType MATLMVMSR1 PetscMatType MATLMVMBROYDEN PetscMatType MATLMVMBADBROYDEN PetscMatType MATLMVMSYMBROYDEN PetscMatType MATLMVMSYMBADBROYDEN PetscMatType MATLMVMDIAGBROYDEN PetscMatType MATCONSTANTDIAGONAL PetscMatType MATHARA ctypedef const char* PetscMatOrderingType "MatOrderingType" PetscMatOrderingType MATORDERINGNATURAL PetscMatOrderingType MATORDERINGND PetscMatOrderingType MATORDERING1WD PetscMatOrderingType MATORDERINGRCM PetscMatOrderingType MATORDERINGQMD PetscMatOrderingType MATORDERINGROWLENGTH PetscMatOrderingType MATORDERINGWBM PetscMatOrderingType MATORDERINGSPECTRAL PetscMatOrderingType MATORDERINGAMD ctypedef const char* PetscMatSolverType "MatSolverType" PetscMatSolverType MATSOLVERSUPERLU PetscMatSolverType MATSOLVERSUPERLU_DIST PetscMatSolverType MATSOLVERSTRUMPACK PetscMatSolverType MATSOLVERUMFPACK PetscMatSolverType MATSOLVERCHOLMOD PetscMatSolverType MATSOLVERKLU PetscMatSolverType MATSOLVERSPARSEELEMENTAL PetscMatSolverType MATSOLVERELEMENTAL PetscMatSolverType MATSOLVERSCALAPACK PetscMatSolverType MATSOLVERESSL PetscMatSolverType MATSOLVERLUSOL PetscMatSolverType MATSOLVERMUMPS PetscMatSolverType MATSOLVERMKL_PARDISO PetscMatSolverType MATSOLVERMKL_CPARDISO PetscMatSolverType MATSOLVERPASTIX PetscMatSolverType MATSOLVERMATLAB PetscMatSolverType MATSOLVERPETSC PetscMatSolverType MATSOLVERBAS PetscMatSolverType MATSOLVERCUSPARSE PetscMatSolverType MATSOLVERCUDA ctypedef enum PetscMatReuse "MatReuse": MAT_INITIAL_MATRIX MAT_REUSE_MATRIX MAT_IGNORE_MATRIX MAT_INPLACE_MATRIX ctypedef enum PetscMatDuplicateOption "MatDuplicateOption": MAT_DO_NOT_COPY_VALUES MAT_COPY_VALUES MAT_SHARE_NONZERO_PATTERN ctypedef enum PetscMatSORType "MatSORType": SOR_FORWARD_SWEEP SOR_BACKWARD_SWEEP SOR_SYMMETRIC_SWEEP SOR_LOCAL_FORWARD_SWEEP SOR_LOCAL_BACKWARD_SWEEP SOR_LOCAL_SYMMETRIC_SWEEP SOR_ZERO_INITIAL_GUESS SOR_EISENSTAT SOR_APPLY_UPPER SOR_APPLY_LOWER ctypedef enum PetscMatAssemblyType "MatAssemblyType": MAT_FLUSH_ASSEMBLY MAT_FINAL_ASSEMBLY ctypedef enum PetscMatInfoType "MatInfoType": MAT_LOCAL MAT_GLOBAL_MAX MAT_GLOBAL_SUM ctypedef enum PetscMatStructure "MatStructure": MAT_SAME_NONZERO_PATTERN "SAME_NONZERO_PATTERN" MAT_DIFFERENT_NONZERO_PATTERN "DIFFERENT_NONZERO_PATTERN" MAT_SUBSET_NONZERO_PATTERN "SUBSET_NONZERO_PATTERN" MAT_UNKNOWN_NONZERO_PATTERN "UNKNOWN_NONZERO_PATTERN" ctypedef enum PetscMatOption "MatOption": MAT_OPTION_MIN MAT_UNUSED_NONZERO_LOCATION_ERR MAT_ROW_ORIENTED MAT_SYMMETRIC MAT_STRUCTURALLY_SYMMETRIC MAT_FORCE_DIAGONAL_ENTRIES MAT_IGNORE_OFF_PROC_ENTRIES MAT_USE_HASH_TABLE MAT_KEEP_NONZERO_PATTERN MAT_IGNORE_ZERO_ENTRIES MAT_USE_INODES MAT_HERMITIAN MAT_SYMMETRY_ETERNAL MAT_NEW_NONZERO_LOCATION_ERR MAT_IGNORE_LOWER_TRIANGULAR MAT_ERROR_LOWER_TRIANGULAR MAT_GETROW_UPPERTRIANGULAR MAT_SPD MAT_NO_OFF_PROC_ZERO_ROWS MAT_NO_OFF_PROC_ENTRIES MAT_NEW_NONZERO_LOCATIONS MAT_NEW_NONZERO_ALLOCATION_ERR MAT_SUBSET_OFF_PROC_ENTRIES MAT_SUBMAT_SINGLEIS MAT_STRUCTURE_ONLY MAT_SORTED_FULL MAT_OPTION_MAX int MatView(PetscMat,PetscViewer) int MatDestroy(PetscMat*) int MatCreate(MPI_Comm,PetscMat*) int MatCreateIS(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,PetscLGMap,PetscMat*) int MatISGetLocalMat(PetscMat,PetscMat*) int MatISGetMPIXAIJ(PetscMat,PetscMatReuse,PetscMat*) int MatCreateScatter(MPI_Comm,PetscScatter,PetscMat*) int MatScatterSetVecScatter(PetscMat,PetscScatter) int MatScatterGetVecScatter(PetscMat,PetscScatter*) int MatCreateNormal(PetscMat,PetscMat*) int MatCreateTranspose(PetscMat,PetscMat*) int MatCreateLRC(PetscMat,PetscMat,PetscVec,PetscMat,PetscMat*) int MatCreateSubMatrixVirtual(PetscMat,PetscIS,PetscIS,PetscMat*) int MatCreateRedundantMatrix(PetscMat,PetscInt,MPI_Comm,PetscMatReuse,PetscMat*) int MatCreateNest(MPI_Comm,PetscInt,PetscIS[],PetscInt,PetscIS[],PetscMat[],PetscMat*) int MatCreateShell(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,void*,PetscMat*) int MatCreateSeqAIJWithArrays(MPI_Comm,PetscInt,PetscInt,PetscInt[],PetscInt[],PetscScalar[],PetscMat*) int MatCreateMPIAIJWithArrays(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt[],PetscInt[],PetscScalar[],PetscMat*) int MatCreateMPIAIJWithSplitArrays(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt[],PetscInt[],PetscScalar[],PetscInt[],PetscInt[],PetscScalar[],PetscMat*) int MatSetSizes(PetscMat,PetscInt,PetscInt,PetscInt,PetscInt) int MatSetBlockSize(PetscMat,PetscInt) int MatSetBlockSizes(PetscMat,PetscInt,PetscInt) int MatSetType(PetscMat,PetscMatType) int MatSetOption(PetscMat,PetscMatOption,PetscBool) enum: MAT_SKIP_ALLOCATION int MatSeqAIJSetPreallocation (PetscMat,PetscInt,PetscInt[]) int MatMPIAIJSetPreallocation (PetscMat,PetscInt,PetscInt[],PetscInt,PetscInt[]) int MatSeqBAIJSetPreallocation (PetscMat,PetscInt,PetscInt,PetscInt[]) int MatMPIBAIJSetPreallocation (PetscMat,PetscInt,PetscInt,PetscInt[],PetscInt,PetscInt[]) int MatSeqSBAIJSetPreallocation(PetscMat,PetscInt,PetscInt,PetscInt[]) int MatMPISBAIJSetPreallocation(PetscMat,PetscInt,PetscInt,PetscInt[],PetscInt,PetscInt[]) int MatSeqAIJSetPreallocationCSR (PetscMat, PetscInt[],PetscInt[],PetscScalar[]) int MatMPIAIJSetPreallocationCSR (PetscMat, PetscInt[],PetscInt[],PetscScalar[]) int MatSeqBAIJSetPreallocationCSR (PetscMat,PetscInt,PetscInt[],PetscInt[],PetscScalar[]) int MatMPIBAIJSetPreallocationCSR (PetscMat,PetscInt,PetscInt[],PetscInt[],PetscScalar[]) int MatSeqSBAIJSetPreallocationCSR(PetscMat,PetscInt,PetscInt[],PetscInt[],PetscScalar[]) int MatMPISBAIJSetPreallocationCSR(PetscMat,PetscInt,PetscInt[],PetscInt[],PetscScalar[]) int MatSeqDenseSetPreallocation(PetscMat,PetscScalar[]) int MatMPIDenseSetPreallocation(PetscMat,PetscScalar[]) int MatISSetPreallocation(PetscMat,PetscInt,PetscInt[],PetscInt,PetscInt[]) int MatSetOptionsPrefix(PetscMat,char[]) int MatGetOptionsPrefix(PetscMat,char*[]) int MatSetFromOptions(PetscMat) int MatSetUp(PetscMat) int MatGetType(PetscMat,PetscMatType*) int MatGetSize(PetscMat,PetscInt*,PetscInt*) int MatGetLocalSize(PetscMat,PetscInt*,PetscInt*) int MatGetBlockSize(PetscMat,PetscInt*) int MatGetBlockSizes(PetscMat,PetscInt*,PetscInt*) int MatGetOwnershipRange(PetscMat,PetscInt*,PetscInt*) int MatGetOwnershipRanges(PetscMat,const PetscInt*[]) int MatGetOwnershipRangeColumn(PetscMat,PetscInt*,PetscInt*) int MatGetOwnershipRangesColumn(PetscMat,const PetscInt*[]) int MatGetOwnershipIS(PetscMat,PetscIS*,PetscIS*) int MatNestGetISs(PetscMat,PetscIS*,PetscIS*) int MatNestGetLocalISs(PetscMat,PetscIS*,PetscIS*) int MatNestGetSize(PetscMat,PetscInt*,PetscInt*) int MatNestGetSubMat(PetscMat,PetscInt,PetscInt,PetscMat*) int MatEqual(PetscMat,PetscMat,PetscBool*) int MatLoad(PetscMat,PetscViewer) int MatDuplicate(PetscMat,PetscMatDuplicateOption,PetscMat*) int MatCopy(PetscMat,PetscMat,PetscMatStructure) int MatTranspose(PetscMat,PetscMatReuse,PetscMat*) int MatConvert(PetscMat,PetscMatType,PetscMatReuse,PetscMat*) int MatIsSymmetric(PetscMat,PetscReal,PetscBool*) int MatIsStructurallySymmetric(PetscMat,PetscBool*) int MatIsHermitian(PetscMat,PetscReal,PetscBool*) int MatIsSymmetricKnown(PetscMat,PetscBool*,PetscBool*) int MatIsHermitianKnown(PetscMat,PetscBool*,PetscBool*) int MatIsTranspose(PetscMat A,PetscMat B,PetscReal tol,PetscBool *flg) int MatCreateVecs(PetscMat,PetscVec*,PetscVec*) int MatSetValue(PetscMat,PetscInt,PetscInt,PetscScalar,PetscInsertMode) int MatSetValues(PetscMat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int MatSetValuesBlocked(PetscMat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int MatSetLocalToGlobalMapping(PetscMat,PetscLGMap,PetscLGMap) int MatGetLocalToGlobalMapping(PetscMat,PetscLGMap*,PetscLGMap*) int MatSetValueLocal(PetscMat,PetscInt,PetscInt,PetscScalar,PetscInsertMode) int MatSetValuesLocal(PetscMat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int MatSetValuesBlockedLocal(PetscMat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],const PetscScalar[],PetscInsertMode) int MatSetStencil(PetscMat,PetscInt,const PetscInt[],const PetscInt[],PetscInt) ctypedef struct PetscMatStencil "MatStencil": PetscInt k,j,i,c int MatSetValuesStencil(PetscMat,PetscInt,const PetscMatStencil[],PetscInt,const PetscMatStencil[],const PetscScalar[],PetscInsertMode) int MatSetValuesBlockedStencil(PetscMat,PetscInt,const PetscMatStencil[],PetscInt,const PetscMatStencil[],const PetscScalar[],PetscInsertMode) int MatGetValues(PetscMat,PetscInt,const PetscInt[],PetscInt,const PetscInt[],PetscScalar[]) int MatGetRow(PetscMat,PetscInt,PetscInt*,const PetscInt*[],const PetscScalar*[]) int MatRestoreRow(PetscMat,PetscInt,PetscInt*,const PetscInt*[],const PetscScalar*[]) int MatGetRowIJ(PetscMat,PetscInt,PetscBool,PetscBool,PetscInt*,const PetscInt*[],const PetscInt*[],PetscBool*) int MatRestoreRowIJ(PetscMat,PetscInt,PetscBool,PetscBool,PetscInt*,const PetscInt*[],const PetscInt*[],PetscBool*) int MatGetColumnIJ(PetscMat,PetscInt,PetscBool,PetscBool,PetscInt*,const PetscInt*[],const PetscInt*[],PetscBool*) int MatRestoreColumnIJ(PetscMat,PetscInt,PetscBool,PetscBool,PetscInt*,const PetscInt*[],const PetscInt*[],PetscBool*) int MatZeroEntries(PetscMat) int MatStoreValues(PetscMat) int MatRetrieveValues(PetscMat) int MatAssemblyBegin(PetscMat,PetscMatAssemblyType) int MatAssemblyEnd(PetscMat,PetscMatAssemblyType) int MatAssembled(PetscMat,PetscBool*) int MatDiagonalSet(PetscMat,PetscVec,PetscInsertMode) int MatDiagonalScale(PetscMat, PetscVec OPTIONAL, PetscVec OPTIONAL) int MatScale(PetscMat,PetscScalar) int MatShift(PetscMat,PetscScalar) int MatChop(PetscMat,PetscReal) int MatAXPY(PetscMat,PetscScalar,PetscMat,PetscMatStructure) int MatAYPX(PetscMat,PetscScalar,PetscMat,PetscMatStructure) int MatMatMult(PetscMat,PetscMat,PetscMatReuse,PetscReal,PetscMat*) int MatMatTransposeMult(PetscMat,PetscMat,PetscMatReuse,PetscReal,PetscMat*) int MatTransposeMatMult(PetscMat,PetscMat,PetscMatReuse,PetscReal,PetscMat*) int MatPtAP(PetscMat,PetscMat,PetscMatReuse,PetscReal,PetscMat*) int MatInterpolate(PetscMat,PetscVec,PetscVec) int MatInterpolateAdd(PetscMat,PetscVec,PetscVec,PetscVec) int MatRestrict(PetscMat,PetscVec,PetscVec) int MatPermute(PetscMat,PetscIS,PetscIS,PetscMat*) int MatPermuteSparsify(PetscMat,PetscInt,PetscReal,PetscReal,PetscIS,PetscIS,PetscMat*) int MatMerge(MPI_Comm,PetscMat,PetscInt,PetscMatReuse,PetscMat*) int MatCreateSubMatrix(PetscMat,PetscIS,PetscIS,PetscMatReuse,PetscMat*) int MatCreateSubMatrices(PetscMat,PetscInt,PetscIS[],PetscIS[],PetscMatReuse,PetscMat*[]) int MatIncreaseOverlap(PetscMat,PetscInt,PetscIS[],PetscInt) int MatGetDiagonalBlock(PetscMat,PetscMat*) int MatGetLocalSubMatrix(PetscMat,PetscIS,PetscIS,PetscMat*) int MatRestoreLocalSubMatrix(PetscMat,PetscIS,PetscIS,PetscMat*) int MatDestroyMatrices(PetscInt,PetscMat*[]) int MatConjugate(PetscMat) int MatRealPart(PetscMat) int MatImaginaryPart(PetscMat) int MatZeroRows(PetscMat,PetscInt,PetscInt[],PetscScalar,PetscVec,PetscVec) int MatZeroRowsLocal(PetscMat,PetscInt,PetscInt[],PetscScalar,PetscVec,PetscVec) int MatZeroRowsIS(PetscMat,PetscIS,PetscScalar,PetscVec,PetscVec) int MatZeroRowsLocalIS(PetscMat,PetscIS,PetscScalar,PetscVec,PetscVec) int MatZeroRowsColumns(PetscMat,PetscInt,PetscInt[],PetscScalar,PetscVec,PetscVec) int MatZeroRowsColumnsLocal(PetscMat,PetscInt,PetscInt[],PetscScalar,PetscVec,PetscVec) int MatZeroRowsColumnsIS(PetscMat,PetscIS,PetscScalar,PetscVec,PetscVec) int MatZeroRowsColumnsLocalIS(PetscMat,PetscIS,PetscScalar,PetscVec,PetscVec) int MatGetDiagonal(PetscMat,PetscVec) int MatGetRowSum(PetscMat,PetscVec) int MatInvertBlockDiagonal(PetscMat,const PetscScalar**) int MatGetRowMax(PetscMat,PetscVec,PetscInt[]) int MatGetRowMaxAbs(PetscMat,PetscVec,PetscInt[]) int MatGetColumnVector(PetscMat,PetscVec,PetscInt) int MatNorm(PetscMat,PetscNormType,PetscReal*) int MatMult(PetscMat,PetscVec,PetscVec) int MatMultAdd(PetscMat,PetscVec,PetscVec,PetscVec) int MatMultTranspose(PetscMat,PetscVec,PetscVec) int MatMultTransposeAdd(PetscMat,PetscVec,PetscVec,PetscVec) int MatMultHermitian"MatMultHermitianTranspose"(PetscMat,PetscVec,PetscVec) int MatMultHermitianAdd"MatMultHermitianTransposeAdd"(PetscMat,PetscVec,PetscVec,PetscVec) int MatMultConstrained(PetscMat,PetscVec,PetscVec) int MatMultTransposeConstrained(PetscMat,PetscVec,PetscVec) int MatSOR(PetscMat,PetscVec,PetscReal,PetscMatSORType,PetscReal,PetscInt,PetscInt,PetscVec) int MatGetOrdering(PetscMat,PetscMatOrderingType,PetscIS*,PetscIS*) int MatReorderForNonzeroDiagonal(PetscMat,PetscReal,PetscIS,PetscIS) int MatISFixLocalEmpty(PetscMat,PetscBool) int MatISGetLocalMat(PetscMat,PetscMat*) int MatISRestoreLocalMat(PetscMat,PetscMat*) int MatISSetLocalMat(PetscMat,PetscMat) int MatMissingDiagonal(Mat,PetscBool*,PetscInt*) ctypedef enum PetscMatFactorShiftType "MatFactorShiftType": MAT_SHIFT_NONE MAT_SHIFT_NONZERO MAT_SHIFT_POSITIVE_DEFINITE MAT_SHIFT_INBLOCKS ctypedef struct PetscMatFactorInfo "MatFactorInfo": PetscReal fill PetscReal levels, diagonal_fill PetscReal usedt, dt, dtcol, dtcount PetscReal zeropivot, pivotinblocks PetscReal shifttype, shiftamount ctypedef struct PetscMatInfo "MatInfo": PetscLogDouble block_size PetscLogDouble nz_allocated, nz_used, nz_unneeded PetscLogDouble memory PetscLogDouble assemblies PetscLogDouble mallocs PetscLogDouble fill_ratio_given, fill_ratio_needed PetscLogDouble factor_mallocs int MatGetInfo(PetscMat,PetscMatInfoType,PetscMatInfo*) int MatFactorInfoInitialize(PetscMatFactorInfo*) int MatCholeskyFactor(PetscMat,PetscIS,PetscMatFactorInfo*) int MatCholeskyFactorSymbolic(PetscMat,PetscIS,PetscMatFactorInfo*,PetscMat*) int MatCholeskyFactorNumeric(PetscMat,PetscMatFactorInfo*,PetscMat*) int MatLUFactor(PetscMat,PetscIS,PetscIS,PetscMatFactorInfo*) int MatILUFactor(PetscMat,PetscIS,PetscIS,PetscMatFactorInfo*) int MatICCFactor(PetscMat,PetscIS,PetscMatFactorInfo*) int MatLUFactorSymbolic(PetscMat,PetscIS,PetscIS,PetscMatFactorInfo*,PetscMat*) int MatILUFactorSymbolic(PetscMat,PetscIS,PetscIS,PetscMatFactorInfo*,PetscMat*) int MatICCFactorSymbolic(PetscMat,PetscIS,PetscMatFactorInfo*,PetscMat*) int MatLUFactorNumeric(PetscMat,PetscMatFactorInfo*,PetscMat*) int MatILUDTFactor(PetscMat,PetscIS,PetscIS,PetscMatFactorInfo*,PetscMat*) int MatGetInertia(PetscMat,PetscInt*,PetscInt*,PetscInt*) int MatSetUnfactored(PetscMat) int MatLRCGetMats(PetscMat,PetscMat*,PetscMat*,PetscVec*,PetscMat*) int MatMumpsSetIcntl(PetscMat,PetscInt,PetscInt) int MatMumpsGetIcntl(PetscMat,PetscInt,PetscInt*) int MatMumpsSetCntl(PetscMat,PetscInt,PetscReal) int MatMumpsGetCntl(PetscMat,PetscInt,PetscReal*) int MatMumpsGetInfo(PetscMat,PetscInt,PetscInt*) int MatMumpsGetInfog(PetscMat,PetscInt,PetscInt*) int MatMumpsGetRinfo(PetscMat,PetscInt,PetscReal*) int MatMumpsGetRinfog(PetscMat,PetscInt,PetscReal*) int MatForwardSolve(PetscMat,PetscVec,PetscVec) int MatBackwardSolve(PetscMat,PetscVec,PetscVec) int MatSolve(PetscMat,PetscVec,PetscVec) int MatSolveTranspose(PetscMat,PetscVec,PetscVec) int MatSolveAdd(PetscMat,PetscVec,PetscVec,PetscVec) int MatSolveTransposeAdd(PetscMat,PetscVec,PetscVec,PetscVec) int MatMatSolve(PetscMat,PetscMat,PetscMat) int MatComputeExplicitOperator(PetscMat,PetscMat*) int MatUseScaledForm(PetscMat,PetscBool) int MatScaleSystem(PetscMat,PetscVec,PetscVec) int MatUnScaleSystem(PetscMat,PetscVec,PetscVec) int MatDenseGetLocalMatrix(PetscMat,PetscMat*) int MatDenseGetArray(PetscMat,PetscScalar*[]) int MatDenseRestoreArray(PetscMat,PetscScalar*[]) cdef extern from "custom.h" nogil: int MatIsPreallocated(PetscMat,PetscBool*) int MatHasPreallocationAIJ(PetscMat,PetscBool*,PetscBool*,PetscBool*) cdef extern from "libpetsc4py.h": PetscMatType MATPYTHON int MatPythonSetContext(PetscMat,void*) int MatPythonGetContext(PetscMat,void**) int MatPythonSetType(PetscMat,char[]) # ----------------------------------------------------------------------------- cdef extern from * nogil: int MatNullSpaceDestroy(PetscNullSpace*) int MatNullSpaceView(PetscNullSpace,PetscViewer) int MatNullSpaceCreate(MPI_Comm,PetscBool,PetscInt,PetscVec[], PetscNullSpace*) int MatNullSpaceCreateRigidBody(PetscVec,PetscNullSpace*) int MatNullSpaceGetVecs(PetscNullSpace,PetscBool*,PetscInt*,const PetscVec*[]) int MatNullSpaceRemove(PetscNullSpace,PetscVec) int MatNullSpaceTest(PetscNullSpace,PetscMat,PetscBool*) ctypedef int MatNullSpaceFunction(PetscNullSpace, PetscVec, void*) except PETSC_ERR_PYTHON int MatNullSpaceSetFunction(PetscNullSpace,MatNullSpaceFunction*,void*) int MatSetNullSpace(PetscMat,PetscNullSpace) int MatGetNullSpace(PetscMat,PetscNullSpace*) int MatSetTransposeNullSpace(PetscMat,PetscNullSpace) int MatGetTransposeNullSpace(PetscMat,PetscNullSpace*) int MatSetNearNullSpace(PetscMat,PetscNullSpace) int MatGetNearNullSpace(PetscMat,PetscNullSpace*) cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): cdef NullSpace ob = NullSpace() ob.nsp = nsp PetscINCREF(ob.obj) return ob cdef int NullSpace_Function( PetscNullSpace n, PetscVec v, void * ctx, ) except PETSC_ERR_PYTHON with gil: cdef NullSpace nsp = ref_NullSpace(n) cdef Vec vec = ref_Vec(v) (function, args, kargs) = nsp.get_attr('__function__') function(nsp, vec, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef inline Mat ref_Mat(PetscMat mat): cdef Mat ob = Mat() ob.mat = mat PetscINCREF(ob.obj) return ob # ----------------------------------------------------------------------------- # unary operations cdef Mat mat_pos(Mat self): cdef Mat mat = type(self)() CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) return mat cdef Mat mat_neg(Mat self): cdef Mat mat = mat_pos(self) CHKERR( MatScale(mat.mat, -1) ) return mat # inplace binary operations cdef Mat mat_iadd(Mat self, other): if isinstance(other, Mat): self.axpy(1, other) elif isinstance(other, (tuple, list)): alpha, mat = other self.axpy(alpha, mat) elif isinstance(other, Vec): self.setDiagonal(other, PETSC_ADD_VALUES) else: self.shift(other) return self cdef Mat mat_isub(Mat self, other): if isinstance(other, Mat): self.axpy(-1, other) elif isinstance(other, (tuple, list)): alpha, mat = other self.axpy(-alpha, mat) elif isinstance(other, Vec): diag = other.copy() diag.scale(-1) self.setDiagonal(diag, PETSC_ADD_VALUES) diag.destroy() else: self.shift(other) return self cdef Mat mat_imul(Mat self, other): if (isinstance(other, tuple) or isinstance(other, list)): L, R = other self.diagonalScale(L, R) else: self.scale(other) return self cdef Mat mat_idiv(Mat self, other): if isinstance(other, (tuple, list)): L, R = other if isinstance(L, Vec): L = L.copy() L.reciprocal() if isinstance(R, Vec): R = R.copy() R.reciprocal() self.diagonalScale(L, R) else: other = 1/other self.scale(other) return self # binary operations cdef Mat mat_add(Mat self, other): return mat_iadd(mat_pos(self), other) cdef Mat mat_sub(Mat self, other): return mat_isub(mat_pos(self), other) cdef Mat mat_mul(Mat self, other): if isinstance(other, Mat): return self.matMult(other) else: return mat_imul(mat_pos(self), other) cdef Vec mat_mul_vec(Mat self, Vec other): cdef Vec result = self.createVecLeft() self.mult(other, result) return result cdef Mat mat_div(Mat self, other): return mat_idiv(mat_pos(self), other) # reflected binary operations cdef Mat mat_radd(Mat self, other): return mat_add(self, other) cdef Mat mat_rsub(Mat self, other): cdef Mat mat = mat_sub(self, other) mat.scale(-1) return mat cdef Mat mat_rmul(Mat self, other): return mat_mul(self, other) cdef Mat mat_rdiv(Mat self, other): self; other; # unused raise NotImplementedError # ----------------------------------------------------------------------------- cdef inline PetscMatStructure matstructure(object structure) \ except (-1): if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN elif structure is True: return MAT_SAME_NONZERO_PATTERN else: return structure cdef inline PetscMatAssemblyType assemblytype(object assembly) \ except (-1): if assembly is None: return MAT_FINAL_ASSEMBLY elif assembly is False: return MAT_FINAL_ASSEMBLY elif assembly is True: return MAT_FLUSH_ASSEMBLY else: return assembly cdef inline PetscMatInfoType infotype(object info) \ except (-1): if info is None: return MAT_GLOBAL_SUM else: return info # ----------------------------------------------------------------------------- cdef inline int Mat_Sizes( object size, object bsize, PetscInt *r, PetscInt *c, PetscInt *m, PetscInt *n, PetscInt *M, PetscInt *N, ) except -1: # unpack row and column sizes cdef object rsize, csize try: rsize , csize = size except (TypeError, ValueError): rsize = csize = size # unpack row and column block sizes cdef object rbsize, cbsize try: rbsize , cbsize = bsize except (TypeError, ValueError): rbsize = cbsize = bsize # split row and column sizes Sys_Sizes(rsize, rbsize, r, m, M) Sys_Sizes(csize, cbsize, c, n, N) return 0 cdef inline int Mat_Create( PetscMatType mtype, object comm, object size, object bsize, PetscMat *A, ) except -1: # communicator cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # sizes and block sizes cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) if rbs == PETSC_DECIDE: rbs = 1 if cbs == PETSC_DECIDE: cbs = rbs Sys_Layout(ccomm, rbs, &m, &M) Sys_Layout(ccomm, cbs, &n, &N) # create matrix and set sizes cdef PetscMat mat = NULL CHKERR( MatCreate(ccomm, &mat) ) CHKERR( MatSetSizes(mat, m, n, M, N) ) CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) CHKERR( MatSetType(mat, mtype) ) A[0] = mat return 0 cdef inline int Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except -1: # cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) # local row size and block size cdef PetscInt m=0, bs=1 CHKERR( MatGetLocalSize(A, &m, NULL) ) if baij == PETSC_TRUE or sbaij == PETSC_TRUE: CHKERR( MatGetBlockSize(A, &bs) ) assert bs > 0, "block size not set" # unpack NNZ argument cdef object od_nnz, oo_nnz try: od_nnz, oo_nnz = NNZ except (TypeError, ValueError): od_nnz, oo_nnz = NNZ, None # diagonal and off-diagonal number of nonzeros cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL if od_nnz is not None: od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) if d_n == 0: d_nnz = NULL # just in case elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL if oo_nnz is not None: oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) if o_n == 0: o_nnz = NULL # just in case elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL if m == PETSC_DECIDE: if d_n > 1 and d_n*bs > m: m = d_n*bs if o_n > 1 and o_n*bs > m: m = o_n*bs # check array sizes if d_n > 1 and d_n*bs != m: raise ValueError( "size(d_nnz) is %d, expected %d" % (toInt(d_n), toInt(m//bs)) ) if o_n > 1 and o_n*bs != m: raise ValueError( "size(o_nnz) is %d, expected %d" % (toInt(o_n), toInt(m//bs)) ) # preallocate if aij == PETSC_TRUE: CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) if baij == PETSC_TRUE: CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) if sbaij == PETSC_TRUE: CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) return 0 cdef inline int Mat_AllocAIJ_CSR(PetscMat A, object CSR) except -1: # cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) # local row size and block size cdef PetscInt m=0, bs = 1 CHKERR( MatGetLocalSize(A, &m, NULL) ) if baij == PETSC_TRUE or sbaij == PETSC_TRUE: CHKERR( MatGetBlockSize(A, &bs) ) assert bs > 0, "block size not set" # unpack CSR argument cdef object oi, oj, ov try: oi, oj, ov = CSR except (TypeError, ValueError): oi, oj = CSR; ov = None # rows, cols, and values cdef PetscInt ni=0, *i=NULL cdef PetscInt nj=0, *j=NULL cdef PetscInt nv=0 cdef PetscScalar *v=NULL oi = iarray_i(oi, &ni, &i) oj = iarray_i(oj, &nj, &j) if ov is not None: ov = iarray_s(ov, &nv, &v) if m == PETSC_DECIDE: m = (ni-1)*bs # check array sizes if ((ni-1)*bs != m): raise ValueError("size(I) is %d, expected %d" % (toInt(ni), toInt(m//bs+1)) ) if (i[0] != 0): raise ValueError("I[0] is %d, expected %d" % (toInt(i[0]), toInt(0)) ) if (i[ni-1] != nj): raise ValueError("size(J) is %d, expected %d" % (toInt(nj), toInt(i[ni-1])) ) if v != NULL and (nj*bs*bs != nv): raise ValueError("size(V) is %d, expected %d" % (toInt(nv), toInt(nj*bs*bs)) ) # preallocate if aij == PETSC_TRUE: CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) if baij == PETSC_TRUE: CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) if sbaij == PETSC_TRUE: CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) return 0 cdef inline int Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except -1: if CSR is not None: return Mat_AllocAIJ_CSR(A, CSR) if NNZ is not None: return Mat_AllocAIJ_NNZ(A, NNZ) return 0 cdef inline object Mat_AllocDense(PetscMat A, object array): cdef PetscInt m=0, N=0 CHKERR( MatGetLocalSize(A, &m, NULL) ) CHKERR( MatGetSize(A, NULL, &N) ) cdef PetscInt size=0 cdef PetscScalar *data=NULL if array is not None: array = ofarray_s(array, &size, &data) if m*N != size: raise ValueError( "size(array) is %d, expected %dx%d=%d" % (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) CHKERR( MatSeqDenseSetPreallocation(A, data) ) CHKERR( MatMPIDenseSetPreallocation(A, data) ) return array # ----------------------------------------------------------------------------- ctypedef int MatSetValuesFcn(PetscMat, PetscInt,const PetscInt*, PetscInt,const PetscInt*, const PetscScalar*,PetscInsertMode) cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): cdef MatSetValuesFcn *setvalues = NULL if blocked and local: setvalues = MatSetValuesBlockedLocal elif blocked: setvalues = MatSetValuesBlocked elif local: setvalues = MatSetValuesLocal else: setvalues = MatSetValues return setvalues cdef inline int matsetvalues(PetscMat A, object oi, object oj, object ov, object oaddv, int blocked, int local) except -1: # block size cdef PetscInt rbs=1, cbs=1 if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) if rbs < 1: rbs = 1 if cbs < 1: cbs = 1 # rows, cols, and values cdef PetscInt ni=0, *i=NULL cdef PetscInt nj=0, *j=NULL cdef PetscInt nv=0 cdef PetscScalar *v=NULL oi = iarray_i(oi, &ni, &i) oj = iarray_i(oj, &nj, &j) ov = iarray_s(ov, &nv, &v) if ni*nj*rbs*cbs != nv: raise ValueError( "incompatible array sizes: ni=%d, nj=%d, nv=%d" % (toInt(ni), toInt(nj), toInt(nv)) ) # MatSetValuesXXX function and insert mode cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local) cdef PetscInsertMode addv = insertmode(oaddv) # actual call CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) return 0 cdef inline int matsetvalues_rcv(PetscMat A, object oi, object oj, object ov, object oaddv, int blocked, int local) except -1: # block size cdef PetscInt rbs=1, cbs=1 if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) if rbs < 1: rbs = 1 if cbs < 1: cbs = 1 # rows, cols, and values cdef PetscInt ni=0, *i=NULL cdef PetscInt nj=0, *j=NULL cdef PetscInt nv=0 cdef PetscScalar *v=NULL cdef ndarray ai = iarray_i(oi, &ni, &i) cdef ndarray aj = iarray_i(oj, &nj, &j) cdef ndarray av = iarray_s(ov, &nv, &v) # check various dimensions if PyArray_NDIM(ai) != 2: raise ValueError( ("row indices must have two dimensions: " "rows.ndim=%d") % (PyArray_NDIM(ai)) ) elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( "expecting a C-contiguous array") if PyArray_NDIM(aj) != 2: raise ValueError( ("column indices must have two dimensions: " "cols.ndim=%d") % (PyArray_NDIM(aj)) ) elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( "expecting a C-contiguous array") if PyArray_NDIM(av) < 2: raise ValueError( ("values must have two or more dimensions: " "vals.ndim=%d") % (PyArray_NDIM(av)) ) elif not PyArray_ISCONTIGUOUS(av): raise ValueError( "expecting a C-contiguous array") # check various shapes cdef Py_ssize_t nm = PyArray_DIM(ai, 0) cdef Py_ssize_t si = PyArray_DIM(ai, 1) cdef Py_ssize_t sj = PyArray_DIM(aj, 1) cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) if ((nm != PyArray_DIM(aj, 0)) or (nm != PyArray_DIM(av, 0)) or (si*rbs * sj*cbs != sv)): raise ValueError( ("input arrays have incompatible shapes: " "rows.shape=%s, cols.shape=%s, vals.shape=%s") % (ai.shape, aj.shape, av.shape)) # MatSetValuesXXX function and insert mode cdef MatSetValuesFcn *setvalues = \ matsetvalues_fcn(blocked, local) cdef PetscInsertMode addv = insertmode(oaddv) # actual calls cdef Py_ssize_t k=0 for k from 0 <= k < nm: CHKERR( setvalues(A, si, &i[k*si], sj, &j[k*sj], &v[k*sv], addv) ) return 0 cdef inline int matsetvalues_ijv(PetscMat A, object oi, object oj, object ov, object oaddv, object om, int blocked, int local) except -1: # block size cdef PetscInt rbs=1, cbs=1 if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) if rbs < 1: rbs = 1 if cbs < 1: cbs = 1 # column pointers, column indices, and values cdef PetscInt ni=0, *i=NULL cdef PetscInt nj=0, *j=NULL cdef PetscInt nv=0 cdef PetscScalar *v=NULL oi = iarray_i(oi, &ni, &i) oj = iarray_i(oj, &nj, &j) ov = iarray_s(ov, &nv, &v) # row indices cdef PetscInt nm=0, *m=NULL cdef PetscInt rs=0, re=ni-1 if om is not None: om = iarray_i(om, &nm, &m) else: if not local: CHKERR( MatGetOwnershipRange(A, &rs, &re) ) rs //= rbs; re //= rbs nm = re - rs # check various sizes if (ni-1 != nm): raise ValueError( "size(I) is %d, expected %d" % (toInt(ni), toInt(nm+1)) ) if (i[0] != 0):raise ValueError( "I[0] is %d, expected %d" % (toInt(i[0]), 0) ) if (i[ni-1] != nj): raise ValueError( "size(J) is %d, expected %d" % (toInt(nj), toInt(i[ni-1])) ) if (nj*rbs*cbs != nv): raise ValueError( "size(V) is %d, expected %d" % (toInt(nv), toInt(nj*rbs*cbs)) ) # MatSetValuesXXX function and insert mode cdef MatSetValuesFcn *setvalues = \ matsetvalues_fcn(blocked, local) cdef PetscInsertMode addv = insertmode(oaddv) # actual call cdef PetscInt k=0, l=0 cdef PetscInt irow=0, ncol=0, *icol=NULL cdef PetscScalar *sval=NULL for k from 0 <= k < nm: irow = m[k] if m!=NULL else rs+k ncol = i[k+1] - i[k] icol = j + i[k] if blocked: sval = v + i[k]*rbs*cbs for l from 0 <= l < ncol: CHKERR( setvalues(A, 1, &irow, 1, &icol[l], &sval[l*rbs*cbs], addv) ) else: sval = v + i[k] CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) return 0 cdef inline int matsetvalues_csr(PetscMat A, object oi, object oj, object ov, object oaddv, int blocked, int local) except -1: matsetvalues_ijv(A, oi, oj, ov, oaddv, None, blocked, local) return 0 cdef inline matgetvalues(PetscMat mat, object orows, object ocols, object values): cdef PetscInt ni=0, nj=0, nv=0 cdef PetscInt *i=NULL, *j=NULL cdef PetscScalar *v=NULL cdef ndarray rows = iarray_i(orows, &ni, &i) cdef ndarray cols = iarray_i(ocols, &nj, &j) if values is None: values = empty_s(ni*nj) values.shape = rows.shape + cols.shape values = oarray_s(values, &nv, &v) if (ni*nj != nv): raise ValueError( "incompatible array sizes: ni=%d, nj=%d, nv=%d" % (toInt(ni), toInt(nj), toInt(nv))) CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) return values # ----------------------------------------------------------------------------- cdef extern from "custom.h": int MatFactorInfoDefaults(PetscBool,PetscBool,PetscMatFactorInfo*) cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ except (-1): if isinstance(st, str): if st == "none": return MAT_SHIFT_NONE if st == "nonzero": return MAT_SHIFT_NONZERO if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE if st == "inblocks": return MAT_SHIFT_INBLOCKS if st == "na": return MAT_SHIFT_NONZERO if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE else: raise ValueError("unknown shift type: %s" % st) return st cdef int matfactorinfo(PetscBool inc, PetscBool chol, object opts, PetscMatFactorInfo *info) except -1: CHKERR( MatFactorInfoDefaults(inc,chol,info) ) if opts is None: return 0 cdef dict options = dict(opts) # cdef fill = options.pop('fill', None) if fill is not None: info.fill = asReal(fill) # cdef zeropivot = options.pop('zeropivot', None) if zeropivot is not None: info.zeropivot = asReal(zeropivot) # cdef levels = options.pop('levels', None) if levels is not None: info.levels = asInt(levels) cdef diagonal_fill = options.pop('diagonal_fill', None) if diagonal_fill is not None: info.diagonal_fill = (diagonal_fill) # cdef dt = options.pop('dt', None) if dt is not None: info.dt = asReal(dt) cdef dtcol = options.pop('dtcol', None) if dtcol is not None: info.dtcol = asReal(dtcol) cdef dtcount = options.pop('dtcount', None) if dtcount is not None: info.dtcount = asInt(dtcount) if ((dt is not None) or (dtcol is not None) or (dtcount is not None)): info.usedt = PETSC_TRUE # cdef shifttype = options.pop('shifttype', None) if shifttype is not None: info.shifttype = matfactorshifttype(shifttype) cdef shiftamount = options.pop('shiftamount', None) if shiftamount is not None: info.shiftamount = asReal(shiftamount) # if options: raise ValueError("unknown options: %s" % list(options.keys())) return 0 # ----------------------------------------------------------------------------- cdef object mat_getitem(Mat self, object ij): cdef PetscInt M=0, N=0 rows, cols = ij if isinstance(rows, slice): CHKERR( MatGetSize(self.mat, &M, NULL) ) start, stop, stride = rows.indices(toInt(M)) rows = arange(start, stop, stride) if isinstance(cols, slice): CHKERR( MatGetSize(self.mat, NULL, &N) ) start, stop, stride = cols.indices(toInt(N)) cols = arange(start, stop, stride) return matgetvalues(self.mat, rows, cols, None) cdef int mat_setitem(Mat self, object ij, object v) except -1: cdef PetscInt M=0, N=0 rows, cols = ij if isinstance(rows, slice): CHKERR( MatGetSize(self.mat, &M, NULL) ) start, stop, stride = rows.indices(toInt(M)) rows = arange(start, stop, stride) if isinstance(cols, slice): CHKERR( MatGetSize(self.mat, NULL, &N) ) start, stop, stride = cols.indices(toInt(N)) cols = arange(start, stop, stride) matsetvalues(self.mat, rows, cols, v, None, 0, 0) return 0 # ----------------------------------------------------------------------------- #@cython.internal cdef class _Mat_Stencil: cdef PetscMatStencil stencil property i: def __set__(self, value): self.stencil.i = asInt(value) property j: def __set__(self, value): self.stencil.j = asInt(value) property k: def __set__(self, value): self.stencil.k = asInt(value) property c: def __set__(self, value): self.stencil.c = asInt(value) property index: def __set__(self, value): cdef PetscMatStencil *s = &self.stencil s.k = s.j = s.i = 0 asDims(value, &s.i, &s.j, &s.k) property field: def __set__(self, value): cdef PetscMatStencil *s = &self.stencil s.c = asInt(value) cdef matsetvaluestencil(PetscMat A, _Mat_Stencil r, _Mat_Stencil c, object value, PetscInsertMode im, int blocked): # block size cdef PetscInt rbs=1, cbs=1 if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) if rbs < 1: rbs = 1 if cbs < 1: cbs = 1 # values cdef PetscInt nv = 1 cdef PetscScalar *v = NULL value = iarray_s(value, &nv, &v) if rbs*cbs != nv: raise ValueError( "incompatible array sizes: nv=%d" % toInt(nv) ) if blocked: CHKERR( MatSetValuesBlockedStencil(A, 1, &r.stencil, 1, &c.stencil, v, im) ) else: CHKERR( MatSetValuesStencil(A, 1, &r.stencil, 1, &c.stencil, v, im) ) return 0 # ----------------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscopt.pxi0000644000175000017500000001477113750315427017667 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef struct _n_PetscOptions ctypedef _n_PetscOptions* PetscOptions int PetscOptionsCreate(PetscOptions*) int PetscOptionsDestroy(PetscOptions*) int PetscOptionsView(PetscOptions,PetscViewer) int PetscOptionsClear(PetscOptions) int PetscOptionsPrefixPush(PetscOptions,char[]) int PetscOptionsPrefixPop(PetscOptions) int PetscOptionsHasName(PetscOptions,char[],char[],PetscBool*) int PetscOptionsSetAlias(PetscOptions,char[],char[]) int PetscOptionsSetValue(PetscOptions,char[],char[]) int PetscOptionsClearValue(PetscOptions,char[]) int PetscOptionsInsertString(PetscOptions,char[]) int PetscOptionsInsertFile(PetscOptions,char[]) int PetscOptionsGetAll(PetscOptions,char*[]) int PetscOptionsGetBool(PetscOptions,char[],char[],PetscBool*,PetscBool*) int PetscOptionsGetInt(PetscOptions,char[],char[],PetscInt*,PetscBool*) int PetscOptionsGetReal(PetscOptions,char[],char[],PetscReal*,PetscBool*) int PetscOptionsGetScalar(PetscOptions,char[],char[],PetscScalar*,PetscBool*) int PetscOptionsGetString(PetscOptions,char[],char[],char[],size_t,PetscBool*) ctypedef struct _p_PetscToken ctypedef _p_PetscToken* PetscToken int PetscTokenCreate(char[],char,PetscToken*) int PetscTokenDestroy(PetscToken*) int PetscTokenFind(PetscToken,char*[]) int PetscOptionsValidKey(char[],PetscBool*) # cdef getprefix(prefix, deft=None): if prefix is None: prefix = deft elif isinstance(prefix, Options): prefix = prefix.prefix elif isinstance(prefix, Object): prefix = prefix.getOptionsPrefix() elif not isinstance(prefix, str): raise TypeError('option prefix must be string') if not prefix: return None if prefix.count(' '): raise ValueError('option prefix should not have spaces') if prefix.startswith('-'): raise ValueError('option prefix should not start with a hypen') return prefix # cdef opt2str(const char *pre, const char *name): p = bytes2str(pre) if pre!=NULL else None n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) return '(prefix:%s, name:%s)' % (p, n) cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): cdef PetscBool value = PETSC_FALSE cdef PetscBool flag = PETSC_FALSE CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) if flag==PETSC_TRUE: return toBool(value) if deft is not None: return deft raise KeyError(opt2str(pre, name)) cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): cdef PetscInt value = 0 cdef PetscBool flag = PETSC_FALSE CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) if flag==PETSC_TRUE: return toInt(value) if deft is not None: return deft raise KeyError(opt2str(pre, name)) cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): cdef PetscReal value = 0 cdef PetscBool flag = PETSC_FALSE CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) if flag==PETSC_TRUE: return toReal(value) if deft is not None: return deft raise KeyError(opt2str(pre, name)) cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): cdef PetscScalar value = 0 cdef PetscBool flag = PETSC_FALSE CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) if flag==PETSC_TRUE: return toScalar(value) if deft is not None: return deft raise KeyError(opt2str(pre, name)) cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): cdef char value[1024+1] cdef PetscBool flag = PETSC_FALSE CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) if flag==PETSC_TRUE: return bytes2str(value) if deft is not None: return deft raise KeyError(opt2str(pre, name)) cdef enum PetscOptType: OPT_BOOL OPT_INT OPT_REAL OPT_SCALAR OPT_STRING cdef getpair(prefix, name, const char **pr, const char **nm): # -- cdef const char *p = NULL prefix = str2bytes(prefix, &p) if p != NULL and p[0] == c'-': p = &p[1] # -- cdef const char *n = NULL name = str2bytes(name, &n) if n != NULL and n[0] != c'-': name = b'-' + name name = str2bytes(name, &n) # -- pr[0] = p nm[0] = n return (prefix, name) cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): cdef const char *pr = NULL cdef const char *nm = NULL tmp = getpair(prefix, name, &pr, &nm) if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) # simple minded options parser cdef tokenize(options): cdef PetscToken t = NULL cdef const char *s = NULL cdef const char *p = NULL options = str2bytes(options, &s) cdef list tokens = [] CHKERR( PetscTokenCreate(s, c' ', &t) ) try: CHKERR( PetscTokenFind(t, &p) ) while p != NULL: tokens.append(bytes2str(p)) CHKERR( PetscTokenFind(t, &p) ) finally: CHKERR( PetscTokenDestroy(&t) ) return tokens cdef bint iskey(key): cdef const char *k = NULL cdef PetscBool b = PETSC_FALSE if key: key = str2bytes(key, &k) CHKERR( PetscOptionsValidKey(k, &b) ) if b == PETSC_TRUE: return True return False cdef gettok(tokens): if tokens: return tokens.pop(0) else: return None cdef getkey(key, prefix): if not iskey(key): return None key = key[1:] if key[0] == '-': key = key[1:] if not key.startswith(prefix): return None return key.replace(prefix, '', 1) cdef parseopt(options, prefix): if isinstance(options, str): tokens = tokenize(options) else: tokens = list(options) prefix = prefix or '' # parser loop opts = {} first = gettok(tokens) while first: key = getkey(first, prefix) if not key: first = gettok(tokens) else: second = gettok(tokens) if getkey(second, prefix): value = None first = second else: value = second first = gettok(tokens) opts[key] = value # we are done return opts # petsc4py-3.15.1/src/PETSc/petscdmstag.pxi0000644000175000017500000002724413750315427020343 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum PetscDMStagStencilType"DMStagStencilType": DMSTAG_STENCIL_STAR DMSTAG_STENCIL_BOX DMSTAG_STENCIL_NONE ctypedef enum PetscDMStagStencilLocation"DMStagStencilLocation": DMSTAG_NULL_LOCATION DMSTAG_BACK_DOWN_LEFT DMSTAG_BACK_DOWN DMSTAG_BACK_DOWN_RIGHT DMSTAG_BACK_LEFT DMSTAG_BACK DMSTAG_BACK_RIGHT DMSTAG_BACK_UP_LEFT DMSTAG_BACK_UP DMSTAG_BACK_UP_RIGHT DMSTAG_DOWN_LEFT DMSTAG_DOWN DMSTAG_DOWN_RIGHT DMSTAG_LEFT DMSTAG_ELEMENT DMSTAG_RIGHT DMSTAG_UP_LEFT DMSTAG_UP DMSTAG_UP_RIGHT DMSTAG_FRONT_DOWN_LEFT DMSTAG_FRONT_DOWN DMSTAG_FRONT_DOWN_RIGHT DMSTAG_FRONT_LEFT DMSTAG_FRONT DMSTAG_FRONT_RIGHT DMSTAG_FRONT_UP_LEFT DMSTAG_FRONT_UP DMSTAG_FRONT_UP_RIGHT int DMStagCreate1d(MPI_Comm,PetscDMBoundaryType,PetscInt,PetscInt,PetscInt,PetscDMStagStencilType,PetscInt,const PetscInt[],PetscDM*) int DMStagCreate2d(MPI_Comm,PetscDMBoundaryType,PetscDMBoundaryType,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscDMStagStencilType,PetscInt,const PetscInt[],const PetscInt[],PetscDM*) int DMStagCreate3d(MPI_Comm,PetscDMBoundaryType,PetscDMBoundaryType,PetscDMBoundaryType,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscInt,PetscDMStagStencilType,PetscInt,const PetscInt[],const PetscInt[],const PetscInt[],PetscDM*) int DMStagGetCorners(PetscDM,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*) int DMStagGetGhostCorners(PetscDM,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*,PetscInt*) int DMStagGetLocalSizes(PetscDM,PetscInt*,PetscInt*,PetscInt*) int DMStagGetEntriesPerElement(PetscDM,PetscInt*) int DMStagGetDOF(PetscDM,PetscInt*,PetscInt*,PetscInt*,PetscInt*) int DMStagGetNumRanks(PetscDM,PetscInt*,PetscInt*,PetscInt*) int DMStagGetGlobalSizes(PetscDM,PetscInt*,PetscInt*,PetscInt*) int DMStagGetBoundaryTypes(PetscDM,PetscDMBoundaryType*,PetscDMBoundaryType*,PetscDMBoundaryType*) int DMStagGetStencilWidth(PetscDM,PetscInt*) int DMStagGetStencilType(PetscDM,PetscDMStagStencilType*) int DMStagGetOwnershipRanges(PetscDM,const PetscInt*[],const PetscInt*[],const PetscInt*[]) int DMStagSetDOF(PetscDM,PetscInt,PetscInt,PetscInt,PetscInt) int DMStagSetNumRanks(PetscDM,PetscInt,PetscInt,PetscInt) int DMStagSetGlobalSizes(PetscDM,PetscInt,PetscInt,PetscInt) int DMStagSetBoundaryTypes(PetscDM,PetscDMBoundaryType,PetscDMBoundaryType,PetscDMBoundaryType) int DMStagSetStencilWidth(PetscDM,PetscInt) int DMStagSetStencilType(PetscDM,PetscDMStagStencilType) int DMStagSetOwnershipRanges(PetscDM,const PetscInt[],const PetscInt[],const PetscInt[]) int DMStagGetLocationSlot(PetscDM,PetscDMStagStencilLocation,PetscInt,PetscInt*) int DMStagGetLocationDOF(PetscDM,PetscDMStagStencilLocation,PetscInt*) int DMStagGetProductCoordinateLocationSlot(PetscDM,PetscDMStagStencilLocation,PetscInt*) int DMStagGetIsFirstRank(PetscDM,PetscBool*,PetscBool*,PetscBool*) int DMStagGetIsLastRank(PetscDM,PetscBool*,PetscBool*,PetscBool*) int DMStagSetUniformCoordinatesExplicit(PetscDM,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal) int DMStagSetUniformCoordinatesProduct(PetscDM,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal) int DMStagSetCoordinateDMType(PetscDM,PetscDMType) int DMStagSetUniformCoordinates(PetscDM,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal,PetscReal) int DMStagCreateCompatibleDMStag(PetscDM,PetscInt,PetscInt,PetscInt,PetscInt,PetscDM*) int DMStagVecSplitToDMDA(PetscDM,PetscVec,PetscDMStagStencilLocation,PetscInt,PetscDM*,PetscVec*) int DMStagMigrateVec(PetscDM,PetscVec,PetscDM,PetscVec) # -------------------------------------------------------------------- cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ except (-1): if isinstance(stencil, str): if stencil == "star": return DMSTAG_STENCIL_STAR elif stencil == "box": return DMSTAG_STENCIL_BOX elif stencil == "none": return DMSTAG_STENCIL_NONE else: raise ValueError("unknown stencil type: %s" % stencil) return stencil cdef inline object toStagStencil(PetscDMStagStencilType stype): if stype == DMSTAG_STENCIL_STAR: return "star" elif stype == DMSTAG_STENCIL_BOX: return "box" elif stype == DMSTAG_STENCIL_NONE: return "none" cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ except (-1): if isinstance(stencil_location, str): if stencil_location == "null": return DMSTAG_NULL_LOCATION elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT elif stencil_location == "back_down": return DMSTAG_BACK_DOWN elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT elif stencil_location == "back_left": return DMSTAG_BACK_LEFT elif stencil_location == "back": return DMSTAG_BACK elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT elif stencil_location == "back_up": return DMSTAG_BACK_UP elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT elif stencil_location == "down": return DMSTAG_DOWN elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT elif stencil_location == "left": return DMSTAG_LEFT elif stencil_location == "element": return DMSTAG_ELEMENT elif stencil_location == "right": return DMSTAG_RIGHT elif stencil_location == "up_left": return DMSTAG_UP_LEFT elif stencil_location == "up": return DMSTAG_UP elif stencil_location == "up_right": return DMSTAG_UP_RIGHT elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT elif stencil_location == "front": return DMSTAG_FRONT elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT elif stencil_location == "front_up": return DMSTAG_FRONT_UP elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT else: raise ValueError("unknown stencil location type: %s" % stencil_location) return stencil_location cdef inline PetscInt asStagDims(dims, PetscInt *_M, PetscInt *_N, PetscInt *_P) except? -1: cdef PetscInt dim = PETSC_DECIDE cdef object M=None, N=None, P=None dims = tuple(dims) dim = len(dims) if dim == 0: pass elif dim == 1: M, = dims elif dim == 2: M, N = dims elif dim == 3: M, N, P = dims if dim >= 1: _M[0] = asInt(M) if dim >= 2: _N[0] = asInt(N) if dim >= 3: _P[0] = asInt(P) return dim cdef inline tuple toStagDims(PetscInt dim, PetscInt M, PetscInt N, PetscInt P): if dim == 0: return () elif dim == 1: return (toInt(M),) elif dim == 2: return (toInt(M), toInt(N)) elif dim == 3: return (toInt(M), toInt(N), toInt(P)) cdef inline PetscInt asDofs(dofs, PetscInt *_dof0, PetscInt *_dof1, PetscInt *_dof2, PetscInt *_dof3) except? -1: cdef PetscInt ndofs = PETSC_DECIDE cdef object dof0=None, dof1=None, dof2=None, dof3=None dofs = tuple(dofs) ndofs = len(dofs) if ndofs == 2: dof0, dof1 = dofs elif ndofs == 3: dof0, dof1, dof2 = dofs elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs if ndofs >= 2: _dof0[0] = asInt(dof0) if ndofs >= 2: _dof1[0] = asInt(dof1) if ndofs >= 3: _dof2[0] = asInt(dof2) if ndofs >= 4: _dof3[0] = asInt(dof3) return ndofs cdef inline tuple toDofs(PetscInt ndofs, PetscInt dof0, PetscInt dof1, PetscInt dof2, PetscInt dof3): if ndofs == 2: return (toInt(dof0), toInt(dof1)) elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) cdef inline tuple asStagOwnershipRanges(object ownership_ranges, PetscInt dim, PetscInt *m, PetscInt *n, PetscInt *p, PetscInt **_x, PetscInt **_y, PetscInt **_z): cdef object ranges = list(ownership_ranges) cdef PetscInt rdim = len(ranges) cdef PetscInt nlx=0, nly=0, nlz=0 if dim == PETSC_DECIDE: dim = rdim elif dim != rdim: raise ValueError( "number of dimensions %d and number ownership ranges %d" % (toInt(dim), toInt(rdim))) if dim >= 1: ranges[0] = iarray_i(ranges[0], &nlx, _x) if m[0] == PETSC_DECIDE: m[0] = nlx elif m[0] != nlx: raise ValueError( "ownership range size %d and number or processors %d" % (toInt(nlx), toInt(m[0]))) if dim >= 2: ranges[1] = iarray_i(ranges[1], &nly, _y) if n[0] == PETSC_DECIDE: n[0] = nly elif n[0] != nly: raise ValueError( "ownership range size %d and number or processors %d" % (toInt(nly), toInt(n[0]))) if dim >= 3: ranges[2] = iarray_i(ranges[2], &nlz, _z) if p[0] == PETSC_DECIDE: p[0] = nlz elif p[0] != nlz: raise ValueError( "ownership range size %d and number or processors %d" % (toInt(nlz), toInt(p[0]))) return tuple(ranges) cdef inline tuple toStagOwnershipRanges(PetscInt dim, PetscInt m, PetscInt n, PetscInt p, const PetscInt *lx, const PetscInt *ly, const PetscInt *lz): # Returns tuple of arrays containing ownership ranges as Python arrays ranges = [array_i(m, lx)] if dim > 1: ranges.append(array_i(n, ly)) if dim > 2: ranges.append(array_i(p, lz)) return tuple(ranges) cdef inline object toStagBoundary(PetscDMBoundaryType btype): if btype == DM_BOUNDARY_NONE: return "none" elif btype == DM_BOUNDARY_PERIODIC: return "periodic" elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): if dim == 1: return (toStagBoundary(btx), ) if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Partitioner.pyx0000644000175000017500000000511713750315427020340 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class PartitionerType(object): PARMETIS = S_(PETSCPARTITIONERPARMETIS) PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) CHACO = S_(PETSCPARTITIONERCHACO) SIMPLE = S_(PETSCPARTITIONERSIMPLE) SHELL = S_(PETSCPARTITIONERSHELL) GATHER = S_(PETSCPARTITIONERGATHER) MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING) # -------------------------------------------------------------------- cdef class Partitioner(Object): Type = PartitionerType def __cinit__(self): self.obj = &self.part self.part = NULL def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PetscPartitionerView(self.part, vwr) ) def destroy(self): CHKERR( PetscPartitionerDestroy(&self.part) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscPartitioner newpart = NULL CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) PetscCLEAR(self.obj); self.part = newpart return self def setType(self, part_type): cdef PetscPartitionerType cval = NULL part_type = str2bytes(part_type, &cval) CHKERR( PetscPartitionerSetType(self.part, cval) ) def getType(self): cdef PetscPartitionerType cval = NULL CHKERR( PetscPartitionerGetType(self.part, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( PetscPartitionerSetFromOptions(self.part) ) def setUp(self): CHKERR( PetscPartitionerSetUp(self.part) ) def reset(self): CHKERR( PetscPartitionerReset(self.part) ) def setShellPartition(self, numProcs, sizes=None, points=None): cdef PetscInt cnumProcs = asInt(numProcs) cdef PetscInt *csizes = NULL cdef PetscInt *cpoints = NULL cdef PetscInt nsize = 0 if sizes is not None: sizes = iarray_i(sizes, &nsize, &csizes) if nsize != cnumProcs: raise ValueError("sizes array should have %d entries (has %d)" % numProcs, toInt(nsize)) if points is None: raise ValueError("Must provide both sizes and points arrays") if points is not None: points = iarray_i(points, NULL, &cpoints) CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, csizes, cpoints) ) petsc4py-3.15.1/src/PETSc/petscsf.pxi0000644000175000017500000000407514030740317017461 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef const char* PetscSFType PetscSFType PETSCSFBASIC PetscSFType PETSCSFNEIGHBOR PetscSFType PETSCSFALLGATHERV PetscSFType PETSCSFALLGATHER PetscSFType PETSCSFGATHERV PetscSFType PETSCSFGATHER PetscSFType PETSCSFALLTOALL PetscSFType PETSCSFWINDOW int PetscSFCreate(MPI_Comm,PetscSF*) int PetscSFSetType(PetscSF,PetscSFType) int PetscSFGetType(PetscSF,PetscSFType*) int PetscSFSetFromOptions(PetscSF) int PetscSFSetUp(PetscSF) int PetscSFView(PetscSF,PetscViewer) int PetscSFReset(PetscSF) int PetscSFDestroy(PetscSF*) ctypedef struct PetscSFNode: PetscInt rank PetscInt index int PetscSFGetGraph(PetscSF,PetscInt*,PetscInt*,const PetscInt**,const PetscSFNode**) int PetscSFSetGraph(PetscSF,PetscInt,PetscInt,const PetscInt*,PetscCopyMode,PetscSFNode*,PetscCopyMode) int PetscSFSetRankOrder(PetscSF,PetscBool) int PetscSFComputeDegreeBegin(PetscSF,const PetscInt**) int PetscSFComputeDegreeEnd(PetscSF,const PetscInt**) int PetscSFGetMultiSF(PetscSF,PetscSF*) int PetscSFCreateInverseSF(PetscSF,PetscSF*) int PetscSFCreateEmbeddedRootSF(PetscSF,PetscInt,const PetscInt*,PetscSF*) int PetscSFCreateEmbeddedLeafSF(PetscSF,PetscInt,const PetscInt*,PetscSF*) int PetscSFBcastBegin(PetscSF,MPI_Datatype,const void*,void*,MPI_Op) int PetscSFBcastEnd(PetscSF,MPI_Datatype,const void*,void*,MPI_Op) int PetscSFReduceBegin(PetscSF,MPI_Datatype,const void*,void*,MPI_Op) int PetscSFReduceEnd(PetscSF,MPI_Datatype,const void*,void*,MPI_Op) int PetscSFScatterBegin(PetscSF,MPI_Datatype,const void*,void*) int PetscSFScatterEnd(PetscSF,MPI_Datatype,const void*,void*) int PetscSFGatherBegin(PetscSF,MPI_Datatype,const void*,void*) int PetscSFGatherEnd(PetscSF,MPI_Datatype,const void*,void*) int PetscSFFetchAndOpBegin(PetscSF,MPI_Datatype,void*,const void*,void*,MPI_Op) int PetscSFFetchAndOpEnd(PetscSF,MPI_Datatype,void*,const void*,void*,MPI_Op) petsc4py-3.15.1/src/PETSc/SF.pyx0000644000175000017500000001761414030740317016345 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class SFType(object): BASIC = S_(PETSCSFBASIC) NEIGHBOR = S_(PETSCSFNEIGHBOR) ALLGATHERV = S_(PETSCSFALLGATHERV) ALLGATHER = S_(PETSCSFALLGATHER) GATHERV = S_(PETSCSFGATHERV) GATHER = S_(PETSCSFGATHER) ALLTOALL = S_(PETSCSFALLTOALL) WINDOW = S_(PETSCSFWINDOW) # -------------------------------------------------------------------- cdef class SF(Object): Type = SFType def __cinit__(self): self.obj = &self.sf self.sf = NULL def __dealloc__(self): CHKERR( PetscSFDestroy(&self.sf) ) self.sf = NULL def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PetscSFView(self.sf, vwr) ) def destroy(self): CHKERR( PetscSFDestroy(&self.sf) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscSF newsf = NULL CHKERR( PetscSFCreate(ccomm, &newsf) ) PetscCLEAR(self.obj); self.sf = newsf return self def setType(self, sf_type): cdef PetscSFType cval = NULL sf_type = str2bytes(sf_type, &cval) CHKERR( PetscSFSetType(self.sf, cval) ) def getType(self): cdef PetscSFType cval = NULL CHKERR( PetscSFGetType(self.sf, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( PetscSFSetFromOptions(self.sf) ) def setUp(self): CHKERR( PetscSFSetUp(self.sf) ) def reset(self): CHKERR( PetscSFReset(self.sf) ) # def getGraph(self): """nleaves can be determined from the size of local""" cdef PetscInt nroots = 0, nleaves = 0 cdef const PetscInt *ilocal = NULL cdef const PetscSFNode *iremote = NULL CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) if ilocal == NULL: local = arange(0, nleaves, 1) else: local = array_i(nleaves, ilocal) remote = array_i(nleaves*2, iremote) remote = remote.reshape(nleaves, 2) return toInt(nroots), local, remote def setGraph(self, nroots, local, remote): """ The nleaves argument is determined from the size of local and/or remote. local may be None, meaning contiguous storage. remote should be 2*nleaves long as (rank, index) pairs. """ cdef PetscInt cnroots = asInt(nroots) cdef PetscInt nleaves = 0 cdef PetscInt nremote = 0 cdef PetscInt *ilocal = NULL cdef PetscSFNode* iremote = NULL remote = iarray_i(remote, &nremote, &iremote) if local is not None: local = iarray_i(local, &nleaves, &ilocal) assert 2*nleaves == nremote else: assert nremote % 2 == 0 nleaves = nremote // 2 CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) def setRankOrder(self, flag): cdef PetscBool bval = asBool(flag) CHKERR( PetscSFSetRankOrder(self.sf, bval) ) # def getMulti(self): cdef SF sf = SF() CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) PetscINCREF(sf.obj) return sf def createInverse(self): cdef SF sf = SF() CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) return sf def computeDegree(self): cdef const PetscInt *cdegree = NULL cdef PetscInt nroots CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) degree = array_i(nroots, cdegree) return degree def createEmbeddedRootSF(self, selected): cdef PetscInt nroots = asInt(len(selected)) cdef PetscInt *cselected = NULL selected = iarray_i(selected, &nroots, &cselected) cdef SF sf = SF() CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) return sf def createEmbeddedLeafSF(self, selected): cdef PetscInt nleaves = asInt(len(selected)) cdef PetscInt *cselected = NULL selected = iarray_i(selected, &nleaves, &cselected) cdef SF sf = SF() CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) return sf def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) cdef MPI_Op cop = mpi4py_Op_Get(op) CHKERR( PetscSFBcastBegin(self.sf, dtype, PyArray_DATA(rootdata), PyArray_DATA(leafdata), cop) ) def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) cdef MPI_Op cop = mpi4py_Op_Get(op) CHKERR( PetscSFBcastEnd(self.sf, dtype, PyArray_DATA(rootdata), PyArray_DATA(leafdata), cop) ) def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) cdef MPI_Op cop = mpi4py_Op_Get(op) CHKERR( PetscSFReduceBegin(self.sf, dtype, PyArray_DATA(leafdata), PyArray_DATA(rootdata), cop) ) def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) cdef MPI_Op cop = mpi4py_Op_Get(op) CHKERR( PetscSFReduceEnd(self.sf, dtype, PyArray_DATA(leafdata), PyArray_DATA(rootdata), cop) ) def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) CHKERR( PetscSFScatterBegin(self.sf, dtype, PyArray_DATA(multirootdata), PyArray_DATA(leafdata)) ) def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) CHKERR( PetscSFScatterEnd(self.sf, dtype, PyArray_DATA(multirootdata), PyArray_DATA(leafdata)) ) def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) CHKERR( PetscSFGatherBegin(self.sf, dtype, PyArray_DATA(leafdata), PyArray_DATA(multirootdata)) ) def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) CHKERR( PetscSFGatherEnd(self.sf, dtype, PyArray_DATA(leafdata), PyArray_DATA(multirootdata)) ) def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) cdef MPI_Op cop = mpi4py_Op_Get(op) CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), PyArray_DATA(leafdata), PyArray_DATA(leafupdate), cop) ) def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) cdef MPI_Op cop = mpi4py_Op_Get(op) CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), PyArray_DATA(leafdata), PyArray_DATA(leafupdate), cop) ) # -------------------------------------------------------------------- del SFType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscsnes.pxi0000644000175000017500000004211713750315427020030 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscSNESType "SNESType" PetscSNESType SNESNEWTONLS PetscSNESType SNESNEWTONTR #PetscSNESType SNESPYTHON PetscSNESType SNESNRICHARDSON PetscSNESType SNESKSPONLY PetscSNESType SNESKSPTRANSPOSEONLY PetscSNESType SNESVINEWTONRSLS PetscSNESType SNESVINEWTONSSLS PetscSNESType SNESNGMRES PetscSNESType SNESQN PetscSNESType SNESSHELL PetscSNESType SNESNGS PetscSNESType SNESNCG PetscSNESType SNESFAS PetscSNESType SNESMS PetscSNESType SNESNASM PetscSNESType SNESANDERSON PetscSNESType SNESASPIN PetscSNESType SNESCOMPOSITE PetscSNESType SNESPATCH ctypedef enum PetscSNESNormSchedule "SNESNormSchedule": SNES_NORM_DEFAULT SNES_NORM_NONE SNES_NORM_ALWAYS SNES_NORM_INITIAL_ONLY SNES_NORM_FINAL_ONLY SNES_NORM_INITIAL_FINAL_ONLY ctypedef enum PetscSNESConvergedReason "SNESConvergedReason": # iterating SNES_CONVERGED_ITERATING # converged SNES_CONVERGED_FNORM_ABS SNES_CONVERGED_FNORM_RELATIVE SNES_CONVERGED_SNORM_RELATIVE SNES_CONVERGED_ITS # diverged SNES_DIVERGED_FUNCTION_DOMAIN SNES_DIVERGED_FUNCTION_COUNT SNES_DIVERGED_LINEAR_SOLVE SNES_DIVERGED_FNORM_NAN SNES_DIVERGED_MAX_IT SNES_DIVERGED_LINE_SEARCH SNES_DIVERGED_INNER SNES_DIVERGED_LOCAL_MIN SNES_DIVERGED_DTOL SNES_DIVERGED_JACOBIAN_DOMAIN SNES_DIVERGED_TR_DELTA ctypedef int (*PetscSNESCtxDel)(void*) ctypedef int (*PetscSNESInitialGuessFunction)(PetscSNES, PetscVec, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscSNESFunctionFunction)(PetscSNES, PetscVec, PetscVec, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscSNESUpdateFunction)(PetscSNES, PetscInt) except PETSC_ERR_PYTHON ctypedef int (*PetscSNESJacobianFunction)(PetscSNES, PetscVec, PetscMat, PetscMat, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscSNESObjectiveFunction)(PetscSNES, PetscVec, PetscReal*, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscSNESConvergedFunction)(PetscSNES, PetscInt, PetscReal, PetscReal, PetscReal, PetscSNESConvergedReason*, void*) except PETSC_ERR_PYTHON ctypedef int (*PetscSNESMonitorFunction)(PetscSNES, PetscInt, PetscReal, void*) except PETSC_ERR_PYTHON int SNESCreate(MPI_Comm,PetscSNES*) int SNESDestroy(PetscSNES*) int SNESView(PetscSNES,PetscViewer) int SNESSetType(PetscSNES,PetscSNESType) int SNESGetType(PetscSNES,PetscSNESType*) int SNESSetOptionsPrefix(PetscSNES,char[]) int SNESAppendOptionsPrefix(PetscSNES,char[]) int SNESGetOptionsPrefix(PetscSNES,char*[]) int SNESSetFromOptions(PetscSNES) int SNESGetKSP(PetscSNES,PetscKSP*) int SNESSetKSP(PetscSNES,PetscKSP) int SNESGetDM(PetscSNES,PetscDM*) int SNESSetDM(PetscSNES,PetscDM) # --- FAS --- int SNESFASSetInterpolation(PetscSNES,PetscInt,PetscMat) int SNESFASGetInterpolation(PetscSNES,PetscInt,PetscMat*) int SNESFASSetRestriction(PetscSNES,PetscInt,PetscMat) int SNESFASGetRestriction(PetscSNES,PetscInt,PetscMat*) int SNESFASSetInjection(PetscSNES,PetscInt,PetscMat) int SNESFASGetInjection(PetscSNES,PetscInt,PetscMat*) int SNESFASSetRScale(PetscSNES,PetscInt,PetscVec) int SNESFASSetLevels(PetscSNES,PetscInt,MPI_Comm[]) int SNESFASGetLevels(PetscSNES,PetscInt*) int SNESFASGetCycleSNES(PetscSNES,PetscInt,PetscSNES*) int SNESFASGetCoarseSolve(PetscSNES,PetscSNES*) int SNESFASGetSmoother(PetscSNES,PetscInt,PetscSNES*) int SNESFASGetSmootherDown(PetscSNES,PetscInt,PetscSNES*) int SNESFASGetSmootherUp(PetscSNES,PetscInt,PetscSNES*) int SNESGetNPC(PetscSNES,PetscSNES*) int SNESHasNPC(PetscSNES,PetscBool*) int SNESSetNPC(PetscSNES,PetscSNES) int SNESGetRhs(PetscSNES,PetscVec*) int SNESGetSolution(PetscSNES,PetscVec*) int SNESSetSolution(PetscSNES,PetscVec) int SNESGetSolutionUpdate(PetscSNES,PetscVec*) int SNESSetInitialGuess"SNESSetComputeInitialGuess"(PetscSNES,PetscSNESInitialGuessFunction,void*) int SNESSetFunction(PetscSNES,PetscVec,PetscSNESFunctionFunction,void*) int SNESGetFunction(PetscSNES,PetscVec*,void*,void**) int SNESSetUpdate(PetscSNES,PetscSNESUpdateFunction) int SNESSetJacobian(PetscSNES,PetscMat,PetscMat,PetscSNESJacobianFunction,void*) int SNESGetJacobian(PetscSNES,PetscMat*,PetscMat*,PetscSNESJacobianFunction*,void**) int SNESSetObjective(PetscSNES,PetscSNESObjectiveFunction,void*) int SNESGetObjective(PetscSNES,PetscSNESObjectiveFunction*,void**) int SNESComputeFunction(PetscSNES,PetscVec,PetscVec) int SNESComputeJacobian(PetscSNES,PetscVec,PetscMat,PetscMat) int SNESComputeObjective(PetscSNES,PetscVec,PetscReal*) ctypedef int (*PetscSNESNGSFunction)(PetscSNES, PetscVec, PetscVec, void*) except PETSC_ERR_PYTHON int SNESSetNGS(PetscSNES,PetscSNESNGSFunction,void*) int SNESGetNGS(PetscSNES,PetscSNESNGSFunction*,void**) int SNESComputeNGS(PetscSNES,PetscVec,PetscVec) int SNESSetNormSchedule(PetscSNES,PetscSNESNormSchedule) int SNESGetNormSchedule(PetscSNES,PetscSNESNormSchedule*) int SNESSetTolerances(PetscSNES,PetscReal,PetscReal,PetscReal,PetscInt,PetscInt) int SNESGetTolerances(PetscSNES,PetscReal*,PetscReal*,PetscReal*,PetscInt*,PetscInt*) int SNESSetConvergenceTest(PetscSNES,PetscSNESConvergedFunction,void*,PetscSNESCtxDel*) int SNESConvergedDefault(PetscSNES,PetscInt,PetscReal,PetscReal,PetscReal, PetscSNESConvergedReason*,void*) except PETSC_ERR_PYTHON int SNESConvergedSkip(PetscSNES,PetscInt,PetscReal,PetscReal,PetscReal, PetscSNESConvergedReason*,void*) except PETSC_ERR_PYTHON int SNESSetConvergenceHistory(PetscSNES,PetscReal[],PetscInt[],PetscInt,PetscBool) int SNESGetConvergenceHistory(PetscSNES,PetscReal*[],PetscInt*[],PetscInt*) int SNESLogConvergenceHistory(PetscSNES,PetscReal,PetscInt) int SNESMonitorSet(PetscSNES,PetscSNESMonitorFunction,void*,PetscSNESCtxDel) int SNESMonitorCancel(PetscSNES) int SNESMonitor(PetscSNES,PetscInt,PetscReal) int SNESSetUp(PetscSNES) int SNESReset(PetscSNES) int SNESSolve(PetscSNES,PetscVec,PetscVec) int SNESSetConvergedReason(PetscSNES,PetscSNESConvergedReason) int SNESGetConvergedReason(PetscSNES,PetscSNESConvergedReason*) int SNESSetIterationNumber(PetscSNES,PetscInt) int SNESGetIterationNumber(PetscSNES,PetscInt*) int SNESSetFunctionNorm(PetscSNES,PetscReal) int SNESGetFunctionNorm(PetscSNES,PetscReal*) int SNESGetLinearSolveIterations(PetscSNES,PetscInt*) int SNESSetCountersReset(PetscSNES,PetscBool) int SNESGetNumberFunctionEvals(PetscSNES,PetscInt*) int SNESSetMaxNonlinearStepFailures(PetscSNES,PetscInt) int SNESGetMaxNonlinearStepFailures(PetscSNES,PetscInt*) int SNESGetNonlinearStepFailures(PetscSNES,PetscInt*) int SNESSetMaxLinearSolveFailures(PetscSNES,PetscInt) int SNESGetMaxLinearSolveFailures(PetscSNES,PetscInt*) int SNESGetLinearSolveFailures(PetscSNES,PetscInt*) int SNESKSPSetUseEW(PetscSNES,PetscBool) int SNESKSPGetUseEW(PetscSNES,PetscBool*) int SNESKSPSetParametersEW(PetscSNES,PetscInt,PetscReal,PetscReal, PetscReal,PetscReal,PetscReal,PetscReal) int SNESKSPGetParametersEW(PetscSNES,PetscInt*,PetscReal*,PetscReal*, PetscReal*,PetscReal*,PetscReal*,PetscReal*) int SNESVISetVariableBounds(PetscSNES,PetscVec,PetscVec) #ctypedef int (*PetscSNESVariableBoundsFunction)(PetscSNES,PetscVec,PetscVec) #int SNESVISetComputeVariableBounds(PetscSNES,PetscSNESVariableBoundsFunction) int SNESVIGetInactiveSet(PetscSNES, PetscIS*) int SNESCompositeGetSNES(PetscSNES,PetscInt,PetscSNES*) int SNESCompositeGetNumber(PetscSNES,PetscInt*) int SNESNASMGetSNES(PetscSNES,PetscInt,PetscSNES*) int SNESNASMGetNumber(PetscSNES,PetscInt*) int SNESPatchSetCellNumbering(PetscSNES, PetscSection) int SNESPatchSetDiscretisationInfo(PetscSNES, PetscInt, PetscDM*, PetscInt*, PetscInt*, const PetscInt**, const PetscInt*, PetscInt, const PetscInt*, PetscInt, const PetscInt*) int SNESPatchSetComputeOperator(PetscSNES, PetscPCPatchComputeOperator, void*) int SNESPatchSetComputeFunction(PetscSNES, PetscPCPatchComputeFunction, void*) int SNESPatchSetConstructType(PetscSNES, PetscPCPatchConstructType, PetscPCPatchConstructOperator, void*) cdef extern from "custom.h" nogil: int SNESSetUseMFFD(PetscSNES,PetscBool) int SNESGetUseMFFD(PetscSNES,PetscBool*) int SNESSetUseFDColoring(PetscSNES,PetscBool) int SNESGetUseFDColoring(PetscSNES,PetscBool*) int SNESConvergenceTestCall(PetscSNES,PetscInt, PetscReal,PetscReal,PetscReal, PetscSNESConvergedReason*) ctypedef const char* PetscSNESLineSearchType "SNESLineSearchType" PetscSNESLineSearchType SNESLINESEARCHBT PetscSNESLineSearchType SNESLINESEARCHNLEQERR PetscSNESLineSearchType SNESLINESEARCHBASIC PetscSNESLineSearchType SNESLINESEARCHL2 PetscSNESLineSearchType SNESLINESEARCHCP PetscSNESLineSearchType SNESLINESEARCHSHELL PetscSNESLineSearchType SNESLINESEARCHNCGLINEAR int SNESGetLineSearch(PetscSNES,PetscSNESLineSearch*) int SNESLineSearchSetFromOptions(PetscSNESLineSearch) int SNESLineSearchApply(PetscSNESLineSearch,PetscVec,PetscVec,PetscReal*,PetscVec) int SNESLineSearchDestroy(PetscSNESLineSearch*) ctypedef int (*PetscSNESPreCheckFunction)(PetscSNESLineSearch, PetscVec,PetscVec, PetscBool*, void*) except PETSC_ERR_PYTHON int SNESLineSearchSetPreCheck(PetscSNESLineSearch,PetscSNESPreCheckFunction,void*) int SNESLineSearchGetSNES(PetscSNESLineSearch,PetscSNES*) cdef extern from "libpetsc4py.h": PetscSNESType SNESPYTHON int SNESPythonSetContext(PetscSNES,void*) int SNESPythonGetContext(PetscSNES,void**) int SNESPythonSetType(PetscSNES,char[]) # ----------------------------------------------------------------------------- cdef inline SNES ref_SNES(PetscSNES snes): cdef SNES ob = SNES() ob.snes = snes PetscINCREF(ob.obj) return ob # ----------------------------------------------------------------------------- cdef int SNES_InitialGuess( PetscSNES snes, PetscVec x, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef Vec Xvec = ref_Vec(x) cdef object context = Snes.get_attr('__initialguess__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (initialguess, args, kargs) = context initialguess(Snes, Xvec, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int SNES_PreCheck( PetscSNESLineSearch linesearch, PetscVec x, PetscVec y, PetscBool *changed, void* ctx ) except PETSC_ERR_PYTHON with gil: cdef PetscSNES snes = NULL; CHKERR(SNESLineSearchGetSNES(linesearch, &snes)); cdef object b = False cdef SNES Snes = ref_SNES(snes) cdef Vec Xvec = ref_Vec(x) cdef Vec Yvec = ref_Vec(y) cdef object context = Snes.get_attr('__precheck__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (precheck, args, kargs) = context b = precheck(Xvec, Yvec, *args, **kargs) changed[0] = asBool(b) return 0 # ----------------------------------------------------------------------------- cdef int SNES_Function( PetscSNES snes, PetscVec x, PetscVec f, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef Vec Xvec = ref_Vec(x) cdef Vec Fvec = ref_Vec(f) cdef object context = Snes.get_attr('__function__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (function, args, kargs) = context function(Snes, Xvec, Fvec, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int SNES_Update( PetscSNES snes, PetscInt its, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef object context = Snes.get_attr('__update__') assert context is not None and type(context) is tuple # sanity check (update, args, kargs) = context update(Snes, toInt(its), *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int SNES_Jacobian( PetscSNES snes, PetscVec x, PetscMat J, PetscMat P, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef Vec Xvec = ref_Vec(x) cdef Mat Jmat = ref_Mat(J) cdef Mat Pmat = ref_Mat(P) cdef object context = Snes.get_attr('__jacobian__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (jacobian, args, kargs) = context jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int SNES_Objective( PetscSNES snes, PetscVec x, PetscReal *o, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef Vec Xvec = ref_Vec(x) cdef object context = Snes.get_attr('__objective__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (objective, args, kargs) = context obj = objective(Snes, Xvec, *args, **kargs) o[0] = asReal(obj) return 0 # ----------------------------------------------------------------------------- cdef int SNES_NGS( PetscSNES snes, PetscVec x, PetscVec b, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef Vec Xvec = ref_Vec(x) cdef Vec Bvec = ref_Vec(b) cdef object context = Snes.get_attr('__ngs__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (ngs, args, kargs) = context ngs(Snes, Xvec, Bvec, *args, **kargs) return 0 # ----------------------------------------------------------------------------- cdef int SNES_Converged( PetscSNES snes, PetscInt iters, PetscReal xnorm, PetscReal gnorm, PetscReal fnorm, PetscSNESConvergedReason *r, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef object it = toInt(iters) cdef object xn = toReal(xnorm) cdef object gn = toReal(gnorm) cdef object fn = toReal(fnorm) cdef object context = Snes.get_attr('__converged__') if context is None and ctx != NULL: context = ctx assert context is not None and type(context) is tuple # sanity check (converged, args, kargs) = context reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) if reason is None: r[0] = SNES_CONVERGED_ITERATING elif reason is False: r[0] = SNES_CONVERGED_ITERATING elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? else: r[0] = reason return 0 # ----------------------------------------------------------------------------- cdef int SNES_Monitor( PetscSNES snes, PetscInt iters, PetscReal rnorm, void* ctx, ) except PETSC_ERR_PYTHON with gil: cdef SNES Snes = ref_SNES(snes) cdef object monitorlist = Snes.get_attr('__monitor__') if monitorlist is None: return 0 cdef object it = toInt(iters) cdef object rn = toReal(rnorm) for (monitor, args, kargs) in monitorlist: monitor(Snes, it, rn, *args, **kargs) return 0 # ----------------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Scatter.pyx0000644000175000017500000001040614030740317017432 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class ScatterType(object): BASIC = S_(PETSCSFBASIC) NEIGHBOR = S_(PETSCSFNEIGHBOR) ALLGATHERV = S_(PETSCSFALLGATHERV) ALLGATHER = S_(PETSCSFALLGATHER) GATHERV = S_(PETSCSFGATHERV) GATHER = S_(PETSCSFGATHER) ALLTOALL = S_(PETSCSFALLTOALL) WINDOW = S_(PETSCSFWINDOW) # -------------------------------------------------------------------- cdef class Scatter(Object): Type = ScatterType Mode = ScatterMode # def __cinit__(self): self.obj = &self.sct self.sct = NULL def __call__(self, x, y, addv=None, mode=None): self.scatter(x, y, addv, mode) # def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( VecScatterView(self.sct, vwr) ) def destroy(self): CHKERR( VecScatterDestroy(&self.sct) ) return self def create(self, Vec vec_from, IS is_from or None, Vec vec_to, IS is_to or None): cdef PetscIS cisfrom = NULL, cisto = NULL if is_from is not None: cisfrom = is_from.iset if is_to is not None: cisto = is_to.iset cdef PetscScatter newsct = NULL CHKERR( VecScatterCreate( vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) PetscCLEAR(self.obj); self.sct = newsct return self def setType(self, scatter_type): cdef PetscScatterType cval = NULL vec_type = str2bytes(scatter_type, &cval) CHKERR( VecScatterSetType(self.sct, cval) ) def getType(self): cdef PetscScatterType cval = NULL CHKERR( VecScatterGetType(self.sct, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( VecScatterSetFromOptions(self.sct) ) def setUp(self): CHKERR( VecScatterSetUp(self.sct) ) return self def copy(self): cdef Scatter scatter = Scatter() CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) return scatter @classmethod def toAll(cls, Vec vec): cdef Scatter scatter = Scatter() cdef Vec ovec = Vec() CHKERR( VecScatterCreateToAll( vec.vec, &scatter.sct, &ovec.vec) ) return (scatter, ovec) @classmethod def toZero(cls, Vec vec): cdef Scatter scatter = Scatter() cdef Vec ovec = Vec() CHKERR( VecScatterCreateToZero( vec.vec, &scatter.sct, &ovec.vec) ) return (scatter, ovec) # def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, caddv, csctm) ) def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, caddv, csctm) ) # def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, caddv, csctm) ) def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, caddv, csctm) ) def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, caddv, csctm) ) CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, caddv, csctm) ) # -------------------------------------------------------------------- del ScatterType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Error.pyx0000644000175000017500000000162713750315427017133 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class Error(RuntimeError): _traceback_ = [] def __init__(self, int ierr=0): self.ierr = ierr RuntimeError.__init__(self, self.ierr) def __nonzero__(self): cdef int ierr = self.ierr return ierr != 0 def __repr__(self): return 'PETSc.Error(%d)' % self.ierr def __str__(self): cdef int csize=1, crank=0 if not (PetscFinalizeCalled): MPI_Comm_size(PETSC_COMM_WORLD, &csize) MPI_Comm_rank(PETSC_COMM_WORLD, &crank) width, rank = len(str(csize-1)), crank tblist = ['error code %d' % self.ierr] for entry in self._traceback_: tbline = '[%*d] %s' % (width, rank, entry) tblist.append(tbline) return '\n'.join(tblist) # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscis.pxi0000644000175000017500000001761113750315427017474 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscISType "ISType" PetscISType ISGENERAL PetscISType ISSTRIDE PetscISType ISBLOCK int ISView(PetscIS,PetscViewer) int ISDestroy(PetscIS*) int ISCreate(MPI_Comm,PetscIS*) int ISSetType(PetscIS,PetscISType) int ISGetType(PetscIS,PetscISType*) int ISCreateGeneral(MPI_Comm,PetscInt,PetscInt[],PetscCopyMode,PetscIS*) int ISCreateBlock(MPI_Comm,PetscInt,PetscInt,PetscInt[],PetscCopyMode,PetscIS*) int ISCreateStride(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscIS*) int ISLoad(PetscIS,PetscViewer) int ISDuplicate(PetscIS,PetscIS*) int ISCopy(PetscIS,PetscIS) int ISAllGather(PetscIS,PetscIS*) int ISInvertPermutation(PetscIS,PetscInt,PetscIS*) int ISGetSize(PetscIS,PetscInt*) int ISGetLocalSize(PetscIS,PetscInt*) int ISGetBlockSize(PetscIS,PetscInt*) int ISSetBlockSize(PetscIS,PetscInt) int ISGetIndices(PetscIS,const PetscInt*[]) int ISRestoreIndices(PetscIS,const PetscInt*[]) int ISEqual(PetscIS,PetscIS,PetscBool*) int ISSetPermutation(PetscIS) int ISPermutation(PetscIS,PetscBool*) int ISSetIdentity(PetscIS) int ISIdentity(PetscIS,PetscBool*) int ISSort(PetscIS) int ISSorted(PetscIS,PetscBool*) int ISSum(PetscIS,PetscIS,PetscIS*) int ISExpand(PetscIS,PetscIS,PetscIS*) int ISDifference(PetscIS,PetscIS,PetscIS*) int ISComplement(PetscIS,PetscInt,PetscInt,PetscIS*) int ISEmbed(PetscIS,PetscIS,PetscBool,PetscIS*) int ISRenumber(PetscIS,PetscIS,PetscInt*,PetscIS*) int ISGeneralSetIndices(PetscIS,PetscInt,PetscInt[],PetscCopyMode) int ISBlockSetIndices(PetscIS,PetscInt,PetscInt,PetscInt[],PetscCopyMode) int ISBlockGetIndices(PetscIS,const PetscInt*[]) int ISBlockRestoreIndices(PetscIS,const PetscInt*[]) int ISStrideSetStride(PetscIS,PetscInt,PetscInt,PetscInt) int ISStrideGetInfo(PetscIS,PetscInt*,PetscInt*) int ISToGeneral(PetscIS) cdef extern from * nogil: ctypedef const char* PetscISLocalToGlobalMappingType "ISLocalToGlobalMappingType" PetscISLocalToGlobalMappingType ISLOCALTOGLOBALMAPPINGBASIC PetscISLocalToGlobalMappingType ISLOCALTOGLOBALMAPPINGHASH ctypedef enum PetscGLMapMode "ISGlobalToLocalMappingMode": PETSC_IS_GTOLM_MASK "IS_GTOLM_MASK" PETSC_IS_GTOLM_DROP "IS_GTOLM_DROP" int ISLocalToGlobalMappingCreate(MPI_Comm,PetscInt,PetscInt,PetscInt[],PetscCopyMode,PetscLGMap*) int ISLocalToGlobalMappingCreateIS(PetscIS,PetscLGMap*) int ISLocalToGlobalMappingCreateSF(PetscSF,PetscInt,PetscLGMap*) int ISLocalToGlobalMappingSetType(PetscLGMap,PetscISLocalToGlobalMappingType) int ISLocalToGlobalMappingSetFromOptions(PetscLGMap) int ISLocalToGlobalMappingView(PetscLGMap,PetscViewer) int ISLocalToGlobalMappingDestroy(PetscLGMap*) int ISLocalToGlobalMappingGetSize(PetscLGMap,PetscInt*) int ISLocalToGlobalMappingGetBlockSize(PetscLGMap,PetscInt*) int ISLocalToGlobalMappingGetIndices(PetscLGMap,const PetscInt*[]) int ISLocalToGlobalMappingRestoreIndices(PetscLGMap,const PetscInt*[]) int ISLocalToGlobalMappingGetBlockIndices(PetscLGMap,const PetscInt*[]) int ISLocalToGlobalMappingRestoreBlockIndices(PetscLGMap,const PetscInt*[]) int ISLocalToGlobalMappingGetInfo(PetscLGMap,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]) int ISLocalToGlobalMappingRestoreInfo(PetscLGMap,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]) int ISLocalToGlobalMappingGetBlockInfo(PetscLGMap,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]) int ISLocalToGlobalMappingRestoreBlockInfo(PetscLGMap,PetscInt*,PetscInt*[],PetscInt*[],PetscInt**[]) int ISLocalToGlobalMappingApply(PetscLGMap,PetscInt,PetscInt[],PetscInt[]) int ISLocalToGlobalMappingApplyBlock(PetscLGMap,PetscInt,PetscInt[],PetscInt[]) int ISLocalToGlobalMappingApplyIS(PetscLGMap,PetscIS,PetscIS*) int ISGlobalToLocalMappingApply(PetscLGMap,PetscGLMapMode,PetscInt,PetscInt[],PetscInt*,PetscInt[]) int ISGlobalToLocalMappingApplyBlock(PetscLGMap,PetscGLMapMode,PetscInt,PetscInt[],PetscInt*,PetscInt[]) # -------------------------------------------------------------------- cdef inline IS ref_IS(PetscIS iset): cdef IS ob = IS() ob.iset = iset PetscINCREF(ob.obj) return ob cdef inline LGMap ref_LGMap(PetscLGMap lgm): cdef LGMap ob = LGMap() ob.lgm = lgm PetscINCREF(ob.obj) return ob # -------------------------------------------------------------------- cdef extern from "pep3118.h": int PyPetscBuffer_FillInfo(Py_buffer*, void*,PetscInt,char, int,int) except -1 void PyPetscBuffer_Release(Py_buffer*) # -------------------------------------------------------------------- cdef class _IS_buffer: cdef PetscIS iset cdef PetscInt size cdef const PetscInt *data cdef bint hasarray def __cinit__(self, IS iset): cdef PetscIS i = iset.iset CHKERR( PetscINCREF(&i) ) self.iset = i self.size = 0 self.data = NULL self.hasarray = 0 def __dealloc__(self): if self.hasarray and self.iset != NULL: CHKERR( ISRestoreIndices(self.iset, &self.data) ) CHKERR( ISDestroy(&self.iset) ) # cdef int acquire(self) except -1: if not self.hasarray and self.iset != NULL: CHKERR( ISGetLocalSize(self.iset, &self.size) ) CHKERR( ISGetIndices(self.iset, &self.data) ) self.hasarray = 1 return 0 cdef int release(self) except -1: if self.hasarray and self.iset != NULL: self.size = 0 CHKERR( ISRestoreIndices(self.iset, &self.data) ) self.hasarray = 0 self.data = NULL return 0 # buffer interface (PEP 3118) cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: self.acquire() PyPetscBuffer_FillInfo(view, self.data, self.size, c'i', 1, flags) view.obj = self return 0 cdef int releasebuffer(self, Py_buffer *view) except -1: PyPetscBuffer_Release(view) self.release() return 0 def __getbuffer__(self, Py_buffer *view, int flags): self.acquirebuffer(view, flags) def __releasebuffer__(self, Py_buffer *view): self.releasebuffer(view) # 'with' statement (PEP 343) cdef object enter(self): self.acquire() return asarray(self) cdef object exit(self): self.release() return None def __enter__(self): return self.enter() def __exit__(self, *exc): return self.exit() # buffer interface (legacy) cdef Py_ssize_t getbuffer(self, void **p) except -1: cdef PetscInt n = 0 if p != NULL: self.acquire() p[0] = self.data n = self.size elif self.iset != NULL: CHKERR( ISGetLocalSize(self.iset, &n) ) return (n*sizeof(PetscInt)) def __getsegcount__(self, Py_ssize_t *lenp): if lenp != NULL: lenp[0] = self.getbuffer(NULL) return 1 def __getreadbuffer__(self, Py_ssize_t idx, void **p): if idx != 0: raise SystemError( "accessing non-existent buffer segment") return self.getbuffer(p) # NumPy array interface (legacy) property __array_interface__: def __get__(self): cdef PetscInt n = 0 if self.iset != NULL: CHKERR( ISGetLocalSize(self.iset, &n) ) cdef object size = toInt(n) cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) return dict(version=3, data=self, shape=(size,), typestr=typestr) # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscds.pxi0000644000175000017500000000273213762215154017464 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscDSType PetscDSType PETSCDSBASIC int PetscDSCreate(MPI_Comm,PetscDS*) int PetscDSDestroy(PetscDS*) int PetscDSView(PetscDS,PetscViewer) int PetscDSSetType(PetscDS,PetscDSType) int PetscDSGetType(PetscDS,PetscDSType*) int PetscDSSetFromOptions(PetscDS) int PetscDSSetUp(PetscDS) int PetscDSGetHeightSubspace(PetscDS,PetscInt,PetscDS*) int PetscDSGetSpatialDimension(PetscDS,PetscInt*) int PetscDSGetCoordinateDimension(PetscDS,PetscInt*) int PetscDSSetCoordinateDimension(PetscDS,PetscInt) int PetscDSGetNumFields(PetscDS,PetscInt*) int PetscDSGetTotalDimension(PetscDS,PetscInt*) int PetscDSGetTotalComponents(PetscDS,PetscInt*) int PetscDSGetFieldIndex(PetscDS,PetscObject,PetscInt*) int PetscDSGetFieldSize(PetscDS,PetscInt,PetscInt*) int PetscDSGetFieldOffset(PetscDS,PetscInt,PetscInt*) int PetscDSGetDimensions(PetscDS,PetscInt*[]) int PetscDSGetComponents(PetscDS,PetscInt*[]) int PetscDSGetComponentOffset(PetscDS,PetscInt,PetscInt*) int PetscDSGetComponentOffsets(PetscDS,PetscInt*[]) int PetscDSGetComponentDerivativeOffsets(PetscDS,PetscInt*[]) int PetscDSGetDiscretization(PetscDS,PetscInt,PetscObject*) int PetscDSSetDiscretization(PetscDS,PetscInt,PetscObject) int PetscDSAddDiscretization(PetscDS,PetscObject) int PetscDSGetImplicit(PetscDS,PetscInt,PetscBool*) int PetscDSSetImplicit(PetscDS,PetscInt,PetscBool) petsc4py-3.15.1/src/PETSc/Random.pyx0000644000175000017500000000561313750315427017261 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class RandomType(object): RAND = S_(PETSCRAND) RAND48 = S_(PETSCRAND48) SPRNG = S_(PETSCSPRNG) RANDER48 = S_(PETSCRANDER48) RANDOM123 = S_(PETSCRANDOM123) # -------------------------------------------------------------------- cdef class Random(Object): Type = RandomType def __cinit__(self): self.obj = &self.rnd self.rnd = NULL def __call__(self): return self.getValue() def view(self, Viewer viewer=None): assert self.obj != NULL cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PetscRandomView(self.rnd, vwr) ) def destroy(self): CHKERR( PetscRandomDestroy(&self.rnd) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) return self def setType(self, rnd_type): cdef PetscRandomType cval = NULL rnd_type = str2bytes(rnd_type, &cval) CHKERR( PetscRandomSetType(self.rnd, cval) ) def getType(self): cdef PetscRandomType cval = NULL CHKERR( PetscRandomGetType(self.rnd, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( PetscRandomSetFromOptions(self.rnd) ) def getValue(self): cdef PetscScalar sval = 0 CHKERR( PetscRandomGetValue(self.rnd, &sval) ) return toScalar(sval) def getValueReal(self): cdef PetscReal rval = 0 CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) return toReal(rval) def getSeed(self): cdef unsigned long seed = 0 CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) return seed def setSeed(self, seed=None): if seed is not None: CHKERR( PetscRandomSetSeed(self.rnd, seed) ) CHKERR( PetscRandomSeed(self.rnd) ) def getInterval(self): cdef PetscScalar sval1 = 0 cdef PetscScalar sval2 = 1 CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) return (toScalar(sval1), toScalar(sval2)) def setInterval(self, interval): cdef PetscScalar sval1 = 0 cdef PetscScalar sval2 = 1 low, high = interval sval1 = asScalar(low) sval2 = asScalar(high) CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) ) # property seed: def __get__(self): return self.getSeed() def __set__(self, value): self.setSeed(value) property interval: def __get__(self): return self.getInterval() def __set__(self, value): self.setInterval(value) # -------------------------------------------------------------------- del RandomType # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscdmlabel.pxi0000644000175000017500000000374013750315427020457 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from* nogil: int DMLabelCreate(MPI_Comm,char[],PetscDMLabel*) #int DMLabelView(PetscDMLabel,PetscViewer) #int DMLabelReset(PetscDMLabel) int DMLabelDestroy(PetscDMLabel*) #int DMLabelGetDefaultValue(PetscDMLabel,PetscInt*) #int DMLabelSetDefaultValue(PetscDMLabel,PetscInt) #int DMLabelDuplicate(PetscDMLabel,PetscDMLabel*) #int DMLabelGetValue(PetscDMLabel,PetscInt,PetscInt*) #int DMLabelSetValue(PetscDMLabel,PetscInt,PetscInt) #int DMLabelClearValue(PetscDMLabel,PetscInt,PetscInt) #int DMLabelAddStratum(PetscDMLabel,PetscInt) #int DMLabelAddStrata(PetscDMLabel,PetscInt,const PetscInt[]) #int DMLabelAddStrataIS(PetscDMLabel,PetscIS) int DMLabelInsertIS(PetscDMLabel,PetscIS,PetscInt) #int DMLabelGetNumValues(PetscDMLabel,PetscInt*) #int DMLabelGetStratumBounds(PetscDMLabel,PetscInt,PetscInt*,PetscInt*) #int DMLabelGetValueIS(PetscDMLabel,PetscIS*) #int DMLabelStratumHasPoint(PetscDMLabel,PetscInt,PetscInt,PetscBool*) #int DMLabelHasStratum(PetscDMLabel,PetscInt,PetscBool*) #int DMLabelGetStratumSize(PetscDMLabel,PetscInt,PetscInt*) #int DMLabelGetStratumIS(PetscDMLabel,PetscInt,PetscIS*) #int DMLabelSetStratumIS(PetscDMLabel,PetscInt,PetscIS) #int DMLabelClearStratum(PetscDMLabel,PetscInt) #int DMLabelComputeIndex(PetscDMLabel) #int DMLabelCreateIndex(PetscDMLabel,PetscInt,PetscInt) #int DMLabelDestroyIndex(PetscDMLabel) #int DMLabelHasValue(PetscDMLabel,PetscInt,PetscBool*) #int DMLabelHasPoint(PetscDMLabel,PetscInt,PetscBool*) #int DMLabelGetBounds(PetscDMLabel,PetscInt*,PetscInt*) #int DMLabelFilter(PetscDMLabel,PetscInt,PetscInt) #int DMLabelPermute(PetscDMLabel,PetscIS,PetscDMLabel*) #int DMLabelDistribute(PetscDMLabel,PetscSF,PetscDMLabel*) #int DMLabelGather(PetscDMLabel,PetscSF,PetscDMLabel*) #int DMLabelConvertToSection(PetscDMLabel,PetscSection*,PetscIS*) petsc4py-3.15.1/src/PETSc/Sys.pyx0000644000175000017500000001504614030740317016610 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class Sys: @classmethod def getVersion(cls, devel=False, date=False, author=False): cdef char cversion[256] cdef PetscInt major=0, minor=0, micro=0, release=0 CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) out = version = (toInt(major), toInt(minor), toInt(micro)) if devel or date or author: out = [version] if devel: out.append(not release) if date: vstr = bytes2str(cversion) if release != 0: date = vstr.split(",", 1)[-1].strip() else: date = vstr.split("GIT Date:")[-1].strip() out.append(date) if author: author = bytes2str(PETSC_AUTHOR_INFO).split('\n') author = tuple([s.strip() for s in author if s]) out.append(author) return tuple(out) @classmethod def getVersionInfo(cls): version, dev, date, author = cls.getVersion(True, True, True) return dict(major = version[0], minor = version[1], subminor = version[2], release = not dev, date = date, authorinfo = author) # --- xxx --- @classmethod def isInitialized(cls): return toBool(PetscInitializeCalled) @classmethod def isFinalized(cls): return toBool(PetscFinalizeCalled) # --- xxx --- @classmethod def getDefaultComm(cls): cdef Comm comm = Comm() comm.comm = PETSC_COMM_DEFAULT return comm @classmethod def setDefaultComm(cls, comm): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) if ccomm == MPI_COMM_NULL: raise ValueError("null communicator") global PETSC_COMM_DEFAULT PETSC_COMM_DEFAULT = ccomm # --- xxx --- @classmethod def Print(cls, *args, **kargs): cdef object comm = kargs.get('comm', None) cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef object sep = kargs.get('sep', ' ') cdef object end = kargs.get('end', '\n') if comm_rank(ccomm) == 0: if not args: args = ('',) format = ['%s', sep] * len(args) format[-1] = end message = ''.join(format) % args else: message = '' cdef const char *m = NULL message = str2bytes(message, &m) CHKERR( PetscPrintf(ccomm, m) ) @classmethod def syncPrint(cls, *args, **kargs): cdef object comm = kargs.get('comm', None) cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef object sep = kargs.get('sep', ' ') cdef object end = kargs.get('end', '\n') cdef object flush = kargs.get('flush', False) if not args: args = ('',) format = ['%s', sep] * len(args) format[-1] = end message = ''.join(format) % args cdef const char *m = NULL message = str2bytes(message, &m) CHKERR( PetscSynchronizedPrintf(ccomm, m) ) if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) @classmethod def syncFlush(cls, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) # --- xxx --- @classmethod def splitOwnership(cls, size, bsize=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs=0, n=0, N=0 Sys_Sizes(size, bsize, &bs, &n, &N) if bs == PETSC_DECIDE: bs = 1 if n > 0: n = n // bs if N > 0: N = N // bs CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) n = n * bs N = N * bs return (toInt(n), toInt(N)) @classmethod def sleep(cls, seconds=1): cdef int s = seconds CHKERR( PetscSleep(s) ) # --- xxx --- @classmethod def pushErrorHandler(cls, errhandler): cdef PetscErrorHandlerFunction handler = NULL if errhandler == "python": handler = \ PetscPythonErrorHandler elif errhandler == "debugger": handler = PetscAttachDebuggerErrorHandler elif errhandler == "emacs": handler = PetscEmacsClientErrorHandler elif errhandler == "traceback": handler = PetscTraceBackErrorHandler elif errhandler == "ignore": handler = PetscIgnoreErrorHandler elif errhandler == "mpiabort": handler = PetscMPIAbortErrorHandler elif errhandler == "abort": handler = PetscAbortErrorHandler else: raise ValueError( "unknown error handler: %s" % errhandler) CHKERR( PetscPushErrorHandler(handler, NULL) ) @classmethod def popErrorHandler(cls): CHKERR( PetscPopErrorHandler() ) @classmethod def popSignalHandler(cls): CHKERR( PetscPopSignalHandler() ) @classmethod def infoAllow(cls, flag, filename=None, mode="w"): cdef PetscBool tval = PETSC_FALSE cdef const char *cfilename = NULL cdef const char *cmode = NULL if flag: tval = PETSC_TRUE CHKERR( PetscInfoAllow(tval) ) if filename is not None: filename = str2bytes(filename, &cfilename) mode = str2bytes(mode, &cmode) CHKERR( PetscInfoSetFile(cfilename, cmode) ) @classmethod def registerCitation(cls, citation): if not citation: raise ValueError("empty citation") cdef const char *cit = NULL citation = str2bytes(citation, &cit) cdef PetscBool flag = get_citation(citation) CHKERR( PetscCitationsRegister(cit, &flag) ) set_citation(citation, toBool(flag)) @classmethod def hasExternalPackage(cls, package): cdef const char *cpackage = NULL package = str2bytes(package, &cpackage) cdef PetscBool has = PETSC_FALSE CHKERR( PetscHasExternalPackage(cpackage, &has) ) return toBool(has) cdef dict citations_registry = { } cdef PetscBool get_citation(object citation): cdef bint is_set = citations_registry.get(citation) return PETSC_TRUE if is_set else PETSC_FALSE cdef set_citation(object citation, bint is_set): citations_registry[citation] = is_set # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/DMStag.pyx0000644000175000017500000003430413750315427017157 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class DMStagStencilType(object): STAR = DMSTAG_STENCIL_STAR BOX = DMSTAG_STENCIL_BOX NONE = DMSTAG_STENCIL_NONE class DMStagStencilLocation(object): NULLLOC = DMSTAG_NULL_LOCATION BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT BACK_DOWN = DMSTAG_BACK_DOWN BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT BACK_LEFT = DMSTAG_BACK_LEFT BACK = DMSTAG_BACK BACK_RIGHT = DMSTAG_BACK_RIGHT BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT BACK_UP = DMSTAG_BACK_UP BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT DOWN_LEFT = DMSTAG_DOWN_LEFT DOWN = DMSTAG_DOWN DOWN_RIGHT = DMSTAG_DOWN_RIGHT LEFT = DMSTAG_LEFT ELEMENT = DMSTAG_ELEMENT RIGHT = DMSTAG_RIGHT UP_LEFT = DMSTAG_UP_LEFT UP = DMSTAG_UP UP_RIGHT = DMSTAG_UP_RIGHT FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT FRONT_DOWN = DMSTAG_FRONT_DOWN FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT FRONT_LEFT = DMSTAG_FRONT_LEFT FRONT = DMSTAG_FRONT FRONT_RIGHT = DMSTAG_FRONT_RIGHT FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT FRONT_UP = DMSTAG_FRONT_UP FRONT_UP_RIGHT = DMSTAG_FRONT_UP_RIGHT # -------------------------------------------------------------------- cdef class DMStag(DM): StencilType = DMStagStencilType StencilLocation = DMStagStencilLocation def create(self, dim, dofs=None, sizes=None, boundary_types=None, stencil_type=None, stencil_width=None, proc_sizes=None, ownership_ranges=None, comm=None, setUp=False): # ndim cdef PetscInt ndim = asInt(dim) # sizes cdef object gsizes = sizes cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 if sizes is not None: nsizes = asStagDims(gsizes, &M, &N, &P) assert(nsizes==ndim) # dofs cdef object cdofs = dofs cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 if dofs is not None: ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) assert(ndofs==ndim+1) # boundary types cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE asBoundary(boundary_types, &btx, &bty, &btz) # stencil cdef PetscInt swidth = 0 if stencil_width is not None: swidth = asInt(stencil_width) cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE if stencil_type is not None: stype = asStagStencil(stencil_type) # comm cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # proc sizes cdef object psizes = proc_sizes cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE if proc_sizes is not None: nprocs = asStagDims(psizes, &m, &n, &p) assert(nprocs==ndim) # ownership ranges cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL if ownership_ranges is not None: nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) assert(nranges==ndim) # create cdef PetscDM newda = NULL if dim == 1: CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) if dim == 2: CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) if dim == 3: CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) PetscCLEAR(self.obj); self.dm = newda if setUp: CHKERR( DMSetUp(self.dm) ) return self # Setters def setStencilWidth(self,swidth): cdef PetscInt sw = asInt(swidth) CHKERR( DMStagSetStencilWidth(self.dm, sw) ) def setStencilType(self, stenciltype): cdef PetscDMStagStencilType stype = asStagStencil(stenciltype) CHKERR( DMStagSetStencilType(self.dm, stype) ) def setBoundaryTypes(self, boundary_types): cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE asBoundary(boundary_types, &btx, &bty, &btz) CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) def setDof(self, dofs): cdef tuple gdofs = tuple(dofs) cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) def setGlobalSizes(self, sizes): cdef tuple gsizes = tuple(sizes) cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 gdim = asStagDims(gsizes, &M, &N, &P) CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) def setProcSizes(self, sizes): cdef tuple psizes = tuple(sizes) cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE pdim = asStagDims(psizes, &m, &n, &p) CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) def setOwnershipRanges(self, ranges): cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) CHKERR( DMStagSetOwnershipRanges(self.dm, lx, ly, lz) ) # Getters def getDim(self): return self.getDimension() def getEntriesPerElement(self): cdef PetscInt epe=0 CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) return toInt(epe) def getStencilWidth(self): cdef PetscInt swidth=0 CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) return toInt(swidth) def getDof(self): cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) CHKERR( DMGetDimension(self.dm, &dim) ) return toDofs(dim+1,dof0,dof1,dof2,dof3) def getCorners(self): cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] def getGhostCorners(self): cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] def getLocalSizes(self): cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) return toStagDims(dim, m, n, p) def getGlobalSizes(self): cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) return toStagDims(dim, m, n, p) def getProcSizes(self): cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) return toStagDims(dim, m, n, p) def getStencilType(self): cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX CHKERR( DMStagGetStencilType(self.dm, &stype) ) return toStagStencil(stype) def getOwnershipRanges(self): cdef PetscInt dim=0, m=0, n=0, p=0 cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) def getBoundaryTypes(self): cdef PetscInt dim=0 cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) return toStagBoundaryTypes(dim, btx, bty, btz) def getIsFirstRank(self): cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE cdef PetscInt dim=0 CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) return toStagDims(dim, rank0, rank1, rank2) def getIsLastRank(self): cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE cdef PetscInt dim=0 CHKERR( DMGetDimension(self.dm, &dim) ) CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) return toStagDims(dim, rank0, rank1, rank2) # Coordinate-related functions def setUniformCoordinatesExplicit(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) def setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) def setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) def setCoordinateDMType(self, dmtype): cdef PetscDMType cval = NULL dmtype = str2bytes(dmtype, &cval) CHKERR( DMStagSetCoordinateDMType(self.dm, cval) ) # Location slot related functions def getLocationSlot(self, loc, c): cdef PetscInt slot=0 cdef PetscInt comp=asInt(c) cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) return toInt(slot) def getProductCoordinateLocationSlot(self, loc): cdef PetscInt slot=0 cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) return toInt(slot) def getLocationDof(self, loc): cdef PetscInt dof=0 cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) return toInt(dof) # Random other functions def migrateVec(self, Vec vec, DM dmTo, Vec vecTo): CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) def createCompatibleDMStag(self, dofs): cdef tuple gdofs = tuple(dofs) cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) cdef PetscDM newda = NULL CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) cdef DM newdm = type(self)() PetscCLEAR(newdm.obj); newdm.dm = newda return newdm def VecSplitToDMDA(self, Vec vec, loc, c): cdef PetscInt pc = asInt(c) cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) cdef PetscDM pda = NULL cdef PetscVec pdavec = NULL CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) cdef DM da = DMDA() PetscCLEAR(da.obj); da.dm = pda cdef Vec davec = Vec() PetscCLEAR(davec.obj); davec.vec = pdavec return (da,davec) def getVecArray(self, Vec vec): raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') def get1dCoordinatecArrays(self): raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') property dim: def __get__(self): return self.getDim() property dofs: def __get__(self): return self.getDof() property entries_per_element: def __get__(self): return self.getEntriesPerElement() property global_sizes: def __get__(self): return self.getGlobalSizes() property local_sizes: def __get__(self): return self.getLocalSizes() property proc_sizes: def __get__(self): return self.getProcSizes() property boundary_types: def __get__(self): return self.getBoundaryTypes() property stencil_type: def __get__(self): return self.getStencilType() property stencil_width: def __get__(self): return self.getStencilWidth() property corners: def __get__(self): return self.getCorners() property ghost_corners: def __get__(self): return self.getGhostCorners() # -------------------------------------------------------------------- del DMStagStencilType del DMStagStencilLocation # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/KSP.pyx0000644000175000017500000005204214030740317016464 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class KSPType(object): RICHARDSON = S_(KSPRICHARDSON) CHEBYSHEV = S_(KSPCHEBYSHEV) CG = S_(KSPCG) GROPPCG = S_(KSPGROPPCG) PIPECG = S_(KSPPIPECG) PIPECGRR = S_(KSPPIPECGRR) PIPELCG = S_(KSPPIPELCG) PIPEPRCG = S_(KSPPIPEPRCG) PIPECG2 = S_(KSPPIPECG2) CGNE = S_(KSPCGNE) NASH = S_(KSPNASH) STCG = S_(KSPSTCG) GLTR = S_(KSPGLTR) FCG = S_(KSPFCG) PIPEFCG = S_(KSPPIPEFCG) GMRES = S_(KSPGMRES) PIPEFGMRES = S_(KSPPIPEFGMRES) FGMRES = S_(KSPFGMRES) LGMRES = S_(KSPLGMRES) DGMRES = S_(KSPDGMRES) PGMRES = S_(KSPPGMRES) TCQMR = S_(KSPTCQMR) BCGS = S_(KSPBCGS) IBCGS = S_(KSPIBCGS) FBCGS = S_(KSPFBCGS) FBCGSR = S_(KSPFBCGSR) BCGSL = S_(KSPBCGSL) PIPEBCGS = S_(KSPPIPEBCGS) CGS = S_(KSPCGS) TFQMR = S_(KSPTFQMR) CR = S_(KSPCR) PIPECR = S_(KSPPIPECR) LSQR = S_(KSPLSQR) PREONLY = S_(KSPPREONLY) QCG = S_(KSPQCG) BICG = S_(KSPBICG) MINRES = S_(KSPMINRES) SYMMLQ = S_(KSPSYMMLQ) LCD = S_(KSPLCD) PYTHON = S_(KSPPYTHON) GCR = S_(KSPGCR) PIPEGCR = S_(KSPPIPEGCR) TSIRM = S_(KSPTSIRM) CGLS = S_(KSPCGLS) FETIDP = S_(KSPFETIDP) HPDDM = S_(KSPHPDDM) class KSPNormType(object): # native NORM_DEFAULT = KSP_NORM_DEFAULT NORM_NONE = KSP_NORM_NONE NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED NORM_NATURAL = KSP_NORM_NATURAL # aliases DEFAULT = NORM_DEFAULT NONE = NO = NORM_NONE PRECONDITIONED = NORM_PRECONDITIONED UNPRECONDITIONED = NORM_UNPRECONDITIONED NATURAL = NORM_NATURAL class KSPConvergedReason(object): #iterating CONVERGED_ITERATING = KSP_CONVERGED_ITERATING ITERATING = KSP_CONVERGED_ITERATING # converged CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL CONVERGED_RTOL = KSP_CONVERGED_RTOL CONVERGED_ATOL = KSP_CONVERGED_ATOL CONVERGED_ITS = KSP_CONVERGED_ITS CONVERGED_CG_NEG_CURVE = KSP_CONVERGED_CG_NEG_CURVE CONVERGED_CG_CONSTRAINED = KSP_CONVERGED_CG_CONSTRAINED CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN # diverged DIVERGED_NULL = KSP_DIVERGED_NULL DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT DIVERGED_DTOL = KSP_DIVERGED_DTOL DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC DIVERGED_NANORINF = KSP_DIVERGED_NANORINF DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED # -------------------------------------------------------------------- cdef class KSP(Object): Type = KSPType NormType = KSPNormType ConvergedReason = KSPConvergedReason # --- xxx --- def __cinit__(self): self.obj = &self.ksp self.ksp = NULL def __call__(self, b, x=None): if x is None: # XXX do this better x = self.getOperators()[0].createVecLeft() self.solve(b, x) return x # --- xxx --- def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( KSPView(self.ksp, vwr) ) def destroy(self): CHKERR( KSPDestroy(&self.ksp) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscKSP newksp = NULL CHKERR( KSPCreate(ccomm, &newksp) ) PetscCLEAR(self.obj); self.ksp = newksp return self def setType(self, ksp_type): cdef PetscKSPType cval = NULL ksp_type = str2bytes(ksp_type, &cval) CHKERR( KSPSetType(self.ksp, cval) ) def getType(self): cdef PetscKSPType cval = NULL CHKERR( KSPGetType(self.ksp, &cval) ) return bytes2str(cval) def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) def getOptionsPrefix(self): cdef const char *cval = NULL CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( KSPSetFromOptions(self.ksp) ) # --- application context --- def setAppCtx(self, appctx): self.set_attr('__appctx__', appctx) def getAppCtx(self): return self.get_attr('__appctx__') # --- discretization space --- def getDM(self): cdef PetscDM newdm = NULL CHKERR( KSPGetDM(self.ksp, &newdm) ) cdef DM dm = subtype_DM(newdm)() dm.dm = newdm PetscINCREF(dm.obj) return dm def setDM(self, DM dm): CHKERR( KSPSetDM(self.ksp, dm.dm) ) def setDMActive(self, bint flag): cdef PetscBool cflag = PETSC_FALSE if flag: cflag = PETSC_TRUE CHKERR( KSPSetDMActive(self.ksp, cflag) ) # --- operators and preconditioner --- def setComputeRHS(self, rhs, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (rhs, args, kargs) self.set_attr('__rhs__', context) CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) def setComputeOperators(self, operators, args=None, kargs=None): if args is None: args = () if kargs is None: kargs = {} context = (operators, args, kargs) self.set_attr('__operators__', context) CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) def setOperators(self, Mat A=None, Mat P=None): cdef PetscMat amat=NULL if A is not None: amat = A.mat cdef PetscMat pmat=amat if P is not None: pmat = P.mat CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) def getOperators(self): cdef Mat A = Mat(), P = Mat() CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) PetscINCREF(A.obj) PetscINCREF(P.obj) return (A, P) def setPC(self, PC pc): CHKERR( KSPSetPC(self.ksp, pc.pc) ) def getPC(self): cdef PC pc = PC() CHKERR( KSPGetPC(self.ksp, &pc.pc) ) PetscINCREF(pc.obj) return pc # --- tolerances and convergence --- def setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None): cdef PetscReal crtol, catol, cdivtol crtol = catol = cdivtol = PETSC_DEFAULT; if rtol is not None: crtol = asReal(rtol) if atol is not None: catol = asReal(atol) if divtol is not None: cdivtol = asReal(divtol) cdef PetscInt cmaxits = PETSC_DEFAULT if max_it is not None: cmaxits = asInt(max_it) CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) def getTolerances(self): cdef PetscReal crtol=0, catol=0, cdivtol=0 cdef PetscInt cmaxits=0 CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) def setConvergenceTest(self, converged, args=None, kargs=None): cdef PetscKSPNormType normtype = KSP_NORM_NONE cdef void* cctx = NULL if converged is not None: CHKERR( KSPSetConvergenceTest( self.ksp, KSP_Converged, NULL, NULL) ) if args is None: args = () if kargs is None: kargs = {} self.set_attr('__converged__', (converged, args, kargs)) else: CHKERR( KSPGetNormType(self.ksp, &normtype) ) if normtype != KSP_NORM_NONE: CHKERR( KSPConvergedDefaultCreate(&cctx) ) CHKERR( KSPSetConvergenceTest( self.ksp, KSPConvergedDefault, cctx, KSPConvergedDefaultDestroy) ) else: CHKERR( KSPSetConvergenceTest( self.ksp, KSPConvergedSkip, NULL, NULL) ) self.set_attr('__converged__', None) def getConvergenceTest(self): return self.get_attr('__converged__') def callConvergenceTest(self, its, rnorm): cdef PetscInt ival = asInt(its) cdef PetscReal rval = asReal(rnorm) cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) return reason def setConvergenceHistory(self, length=None, reset=False): cdef PetscReal *data = NULL cdef PetscInt size = 10000 cdef PetscBool flag = PETSC_FALSE if length is True: pass elif length is not None: size = asInt(length) if size < 0: size = 10000 if reset: flag = PETSC_TRUE cdef object hist = oarray_r(empty_r(size), NULL, &data) self.set_attr('__history__', hist) CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) def getConvergenceHistory(self): cdef const PetscReal *data = NULL cdef PetscInt size = 0 CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) return array_r(size, data) def logConvergenceHistory(self, rnorm): cdef PetscReal rval = asReal(rnorm) CHKERR( KSPLogResidualHistory(self.ksp, rval) ) # --- monitoring --- def setMonitor(self, monitor, args=None, kargs=None): if monitor is None: return cdef object monitorlist = self.get_attr('__monitor__') if monitorlist is None: monitorlist = [] self.set_attr('__monitor__', monitorlist) CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) if args is None: args = () if kargs is None: kargs = {} monitorlist.append((monitor, args, kargs)) def getMonitor(self): return self.get_attr('__monitor__') def cancelMonitor(self): CHKERR( KSPMonitorCancel(self.ksp) ) self.set_attr('__monitor__', None) def monitor(self, its, rnorm): cdef PetscInt ival = asInt(its) cdef PetscReal rval = asReal(rnorm) CHKERR( KSPMonitor(self.ksp, ival, rval) ) # --- customization --- def setPCSide(self, side): CHKERR( KSPSetPCSide(self.ksp, side) ) def getPCSide(self): cdef PetscPCSide side = PC_LEFT CHKERR( KSPGetPCSide(self.ksp, &side) ) return side def setNormType(self, normtype): CHKERR( KSPSetNormType(self.ksp, normtype) ) def getNormType(self): cdef PetscKSPNormType normtype = KSP_NORM_NONE CHKERR( KSPGetNormType(self.ksp, &normtype) ) return normtype def setComputeEigenvalues(self, bint flag): cdef PetscBool compute = PETSC_FALSE if flag: compute = PETSC_TRUE CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) def getComputeEigenvalues(self): cdef PetscBool flag = PETSC_FALSE CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) return toBool(flag) def setComputeSingularValues(self, bint flag): cdef PetscBool compute = PETSC_FALSE if flag: compute = PETSC_TRUE CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) def getComputeSingularValues(self): cdef PetscBool flag = PETSC_FALSE CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) return toBool(flag) # --- initial guess --- def setInitialGuessNonzero(self, bint flag): cdef PetscBool guess_nonzero = PETSC_FALSE if flag: guess_nonzero = PETSC_TRUE CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) def getInitialGuessNonzero(self): cdef PetscBool flag = PETSC_FALSE CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) return toBool(flag) def setInitialGuessKnoll(self, bint flag): cdef PetscBool guess_knoll = PETSC_FALSE if flag: guess_knoll = PETSC_TRUE CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) def getInitialGuessKnoll(self): cdef PetscBool flag = PETSC_FALSE CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) return toBool(flag) def setUseFischerGuess(self, model, size): cdef PetscInt ival1 = asInt(model) cdef PetscInt ival2 = asInt(size) CHKERR( KSPSetUseFischerGuess(self.ksp, ival1, ival2) ) # --- solving --- def setUp(self): CHKERR( KSPSetUp(self.ksp) ) def reset(self): CHKERR( KSPReset(self.ksp) ) def setUpOnBlocks(self): CHKERR( KSPSetUpOnBlocks(self.ksp) ) def solve(self, Vec b or None, Vec x or None): cdef PetscVec b_vec = NULL cdef PetscVec x_vec = NULL if b is not None: b_vec = b.vec if x is not None: x_vec = x.vec CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) def solveTranspose(self, Vec b, Vec x): CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) def setIterationNumber(self, its): cdef PetscInt ival = asInt(its) CHKERR( KSPSetIterationNumber(self.ksp, ival) ) def getIterationNumber(self): cdef PetscInt ival = 0 CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) return toInt(ival) def setResidualNorm(self, rnorm): cdef PetscReal rval = asReal(rnorm) CHKERR( KSPSetResidualNorm(self.ksp, rval) ) def getResidualNorm(self): cdef PetscReal rval = 0 CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) return toReal(rval) def setConvergedReason(self, reason): cdef PetscKSPConvergedReason val = reason CHKERR( KSPSetConvergedReason(self.ksp, val) ) def getConvergedReason(self): cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) return reason def getRhs(self): cdef Vec vec = Vec() CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) PetscINCREF(vec.obj) return vec def getSolution(self): cdef Vec vec = Vec() CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) PetscINCREF(vec.obj) return vec def getWorkVecs(self, right=None, left=None): cdef bint R = right is not None cdef bint L = left is not None cdef PetscInt i=0, nr=0, nl=0 cdef PetscVec *vr=NULL, *vl=NULL if R: nr = asInt(right) if L: nl = asInt(left) cdef object vecsr = [] if R else None cdef object vecsl = [] if L else None CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) try: for i from 0 <= i < nr: vecsr.append(ref_Vec(vr[i])) for i from 0 <= i < nl: vecsl.append(ref_Vec(vl[i])) finally: if nr > 0 and vr != NULL: VecDestroyVecs(nr, &vr) # XXX errors? if nl > 0 and vl !=NULL: VecDestroyVecs(nl, &vl) # XXX errors? # if R and L: return (vecsr, vecsl) elif R: return vecsr elif L: return vecsl else: return None def buildSolution(self, Vec x=None): if x is None: x = Vec() if x.vec == NULL: CHKERR( KSPGetSolution(self.ksp, &x.vec) ) CHKERR( VecDuplicate(x.vec, &x.vec) ) CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) return x def buildResidual(self, Vec r=None): if r is None: r = Vec() if r.vec == NULL: CHKERR( KSPGetRhs(self.ksp, &r.vec) ) CHKERR( VecDuplicate(r.vec, &r.vec) ) CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) return r def computeEigenvalues(self): cdef PetscInt its = 0 cdef PetscInt neig = 0 cdef PetscReal *rdata = NULL cdef PetscReal *idata = NULL CHKERR( KSPGetIterationNumber(self.ksp, &its) ) cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) eigen = empty_c(neig) eigen.real = r[:neig] eigen.imag = i[:neig] return eigen def computeExtremeSingularValues(self): cdef PetscReal smax = 0 cdef PetscReal smin = 0 CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) return smax, smin # --- GMRES --- def setGMRESRestart(self, restart): cdef PetscInt ival = asInt(restart) CHKERR( KSPGMRESSetRestart(self.ksp, ival) ) # --- Python --- def createPython(self, context=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscKSP newksp = NULL CHKERR( KSPCreate(ccomm, &newksp) ) PetscCLEAR(self.obj); self.ksp = newksp CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) CHKERR( KSPPythonSetContext(self.ksp, context) ) return self def setPythonContext(self, context): CHKERR( KSPPythonSetContext(self.ksp, context) ) def getPythonContext(self): cdef void *context = NULL CHKERR( KSPPythonGetContext(self.ksp, &context) ) if context == NULL: return None else: return context def setPythonType(self, py_type): cdef const char *cval = NULL py_type = str2bytes(py_type, &cval) CHKERR( KSPPythonSetType(self.ksp, cval) ) # --- application context --- property appctx: def __get__(self): return self.getAppCtx() def __set__(self, value): self.setAppCtx(value) # --- discretization space --- property dm: def __get__(self): return self.getDM() def __set__(self, value): self.setDM(value) # --- vectors --- property vec_sol: def __get__(self): return self.getSolution() property vec_rhs: def __get__(self): return self.getRhs() # --- operators --- property mat_op: def __get__(self): return self.getOperators()[0] property mat_pc: def __get__(self): return self.getOperators()[1] # --- initial guess --- property guess_nonzero: def __get__(self): return self.getInitialGuessNonzero() def __set__(self, value): self.setInitialGuessNonzero(value) property guess_knoll: def __get__(self): return self.getInitialGuessKnoll() def __set__(self, value): self.setInitialGuessKnoll(value) # --- preconditioner --- property pc: def __get__(self): return self.getPC() property pc_side: def __get__(self): return self.getPCSide() def __set__(self, value): self.setPCSide(value) property norm_type: def __get__(self): return self.getNormType() def __set__(self, value): self.setNormType(value) # --- tolerances --- property rtol: def __get__(self): return self.getTolerances()[0] def __set__(self, value): self.setTolerances(rtol=value) property atol: def __get__(self): return self.getTolerances()[1] def __set__(self, value): self.setTolerances(atol=value) property divtol: def __get__(self): return self.getTolerances()[2] def __set__(self, value): self.setTolerances(divtol=value) property max_it: def __get__(self): return self.getTolerances()[3] def __set__(self, value): self.setTolerances(max_it=value) # --- iteration --- property its: def __get__(self): return self.getIterationNumber() def __set__(self, value): self.setIterationNumber(value) property norm: def __get__(self): return self.getResidualNorm() def __set__(self, value): self.setResidualNorm(value) property history: def __get__(self): return self.getConvergenceHistory() # --- convergence --- property reason: def __get__(self): return self.getConvergedReason() def __set__(self, value): self.setConvergedReason(value) property iterating: def __get__(self): return self.reason == 0 property converged: def __get__(self): return self.reason > 0 property diverged: def __get__(self): return self.reason < 0 # -------------------------------------------------------------------- del KSPType del KSPNormType del KSPConvergedReason # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/DMComposite.pyx0000644000175000017500000000743413750315427020227 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class DMComposite(DM): def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscDM newdm = NULL CHKERR( DMCompositeCreate(ccomm, &newdm) ) PetscCLEAR(self.obj); self.dm = newdm return self def addDM(self, DM dm, *args): """Add DM to composite""" CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) cdef object item for item in args: dm = item CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) def getNumber(self): """Get number of sub-DMs contained in the DMComposite""" cdef PetscInt n = 0 CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) return toInt(n) getNumberDM = getNumber def getEntries(self): """Get tuple of sub-DMs contained in the DMComposite""" cdef PetscInt i, n = 0 cdef PetscDM *cdms = NULL CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) cdef DM entry = None cdef list entries = [] for i from 0 <= i < n: entry = subtype_DM(cdms[i])() entry.dm = cdms[i] PetscINCREF(entry.obj) entries.append(entry) return tuple(entries) def scatter(self, Vec gvec, lvecs): """Scatter coupled global vector into split local vectors""" cdef PetscInt i, n = 0 CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) cdef PetscVec *clvecs = NULL cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) for i from 0 <= i < n: clvecs[i] = (lvecs[i]).vec CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) def gather(self, Vec gvec, imode, lvecs): """Gather split local vectors into coupled global vector""" cdef PetscInsertMode cimode = insertmode(imode) cdef PetscInt i, n = 0 CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) cdef PetscVec *clvecs = NULL cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) for i from 0 <= i < n: clvecs[i] = (lvecs[i]).vec CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) def getGlobalISs(self): cdef PetscInt i, n = 0 cdef PetscIS *cis = NULL CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] for i from 0 <= i < n: CHKERR( ISDestroy(&cis[i]) ) CHKERR( PetscFree(cis) ) return isets def getLocalISs(self): cdef PetscInt i, n = 0 cdef PetscIS *cis = NULL CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] for i from 0 <= i < n: CHKERR( ISDestroy(&cis[i]) ) CHKERR( PetscFree(cis) ) return isets def getLGMaps(self): cdef PetscInt i, n = 0 cdef PetscLGMap *clgm = NULL CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] for i from 0 <= i < n: CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) CHKERR( PetscFree(clgm) ) return lgms def getAccess(self, Vec gvec, locs=None): """Get access to specified parts of global vector. Use via 'with' context manager (PEP 343). """ return _DMComposite_access(self, gvec, locs) petsc4py-3.15.1/src/PETSc/petscdmda.pxi0000644000175000017500000002757513750315427020000 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum PetscDMDAStencilType"DMDAStencilType": DMDA_STENCIL_STAR DMDA_STENCIL_BOX ctypedef enum PetscDMDAInterpolationType"DMDAInterpolationType": DMDA_INTERPOLATION_Q0 "DMDA_Q0" DMDA_INTERPOLATION_Q1 "DMDA_Q1" ctypedef enum PetscDMDAElementType"DMDAElementType": DMDA_ELEMENT_P1 DMDA_ELEMENT_Q1 int DMDACreateND(MPI_Comm, PetscInt,PetscInt, # dim, dof PetscInt,PetscInt,PetscInt, # M, N, P PetscInt,PetscInt,PetscInt, # m, n, p PetscInt[],PetscInt[],PetscInt[], # lx, ly, lz PetscDMBoundaryType, # bx PetscDMBoundaryType, # by PetscDMBoundaryType, # bz PetscDMDAStencilType, # stencil type PetscInt, # stencil width PetscDM*) int DMDASetDof(PetscDM,PetscInt) int DMDASetSizes(PetscDM,PetscInt,PetscInt,PetscInt) int DMDASetNumProcs(PetscDM,PetscInt,PetscInt,PetscInt) int DMDASetBoundaryType(PetscDM,PetscDMBoundaryType,PetscDMBoundaryType,PetscDMBoundaryType) int DMDASetStencilType(PetscDM,PetscDMDAStencilType) int DMDASetStencilWidth(PetscDM,PetscInt) int DMDAGetInfo(PetscDM, PetscInt*, PetscInt*,PetscInt*,PetscInt*, PetscInt*,PetscInt*,PetscInt*, PetscInt*,PetscInt*, PetscDMBoundaryType*, PetscDMBoundaryType*, PetscDMBoundaryType*, PetscDMDAStencilType*) int DMDAGetCorners(PetscDM, PetscInt*,PetscInt*,PetscInt*, PetscInt*,PetscInt*,PetscInt*) int DMDAGetGhostCorners(PetscDM, PetscInt*,PetscInt*,PetscInt*, PetscInt*,PetscInt*,PetscInt*) int DMDAGetOwnershipRanges(PetscDM, const PetscInt*[], const PetscInt*[], const PetscInt*[]) int DMDASetUniformCoordinates(PetscDM, PetscReal,PetscReal, PetscReal,PetscReal, PetscReal,PetscReal) int DMGetBoundingBox(PetscDM,PetscReal[],PetscReal[]) int DMGetLocalBoundingBox(PetscDM,PetscReal[],PetscReal[]) int DMDACreateNaturalVector(PetscDM,PetscVec*) int DMDAGlobalToNaturalBegin(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMDAGlobalToNaturalEnd(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMDANaturalToGlobalBegin(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMDANaturalToGlobalEnd(PetscDM,PetscVec,PetscInsertMode,PetscVec) int DMDAGetAO(PetscDM,PetscAO*) int DMDAGetScatter(PetscDM,PetscScatter*,PetscScatter*) int DMDASetRefinementFactor(PetscDM,PetscInt,PetscInt,PetscInt) int DMDAGetRefinementFactor(PetscDM,PetscInt*,PetscInt*,PetscInt*) int DMDASetInterpolationType(PetscDM,PetscDMDAInterpolationType) int DMDAGetInterpolationType(PetscDM,PetscDMDAInterpolationType*) int DMDASetElementType(PetscDM,PetscDMDAElementType) int DMDAGetElementType(PetscDM,PetscDMDAElementType*) int DMDAGetElements(PetscDM,PetscInt*,PetscInt*,const PetscInt**) int DMDARestoreElements(PetscDM,PetscInt*,PetscInt*,const PetscInt**) int DMDASetFieldName(PetscDM,PetscInt,const char[]) int DMDAGetFieldName(PetscDM,PetscInt,const char*[]) int DMDASetCoordinateName(PetscDM,PetscInt,const char[]) int DMDAGetCoordinateName(PetscDM,PetscInt,const char*[]) # -------------------------------------------------------------------- cdef inline PetscDMDAStencilType asStencil(object stencil) \ except (-1): if isinstance(stencil, str): if stencil == "star": return DMDA_STENCIL_STAR elif stencil == "box": return DMDA_STENCIL_BOX else: raise ValueError("unknown stencil type: %s" % stencil) return stencil cdef inline object toStencil(PetscDMDAStencilType stype): if stype == DMDA_STENCIL_STAR: return "star" elif stype == DMDA_STENCIL_BOX: return "box" cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ except (-1): if (isinstance(itype, str)): if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 else: raise ValueError("unknown interpolation type: %s" % itype) return itype cdef inline PetscDMDAElementType daelementtype(object etype) \ except (-1): if (isinstance(etype, str)): if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 else: raise ValueError("unknown element type: %s" % etype) return etype cdef inline int DMDAGetDim(PetscDM da, PetscInt *dim) nogil: return DMDAGetInfo(da, dim, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) cdef inline PetscInt asDims(dims, PetscInt *_M, PetscInt *_N, PetscInt *_P) except? -1: cdef PetscInt dim = PETSC_DECIDE cdef object M=None, N=None, P=None dims = tuple(dims) dim = len(dims) if dim == 0: pass elif dim == 1: M, = dims elif dim == 2: M, N = dims elif dim == 3: M, N, P = dims if dim >= 1: _M[0] = asInt(M) if dim >= 2: _N[0] = asInt(N) if dim >= 3: _P[0] = asInt(P) return dim cdef inline tuple toDims(PetscInt dim, PetscInt M, PetscInt N, PetscInt P): if dim == 0: return () elif dim == 1: return (toInt(M),) elif dim == 2: return (toInt(M), toInt(N)) elif dim == 3: return (toInt(M), toInt(N), toInt(P)) cdef inline tuple asOwnershipRanges(object ownership_ranges, PetscInt dim, PetscInt *m, PetscInt *n, PetscInt *p, PetscInt **_x, PetscInt **_y, PetscInt **_z): cdef object ranges = list(ownership_ranges) cdef PetscInt rdim = len(ranges) cdef PetscInt nlx=0, nly=0, nlz=0 if dim == PETSC_DECIDE: dim = rdim elif dim != rdim: raise ValueError( "number of dimensions %d and number ownership ranges %d" % (toInt(dim), toInt(rdim))) if dim >= 1: ranges[0] = iarray_i(ranges[0], &nlx, _x) if m[0] == PETSC_DECIDE: m[0] = nlx elif m[0] != nlx: raise ValueError( "ownership range size %d and number or processors %d" % (toInt(nlx), toInt(m[0]))) if dim >= 2: ranges[1] = iarray_i(ranges[1], &nly, _y) if n[0] == PETSC_DECIDE: n[0] = nly elif n[0] != nly: raise ValueError( "ownership range size %d and number or processors %d" % (toInt(nly), toInt(n[0]))) if dim >= 3: ranges[2] = iarray_i(ranges[2], &nlz, _z) if p[0] == PETSC_DECIDE: p[0] = nlz elif p[0] != nlz: raise ValueError( "ownership range size %d and number or processors %d" % (toInt(nlz), toInt(p[0]))) return tuple(ranges) cdef inline tuple toOwnershipRanges(PetscInt dim, PetscInt m, PetscInt n, PetscInt p, const PetscInt *lx, const PetscInt *ly, const PetscInt *lz): # Returns tuple of arrays containing ownership ranges as Python arrays ranges = [array_i(m, lx)] if dim > 1: ranges.append(array_i(n, ly)) if dim > 2: ranges.append(array_i(p, lz)) return tuple(ranges) # -------------------------------------------------------------------- cdef class _DMDA_Vec_array(object): cdef _Vec_buffer vecbuf cdef readonly tuple starts, sizes cdef readonly tuple shape, strides cdef readonly ndarray array def __cinit__(self, DMDA da, Vec vec, bint DOF=False): # cdef PetscInt dim=0, dof=0 CHKERR( DMDAGetInfo(da.dm, &dim, NULL, NULL, NULL, NULL, NULL, NULL, &dof, NULL, NULL, NULL, NULL, NULL) ) cdef PetscInt lxs=0, lys=0, lzs=0 cdef PetscInt lxm=0, lym=0, lzm=0 CHKERR( DMDAGetCorners(da.dm, &lxs, &lys, &lzs, &lxm, &lym, &lzm) ) cdef PetscInt gxs=0, gys=0, gzs=0 cdef PetscInt gxm=0, gym=0, gzm=0 CHKERR( DMDAGetGhostCorners(da.dm, &gxs, &gys, &gzs, &gxm, &gym, &gzm) ) # cdef PetscInt n=0 CHKERR( VecGetLocalSize(vec.vec, &n) ) cdef PetscInt xs, ys, zs, xm, ym, zm if (n == lxm*lym*lzm*dof): xs, ys, zs = lxs, lys, lzs xm, ym, zm = lxm, lym, lzm elif (n == gxm*gym*gzm*dof): xs, ys, zs = gxs, gys, gzs xm, ym, zm = gxm, gym, gzm else: raise ValueError( "Vector local size %d is not compatible " "with DMDA local sizes %s" % (n, toDims(dim, lxm, lym, lzm))) # cdef tuple starts = toDims(dim, xs, ys, zs) cdef tuple sizes = toDims(dim, xm, ym, zm) cdef Py_ssize_t k = sizeof(PetscScalar) cdef Py_ssize_t f = dof cdef Py_ssize_t d = dim cdef tuple shape = toDims(dim, xm, ym, zm) cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] if DOF or f > 1: shape += (f,) if DOF or f > 1: strides += (k,) # self.vecbuf = _Vec_buffer(vec) self.starts = starts self.sizes = sizes self.shape = shape self.strides = strides cdef int acquire(self) except -1: self.vecbuf.acquire() if self.array is None: self.array = asarray(self.vecbuf) self.array.shape = self.shape self.array.strides = self.strides return 0 cdef int release(self) except -1: self.vecbuf.release() self.array = None return 0 # def __getitem__(self, index): self.acquire() index = adjust_index_exp(self.starts, index) return self.array[index] def __setitem__(self, index, value): self.acquire() index = adjust_index_exp(self.starts, index) self.array[index] = value # 'with' statement (PEP 343) def __enter__(self): self.acquire() return self def __exit__(self, *exc): self.release() return None cdef object adjust_index_exp(object starts, object index): if not isinstance(index, tuple): return adjust_index(starts[0], index) index = list(index) for i, start in enumerate(starts): index[i] = adjust_index(start, index[i]) index = tuple(index) return index cdef object adjust_index(object lbound, object index): if index is None: return index if index is Ellipsis: return index if isinstance(index, slice): start = index.start stop = index.stop step = index.step if start is not None: start -= lbound if stop is not None: stop -= lbound return slice(start, stop, step) try: return index - lbound except TypeError: return index # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Viewer.pyx0000644000175000017500000003465214030740317017277 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class ViewerType(object): SOCKET = S_(PETSCVIEWERSOCKET) ASCII = S_(PETSCVIEWERASCII) BINARY = S_(PETSCVIEWERBINARY) STRING = S_(PETSCVIEWERSTRING) DRAW = S_(PETSCVIEWERDRAW) VU = S_(PETSCVIEWERVU) MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) HDF5 = S_(PETSCVIEWERHDF5) VTK = S_(PETSCVIEWERVTK) MATLAB = S_(PETSCVIEWERMATLAB) SAWS = S_(PETSCVIEWERSAWS) GLVIS = S_(PETSCVIEWERGLVIS) ADIOS = S_(PETSCVIEWERADIOS) ADIOS2 = S_(PETSCVIEWERADIOS2) EXODUSII = S_(PETSCVIEWEREXODUSII) class ViewerFormat(object): DEFAULT = PETSC_VIEWER_DEFAULT ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL ASCII_INFO = PETSC_VIEWER_ASCII_INFO ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX ASCII_XML = PETSC_VIEWER_ASCII_XML ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS ASCII_CSV = PETSC_VIEWER_ASCII_CSV DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC DRAW_LG = PETSC_VIEWER_DRAW_LG DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS VTK_VTS = PETSC_VIEWER_VTK_VTS VTK_VTR = PETSC_VIEWER_VTK_VTR VTK_VTU = PETSC_VIEWER_VTK_VTU BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB NATIVE = PETSC_VIEWER_NATIVE HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF HDF5_MAT = PETSC_VIEWER_HDF5_MAT NOFORMAT = PETSC_VIEWER_NOFORMAT LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE FAILED = PETSC_VIEWER_FAILED class FileMode(object): # native READ = PETSC_FILE_MODE_READ WRITE = PETSC_FILE_MODE_WRITE APPEND = PETSC_FILE_MODE_APPEND UPDATE = PETSC_FILE_MODE_UPDATE APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE # aliases R, W, A, U = READ, WRITE, APPEND, UPDATE AU = UA = APPEND_UPDATE class DrawSize(object): # native FULL_SIZE = PETSC_DRAW_FULL_SIZE HALF_SIZE = PETSC_DRAW_HALF_SIZE THIRD_SIZE = PETSC_DRAW_THIRD_SIZE QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE # aliases FULL = FULL_SIZE HALF = HALF_SIZE THIRD = THIRD_SIZE QUARTER = QUARTER_SIZE # -------------------------------------------------------------------- cdef class Viewer(Object): Type = ViewerType Format = ViewerFormat Mode = FileMode Size = DrawSize # def __cinit__(self): self.obj = &self.vwr self.vwr = NULL def __call__(self, Object obj): assert obj.obj != NULL CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) # def view(self, obj=None): if obj is None: CHKERR( PetscViewerView(self.vwr, NULL) ) elif isinstance(obj, Viewer): CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) else: assert (obj).obj != NULL CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) def destroy(self): CHKERR( PetscViewerDestroy(&self.vwr) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscViewer newvwr = NULL CHKERR( PetscViewerCreate(ccomm, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr return self def createASCII(self, name, mode=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE if mode is not None: cmode = filemode(mode) cdef PetscViewer newvwr = NULL CHKERR( PetscViewerCreate(ccomm, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) CHKERR( PetscViewerFileSetName(self.vwr, cname) ) return self def createBinary(self, name, mode=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscFileMode cmode = filemode(mode) cdef PetscViewer newvwr = NULL CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr return self def createMPIIO(self, name, mode=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscFileMode cmode = filemode(mode) cdef PetscViewer newvwr = NULL CHKERR( PetscViewerCreate(ccomm, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) CHKERR( PetscViewerFileSetName(self.vwr, cname) ) return self def createVTK(self, name, mode=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscFileMode cmode = filemode(mode) cdef PetscViewer newvwr = NULL CHKERR( PetscViewerCreate(ccomm, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) CHKERR( PetscViewerFileSetName(self.vwr, cname) ) return self def createHDF5(self, name, mode=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscFileMode cmode = filemode(mode) cdef PetscViewer newvwr = NULL CHKERR( PetscViewerCreate(ccomm, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) CHKERR( PetscViewerFileSetName(self.vwr, cname) ) return self def createDraw(self, display=None, title=None, position=None, size=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cdisplay = NULL cdef const char *ctitle = NULL display = str2bytes(display, &cdisplay) title = str2bytes(title, &ctitle) cdef int x, y, h, w x = y = h = w = PETSC_DECIDE if position not in (None, PETSC_DECIDE): x, y = position if size not in (None, PETSC_DECIDE): try: w, h = size except TypeError: w = h = size cdef PetscViewer newvwr = NULL CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, x, y, w, h, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr return self def setType(self, vwr_type): cdef PetscViewerType cval = NULL vwr_type = str2bytes(vwr_type, &cval) CHKERR( PetscViewerSetType(self.vwr, cval) ) def getType(self): cdef PetscViewerType cval = NULL CHKERR( PetscViewerGetType(self.vwr, &cval) ) return bytes2str(cval) def getFormat(self): cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT CHKERR( PetscViewerGetFormat(self.vwr, &format) ) return format def pushFormat(self, format): CHKERR( PetscViewerPushFormat(self.vwr, format) ) def popFormat(self): CHKERR( PetscViewerPopFormat(self.vwr) ) @classmethod def STDOUT(cls, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef Viewer viewer = Viewer() viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) PetscINCREF(viewer.obj) return viewer @classmethod def STDERR(cls, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef Viewer viewer = Viewer() viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) PetscINCREF(viewer.obj) return viewer @classmethod def ASCII(cls, name, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef Viewer viewer = Viewer() CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) return viewer @classmethod def BINARY(cls, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef Viewer viewer = Viewer() viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) PetscINCREF(viewer.obj) return viewer @classmethod def DRAW(cls, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef Viewer viewer = Viewer() viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) PetscINCREF(viewer.obj) return viewer # --- ASCII viewers --- def setASCIITab(self, tabs): cdef PetscInt ctabs = asInt(tabs) CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) def getASCIITab(self): cdef PetscInt tabs = 0 CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) return toInt(tabs) def addASCIITab(self, tabs): cdef PetscInt ctabs = asInt(tabs) CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) def subtractASCIITab(self, tabs): cdef PetscInt ctabs = asInt(tabs) CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) def pushASCIISynchronized(self): CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) def popASCIISynchronized(self): CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) def pushASCIITab(self): CHKERR( PetscViewerASCIIPushTab(self.vwr) ) def popASCIITab(self): CHKERR( PetscViewerASCIIPopTab(self.vwr) ) def useASCIITabs(self, flag): cdef PetscBool flg = flag CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) def printfASCII(self, msg): cdef const char *cmsg = NULL msg = str2bytes(msg, &cmsg) CHKERR( PetscViewerASCIIPrintf(self.vwr, cmsg) ) def printfASCIISynchronized(self, msg): cdef const char *cmsg = NULL msg = str2bytes(msg, &cmsg) CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, cmsg) ) # --- methods specific to file viewers --- def flush(self): CHKERR( PetscViewerFlush(self.vwr) ) def setFileMode(self, mode): CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) def getFileMode(self): cdef PetscFileMode mode = PETSC_FILE_MODE_READ CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) return mode def setFileName(self, name): cdef const char *cval = NULL name = str2bytes(name, &cval) CHKERR( PetscViewerFileSetName(self.vwr, cval) ) def getFileName(self): cdef const char *cval = NULL CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) return bytes2str(cval) # --- methods specific to draw viewers --- def setDrawInfo(self, display=None, title=None, position=None, size=None): cdef const char *cdisplay = NULL cdef const char *ctitle = NULL display = str2bytes(display, &cdisplay) title = str2bytes(title, &ctitle) cdef int x, y, h, w x = y = h = w = PETSC_DECIDE if position not in (None, PETSC_DECIDE): x, y = position if size not in (None, PETSC_DECIDE): try: w, h = size except TypeError: w = h = size CHKERR( PetscViewerDrawSetInfo(self.vwr, cdisplay, ctitle, x, y, w, h) ) def clearDraw(self): CHKERR( PetscViewerDrawClear(self.vwr) ) # -------------------------------------------------------------------- cdef class ViewerHDF5(Viewer): def create(self, name, mode=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef const char *cname = NULL name = str2bytes(name, &cname) cdef PetscFileMode cmode = filemode(mode) cdef PetscViewer newvwr = NULL CHKERR( PetscViewerCreate(ccomm, &newvwr) ) PetscCLEAR(self.obj); self.vwr = newvwr CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) CHKERR( PetscViewerFileSetName(self.vwr, cname) ) return self def getTimestep(self): cdef PetscInt ctimestep = 0 CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) return toInt(ctimestep) def setTimestep(self, timestep): CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) def incrementTimestep(self): CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) def pushGroup(self, group): cdef const char *cgroup = NULL group = str2bytes(group, &cgroup) CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) def popGroup(self): CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) def getGroup(self): cdef const char *cgroup = NULL CHKERR( PetscViewerHDF5GetGroup(self.vwr, &cgroup) ) return bytes2str(cgroup) # -------------------------------------------------------------------- del ViewerType del ViewerFormat del FileMode del DrawSize # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/Section.pyx0000644000175000017500000002113113750315427017436 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef class Section(Object): def __cinit__(self): self.obj = &self.sec self.sec = NULL def __dealloc__(self): CHKERR( PetscSectionDestroy(&self.sec) ) self.sec = NULL def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( PetscSectionView(self.sec, vwr) ) def destroy(self): CHKERR( PetscSectionDestroy(&self.sec) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscSection newsec = NULL CHKERR( PetscSectionCreate(ccomm, &newsec) ) PetscCLEAR(self.obj); self.sec = newsec return self def clone(self): cdef Section sec =
type(self)() CHKERR( PetscSectionClone(self.sec, &sec.sec) ) return sec def setUp(self): CHKERR( PetscSectionSetUp(self.sec) ) def reset(self): CHKERR( PetscSectionReset(self.sec) ) def getNumFields(self): cdef PetscInt numFields = 0 CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) return toInt(numFields) def setNumFields(self,numFields): cdef PetscInt cnumFields = asInt(numFields) CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) def getFieldName(self,field): cdef PetscInt cfield = asInt(field) cdef const char *fieldName = NULL CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) return bytes2str(fieldName) def setFieldName(self,field,fieldName): cdef PetscInt cfield = asInt(field) cdef const char *cname = NULL fieldName = str2bytes(fieldName, &cname) CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) def getFieldComponents(self,field): cdef PetscInt cfield = asInt(field), cnumComp = 0 CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) return toInt(cnumComp) def setFieldComponents(self,field,numComp): cdef PetscInt cfield = asInt(field) cdef PetscInt cnumComp = asInt(numComp) CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) def getChart(self): cdef PetscInt pStart = 0, pEnd = 0 CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) return toInt(pStart), toInt(pEnd) def setChart(self, pStart, pEnd): cdef PetscInt cStart = asInt(pStart) cdef PetscInt cEnd = asInt(pEnd) CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) def getDof(self,point): cdef PetscInt cpoint = asInt(point), cnumDof = 0 CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) return toInt(cnumDof) def setDof(self,point,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) def addDof(self,point,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) def getFieldDof(self,point,field): cdef PetscInt cpoint = asInt(point), cnumDof = 0 cdef PetscInt cfield = asInt(field) CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) return toInt(cnumDof) def setFieldDof(self,point,field,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) def addFieldDof(self,point,field,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) def getConstraintDof(self,point): cdef PetscInt cpoint = asInt(point), cnumDof = 0 CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) return toInt(cnumDof) def setConstraintDof(self,point,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) def addConstraintDof(self,point,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) def getFieldConstraintDof(self,point,field): cdef PetscInt cpoint = asInt(point), cnumDof = 0 cdef PetscInt cfield = asInt(field) CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) return toInt(cnumDof) def setFieldConstraintDof(self,point,field,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) def addFieldConstraintDof(self,point,field,numDof): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt cnumDof = asInt(numDof) CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) def getConstraintIndices(self,point): cdef PetscInt cpoint = asInt(point) cdef PetscInt nindex = 0 cdef const PetscInt *indices = NULL CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) return array_i(nindex, indices) def setConstraintIndices(self,point,indices): cdef PetscInt cpoint = asInt(point) cdef PetscInt nindex = 0 cdef PetscInt *cindices = NULL indices = iarray_i(indices, &nindex, &cindices) CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) def getFieldConstraintIndices(self,point,field): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt nindex = 0 cdef const PetscInt *indices = NULL CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) return array_i(nindex, indices) def setFieldConstraintIndices(self,point,field,indices): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt nindex = 0 cdef PetscInt *cindices = NULL indices = iarray_i(indices, &nindex, &cindices) CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) def getMaxDof(self): cdef PetscInt maxDof = 0 CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) return toInt(maxDof) def getStorageSize(self): cdef PetscInt size = 0 CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) return toInt(size) def getConstrainedStorageSize(self): cdef PetscInt size = 0 CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) return toInt(size) def getOffset(self,point): cdef PetscInt cpoint = asInt(point), offset = 0 CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) return toInt(offset) def setOffset(self,point,offset): cdef PetscInt cpoint = asInt(point) cdef PetscInt coffset = asInt(offset) CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) def getFieldOffset(self,point,field): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt offset = 0 CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) return toInt(offset) def setFieldOffset(self,point,field,offset): cdef PetscInt cpoint = asInt(point) cdef PetscInt cfield = asInt(field) cdef PetscInt coffset = asInt(offset) CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) def getOffsetRange(self): cdef PetscInt oStart = 0, oEnd = 0 CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) return toInt(oStart),toInt(oEnd) def createGlobalSection(self, SF sf): cdef Section gsec = Section() CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) return gsec petsc4py-3.15.1/src/PETSc/Vec.pyx0000644000175000017500000012656714062763234016572 0ustar balaybalay00000000000000# -------------------------------------------------------------------- class VecType(object): SEQ = S_(VECSEQ) MPI = S_(VECMPI) STANDARD = S_(VECSTANDARD) SHARED = S_(VECSHARED) SEQVIENNACL= S_(VECSEQVIENNACL) MPIVIENNACL= S_(VECMPIVIENNACL) VIENNACL = S_(VECVIENNACL) SEQCUDA = S_(VECSEQCUDA) MPICUDA = S_(VECMPICUDA) CUDA = S_(VECCUDA) NEST = S_(VECNEST) SEQKOKKOS = S_(VECSEQKOKKOS) MPIKOKKOS = S_(VECMPIKOKKOS) KOKKOS = S_(VECKOKKOS) class VecOption(object): IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES # -------------------------------------------------------------------- cdef class Vec(Object): Type = VecType Option = VecOption # def __cinit__(self): self.obj = &self.vec self.vec = NULL # unary operations def __pos__(self): return vec_pos(self) def __neg__(self): return vec_neg(self) def __abs__(self): return vec_abs(self) # inplace binary operations def __iadd__(self, other): return vec_iadd(self, other) def __isub__(self, other): return vec_isub(self, other) def __imul__(self, other): return vec_imul(self, other) def __idiv__(self, other): return vec_idiv(self, other) def __itruediv__(self, other): return vec_idiv(self, other) # binary operations def __add__(self, other): if isinstance(self, Vec): return vec_add(self, other) else: return vec_radd(other, self) def __sub__(self, other): if isinstance(self, Vec): return vec_sub(self, other) else: return vec_rsub(other, self) def __mul__(self, other): if isinstance(self, Vec): return vec_mul(self, other) else: return vec_rmul(other, self) def __div__(self, other): if isinstance(self, Vec): return vec_div(self, other) else: return vec_rdiv(other, self) def __truediv__(self, other): if isinstance(self, Vec): return vec_div(self, other) else: return vec_rdiv(other, self) # #def __len__(self): # cdef PetscInt size = 0 # CHKERR( VecGetSize(self.vec, &size) ) # return size def __getitem__(self, i): return vec_getitem(self, i) def __setitem__(self, i, v): vec_setitem(self, i, v) # buffer interface (PEP 3118) def __getbuffer__(self, Py_buffer *view, int flags): cdef _Vec_buffer buf = _Vec_buffer(self) buf.acquirebuffer(view, flags) def __releasebuffer__(self, Py_buffer *view): cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) buf.releasebuffer(view) self # unused # 'with' statement (PEP 343) def __enter__(self): cdef _Vec_buffer buf = _Vec_buffer(self) self.set_attr('__buffer__', buf) return buf.enter() def __exit__(self, *exc): cdef _Vec_buffer buf = self.get_attr('__buffer__') self.set_attr('__buffer__', None) return buf.exit() # def view(self, Viewer viewer=None): cdef PetscViewer vwr = NULL if viewer is not None: vwr = viewer.vwr CHKERR( VecView(self.vec, vwr) ) def destroy(self): CHKERR( VecDestroy(&self.vec) ) return self def create(self, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscVec newvec = NULL CHKERR( VecCreate(ccomm, &newvec) ) PetscCLEAR(self.obj); self.vec = newvec return self def setType(self, vec_type): cdef PetscVecType cval = NULL vec_type = str2bytes(vec_type, &cval) CHKERR( VecSetType(self.vec, cval) ) def setSizes(self, size, bsize=None): cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) CHKERR( VecSetSizes(self.vec, n, N) ) if bs != PETSC_DECIDE: CHKERR( VecSetBlockSize(self.vec, bs) ) # def createSeq(self, size, bsize=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) if bs == PETSC_DECIDE: bs = 1 cdef PetscVec newvec = NULL CHKERR( VecCreate(ccomm,&newvec) ) CHKERR( VecSetSizes(newvec, n, N) ) CHKERR( VecSetBlockSize(newvec, bs) ) CHKERR( VecSetType(newvec, VECSEQ) ) PetscCLEAR(self.obj); self.vec = newvec return self def createMPI(self, size, bsize=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) if bs == PETSC_DECIDE: bs = 1 cdef PetscVec newvec = NULL CHKERR( VecCreate(ccomm, &newvec) ) CHKERR( VecSetSizes(newvec, n, N) ) CHKERR( VecSetBlockSize(newvec, bs) ) CHKERR( VecSetType(newvec, VECMPI) ) PetscCLEAR(self.obj); self.vec = newvec return self def createWithArray(self, array, size=None, bsize=None, comm=None): cdef PetscInt na=0 cdef PetscScalar *sa=NULL array = iarray_s(array, &na, &sa) if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) if bs == PETSC_DECIDE: bs = 1 if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) cdef PetscVec newvec = NULL if comm_size(ccomm) == 1: CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) else: CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) PetscCLEAR(self.obj); self.vec = newvec self.set_attr('__array__', array) return self def createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None): """ Returns an instance of :class:`Vec`, a VECCUDA with user provided memory spaces for CPU and GPU arrays. :arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if *None*. :arg cudahandle: Address of the array on the GPU. Will be lazily allocated if *None*. :arg size: A :class:`int` denoting the size of the Vec. :arg bsize: A :class:`int` denoting the block size. """ cdef PetscInt na=0 cdef PetscScalar *sa=NULL cdef PetscScalar *gpuarray = NULL if cudahandle: gpuarray = (cudahandle) if cpuarray is not None: cpuarray = iarray_s(cpuarray, &na, &sa) if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) if bs == PETSC_DECIDE: bs = 1 if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) cdef PetscVec newvec = NULL if comm_size(ccomm) == 1: CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) else: CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) PetscCLEAR(self.obj); self.vec = newvec if cpuarray is not None: self.set_attr('__array__', cpuarray) return self def createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None): """ Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory spaces for CPU and GPU arrays. :arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if *None*. :arg viennaclvechandle: Address of the array on the GPU. Will be lazily allocated if *None*. :arg size: A :class:`int` denoting the size of the Vec. :arg size: A :class:`int` denoting the block size. """ cdef PetscInt na=0 cdef PetscScalar *sa=NULL cdef PetscScalar *vclvec = NULL if viennaclvechandle: vclvec = (viennaclvechandle) if cpuarray is not None: cpuarray = iarray_s(cpuarray, &na, &sa) if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) if bs == PETSC_DECIDE: bs = 1 if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) cdef PetscVec newvec = NULL if comm_size(ccomm) == 1: CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) else: CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) PetscCLEAR(self.obj); self.vec = newvec if cpuarray is not None: self.set_attr('__array__', cpuarray) return self def createWithDLPack(self, object dltensor, size=None, bsize=None, comm=None): """ Returns an instance :class:`Vec`, a PETSc vector from a DLPack object sharing the same memory. This operation does not modify the storage of the original tensor and should be used with contiguous tensors only. If the tensor is stored in row-major order (e.g. PyTorch tensors), the resulting vector will look like an unrolled tensor using row-major order. :arg dltensor: An object with a __dlpack__ method or a DLPack tensor object (for backward compatibility) :arg size: A :class:`int` denoting the size of the Vec. :arg bsize: A :class:`int` denoting the block size. """ cdef DLManagedTensor* ptr = NULL cdef int bits = 0 cdef PetscInt nz = 1 cdef int64_t ndim = 0 cdef int64_t* shape = NULL cdef int64_t* strides = NULL cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs = 0,n = 0,N = 0 cdef DLContext* ctx = NULL if not PyCapsule_CheckExact(dltensor): dltensor = dltensor.__dlpack__() if PyCapsule_IsValid(dltensor, 'dltensor'): ptr = PyCapsule_GetPointer(dltensor, 'dltensor') bits = ptr.dl_tensor.dtype.bits if bits != 8*sizeof(PetscScalar): raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) ndim = ptr.dl_tensor.ndim shape = ptr.dl_tensor.shape for s in shape[:ndim]: nz = nz*s strides = ptr.dl_tensor.strides PyCapsule_SetName(dltensor, 'used_dltensor') else: raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) if bs == PETSC_DECIDE: bs = 1 if nz < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(nz), toInt(n), toInt(bs))) cdef PetscVec newvec = NULL if ptr.dl_tensor.ctx.device_type == 2: if comm_size(ccomm) == 1: CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) else: CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) else: if comm_size(ccomm) == 1: CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) else: CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) PetscCLEAR(self.obj); self.vec = newvec self.set_attr('__array__', dltensor) cdef int64_t* shape_arr = NULL cdef int64_t* strides_arr = NULL cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) for i in range(ndim): shape_arr[i] = shape[i] strides_arr[i] = strides[i] self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) if ptr.manager_deleter != NULL: ptr.manager_deleter(ptr) # free the manager return self def attachDLPackInfo(self, Vec vec=None, object dltensor=None): """ Attach the tensor information from an input vector (vec) or a DLPack tensor if it is not available in current vector. The input vector is typically created with createWithDlpack(). This operation does not copy the data from the input parameters, it simply uses their meta information. Note that the auxiliary tensor information is required when converting a PETSc vector to a DLPack object. See also :meth:`Vec.clearDLPackInfo`. :arg vec: A :class:'Vec' containing auxiliary tensor information :arg dltensor: A DLPack tensor object """ cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None cdef DLManagedTensor* ptr = NULL cdef int64_t* shape_arr = NULL cdef int64_t* strides_arr = NULL cdef object s1 = None, s2 = None if vec is None and dltensor is None: raise ValueError('Missing input parameters') if vec is not None: t0 = self.getType() t1 = vec.getType() if t0 != t1: raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) ctx = (vec).get_attr('__dltensor_ctx__') if ctx is None: raise ValueError('Input vector has no tensor information') self.set_attr('__dltensor_ctx__', ctx) else: if PyCapsule_IsValid(dltensor, 'dltensor'): ptr = PyCapsule_GetPointer(dltensor, 'dltensor') elif PyCapsule_IsValid(dltensor, 'used_dltensor'): ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') else: raise ValueError("Expect a dltensor or used_dltensor field") bits = ptr.dl_tensor.dtype.bits if bits != 8*sizeof(PetscScalar): raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) ndim = ptr.dl_tensor.ndim shape = ptr.dl_tensor.shape strides = ptr.dl_tensor.strides s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) for i in range(ndim): shape_arr[i] = shape[i] strides_arr[i] = strides[i] self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) return self def clearDLPackInfo(self): """ Clear the tensor information See also :meth:`Vec.attachDLPackInfo`. """ self.set_attr('__dltensor_ctx__', None) return self def toDLPack(self): """ Return a DLPack tensor. Error out if the tensor information is missing. buildTensorInfo() can be used to get tensor information from an input vector that already has tensor information. This input vector is typically created with createWithDlpack(). One can do the following to convert vector X to a DLPack tensor whose anxiliary information inherits from Y. X.buildTensorInfo(Y) X.toDLPack() """ cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor cdef PetscScalar *a = NULL cdef int64_t ndim = 0 cdef int64_t* shape_strides = NULL dl_tensor.byte_offset = 0 cval = self.getType() if cval == self.Type.CUDA or cval == self.Type.SEQCUDA or cval == self.Type.MPICUDA: CHKERR( VecCUDAGetArrayWrite(self.vec, &a) ) else: CHKERR( VecGetArrayWrite(self.vec, &a) ) dl_tensor.data = a cdef DLContext* ctx = &dl_tensor.ctx cdef object ctx0 = self.get_attr('__dltensor_ctx__') if ctx0 is not None: (device_type, device_id, ndim, shape, strides) = ctx0 ctx.device_type = device_type ctx.device_id = device_id shape_strides = malloc(sizeof(int64_t)*2*ndim) for i in range(ndim): shape_strides[i] = shape[i] for i in range(ndim): shape_strides[i+ndim] = strides[i] else: raise ValueError('Missing tensor information') dl_tensor.ndim = ndim dl_tensor.shape = shape_strides dl_tensor.strides = shape_strides + ndim cdef DLDataType* dtype = &dl_tensor.dtype dtype.code = DLDataTypeCode.kDLFloat if sizeof(PetscScalar) == 8: dtype.bits = 64 elif sizeof(PetscScalar) == 4: dtype.bits = 32 else: raise ValueError('Unsupported PetscScalar type') dtype.lanes = 1 dlm_tensor.manager_ctx = self.vec CHKERR( PetscObjectReference(self.vec) ) dlm_tensor.manager_deleter = manager_deleter return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) def createGhost(self, ghosts, size, bsize=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt ng=0, *ig=NULL ghosts = iarray_i(ghosts, &ng, &ig) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) cdef PetscVec newvec = NULL if bs == PETSC_DECIDE: CHKERR( VecCreateGhost( ccomm, n, N, ng, ig, &newvec) ) else: CHKERR( VecCreateGhostBlock( ccomm, bs, n, N, ng, ig, &newvec) ) PetscCLEAR(self.obj); self.vec = newvec return self def createGhostWithArray(self, ghosts, array, size=None, bsize=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt ng=0, *ig=NULL ghosts = iarray_i(ghosts, &ng, &ig) cdef PetscInt na=0 cdef PetscScalar *sa=NULL array = oarray_s(array, &na, &sa) cdef PetscInt b = 1 if bsize is None else asInt(bsize) if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) if na < (n+ng*b): raise ValueError( "ghosts size %d, array size %d, and " "vector local size %d block size %d" % (toInt(ng), toInt(na), toInt(n), toInt(b))) cdef PetscVec newvec = NULL if bs == PETSC_DECIDE: CHKERR( VecCreateGhostWithArray( ccomm, n, N, ng, ig, sa, &newvec) ) else: CHKERR( VecCreateGhostBlockWithArray( ccomm, bs, n, N, ng, ig, sa, &newvec) ) PetscCLEAR(self.obj); self.vec = newvec self.set_attr('__array__', array) return self def createShared(self, size, bsize=None, comm=None): cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef PetscInt bs=0, n=0, N=0 Vec_Sizes(size, bsize, &bs, &n, &N) Sys_Layout(ccomm, bs, &n, &N) cdef PetscVec newvec = NULL CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) PetscCLEAR(self.obj); self.vec = newvec if bs != PETSC_DECIDE: CHKERR( VecSetBlockSize(self.vec, bs) ) return self def createNest(self, vecs, isets=None, comm=None): vecs = list(vecs) if isets: isets = list(isets) assert len(isets) == len(vecs) else: isets = None cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) cdef Py_ssize_t i, m = len(vecs) cdef PetscInt n = m cdef PetscVec *cvecs = NULL cdef PetscIS *cisets = NULL cdef object tmp1, tmp2 tmp1 = oarray_p(empty_p(n), NULL, &cvecs) for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec if isets is not None: tmp2 = oarray_p(empty_p(n), NULL, &cisets) for i from 0 <= i < m: cisets[i] = (isets[i]).iset cdef PetscVec newvec = NULL CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) PetscCLEAR(self.obj); self.vec = newvec return self # def setOptionsPrefix(self, prefix): cdef const char *cval = NULL prefix = str2bytes(prefix, &cval) CHKERR( VecSetOptionsPrefix(self.vec, cval) ) def getOptionsPrefix(self): cdef const char *cval = NULL CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) return bytes2str(cval) def setFromOptions(self): CHKERR( VecSetFromOptions(self.vec) ) def setUp(self): CHKERR( VecSetUp(self.vec) ) return self def setOption(self, option, flag): CHKERR( VecSetOption(self.vec, option, flag) ) def getType(self): cdef PetscVecType cval = NULL CHKERR( VecGetType(self.vec, &cval) ) return bytes2str(cval) def getSize(self): cdef PetscInt N = 0 CHKERR( VecGetSize(self.vec, &N) ) return toInt(N) def getLocalSize(self): cdef PetscInt n = 0 CHKERR( VecGetLocalSize(self.vec, &n) ) return toInt(n) def getSizes(self): cdef PetscInt n = 0, N = 0 CHKERR( VecGetLocalSize(self.vec, &n) ) CHKERR( VecGetSize(self.vec, &N) ) return (toInt(n), toInt(N)) def setBlockSize(self, bsize): cdef PetscInt bs = asInt(bsize) CHKERR( VecSetBlockSize(self.vec, bs) ) def getBlockSize(self): cdef PetscInt bs=0 CHKERR( VecGetBlockSize(self.vec, &bs) ) return toInt(bs) def getOwnershipRange(self): cdef PetscInt low=0, high=0 CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) return (toInt(low), toInt(high)) def getOwnershipRanges(self): cdef const PetscInt *rng = NULL CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) cdef MPI_Comm comm = MPI_COMM_NULL CHKERR( PetscObjectGetComm(self.vec, &comm) ) cdef int size = -1 CHKERR( MPI_Comm_size(comm, &size) ) return array_i(size+1, rng) def getBuffer(self, readonly=False): if readonly: return vec_getbuffer_r(self) else: return vec_getbuffer_w(self) def getArray(self, readonly=False): if readonly: return vec_getarray_r(self) else: return vec_getarray_w(self) def setArray(self, array): vec_setarray(self, array) def placeArray(self, array): cdef PetscInt nv=0 cdef PetscInt na=0 cdef PetscScalar *a = NULL CHKERR( VecGetLocalSize(self.vec, &nv) ) array = oarray_s(array, &na, &a) if (na != nv): raise ValueError( "cannot place input array size %d, vector size %d" % (toInt(na), toInt(nv))) CHKERR( VecPlaceArray(self.vec, a) ) self.set_attr('__placed_array__', array) def resetArray(self, force=False): cdef object array = None array = self.get_attr('__placed_array__') if array is None and not force: return None CHKERR( VecResetArray(self.vec) ) self.set_attr('__placed_array__', None) return array def bindToCPU(self, flg): """ If *flg* is *True*, all subsequent operations of *self* would be performed on CPU. If *flg* is *False*, all subsequent operations of *self* would be offloaded to the device, provided that the VecType is capable of offloading. :arg flg: An instance of :class:`bool`. """ cdef PetscBool bindFlg = asBool(flg) CHKERR( VecBindToCPU(self.vec, bindFlg) ) def getCUDAHandle(self, mode='rw'): cdef PetscScalar *hdl = NULL cdef const char *m = NULL if mode is not None: mode = str2bytes(mode, &m) if m == NULL or (m[0] == c'r' and m[1] == c'w'): CHKERR( VecCUDAGetArray(self.vec, &hdl) ) elif m[0] == c'r': CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) elif m[0] == c'w': CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) else: raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") return hdl def restoreCUDAHandle(self, handle, mode='rw'): cdef PetscScalar *hdl = (handle) cdef const char *m = NULL if mode is not None: mode = str2bytes(mode, &m) if m == NULL or (m[0] == c'r' and m[1] == c'w'): CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) elif m[0] == c'r': CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) elif m[0] == c'w': CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) else: raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") def getOffloadMask(self): """ Returns :class:`int` of the Vec's PetscOffloadMask enum value. """ cdef PetscOffloadMask mask CHKERR( VecGetOffloadMask(self.vec, &mask) ) return mask def getCLContextHandle(self): """ Returns a Vec's CL Context as :class:`int`. To interface with :mod:`pyopencl` refer :meth:`pyopencl.Context.from_int_ptr` """ cdef Py_uintptr_t ctxhdl = 0 CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) ) return ctxhdl def getCLQueueHandle(self): """ Returns a Vec's CL Context as :class:`int`. To interface with :mod:`pyopencl` refer :meth:`pyopencl.Context.from_int_ptr` """ cdef Py_uintptr_t queuehdl = 0 CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) ) return queuehdl def getCLMemHandle(self, mode='rw'): """ Returns a Vec's CL buffer as :class:`int`. To interface with :mod:`pyopencl` refer :meth:`pyopencl.MemoryObject.from_int_ptr`. :arg mode: An instance of class:`str` denoting the intended access usage to the CL buffer. Can be one of 'r'(read-only), 'w' (write-only) or 'rw' (read-write). See also :meth:`Vec.restoreCLMemHandle`. """ cdef Py_uintptr_t memhdl = 0 cdef const char *m = NULL mode = str2bytes(mode, &m) if m == NULL or (m[0] == c'r' and m[1] == c'w'): CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) elif m[0] == c'r': CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) elif m[0] == c'w': CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) else: raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") return memhdl def restoreCLMemHandle(self): """ To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes. See also :meth:`Vec.getCLMemHandle`. """ CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) def duplicate(self, array=None): cdef Vec vec = type(self)() CHKERR( VecDuplicate(self.vec, &vec.vec) ) # duplicate tensor context cdef object ctx0 = self.get_attr('__dltensor_ctx__') if ctx0 is not None: vec.set_attr('__dltensor_ctx__', ctx0) if array is not None: vec_setarray(vec, array) return vec def copy(self, Vec result=None): if result is None: result = type(self)() if result.vec == NULL: CHKERR( VecDuplicate(self.vec, &result.vec) ) CHKERR( VecCopy(self.vec, result.vec) ) return result def chop(self, tol): cdef PetscReal rval = asReal(tol) CHKERR( VecChop(self.vec, rval) ) def load(self, Viewer viewer): cdef MPI_Comm comm = MPI_COMM_NULL cdef PetscObject obj = (viewer.vwr) if self.vec == NULL: CHKERR( PetscObjectGetComm(obj, &comm) ) CHKERR( VecCreate(comm, &self.vec) ) CHKERR( VecLoad(self.vec, viewer.vwr) ) return self def equal(self, Vec vec): cdef PetscBool flag = PETSC_FALSE CHKERR( VecEqual(self.vec, vec.vec, &flag) ) return toBool(flag) def dot(self, Vec vec): cdef PetscScalar sval = 0 CHKERR( VecDot(self.vec, vec.vec, &sval) ) return toScalar(sval) def dotBegin(self, Vec vec): cdef PetscScalar sval = 0 CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) def dotEnd(self, Vec vec): cdef PetscScalar sval = 0 CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) return toScalar(sval) def tDot(self, Vec vec): cdef PetscScalar sval = 0 CHKERR( VecTDot(self.vec, vec.vec, &sval) ) return toScalar(sval) def tDotBegin(self, Vec vec): cdef PetscScalar sval = 0 CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) def tDotEnd(self, Vec vec): cdef PetscScalar sval = 0 CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) return toScalar(sval) def mDot(self, vecs, out=None): self; vecs; out; # unused raise NotImplementedError def mDotBegin(self, vecs, out=None): self; vecs; out; # unused raise NotImplementedError def mDotEnd(self, vecs, out=None): self; vecs; out; # unused raise NotImplementedError def mtDot(self, vecs, out=None): self; vecs; out; # unused raise NotImplementedError def mtDotBegin(self, vecs, out=None): self; vecs; out; # unused raise NotImplementedError def mtDotEnd(self, vecs, out=None): self; vecs; out; # unused raise NotImplementedError def norm(self, norm_type=None): cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 cdef PetscNormType ntype = PETSC_NORM_2 if norm_type is not None: ntype = norm_type cdef PetscReal rval[2] CHKERR( VecNorm(self.vec, ntype, rval) ) if ntype != norm_1_2: return toReal(rval[0]) else: return (toReal(rval[0]), toReal(rval[1])) def normBegin(self, norm_type=None): cdef PetscNormType ntype = PETSC_NORM_2 if norm_type is not None: ntype = norm_type cdef PetscReal dummy[2] CHKERR( VecNormBegin(self.vec, ntype, dummy) ) def normEnd(self, norm_type=None): cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 cdef PetscNormType ntype = PETSC_NORM_2 if norm_type is not None: ntype = norm_type cdef PetscReal rval[2] CHKERR( VecNormEnd(self.vec, ntype, rval) ) if ntype != norm_1_2: return toReal(rval[0]) else: return (toReal(rval[0]), toReal(rval[1])) def sum(self): cdef PetscScalar sval = 0 CHKERR( VecSum(self.vec, &sval) ) return toScalar(sval) def min(self): cdef PetscInt ival = 0 cdef PetscReal rval = 0 CHKERR( VecMin(self.vec, &ival, &rval) ) return (toInt(ival), toReal(rval)) def max(self): cdef PetscInt ival = 0 cdef PetscReal rval = 0 CHKERR( VecMax(self.vec, &ival, &rval) ) return (toInt(ival), toReal(rval)) def normalize(self): cdef PetscReal rval = 0 CHKERR( VecNormalize(self.vec, &rval) ) return toReal(rval) def reciprocal(self): CHKERR( VecReciprocal(self.vec) ) def exp(self): CHKERR( VecExp(self.vec) ) def log(self): CHKERR( VecLog(self.vec) ) def sqrtabs(self): CHKERR( VecSqrtAbs(self.vec) ) def abs(self): CHKERR( VecAbs(self.vec) ) def conjugate(self): CHKERR( VecConjugate(self.vec) ) def setRandom(self, Random random=None): cdef PetscRandom rnd = NULL if random is not None: rnd = random.rnd CHKERR( VecSetRandom(self.vec, rnd) ) def permute(self, IS order, invert=False): cdef PetscBool cinvert = PETSC_FALSE if invert: cinvert = PETSC_TRUE CHKERR( VecPermute(self.vec, order.iset, cinvert) ) def zeroEntries(self): CHKERR( VecZeroEntries(self.vec) ) def set(self, alpha): cdef PetscScalar sval = asScalar(alpha) CHKERR( VecSet(self.vec, sval) ) def isset(self, IS idx, alpha): cdef PetscScalar aval = asScalar(alpha) CHKERR( VecISSet(self.vec, idx.iset, aval) ) def scale(self, alpha): cdef PetscScalar sval = asScalar(alpha) CHKERR( VecScale(self.vec, sval) ) def shift(self, alpha): cdef PetscScalar sval = asScalar(alpha) CHKERR( VecShift(self.vec, sval) ) def chop(self, tol): cdef PetscReal rval = asReal(tol) CHKERR( VecChop(self.vec, rval) ) def swap(self, Vec vec): CHKERR( VecSwap(self.vec, vec.vec) ) def axpy(self, alpha, Vec x): cdef PetscScalar sval = asScalar(alpha) CHKERR( VecAXPY(self.vec, sval, x.vec) ) def isaxpy(self, IS idx, alpha, Vec x): cdef PetscScalar sval = asScalar(alpha) CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) def aypx(self, alpha, Vec x): cdef PetscScalar sval = asScalar(alpha) CHKERR( VecAYPX(self.vec, sval, x.vec) ) def axpby(self, alpha, beta, Vec y): cdef PetscScalar sval1 = asScalar(alpha) cdef PetscScalar sval2 = asScalar(beta) CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) ) def waxpy(self, alpha, Vec x, Vec y): cdef PetscScalar sval = asScalar(alpha) CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) def maxpy(self, alphas, vecs): cdef PetscInt n = 0 cdef PetscScalar *a = NULL cdef PetscVec *v = NULL cdef object tmp1 = iarray_s(alphas, &n, &a) cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) assert n == len(vecs) cdef Py_ssize_t i=0 for i from 0 <= i < n: v[i] = ((vecs[i])).vec CHKERR( VecMAXPY(self.vec, n, a, v) ) def pointwiseMult(self, Vec x, Vec y): CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) def pointwiseDivide(self, Vec x, Vec y): CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) def pointwiseMin(self, Vec x, Vec y): CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) def pointwiseMax(self, Vec x, Vec y): CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) def pointwiseMaxAbs(self, Vec x, Vec y): CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) def maxPointwiseDivide(self, Vec vec): cdef PetscReal rval = 0 CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) return toReal(rval) def getValue(self, index): cdef PetscInt ival = asInt(index) cdef PetscScalar sval = 0 CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) return toScalar(sval) def getValues(self, indices, values=None): return vecgetvalues(self.vec, indices, values) def getValuesStagStencil(self, indices, values=None): raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') def setValue(self, index, value, addv=None): cdef PetscInt ival = asInt(index) cdef PetscScalar sval = asScalar(value) cdef PetscInsertMode caddv = insertmode(addv) CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) def setValues(self, indices, values, addv=None): vecsetvalues(self.vec, indices, values, addv, 0, 0) def setValuesBlocked(self, indices, values, addv=None): vecsetvalues(self.vec, indices, values, addv, 1, 0) def setValuesStagStencil(self, indices, values, addv=None): raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') def setLGMap(self, LGMap lgmap): CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) def getLGMap(self): cdef LGMap cmap = LGMap() CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) PetscINCREF(cmap.obj) return cmap def setValueLocal(self, index, value, addv=None): cdef PetscInt ival = asInt(index) cdef PetscScalar sval = asScalar(value) cdef PetscInsertMode caddv = insertmode(addv) CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) def setValuesLocal(self, indices, values, addv=None): vecsetvalues(self.vec, indices, values, addv, 0, 1) def setValuesBlockedLocal(self, indices, values, addv=None): vecsetvalues(self.vec, indices, values, addv, 1, 1) def assemblyBegin(self): CHKERR( VecAssemblyBegin(self.vec) ) def assemblyEnd(self): CHKERR( VecAssemblyEnd(self.vec) ) def assemble(self): CHKERR( VecAssemblyBegin(self.vec) ) CHKERR( VecAssemblyEnd(self.vec) ) # --- methods for strided vectors --- def strideScale(self, field, alpha): cdef PetscInt ival = asInt(field) cdef PetscScalar sval = asScalar(alpha) CHKERR( VecStrideScale(self.vec, ival, sval) ) def strideSum(self, field): cdef PetscInt ival = asInt(field) cdef PetscScalar sval = 0 CHKERR( VecStrideSum(self.vec, ival, &sval) ) return toScalar(sval) def strideMin(self, field): cdef PetscInt ival1 = asInt(field) cdef PetscInt ival2 = 0 cdef PetscReal rval = 0 CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) return (toInt(ival2), toReal(rval)) def strideMax(self, field): cdef PetscInt ival1 = asInt(field) cdef PetscInt ival2 = 0 cdef PetscReal rval = 0 CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) return (toInt(ival2), toReal(rval)) def strideNorm(self, field, norm_type=None): cdef PetscInt ival = asInt(field) cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 cdef PetscNormType ntype = PETSC_NORM_2 if norm_type is not None: ntype = norm_type cdef PetscReal rval[2] CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) if ntype != norm_1_2: return toReal(rval[0]) else: return (toReal(rval[0]), toReal(rval[1])) def strideScatter(self, field, Vec vec, addv=None): cdef PetscInt ival = asInt(field) cdef PetscInsertMode caddv = insertmode(addv) CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) def strideGather(self, field, Vec vec, addv=None): cdef PetscInt ival = asInt(field) cdef PetscInsertMode caddv = insertmode(addv) CHKERR( VecStrideGather(self.vec, ival, vec.vec, caddv) ) # --- methods for vectors with ghost values --- def localForm(self): """ Intended for use in context manager:: with vec.localForm() as lf: use(lf) """ return _Vec_LocalForm(self) def ghostUpdateBegin(self, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) def ghostUpdateEnd(self, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) def ghostUpdate(self, addv=None, mode=None): cdef PetscInsertMode caddv = insertmode(addv) cdef PetscScatterMode csctm = scattermode(mode) CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) def setMPIGhost(self, ghosts): "Alternative to createGhost()" cdef PetscInt ng=0, *ig=NULL ghosts = iarray_i(ghosts, &ng, &ig) CHKERR( VecMPISetGhost(self.vec, ng, ig) ) # def getSubVector(self, IS iset, Vec subvec=None): if subvec is None: subvec = Vec() else: CHKERR( VecDestroy(&subvec.vec) ) CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) return subvec def restoreSubVector(self, IS iset, Vec subvec): CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) def getNestSubVecs(self): cdef PetscInt N=0 cdef PetscVec* sx=NULL CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) output = [] for i in range(N): pyvec = Vec() pyvec.vec = sx[i] CHKERR( PetscObjectReference( pyvec.vec) ) output.append(pyvec) return output def setNestSubVecs(self, sx, idxm=None): if idxm is None: idxm = range(len(sx)) else: assert len(idxm) == len(sx) cdef PetscInt N = 0 cdef PetscInt* cidxm = NULL idxm = iarray_i(idxm, &N, &cidxm) cdef PetscVec* csx = NULL tmp = oarray_p(empty_p(N), NULL, &csx) for i from 0 <= i < N: csx[i] = (sx[i]).vec CHKERR( VecNestSetSubVecs(self.vec, N, cidxm, csx) ) # property sizes: def __get__(self): return self.getSizes() def __set__(self, value): self.setSizes(value) property size: def __get__(self): return self.getSize() property local_size: def __get__(self): return self.getLocalSize() property block_size: def __get__(self): return self.getBlockSize() property owner_range: def __get__(self): return self.getOwnershipRange() property owner_ranges: def __get__(self): return self.getOwnershipRanges() property buffer_w: "Vec buffer (writable)" def __get__(self): return self.getBuffer() property buffer_r: "Vec buffer (read-only)" def __get__(self): return self.getBuffer(True) property array_w: "Vec array (writable)" def __get__(self): return self.getArray() def __set__(self, value): cdef buf = self.getBuffer() with buf as array: array[:] = value property array_r: "Vec array (read-only)" def __get__(self): return self.getArray(True) property buffer: def __get__(self): return self.buffer_w property array: def __get__(self): return self.array_w def __set__(self, value): self.array_w = value # --- NumPy array interface (legacy) --- property __array_interface__: def __get__(self): cdef buf = self.getBuffer() return buf.__array_interface__ # -------------------------------------------------------------------- del VecType del VecOption # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscao.pxi0000644000175000017500000000163513750315427017457 0ustar balaybalay00000000000000cdef extern from * nogil: ctypedef const char* PetscAOType "AOType" PetscAOType AOBASIC PetscAOType AOADVANCED PetscAOType AOMAPPING PetscAOType AOMEMORYSCALABLE int AOView(PetscAO,PetscViewer) int AODestroy(PetscAO*) int AOCreateBasic(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],PetscAO*) int AOCreateBasicIS(PetscIS,PetscIS,PetscAO*) int AOCreateMemoryScalable(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],PetscAO*) int AOCreateMemoryScalableIS(PetscIS,PetscIS,PetscAO*) int AOCreateMapping(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],PetscAO*) int AOCreateMappingIS(PetscIS,PetscIS,PetscAO*) int AOGetType(PetscAO,PetscAOType*) int AOApplicationToPetsc(PetscAO,PetscInt,PetscInt[]) int AOApplicationToPetscIS(PetscAO,PetscIS) int AOPetscToApplication(PetscAO,PetscInt,PetscInt[]) int AOPetscToApplicationIS(PetscAO,PetscIS) petsc4py-3.15.1/src/PETSc/PETSc.pyx0000644000175000017500000003441014030740317016744 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from *: ctypedef ssize_t Py_intptr_t ctypedef size_t Py_uintptr_t # -------------------------------------------------------------------- cdef inline object bytes2str(const char p[]): if p == NULL: return None cdef bytes s = p if isinstance(s, str): return s else: return s.decode() cdef inline object str2bytes(object s, const char *p[]): if s is None: p[0] = NULL return None if not isinstance(s, bytes): s = s.encode() p[0] = (s) return s cdef inline object S_(const char p[]): if p == NULL: return None cdef object s = p return s if isinstance(s, str) else s.decode() # -------------------------------------------------------------------- # Vile hack for raising a exception and not contaminating traceback cdef extern from *: enum: PETSC_ERR_PYTHON cdef extern from *: void PyErr_SetObject(object, object) void *PyExc_RuntimeError cdef object PetscError = PyExc_RuntimeError cdef inline int SETERR(int ierr) with gil: if (PetscError) != NULL: PyErr_SetObject(PetscError, ierr) else: PyErr_SetObject(PyExc_RuntimeError, ierr) return ierr cdef inline int CHKERR(int ierr) nogil except -1: if ierr == 0: return 0 # no error if ierr == PETSC_ERR_PYTHON: return -1 # error in Python call SETERR(ierr) return -1 # -------------------------------------------------------------------- # PETSc support # ------------- cdef extern from "compat.h": pass cdef extern from "custom.h": pass cdef extern from *: ctypedef long PetscInt ctypedef double PetscReal ctypedef double PetscScalar cdef extern from "scalar.h": object PyPetscScalar_FromPetscScalar(PetscScalar) PetscScalar PyPetscScalar_AsPetscScalar(object) except? -1.0 cdef inline object toBool(PetscBool value): return True if value else False cdef inline PetscBool asBool(object value) except? 0: return PETSC_TRUE if value else PETSC_FALSE cdef inline object toInt(PetscInt value): return value cdef inline PetscInt asInt(object value) except? -1: return value cdef inline object toReal(PetscReal value): return value cdef inline PetscReal asReal(object value) except? -1: return value cdef inline object toScalar(PetscScalar value): return PyPetscScalar_FromPetscScalar(value) cdef inline PetscScalar asScalar(object value) except? -1.0: return PyPetscScalar_AsPetscScalar(value) # -------------------------------------------------------------------- # NumPy support # ------------- include "arraynpy.pxi" import_array() IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX) # -------------------------------------------------------------------- include "petscdef.pxi" include "petscmem.pxi" include "petscopt.pxi" include "petscmpi.pxi" include "petscsys.pxi" include "petsclog.pxi" include "petscobj.pxi" include "petscvwr.pxi" include "petscrand.pxi" include "petscis.pxi" include "petscsf.pxi" include "petscvec.pxi" include "petscdt.pxi" include "petscfe.pxi" include "petscsct.pxi" include "petscsec.pxi" include "petscmat.pxi" include "petscpc.pxi" include "petscksp.pxi" include "petscsnes.pxi" include "petscts.pxi" include "petsctao.pxi" include "petscao.pxi" include "petscdm.pxi" include "petscds.pxi" include "petscdmda.pxi" include "petscdmplex.pxi" include "petscdmstag.pxi" include "petscdmcomposite.pxi" include "petscdmshell.pxi" include "petscdmlabel.pxi" include "petscdmswarm.pxi" include "petscpartitioner.pxi" # -------------------------------------------------------------------- __doc__ = u""" Portable, Extensible Toolkit for Scientific Computation """ include "Const.pyx" include "Error.pyx" include "Options.pyx" include "Sys.pyx" include "Log.pyx" include "Comm.pyx" include "Object.pyx" include "Viewer.pyx" include "Random.pyx" include "IS.pyx" include "SF.pyx" include "Vec.pyx" include "DT.pyx" include "FE.pyx" include "Scatter.pyx" include "Section.pyx" include "Mat.pyx" include "PC.pyx" include "KSP.pyx" include "SNES.pyx" include "TS.pyx" include "TAO.pyx" include "AO.pyx" include "DM.pyx" include "DS.pyx" include "DMDA.pyx" include "DMPlex.pyx" include "DMStag.pyx" include "DMComposite.pyx" include "DMShell.pyx" include "DMLabel.pyx" include "DMSwarm.pyx" include "Partitioner.pyx" # -------------------------------------------------------------------- include "CAPI.pyx" # -------------------------------------------------------------------- cdef extern from "Python.h": int Py_IsInitialized() nogil cdef extern from * nogil: int PetscTBEH(MPI_Comm,int,char*,char*, int,PetscErrorType,char*,void*) cdef object tracebacklist = [] cdef int traceback(MPI_Comm comm, int line, const char *cfun, const char *cfile, int n, PetscErrorType p, const char *mess, void *ctx) with gil: cdef PetscLogDouble mem=0 cdef PetscLogDouble rss=0 cdef const char *text=NULL global tracebacklist cdef object tbl = tracebacklist fun = bytes2str(cfun) fnm = bytes2str(cfile) m = "%s() line %d in %s" % (fun, line, fnm) tbl.insert(0, m) if p != PETSC_ERROR_INITIAL: return n # del tbl[1:] # clear any previous stuff if n == PETSC_ERR_MEM: # special case PetscMallocGetCurrentUsage(&mem) PetscMemoryGetCurrentUsage(&rss) m = ("Out of memory. " "Allocated: %d, " "Used by process: %d") % (mem, rss) tbl.append(m) else: PetscErrorMessage(n, &text, NULL) if text != NULL: tbl.append(bytes2str(text)) if mess != NULL: tbl.append(bytes2str(mess)) comm; ctx; # unused return n cdef int PetscPythonErrorHandler( MPI_Comm comm, int line, const char *cfun, const char *cfile, int n, PetscErrorType p, const char *mess, void *ctx) nogil: global tracebacklist if Py_IsInitialized() and (tracebacklist) != NULL: return traceback(comm, line, cfun, cfile, n, p, mess, ctx) else: return PetscTBEH(comm, line, cfun, cfile, n, p, mess, ctx) # -------------------------------------------------------------------- cdef extern from "stdlib.h" nogil: void* malloc(size_t) void* realloc (void*,size_t) void free(void*) cdef extern from "string.h" nogil: void* memset(void*,int,size_t) void* memcpy(void*,void*,size_t) char* strdup(char*) cdef extern from "Python.h": int Py_AtExit(void (*)()) void PySys_WriteStderr(char*,...) cdef extern from "stdio.h" nogil: ctypedef struct FILE FILE *stderr int fprintf(FILE *, char *, ...) cdef extern from "initpkg.h": int PetscInitializePackageAll() cdef extern from "libpetsc4py.h": int import_libpetsc4py() except -1 int PetscPythonRegisterAll() cdef int PyPetsc_Argc = 0 cdef char** PyPetsc_Argv = NULL cdef int getinitargs(object args, int *argc, char **argv[]) except -1: # allocate command line arguments cdef int i, c = 0 cdef char **v = NULL if args is None: args = [] args = [str(a).encode() for a in args] args = [a for a in args if a] c = len(args) v = malloc((c+1)*sizeof(char*)) if v == NULL: raise MemoryError memset(v, 0, (c+1)*sizeof(char*)) try: for 0 <= i < c: v[i] = strdup(args[i]) if v[i] == NULL: raise MemoryError except: delinitargs(&c, &v); raise argc[0] = c; argv[0] = v return 0 cdef void delinitargs(int *argc, char **argv[]) nogil: # dallocate command line arguments cdef int i, c = argc[0] cdef char** v = argv[0] argc[0] = 0; argv[0] = NULL; if c >= 0 and v != NULL: for 0 <= i < c: if v[i] != NULL: free(v[i]) free(v) cdef void finalize() nogil: cdef int ierr = 0 # deallocate command line arguments global PyPetsc_Argc; global PyPetsc_Argv; delinitargs(&PyPetsc_Argc, &PyPetsc_Argv) # manage PETSc finalization if not (PetscInitializeCalled): return if (PetscFinalizeCalled): return # deinstall Python error handler ierr = PetscPopErrorHandler() if ierr != 0: fprintf(stderr, "PetscPopErrorHandler() failed " "[error code: %d]\n", ierr) # finalize PETSc ierr = PetscFinalize() if ierr != 0: fprintf(stderr, "PetscFinalize() failed " "[error code: %d]\n", ierr) # and we are done, see you later !! cdef int initialize(object args, object comm) except -1: if (PetscInitializeCalled): return 1 if (PetscFinalizeCalled): return 0 # allocate command line arguments global PyPetsc_Argc; global PyPetsc_Argv; getinitargs(args, &PyPetsc_Argc, &PyPetsc_Argv) # communicator global PETSC_COMM_WORLD PETSC_COMM_WORLD = def_Comm(comm, PETSC_COMM_WORLD) # initialize PETSc CHKERR( PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL) ) # install Python error handler cdef PetscErrorHandlerFunction handler = NULL handler = PetscPythonErrorHandler CHKERR( PetscPushErrorHandler(handler, NULL) ) # register finalization function if Py_AtExit(finalize) < 0: PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", b"PetscFinalize()") return 1 # and we are done, enjoy !! cdef extern from *: PetscClassId PETSC_OBJECT_CLASSID "PETSC_OBJECT_CLASSID" PetscClassId PETSC_VIEWER_CLASSID "PETSC_VIEWER_CLASSID" PetscClassId PETSC_RANDOM_CLASSID "PETSC_RANDOM_CLASSID" PetscClassId PETSC_IS_CLASSID "IS_CLASSID" PetscClassId PETSC_LGMAP_CLASSID "IS_LTOGM_CLASSID" PetscClassId PETSC_SF_CLASSID "PETSCSF_CLASSID" PetscClassId PETSC_VEC_CLASSID "VEC_CLASSID" PetscClassId PETSC_SECTION_CLASSID "PETSC_SECTION_CLASSID" PetscClassId PETSC_MAT_CLASSID "MAT_CLASSID" PetscClassId PETSC_NULLSPACE_CLASSID "MAT_NULLSPACE_CLASSID" PetscClassId PETSC_PC_CLASSID "PC_CLASSID" PetscClassId PETSC_KSP_CLASSID "KSP_CLASSID" PetscClassId PETSC_SNES_CLASSID "SNES_CLASSID" PetscClassId PETSC_TS_CLASSID "TS_CLASSID" PetscClassId PETSC_TAO_CLASSID "TAO_CLASSID" PetscClassId PETSC_AO_CLASSID "AO_CLASSID" PetscClassId PETSC_DM_CLASSID "DM_CLASSID" PetscClassId PETSC_DS_CLASSID "PETSCDS_CLASSID" PetscClassId PETSC_PARTITIONER_CLASSID "PETSCPARTITIONER_CLASSID" PetscClassId PETSC_FE_CLASSID "PETSCFE_CLASSID" PetscClassId PETSC_DMLABEL_CLASSID "DMLABEL_CLASSID" cdef bint registercalled = 0 cdef const char *citation = b"""\ @Article{Dalcin2011, Author = {Lisandro D. Dalcin and Rodrigo R. Paz and Pablo A. Kler and Alejandro Cosimo}, Title = {Parallel distributed computing using {P}ython}, Journal = {Advances in Water Resources}, Note = {New Computational Methods and Software Tools}, Volume = {34}, Number = {9}, Pages = {1124--1139}, Year = {2011}, DOI = {http://dx.doi.org/10.1016/j.advwatres.2011.04.013} } """ cdef int register() except -1: global registercalled if registercalled: return 0 registercalled = True # register citation CHKERR( PetscCitationsRegister(citation, NULL) ) # make sure all PETSc packages are initialized CHKERR( PetscInitializePackageAll() ) # register custom implementations import_libpetsc4py() CHKERR( PetscPythonRegisterAll() ) # register Python types PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) PyPetscType_Register(PETSC_IS_CLASSID, IS) PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) PyPetscType_Register(PETSC_SF_CLASSID, SF) PyPetscType_Register(PETSC_VEC_CLASSID, Vec) PyPetscType_Register(PETSC_SECTION_CLASSID, Section) PyPetscType_Register(PETSC_MAT_CLASSID, Mat) PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) PyPetscType_Register(PETSC_PC_CLASSID, PC) PyPetscType_Register(PETSC_KSP_CLASSID, KSP) PyPetscType_Register(PETSC_SNES_CLASSID, SNES) PyPetscType_Register(PETSC_TS_CLASSID, TS) PyPetscType_Register(PETSC_TAO_CLASSID, TAO) PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) PyPetscType_Register(PETSC_AO_CLASSID, AO) PyPetscType_Register(PETSC_DM_CLASSID, DM) PyPetscType_Register(PETSC_DS_CLASSID, DS) PyPetscType_Register(PETSC_FE_CLASSID, FE) PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) return 0 # and we are done, enjoy !! # -------------------------------------------------------------------- def _initialize(args=None, comm=None): global tracebacklist Error._traceback_ = tracebacklist global PetscError PetscError = Error # cdef int ready = initialize(args, comm) if ready: register() # global __COMM_SELF__, __COMM_WORLD__ __COMM_SELF__.comm = PETSC_COMM_SELF __COMM_WORLD__.comm = PETSC_COMM_WORLD # global PETSC_COMM_DEFAULT PETSC_COMM_DEFAULT = PETSC_COMM_WORLD def _finalize(): finalize() # global __COMM_SELF__ __COMM_SELF__.comm = MPI_COMM_NULL global __COMM_WORLD__ __COMM_WORLD__.comm = MPI_COMM_NULL # global PETSC_COMM_DEFAULT PETSC_COMM_DEFAULT = MPI_COMM_NULL # global type_registry type_registry.clear() global stage_registry stage_registry.clear() global class_registry class_registry.clear() global event_registry event_registry.clear() global citations_registry citations_registry.clear() # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc/petscmpi.pxi0000644000175000017500000000755213750315427017651 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from * nogil: MPI_Comm MPI_COMM_NULL MPI_Comm MPI_COMM_SELF MPI_Comm MPI_COMM_WORLD MPI_Datatype MPI_DATATYPE_NULL MPI_Op MPI_OP_NULL enum: MPI_IDENT enum: MPI_CONGRUENT int MPI_Comm_compare(MPI_Comm,MPI_Comm,int*) int MPI_Comm_size(MPI_Comm,int*) int MPI_Comm_rank(MPI_Comm,int*) int MPI_Barrier(MPI_Comm) int MPI_Initialized(int*) int MPI_Finalized(int*) ctypedef int MPI_Fint MPI_Fint MPI_Comm_c2f(MPI_Comm) cdef extern from * nogil: MPI_Comm PETSC_COMM_SELF MPI_Comm PETSC_COMM_WORLD int PetscCommDuplicate(MPI_Comm,MPI_Comm*,int*) int PetscCommDestroy(MPI_Comm*) # -------------------------------------------------------------------- cdef extern from "cython.h": void *Cython_ImportFunction(object, char[], char[]) except? NULL ctypedef MPI_Comm* PyMPICommGet(object) except NULL ctypedef object PyMPICommNew(MPI_Comm) ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL ctypedef MPI_Op* PyMPIOpGet(object) except NULL cdef inline MPI_Comm mpi4py_Comm_Get(object comm) except *: from mpi4py import MPI cdef PyMPICommGet *commget = \ Cython_ImportFunction( MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)") if commget == NULL: return MPI_COMM_NULL cdef MPI_Comm *ptr = commget(comm) if ptr == NULL: return MPI_COMM_NULL return ptr[0] cdef inline object mpi4py_Comm_New(MPI_Comm comm): from mpi4py import MPI cdef PyMPICommNew *commnew = \ Cython_ImportFunction( MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)") if commnew == NULL: return None return commnew(comm) cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *: from mpi4py import MPI cdef PyMPIDatatypeGet *datatypeget = \ Cython_ImportFunction( MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)") if datatypeget == NULL: return MPI_DATATYPE_NULL cdef MPI_Datatype *ptr = datatypeget(datatype) if ptr == NULL: return MPI_DATATYPE_NULL return ptr[0] cdef inline MPI_Op mpi4py_Op_Get(object op) except *: from mpi4py import MPI cdef PyMPIOpGet *opget = \ Cython_ImportFunction( MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)") if opget == NULL: return MPI_OP_NULL cdef MPI_Op *ptr = opget(op) if ptr == NULL: return MPI_OP_NULL return ptr[0] # -------------------------------------------------------------------- cdef inline int PetscCommDEALLOC(MPI_Comm* comm): if comm == NULL: return 0 cdef MPI_Comm tmp = comm[0] if tmp == MPI_COMM_NULL: return 0 comm[0] = MPI_COMM_NULL if not (PetscInitializeCalled): return 0 if (PetscFinalizeCalled): return 0 return PetscCommDestroy(&tmp) cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: cdef MPI_Comm retv = MPI_COMM_NULL if comm is None: retv = defv elif isinstance(comm, Comm): retv = (comm).comm elif type(comm).__module__ == 'mpi4py.MPI': retv = mpi4py_Comm_Get(comm) else: retv = (comm).comm return retv cdef inline Comm new_Comm(MPI_Comm comm): cdef Comm ob = Comm() ob.comm = comm return ob # -------------------------------------------------------------------- cdef inline int comm_size(MPI_Comm comm) except ? -1: if comm == MPI_COMM_NULL: raise ValueError("null communicator") cdef int size = 0 CHKERR( MPI_Comm_size(comm, &size) ) return size cdef inline int comm_rank(MPI_Comm comm) except ? -1: if comm == MPI_COMM_NULL: raise ValueError("null communicator") cdef int rank = 0 CHKERR( MPI_Comm_rank(comm, &rank) ) return rank # -------------------------------------------------------------------- petsc4py-3.15.1/src/libpetsc4py/0000755000175000017500000000000014062764472016623 5ustar balaybalay00000000000000petsc4py-3.15.1/src/libpetsc4py/libpetsc4py.h0000644000175000017500000000266014062764420021233 0ustar balaybalay00000000000000/* Generated by Cython 0.29.22 */ #ifndef __PYX_HAVE__libpetsc4py #define __PYX_HAVE__libpetsc4py #include "Python.h" #ifndef __PYX_HAVE_API__libpetsc4py #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(_T) _T #endif __PYX_EXTERN_C int import_libpetsc4py(void); __PYX_EXTERN_C PetscErrorCode MatPythonGetContext(Mat, void **); __PYX_EXTERN_C PetscErrorCode MatPythonSetContext(Mat, void *); __PYX_EXTERN_C PetscErrorCode PCPythonGetContext(PC, void **); __PYX_EXTERN_C PetscErrorCode PCPythonSetContext(PC, void *); __PYX_EXTERN_C PetscErrorCode KSPPythonGetContext(KSP, void **); __PYX_EXTERN_C PetscErrorCode KSPPythonSetContext(KSP, void *); __PYX_EXTERN_C PetscErrorCode SNESPythonGetContext(SNES, void **); __PYX_EXTERN_C PetscErrorCode SNESPythonSetContext(SNES, void *); __PYX_EXTERN_C PetscErrorCode TSPythonGetContext(TS, void **); __PYX_EXTERN_C PetscErrorCode TSPythonSetContext(TS, void *); __PYX_EXTERN_C PetscErrorCode PetscPythonRegisterAll(void); #endif /* !__PYX_HAVE_API__libpetsc4py */ /* WARNING: the interface of the module init function changed in CPython 3.5. */ /* It now returns a PyModuleDef instance instead of a PyModule instance. */ #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initlibpetsc4py(void); #else PyMODINIT_FUNC PyInit_libpetsc4py(void); #endif #endif /* !__PYX_HAVE__libpetsc4py */ petsc4py-3.15.1/src/libpetsc4py/libpetsc4py.c0000644000175000017500000463046514062764420021244 0ustar balaybalay00000000000000/* Generated by Cython 0.29.22 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_22" #define CYTHON_HEX_VERSION 0x001D16F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__libpetsc4py #define __PYX_HAVE_API__libpetsc4py /* Early includes */ #include "petsc.h" #include "custom.h" #include "scalar.h" #include "string.h" #include "petsc4py/numpy.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "libpetsc4py/libpetsc4py.pyx", "include/arraynpy.pxi", "include/petsc4py/PETSc.pxd", }; /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /*--- Type declarations ---*/ struct PyPetscCommObject; struct PyPetscObjectObject; struct PyPetscViewerObject; struct PyPetscRandomObject; struct PyPetscISObject; struct PyPetscLGMapObject; struct PyPetscSFObject; struct PyPetscVecObject; struct PyPetscFEObject; struct PyPetscQuadObject; struct PyPetscScatterObject; struct PyPetscSectionObject; struct PyPetscMatObject; struct PyPetscNullSpaceObject; struct PyPetscPCObject; struct PyPetscKSPObject; struct PyPetscSNESObject; struct PyPetscTSObject; struct PyPetscTAOObject; struct PyPetscAOObject; struct PyPetscDMObject; struct PyPetscDSObject; struct PyPetscPartitionerObject; struct PyPetscDMLabelObject; struct __pyx_obj_11libpetsc4py__PyObj; struct __pyx_obj_11libpetsc4py__PyMat; struct __pyx_obj_11libpetsc4py__PyPC; struct __pyx_obj_11libpetsc4py__PyKSP; struct __pyx_obj_11libpetsc4py__PySNES; struct __pyx_obj_11libpetsc4py__PyTS; /* "petsc4py/PETSc.pxd":91 * # -------------------------------------------------------------------- * * ctypedef public api class Comm [ # <<<<<<<<<<<<<< * type PyPetscComm_Type, * object PyPetscCommObject, */ struct PyPetscCommObject { PyObject_HEAD MPI_Comm comm; int isdup; PyObject *base; }; typedef struct PyPetscCommObject PyPetscCommObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscComm_Type; /* "petsc4py/PETSc.pxd":99 * cdef object base * * ctypedef public api class Object [ # <<<<<<<<<<<<<< * type PyPetscObject_Type, * object PyPetscObjectObject, */ struct PyPetscObjectObject { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtab; PyObject *__weakref__; PyObject *__pyx___dummy__; PetscObject oval; PetscObject *obj; }; typedef struct PyPetscObjectObject PyPetscObjectObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type; /* "petsc4py/PETSc.pxd":111 * cdef object get_dict(self) * * ctypedef public api class Viewer(Object) [ # <<<<<<<<<<<<<< * type PyPetscViewer_Type, * object PyPetscViewerObject, */ struct PyPetscViewerObject { struct PyPetscObjectObject __pyx_base; PetscViewer vwr; }; typedef struct PyPetscViewerObject PyPetscViewerObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type; /* "petsc4py/PETSc.pxd":117 * cdef PetscViewer vwr * * ctypedef public api class Random(Object) [ # <<<<<<<<<<<<<< * type PyPetscRandom_Type, * object PyPetscRandomObject, */ struct PyPetscRandomObject { struct PyPetscObjectObject __pyx_base; PetscRandom rnd; }; typedef struct PyPetscRandomObject PyPetscRandomObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRandom_Type; /* "petsc4py/PETSc.pxd":123 * cdef PetscRandom rnd * * ctypedef public api class IS(Object) [ # <<<<<<<<<<<<<< * type PyPetscIS_Type, * object PyPetscISObject, */ struct PyPetscISObject { struct PyPetscObjectObject __pyx_base; IS iset; }; typedef struct PyPetscISObject PyPetscISObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type; /* "petsc4py/PETSc.pxd":129 * cdef PetscIS iset * * ctypedef public api class LGMap(Object) [ # <<<<<<<<<<<<<< * type PyPetscLGMap_Type, * object PyPetscLGMapObject, */ struct PyPetscLGMapObject { struct PyPetscObjectObject __pyx_base; ISLocalToGlobalMapping lgm; }; typedef struct PyPetscLGMapObject PyPetscLGMapObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscLGMap_Type; /* "petsc4py/PETSc.pxd":135 * cdef PetscLGMap lgm * * ctypedef public api class SF(Object) [ # <<<<<<<<<<<<<< * type PyPetscSF_Type, * object PyPetscSFObject, */ struct PyPetscSFObject { struct PyPetscObjectObject __pyx_base; PetscSF sf; }; typedef struct PyPetscSFObject PyPetscSFObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type; /* "petsc4py/PETSc.pxd":141 * cdef PetscSF sf * * ctypedef public api class Vec(Object) [ # <<<<<<<<<<<<<< * type PyPetscVec_Type, * object PyPetscVecObject, */ struct PyPetscVecObject { struct PyPetscObjectObject __pyx_base; Vec vec; }; typedef struct PyPetscVecObject PyPetscVecObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscVec_Type; /* "petsc4py/PETSc.pxd":147 * cdef PetscVec vec * * ctypedef public api class FE(Object) [ # <<<<<<<<<<<<<< * type PyPetscFE_Type, * object PyPetscFEObject, */ struct PyPetscFEObject { struct PyPetscObjectObject __pyx_base; PetscFE fe; }; typedef struct PyPetscFEObject PyPetscFEObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type; /* "petsc4py/PETSc.pxd":153 * cdef PetscFE fe * * ctypedef public api class Quad(Object) [ # <<<<<<<<<<<<<< * type PyPetscQuad_Type, * object PyPetscQuadObject, */ struct PyPetscQuadObject { struct PyPetscObjectObject __pyx_base; PetscQuadrature quad; }; typedef struct PyPetscQuadObject PyPetscQuadObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscQuad_Type; /* "petsc4py/PETSc.pxd":159 * cdef PetscQuadrature quad * * ctypedef public api class Scatter(Object) [ # <<<<<<<<<<<<<< * type PyPetscScatter_Type, * object PyPetscScatterObject, */ struct PyPetscScatterObject { struct PyPetscObjectObject __pyx_base; VecScatter sct; }; typedef struct PyPetscScatterObject PyPetscScatterObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscScatter_Type; /* "petsc4py/PETSc.pxd":165 * cdef PetscScatter sct * * ctypedef public api class Section(Object) [ # <<<<<<<<<<<<<< * type PyPetscSection_Type, * object PyPetscSectionObject, */ struct PyPetscSectionObject { struct PyPetscObjectObject __pyx_base; PetscSection sec; }; typedef struct PyPetscSectionObject PyPetscSectionObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSection_Type; /* "petsc4py/PETSc.pxd":171 * cdef PetscSection sec * * ctypedef public api class Mat(Object) [ # <<<<<<<<<<<<<< * type PyPetscMat_Type, * object PyPetscMatObject, */ struct PyPetscMatObject { struct PyPetscObjectObject __pyx_base; Mat mat; }; typedef struct PyPetscMatObject PyPetscMatObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMat_Type; /* "petsc4py/PETSc.pxd":177 * cdef PetscMat mat * * ctypedef public api class NullSpace(Object) [ # <<<<<<<<<<<<<< * type PyPetscNullSpace_Type, * object PyPetscNullSpaceObject, */ struct PyPetscNullSpaceObject { struct PyPetscObjectObject __pyx_base; MatNullSpace nsp; }; typedef struct PyPetscNullSpaceObject PyPetscNullSpaceObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type; /* "petsc4py/PETSc.pxd":183 * cdef PetscNullSpace nsp * * ctypedef public api class PC(Object) [ # <<<<<<<<<<<<<< * type PyPetscPC_Type, * object PyPetscPCObject, */ struct PyPetscPCObject { struct PyPetscObjectObject __pyx_base; PC pc; }; typedef struct PyPetscPCObject PyPetscPCObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPC_Type; /* "petsc4py/PETSc.pxd":189 * cdef PetscPC pc * * ctypedef public api class KSP(Object) [ # <<<<<<<<<<<<<< * type PyPetscKSP_Type, * object PyPetscKSPObject, */ struct PyPetscKSPObject { struct PyPetscObjectObject __pyx_base; KSP ksp; }; typedef struct PyPetscKSPObject PyPetscKSPObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscKSP_Type; /* "petsc4py/PETSc.pxd":195 * cdef PetscKSP ksp * * ctypedef public api class SNES(Object) [ # <<<<<<<<<<<<<< * type PyPetscSNES_Type, * object PyPetscSNESObject, */ struct PyPetscSNESObject { struct PyPetscObjectObject __pyx_base; SNES snes; }; typedef struct PyPetscSNESObject PyPetscSNESObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNES_Type; /* "petsc4py/PETSc.pxd":201 * cdef PetscSNES snes * * ctypedef public api class TS(Object) [ # <<<<<<<<<<<<<< * type PyPetscTS_Type, * object PyPetscTSObject, */ struct PyPetscTSObject { struct PyPetscObjectObject __pyx_base; TS ts; }; typedef struct PyPetscTSObject PyPetscTSObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type; /* "petsc4py/PETSc.pxd":207 * cdef PetscTS ts * * ctypedef public api class TAO(Object) [ # <<<<<<<<<<<<<< * type PyPetscTAO_Type, * object PyPetscTAOObject, */ struct PyPetscTAOObject { struct PyPetscObjectObject __pyx_base; Tao tao; }; typedef struct PyPetscTAOObject PyPetscTAOObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAO_Type; /* "petsc4py/PETSc.pxd":213 * cdef PetscTAO tao * * ctypedef public api class AO(Object) [ # <<<<<<<<<<<<<< * type PyPetscAO_Type, * object PyPetscAOObject, */ struct PyPetscAOObject { struct PyPetscObjectObject __pyx_base; AO ao; }; typedef struct PyPetscAOObject PyPetscAOObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscAO_Type; /* "petsc4py/PETSc.pxd":219 * cdef PetscAO ao * * ctypedef public api class DM(Object) [ # <<<<<<<<<<<<<< * type PyPetscDM_Type, * object PyPetscDMObject, */ struct PyPetscDMObject { struct PyPetscObjectObject __pyx_base; DM dm; }; typedef struct PyPetscDMObject PyPetscDMObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDM_Type; /* "petsc4py/PETSc.pxd":225 * cdef PetscDM dm * * ctypedef public api class DS(Object) [ # <<<<<<<<<<<<<< * type PyPetscDS_Type, * object PyPetscDSObject, */ struct PyPetscDSObject { struct PyPetscObjectObject __pyx_base; PetscDS ds; }; typedef struct PyPetscDSObject PyPetscDSObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type; /* "petsc4py/PETSc.pxd":231 * cdef PetscDS ds * * ctypedef public api class Partitioner(Object) [ # <<<<<<<<<<<<<< * type PyPetscPartitioner_Type, * object PyPetscPartitionerObject, */ struct PyPetscPartitionerObject { struct PyPetscObjectObject __pyx_base; PetscPartitioner part; }; typedef struct PyPetscPartitionerObject PyPetscPartitionerObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type; /* "petsc4py/PETSc.pxd":237 * cdef PetscPartitioner part * * ctypedef public api class DMLabel(Object) [ # <<<<<<<<<<<<<< * type PyPetscDMLabel_Type, * object PyPetscDMLabelObject, */ struct PyPetscDMLabelObject { struct PyPetscObjectObject __pyx_base; DMLabel dmlabel; }; typedef struct PyPetscDMLabelObject PyPetscDMLabelObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type; /* "libpetsc4py.pyx":296 * * @cython.internal * cdef class _PyObj: # <<<<<<<<<<<<<< * * cdef object self */ struct __pyx_obj_11libpetsc4py__PyObj { PyObject_HEAD struct __pyx_vtabstruct_11libpetsc4py__PyObj *__pyx_vtab; PyObject *self; PyObject *name; }; /* "libpetsc4py.pyx":527 * * @cython.internal * cdef class _PyMat(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: */ struct __pyx_obj_11libpetsc4py__PyMat { struct __pyx_obj_11libpetsc4py__PyObj __pyx_base; }; /* "libpetsc4py.pyx":1201 * * @cython.internal * cdef class _PyPC(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: */ struct __pyx_obj_11libpetsc4py__PyPC { struct __pyx_obj_11libpetsc4py__PyObj __pyx_base; }; /* "libpetsc4py.pyx":1477 * * @cython.internal * cdef class _PyKSP(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: */ struct __pyx_obj_11libpetsc4py__PyKSP { struct __pyx_obj_11libpetsc4py__PyObj __pyx_base; }; /* "libpetsc4py.pyx":1839 * * @cython.internal * cdef class _PySNES(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: */ struct __pyx_obj_11libpetsc4py__PySNES { struct __pyx_obj_11libpetsc4py__PyObj __pyx_base; }; /* "libpetsc4py.pyx":2185 * * @cython.internal * cdef class _PyTS(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: */ struct __pyx_obj_11libpetsc4py__PyTS { struct __pyx_obj_11libpetsc4py__PyObj __pyx_base; }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type; /* "petsc4py/PETSc.pxd":99 * cdef object base * * ctypedef public api class Object [ # <<<<<<<<<<<<<< * type PyPetscObject_Type, * object PyPetscObjectObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Object { PyObject *(*get_attr)(struct PyPetscObjectObject *, char *); PyObject *(*set_attr)(struct PyPetscObjectObject *, char *, PyObject *); PyObject *(*get_dict)(struct PyPetscObjectObject *); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtabptr_8petsc4py_5PETSc_Object; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type; /* "petsc4py/PETSc.pxd":111 * cdef object get_dict(self) * * ctypedef public api class Viewer(Object) [ # <<<<<<<<<<<<<< * type PyPetscViewer_Type, * object PyPetscViewerObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer *__pyx_vtabptr_8petsc4py_5PETSc_Viewer; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRandom_Type; /* "petsc4py/PETSc.pxd":117 * cdef PetscViewer vwr * * ctypedef public api class Random(Object) [ # <<<<<<<<<<<<<< * type PyPetscRandom_Type, * object PyPetscRandomObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Random { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Random *__pyx_vtabptr_8petsc4py_5PETSc_Random; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type; /* "petsc4py/PETSc.pxd":123 * cdef PetscRandom rnd * * ctypedef public api class IS(Object) [ # <<<<<<<<<<<<<< * type PyPetscIS_Type, * object PyPetscISObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_IS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *__pyx_vtabptr_8petsc4py_5PETSc_IS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscLGMap_Type; /* "petsc4py/PETSc.pxd":129 * cdef PetscIS iset * * ctypedef public api class LGMap(Object) [ # <<<<<<<<<<<<<< * type PyPetscLGMap_Type, * object PyPetscLGMapObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap *__pyx_vtabptr_8petsc4py_5PETSc_LGMap; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type; /* "petsc4py/PETSc.pxd":135 * cdef PetscLGMap lgm * * ctypedef public api class SF(Object) [ # <<<<<<<<<<<<<< * type PyPetscSF_Type, * object PyPetscSFObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_SF { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SF *__pyx_vtabptr_8petsc4py_5PETSc_SF; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscVec_Type; /* "petsc4py/PETSc.pxd":141 * cdef PetscSF sf * * ctypedef public api class Vec(Object) [ # <<<<<<<<<<<<<< * type PyPetscVec_Type, * object PyPetscVecObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *__pyx_vtabptr_8petsc4py_5PETSc_Vec; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type; /* "petsc4py/PETSc.pxd":147 * cdef PetscVec vec * * ctypedef public api class FE(Object) [ # <<<<<<<<<<<<<< * type PyPetscFE_Type, * object PyPetscFEObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_FE { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_FE *__pyx_vtabptr_8petsc4py_5PETSc_FE; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscQuad_Type; /* "petsc4py/PETSc.pxd":153 * cdef PetscFE fe * * ctypedef public api class Quad(Object) [ # <<<<<<<<<<<<<< * type PyPetscQuad_Type, * object PyPetscQuadObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad *__pyx_vtabptr_8petsc4py_5PETSc_Quad; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscScatter_Type; /* "petsc4py/PETSc.pxd":159 * cdef PetscQuadrature quad * * ctypedef public api class Scatter(Object) [ # <<<<<<<<<<<<<< * type PyPetscScatter_Type, * object PyPetscScatterObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter *__pyx_vtabptr_8petsc4py_5PETSc_Scatter; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSection_Type; /* "petsc4py/PETSc.pxd":165 * cdef PetscScatter sct * * ctypedef public api class Section(Object) [ # <<<<<<<<<<<<<< * type PyPetscSection_Type, * object PyPetscSectionObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Section { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Section *__pyx_vtabptr_8petsc4py_5PETSc_Section; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMat_Type; /* "petsc4py/PETSc.pxd":171 * cdef PetscSection sec * * ctypedef public api class Mat(Object) [ # <<<<<<<<<<<<<< * type PyPetscMat_Type, * object PyPetscMatObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *__pyx_vtabptr_8petsc4py_5PETSc_Mat; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type; /* "petsc4py/PETSc.pxd":177 * cdef PetscMat mat * * ctypedef public api class NullSpace(Object) [ # <<<<<<<<<<<<<< * type PyPetscNullSpace_Type, * object PyPetscNullSpaceObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *__pyx_vtabptr_8petsc4py_5PETSc_NullSpace; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPC_Type; /* "petsc4py/PETSc.pxd":183 * cdef PetscNullSpace nsp * * ctypedef public api class PC(Object) [ # <<<<<<<<<<<<<< * type PyPetscPC_Type, * object PyPetscPCObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_PC { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *__pyx_vtabptr_8petsc4py_5PETSc_PC; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscKSP_Type; /* "petsc4py/PETSc.pxd":189 * cdef PetscPC pc * * ctypedef public api class KSP(Object) [ # <<<<<<<<<<<<<< * type PyPetscKSP_Type, * object PyPetscKSPObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *__pyx_vtabptr_8petsc4py_5PETSc_KSP; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNES_Type; /* "petsc4py/PETSc.pxd":195 * cdef PetscKSP ksp * * ctypedef public api class SNES(Object) [ # <<<<<<<<<<<<<< * type PyPetscSNES_Type, * object PyPetscSNESObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *__pyx_vtabptr_8petsc4py_5PETSc_SNES; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type; /* "petsc4py/PETSc.pxd":201 * cdef PetscSNES snes * * ctypedef public api class TS(Object) [ # <<<<<<<<<<<<<< * type PyPetscTS_Type, * object PyPetscTSObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_TS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *__pyx_vtabptr_8petsc4py_5PETSc_TS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAO_Type; /* "petsc4py/PETSc.pxd":207 * cdef PetscTS ts * * ctypedef public api class TAO(Object) [ # <<<<<<<<<<<<<< * type PyPetscTAO_Type, * object PyPetscTAOObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *__pyx_vtabptr_8petsc4py_5PETSc_TAO; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscAO_Type; /* "petsc4py/PETSc.pxd":213 * cdef PetscTAO tao * * ctypedef public api class AO(Object) [ # <<<<<<<<<<<<<< * type PyPetscAO_Type, * object PyPetscAOObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_AO { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_AO *__pyx_vtabptr_8petsc4py_5PETSc_AO; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDM_Type; /* "petsc4py/PETSc.pxd":219 * cdef PetscAO ao * * ctypedef public api class DM(Object) [ # <<<<<<<<<<<<<< * type PyPetscDM_Type, * object PyPetscDMObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DM { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *__pyx_vtabptr_8petsc4py_5PETSc_DM; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type; /* "petsc4py/PETSc.pxd":225 * cdef PetscDM dm * * ctypedef public api class DS(Object) [ # <<<<<<<<<<<<<< * type PyPetscDS_Type, * object PyPetscDSObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DS *__pyx_vtabptr_8petsc4py_5PETSc_DS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type; /* "petsc4py/PETSc.pxd":231 * cdef PetscDS ds * * ctypedef public api class Partitioner(Object) [ # <<<<<<<<<<<<<< * type PyPetscPartitioner_Type, * object PyPetscPartitionerObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner *__pyx_vtabptr_8petsc4py_5PETSc_Partitioner; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type; /* "petsc4py/PETSc.pxd":237 * cdef PetscPartitioner part * * ctypedef public api class DMLabel(Object) [ # <<<<<<<<<<<<<< * type PyPetscDMLabel_Type, * object PyPetscDMLabelObject, */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel *__pyx_vtabptr_8petsc4py_5PETSc_DMLabel; /* "libpetsc4py.pyx":296 * * @cython.internal * cdef class _PyObj: # <<<<<<<<<<<<<< * * cdef object self */ struct __pyx_vtabstruct_11libpetsc4py__PyObj { int (*setcontext)(struct __pyx_obj_11libpetsc4py__PyObj *, void *, struct PyPetscObjectObject *); int (*getcontext)(struct __pyx_obj_11libpetsc4py__PyObj *, void **); int (*setname)(struct __pyx_obj_11libpetsc4py__PyObj *, char *); char *(*getname)(struct __pyx_obj_11libpetsc4py__PyObj *); }; static struct __pyx_vtabstruct_11libpetsc4py__PyObj *__pyx_vtabptr_11libpetsc4py__PyObj; /* "libpetsc4py.pyx":527 * * @cython.internal * cdef class _PyMat(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: */ struct __pyx_vtabstruct_11libpetsc4py__PyMat { struct __pyx_vtabstruct_11libpetsc4py__PyObj __pyx_base; }; static struct __pyx_vtabstruct_11libpetsc4py__PyMat *__pyx_vtabptr_11libpetsc4py__PyMat; /* "libpetsc4py.pyx":1201 * * @cython.internal * cdef class _PyPC(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: */ struct __pyx_vtabstruct_11libpetsc4py__PyPC { struct __pyx_vtabstruct_11libpetsc4py__PyObj __pyx_base; }; static struct __pyx_vtabstruct_11libpetsc4py__PyPC *__pyx_vtabptr_11libpetsc4py__PyPC; /* "libpetsc4py.pyx":1477 * * @cython.internal * cdef class _PyKSP(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: */ struct __pyx_vtabstruct_11libpetsc4py__PyKSP { struct __pyx_vtabstruct_11libpetsc4py__PyObj __pyx_base; }; static struct __pyx_vtabstruct_11libpetsc4py__PyKSP *__pyx_vtabptr_11libpetsc4py__PyKSP; /* "libpetsc4py.pyx":1839 * * @cython.internal * cdef class _PySNES(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: */ struct __pyx_vtabstruct_11libpetsc4py__PySNES { struct __pyx_vtabstruct_11libpetsc4py__PyObj __pyx_base; }; static struct __pyx_vtabstruct_11libpetsc4py__PySNES *__pyx_vtabptr_11libpetsc4py__PySNES; /* "libpetsc4py.pyx":2185 * * @cython.internal * cdef class _PyTS(_PyObj): pass # <<<<<<<<<<<<<< * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: */ struct __pyx_vtabstruct_11libpetsc4py__PyTS { struct __pyx_vtabstruct_11libpetsc4py__PyObj __pyx_base; }; static struct __pyx_vtabstruct_11libpetsc4py__PyTS *__pyx_vtabptr_11libpetsc4py__PyTS; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* tp_new.proto */ #define __Pyx_tp_new(type_obj, args) __Pyx_tp_new_kwargs(type_obj, args, NULL) static CYTHON_INLINE PyObject* __Pyx_tp_new_kwargs(PyObject* type_obj, PyObject* args, PyObject* kwargs) { return (PyObject*) (((PyTypeObject*)type_obj)->tp_new((PyTypeObject*)type_obj, args, kwargs)); } /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* decode_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_bytes( PyObject* string, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { return __Pyx_decode_c_bytes( PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string), start, stop, encoding, errors, decode_func); } /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyExec.proto */ static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*); /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* RegisterModuleCleanup.proto */ static void __pyx_module_cleanup(PyObject *self); #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static int __Pyx_RegisterCleanup(void); #else #define __Pyx_RegisterCleanup() (0) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* None.proto */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); /* proto */ /* GCCDiagnostics.proto */ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscInt(PetscInt value); /* CIntFromPy.proto */ static CYTHON_INLINE PetscInt __Pyx_PyInt_As_PetscInt(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatSORType(MatSORType value); /* CIntFromPy.proto */ static CYTHON_INLINE PetscBool __Pyx_PyInt_As_PetscBool(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NormType(NormType value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionImport.proto */ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static int __pyx_f_11libpetsc4py_6_PyObj_setcontext(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, void *__pyx_v_ctx, struct PyPetscObjectObject *__pyx_v_base); /* proto*/ static int __pyx_f_11libpetsc4py_6_PyObj_getcontext(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, void **__pyx_v_ctx); /* proto*/ static int __pyx_f_11libpetsc4py_6_PyObj_setname(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, char *__pyx_v_name); /* proto*/ static char *__pyx_f_11libpetsc4py_6_PyObj_getname(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self); /* proto*/ /* Module declarations from 'cython' */ /* Module declarations from 'petsc4py.PETSc' */ static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Comm = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Object = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Viewer = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Random = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_IS = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LGMap = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SF = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Vec = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_FE = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Quad = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Scatter = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Section = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Mat = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_NullSpace = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_PC = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_KSP = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SNES = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TS = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAO = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_AO = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DM = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DS = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Partitioner = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMLabel = 0; static PyTypeObject *(*__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup)(int); /*proto*/ /* Module declarations from 'numpy' */ /* Module declarations from 'libpetsc4py' */ static PyTypeObject *__pyx_ptype_11libpetsc4py_dtype = 0; static PyTypeObject *__pyx_ptype_11libpetsc4py_ndarray = 0; static PyTypeObject *__pyx_ptype_11libpetsc4py__PyObj = 0; static PyTypeObject *__pyx_ptype_11libpetsc4py__PyMat = 0; static PyTypeObject *__pyx_ptype_11libpetsc4py__PyPC = 0; static PyTypeObject *__pyx_ptype_11libpetsc4py__PyKSP = 0; static PyTypeObject *__pyx_ptype_11libpetsc4py__PySNES = 0; static PyTypeObject *__pyx_ptype_11libpetsc4py__PyTS = 0; static char *__pyx_v_11libpetsc4py_FUNCT; static char *__pyx_v_11libpetsc4py_fstack[0x400]; static int __pyx_v_11libpetsc4py_istack; static PyObject *__pyx_v_11libpetsc4py_PetscError = 0; static PyObject *__pyx_v_11libpetsc4py_module_cache = 0; __PYX_EXTERN_C int import_libpetsc4py(void); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_11libpetsc4py_toInt(PetscInt); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_11libpetsc4py_asInt(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_11libpetsc4py_toReal(PetscReal); /*proto*/ static CYTHON_INLINE PetscReal __pyx_f_11libpetsc4py_asReal(PyObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_array_i(PetscInt, PetscInt const *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_iarray(PyObject *, int); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_oarray(PyObject *, int); /*proto*/ static CYTHON_INLINE void __pyx_f_11libpetsc4py_FunctionBegin(char *); /*proto*/ static CYTHON_INLINE PetscErrorCode __pyx_f_11libpetsc4py_FunctionEnd(void); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PetscSETERR(PetscErrorCode, char *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PetscCHKERR(PetscErrorCode); /*proto*/ static CYTHON_INLINE void __pyx_f_11libpetsc4py_PythonSETERR(PetscErrorCode); /*proto*/ static CYTHON_INLINE int __pyx_f_11libpetsc4py_CHKERR(PetscErrorCode); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_UNSUPPORTED(char *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_11libpetsc4py_getRef(void *); /*proto*/ static CYTHON_INLINE void __pyx_f_11libpetsc4py_addRef(void *); /*proto*/ static CYTHON_INLINE void __pyx_f_11libpetsc4py_delRef(void *); /*proto*/ static CYTHON_INLINE PetscObject __pyx_f_11libpetsc4py_newRef(void *); /*proto*/ static CYTHON_INLINE char *__pyx_f_11libpetsc4py_getPrefix(void *); /*proto*/ static CYTHON_INLINE int __pyx_f_11libpetsc4py_getCommSize(void *); /*proto*/ static CYTHON_INLINE struct PyPetscViewerObject *__pyx_f_11libpetsc4py_Viewer_(PetscViewer); /*proto*/ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_11libpetsc4py_IS_(IS); /*proto*/ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_11libpetsc4py_Vec_(Vec); /*proto*/ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_11libpetsc4py_Mat_(Mat); /*proto*/ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_11libpetsc4py_PC_(PC); /*proto*/ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_11libpetsc4py_KSP_(KSP); /*proto*/ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_11libpetsc4py_SNES_(SNES); /*proto*/ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_11libpetsc4py_TS_(TS); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_11libpetsc4py_bytes2str(char const *); /*proto*/ static PyObject *__pyx_f_11libpetsc4py_parse_url(PyObject *); /*proto*/ static PyObject *__pyx_f_11libpetsc4py_load_module(PyObject *); /*proto*/ static PyObject *__pyx_f_11libpetsc4py_createcontext(char *); /*proto*/ static int __pyx_f_11libpetsc4py_viewcontext(struct __pyx_obj_11libpetsc4py__PyObj *, PetscViewer); /*proto*/ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyMat *__pyx_f_11libpetsc4py_PyMat(Mat); /*proto*/ __PYX_EXTERN_C PetscErrorCode MatPythonGetContext(Mat, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode MatPythonSetContext(Mat, void *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatPythonSetType_PYTHON(Mat, char *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatCreate_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatDestroy_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetFromOptions_Python(PetscOptionItems *, Mat); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatView_Python(Mat, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatDuplicate_Python(Mat, MatDuplicateOption, Mat *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatCopy_Python(Mat, Mat, MatStructure); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatGetDiagonalBlock_Python(Mat, Mat *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatCreateSubMatrix_Python(Mat, IS, IS, MatReuse, Mat *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetOption_Python(Mat, MatOption, PetscBool); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetUp_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatAssemblyBegin_Python(Mat, MatAssemblyType); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatAssemblyEnd_Python(Mat, MatAssemblyType); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatZeroEntries_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatZeroRowsColumns_Python(Mat, PetscInt, PetscInt const *, PetscScalar, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatScale_Python(Mat, PetscScalar); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatShift_Python(Mat, PetscScalar); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatCreateVecs_Python(Mat, Vec *, Vec *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMult_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultTranspose_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultHermitian_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultTransposeAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultHermitianAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultDiagonalBlock_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolve_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolveTranspose_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolveAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolveTransposeAdd_Python(Mat, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSOR_Python(Mat, Vec, PetscReal, MatSORType, PetscReal, PetscInt, PetscInt, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatGetDiagonal_Python(Mat, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetDiagonal_Python(Mat, Vec, InsertMode); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatDiagonalScale_Python(Mat, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatMissingDiagonal_Python(Mat, PetscBool *, PetscInt *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatNorm_Python(Mat, NormType, PetscReal *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatRealPart_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatImagPart_Python(Mat); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_MatConjugate_Python(Mat); /*proto*/ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyPC *__pyx_f_11libpetsc4py_PyPC(PC); /*proto*/ __PYX_EXTERN_C PetscErrorCode PCPythonGetContext(PC, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode PCPythonSetContext(PC, void *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCPythonSetType_PYTHON(PC, char *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCCreate_Python(PC); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCDestroy_Python(PC); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCSetUp_Python(PC); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCReset_Python(PC); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCSetFromOptions_Python(PetscOptionItems *, PC); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCView_Python(PC, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCPreSolve_Python(PC, KSP, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCPostSolve_Python(PC, KSP, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCApply_Python(PC, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCApplyTranspose_Python(PC, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCApplySymmetricLeft_Python(PC, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PCApplySymmetricRight_Python(PC, Vec, Vec); /*proto*/ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyKSP *__pyx_f_11libpetsc4py_PyKSP(KSP); /*proto*/ __PYX_EXTERN_C PetscErrorCode KSPPythonGetContext(KSP, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode KSPPythonSetContext(KSP, void *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPPythonSetType_PYTHON(KSP, char *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPCreate_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPDestroy_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSetUp_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPReset_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSetFromOptions_Python(PetscOptionItems *, KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPView_Python(KSP, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPBuildSolution_Python(KSP, Vec, Vec *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPBuildResidual_Python(KSP, Vec, Vec, Vec *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSolve_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSolve_Python_default(KSP, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPPreStep_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPPostStep_Python(KSP); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_KSPStep_Python(KSP, Vec, Vec); /*proto*/ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PySNES *__pyx_f_11libpetsc4py_PySNES(SNES); /*proto*/ __PYX_EXTERN_C PetscErrorCode SNESPythonGetContext(SNES, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode SNESPythonSetContext(SNES, void *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESPythonSetType_PYTHON(SNES, char *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESCreate_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESDestroy_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSetUp_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESReset_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSetFromOptions_Python(PetscOptionItems *, SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESView_Python(SNES, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSolve_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSolve_Python_default(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESPreStep_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESPostStep_Python(SNES); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESStep_Python(SNES, Vec, Vec, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESStep_Python_default(SNES, Vec, Vec, Vec); /*proto*/ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyTS *__pyx_f_11libpetsc4py_PyTS(TS); /*proto*/ __PYX_EXTERN_C PetscErrorCode TSPythonGetContext(TS, void **); /*proto*/ __PYX_EXTERN_C PetscErrorCode TSPythonSetContext(TS, void *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSPythonSetType_PYTHON(TS, char *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSCreate_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSDestroy_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSSetUp_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSReset_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSSetFromOptions_Python(PetscOptionItems *, TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSView_Python(TS, PetscViewer); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSStep_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSRollBack_Python(TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSInterpolate_Python(TS, PetscReal, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSEvaluateStep_Python(TS, PetscInt, Vec, PetscBool *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESTSFormFunction_Python(SNES, Vec, Vec, TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_SNESTSFormJacobian_Python(SNES, Vec, Mat, Mat, TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSSolveStep_Python(TS, PetscReal, Vec); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSAdaptStep_Python(TS, PetscReal, Vec, PetscReal *, PetscBool *); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_TSStep_Python_default(TS); /*proto*/ static PetscErrorCode __pyx_f_11libpetsc4py_PetscPythonMonitorSet_Python(PetscObject, char const *); /*proto*/ __PYX_EXTERN_C PetscErrorCode PetscPythonRegisterAll(void); /*proto*/ #define __Pyx_MODULE_NAME "libpetsc4py" extern int __pyx_module_is_main_libpetsc4py; int __pyx_module_is_main_libpetsc4py = 0; /* Implementation of 'libpetsc4py' */ static PyObject *__pyx_builtin_open; static PyObject *__pyx_builtin_compile; static const char __pyx_k_[] = ":"; static const char __pyx_k__3[] = "."; static const char __pyx_k__5[] = ","; static const char __pyx_k_rU[] = "rU"; static const char __pyx_k_SOR[] = "SOR"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_exec[] = "exec"; static const char __pyx_k_file[] = "__file__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mult[] = "mult"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_norm[] = "norm"; static const char __pyx_k_open[] = "open"; static const char __pyx_k_read[] = "read"; static const char __pyx_k_step[] = "step"; static const char __pyx_k_view[] = "view"; static const char __pyx_k_Error[] = "Error"; static const char __pyx_k_apply[] = "apply"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_reset[] = "reset"; static const char __pyx_k_scale[] = "scale"; static const char __pyx_k_setUp[] = "setUp"; static const char __pyx_k_shift[] = "shift"; static const char __pyx_k_solve[] = "solve"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_create[] = "create"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_rsplit[] = "rsplit"; static const char __pyx_k_compile[] = "compile"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_monitor[] = "monitor"; static const char __pyx_k_multAdd[] = "multAdd"; static const char __pyx_k_package[] = "__package__"; static const char __pyx_k_preStep[] = "preStep"; static const char __pyx_k_assembly[] = "assembly"; static const char __pyx_k_builtins[] = "__builtins__"; static const char __pyx_k_imagPart[] = "imagPart"; static const char __pyx_k_postStep[] = "postStep"; static const char __pyx_k_preSolve[] = "preSolve"; static const char __pyx_k_realPart[] = "realPart"; static const char __pyx_k_rollback[] = "rollback"; static const char __pyx_k_solveAdd[] = "solveAdd"; static const char __pyx_k_adaptStep[] = "adaptStep"; static const char __pyx_k_conjugate[] = "conjugate"; static const char __pyx_k_duplicate[] = "duplicate"; static const char __pyx_k_postSolve[] = "postSolve"; static const char __pyx_k_setOption[] = "setOption"; static const char __pyx_k_solveStep[] = "solveStep"; static const char __pyx_k_createVecs[] = "createVecs"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_setMonitor[] = "setMonitor"; static const char __pyx_k_assemblyEnd[] = "assemblyEnd"; static const char __pyx_k_getDiagonal[] = "getDiagonal"; static const char __pyx_k_interpolate[] = "interpolate"; static const char __pyx_k_setDiagonal[] = "setDiagonal"; static const char __pyx_k_zeroEntries[] = "zeroEntries"; static const char __pyx_k_evaluatestep[] = "evaluatestep"; static const char __pyx_k_assemblyBegin[] = "assemblyBegin"; static const char __pyx_k_buildResidual[] = "buildResidual"; static const char __pyx_k_buildSolution[] = "buildSolution"; static const char __pyx_k_diagonalScale[] = "diagonalScale"; static const char __pyx_k_multHermitian[] = "multHermitian"; static const char __pyx_k_multTranspose[] = "multTranspose"; static const char __pyx_k_stepTranspose[] = "stepTranspose"; static const char __pyx_k_applyTranspose[] = "applyTranspose"; static const char __pyx_k_petsc4py_PETSc[] = "petsc4py.PETSc"; static const char __pyx_k_setFromOptions[] = "setFromOptions"; static const char __pyx_k_solveTranspose[] = "solveTranspose"; static const char __pyx_k_createSubMatrix[] = "createSubMatrix"; static const char __pyx_k_missingDiagonal[] = "missingDiagonal"; static const char __pyx_k_zeroRowsColumns[] = "zeroRowsColumns"; static const char __pyx_k_formSNESFunction[] = "formSNESFunction"; static const char __pyx_k_formSNESJacobian[] = "formSNESJacobian"; static const char __pyx_k_getDiagonalBlock[] = "getDiagonalBlock"; static const char __pyx_k_multHermitianAdd[] = "multHermitianAdd"; static const char __pyx_k_multTransposeAdd[] = "multTransposeAdd"; static const char __pyx_k_multDiagonalBlock[] = "multDiagonalBlock"; static const char __pyx_k_solveTransposeAdd[] = "solveTransposeAdd"; static const char __pyx_k_applySymmetricLeft[] = "applySymmetricLeft"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_applySymmetricRight[] = "applySymmetricRight"; static PyObject *__pyx_kp_s_; static PyObject *__pyx_n_s_Error; static PyObject *__pyx_n_s_SOR; static PyObject *__pyx_kp_s__3; static PyObject *__pyx_kp_s__5; static PyObject *__pyx_n_s_adaptStep; static PyObject *__pyx_n_s_apply; static PyObject *__pyx_n_s_applySymmetricLeft; static PyObject *__pyx_n_s_applySymmetricRight; static PyObject *__pyx_n_s_applyTranspose; static PyObject *__pyx_n_s_assembly; static PyObject *__pyx_n_s_assemblyBegin; static PyObject *__pyx_n_s_assemblyEnd; static PyObject *__pyx_n_s_buildResidual; static PyObject *__pyx_n_s_buildSolution; static PyObject *__pyx_n_s_builtins; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_compile; static PyObject *__pyx_n_s_conjugate; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_create; static PyObject *__pyx_n_s_createSubMatrix; static PyObject *__pyx_n_s_createVecs; static PyObject *__pyx_n_s_destroy; static PyObject *__pyx_n_s_diagonalScale; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_duplicate; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_evaluatestep; static PyObject *__pyx_n_s_exec; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_formSNESFunction; static PyObject *__pyx_n_s_formSNESJacobian; static PyObject *__pyx_n_s_getDiagonal; static PyObject *__pyx_n_s_getDiagonalBlock; static PyObject *__pyx_n_s_imagPart; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_interpolate; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_missingDiagonal; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_monitor; static PyObject *__pyx_n_s_mult; static PyObject *__pyx_n_s_multAdd; static PyObject *__pyx_n_s_multDiagonalBlock; static PyObject *__pyx_n_s_multHermitian; static PyObject *__pyx_n_s_multHermitianAdd; static PyObject *__pyx_n_s_multTranspose; static PyObject *__pyx_n_s_multTransposeAdd; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_norm; static PyObject *__pyx_n_s_open; static PyObject *__pyx_n_s_package; static PyObject *__pyx_n_s_petsc4py_PETSc; static PyObject *__pyx_n_s_postSolve; static PyObject *__pyx_n_s_postStep; static PyObject *__pyx_n_s_preSolve; static PyObject *__pyx_n_s_preStep; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_rU; static PyObject *__pyx_n_s_read; static PyObject *__pyx_n_s_realPart; static PyObject *__pyx_n_s_reset; static PyObject *__pyx_n_s_rollback; static PyObject *__pyx_n_s_rsplit; static PyObject *__pyx_n_s_scale; static PyObject *__pyx_n_s_setDiagonal; static PyObject *__pyx_n_s_setFromOptions; static PyObject *__pyx_n_s_setMonitor; static PyObject *__pyx_n_s_setOption; static PyObject *__pyx_n_s_setUp; static PyObject *__pyx_n_s_shift; static PyObject *__pyx_n_s_solve; static PyObject *__pyx_n_s_solveAdd; static PyObject *__pyx_n_s_solveStep; static PyObject *__pyx_n_s_solveTranspose; static PyObject *__pyx_n_s_solveTransposeAdd; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_step; static PyObject *__pyx_n_s_stepTranspose; static PyObject *__pyx_n_s_view; static PyObject *__pyx_n_s_zeroEntries; static PyObject *__pyx_n_s_zeroRowsColumns; static PyObject *__pyx_pf_11libpetsc4py_6_PyObj___getattr__(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_tp_new_11libpetsc4py__PyObj(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11libpetsc4py__PyMat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11libpetsc4py__PyPC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11libpetsc4py__PyKSP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11libpetsc4py__PySNES(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_11libpetsc4py__PyTS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_int_1; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__4; /* Late includes */ /* "libpetsc4py.pyx":30 * void initlibpetsc4py() nogil except * * * cdef public int import_libpetsc4py() nogil except -1: # <<<<<<<<<<<<<< * initlibpetsc4py() * return 0 */ int import_libpetsc4py(void) { int __pyx_r; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "libpetsc4py.pyx":31 * * cdef public int import_libpetsc4py() nogil except -1: * initlibpetsc4py() # <<<<<<<<<<<<<< * return 0 * */ initlibpetsc4py(); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 31, __pyx_L1_error) /* "libpetsc4py.pyx":32 * cdef public int import_libpetsc4py() nogil except -1: * initlibpetsc4py() * return 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":30 * void initlibpetsc4py() nogil except * * * cdef public int import_libpetsc4py() nogil except -1: # <<<<<<<<<<<<<< * initlibpetsc4py() * return 0 */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("libpetsc4py.import_libpetsc4py", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":84 * PetscErrorCode PetscViewerStringSPrintf(PetscViewer,char[],...) * * cdef inline object toInt(PetscInt value): return value # <<<<<<<<<<<<<< * cdef inline PetscInt asInt(object value) except?-1: return value * cdef inline object toReal(PetscReal value): return value */ static CYTHON_INLINE PyObject *__pyx_f_11libpetsc4py_toInt(PetscInt __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toInt", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscInt(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.toInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":85 * * cdef inline object toInt(PetscInt value): return value * cdef inline PetscInt asInt(object value) except?-1: return value # <<<<<<<<<<<<<< * cdef inline object toReal(PetscReal value): return value * cdef inline PetscReal asReal(object value) except?-1: return value */ static CYTHON_INLINE PetscInt __pyx_f_11libpetsc4py_asInt(PyObject *__pyx_v_value) { PetscInt __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asInt", 0); __pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.asInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":86 * cdef inline object toInt(PetscInt value): return value * cdef inline PetscInt asInt(object value) except?-1: return value * cdef inline object toReal(PetscReal value): return value # <<<<<<<<<<<<<< * cdef inline PetscReal asReal(object value) except?-1: return value * cdef extern from "scalar.h": */ static CYTHON_INLINE PyObject *__pyx_f_11libpetsc4py_toReal(PetscReal __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toReal", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.toReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":87 * cdef inline PetscInt asInt(object value) except?-1: return value * cdef inline object toReal(PetscReal value): return value * cdef inline PetscReal asReal(object value) except?-1: return value # <<<<<<<<<<<<<< * cdef extern from "scalar.h": * object toScalar"PyPetscScalar_FromPetscScalar"(PetscScalar) */ static CYTHON_INLINE PetscReal __pyx_f_11libpetsc4py_asReal(PyObject *__pyx_v_value) { PetscReal __pyx_r; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asReal", 0); __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.asReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1.0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":68 * # -------------------------------------------------------------------- * * cdef inline ndarray asarray(object ob): # <<<<<<<<<<<<<< * return PyArray_FROM_O(ob) * */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_asarray(PyObject *__pyx_v_ob) { PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asarray", 0); /* "include/arraynpy.pxi":69 * * cdef inline ndarray asarray(object ob): * return PyArray_FROM_O(ob) # <<<<<<<<<<<<<< * * cdef inline ndarray arange(start, stop, stride): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_FROM_O(__pyx_v_ob)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":68 * # -------------------------------------------------------------------- * * cdef inline ndarray asarray(object ob): # <<<<<<<<<<<<<< * return PyArray_FROM_O(ob) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.asarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":71 * return PyArray_FROM_O(ob) * * cdef inline ndarray arange(start, stop, stride): # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_arange(PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_stride) { PyArray_Descr *__pyx_v_descr = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arange", 0); /* "include/arraynpy.pxi":72 * * cdef inline ndarray arange(start, stop, stride): * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<< * return PyArray_ArangeObj(start, stop, stride, descr) * */ __pyx_t_1 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_descr = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0; /* "include/arraynpy.pxi":73 * cdef inline ndarray arange(start, stop, stride): * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_2 = ((PyObject *)PyArray_ArangeObj(__pyx_v_start, __pyx_v_stop, __pyx_v_stride, __pyx_v_descr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":71 * return PyArray_FROM_O(ob) * * cdef inline ndarray arange(start, stop, stride): # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.arange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":77 * # -------------------------------------------------------------------- * * cdef inline ndarray empty_i(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_empty_i(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_i", 0); /* "include/arraynpy.pxi":78 * * cdef inline ndarray empty_i(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":79 * cdef inline ndarray empty_i(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_r(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_INT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":77 * # -------------------------------------------------------------------- * * cdef inline ndarray empty_i(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.empty_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":81 * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * * cdef inline ndarray empty_r(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_empty_r(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_r", 0); /* "include/arraynpy.pxi":82 * * cdef inline ndarray empty_r(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":83 * cdef inline ndarray empty_r(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_s(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_REAL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":81 * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * * cdef inline ndarray empty_r(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.empty_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":85 * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * * cdef inline ndarray empty_s(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_empty_s(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_s", 0); /* "include/arraynpy.pxi":86 * * cdef inline ndarray empty_s(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":87 * cdef inline ndarray empty_s(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_c(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_SCALAR, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":85 * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * * cdef inline ndarray empty_s(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.empty_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":89 * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * * cdef inline ndarray empty_c(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_empty_c(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_c", 0); /* "include/arraynpy.pxi":90 * * cdef inline ndarray empty_c(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":91 * cdef inline ndarray empty_c(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_p(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_COMPLEX, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":89 * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * * cdef inline ndarray empty_c(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.empty_c", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":93 * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * * cdef inline ndarray empty_p(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_empty_p(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_p", 0); /* "include/arraynpy.pxi":94 * * cdef inline ndarray empty_p(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_INTP, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":95 * cdef inline ndarray empty_p(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_INTP, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":93 * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * * cdef inline ndarray empty_p(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.empty_p", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":99 * # -------------------------------------------------------------------- * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_array_i(PetscInt __pyx_v_size, PetscInt const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_i", 0); /* "include/arraynpy.pxi":100 * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":101 * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_INT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":102 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":103 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscInt))))); /* "include/arraynpy.pxi":102 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary */ } /* "include/arraynpy.pxi":104 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":99 * # -------------------------------------------------------------------- * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.array_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":106 * return ary * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_array_r(PetscInt __pyx_v_size, PetscReal const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_r", 0); /* "include/arraynpy.pxi":107 * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":108 * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_REAL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":109 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":110 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscReal))))); /* "include/arraynpy.pxi":109 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary */ } /* "include/arraynpy.pxi":111 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":106 * return ary * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.array_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":113 * return ary * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_array_b(PetscInt __pyx_v_size, PetscBool const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_b", 0); /* "include/arraynpy.pxi":114 * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":115 * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_BOOL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":116 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":117 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscBool))))); /* "include/arraynpy.pxi":116 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary */ } /* "include/arraynpy.pxi":118 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":113 * return ary * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.array_b", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":120 * return ary * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_array_s(PetscInt __pyx_v_size, PetscScalar const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_s", 0); /* "include/arraynpy.pxi":121 * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":122 * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_SCALAR, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":123 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":124 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscScalar))))); /* "include/arraynpy.pxi":123 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary */ } /* "include/arraynpy.pxi":125 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":120 * return ary * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.array_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":129 * # -------------------------------------------------------------------- * * cdef inline ndarray iarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_iarray(PyObject *__pyx_v_ob, int __pyx_v_typenum) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray", 0); /* "include/arraynpy.pxi":130 * * cdef inline ndarray iarray(object ob, int typenum): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, __pyx_v_typenum, (NPY_ARRAY_ALIGNED | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":132 * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) */ __pyx_t_2 = (PyArray_ISCONTIGUOUS(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":133 * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary # <<<<<<<<<<<<<< * return PyArray_Copy(ary) * */ __pyx_t_2 = (PyArray_ISFORTRAN(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":134 * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":129 * # -------------------------------------------------------------------- * * cdef inline ndarray iarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.iarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":136 * return PyArray_Copy(ary) * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_iarray_i(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscInt **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_i", 0); /* "include/arraynpy.pxi":137 * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_iarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":138 * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":139 * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":140 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":136 * return PyArray_Copy(ary) * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.iarray_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":142 * return ary * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_iarray_r(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscReal **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_r", 0); /* "include/arraynpy.pxi":143 * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_iarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":144 * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":145 * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":146 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":142 * return ary * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.iarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":148 * return ary * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_iarray_b(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscBool **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_b", 0); /* "include/arraynpy.pxi":149 * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_iarray(__pyx_v_ob, NPY_PETSC_BOOL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":150 * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":151 * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscBool *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":152 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":148 * return ary * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.iarray_b", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":154 * return ary * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_iarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_s", 0); /* "include/arraynpy.pxi":155 * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_iarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":156 * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":157 * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":158 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":154 * return ary * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.iarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":162 * # -------------------------------------------------------------------- * * cdef inline ndarray oarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_oarray(PyObject *__pyx_v_ob, int __pyx_v_typenum) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray", 0); /* "include/arraynpy.pxi":163 * * cdef inline ndarray oarray(object ob, int typenum): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, __pyx_v_typenum, ((NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE) | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":165 * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) */ __pyx_t_2 = (PyArray_ISCONTIGUOUS(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":166 * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary # <<<<<<<<<<<<<< * return PyArray_Copy(ary) * */ __pyx_t_2 = (PyArray_ISFORTRAN(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":167 * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":162 * # -------------------------------------------------------------------- * * cdef inline ndarray oarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.oarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":169 * return PyArray_Copy(ary) * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_oarray_i(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscInt **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_i", 0); /* "include/arraynpy.pxi":170 * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_oarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":171 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":172 * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":173 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":169 * return PyArray_Copy(ary) * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.oarray_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":175 * return ary * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_oarray_r(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscReal **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_r", 0); /* "include/arraynpy.pxi":176 * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_oarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":177 * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":178 * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":179 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":175 * return ary * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.oarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":181 * return ary * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_oarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_s", 0); /* "include/arraynpy.pxi":182 * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_oarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":183 * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":184 * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":185 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":181 * return ary * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.oarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":187 * return ary * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_oarray_p(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, void **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_p", 0); /* "include/arraynpy.pxi":188 * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): * cdef ndarray ary = oarray(ob, NPY_INTP) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_oarray(__pyx_v_ob, NPY_INTP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":189 * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":190 * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((void *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":191 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":187 * return ary * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.oarray_p", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":195 * # -------------------------------------------------------------------- * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_ocarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ocarray_s", 0); /* "include/arraynpy.pxi":196 * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, NPY_PETSC_SCALAR, (NPY_ARRAY_CARRAY | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":198 * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":199 * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":200 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":195 * # -------------------------------------------------------------------- * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.ocarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":202 * return ary * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_11libpetsc4py_ofarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ofarray_s", 0); /* "include/arraynpy.pxi":203 * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, NPY_PETSC_SCALAR, (NPY_ARRAY_FARRAY | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":205 * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":206 * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":207 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":202 * return ary * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.ofarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":118 * cdef int istack = 0 * * cdef inline void FunctionBegin(char name[]) nogil: # <<<<<<<<<<<<<< * global FUNCT * FUNCT = name */ static CYTHON_INLINE void __pyx_f_11libpetsc4py_FunctionBegin(char *__pyx_v_name) { int __pyx_t_1; /* "libpetsc4py.pyx":120 * cdef inline void FunctionBegin(char name[]) nogil: * global FUNCT * FUNCT = name # <<<<<<<<<<<<<< * global fstack, istack * fstack[istack] = FUNCT */ __pyx_v_11libpetsc4py_FUNCT = __pyx_v_name; /* "libpetsc4py.pyx":122 * FUNCT = name * global fstack, istack * fstack[istack] = FUNCT # <<<<<<<<<<<<<< * istack += 1 * if istack >= 1024: */ (__pyx_v_11libpetsc4py_fstack[__pyx_v_11libpetsc4py_istack]) = __pyx_v_11libpetsc4py_FUNCT; /* "libpetsc4py.pyx":123 * global fstack, istack * fstack[istack] = FUNCT * istack += 1 # <<<<<<<<<<<<<< * if istack >= 1024: * istack = 0 */ __pyx_v_11libpetsc4py_istack = (__pyx_v_11libpetsc4py_istack + 1); /* "libpetsc4py.pyx":124 * fstack[istack] = FUNCT * istack += 1 * if istack >= 1024: # <<<<<<<<<<<<<< * istack = 0 * return */ __pyx_t_1 = ((__pyx_v_11libpetsc4py_istack >= 0x400) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":125 * istack += 1 * if istack >= 1024: * istack = 0 # <<<<<<<<<<<<<< * return * */ __pyx_v_11libpetsc4py_istack = 0; /* "libpetsc4py.pyx":124 * fstack[istack] = FUNCT * istack += 1 * if istack >= 1024: # <<<<<<<<<<<<<< * istack = 0 * return */ } /* "libpetsc4py.pyx":126 * if istack >= 1024: * istack = 0 * return # <<<<<<<<<<<<<< * * cdef inline PetscErrorCode FunctionEnd() nogil: */ goto __pyx_L0; /* "libpetsc4py.pyx":118 * cdef int istack = 0 * * cdef inline void FunctionBegin(char name[]) nogil: # <<<<<<<<<<<<<< * global FUNCT * FUNCT = name */ /* function exit code */ __pyx_L0:; } /* "libpetsc4py.pyx":128 * return * * cdef inline PetscErrorCode FunctionEnd() nogil: # <<<<<<<<<<<<<< * global FUNCT * FUNCT = NULL */ static CYTHON_INLINE PetscErrorCode __pyx_f_11libpetsc4py_FunctionEnd(void) { PetscErrorCode __pyx_r; int __pyx_t_1; /* "libpetsc4py.pyx":130 * cdef inline PetscErrorCode FunctionEnd() nogil: * global FUNCT * FUNCT = NULL # <<<<<<<<<<<<<< * global fstack, istack * istack -= 1 */ __pyx_v_11libpetsc4py_FUNCT = NULL; /* "libpetsc4py.pyx":132 * FUNCT = NULL * global fstack, istack * istack -= 1 # <<<<<<<<<<<<<< * if istack < 0: * istack = 1024 */ __pyx_v_11libpetsc4py_istack = (__pyx_v_11libpetsc4py_istack - 1); /* "libpetsc4py.pyx":133 * global fstack, istack * istack -= 1 * if istack < 0: # <<<<<<<<<<<<<< * istack = 1024 * FUNCT = fstack[istack] */ __pyx_t_1 = ((__pyx_v_11libpetsc4py_istack < 0) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":134 * istack -= 1 * if istack < 0: * istack = 1024 # <<<<<<<<<<<<<< * FUNCT = fstack[istack] * return 0 */ __pyx_v_11libpetsc4py_istack = 0x400; /* "libpetsc4py.pyx":133 * global fstack, istack * istack -= 1 * if istack < 0: # <<<<<<<<<<<<<< * istack = 1024 * FUNCT = fstack[istack] */ } /* "libpetsc4py.pyx":135 * if istack < 0: * istack = 1024 * FUNCT = fstack[istack] # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_11libpetsc4py_FUNCT = (__pyx_v_11libpetsc4py_fstack[__pyx_v_11libpetsc4py_istack]); /* "libpetsc4py.pyx":136 * istack = 1024 * FUNCT = fstack[istack] * return 0 # <<<<<<<<<<<<<< * * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) nogil: */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":128 * return * * cdef inline PetscErrorCode FunctionEnd() nogil: # <<<<<<<<<<<<<< * global FUNCT * FUNCT = NULL */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":138 * return 0 * * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) nogil: # <<<<<<<<<<<<<< * global fstack, istack * istack = 0; fstack[istack] = NULL; */ static PetscErrorCode __pyx_f_11libpetsc4py_PetscSETERR(PetscErrorCode __pyx_v_ierr, char *__pyx_v_msg) { PetscErrorCode __pyx_r; /* "libpetsc4py.pyx":140 * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) nogil: * global fstack, istack * istack = 0; fstack[istack] = NULL; # <<<<<<<<<<<<<< * global FUNCT * return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, */ __pyx_v_11libpetsc4py_istack = 0; (__pyx_v_11libpetsc4py_fstack[__pyx_v_11libpetsc4py_istack]) = NULL; /* "libpetsc4py.pyx":142 * istack = 0; fstack[istack] = NULL; * global FUNCT * return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, # <<<<<<<<<<<<<< * PETSC_ERROR_INITIAL, msg, NULL) * */ __pyx_r = PetscERROR(PETSC_COMM_SELF, __pyx_v_11libpetsc4py_FUNCT, __pyx_v_ierr, PETSC_ERROR_INITIAL, __pyx_v_msg, NULL); goto __pyx_L0; /* "libpetsc4py.pyx":138 * return 0 * * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) nogil: # <<<<<<<<<<<<<< * global fstack, istack * istack = 0; fstack[istack] = NULL; */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":145 * PETSC_ERROR_INITIAL, msg, NULL) * * cdef PetscErrorCode PetscCHKERR(PetscErrorCode ierr) nogil: # <<<<<<<<<<<<<< * global fstack, istack * istack = 0; fstack[istack] = NULL; */ static PetscErrorCode __pyx_f_11libpetsc4py_PetscCHKERR(PetscErrorCode __pyx_v_ierr) { PetscErrorCode __pyx_r; /* "libpetsc4py.pyx":147 * cdef PetscErrorCode PetscCHKERR(PetscErrorCode ierr) nogil: * global fstack, istack * istack = 0; fstack[istack] = NULL; # <<<<<<<<<<<<<< * global FUNCT * return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, */ __pyx_v_11libpetsc4py_istack = 0; (__pyx_v_11libpetsc4py_fstack[__pyx_v_11libpetsc4py_istack]) = NULL; /* "libpetsc4py.pyx":149 * istack = 0; fstack[istack] = NULL; * global FUNCT * return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, # <<<<<<<<<<<<<< * PETSC_ERROR_REPEAT, b"", NULL) * */ __pyx_r = PetscERROR(PETSC_COMM_SELF, __pyx_v_11libpetsc4py_FUNCT, __pyx_v_ierr, PETSC_ERROR_REPEAT, ((char *)""), NULL); goto __pyx_L0; /* "libpetsc4py.pyx":145 * PETSC_ERROR_INITIAL, msg, NULL) * * cdef PetscErrorCode PetscCHKERR(PetscErrorCode ierr) nogil: # <<<<<<<<<<<<<< * global fstack, istack * istack = 0; fstack[istack] = NULL; */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":160 * from petsc4py.PETSc import Error as PetscError * * cdef inline void PythonSETERR(PetscErrorCode ierr) with gil: # <<<<<<<<<<<<<< * if (PetscError) != NULL: * PyErr_SetObject(PetscError, ierr) */ static CYTHON_INLINE void __pyx_f_11libpetsc4py_PythonSETERR(PetscErrorCode __pyx_v_ierr) { __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PythonSETERR", 0); /* "libpetsc4py.pyx":161 * * cdef inline void PythonSETERR(PetscErrorCode ierr) with gil: * if (PetscError) != NULL: # <<<<<<<<<<<<<< * PyErr_SetObject(PetscError, ierr) * else: */ __pyx_t_1 = ((((void *)__pyx_v_11libpetsc4py_PetscError) != NULL) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":162 * cdef inline void PythonSETERR(PetscErrorCode ierr) with gil: * if (PetscError) != NULL: * PyErr_SetObject(PetscError, ierr) # <<<<<<<<<<<<<< * else: * PyErr_SetObject(PyExc_RuntimeError, ierr) */ __pyx_t_2 = __pyx_v_11libpetsc4py_PetscError; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); PyErr_SetObject(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":161 * * cdef inline void PythonSETERR(PetscErrorCode ierr) with gil: * if (PetscError) != NULL: # <<<<<<<<<<<<<< * PyErr_SetObject(PetscError, ierr) * else: */ goto __pyx_L3; } /* "libpetsc4py.pyx":164 * PyErr_SetObject(PetscError, ierr) * else: * PyErr_SetObject(PyExc_RuntimeError, ierr) # <<<<<<<<<<<<<< * * cdef inline int CHKERR(PetscErrorCode ierr) nogil except -1: */ /*else*/ { __pyx_t_3 = ((PyObject *)PyExc_RuntimeError); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); PyErr_SetObject(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "libpetsc4py.pyx":160 * from petsc4py.PETSc import Error as PetscError * * cdef inline void PythonSETERR(PetscErrorCode ierr) with gil: # <<<<<<<<<<<<<< * if (PetscError) != NULL: * PyErr_SetObject(PetscError, ierr) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("libpetsc4py.PythonSETERR", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } /* "libpetsc4py.pyx":166 * PyErr_SetObject(PyExc_RuntimeError, ierr) * * cdef inline int CHKERR(PetscErrorCode ierr) nogil except -1: # <<<<<<<<<<<<<< * if ierr == 0: * return 0 */ static CYTHON_INLINE int __pyx_f_11libpetsc4py_CHKERR(PetscErrorCode __pyx_v_ierr) { int __pyx_r; int __pyx_t_1; /* "libpetsc4py.pyx":167 * * cdef inline int CHKERR(PetscErrorCode ierr) nogil except -1: * if ierr == 0: # <<<<<<<<<<<<<< * return 0 * if ierr == PETSC_ERR_PYTHON: */ __pyx_t_1 = ((__pyx_v_ierr == 0) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":168 * cdef inline int CHKERR(PetscErrorCode ierr) nogil except -1: * if ierr == 0: * return 0 # <<<<<<<<<<<<<< * if ierr == PETSC_ERR_PYTHON: * #PetscCHKERR(ierr) */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":167 * * cdef inline int CHKERR(PetscErrorCode ierr) nogil except -1: * if ierr == 0: # <<<<<<<<<<<<<< * return 0 * if ierr == PETSC_ERR_PYTHON: */ } /* "libpetsc4py.pyx":169 * if ierr == 0: * return 0 * if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * #PetscCHKERR(ierr) * return -1 */ __pyx_t_1 = ((__pyx_v_ierr == PETSC_ERR_PYTHON) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":171 * if ierr == PETSC_ERR_PYTHON: * #PetscCHKERR(ierr) * return -1 # <<<<<<<<<<<<<< * if Py_IsInitialized(): * PythonSETERR(ierr) */ __pyx_r = -1; goto __pyx_L0; /* "libpetsc4py.pyx":169 * if ierr == 0: * return 0 * if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * #PetscCHKERR(ierr) * return -1 */ } /* "libpetsc4py.pyx":172 * #PetscCHKERR(ierr) * return -1 * if Py_IsInitialized(): # <<<<<<<<<<<<<< * PythonSETERR(ierr) * PetscCHKERR(ierr) */ __pyx_t_1 = (Py_IsInitialized() != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":173 * return -1 * if Py_IsInitialized(): * PythonSETERR(ierr) # <<<<<<<<<<<<<< * PetscCHKERR(ierr) * return -1 */ __pyx_f_11libpetsc4py_PythonSETERR(__pyx_v_ierr); /* "libpetsc4py.pyx":172 * #PetscCHKERR(ierr) * return -1 * if Py_IsInitialized(): # <<<<<<<<<<<<<< * PythonSETERR(ierr) * PetscCHKERR(ierr) */ } /* "libpetsc4py.pyx":174 * if Py_IsInitialized(): * PythonSETERR(ierr) * PetscCHKERR(ierr) # <<<<<<<<<<<<<< * return -1 * */ (void)(__pyx_f_11libpetsc4py_PetscCHKERR(__pyx_v_ierr)); /* "libpetsc4py.pyx":175 * PythonSETERR(ierr) * PetscCHKERR(ierr) * return -1 # <<<<<<<<<<<<<< * * cdef PetscErrorCode UNSUPPORTED(char msg[]) nogil: */ __pyx_r = -1; goto __pyx_L0; /* "libpetsc4py.pyx":166 * PyErr_SetObject(PyExc_RuntimeError, ierr) * * cdef inline int CHKERR(PetscErrorCode ierr) nogil except -1: # <<<<<<<<<<<<<< * if ierr == 0: * return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":177 * return -1 * * cdef PetscErrorCode UNSUPPORTED(char msg[]) nogil: # <<<<<<<<<<<<<< * global FUNCT * return PetscERROR(PETSC_COMM_SELF,FUNCT,PETSC_ERR_USER, */ static PetscErrorCode __pyx_f_11libpetsc4py_UNSUPPORTED(char *__pyx_v_msg) { PetscErrorCode __pyx_r; /* "libpetsc4py.pyx":179 * cdef PetscErrorCode UNSUPPORTED(char msg[]) nogil: * global FUNCT * return PetscERROR(PETSC_COMM_SELF,FUNCT,PETSC_ERR_USER, # <<<<<<<<<<<<<< * PETSC_ERROR_INITIAL,b"method %s()",msg) * */ __pyx_r = PetscERROR(PETSC_COMM_SELF, __pyx_v_11libpetsc4py_FUNCT, PETSC_ERR_USER, PETSC_ERROR_INITIAL, ((char *)"method %s()"), __pyx_v_msg); goto __pyx_L0; /* "libpetsc4py.pyx":177 * return -1 * * cdef PetscErrorCode UNSUPPORTED(char msg[]) nogil: # <<<<<<<<<<<<<< * global FUNCT * return PetscERROR(PETSC_COMM_SELF,FUNCT,PETSC_ERR_USER, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":184 * # -------------------------------------------------------------------- * * cdef inline PetscInt getRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ static CYTHON_INLINE PetscInt __pyx_f_11libpetsc4py_getRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; PetscInt __pyx_r; int __pyx_t_1; /* "libpetsc4py.pyx":185 * * cdef inline PetscInt getRef(void *pobj) nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj == NULL: return 0 * else: return obj.refct */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "libpetsc4py.pyx":186 * cdef inline PetscInt getRef(void *pobj) nogil: * cdef PetscObject obj = pobj * if obj == NULL: return 0 # <<<<<<<<<<<<<< * else: return obj.refct * */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":187 * cdef PetscObject obj = pobj * if obj == NULL: return 0 * else: return obj.refct # <<<<<<<<<<<<<< * * cdef inline void addRef(void *pobj) nogil: */ /*else*/ { __pyx_r = __pyx_v_obj->refct; goto __pyx_L0; } /* "libpetsc4py.pyx":184 * # -------------------------------------------------------------------- * * cdef inline PetscInt getRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":189 * else: return obj.refct * * cdef inline void addRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct += 1 */ static CYTHON_INLINE void __pyx_f_11libpetsc4py_addRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_t_1; /* "libpetsc4py.pyx":190 * * cdef inline void addRef(void *pobj) nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj != NULL: obj.refct += 1 * */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "libpetsc4py.pyx":191 * cdef inline void addRef(void *pobj) nogil: * cdef PetscObject obj = pobj * if obj != NULL: obj.refct += 1 # <<<<<<<<<<<<<< * * cdef inline void delRef(void *pobj) nogil: */ __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); if (__pyx_t_1) { __pyx_v_obj->refct = (__pyx_v_obj->refct + 1); } /* "libpetsc4py.pyx":189 * else: return obj.refct * * cdef inline void addRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct += 1 */ /* function exit code */ } /* "libpetsc4py.pyx":193 * if obj != NULL: obj.refct += 1 * * cdef inline void delRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct -= 1 */ static CYTHON_INLINE void __pyx_f_11libpetsc4py_delRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_t_1; /* "libpetsc4py.pyx":194 * * cdef inline void delRef(void *pobj) nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj != NULL: obj.refct -= 1 * */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "libpetsc4py.pyx":195 * cdef inline void delRef(void *pobj) nogil: * cdef PetscObject obj = pobj * if obj != NULL: obj.refct -= 1 # <<<<<<<<<<<<<< * * cdef inline PetscObject newRef(void *pobj) nogil: */ __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); if (__pyx_t_1) { __pyx_v_obj->refct = (__pyx_v_obj->refct - 1); } /* "libpetsc4py.pyx":193 * if obj != NULL: obj.refct += 1 * * cdef inline void delRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj != NULL: obj.refct -= 1 */ /* function exit code */ } /* "libpetsc4py.pyx":197 * if obj != NULL: obj.refct -= 1 * * cdef inline PetscObject newRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * cdef int ierr = 0 */ static CYTHON_INLINE PetscObject __pyx_f_11libpetsc4py_newRef(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_v_ierr; PetscObject __pyx_r; int __pyx_t_1; /* "libpetsc4py.pyx":198 * * cdef inline PetscObject newRef(void *pobj) nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * cdef int ierr = 0 * if obj != NULL: */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "libpetsc4py.pyx":199 * cdef inline PetscObject newRef(void *pobj) nogil: * cdef PetscObject obj = pobj * cdef int ierr = 0 # <<<<<<<<<<<<<< * if obj != NULL: * ierr = PetscObjectReference(obj) */ __pyx_v_ierr = 0; /* "libpetsc4py.pyx":200 * cdef PetscObject obj = pobj * cdef int ierr = 0 * if obj != NULL: # <<<<<<<<<<<<<< * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! */ __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":201 * cdef int ierr = 0 * if obj != NULL: * ierr = PetscObjectReference(obj) # <<<<<<<<<<<<<< * if ierr: return NULL # XXX warning! * return obj */ __pyx_v_ierr = PetscObjectReference(__pyx_v_obj); /* "libpetsc4py.pyx":202 * if obj != NULL: * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! # <<<<<<<<<<<<<< * return obj * */ __pyx_t_1 = (__pyx_v_ierr != 0); if (__pyx_t_1) { __pyx_r = NULL; goto __pyx_L0; } /* "libpetsc4py.pyx":200 * cdef PetscObject obj = pobj * cdef int ierr = 0 * if obj != NULL: # <<<<<<<<<<<<<< * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! */ } /* "libpetsc4py.pyx":203 * ierr = PetscObjectReference(obj) * if ierr: return NULL # XXX warning! * return obj # <<<<<<<<<<<<<< * * cdef inline char* getPrefix(void *pobj) nogil: */ __pyx_r = __pyx_v_obj; goto __pyx_L0; /* "libpetsc4py.pyx":197 * if obj != NULL: obj.refct -= 1 * * cdef inline PetscObject newRef(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * cdef int ierr = 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":205 * return obj * * cdef inline char* getPrefix(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return NULL */ static CYTHON_INLINE char *__pyx_f_11libpetsc4py_getPrefix(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; char *__pyx_r; int __pyx_t_1; /* "libpetsc4py.pyx":206 * * cdef inline char* getPrefix(void *pobj) nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj == NULL: return NULL * return obj.prefix */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "libpetsc4py.pyx":207 * cdef inline char* getPrefix(void *pobj) nogil: * cdef PetscObject obj = pobj * if obj == NULL: return NULL # <<<<<<<<<<<<<< * return obj.prefix * */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __pyx_r = NULL; goto __pyx_L0; } /* "libpetsc4py.pyx":208 * cdef PetscObject obj = pobj * if obj == NULL: return NULL * return obj.prefix # <<<<<<<<<<<<<< * * cdef inline int getCommSize(void *pobj) nogil: */ __pyx_r = __pyx_v_obj->prefix; goto __pyx_L0; /* "libpetsc4py.pyx":205 * return obj * * cdef inline char* getPrefix(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return NULL */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":210 * return obj.prefix * * cdef inline int getCommSize(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ static CYTHON_INLINE int __pyx_f_11libpetsc4py_getCommSize(void *__pyx_v_pobj) { PetscObject __pyx_v_obj; int __pyx_v_size; int __pyx_r; int __pyx_t_1; /* "libpetsc4py.pyx":211 * * cdef inline int getCommSize(void *pobj) nogil: * cdef PetscObject obj = pobj # <<<<<<<<<<<<<< * if obj == NULL: return 0 * cdef int size = 0 */ __pyx_v_obj = ((PetscObject)__pyx_v_pobj); /* "libpetsc4py.pyx":212 * cdef inline int getCommSize(void *pobj) nogil: * cdef PetscObject obj = pobj * if obj == NULL: return 0 # <<<<<<<<<<<<<< * cdef int size = 0 * MPI_Comm_size(obj.comm,&size) */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":213 * cdef PetscObject obj = pobj * if obj == NULL: return 0 * cdef int size = 0 # <<<<<<<<<<<<<< * MPI_Comm_size(obj.comm,&size) * return size */ __pyx_v_size = 0; /* "libpetsc4py.pyx":214 * if obj == NULL: return 0 * cdef int size = 0 * MPI_Comm_size(obj.comm,&size) # <<<<<<<<<<<<<< * return size * */ (void)(MPI_Comm_size(__pyx_v_obj->comm, (&__pyx_v_size))); /* "libpetsc4py.pyx":215 * cdef int size = 0 * MPI_Comm_size(obj.comm,&size) * return size # <<<<<<<<<<<<<< * * cdef inline Viewer Viewer_(PetscViewer p): */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "libpetsc4py.pyx":210 * return obj.prefix * * cdef inline int getCommSize(void *pobj) nogil: # <<<<<<<<<<<<<< * cdef PetscObject obj = pobj * if obj == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "libpetsc4py.pyx":217 * return size * * cdef inline Viewer Viewer_(PetscViewer p): # <<<<<<<<<<<<<< * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscViewerObject *__pyx_f_11libpetsc4py_Viewer_(PetscViewer __pyx_v_p) { struct PyPetscViewerObject *__pyx_v_ob = 0; struct PyPetscViewerObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Viewer_", 0); /* "libpetsc4py.pyx":218 * * cdef inline Viewer Viewer_(PetscViewer p): * cdef Viewer ob = Viewer.__new__(Viewer) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(0, 218, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscViewerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":219 * cdef inline Viewer Viewer_(PetscViewer p): * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":220 * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline IS IS_(PetscIS p): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":217 * return size * * cdef inline Viewer Viewer_(PetscViewer p): # <<<<<<<<<<<<<< * cdef Viewer ob = Viewer.__new__(Viewer) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.Viewer_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":222 * return ob * * cdef inline IS IS_(PetscIS p): # <<<<<<<<<<<<<< * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_11libpetsc4py_IS_(IS __pyx_v_p) { struct PyPetscISObject *__pyx_v_ob = 0; struct PyPetscISObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("IS_", 0); /* "libpetsc4py.pyx":223 * * cdef inline IS IS_(PetscIS p): * cdef IS ob = IS.__new__(IS) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(0, 223, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":224 * cdef inline IS IS_(PetscIS p): * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":225 * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline Vec Vec_(PetscVec p): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":222 * return ob * * cdef inline IS IS_(PetscIS p): # <<<<<<<<<<<<<< * cdef IS ob = IS.__new__(IS) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.IS_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":227 * return ob * * cdef inline Vec Vec_(PetscVec p): # <<<<<<<<<<<<<< * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_11libpetsc4py_Vec_(Vec __pyx_v_p) { struct PyPetscVecObject *__pyx_v_ob = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Vec_", 0); /* "libpetsc4py.pyx":228 * * cdef inline Vec Vec_(PetscVec p): * cdef Vec ob = Vec.__new__(Vec) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(0, 228, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":229 * cdef inline Vec Vec_(PetscVec p): * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":230 * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline Mat Mat_(PetscMat p): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":227 * return ob * * cdef inline Vec Vec_(PetscVec p): # <<<<<<<<<<<<<< * cdef Vec ob = Vec.__new__(Vec) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.Vec_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":232 * return ob * * cdef inline Mat Mat_(PetscMat p): # <<<<<<<<<<<<<< * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_11libpetsc4py_Mat_(Mat __pyx_v_p) { struct PyPetscMatObject *__pyx_v_ob = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_", 0); /* "libpetsc4py.pyx":233 * * cdef inline Mat Mat_(PetscMat p): * cdef Mat ob = Mat.__new__(Mat) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(0, 233, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":234 * cdef inline Mat Mat_(PetscMat p): * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":235 * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline PC PC_(PetscPC p): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":232 * return ob * * cdef inline Mat Mat_(PetscMat p): # <<<<<<<<<<<<<< * cdef Mat ob = Mat.__new__(Mat) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.Mat_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":237 * return ob * * cdef inline PC PC_(PetscPC p): # <<<<<<<<<<<<<< * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_11libpetsc4py_PC_(PC __pyx_v_p) { struct PyPetscPCObject *__pyx_v_ob = 0; struct PyPetscPCObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PC_", 0); /* "libpetsc4py.pyx":238 * * cdef inline PC PC_(PetscPC p): * cdef PC ob = PC.__new__(PC) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_PC)))) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":239 * cdef inline PC PC_(PetscPC p): * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":240 * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline KSP KSP_(PetscKSP p): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":237 * return ob * * cdef inline PC PC_(PetscPC p): # <<<<<<<<<<<<<< * cdef PC ob = PC.__new__(PC) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.PC_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":242 * return ob * * cdef inline KSP KSP_(PetscKSP p): # <<<<<<<<<<<<<< * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_11libpetsc4py_KSP_(KSP __pyx_v_p) { struct PyPetscKSPObject *__pyx_v_ob = 0; struct PyPetscKSPObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("KSP_", 0); /* "libpetsc4py.pyx":243 * * cdef inline KSP KSP_(PetscKSP p): * cdef KSP ob = KSP.__new__(KSP) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_KSP)))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":244 * cdef inline KSP KSP_(PetscKSP p): * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":245 * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline SNES SNES_(PetscSNES p): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":242 * return ob * * cdef inline KSP KSP_(PetscKSP p): # <<<<<<<<<<<<<< * cdef KSP ob = KSP.__new__(KSP) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.KSP_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":247 * return ob * * cdef inline SNES SNES_(PetscSNES p): # <<<<<<<<<<<<<< * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_11libpetsc4py_SNES_(SNES __pyx_v_p) { struct PyPetscSNESObject *__pyx_v_ob = 0; struct PyPetscSNESObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SNES_", 0); /* "libpetsc4py.pyx":248 * * cdef inline SNES SNES_(PetscSNES p): * cdef SNES ob = SNES.__new__(SNES) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_SNES)))) __PYX_ERR(0, 248, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":249 * cdef inline SNES SNES_(PetscSNES p): * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":250 * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * cdef inline TS TS_(PetscTS p): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":247 * return ob * * cdef inline SNES SNES_(PetscSNES p): # <<<<<<<<<<<<<< * cdef SNES ob = SNES.__new__(SNES) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.SNES_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":252 * return ob * * cdef inline TS TS_(PetscTS p): # <<<<<<<<<<<<<< * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) */ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_11libpetsc4py_TS_(TS __pyx_v_p) { struct PyPetscTSObject *__pyx_v_ob = 0; struct PyPetscTSObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TS_", 0); /* "libpetsc4py.pyx":253 * * cdef inline TS TS_(PetscTS p): * cdef TS ob = TS.__new__(TS) # <<<<<<<<<<<<<< * ob.obj[0] = newRef(p) * return ob */ __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_TS)))) __PYX_ERR(0, 253, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":254 * cdef inline TS TS_(PetscTS p): * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) # <<<<<<<<<<<<<< * return ob * */ (__pyx_v_ob->__pyx_base.obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_p); /* "libpetsc4py.pyx":255 * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "libpetsc4py.pyx":252 * return ob * * cdef inline TS TS_(PetscTS p): # <<<<<<<<<<<<<< * cdef TS ob = TS.__new__(TS) * ob.obj[0] = newRef(p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.TS_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":259 * # -------------------------------------------------------------------- * * cdef inline object bytes2str(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: * return None */ static CYTHON_INLINE PyObject *__pyx_f_11libpetsc4py_bytes2str(char const *__pyx_v_p) { PyObject *__pyx_v_s = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bytes2str", 0); /* "libpetsc4py.pyx":260 * * cdef inline object bytes2str(const char p[]): * if p == NULL: # <<<<<<<<<<<<<< * return None * cdef bytes s = p */ __pyx_t_1 = ((__pyx_v_p == NULL) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":261 * cdef inline object bytes2str(const char p[]): * if p == NULL: * return None # <<<<<<<<<<<<<< * cdef bytes s = p * if isinstance(s, str): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "libpetsc4py.pyx":260 * * cdef inline object bytes2str(const char p[]): * if p == NULL: # <<<<<<<<<<<<<< * return None * cdef bytes s = p */ } /* "libpetsc4py.pyx":262 * if p == NULL: * return None * cdef bytes s = p # <<<<<<<<<<<<<< * if isinstance(s, str): * return s */ __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)__pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_s = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":263 * return None * cdef bytes s = p * if isinstance(s, str): # <<<<<<<<<<<<<< * return s * else: */ __pyx_t_1 = PyString_Check(__pyx_v_s); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":264 * cdef bytes s = p * if isinstance(s, str): * return s # <<<<<<<<<<<<<< * else: * return s.decode() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; /* "libpetsc4py.pyx":263 * return None * cdef bytes s = p * if isinstance(s, str): # <<<<<<<<<<<<<< * return s * else: */ } /* "libpetsc4py.pyx":266 * return s * else: * return s.decode() # <<<<<<<<<<<<<< * * cdef object parse_url(object url): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_decode_bytes(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":259 * # -------------------------------------------------------------------- * * cdef inline object bytes2str(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.bytes2str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":268 * return s.decode() * * cdef object parse_url(object url): # <<<<<<<<<<<<<< * path, name = url.rsplit(":", 1) * return (path, name) */ static PyObject *__pyx_f_11libpetsc4py_parse_url(PyObject *__pyx_v_url) { PyObject *__pyx_v_path = NULL; PyObject *__pyx_v_name = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_url", 0); /* "libpetsc4py.pyx":269 * * cdef object parse_url(object url): * path, name = url.rsplit(":", 1) # <<<<<<<<<<<<<< * return (path, name) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 269, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 269, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 269, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_path = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_name = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":270 * cdef object parse_url(object url): * path, name = url.rsplit(":", 1) * return (path, name) # <<<<<<<<<<<<<< * * cdef dict module_cache = {} */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "libpetsc4py.pyx":268 * return s.decode() * * cdef object parse_url(object url): # <<<<<<<<<<<<<< * path, name = url.rsplit(":", 1) * return (path, name) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("libpetsc4py.parse_url", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_path); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":274 * cdef dict module_cache = {} * * cdef object load_module(object path): # <<<<<<<<<<<<<< * if path in module_cache: * return module_cache[path] */ static PyObject *__pyx_f_11libpetsc4py_load_module(PyObject *__pyx_v_path) { PyObject *__pyx_v_module = NULL; PyObject *__pyx_v_source = NULL; PyObject *__pyx_v_code = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; char const *__pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_module", 0); /* "libpetsc4py.pyx":275 * * cdef object load_module(object path): * if path in module_cache: # <<<<<<<<<<<<<< * return module_cache[path] * module = PyModule_New("__petsc__") */ if (unlikely(__pyx_v_11libpetsc4py_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 275, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_path, __pyx_v_11libpetsc4py_module_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 275, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":276 * cdef object load_module(object path): * if path in module_cache: * return module_cache[path] # <<<<<<<<<<<<<< * module = PyModule_New("__petsc__") * module.__file__ = path */ __Pyx_XDECREF(__pyx_r); if (unlikely(__pyx_v_11libpetsc4py_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 276, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_11libpetsc4py_module_cache, __pyx_v_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "libpetsc4py.pyx":275 * * cdef object load_module(object path): * if path in module_cache: # <<<<<<<<<<<<<< * return module_cache[path] * module = PyModule_New("__petsc__") */ } /* "libpetsc4py.pyx":277 * if path in module_cache: * return module_cache[path] * module = PyModule_New("__petsc__") # <<<<<<<<<<<<<< * module.__file__ = path * module.__package__ = None */ __pyx_t_3 = PyModule_New(((char *)"__petsc__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_module = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":278 * return module_cache[path] * module = PyModule_New("__petsc__") * module.__file__ = path # <<<<<<<<<<<<<< * module.__package__ = None * module_cache[path] = module */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_module, __pyx_n_s_file, __pyx_v_path) < 0) __PYX_ERR(0, 278, __pyx_L1_error) /* "libpetsc4py.pyx":279 * module = PyModule_New("__petsc__") * module.__file__ = path * module.__package__ = None # <<<<<<<<<<<<<< * module_cache[path] = module * try: */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_module, __pyx_n_s_package, Py_None) < 0) __PYX_ERR(0, 279, __pyx_L1_error) /* "libpetsc4py.pyx":280 * module.__file__ = path * module.__package__ = None * module_cache[path] = module # <<<<<<<<<<<<<< * try: * source = open(path, 'rU') */ if (unlikely(__pyx_v_11libpetsc4py_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 280, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_11libpetsc4py_module_cache, __pyx_v_path, __pyx_v_module) < 0)) __PYX_ERR(0, 280, __pyx_L1_error) /* "libpetsc4py.pyx":281 * module.__package__ = None * module_cache[path] = module * try: # <<<<<<<<<<<<<< * source = open(path, 'rU') * try: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "libpetsc4py.pyx":282 * module_cache[path] = module * try: * source = open(path, 'rU') # <<<<<<<<<<<<<< * try: * code = compile(source.read(), path, 'exec') */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path); __Pyx_INCREF(__pyx_n_s_rU); __Pyx_GIVEREF(__pyx_n_s_rU); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_rU); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_source = __pyx_t_7; __pyx_t_7 = 0; /* "libpetsc4py.pyx":283 * try: * source = open(path, 'rU') * try: # <<<<<<<<<<<<<< * code = compile(source.read(), path, 'exec') * finally: */ /*try:*/ { /* "libpetsc4py.pyx":284 * source = open(path, 'rU') * try: * code = compile(source.read(), path, 'exec') # <<<<<<<<<<<<<< * finally: * source.close() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __Pyx_INCREF(__pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path); __Pyx_INCREF(__pyx_n_s_exec); __Pyx_GIVEREF(__pyx_n_s_exec); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_exec); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_compile, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_code = __pyx_t_7; __pyx_t_7 = 0; } /* "libpetsc4py.pyx":286 * code = compile(source.read(), path, 'exec') * finally: * source.close() # <<<<<<<<<<<<<< * exec(code, module.__dict__) * except: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L12; } __pyx_L11_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename; { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11; goto __pyx_L4_error; __pyx_L14_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17); } __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; goto __pyx_L4_error; } __pyx_L12:; } /* "libpetsc4py.pyx":287 * finally: * source.close() * exec(code, module.__dict__) # <<<<<<<<<<<<<< * except: * del module_cache[path] */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyExec2(__pyx_v_code, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":281 * module.__package__ = None * module_cache[path] = module * try: # <<<<<<<<<<<<<< * source = open(path, 'rU') * try: */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "libpetsc4py.pyx":288 * source.close() * exec(code, module.__dict__) * except: # <<<<<<<<<<<<<< * del module_cache[path] * raise */ /*except:*/ { __Pyx_AddTraceback("libpetsc4py.load_module", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 288, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); /* "libpetsc4py.pyx":289 * exec(code, module.__dict__) * except: * del module_cache[path] # <<<<<<<<<<<<<< * raise * return module */ if (unlikely(__pyx_v_11libpetsc4py_module_cache == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 289, __pyx_L6_except_error) } if (unlikely(PyDict_DelItem(__pyx_v_11libpetsc4py_module_cache, __pyx_v_path) < 0)) __PYX_ERR(0, 289, __pyx_L6_except_error) /* "libpetsc4py.pyx":290 * except: * del module_cache[path] * raise # <<<<<<<<<<<<<< * return module * */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_7, __pyx_t_8); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __PYX_ERR(0, 290, __pyx_L6_except_error) } __pyx_L6_except_error:; /* "libpetsc4py.pyx":281 * module.__package__ = None * module_cache[path] = module * try: # <<<<<<<<<<<<<< * source = open(path, 'rU') * try: */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L9_try_end:; } /* "libpetsc4py.pyx":291 * del module_cache[path] * raise * return module # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_module); __pyx_r = __pyx_v_module; goto __pyx_L0; /* "libpetsc4py.pyx":274 * cdef dict module_cache = {} * * cdef object load_module(object path): # <<<<<<<<<<<<<< * if path in module_cache: * return module_cache[path] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.load_module", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_module); __Pyx_XDECREF(__pyx_v_source); __Pyx_XDECREF(__pyx_v_code); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":301 * cdef bytes name * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.self, attr, None) * */ /* Python wrapper */ static PyObject *__pyx_pw_11libpetsc4py_6_PyObj_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ static PyObject *__pyx_pw_11libpetsc4py_6_PyObj_1__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_r = __pyx_pf_11libpetsc4py_6_PyObj___getattr__(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_11libpetsc4py_6_PyObj___getattr__(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, PyObject *__pyx_v_attr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 0); /* "libpetsc4py.pyx":302 * * def __getattr__(self, attr): * return getattr(self.self, attr, None) # <<<<<<<<<<<<<< * * cdef int setcontext(self, void *ctx, Object base) except -1: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->self; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetAttr3(__pyx_t_1, __pyx_v_attr, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "libpetsc4py.pyx":301 * cdef bytes name * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.self, attr, None) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py._PyObj.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":304 * return getattr(self.self, attr, None) * * cdef int setcontext(self, void *ctx, Object base) except -1: # <<<<<<<<<<<<<< * # * if ctx == self.self: */ static int __pyx_f_11libpetsc4py_6_PyObj_setcontext(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, void *__pyx_v_ctx, struct PyPetscObjectObject *__pyx_v_base) { PyObject *__pyx_v_destroy = 0; PyObject *__pyx_v_create = 0; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setcontext", 0); /* "libpetsc4py.pyx":306 * cdef int setcontext(self, void *ctx, Object base) except -1: * # * if ctx == self.self: # <<<<<<<<<<<<<< * return 0 * # */ __pyx_t_1 = ((__pyx_v_ctx == ((void *)__pyx_v_self->self)) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":307 * # * if ctx == self.self: * return 0 # <<<<<<<<<<<<<< * # * cdef object destroy = self.destroy */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":306 * cdef int setcontext(self, void *ctx, Object base) except -1: * # * if ctx == self.self: # <<<<<<<<<<<<<< * return 0 * # */ } /* "libpetsc4py.pyx":309 * return 0 * # * cdef object destroy = self.destroy # <<<<<<<<<<<<<< * if destroy is not None: * destroy(base) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_destroy = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":310 * # * cdef object destroy = self.destroy * if destroy is not None: # <<<<<<<<<<<<<< * destroy(base) * destroy = None */ __pyx_t_1 = (__pyx_v_destroy != Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":311 * cdef object destroy = self.destroy * if destroy is not None: * destroy(base) # <<<<<<<<<<<<<< * destroy = None * # */ __Pyx_INCREF(__pyx_v_destroy); __pyx_t_4 = __pyx_v_destroy; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_base)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_base)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":312 * if destroy is not None: * destroy(base) * destroy = None # <<<<<<<<<<<<<< * # * if ctx == NULL: */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_destroy, Py_None); /* "libpetsc4py.pyx":310 * # * cdef object destroy = self.destroy * if destroy is not None: # <<<<<<<<<<<<<< * destroy(base) * destroy = None */ } /* "libpetsc4py.pyx":314 * destroy = None * # * if ctx == NULL: # <<<<<<<<<<<<<< * self.self = None * self.name = None */ __pyx_t_3 = ((__pyx_v_ctx == NULL) != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":315 * # * if ctx == NULL: * self.self = None # <<<<<<<<<<<<<< * self.name = None * return 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->self); __Pyx_DECREF(__pyx_v_self->self); __pyx_v_self->self = Py_None; /* "libpetsc4py.pyx":316 * if ctx == NULL: * self.self = None * self.name = None # <<<<<<<<<<<<<< * return 0 * # */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)Py_None); /* "libpetsc4py.pyx":317 * self.self = None * self.name = None * return 0 # <<<<<<<<<<<<<< * # * self.self = ctx */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":314 * destroy = None * # * if ctx == NULL: # <<<<<<<<<<<<<< * self.self = None * self.name = None */ } /* "libpetsc4py.pyx":319 * return 0 * # * self.self = ctx # <<<<<<<<<<<<<< * self.name = None * cdef object create = self.create */ __pyx_t_2 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->self); __Pyx_DECREF(__pyx_v_self->self); __pyx_v_self->self = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":320 * # * self.self = ctx * self.name = None # <<<<<<<<<<<<<< * cdef object create = self.create * if create is not None: */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)Py_None); /* "libpetsc4py.pyx":321 * self.self = ctx * self.name = None * cdef object create = self.create # <<<<<<<<<<<<<< * if create is not None: * create(base) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_create = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":322 * self.name = None * cdef object create = self.create * if create is not None: # <<<<<<<<<<<<<< * create(base) * create = None */ __pyx_t_3 = (__pyx_v_create != Py_None); __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":323 * cdef object create = self.create * if create is not None: * create(base) # <<<<<<<<<<<<<< * create = None * return 0 */ __Pyx_INCREF(__pyx_v_create); __pyx_t_4 = __pyx_v_create; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v_base)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_base)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":324 * if create is not None: * create(base) * create = None # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_create, Py_None); /* "libpetsc4py.pyx":322 * self.name = None * cdef object create = self.create * if create is not None: # <<<<<<<<<<<<<< * create(base) * create = None */ } /* "libpetsc4py.pyx":325 * create(base) * create = None * return 0 # <<<<<<<<<<<<<< * * cdef int getcontext(self, void **ctx) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":304 * return getattr(self.self, attr, None) * * cdef int setcontext(self, void *ctx, Object base) except -1: # <<<<<<<<<<<<<< * # * if ctx == self.self: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("libpetsc4py._PyObj.setcontext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_destroy); __Pyx_XDECREF(__pyx_v_create); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":327 * return 0 * * cdef int getcontext(self, void **ctx) except -1: # <<<<<<<<<<<<<< * if ctx == NULL: return 0 * if self.self is not None: */ static int __pyx_f_11libpetsc4py_6_PyObj_getcontext(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, void **__pyx_v_ctx) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("getcontext", 0); /* "libpetsc4py.pyx":328 * * cdef int getcontext(self, void **ctx) except -1: * if ctx == NULL: return 0 # <<<<<<<<<<<<<< * if self.self is not None: * ctx[0] = self.self */ __pyx_t_1 = ((__pyx_v_ctx == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":329 * cdef int getcontext(self, void **ctx) except -1: * if ctx == NULL: return 0 * if self.self is not None: # <<<<<<<<<<<<<< * ctx[0] = self.self * else: */ __pyx_t_1 = (__pyx_v_self->self != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":330 * if ctx == NULL: return 0 * if self.self is not None: * ctx[0] = self.self # <<<<<<<<<<<<<< * else: * ctx[0] = NULL */ (__pyx_v_ctx[0]) = ((void *)__pyx_v_self->self); /* "libpetsc4py.pyx":329 * cdef int getcontext(self, void **ctx) except -1: * if ctx == NULL: return 0 * if self.self is not None: # <<<<<<<<<<<<<< * ctx[0] = self.self * else: */ goto __pyx_L4; } /* "libpetsc4py.pyx":332 * ctx[0] = self.self * else: * ctx[0] = NULL # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { (__pyx_v_ctx[0]) = NULL; } __pyx_L4:; /* "libpetsc4py.pyx":333 * else: * ctx[0] = NULL * return 0 # <<<<<<<<<<<<<< * * cdef int setname(self, char name[]) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":327 * return 0 * * cdef int getcontext(self, void **ctx) except -1: # <<<<<<<<<<<<<< * if ctx == NULL: return 0 * if self.self is not None: */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":335 * return 0 * * cdef int setname(self, char name[]) except -1: # <<<<<<<<<<<<<< * if name != NULL and name[0] != 0: * self.name = name */ static int __pyx_f_11libpetsc4py_6_PyObj_setname(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self, char *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setname", 0); /* "libpetsc4py.pyx":336 * * cdef int setname(self, char name[]) except -1: * if name != NULL and name[0] != 0: # <<<<<<<<<<<<<< * self.name = name * else: */ __pyx_t_2 = ((__pyx_v_name != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (((__pyx_v_name[0]) != 0) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "libpetsc4py.pyx":337 * cdef int setname(self, char name[]) except -1: * if name != NULL and name[0] != 0: * self.name = name # <<<<<<<<<<<<<< * else: * self.name = None */ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":336 * * cdef int setname(self, char name[]) except -1: * if name != NULL and name[0] != 0: # <<<<<<<<<<<<<< * self.name = name * else: */ goto __pyx_L3; } /* "libpetsc4py.pyx":339 * self.name = name * else: * self.name = None # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)Py_None); } __pyx_L3:; /* "libpetsc4py.pyx":340 * else: * self.name = None * return 0 # <<<<<<<<<<<<<< * * cdef char* getname(self) except? NULL: */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":335 * return 0 * * cdef int setname(self, char name[]) except -1: # <<<<<<<<<<<<<< * if name != NULL and name[0] != 0: * self.name = name */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py._PyObj.setname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":342 * return 0 * * cdef char* getname(self) except? NULL: # <<<<<<<<<<<<<< * if self.self is None: * return NULL */ static char *__pyx_f_11libpetsc4py_6_PyObj_getname(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_self) { PyObject *__pyx_v_ctx = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_modname = NULL; PyObject *__pyx_v_clsname = NULL; PyObject *__pyx_v_cls = NULL; char *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; char *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getname", 0); /* "libpetsc4py.pyx":343 * * cdef char* getname(self) except? NULL: * if self.self is None: # <<<<<<<<<<<<<< * return NULL * if self.name is not None: */ __pyx_t_1 = (__pyx_v_self->self == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":344 * cdef char* getname(self) except? NULL: * if self.self is None: * return NULL # <<<<<<<<<<<<<< * if self.name is not None: * return self.name */ __pyx_r = NULL; goto __pyx_L0; /* "libpetsc4py.pyx":343 * * cdef char* getname(self) except? NULL: * if self.self is None: # <<<<<<<<<<<<<< * return NULL * if self.name is not None: */ } /* "libpetsc4py.pyx":345 * if self.self is None: * return NULL * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * cdef ctx = self.self */ __pyx_t_2 = (__pyx_v_self->name != ((PyObject*)Py_None)); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":346 * return NULL * if self.name is not None: * return self.name # <<<<<<<<<<<<<< * cdef ctx = self.self * cdef name = None */ if (unlikely(__pyx_v_self->name == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(0, 346, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "libpetsc4py.pyx":345 * if self.self is None: * return NULL * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * cdef ctx = self.self */ } /* "libpetsc4py.pyx":347 * if self.name is not None: * return self.name * cdef ctx = self.self # <<<<<<<<<<<<<< * cdef name = None * if PyModule_Check(ctx): */ __pyx_t_4 = __pyx_v_self->self; __Pyx_INCREF(__pyx_t_4); __pyx_v_ctx = __pyx_t_4; __pyx_t_4 = 0; /* "libpetsc4py.pyx":348 * return self.name * cdef ctx = self.self * cdef name = None # <<<<<<<<<<<<<< * if PyModule_Check(ctx): * name = getattr(ctx, '__name__', None) */ __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; /* "libpetsc4py.pyx":349 * cdef ctx = self.self * cdef name = None * if PyModule_Check(ctx): # <<<<<<<<<<<<<< * name = getattr(ctx, '__name__', None) * else: */ __pyx_t_1 = (PyModule_Check(__pyx_v_ctx) != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":350 * cdef name = None * if PyModule_Check(ctx): * name = getattr(ctx, '__name__', None) # <<<<<<<<<<<<<< * else: * modname = getattr(ctx, '__module__', None) */ __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_ctx, __pyx_n_s_name, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; /* "libpetsc4py.pyx":349 * cdef ctx = self.self * cdef name = None * if PyModule_Check(ctx): # <<<<<<<<<<<<<< * name = getattr(ctx, '__name__', None) * else: */ goto __pyx_L5; } /* "libpetsc4py.pyx":352 * name = getattr(ctx, '__name__', None) * else: * modname = getattr(ctx, '__module__', None) # <<<<<<<<<<<<<< * clsname = None * cls = getattr(ctx, '__class__', None) */ /*else*/ { __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_ctx, __pyx_n_s_module, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_modname = __pyx_t_4; __pyx_t_4 = 0; /* "libpetsc4py.pyx":353 * else: * modname = getattr(ctx, '__module__', None) * clsname = None # <<<<<<<<<<<<<< * cls = getattr(ctx, '__class__', None) * if cls: */ __Pyx_INCREF(Py_None); __pyx_v_clsname = Py_None; /* "libpetsc4py.pyx":354 * modname = getattr(ctx, '__module__', None) * clsname = None * cls = getattr(ctx, '__class__', None) # <<<<<<<<<<<<<< * if cls: * clsname = getattr(cls, '__name__', None) */ __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_ctx, __pyx_n_s_class, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_cls = __pyx_t_4; __pyx_t_4 = 0; /* "libpetsc4py.pyx":355 * clsname = None * cls = getattr(ctx, '__class__', None) * if cls: # <<<<<<<<<<<<<< * clsname = getattr(cls, '__name__', None) * if not modname: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cls); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 355, __pyx_L1_error) if (__pyx_t_1) { /* "libpetsc4py.pyx":356 * cls = getattr(ctx, '__class__', None) * if cls: * clsname = getattr(cls, '__name__', None) # <<<<<<<<<<<<<< * if not modname: * modname = getattr(cls, '__module__', None) */ __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_n_s_name, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_clsname, __pyx_t_4); __pyx_t_4 = 0; /* "libpetsc4py.pyx":357 * if cls: * clsname = getattr(cls, '__name__', None) * if not modname: # <<<<<<<<<<<<<< * modname = getattr(cls, '__module__', None) * if modname and clsname: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_modname); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 357, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":358 * clsname = getattr(cls, '__name__', None) * if not modname: * modname = getattr(cls, '__module__', None) # <<<<<<<<<<<<<< * if modname and clsname: * name = modname + '.' + clsname */ __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_cls, __pyx_n_s_module, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_modname, __pyx_t_4); __pyx_t_4 = 0; /* "libpetsc4py.pyx":357 * if cls: * clsname = getattr(cls, '__name__', None) * if not modname: # <<<<<<<<<<<<<< * modname = getattr(cls, '__module__', None) * if modname and clsname: */ } /* "libpetsc4py.pyx":355 * clsname = None * cls = getattr(ctx, '__class__', None) * if cls: # <<<<<<<<<<<<<< * clsname = getattr(cls, '__name__', None) * if not modname: */ } /* "libpetsc4py.pyx":359 * if not modname: * modname = getattr(cls, '__module__', None) * if modname and clsname: # <<<<<<<<<<<<<< * name = modname + '.' + clsname * elif clsname: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_modname); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 359, __pyx_L1_error) if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_clsname); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 359, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __pyx_L9_bool_binop_done:; if (__pyx_t_2) { /* "libpetsc4py.pyx":360 * modname = getattr(cls, '__module__', None) * if modname and clsname: * name = modname + '.' + clsname # <<<<<<<<<<<<<< * elif clsname: * name = clsname */ __pyx_t_4 = PyNumber_Add(__pyx_v_modname, __pyx_kp_s__3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_v_clsname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* "libpetsc4py.pyx":359 * if not modname: * modname = getattr(cls, '__module__', None) * if modname and clsname: # <<<<<<<<<<<<<< * name = modname + '.' + clsname * elif clsname: */ goto __pyx_L8; } /* "libpetsc4py.pyx":361 * if modname and clsname: * name = modname + '.' + clsname * elif clsname: # <<<<<<<<<<<<<< * name = clsname * elif modname: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_clsname); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 361, __pyx_L1_error) if (__pyx_t_2) { /* "libpetsc4py.pyx":362 * name = modname + '.' + clsname * elif clsname: * name = clsname # <<<<<<<<<<<<<< * elif modname: * name = modname */ __Pyx_INCREF(__pyx_v_clsname); __Pyx_DECREF_SET(__pyx_v_name, __pyx_v_clsname); /* "libpetsc4py.pyx":361 * if modname and clsname: * name = modname + '.' + clsname * elif clsname: # <<<<<<<<<<<<<< * name = clsname * elif modname: */ goto __pyx_L8; } /* "libpetsc4py.pyx":363 * elif clsname: * name = clsname * elif modname: # <<<<<<<<<<<<<< * name = modname * if name is not None: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_modname); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 363, __pyx_L1_error) if (__pyx_t_2) { /* "libpetsc4py.pyx":364 * name = clsname * elif modname: * name = modname # <<<<<<<<<<<<<< * if name is not None: * self.name = name.encode() */ __Pyx_INCREF(__pyx_v_modname); __Pyx_DECREF_SET(__pyx_v_name, __pyx_v_modname); /* "libpetsc4py.pyx":363 * elif clsname: * name = clsname * elif modname: # <<<<<<<<<<<<<< * name = modname * if name is not None: */ } __pyx_L8:; } __pyx_L5:; /* "libpetsc4py.pyx":365 * elif modname: * name = modname * if name is not None: # <<<<<<<<<<<<<< * self.name = name.encode() * if self.name is not None: */ __pyx_t_2 = (__pyx_v_name != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":366 * name = modname * if name is not None: * self.name = name.encode() # <<<<<<<<<<<<<< * if self.name is not None: * return self.name */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "libpetsc4py.pyx":365 * elif modname: * name = modname * if name is not None: # <<<<<<<<<<<<<< * self.name = name.encode() * if self.name is not None: */ } /* "libpetsc4py.pyx":367 * if name is not None: * self.name = name.encode() * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * return NULL */ __pyx_t_1 = (__pyx_v_self->name != ((PyObject*)Py_None)); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":368 * self.name = name.encode() * if self.name is not None: * return self.name # <<<<<<<<<<<<<< * return NULL * */ if (unlikely(__pyx_v_self->name == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(0, 368, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "libpetsc4py.pyx":367 * if name is not None: * self.name = name.encode() * if self.name is not None: # <<<<<<<<<<<<<< * return self.name * return NULL */ } /* "libpetsc4py.pyx":369 * if self.name is not None: * return self.name * return NULL # <<<<<<<<<<<<<< * * cdef createcontext(char name_p[]): */ __pyx_r = NULL; goto __pyx_L0; /* "libpetsc4py.pyx":342 * return 0 * * cdef char* getname(self) except? NULL: # <<<<<<<<<<<<<< * if self.self is None: * return NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py._PyObj.getname", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_modname); __Pyx_XDECREF(__pyx_v_clsname); __Pyx_XDECREF(__pyx_v_cls); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":371 * return NULL * * cdef createcontext(char name_p[]): # <<<<<<<<<<<<<< * if name_p == NULL: return None * cdef name = bytes2str(name_p) */ static PyObject *__pyx_f_11libpetsc4py_createcontext(char *__pyx_v_name_p) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mod = 0; PyObject *__pyx_v_path = 0; PyObject *__pyx_v_modname = 0; PyObject *__pyx_v_cls = 0; PyObject *__pyx_v_attr = 0; PyObject *__pyx_v_clsname = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createcontext", 0); /* "libpetsc4py.pyx":372 * * cdef createcontext(char name_p[]): * if name_p == NULL: return None # <<<<<<<<<<<<<< * cdef name = bytes2str(name_p) * cdef mod, path, modname=None */ __pyx_t_1 = ((__pyx_v_name_p == NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "libpetsc4py.pyx":373 * cdef createcontext(char name_p[]): * if name_p == NULL: return None * cdef name = bytes2str(name_p) # <<<<<<<<<<<<<< * cdef mod, path, modname=None * cdef cls, attr, clsname=None */ __pyx_t_2 = __pyx_f_11libpetsc4py_bytes2str(__pyx_v_name_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_name = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":374 * if name_p == NULL: return None * cdef name = bytes2str(name_p) * cdef mod, path, modname=None # <<<<<<<<<<<<<< * cdef cls, attr, clsname=None * # path/to/filename.py:{function|class} */ __Pyx_INCREF(Py_None); __pyx_v_modname = Py_None; /* "libpetsc4py.pyx":375 * cdef name = bytes2str(name_p) * cdef mod, path, modname=None * cdef cls, attr, clsname=None # <<<<<<<<<<<<<< * # path/to/filename.py:{function|class} * if ':' in name: */ __Pyx_INCREF(Py_None); __pyx_v_clsname = Py_None; /* "libpetsc4py.pyx":377 * cdef cls, attr, clsname=None * # path/to/filename.py:{function|class} * if ':' in name: # <<<<<<<<<<<<<< * path, attr = parse_url(name) * mod = load_module(path) */ __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 377, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":378 * # path/to/filename.py:{function|class} * if ':' in name: * path, attr = parse_url(name) # <<<<<<<<<<<<<< * mod = load_module(path) * if attr: */ __pyx_t_2 = __pyx_f_11libpetsc4py_parse_url(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 378, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 378, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 378, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_path = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_attr = __pyx_t_5; __pyx_t_5 = 0; /* "libpetsc4py.pyx":379 * if ':' in name: * path, attr = parse_url(name) * mod = load_module(path) # <<<<<<<<<<<<<< * if attr: * cls = getattr(mod, attr) */ __pyx_t_2 = __pyx_f_11libpetsc4py_load_module(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mod = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":380 * path, attr = parse_url(name) * mod = load_module(path) * if attr: # <<<<<<<<<<<<<< * cls = getattr(mod, attr) * return cls() */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_attr); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 380, __pyx_L1_error) if (__pyx_t_3) { /* "libpetsc4py.pyx":381 * mod = load_module(path) * if attr: * cls = getattr(mod, attr) # <<<<<<<<<<<<<< * return cls() * else: */ __pyx_t_2 = __Pyx_GetAttr(__pyx_v_mod, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_cls = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":382 * if attr: * cls = getattr(mod, attr) * return cls() # <<<<<<<<<<<<<< * else: * return mod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cls); __pyx_t_5 = __pyx_v_cls; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "libpetsc4py.pyx":380 * path, attr = parse_url(name) * mod = load_module(path) * if attr: # <<<<<<<<<<<<<< * cls = getattr(mod, attr) * return cls() */ } /* "libpetsc4py.pyx":384 * return cls() * else: * return mod # <<<<<<<<<<<<<< * # package.module[.{function|class}] * if '.' in name: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_mod); __pyx_r = __pyx_v_mod; goto __pyx_L0; } /* "libpetsc4py.pyx":377 * cdef cls, attr, clsname=None * # path/to/filename.py:{function|class} * if ':' in name: # <<<<<<<<<<<<<< * path, attr = parse_url(name) * mod = load_module(path) */ } /* "libpetsc4py.pyx":386 * return mod * # package.module[.{function|class}] * if '.' in name: # <<<<<<<<<<<<<< * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__3, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 386, __pyx_L1_error) __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { /* "libpetsc4py.pyx":387 * # package.module[.{function|class}] * if '.' in name: * modname, clsname = name.rsplit('.', 1) # <<<<<<<<<<<<<< * mod = PyImport_Import(modname) * if hasattr(mod, clsname): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 387, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 387, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 387, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_modname, __pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_clsname, __pyx_t_4); __pyx_t_4 = 0; /* "libpetsc4py.pyx":388 * if '.' in name: * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) # <<<<<<<<<<<<<< * if hasattr(mod, clsname): * cls = getattr(mod, clsname) */ __pyx_t_5 = PyImport_Import(__pyx_v_modname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_mod = __pyx_t_5; __pyx_t_5 = 0; /* "libpetsc4py.pyx":389 * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) * if hasattr(mod, clsname): # <<<<<<<<<<<<<< * cls = getattr(mod, clsname) * if not PyModule_Check(cls): */ __pyx_t_1 = __Pyx_HasAttr(__pyx_v_mod, __pyx_v_clsname); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 389, __pyx_L1_error) __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":390 * mod = PyImport_Import(modname) * if hasattr(mod, clsname): * cls = getattr(mod, clsname) # <<<<<<<<<<<<<< * if not PyModule_Check(cls): * return cls() */ __pyx_t_5 = __Pyx_GetAttr(__pyx_v_mod, __pyx_v_clsname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_cls = __pyx_t_5; __pyx_t_5 = 0; /* "libpetsc4py.pyx":391 * if hasattr(mod, clsname): * cls = getattr(mod, clsname) * if not PyModule_Check(cls): # <<<<<<<<<<<<<< * return cls() * # package[.module] */ __pyx_t_3 = ((!(PyModule_Check(__pyx_v_cls) != 0)) != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":392 * cls = getattr(mod, clsname) * if not PyModule_Check(cls): * return cls() # <<<<<<<<<<<<<< * # package[.module] * mod = PyImport_Import(name) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_cls); __pyx_t_4 = __pyx_v_cls; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "libpetsc4py.pyx":391 * if hasattr(mod, clsname): * cls = getattr(mod, clsname) * if not PyModule_Check(cls): # <<<<<<<<<<<<<< * return cls() * # package[.module] */ } /* "libpetsc4py.pyx":389 * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) * if hasattr(mod, clsname): # <<<<<<<<<<<<<< * cls = getattr(mod, clsname) * if not PyModule_Check(cls): */ } /* "libpetsc4py.pyx":386 * return mod * # package.module[.{function|class}] * if '.' in name: # <<<<<<<<<<<<<< * modname, clsname = name.rsplit('.', 1) * mod = PyImport_Import(modname) */ } /* "libpetsc4py.pyx":394 * return cls() * # package[.module] * mod = PyImport_Import(name) # <<<<<<<<<<<<<< * return mod * */ __pyx_t_5 = PyImport_Import(__pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_mod, __pyx_t_5); __pyx_t_5 = 0; /* "libpetsc4py.pyx":395 * # package[.module] * mod = PyImport_Import(name) * return mod # <<<<<<<<<<<<<< * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_mod); __pyx_r = __pyx_v_mod; goto __pyx_L0; /* "libpetsc4py.pyx":371 * return NULL * * cdef createcontext(char name_p[]): # <<<<<<<<<<<<<< * if name_p == NULL: return None * cdef name = bytes2str(name_p) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.createcontext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_mod); __Pyx_XDECREF(__pyx_v_path); __Pyx_XDECREF(__pyx_v_modname); __Pyx_XDECREF(__pyx_v_cls); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XDECREF(__pyx_v_clsname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":397 * return mod * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: # <<<<<<<<<<<<<< * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) */ static int __pyx_f_11libpetsc4py_viewcontext(struct __pyx_obj_11libpetsc4py__PyObj *__pyx_v_ctx, PetscViewer __pyx_v_viewer) { PetscBool __pyx_v_isascii; PetscBool __pyx_v_isstring; char *__pyx_v_name; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; char *__pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewcontext", 0); /* "libpetsc4py.pyx":398 * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) */ __pyx_v_isascii = PETSC_FALSE; __pyx_v_isstring = PETSC_FALSE; /* "libpetsc4py.pyx":399 * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectTypeCompare(((PetscObject)__pyx_v_viewer), PETSCVIEWERASCII, (&__pyx_v_isascii))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) /* "libpetsc4py.pyx":400 * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) # <<<<<<<<<<<<<< * cdef char *name = ctx.getname() * if isascii: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectTypeCompare(((PetscObject)__pyx_v_viewer), PETSCVIEWERSTRING, (&__pyx_v_isstring))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 400, __pyx_L1_error) /* "libpetsc4py.pyx":401 * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() # <<<<<<<<<<<<<< * if isascii: * if name == NULL: name = b"unknown/no yet set" */ __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyObj *)__pyx_v_ctx->__pyx_vtab)->getname(__pyx_v_ctx); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_v_name = __pyx_t_2; /* "libpetsc4py.pyx":402 * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() * if isascii: # <<<<<<<<<<<<<< * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) */ if (__pyx_v_isascii) { /* "libpetsc4py.pyx":403 * cdef char *name = ctx.getname() * if isascii: * if name == NULL: name = b"unknown/no yet set" # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: */ __pyx_t_3 = ((__pyx_v_name == NULL) != 0); if (__pyx_t_3) { __pyx_v_name = ((char *)"unknown/no yet set"); } /* "libpetsc4py.pyx":404 * if isascii: * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) # <<<<<<<<<<<<<< * if isstring: * if name == NULL: name = b"" */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscViewerASCIIPrintf(__pyx_v_viewer, ((char *)" Python: %s\n"), __pyx_v_name)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 404, __pyx_L1_error) /* "libpetsc4py.pyx":402 * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) * cdef char *name = ctx.getname() * if isascii: # <<<<<<<<<<<<<< * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) */ } /* "libpetsc4py.pyx":405 * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: # <<<<<<<<<<<<<< * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer,"%s", name) ) */ if (__pyx_v_isstring) { /* "libpetsc4py.pyx":406 * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: * if name == NULL: name = b"" # <<<<<<<<<<<<<< * CHKERR( PetscViewerStringSPrintf(viewer,"%s", name) ) * return 0 */ __pyx_t_3 = ((__pyx_v_name == NULL) != 0); if (__pyx_t_3) { __pyx_v_name = ((char *)""); } /* "libpetsc4py.pyx":407 * if isstring: * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer,"%s", name) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscViewerStringSPrintf(__pyx_v_viewer, ((char *)"%s"), __pyx_v_name)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 407, __pyx_L1_error) /* "libpetsc4py.pyx":405 * if name == NULL: name = b"unknown/no yet set" * CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) * if isstring: # <<<<<<<<<<<<<< * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer,"%s", name) ) */ } /* "libpetsc4py.pyx":408 * if name == NULL: name = b"" * CHKERR( PetscViewerStringSPrintf(viewer,"%s", name) ) * return 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":397 * return mod * * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: # <<<<<<<<<<<<<< * cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.viewcontext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":528 * @cython.internal * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): # <<<<<<<<<<<<<< * if mat != NULL and mat.data != NULL: * return <_PyMat>mat.data */ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyMat *__pyx_f_11libpetsc4py_PyMat(Mat __pyx_v_mat) { struct __pyx_obj_11libpetsc4py__PyMat *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyMat", 0); /* "libpetsc4py.pyx":529 * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: # <<<<<<<<<<<<<< * return <_PyMat>mat.data * else: */ __pyx_t_2 = ((__pyx_v_mat != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_mat->data != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "libpetsc4py.pyx":530 * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: * return <_PyMat>mat.data # <<<<<<<<<<<<<< * else: * return _PyMat.__new__(_PyMat) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_v_mat->data))); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_v_mat->data); goto __pyx_L0; /* "libpetsc4py.pyx":529 * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): * if mat != NULL and mat.data != NULL: # <<<<<<<<<<<<<< * return <_PyMat>mat.data * else: */ } /* "libpetsc4py.pyx":532 * return <_PyMat>mat.data * else: * return _PyMat.__new__(_PyMat) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_3 = ((PyObject *)__pyx_tp_new_11libpetsc4py__PyMat(((PyTypeObject *)__pyx_ptype_11libpetsc4py__PyMat), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":528 * @cython.internal * cdef class _PyMat(_PyObj): pass * cdef inline _PyMat PyMat(PetscMat mat): # <<<<<<<<<<<<<< * if mat != NULL and mat.data != NULL: * return <_PyMat>mat.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.PyMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":534 * return _PyMat.__new__(_PyMat) * * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"MatPythonGetContext") */ PetscErrorCode MatPythonGetContext(Mat __pyx_v_mat, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("MatPythonGetContext", 0); /* "libpetsc4py.pyx":536 * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ * except IERR: * FunctionBegin(b"MatPythonGetContext") # <<<<<<<<<<<<<< * PyMat(mat).getcontext(ctx) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatPythonGetContext")); /* "libpetsc4py.pyx":537 * except IERR: * FunctionBegin(b"MatPythonGetContext") * PyMat(mat).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyMat *)((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":538 * FunctionBegin(b"MatPythonGetContext") * PyMat(mat).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":534 * return _PyMat.__new__(_PyMat) * * cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"MatPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.MatPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":540 * return FunctionEnd() * * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"MatPythonSetContext") */ PetscErrorCode MatPythonSetContext(Mat __pyx_v_mat, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("MatPythonSetContext", 0); /* "libpetsc4py.pyx":542 * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ * except IERR: * FunctionBegin(b"MatPythonSetContext") # <<<<<<<<<<<<<< * PyMat(mat).setcontext(ctx, Mat_(mat)) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatPythonSetContext")); /* "libpetsc4py.pyx":543 * except IERR: * FunctionBegin(b"MatPythonSetContext") * PyMat(mat).setcontext(ctx, Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_11libpetsc4py__PyMat *)((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":544 * FunctionBegin(b"MatPythonSetContext") * PyMat(mat).setcontext(ctx, Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":540 * return FunctionEnd() * * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"MatPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.MatPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":546 * return FunctionEnd() * * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_11libpetsc4py_MatPythonSetType_PYTHON(Mat __pyx_v_mat, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatPythonSetType_PYTHON", 0); /* "libpetsc4py.pyx":548 * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ * except IERR with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatPythonSetType_PYTHON")); /* "libpetsc4py.pyx":549 * except IERR with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * MatPythonSetContext(mat, ctx) */ __pyx_t_1 = ((__pyx_v_name == NULL) != 0); if (__pyx_t_1) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":550 * FunctionBegin(b"MatPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * MatPythonSetContext(mat, ctx) * PyMat(mat).setname(name) */ __pyx_t_2 = __pyx_f_11libpetsc4py_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":551 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * MatPythonSetContext(mat, ctx) # <<<<<<<<<<<<<< * PyMat(mat).setname(name) * return FunctionEnd() */ __pyx_t_3 = MatPythonSetContext(__pyx_v_mat, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 551, __pyx_L1_error) /* "libpetsc4py.pyx":552 * cdef object ctx = createcontext(name) * MatPythonSetContext(mat, ctx) * PyMat(mat).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_11libpetsc4py__PyMat *)((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":553 * MatPythonSetContext(mat, ctx) * PyMat(mat).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatCreate_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":546 * return FunctionEnd() * * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"MatPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.MatPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":555 * return FunctionEnd() * * cdef PetscErrorCode MatCreate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_MatCreate_Python(Mat __pyx_v_mat) { MatOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations MatOps __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCreate_Python", 0); /* "libpetsc4py.pyx":559 * ) \ * except IERR with gil: * FunctionBegin(b"MatCreate_Python") # <<<<<<<<<<<<<< * # * cdef MatOps ops = mat.ops */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatCreate_Python")); /* "libpetsc4py.pyx":561 * FunctionBegin(b"MatCreate_Python") * # * cdef MatOps ops = mat.ops # <<<<<<<<<<<<<< * ops.destroy = MatDestroy_Python * ops.setfromoptions = MatSetFromOptions_Python */ __pyx_t_1 = __pyx_v_mat->ops; __pyx_v_ops = __pyx_t_1; /* "libpetsc4py.pyx":562 * # * cdef MatOps ops = mat.ops * ops.destroy = MatDestroy_Python # <<<<<<<<<<<<<< * ops.setfromoptions = MatSetFromOptions_Python * ops.view = MatView_Python */ __pyx_v_ops->destroy = __pyx_f_11libpetsc4py_MatDestroy_Python; /* "libpetsc4py.pyx":563 * cdef MatOps ops = mat.ops * ops.destroy = MatDestroy_Python * ops.setfromoptions = MatSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = MatView_Python * ops.duplicate = MatDuplicate_Python */ __pyx_v_ops->setfromoptions = __pyx_f_11libpetsc4py_MatSetFromOptions_Python; /* "libpetsc4py.pyx":564 * ops.destroy = MatDestroy_Python * ops.setfromoptions = MatSetFromOptions_Python * ops.view = MatView_Python # <<<<<<<<<<<<<< * ops.duplicate = MatDuplicate_Python * ops.copy = MatCopy_Python */ __pyx_v_ops->view = __pyx_f_11libpetsc4py_MatView_Python; /* "libpetsc4py.pyx":565 * ops.setfromoptions = MatSetFromOptions_Python * ops.view = MatView_Python * ops.duplicate = MatDuplicate_Python # <<<<<<<<<<<<<< * ops.copy = MatCopy_Python * ops.createsubmatrix = MatCreateSubMatrix_Python */ __pyx_v_ops->duplicate = __pyx_f_11libpetsc4py_MatDuplicate_Python; /* "libpetsc4py.pyx":566 * ops.view = MatView_Python * ops.duplicate = MatDuplicate_Python * ops.copy = MatCopy_Python # <<<<<<<<<<<<<< * ops.createsubmatrix = MatCreateSubMatrix_Python * ops.setoption = MatSetOption_Python */ __pyx_v_ops->copy = __pyx_f_11libpetsc4py_MatCopy_Python; /* "libpetsc4py.pyx":567 * ops.duplicate = MatDuplicate_Python * ops.copy = MatCopy_Python * ops.createsubmatrix = MatCreateSubMatrix_Python # <<<<<<<<<<<<<< * ops.setoption = MatSetOption_Python * ops.setup = MatSetUp_Python */ __pyx_v_ops->createsubmatrix = __pyx_f_11libpetsc4py_MatCreateSubMatrix_Python; /* "libpetsc4py.pyx":568 * ops.copy = MatCopy_Python * ops.createsubmatrix = MatCreateSubMatrix_Python * ops.setoption = MatSetOption_Python # <<<<<<<<<<<<<< * ops.setup = MatSetUp_Python * ops.assemblybegin = MatAssemblyBegin_Python */ __pyx_v_ops->setoption = __pyx_f_11libpetsc4py_MatSetOption_Python; /* "libpetsc4py.pyx":569 * ops.createsubmatrix = MatCreateSubMatrix_Python * ops.setoption = MatSetOption_Python * ops.setup = MatSetUp_Python # <<<<<<<<<<<<<< * ops.assemblybegin = MatAssemblyBegin_Python * ops.assemblyend = MatAssemblyEnd_Python */ __pyx_v_ops->setup = __pyx_f_11libpetsc4py_MatSetUp_Python; /* "libpetsc4py.pyx":570 * ops.setoption = MatSetOption_Python * ops.setup = MatSetUp_Python * ops.assemblybegin = MatAssemblyBegin_Python # <<<<<<<<<<<<<< * ops.assemblyend = MatAssemblyEnd_Python * ops.zeroentries = MatZeroEntries_Python */ __pyx_v_ops->assemblybegin = __pyx_f_11libpetsc4py_MatAssemblyBegin_Python; /* "libpetsc4py.pyx":571 * ops.setup = MatSetUp_Python * ops.assemblybegin = MatAssemblyBegin_Python * ops.assemblyend = MatAssemblyEnd_Python # <<<<<<<<<<<<<< * ops.zeroentries = MatZeroEntries_Python * ops.zerorowscolumns = MatZeroRowsColumns_Python */ __pyx_v_ops->assemblyend = __pyx_f_11libpetsc4py_MatAssemblyEnd_Python; /* "libpetsc4py.pyx":572 * ops.assemblybegin = MatAssemblyBegin_Python * ops.assemblyend = MatAssemblyEnd_Python * ops.zeroentries = MatZeroEntries_Python # <<<<<<<<<<<<<< * ops.zerorowscolumns = MatZeroRowsColumns_Python * ops.scale = MatScale_Python */ __pyx_v_ops->zeroentries = __pyx_f_11libpetsc4py_MatZeroEntries_Python; /* "libpetsc4py.pyx":573 * ops.assemblyend = MatAssemblyEnd_Python * ops.zeroentries = MatZeroEntries_Python * ops.zerorowscolumns = MatZeroRowsColumns_Python # <<<<<<<<<<<<<< * ops.scale = MatScale_Python * ops.shift = MatShift_Python */ __pyx_v_ops->zerorowscolumns = __pyx_f_11libpetsc4py_MatZeroRowsColumns_Python; /* "libpetsc4py.pyx":574 * ops.zeroentries = MatZeroEntries_Python * ops.zerorowscolumns = MatZeroRowsColumns_Python * ops.scale = MatScale_Python # <<<<<<<<<<<<<< * ops.shift = MatShift_Python * ops.getvecs = MatCreateVecs_Python */ __pyx_v_ops->scale = __pyx_f_11libpetsc4py_MatScale_Python; /* "libpetsc4py.pyx":575 * ops.zerorowscolumns = MatZeroRowsColumns_Python * ops.scale = MatScale_Python * ops.shift = MatShift_Python # <<<<<<<<<<<<<< * ops.getvecs = MatCreateVecs_Python * ops.mult = MatMult_Python */ __pyx_v_ops->shift = __pyx_f_11libpetsc4py_MatShift_Python; /* "libpetsc4py.pyx":576 * ops.scale = MatScale_Python * ops.shift = MatShift_Python * ops.getvecs = MatCreateVecs_Python # <<<<<<<<<<<<<< * ops.mult = MatMult_Python * ops.sor = MatSOR_Python */ __pyx_v_ops->getvecs = __pyx_f_11libpetsc4py_MatCreateVecs_Python; /* "libpetsc4py.pyx":577 * ops.shift = MatShift_Python * ops.getvecs = MatCreateVecs_Python * ops.mult = MatMult_Python # <<<<<<<<<<<<<< * ops.sor = MatSOR_Python * ops.multtranspose = MatMultTranspose_Python */ __pyx_v_ops->mult = __pyx_f_11libpetsc4py_MatMult_Python; /* "libpetsc4py.pyx":578 * ops.getvecs = MatCreateVecs_Python * ops.mult = MatMult_Python * ops.sor = MatSOR_Python # <<<<<<<<<<<<<< * ops.multtranspose = MatMultTranspose_Python * ops.multhermitian = MatMultHermitian_Python */ __pyx_v_ops->sor = __pyx_f_11libpetsc4py_MatSOR_Python; /* "libpetsc4py.pyx":579 * ops.mult = MatMult_Python * ops.sor = MatSOR_Python * ops.multtranspose = MatMultTranspose_Python # <<<<<<<<<<<<<< * ops.multhermitian = MatMultHermitian_Python * ops.multadd = MatMultAdd_Python */ __pyx_v_ops->multtranspose = __pyx_f_11libpetsc4py_MatMultTranspose_Python; /* "libpetsc4py.pyx":580 * ops.sor = MatSOR_Python * ops.multtranspose = MatMultTranspose_Python * ops.multhermitian = MatMultHermitian_Python # <<<<<<<<<<<<<< * ops.multadd = MatMultAdd_Python * ops.multtransposeadd = MatMultTransposeAdd_Python */ __pyx_v_ops->multhermitiantranspose = __pyx_f_11libpetsc4py_MatMultHermitian_Python; /* "libpetsc4py.pyx":581 * ops.multtranspose = MatMultTranspose_Python * ops.multhermitian = MatMultHermitian_Python * ops.multadd = MatMultAdd_Python # <<<<<<<<<<<<<< * ops.multtransposeadd = MatMultTransposeAdd_Python * ops.multhermitianadd = MatMultHermitianAdd_Python */ __pyx_v_ops->multadd = __pyx_f_11libpetsc4py_MatMultAdd_Python; /* "libpetsc4py.pyx":582 * ops.multhermitian = MatMultHermitian_Python * ops.multadd = MatMultAdd_Python * ops.multtransposeadd = MatMultTransposeAdd_Python # <<<<<<<<<<<<<< * ops.multhermitianadd = MatMultHermitianAdd_Python * ops.multdiagonalblock = MatMultDiagonalBlock_Python */ __pyx_v_ops->multtransposeadd = __pyx_f_11libpetsc4py_MatMultTransposeAdd_Python; /* "libpetsc4py.pyx":583 * ops.multadd = MatMultAdd_Python * ops.multtransposeadd = MatMultTransposeAdd_Python * ops.multhermitianadd = MatMultHermitianAdd_Python # <<<<<<<<<<<<<< * ops.multdiagonalblock = MatMultDiagonalBlock_Python * ops.solve = MatSolve_Python */ __pyx_v_ops->multhermitiantransposeadd = __pyx_f_11libpetsc4py_MatMultHermitianAdd_Python; /* "libpetsc4py.pyx":584 * ops.multtransposeadd = MatMultTransposeAdd_Python * ops.multhermitianadd = MatMultHermitianAdd_Python * ops.multdiagonalblock = MatMultDiagonalBlock_Python # <<<<<<<<<<<<<< * ops.solve = MatSolve_Python * ops.solvetranspose = MatSolveTranspose_Python */ __pyx_v_ops->multdiagonalblock = __pyx_f_11libpetsc4py_MatMultDiagonalBlock_Python; /* "libpetsc4py.pyx":585 * ops.multhermitianadd = MatMultHermitianAdd_Python * ops.multdiagonalblock = MatMultDiagonalBlock_Python * ops.solve = MatSolve_Python # <<<<<<<<<<<<<< * ops.solvetranspose = MatSolveTranspose_Python * ops.solveadd = MatSolveAdd_Python */ __pyx_v_ops->solve = __pyx_f_11libpetsc4py_MatSolve_Python; /* "libpetsc4py.pyx":586 * ops.multdiagonalblock = MatMultDiagonalBlock_Python * ops.solve = MatSolve_Python * ops.solvetranspose = MatSolveTranspose_Python # <<<<<<<<<<<<<< * ops.solveadd = MatSolveAdd_Python * ops.solvetransposeadd = MatSolveTransposeAdd_Python */ __pyx_v_ops->solvetranspose = __pyx_f_11libpetsc4py_MatSolveTranspose_Python; /* "libpetsc4py.pyx":587 * ops.solve = MatSolve_Python * ops.solvetranspose = MatSolveTranspose_Python * ops.solveadd = MatSolveAdd_Python # <<<<<<<<<<<<<< * ops.solvetransposeadd = MatSolveTransposeAdd_Python * ops.getdiagonal = MatGetDiagonal_Python */ __pyx_v_ops->solveadd = __pyx_f_11libpetsc4py_MatSolveAdd_Python; /* "libpetsc4py.pyx":588 * ops.solvetranspose = MatSolveTranspose_Python * ops.solveadd = MatSolveAdd_Python * ops.solvetransposeadd = MatSolveTransposeAdd_Python # <<<<<<<<<<<<<< * ops.getdiagonal = MatGetDiagonal_Python * ops.setdiagonal = MatSetDiagonal_Python */ __pyx_v_ops->solvetransposeadd = __pyx_f_11libpetsc4py_MatSolveTransposeAdd_Python; /* "libpetsc4py.pyx":589 * ops.solveadd = MatSolveAdd_Python * ops.solvetransposeadd = MatSolveTransposeAdd_Python * ops.getdiagonal = MatGetDiagonal_Python # <<<<<<<<<<<<<< * ops.setdiagonal = MatSetDiagonal_Python * ops.diagonalscale = MatDiagonalScale_Python */ __pyx_v_ops->getdiagonal = __pyx_f_11libpetsc4py_MatGetDiagonal_Python; /* "libpetsc4py.pyx":590 * ops.solvetransposeadd = MatSolveTransposeAdd_Python * ops.getdiagonal = MatGetDiagonal_Python * ops.setdiagonal = MatSetDiagonal_Python # <<<<<<<<<<<<<< * ops.diagonalscale = MatDiagonalScale_Python * ops.missingdiagonal = MatMissingDiagonal_Python */ __pyx_v_ops->diagonalset = __pyx_f_11libpetsc4py_MatSetDiagonal_Python; /* "libpetsc4py.pyx":591 * ops.getdiagonal = MatGetDiagonal_Python * ops.setdiagonal = MatSetDiagonal_Python * ops.diagonalscale = MatDiagonalScale_Python # <<<<<<<<<<<<<< * ops.missingdiagonal = MatMissingDiagonal_Python * ops.norm = MatNorm_Python */ __pyx_v_ops->diagonalscale = __pyx_f_11libpetsc4py_MatDiagonalScale_Python; /* "libpetsc4py.pyx":592 * ops.setdiagonal = MatSetDiagonal_Python * ops.diagonalscale = MatDiagonalScale_Python * ops.missingdiagonal = MatMissingDiagonal_Python # <<<<<<<<<<<<<< * ops.norm = MatNorm_Python * ops.realpart = MatRealPart_Python */ __pyx_v_ops->missingdiagonal = __pyx_f_11libpetsc4py_MatMissingDiagonal_Python; /* "libpetsc4py.pyx":593 * ops.diagonalscale = MatDiagonalScale_Python * ops.missingdiagonal = MatMissingDiagonal_Python * ops.norm = MatNorm_Python # <<<<<<<<<<<<<< * ops.realpart = MatRealPart_Python * ops.imagpart = MatImagPart_Python */ __pyx_v_ops->norm = __pyx_f_11libpetsc4py_MatNorm_Python; /* "libpetsc4py.pyx":594 * ops.missingdiagonal = MatMissingDiagonal_Python * ops.norm = MatNorm_Python * ops.realpart = MatRealPart_Python # <<<<<<<<<<<<<< * ops.imagpart = MatImagPart_Python * ops.conjugate = MatConjugate_Python */ __pyx_v_ops->realpart = __pyx_f_11libpetsc4py_MatRealPart_Python; /* "libpetsc4py.pyx":595 * ops.norm = MatNorm_Python * ops.realpart = MatRealPart_Python * ops.imagpart = MatImagPart_Python # <<<<<<<<<<<<<< * ops.conjugate = MatConjugate_Python * # */ __pyx_v_ops->imaginarypart = __pyx_f_11libpetsc4py_MatImagPart_Python; /* "libpetsc4py.pyx":596 * ops.realpart = MatRealPart_Python * ops.imagpart = MatImagPart_Python * ops.conjugate = MatConjugate_Python # <<<<<<<<<<<<<< * # * mat.assembled = PETSC_TRUE # XXX */ __pyx_v_ops->conjugate = __pyx_f_11libpetsc4py_MatConjugate_Python; /* "libpetsc4py.pyx":598 * ops.conjugate = MatConjugate_Python * # * mat.assembled = PETSC_TRUE # XXX # <<<<<<<<<<<<<< * mat.preallocated = PETSC_FALSE # XXX * # */ __pyx_v_mat->assembled = PETSC_TRUE; /* "libpetsc4py.pyx":599 * # * mat.assembled = PETSC_TRUE # XXX * mat.preallocated = PETSC_FALSE # XXX # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_mat->preallocated = PETSC_FALSE; /* "libpetsc4py.pyx":601 * mat.preallocated = PETSC_FALSE # XXX * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat,b"MatGetDiagonalBlock_C", * MatGetDiagonalBlock_Python) ) */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatGetDiagonalBlock_C"), ((PetscVoidFunction)__pyx_f_11libpetsc4py_MatGetDiagonalBlock_Python))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 601, __pyx_L1_error) /* "libpetsc4py.pyx":604 * mat,b"MatGetDiagonalBlock_C", * MatGetDiagonalBlock_Python) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat,b"MatPythonSetType_C", * MatPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatPythonSetType_C"), ((PetscVoidFunction)__pyx_f_11libpetsc4py_MatPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 604, __pyx_L1_error) /* "libpetsc4py.pyx":607 * mat,b"MatPythonSetType_C", * MatPythonSetType_PYTHON) ) * CHKERR( PetscObjectChangeTypeName( # <<<<<<<<<<<<<< * mat,MATPYTHON) ) * # */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectChangeTypeName(((PetscObject)__pyx_v_mat), "python")); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 607, __pyx_L1_error) /* "libpetsc4py.pyx":610 * mat,MATPYTHON) ) * # * cdef ctx = PyMat(NULL) # <<<<<<<<<<<<<< * mat.data = ctx * Py_INCREF(mat.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":611 * # * cdef ctx = PyMat(NULL) * mat.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(mat.data) * return FunctionEnd() */ __pyx_v_mat->data = ((void *)__pyx_v_ctx); /* "libpetsc4py.pyx":612 * cdef ctx = PyMat(NULL) * mat.data = ctx * Py_INCREF(mat.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_mat->data)); /* "libpetsc4py.pyx":613 * mat.data = ctx * Py_INCREF(mat.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatDestroy_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":555 * return FunctionEnd() * * cdef PetscErrorCode MatCreate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.MatCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":615 * return FunctionEnd() * * cdef PetscErrorCode MatDestroy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_MatDestroy_Python(Mat __pyx_v_mat) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatDestroy_Python", 0); /* "libpetsc4py.pyx":619 * ) \ * except IERR with gil: * FunctionBegin(b"MatDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * mat,b"MatGetDiagonalBlock_C", */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatDestroy_Python")); /* "libpetsc4py.pyx":620 * except IERR with gil: * FunctionBegin(b"MatDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat,b"MatGetDiagonalBlock_C", * NULL) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatGetDiagonalBlock_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 620, __pyx_L1_error) /* "libpetsc4py.pyx":623 * mat,b"MatGetDiagonalBlock_C", * NULL) ) * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * mat,b"MatPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_mat), ((char *)"MatPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 623, __pyx_L1_error) /* "libpetsc4py.pyx":626 * mat,b"MatPythonSetType_C", * NULL) ) * CHKERR( PetscObjectChangeTypeName( # <<<<<<<<<<<<<< * mat,NULL) ) * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectChangeTypeName(((PetscObject)__pyx_v_mat), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 626, __pyx_L1_error) /* "libpetsc4py.pyx":629 * mat,NULL) ) * # * if not Py_IsInitialized(): return FunctionEnd() # <<<<<<<<<<<<<< * try: * addRef(mat) */ __pyx_t_2 = ((!(Py_IsInitialized() != 0)) != 0); if (__pyx_t_2) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":630 * # * if not Py_IsInitialized(): return FunctionEnd() * try: # <<<<<<<<<<<<<< * addRef(mat) * MatPythonSetContext(mat, NULL) */ /*try:*/ { /* "libpetsc4py.pyx":631 * if not Py_IsInitialized(): return FunctionEnd() * try: * addRef(mat) # <<<<<<<<<<<<<< * MatPythonSetContext(mat, NULL) * finally: */ __pyx_f_11libpetsc4py_addRef(__pyx_v_mat); /* "libpetsc4py.pyx":632 * try: * addRef(mat) * MatPythonSetContext(mat, NULL) # <<<<<<<<<<<<<< * finally: * delRef(mat) */ __pyx_t_3 = MatPythonSetContext(__pyx_v_mat, NULL); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 632, __pyx_L5_error) } /* "libpetsc4py.pyx":634 * MatPythonSetContext(mat, NULL) * finally: * delRef(mat) # <<<<<<<<<<<<<< * Py_DECREF(mat.data) * mat.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_11libpetsc4py_delRef(__pyx_v_mat); /* "libpetsc4py.pyx":635 * finally: * delRef(mat) * Py_DECREF(mat.data) # <<<<<<<<<<<<<< * mat.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_mat->data)); /* "libpetsc4py.pyx":636 * delRef(mat) * Py_DECREF(mat.data) * mat.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_mat->data = NULL; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_1 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { /* "libpetsc4py.pyx":634 * MatPythonSetContext(mat, NULL) * finally: * delRef(mat) # <<<<<<<<<<<<<< * Py_DECREF(mat.data) * mat.data = NULL */ __pyx_f_11libpetsc4py_delRef(__pyx_v_mat); /* "libpetsc4py.pyx":635 * finally: * delRef(mat) * Py_DECREF(mat.data) # <<<<<<<<<<<<<< * mat.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_mat->data)); /* "libpetsc4py.pyx":636 * delRef(mat) * Py_DECREF(mat.data) * mat.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_mat->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L6:; } /* "libpetsc4py.pyx":637 * Py_DECREF(mat.data) * mat.data = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetFromOptions_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":615 * return FunctionEnd() * * cdef PetscErrorCode MatDestroy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.MatDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":639 * return FunctionEnd() * * cdef PetscErrorCode MatSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscMat mat, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetFromOptions_Python(PetscOptionItems *__pyx_v_PetscOptionsObject, Mat __pyx_v_mat) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetFromOptions_Python", 0); /* "libpetsc4py.pyx":644 * ) \ * except IERR with gil: * FunctionBegin(b"MatSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PyMat(mat).getname() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSetFromOptions_Python")); /* "libpetsc4py.pyx":646 * FunctionBegin(b"MatSetFromOptions_Python") * # * cdef char name[2048], *defval = PyMat(mat).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyMat *)((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":647 * # * cdef char name[2048], *defval = PyMat(mat).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":648 * cdef char name[2048], *defval = PyMat(mat).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-mat_python_type",b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "libpetsc4py.pyx":649 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-mat_python_type",b"Python [package.]module[.{class|function}]", * b"MatPythonSetType",defval,name,sizeof(name),&found) ); opts; */ __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsString(((char *)"-mat_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"MatPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 649, __pyx_L1_error) /* "libpetsc4py.pyx":651 * CHKERR( PetscOptionsString( * b"-mat_python_type",b"Python [package.]module[.{class|function}]", * b"MatPythonSetType",defval,name,sizeof(name),&found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat,name) ) */ ((void)PetscOptionsObject); /* "libpetsc4py.pyx":652 * b"-mat_python_type",b"Python [package.]module[.{class|function}]", * b"MatPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":653 * b"MatPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat,name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyMat(mat).setFromOptions */ __pyx_t_6 = __pyx_f_11libpetsc4py_MatPythonSetType_PYTHON(__pyx_v_mat, __pyx_v_name); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 653, __pyx_L1_error) __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_6); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 653, __pyx_L1_error) /* "libpetsc4py.pyx":652 * b"-mat_python_type",b"Python [package.]module[.{class|function}]", * b"MatPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * # */ } /* "libpetsc4py.pyx":655 * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * # * cdef setFromOptions = PyMat(mat).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "libpetsc4py.pyx":656 * # * cdef setFromOptions = PyMat(mat).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(Mat_(mat)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":657 * cdef setFromOptions = PyMat(mat).setFromOptions * if setFromOptions is not None: * setFromOptions(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "libpetsc4py.pyx":656 * # * cdef setFromOptions = PyMat(mat).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(Mat_(mat)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":658 * if setFromOptions is not None: * setFromOptions(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatView_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":639 * return FunctionEnd() * * cdef PetscErrorCode MatSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscMat mat, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":660 * return FunctionEnd() * * cdef PetscErrorCode MatView_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatView_Python(Mat __pyx_v_mat, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatView_Python", 0); /* "libpetsc4py.pyx":665 * ) \ * except IERR with gil: * FunctionBegin(b"MatView_Python") # <<<<<<<<<<<<<< * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatView_Python")); /* "libpetsc4py.pyx":666 * except IERR with gil: * FunctionBegin(b"MatView_Python") * viewcontext(PyMat(mat), vwr) # <<<<<<<<<<<<<< * cdef view = PyMat(mat).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_11libpetsc4py_viewcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":667 * FunctionBegin(b"MatView_Python") * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view # <<<<<<<<<<<<<< * if view is not None: * view(Mat_(mat), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":668 * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view * if view is not None: # <<<<<<<<<<<<<< * view(Mat_(mat), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":669 * cdef view = PyMat(mat).view * if view is not None: * view(Mat_(mat), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_view); __pyx_t_7 = __pyx_v_view; __pyx_t_8 = NULL; __pyx_t_2 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_2, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":668 * viewcontext(PyMat(mat), vwr) * cdef view = PyMat(mat).view * if view is not None: # <<<<<<<<<<<<<< * view(Mat_(mat), Viewer_(vwr)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":670 * if view is not None: * view(Mat_(mat), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatDuplicate_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":660 * return FunctionEnd() * * cdef PetscErrorCode MatView_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":672 * return FunctionEnd() * * cdef PetscErrorCode MatDuplicate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatDuplicateOption op, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatDuplicate_Python(Mat __pyx_v_mat, MatDuplicateOption __pyx_v_op, Mat *__pyx_v_out) { PyObject *__pyx_v_duplicate = 0; struct PyPetscMatObject *__pyx_v_m = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; Mat __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatDuplicate_Python", 0); /* "libpetsc4py.pyx":678 * ) \ * except IERR with gil: * FunctionBegin(b"MatDuplicate_Python") # <<<<<<<<<<<<<< * cdef duplicate = PyMat(mat).duplicate * if duplicate is None: return UNSUPPORTED(b"duplicate") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatDuplicate_Python")); /* "libpetsc4py.pyx":679 * except IERR with gil: * FunctionBegin(b"MatDuplicate_Python") * cdef duplicate = PyMat(mat).duplicate # <<<<<<<<<<<<<< * if duplicate is None: return UNSUPPORTED(b"duplicate") * cdef Mat m = duplicate(Mat_(mat), op) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_duplicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_duplicate = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":680 * FunctionBegin(b"MatDuplicate_Python") * cdef duplicate = PyMat(mat).duplicate * if duplicate is None: return UNSUPPORTED(b"duplicate") # <<<<<<<<<<<<<< * cdef Mat m = duplicate(Mat_(mat), op) * out[0] = m.mat; m.mat = NULL */ __pyx_t_3 = (__pyx_v_duplicate == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"duplicate")); goto __pyx_L0; } /* "libpetsc4py.pyx":681 * cdef duplicate = PyMat(mat).duplicate * if duplicate is None: return UNSUPPORTED(b"duplicate") * cdef Mat m = duplicate(Mat_(mat), op) # <<<<<<<<<<<<<< * out[0] = m.mat; m.mat = NULL * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_duplicate); __pyx_t_6 = __pyx_v_duplicate; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(0, 681, __pyx_L1_error) __pyx_v_m = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":682 * if duplicate is None: return UNSUPPORTED(b"duplicate") * cdef Mat m = duplicate(Mat_(mat), op) * out[0] = m.mat; m.mat = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_10 = __pyx_v_m->mat; (__pyx_v_out[0]) = __pyx_t_10; __pyx_v_m->mat = NULL; /* "libpetsc4py.pyx":683 * cdef Mat m = duplicate(Mat_(mat), op) * out[0] = m.mat; m.mat = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatCopy_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":672 * return FunctionEnd() * * cdef PetscErrorCode MatDuplicate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatDuplicateOption op, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatDuplicate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_duplicate); __Pyx_XDECREF((PyObject *)__pyx_v_m); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":685 * return FunctionEnd() * * cdef PetscErrorCode MatCopy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat out, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatCopy_Python(Mat __pyx_v_mat, Mat __pyx_v_out, MatStructure __pyx_v_op) { PyObject *__pyx_v_copy = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCopy_Python", 0); /* "libpetsc4py.pyx":691 * ) \ * except IERR with gil: * FunctionBegin(b"MatCopy_Python") # <<<<<<<<<<<<<< * cdef copy = PyMat(mat).copy * if copy is None: return UNSUPPORTED(b"copy") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatCopy_Python")); /* "libpetsc4py.pyx":692 * except IERR with gil: * FunctionBegin(b"MatCopy_Python") * cdef copy = PyMat(mat).copy # <<<<<<<<<<<<<< * if copy is None: return UNSUPPORTED(b"copy") * copy(Mat_(mat), Mat_(out), op) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_copy = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":693 * FunctionBegin(b"MatCopy_Python") * cdef copy = PyMat(mat).copy * if copy is None: return UNSUPPORTED(b"copy") # <<<<<<<<<<<<<< * copy(Mat_(mat), Mat_(out), op) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_copy == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"copy")); goto __pyx_L0; } /* "libpetsc4py.pyx":694 * cdef copy = PyMat(mat).copy * if copy is None: return UNSUPPORTED(b"copy") * copy(Mat_(mat), Mat_(out), op) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_out)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyInt_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_copy); __pyx_t_7 = __pyx_v_copy; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":695 * if copy is None: return UNSUPPORTED(b"copy") * copy(Mat_(mat), Mat_(out), op) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatGetDiagonalBlock_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":685 * return FunctionEnd() * * cdef PetscErrorCode MatCopy_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat out, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatCopy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_copy); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":697 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat *out */ static PetscErrorCode __pyx_f_11libpetsc4py_MatGetDiagonalBlock_Python(Mat __pyx_v_mat, Mat *__pyx_v_out) { PyObject *__pyx_v_getDiagonalBlock = 0; struct PyPetscMatObject *__pyx_v_sub = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; Mat __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatGetDiagonalBlock_Python", 0); /* "libpetsc4py.pyx":702 * ) \ * except IERR with gil: * FunctionBegin(b"MatGetDiagonalBlock_Python") # <<<<<<<<<<<<<< * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatGetDiagonalBlock_Python")); /* "libpetsc4py.pyx":703 * except IERR with gil: * FunctionBegin(b"MatGetDiagonalBlock_Python") * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock # <<<<<<<<<<<<<< * if getDiagonalBlock is None: * if getCommSize(mat) == 1: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getDiagonalBlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_getDiagonalBlock = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":704 * FunctionBegin(b"MatGetDiagonalBlock_Python") * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: # <<<<<<<<<<<<<< * if getCommSize(mat) == 1: * out[0] = mat */ __pyx_t_3 = (__pyx_v_getDiagonalBlock == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":705 * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: * if getCommSize(mat) == 1: # <<<<<<<<<<<<<< * out[0] = mat * return FunctionEnd() */ __pyx_t_4 = ((__pyx_f_11libpetsc4py_getCommSize(__pyx_v_mat) == 1) != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":706 * if getDiagonalBlock is None: * if getCommSize(mat) == 1: * out[0] = mat # <<<<<<<<<<<<<< * return FunctionEnd() * if getDiagonalBlock is None: return UNSUPPORTED(b"getDiagonalBlock") */ (__pyx_v_out[0]) = __pyx_v_mat; /* "libpetsc4py.pyx":707 * if getCommSize(mat) == 1: * out[0] = mat * return FunctionEnd() # <<<<<<<<<<<<<< * if getDiagonalBlock is None: return UNSUPPORTED(b"getDiagonalBlock") * cdef Mat sub = getDiagonalBlock(Mat_(mat)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":705 * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: * if getCommSize(mat) == 1: # <<<<<<<<<<<<<< * out[0] = mat * return FunctionEnd() */ } /* "libpetsc4py.pyx":704 * FunctionBegin(b"MatGetDiagonalBlock_Python") * cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock * if getDiagonalBlock is None: # <<<<<<<<<<<<<< * if getCommSize(mat) == 1: * out[0] = mat */ } /* "libpetsc4py.pyx":708 * out[0] = mat * return FunctionEnd() * if getDiagonalBlock is None: return UNSUPPORTED(b"getDiagonalBlock") # <<<<<<<<<<<<<< * cdef Mat sub = getDiagonalBlock(Mat_(mat)) * if sub is not None: out[0] = sub.mat */ __pyx_t_4 = (__pyx_v_getDiagonalBlock == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"getDiagonalBlock")); goto __pyx_L0; } /* "libpetsc4py.pyx":709 * return FunctionEnd() * if getDiagonalBlock is None: return UNSUPPORTED(b"getDiagonalBlock") * cdef Mat sub = getDiagonalBlock(Mat_(mat)) # <<<<<<<<<<<<<< * if sub is not None: out[0] = sub.mat * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_getDiagonalBlock); __pyx_t_5 = __pyx_v_getDiagonalBlock; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(0, 709, __pyx_L1_error) __pyx_v_sub = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":710 * if getDiagonalBlock is None: return UNSUPPORTED(b"getDiagonalBlock") * cdef Mat sub = getDiagonalBlock(Mat_(mat)) * if sub is not None: out[0] = sub.mat # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_3 = (((PyObject *)__pyx_v_sub) != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_t_7 = __pyx_v_sub->mat; (__pyx_v_out[0]) = __pyx_t_7; } /* "libpetsc4py.pyx":711 * cdef Mat sub = getDiagonalBlock(Mat_(mat)) * if sub is not None: out[0] = sub.mat * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatCreateSubMatrix_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":697 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscMat *out */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.MatGetDiagonalBlock_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_getDiagonalBlock); __Pyx_XDECREF((PyObject *)__pyx_v_sub); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":713 * return FunctionEnd() * * cdef PetscErrorCode MatCreateSubMatrix_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscIS row, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatCreateSubMatrix_Python(Mat __pyx_v_mat, IS __pyx_v_row, IS __pyx_v_col, MatReuse __pyx_v_op, Mat *__pyx_v_out) { PyObject *__pyx_v_createSubMatrix = 0; struct PyPetscMatObject *__pyx_v_sub = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; Mat __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCreateSubMatrix_Python", 0); /* "libpetsc4py.pyx":721 * ) \ * except IERR with gil: * FunctionBegin(b"MatCreateSubMatrix_Python") # <<<<<<<<<<<<<< * cdef createSubMatrix = PyMat(mat).createSubMatrix * if createSubMatrix is None: return UNSUPPORTED(b"createSubMatrix") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatCreateSubMatrix_Python")); /* "libpetsc4py.pyx":722 * except IERR with gil: * FunctionBegin(b"MatCreateSubMatrix_Python") * cdef createSubMatrix = PyMat(mat).createSubMatrix # <<<<<<<<<<<<<< * if createSubMatrix is None: return UNSUPPORTED(b"createSubMatrix") * cdef Mat sub = None */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_createSubMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_createSubMatrix = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":723 * FunctionBegin(b"MatCreateSubMatrix_Python") * cdef createSubMatrix = PyMat(mat).createSubMatrix * if createSubMatrix is None: return UNSUPPORTED(b"createSubMatrix") # <<<<<<<<<<<<<< * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: */ __pyx_t_3 = (__pyx_v_createSubMatrix == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"createSubMatrix")); goto __pyx_L0; } /* "libpetsc4py.pyx":724 * cdef createSubMatrix = PyMat(mat).createSubMatrix * if createSubMatrix is None: return UNSUPPORTED(b"createSubMatrix") * cdef Mat sub = None # <<<<<<<<<<<<<< * if op == MAT_IGNORE_MATRIX: * sub = None */ __Pyx_INCREF(Py_None); __pyx_v_sub = ((struct PyPetscMatObject *)Py_None); /* "libpetsc4py.pyx":725 * if createSubMatrix is None: return UNSUPPORTED(b"createSubMatrix") * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: # <<<<<<<<<<<<<< * sub = None * elif op == MAT_INITIAL_MATRIX: */ switch (__pyx_v_op) { case MAT_IGNORE_MATRIX: /* "libpetsc4py.pyx":726 * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: * sub = None # <<<<<<<<<<<<<< * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)Py_None)); /* "libpetsc4py.pyx":725 * if createSubMatrix is None: return UNSUPPORTED(b"createSubMatrix") * cdef Mat sub = None * if op == MAT_IGNORE_MATRIX: # <<<<<<<<<<<<<< * sub = None * elif op == MAT_INITIAL_MATRIX: */ break; case MAT_INITIAL_MATRIX: /* "libpetsc4py.pyx":728 * sub = None * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) # <<<<<<<<<<<<<< * if sub is not None: * addRef(sub.mat) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_IS_(__pyx_v_row)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_IS_(__pyx_v_col)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_createSubMatrix); __pyx_t_7 = __pyx_v_createSubMatrix; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6, Py_None}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6, Py_None}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_9, Py_None); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "libpetsc4py.pyx":729 * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: # <<<<<<<<<<<<<< * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: */ __pyx_t_4 = (((PyObject *)__pyx_v_sub) != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":730 * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: * addRef(sub.mat) # <<<<<<<<<<<<<< * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) */ __pyx_f_11libpetsc4py_addRef(__pyx_v_sub->mat); /* "libpetsc4py.pyx":729 * elif op == MAT_INITIAL_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: # <<<<<<<<<<<<<< * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: */ } /* "libpetsc4py.pyx":727 * if op == MAT_IGNORE_MATRIX: * sub = None * elif op == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<< * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) * if sub is not None: */ break; case MAT_REUSE_MATRIX: /* "libpetsc4py.pyx":732 * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) # <<<<<<<<<<<<<< * if sub is not None: * out[0] = sub.mat */ __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = ((PyObject *)__pyx_f_11libpetsc4py_IS_(__pyx_v_row)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_IS_(__pyx_v_col)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_((__pyx_v_out[0]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_createSubMatrix); __pyx_t_1 = __pyx_v_createSubMatrix; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_t_7, __pyx_t_10, __pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_t_7, __pyx_t_10, __pyx_t_6, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 4+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_9, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_9, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_9, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_9, __pyx_t_5); __pyx_t_7 = 0; __pyx_t_10 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "libpetsc4py.pyx":731 * if sub is not None: * addRef(sub.mat) * elif op == MAT_REUSE_MATRIX: # <<<<<<<<<<<<<< * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: */ break; default: break; } /* "libpetsc4py.pyx":733 * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: # <<<<<<<<<<<<<< * out[0] = sub.mat * return FunctionEnd() */ __pyx_t_3 = (((PyObject *)__pyx_v_sub) != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":734 * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: * out[0] = sub.mat # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_12 = __pyx_v_sub->mat; (__pyx_v_out[0]) = __pyx_t_12; /* "libpetsc4py.pyx":733 * elif op == MAT_REUSE_MATRIX: * sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) * if sub is not None: # <<<<<<<<<<<<<< * out[0] = sub.mat * return FunctionEnd() */ } /* "libpetsc4py.pyx":735 * if sub is not None: * out[0] = sub.mat * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetOption_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":713 * return FunctionEnd() * * cdef PetscErrorCode MatCreateSubMatrix_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscIS row, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.MatCreateSubMatrix_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_createSubMatrix); __Pyx_XDECREF((PyObject *)__pyx_v_sub); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":737 * return FunctionEnd() * * cdef PetscErrorCode MatSetOption_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatOption op, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetOption_Python(Mat __pyx_v_mat, MatOption __pyx_v_op, PetscBool __pyx_v_flag) { PyObject *__pyx_v_setOption = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetOption_Python", 0); /* "libpetsc4py.pyx":743 * ) \ * except IERR with gil: * FunctionBegin(b"MatSetOption_Python") # <<<<<<<<<<<<<< * cdef setOption = PyMat(mat).setOption * if setOption is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSetOption_Python")); /* "libpetsc4py.pyx":744 * except IERR with gil: * FunctionBegin(b"MatSetOption_Python") * cdef setOption = PyMat(mat).setOption # <<<<<<<<<<<<<< * if setOption is not None: * setOption(Mat_(mat), op, (flag)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setOption); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setOption = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":745 * FunctionBegin(b"MatSetOption_Python") * cdef setOption = PyMat(mat).setOption * if setOption is not None: # <<<<<<<<<<<<<< * setOption(Mat_(mat), op, (flag)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_setOption != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":746 * cdef setOption = PyMat(mat).setOption * if setOption is not None: * setOption(Mat_(mat), op, (flag)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBool_FromLong((((int)__pyx_v_flag) != 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_setOption); __pyx_t_7 = __pyx_v_setOption; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":745 * FunctionBegin(b"MatSetOption_Python") * cdef setOption = PyMat(mat).setOption * if setOption is not None: # <<<<<<<<<<<<<< * setOption(Mat_(mat), op, (flag)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":747 * if setOption is not None: * setOption(Mat_(mat), op, (flag)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetUp_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":737 * return FunctionEnd() * * cdef PetscErrorCode MatSetOption_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatOption op, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatSetOption_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setOption); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":749 * return FunctionEnd() * * cdef PetscErrorCode MatSetUp_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetUp_Python(Mat __pyx_v_mat) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetUp_Python", 0); /* "libpetsc4py.pyx":753 * ) \ * except IERR with gil: * FunctionBegin(b"MatSetUp_Python") # <<<<<<<<<<<<<< * cdef PetscInt rbs = -1, cbs = -1 * CHKERR( PetscLayoutGetBlockSize(mat.rmap,&rbs) ) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSetUp_Python")); /* "libpetsc4py.pyx":754 * except IERR with gil: * FunctionBegin(b"MatSetUp_Python") * cdef PetscInt rbs = -1, cbs = -1 # <<<<<<<<<<<<<< * CHKERR( PetscLayoutGetBlockSize(mat.rmap,&rbs) ) * CHKERR( PetscLayoutGetBlockSize(mat.cmap,&cbs) ) */ __pyx_v_rbs = -1L; __pyx_v_cbs = -1L; /* "libpetsc4py.pyx":755 * FunctionBegin(b"MatSetUp_Python") * cdef PetscInt rbs = -1, cbs = -1 * CHKERR( PetscLayoutGetBlockSize(mat.rmap,&rbs) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutGetBlockSize(mat.cmap,&cbs) ) * if rbs == -1: rbs = 1 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscLayoutGetBlockSize(__pyx_v_mat->rmap, (&__pyx_v_rbs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 755, __pyx_L1_error) /* "libpetsc4py.pyx":756 * cdef PetscInt rbs = -1, cbs = -1 * CHKERR( PetscLayoutGetBlockSize(mat.rmap,&rbs) ) * CHKERR( PetscLayoutGetBlockSize(mat.cmap,&cbs) ) # <<<<<<<<<<<<<< * if rbs == -1: rbs = 1 * if cbs == -1: cbs = rbs */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscLayoutGetBlockSize(__pyx_v_mat->cmap, (&__pyx_v_cbs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 756, __pyx_L1_error) /* "libpetsc4py.pyx":757 * CHKERR( PetscLayoutGetBlockSize(mat.rmap,&rbs) ) * CHKERR( PetscLayoutGetBlockSize(mat.cmap,&cbs) ) * if rbs == -1: rbs = 1 # <<<<<<<<<<<<<< * if cbs == -1: cbs = rbs * CHKERR( PetscLayoutSetBlockSize(mat.rmap,rbs) ) */ __pyx_t_2 = ((__pyx_v_rbs == -1L) != 0); if (__pyx_t_2) { __pyx_v_rbs = 1; } /* "libpetsc4py.pyx":758 * CHKERR( PetscLayoutGetBlockSize(mat.cmap,&cbs) ) * if rbs == -1: rbs = 1 * if cbs == -1: cbs = rbs # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetBlockSize(mat.rmap,rbs) ) * CHKERR( PetscLayoutSetBlockSize(mat.cmap,cbs) ) */ __pyx_t_2 = ((__pyx_v_cbs == -1L) != 0); if (__pyx_t_2) { __pyx_v_cbs = __pyx_v_rbs; } /* "libpetsc4py.pyx":759 * if rbs == -1: rbs = 1 * if cbs == -1: cbs = rbs * CHKERR( PetscLayoutSetBlockSize(mat.rmap,rbs) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetBlockSize(mat.cmap,cbs) ) * CHKERR( PetscLayoutSetUp(mat.rmap) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscLayoutSetBlockSize(__pyx_v_mat->rmap, __pyx_v_rbs)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 759, __pyx_L1_error) /* "libpetsc4py.pyx":760 * if cbs == -1: cbs = rbs * CHKERR( PetscLayoutSetBlockSize(mat.rmap,rbs) ) * CHKERR( PetscLayoutSetBlockSize(mat.cmap,cbs) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetUp(mat.rmap) ) * CHKERR( PetscLayoutSetUp(mat.cmap) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscLayoutSetBlockSize(__pyx_v_mat->cmap, __pyx_v_cbs)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 760, __pyx_L1_error) /* "libpetsc4py.pyx":761 * CHKERR( PetscLayoutSetBlockSize(mat.rmap,rbs) ) * CHKERR( PetscLayoutSetBlockSize(mat.cmap,cbs) ) * CHKERR( PetscLayoutSetUp(mat.rmap) ) # <<<<<<<<<<<<<< * CHKERR( PetscLayoutSetUp(mat.cmap) ) * mat.preallocated = PETSC_TRUE */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscLayoutSetUp(__pyx_v_mat->rmap)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 761, __pyx_L1_error) /* "libpetsc4py.pyx":762 * CHKERR( PetscLayoutSetBlockSize(mat.cmap,cbs) ) * CHKERR( PetscLayoutSetUp(mat.rmap) ) * CHKERR( PetscLayoutSetUp(mat.cmap) ) # <<<<<<<<<<<<<< * mat.preallocated = PETSC_TRUE * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscLayoutSetUp(__pyx_v_mat->cmap)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 762, __pyx_L1_error) /* "libpetsc4py.pyx":763 * CHKERR( PetscLayoutSetUp(mat.rmap) ) * CHKERR( PetscLayoutSetUp(mat.cmap) ) * mat.preallocated = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_v_mat->preallocated = PETSC_TRUE; /* "libpetsc4py.pyx":766 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyMat(mat).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":767 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(mat), b"-mat_python_type", */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = (((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_t_3)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":768 * cdef PetscBool found = PETSC_FALSE * if PyMat(mat).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(mat), b"-mat_python_type", * name,sizeof(name),&found) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsGetString(NULL, __pyx_f_11libpetsc4py_getPrefix(__pyx_v_mat), ((char *)"-mat_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 768, __pyx_L1_error) /* "libpetsc4py.pyx":771 * getPrefix(mat), b"-mat_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * if PyMat(mat).self is None: */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L7_bool_binop_done; } __pyx_t_2 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_2; __pyx_L7_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":772 * name,sizeof(name),&found) ) * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat,name) ) # <<<<<<<<<<<<<< * if PyMat(mat).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_5 = __pyx_f_11libpetsc4py_MatPythonSetType_PYTHON(__pyx_v_mat, __pyx_v_name); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 772, __pyx_L1_error) __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 772, __pyx_L1_error) /* "libpetsc4py.pyx":771 * getPrefix(mat), b"-mat_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * if PyMat(mat).self is None: */ } /* "libpetsc4py.pyx":767 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(mat), b"-mat_python_type", */ } /* "libpetsc4py.pyx":773 * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = (((struct __pyx_obj_11libpetsc4py__PyMat *)__pyx_t_3)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":774 * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * if PyMat(mat).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * MatPythonSetType(mat,\"[package.]module.class\")\n" */ __pyx_r = __pyx_f_11libpetsc4py_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * MatPythonSetType(mat,\"[package.]module.class\")\n * MatSetFromOptions(mat) and pass option -mat_python_type [package.]module.class")); goto __pyx_L0; /* "libpetsc4py.pyx":773 * if found and name[0]: * CHKERR( MatPythonSetType_PYTHON(mat,name) ) * if PyMat(mat).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "libpetsc4py.pyx":780 * "-mat_python_type [package.]module.class") * # * cdef setUp = PyMat(mat).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(Mat_(mat)) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":781 * # * cdef setUp = PyMat(mat).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(Mat_(mat)) * return FunctionEnd() */ __pyx_t_2 = (__pyx_v_setUp != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":782 * cdef setUp = PyMat(mat).setUp * if setUp is not None: * setUp(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":781 * # * cdef setUp = PyMat(mat).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(Mat_(mat)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":783 * if setUp is not None: * setUp(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatAssemblyBegin_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":749 * return FunctionEnd() * * cdef PetscErrorCode MatSetUp_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.MatSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":785 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyBegin_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatAssemblyType at, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatAssemblyBegin_Python(Mat __pyx_v_mat, MatAssemblyType __pyx_v_at) { PyObject *__pyx_v_assembly = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatAssemblyBegin_Python", 0); /* "libpetsc4py.pyx":790 * ) \ * except IERR with gil: * FunctionBegin(b"MatAssemblyBegin_Python") # <<<<<<<<<<<<<< * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatAssemblyBegin_Python")); /* "libpetsc4py.pyx":791 * except IERR with gil: * FunctionBegin(b"MatAssemblyBegin_Python") * cdef assembly = PyMat(mat).assemblyBegin # <<<<<<<<<<<<<< * if assembly is not None: * assembly(Mat_(mat), at) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_assemblyBegin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_assembly = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":792 * FunctionBegin(b"MatAssemblyBegin_Python") * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_assembly != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":793 * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: * assembly(Mat_(mat), at) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_long(((long)__pyx_v_at)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_assembly); __pyx_t_6 = __pyx_v_assembly; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":792 * FunctionBegin(b"MatAssemblyBegin_Python") * cdef assembly = PyMat(mat).assemblyBegin * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ } /* "libpetsc4py.pyx":794 * if assembly is not None: * assembly(Mat_(mat), at) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatAssemblyEnd_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":785 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyBegin_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatAssemblyType at, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatAssemblyBegin_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_assembly); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":796 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyEnd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatAssemblyType at, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatAssemblyEnd_Python(Mat __pyx_v_mat, MatAssemblyType __pyx_v_at) { PyObject *__pyx_v_assembly = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatAssemblyEnd_Python", 0); /* "libpetsc4py.pyx":801 * ) \ * except IERR with gil: * FunctionBegin(b"MatAssemblyEnd_Python") # <<<<<<<<<<<<<< * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatAssemblyEnd_Python")); /* "libpetsc4py.pyx":802 * except IERR with gil: * FunctionBegin(b"MatAssemblyEnd_Python") * cdef assembly = PyMat(mat).assemblyEnd # <<<<<<<<<<<<<< * if assembly is None: * assembly = PyMat(mat).assembly */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_assemblyEnd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_assembly = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":803 * FunctionBegin(b"MatAssemblyEnd_Python") * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: # <<<<<<<<<<<<<< * assembly = PyMat(mat).assembly * if assembly is not None: */ __pyx_t_3 = (__pyx_v_assembly == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":804 * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: * assembly = PyMat(mat).assembly # <<<<<<<<<<<<<< * if assembly is not None: * assembly(Mat_(mat), at) */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_assembly); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_assembly, __pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":803 * FunctionBegin(b"MatAssemblyEnd_Python") * cdef assembly = PyMat(mat).assemblyEnd * if assembly is None: # <<<<<<<<<<<<<< * assembly = PyMat(mat).assembly * if assembly is not None: */ } /* "libpetsc4py.pyx":805 * if assembly is None: * assembly = PyMat(mat).assembly * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_assembly != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":806 * assembly = PyMat(mat).assembly * if assembly is not None: * assembly(Mat_(mat), at) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyInt_From_int(((int)__pyx_v_at)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_assembly); __pyx_t_6 = __pyx_v_assembly; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":805 * if assembly is None: * assembly = PyMat(mat).assembly * if assembly is not None: # <<<<<<<<<<<<<< * assembly(Mat_(mat), at) * return FunctionEnd() */ } /* "libpetsc4py.pyx":807 * if assembly is not None: * assembly(Mat_(mat), at) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatZeroEntries_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":796 * return FunctionEnd() * * cdef PetscErrorCode MatAssemblyEnd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * MatAssemblyType at, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatAssemblyEnd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_assembly); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":809 * return FunctionEnd() * * cdef PetscErrorCode MatZeroEntries_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_MatZeroEntries_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_zeroEntries = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatZeroEntries_Python", 0); /* "libpetsc4py.pyx":813 * ) \ * except IERR with gil: * FunctionBegin(b"MatZeroEntries_Python") # <<<<<<<<<<<<<< * cdef zeroEntries = PyMat(mat).zeroEntries * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatZeroEntries_Python")); /* "libpetsc4py.pyx":814 * except IERR with gil: * FunctionBegin(b"MatZeroEntries_Python") * cdef zeroEntries = PyMat(mat).zeroEntries # <<<<<<<<<<<<<< * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") * zeroEntries(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeroEntries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_zeroEntries = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":815 * FunctionBegin(b"MatZeroEntries_Python") * cdef zeroEntries = PyMat(mat).zeroEntries * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") # <<<<<<<<<<<<<< * zeroEntries(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_zeroEntries == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"zeroEntries")); goto __pyx_L0; } /* "libpetsc4py.pyx":816 * cdef zeroEntries = PyMat(mat).zeroEntries * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") * zeroEntries(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_zeroEntries); __pyx_t_5 = __pyx_v_zeroEntries; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":817 * if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") * zeroEntries(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatZeroRowsColumns_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":809 * return FunctionEnd() * * cdef PetscErrorCode MatZeroEntries_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.MatZeroEntries_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_zeroEntries); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":819 * return FunctionEnd() * * cdef PetscErrorCode MatZeroRowsColumns_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscInt numRows, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatZeroRowsColumns_Python(Mat __pyx_v_mat, PetscInt __pyx_v_numRows, PetscInt const *__pyx_v_rows, PetscScalar __pyx_v_diag, Vec __pyx_v_x, Vec __pyx_v_b) { PyObject *__pyx_v_zeroRowsColumns = 0; PyArrayObject *__pyx_v_pyrows = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatZeroRowsColumns_Python", 0); /* "libpetsc4py.pyx":828 * ) \ * except IERR with gil: * FunctionBegin(b"MatZeroRowsColumns_Python") # <<<<<<<<<<<<<< * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatZeroRowsColumns_Python")); /* "libpetsc4py.pyx":829 * except IERR with gil: * FunctionBegin(b"MatZeroRowsColumns_Python") * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns # <<<<<<<<<<<<<< * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") * cdef ndarray pyrows = array_i(numRows, rows) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeroRowsColumns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_zeroRowsColumns = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":830 * FunctionBegin(b"MatZeroRowsColumns_Python") * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") # <<<<<<<<<<<<<< * cdef ndarray pyrows = array_i(numRows, rows) * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) */ __pyx_t_3 = (__pyx_v_zeroRowsColumns == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"zeroRowsColumns")); goto __pyx_L0; } /* "libpetsc4py.pyx":831 * cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") * cdef ndarray pyrows = array_i(numRows, rows) # <<<<<<<<<<<<<< * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) * return FunctionEnd() */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_array_i(__pyx_v_numRows, __pyx_v_rows)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pyrows = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":832 * if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") * cdef ndarray pyrows = array_i(numRows, rows) * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyPetscScalar_FromPetscScalar(__pyx_v_diag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_zeroRowsColumns); __pyx_t_8 = __pyx_v_zeroRowsColumns; __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_1, ((PyObject *)__pyx_v_pyrows), __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_t_1, ((PyObject *)__pyx_v_pyrows), __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 5+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_11 = PyTuple_New(5+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_pyrows)); __Pyx_GIVEREF(((PyObject *)__pyx_v_pyrows)); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, ((PyObject *)__pyx_v_pyrows)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_10, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":833 * cdef ndarray pyrows = array_i(numRows, rows) * zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatScale_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":819 * return FunctionEnd() * * cdef PetscErrorCode MatZeroRowsColumns_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscInt numRows, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.MatZeroRowsColumns_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_zeroRowsColumns); __Pyx_XDECREF((PyObject *)__pyx_v_pyrows); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":835 * return FunctionEnd() * * cdef PetscErrorCode MatScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatScale_Python(Mat __pyx_v_mat, PetscScalar __pyx_v_s) { PyObject *__pyx_v_scale = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatScale_Python", 0); /* "libpetsc4py.pyx":840 * ) \ * except IERR with gil: * FunctionBegin(b"MatScale_Python") # <<<<<<<<<<<<<< * cdef scale = PyMat(mat).scale * if scale is None: return UNSUPPORTED(b"scale") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatScale_Python")); /* "libpetsc4py.pyx":841 * except IERR with gil: * FunctionBegin(b"MatScale_Python") * cdef scale = PyMat(mat).scale # <<<<<<<<<<<<<< * if scale is None: return UNSUPPORTED(b"scale") * scale(Mat_(mat), toScalar(s)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_scale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_scale = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":842 * FunctionBegin(b"MatScale_Python") * cdef scale = PyMat(mat).scale * if scale is None: return UNSUPPORTED(b"scale") # <<<<<<<<<<<<<< * scale(Mat_(mat), toScalar(s)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_scale == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"scale")); goto __pyx_L0; } /* "libpetsc4py.pyx":843 * cdef scale = PyMat(mat).scale * if scale is None: return UNSUPPORTED(b"scale") * scale(Mat_(mat), toScalar(s)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyPetscScalar_FromPetscScalar(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_scale); __pyx_t_6 = __pyx_v_scale; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":844 * if scale is None: return UNSUPPORTED(b"scale") * scale(Mat_(mat), toScalar(s)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatShift_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":835 * return FunctionEnd() * * cdef PetscErrorCode MatScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatScale_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_scale); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":846 * return FunctionEnd() * * cdef PetscErrorCode MatShift_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatShift_Python(Mat __pyx_v_mat, PetscScalar __pyx_v_s) { PyObject *__pyx_v_shift = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatShift_Python", 0); /* "libpetsc4py.pyx":851 * ) \ * except IERR with gil: * FunctionBegin(b"MatShift_Python") # <<<<<<<<<<<<<< * cdef shift = PyMat(mat).shift * if shift is None: return UNSUPPORTED(b"shift") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatShift_Python")); /* "libpetsc4py.pyx":852 * except IERR with gil: * FunctionBegin(b"MatShift_Python") * cdef shift = PyMat(mat).shift # <<<<<<<<<<<<<< * if shift is None: return UNSUPPORTED(b"shift") * shift(Mat_(mat), toScalar(s)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shift); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_shift = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":853 * FunctionBegin(b"MatShift_Python") * cdef shift = PyMat(mat).shift * if shift is None: return UNSUPPORTED(b"shift") # <<<<<<<<<<<<<< * shift(Mat_(mat), toScalar(s)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_shift == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"shift")); goto __pyx_L0; } /* "libpetsc4py.pyx":854 * cdef shift = PyMat(mat).shift * if shift is None: return UNSUPPORTED(b"shift") * shift(Mat_(mat), toScalar(s)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyPetscScalar_FromPetscScalar(__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shift); __pyx_t_6 = __pyx_v_shift; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":855 * if shift is None: return UNSUPPORTED(b"shift") * shift(Mat_(mat), toScalar(s)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatCreateVecs_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":846 * return FunctionEnd() * * cdef PetscErrorCode MatShift_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscScalar s, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatShift_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_shift); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":857 * return FunctionEnd() * * cdef PetscErrorCode MatCreateVecs_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec *x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatCreateVecs_Python(Mat __pyx_v_mat, Vec *__pyx_v_x, Vec *__pyx_v_y) { PyObject *__pyx_v_createVecs = 0; struct PyPetscVecObject *__pyx_v_u = 0; struct PyPetscVecObject *__pyx_v_v = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *(*__pyx_t_16)(PyObject *); Vec __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatCreateVecs_Python", 0); /* "libpetsc4py.pyx":863 * ) \ * except IERR with gil: * FunctionBegin(b"MatCreateVecs_Python") # <<<<<<<<<<<<<< * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatCreateVecs_Python")); /* "libpetsc4py.pyx":864 * except IERR with gil: * FunctionBegin(b"MatCreateVecs_Python") * cdef createVecs = PyMat(mat).createVecs # <<<<<<<<<<<<<< * if createVecs is None: * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_createVecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_createVecs = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":865 * FunctionBegin(b"MatCreateVecs_Python") * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: # <<<<<<<<<<<<<< * try: * mat.ops.getvecs = NULL */ __pyx_t_3 = (__pyx_v_createVecs == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":866 * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: * try: # <<<<<<<<<<<<<< * mat.ops.getvecs = NULL * CHKERR( MatCreateVecs(mat,x,y) ) */ /*try:*/ { /* "libpetsc4py.pyx":867 * if createVecs is None: * try: * mat.ops.getvecs = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(mat,x,y) ) * finally: */ __pyx_v_mat->ops->getvecs = NULL; /* "libpetsc4py.pyx":868 * try: * mat.ops.getvecs = NULL * CHKERR( MatCreateVecs(mat,x,y) ) # <<<<<<<<<<<<<< * finally: * mat.ops.getvecs = MatCreateVecs_Python */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatCreateVecs(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 868, __pyx_L5_error) } /* "libpetsc4py.pyx":870 * CHKERR( MatCreateVecs(mat,x,y) ) * finally: * mat.ops.getvecs = MatCreateVecs_Python # <<<<<<<<<<<<<< * return FunctionEnd() * if createVecs is None: return UNSUPPORTED(b"createVecs") */ /*finally:*/ { /*normal exit:*/{ __pyx_v_mat->ops->getvecs = __pyx_f_11libpetsc4py_MatCreateVecs_Python; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_v_mat->ops->getvecs = __pyx_f_11libpetsc4py_MatCreateVecs_Python; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; } __pyx_L6:; } /* "libpetsc4py.pyx":871 * finally: * mat.ops.getvecs = MatCreateVecs_Python * return FunctionEnd() # <<<<<<<<<<<<<< * if createVecs is None: return UNSUPPORTED(b"createVecs") * cdef Vec u, v */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":865 * FunctionBegin(b"MatCreateVecs_Python") * cdef createVecs = PyMat(mat).createVecs * if createVecs is None: # <<<<<<<<<<<<<< * try: * mat.ops.getvecs = NULL */ } /* "libpetsc4py.pyx":872 * mat.ops.getvecs = MatCreateVecs_Python * return FunctionEnd() * if createVecs is None: return UNSUPPORTED(b"createVecs") # <<<<<<<<<<<<<< * cdef Vec u, v * u, v = createVecs(Mat_(mat)) */ __pyx_t_4 = (__pyx_v_createVecs == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"createVecs")); goto __pyx_L0; } /* "libpetsc4py.pyx":874 * if createVecs is None: return UNSUPPORTED(b"createVecs") * cdef Vec u, v * u, v = createVecs(Mat_(mat)) # <<<<<<<<<<<<<< * if x != NULL: * x[0] = u.vec */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_createVecs); __pyx_t_14 = __pyx_v_createVecs; __pyx_t_15 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); } } __pyx_t_2 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_1); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 874, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_14 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext; index = 0; __pyx_t_14 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_14)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_14); index = 1; __pyx_t_1 = __pyx_t_16(__pyx_t_15); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 2) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __pyx_t_16 = NULL; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_16 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 874, __pyx_L1_error) __pyx_L11_unpacking_done:; } if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(0, 874, __pyx_L1_error) if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(0, 874, __pyx_L1_error) __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_14); __pyx_t_14 = 0; __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":875 * cdef Vec u, v * u, v = createVecs(Mat_(mat)) * if x != NULL: # <<<<<<<<<<<<<< * x[0] = u.vec * u.vec = NULL */ __pyx_t_3 = ((__pyx_v_x != NULL) != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":876 * u, v = createVecs(Mat_(mat)) * if x != NULL: * x[0] = u.vec # <<<<<<<<<<<<<< * u.vec = NULL * if y != NULL: */ __pyx_t_17 = __pyx_v_u->vec; (__pyx_v_x[0]) = __pyx_t_17; /* "libpetsc4py.pyx":877 * if x != NULL: * x[0] = u.vec * u.vec = NULL # <<<<<<<<<<<<<< * if y != NULL: * y[0] = v.vec */ __pyx_v_u->vec = NULL; /* "libpetsc4py.pyx":875 * cdef Vec u, v * u, v = createVecs(Mat_(mat)) * if x != NULL: # <<<<<<<<<<<<<< * x[0] = u.vec * u.vec = NULL */ } /* "libpetsc4py.pyx":878 * x[0] = u.vec * u.vec = NULL * if y != NULL: # <<<<<<<<<<<<<< * y[0] = v.vec * v.vec = NULL */ __pyx_t_3 = ((__pyx_v_y != NULL) != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":879 * u.vec = NULL * if y != NULL: * y[0] = v.vec # <<<<<<<<<<<<<< * v.vec = NULL * return FunctionEnd() */ __pyx_t_17 = __pyx_v_v->vec; (__pyx_v_y[0]) = __pyx_t_17; /* "libpetsc4py.pyx":880 * if y != NULL: * y[0] = v.vec * v.vec = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_v->vec = NULL; /* "libpetsc4py.pyx":878 * x[0] = u.vec * u.vec = NULL * if y != NULL: # <<<<<<<<<<<<<< * y[0] = v.vec * v.vec = NULL */ } /* "libpetsc4py.pyx":881 * y[0] = v.vec * v.vec = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMult_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":857 * return FunctionEnd() * * cdef PetscErrorCode MatCreateVecs_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec *x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("libpetsc4py.MatCreateVecs_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_createVecs); __Pyx_XDECREF((PyObject *)__pyx_v_u); __Pyx_XDECREF((PyObject *)__pyx_v_v); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":883 * return FunctionEnd() * * cdef PetscErrorCode MatMult_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMult_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_mult = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMult_Python", 0); /* "libpetsc4py.pyx":889 * ) \ * except IERR with gil: * FunctionBegin(b"MatMult_Python") # <<<<<<<<<<<<<< * cdef mult = PyMat(mat).mult * if mult is None: return UNSUPPORTED(b"mult") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMult_Python")); /* "libpetsc4py.pyx":890 * except IERR with gil: * FunctionBegin(b"MatMult_Python") * cdef mult = PyMat(mat).mult # <<<<<<<<<<<<<< * if mult is None: return UNSUPPORTED(b"mult") * mult(Mat_(mat), Vec_(x), Vec_(y)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mult); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mult = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":891 * FunctionBegin(b"MatMult_Python") * cdef mult = PyMat(mat).mult * if mult is None: return UNSUPPORTED(b"mult") # <<<<<<<<<<<<<< * mult(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_mult == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"mult")); goto __pyx_L0; } /* "libpetsc4py.pyx":892 * cdef mult = PyMat(mat).mult * if mult is None: return UNSUPPORTED(b"mult") * mult(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_mult); __pyx_t_7 = __pyx_v_mult; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":893 * if mult is None: return UNSUPPORTED(b"mult") * mult(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultTranspose_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":883 * return FunctionEnd() * * cdef PetscErrorCode MatMult_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatMult_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mult); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":895 * return FunctionEnd() * * cdef PetscErrorCode MatMultTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultTranspose_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_multTranspose = 0; PetscBool __pyx_v_symmset; PetscBool __pyx_v_symmknown; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultTranspose_Python", 0); /* "libpetsc4py.pyx":901 * ) \ * except IERR with gil: * FunctionBegin(b"MatMultTranspose_Python") # <<<<<<<<<<<<<< * cdef multTranspose = PyMat(mat).multTranspose * cdef PetscBool symmset, symmknown */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMultTranspose_Python")); /* "libpetsc4py.pyx":902 * except IERR with gil: * FunctionBegin(b"MatMultTranspose_Python") * cdef multTranspose = PyMat(mat).multTranspose # <<<<<<<<<<<<<< * cdef PetscBool symmset, symmknown * if multTranspose is None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multTranspose = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":904 * cdef multTranspose = PyMat(mat).multTranspose * cdef PetscBool symmset, symmknown * if multTranspose is None: # <<<<<<<<<<<<<< * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) */ __pyx_t_3 = (__pyx_v_multTranspose == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":905 * cdef PetscBool symmset, symmknown * if multTranspose is None: * symmset = symmknown = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: */ __pyx_v_symmset = PETSC_FALSE; __pyx_v_symmknown = PETSC_FALSE; /* "libpetsc4py.pyx":906 * if multTranspose is None: * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) # <<<<<<<<<<<<<< * if symmset and symmknown: * CHKERR( MatMult(mat,x,y) ) */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatIsSymmetricKnown(__pyx_v_mat, (&__pyx_v_symmset), (&__pyx_v_symmknown))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 906, __pyx_L1_error) /* "libpetsc4py.pyx":907 * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: # <<<<<<<<<<<<<< * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() */ if (__pyx_v_symmset) { } else { __pyx_t_4 = __pyx_v_symmset; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = __pyx_v_symmknown; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":908 * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: * CHKERR( MatMult(mat,x,y) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if multTranspose is None: return UNSUPPORTED(b"multTranspose") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatMult(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 908, __pyx_L1_error) /* "libpetsc4py.pyx":909 * if symmset and symmknown: * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if multTranspose is None: return UNSUPPORTED(b"multTranspose") * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":907 * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: # <<<<<<<<<<<<<< * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() */ } /* "libpetsc4py.pyx":904 * cdef multTranspose = PyMat(mat).multTranspose * cdef PetscBool symmset, symmknown * if multTranspose is None: # <<<<<<<<<<<<<< * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) */ } /* "libpetsc4py.pyx":910 * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() * if multTranspose is None: return UNSUPPORTED(b"multTranspose") # <<<<<<<<<<<<<< * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_multTranspose == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"multTranspose")); goto __pyx_L0; } /* "libpetsc4py.pyx":911 * return FunctionEnd() * if multTranspose is None: return UNSUPPORTED(b"multTranspose") * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_multTranspose); __pyx_t_8 = __pyx_v_multTranspose; __pyx_t_9 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_1, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_1, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":912 * if multTranspose is None: return UNSUPPORTED(b"multTranspose") * multTranspose(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultHermitian_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":895 * return FunctionEnd() * * cdef PetscErrorCode MatMultTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatMultTranspose_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multTranspose); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":914 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitian_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultHermitian_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_multHermitian = 0; PetscBool __pyx_v_hermset; PetscBool __pyx_v_hermknown; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultHermitian_Python", 0); /* "libpetsc4py.pyx":920 * ) \ * except IERR with gil: * FunctionBegin(b"MatMultHermitian_Python") # <<<<<<<<<<<<<< * cdef multHermitian = PyMat(mat).multHermitian * cdef PetscBool hermset, hermknown */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMultHermitian_Python")); /* "libpetsc4py.pyx":921 * except IERR with gil: * FunctionBegin(b"MatMultHermitian_Python") * cdef multHermitian = PyMat(mat).multHermitian # <<<<<<<<<<<<<< * cdef PetscBool hermset, hermknown * if multHermitian is None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multHermitian); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multHermitian = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":923 * cdef multHermitian = PyMat(mat).multHermitian * cdef PetscBool hermset, hermknown * if multHermitian is None: # <<<<<<<<<<<<<< * hermset = hermknown = PETSC_FALSE * CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) */ __pyx_t_3 = (__pyx_v_multHermitian == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":924 * cdef PetscBool hermset, hermknown * if multHermitian is None: * hermset = hermknown = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) * if hermset and hermknown: */ __pyx_v_hermset = PETSC_FALSE; __pyx_v_hermknown = PETSC_FALSE; /* "libpetsc4py.pyx":925 * if multHermitian is None: * hermset = hermknown = PETSC_FALSE * CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) # <<<<<<<<<<<<<< * if hermset and hermknown: * CHKERR( MatMult(mat,x,y) ) */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatIsHermitianKnown(__pyx_v_mat, (&__pyx_v_hermset), (&__pyx_v_hermknown))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 925, __pyx_L1_error) /* "libpetsc4py.pyx":926 * hermset = hermknown = PETSC_FALSE * CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) * if hermset and hermknown: # <<<<<<<<<<<<<< * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() */ if (__pyx_v_hermset) { } else { __pyx_t_4 = __pyx_v_hermset; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = __pyx_v_hermknown; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":927 * CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) * if hermset and hermknown: * CHKERR( MatMult(mat,x,y) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if multHermitian is None: return UNSUPPORTED(b"multHermitian") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatMult(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 927, __pyx_L1_error) /* "libpetsc4py.pyx":928 * if hermset and hermknown: * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if multHermitian is None: return UNSUPPORTED(b"multHermitian") * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":926 * hermset = hermknown = PETSC_FALSE * CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) * if hermset and hermknown: # <<<<<<<<<<<<<< * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() */ } /* "libpetsc4py.pyx":923 * cdef multHermitian = PyMat(mat).multHermitian * cdef PetscBool hermset, hermknown * if multHermitian is None: # <<<<<<<<<<<<<< * hermset = hermknown = PETSC_FALSE * CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) */ } /* "libpetsc4py.pyx":929 * CHKERR( MatMult(mat,x,y) ) * return FunctionEnd() * if multHermitian is None: return UNSUPPORTED(b"multHermitian") # <<<<<<<<<<<<<< * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_multHermitian == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"multHermitian")); goto __pyx_L0; } /* "libpetsc4py.pyx":930 * return FunctionEnd() * if multHermitian is None: return UNSUPPORTED(b"multHermitian") * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_multHermitian); __pyx_t_8 = __pyx_v_multHermitian; __pyx_t_9 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_1, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_1, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":931 * if multHermitian is None: return UNSUPPORTED(b"multHermitian") * multHermitian(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultAdd_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":914 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitian_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatMultHermitian_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multHermitian); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":933 * return FunctionEnd() * * cdef PetscErrorCode MatMultAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_v, Vec __pyx_v_y) { PyObject *__pyx_v_multAdd = 0; Vec __pyx_v_t; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultAdd_Python", 0); /* "libpetsc4py.pyx":940 * ) \ * except IERR with gil: * FunctionBegin(b"MatMultAdd_Python") # <<<<<<<<<<<<<< * cdef multAdd = PyMat(mat).multAdd * cdef PetscVec t = NULL */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMultAdd_Python")); /* "libpetsc4py.pyx":941 * except IERR with gil: * FunctionBegin(b"MatMultAdd_Python") * cdef multAdd = PyMat(mat).multAdd # <<<<<<<<<<<<<< * cdef PetscVec t = NULL * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multAdd = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":942 * FunctionBegin(b"MatMultAdd_Python") * cdef multAdd = PyMat(mat).multAdd * cdef PetscVec t = NULL # <<<<<<<<<<<<<< * * if multAdd is None: */ __pyx_v_t = NULL; /* "libpetsc4py.pyx":944 * cdef PetscVec t = NULL * * if multAdd is None: # <<<<<<<<<<<<<< * if v == y: * CHKERR( VecDuplicate(y, &t) ) */ __pyx_t_3 = (__pyx_v_multAdd == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":945 * * if multAdd is None: * if v == y: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat,x,t) ) */ __pyx_t_4 = ((__pyx_v_v == __pyx_v_y) != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":946 * if multAdd is None: * if v == y: * CHKERR( VecDuplicate(y, &t) ) # <<<<<<<<<<<<<< * CHKERR( MatMult(mat,x,t) ) * CHKERR( VecAXPY(y,1.0,t) ) */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecDuplicate(__pyx_v_y, (&__pyx_v_t))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 946, __pyx_L1_error) /* "libpetsc4py.pyx":947 * if v == y: * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat,x,t) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y,1.0,t) ) * CHKERR( VecDestroy(&t) ) */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatMult(__pyx_v_mat, __pyx_v_x, __pyx_v_t)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 947, __pyx_L1_error) /* "libpetsc4py.pyx":948 * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat,x,t) ) * CHKERR( VecAXPY(y,1.0,t) ) # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&t) ) * else: */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_t)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 948, __pyx_L1_error) /* "libpetsc4py.pyx":949 * CHKERR( MatMult(mat,x,t) ) * CHKERR( VecAXPY(y,1.0,t) ) * CHKERR( VecDestroy(&t) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatMult(mat,x,y) ) */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 949, __pyx_L1_error) /* "libpetsc4py.pyx":945 * * if multAdd is None: * if v == y: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(y, &t) ) * CHKERR( MatMult(mat,x,t) ) */ goto __pyx_L4; } /* "libpetsc4py.pyx":951 * CHKERR( VecDestroy(&t) ) * else: * CHKERR( MatMult(mat,x,y) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() */ /*else*/ { __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatMult(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 951, __pyx_L1_error) /* "libpetsc4py.pyx":952 * else: * CHKERR( MatMult(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if multAdd is None: return UNSUPPORTED(b"multAdd") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_v)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 952, __pyx_L1_error) } __pyx_L4:; /* "libpetsc4py.pyx":953 * CHKERR( MatMult(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if multAdd is None: return UNSUPPORTED(b"multAdd") * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":944 * cdef PetscVec t = NULL * * if multAdd is None: # <<<<<<<<<<<<<< * if v == y: * CHKERR( VecDuplicate(y, &t) ) */ } /* "libpetsc4py.pyx":954 * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() * if multAdd is None: return UNSUPPORTED(b"multAdd") # <<<<<<<<<<<<<< * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_multAdd == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"multAdd")); goto __pyx_L0; } /* "libpetsc4py.pyx":955 * return FunctionEnd() * if multAdd is None: return UNSUPPORTED(b"multAdd") * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_multAdd); __pyx_t_9 = __pyx_v_multAdd; __pyx_t_10 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_5, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":956 * if multAdd is None: return UNSUPPORTED(b"multAdd") * multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultTransposeAdd_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":933 * return FunctionEnd() * * cdef PetscErrorCode MatMultAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.MatMultAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":958 * return FunctionEnd() * * cdef PetscErrorCode MatMultTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultTransposeAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_v, Vec __pyx_v_y) { PyObject *__pyx_v_multTransposeAdd = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultTransposeAdd_Python", 0); /* "libpetsc4py.pyx":965 * ) \ * except IERR with gil: * FunctionBegin(b"MatMultTransposeAdd_Python") # <<<<<<<<<<<<<< * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * if multTransposeAdd is None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMultTransposeAdd_Python")); /* "libpetsc4py.pyx":966 * except IERR with gil: * FunctionBegin(b"MatMultTransposeAdd_Python") * cdef multTransposeAdd = PyMat(mat).multTransposeAdd # <<<<<<<<<<<<<< * if multTransposeAdd is None: * CHKERR( MatMultTranspose(mat,x,y) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multTransposeAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multTransposeAdd = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":967 * FunctionBegin(b"MatMultTransposeAdd_Python") * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * if multTransposeAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatMultTranspose(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) */ __pyx_t_3 = (__pyx_v_multTransposeAdd == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":968 * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * if multTransposeAdd is None: * CHKERR( MatMultTranspose(mat,x,y) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatMultTranspose(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 968, __pyx_L1_error) /* "libpetsc4py.pyx":969 * if multTransposeAdd is None: * CHKERR( MatMultTranspose(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_v)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 969, __pyx_L1_error) /* "libpetsc4py.pyx":970 * CHKERR( MatMultTranspose(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":967 * FunctionBegin(b"MatMultTransposeAdd_Python") * cdef multTransposeAdd = PyMat(mat).multTransposeAdd * if multTransposeAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatMultTranspose(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) */ } /* "libpetsc4py.pyx":971 * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") # <<<<<<<<<<<<<< * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_multTransposeAdd == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"multTransposeAdd")); goto __pyx_L0; } /* "libpetsc4py.pyx":972 * return FunctionEnd() * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_multTransposeAdd); __pyx_t_9 = __pyx_v_multTransposeAdd; __pyx_t_10 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_5, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":973 * if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") * multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultHermitianAdd_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":958 * return FunctionEnd() * * cdef PetscErrorCode MatMultTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.MatMultTransposeAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multTransposeAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":975 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitianAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultHermitianAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_v, Vec __pyx_v_y) { PyObject *__pyx_v_multHermitianAdd = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultHermitianAdd_Python", 0); /* "libpetsc4py.pyx":982 * ) \ * except IERR with gil: * FunctionBegin(b"MatMultHermitianAdd_Python") # <<<<<<<<<<<<<< * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMultHermitianAdd_Python")); /* "libpetsc4py.pyx":983 * except IERR with gil: * FunctionBegin(b"MatMultHermitianAdd_Python") * cdef multHermitianAdd = PyMat(mat).multHermitianAdd # <<<<<<<<<<<<<< * if multHermitianAdd is None: * CHKERR( MatMultHermitian(mat,x,y) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multHermitianAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multHermitianAdd = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":984 * FunctionBegin(b"MatMultHermitianAdd_Python") * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatMultHermitian(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) */ __pyx_t_3 = (__pyx_v_multHermitianAdd == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":985 * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: * CHKERR( MatMultHermitian(mat,x,y) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatMultHermitianTranspose(__pyx_v_mat, __pyx_v_x, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 985, __pyx_L1_error) /* "libpetsc4py.pyx":986 * if multHermitianAdd is None: * CHKERR( MatMultHermitian(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if multHermitianAdd is None: return UNSUPPORTED(b"multHermitianAdd") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecAXPY(__pyx_v_y, 1.0, __pyx_v_v)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 986, __pyx_L1_error) /* "libpetsc4py.pyx":987 * CHKERR( MatMultHermitian(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if multHermitianAdd is None: return UNSUPPORTED(b"multHermitianAdd") * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":984 * FunctionBegin(b"MatMultHermitianAdd_Python") * cdef multHermitianAdd = PyMat(mat).multHermitianAdd * if multHermitianAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatMultHermitian(mat,x,y) ) * CHKERR( VecAXPY(y,1.0,v) ) */ } /* "libpetsc4py.pyx":988 * CHKERR( VecAXPY(y,1.0,v) ) * return FunctionEnd() * if multHermitianAdd is None: return UNSUPPORTED(b"multHermitianAdd") # <<<<<<<<<<<<<< * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_multHermitianAdd == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"multHermitianAdd")); goto __pyx_L0; } /* "libpetsc4py.pyx":989 * return FunctionEnd() * if multHermitianAdd is None: return UNSUPPORTED(b"multHermitianAdd") * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_multHermitianAdd); __pyx_t_9 = __pyx_v_multHermitianAdd; __pyx_t_10 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_5, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":990 * if multHermitianAdd is None: return UNSUPPORTED(b"multHermitianAdd") * multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMultDiagonalBlock_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":975 * return FunctionEnd() * * cdef PetscErrorCode MatMultHermitianAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.MatMultHermitianAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multHermitianAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":992 * return FunctionEnd() * * cdef PetscErrorCode MatMultDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMultDiagonalBlock_Python(Mat __pyx_v_mat, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_multDiagonalBlock = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMultDiagonalBlock_Python", 0); /* "libpetsc4py.pyx":998 * ) \ * except IERR with gil: * FunctionBegin(b"MatMultDiagonalBlock_Python") # <<<<<<<<<<<<<< * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMultDiagonalBlock_Python")); /* "libpetsc4py.pyx":999 * except IERR with gil: * FunctionBegin(b"MatMultDiagonalBlock_Python") * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock # <<<<<<<<<<<<<< * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_multDiagonalBlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_multDiagonalBlock = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1000 * FunctionBegin(b"MatMultDiagonalBlock_Python") * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") # <<<<<<<<<<<<<< * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_multDiagonalBlock == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"multDiagonalBlock")); goto __pyx_L0; } /* "libpetsc4py.pyx":1001 * cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_multDiagonalBlock); __pyx_t_7 = __pyx_v_multDiagonalBlock; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1002 * if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") * multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolve_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":992 * return FunctionEnd() * * cdef PetscErrorCode MatMultDiagonalBlock_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatMultDiagonalBlock_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_multDiagonalBlock); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1004 * return FunctionEnd() * * cdef PetscErrorCode MatSolve_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolve_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_solve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolve_Python", 0); /* "libpetsc4py.pyx":1010 * ) \ * except IERR with gil: * FunctionBegin(b"MatSolve_Python") # <<<<<<<<<<<<<< * cdef solve = PyMat(mat).solve * if solve is None: return UNSUPPORTED(b"solve") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSolve_Python")); /* "libpetsc4py.pyx":1011 * except IERR with gil: * FunctionBegin(b"MatSolve_Python") * cdef solve = PyMat(mat).solve # <<<<<<<<<<<<<< * if solve is None: return UNSUPPORTED(b"solve") * solve(Mat_(mat), Vec_(b), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solve); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solve = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1012 * FunctionBegin(b"MatSolve_Python") * cdef solve = PyMat(mat).solve * if solve is None: return UNSUPPORTED(b"solve") # <<<<<<<<<<<<<< * solve(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_solve == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"solve")); goto __pyx_L0; } /* "libpetsc4py.pyx":1013 * cdef solve = PyMat(mat).solve * if solve is None: return UNSUPPORTED(b"solve") * solve(Mat_(mat), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_solve); __pyx_t_7 = __pyx_v_solve; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1014 * if solve is None: return UNSUPPORTED(b"solve") * solve(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolveTranspose_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1004 * return FunctionEnd() * * cdef PetscErrorCode MatSolve_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1016 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolveTranspose_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_solveTranspose = 0; PetscBool __pyx_v_symmset; PetscBool __pyx_v_symmknown; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolveTranspose_Python", 0); /* "libpetsc4py.pyx":1022 * ) \ * except IERR with gil: * FunctionBegin(b"MatSolveTranspose_Python") # <<<<<<<<<<<<<< * cdef solveTranspose = PyMat(mat).solveTranspose * cdef PetscBool symmset, symmknown */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSolveTranspose_Python")); /* "libpetsc4py.pyx":1023 * except IERR with gil: * FunctionBegin(b"MatSolveTranspose_Python") * cdef solveTranspose = PyMat(mat).solveTranspose # <<<<<<<<<<<<<< * cdef PetscBool symmset, symmknown * if solveTranspose is None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveTranspose = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1025 * cdef solveTranspose = PyMat(mat).solveTranspose * cdef PetscBool symmset, symmknown * if solveTranspose is None: # <<<<<<<<<<<<<< * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) */ __pyx_t_3 = (__pyx_v_solveTranspose == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1026 * cdef PetscBool symmset, symmknown * if solveTranspose is None: * symmset = symmknown = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: */ __pyx_v_symmset = PETSC_FALSE; __pyx_v_symmknown = PETSC_FALSE; /* "libpetsc4py.pyx":1027 * if solveTranspose is None: * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) # <<<<<<<<<<<<<< * if symmset and symmknown: * CHKERR( MatSolve(mat,b,x) ) */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatIsSymmetricKnown(__pyx_v_mat, (&__pyx_v_symmset), (&__pyx_v_symmknown))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1027, __pyx_L1_error) /* "libpetsc4py.pyx":1028 * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: # <<<<<<<<<<<<<< * CHKERR( MatSolve(mat,b,x) ) * return FunctionEnd() */ if (__pyx_v_symmset) { } else { __pyx_t_4 = __pyx_v_symmset; goto __pyx_L5_bool_binop_done; } __pyx_t_4 = __pyx_v_symmknown; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":1029 * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: * CHKERR( MatSolve(mat,b,x) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if solveTranspose is None: return UNSUPPORTED(b"solveTranspose") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatSolve(__pyx_v_mat, __pyx_v_b, __pyx_v_x)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1029, __pyx_L1_error) /* "libpetsc4py.pyx":1030 * if symmset and symmknown: * CHKERR( MatSolve(mat,b,x) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if solveTranspose is None: return UNSUPPORTED(b"solveTranspose") * solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1028 * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) * if symmset and symmknown: # <<<<<<<<<<<<<< * CHKERR( MatSolve(mat,b,x) ) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1025 * cdef solveTranspose = PyMat(mat).solveTranspose * cdef PetscBool symmset, symmknown * if solveTranspose is None: # <<<<<<<<<<<<<< * symmset = symmknown = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) */ } /* "libpetsc4py.pyx":1031 * CHKERR( MatSolve(mat,b,x) ) * return FunctionEnd() * if solveTranspose is None: return UNSUPPORTED(b"solveTranspose") # <<<<<<<<<<<<<< * solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_solveTranspose == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"solveTranspose")); goto __pyx_L0; } /* "libpetsc4py.pyx":1032 * return FunctionEnd() * if solveTranspose is None: return UNSUPPORTED(b"solveTranspose") * solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_solveTranspose); __pyx_t_8 = __pyx_v_solveTranspose; __pyx_t_9 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_1, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_1, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1033 * if solveTranspose is None: return UNSUPPORTED(b"solveTranspose") * solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolveAdd_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1016 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTranspose_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatSolveTranspose_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveTranspose); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1035 * return FunctionEnd() * * cdef PetscErrorCode MatSolveAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolveAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_y, Vec __pyx_v_x) { PyObject *__pyx_v_solveAdd = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolveAdd_Python", 0); /* "libpetsc4py.pyx":1042 * ) \ * except IERR with gil: * FunctionBegin(b"MatSolveAdd_Python") # <<<<<<<<<<<<<< * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSolveAdd_Python")); /* "libpetsc4py.pyx":1043 * except IERR with gil: * FunctionBegin(b"MatSolveAdd_Python") * cdef solveAdd = PyMat(mat).solveAdd # <<<<<<<<<<<<<< * if solveAdd is None: * CHKERR( MatSolve(mat,b,x) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveAdd = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1044 * FunctionBegin(b"MatSolveAdd_Python") * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatSolve(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) */ __pyx_t_3 = (__pyx_v_solveAdd == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1045 * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: * CHKERR( MatSolve(mat,b,x) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(x,1.0,y) ) * return FunctionEnd() */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatSolve(__pyx_v_mat, __pyx_v_b, __pyx_v_x)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1045, __pyx_L1_error) /* "libpetsc4py.pyx":1046 * if solveAdd is None: * CHKERR( MatSolve(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if solveAdd is None: return UNSUPPORTED(b"solveAdd") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecAXPY(__pyx_v_x, 1.0, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1046, __pyx_L1_error) /* "libpetsc4py.pyx":1047 * CHKERR( MatSolve(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if solveAdd is None: return UNSUPPORTED(b"solveAdd") * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1044 * FunctionBegin(b"MatSolveAdd_Python") * cdef solveAdd = PyMat(mat).solveAdd * if solveAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatSolve(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) */ } /* "libpetsc4py.pyx":1048 * CHKERR( VecAXPY(x,1.0,y) ) * return FunctionEnd() * if solveAdd is None: return UNSUPPORTED(b"solveAdd") # <<<<<<<<<<<<<< * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_solveAdd == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"solveAdd")); goto __pyx_L0; } /* "libpetsc4py.pyx":1049 * return FunctionEnd() * if solveAdd is None: return UNSUPPORTED(b"solveAdd") * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_solveAdd); __pyx_t_9 = __pyx_v_solveAdd; __pyx_t_10 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_5, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1050 * if solveAdd is None: return UNSUPPORTED(b"solveAdd") * solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSolveTransposeAdd_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1035 * return FunctionEnd() * * cdef PetscErrorCode MatSolveAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.MatSolveAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1052 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSolveTransposeAdd_Python(Mat __pyx_v_mat, Vec __pyx_v_b, Vec __pyx_v_y, Vec __pyx_v_x) { PyObject *__pyx_v_solveTransposeAdd = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSolveTransposeAdd_Python", 0); /* "libpetsc4py.pyx":1059 * ) \ * except IERR with gil: * FunctionBegin(b"MatSolveTransposeAdd_Python") # <<<<<<<<<<<<<< * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSolveTransposeAdd_Python")); /* "libpetsc4py.pyx":1060 * except IERR with gil: * FunctionBegin(b"MatSolveTransposeAdd_Python") * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd # <<<<<<<<<<<<<< * if solveTransposeAdd is None: * CHKERR( MatSolveTranspose(mat,b,x) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveTransposeAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveTransposeAdd = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1061 * FunctionBegin(b"MatSolveTransposeAdd_Python") * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatSolveTranspose(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) */ __pyx_t_3 = (__pyx_v_solveTransposeAdd == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1062 * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: * CHKERR( MatSolveTranspose(mat,b,x) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(x,1.0,y) ) * return FunctionEnd() */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(MatSolveTranspose(__pyx_v_mat, __pyx_v_b, __pyx_v_x)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1062, __pyx_L1_error) /* "libpetsc4py.pyx":1063 * if solveTransposeAdd is None: * CHKERR( MatSolveTranspose(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) # <<<<<<<<<<<<<< * return FunctionEnd() * if solveTransposeAdd is None: return UNSUPPORTED(b"solveTransposeAdd") */ __pyx_t_5 = __pyx_f_11libpetsc4py_CHKERR(VecAXPY(__pyx_v_x, 1.0, __pyx_v_y)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 1063, __pyx_L1_error) /* "libpetsc4py.pyx":1064 * CHKERR( MatSolveTranspose(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) * return FunctionEnd() # <<<<<<<<<<<<<< * if solveTransposeAdd is None: return UNSUPPORTED(b"solveTransposeAdd") * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1061 * FunctionBegin(b"MatSolveTransposeAdd_Python") * cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd * if solveTransposeAdd is None: # <<<<<<<<<<<<<< * CHKERR( MatSolveTranspose(mat,b,x) ) * CHKERR( VecAXPY(x,1.0,y) ) */ } /* "libpetsc4py.pyx":1065 * CHKERR( VecAXPY(x,1.0,y) ) * return FunctionEnd() * if solveTransposeAdd is None: return UNSUPPORTED(b"solveTransposeAdd") # <<<<<<<<<<<<<< * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_solveTransposeAdd == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"solveTransposeAdd")); goto __pyx_L0; } /* "libpetsc4py.pyx":1066 * return FunctionEnd() * if solveTransposeAdd is None: return UNSUPPORTED(b"solveTransposeAdd") * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_solveTransposeAdd); __pyx_t_9 = __pyx_v_solveTransposeAdd; __pyx_t_10 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_5, __pyx_t_8); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1067 * if solveTransposeAdd is None: return UNSUPPORTED(b"solveTransposeAdd") * solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSOR_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1052 * return FunctionEnd() * * cdef PetscErrorCode MatSolveTransposeAdd_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.MatSolveTransposeAdd_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveTransposeAdd); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1069 * return FunctionEnd() * * cdef PetscErrorCode MatSOR_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSOR_Python(Mat __pyx_v_mat, Vec __pyx_v_b, PetscReal __pyx_v_omega, MatSORType __pyx_v_sortype, PetscReal __pyx_v_shift, PetscInt __pyx_v_its, PetscInt __pyx_v_lits, Vec __pyx_v_x) { PyObject *__pyx_v_SOR = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PetscReal __pyx_t_7; PyObject *__pyx_t_8 = NULL; PetscInt __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSOR_Python", 0); /* "libpetsc4py.pyx":1080 * )\ * except IERR with gil: * FunctionBegin(b"MatSOR_Python") # <<<<<<<<<<<<<< * cdef SOR = PyMat(mat).SOR * if SOR is None: return UNSUPPORTED(b"SOR") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSOR_Python")); /* "libpetsc4py.pyx":1081 * except IERR with gil: * FunctionBegin(b"MatSOR_Python") * cdef SOR = PyMat(mat).SOR # <<<<<<<<<<<<<< * if SOR is None: return UNSUPPORTED(b"SOR") * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_SOR = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1082 * FunctionBegin(b"MatSOR_Python") * cdef SOR = PyMat(mat).SOR * if SOR is None: return UNSUPPORTED(b"SOR") # <<<<<<<<<<<<<< * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_SOR == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"SOR")); goto __pyx_L0; } /* "libpetsc4py.pyx":1083 * cdef SOR = PyMat(mat).SOR * if SOR is None: return UNSUPPORTED(b"SOR") * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyFloat_FromDouble(__pyx_v_omega); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_11libpetsc4py_asReal(__pyx_t_6); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyFloat_FromDouble(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyInt_From_MatSORType(__pyx_v_sortype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __pyx_f_11libpetsc4py_asInt(__pyx_t_8); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyInt_From_PetscInt(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyFloat_FromDouble(__pyx_v_shift); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = __pyx_f_11libpetsc4py_asReal(__pyx_t_10); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyFloat_FromDouble(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = __Pyx_PyInt_From_PetscInt(__pyx_v_its); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = __pyx_f_11libpetsc4py_asInt(__pyx_t_11); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = __Pyx_PyInt_From_PetscInt(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = __Pyx_PyInt_From_PetscInt(__pyx_v_lits); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = __pyx_f_11libpetsc4py_asInt(__pyx_t_12); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_PetscInt(__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_SOR); __pyx_t_14 = __pyx_v_SOR; __pyx_t_15 = NULL; __pyx_t_16 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) { __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14); if (likely(__pyx_t_15)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); __Pyx_INCREF(__pyx_t_15); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_14, function); __pyx_t_16 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[9] = {__pyx_t_15, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_8, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_16, 8+__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) { PyObject *__pyx_temp[9] = {__pyx_t_15, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_8, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_16, 8+__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } else #endif { __pyx_t_17 = PyTuple_New(8+__pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); if (__pyx_t_15) { __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15); __pyx_t_15 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_16, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_16, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_16, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_17, 3+__pyx_t_16, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_17, 4+__pyx_t_16, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_17, 5+__pyx_t_16, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_17, 6+__pyx_t_16, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_17, 7+__pyx_t_16, __pyx_t_13); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_8 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1084 * if SOR is None: return UNSUPPORTED(b"SOR") * SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatGetDiagonal_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1069 * return FunctionEnd() * * cdef PetscErrorCode MatSOR_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_XDECREF(__pyx_t_15); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("libpetsc4py.MatSOR_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_SOR); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1086 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatGetDiagonal_Python(Mat __pyx_v_mat, Vec __pyx_v_v) { PyObject *__pyx_v_getDiagonal = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatGetDiagonal_Python", 0); /* "libpetsc4py.pyx":1091 * ) \ * except IERR with gil: * FunctionBegin(b"MatGetDiagonal_Python") # <<<<<<<<<<<<<< * cdef getDiagonal = PyMat(mat).getDiagonal * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatGetDiagonal_Python")); /* "libpetsc4py.pyx":1092 * except IERR with gil: * FunctionBegin(b"MatGetDiagonal_Python") * cdef getDiagonal = PyMat(mat).getDiagonal # <<<<<<<<<<<<<< * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") * getDiagonal(Mat_(mat), Vec_(v)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_getDiagonal = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1093 * FunctionBegin(b"MatGetDiagonal_Python") * cdef getDiagonal = PyMat(mat).getDiagonal * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") # <<<<<<<<<<<<<< * getDiagonal(Mat_(mat), Vec_(v)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_getDiagonal == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"getDiagonal")); goto __pyx_L0; } /* "libpetsc4py.pyx":1094 * cdef getDiagonal = PyMat(mat).getDiagonal * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") * getDiagonal(Mat_(mat), Vec_(v)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_getDiagonal); __pyx_t_6 = __pyx_v_getDiagonal; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1095 * if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") * getDiagonal(Mat_(mat), Vec_(v)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatSetDiagonal_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1086 * return FunctionEnd() * * cdef PetscErrorCode MatGetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatGetDiagonal_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_getDiagonal); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1097 * return FunctionEnd() * * cdef PetscErrorCode MatSetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatSetDiagonal_Python(Mat __pyx_v_mat, Vec __pyx_v_v, InsertMode __pyx_v_im) { PyObject *__pyx_v_setDiagonal = 0; int __pyx_v_addv; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatSetDiagonal_Python", 0); /* "libpetsc4py.pyx":1103 * ) \ * except IERR with gil: * FunctionBegin(b"MatSetDiagonal_Python") # <<<<<<<<<<<<<< * cdef setDiagonal = PyMat(mat).setDiagonal * cdef bint addv = True if im == ADD_VALUES else False */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatSetDiagonal_Python")); /* "libpetsc4py.pyx":1104 * except IERR with gil: * FunctionBegin(b"MatSetDiagonal_Python") * cdef setDiagonal = PyMat(mat).setDiagonal # <<<<<<<<<<<<<< * cdef bint addv = True if im == ADD_VALUES else False * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setDiagonal = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1105 * FunctionBegin(b"MatSetDiagonal_Python") * cdef setDiagonal = PyMat(mat).setDiagonal * cdef bint addv = True if im == ADD_VALUES else False # <<<<<<<<<<<<<< * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") * setDiagonal(Mat_(mat), Vec_(v), addv) */ if (((__pyx_v_im == ADD_VALUES) != 0)) { __pyx_t_3 = 1; } else { __pyx_t_3 = 0; } __pyx_v_addv = __pyx_t_3; /* "libpetsc4py.pyx":1106 * cdef setDiagonal = PyMat(mat).setDiagonal * cdef bint addv = True if im == ADD_VALUES else False * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") # <<<<<<<<<<<<<< * setDiagonal(Mat_(mat), Vec_(v), addv) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_setDiagonal == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"setDiagonal")); goto __pyx_L0; } /* "libpetsc4py.pyx":1107 * cdef bint addv = True if im == ADD_VALUES else False * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") * setDiagonal(Mat_(mat), Vec_(v), addv) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_addv); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_setDiagonal); __pyx_t_7 = __pyx_v_setDiagonal; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1108 * if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") * setDiagonal(Mat_(mat), Vec_(v), addv) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatDiagonalScale_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1097 * return FunctionEnd() * * cdef PetscErrorCode MatSetDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatSetDiagonal_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setDiagonal); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1110 * return FunctionEnd() * * cdef PetscErrorCode MatDiagonalScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec l, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatDiagonalScale_Python(Mat __pyx_v_mat, Vec __pyx_v_l, Vec __pyx_v_r) { PyObject *__pyx_v_diagonalScale = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatDiagonalScale_Python", 0); /* "libpetsc4py.pyx":1116 * ) \ * except IERR with gil: * FunctionBegin(b"MatDiagonalScale_Python") # <<<<<<<<<<<<<< * cdef diagonalScale = PyMat(mat).diagonalScale * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatDiagonalScale_Python")); /* "libpetsc4py.pyx":1117 * except IERR with gil: * FunctionBegin(b"MatDiagonalScale_Python") * cdef diagonalScale = PyMat(mat).diagonalScale # <<<<<<<<<<<<<< * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_diagonalScale = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1118 * FunctionBegin(b"MatDiagonalScale_Python") * cdef diagonalScale = PyMat(mat).diagonalScale * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") # <<<<<<<<<<<<<< * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_diagonalScale == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"diagonalScale")); goto __pyx_L0; } /* "libpetsc4py.pyx":1119 * cdef diagonalScale = PyMat(mat).diagonalScale * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_l)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_r)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_diagonalScale); __pyx_t_7 = __pyx_v_diagonalScale; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1120 * if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") * diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatMissingDiagonal_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1110 * return FunctionEnd() * * cdef PetscErrorCode MatDiagonalScale_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscVec l, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.MatDiagonalScale_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_diagonalScale); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1122 * return FunctionEnd() * * cdef PetscErrorCode MatMissingDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscBool *missing, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatMissingDiagonal_Python(Mat __pyx_v_mat, PetscBool *__pyx_v_missing, PetscInt *__pyx_v_loc) { PyObject *__pyx_v_missingDiagonal = 0; PyObject *__pyx_v_pymissing = NULL; PyObject *__pyx_v_pyloc = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); PetscBool __pyx_t_8; PetscInt __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatMissingDiagonal_Python", 0); /* "libpetsc4py.pyx":1128 * ) \ * except IERR with gil: * FunctionBegin(b"MatMissingDiagonal_Python") # <<<<<<<<<<<<<< * cdef missingDiagonal = PyMat(mat).missingDiagonal * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatMissingDiagonal_Python")); /* "libpetsc4py.pyx":1129 * except IERR with gil: * FunctionBegin(b"MatMissingDiagonal_Python") * cdef missingDiagonal = PyMat(mat).missingDiagonal # <<<<<<<<<<<<<< * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") * pymissing, pyloc = missingDiagonal(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_missingDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_missingDiagonal = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1130 * FunctionBegin(b"MatMissingDiagonal_Python") * cdef missingDiagonal = PyMat(mat).missingDiagonal * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") # <<<<<<<<<<<<<< * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing */ __pyx_t_3 = (__pyx_v_missingDiagonal == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"missingDiagonal")); goto __pyx_L0; } /* "libpetsc4py.pyx":1131 * cdef missingDiagonal = PyMat(mat).missingDiagonal * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") * pymissing, pyloc = missingDiagonal(Mat_(mat)) # <<<<<<<<<<<<<< * missing[0] = pymissing * if loc: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_missingDiagonal); __pyx_t_5 = __pyx_v_missingDiagonal; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 1131, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1131, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 1131, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_pymissing = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_pyloc = __pyx_t_1; __pyx_t_1 = 0; /* "libpetsc4py.pyx":1132 * if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing # <<<<<<<<<<<<<< * if loc: * loc[0] = asInt(pyloc) */ __pyx_t_8 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_pymissing)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L1_error) (__pyx_v_missing[0]) = ((PetscBool)__pyx_t_8); /* "libpetsc4py.pyx":1133 * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing * if loc: # <<<<<<<<<<<<<< * loc[0] = asInt(pyloc) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_loc != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1134 * missing[0] = pymissing * if loc: * loc[0] = asInt(pyloc) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_9 = __pyx_f_11libpetsc4py_asInt(__pyx_v_pyloc); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error) (__pyx_v_loc[0]) = __pyx_t_9; /* "libpetsc4py.pyx":1133 * pymissing, pyloc = missingDiagonal(Mat_(mat)) * missing[0] = pymissing * if loc: # <<<<<<<<<<<<<< * loc[0] = asInt(pyloc) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1135 * if loc: * loc[0] = asInt(pyloc) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatNorm_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1122 * return FunctionEnd() * * cdef PetscErrorCode MatMissingDiagonal_Python( # <<<<<<<<<<<<<< * PetscMat mat, * PetscBool *missing, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.MatMissingDiagonal_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_missingDiagonal); __Pyx_XDECREF(__pyx_v_pymissing); __Pyx_XDECREF(__pyx_v_pyloc); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1137 * return FunctionEnd() * * cdef PetscErrorCode MatNorm_Python( # <<<<<<<<<<<<<< * PetscMat mat, * NormType ntype, */ static PetscErrorCode __pyx_f_11libpetsc4py_MatNorm_Python(Mat __pyx_v_mat, NormType __pyx_v_ntype, PetscReal *__pyx_v_nrm) { PyObject *__pyx_v_norm = 0; PyObject *__pyx_v_retval = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PetscReal __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatNorm_Python", 0); /* "libpetsc4py.pyx":1143 * ) \ * except IERR with gil: * FunctionBegin(b"MatNorm_Python") # <<<<<<<<<<<<<< * cdef norm = PyMat(mat).norm * if norm is None: return UNSUPPORTED(b"norm") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatNorm_Python")); /* "libpetsc4py.pyx":1144 * except IERR with gil: * FunctionBegin(b"MatNorm_Python") * cdef norm = PyMat(mat).norm # <<<<<<<<<<<<<< * if norm is None: return UNSUPPORTED(b"norm") * retval = norm(Mat_(mat), ntype) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_norm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_norm = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1145 * FunctionBegin(b"MatNorm_Python") * cdef norm = PyMat(mat).norm * if norm is None: return UNSUPPORTED(b"norm") # <<<<<<<<<<<<<< * retval = norm(Mat_(mat), ntype) * nrm[0] = retval */ __pyx_t_3 = (__pyx_v_norm == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"norm")); goto __pyx_L0; } /* "libpetsc4py.pyx":1146 * cdef norm = PyMat(mat).norm * if norm is None: return UNSUPPORTED(b"norm") * retval = norm(Mat_(mat), ntype) # <<<<<<<<<<<<<< * nrm[0] = retval * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_NormType(__pyx_v_ntype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_norm); __pyx_t_6 = __pyx_v_norm; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_retval = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1147 * if norm is None: return UNSUPPORTED(b"norm") * retval = norm(Mat_(mat), ntype) * nrm[0] = retval # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_retval); if (unlikely((__pyx_t_10 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1147, __pyx_L1_error) (__pyx_v_nrm[0]) = ((PetscReal)__pyx_t_10); /* "libpetsc4py.pyx":1148 * retval = norm(Mat_(mat), ntype) * nrm[0] = retval * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatRealPart_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1137 * return FunctionEnd() * * cdef PetscErrorCode MatNorm_Python( # <<<<<<<<<<<<<< * PetscMat mat, * NormType ntype, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.MatNorm_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_norm); __Pyx_XDECREF(__pyx_v_retval); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1150 * return FunctionEnd() * * cdef PetscErrorCode MatRealPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_MatRealPart_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_realPart = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatRealPart_Python", 0); /* "libpetsc4py.pyx":1154 * ) \ * except IERR with gil: * FunctionBegin(b"MatRealPart_Python") # <<<<<<<<<<<<<< * cdef realPart = PyMat(mat).realPart * if realPart is None: return UNSUPPORTED(b"realPart") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatRealPart_Python")); /* "libpetsc4py.pyx":1155 * except IERR with gil: * FunctionBegin(b"MatRealPart_Python") * cdef realPart = PyMat(mat).realPart # <<<<<<<<<<<<<< * if realPart is None: return UNSUPPORTED(b"realPart") * realPart(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realPart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_realPart = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1156 * FunctionBegin(b"MatRealPart_Python") * cdef realPart = PyMat(mat).realPart * if realPart is None: return UNSUPPORTED(b"realPart") # <<<<<<<<<<<<<< * realPart(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_realPart == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"realPart")); goto __pyx_L0; } /* "libpetsc4py.pyx":1157 * cdef realPart = PyMat(mat).realPart * if realPart is None: return UNSUPPORTED(b"realPart") * realPart(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_realPart); __pyx_t_5 = __pyx_v_realPart; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1158 * if realPart is None: return UNSUPPORTED(b"realPart") * realPart(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatImagPart_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1150 * return FunctionEnd() * * cdef PetscErrorCode MatRealPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.MatRealPart_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_realPart); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1160 * return FunctionEnd() * * cdef PetscErrorCode MatImagPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_MatImagPart_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_imagPart = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatImagPart_Python", 0); /* "libpetsc4py.pyx":1164 * ) \ * except IERR with gil: * FunctionBegin(b"MatImagPart_Python") # <<<<<<<<<<<<<< * cdef imagPart = PyMat(mat).imagPart * if imagPart is None: return UNSUPPORTED(b"imagPart") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatImagPart_Python")); /* "libpetsc4py.pyx":1165 * except IERR with gil: * FunctionBegin(b"MatImagPart_Python") * cdef imagPart = PyMat(mat).imagPart # <<<<<<<<<<<<<< * if imagPart is None: return UNSUPPORTED(b"imagPart") * imagPart(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_imagPart); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_imagPart = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1166 * FunctionBegin(b"MatImagPart_Python") * cdef imagPart = PyMat(mat).imagPart * if imagPart is None: return UNSUPPORTED(b"imagPart") # <<<<<<<<<<<<<< * imagPart(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_imagPart == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"imagPart")); goto __pyx_L0; } /* "libpetsc4py.pyx":1167 * cdef imagPart = PyMat(mat).imagPart * if imagPart is None: return UNSUPPORTED(b"imagPart") * imagPart(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_imagPart); __pyx_t_5 = __pyx_v_imagPart; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1168 * if imagPart is None: return UNSUPPORTED(b"imagPart") * imagPart(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode MatConjugate_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1160 * return FunctionEnd() * * cdef PetscErrorCode MatImagPart_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.MatImagPart_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_imagPart); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1170 * return FunctionEnd() * * cdef PetscErrorCode MatConjugate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_MatConjugate_Python(Mat __pyx_v_mat) { PyObject *__pyx_v_conjugate = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("MatConjugate_Python", 0); /* "libpetsc4py.pyx":1174 * ) \ * except IERR with gil: * FunctionBegin(b"MatConjugate_Python") # <<<<<<<<<<<<<< * cdef conjugate = PyMat(mat).conjugate * if conjugate is None: return UNSUPPORTED(b"conjugate") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"MatConjugate_Python")); /* "libpetsc4py.pyx":1175 * except IERR with gil: * FunctionBegin(b"MatConjugate_Python") * cdef conjugate = PyMat(mat).conjugate # <<<<<<<<<<<<<< * if conjugate is None: return UNSUPPORTED(b"conjugate") * conjugate(Mat_(mat)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_conjugate = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1176 * FunctionBegin(b"MatConjugate_Python") * cdef conjugate = PyMat(mat).conjugate * if conjugate is None: return UNSUPPORTED(b"conjugate") # <<<<<<<<<<<<<< * conjugate(Mat_(mat)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_conjugate == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"conjugate")); goto __pyx_L0; } /* "libpetsc4py.pyx":1177 * cdef conjugate = PyMat(mat).conjugate * if conjugate is None: return UNSUPPORTED(b"conjugate") * conjugate(Mat_(mat)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_conjugate); __pyx_t_5 = __pyx_v_conjugate; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1178 * if conjugate is None: return UNSUPPORTED(b"conjugate") * conjugate(Mat_(mat)) * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1170 * return FunctionEnd() * * cdef PetscErrorCode MatConjugate_Python( # <<<<<<<<<<<<<< * PetscMat mat, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.MatConjugate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_conjugate); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1202 * @cython.internal * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): # <<<<<<<<<<<<<< * if pc != NULL and pc.data != NULL: * return <_PyPC>pc.data */ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyPC *__pyx_f_11libpetsc4py_PyPC(PC __pyx_v_pc) { struct __pyx_obj_11libpetsc4py__PyPC *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPC", 0); /* "libpetsc4py.pyx":1203 * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: # <<<<<<<<<<<<<< * return <_PyPC>pc.data * else: */ __pyx_t_2 = ((__pyx_v_pc != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_pc->data != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "libpetsc4py.pyx":1204 * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: * return <_PyPC>pc.data # <<<<<<<<<<<<<< * else: * return _PyPC.__new__(_PyPC) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_v_pc->data))); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_v_pc->data); goto __pyx_L0; /* "libpetsc4py.pyx":1203 * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): * if pc != NULL and pc.data != NULL: # <<<<<<<<<<<<<< * return <_PyPC>pc.data * else: */ } /* "libpetsc4py.pyx":1206 * return <_PyPC>pc.data * else: * return _PyPC.__new__(_PyPC) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_3 = ((PyObject *)__pyx_tp_new_11libpetsc4py__PyPC(((PyTypeObject *)__pyx_ptype_11libpetsc4py__PyPC), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":1202 * @cython.internal * cdef class _PyPC(_PyObj): pass * cdef inline _PyPC PyPC(PetscPC pc): # <<<<<<<<<<<<<< * if pc != NULL and pc.data != NULL: * return <_PyPC>pc.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.PyPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1208 * return _PyPC.__new__(_PyPC) * * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"PCPythonGetContext") */ PetscErrorCode PCPythonGetContext(PC __pyx_v_pc, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PCPythonGetContext", 0); /* "libpetsc4py.pyx":1210 * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ * except IERR: * FunctionBegin(b"PCPythonGetContext") # <<<<<<<<<<<<<< * PyPC(pc).getcontext(ctx) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCPythonGetContext")); /* "libpetsc4py.pyx":1211 * except IERR: * FunctionBegin(b"PCPythonGetContext") * PyPC(pc).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyPC *)((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1212 * FunctionBegin(b"PCPythonGetContext") * PyPC(pc).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1208 * return _PyPC.__new__(_PyPC) * * cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"PCPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.PCPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1214 * return FunctionEnd() * * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"PCPythonSetContext") */ PetscErrorCode PCPythonSetContext(PC __pyx_v_pc, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PCPythonSetContext", 0); /* "libpetsc4py.pyx":1216 * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ * except IERR: * FunctionBegin(b"PCPythonSetContext") # <<<<<<<<<<<<<< * PyPC(pc).setcontext(ctx, PC_(pc)) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCPythonSetContext")); /* "libpetsc4py.pyx":1217 * except IERR: * FunctionBegin(b"PCPythonSetContext") * PyPC(pc).setcontext(ctx, PC_(pc)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_11libpetsc4py__PyPC *)((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1218 * FunctionBegin(b"PCPythonSetContext") * PyPC(pc).setcontext(ctx, PC_(pc)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1214 * return FunctionEnd() * * cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"PCPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.PCPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1220 * return FunctionEnd() * * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_11libpetsc4py_PCPythonSetType_PYTHON(PC __pyx_v_pc, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPythonSetType_PYTHON", 0); /* "libpetsc4py.pyx":1222 * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ * except IERR with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCPythonSetType_PYTHON")); /* "libpetsc4py.pyx":1223 * except IERR with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * PCPythonSetContext(pc, ctx) */ __pyx_t_1 = ((__pyx_v_name == NULL) != 0); if (__pyx_t_1) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":1224 * FunctionBegin(b"PCPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * PCPythonSetContext(pc, ctx) * PyPC(pc).setname(name) */ __pyx_t_2 = __pyx_f_11libpetsc4py_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1225 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * PCPythonSetContext(pc, ctx) # <<<<<<<<<<<<<< * PyPC(pc).setname(name) * return FunctionEnd() */ __pyx_t_3 = PCPythonSetContext(__pyx_v_pc, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1225, __pyx_L1_error) /* "libpetsc4py.pyx":1226 * cdef object ctx = createcontext(name) * PCPythonSetContext(pc, ctx) * PyPC(pc).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_11libpetsc4py__PyPC *)((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1227 * PCPythonSetContext(pc, ctx) * PyPC(pc).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCCreate_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1220 * return FunctionEnd() * * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"PCPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.PCPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1229 * return FunctionEnd() * * cdef PetscErrorCode PCCreate_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_PCCreate_Python(PC __pyx_v_pc) { PCOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PCOps __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCCreate_Python", 0); /* "libpetsc4py.pyx":1233 * ) \ * except IERR with gil: * FunctionBegin(b"PCCreate_Python") # <<<<<<<<<<<<<< * # * cdef PCOps ops = pc.ops */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCCreate_Python")); /* "libpetsc4py.pyx":1235 * FunctionBegin(b"PCCreate_Python") * # * cdef PCOps ops = pc.ops # <<<<<<<<<<<<<< * ops.reset = PCReset_Python * ops.destroy = PCDestroy_Python */ __pyx_t_1 = __pyx_v_pc->ops; __pyx_v_ops = __pyx_t_1; /* "libpetsc4py.pyx":1236 * # * cdef PCOps ops = pc.ops * ops.reset = PCReset_Python # <<<<<<<<<<<<<< * ops.destroy = PCDestroy_Python * ops.setup = PCSetUp_Python */ __pyx_v_ops->reset = __pyx_f_11libpetsc4py_PCReset_Python; /* "libpetsc4py.pyx":1237 * cdef PCOps ops = pc.ops * ops.reset = PCReset_Python * ops.destroy = PCDestroy_Python # <<<<<<<<<<<<<< * ops.setup = PCSetUp_Python * ops.setfromoptions = PCSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_11libpetsc4py_PCDestroy_Python; /* "libpetsc4py.pyx":1238 * ops.reset = PCReset_Python * ops.destroy = PCDestroy_Python * ops.setup = PCSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = PCSetFromOptions_Python * ops.view = PCView_Python */ __pyx_v_ops->setup = __pyx_f_11libpetsc4py_PCSetUp_Python; /* "libpetsc4py.pyx":1239 * ops.destroy = PCDestroy_Python * ops.setup = PCSetUp_Python * ops.setfromoptions = PCSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = PCView_Python * ops.presolve = PCPreSolve_Python */ __pyx_v_ops->setfromoptions = __pyx_f_11libpetsc4py_PCSetFromOptions_Python; /* "libpetsc4py.pyx":1240 * ops.setup = PCSetUp_Python * ops.setfromoptions = PCSetFromOptions_Python * ops.view = PCView_Python # <<<<<<<<<<<<<< * ops.presolve = PCPreSolve_Python * ops.postsolve = PCPostSolve_Python */ __pyx_v_ops->view = __pyx_f_11libpetsc4py_PCView_Python; /* "libpetsc4py.pyx":1241 * ops.setfromoptions = PCSetFromOptions_Python * ops.view = PCView_Python * ops.presolve = PCPreSolve_Python # <<<<<<<<<<<<<< * ops.postsolve = PCPostSolve_Python * ops.apply = PCApply_Python */ __pyx_v_ops->presolve = __pyx_f_11libpetsc4py_PCPreSolve_Python; /* "libpetsc4py.pyx":1242 * ops.view = PCView_Python * ops.presolve = PCPreSolve_Python * ops.postsolve = PCPostSolve_Python # <<<<<<<<<<<<<< * ops.apply = PCApply_Python * ops.applytranspose = PCApplyTranspose_Python */ __pyx_v_ops->postsolve = __pyx_f_11libpetsc4py_PCPostSolve_Python; /* "libpetsc4py.pyx":1243 * ops.presolve = PCPreSolve_Python * ops.postsolve = PCPostSolve_Python * ops.apply = PCApply_Python # <<<<<<<<<<<<<< * ops.applytranspose = PCApplyTranspose_Python * ops.applysymmetricleft = PCApplySymmetricLeft_Python */ __pyx_v_ops->apply = __pyx_f_11libpetsc4py_PCApply_Python; /* "libpetsc4py.pyx":1244 * ops.postsolve = PCPostSolve_Python * ops.apply = PCApply_Python * ops.applytranspose = PCApplyTranspose_Python # <<<<<<<<<<<<<< * ops.applysymmetricleft = PCApplySymmetricLeft_Python * ops.applysymmetricright = PCApplySymmetricRight_Python */ __pyx_v_ops->applytranspose = __pyx_f_11libpetsc4py_PCApplyTranspose_Python; /* "libpetsc4py.pyx":1245 * ops.apply = PCApply_Python * ops.applytranspose = PCApplyTranspose_Python * ops.applysymmetricleft = PCApplySymmetricLeft_Python # <<<<<<<<<<<<<< * ops.applysymmetricright = PCApplySymmetricRight_Python * # */ __pyx_v_ops->applysymmetricleft = __pyx_f_11libpetsc4py_PCApplySymmetricLeft_Python; /* "libpetsc4py.pyx":1246 * ops.applytranspose = PCApplyTranspose_Python * ops.applysymmetricleft = PCApplySymmetricLeft_Python * ops.applysymmetricright = PCApplySymmetricRight_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->applysymmetricright = __pyx_f_11libpetsc4py_PCApplySymmetricRight_Python; /* "libpetsc4py.pyx":1248 * ops.applysymmetricright = PCApplySymmetricRight_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * pc, b"PCPythonSetType_C", * PCPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_pc), ((char *)"PCPythonSetType_C"), ((PetscVoidFunction)__pyx_f_11libpetsc4py_PCPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1248, __pyx_L1_error) /* "libpetsc4py.pyx":1252 * PCPythonSetType_PYTHON) ) * # * cdef ctx = PyPC(NULL) # <<<<<<<<<<<<<< * pc.data = ctx * Py_INCREF(pc.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1253 * # * cdef ctx = PyPC(NULL) * pc.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(pc.data) * return FunctionEnd() */ __pyx_v_pc->data = ((void *)__pyx_v_ctx); /* "libpetsc4py.pyx":1254 * cdef ctx = PyPC(NULL) * pc.data = ctx * Py_INCREF(pc.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_pc->data)); /* "libpetsc4py.pyx":1255 * pc.data = ctx * Py_INCREF(pc.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCDestroy_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1229 * return FunctionEnd() * * cdef PetscErrorCode PCCreate_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.PCCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1257 * return FunctionEnd() * * cdef PetscErrorCode PCDestroy_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_PCDestroy_Python(PC __pyx_v_pc) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCDestroy_Python", 0); /* "libpetsc4py.pyx":1261 * ) \ * except IERR with gil: * FunctionBegin(b"PCDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * pc, b"PCPythonSetType_C", */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCDestroy_Python")); /* "libpetsc4py.pyx":1262 * except IERR with gil: * FunctionBegin(b"PCDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * pc, b"PCPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_pc), ((char *)"PCPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1262, __pyx_L1_error) /* "libpetsc4py.pyx":1266 * NULL) ) * # * if not Py_IsInitialized(): return FunctionEnd() # <<<<<<<<<<<<<< * try: * addRef(pc) */ __pyx_t_2 = ((!(Py_IsInitialized() != 0)) != 0); if (__pyx_t_2) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":1267 * # * if not Py_IsInitialized(): return FunctionEnd() * try: # <<<<<<<<<<<<<< * addRef(pc) * PCPythonSetContext(pc, NULL) */ /*try:*/ { /* "libpetsc4py.pyx":1268 * if not Py_IsInitialized(): return FunctionEnd() * try: * addRef(pc) # <<<<<<<<<<<<<< * PCPythonSetContext(pc, NULL) * finally: */ __pyx_f_11libpetsc4py_addRef(__pyx_v_pc); /* "libpetsc4py.pyx":1269 * try: * addRef(pc) * PCPythonSetContext(pc, NULL) # <<<<<<<<<<<<<< * finally: * delRef(pc) */ __pyx_t_3 = PCPythonSetContext(__pyx_v_pc, NULL); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1269, __pyx_L5_error) } /* "libpetsc4py.pyx":1271 * PCPythonSetContext(pc, NULL) * finally: * delRef(pc) # <<<<<<<<<<<<<< * Py_DECREF(pc.data) * pc.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_11libpetsc4py_delRef(__pyx_v_pc); /* "libpetsc4py.pyx":1272 * finally: * delRef(pc) * Py_DECREF(pc.data) # <<<<<<<<<<<<<< * pc.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_pc->data)); /* "libpetsc4py.pyx":1273 * delRef(pc) * Py_DECREF(pc.data) * pc.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_pc->data = NULL; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_1 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { /* "libpetsc4py.pyx":1271 * PCPythonSetContext(pc, NULL) * finally: * delRef(pc) # <<<<<<<<<<<<<< * Py_DECREF(pc.data) * pc.data = NULL */ __pyx_f_11libpetsc4py_delRef(__pyx_v_pc); /* "libpetsc4py.pyx":1272 * finally: * delRef(pc) * Py_DECREF(pc.data) # <<<<<<<<<<<<<< * pc.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_pc->data)); /* "libpetsc4py.pyx":1273 * delRef(pc) * Py_DECREF(pc.data) * pc.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_pc->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L6:; } /* "libpetsc4py.pyx":1274 * Py_DECREF(pc.data) * pc.data = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCSetUp_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1257 * return FunctionEnd() * * cdef PetscErrorCode PCDestroy_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.PCDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1276 * return FunctionEnd() * * cdef PetscErrorCode PCSetUp_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_PCSetUp_Python(PC __pyx_v_pc) { char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PyObject *__pyx_v_o = 0; PCOps __pyx_v_ops; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PCOps __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCSetUp_Python", 0); /* "libpetsc4py.pyx":1280 * ) \ * except IERR with gil: * FunctionBegin(b"PCSetUp_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCSetUp_Python")); /* "libpetsc4py.pyx":1283 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyPC(pc).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":1284 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(pc), b"-pc_python_type", */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":1285 * cdef PetscBool found = PETSC_FALSE * if PyPC(pc).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(pc), b"-pc_python_type", * name,sizeof(name),&found) ) */ __pyx_t_4 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsGetString(NULL, __pyx_f_11libpetsc4py_getPrefix(__pyx_v_pc), ((char *)"-pc_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1285, __pyx_L1_error) /* "libpetsc4py.pyx":1288 * getPrefix(pc), b"-pc_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * if PyPC(pc).self is None: */ if (__pyx_v_found) { } else { __pyx_t_3 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = ((__pyx_v_name[0]) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "libpetsc4py.pyx":1289 * name,sizeof(name),&found) ) * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc,name) ) # <<<<<<<<<<<<<< * if PyPC(pc).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_5 = __pyx_f_11libpetsc4py_PCPythonSetType_PYTHON(__pyx_v_pc, __pyx_v_name); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1289, __pyx_L1_error) __pyx_t_4 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_5); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1289, __pyx_L1_error) /* "libpetsc4py.pyx":1288 * getPrefix(pc), b"-pc_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * if PyPC(pc).self is None: */ } /* "libpetsc4py.pyx":1284 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(pc), b"-pc_python_type", */ } /* "libpetsc4py.pyx":1290 * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1291 * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * if PyPC(pc).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * PCPythonSetType(pc,\"[package.]module.class\")\n" */ __pyx_r = __pyx_f_11libpetsc4py_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * PCPythonSetType(pc,\"[package.]module.class\")\n * PCSetFromOptions(pc) and pass option -pc_python_type [package.]module.class")); goto __pyx_L0; /* "libpetsc4py.pyx":1290 * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * if PyPC(pc).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "libpetsc4py.pyx":1297 * "-pc_python_type [package.]module.class") * # * cdef setUp = PyPC(pc).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(PC_(pc)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":1298 * # * cdef setUp = PyPC(pc).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(PC_(pc)) * # */ __pyx_t_2 = (__pyx_v_setUp != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":1299 * cdef setUp = PyPC(pc).setUp * if setUp is not None: * setUp(PC_(pc)) # <<<<<<<<<<<<<< * # * cdef o = PyPC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":1298 * # * cdef setUp = PyPC(pc).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(PC_(pc)) * # */ } /* "libpetsc4py.pyx":1301 * setUp(PC_(pc)) * # * cdef o = PyPC(pc) # <<<<<<<<<<<<<< * cdef PCOps ops = pc.ops * if o.applyTranspose is None: */ __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_o = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":1302 * # * cdef o = PyPC(pc) * cdef PCOps ops = pc.ops # <<<<<<<<<<<<<< * if o.applyTranspose is None: * ops.applytranspose = NULL */ __pyx_t_9 = __pyx_v_pc->ops; __pyx_v_ops = __pyx_t_9; /* "libpetsc4py.pyx":1303 * cdef o = PyPC(pc) * cdef PCOps ops = pc.ops * if o.applyTranspose is None: # <<<<<<<<<<<<<< * ops.applytranspose = NULL * if o.applySymmetricLeft is None: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_applyTranspose); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = (__pyx_t_6 == Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1304 * cdef PCOps ops = pc.ops * if o.applyTranspose is None: * ops.applytranspose = NULL # <<<<<<<<<<<<<< * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL */ __pyx_v_ops->applytranspose = NULL; /* "libpetsc4py.pyx":1303 * cdef o = PyPC(pc) * cdef PCOps ops = pc.ops * if o.applyTranspose is None: # <<<<<<<<<<<<<< * ops.applytranspose = NULL * if o.applySymmetricLeft is None: */ } /* "libpetsc4py.pyx":1305 * if o.applyTranspose is None: * ops.applytranspose = NULL * if o.applySymmetricLeft is None: # <<<<<<<<<<<<<< * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_applySymmetricLeft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = (__pyx_t_6 == Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":1306 * ops.applytranspose = NULL * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL # <<<<<<<<<<<<<< * if o.applySymmetricRight is None: * ops.applysymmetricright = NULL */ __pyx_v_ops->applysymmetricleft = NULL; /* "libpetsc4py.pyx":1305 * if o.applyTranspose is None: * ops.applytranspose = NULL * if o.applySymmetricLeft is None: # <<<<<<<<<<<<<< * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: */ } /* "libpetsc4py.pyx":1307 * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: # <<<<<<<<<<<<<< * ops.applysymmetricright = NULL * # */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_applySymmetricRight); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = (__pyx_t_6 == Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1308 * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: * ops.applysymmetricright = NULL # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_v_ops->applysymmetricright = NULL; /* "libpetsc4py.pyx":1307 * if o.applySymmetricLeft is None: * ops.applysymmetricleft = NULL * if o.applySymmetricRight is None: # <<<<<<<<<<<<<< * ops.applysymmetricright = NULL * # */ } /* "libpetsc4py.pyx":1310 * ops.applysymmetricright = NULL * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCReset_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1276 * return FunctionEnd() * * cdef PetscErrorCode PCSetUp_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.PCSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_XDECREF(__pyx_v_o); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1312 * return FunctionEnd() * * cdef PetscErrorCode PCReset_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_PCReset_Python(PC __pyx_v_pc) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCReset_Python", 0); /* "libpetsc4py.pyx":1316 * ) \ * except IERR with gil: * if getRef(pc) == 0: return 0 # <<<<<<<<<<<<<< * FunctionBegin(b"PCReset_Python") * cdef reset = PyPC(pc).reset */ __pyx_t_1 = ((__pyx_f_11libpetsc4py_getRef(__pyx_v_pc) == 0) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":1317 * except IERR with gil: * if getRef(pc) == 0: return 0 * FunctionBegin(b"PCReset_Python") # <<<<<<<<<<<<<< * cdef reset = PyPC(pc).reset * if reset is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCReset_Python")); /* "libpetsc4py.pyx":1318 * if getRef(pc) == 0: return 0 * FunctionBegin(b"PCReset_Python") * cdef reset = PyPC(pc).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(PC_(pc)) */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_reset = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1319 * FunctionBegin(b"PCReset_Python") * cdef reset = PyPC(pc).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(PC_(pc)) * return FunctionEnd() */ __pyx_t_1 = (__pyx_v_reset != Py_None); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1320 * cdef reset = PyPC(pc).reset * if reset is not None: * reset(PC_(pc)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_reset); __pyx_t_5 = __pyx_v_reset; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":1319 * FunctionBegin(b"PCReset_Python") * cdef reset = PyPC(pc).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(PC_(pc)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1321 * if reset is not None: * reset(PC_(pc)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCSetFromOptions_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1312 * return FunctionEnd() * * cdef PetscErrorCode PCReset_Python( # <<<<<<<<<<<<<< * PetscPC pc, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.PCReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1323 * return FunctionEnd() * * cdef PetscErrorCode PCSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscPC pc, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCSetFromOptions_Python(PetscOptionItems *__pyx_v_PetscOptionsObject, PC __pyx_v_pc) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCSetFromOptions_Python", 0); /* "libpetsc4py.pyx":1328 * ) \ * except IERR with gil: * FunctionBegin(b"PCSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PyPC(pc).getname() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCSetFromOptions_Python")); /* "libpetsc4py.pyx":1330 * FunctionBegin(b"PCSetFromOptions_Python") * # * cdef char name[2048], *defval = PyPC(pc).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyPC *)((struct __pyx_obj_11libpetsc4py__PyPC *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 1330, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1331 * # * cdef char name[2048], *defval = PyPC(pc).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":1332 * cdef char name[2048], *defval = PyPC(pc).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-pc_python_type",b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "libpetsc4py.pyx":1333 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-pc_python_type",b"Python [package.]module[.{class|function}]", * b"PCPythonSetType",defval,name,sizeof(name),&found) ); opts; */ __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsString(((char *)"-pc_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"PCPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1333, __pyx_L1_error) /* "libpetsc4py.pyx":1335 * CHKERR( PetscOptionsString( * b"-pc_python_type",b"Python [package.]module[.{class|function}]", * b"PCPythonSetType",defval,name,sizeof(name),&found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc,name) ) */ ((void)PetscOptionsObject); /* "libpetsc4py.pyx":1336 * b"-pc_python_type",b"Python [package.]module[.{class|function}]", * b"PCPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":1337 * b"PCPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: * CHKERR( PCPythonSetType_PYTHON(pc,name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyPC(pc).setFromOptions */ __pyx_t_6 = __pyx_f_11libpetsc4py_PCPythonSetType_PYTHON(__pyx_v_pc, __pyx_v_name); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1337, __pyx_L1_error) __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_6); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1337, __pyx_L1_error) /* "libpetsc4py.pyx":1336 * b"-pc_python_type",b"Python [package.]module[.{class|function}]", * b"PCPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * # */ } /* "libpetsc4py.pyx":1339 * CHKERR( PCPythonSetType_PYTHON(pc,name) ) * # * cdef setFromOptions = PyPC(pc).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(PC_(pc)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "libpetsc4py.pyx":1340 * # * cdef setFromOptions = PyPC(pc).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(PC_(pc)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1341 * cdef setFromOptions = PyPC(pc).setFromOptions * if setFromOptions is not None: * setFromOptions(PC_(pc)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "libpetsc4py.pyx":1340 * # * cdef setFromOptions = PyPC(pc).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(PC_(pc)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1342 * if setFromOptions is not None: * setFromOptions(PC_(pc)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCView_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1323 * return FunctionEnd() * * cdef PetscErrorCode PCSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscPC pc, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.PCSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1344 * return FunctionEnd() * * cdef PetscErrorCode PCView_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCView_Python(PC __pyx_v_pc, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCView_Python", 0); /* "libpetsc4py.pyx":1349 * ) \ * except IERR with gil: * FunctionBegin(b"PCView_Python") # <<<<<<<<<<<<<< * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCView_Python")); /* "libpetsc4py.pyx":1350 * except IERR with gil: * FunctionBegin(b"PCView_Python") * viewcontext(PyPC(pc), vwr) # <<<<<<<<<<<<<< * cdef view = PyPC(pc).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_11libpetsc4py_viewcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1351 * FunctionBegin(b"PCView_Python") * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view # <<<<<<<<<<<<<< * if view is not None: * view(PC_(pc), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1352 * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view * if view is not None: # <<<<<<<<<<<<<< * view(PC_(pc), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1353 * cdef view = PyPC(pc).view * if view is not None: * view(PC_(pc), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_view); __pyx_t_7 = __pyx_v_view; __pyx_t_8 = NULL; __pyx_t_2 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_2, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":1352 * viewcontext(PyPC(pc), vwr) * cdef view = PyPC(pc).view * if view is not None: # <<<<<<<<<<<<<< * view(PC_(pc), Viewer_(vwr)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1354 * if view is not None: * view(PC_(pc), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPreSolve_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1344 * return FunctionEnd() * * cdef PetscErrorCode PCView_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.PCView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1356 * return FunctionEnd() * * cdef PetscErrorCode PCPreSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCPreSolve_Python(PC __pyx_v_pc, KSP __pyx_v_ksp, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_preSolve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPreSolve_Python", 0); /* "libpetsc4py.pyx":1363 * ) \ * except IERR with gil: * FunctionBegin(b"PCPreSolve_Python") # <<<<<<<<<<<<<< * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCPreSolve_Python")); /* "libpetsc4py.pyx":1364 * except IERR with gil: * FunctionBegin(b"PCPreSolve_Python") * cdef preSolve = PyPC(pc).preSolve # <<<<<<<<<<<<<< * if preSolve is not None: * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_preSolve); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_preSolve = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1365 * FunctionBegin(b"PCPreSolve_Python") * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: # <<<<<<<<<<<<<< * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_preSolve != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1366 * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_preSolve); __pyx_t_8 = __pyx_v_preSolve; __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1365 * FunctionBegin(b"PCPreSolve_Python") * cdef preSolve = PyPC(pc).preSolve * if preSolve is not None: # <<<<<<<<<<<<<< * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1367 * if preSolve is not None: * preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCPostSolve_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1356 * return FunctionEnd() * * cdef PetscErrorCode PCPreSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.PCPreSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preSolve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1369 * return FunctionEnd() * * cdef PetscErrorCode PCPostSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCPostSolve_Python(PC __pyx_v_pc, KSP __pyx_v_ksp, Vec __pyx_v_b, Vec __pyx_v_x) { PyObject *__pyx_v_postSolve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPostSolve_Python", 0); /* "libpetsc4py.pyx":1376 * ) \ * except IERR with gil: * FunctionBegin(b"PCPostSolve_Python") # <<<<<<<<<<<<<< * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCPostSolve_Python")); /* "libpetsc4py.pyx":1377 * except IERR with gil: * FunctionBegin(b"PCPostSolve_Python") * cdef postSolve = PyPC(pc).postSolve # <<<<<<<<<<<<<< * if postSolve is not None: * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_postSolve); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_postSolve = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1378 * FunctionBegin(b"PCPostSolve_Python") * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: # <<<<<<<<<<<<<< * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_postSolve != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1379 * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_postSolve); __pyx_t_8 = __pyx_v_postSolve; __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1378 * FunctionBegin(b"PCPostSolve_Python") * cdef postSolve = PyPC(pc).postSolve * if postSolve is not None: # <<<<<<<<<<<<<< * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1380 * if postSolve is not None: * postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApply_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1369 * return FunctionEnd() * * cdef PetscErrorCode PCPostSolve_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscKSP ksp, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.PCPostSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_postSolve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1382 * return FunctionEnd() * * cdef PetscErrorCode PCApply_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCApply_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_apply = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApply_Python", 0); /* "libpetsc4py.pyx":1388 * ) \ * except IERR with gil: * FunctionBegin(b"PCApply_Python") # <<<<<<<<<<<<<< * cdef apply = PyPC(pc).apply * apply(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCApply_Python")); /* "libpetsc4py.pyx":1389 * except IERR with gil: * FunctionBegin(b"PCApply_Python") * cdef apply = PyPC(pc).apply # <<<<<<<<<<<<<< * apply(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_apply); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_apply = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1390 * FunctionBegin(b"PCApply_Python") * cdef apply = PyPC(pc).apply * apply(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_apply); __pyx_t_5 = __pyx_v_apply; __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1391 * cdef apply = PyPC(pc).apply * apply(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApplyTranspose_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1382 * return FunctionEnd() * * cdef PetscErrorCode PCApply_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.PCApply_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_apply); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1393 * return FunctionEnd() * * cdef PetscErrorCode PCApplyTranspose_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCApplyTranspose_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_applyTranspose = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApplyTranspose_Python", 0); /* "libpetsc4py.pyx":1399 * ) \ * except IERR with gil: * FunctionBegin(b"PCApplyTranspose_Python") # <<<<<<<<<<<<<< * cdef applyTranspose = PyPC(pc).applyTranspose * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCApplyTranspose_Python")); /* "libpetsc4py.pyx":1400 * except IERR with gil: * FunctionBegin(b"PCApplyTranspose_Python") * cdef applyTranspose = PyPC(pc).applyTranspose # <<<<<<<<<<<<<< * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_applyTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_applyTranspose = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1401 * FunctionBegin(b"PCApplyTranspose_Python") * cdef applyTranspose = PyPC(pc).applyTranspose * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_applyTranspose); __pyx_t_5 = __pyx_v_applyTranspose; __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1402 * cdef applyTranspose = PyPC(pc).applyTranspose * applyTranspose(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApplySymmetricLeft_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1393 * return FunctionEnd() * * cdef PetscErrorCode PCApplyTranspose_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.PCApplyTranspose_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_applyTranspose); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1404 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricLeft_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCApplySymmetricLeft_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_applySymmetricLeft = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApplySymmetricLeft_Python", 0); /* "libpetsc4py.pyx":1410 * ) \ * except IERR with gil: * FunctionBegin(b"PCApplySymmetricLeft_Python") # <<<<<<<<<<<<<< * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCApplySymmetricLeft_Python")); /* "libpetsc4py.pyx":1411 * except IERR with gil: * FunctionBegin(b"PCApplySymmetricLeft_Python") * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft # <<<<<<<<<<<<<< * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_applySymmetricLeft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_applySymmetricLeft = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1412 * FunctionBegin(b"PCApplySymmetricLeft_Python") * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_applySymmetricLeft); __pyx_t_5 = __pyx_v_applySymmetricLeft; __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1413 * cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft * applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode PCApplySymmetricRight_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1404 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricLeft_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.PCApplySymmetricLeft_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_applySymmetricLeft); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1415 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricRight_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_PCApplySymmetricRight_Python(PC __pyx_v_pc, Vec __pyx_v_x, Vec __pyx_v_y) { PyObject *__pyx_v_applySymmetricRight = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCApplySymmetricRight_Python", 0); /* "libpetsc4py.pyx":1421 * ) \ * except IERR with gil: * FunctionBegin(b"PCApplySymmetricRight_Python") # <<<<<<<<<<<<<< * cdef applySymmetricRight = PyPC(pc).applySymmetricRight * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PCApplySymmetricRight_Python")); /* "libpetsc4py.pyx":1422 * except IERR with gil: * FunctionBegin(b"PCApplySymmetricRight_Python") * cdef applySymmetricRight = PyPC(pc).applySymmetricRight # <<<<<<<<<<<<<< * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_applySymmetricRight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_applySymmetricRight = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1423 * FunctionBegin(b"PCApplySymmetricRight_Python") * cdef applySymmetricRight = PyPC(pc).applySymmetricRight * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_applySymmetricRight); __pyx_t_5 = __pyx_v_applySymmetricRight; __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_1, __pyx_t_3, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1424 * cdef applySymmetricRight = PyPC(pc).applySymmetricRight * applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1415 * return FunctionEnd() * * cdef PetscErrorCode PCApplySymmetricRight_Python( # <<<<<<<<<<<<<< * PetscPC pc, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.PCApplySymmetricRight_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_applySymmetricRight); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1478 * @cython.internal * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): # <<<<<<<<<<<<<< * if ksp != NULL and ksp.data != NULL: * return <_PyKSP>ksp.data */ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyKSP *__pyx_f_11libpetsc4py_PyKSP(KSP __pyx_v_ksp) { struct __pyx_obj_11libpetsc4py__PyKSP *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyKSP", 0); /* "libpetsc4py.pyx":1479 * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: # <<<<<<<<<<<<<< * return <_PyKSP>ksp.data * else: */ __pyx_t_2 = ((__pyx_v_ksp != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_ksp->data != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "libpetsc4py.pyx":1480 * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: * return <_PyKSP>ksp.data # <<<<<<<<<<<<<< * else: * return _PyKSP.__new__(_PyKSP) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_v_ksp->data))); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_v_ksp->data); goto __pyx_L0; /* "libpetsc4py.pyx":1479 * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): * if ksp != NULL and ksp.data != NULL: # <<<<<<<<<<<<<< * return <_PyKSP>ksp.data * else: */ } /* "libpetsc4py.pyx":1482 * return <_PyKSP>ksp.data * else: * return _PyKSP.__new__(_PyKSP) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_3 = ((PyObject *)__pyx_tp_new_11libpetsc4py__PyKSP(((PyTypeObject *)__pyx_ptype_11libpetsc4py__PyKSP), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1482, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":1478 * @cython.internal * cdef class _PyKSP(_PyObj): pass * cdef inline _PyKSP PyKSP(PetscKSP ksp): # <<<<<<<<<<<<<< * if ksp != NULL and ksp.data != NULL: * return <_PyKSP>ksp.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.PyKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1484 * return _PyKSP.__new__(_PyKSP) * * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"KSPPythonGetContext") */ PetscErrorCode KSPPythonGetContext(KSP __pyx_v_ksp, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("KSPPythonGetContext", 0); /* "libpetsc4py.pyx":1486 * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ * except IERR: * FunctionBegin(b"KSPPythonGetContext") # <<<<<<<<<<<<<< * PyKSP(ksp).getcontext(ctx) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPPythonGetContext")); /* "libpetsc4py.pyx":1487 * except IERR: * FunctionBegin(b"KSPPythonGetContext") * PyKSP(ksp).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyKSP *)((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1488 * FunctionBegin(b"KSPPythonGetContext") * PyKSP(ksp).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1484 * return _PyKSP.__new__(_PyKSP) * * cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"KSPPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.KSPPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1490 * return FunctionEnd() * * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"KSPPythonSetContext") */ PetscErrorCode KSPPythonSetContext(KSP __pyx_v_ksp, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("KSPPythonSetContext", 0); /* "libpetsc4py.pyx":1492 * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ * except IERR: * FunctionBegin(b"KSPPythonSetContext") # <<<<<<<<<<<<<< * PyKSP(ksp).setcontext(ctx, KSP_(ksp)) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPPythonSetContext")); /* "libpetsc4py.pyx":1493 * except IERR: * FunctionBegin(b"KSPPythonSetContext") * PyKSP(ksp).setcontext(ctx, KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_11libpetsc4py__PyKSP *)((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1494 * FunctionBegin(b"KSPPythonSetContext") * PyKSP(ksp).setcontext(ctx, KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1490 * return FunctionEnd() * * cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"KSPPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.KSPPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1496 * return FunctionEnd() * * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPPythonSetType_PYTHON(KSP __pyx_v_ksp, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPPythonSetType_PYTHON", 0); /* "libpetsc4py.pyx":1498 * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ * except IERR with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPPythonSetType_PYTHON")); /* "libpetsc4py.pyx":1499 * except IERR with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * KSPPythonSetContext(ksp, ctx) */ __pyx_t_1 = ((__pyx_v_name == NULL) != 0); if (__pyx_t_1) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":1500 * FunctionBegin(b"KSPPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * KSPPythonSetContext(ksp, ctx) * PyKSP(ksp).setname(name) */ __pyx_t_2 = __pyx_f_11libpetsc4py_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1501 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * KSPPythonSetContext(ksp, ctx) # <<<<<<<<<<<<<< * PyKSP(ksp).setname(name) * return FunctionEnd() */ __pyx_t_3 = KSPPythonSetContext(__pyx_v_ksp, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1501, __pyx_L1_error) /* "libpetsc4py.pyx":1502 * cdef object ctx = createcontext(name) * KSPPythonSetContext(ksp, ctx) * PyKSP(ksp).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_11libpetsc4py__PyKSP *)((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1502, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1503 * KSPPythonSetContext(ksp, ctx) * PyKSP(ksp).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPCreate_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1496 * return FunctionEnd() * * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"KSPPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.KSPPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1505 * return FunctionEnd() * * cdef PetscErrorCode KSPCreate_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPCreate_Python(KSP __pyx_v_ksp) { KSPOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations KSPOps __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPCreate_Python", 0); /* "libpetsc4py.pyx":1509 * ) \ * except IERR with gil: * FunctionBegin(b"KSPCreate_Python") # <<<<<<<<<<<<<< * # * cdef KSPOps ops = ksp.ops */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPCreate_Python")); /* "libpetsc4py.pyx":1511 * FunctionBegin(b"KSPCreate_Python") * # * cdef KSPOps ops = ksp.ops # <<<<<<<<<<<<<< * ops.reset = KSPReset_Python * ops.destroy = KSPDestroy_Python */ __pyx_t_1 = __pyx_v_ksp->ops; __pyx_v_ops = __pyx_t_1; /* "libpetsc4py.pyx":1512 * # * cdef KSPOps ops = ksp.ops * ops.reset = KSPReset_Python # <<<<<<<<<<<<<< * ops.destroy = KSPDestroy_Python * ops.setup = KSPSetUp_Python */ __pyx_v_ops->reset = __pyx_f_11libpetsc4py_KSPReset_Python; /* "libpetsc4py.pyx":1513 * cdef KSPOps ops = ksp.ops * ops.reset = KSPReset_Python * ops.destroy = KSPDestroy_Python # <<<<<<<<<<<<<< * ops.setup = KSPSetUp_Python * ops.setfromoptions = KSPSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_11libpetsc4py_KSPDestroy_Python; /* "libpetsc4py.pyx":1514 * ops.reset = KSPReset_Python * ops.destroy = KSPDestroy_Python * ops.setup = KSPSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = KSPSetFromOptions_Python * ops.view = KSPView_Python */ __pyx_v_ops->setup = __pyx_f_11libpetsc4py_KSPSetUp_Python; /* "libpetsc4py.pyx":1515 * ops.destroy = KSPDestroy_Python * ops.setup = KSPSetUp_Python * ops.setfromoptions = KSPSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = KSPView_Python * ops.solve = KSPSolve_Python */ __pyx_v_ops->setfromoptions = __pyx_f_11libpetsc4py_KSPSetFromOptions_Python; /* "libpetsc4py.pyx":1516 * ops.setup = KSPSetUp_Python * ops.setfromoptions = KSPSetFromOptions_Python * ops.view = KSPView_Python # <<<<<<<<<<<<<< * ops.solve = KSPSolve_Python * ops.buildsolution = KSPBuildSolution_Python */ __pyx_v_ops->view = __pyx_f_11libpetsc4py_KSPView_Python; /* "libpetsc4py.pyx":1517 * ops.setfromoptions = KSPSetFromOptions_Python * ops.view = KSPView_Python * ops.solve = KSPSolve_Python # <<<<<<<<<<<<<< * ops.buildsolution = KSPBuildSolution_Python * ops.buildresidual = KSPBuildResidual_Python */ __pyx_v_ops->solve = __pyx_f_11libpetsc4py_KSPSolve_Python; /* "libpetsc4py.pyx":1518 * ops.view = KSPView_Python * ops.solve = KSPSolve_Python * ops.buildsolution = KSPBuildSolution_Python # <<<<<<<<<<<<<< * ops.buildresidual = KSPBuildResidual_Python * # */ __pyx_v_ops->buildsolution = __pyx_f_11libpetsc4py_KSPBuildSolution_Python; /* "libpetsc4py.pyx":1519 * ops.solve = KSPSolve_Python * ops.buildsolution = KSPBuildSolution_Python * ops.buildresidual = KSPBuildResidual_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->buildresidual = __pyx_f_11libpetsc4py_KSPBuildResidual_Python; /* "libpetsc4py.pyx":1521 * ops.buildresidual = KSPBuildResidual_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ksp, b"KSPPythonSetType_C", * KSPPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ksp), ((char *)"KSPPythonSetType_C"), ((PetscVoidFunction)__pyx_f_11libpetsc4py_KSPPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1521, __pyx_L1_error) /* "libpetsc4py.pyx":1525 * KSPPythonSetType_PYTHON) ) * # * cdef ctx = PyKSP(NULL) # <<<<<<<<<<<<<< * ksp.data = ctx * Py_INCREF(ksp.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1526 * # * cdef ctx = PyKSP(NULL) * ksp.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(ksp.data) * # */ __pyx_v_ksp->data = ((void *)__pyx_v_ctx); /* "libpetsc4py.pyx":1527 * cdef ctx = PyKSP(NULL) * ksp.data = ctx * Py_INCREF(ksp.data) # <<<<<<<<<<<<<< * # * CHKERR( KSPSetSupportedNorm( */ Py_INCREF(((PyObject *)__pyx_v_ksp->data)); /* "libpetsc4py.pyx":1529 * Py_INCREF(ksp.data) * # * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_PRECONDITIONED, PC_LEFT, 3) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_PRECONDITIONED, PC_LEFT, 3)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1529, __pyx_L1_error) /* "libpetsc4py.pyx":1531 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_PRECONDITIONED, PC_LEFT, 3) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_UNPRECONDITIONED, PC_RIGHT, 3) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_UNPRECONDITIONED, PC_RIGHT, 3)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1531, __pyx_L1_error) /* "libpetsc4py.pyx":1533 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_UNPRECONDITIONED, PC_RIGHT, 3) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_UNPRECONDITIONED, PC_LEFT, 2) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_UNPRECONDITIONED, PC_LEFT, 2)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1533, __pyx_L1_error) /* "libpetsc4py.pyx":1535 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_UNPRECONDITIONED, PC_LEFT, 2) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_PRECONDITIONED, PC_RIGHT, 2) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_PRECONDITIONED, PC_RIGHT, 2)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1535, __pyx_L1_error) /* "libpetsc4py.pyx":1537 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_PRECONDITIONED, PC_RIGHT, 2) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_PRECONDITIONED, PC_SYMMETRIC, 1) ) * CHKERR( KSPSetSupportedNorm( */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_PRECONDITIONED, PC_SYMMETRIC, 1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1537, __pyx_L1_error) /* "libpetsc4py.pyx":1539 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_PRECONDITIONED, PC_SYMMETRIC, 1) ) * CHKERR( KSPSetSupportedNorm( # <<<<<<<<<<<<<< * ksp, KSP_NORM_UNPRECONDITIONED, PC_SYMMETRIC, 1) ) * return FunctionEnd() */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(KSPSetSupportedNorm(__pyx_v_ksp, KSP_NORM_UNPRECONDITIONED, PC_SYMMETRIC, 1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1539, __pyx_L1_error) /* "libpetsc4py.pyx":1541 * CHKERR( KSPSetSupportedNorm( * ksp, KSP_NORM_UNPRECONDITIONED, PC_SYMMETRIC, 1) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPDestroy_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1505 * return FunctionEnd() * * cdef PetscErrorCode KSPCreate_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.KSPCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1543 * return FunctionEnd() * * cdef PetscErrorCode KSPDestroy_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPDestroy_Python(KSP __pyx_v_ksp) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPDestroy_Python", 0); /* "libpetsc4py.pyx":1547 * ) \ * except IERR with gil: * FunctionBegin(b"KSPDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * ksp, b"KSPPythonSetType_C", */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPDestroy_Python")); /* "libpetsc4py.pyx":1548 * except IERR with gil: * FunctionBegin(b"KSPDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ksp, b"KSPPythonSetType_C", * NULL)) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ksp), ((char *)"KSPPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1548, __pyx_L1_error) /* "libpetsc4py.pyx":1552 * NULL)) * # * if not Py_IsInitialized(): return FunctionEnd() # <<<<<<<<<<<<<< * try: * addRef(ksp) */ __pyx_t_2 = ((!(Py_IsInitialized() != 0)) != 0); if (__pyx_t_2) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":1553 * # * if not Py_IsInitialized(): return FunctionEnd() * try: # <<<<<<<<<<<<<< * addRef(ksp) * KSPPythonSetContext(ksp, NULL) */ /*try:*/ { /* "libpetsc4py.pyx":1554 * if not Py_IsInitialized(): return FunctionEnd() * try: * addRef(ksp) # <<<<<<<<<<<<<< * KSPPythonSetContext(ksp, NULL) * finally: */ __pyx_f_11libpetsc4py_addRef(__pyx_v_ksp); /* "libpetsc4py.pyx":1555 * try: * addRef(ksp) * KSPPythonSetContext(ksp, NULL) # <<<<<<<<<<<<<< * finally: * delRef(ksp) */ __pyx_t_3 = KSPPythonSetContext(__pyx_v_ksp, NULL); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1555, __pyx_L5_error) } /* "libpetsc4py.pyx":1557 * KSPPythonSetContext(ksp, NULL) * finally: * delRef(ksp) # <<<<<<<<<<<<<< * Py_DECREF(ksp.data) * ksp.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_11libpetsc4py_delRef(__pyx_v_ksp); /* "libpetsc4py.pyx":1558 * finally: * delRef(ksp) * Py_DECREF(ksp.data) # <<<<<<<<<<<<<< * ksp.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_ksp->data)); /* "libpetsc4py.pyx":1559 * delRef(ksp) * Py_DECREF(ksp.data) * ksp.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ksp->data = NULL; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_1 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { /* "libpetsc4py.pyx":1557 * KSPPythonSetContext(ksp, NULL) * finally: * delRef(ksp) # <<<<<<<<<<<<<< * Py_DECREF(ksp.data) * ksp.data = NULL */ __pyx_f_11libpetsc4py_delRef(__pyx_v_ksp); /* "libpetsc4py.pyx":1558 * finally: * delRef(ksp) * Py_DECREF(ksp.data) # <<<<<<<<<<<<<< * ksp.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_ksp->data)); /* "libpetsc4py.pyx":1559 * delRef(ksp) * Py_DECREF(ksp.data) * ksp.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ksp->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L6:; } /* "libpetsc4py.pyx":1560 * Py_DECREF(ksp.data) * ksp.data = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSetUp_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1543 * return FunctionEnd() * * cdef PetscErrorCode KSPDestroy_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.KSPDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1562 * return FunctionEnd() * * cdef PetscErrorCode KSPSetUp_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSetUp_Python(KSP __pyx_v_ksp) { char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPSetUp_Python", 0); /* "libpetsc4py.pyx":1566 * ) \ * except IERR with gil: * FunctionBegin(b"KSPSetUp_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPSetUp_Python")); /* "libpetsc4py.pyx":1569 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyKSP(ksp).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":1570 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ksp), b"-ksp_python_type", */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":1571 * cdef PetscBool found = PETSC_FALSE * if PyKSP(ksp).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(ksp), b"-ksp_python_type", * name,sizeof(name),&found) ) */ __pyx_t_4 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsGetString(NULL, __pyx_f_11libpetsc4py_getPrefix(__pyx_v_ksp), ((char *)"-ksp_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1571, __pyx_L1_error) /* "libpetsc4py.pyx":1574 * getPrefix(ksp), b"-ksp_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * if PyKSP(ksp).self is None: */ if (__pyx_v_found) { } else { __pyx_t_3 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = ((__pyx_v_name[0]) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "libpetsc4py.pyx":1575 * name,sizeof(name),&found) ) * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) # <<<<<<<<<<<<<< * if PyKSP(ksp).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_5 = __pyx_f_11libpetsc4py_KSPPythonSetType_PYTHON(__pyx_v_ksp, __pyx_v_name); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1575, __pyx_L1_error) __pyx_t_4 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_5); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1575, __pyx_L1_error) /* "libpetsc4py.pyx":1574 * getPrefix(ksp), b"-ksp_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * if PyKSP(ksp).self is None: */ } /* "libpetsc4py.pyx":1570 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ksp), b"-ksp_python_type", */ } /* "libpetsc4py.pyx":1576 * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1577 * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * if PyKSP(ksp).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * KSPPythonSetType(ksp,\"[package.]module.class\")\n" */ __pyx_r = __pyx_f_11libpetsc4py_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * KSPPythonSetType(ksp,\"[package.]module.class\")\n * KSPSetFromOptions(ksp) and pass option -ksp_python_type [package.]module.class")); goto __pyx_L0; /* "libpetsc4py.pyx":1576 * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * if PyKSP(ksp).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "libpetsc4py.pyx":1583 * "-ksp_python_type [package.]module.class") * # * cdef setUp = PyKSP(ksp).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":1584 * # * cdef setUp = PyKSP(ksp).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_2 = (__pyx_v_setUp != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":1585 * cdef setUp = PyKSP(ksp).setUp * if setUp is not None: * setUp(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":1584 * # * cdef setUp = PyKSP(ksp).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(KSP_(ksp)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1586 * if setUp is not None: * setUp(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPReset_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1562 * return FunctionEnd() * * cdef PetscErrorCode KSPSetUp_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.KSPSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1588 * return FunctionEnd() * * cdef PetscErrorCode KSPReset_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPReset_Python(KSP __pyx_v_ksp) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPReset_Python", 0); /* "libpetsc4py.pyx":1592 * ) \ * except IERR with gil: * if getRef(ksp) == 0: return 0 # <<<<<<<<<<<<<< * FunctionBegin(b"KSPReset_Python") * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_sol",NULL) ) */ __pyx_t_1 = ((__pyx_f_11libpetsc4py_getRef(__pyx_v_ksp) == 0) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":1593 * except IERR with gil: * if getRef(ksp) == 0: return 0 * FunctionBegin(b"KSPReset_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_sol",NULL) ) * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_res",NULL) ) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPReset_Python")); /* "libpetsc4py.pyx":1594 * if getRef(ksp) == 0: return 0 * FunctionBegin(b"KSPReset_Python") * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_sol",NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_res",NULL) ) * cdef reset = PyKSP(ksp).reset */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_sol"), NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1594, __pyx_L1_error) /* "libpetsc4py.pyx":1595 * FunctionBegin(b"KSPReset_Python") * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_sol",NULL) ) * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_res",NULL) ) # <<<<<<<<<<<<<< * cdef reset = PyKSP(ksp).reset * if reset is not None: */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_res"), NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1595, __pyx_L1_error) /* "libpetsc4py.pyx":1596 * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_sol",NULL) ) * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_res",NULL) ) * cdef reset = PyKSP(ksp).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(KSP_(ksp)) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_reset = __pyx_t_4; __pyx_t_4 = 0; /* "libpetsc4py.pyx":1597 * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_res",NULL) ) * cdef reset = PyKSP(ksp).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_1 = (__pyx_v_reset != Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1598 * cdef reset = PyKSP(ksp).reset * if reset is not None: * reset(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_reset); __pyx_t_6 = __pyx_v_reset; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "libpetsc4py.pyx":1597 * CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_res",NULL) ) * cdef reset = PyKSP(ksp).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(KSP_(ksp)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1599 * if reset is not None: * reset(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSetFromOptions_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1588 * return FunctionEnd() * * cdef PetscErrorCode KSPReset_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("libpetsc4py.KSPReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1601 * return FunctionEnd() * * cdef PetscErrorCode KSPSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscKSP ksp, */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSetFromOptions_Python(PetscOptionItems *__pyx_v_PetscOptionsObject, KSP __pyx_v_ksp) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPSetFromOptions_Python", 0); /* "libpetsc4py.pyx":1606 * ) \ * except IERR with gil: * FunctionBegin(b"KSPSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PyKSP(ksp).getname() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPSetFromOptions_Python")); /* "libpetsc4py.pyx":1608 * FunctionBegin(b"KSPSetFromOptions_Python") * # * cdef char name[2048], *defval = PyKSP(ksp).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyKSP *)((struct __pyx_obj_11libpetsc4py__PyKSP *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 1608, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1609 * # * cdef char name[2048], *defval = PyKSP(ksp).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":1610 * cdef char name[2048], *defval = PyKSP(ksp).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-ksp_python_type",b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "libpetsc4py.pyx":1611 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-ksp_python_type",b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType",defval,name,sizeof(name),&found) ); opts; */ __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsString(((char *)"-ksp_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"KSPPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1611, __pyx_L1_error) /* "libpetsc4py.pyx":1613 * CHKERR( PetscOptionsString( * b"-ksp_python_type",b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType",defval,name,sizeof(name),&found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) */ ((void)PetscOptionsObject); /* "libpetsc4py.pyx":1614 * b"-ksp_python_type",b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":1615 * b"KSPPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyKSP(ksp).setFromOptions */ __pyx_t_6 = __pyx_f_11libpetsc4py_KSPPythonSetType_PYTHON(__pyx_v_ksp, __pyx_v_name); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1615, __pyx_L1_error) __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_6); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1615, __pyx_L1_error) /* "libpetsc4py.pyx":1614 * b"-ksp_python_type",b"Python [package.]module[.{class|function}]", * b"KSPPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * # */ } /* "libpetsc4py.pyx":1617 * CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) * # * cdef setFromOptions = PyKSP(ksp).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "libpetsc4py.pyx":1618 * # * cdef setFromOptions = PyKSP(ksp).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1619 * cdef setFromOptions = PyKSP(ksp).setFromOptions * if setFromOptions is not None: * setFromOptions(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "libpetsc4py.pyx":1618 * # * cdef setFromOptions = PyKSP(ksp).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(KSP_(ksp)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1620 * if setFromOptions is not None: * setFromOptions(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPView_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1601 * return FunctionEnd() * * cdef PetscErrorCode KSPSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscKSP ksp, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.KSPSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1622 * return FunctionEnd() * * cdef PetscErrorCode KSPView_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPView_Python(KSP __pyx_v_ksp, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPView_Python", 0); /* "libpetsc4py.pyx":1627 * ) \ * except IERR with gil: * FunctionBegin(b"KSPView_Python") # <<<<<<<<<<<<<< * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPView_Python")); /* "libpetsc4py.pyx":1628 * except IERR with gil: * FunctionBegin(b"KSPView_Python") * viewcontext(PyKSP(ksp), vwr) # <<<<<<<<<<<<<< * cdef view = PyKSP(ksp).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_11libpetsc4py_viewcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1629 * FunctionBegin(b"KSPView_Python") * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view # <<<<<<<<<<<<<< * if view is not None: * view(KSP_(ksp), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1630 * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view * if view is not None: # <<<<<<<<<<<<<< * view(KSP_(ksp), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1631 * cdef view = PyKSP(ksp).view * if view is not None: * view(KSP_(ksp), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_view); __pyx_t_7 = __pyx_v_view; __pyx_t_8 = NULL; __pyx_t_2 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_2, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":1630 * viewcontext(PyKSP(ksp), vwr) * cdef view = PyKSP(ksp).view * if view is not None: # <<<<<<<<<<<<<< * view(KSP_(ksp), Viewer_(vwr)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1632 * if view is not None: * view(KSP_(ksp), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPBuildSolution_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1622 * return FunctionEnd() * * cdef PetscErrorCode KSPView_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.KSPView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1634 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildSolution_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec v, */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPBuildSolution_Python(KSP __pyx_v_ksp, Vec __pyx_v_v, Vec *__pyx_v_V) { Vec __pyx_v_x; PyObject *__pyx_v_buildSolution = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPBuildSolution_Python", 0); /* "libpetsc4py.pyx":1640 * ) \ * except IERR with gil: * FunctionBegin(b"KSPBuildSolution_Python") # <<<<<<<<<<<<<< * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPBuildSolution_Python")); /* "libpetsc4py.pyx":1641 * except IERR with gil: * FunctionBegin(b"KSPBuildSolution_Python") * cdef PetscVec x = v # <<<<<<<<<<<<<< * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: */ __pyx_v_x = __pyx_v_v; /* "libpetsc4py.pyx":1642 * FunctionBegin(b"KSPBuildSolution_Python") * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution # <<<<<<<<<<<<<< * if buildSolution is not None: * if x == NULL: pass # XXX */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_buildSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_buildSolution = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1643 * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: # <<<<<<<<<<<<<< * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) */ __pyx_t_3 = (__pyx_v_buildSolution != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1644 * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: * if x == NULL: pass # XXX # <<<<<<<<<<<<<< * buildSolution(KSP_(ksp), Vec_(x)) * if V != NULL: V[0] = x */ __pyx_t_4 = ((__pyx_v_x == NULL) != 0); if (__pyx_t_4) { } /* "libpetsc4py.pyx":1645 * if buildSolution is not None: * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) # <<<<<<<<<<<<<< * if V != NULL: V[0] = x * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_buildSolution); __pyx_t_6 = __pyx_v_buildSolution; __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_t_5}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1646 * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) * if V != NULL: V[0] = x # <<<<<<<<<<<<<< * else: * CHKERR( KSPBuildSolutionDefault(ksp, v, V) ) */ __pyx_t_4 = ((__pyx_v_V != NULL) != 0); if (__pyx_t_4) { (__pyx_v_V[0]) = __pyx_v_x; } /* "libpetsc4py.pyx":1643 * cdef PetscVec x = v * cdef buildSolution = PyKSP(ksp).buildSolution * if buildSolution is not None: # <<<<<<<<<<<<<< * if x == NULL: pass # XXX * buildSolution(KSP_(ksp), Vec_(x)) */ goto __pyx_L3; } /* "libpetsc4py.pyx":1648 * if V != NULL: V[0] = x * else: * CHKERR( KSPBuildSolutionDefault(ksp, v, V) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_8 = __pyx_f_11libpetsc4py_CHKERR(KSPBuildSolutionDefault(__pyx_v_ksp, __pyx_v_v, __pyx_v_V)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1648, __pyx_L1_error) } __pyx_L3:; /* "libpetsc4py.pyx":1649 * else: * CHKERR( KSPBuildSolutionDefault(ksp, v, V) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPBuildResidual_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1634 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildSolution_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.KSPBuildSolution_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buildSolution); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1651 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildResidual_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec t, */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPBuildResidual_Python(KSP __pyx_v_ksp, Vec __pyx_v_t, Vec __pyx_v_v, Vec *__pyx_v_V) { PyObject *__pyx_v_buildResidual = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPBuildResidual_Python", 0); /* "libpetsc4py.pyx":1658 * ) \ * except IERR with gil: * FunctionBegin(b"KSPBuildResidual_Python") # <<<<<<<<<<<<<< * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPBuildResidual_Python")); /* "libpetsc4py.pyx":1659 * except IERR with gil: * FunctionBegin(b"KSPBuildResidual_Python") * cdef buildResidual = PyKSP(ksp).buildResidual # <<<<<<<<<<<<<< * if buildResidual is not None: * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_buildResidual); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_buildResidual = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1660 * FunctionBegin(b"KSPBuildResidual_Python") * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: # <<<<<<<<<<<<<< * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) * if V != NULL: V[0] = v */ __pyx_t_3 = (__pyx_v_buildResidual != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1661 * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) # <<<<<<<<<<<<<< * if V != NULL: V[0] = v * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_t)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_buildResidual); __pyx_t_7 = __pyx_v_buildResidual; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1662 * if buildResidual is not None: * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) * if V != NULL: V[0] = v # <<<<<<<<<<<<<< * else: * CHKERR( KSPBuildResidualDefault(ksp, t, v, V) ) */ __pyx_t_4 = ((__pyx_v_V != NULL) != 0); if (__pyx_t_4) { (__pyx_v_V[0]) = __pyx_v_v; } /* "libpetsc4py.pyx":1660 * FunctionBegin(b"KSPBuildResidual_Python") * cdef buildResidual = PyKSP(ksp).buildResidual * if buildResidual is not None: # <<<<<<<<<<<<<< * buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) * if V != NULL: V[0] = v */ goto __pyx_L3; } /* "libpetsc4py.pyx":1664 * if V != NULL: V[0] = v * else: * CHKERR( KSPBuildResidualDefault(ksp, t, v, V) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(KSPBuildResidualDefault(__pyx_v_ksp, __pyx_v_t, __pyx_v_v, __pyx_v_V)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 1664, __pyx_L1_error) } __pyx_L3:; /* "libpetsc4py.pyx":1665 * else: * CHKERR( KSPBuildResidualDefault(ksp, t, v, V) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSolve_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1651 * return FunctionEnd() * * cdef PetscErrorCode KSPBuildResidual_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.KSPBuildResidual_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buildResidual); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1667 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSolve_Python(KSP __pyx_v_ksp) { Vec __pyx_v_B; Vec __pyx_v_X; PyObject *__pyx_v_solve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PetscErrorCode __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPSolve_Python", 0); /* "libpetsc4py.pyx":1671 * ) \ * except IERR with gil: * FunctionBegin(b"KSPSolve_Python") # <<<<<<<<<<<<<< * cdef PetscVec B = NULL, X = NULL * CHKERR( KSPGetRhs(ksp,&B) ) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPSolve_Python")); /* "libpetsc4py.pyx":1672 * except IERR with gil: * FunctionBegin(b"KSPSolve_Python") * cdef PetscVec B = NULL, X = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(ksp,&B) ) * CHKERR( KSPGetSolution(ksp,&X) ) */ __pyx_v_B = NULL; __pyx_v_X = NULL; /* "libpetsc4py.pyx":1673 * FunctionBegin(b"KSPSolve_Python") * cdef PetscVec B = NULL, X = NULL * CHKERR( KSPGetRhs(ksp,&B) ) # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(ksp,&X) ) * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPGetRhs(__pyx_v_ksp, (&__pyx_v_B))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1673, __pyx_L1_error) /* "libpetsc4py.pyx":1674 * cdef PetscVec B = NULL, X = NULL * CHKERR( KSPGetRhs(ksp,&B) ) * CHKERR( KSPGetSolution(ksp,&X) ) # <<<<<<<<<<<<<< * # * ksp.iter = 0 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPGetSolution(__pyx_v_ksp, (&__pyx_v_X))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1674, __pyx_L1_error) /* "libpetsc4py.pyx":1676 * CHKERR( KSPGetSolution(ksp,&X) ) * # * ksp.iter = 0 # <<<<<<<<<<<<<< * ksp.reason = KSP_CONVERGED_ITERATING * # */ __pyx_v_ksp->its = 0; /* "libpetsc4py.pyx":1677 * # * ksp.iter = 0 * ksp.reason = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # * cdef solve = None */ __pyx_v_ksp->reason = KSP_CONVERGED_ITERATING; /* "libpetsc4py.pyx":1679 * ksp.reason = KSP_CONVERGED_ITERATING * # * cdef solve = None # <<<<<<<<<<<<<< * if ksp.transpose_solve: * solve = PyKSP(ksp).solveTranspose */ __Pyx_INCREF(Py_None); __pyx_v_solve = Py_None; /* "libpetsc4py.pyx":1680 * # * cdef solve = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * solve = PyKSP(ksp).solveTranspose * else: */ if (__pyx_v_ksp->transpose_solve) { /* "libpetsc4py.pyx":1681 * cdef solve = None * if ksp.transpose_solve: * solve = PyKSP(ksp).solveTranspose # <<<<<<<<<<<<<< * else: * solve = PyKSP(ksp).solve */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_solveTranspose); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_solve, __pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":1680 * # * cdef solve = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * solve = PyKSP(ksp).solveTranspose * else: */ goto __pyx_L3; } /* "libpetsc4py.pyx":1683 * solve = PyKSP(ksp).solveTranspose * else: * solve = PyKSP(ksp).solve # <<<<<<<<<<<<<< * if solve is not None: * solve(KSP_(ksp),Vec_(B),Vec_(X)) */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_solve); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_solve, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "libpetsc4py.pyx":1684 * else: * solve = PyKSP(ksp).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(KSP_(ksp),Vec_(B),Vec_(X)) * else: */ __pyx_t_4 = (__pyx_v_solve != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1685 * solve = PyKSP(ksp).solve * if solve is not None: * solve(KSP_(ksp),Vec_(B),Vec_(X)) # <<<<<<<<<<<<<< * else: * KSPSolve_Python_default(ksp,B,X) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_B)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_solve); __pyx_t_8 = __pyx_v_solve; __pyx_t_9 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_3, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_3, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_1, __pyx_t_7); __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1684 * else: * solve = PyKSP(ksp).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(KSP_(ksp),Vec_(B),Vec_(X)) * else: */ goto __pyx_L4; } /* "libpetsc4py.pyx":1687 * solve(KSP_(ksp),Vec_(B),Vec_(X)) * else: * KSPSolve_Python_default(ksp,B,X) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_11 = __pyx_f_11libpetsc4py_KSPSolve_Python_default(__pyx_v_ksp, __pyx_v_B, __pyx_v_X); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1687, __pyx_L1_error) } __pyx_L4:; /* "libpetsc4py.pyx":1688 * else: * KSPSolve_Python_default(ksp,B,X) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPSolve_Python_default( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1667 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.KSPSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1690 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python_default( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPSolve_Python_default(KSP __pyx_v_ksp, Vec __pyx_v_B, Vec __pyx_v_X) { Vec __pyx_v_t; Vec __pyx_v_v; CYTHON_UNUSED PetscInt __pyx_v_its; Vec __pyx_v_R; PetscReal __pyx_v_rnorm; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPSolve_Python_default", 0); /* "libpetsc4py.pyx":1696 * ) \ * except IERR with gil: * FunctionBegin(b"KSPSolve_Python_default") # <<<<<<<<<<<<<< * # * cdef PetscVec t = NULL */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPSolve_Python_default")); /* "libpetsc4py.pyx":1698 * FunctionBegin(b"KSPSolve_Python_default") * # * cdef PetscVec t = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ksp, */ __pyx_v_t = NULL; /* "libpetsc4py.pyx":1699 * # * cdef PetscVec t = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_sol", */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_sol"), ((PetscObject *)(&__pyx_v_t)))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1699, __pyx_L1_error) /* "libpetsc4py.pyx":1703 * b"@ksp.vec_work_sol", * &t) ) * if t == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(X,&t) ) * CHKERR( PetscObjectCompose( */ __pyx_t_2 = ((__pyx_v_t == NULL) != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1704 * &t) ) * if t == NULL: * CHKERR( VecDuplicate(X,&t) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose( * ksp, */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecDuplicate(__pyx_v_X, (&__pyx_v_t))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1704, __pyx_L1_error) /* "libpetsc4py.pyx":1705 * if t == NULL: * CHKERR( VecDuplicate(X,&t) ) * CHKERR( PetscObjectCompose( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_sol", */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_sol"), ((PetscObject)__pyx_v_t))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1705, __pyx_L1_error) /* "libpetsc4py.pyx":1703 * b"@ksp.vec_work_sol", * &t) ) * if t == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(X,&t) ) * CHKERR( PetscObjectCompose( */ } /* "libpetsc4py.pyx":1709 * b"@ksp.vec_work_sol", * t) ) * cdef PetscVec v = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ksp, */ __pyx_v_v = NULL; /* "libpetsc4py.pyx":1710 * t) ) * cdef PetscVec v = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_res", */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_res"), ((PetscObject *)(&__pyx_v_v)))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1710, __pyx_L1_error) /* "libpetsc4py.pyx":1714 * b"@ksp.vec_work_res", * &v) ) * if v == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(B,&v) ) * CHKERR( PetscObjectCompose( */ __pyx_t_2 = ((__pyx_v_v == NULL) != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1715 * &v) ) * if v == NULL: * CHKERR( VecDuplicate(B,&v) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose( * ksp, */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecDuplicate(__pyx_v_B, (&__pyx_v_v))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1715, __pyx_L1_error) /* "libpetsc4py.pyx":1716 * if v == NULL: * CHKERR( VecDuplicate(B,&v) ) * CHKERR( PetscObjectCompose( # <<<<<<<<<<<<<< * ksp, * b"@ksp.vec_work_res", */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ksp), ((char *)"@ksp.vec_work_res"), ((PetscObject)__pyx_v_v))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1716, __pyx_L1_error) /* "libpetsc4py.pyx":1714 * b"@ksp.vec_work_res", * &v) ) * if v == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(B,&v) ) * CHKERR( PetscObjectCompose( */ } /* "libpetsc4py.pyx":1721 * v) ) * # * cdef PetscInt its = 0 # <<<<<<<<<<<<<< * cdef PetscVec R = NULL * cdef PetscReal rnorm = 0 */ __pyx_v_its = 0; /* "libpetsc4py.pyx":1722 * # * cdef PetscInt its = 0 * cdef PetscVec R = NULL # <<<<<<<<<<<<<< * cdef PetscReal rnorm = 0 * # */ __pyx_v_R = NULL; /* "libpetsc4py.pyx":1723 * cdef PetscInt its = 0 * cdef PetscVec R = NULL * cdef PetscReal rnorm = 0 # <<<<<<<<<<<<<< * # * CHKERR( KSPBuildResidual(ksp,t,v,&R) ) */ __pyx_v_rnorm = 0.0; /* "libpetsc4py.pyx":1725 * cdef PetscReal rnorm = 0 * # * CHKERR( KSPBuildResidual(ksp,t,v,&R) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(R,NORM_2,&rnorm) ) * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPBuildResidual(__pyx_v_ksp, __pyx_v_t, __pyx_v_v, (&__pyx_v_R))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1725, __pyx_L1_error) /* "libpetsc4py.pyx":1726 * # * CHKERR( KSPBuildResidual(ksp,t,v,&R) ) * CHKERR( VecNorm(R,NORM_2,&rnorm) ) # <<<<<<<<<<<<<< * # * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecNorm(__pyx_v_R, NORM_2, (&__pyx_v_rnorm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1726, __pyx_L1_error) /* "libpetsc4py.pyx":1728 * CHKERR( VecNorm(R,NORM_2,&rnorm) ) * # * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) # <<<<<<<<<<<<<< * CHKERR( KSPLogHistory(ksp,ksp.norm) ) * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPConverged(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_rnorm, (&__pyx_v_ksp->reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1728, __pyx_L1_error) /* "libpetsc4py.pyx":1729 * # * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) * CHKERR( KSPLogHistory(ksp,ksp.norm) ) # <<<<<<<<<<<<<< * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * for its from 0 <= its < ksp.max_its: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPLogHistory(__pyx_v_ksp, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1729, __pyx_L1_error) /* "libpetsc4py.pyx":1730 * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) * CHKERR( KSPLogHistory(ksp,ksp.norm) ) * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) # <<<<<<<<<<<<<< * for its from 0 <= its < ksp.max_its: * if ksp.reason: break */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPMonitor(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1730, __pyx_L1_error) /* "libpetsc4py.pyx":1731 * CHKERR( KSPLogHistory(ksp,ksp.norm) ) * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * for its from 0 <= its < ksp.max_its: # <<<<<<<<<<<<<< * if ksp.reason: break * KSPPreStep_Python(ksp) */ __pyx_t_3 = __pyx_v_ksp->max_it; for (__pyx_v_its = 0; __pyx_v_its < __pyx_t_3; __pyx_v_its++) { /* "libpetsc4py.pyx":1732 * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * for its from 0 <= its < ksp.max_its: * if ksp.reason: break # <<<<<<<<<<<<<< * KSPPreStep_Python(ksp) * # */ if (__pyx_v_ksp->reason) { goto __pyx_L6_break; } /* "libpetsc4py.pyx":1733 * for its from 0 <= its < ksp.max_its: * if ksp.reason: break * KSPPreStep_Python(ksp) # <<<<<<<<<<<<<< * # * KSPStep_Python(ksp,B,X) */ __pyx_t_4 = __pyx_f_11libpetsc4py_KSPPreStep_Python(__pyx_v_ksp); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1733, __pyx_L1_error) /* "libpetsc4py.pyx":1735 * KSPPreStep_Python(ksp) * # * KSPStep_Python(ksp,B,X) # <<<<<<<<<<<<<< * CHKERR( KSPBuildResidual(ksp,t,v,&R) ) * CHKERR( VecNorm(R,NORM_2,&rnorm) ) */ __pyx_t_4 = __pyx_f_11libpetsc4py_KSPStep_Python(__pyx_v_ksp, __pyx_v_B, __pyx_v_X); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1735, __pyx_L1_error) /* "libpetsc4py.pyx":1736 * # * KSPStep_Python(ksp,B,X) * CHKERR( KSPBuildResidual(ksp,t,v,&R) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(R,NORM_2,&rnorm) ) * ksp.iter += 1 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPBuildResidual(__pyx_v_ksp, __pyx_v_t, __pyx_v_v, (&__pyx_v_R))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1736, __pyx_L1_error) /* "libpetsc4py.pyx":1737 * KSPStep_Python(ksp,B,X) * CHKERR( KSPBuildResidual(ksp,t,v,&R) ) * CHKERR( VecNorm(R,NORM_2,&rnorm) ) # <<<<<<<<<<<<<< * ksp.iter += 1 * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecNorm(__pyx_v_R, NORM_2, (&__pyx_v_rnorm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1737, __pyx_L1_error) /* "libpetsc4py.pyx":1738 * CHKERR( KSPBuildResidual(ksp,t,v,&R) ) * CHKERR( VecNorm(R,NORM_2,&rnorm) ) * ksp.iter += 1 # <<<<<<<<<<<<<< * # * KSPPostStep_Python(ksp) */ __pyx_v_ksp->its = (__pyx_v_ksp->its + 1); /* "libpetsc4py.pyx":1740 * ksp.iter += 1 * # * KSPPostStep_Python(ksp) # <<<<<<<<<<<<<< * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) * CHKERR( KSPLogHistory(ksp,ksp.norm) ) */ __pyx_t_4 = __pyx_f_11libpetsc4py_KSPPostStep_Python(__pyx_v_ksp); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1740, __pyx_L1_error) /* "libpetsc4py.pyx":1741 * # * KSPPostStep_Python(ksp) * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) # <<<<<<<<<<<<<< * CHKERR( KSPLogHistory(ksp,ksp.norm) ) * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPConverged(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_rnorm, (&__pyx_v_ksp->reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1741, __pyx_L1_error) /* "libpetsc4py.pyx":1742 * KSPPostStep_Python(ksp) * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) * CHKERR( KSPLogHistory(ksp,ksp.norm) ) # <<<<<<<<<<<<<< * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * if ksp.iter == ksp.max_its: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPLogHistory(__pyx_v_ksp, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1742, __pyx_L1_error) /* "libpetsc4py.pyx":1743 * CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) * CHKERR( KSPLogHistory(ksp,ksp.norm) ) * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) # <<<<<<<<<<<<<< * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPMonitor(__pyx_v_ksp, __pyx_v_ksp->its, __pyx_v_ksp->rnorm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1743, __pyx_L1_error) } __pyx_L6_break:; /* "libpetsc4py.pyx":1744 * CHKERR( KSPLogHistory(ksp,ksp.norm) ) * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * if ksp.iter == ksp.max_its: # <<<<<<<<<<<<<< * if ksp.reason == KSP_CONVERGED_ITERATING: * ksp.reason = KSP_DIVERGED_ITS */ __pyx_t_2 = ((__pyx_v_ksp->its == __pyx_v_ksp->max_it) != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1745 * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: # <<<<<<<<<<<<<< * ksp.reason = KSP_DIVERGED_ITS * # */ __pyx_t_2 = ((__pyx_v_ksp->reason == KSP_CONVERGED_ITERATING) != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1746 * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: * ksp.reason = KSP_DIVERGED_ITS # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_v_ksp->reason = KSP_DIVERGED_ITS; /* "libpetsc4py.pyx":1745 * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * if ksp.iter == ksp.max_its: * if ksp.reason == KSP_CONVERGED_ITERATING: # <<<<<<<<<<<<<< * ksp.reason = KSP_DIVERGED_ITS * # */ } /* "libpetsc4py.pyx":1744 * CHKERR( KSPLogHistory(ksp,ksp.norm) ) * CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) * if ksp.iter == ksp.max_its: # <<<<<<<<<<<<<< * if ksp.reason == KSP_CONVERGED_ITERATING: * ksp.reason = KSP_DIVERGED_ITS */ } /* "libpetsc4py.pyx":1748 * ksp.reason = KSP_DIVERGED_ITS * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPPreStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1690 * return FunctionEnd() * * cdef PetscErrorCode KSPSolve_Python_default( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.KSPSolve_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1750 * return FunctionEnd() * * cdef PetscErrorCode KSPPreStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPPreStep_Python(KSP __pyx_v_ksp) { PyObject *__pyx_v_preStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPPreStep_Python", 0); /* "libpetsc4py.pyx":1754 * ) \ * except IERR with gil: * FunctionBegin(b"KSPPreStep_Python") # <<<<<<<<<<<<<< * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPPreStep_Python")); /* "libpetsc4py.pyx":1755 * except IERR with gil: * FunctionBegin(b"KSPPreStep_Python") * cdef preStep = PyKSP(ksp).preStep # <<<<<<<<<<<<<< * if preStep is not None: * preStep(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_preStep = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1756 * FunctionBegin(b"KSPPreStep_Python") * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_preStep != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1757 * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: * preStep(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_preStep); __pyx_t_5 = __pyx_v_preStep; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1756 * FunctionBegin(b"KSPPreStep_Python") * cdef preStep = PyKSP(ksp).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(KSP_(ksp)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1758 * if preStep is not None: * preStep(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPPostStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1750 * return FunctionEnd() * * cdef PetscErrorCode KSPPreStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.KSPPreStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1760 * return FunctionEnd() * * cdef PetscErrorCode KSPPostStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPPostStep_Python(KSP __pyx_v_ksp) { PyObject *__pyx_v_postStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPPostStep_Python", 0); /* "libpetsc4py.pyx":1764 * ) \ * except IERR with gil: * FunctionBegin(b"KSPPostStep_Python") # <<<<<<<<<<<<<< * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPPostStep_Python")); /* "libpetsc4py.pyx":1765 * except IERR with gil: * FunctionBegin(b"KSPPostStep_Python") * cdef postStep = PyKSP(ksp).postStep # <<<<<<<<<<<<<< * if postStep is not None: * postStep(KSP_(ksp)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_postStep = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1766 * FunctionBegin(b"KSPPostStep_Python") * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(KSP_(ksp)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_postStep != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1767 * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: * postStep(KSP_(ksp)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_postStep); __pyx_t_5 = __pyx_v_postStep; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1766 * FunctionBegin(b"KSPPostStep_Python") * cdef postStep = PyKSP(ksp).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(KSP_(ksp)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1768 * if postStep is not None: * postStep(KSP_(ksp)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode KSPStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1760 * return FunctionEnd() * * cdef PetscErrorCode KSPPostStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.KSPPostStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_postStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1770 * return FunctionEnd() * * cdef PetscErrorCode KSPStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ static PetscErrorCode __pyx_f_11libpetsc4py_KSPStep_Python(KSP __pyx_v_ksp, Vec __pyx_v_B, Vec __pyx_v_X) { PyObject *__pyx_v_step = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSPStep_Python", 0); /* "libpetsc4py.pyx":1776 * ) \ * except IERR with gil: * FunctionBegin(b"KSPStep_Python") # <<<<<<<<<<<<<< * cdef step = None * if ksp.transpose_solve: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"KSPStep_Python")); /* "libpetsc4py.pyx":1777 * except IERR with gil: * FunctionBegin(b"KSPStep_Python") * cdef step = None # <<<<<<<<<<<<<< * if ksp.transpose_solve: * step = PyKSP(ksp).stepTranspose */ __Pyx_INCREF(Py_None); __pyx_v_step = Py_None; /* "libpetsc4py.pyx":1778 * FunctionBegin(b"KSPStep_Python") * cdef step = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * step = PyKSP(ksp).stepTranspose * if step is None: return UNSUPPORTED(b"stepTranspose") */ if (__pyx_v_ksp->transpose_solve) { /* "libpetsc4py.pyx":1779 * cdef step = None * if ksp.transpose_solve: * step = PyKSP(ksp).stepTranspose # <<<<<<<<<<<<<< * if step is None: return UNSUPPORTED(b"stepTranspose") * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stepTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1780 * if ksp.transpose_solve: * step = PyKSP(ksp).stepTranspose * if step is None: return UNSUPPORTED(b"stepTranspose") # <<<<<<<<<<<<<< * else: * step = PyKSP(ksp).step */ __pyx_t_3 = (__pyx_v_step == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"stepTranspose")); goto __pyx_L0; } /* "libpetsc4py.pyx":1778 * FunctionBegin(b"KSPStep_Python") * cdef step = None * if ksp.transpose_solve: # <<<<<<<<<<<<<< * step = PyKSP(ksp).stepTranspose * if step is None: return UNSUPPORTED(b"stepTranspose") */ goto __pyx_L3; } /* "libpetsc4py.pyx":1782 * if step is None: return UNSUPPORTED(b"stepTranspose") * else: * step = PyKSP(ksp).step # <<<<<<<<<<<<<< * if step is None: return UNSUPPORTED(b"step") * step(KSP_(ksp),Vec_(B),Vec_(X)) */ /*else*/ { __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1783 * else: * step = PyKSP(ksp).step * if step is None: return UNSUPPORTED(b"step") # <<<<<<<<<<<<<< * step(KSP_(ksp),Vec_(B),Vec_(X)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_step == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"step")); goto __pyx_L0; } } __pyx_L3:; /* "libpetsc4py.pyx":1784 * step = PyKSP(ksp).step * if step is None: return UNSUPPORTED(b"step") * step(KSP_(ksp),Vec_(B),Vec_(X)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_B)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_step); __pyx_t_7 = __pyx_v_step; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_2, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_2, __pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1785 * if step is None: return UNSUPPORTED(b"step") * step(KSP_(ksp),Vec_(B),Vec_(X)) * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1770 * return FunctionEnd() * * cdef PetscErrorCode KSPStep_Python( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec B, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.KSPStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_step); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1840 * @cython.internal * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): # <<<<<<<<<<<<<< * if snes != NULL and snes.data != NULL: * return <_PySNES>snes.data */ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PySNES *__pyx_f_11libpetsc4py_PySNES(SNES __pyx_v_snes) { struct __pyx_obj_11libpetsc4py__PySNES *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PySNES", 0); /* "libpetsc4py.pyx":1841 * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: # <<<<<<<<<<<<<< * return <_PySNES>snes.data * else: */ __pyx_t_2 = ((__pyx_v_snes != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_snes->data != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "libpetsc4py.pyx":1842 * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: * return <_PySNES>snes.data # <<<<<<<<<<<<<< * else: * return _PySNES.__new__(_PySNES) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_v_snes->data))); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_v_snes->data); goto __pyx_L0; /* "libpetsc4py.pyx":1841 * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): * if snes != NULL and snes.data != NULL: # <<<<<<<<<<<<<< * return <_PySNES>snes.data * else: */ } /* "libpetsc4py.pyx":1844 * return <_PySNES>snes.data * else: * return _PySNES.__new__(_PySNES) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_3 = ((PyObject *)__pyx_tp_new_11libpetsc4py__PySNES(((PyTypeObject *)__pyx_ptype_11libpetsc4py__PySNES), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1844, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":1840 * @cython.internal * cdef class _PySNES(_PyObj): pass * cdef inline _PySNES PySNES(PetscSNES snes): # <<<<<<<<<<<<<< * if snes != NULL and snes.data != NULL: * return <_PySNES>snes.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.PySNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1846 * return _PySNES.__new__(_PySNES) * * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"SNESPythonGetContext ") */ PetscErrorCode SNESPythonGetContext(SNES __pyx_v_snes, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SNESPythonGetContext", 0); /* "libpetsc4py.pyx":1848 * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ * except IERR: * FunctionBegin(b"SNESPythonGetContext ") # <<<<<<<<<<<<<< * PySNES(snes).getcontext(ctx) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESPythonGetContext ")); /* "libpetsc4py.pyx":1849 * except IERR: * FunctionBegin(b"SNESPythonGetContext ") * PySNES(snes).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PySNES *)((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1850 * FunctionBegin(b"SNESPythonGetContext ") * PySNES(snes).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1846 * return _PySNES.__new__(_PySNES) * * cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"SNESPythonGetContext ") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.SNESPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1852 * return FunctionEnd() * * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"SNESPythonSetContext ") */ PetscErrorCode SNESPythonSetContext(SNES __pyx_v_snes, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SNESPythonSetContext", 0); /* "libpetsc4py.pyx":1854 * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ * except IERR: * FunctionBegin(b"SNESPythonSetContext ") # <<<<<<<<<<<<<< * PySNES(snes).setcontext(ctx, SNES_(snes)) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESPythonSetContext ")); /* "libpetsc4py.pyx":1855 * except IERR: * FunctionBegin(b"SNESPythonSetContext ") * PySNES(snes).setcontext(ctx, SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_11libpetsc4py__PySNES *)((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1856 * FunctionBegin(b"SNESPythonSetContext ") * PySNES(snes).setcontext(ctx, SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1852 * return FunctionEnd() * * cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"SNESPythonSetContext ") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.SNESPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":1858 * return FunctionEnd() * * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESPythonSetType_PYTHON(SNES __pyx_v_snes, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESPythonSetType_PYTHON", 0); /* "libpetsc4py.pyx":1860 * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ * except IERR with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESPythonSetType_PYTHON")); /* "libpetsc4py.pyx":1861 * except IERR with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * SNESPythonSetContext(snes, ctx) */ __pyx_t_1 = ((__pyx_v_name == NULL) != 0); if (__pyx_t_1) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":1862 * FunctionBegin(b"SNESPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * SNESPythonSetContext(snes, ctx) * PySNES(snes).setname(name) */ __pyx_t_2 = __pyx_f_11libpetsc4py_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":1863 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * SNESPythonSetContext(snes, ctx) # <<<<<<<<<<<<<< * PySNES(snes).setname(name) * return FunctionEnd() */ __pyx_t_3 = SNESPythonSetContext(__pyx_v_snes, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1863, __pyx_L1_error) /* "libpetsc4py.pyx":1864 * cdef object ctx = createcontext(name) * SNESPythonSetContext(snes, ctx) * PySNES(snes).setname(name) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_11libpetsc4py__PySNES *)((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1864, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":1865 * SNESPythonSetContext(snes, ctx) * PySNES(snes).setname(name) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESCreate_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1858 * return FunctionEnd() * * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"SNESPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.SNESPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1867 * return FunctionEnd() * * cdef PetscErrorCode SNESCreate_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESCreate_Python(SNES __pyx_v_snes) { SNESOps __pyx_v_ops; SNESLineSearch __pyx_v_ls; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations SNESOps __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESCreate_Python", 0); /* "libpetsc4py.pyx":1871 * ) \ * except IERR with gil: * FunctionBegin(b"SNESCreate_Python") # <<<<<<<<<<<<<< * # * cdef SNESOps ops = snes.ops */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESCreate_Python")); /* "libpetsc4py.pyx":1873 * FunctionBegin(b"SNESCreate_Python") * # * cdef SNESOps ops = snes.ops # <<<<<<<<<<<<<< * cdef PetscSNESLineSearch ls = NULL * ops.reset = SNESReset_Python */ __pyx_t_1 = __pyx_v_snes->ops; __pyx_v_ops = __pyx_t_1; /* "libpetsc4py.pyx":1874 * # * cdef SNESOps ops = snes.ops * cdef PetscSNESLineSearch ls = NULL # <<<<<<<<<<<<<< * ops.reset = SNESReset_Python * ops.destroy = SNESDestroy_Python */ __pyx_v_ls = NULL; /* "libpetsc4py.pyx":1875 * cdef SNESOps ops = snes.ops * cdef PetscSNESLineSearch ls = NULL * ops.reset = SNESReset_Python # <<<<<<<<<<<<<< * ops.destroy = SNESDestroy_Python * ops.setup = SNESSetUp_Python */ __pyx_v_ops->reset = __pyx_f_11libpetsc4py_SNESReset_Python; /* "libpetsc4py.pyx":1876 * cdef PetscSNESLineSearch ls = NULL * ops.reset = SNESReset_Python * ops.destroy = SNESDestroy_Python # <<<<<<<<<<<<<< * ops.setup = SNESSetUp_Python * ops.setfromoptions = SNESSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_11libpetsc4py_SNESDestroy_Python; /* "libpetsc4py.pyx":1877 * ops.reset = SNESReset_Python * ops.destroy = SNESDestroy_Python * ops.setup = SNESSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = SNESSetFromOptions_Python * ops.view = SNESView_Python */ __pyx_v_ops->setup = __pyx_f_11libpetsc4py_SNESSetUp_Python; /* "libpetsc4py.pyx":1878 * ops.destroy = SNESDestroy_Python * ops.setup = SNESSetUp_Python * ops.setfromoptions = SNESSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = SNESView_Python * ops.solve = SNESSolve_Python */ __pyx_v_ops->setfromoptions = __pyx_f_11libpetsc4py_SNESSetFromOptions_Python; /* "libpetsc4py.pyx":1879 * ops.setup = SNESSetUp_Python * ops.setfromoptions = SNESSetFromOptions_Python * ops.view = SNESView_Python # <<<<<<<<<<<<<< * ops.solve = SNESSolve_Python * # */ __pyx_v_ops->view = __pyx_f_11libpetsc4py_SNESView_Python; /* "libpetsc4py.pyx":1880 * ops.setfromoptions = SNESSetFromOptions_Python * ops.view = SNESView_Python * ops.solve = SNESSolve_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->solve = __pyx_f_11libpetsc4py_SNESSolve_Python; /* "libpetsc4py.pyx":1882 * ops.solve = SNESSolve_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * snes, b"SNESPythonSetType_C", * SNESPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_snes), ((char *)"SNESPythonSetType_C"), ((PetscVoidFunction)__pyx_f_11libpetsc4py_SNESPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1882, __pyx_L1_error) /* "libpetsc4py.pyx":1886 * SNESPythonSetType_PYTHON) ) * # * cdef ctx = PySNES(NULL) # <<<<<<<<<<<<<< * snes.data = ctx * */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1887 * # * cdef ctx = PySNES(NULL) * snes.data = ctx # <<<<<<<<<<<<<< * * # Ensure that the SNES has a linesearch object early enough that */ __pyx_v_snes->data = ((void *)__pyx_v_ctx); /* "libpetsc4py.pyx":1891 * # Ensure that the SNES has a linesearch object early enough that * # it gets setFromOptions. * CHKERR( SNESGetLineSearch(snes, &ls) ) # <<<<<<<<<<<<<< * Py_INCREF(snes.data) * return FunctionEnd() */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(SNESGetLineSearch(__pyx_v_snes, (&__pyx_v_ls))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1891, __pyx_L1_error) /* "libpetsc4py.pyx":1892 * # it gets setFromOptions. * CHKERR( SNESGetLineSearch(snes, &ls) ) * Py_INCREF(snes.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_snes->data)); /* "libpetsc4py.pyx":1893 * CHKERR( SNESGetLineSearch(snes, &ls) ) * Py_INCREF(snes.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESDestroy_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1867 * return FunctionEnd() * * cdef PetscErrorCode SNESCreate_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.SNESCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1895 * return FunctionEnd() * * cdef PetscErrorCode SNESDestroy_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESDestroy_Python(SNES __pyx_v_snes) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESDestroy_Python", 0); /* "libpetsc4py.pyx":1899 * ) \ * except IERR with gil: * FunctionBegin(b"SNESDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * snes, b"SNESPythonSetType_C", */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESDestroy_Python")); /* "libpetsc4py.pyx":1900 * except IERR with gil: * FunctionBegin(b"SNESDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * snes, b"SNESPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_snes), ((char *)"SNESPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1900, __pyx_L1_error) /* "libpetsc4py.pyx":1904 * NULL) ) * # * if not Py_IsInitialized(): return FunctionEnd() # <<<<<<<<<<<<<< * try: * addRef(snes) */ __pyx_t_2 = ((!(Py_IsInitialized() != 0)) != 0); if (__pyx_t_2) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":1905 * # * if not Py_IsInitialized(): return FunctionEnd() * try: # <<<<<<<<<<<<<< * addRef(snes) * SNESPythonSetContext(snes, NULL) */ /*try:*/ { /* "libpetsc4py.pyx":1906 * if not Py_IsInitialized(): return FunctionEnd() * try: * addRef(snes) # <<<<<<<<<<<<<< * SNESPythonSetContext(snes, NULL) * finally: */ __pyx_f_11libpetsc4py_addRef(__pyx_v_snes); /* "libpetsc4py.pyx":1907 * try: * addRef(snes) * SNESPythonSetContext(snes, NULL) # <<<<<<<<<<<<<< * finally: * delRef(snes) */ __pyx_t_3 = SNESPythonSetContext(__pyx_v_snes, NULL); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1907, __pyx_L5_error) } /* "libpetsc4py.pyx":1909 * SNESPythonSetContext(snes, NULL) * finally: * delRef(snes) # <<<<<<<<<<<<<< * Py_DECREF(snes.data) * snes.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_11libpetsc4py_delRef(__pyx_v_snes); /* "libpetsc4py.pyx":1910 * finally: * delRef(snes) * Py_DECREF(snes.data) # <<<<<<<<<<<<<< * snes.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_snes->data)); /* "libpetsc4py.pyx":1911 * delRef(snes) * Py_DECREF(snes.data) * snes.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_snes->data = NULL; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_1 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { /* "libpetsc4py.pyx":1909 * SNESPythonSetContext(snes, NULL) * finally: * delRef(snes) # <<<<<<<<<<<<<< * Py_DECREF(snes.data) * snes.data = NULL */ __pyx_f_11libpetsc4py_delRef(__pyx_v_snes); /* "libpetsc4py.pyx":1910 * finally: * delRef(snes) * Py_DECREF(snes.data) # <<<<<<<<<<<<<< * snes.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_snes->data)); /* "libpetsc4py.pyx":1911 * delRef(snes) * Py_DECREF(snes.data) * snes.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_snes->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L6:; } /* "libpetsc4py.pyx":1912 * Py_DECREF(snes.data) * snes.data = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSetUp_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1895 * return FunctionEnd() * * cdef PetscErrorCode SNESDestroy_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.SNESDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1914 * return FunctionEnd() * * cdef PetscErrorCode SNESSetUp_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSetUp_Python(SNES __pyx_v_snes) { char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESSetUp_Python", 0); /* "libpetsc4py.pyx":1918 * ) \ * except IERR with gil: * FunctionBegin(b"SNESSetUp_Python") # <<<<<<<<<<<<<< * # * #SNESGetKSP(snes,&snes.ksp) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESSetUp_Python")); /* "libpetsc4py.pyx":1923 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PySNES(snes).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":1924 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(snes),b"-snes_python_type", */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":1925 * cdef PetscBool found = PETSC_FALSE * if PySNES(snes).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(snes),b"-snes_python_type", * name,sizeof(name),&found) ) */ __pyx_t_4 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsGetString(NULL, __pyx_f_11libpetsc4py_getPrefix(__pyx_v_snes), ((char *)"-snes_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1925, __pyx_L1_error) /* "libpetsc4py.pyx":1928 * getPrefix(snes),b"-snes_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * if PySNES(snes).self is None: */ if (__pyx_v_found) { } else { __pyx_t_3 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = ((__pyx_v_name[0]) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "libpetsc4py.pyx":1929 * name,sizeof(name),&found) ) * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) # <<<<<<<<<<<<<< * if PySNES(snes).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_5 = __pyx_f_11libpetsc4py_SNESPythonSetType_PYTHON(__pyx_v_snes, __pyx_v_name); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1929, __pyx_L1_error) __pyx_t_4 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_5); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1929, __pyx_L1_error) /* "libpetsc4py.pyx":1928 * getPrefix(snes),b"-snes_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * if PySNES(snes).self is None: */ } /* "libpetsc4py.pyx":1924 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(snes),b"-snes_python_type", */ } /* "libpetsc4py.pyx":1930 * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_t_1)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "libpetsc4py.pyx":1931 * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * if PySNES(snes).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * SNESPythonSetType(snes,\"[package.]module.class\")\n" */ __pyx_r = __pyx_f_11libpetsc4py_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * SNESPythonSetType(snes,\"[package.]module.class\")\n * SNESSetFromOptions(snes) and pass option -snes_python_type [package.]module.class")); goto __pyx_L0; /* "libpetsc4py.pyx":1930 * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * if PySNES(snes).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "libpetsc4py.pyx":1937 * "-snes_python_type [package.]module.class") * # * cdef setUp = PySNES(snes).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":1938 * # * cdef setUp = PySNES(snes).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(SNES_(snes)) * return FunctionEnd() */ __pyx_t_2 = (__pyx_v_setUp != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":1939 * cdef setUp = PySNES(snes).setUp * if setUp is not None: * setUp(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":1938 * # * cdef setUp = PySNES(snes).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(SNES_(snes)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1940 * if setUp is not None: * setUp(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESReset_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1914 * return FunctionEnd() * * cdef PetscErrorCode SNESSetUp_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.SNESSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1942 * return FunctionEnd() * * cdef PetscErrorCode SNESReset_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESReset_Python(SNES __pyx_v_snes) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESReset_Python", 0); /* "libpetsc4py.pyx":1946 * ) \ * except IERR with gil: * if getRef(snes) == 0: return 0 # <<<<<<<<<<<<<< * FunctionBegin(b"SNESReset_Python") * cdef reset = PySNES(snes).reset */ __pyx_t_1 = ((__pyx_f_11libpetsc4py_getRef(__pyx_v_snes) == 0) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":1947 * except IERR with gil: * if getRef(snes) == 0: return 0 * FunctionBegin(b"SNESReset_Python") # <<<<<<<<<<<<<< * cdef reset = PySNES(snes).reset * if reset is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESReset_Python")); /* "libpetsc4py.pyx":1948 * if getRef(snes) == 0: return 0 * FunctionBegin(b"SNESReset_Python") * cdef reset = PySNES(snes).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(SNES_(snes)) */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_reset = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1949 * FunctionBegin(b"SNESReset_Python") * cdef reset = PySNES(snes).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(SNES_(snes)) * return FunctionEnd() */ __pyx_t_1 = (__pyx_v_reset != Py_None); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":1950 * cdef reset = PySNES(snes).reset * if reset is not None: * reset(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_reset); __pyx_t_5 = __pyx_v_reset; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":1949 * FunctionBegin(b"SNESReset_Python") * cdef reset = PySNES(snes).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(SNES_(snes)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1951 * if reset is not None: * reset(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSetFromOptions_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1942 * return FunctionEnd() * * cdef PetscErrorCode SNESReset_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.SNESReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1953 * return FunctionEnd() * * cdef PetscErrorCode SNESSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscSNES snes, */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSetFromOptions_Python(PetscOptionItems *__pyx_v_PetscOptionsObject, SNES __pyx_v_snes) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESSetFromOptions_Python", 0); /* "libpetsc4py.pyx":1958 * ) \ * except IERR with gil: * FunctionBegin(b"SNESSetFromOptions_Python") # <<<<<<<<<<<<<< * # * cdef char name[2048], *defval = PySNES(snes).getname() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESSetFromOptions_Python")); /* "libpetsc4py.pyx":1960 * FunctionBegin(b"SNESSetFromOptions_Python") * # * cdef char name[2048], *defval = PySNES(snes).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PySNES *)((struct __pyx_obj_11libpetsc4py__PySNES *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 1960, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1961 * # * cdef char name[2048], *defval = PySNES(snes).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":1962 * cdef char name[2048], *defval = PySNES(snes).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-snes_python_type",b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "libpetsc4py.pyx":1963 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-snes_python_type",b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType",defval,name,sizeof(name),&found) ); opts; */ __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsString(((char *)"-snes_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"SNESPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1963, __pyx_L1_error) /* "libpetsc4py.pyx":1965 * CHKERR( PetscOptionsString( * b"-snes_python_type",b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType",defval,name,sizeof(name),&found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) */ ((void)PetscOptionsObject); /* "libpetsc4py.pyx":1966 * b"-snes_python_type",b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":1967 * b"SNESPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PySNES(snes).setFromOptions */ __pyx_t_6 = __pyx_f_11libpetsc4py_SNESPythonSetType_PYTHON(__pyx_v_snes, __pyx_v_name); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 1967, __pyx_L1_error) __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_6); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1967, __pyx_L1_error) /* "libpetsc4py.pyx":1966 * b"-snes_python_type",b"Python [package.]module[.{class|function}]", * b"SNESPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * # */ } /* "libpetsc4py.pyx":1969 * CHKERR( SNESPythonSetType_PYTHON(snes,name) ) * # * cdef setFromOptions = PySNES(snes).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "libpetsc4py.pyx":1970 * # * cdef setFromOptions = PySNES(snes).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(SNES_(snes)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1971 * cdef setFromOptions = PySNES(snes).setFromOptions * if setFromOptions is not None: * setFromOptions(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "libpetsc4py.pyx":1970 * # * cdef setFromOptions = PySNES(snes).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(SNES_(snes)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1972 * if setFromOptions is not None: * setFromOptions(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESView_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1953 * return FunctionEnd() * * cdef PetscErrorCode SNESSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscSNES snes, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.SNESSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1974 * return FunctionEnd() * * cdef PetscErrorCode SNESView_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESView_Python(SNES __pyx_v_snes, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESView_Python", 0); /* "libpetsc4py.pyx":1979 * ) \ * except IERR with gil: * FunctionBegin(b"SNESView_Python") # <<<<<<<<<<<<<< * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESView_Python")); /* "libpetsc4py.pyx":1980 * except IERR with gil: * FunctionBegin(b"SNESView_Python") * viewcontext(PySNES(snes), vwr) # <<<<<<<<<<<<<< * cdef view = PySNES(snes).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_11libpetsc4py_viewcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":1981 * FunctionBegin(b"SNESView_Python") * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view # <<<<<<<<<<<<<< * if view is not None: * view(SNES_(snes), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1982 * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view * if view is not None: # <<<<<<<<<<<<<< * view(SNES_(snes), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":1983 * cdef view = PySNES(snes).view * if view is not None: * view(SNES_(snes), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_view); __pyx_t_7 = __pyx_v_view; __pyx_t_8 = NULL; __pyx_t_2 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1983, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1983, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_2, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":1982 * viewcontext(PySNES(snes), vwr) * cdef view = PySNES(snes).view * if view is not None: # <<<<<<<<<<<<<< * view(SNES_(snes), Viewer_(vwr)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":1984 * if view is not None: * view(SNES_(snes), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSolve_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1974 * return FunctionEnd() * * cdef PetscErrorCode SNESView_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.SNESView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":1986 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSolve_Python(SNES __pyx_v_snes) { Vec __pyx_v_b; Vec __pyx_v_x; PyObject *__pyx_v_solve = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PetscErrorCode __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESSolve_Python", 0); /* "libpetsc4py.pyx":1990 * ) \ * except IERR with gil: * FunctionBegin(b"SNESSolve_Python") # <<<<<<<<<<<<<< * cdef PetscVec b = NULL, x = NULL * CHKERR( SNESGetRhs(snes,&b) ) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESSolve_Python")); /* "libpetsc4py.pyx":1991 * except IERR with gil: * FunctionBegin(b"SNESSolve_Python") * cdef PetscVec b = NULL, x = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetRhs(snes,&b) ) * CHKERR( SNESGetSolution(snes,&x) ) */ __pyx_v_b = NULL; __pyx_v_x = NULL; /* "libpetsc4py.pyx":1992 * FunctionBegin(b"SNESSolve_Python") * cdef PetscVec b = NULL, x = NULL * CHKERR( SNESGetRhs(snes,&b) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetSolution(snes,&x) ) * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESGetRhs(__pyx_v_snes, (&__pyx_v_b))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1992, __pyx_L1_error) /* "libpetsc4py.pyx":1993 * cdef PetscVec b = NULL, x = NULL * CHKERR( SNESGetRhs(snes,&b) ) * CHKERR( SNESGetSolution(snes,&x) ) # <<<<<<<<<<<<<< * # * snes.iter = 0 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESGetSolution(__pyx_v_snes, (&__pyx_v_x))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1993, __pyx_L1_error) /* "libpetsc4py.pyx":1995 * CHKERR( SNESGetSolution(snes,&x) ) * # * snes.iter = 0 # <<<<<<<<<<<<<< * snes.reason = SNES_CONVERGED_ITERATING * # */ __pyx_v_snes->iter = 0; /* "libpetsc4py.pyx":1996 * # * snes.iter = 0 * snes.reason = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # * cdef solve = PySNES(snes).solve */ __pyx_v_snes->reason = SNES_CONVERGED_ITERATING; /* "libpetsc4py.pyx":1998 * snes.reason = SNES_CONVERGED_ITERATING * # * cdef solve = PySNES(snes).solve # <<<<<<<<<<<<<< * if solve is not None: * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_solve); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_solve = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":1999 * # * cdef solve = PySNES(snes).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) * else: */ __pyx_t_4 = (__pyx_v_solve != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":2000 * cdef solve = PySNES(snes).solve * if solve is not None: * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) # <<<<<<<<<<<<<< * else: * SNESSolve_Python_default(snes) */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (((__pyx_v_b != NULL) != 0)) { __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __pyx_t_7; __pyx_t_7 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_6 = Py_None; } __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_solve); __pyx_t_8 = __pyx_v_solve; __pyx_t_9 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_2, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_2, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_1, 3+__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_1, __pyx_t_7); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":1999 * # * cdef solve = PySNES(snes).solve * if solve is not None: # <<<<<<<<<<<<<< * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) * else: */ goto __pyx_L3; } /* "libpetsc4py.pyx":2002 * solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) * else: * SNESSolve_Python_default(snes) # <<<<<<<<<<<<<< * # * return FunctionEnd() */ /*else*/ { __pyx_t_11 = __pyx_f_11libpetsc4py_SNESSolve_Python_default(__pyx_v_snes); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2002, __pyx_L1_error) } __pyx_L3:; /* "libpetsc4py.pyx":2004 * SNESSolve_Python_default(snes) * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESSolve_Python_default( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":1986 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.SNESSolve_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solve); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2006 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESSolve_Python_default(SNES __pyx_v_snes) { Vec __pyx_v_X; Vec __pyx_v_F; Vec __pyx_v_Y; SNESLineSearch __pyx_v_ls; CYTHON_UNUSED PetscInt __pyx_v_its; PetscInt __pyx_v_lits; PetscReal __pyx_v_xnorm; PetscReal __pyx_v_fnorm; PetscReal __pyx_v_ynorm; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESSolve_Python_default", 0); /* "libpetsc4py.pyx":2010 * ) \ * except IERR with gil: * FunctionBegin(b"SNESSolve_Python_default") # <<<<<<<<<<<<<< * # * cdef PetscVec X=NULL, F=NULL, Y=NULL */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESSolve_Python_default")); /* "libpetsc4py.pyx":2012 * FunctionBegin(b"SNESSolve_Python_default") * # * cdef PetscVec X=NULL, F=NULL, Y=NULL # <<<<<<<<<<<<<< * cdef PetscSNESLineSearch ls * CHKERR( SNESGetSolution(snes,&X) ) */ __pyx_v_X = NULL; __pyx_v_F = NULL; __pyx_v_Y = NULL; /* "libpetsc4py.pyx":2014 * cdef PetscVec X=NULL, F=NULL, Y=NULL * cdef PetscSNESLineSearch ls * CHKERR( SNESGetSolution(snes,&X) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetFunction(snes,&F,NULL,NULL) ) * CHKERR( SNESGetSolutionUpdate(snes,&Y) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESGetSolution(__pyx_v_snes, (&__pyx_v_X))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2014, __pyx_L1_error) /* "libpetsc4py.pyx":2015 * cdef PetscSNESLineSearch ls * CHKERR( SNESGetSolution(snes,&X) ) * CHKERR( SNESGetFunction(snes,&F,NULL,NULL) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetSolutionUpdate(snes,&Y) ) * CHKERR( SNESGetLineSearch(snes, &ls) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESGetFunction(__pyx_v_snes, (&__pyx_v_F), NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2015, __pyx_L1_error) /* "libpetsc4py.pyx":2016 * CHKERR( SNESGetSolution(snes,&X) ) * CHKERR( SNESGetFunction(snes,&F,NULL,NULL) ) * CHKERR( SNESGetSolutionUpdate(snes,&Y) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetLineSearch(snes, &ls) ) * cdef PetscInt its=0, lits=0 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESGetSolutionUpdate(__pyx_v_snes, (&__pyx_v_Y))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2016, __pyx_L1_error) /* "libpetsc4py.pyx":2017 * CHKERR( SNESGetFunction(snes,&F,NULL,NULL) ) * CHKERR( SNESGetSolutionUpdate(snes,&Y) ) * CHKERR( SNESGetLineSearch(snes, &ls) ) # <<<<<<<<<<<<<< * cdef PetscInt its=0, lits=0 * cdef PetscReal xnorm = 0.0 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESGetLineSearch(__pyx_v_snes, (&__pyx_v_ls))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2017, __pyx_L1_error) /* "libpetsc4py.pyx":2018 * CHKERR( SNESGetSolutionUpdate(snes,&Y) ) * CHKERR( SNESGetLineSearch(snes, &ls) ) * cdef PetscInt its=0, lits=0 # <<<<<<<<<<<<<< * cdef PetscReal xnorm = 0.0 * cdef PetscReal fnorm = 0.0 */ __pyx_v_its = 0; __pyx_v_lits = 0; /* "libpetsc4py.pyx":2019 * CHKERR( SNESGetLineSearch(snes, &ls) ) * cdef PetscInt its=0, lits=0 * cdef PetscReal xnorm = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal fnorm = 0.0 * cdef PetscReal ynorm = 0.0 */ __pyx_v_xnorm = 0.0; /* "libpetsc4py.pyx":2020 * cdef PetscInt its=0, lits=0 * cdef PetscReal xnorm = 0.0 * cdef PetscReal fnorm = 0.0 # <<<<<<<<<<<<<< * cdef PetscReal ynorm = 0.0 * # */ __pyx_v_fnorm = 0.0; /* "libpetsc4py.pyx":2021 * cdef PetscReal xnorm = 0.0 * cdef PetscReal fnorm = 0.0 * cdef PetscReal ynorm = 0.0 # <<<<<<<<<<<<<< * # * CHKERR( VecSet(Y,0.0) ) */ __pyx_v_ynorm = 0.0; /* "libpetsc4py.pyx":2023 * cdef PetscReal ynorm = 0.0 * # * CHKERR( VecSet(Y,0.0) ) # <<<<<<<<<<<<<< * CHKERR( SNESComputeFunction(snes,X,F) ) * CHKERR( VecNorm(X,NORM_2,&xnorm) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecSet(__pyx_v_Y, 0.0)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2023, __pyx_L1_error) /* "libpetsc4py.pyx":2024 * # * CHKERR( VecSet(Y,0.0) ) * CHKERR( SNESComputeFunction(snes,X,F) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(X,NORM_2,&xnorm) ) * CHKERR( VecNorm(F,NORM_2,&fnorm) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESComputeFunction(__pyx_v_snes, __pyx_v_X, __pyx_v_F)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2024, __pyx_L1_error) /* "libpetsc4py.pyx":2025 * CHKERR( VecSet(Y,0.0) ) * CHKERR( SNESComputeFunction(snes,X,F) ) * CHKERR( VecNorm(X,NORM_2,&xnorm) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(F,NORM_2,&fnorm) ) * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecNorm(__pyx_v_X, NORM_2, (&__pyx_v_xnorm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2025, __pyx_L1_error) /* "libpetsc4py.pyx":2026 * CHKERR( SNESComputeFunction(snes,X,F) ) * CHKERR( VecNorm(X,NORM_2,&xnorm) ) * CHKERR( VecNorm(F,NORM_2,&fnorm) ) # <<<<<<<<<<<<<< * # * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecNorm(__pyx_v_F, NORM_2, (&__pyx_v_fnorm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2026, __pyx_L1_error) /* "libpetsc4py.pyx":2028 * CHKERR( VecNorm(F,NORM_2,&fnorm) ) * # * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) # <<<<<<<<<<<<<< * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESConverged(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm, (&__pyx_v_snes->reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2028, __pyx_L1_error) /* "libpetsc4py.pyx":2029 * # * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) # <<<<<<<<<<<<<< * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * for its from 0 <= its < snes.max_its: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESLogHistory(__pyx_v_snes, __pyx_v_snes->norm, __pyx_v_lits)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2029, __pyx_L1_error) /* "libpetsc4py.pyx":2030 * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) # <<<<<<<<<<<<<< * for its from 0 <= its < snes.max_its: * if snes.reason: break */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESMonitor(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_snes->norm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2030, __pyx_L1_error) /* "libpetsc4py.pyx":2031 * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * for its from 0 <= its < snes.max_its: # <<<<<<<<<<<<<< * if snes.reason: break * SNESPreStep_Python(snes) */ __pyx_t_2 = __pyx_v_snes->max_its; for (__pyx_v_its = 0; __pyx_v_its < __pyx_t_2; __pyx_v_its++) { /* "libpetsc4py.pyx":2032 * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * for its from 0 <= its < snes.max_its: * if snes.reason: break # <<<<<<<<<<<<<< * SNESPreStep_Python(snes) * # */ if (__pyx_v_snes->reason) { goto __pyx_L4_break; } /* "libpetsc4py.pyx":2033 * for its from 0 <= its < snes.max_its: * if snes.reason: break * SNESPreStep_Python(snes) # <<<<<<<<<<<<<< * # * lits = -snes.linear_its */ __pyx_t_3 = __pyx_f_11libpetsc4py_SNESPreStep_Python(__pyx_v_snes); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2033, __pyx_L1_error) /* "libpetsc4py.pyx":2035 * SNESPreStep_Python(snes) * # * lits = -snes.linear_its # <<<<<<<<<<<<<< * SNESStep_Python(snes,X,F,Y) * lits += snes.linear_its */ __pyx_v_lits = (-__pyx_v_snes->linear_its); /* "libpetsc4py.pyx":2036 * # * lits = -snes.linear_its * SNESStep_Python(snes,X,F,Y) # <<<<<<<<<<<<<< * lits += snes.linear_its * # */ __pyx_t_3 = __pyx_f_11libpetsc4py_SNESStep_Python(__pyx_v_snes, __pyx_v_X, __pyx_v_F, __pyx_v_Y); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2036, __pyx_L1_error) /* "libpetsc4py.pyx":2037 * lits = -snes.linear_its * SNESStep_Python(snes,X,F,Y) * lits += snes.linear_its # <<<<<<<<<<<<<< * # * CHKERR( SNESLineSearchApply(ls,X,F,&fnorm,Y) ) */ __pyx_v_lits = (__pyx_v_lits + __pyx_v_snes->linear_its); /* "libpetsc4py.pyx":2039 * lits += snes.linear_its * # * CHKERR( SNESLineSearchApply(ls,X,F,&fnorm,Y) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(X,NORM_2,&xnorm) ) * CHKERR( VecNorm(Y,NORM_2,&ynorm) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESLineSearchApply(__pyx_v_ls, __pyx_v_X, __pyx_v_F, (&__pyx_v_fnorm), __pyx_v_Y)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2039, __pyx_L1_error) /* "libpetsc4py.pyx":2040 * # * CHKERR( SNESLineSearchApply(ls,X,F,&fnorm,Y) ) * CHKERR( VecNorm(X,NORM_2,&xnorm) ) # <<<<<<<<<<<<<< * CHKERR( VecNorm(Y,NORM_2,&ynorm) ) * snes.iter += 1 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecNorm(__pyx_v_X, NORM_2, (&__pyx_v_xnorm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2040, __pyx_L1_error) /* "libpetsc4py.pyx":2041 * CHKERR( SNESLineSearchApply(ls,X,F,&fnorm,Y) ) * CHKERR( VecNorm(X,NORM_2,&xnorm) ) * CHKERR( VecNorm(Y,NORM_2,&ynorm) ) # <<<<<<<<<<<<<< * snes.iter += 1 * # */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecNorm(__pyx_v_Y, NORM_2, (&__pyx_v_ynorm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2041, __pyx_L1_error) /* "libpetsc4py.pyx":2042 * CHKERR( VecNorm(X,NORM_2,&xnorm) ) * CHKERR( VecNorm(Y,NORM_2,&ynorm) ) * snes.iter += 1 # <<<<<<<<<<<<<< * # * SNESPostStep_Python(snes) */ __pyx_v_snes->iter = (__pyx_v_snes->iter + 1); /* "libpetsc4py.pyx":2044 * snes.iter += 1 * # * SNESPostStep_Python(snes) # <<<<<<<<<<<<<< * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) */ __pyx_t_3 = __pyx_f_11libpetsc4py_SNESPostStep_Python(__pyx_v_snes); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2044, __pyx_L1_error) /* "libpetsc4py.pyx":2045 * # * SNESPostStep_Python(snes) * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) # <<<<<<<<<<<<<< * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESConverged(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm, (&__pyx_v_snes->reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2045, __pyx_L1_error) /* "libpetsc4py.pyx":2046 * SNESPostStep_Python(snes) * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) # <<<<<<<<<<<<<< * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * if snes.iter == snes.max_its: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESLogHistory(__pyx_v_snes, __pyx_v_snes->norm, __pyx_v_lits)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2046, __pyx_L1_error) /* "libpetsc4py.pyx":2047 * CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) # <<<<<<<<<<<<<< * if snes.iter == snes.max_its: * if snes.reason == SNES_CONVERGED_ITERATING: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESMonitor(__pyx_v_snes, __pyx_v_snes->iter, __pyx_v_snes->norm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2047, __pyx_L1_error) } __pyx_L4_break:; /* "libpetsc4py.pyx":2048 * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * if snes.iter == snes.max_its: # <<<<<<<<<<<<<< * if snes.reason == SNES_CONVERGED_ITERATING: * snes.reason = SNES_DIVERGED_MAX_IT */ __pyx_t_4 = ((__pyx_v_snes->iter == __pyx_v_snes->max_its) != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2049 * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * if snes.iter == snes.max_its: * if snes.reason == SNES_CONVERGED_ITERATING: # <<<<<<<<<<<<<< * snes.reason = SNES_DIVERGED_MAX_IT * # */ __pyx_t_4 = ((__pyx_v_snes->reason == SNES_CONVERGED_ITERATING) != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2050 * if snes.iter == snes.max_its: * if snes.reason == SNES_CONVERGED_ITERATING: * snes.reason = SNES_DIVERGED_MAX_IT # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_v_snes->reason = SNES_DIVERGED_MAX_IT; /* "libpetsc4py.pyx":2049 * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * if snes.iter == snes.max_its: * if snes.reason == SNES_CONVERGED_ITERATING: # <<<<<<<<<<<<<< * snes.reason = SNES_DIVERGED_MAX_IT * # */ } /* "libpetsc4py.pyx":2048 * CHKERR( SNESLogHistory(snes,snes.norm,lits) ) * CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) * if snes.iter == snes.max_its: # <<<<<<<<<<<<<< * if snes.reason == SNES_CONVERGED_ITERATING: * snes.reason = SNES_DIVERGED_MAX_IT */ } /* "libpetsc4py.pyx":2052 * snes.reason = SNES_DIVERGED_MAX_IT * # * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESPreStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2006 * return FunctionEnd() * * cdef PetscErrorCode SNESSolve_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.SNESSolve_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2054 * return FunctionEnd() * * cdef PetscErrorCode SNESPreStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESPreStep_Python(SNES __pyx_v_snes) { PyObject *__pyx_v_preStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESPreStep_Python", 0); /* "libpetsc4py.pyx":2058 * ) \ * except IERR with gil: * FunctionBegin(b"SNESPreStep_Python") # <<<<<<<<<<<<<< * cdef preStep = PySNES(snes).preStep * if preStep is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESPreStep_Python")); /* "libpetsc4py.pyx":2059 * except IERR with gil: * FunctionBegin(b"SNESPreStep_Python") * cdef preStep = PySNES(snes).preStep # <<<<<<<<<<<<<< * if preStep is not None: * preStep(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_preStep = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2060 * FunctionBegin(b"SNESPreStep_Python") * cdef preStep = PySNES(snes).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(SNES_(snes)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_preStep != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2061 * cdef preStep = PySNES(snes).preStep * if preStep is not None: * preStep(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_preStep); __pyx_t_5 = __pyx_v_preStep; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2060 * FunctionBegin(b"SNESPreStep_Python") * cdef preStep = PySNES(snes).preStep * if preStep is not None: # <<<<<<<<<<<<<< * preStep(SNES_(snes)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":2062 * if preStep is not None: * preStep(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESPostStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2054 * return FunctionEnd() * * cdef PetscErrorCode SNESPreStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.SNESPreStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_preStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2064 * return FunctionEnd() * * cdef PetscErrorCode SNESPostStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESPostStep_Python(SNES __pyx_v_snes) { PyObject *__pyx_v_postStep = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESPostStep_Python", 0); /* "libpetsc4py.pyx":2068 * ) \ * except IERR with gil: * FunctionBegin(b"SNESPostStep_Python") # <<<<<<<<<<<<<< * cdef postStep = PySNES(snes).postStep * if postStep is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESPostStep_Python")); /* "libpetsc4py.pyx":2069 * except IERR with gil: * FunctionBegin(b"SNESPostStep_Python") * cdef postStep = PySNES(snes).postStep # <<<<<<<<<<<<<< * if postStep is not None: * postStep(SNES_(snes)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_postStep = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2070 * FunctionBegin(b"SNESPostStep_Python") * cdef postStep = PySNES(snes).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(SNES_(snes)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_postStep != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2071 * cdef postStep = PySNES(snes).postStep * if postStep is not None: * postStep(SNES_(snes)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_postStep); __pyx_t_5 = __pyx_v_postStep; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2070 * FunctionBegin(b"SNESPostStep_Python") * cdef postStep = PySNES(snes).postStep * if postStep is not None: # <<<<<<<<<<<<<< * postStep(SNES_(snes)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":2072 * if postStep is not None: * postStep(SNES_(snes)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2064 * return FunctionEnd() * * cdef PetscErrorCode SNESPostStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.SNESPostStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_postStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2074 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESStep_Python(SNES __pyx_v_snes, Vec __pyx_v_X, Vec __pyx_v_F, Vec __pyx_v_Y) { PyObject *__pyx_v_step = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PetscErrorCode __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESStep_Python", 0); /* "libpetsc4py.pyx":2081 * ) \ * except IERR with gil: * FunctionBegin(b"SNESStep_Python") # <<<<<<<<<<<<<< * cdef step = PySNES(snes).step * if step is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESStep_Python")); /* "libpetsc4py.pyx":2082 * except IERR with gil: * FunctionBegin(b"SNESStep_Python") * cdef step = PySNES(snes).step # <<<<<<<<<<<<<< * if step is not None: * step(SNES_(snes),Vec_(X),Vec_(F),Vec_(Y)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PySNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_step = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2083 * FunctionBegin(b"SNESStep_Python") * cdef step = PySNES(snes).step * if step is not None: # <<<<<<<<<<<<<< * step(SNES_(snes),Vec_(X),Vec_(F),Vec_(Y)) * else: */ __pyx_t_3 = (__pyx_v_step != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2084 * cdef step = PySNES(snes).step * if step is not None: * step(SNES_(snes),Vec_(X),Vec_(F),Vec_(Y)) # <<<<<<<<<<<<<< * else: * SNESStep_Python_default(snes,X,F,Y) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_F)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_Y)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_step); __pyx_t_8 = __pyx_v_step; __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 4+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_11 = PyTuple_New(4+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_10, __pyx_t_7); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2083 * FunctionBegin(b"SNESStep_Python") * cdef step = PySNES(snes).step * if step is not None: # <<<<<<<<<<<<<< * step(SNES_(snes),Vec_(X),Vec_(F),Vec_(Y)) * else: */ goto __pyx_L3; } /* "libpetsc4py.pyx":2086 * step(SNES_(snes),Vec_(X),Vec_(F),Vec_(Y)) * else: * SNESStep_Python_default(snes,X,F,Y) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_12 = __pyx_f_11libpetsc4py_SNESStep_Python_default(__pyx_v_snes, __pyx_v_X, __pyx_v_F, __pyx_v_Y); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2086, __pyx_L1_error) } __pyx_L3:; /* "libpetsc4py.pyx":2087 * else: * SNESStep_Python_default(snes,X,F,Y) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESStep_Python_default( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2074 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.SNESStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_step); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2089 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESStep_Python_default(SNES __pyx_v_snes, Vec __pyx_v_X, Vec __pyx_v_F, Vec __pyx_v_Y) { Mat __pyx_v_J; Mat __pyx_v_P; PetscInt __pyx_v_lits; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESStep_Python_default", 0); /* "libpetsc4py.pyx":2096 * ) \ * except IERR with gil: * FunctionBegin(b"SNESStep_Python_default") # <<<<<<<<<<<<<< * cdef PetscMat J = NULL, P = NULL * cdef PetscInt lits = 0 */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"SNESStep_Python_default")); /* "libpetsc4py.pyx":2097 * except IERR with gil: * FunctionBegin(b"SNESStep_Python_default") * cdef PetscMat J = NULL, P = NULL # <<<<<<<<<<<<<< * cdef PetscInt lits = 0 * CHKERR( SNESGetJacobian(snes,&J,&P,NULL,NULL) ) */ __pyx_v_J = NULL; __pyx_v_P = NULL; /* "libpetsc4py.pyx":2098 * FunctionBegin(b"SNESStep_Python_default") * cdef PetscMat J = NULL, P = NULL * cdef PetscInt lits = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetJacobian(snes,&J,&P,NULL,NULL) ) * CHKERR( SNESComputeJacobian(snes,X,J,P) ) */ __pyx_v_lits = 0; /* "libpetsc4py.pyx":2099 * cdef PetscMat J = NULL, P = NULL * cdef PetscInt lits = 0 * CHKERR( SNESGetJacobian(snes,&J,&P,NULL,NULL) ) # <<<<<<<<<<<<<< * CHKERR( SNESComputeJacobian(snes,X,J,P) ) * CHKERR( KSPSetOperators(snes.ksp,J,P) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESGetJacobian(__pyx_v_snes, (&__pyx_v_J), (&__pyx_v_P), NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2099, __pyx_L1_error) /* "libpetsc4py.pyx":2100 * cdef PetscInt lits = 0 * CHKERR( SNESGetJacobian(snes,&J,&P,NULL,NULL) ) * CHKERR( SNESComputeJacobian(snes,X,J,P) ) # <<<<<<<<<<<<<< * CHKERR( KSPSetOperators(snes.ksp,J,P) ) * CHKERR( KSPSolve(snes.ksp,F,Y) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESComputeJacobian(__pyx_v_snes, __pyx_v_X, __pyx_v_J, __pyx_v_P)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2100, __pyx_L1_error) /* "libpetsc4py.pyx":2101 * CHKERR( SNESGetJacobian(snes,&J,&P,NULL,NULL) ) * CHKERR( SNESComputeJacobian(snes,X,J,P) ) * CHKERR( KSPSetOperators(snes.ksp,J,P) ) # <<<<<<<<<<<<<< * CHKERR( KSPSolve(snes.ksp,F,Y) ) * CHKERR( KSPGetIterationNumber(snes.ksp,&lits) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPSetOperators(__pyx_v_snes->ksp, __pyx_v_J, __pyx_v_P)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2101, __pyx_L1_error) /* "libpetsc4py.pyx":2102 * CHKERR( SNESComputeJacobian(snes,X,J,P) ) * CHKERR( KSPSetOperators(snes.ksp,J,P) ) * CHKERR( KSPSolve(snes.ksp,F,Y) ) # <<<<<<<<<<<<<< * CHKERR( KSPGetIterationNumber(snes.ksp,&lits) ) * snes.linear_its += lits */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPSolve(__pyx_v_snes->ksp, __pyx_v_F, __pyx_v_Y)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2102, __pyx_L1_error) /* "libpetsc4py.pyx":2103 * CHKERR( KSPSetOperators(snes.ksp,J,P) ) * CHKERR( KSPSolve(snes.ksp,F,Y) ) * CHKERR( KSPGetIterationNumber(snes.ksp,&lits) ) # <<<<<<<<<<<<<< * snes.linear_its += lits * return FunctionEnd() */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPGetIterationNumber(__pyx_v_snes->ksp, (&__pyx_v_lits))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2103, __pyx_L1_error) /* "libpetsc4py.pyx":2104 * CHKERR( KSPSolve(snes.ksp,F,Y) ) * CHKERR( KSPGetIterationNumber(snes.ksp,&lits) ) * snes.linear_its += lits # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_snes->linear_its = (__pyx_v_snes->linear_its + __pyx_v_lits); /* "libpetsc4py.pyx":2105 * CHKERR( KSPGetIterationNumber(snes.ksp,&lits) ) * snes.linear_its += lits * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2089 * return FunctionEnd() * * cdef PetscErrorCode SNESStep_Python_default( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec X, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.SNESStep_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2186 * @cython.internal * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): # <<<<<<<<<<<<<< * if ts != NULL and ts.data != NULL: * return <_PyTS>ts.data */ static CYTHON_INLINE struct __pyx_obj_11libpetsc4py__PyTS *__pyx_f_11libpetsc4py_PyTS(TS __pyx_v_ts) { struct __pyx_obj_11libpetsc4py__PyTS *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyTS", 0); /* "libpetsc4py.pyx":2187 * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: # <<<<<<<<<<<<<< * return <_PyTS>ts.data * else: */ __pyx_t_2 = ((__pyx_v_ts != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_ts->data != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "libpetsc4py.pyx":2188 * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: * return <_PyTS>ts.data # <<<<<<<<<<<<<< * else: * return _PyTS.__new__(_PyTS) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_v_ts->data))); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_v_ts->data); goto __pyx_L0; /* "libpetsc4py.pyx":2187 * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): * if ts != NULL and ts.data != NULL: # <<<<<<<<<<<<<< * return <_PyTS>ts.data * else: */ } /* "libpetsc4py.pyx":2190 * return <_PyTS>ts.data * else: * return _PyTS.__new__(_PyTS) # <<<<<<<<<<<<<< * * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_3 = ((PyObject *)__pyx_tp_new_11libpetsc4py__PyTS(((PyTypeObject *)__pyx_ptype_11libpetsc4py__PyTS), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2190, __pyx_L1_error) __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_r = ((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":2186 * @cython.internal * cdef class _PyTS(_PyObj): pass * cdef inline _PyTS PyTS(PetscTS ts): # <<<<<<<<<<<<<< * if ts != NULL and ts.data != NULL: * return <_PyTS>ts.data */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.PyTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":2192 * return _PyTS.__new__(_PyTS) * * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"TSPythonGetContext") */ PetscErrorCode TSPythonGetContext(TS __pyx_v_ts, void **__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TSPythonGetContext", 0); /* "libpetsc4py.pyx":2194 * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ * except IERR: * FunctionBegin(b"TSPythonGetContext") # <<<<<<<<<<<<<< * PyTS(ts).getcontext(ctx) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSPythonGetContext")); /* "libpetsc4py.pyx":2195 * except IERR: * FunctionBegin(b"TSPythonGetContext") * PyTS(ts).getcontext(ctx) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyTS *)((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":2196 * FunctionBegin(b"TSPythonGetContext") * PyTS(ts).getcontext(ctx) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2192 * return _PyTS.__new__(_PyTS) * * cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"TSPythonGetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("libpetsc4py.TSPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":2198 * return FunctionEnd() * * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"TSPythonSetContext") */ PetscErrorCode TSPythonSetContext(TS __pyx_v_ts, void *__pyx_v_ctx) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("TSPythonSetContext", 0); /* "libpetsc4py.pyx":2200 * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ * except IERR: * FunctionBegin(b"TSPythonSetContext") # <<<<<<<<<<<<<< * PyTS(ts).setcontext(ctx, TS_(ts)) * return FunctionEnd() */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSPythonSetContext")); /* "libpetsc4py.pyx":2201 * except IERR: * FunctionBegin(b"TSPythonSetContext") * PyTS(ts).setcontext(ctx, TS_(ts)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((struct __pyx_vtabstruct_11libpetsc4py__PyTS *)((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.setcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_ctx, ((struct PyPetscObjectObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 2201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2202 * FunctionBegin(b"TSPythonSetContext") * PyTS(ts).setcontext(ctx, TS_(ts)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2198 * return FunctionEnd() * * cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ # <<<<<<<<<<<<<< * except IERR: * FunctionBegin(b"TSPythonSetContext") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.TSPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "libpetsc4py.pyx":2204 * return FunctionEnd() * * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") */ static PetscErrorCode __pyx_f_11libpetsc4py_TSPythonSetType_PYTHON(TS __pyx_v_ts, char *__pyx_v_name) { PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscErrorCode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSPythonSetType_PYTHON", 0); /* "libpetsc4py.pyx":2206 * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ * except IERR with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") # <<<<<<<<<<<<<< * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSPythonSetType_PYTHON")); /* "libpetsc4py.pyx":2207 * except IERR with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX # <<<<<<<<<<<<<< * cdef object ctx = createcontext(name) * TSPythonSetContext(ts, ctx) */ __pyx_t_1 = ((__pyx_v_name == NULL) != 0); if (__pyx_t_1) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":2208 * FunctionBegin(b"TSPythonSetType_PYTHON") * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) # <<<<<<<<<<<<<< * TSPythonSetContext(ts, ctx) * PyTS(ts).setname(name) */ __pyx_t_2 = __pyx_f_11libpetsc4py_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ctx = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2209 * if name == NULL: return FunctionEnd() # XXX * cdef object ctx = createcontext(name) * TSPythonSetContext(ts, ctx) # <<<<<<<<<<<<<< * PyTS(ts).setname(name) * return 0 */ __pyx_t_3 = TSPythonSetContext(__pyx_v_ts, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2209, __pyx_L1_error) /* "libpetsc4py.pyx":2210 * cdef object ctx = createcontext(name) * TSPythonSetContext(ts, ctx) * PyTS(ts).setname(name) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_11libpetsc4py__PyTS *)((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_t_2)->__pyx_base.__pyx_vtab)->__pyx_base.setname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_2), __pyx_v_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 2210, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2211 * TSPythonSetContext(ts, ctx) * PyTS(ts).setname(name) * return 0 # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSCreate_Python( */ __pyx_r = 0; goto __pyx_L0; /* "libpetsc4py.pyx":2204 * return FunctionEnd() * * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ # <<<<<<<<<<<<<< * except IERR with gil: * FunctionBegin(b"TSPythonSetType_PYTHON") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("libpetsc4py.TSPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2213 * return 0 * * cdef PetscErrorCode TSCreate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_TSCreate_Python(TS __pyx_v_ts) { TSOps __pyx_v_ops; PyObject *__pyx_v_ctx = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations TSOps __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSCreate_Python", 0); /* "libpetsc4py.pyx":2217 * ) \ * except IERR with gil: * FunctionBegin(b"TSCreate_Python") # <<<<<<<<<<<<<< * # * cdef TSOps ops = ts.ops */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSCreate_Python")); /* "libpetsc4py.pyx":2219 * FunctionBegin(b"TSCreate_Python") * # * cdef TSOps ops = ts.ops # <<<<<<<<<<<<<< * ops.reset = TSReset_Python * ops.destroy = TSDestroy_Python */ __pyx_t_1 = __pyx_v_ts->ops; __pyx_v_ops = __pyx_t_1; /* "libpetsc4py.pyx":2220 * # * cdef TSOps ops = ts.ops * ops.reset = TSReset_Python # <<<<<<<<<<<<<< * ops.destroy = TSDestroy_Python * ops.setup = TSSetUp_Python */ __pyx_v_ops->reset = __pyx_f_11libpetsc4py_TSReset_Python; /* "libpetsc4py.pyx":2221 * cdef TSOps ops = ts.ops * ops.reset = TSReset_Python * ops.destroy = TSDestroy_Python # <<<<<<<<<<<<<< * ops.setup = TSSetUp_Python * ops.setfromoptions = TSSetFromOptions_Python */ __pyx_v_ops->destroy = __pyx_f_11libpetsc4py_TSDestroy_Python; /* "libpetsc4py.pyx":2222 * ops.reset = TSReset_Python * ops.destroy = TSDestroy_Python * ops.setup = TSSetUp_Python # <<<<<<<<<<<<<< * ops.setfromoptions = TSSetFromOptions_Python * ops.view = TSView_Python */ __pyx_v_ops->setup = __pyx_f_11libpetsc4py_TSSetUp_Python; /* "libpetsc4py.pyx":2223 * ops.destroy = TSDestroy_Python * ops.setup = TSSetUp_Python * ops.setfromoptions = TSSetFromOptions_Python # <<<<<<<<<<<<<< * ops.view = TSView_Python * ops.step = TSStep_Python */ __pyx_v_ops->setfromoptions = __pyx_f_11libpetsc4py_TSSetFromOptions_Python; /* "libpetsc4py.pyx":2224 * ops.setup = TSSetUp_Python * ops.setfromoptions = TSSetFromOptions_Python * ops.view = TSView_Python # <<<<<<<<<<<<<< * ops.step = TSStep_Python * ops.rollback = TSRollBack_Python */ __pyx_v_ops->view = __pyx_f_11libpetsc4py_TSView_Python; /* "libpetsc4py.pyx":2225 * ops.setfromoptions = TSSetFromOptions_Python * ops.view = TSView_Python * ops.step = TSStep_Python # <<<<<<<<<<<<<< * ops.rollback = TSRollBack_Python * ops.interpolate = TSInterpolate_Python */ __pyx_v_ops->step = __pyx_f_11libpetsc4py_TSStep_Python; /* "libpetsc4py.pyx":2226 * ops.view = TSView_Python * ops.step = TSStep_Python * ops.rollback = TSRollBack_Python # <<<<<<<<<<<<<< * ops.interpolate = TSInterpolate_Python * ops.evaluatestep = TSEvaluateStep_Python */ __pyx_v_ops->rollback = __pyx_f_11libpetsc4py_TSRollBack_Python; /* "libpetsc4py.pyx":2227 * ops.step = TSStep_Python * ops.rollback = TSRollBack_Python * ops.interpolate = TSInterpolate_Python # <<<<<<<<<<<<<< * ops.evaluatestep = TSEvaluateStep_Python * ops.snesfunction = SNESTSFormFunction_Python */ __pyx_v_ops->interpolate = __pyx_f_11libpetsc4py_TSInterpolate_Python; /* "libpetsc4py.pyx":2228 * ops.rollback = TSRollBack_Python * ops.interpolate = TSInterpolate_Python * ops.evaluatestep = TSEvaluateStep_Python # <<<<<<<<<<<<<< * ops.snesfunction = SNESTSFormFunction_Python * ops.snesjacobian = SNESTSFormJacobian_Python */ __pyx_v_ops->evaluatestep = __pyx_f_11libpetsc4py_TSEvaluateStep_Python; /* "libpetsc4py.pyx":2229 * ops.interpolate = TSInterpolate_Python * ops.evaluatestep = TSEvaluateStep_Python * ops.snesfunction = SNESTSFormFunction_Python # <<<<<<<<<<<<<< * ops.snesjacobian = SNESTSFormJacobian_Python * # */ __pyx_v_ops->snesfunction = __pyx_f_11libpetsc4py_SNESTSFormFunction_Python; /* "libpetsc4py.pyx":2230 * ops.evaluatestep = TSEvaluateStep_Python * ops.snesfunction = SNESTSFormFunction_Python * ops.snesjacobian = SNESTSFormJacobian_Python # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectComposeFunction( */ __pyx_v_ops->snesjacobian = __pyx_f_11libpetsc4py_SNESTSFormJacobian_Python; /* "libpetsc4py.pyx":2232 * ops.snesjacobian = SNESTSFormJacobian_Python * # * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ts, b"TSPythonSetType_C", * TSPythonSetType_PYTHON) ) */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ts), ((char *)"TSPythonSetType_C"), ((PetscVoidFunction)__pyx_f_11libpetsc4py_TSPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2232, __pyx_L1_error) /* "libpetsc4py.pyx":2236 * TSPythonSetType_PYTHON) ) * # * ts.usessnes = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef ctx = PyTS(NULL) */ __pyx_v_ts->usessnes = PETSC_TRUE; /* "libpetsc4py.pyx":2238 * ts.usessnes = PETSC_TRUE * # * cdef ctx = PyTS(NULL) # <<<<<<<<<<<<<< * ts.data = ctx * Py_INCREF(ts.data) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ctx = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":2239 * # * cdef ctx = PyTS(NULL) * ts.data = ctx # <<<<<<<<<<<<<< * Py_INCREF(ts.data) * return FunctionEnd() */ __pyx_v_ts->data = ((void *)__pyx_v_ctx); /* "libpetsc4py.pyx":2240 * cdef ctx = PyTS(NULL) * ts.data = ctx * Py_INCREF(ts.data) # <<<<<<<<<<<<<< * return FunctionEnd() * */ Py_INCREF(((PyObject *)__pyx_v_ts->data)); /* "libpetsc4py.pyx":2241 * ts.data = ctx * Py_INCREF(ts.data) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSDestroy_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2213 * return 0 * * cdef PetscErrorCode TSCreate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("libpetsc4py.TSCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2243 * return FunctionEnd() * * cdef PetscErrorCode TSDestroy_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_TSDestroy_Python(TS __pyx_v_ts) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscErrorCode __pyx_t_3; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSDestroy_Python", 0); /* "libpetsc4py.pyx":2247 * ) \ * except IERR with gil: * FunctionBegin(b"TSDestroy_Python") # <<<<<<<<<<<<<< * CHKERR( PetscObjectComposeFunction( * ts, b"TSPythonSetType_C", */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSDestroy_Python")); /* "libpetsc4py.pyx":2248 * except IERR with gil: * FunctionBegin(b"TSDestroy_Python") * CHKERR( PetscObjectComposeFunction( # <<<<<<<<<<<<<< * ts, b"TSPythonSetType_C", * NULL) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_ts), ((char *)"TSPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2248, __pyx_L1_error) /* "libpetsc4py.pyx":2252 * NULL) ) * # * if not Py_IsInitialized(): return FunctionEnd() # <<<<<<<<<<<<<< * try: * addRef(ts) */ __pyx_t_2 = ((!(Py_IsInitialized() != 0)) != 0); if (__pyx_t_2) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":2253 * # * if not Py_IsInitialized(): return FunctionEnd() * try: # <<<<<<<<<<<<<< * addRef(ts) * TSPythonSetContext(ts, NULL) */ /*try:*/ { /* "libpetsc4py.pyx":2254 * if not Py_IsInitialized(): return FunctionEnd() * try: * addRef(ts) # <<<<<<<<<<<<<< * TSPythonSetContext(ts, NULL) * finally: */ __pyx_f_11libpetsc4py_addRef(__pyx_v_ts); /* "libpetsc4py.pyx":2255 * try: * addRef(ts) * TSPythonSetContext(ts, NULL) # <<<<<<<<<<<<<< * finally: * delRef(ts) */ __pyx_t_3 = TSPythonSetContext(__pyx_v_ts, NULL); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2255, __pyx_L5_error) } /* "libpetsc4py.pyx":2257 * TSPythonSetContext(ts, NULL) * finally: * delRef(ts) # <<<<<<<<<<<<<< * Py_DECREF(ts.data) * ts.data = NULL */ /*finally:*/ { /*normal exit:*/{ __pyx_f_11libpetsc4py_delRef(__pyx_v_ts); /* "libpetsc4py.pyx":2258 * finally: * delRef(ts) * Py_DECREF(ts.data) # <<<<<<<<<<<<<< * ts.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_ts->data)); /* "libpetsc4py.pyx":2259 * delRef(ts) * Py_DECREF(ts.data) * ts.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ts->data = NULL; goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_1 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { /* "libpetsc4py.pyx":2257 * TSPythonSetContext(ts, NULL) * finally: * delRef(ts) # <<<<<<<<<<<<<< * Py_DECREF(ts.data) * ts.data = NULL */ __pyx_f_11libpetsc4py_delRef(__pyx_v_ts); /* "libpetsc4py.pyx":2258 * finally: * delRef(ts) * Py_DECREF(ts.data) # <<<<<<<<<<<<<< * ts.data = NULL * return FunctionEnd() */ Py_DECREF(((PyObject *)__pyx_v_ts->data)); /* "libpetsc4py.pyx":2259 * delRef(ts) * Py_DECREF(ts.data) * ts.data = NULL # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ts->data = NULL; } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; } __pyx_L6:; } /* "libpetsc4py.pyx":2260 * Py_DECREF(ts.data) * ts.data = NULL * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSSetUp_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2243 * return FunctionEnd() * * cdef PetscErrorCode TSDestroy_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.TSDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2262 * return FunctionEnd() * * cdef PetscErrorCode TSSetUp_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_TSSetUp_Python(TS __pyx_v_ts) { Vec __pyx_v_vec_update; Vec __pyx_v_vec_dot; char __pyx_v_name[0x800]; PetscBool __pyx_v_found; PyObject *__pyx_v_setUp = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PetscErrorCode __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSSetUp_Python", 0); /* "libpetsc4py.pyx":2266 * ) \ * except IERR with gil: * FunctionBegin(b"TSSetUp_Python") # <<<<<<<<<<<<<< * # * cdef PetscVec vec_update = NULL */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSSetUp_Python")); /* "libpetsc4py.pyx":2268 * FunctionBegin(b"TSSetUp_Python") * # * cdef PetscVec vec_update = NULL # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(ts.vec_sol,&vec_update) ) * CHKERR( PetscObjectCompose(ts, */ __pyx_v_vec_update = NULL; /* "libpetsc4py.pyx":2269 * # * cdef PetscVec vec_update = NULL * CHKERR( VecDuplicate(ts.vec_sol,&vec_update) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ts, * b"@ts.vec_update", */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecDuplicate(__pyx_v_ts->vec_sol, (&__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2269, __pyx_L1_error) /* "libpetsc4py.pyx":2270 * cdef PetscVec vec_update = NULL * CHKERR( VecDuplicate(ts.vec_sol,&vec_update) ) * CHKERR( PetscObjectCompose(ts, # <<<<<<<<<<<<<< * b"@ts.vec_update", * vec_update) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_update"), ((PetscObject)__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2270, __pyx_L1_error) /* "libpetsc4py.pyx":2273 * b"@ts.vec_update", * vec_update) ) * CHKERR( VecDestroy(&vec_update) ) # <<<<<<<<<<<<<< * cdef PetscVec vec_dot = NULL * CHKERR( VecDuplicate(ts.vec_sol,&vec_dot) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecDestroy((&__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2273, __pyx_L1_error) /* "libpetsc4py.pyx":2274 * vec_update) ) * CHKERR( VecDestroy(&vec_update) ) * cdef PetscVec vec_dot = NULL # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(ts.vec_sol,&vec_dot) ) * CHKERR( PetscObjectCompose(ts, */ __pyx_v_vec_dot = NULL; /* "libpetsc4py.pyx":2275 * CHKERR( VecDestroy(&vec_update) ) * cdef PetscVec vec_dot = NULL * CHKERR( VecDuplicate(ts.vec_sol,&vec_dot) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ts, * b"@ts.vec_dot", */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecDuplicate(__pyx_v_ts->vec_sol, (&__pyx_v_vec_dot))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2275, __pyx_L1_error) /* "libpetsc4py.pyx":2276 * cdef PetscVec vec_dot = NULL * CHKERR( VecDuplicate(ts.vec_sol,&vec_dot) ) * CHKERR( PetscObjectCompose(ts, # <<<<<<<<<<<<<< * b"@ts.vec_dot", * vec_dot) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), ((PetscObject)__pyx_v_vec_dot))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2276, __pyx_L1_error) /* "libpetsc4py.pyx":2279 * b"@ts.vec_dot", * vec_dot) ) * CHKERR( VecDestroy(&vec_dot) ) # <<<<<<<<<<<<<< * # * cdef char name[2048] */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecDestroy((&__pyx_v_vec_dot))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2279, __pyx_L1_error) /* "libpetsc4py.pyx":2282 * # * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * if PyTS(ts).self is None: * CHKERR( PetscOptionsGetString(NULL, */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":2283 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ts),b"-ts_python_type", */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_t_2)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2284 * cdef PetscBool found = PETSC_FALSE * if PyTS(ts).self is None: * CHKERR( PetscOptionsGetString(NULL, # <<<<<<<<<<<<<< * getPrefix(ts),b"-ts_python_type", * name,sizeof(name),&found) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsGetString(NULL, __pyx_f_11libpetsc4py_getPrefix(__pyx_v_ts), ((char *)"-ts_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2284, __pyx_L1_error) /* "libpetsc4py.pyx":2287 * getPrefix(ts),b"-ts_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * if PyTS(ts).self is None: */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":2288 * name,sizeof(name),&found) ) * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts,name) ) # <<<<<<<<<<<<<< * if PyTS(ts).self is None: * return PetscSETERR(PETSC_ERR_USER, */ __pyx_t_5 = __pyx_f_11libpetsc4py_TSPythonSetType_PYTHON(__pyx_v_ts, __pyx_v_name); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2288, __pyx_L1_error) __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2288, __pyx_L1_error) /* "libpetsc4py.pyx":2287 * getPrefix(ts),b"-ts_python_type", * name,sizeof(name),&found) ) * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * if PyTS(ts).self is None: */ } /* "libpetsc4py.pyx":2283 * cdef char name[2048] * cdef PetscBool found = PETSC_FALSE * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(NULL, * getPrefix(ts),b"-ts_python_type", */ } /* "libpetsc4py.pyx":2289 * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_t_2)->__pyx_base.self == Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":2290 * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * if PyTS(ts).self is None: * return PetscSETERR(PETSC_ERR_USER, # <<<<<<<<<<<<<< * "Python context not set, call one of \n" * " * TSPythonSetType(ts,\"[package.]module.class\")\n" */ __pyx_r = __pyx_f_11libpetsc4py_PetscSETERR(PETSC_ERR_USER, ((char *)"Python context not set, call one of \n * TSPythonSetType(ts,\"[package.]module.class\")\n * TSSetFromOptions(ts) and pass option -ts_python_type [package.]module.class")); goto __pyx_L0; /* "libpetsc4py.pyx":2289 * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * if PyTS(ts).self is None: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, * "Python context not set, call one of \n" */ } /* "libpetsc4py.pyx":2296 * "-ts_python_type [package.]module.class") * # * cdef setUp = PyTS(ts).setUp # <<<<<<<<<<<<<< * if setUp is not None: * setUp(TS_(ts)) */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_setUp = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":2297 * # * cdef setUp = PyTS(ts).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(TS_(ts)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_setUp != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2298 * cdef setUp = PyTS(ts).setUp * if setUp is not None: * setUp(TS_(ts)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_setUp); __pyx_t_7 = __pyx_v_setUp; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":2297 * # * cdef setUp = PyTS(ts).setUp * if setUp is not None: # <<<<<<<<<<<<<< * setUp(TS_(ts)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":2299 * if setUp is not None: * setUp(TS_(ts)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSReset_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2262 * return FunctionEnd() * * cdef PetscErrorCode TSSetUp_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.TSSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setUp); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2301 * return FunctionEnd() * * cdef PetscErrorCode TSReset_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_TSReset_Python(TS __pyx_v_ts) { PyObject *__pyx_v_reset = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSReset_Python", 0); /* "libpetsc4py.pyx":2305 * ) \ * except IERR with gil: * if getRef(ts) == 0: return 0 # <<<<<<<<<<<<<< * FunctionBegin(b"TSReset_Python") * # */ __pyx_t_1 = ((__pyx_f_11libpetsc4py_getRef(__pyx_v_ts) == 0) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "libpetsc4py.pyx":2306 * except IERR with gil: * if getRef(ts) == 0: return 0 * FunctionBegin(b"TSReset_Python") # <<<<<<<<<<<<<< * # * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSReset_Python")); /* "libpetsc4py.pyx":2308 * FunctionBegin(b"TSReset_Python") * # * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) * # */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_update"), NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2308, __pyx_L1_error) /* "libpetsc4py.pyx":2309 * # * CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) # <<<<<<<<<<<<<< * # * cdef reset = PyTS(ts).reset */ __pyx_t_2 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectCompose(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2309, __pyx_L1_error) /* "libpetsc4py.pyx":2311 * CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) * # * cdef reset = PyTS(ts).reset # <<<<<<<<<<<<<< * if reset is not None: * reset(TS_(ts)) */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reset); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_reset = __pyx_t_4; __pyx_t_4 = 0; /* "libpetsc4py.pyx":2312 * # * cdef reset = PyTS(ts).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(TS_(ts)) * return FunctionEnd() */ __pyx_t_1 = (__pyx_v_reset != Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":2313 * cdef reset = PyTS(ts).reset * if reset is not None: * reset(TS_(ts)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_3 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_reset); __pyx_t_6 = __pyx_v_reset; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "libpetsc4py.pyx":2312 * # * cdef reset = PyTS(ts).reset * if reset is not None: # <<<<<<<<<<<<<< * reset(TS_(ts)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":2314 * if reset is not None: * reset(TS_(ts)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSSetFromOptions_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2301 * return FunctionEnd() * * cdef PetscErrorCode TSReset_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("libpetsc4py.TSReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_reset); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2316 * return FunctionEnd() * * cdef PetscErrorCode TSSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscTS ts, */ static PetscErrorCode __pyx_f_11libpetsc4py_TSSetFromOptions_Python(PetscOptionItems *__pyx_v_PetscOptionsObject, TS __pyx_v_ts) { char __pyx_v_name[0x800]; char *__pyx_v_defval; PetscBool __pyx_v_found; PetscOptionItems *PetscOptionsObject; PyObject *__pyx_v_setFromOptions = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char *__pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PetscErrorCode __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSSetFromOptions_Python", 0); /* "libpetsc4py.pyx":2321 * ) \ * except IERR with gil: * FunctionBegin(b"TSSetFromOptions_Python") # <<<<<<<<<<<<<< * cdef char name[2048], *defval = PyTS(ts).getname() * cdef PetscBool found = PETSC_FALSE */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSSetFromOptions_Python")); /* "libpetsc4py.pyx":2322 * except IERR with gil: * FunctionBegin(b"TSSetFromOptions_Python") * cdef char name[2048], *defval = PyTS(ts).getname() # <<<<<<<<<<<<<< * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((struct __pyx_vtabstruct_11libpetsc4py__PyTS *)((struct __pyx_obj_11libpetsc4py__PyTS *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 2322, __pyx_L1_error) __pyx_v_defval = __pyx_t_2; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":2323 * FunctionBegin(b"TSSetFromOptions_Python") * cdef char name[2048], *defval = PyTS(ts).getname() * cdef PetscBool found = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( */ __pyx_v_found = PETSC_FALSE; /* "libpetsc4py.pyx":2324 * cdef char name[2048], *defval = PyTS(ts).getname() * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject # <<<<<<<<<<<<<< * CHKERR( PetscOptionsString( * b"-ts_python_type",b"Python [package.]module[.{class|function}]", */ PetscOptionsObject = __pyx_v_PetscOptionsObject; /* "libpetsc4py.pyx":2325 * cdef PetscBool found = PETSC_FALSE * cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject * CHKERR( PetscOptionsString( # <<<<<<<<<<<<<< * b"-ts_python_type",b"Python [package.]module[.{class|function}]", * b"TSPythonSetType",defval,name,sizeof(name),&found) ); opts; */ __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(PetscOptionsString(((char *)"-ts_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"TSPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 2325, __pyx_L1_error) /* "libpetsc4py.pyx":2327 * CHKERR( PetscOptionsString( * b"-ts_python_type",b"Python [package.]module[.{class|function}]", * b"TSPythonSetType",defval,name,sizeof(name),&found) ); opts; # <<<<<<<<<<<<<< * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts,name) ) */ ((void)PetscOptionsObject); /* "libpetsc4py.pyx":2328 * b"-ts_python_type",b"Python [package.]module[.{class|function}]", * b"TSPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * # */ if (__pyx_v_found) { } else { __pyx_t_4 = __pyx_v_found; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_name[0]) != 0); __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "libpetsc4py.pyx":2329 * b"TSPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: * CHKERR( TSPythonSetType_PYTHON(ts,name) ) # <<<<<<<<<<<<<< * # * cdef setFromOptions = PyTS(ts).setFromOptions */ __pyx_t_6 = __pyx_f_11libpetsc4py_TSPythonSetType_PYTHON(__pyx_v_ts, __pyx_v_name); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2329, __pyx_L1_error) __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(__pyx_t_6); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 2329, __pyx_L1_error) /* "libpetsc4py.pyx":2328 * b"-ts_python_type",b"Python [package.]module[.{class|function}]", * b"TSPythonSetType",defval,name,sizeof(name),&found) ); opts; * if found and name[0]: # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * # */ } /* "libpetsc4py.pyx":2331 * CHKERR( TSPythonSetType_PYTHON(ts,name) ) * # * cdef setFromOptions = PyTS(ts).setFromOptions # <<<<<<<<<<<<<< * if setFromOptions is not None: * setFromOptions(TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_setFromOptions = __pyx_t_7; __pyx_t_7 = 0; /* "libpetsc4py.pyx":2332 * # * cdef setFromOptions = PyTS(ts).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) */ __pyx_t_4 = (__pyx_v_setFromOptions != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":2333 * cdef setFromOptions = PyTS(ts).setFromOptions * if setFromOptions is not None: * setFromOptions(TS_(ts)) # <<<<<<<<<<<<<< * CHKERR( SNESSetFromOptions(ts.snes) ) * return FunctionEnd() */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_setFromOptions); __pyx_t_8 = __pyx_v_setFromOptions; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "libpetsc4py.pyx":2332 * # * cdef setFromOptions = PyTS(ts).setFromOptions * if setFromOptions is not None: # <<<<<<<<<<<<<< * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) */ } /* "libpetsc4py.pyx":2334 * if setFromOptions is not None: * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_3 = __pyx_f_11libpetsc4py_CHKERR(SNESSetFromOptions(__pyx_v_ts->snes)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 2334, __pyx_L1_error) /* "libpetsc4py.pyx":2335 * setFromOptions(TS_(ts)) * CHKERR( SNESSetFromOptions(ts.snes) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSView_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2316 * return FunctionEnd() * * cdef PetscErrorCode TSSetFromOptions_Python( # <<<<<<<<<<<<<< * PetscOptionItems *PetscOptionsObject, * PetscTS ts, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.TSSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_setFromOptions); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2337 * return FunctionEnd() * * cdef PetscErrorCode TSView_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscViewer vwr, */ static PetscErrorCode __pyx_f_11libpetsc4py_TSView_Python(TS __pyx_v_ts, PetscViewer __pyx_v_vwr) { PyObject *__pyx_v_view = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSView_Python", 0); /* "libpetsc4py.pyx":2342 * ) \ * except IERR with gil: * FunctionBegin(b"TSView_Python") # <<<<<<<<<<<<<< * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSView_Python")); /* "libpetsc4py.pyx":2343 * except IERR with gil: * FunctionBegin(b"TSView_Python") * viewcontext(PyTS(ts), vwr) # <<<<<<<<<<<<<< * cdef view = PyTS(ts).view * if view is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_11libpetsc4py_viewcontext(((struct __pyx_obj_11libpetsc4py__PyObj *)__pyx_t_1), __pyx_v_vwr); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "libpetsc4py.pyx":2344 * FunctionBegin(b"TSView_Python") * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view # <<<<<<<<<<<<<< * if view is not None: * view(TS_(ts), Viewer_(vwr)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_view = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":2345 * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view * if view is not None: # <<<<<<<<<<<<<< * view(TS_(ts), Viewer_(vwr)) * return FunctionEnd() */ __pyx_t_4 = (__pyx_v_view != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":2346 * cdef view = PyTS(ts).view * if view is not None: * view(TS_(ts), Viewer_(vwr)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_view); __pyx_t_7 = __pyx_v_view; __pyx_t_8 = NULL; __pyx_t_2 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_2 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2346, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_1, __pyx_t_6}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2346, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_2, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":2345 * viewcontext(PyTS(ts), vwr) * cdef view = PyTS(ts).view * if view is not None: # <<<<<<<<<<<<<< * view(TS_(ts), Viewer_(vwr)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":2347 * if view is not None: * view(TS_(ts), Viewer_(vwr)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2337 * return FunctionEnd() * * cdef PetscErrorCode TSView_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscViewer vwr, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("libpetsc4py.TSView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_view); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2349 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_TSStep_Python(TS __pyx_v_ts) { PyObject *__pyx_v_step = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PetscErrorCode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSStep_Python", 0); /* "libpetsc4py.pyx":2353 * ) \ * except IERR with gil: * FunctionBegin(b"TSStep_Python") # <<<<<<<<<<<<<< * cdef step = PyTS(ts).step * if step is not None: */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSStep_Python")); /* "libpetsc4py.pyx":2354 * except IERR with gil: * FunctionBegin(b"TSStep_Python") * cdef step = PyTS(ts).step # <<<<<<<<<<<<<< * if step is not None: * step(TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_step = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2355 * FunctionBegin(b"TSStep_Python") * cdef step = PyTS(ts).step * if step is not None: # <<<<<<<<<<<<<< * step(TS_(ts)) * else: */ __pyx_t_3 = (__pyx_v_step != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2356 * cdef step = PyTS(ts).step * if step is not None: * step(TS_(ts)) # <<<<<<<<<<<<<< * else: * TSStep_Python_default(ts) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_step); __pyx_t_5 = __pyx_v_step; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2355 * FunctionBegin(b"TSStep_Python") * cdef step = PyTS(ts).step * if step is not None: # <<<<<<<<<<<<<< * step(TS_(ts)) * else: */ goto __pyx_L3; } /* "libpetsc4py.pyx":2358 * step(TS_(ts)) * else: * TSStep_Python_default(ts) # <<<<<<<<<<<<<< * return FunctionEnd() * */ /*else*/ { __pyx_t_7 = __pyx_f_11libpetsc4py_TSStep_Python_default(__pyx_v_ts); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2358, __pyx_L1_error) } __pyx_L3:; /* "libpetsc4py.pyx":2359 * else: * TSStep_Python_default(ts) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSRollBack_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2349 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.TSStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_step); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2361 * return FunctionEnd() * * cdef PetscErrorCode TSRollBack_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_TSRollBack_Python(TS __pyx_v_ts) { PyObject *__pyx_v_rollback = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSRollBack_Python", 0); /* "libpetsc4py.pyx":2365 * ) \ * except IERR with gil: * FunctionBegin(b"TSRollBack_Python") # <<<<<<<<<<<<<< * cdef rollback = PyTS(ts).rollback * if rollback is None: return UNSUPPORTED(b"rollback") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSRollBack_Python")); /* "libpetsc4py.pyx":2366 * except IERR with gil: * FunctionBegin(b"TSRollBack_Python") * cdef rollback = PyTS(ts).rollback # <<<<<<<<<<<<<< * if rollback is None: return UNSUPPORTED(b"rollback") * rollback(TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_rollback); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rollback = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2367 * FunctionBegin(b"TSRollBack_Python") * cdef rollback = PyTS(ts).rollback * if rollback is None: return UNSUPPORTED(b"rollback") # <<<<<<<<<<<<<< * rollback(TS_(ts)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_rollback == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"rollback")); goto __pyx_L0; } /* "libpetsc4py.pyx":2368 * cdef rollback = PyTS(ts).rollback * if rollback is None: return UNSUPPORTED(b"rollback") * rollback(TS_(ts)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_rollback); __pyx_t_5 = __pyx_v_rollback; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2369 * if rollback is None: return UNSUPPORTED(b"rollback") * rollback(TS_(ts)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSInterpolate_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2361 * return FunctionEnd() * * cdef PetscErrorCode TSRollBack_Python( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("libpetsc4py.TSRollBack_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rollback); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2371 * return FunctionEnd() * * cdef PetscErrorCode TSInterpolate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_11libpetsc4py_TSInterpolate_Python(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x) { PyObject *__pyx_v_interpolate = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSInterpolate_Python", 0); /* "libpetsc4py.pyx":2377 * ) \ * except IERR with gil: * FunctionBegin(b"TSInterpolate _Python") # <<<<<<<<<<<<<< * cdef interpolate = PyTS(ts).interpolate * if interpolate is None: return UNSUPPORTED(b"interpolate") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSInterpolate _Python")); /* "libpetsc4py.pyx":2378 * except IERR with gil: * FunctionBegin(b"TSInterpolate _Python") * cdef interpolate = PyTS(ts).interpolate # <<<<<<<<<<<<<< * if interpolate is None: return UNSUPPORTED(b"interpolate") * interpolate(TS_(ts),toReal(t),Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_interpolate = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2379 * FunctionBegin(b"TSInterpolate _Python") * cdef interpolate = PyTS(ts).interpolate * if interpolate is None: return UNSUPPORTED(b"interpolate") # <<<<<<<<<<<<<< * interpolate(TS_(ts),toReal(t),Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_interpolate == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"interpolate")); goto __pyx_L0; } /* "libpetsc4py.pyx":2380 * cdef interpolate = PyTS(ts).interpolate * if interpolate is None: return UNSUPPORTED(b"interpolate") * interpolate(TS_(ts),toReal(t),Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_f_11libpetsc4py_toReal(__pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_interpolate); __pyx_t_7 = __pyx_v_interpolate; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2381 * if interpolate is None: return UNSUPPORTED(b"interpolate") * interpolate(TS_(ts),toReal(t),Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSEvaluateStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2371 * return FunctionEnd() * * cdef PetscErrorCode TSInterpolate_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.TSInterpolate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_interpolate); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2383 * return FunctionEnd() * * cdef PetscErrorCode TSEvaluateStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt o, */ static PetscErrorCode __pyx_f_11libpetsc4py_TSEvaluateStep_Python(TS __pyx_v_ts, PetscInt __pyx_v_o, Vec __pyx_v_x, PetscBool *__pyx_v_flag) { PyObject *__pyx_v_evaluatestep = 0; PyObject *__pyx_v_done = 0; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PetscBool __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSEvaluateStep_Python", 0); /* "libpetsc4py.pyx":2390 * ) \ * except IERR with gil: * FunctionBegin(b"TSEvaluateStep _Python") # <<<<<<<<<<<<<< * cdef evaluatestep = PyTS(ts).evaluatestep * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSEvaluateStep _Python")); /* "libpetsc4py.pyx":2391 * except IERR with gil: * FunctionBegin(b"TSEvaluateStep _Python") * cdef evaluatestep = PyTS(ts).evaluatestep # <<<<<<<<<<<<<< * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts),toInt(o),Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_evaluatestep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_evaluatestep = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2392 * FunctionBegin(b"TSEvaluateStep _Python") * cdef evaluatestep = PyTS(ts).evaluatestep * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") # <<<<<<<<<<<<<< * cdef done = evaluatestep(TS_(ts),toInt(o),Vec_(x)) * if flag != NULL: */ __pyx_t_3 = (__pyx_v_evaluatestep == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_r = __pyx_f_11libpetsc4py_UNSUPPORTED(((char *)"evaluatestep")); goto __pyx_L0; } /* "libpetsc4py.pyx":2393 * cdef evaluatestep = PyTS(ts).evaluatestep * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts),toInt(o),Vec_(x)) # <<<<<<<<<<<<<< * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_f_11libpetsc4py_toInt(__pyx_v_o); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_evaluatestep); __pyx_t_7 = __pyx_v_evaluatestep; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_done = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2394 * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts),toInt(o),Vec_(x)) * if flag != NULL: # <<<<<<<<<<<<<< * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: */ __pyx_t_4 = ((__pyx_v_flag != NULL) != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2395 * cdef done = evaluatestep(TS_(ts),toInt(o),Vec_(x)) * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE # <<<<<<<<<<<<<< * elif not done: * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_done); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2395, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_11 = PETSC_TRUE; } else { __pyx_t_11 = PETSC_FALSE; } (__pyx_v_flag[0]) = __pyx_t_11; /* "libpetsc4py.pyx":2394 * if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") * cdef done = evaluatestep(TS_(ts),toInt(o),Vec_(x)) * if flag != NULL: # <<<<<<<<<<<<<< * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: */ goto __pyx_L4; } /* "libpetsc4py.pyx":2396 * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") * return FunctionEnd() */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_done); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2396, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":2397 * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_r = __pyx_f_11libpetsc4py_PetscSETERR(PETSC_ERR_USER, ((char *)"Cannot evaluate step")); goto __pyx_L0; /* "libpetsc4py.pyx":2396 * if flag != NULL: * flag[0] = PETSC_TRUE if done else PETSC_FALSE * elif not done: # <<<<<<<<<<<<<< * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") * return FunctionEnd() */ } __pyx_L4:; /* "libpetsc4py.pyx":2398 * elif not done: * return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESTSFormFunction_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2383 * return FunctionEnd() * * cdef PetscErrorCode TSEvaluateStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt o, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.TSEvaluateStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_evaluatestep); __Pyx_XDECREF(__pyx_v_done); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2400 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormFunction_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESTSFormFunction_Python(SNES __pyx_v_snes, Vec __pyx_v_x, Vec __pyx_v_f, TS __pyx_v_ts) { PyObject *__pyx_v_formSNESFunction = 0; PyObject *__pyx_v_args = NULL; Vec __pyx_v_dx; PetscReal __pyx_v_t; PetscReal __pyx_v_a; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESTSFormFunction_Python", 0); /* "libpetsc4py.pyx":2408 * except IERR with gil: * # * cdef formSNESFunction = PyTS(ts).formSNESFunction # <<<<<<<<<<<<<< * if formSNESFunction is not None: * args = (SNES_(snes),Vec_(x),Vec_(f),TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_formSNESFunction); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_formSNESFunction = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2409 * # * cdef formSNESFunction = PyTS(ts).formSNESFunction * if formSNESFunction is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes),Vec_(x),Vec_(f),TS_(ts)) * formSNESFunction(args) */ __pyx_t_3 = (__pyx_v_formSNESFunction != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2410 * cdef formSNESFunction = PyTS(ts).formSNESFunction * if formSNESFunction is not None: * args = (SNES_(snes),Vec_(x),Vec_(f),TS_(ts)) # <<<<<<<<<<<<<< * formSNESFunction(args) * return FunctionEnd() */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_f)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_v_args = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; /* "libpetsc4py.pyx":2411 * if formSNESFunction is not None: * args = (SNES_(snes),Vec_(x),Vec_(f),TS_(ts)) * formSNESFunction(args) # <<<<<<<<<<<<<< * return FunctionEnd() * # */ __Pyx_INCREF(__pyx_v_formSNESFunction); __pyx_t_6 = __pyx_v_formSNESFunction; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_args); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "libpetsc4py.pyx":2412 * args = (SNES_(snes),Vec_(x),Vec_(f),TS_(ts)) * formSNESFunction(args) * return FunctionEnd() # <<<<<<<<<<<<<< * # * cdef PetscVec dx = NULL */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2409 * # * cdef formSNESFunction = PyTS(ts).formSNESFunction * if formSNESFunction is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes),Vec_(x),Vec_(f),TS_(ts)) * formSNESFunction(args) */ } /* "libpetsc4py.pyx":2414 * return FunctionEnd() * # * cdef PetscVec dx = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ts, */ __pyx_v_dx = NULL; /* "libpetsc4py.pyx":2415 * # * cdef PetscVec dx = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ts, * b"@ts.vec_dot", */ __pyx_t_8 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), ((PetscObject *)(&__pyx_v_dx)))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2415, __pyx_L1_error) /* "libpetsc4py.pyx":2420 * &dx) ) * # * cdef PetscReal t = ts.ptime + ts.time_step # <<<<<<<<<<<<<< * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol,dx) ) */ __pyx_v_t = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "libpetsc4py.pyx":2421 * # * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step # <<<<<<<<<<<<<< * CHKERR( VecCopy(ts.vec_sol,dx) ) * CHKERR( VecAXPBY(dx,+a,-a,x) ) */ __pyx_v_a = (((PetscReal)1.0) / __pyx_v_ts->time_step); /* "libpetsc4py.pyx":2422 * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol,dx) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPBY(dx,+a,-a,x) ) * CHKERR( TSComputeIFunction(ts,t,x,dx,f,PETSC_FALSE) ) */ __pyx_t_8 = __pyx_f_11libpetsc4py_CHKERR(VecCopy(__pyx_v_ts->vec_sol, __pyx_v_dx)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2422, __pyx_L1_error) /* "libpetsc4py.pyx":2423 * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol,dx) ) * CHKERR( VecAXPBY(dx,+a,-a,x) ) # <<<<<<<<<<<<<< * CHKERR( TSComputeIFunction(ts,t,x,dx,f,PETSC_FALSE) ) * return FunctionEnd() */ __pyx_t_8 = __pyx_f_11libpetsc4py_CHKERR(VecAXPBY(__pyx_v_dx, __pyx_v_a, (-__pyx_v_a), __pyx_v_x)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2423, __pyx_L1_error) /* "libpetsc4py.pyx":2424 * CHKERR( VecCopy(ts.vec_sol,dx) ) * CHKERR( VecAXPBY(dx,+a,-a,x) ) * CHKERR( TSComputeIFunction(ts,t,x,dx,f,PETSC_FALSE) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_8 = __pyx_f_11libpetsc4py_CHKERR(TSComputeIFunction(__pyx_v_ts, __pyx_v_t, __pyx_v_x, __pyx_v_dx, __pyx_v_f, PETSC_FALSE)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 2424, __pyx_L1_error) /* "libpetsc4py.pyx":2425 * CHKERR( VecAXPBY(dx,+a,-a,x) ) * CHKERR( TSComputeIFunction(ts,t,x,dx,f,PETSC_FALSE) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode SNESTSFormJacobian_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2400 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormFunction_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("libpetsc4py.SNESTSFormFunction_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_formSNESFunction); __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2427 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormJacobian_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static PetscErrorCode __pyx_f_11libpetsc4py_SNESTSFormJacobian_Python(SNES __pyx_v_snes, Vec __pyx_v_x, Mat __pyx_v_A, Mat __pyx_v_B, TS __pyx_v_ts) { PyObject *__pyx_v_formSNESJacobian = 0; PyObject *__pyx_v_args = NULL; Vec __pyx_v_dx; PetscReal __pyx_v_t; PetscReal __pyx_v_a; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNESTSFormJacobian_Python", 0); /* "libpetsc4py.pyx":2436 * except IERR with gil: * # * cdef formSNESJacobian = PyTS(ts).formSNESJacobian # <<<<<<<<<<<<<< * if formSNESJacobian is not None: * args = (SNES_(snes),Vec_(x),Mat_(A),Mat_(B),TS_(ts)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_formSNESJacobian); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_formSNESJacobian = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2437 * # * cdef formSNESJacobian = PyTS(ts).formSNESJacobian * if formSNESJacobian is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes),Vec_(x),Mat_(A),Mat_(B),TS_(ts)) * formSNESJacobian(*args) */ __pyx_t_3 = (__pyx_v_formSNESJacobian != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2438 * cdef formSNESJacobian = PyTS(ts).formSNESJacobian * if formSNESJacobian is not None: * args = (SNES_(snes),Vec_(x),Mat_(A),Mat_(B),TS_(ts)) # <<<<<<<<<<<<<< * formSNESJacobian(*args) * return FunctionEnd() */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_A)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Mat_(__pyx_v_B)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_7); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_v_args = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "libpetsc4py.pyx":2439 * if formSNESJacobian is not None: * args = (SNES_(snes),Vec_(x),Mat_(A),Mat_(B),TS_(ts)) * formSNESJacobian(*args) # <<<<<<<<<<<<<< * return FunctionEnd() * # */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_formSNESJacobian, __pyx_v_args, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "libpetsc4py.pyx":2440 * args = (SNES_(snes),Vec_(x),Mat_(A),Mat_(B),TS_(ts)) * formSNESJacobian(*args) * return FunctionEnd() # <<<<<<<<<<<<<< * # * cdef PetscVec dx = NULL */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2437 * # * cdef formSNESJacobian = PyTS(ts).formSNESJacobian * if formSNESJacobian is not None: # <<<<<<<<<<<<<< * args = (SNES_(snes),Vec_(x),Mat_(A),Mat_(B),TS_(ts)) * formSNESJacobian(*args) */ } /* "libpetsc4py.pyx":2442 * return FunctionEnd() * # * cdef PetscVec dx = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ts, */ __pyx_v_dx = NULL; /* "libpetsc4py.pyx":2443 * # * cdef PetscVec dx = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ts, * b"@ts.vec_dot", */ __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_dot"), ((PetscObject *)(&__pyx_v_dx)))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2443, __pyx_L1_error) /* "libpetsc4py.pyx":2448 * &dx) ) * # * cdef PetscReal t = ts.ptime + ts.time_step # <<<<<<<<<<<<<< * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol,dx) ) */ __pyx_v_t = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "libpetsc4py.pyx":2449 * # * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step # <<<<<<<<<<<<<< * CHKERR( VecCopy(ts.vec_sol,dx) ) * CHKERR( VecAXPBY(dx,+a,-a,x) ) */ __pyx_v_a = (((PetscReal)1.0) / __pyx_v_ts->time_step); /* "libpetsc4py.pyx":2450 * cdef PetscReal t = ts.ptime + ts.time_step * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol,dx) ) # <<<<<<<<<<<<<< * CHKERR( VecAXPBY(dx,+a,-a,x) ) * CHKERR( TSComputeIJacobian(ts,t,x,dx,a,A,B,PETSC_FALSE) ) */ __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(VecCopy(__pyx_v_ts->vec_sol, __pyx_v_dx)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2450, __pyx_L1_error) /* "libpetsc4py.pyx":2451 * cdef PetscReal a = 1.0/ts.time_step * CHKERR( VecCopy(ts.vec_sol,dx) ) * CHKERR( VecAXPBY(dx,+a,-a,x) ) # <<<<<<<<<<<<<< * CHKERR( TSComputeIJacobian(ts,t,x,dx,a,A,B,PETSC_FALSE) ) * return FunctionEnd() */ __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(VecAXPBY(__pyx_v_dx, __pyx_v_a, (-__pyx_v_a), __pyx_v_x)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2451, __pyx_L1_error) /* "libpetsc4py.pyx":2452 * CHKERR( VecCopy(ts.vec_sol,dx) ) * CHKERR( VecAXPBY(dx,+a,-a,x) ) * CHKERR( TSComputeIJacobian(ts,t,x,dx,a,A,B,PETSC_FALSE) ) # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(TSComputeIJacobian(__pyx_v_ts, __pyx_v_t, __pyx_v_x, __pyx_v_dx, __pyx_v_a, __pyx_v_A, __pyx_v_B, PETSC_FALSE)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2452, __pyx_L1_error) /* "libpetsc4py.pyx":2453 * CHKERR( VecAXPBY(dx,+a,-a,x) ) * CHKERR( TSComputeIJacobian(ts,t,x,dx,a,A,B,PETSC_FALSE) ) * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSSolveStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2427 * return FunctionEnd() * * cdef PetscErrorCode SNESTSFormJacobian_Python( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("libpetsc4py.SNESTSFormJacobian_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_formSNESJacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2455 * return FunctionEnd() * * cdef PetscErrorCode TSSolveStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_11libpetsc4py_TSSolveStep_Python(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x) { PyObject *__pyx_v_solveStep = 0; PetscInt __pyx_v_nits; PetscInt __pyx_v_lits; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSSolveStep_Python", 0); /* "libpetsc4py.pyx":2461 * ) \ * except IERR with gil: * FunctionBegin(b"TSSolveStep_Python") # <<<<<<<<<<<<<< * # * cdef solveStep = PyTS(ts).solveStep */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSSolveStep_Python")); /* "libpetsc4py.pyx":2463 * FunctionBegin(b"TSSolveStep_Python") * # * cdef solveStep = PyTS(ts).solveStep # <<<<<<<<<<<<<< * if solveStep is not None: * solveStep(TS_(ts), t, Vec_(x)) */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_solveStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solveStep = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2464 * # * cdef solveStep = PyTS(ts).solveStep * if solveStep is not None: # <<<<<<<<<<<<<< * solveStep(TS_(ts), t, Vec_(x)) * return FunctionEnd() */ __pyx_t_3 = (__pyx_v_solveStep != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2465 * cdef solveStep = PyTS(ts).solveStep * if solveStep is not None: * solveStep(TS_(ts), t, Vec_(x)) # <<<<<<<<<<<<<< * return FunctionEnd() * # */ __pyx_t_1 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyFloat_FromDouble(((double)__pyx_v_t)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_solveStep); __pyx_t_7 = __pyx_v_solveStep; __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_1, __pyx_t_5, __pyx_t_6}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_t_6); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2466 * if solveStep is not None: * solveStep(TS_(ts), t, Vec_(x)) * return FunctionEnd() # <<<<<<<<<<<<<< * # * cdef PetscInt nits = 0, lits = 0 */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2464 * # * cdef solveStep = PyTS(ts).solveStep * if solveStep is not None: # <<<<<<<<<<<<<< * solveStep(TS_(ts), t, Vec_(x)) * return FunctionEnd() */ } /* "libpetsc4py.pyx":2468 * return FunctionEnd() * # * cdef PetscInt nits = 0, lits = 0 # <<<<<<<<<<<<<< * CHKERR( SNESSolve(ts.snes, NULL, x) ) * CHKERR( SNESGetIterationNumber(ts.snes,&nits) ) */ __pyx_v_nits = 0; __pyx_v_lits = 0; /* "libpetsc4py.pyx":2469 * # * cdef PetscInt nits = 0, lits = 0 * CHKERR( SNESSolve(ts.snes, NULL, x) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetIterationNumber(ts.snes,&nits) ) * CHKERR( SNESGetLinearSolveIterations(ts.snes,&lits) ) */ __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(SNESSolve(__pyx_v_ts->snes, NULL, __pyx_v_x)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2469, __pyx_L1_error) /* "libpetsc4py.pyx":2470 * cdef PetscInt nits = 0, lits = 0 * CHKERR( SNESSolve(ts.snes, NULL, x) ) * CHKERR( SNESGetIterationNumber(ts.snes,&nits) ) # <<<<<<<<<<<<<< * CHKERR( SNESGetLinearSolveIterations(ts.snes,&lits) ) * ts.snes_its += nits */ __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(SNESGetIterationNumber(__pyx_v_ts->snes, (&__pyx_v_nits))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2470, __pyx_L1_error) /* "libpetsc4py.pyx":2471 * CHKERR( SNESSolve(ts.snes, NULL, x) ) * CHKERR( SNESGetIterationNumber(ts.snes,&nits) ) * CHKERR( SNESGetLinearSolveIterations(ts.snes,&lits) ) # <<<<<<<<<<<<<< * ts.snes_its += nits * ts.ksp_its += lits */ __pyx_t_9 = __pyx_f_11libpetsc4py_CHKERR(SNESGetLinearSolveIterations(__pyx_v_ts->snes, (&__pyx_v_lits))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 2471, __pyx_L1_error) /* "libpetsc4py.pyx":2472 * CHKERR( SNESGetIterationNumber(ts.snes,&nits) ) * CHKERR( SNESGetLinearSolveIterations(ts.snes,&lits) ) * ts.snes_its += nits # <<<<<<<<<<<<<< * ts.ksp_its += lits * return FunctionEnd() */ __pyx_v_ts->snes_its = (__pyx_v_ts->snes_its + __pyx_v_nits); /* "libpetsc4py.pyx":2473 * CHKERR( SNESGetLinearSolveIterations(ts.snes,&lits) ) * ts.snes_its += nits * ts.ksp_its += lits # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ts->ksp_its = (__pyx_v_ts->ksp_its + __pyx_v_lits); /* "libpetsc4py.pyx":2474 * ts.snes_its += nits * ts.ksp_its += lits * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSAdaptStep_Python( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2455 * return FunctionEnd() * * cdef PetscErrorCode TSSolveStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("libpetsc4py.TSSolveStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solveStep); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2476 * return FunctionEnd() * * cdef PetscErrorCode TSAdaptStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static PetscErrorCode __pyx_f_11libpetsc4py_TSAdaptStep_Python(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, PetscReal *__pyx_v_nextdt, PetscBool *__pyx_v_stepok) { PyObject *__pyx_v_adaptStep = 0; PyObject *__pyx_v_retval = 0; double __pyx_v_dt; int __pyx_v_ok; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; double __pyx_t_12; PetscBool __pyx_t_13; PyObject *(*__pyx_t_14)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSAdaptStep_Python", 0); /* "libpetsc4py.pyx":2484 * ) \ * except IERR with gil: * FunctionBegin(b"TSAdaptStep_Python") # <<<<<<<<<<<<<< * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSAdaptStep_Python")); /* "libpetsc4py.pyx":2485 * except IERR with gil: * FunctionBegin(b"TSAdaptStep_Python") * nextdt[0] = ts.time_step # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE * # */ __pyx_t_1 = __pyx_v_ts->time_step; (__pyx_v_nextdt[0]) = __pyx_t_1; /* "libpetsc4py.pyx":2486 * FunctionBegin(b"TSAdaptStep_Python") * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef adaptStep = PyTS(ts).adaptStep */ (__pyx_v_stepok[0]) = PETSC_TRUE; /* "libpetsc4py.pyx":2488 * stepok[0] = PETSC_TRUE * # * cdef adaptStep = PyTS(ts).adaptStep # <<<<<<<<<<<<<< * if adaptStep is None: return FunctionEnd() * cdef object retval */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_adaptStep); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_adaptStep = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":2489 * # * cdef adaptStep = PyTS(ts).adaptStep * if adaptStep is None: return FunctionEnd() # <<<<<<<<<<<<<< * cdef object retval * cdef double dt */ __pyx_t_4 = (__pyx_v_adaptStep == Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; } /* "libpetsc4py.pyx":2493 * cdef double dt * cdef bint ok * retval = adaptStep(TS_(ts), t, Vec_(x)) # <<<<<<<<<<<<<< * if retval is None: pass * elif isinstance(retval, float): */ __pyx_t_2 = ((PyObject *)__pyx_f_11libpetsc4py_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyFloat_FromDouble(((double)__pyx_v_t)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_11libpetsc4py_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_adaptStep); __pyx_t_8 = __pyx_v_adaptStep; __pyx_t_9 = NULL; __pyx_t_10 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_10 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_2, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_2, __pyx_t_6, __pyx_t_7}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_7); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_retval = __pyx_t_3; __pyx_t_3 = 0; /* "libpetsc4py.pyx":2494 * cdef bint ok * retval = adaptStep(TS_(ts), t, Vec_(x)) * if retval is None: pass # <<<<<<<<<<<<<< * elif isinstance(retval, float): * dt = retval */ __pyx_t_5 = (__pyx_v_retval == Py_None); __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { goto __pyx_L4; } /* "libpetsc4py.pyx":2495 * retval = adaptStep(TS_(ts), t, Vec_(x)) * if retval is None: pass * elif isinstance(retval, float): # <<<<<<<<<<<<<< * dt = retval * nextdt[0] = dt */ __pyx_t_4 = PyFloat_Check(__pyx_v_retval); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":2496 * if retval is None: pass * elif isinstance(retval, float): * dt = retval # <<<<<<<<<<<<<< * nextdt[0] = dt * stepok[0] = PETSC_TRUE */ __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_retval); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2496, __pyx_L1_error) __pyx_v_dt = __pyx_t_12; /* "libpetsc4py.pyx":2497 * elif isinstance(retval, float): * dt = retval * nextdt[0] = dt # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): */ (__pyx_v_nextdt[0]) = ((PetscReal)__pyx_v_dt); /* "libpetsc4py.pyx":2498 * dt = retval * nextdt[0] = dt * stepok[0] = PETSC_TRUE # <<<<<<<<<<<<<< * elif isinstance(retval, bool): * ok = retval */ (__pyx_v_stepok[0]) = PETSC_TRUE; /* "libpetsc4py.pyx":2495 * retval = adaptStep(TS_(ts), t, Vec_(x)) * if retval is None: pass * elif isinstance(retval, float): # <<<<<<<<<<<<<< * dt = retval * nextdt[0] = dt */ goto __pyx_L4; } /* "libpetsc4py.pyx":2499 * nextdt[0] = dt * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): # <<<<<<<<<<<<<< * ok = retval * nextdt[0] = ts.time_step */ __pyx_t_3 = ((PyObject*)&PyBool_Type); __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = PyObject_IsInstance(__pyx_v_retval, __pyx_t_3); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 2499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2500 * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): * ok = retval # <<<<<<<<<<<<<< * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_retval); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2500, __pyx_L1_error) __pyx_v_ok = __pyx_t_4; /* "libpetsc4py.pyx":2501 * elif isinstance(retval, bool): * ok = retval * nextdt[0] = ts.time_step # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * else: */ __pyx_t_1 = __pyx_v_ts->time_step; (__pyx_v_nextdt[0]) = __pyx_t_1; /* "libpetsc4py.pyx":2502 * ok = retval * nextdt[0] = ts.time_step * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE # <<<<<<<<<<<<<< * else: * dt, ok = retval */ if ((__pyx_v_ok != 0)) { __pyx_t_13 = PETSC_TRUE; } else { __pyx_t_13 = PETSC_FALSE; } (__pyx_v_stepok[0]) = __pyx_t_13; /* "libpetsc4py.pyx":2499 * nextdt[0] = dt * stepok[0] = PETSC_TRUE * elif isinstance(retval, bool): # <<<<<<<<<<<<<< * ok = retval * nextdt[0] = ts.time_step */ goto __pyx_L4; } /* "libpetsc4py.pyx":2504 * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * else: * dt, ok = retval # <<<<<<<<<<<<<< * nextdt[0] = dt * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE */ /*else*/ { if ((likely(PyTuple_CheckExact(__pyx_v_retval))) || (PyList_CheckExact(__pyx_v_retval))) { PyObject* sequence = __pyx_v_retval; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 2504, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_retval); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_14 = Py_TYPE(__pyx_t_11)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_11), 2) < 0) __PYX_ERR(0, 2504, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 2504, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2504, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_dt = __pyx_t_12; __pyx_v_ok = __pyx_t_4; /* "libpetsc4py.pyx":2505 * else: * dt, ok = retval * nextdt[0] = dt # <<<<<<<<<<<<<< * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * return FunctionEnd() */ (__pyx_v_nextdt[0]) = ((PetscReal)__pyx_v_dt); /* "libpetsc4py.pyx":2506 * dt, ok = retval * nextdt[0] = dt * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE # <<<<<<<<<<<<<< * return FunctionEnd() * */ if ((__pyx_v_ok != 0)) { __pyx_t_13 = PETSC_TRUE; } else { __pyx_t_13 = PETSC_FALSE; } (__pyx_v_stepok[0]) = __pyx_t_13; } __pyx_L4:; /* "libpetsc4py.pyx":2507 * nextdt[0] = dt * stepok[0] = PETSC_TRUE if ok else PETSC_FALSE * return FunctionEnd() # <<<<<<<<<<<<<< * * cdef PetscErrorCode TSStep_Python_default( */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2476 * return FunctionEnd() * * cdef PetscErrorCode TSAdaptStep_Python( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("libpetsc4py.TSAdaptStep_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_adaptStep); __Pyx_XDECREF(__pyx_v_retval); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2509 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python_default( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ static PetscErrorCode __pyx_f_11libpetsc4py_TSStep_Python_default(TS __pyx_v_ts) { Vec __pyx_v_vec_update; CYTHON_UNUSED PetscInt __pyx_v_r; PetscReal __pyx_v_tt; PetscReal __pyx_v_dt; PetscBool __pyx_v_accept; PetscBool __pyx_v_stageok; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscReal __pyx_t_2; PetscInt __pyx_t_3; PetscErrorCode __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TSStep_Python_default", 0); /* "libpetsc4py.pyx":2513 * ) \ * except IERR with gil: * FunctionBegin(b"TSStep_Python_default") # <<<<<<<<<<<<<< * cdef PetscVec vec_update = NULL * CHKERR( PetscObjectQuery( */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"TSStep_Python_default")); /* "libpetsc4py.pyx":2514 * except IERR with gil: * FunctionBegin(b"TSStep_Python_default") * cdef PetscVec vec_update = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery( * ts, */ __pyx_v_vec_update = NULL; /* "libpetsc4py.pyx":2515 * FunctionBegin(b"TSStep_Python_default") * cdef PetscVec vec_update = NULL * CHKERR( PetscObjectQuery( # <<<<<<<<<<<<<< * ts, * b"@ts.vec_update", */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectQuery(((PetscObject)__pyx_v_ts), ((char *)"@ts.vec_update"), ((PetscObject *)(&__pyx_v_vec_update)))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2515, __pyx_L1_error) /* "libpetsc4py.pyx":2520 * &vec_update) ) * # * cdef PetscInt r = 0 # <<<<<<<<<<<<<< * cdef PetscReal tt = ts.ptime * cdef PetscReal dt = ts.time_step */ __pyx_v_r = 0; /* "libpetsc4py.pyx":2521 * # * cdef PetscInt r = 0 * cdef PetscReal tt = ts.ptime # <<<<<<<<<<<<<< * cdef PetscReal dt = ts.time_step * cdef PetscBool accept = PETSC_TRUE */ __pyx_t_2 = __pyx_v_ts->ptime; __pyx_v_tt = __pyx_t_2; /* "libpetsc4py.pyx":2522 * cdef PetscInt r = 0 * cdef PetscReal tt = ts.ptime * cdef PetscReal dt = ts.time_step # <<<<<<<<<<<<<< * cdef PetscBool accept = PETSC_TRUE * cdef PetscBool stageok = PETSC_TRUE */ __pyx_t_2 = __pyx_v_ts->time_step; __pyx_v_dt = __pyx_t_2; /* "libpetsc4py.pyx":2523 * cdef PetscReal tt = ts.ptime * cdef PetscReal dt = ts.time_step * cdef PetscBool accept = PETSC_TRUE # <<<<<<<<<<<<<< * cdef PetscBool stageok = PETSC_TRUE * for r from 0 <= r < ts.max_reject: */ __pyx_v_accept = PETSC_TRUE; /* "libpetsc4py.pyx":2524 * cdef PetscReal dt = ts.time_step * cdef PetscBool accept = PETSC_TRUE * cdef PetscBool stageok = PETSC_TRUE # <<<<<<<<<<<<<< * for r from 0 <= r < ts.max_reject: * tt = ts.ptime + ts.time_step */ __pyx_v_stageok = PETSC_TRUE; /* "libpetsc4py.pyx":2525 * cdef PetscBool accept = PETSC_TRUE * cdef PetscBool stageok = PETSC_TRUE * for r from 0 <= r < ts.max_reject: # <<<<<<<<<<<<<< * tt = ts.ptime + ts.time_step * CHKERR( VecCopy(ts.vec_sol,vec_update) ) */ __pyx_t_3 = __pyx_v_ts->max_reject; for (__pyx_v_r = 0; __pyx_v_r < __pyx_t_3; __pyx_v_r++) { /* "libpetsc4py.pyx":2526 * cdef PetscBool stageok = PETSC_TRUE * for r from 0 <= r < ts.max_reject: * tt = ts.ptime + ts.time_step # <<<<<<<<<<<<<< * CHKERR( VecCopy(ts.vec_sol,vec_update) ) * CHKERR( TSPreStage(ts,tt+dt) ) */ __pyx_v_tt = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "libpetsc4py.pyx":2527 * for r from 0 <= r < ts.max_reject: * tt = ts.ptime + ts.time_step * CHKERR( VecCopy(ts.vec_sol,vec_update) ) # <<<<<<<<<<<<<< * CHKERR( TSPreStage(ts,tt+dt) ) * TSSolveStep_Python(ts,tt,vec_update) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecCopy(__pyx_v_ts->vec_sol, __pyx_v_vec_update)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2527, __pyx_L1_error) /* "libpetsc4py.pyx":2528 * tt = ts.ptime + ts.time_step * CHKERR( VecCopy(ts.vec_sol,vec_update) ) * CHKERR( TSPreStage(ts,tt+dt) ) # <<<<<<<<<<<<<< * TSSolveStep_Python(ts,tt,vec_update) * CHKERR( TSPostStage(ts,tt+dt,0,&vec_update) ); */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(TSPreStage(__pyx_v_ts, (__pyx_v_tt + __pyx_v_dt))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2528, __pyx_L1_error) /* "libpetsc4py.pyx":2529 * CHKERR( VecCopy(ts.vec_sol,vec_update) ) * CHKERR( TSPreStage(ts,tt+dt) ) * TSSolveStep_Python(ts,tt,vec_update) # <<<<<<<<<<<<<< * CHKERR( TSPostStage(ts,tt+dt,0,&vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt,ts,tt+dt,vec_update,&stageok) ); */ __pyx_t_4 = __pyx_f_11libpetsc4py_TSSolveStep_Python(__pyx_v_ts, __pyx_v_tt, __pyx_v_vec_update); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2529, __pyx_L1_error) /* "libpetsc4py.pyx":2530 * CHKERR( TSPreStage(ts,tt+dt) ) * TSSolveStep_Python(ts,tt,vec_update) * CHKERR( TSPostStage(ts,tt+dt,0,&vec_update) ); # <<<<<<<<<<<<<< * CHKERR( TSAdaptCheckStage(ts.adapt,ts,tt+dt,vec_update,&stageok) ); * if not stageok: */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(TSPostStage(__pyx_v_ts, (__pyx_v_tt + __pyx_v_dt), 0, (&__pyx_v_vec_update))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2530, __pyx_L1_error) /* "libpetsc4py.pyx":2531 * TSSolveStep_Python(ts,tt,vec_update) * CHKERR( TSPostStage(ts,tt+dt,0,&vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt,ts,tt+dt,vec_update,&stageok) ); # <<<<<<<<<<<<<< * if not stageok: * ts.reject += 1 */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(TSAdaptCheckStage(__pyx_v_ts->adapt, __pyx_v_ts, (__pyx_v_tt + __pyx_v_dt), __pyx_v_vec_update, (&__pyx_v_stageok))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2531, __pyx_L1_error) /* "libpetsc4py.pyx":2532 * CHKERR( TSPostStage(ts,tt+dt,0,&vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt,ts,tt+dt,vec_update,&stageok) ); * if not stageok: # <<<<<<<<<<<<<< * ts.reject += 1 * continue */ __pyx_t_5 = ((!__pyx_v_stageok) != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":2533 * CHKERR( TSAdaptCheckStage(ts.adapt,ts,tt+dt,vec_update,&stageok) ); * if not stageok: * ts.reject += 1 # <<<<<<<<<<<<<< * continue * TSAdaptStep_Python(ts,tt,vec_update,&dt,&accept) */ __pyx_v_ts->reject = (__pyx_v_ts->reject + 1); /* "libpetsc4py.pyx":2534 * if not stageok: * ts.reject += 1 * continue # <<<<<<<<<<<<<< * TSAdaptStep_Python(ts,tt,vec_update,&dt,&accept) * if not accept: */ goto __pyx_L3_continue; /* "libpetsc4py.pyx":2532 * CHKERR( TSPostStage(ts,tt+dt,0,&vec_update) ); * CHKERR( TSAdaptCheckStage(ts.adapt,ts,tt+dt,vec_update,&stageok) ); * if not stageok: # <<<<<<<<<<<<<< * ts.reject += 1 * continue */ } /* "libpetsc4py.pyx":2535 * ts.reject += 1 * continue * TSAdaptStep_Python(ts,tt,vec_update,&dt,&accept) # <<<<<<<<<<<<<< * if not accept: * ts.time_step = dt */ __pyx_t_4 = __pyx_f_11libpetsc4py_TSAdaptStep_Python(__pyx_v_ts, __pyx_v_tt, __pyx_v_vec_update, (&__pyx_v_dt), (&__pyx_v_accept)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2535, __pyx_L1_error) /* "libpetsc4py.pyx":2536 * continue * TSAdaptStep_Python(ts,tt,vec_update,&dt,&accept) * if not accept: # <<<<<<<<<<<<<< * ts.time_step = dt * ts.reject += 1 */ __pyx_t_5 = ((!__pyx_v_accept) != 0); if (__pyx_t_5) { /* "libpetsc4py.pyx":2537 * TSAdaptStep_Python(ts,tt,vec_update,&dt,&accept) * if not accept: * ts.time_step = dt # <<<<<<<<<<<<<< * ts.reject += 1 * continue */ __pyx_v_ts->time_step = __pyx_v_dt; /* "libpetsc4py.pyx":2538 * if not accept: * ts.time_step = dt * ts.reject += 1 # <<<<<<<<<<<<<< * continue * CHKERR( VecCopy(vec_update,ts.vec_sol) ) */ __pyx_v_ts->reject = (__pyx_v_ts->reject + 1); /* "libpetsc4py.pyx":2539 * ts.time_step = dt * ts.reject += 1 * continue # <<<<<<<<<<<<<< * CHKERR( VecCopy(vec_update,ts.vec_sol) ) * ts.ptime += ts.time_step */ goto __pyx_L3_continue; /* "libpetsc4py.pyx":2536 * continue * TSAdaptStep_Python(ts,tt,vec_update,&dt,&accept) * if not accept: # <<<<<<<<<<<<<< * ts.time_step = dt * ts.reject += 1 */ } /* "libpetsc4py.pyx":2540 * ts.reject += 1 * continue * CHKERR( VecCopy(vec_update,ts.vec_sol) ) # <<<<<<<<<<<<<< * ts.ptime += ts.time_step * ts.time_step = dt */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(VecCopy(__pyx_v_vec_update, __pyx_v_ts->vec_sol)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2540, __pyx_L1_error) /* "libpetsc4py.pyx":2541 * continue * CHKERR( VecCopy(vec_update,ts.vec_sol) ) * ts.ptime += ts.time_step # <<<<<<<<<<<<<< * ts.time_step = dt * break */ __pyx_v_ts->ptime = (__pyx_v_ts->ptime + __pyx_v_ts->time_step); /* "libpetsc4py.pyx":2542 * CHKERR( VecCopy(vec_update,ts.vec_sol) ) * ts.ptime += ts.time_step * ts.time_step = dt # <<<<<<<<<<<<<< * break * if (not stageok or not accept) and ts.reason == 0: */ __pyx_v_ts->time_step = __pyx_v_dt; /* "libpetsc4py.pyx":2543 * ts.ptime += ts.time_step * ts.time_step = dt * break # <<<<<<<<<<<<<< * if (not stageok or not accept) and ts.reason == 0: * ts.reason = TS_DIVERGED_STEP_REJECTED */ goto __pyx_L4_break; __pyx_L3_continue:; } __pyx_L4_break:; /* "libpetsc4py.pyx":2544 * ts.time_step = dt * break * if (not stageok or not accept) and ts.reason == 0: # <<<<<<<<<<<<<< * ts.reason = TS_DIVERGED_STEP_REJECTED * return FunctionEnd() */ __pyx_t_6 = ((!__pyx_v_stageok) != 0); if (!__pyx_t_6) { } else { goto __pyx_L9_next_and; } __pyx_t_6 = ((!__pyx_v_accept) != 0); if (__pyx_t_6) { } else { __pyx_t_5 = __pyx_t_6; goto __pyx_L8_bool_binop_done; } __pyx_L9_next_and:; __pyx_t_6 = ((__pyx_v_ts->reason == 0) != 0); __pyx_t_5 = __pyx_t_6; __pyx_L8_bool_binop_done:; if (__pyx_t_5) { /* "libpetsc4py.pyx":2545 * break * if (not stageok or not accept) and ts.reason == 0: * ts.reason = TS_DIVERGED_STEP_REJECTED # <<<<<<<<<<<<<< * return FunctionEnd() * */ __pyx_v_ts->reason = TS_DIVERGED_STEP_REJECTED; /* "libpetsc4py.pyx":2544 * ts.time_step = dt * break * if (not stageok or not accept) and ts.reason == 0: # <<<<<<<<<<<<<< * ts.reason = TS_DIVERGED_STEP_REJECTED * return FunctionEnd() */ } /* "libpetsc4py.pyx":2546 * if (not stageok or not accept) and ts.reason == 0: * ts.reason = TS_DIVERGED_STEP_REJECTED * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2509 * return FunctionEnd() * * cdef PetscErrorCode TSStep_Python_default( # <<<<<<<<<<<<<< * PetscTS ts, * ) \ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.TSStep_Python_default", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2550 * # -------------------------------------------------------------------- * * cdef PetscErrorCode PetscPythonMonitorSet_Python( # <<<<<<<<<<<<<< * PetscObject obj_p, * const char *url_p, */ static PetscErrorCode __pyx_f_11libpetsc4py_PetscPythonMonitorSet_Python(PetscObject __pyx_v_obj_p, char const *__pyx_v_url_p) { PetscClassId __pyx_v_classid; PyTypeObject *__pyx_v_klass = 0; struct PyPetscObjectObject *__pyx_v_ob = 0; PyObject *__pyx_v_url = 0; PyObject *__pyx_v_path = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_module = NULL; PyObject *__pyx_v_attr = NULL; PyObject *__pyx_v_monitor = NULL; PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PetscPythonMonitorSet_Python", 0); /* "libpetsc4py.pyx":2555 * ) \ * except IERR with gil: * FunctionBegin(b"PetscPythonMonitorSet_Python") # <<<<<<<<<<<<<< * assert obj_p != NULL * assert url_p != NULL */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PetscPythonMonitorSet_Python")); /* "libpetsc4py.pyx":2556 * except IERR with gil: * FunctionBegin(b"PetscPythonMonitorSet_Python") * assert obj_p != NULL # <<<<<<<<<<<<<< * assert url_p != NULL * assert url_p[0] != 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_obj_p != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2556, __pyx_L1_error) } } #endif /* "libpetsc4py.pyx":2557 * FunctionBegin(b"PetscPythonMonitorSet_Python") * assert obj_p != NULL * assert url_p != NULL # <<<<<<<<<<<<<< * assert url_p[0] != 0 * # */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_url_p != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2557, __pyx_L1_error) } } #endif /* "libpetsc4py.pyx":2558 * assert obj_p != NULL * assert url_p != NULL * assert url_p[0] != 0 # <<<<<<<<<<<<<< * # * cdef PetscClassId classid = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((__pyx_v_url_p[0]) != 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 2558, __pyx_L1_error) } } #endif /* "libpetsc4py.pyx":2560 * assert url_p[0] != 0 * # * cdef PetscClassId classid = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassId(obj_p,&classid) ) * cdef type klass = PyPetscType_Lookup(classid) */ __pyx_v_classid = 0; /* "libpetsc4py.pyx":2561 * # * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj_p,&classid) ) # <<<<<<<<<<<<<< * cdef type klass = PyPetscType_Lookup(classid) * cdef Object ob = klass() */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PetscObjectGetClassId(__pyx_v_obj_p, (&__pyx_v_classid))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2561, __pyx_L1_error) /* "libpetsc4py.pyx":2562 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj_p,&classid) ) * cdef type klass = PyPetscType_Lookup(classid) # <<<<<<<<<<<<<< * cdef Object ob = klass() * ob.obj[0] = newRef(obj_p) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(__pyx_v_classid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_klass = ((PyTypeObject*)__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2563 * CHKERR( PetscObjectGetClassId(obj_p,&classid) ) * cdef type klass = PyPetscType_Lookup(classid) * cdef Object ob = klass() # <<<<<<<<<<<<<< * ob.obj[0] = newRef(obj_p) * # */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_v_klass)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(0, 2563, __pyx_L1_error) __pyx_v_ob = ((struct PyPetscObjectObject *)__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2564 * cdef type klass = PyPetscType_Lookup(classid) * cdef Object ob = klass() * ob.obj[0] = newRef(obj_p) # <<<<<<<<<<<<<< * # * cdef url = bytes2str(url_p) */ (__pyx_v_ob->obj[0]) = __pyx_f_11libpetsc4py_newRef(__pyx_v_obj_p); /* "libpetsc4py.pyx":2566 * ob.obj[0] = newRef(obj_p) * # * cdef url = bytes2str(url_p) # <<<<<<<<<<<<<< * if ':' in url: * path, names = parse_url(url) */ __pyx_t_2 = __pyx_f_11libpetsc4py_bytes2str(__pyx_v_url_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_url = __pyx_t_2; __pyx_t_2 = 0; /* "libpetsc4py.pyx":2567 * # * cdef url = bytes2str(url_p) * if ':' in url: # <<<<<<<<<<<<<< * path, names = parse_url(url) * else: */ __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_, __pyx_v_url, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2567, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "libpetsc4py.pyx":2568 * cdef url = bytes2str(url_p) * if ':' in url: * path, names = parse_url(url) # <<<<<<<<<<<<<< * else: * path, names = url, 'monitor' */ __pyx_t_2 = __pyx_f_11libpetsc4py_parse_url(__pyx_v_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 2568, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2568, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 2568, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_path = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_names = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":2567 * # * cdef url = bytes2str(url_p) * if ':' in url: # <<<<<<<<<<<<<< * path, names = parse_url(url) * else: */ goto __pyx_L3; } /* "libpetsc4py.pyx":2570 * path, names = parse_url(url) * else: * path, names = url, 'monitor' # <<<<<<<<<<<<<< * module = load_module(path) * for attr in names.split(','): */ /*else*/ { __pyx_t_2 = __pyx_v_url; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = __pyx_n_s_monitor; __Pyx_INCREF(__pyx_t_6); __pyx_v_path = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_names = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L3:; /* "libpetsc4py.pyx":2571 * else: * path, names = url, 'monitor' * module = load_module(path) # <<<<<<<<<<<<<< * for attr in names.split(','): * monitor = getattr(module, attr) */ __pyx_t_6 = __pyx_f_11libpetsc4py_load_module(__pyx_v_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_module = __pyx_t_6; __pyx_t_6 = 0; /* "libpetsc4py.pyx":2572 * path, names = url, 'monitor' * module = load_module(path) * for attr in names.split(','): # <<<<<<<<<<<<<< * monitor = getattr(module, attr) * if isinstance(monitor, type): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_names, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s__5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__5); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2572, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2572, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2572, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 2572, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":2573 * module = load_module(path) * for attr in names.split(','): * monitor = getattr(module, attr) # <<<<<<<<<<<<<< * if isinstance(monitor, type): * monitor = monitor(ob) */ __pyx_t_6 = __Pyx_GetAttr(__pyx_v_module, __pyx_v_attr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":2574 * for attr in names.split(','): * monitor = getattr(module, attr) * if isinstance(monitor, type): # <<<<<<<<<<<<<< * monitor = monitor(ob) * ob.setMonitor(monitor) */ __pyx_t_4 = PyType_Check(__pyx_v_monitor); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "libpetsc4py.pyx":2575 * monitor = getattr(module, attr) * if isinstance(monitor, type): * monitor = monitor(ob) # <<<<<<<<<<<<<< * ob.setMonitor(monitor) * # */ __Pyx_INCREF(__pyx_v_monitor); __pyx_t_5 = __pyx_v_monitor; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, ((PyObject *)__pyx_v_ob)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_ob)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_monitor, __pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":2574 * for attr in names.split(','): * monitor = getattr(module, attr) * if isinstance(monitor, type): # <<<<<<<<<<<<<< * monitor = monitor(ob) * ob.setMonitor(monitor) */ } /* "libpetsc4py.pyx":2576 * if isinstance(monitor, type): * monitor = monitor(ob) * ob.setMonitor(monitor) # <<<<<<<<<<<<<< * # * return FunctionEnd() */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ob), __pyx_n_s_setMonitor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_v_monitor) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_monitor); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "libpetsc4py.pyx":2572 * path, names = url, 'monitor' * module = load_module(path) * for attr in names.split(','): # <<<<<<<<<<<<<< * monitor = getattr(module, attr) * if isinstance(monitor, type): */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":2578 * ob.setMonitor(monitor) * # * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2550 * # -------------------------------------------------------------------- * * cdef PetscErrorCode PetscPythonMonitorSet_Python( # <<<<<<<<<<<<<< * PetscObject obj_p, * const char *url_p, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("libpetsc4py.PetscPythonMonitorSet_Python", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_klass); __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XDECREF(__pyx_v_url); __Pyx_XDECREF(__pyx_v_path); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_module); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "libpetsc4py.pyx":2606 * * * cdef public PetscErrorCode PetscPythonRegisterAll() except IERR: # <<<<<<<<<<<<<< * FunctionBegin(b"PetscPythonRegisterAll") * */ PetscErrorCode PetscPythonRegisterAll(void) { PetscErrorCode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PetscPythonRegisterAll", 0); /* "libpetsc4py.pyx":2607 * * cdef public PetscErrorCode PetscPythonRegisterAll() except IERR: * FunctionBegin(b"PetscPythonRegisterAll") # <<<<<<<<<<<<<< * * # Python subtypes */ __pyx_f_11libpetsc4py_FunctionBegin(((char *)"PetscPythonRegisterAll")); /* "libpetsc4py.pyx":2610 * * # Python subtypes * CHKERR( MatRegister ( MATPYTHON, MatCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(MatRegister("python", __pyx_f_11libpetsc4py_MatCreate_Python)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2610, __pyx_L1_error) /* "libpetsc4py.pyx":2611 * # Python subtypes * CHKERR( MatRegister ( MATPYTHON, MatCreate_Python ) ) * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(PCRegister("python", __pyx_f_11libpetsc4py_PCCreate_Python)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2611, __pyx_L1_error) /* "libpetsc4py.pyx":2612 * CHKERR( MatRegister ( MATPYTHON, MatCreate_Python ) ) * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) * CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(KSPRegister("python", __pyx_f_11libpetsc4py_KSPCreate_Python)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2612, __pyx_L1_error) /* "libpetsc4py.pyx":2613 * CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) # <<<<<<<<<<<<<< * CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) * */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(SNESRegister("python", __pyx_f_11libpetsc4py_SNESCreate_Python)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2613, __pyx_L1_error) /* "libpetsc4py.pyx":2614 * CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) * CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) * CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) # <<<<<<<<<<<<<< * * # Python monitors */ __pyx_t_1 = __pyx_f_11libpetsc4py_CHKERR(TSRegister("python", __pyx_f_11libpetsc4py_TSCreate_Python)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2614, __pyx_L1_error) /* "libpetsc4py.pyx":2618 * # Python monitors * global PetscPythonMonitorSet_C * PetscPythonMonitorSet_C = PetscPythonMonitorSet_Python # <<<<<<<<<<<<<< * * return FunctionEnd() */ PetscPythonMonitorSet_C = __pyx_f_11libpetsc4py_PetscPythonMonitorSet_Python; /* "libpetsc4py.pyx":2620 * PetscPythonMonitorSet_C = PetscPythonMonitorSet_Python * * return FunctionEnd() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_f_11libpetsc4py_FunctionEnd(); goto __pyx_L0; /* "libpetsc4py.pyx":2606 * * * cdef public PetscErrorCode PetscPythonRegisterAll() except IERR: # <<<<<<<<<<<<<< * FunctionBegin(b"PetscPythonRegisterAll") * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("libpetsc4py.PetscPythonRegisterAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static struct __pyx_vtabstruct_11libpetsc4py__PyObj __pyx_vtable_11libpetsc4py__PyObj; static PyObject *__pyx_tp_new_11libpetsc4py__PyObj(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_11libpetsc4py__PyObj *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11libpetsc4py__PyObj *)o); p->__pyx_vtab = __pyx_vtabptr_11libpetsc4py__PyObj; p->self = Py_None; Py_INCREF(Py_None); p->name = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_11libpetsc4py__PyObj(PyObject *o) { struct __pyx_obj_11libpetsc4py__PyObj *p = (struct __pyx_obj_11libpetsc4py__PyObj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->self); Py_CLEAR(p->name); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_11libpetsc4py__PyObj(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_11libpetsc4py__PyObj *p = (struct __pyx_obj_11libpetsc4py__PyObj *)o; if (p->self) { e = (*v)(p->self, a); if (e) return e; } return 0; } static int __pyx_tp_clear_11libpetsc4py__PyObj(PyObject *o) { PyObject* tmp; struct __pyx_obj_11libpetsc4py__PyObj *p = (struct __pyx_obj_11libpetsc4py__PyObj *)o; tmp = ((PyObject*)p->self); p->self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_getattro_11libpetsc4py__PyObj(PyObject *o, PyObject *n) { PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); v = __pyx_pw_11libpetsc4py_6_PyObj_1__getattr__(o, n); } return v; } static PyMethodDef __pyx_methods_11libpetsc4py__PyObj[] = { {"__getattr__", (PyCFunction)__pyx_pw_11libpetsc4py_6_PyObj_1__getattr__, METH_O|METH_COEXIST, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_11libpetsc4py__PyObj = { PyVarObject_HEAD_INIT(0, 0) "libpetsc4py._PyObj", /*tp_name*/ sizeof(struct __pyx_obj_11libpetsc4py__PyObj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11libpetsc4py__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ __pyx_tp_getattro_11libpetsc4py__PyObj, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11libpetsc4py__PyObj, /*tp_traverse*/ __pyx_tp_clear_11libpetsc4py__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_11libpetsc4py__PyObj, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11libpetsc4py__PyObj, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11libpetsc4py__PyMat __pyx_vtable_11libpetsc4py__PyMat; static PyObject *__pyx_tp_new_11libpetsc4py__PyMat(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_11libpetsc4py__PyMat *p; PyObject *o = __pyx_tp_new_11libpetsc4py__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11libpetsc4py__PyMat *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_11libpetsc4py__PyObj*)__pyx_vtabptr_11libpetsc4py__PyMat; return o; } static PyTypeObject __pyx_type_11libpetsc4py__PyMat = { PyVarObject_HEAD_INIT(0, 0) "libpetsc4py._PyMat", /*tp_name*/ sizeof(struct __pyx_obj_11libpetsc4py__PyMat), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11libpetsc4py__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11libpetsc4py__PyObj, /*tp_traverse*/ __pyx_tp_clear_11libpetsc4py__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11libpetsc4py__PyMat, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11libpetsc4py__PyPC __pyx_vtable_11libpetsc4py__PyPC; static PyObject *__pyx_tp_new_11libpetsc4py__PyPC(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_11libpetsc4py__PyPC *p; PyObject *o = __pyx_tp_new_11libpetsc4py__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11libpetsc4py__PyPC *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_11libpetsc4py__PyObj*)__pyx_vtabptr_11libpetsc4py__PyPC; return o; } static PyTypeObject __pyx_type_11libpetsc4py__PyPC = { PyVarObject_HEAD_INIT(0, 0) "libpetsc4py._PyPC", /*tp_name*/ sizeof(struct __pyx_obj_11libpetsc4py__PyPC), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11libpetsc4py__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11libpetsc4py__PyObj, /*tp_traverse*/ __pyx_tp_clear_11libpetsc4py__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11libpetsc4py__PyPC, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11libpetsc4py__PyKSP __pyx_vtable_11libpetsc4py__PyKSP; static PyObject *__pyx_tp_new_11libpetsc4py__PyKSP(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_11libpetsc4py__PyKSP *p; PyObject *o = __pyx_tp_new_11libpetsc4py__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11libpetsc4py__PyKSP *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_11libpetsc4py__PyObj*)__pyx_vtabptr_11libpetsc4py__PyKSP; return o; } static PyTypeObject __pyx_type_11libpetsc4py__PyKSP = { PyVarObject_HEAD_INIT(0, 0) "libpetsc4py._PyKSP", /*tp_name*/ sizeof(struct __pyx_obj_11libpetsc4py__PyKSP), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11libpetsc4py__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11libpetsc4py__PyObj, /*tp_traverse*/ __pyx_tp_clear_11libpetsc4py__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11libpetsc4py__PyKSP, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11libpetsc4py__PySNES __pyx_vtable_11libpetsc4py__PySNES; static PyObject *__pyx_tp_new_11libpetsc4py__PySNES(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_11libpetsc4py__PySNES *p; PyObject *o = __pyx_tp_new_11libpetsc4py__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11libpetsc4py__PySNES *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_11libpetsc4py__PyObj*)__pyx_vtabptr_11libpetsc4py__PySNES; return o; } static PyTypeObject __pyx_type_11libpetsc4py__PySNES = { PyVarObject_HEAD_INIT(0, 0) "libpetsc4py._PySNES", /*tp_name*/ sizeof(struct __pyx_obj_11libpetsc4py__PySNES), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11libpetsc4py__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11libpetsc4py__PyObj, /*tp_traverse*/ __pyx_tp_clear_11libpetsc4py__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11libpetsc4py__PySNES, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_11libpetsc4py__PyTS __pyx_vtable_11libpetsc4py__PyTS; static PyObject *__pyx_tp_new_11libpetsc4py__PyTS(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_11libpetsc4py__PyTS *p; PyObject *o = __pyx_tp_new_11libpetsc4py__PyObj(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_11libpetsc4py__PyTS *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_11libpetsc4py__PyObj*)__pyx_vtabptr_11libpetsc4py__PyTS; return o; } static PyTypeObject __pyx_type_11libpetsc4py__PyTS = { PyVarObject_HEAD_INIT(0, 0) "libpetsc4py._PyTS", /*tp_name*/ sizeof(struct __pyx_obj_11libpetsc4py__PyTS), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_11libpetsc4py__PyObj, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_11libpetsc4py__PyObj, /*tp_traverse*/ __pyx_tp_clear_11libpetsc4py__PyObj, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_11libpetsc4py__PyTS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_libpetsc4py(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_libpetsc4py}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "libpetsc4py", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ (freefunc)__pyx_module_cleanup /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0}, {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1}, {&__pyx_n_s_SOR, __pyx_k_SOR, sizeof(__pyx_k_SOR), 0, 0, 1, 1}, {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0}, {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, {&__pyx_n_s_adaptStep, __pyx_k_adaptStep, sizeof(__pyx_k_adaptStep), 0, 0, 1, 1}, {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1}, {&__pyx_n_s_applySymmetricLeft, __pyx_k_applySymmetricLeft, sizeof(__pyx_k_applySymmetricLeft), 0, 0, 1, 1}, {&__pyx_n_s_applySymmetricRight, __pyx_k_applySymmetricRight, sizeof(__pyx_k_applySymmetricRight), 0, 0, 1, 1}, {&__pyx_n_s_applyTranspose, __pyx_k_applyTranspose, sizeof(__pyx_k_applyTranspose), 0, 0, 1, 1}, {&__pyx_n_s_assembly, __pyx_k_assembly, sizeof(__pyx_k_assembly), 0, 0, 1, 1}, {&__pyx_n_s_assemblyBegin, __pyx_k_assemblyBegin, sizeof(__pyx_k_assemblyBegin), 0, 0, 1, 1}, {&__pyx_n_s_assemblyEnd, __pyx_k_assemblyEnd, sizeof(__pyx_k_assemblyEnd), 0, 0, 1, 1}, {&__pyx_n_s_buildResidual, __pyx_k_buildResidual, sizeof(__pyx_k_buildResidual), 0, 0, 1, 1}, {&__pyx_n_s_buildSolution, __pyx_k_buildSolution, sizeof(__pyx_k_buildSolution), 0, 0, 1, 1}, {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, {&__pyx_n_s_conjugate, __pyx_k_conjugate, sizeof(__pyx_k_conjugate), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_create, __pyx_k_create, sizeof(__pyx_k_create), 0, 0, 1, 1}, {&__pyx_n_s_createSubMatrix, __pyx_k_createSubMatrix, sizeof(__pyx_k_createSubMatrix), 0, 0, 1, 1}, {&__pyx_n_s_createVecs, __pyx_k_createVecs, sizeof(__pyx_k_createVecs), 0, 0, 1, 1}, {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_diagonalScale, __pyx_k_diagonalScale, sizeof(__pyx_k_diagonalScale), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_duplicate, __pyx_k_duplicate, sizeof(__pyx_k_duplicate), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_evaluatestep, __pyx_k_evaluatestep, sizeof(__pyx_k_evaluatestep), 0, 0, 1, 1}, {&__pyx_n_s_exec, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_formSNESFunction, __pyx_k_formSNESFunction, sizeof(__pyx_k_formSNESFunction), 0, 0, 1, 1}, {&__pyx_n_s_formSNESJacobian, __pyx_k_formSNESJacobian, sizeof(__pyx_k_formSNESJacobian), 0, 0, 1, 1}, {&__pyx_n_s_getDiagonal, __pyx_k_getDiagonal, sizeof(__pyx_k_getDiagonal), 0, 0, 1, 1}, {&__pyx_n_s_getDiagonalBlock, __pyx_k_getDiagonalBlock, sizeof(__pyx_k_getDiagonalBlock), 0, 0, 1, 1}, {&__pyx_n_s_imagPart, __pyx_k_imagPart, sizeof(__pyx_k_imagPart), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_interpolate, __pyx_k_interpolate, sizeof(__pyx_k_interpolate), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_missingDiagonal, __pyx_k_missingDiagonal, sizeof(__pyx_k_missingDiagonal), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_monitor, __pyx_k_monitor, sizeof(__pyx_k_monitor), 0, 0, 1, 1}, {&__pyx_n_s_mult, __pyx_k_mult, sizeof(__pyx_k_mult), 0, 0, 1, 1}, {&__pyx_n_s_multAdd, __pyx_k_multAdd, sizeof(__pyx_k_multAdd), 0, 0, 1, 1}, {&__pyx_n_s_multDiagonalBlock, __pyx_k_multDiagonalBlock, sizeof(__pyx_k_multDiagonalBlock), 0, 0, 1, 1}, {&__pyx_n_s_multHermitian, __pyx_k_multHermitian, sizeof(__pyx_k_multHermitian), 0, 0, 1, 1}, {&__pyx_n_s_multHermitianAdd, __pyx_k_multHermitianAdd, sizeof(__pyx_k_multHermitianAdd), 0, 0, 1, 1}, {&__pyx_n_s_multTranspose, __pyx_k_multTranspose, sizeof(__pyx_k_multTranspose), 0, 0, 1, 1}, {&__pyx_n_s_multTransposeAdd, __pyx_k_multTransposeAdd, sizeof(__pyx_k_multTransposeAdd), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1}, {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1}, {&__pyx_n_s_package, __pyx_k_package, sizeof(__pyx_k_package), 0, 0, 1, 1}, {&__pyx_n_s_petsc4py_PETSc, __pyx_k_petsc4py_PETSc, sizeof(__pyx_k_petsc4py_PETSc), 0, 0, 1, 1}, {&__pyx_n_s_postSolve, __pyx_k_postSolve, sizeof(__pyx_k_postSolve), 0, 0, 1, 1}, {&__pyx_n_s_postStep, __pyx_k_postStep, sizeof(__pyx_k_postStep), 0, 0, 1, 1}, {&__pyx_n_s_preSolve, __pyx_k_preSolve, sizeof(__pyx_k_preSolve), 0, 0, 1, 1}, {&__pyx_n_s_preStep, __pyx_k_preStep, sizeof(__pyx_k_preStep), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rU, __pyx_k_rU, sizeof(__pyx_k_rU), 0, 0, 1, 1}, {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_realPart, __pyx_k_realPart, sizeof(__pyx_k_realPart), 0, 0, 1, 1}, {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, {&__pyx_n_s_rollback, __pyx_k_rollback, sizeof(__pyx_k_rollback), 0, 0, 1, 1}, {&__pyx_n_s_rsplit, __pyx_k_rsplit, sizeof(__pyx_k_rsplit), 0, 0, 1, 1}, {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1}, {&__pyx_n_s_setDiagonal, __pyx_k_setDiagonal, sizeof(__pyx_k_setDiagonal), 0, 0, 1, 1}, {&__pyx_n_s_setFromOptions, __pyx_k_setFromOptions, sizeof(__pyx_k_setFromOptions), 0, 0, 1, 1}, {&__pyx_n_s_setMonitor, __pyx_k_setMonitor, sizeof(__pyx_k_setMonitor), 0, 0, 1, 1}, {&__pyx_n_s_setOption, __pyx_k_setOption, sizeof(__pyx_k_setOption), 0, 0, 1, 1}, {&__pyx_n_s_setUp, __pyx_k_setUp, sizeof(__pyx_k_setUp), 0, 0, 1, 1}, {&__pyx_n_s_shift, __pyx_k_shift, sizeof(__pyx_k_shift), 0, 0, 1, 1}, {&__pyx_n_s_solve, __pyx_k_solve, sizeof(__pyx_k_solve), 0, 0, 1, 1}, {&__pyx_n_s_solveAdd, __pyx_k_solveAdd, sizeof(__pyx_k_solveAdd), 0, 0, 1, 1}, {&__pyx_n_s_solveStep, __pyx_k_solveStep, sizeof(__pyx_k_solveStep), 0, 0, 1, 1}, {&__pyx_n_s_solveTranspose, __pyx_k_solveTranspose, sizeof(__pyx_k_solveTranspose), 0, 0, 1, 1}, {&__pyx_n_s_solveTransposeAdd, __pyx_k_solveTransposeAdd, sizeof(__pyx_k_solveTransposeAdd), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, {&__pyx_n_s_stepTranspose, __pyx_k_stepTranspose, sizeof(__pyx_k_stepTranspose), 0, 0, 1, 1}, {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_zeroEntries, __pyx_k_zeroEntries, sizeof(__pyx_k_zeroEntries), 0, 0, 1, 1}, {&__pyx_n_s_zeroRowsColumns, __pyx_k_zeroRowsColumns, sizeof(__pyx_k_zeroRowsColumns), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 282, __pyx_L1_error) __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_n_s_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 284, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "libpetsc4py.pyx":269 * * cdef object parse_url(object url): * path, name = url.rsplit(":", 1) # <<<<<<<<<<<<<< * return (path, name) * */ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_kp_s_, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "libpetsc4py.pyx":387 * # package.module[.{function|class}] * if '.' in name: * modname, clsname = name.rsplit('.', 1) # <<<<<<<<<<<<<< * mod = PyImport_Import(modname) * if hasattr(mod, clsname): */ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_kp_s__3, __pyx_int_1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_11libpetsc4py_PetscError = Py_None; Py_INCREF(Py_None); __pyx_v_11libpetsc4py_module_cache = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_11libpetsc4py_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_11libpetsc4py_dtype) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_ptype_11libpetsc4py_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_11libpetsc4py_ndarray) __PYX_ERR(1, 12, __pyx_L1_error) __pyx_vtabptr_11libpetsc4py__PyObj = &__pyx_vtable_11libpetsc4py__PyObj; __pyx_vtable_11libpetsc4py__PyObj.setcontext = (int (*)(struct __pyx_obj_11libpetsc4py__PyObj *, void *, struct PyPetscObjectObject *))__pyx_f_11libpetsc4py_6_PyObj_setcontext; __pyx_vtable_11libpetsc4py__PyObj.getcontext = (int (*)(struct __pyx_obj_11libpetsc4py__PyObj *, void **))__pyx_f_11libpetsc4py_6_PyObj_getcontext; __pyx_vtable_11libpetsc4py__PyObj.setname = (int (*)(struct __pyx_obj_11libpetsc4py__PyObj *, char *))__pyx_f_11libpetsc4py_6_PyObj_setname; __pyx_vtable_11libpetsc4py__PyObj.getname = (char *(*)(struct __pyx_obj_11libpetsc4py__PyObj *))__pyx_f_11libpetsc4py_6_PyObj_getname; if (PyType_Ready(&__pyx_type_11libpetsc4py__PyObj) < 0) __PYX_ERR(0, 296, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11libpetsc4py__PyObj.tp_print = 0; #endif if (__Pyx_SetVtable(__pyx_type_11libpetsc4py__PyObj.tp_dict, __pyx_vtabptr_11libpetsc4py__PyObj) < 0) __PYX_ERR(0, 296, __pyx_L1_error) __pyx_ptype_11libpetsc4py__PyObj = &__pyx_type_11libpetsc4py__PyObj; __pyx_vtabptr_11libpetsc4py__PyMat = &__pyx_vtable_11libpetsc4py__PyMat; __pyx_vtable_11libpetsc4py__PyMat.__pyx_base = *__pyx_vtabptr_11libpetsc4py__PyObj; __pyx_type_11libpetsc4py__PyMat.tp_base = __pyx_ptype_11libpetsc4py__PyObj; if (PyType_Ready(&__pyx_type_11libpetsc4py__PyMat) < 0) __PYX_ERR(0, 527, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11libpetsc4py__PyMat.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11libpetsc4py__PyMat.tp_dictoffset && __pyx_type_11libpetsc4py__PyMat.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11libpetsc4py__PyMat.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_11libpetsc4py__PyMat.tp_dict, __pyx_vtabptr_11libpetsc4py__PyMat) < 0) __PYX_ERR(0, 527, __pyx_L1_error) __pyx_ptype_11libpetsc4py__PyMat = &__pyx_type_11libpetsc4py__PyMat; __pyx_vtabptr_11libpetsc4py__PyPC = &__pyx_vtable_11libpetsc4py__PyPC; __pyx_vtable_11libpetsc4py__PyPC.__pyx_base = *__pyx_vtabptr_11libpetsc4py__PyObj; __pyx_type_11libpetsc4py__PyPC.tp_base = __pyx_ptype_11libpetsc4py__PyObj; if (PyType_Ready(&__pyx_type_11libpetsc4py__PyPC) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11libpetsc4py__PyPC.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11libpetsc4py__PyPC.tp_dictoffset && __pyx_type_11libpetsc4py__PyPC.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11libpetsc4py__PyPC.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_11libpetsc4py__PyPC.tp_dict, __pyx_vtabptr_11libpetsc4py__PyPC) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) __pyx_ptype_11libpetsc4py__PyPC = &__pyx_type_11libpetsc4py__PyPC; __pyx_vtabptr_11libpetsc4py__PyKSP = &__pyx_vtable_11libpetsc4py__PyKSP; __pyx_vtable_11libpetsc4py__PyKSP.__pyx_base = *__pyx_vtabptr_11libpetsc4py__PyObj; __pyx_type_11libpetsc4py__PyKSP.tp_base = __pyx_ptype_11libpetsc4py__PyObj; if (PyType_Ready(&__pyx_type_11libpetsc4py__PyKSP) < 0) __PYX_ERR(0, 1477, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11libpetsc4py__PyKSP.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11libpetsc4py__PyKSP.tp_dictoffset && __pyx_type_11libpetsc4py__PyKSP.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11libpetsc4py__PyKSP.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_11libpetsc4py__PyKSP.tp_dict, __pyx_vtabptr_11libpetsc4py__PyKSP) < 0) __PYX_ERR(0, 1477, __pyx_L1_error) __pyx_ptype_11libpetsc4py__PyKSP = &__pyx_type_11libpetsc4py__PyKSP; __pyx_vtabptr_11libpetsc4py__PySNES = &__pyx_vtable_11libpetsc4py__PySNES; __pyx_vtable_11libpetsc4py__PySNES.__pyx_base = *__pyx_vtabptr_11libpetsc4py__PyObj; __pyx_type_11libpetsc4py__PySNES.tp_base = __pyx_ptype_11libpetsc4py__PyObj; if (PyType_Ready(&__pyx_type_11libpetsc4py__PySNES) < 0) __PYX_ERR(0, 1839, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11libpetsc4py__PySNES.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11libpetsc4py__PySNES.tp_dictoffset && __pyx_type_11libpetsc4py__PySNES.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11libpetsc4py__PySNES.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_11libpetsc4py__PySNES.tp_dict, __pyx_vtabptr_11libpetsc4py__PySNES) < 0) __PYX_ERR(0, 1839, __pyx_L1_error) __pyx_ptype_11libpetsc4py__PySNES = &__pyx_type_11libpetsc4py__PySNES; __pyx_vtabptr_11libpetsc4py__PyTS = &__pyx_vtable_11libpetsc4py__PyTS; __pyx_vtable_11libpetsc4py__PyTS.__pyx_base = *__pyx_vtabptr_11libpetsc4py__PyObj; __pyx_type_11libpetsc4py__PyTS.tp_base = __pyx_ptype_11libpetsc4py__PyObj; if (PyType_Ready(&__pyx_type_11libpetsc4py__PyTS) < 0) __PYX_ERR(0, 2185, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_11libpetsc4py__PyTS.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11libpetsc4py__PyTS.tp_dictoffset && __pyx_type_11libpetsc4py__PyTS.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_11libpetsc4py__PyTS.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_11libpetsc4py__PyTS.tp_dict, __pyx_vtabptr_11libpetsc4py__PyTS) < 0) __PYX_ERR(0, 2185, __pyx_L1_error) __pyx_ptype_11libpetsc4py__PyTS = &__pyx_type_11libpetsc4py__PyTS; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule("petsc4py.PETSc"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_Comm = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Comm", sizeof(struct PyPetscCommObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Comm) __PYX_ERR(2, 91, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Object = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Object", sizeof(struct PyPetscObjectObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Object) __PYX_ERR(2, 99, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Object = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Object->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Object)) __PYX_ERR(2, 99, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Viewer = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Viewer", sizeof(struct PyPetscViewerObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Viewer) __PYX_ERR(2, 111, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Viewer = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Viewer)) __PYX_ERR(2, 111, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Random = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Random", sizeof(struct PyPetscRandomObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Random) __PYX_ERR(2, 117, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Random = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Random*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Random->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Random)) __PYX_ERR(2, 117, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_IS = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "IS", sizeof(struct PyPetscISObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_IS) __PYX_ERR(2, 123, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_IS = (struct __pyx_vtabstruct_8petsc4py_5PETSc_IS*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_IS->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_IS)) __PYX_ERR(2, 123, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_LGMap = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "LGMap", sizeof(struct PyPetscLGMapObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_LGMap) __PYX_ERR(2, 129, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_LGMap = (struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_LGMap)) __PYX_ERR(2, 129, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_SF = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "SF", sizeof(struct PyPetscSFObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_SF) __PYX_ERR(2, 135, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_SF = (struct __pyx_vtabstruct_8petsc4py_5PETSc_SF*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_SF->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_SF)) __PYX_ERR(2, 135, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Vec = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Vec", sizeof(struct PyPetscVecObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Vec) __PYX_ERR(2, 141, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Vec = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Vec->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Vec)) __PYX_ERR(2, 141, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_FE = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "FE", sizeof(struct PyPetscFEObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_FE) __PYX_ERR(2, 147, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_FE = (struct __pyx_vtabstruct_8petsc4py_5PETSc_FE*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_FE->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_FE)) __PYX_ERR(2, 147, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Quad = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Quad", sizeof(struct PyPetscQuadObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Quad) __PYX_ERR(2, 153, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Quad = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Quad->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Quad)) __PYX_ERR(2, 153, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Scatter = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Scatter", sizeof(struct PyPetscScatterObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Scatter) __PYX_ERR(2, 159, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Scatter = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Scatter)) __PYX_ERR(2, 159, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Section = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Section", sizeof(struct PyPetscSectionObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Section) __PYX_ERR(2, 165, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Section = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Section*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Section->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Section)) __PYX_ERR(2, 165, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Mat = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Mat", sizeof(struct PyPetscMatObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Mat) __PYX_ERR(2, 171, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Mat = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Mat)) __PYX_ERR(2, 171, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_NullSpace = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "NullSpace", sizeof(struct PyPetscNullSpaceObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_NullSpace) __PYX_ERR(2, 177, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_NullSpace = (struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_NullSpace)) __PYX_ERR(2, 177, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_PC = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "PC", sizeof(struct PyPetscPCObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_PC) __PYX_ERR(2, 183, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_PC = (struct __pyx_vtabstruct_8petsc4py_5PETSc_PC*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_PC)) __PYX_ERR(2, 183, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_KSP = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "KSP", sizeof(struct PyPetscKSPObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_KSP) __PYX_ERR(2, 189, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_KSP = (struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_KSP->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_KSP)) __PYX_ERR(2, 189, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_SNES = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "SNES", sizeof(struct PyPetscSNESObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_SNES) __PYX_ERR(2, 195, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_SNES = (struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_SNES)) __PYX_ERR(2, 195, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_TS = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "TS", sizeof(struct PyPetscTSObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_TS) __PYX_ERR(2, 201, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_TS = (struct __pyx_vtabstruct_8petsc4py_5PETSc_TS*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_TS)) __PYX_ERR(2, 201, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_TAO = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "TAO", sizeof(struct PyPetscTAOObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_TAO) __PYX_ERR(2, 207, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_TAO = (struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_TAO->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_TAO)) __PYX_ERR(2, 207, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_AO = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "AO", sizeof(struct PyPetscAOObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_AO) __PYX_ERR(2, 213, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_AO = (struct __pyx_vtabstruct_8petsc4py_5PETSc_AO*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_AO->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_AO)) __PYX_ERR(2, 213, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_DM = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "DM", sizeof(struct PyPetscDMObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_DM) __PYX_ERR(2, 219, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_DM = (struct __pyx_vtabstruct_8petsc4py_5PETSc_DM*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_DM)) __PYX_ERR(2, 219, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_DS = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "DS", sizeof(struct PyPetscDSObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_DS) __PYX_ERR(2, 225, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_DS = (struct __pyx_vtabstruct_8petsc4py_5PETSc_DS*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_DS->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_DS)) __PYX_ERR(2, 225, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Partitioner = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "Partitioner", sizeof(struct PyPetscPartitionerObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Partitioner) __PYX_ERR(2, 231, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_Partitioner = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_Partitioner)) __PYX_ERR(2, 231, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_DMLabel = __Pyx_ImportType(__pyx_t_1, "petsc4py.PETSc", "DMLabel", sizeof(struct PyPetscDMLabelObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_DMLabel) __PYX_ERR(2, 237, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc_DMLabel = (struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel*)__Pyx_GetVtable(__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_dict); if (unlikely(!__pyx_vtabptr_8petsc4py_5PETSc_DMLabel)) __PYX_ERR(2, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("petsc4py.PETSc"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_ImportFunction(__pyx_t_1, "PyPetscType_Lookup", (void (**)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup, "PyTypeObject *(int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initlibpetsc4py(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initlibpetsc4py(void) #else __Pyx_PyMODINIT_FUNC PyInit_libpetsc4py(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_libpetsc4py(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_libpetsc4py(PyObject *__pyx_pyinit_module) #endif #endif { int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscErrorCode __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'libpetsc4py' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libpetsc4py(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("libpetsc4py", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_libpetsc4py) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "libpetsc4py")) { if (unlikely(PyDict_SetItemString(modules, "libpetsc4py", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) (void)__Pyx_modinit_variable_import_code(); if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "libpetsc4py.pyx":104 * include "arraynpy.pxi" * * import_array() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = _import_array(); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 104, __pyx_L1_error) /* "libpetsc4py.pyx":114 * enum: IERR "PETSC_ERR_PYTHON" * * cdef char *FUNCT = NULL # <<<<<<<<<<<<<< * cdef char *fstack[1024] * cdef int istack = 0 */ __pyx_v_11libpetsc4py_FUNCT = NULL; /* "libpetsc4py.pyx":116 * cdef char *FUNCT = NULL * cdef char *fstack[1024] * cdef int istack = 0 # <<<<<<<<<<<<<< * * cdef inline void FunctionBegin(char name[]) nogil: */ __pyx_v_11libpetsc4py_istack = 0; /* "libpetsc4py.pyx":157 * PyObject *PyExc_RuntimeError * * cdef object PetscError = PyExc_RuntimeError # <<<<<<<<<<<<<< * from petsc4py.PETSc import Error as PetscError * */ __pyx_t_2 = ((PyObject *)PyExc_RuntimeError); __Pyx_INCREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11libpetsc4py_PetscError); __Pyx_DECREF_SET(__pyx_v_11libpetsc4py_PetscError, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "libpetsc4py.pyx":158 * * cdef object PetscError = PyExc_RuntimeError * from petsc4py.PETSc import Error as PetscError # <<<<<<<<<<<<<< * * cdef inline void PythonSETERR(PetscErrorCode ierr) with gil: */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_Error); __Pyx_GIVEREF(__pyx_n_s_Error); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Error); __pyx_t_3 = __Pyx_Import(__pyx_n_s_petsc4py_PETSc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_v_11libpetsc4py_PetscError); __Pyx_DECREF_SET(__pyx_v_11libpetsc4py_PetscError, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":272 * return (path, name) * * cdef dict module_cache = {} # <<<<<<<<<<<<<< * * cdef object load_module(object path): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_11libpetsc4py_module_cache); __Pyx_DECREF_SET(__pyx_v_11libpetsc4py_module_cache, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "libpetsc4py.pyx":2629 * # below trick Cython to treat all these entries as used. * * if PETSC_FALSE: # <<<<<<<<<<<<<< * import_libpetsc4py() * MatPythonGetContext(NULL,NULL) */ if (PETSC_FALSE) { /* "libpetsc4py.pyx":2630 * * if PETSC_FALSE: * import_libpetsc4py() # <<<<<<<<<<<<<< * MatPythonGetContext(NULL,NULL) * MatPythonSetContext(NULL,NULL) */ __pyx_t_1 = import_libpetsc4py(); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 2630, __pyx_L1_error) ((void)__pyx_t_1); /* "libpetsc4py.pyx":2631 * if PETSC_FALSE: * import_libpetsc4py() * MatPythonGetContext(NULL,NULL) # <<<<<<<<<<<<<< * MatPythonSetContext(NULL,NULL) * PCPythonGetContext(NULL,NULL) */ __pyx_t_4 = MatPythonGetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2631, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2632 * import_libpetsc4py() * MatPythonGetContext(NULL,NULL) * MatPythonSetContext(NULL,NULL) # <<<<<<<<<<<<<< * PCPythonGetContext(NULL,NULL) * PCPythonSetContext(NULL,NULL) */ __pyx_t_4 = MatPythonSetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2632, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2633 * MatPythonGetContext(NULL,NULL) * MatPythonSetContext(NULL,NULL) * PCPythonGetContext(NULL,NULL) # <<<<<<<<<<<<<< * PCPythonSetContext(NULL,NULL) * KSPPythonGetContext(NULL,NULL) */ __pyx_t_4 = PCPythonGetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2633, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2634 * MatPythonSetContext(NULL,NULL) * PCPythonGetContext(NULL,NULL) * PCPythonSetContext(NULL,NULL) # <<<<<<<<<<<<<< * KSPPythonGetContext(NULL,NULL) * KSPPythonSetContext(NULL,NULL) */ __pyx_t_4 = PCPythonSetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2634, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2635 * PCPythonGetContext(NULL,NULL) * PCPythonSetContext(NULL,NULL) * KSPPythonGetContext(NULL,NULL) # <<<<<<<<<<<<<< * KSPPythonSetContext(NULL,NULL) * SNESPythonGetContext(NULL,NULL) */ __pyx_t_4 = KSPPythonGetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2635, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2636 * PCPythonSetContext(NULL,NULL) * KSPPythonGetContext(NULL,NULL) * KSPPythonSetContext(NULL,NULL) # <<<<<<<<<<<<<< * SNESPythonGetContext(NULL,NULL) * SNESPythonSetContext(NULL,NULL) */ __pyx_t_4 = KSPPythonSetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2636, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2637 * KSPPythonGetContext(NULL,NULL) * KSPPythonSetContext(NULL,NULL) * SNESPythonGetContext(NULL,NULL) # <<<<<<<<<<<<<< * SNESPythonSetContext(NULL,NULL) * TSPythonGetContext(NULL,NULL) */ __pyx_t_4 = SNESPythonGetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2637, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2638 * KSPPythonSetContext(NULL,NULL) * SNESPythonGetContext(NULL,NULL) * SNESPythonSetContext(NULL,NULL) # <<<<<<<<<<<<<< * TSPythonGetContext(NULL,NULL) * TSPythonSetContext(NULL,NULL) */ __pyx_t_4 = SNESPythonSetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2638, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2639 * SNESPythonGetContext(NULL,NULL) * SNESPythonSetContext(NULL,NULL) * TSPythonGetContext(NULL,NULL) # <<<<<<<<<<<<<< * TSPythonSetContext(NULL,NULL) * PetscPythonRegisterAll() */ __pyx_t_4 = TSPythonGetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2639, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2640 * SNESPythonSetContext(NULL,NULL) * TSPythonGetContext(NULL,NULL) * TSPythonSetContext(NULL,NULL) # <<<<<<<<<<<<<< * PetscPythonRegisterAll() * */ __pyx_t_4 = TSPythonSetContext(NULL, NULL); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2640, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2641 * TSPythonGetContext(NULL,NULL) * TSPythonSetContext(NULL,NULL) * PetscPythonRegisterAll() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_4 = PetscPythonRegisterAll(); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(0, 2641, __pyx_L1_error) ((void)__pyx_t_4); /* "libpetsc4py.pyx":2629 * # below trick Cython to treat all these entries as used. * * if PETSC_FALSE: # <<<<<<<<<<<<<< * import_libpetsc4py() * MatPythonGetContext(NULL,NULL) */ } /*--- Wrapped vars code ---*/ if (__Pyx_RegisterCleanup()) __PYX_ERR(0, 1, __pyx_L1_error); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init libpetsc4py", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init libpetsc4py"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) { Py_CLEAR(__pyx_tuple__2); Py_CLEAR(__pyx_tuple__4); /* CodeObjectCache.cleanup */ if (__pyx_code_cache.entries) { __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; int i, count = __pyx_code_cache.count; __pyx_code_cache.count = 0; __pyx_code_cache.max_count = 0; __pyx_code_cache.entries = NULL; for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* decode_c_bytes */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { if (unlikely((start < 0) | (stop < 0))) { if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (stop > length) stop = length; if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (__Pyx_PyFastCFunction_Check(func)) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyExec */ static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) { return __Pyx_PyExec3(o, globals, NULL); } static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) { PyObject* result; PyObject* s = 0; char *code = 0; if (!globals || globals == Py_None) { globals = __pyx_d; } else if (!PyDict_Check(globals)) { PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not %.200s", Py_TYPE(globals)->tp_name); goto bad; } if (!locals || locals == Py_None) { locals = globals; } if (__Pyx_PyDict_GetItemStr(globals, __pyx_n_s_builtins) == NULL) { if (PyDict_SetItem(globals, __pyx_n_s_builtins, PyEval_GetBuiltins()) < 0) goto bad; } if (PyCode_Check(o)) { if (__Pyx_PyCode_HasFreeVars((PyCodeObject *)o)) { PyErr_SetString(PyExc_TypeError, "code object passed to exec() may not contain free variables"); goto bad; } #if CYTHON_COMPILING_IN_PYPY || PY_VERSION_HEX < 0x030200B1 result = PyEval_EvalCode((PyCodeObject *)o, globals, locals); #else result = PyEval_EvalCode(o, globals, locals); #endif } else { PyCompilerFlags cf; cf.cf_flags = 0; #if PY_VERSION_HEX >= 0x030800A3 cf.cf_feature_version = PY_MINOR_VERSION; #endif if (PyUnicode_Check(o)) { cf.cf_flags = PyCF_SOURCE_IS_UTF8; s = PyUnicode_AsUTF8String(o); if (!s) goto bad; o = s; #if PY_MAJOR_VERSION >= 3 } else if (!PyBytes_Check(o)) { #else } else if (!PyString_Check(o)) { #endif PyErr_Format(PyExc_TypeError, "exec: arg 1 must be string, bytes or code object, got %.200s", Py_TYPE(o)->tp_name); goto bad; } #if PY_MAJOR_VERSION >= 3 code = PyBytes_AS_STRING(o); #else code = PyString_AS_STRING(o); #endif if (PyEval_MergeCompilerFlags(&cf)) { result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf); } else { result = PyRun_String(code, Py_file_input, globals, locals); } Py_XDECREF(s); } return result; bad: Py_XDECREF(s); return 0; } /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* GetAttr3 */ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* GetVTable */ static void* __Pyx_GetVtable(PyObject *dict) { void* ptr; PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable); if (!ob) goto bad; #if PY_VERSION_HEX >= 0x02070000 ptr = PyCapsule_GetPointer(ob, 0); #else ptr = PyCObject_AsVoidPtr(ob); #endif if (!ptr && !PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); Py_DECREF(ob); return ptr; bad: Py_XDECREF(ob); return NULL; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* RegisterModuleCleanup */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) { __pyx_module_cleanup(module); Py_INCREF(Py_None); return Py_None; } static int __Pyx_RegisterCleanup(void) { static PyMethodDef cleanup_def = { "__cleanup", (PyCFunction)__pyx_module_cleanup_atexit, METH_NOARGS, 0}; PyObject *cleanup_func = 0; PyObject *atexit = 0; PyObject *reg = 0; PyObject *args = 0; PyObject *res = 0; int ret = -1; cleanup_func = PyCFunction_New(&cleanup_def, 0); if (!cleanup_func) goto bad; atexit = PyImport_ImportModule("atexit"); if (!atexit) goto bad; reg = PyObject_GetAttrString(atexit, "_exithandlers"); if (reg && PyList_Check(reg)) { PyObject *a, *kw; a = PyTuple_New(0); kw = PyDict_New(); if (!a || !kw) { Py_XDECREF(a); Py_XDECREF(kw); goto bad; } args = PyTuple_Pack(3, cleanup_func, a, kw); Py_DECREF(a); Py_DECREF(kw); if (!args) goto bad; ret = PyList_Insert(reg, 0, args); } else { if (!reg) PyErr_Clear(); Py_XDECREF(reg); reg = PyObject_GetAttrString(atexit, "register"); if (!reg) goto bad; args = PyTuple_Pack(1, cleanup_func); if (!args) goto bad; res = PyObject_CallObject(reg, args); if (!res) goto bad; ret = 0; } bad: Py_XDECREF(cleanup_func); Py_XDECREF(atexit); Py_XDECREF(reg); Py_XDECREF(args); Py_XDECREF(res); return ret; } #endif /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* None */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void) { int err; #ifdef WITH_THREAD PyGILState_STATE _save = PyGILState_Ensure(); #endif err = !!PyErr_Occurred(); #ifdef WITH_THREAD PyGILState_Release(_save); #endif return err; } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscInt(PetscInt value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscInt neg_one = (PetscInt) -1, const_zero = (PetscInt) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscInt) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscInt) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscInt) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscInt), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE PetscInt __Pyx_PyInt_As_PetscInt(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscInt neg_one = (PetscInt) -1, const_zero = (PetscInt) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PetscInt) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PetscInt, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscInt) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscInt) 0; case 1: __PYX_VERIFY_RETURN_INT(PetscInt, digit, digits[0]) case 2: if (8 * sizeof(PetscInt) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) >= 2 * PyLong_SHIFT) { return (PetscInt) (((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; case 3: if (8 * sizeof(PetscInt) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) >= 3 * PyLong_SHIFT) { return (PetscInt) (((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; case 4: if (8 * sizeof(PetscInt) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) >= 4 * PyLong_SHIFT) { return (PetscInt) (((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscInt) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PetscInt) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscInt) 0; case -1: __PYX_VERIFY_RETURN_INT(PetscInt, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PetscInt, digit, +digits[0]) case -2: if (8 * sizeof(PetscInt) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT) { return (PetscInt) (((PetscInt)-1)*(((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 2: if (8 * sizeof(PetscInt) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT) { return (PetscInt) ((((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case -3: if (8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT) { return (PetscInt) (((PetscInt)-1)*(((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 3: if (8 * sizeof(PetscInt) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT) { return (PetscInt) ((((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case -4: if (8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 4 * PyLong_SHIFT) { return (PetscInt) (((PetscInt)-1)*(((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 4: if (8 * sizeof(PetscInt) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 4 * PyLong_SHIFT) { return (PetscInt) ((((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; } #endif if (sizeof(PetscInt) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PetscInt val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PetscInt) -1; } } else { PetscInt val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscInt) -1; val = __Pyx_PyInt_As_PetscInt(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscInt"); return (PetscInt) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscInt"); return (PetscInt) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatSORType(MatSORType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatSORType neg_one = (MatSORType) -1, const_zero = (MatSORType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatSORType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatSORType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatSORType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatSORType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatSORType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatSORType), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE PetscBool __Pyx_PyInt_As_PetscBool(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscBool neg_one = (PetscBool) -1, const_zero = (PetscBool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PetscBool) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PetscBool, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscBool) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscBool) 0; case 1: __PYX_VERIFY_RETURN_INT(PetscBool, digit, digits[0]) case 2: if (8 * sizeof(PetscBool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) >= 2 * PyLong_SHIFT) { return (PetscBool) (((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; case 3: if (8 * sizeof(PetscBool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) >= 3 * PyLong_SHIFT) { return (PetscBool) (((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; case 4: if (8 * sizeof(PetscBool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) >= 4 * PyLong_SHIFT) { return (PetscBool) (((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscBool) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PetscBool) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscBool) 0; case -1: __PYX_VERIFY_RETURN_INT(PetscBool, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PetscBool, digit, +digits[0]) case -2: if (8 * sizeof(PetscBool) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT) { return (PetscBool) (((PetscBool)-1)*(((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 2: if (8 * sizeof(PetscBool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT) { return (PetscBool) ((((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case -3: if (8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT) { return (PetscBool) (((PetscBool)-1)*(((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 3: if (8 * sizeof(PetscBool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT) { return (PetscBool) ((((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case -4: if (8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 4 * PyLong_SHIFT) { return (PetscBool) (((PetscBool)-1)*(((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 4: if (8 * sizeof(PetscBool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 4 * PyLong_SHIFT) { return (PetscBool) ((((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; } #endif if (sizeof(PetscBool) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PetscBool val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PetscBool) -1; } } else { PetscBool val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscBool) -1; val = __Pyx_PyInt_As_PetscBool(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscBool"); return (PetscBool) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscBool"); return (PetscBool) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NormType(NormType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const NormType neg_one = (NormType) -1, const_zero = (NormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(NormType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(NormType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(NormType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(NormType), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ petsc4py-3.15.1/src/libpetsc4py/libpetsc4py.pyx0000644000175000017500000025122314062763234021627 0ustar balaybalay00000000000000#cython: cdivision=True #cython: binding=False #cython: auto_pickle=False #cython: autotestdict=False #cython: warn.multiple_declarators=False cimport cython # ---------- from petsc4py.PETSc cimport * cdef extern from "custom.h": pass # ---------- cdef extern from "Python.h": bint Py_IsInitialized() nogil ctypedef struct PyObject void Py_INCREF(PyObject*) void Py_DECREF(PyObject*) void Py_CLEAR(PyObject*) object PyModule_New(char*) bint PyModule_Check(object) object PyImport_Import(object) # -------------------------------------------------------------------- cdef extern from "custom.h": void initlibpetsc4py() nogil except * cdef public int import_libpetsc4py() nogil except -1: initlibpetsc4py() return 0 # -------------------------------------------------------------------- cdef extern from * nogil: MPI_Comm MPI_COMM_NULL MPI_Comm PETSC_COMM_SELF MPI_Comm PETSC_COMM_WORLD int MPI_Comm_size(MPI_Comm,int*) int MPI_Comm_rank(MPI_Comm,int*) ctypedef int PetscErrorCode enum: PETSC_ERR_SUP enum: PETSC_ERR_USER enum: PETSC_ERROR_INITIAL enum: PETSC_ERROR_REPEAT PetscErrorCode PetscERROR(MPI_Comm,char[],PetscErrorCode,int,char[],char[]) ctypedef enum PetscBool: PETSC_TRUE PETSC_FALSE ctypedef long PetscInt ctypedef double PetscReal ctypedef double PetscScalar ctypedef struct _p_PetscObject: MPI_Comm comm char *prefix PetscInt refct ctypedef int PetscClassId PetscErrorCode PetscObjectGetClassId(PetscObject,PetscClassId*) PetscErrorCode PetscObjectGetComm(PetscObject,MPI_Comm*) PetscErrorCode PetscObjectCompose(PetscObject,char[],PetscObject) PetscErrorCode PetscObjectQuery(PetscObject,char[],PetscObject*) PetscErrorCode PetscObjectReference(PetscObject) ctypedef void (*PetscVoidFunction)() PetscErrorCode PetscObjectComposeFunction(PetscObject,char[],void (*ptr)()) PetscErrorCode PetscObjectTypeCompare(PetscObject,char[],PetscBool*) PetscErrorCode PetscObjectChangeTypeName(PetscObject, char[]) ctypedef struct _p_PetscOptionItems ctypedef _p_PetscOptionItems* PetscOptionItems ctypedef struct _n_PetscOptions ctypedef _n_PetscOptions* PetscOptions PetscErrorCode PetscOptionsString(char[],char[],char[],char[],char[],size_t,PetscBool*) PetscErrorCode PetscOptionsGetString(PetscOptions,char[],char[],char[],size_t,PetscBool*) char *PETSCVIEWERASCII char *PETSCVIEWERSTRING PetscErrorCode PetscViewerASCIIPrintf(PetscViewer,char[],...) PetscErrorCode PetscViewerStringSPrintf(PetscViewer,char[],...) cdef inline object toInt(PetscInt value): return value cdef inline PetscInt asInt(object value) except?-1: return value cdef inline object toReal(PetscReal value): return value cdef inline PetscReal asReal(object value) except?-1: return value cdef extern from "scalar.h": object toScalar"PyPetscScalar_FromPetscScalar"(PetscScalar) PetscScalar asScalar"PyPetscScalar_AsPetscScalar"(object) except* # -------------------------------------------------------------------- # NumPy support # ------------- cdef extern from "string.h" nogil: void* memset(void*,int,size_t) void* memcpy(void*,void*,size_t) char* strdup(char*) include "arraynpy.pxi" import_array() # -------------------------------------------------------------------- cdef extern from * nogil: enum: PETSC_ERR_PYTHON cdef extern from * nogil: enum: IERR "PETSC_ERR_PYTHON" cdef char *FUNCT = NULL cdef char *fstack[1024] cdef int istack = 0 cdef inline void FunctionBegin(char name[]) nogil: global FUNCT FUNCT = name global fstack, istack fstack[istack] = FUNCT istack += 1 if istack >= 1024: istack = 0 return cdef inline PetscErrorCode FunctionEnd() nogil: global FUNCT FUNCT = NULL global fstack, istack istack -= 1 if istack < 0: istack = 1024 FUNCT = fstack[istack] return 0 cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr,char msg[]) nogil: global fstack, istack istack = 0; fstack[istack] = NULL; global FUNCT return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, PETSC_ERROR_INITIAL, msg, NULL) cdef PetscErrorCode PetscCHKERR(PetscErrorCode ierr) nogil: global fstack, istack istack = 0; fstack[istack] = NULL; global FUNCT return PetscERROR(PETSC_COMM_SELF,FUNCT,ierr, PETSC_ERROR_REPEAT, b"", NULL) cdef extern from *: void PyErr_SetObject(object, object) PyObject *PyExc_RuntimeError cdef object PetscError = PyExc_RuntimeError from petsc4py.PETSc import Error as PetscError cdef inline void PythonSETERR(PetscErrorCode ierr) with gil: if (PetscError) != NULL: PyErr_SetObject(PetscError, ierr) else: PyErr_SetObject(PyExc_RuntimeError, ierr) cdef inline int CHKERR(PetscErrorCode ierr) nogil except -1: if ierr == 0: return 0 if ierr == PETSC_ERR_PYTHON: #PetscCHKERR(ierr) return -1 if Py_IsInitialized(): PythonSETERR(ierr) PetscCHKERR(ierr) return -1 cdef PetscErrorCode UNSUPPORTED(char msg[]) nogil: global FUNCT return PetscERROR(PETSC_COMM_SELF,FUNCT,PETSC_ERR_USER, PETSC_ERROR_INITIAL,b"method %s()",msg) # -------------------------------------------------------------------- cdef inline PetscInt getRef(void *pobj) nogil: cdef PetscObject obj = pobj if obj == NULL: return 0 else: return obj.refct cdef inline void addRef(void *pobj) nogil: cdef PetscObject obj = pobj if obj != NULL: obj.refct += 1 cdef inline void delRef(void *pobj) nogil: cdef PetscObject obj = pobj if obj != NULL: obj.refct -= 1 cdef inline PetscObject newRef(void *pobj) nogil: cdef PetscObject obj = pobj cdef int ierr = 0 if obj != NULL: ierr = PetscObjectReference(obj) if ierr: return NULL # XXX warning! return obj cdef inline char* getPrefix(void *pobj) nogil: cdef PetscObject obj = pobj if obj == NULL: return NULL return obj.prefix cdef inline int getCommSize(void *pobj) nogil: cdef PetscObject obj = pobj if obj == NULL: return 0 cdef int size = 0 MPI_Comm_size(obj.comm,&size) return size cdef inline Viewer Viewer_(PetscViewer p): cdef Viewer ob = Viewer.__new__(Viewer) ob.obj[0] = newRef(p) return ob cdef inline IS IS_(PetscIS p): cdef IS ob = IS.__new__(IS) ob.obj[0] = newRef(p) return ob cdef inline Vec Vec_(PetscVec p): cdef Vec ob = Vec.__new__(Vec) ob.obj[0] = newRef(p) return ob cdef inline Mat Mat_(PetscMat p): cdef Mat ob = Mat.__new__(Mat) ob.obj[0] = newRef(p) return ob cdef inline PC PC_(PetscPC p): cdef PC ob = PC.__new__(PC) ob.obj[0] = newRef(p) return ob cdef inline KSP KSP_(PetscKSP p): cdef KSP ob = KSP.__new__(KSP) ob.obj[0] = newRef(p) return ob cdef inline SNES SNES_(PetscSNES p): cdef SNES ob = SNES.__new__(SNES) ob.obj[0] = newRef(p) return ob cdef inline TS TS_(PetscTS p): cdef TS ob = TS.__new__(TS) ob.obj[0] = newRef(p) return ob # -------------------------------------------------------------------- cdef inline object bytes2str(const char p[]): if p == NULL: return None cdef bytes s = p if isinstance(s, str): return s else: return s.decode() cdef object parse_url(object url): path, name = url.rsplit(":", 1) return (path, name) cdef dict module_cache = {} cdef object load_module(object path): if path in module_cache: return module_cache[path] module = PyModule_New("__petsc__") module.__file__ = path module.__package__ = None module_cache[path] = module try: source = open(path, 'rU') try: code = compile(source.read(), path, 'exec') finally: source.close() exec(code, module.__dict__) except: del module_cache[path] raise return module # ----------------------------------------------------------------------------- @cython.internal cdef class _PyObj: cdef object self cdef bytes name def __getattr__(self, attr): return getattr(self.self, attr, None) cdef int setcontext(self, void *ctx, Object base) except -1: # if ctx == self.self: return 0 # cdef object destroy = self.destroy if destroy is not None: destroy(base) destroy = None # if ctx == NULL: self.self = None self.name = None return 0 # self.self = ctx self.name = None cdef object create = self.create if create is not None: create(base) create = None return 0 cdef int getcontext(self, void **ctx) except -1: if ctx == NULL: return 0 if self.self is not None: ctx[0] = self.self else: ctx[0] = NULL return 0 cdef int setname(self, char name[]) except -1: if name != NULL and name[0] != 0: self.name = name else: self.name = None return 0 cdef char* getname(self) except? NULL: if self.self is None: return NULL if self.name is not None: return self.name cdef ctx = self.self cdef name = None if PyModule_Check(ctx): name = getattr(ctx, '__name__', None) else: modname = getattr(ctx, '__module__', None) clsname = None cls = getattr(ctx, '__class__', None) if cls: clsname = getattr(cls, '__name__', None) if not modname: modname = getattr(cls, '__module__', None) if modname and clsname: name = modname + '.' + clsname elif clsname: name = clsname elif modname: name = modname if name is not None: self.name = name.encode() if self.name is not None: return self.name return NULL cdef createcontext(char name_p[]): if name_p == NULL: return None cdef name = bytes2str(name_p) cdef mod, path, modname=None cdef cls, attr, clsname=None # path/to/filename.py:{function|class} if ':' in name: path, attr = parse_url(name) mod = load_module(path) if attr: cls = getattr(mod, attr) return cls() else: return mod # package.module[.{function|class}] if '.' in name: modname, clsname = name.rsplit('.', 1) mod = PyImport_Import(modname) if hasattr(mod, clsname): cls = getattr(mod, clsname) if not PyModule_Check(cls): return cls() # package[.module] mod = PyImport_Import(name) return mod cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1: cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERASCII, &isascii) ) CHKERR( PetscObjectTypeCompare(viewer, PETSCVIEWERSTRING, &isstring) ) cdef char *name = ctx.getname() if isascii: if name == NULL: name = b"unknown/no yet set" CHKERR( PetscViewerASCIIPrintf(viewer, b" Python: %s\n", name) ) if isstring: if name == NULL: name = b"" CHKERR( PetscViewerStringSPrintf(viewer,"%s", name) ) return 0 # -------------------------------------------------------------------- cdef extern from * nogil: struct _n_PetscLayout ctypedef _n_PetscLayout* PetscLayout PetscErrorCode PetscLayoutSetLocalSize(PetscLayout,PetscInt) PetscErrorCode PetscLayoutSetSize(PetscLayout,PetscInt) PetscErrorCode PetscLayoutGetBlockSize(PetscLayout,PetscInt*) PetscErrorCode PetscLayoutSetBlockSize(PetscLayout,PetscInt) PetscErrorCode PetscLayoutSetUp(PetscLayout) cdef extern from * nogil: ctypedef enum NormType: NORM_1 NORM_2 ctypedef enum InsertMode: INSERT_VALUES ADD_VALUES PetscErrorCode VecDestroy(PetscVec*) PetscErrorCode VecDuplicate(PetscVec,PetscVec*) PetscErrorCode VecCopy(PetscVec,PetscVec) PetscErrorCode VecSet(PetscVec,PetscScalar) PetscErrorCode VecScale(PetscVec,PetscScalar) PetscErrorCode VecShift(PetscVec,PetscScalar) PetscErrorCode VecAXPY(PetscVec,PetscScalar,PetscVec) PetscErrorCode VecAXPBY(PetscVec,PetscScalar,PetscScalar,PetscVec) PetscErrorCode VecNorm(PetscVec,NormType,PetscReal*) # -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum MatDuplicateOption: MAT_DO_NOT_COPY_VALUES MAT_COPY_VALUES MAT_SHARE_NONZERO_PATTERN ctypedef enum MatAssemblyType: MAT_FLUSH_ASSEMBLY MAT_FINAL_ASSEMBLY ctypedef enum MatOption: pass ctypedef enum MatStructure: SAME_NONZERO_PATTERN DIFFERENT_NONZERO_PATTERN SUBSET_NONZERO_PATTERN UNKNOWN_NONZERO_PATTERN ctypedef enum MatReuse: MAT_IGNORE_MATRIX MAT_INITIAL_MATRIX MAT_REUSE_MATRIX ctypedef enum MatSORType: SOR_FORWARD_SWEEP SOR_BACKWARD_SWEEP SOR_SYMMETRIC_SWEEP SOR_LOCAL_FORWARD_SWEEP SOR_LOCAL_BACKWARD_SWEEP SOR_LOCAL_SYMMETRIC_SWEEP SOR_ZERO_INITIAL_GUESS SOR_EISENSTAT SOR_APPLY_UPPER SOR_APPLY_LOWER cdef extern from * nogil: struct _MatOps: PetscErrorCode (*destroy)(PetscMat) except IERR PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscMat) except IERR PetscErrorCode (*view)(PetscMat,PetscViewer) except IERR PetscErrorCode (*duplicate)(PetscMat,MatDuplicateOption,PetscMat*) except IERR PetscErrorCode (*copy)(PetscMat,PetscMat,MatStructure) except IERR PetscErrorCode (*createsubmatrix)(PetscMat,PetscIS,PetscIS,MatReuse,PetscMat*) except IERR PetscErrorCode (*setoption)(PetscMat,MatOption,PetscBool) except IERR PetscErrorCode (*setup)(PetscMat) except IERR PetscErrorCode (*assemblybegin)(PetscMat,MatAssemblyType) except IERR PetscErrorCode (*assemblyend)(PetscMat,MatAssemblyType) except IERR PetscErrorCode (*zeroentries)(PetscMat) except IERR PetscErrorCode (*zerorowscolumns)(PetscMat,PetscInt,PetscInt*,PetscScalar,PetscVec,PetscVec) except IERR PetscErrorCode (*scale)(PetscMat,PetscScalar) except IERR PetscErrorCode (*shift)(PetscMat,PetscScalar) except IERR PetscErrorCode (*sor)(PetscMat,PetscVec,PetscReal,MatSORType,PetscReal,PetscInt,PetscInt,PetscVec) except IERR PetscErrorCode (*getvecs)(PetscMat,PetscVec*,PetscVec*) except IERR PetscErrorCode (*mult)(PetscMat,PetscVec,PetscVec) except IERR PetscErrorCode (*multtranspose)(PetscMat,PetscVec,PetscVec) except IERR PetscErrorCode (*multhermitian"multhermitiantranspose")(PetscMat,PetscVec,PetscVec) except IERR PetscErrorCode (*multadd)(PetscMat,PetscVec,PetscVec,PetscVec) except IERR PetscErrorCode (*multtransposeadd)(PetscMat,PetscVec,PetscVec,PetscVec) except IERR PetscErrorCode (*multhermitianadd"multhermitiantransposeadd")(PetscMat,PetscVec,PetscVec,PetscVec) except IERR PetscErrorCode (*multdiagonalblock)(PetscMat,PetscVec,PetscVec) except IERR PetscErrorCode (*solve)(PetscMat,PetscVec,PetscVec) except IERR PetscErrorCode (*solvetranspose)(PetscMat,PetscVec,PetscVec) except IERR PetscErrorCode (*solveadd)(PetscMat,PetscVec,PetscVec,PetscVec) except IERR PetscErrorCode (*solvetransposeadd)(PetscMat,PetscVec,PetscVec,PetscVec) except IERR PetscErrorCode (*getdiagonal)(PetscMat,PetscVec) except IERR PetscErrorCode (*setdiagonal"diagonalset")(PetscMat,PetscVec,InsertMode) except IERR PetscErrorCode (*diagonalscale)(PetscMat,PetscVec,PetscVec) except IERR PetscErrorCode (*missingdiagonal)(PetscMat,PetscBool*,PetscInt*) except IERR PetscErrorCode (*norm)(PetscMat,NormType,PetscReal*) except IERR PetscErrorCode (*realpart)(PetscMat) except IERR PetscErrorCode (*imagpart"imaginarypart")(PetscMat) except IERR PetscErrorCode (*conjugate)(PetscMat) except IERR ctypedef _MatOps *MatOps struct _p_Mat: void *data MatOps ops PetscBool assembled PetscBool preallocated PetscLayout rmap, cmap cdef extern from * nogil: PetscErrorCode MatCreateVecs(PetscMat,PetscVec*,PetscVec*) PetscErrorCode MatIsSymmetricKnown(PetscMat,PetscBool*,PetscBool*) PetscErrorCode MatIsHermitianKnown(PetscMat,PetscBool*,PetscBool*) PetscErrorCode MatMult(PetscMat,PetscVec,PetscVec) PetscErrorCode MatMultTranspose(PetscMat,PetscVec,PetscVec) PetscErrorCode MatMultHermitian"MatMultHermitianTranspose"(PetscMat,PetscVec,PetscVec) PetscErrorCode MatSolve(PetscMat,PetscVec,PetscVec) PetscErrorCode MatSolveTranspose(PetscMat,PetscVec,PetscVec) @cython.internal cdef class _PyMat(_PyObj): pass cdef inline _PyMat PyMat(PetscMat mat): if mat != NULL and mat.data != NULL: return <_PyMat>mat.data else: return _PyMat.__new__(_PyMat) cdef public PetscErrorCode MatPythonGetContext(PetscMat mat, void **ctx) \ except IERR: FunctionBegin(b"MatPythonGetContext") PyMat(mat).getcontext(ctx) return FunctionEnd() cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \ except IERR: FunctionBegin(b"MatPythonSetContext") PyMat(mat).setcontext(ctx, Mat_(mat)) return FunctionEnd() cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, char name[]) \ except IERR with gil: FunctionBegin(b"MatPythonSetType_PYTHON") if name == NULL: return FunctionEnd() # XXX cdef object ctx = createcontext(name) MatPythonSetContext(mat, ctx) PyMat(mat).setname(name) return FunctionEnd() cdef PetscErrorCode MatCreate_Python( PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatCreate_Python") # cdef MatOps ops = mat.ops ops.destroy = MatDestroy_Python ops.setfromoptions = MatSetFromOptions_Python ops.view = MatView_Python ops.duplicate = MatDuplicate_Python ops.copy = MatCopy_Python ops.createsubmatrix = MatCreateSubMatrix_Python ops.setoption = MatSetOption_Python ops.setup = MatSetUp_Python ops.assemblybegin = MatAssemblyBegin_Python ops.assemblyend = MatAssemblyEnd_Python ops.zeroentries = MatZeroEntries_Python ops.zerorowscolumns = MatZeroRowsColumns_Python ops.scale = MatScale_Python ops.shift = MatShift_Python ops.getvecs = MatCreateVecs_Python ops.mult = MatMult_Python ops.sor = MatSOR_Python ops.multtranspose = MatMultTranspose_Python ops.multhermitian = MatMultHermitian_Python ops.multadd = MatMultAdd_Python ops.multtransposeadd = MatMultTransposeAdd_Python ops.multhermitianadd = MatMultHermitianAdd_Python ops.multdiagonalblock = MatMultDiagonalBlock_Python ops.solve = MatSolve_Python ops.solvetranspose = MatSolveTranspose_Python ops.solveadd = MatSolveAdd_Python ops.solvetransposeadd = MatSolveTransposeAdd_Python ops.getdiagonal = MatGetDiagonal_Python ops.setdiagonal = MatSetDiagonal_Python ops.diagonalscale = MatDiagonalScale_Python ops.missingdiagonal = MatMissingDiagonal_Python ops.norm = MatNorm_Python ops.realpart = MatRealPart_Python ops.imagpart = MatImagPart_Python ops.conjugate = MatConjugate_Python # mat.assembled = PETSC_TRUE # XXX mat.preallocated = PETSC_FALSE # XXX # CHKERR( PetscObjectComposeFunction( mat,b"MatGetDiagonalBlock_C", MatGetDiagonalBlock_Python) ) CHKERR( PetscObjectComposeFunction( mat,b"MatPythonSetType_C", MatPythonSetType_PYTHON) ) CHKERR( PetscObjectChangeTypeName( mat,MATPYTHON) ) # cdef ctx = PyMat(NULL) mat.data = ctx Py_INCREF(mat.data) return FunctionEnd() cdef PetscErrorCode MatDestroy_Python( PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatDestroy_Python") CHKERR( PetscObjectComposeFunction( mat,b"MatGetDiagonalBlock_C", NULL) ) CHKERR( PetscObjectComposeFunction( mat,b"MatPythonSetType_C", NULL) ) CHKERR( PetscObjectChangeTypeName( mat,NULL) ) # if not Py_IsInitialized(): return FunctionEnd() try: addRef(mat) MatPythonSetContext(mat, NULL) finally: delRef(mat) Py_DECREF(mat.data) mat.data = NULL return FunctionEnd() cdef PetscErrorCode MatSetFromOptions_Python( PetscOptionItems *PetscOptionsObject, PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatSetFromOptions_Python") # cdef char name[2048], *defval = PyMat(mat).getname() cdef PetscBool found = PETSC_FALSE cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject CHKERR( PetscOptionsString( b"-mat_python_type",b"Python [package.]module[.{class|function}]", b"MatPythonSetType",defval,name,sizeof(name),&found) ); opts; if found and name[0]: CHKERR( MatPythonSetType_PYTHON(mat,name) ) # cdef setFromOptions = PyMat(mat).setFromOptions if setFromOptions is not None: setFromOptions(Mat_(mat)) return FunctionEnd() cdef PetscErrorCode MatView_Python( PetscMat mat, PetscViewer vwr, ) \ except IERR with gil: FunctionBegin(b"MatView_Python") viewcontext(PyMat(mat), vwr) cdef view = PyMat(mat).view if view is not None: view(Mat_(mat), Viewer_(vwr)) return FunctionEnd() cdef PetscErrorCode MatDuplicate_Python( PetscMat mat, MatDuplicateOption op, PetscMat* out, ) \ except IERR with gil: FunctionBegin(b"MatDuplicate_Python") cdef duplicate = PyMat(mat).duplicate if duplicate is None: return UNSUPPORTED(b"duplicate") cdef Mat m = duplicate(Mat_(mat), op) out[0] = m.mat; m.mat = NULL return FunctionEnd() cdef PetscErrorCode MatCopy_Python( PetscMat mat, PetscMat out, MatStructure op, ) \ except IERR with gil: FunctionBegin(b"MatCopy_Python") cdef copy = PyMat(mat).copy if copy is None: return UNSUPPORTED(b"copy") copy(Mat_(mat), Mat_(out), op) return FunctionEnd() cdef PetscErrorCode MatGetDiagonalBlock_Python( PetscMat mat, PetscMat *out ) \ except IERR with gil: FunctionBegin(b"MatGetDiagonalBlock_Python") cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock if getDiagonalBlock is None: if getCommSize(mat) == 1: out[0] = mat return FunctionEnd() if getDiagonalBlock is None: return UNSUPPORTED(b"getDiagonalBlock") cdef Mat sub = getDiagonalBlock(Mat_(mat)) if sub is not None: out[0] = sub.mat return FunctionEnd() cdef PetscErrorCode MatCreateSubMatrix_Python( PetscMat mat, PetscIS row, PetscIS col, MatReuse op, PetscMat *out, ) \ except IERR with gil: FunctionBegin(b"MatCreateSubMatrix_Python") cdef createSubMatrix = PyMat(mat).createSubMatrix if createSubMatrix is None: return UNSUPPORTED(b"createSubMatrix") cdef Mat sub = None if op == MAT_IGNORE_MATRIX: sub = None elif op == MAT_INITIAL_MATRIX: sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), None) if sub is not None: addRef(sub.mat) elif op == MAT_REUSE_MATRIX: sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0])) if sub is not None: out[0] = sub.mat return FunctionEnd() cdef PetscErrorCode MatSetOption_Python( PetscMat mat, MatOption op, PetscBool flag, ) \ except IERR with gil: FunctionBegin(b"MatSetOption_Python") cdef setOption = PyMat(mat).setOption if setOption is not None: setOption(Mat_(mat), op, (flag)) return FunctionEnd() cdef PetscErrorCode MatSetUp_Python( PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatSetUp_Python") cdef PetscInt rbs = -1, cbs = -1 CHKERR( PetscLayoutGetBlockSize(mat.rmap,&rbs) ) CHKERR( PetscLayoutGetBlockSize(mat.cmap,&cbs) ) if rbs == -1: rbs = 1 if cbs == -1: cbs = rbs CHKERR( PetscLayoutSetBlockSize(mat.rmap,rbs) ) CHKERR( PetscLayoutSetBlockSize(mat.cmap,cbs) ) CHKERR( PetscLayoutSetUp(mat.rmap) ) CHKERR( PetscLayoutSetUp(mat.cmap) ) mat.preallocated = PETSC_TRUE # cdef char name[2048] cdef PetscBool found = PETSC_FALSE if PyMat(mat).self is None: CHKERR( PetscOptionsGetString(NULL, getPrefix(mat), b"-mat_python_type", name,sizeof(name),&found) ) if found and name[0]: CHKERR( MatPythonSetType_PYTHON(mat,name) ) if PyMat(mat).self is None: return PetscSETERR(PETSC_ERR_USER, "Python context not set, call one of \n" " * MatPythonSetType(mat,\"[package.]module.class\")\n" " * MatSetFromOptions(mat) and pass option " "-mat_python_type [package.]module.class") # cdef setUp = PyMat(mat).setUp if setUp is not None: setUp(Mat_(mat)) return FunctionEnd() cdef PetscErrorCode MatAssemblyBegin_Python( PetscMat mat, MatAssemblyType at, ) \ except IERR with gil: FunctionBegin(b"MatAssemblyBegin_Python") cdef assembly = PyMat(mat).assemblyBegin if assembly is not None: assembly(Mat_(mat), at) return FunctionEnd() cdef PetscErrorCode MatAssemblyEnd_Python( PetscMat mat, MatAssemblyType at, ) \ except IERR with gil: FunctionBegin(b"MatAssemblyEnd_Python") cdef assembly = PyMat(mat).assemblyEnd if assembly is None: assembly = PyMat(mat).assembly if assembly is not None: assembly(Mat_(mat), at) return FunctionEnd() cdef PetscErrorCode MatZeroEntries_Python( PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatZeroEntries_Python") cdef zeroEntries = PyMat(mat).zeroEntries if zeroEntries is None: return UNSUPPORTED(b"zeroEntries") zeroEntries(Mat_(mat)) return FunctionEnd() cdef PetscErrorCode MatZeroRowsColumns_Python( PetscMat mat, PetscInt numRows, const PetscInt* rows, PetscScalar diag, PetscVec x, PetscVec b, ) \ except IERR with gil: FunctionBegin(b"MatZeroRowsColumns_Python") cdef zeroRowsColumns = PyMat(mat).zeroRowsColumns if zeroRowsColumns is None: return UNSUPPORTED(b"zeroRowsColumns") cdef ndarray pyrows = array_i(numRows, rows) zeroRowsColumns(Mat_(mat), pyrows, toScalar(diag), Vec_(x), Vec_(b)) return FunctionEnd() cdef PetscErrorCode MatScale_Python( PetscMat mat, PetscScalar s, ) \ except IERR with gil: FunctionBegin(b"MatScale_Python") cdef scale = PyMat(mat).scale if scale is None: return UNSUPPORTED(b"scale") scale(Mat_(mat), toScalar(s)) return FunctionEnd() cdef PetscErrorCode MatShift_Python( PetscMat mat, PetscScalar s, ) \ except IERR with gil: FunctionBegin(b"MatShift_Python") cdef shift = PyMat(mat).shift if shift is None: return UNSUPPORTED(b"shift") shift(Mat_(mat), toScalar(s)) return FunctionEnd() cdef PetscErrorCode MatCreateVecs_Python( PetscMat mat, PetscVec *x, PetscVec *y, ) \ except IERR with gil: FunctionBegin(b"MatCreateVecs_Python") cdef createVecs = PyMat(mat).createVecs if createVecs is None: try: mat.ops.getvecs = NULL CHKERR( MatCreateVecs(mat,x,y) ) finally: mat.ops.getvecs = MatCreateVecs_Python return FunctionEnd() if createVecs is None: return UNSUPPORTED(b"createVecs") cdef Vec u, v u, v = createVecs(Mat_(mat)) if x != NULL: x[0] = u.vec u.vec = NULL if y != NULL: y[0] = v.vec v.vec = NULL return FunctionEnd() cdef PetscErrorCode MatMult_Python( PetscMat mat, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"MatMult_Python") cdef mult = PyMat(mat).mult if mult is None: return UNSUPPORTED(b"mult") mult(Mat_(mat), Vec_(x), Vec_(y)) return FunctionEnd() cdef PetscErrorCode MatMultTranspose_Python( PetscMat mat, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"MatMultTranspose_Python") cdef multTranspose = PyMat(mat).multTranspose cdef PetscBool symmset, symmknown if multTranspose is None: symmset = symmknown = PETSC_FALSE CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) if symmset and symmknown: CHKERR( MatMult(mat,x,y) ) return FunctionEnd() if multTranspose is None: return UNSUPPORTED(b"multTranspose") multTranspose(Mat_(mat), Vec_(x), Vec_(y)) return FunctionEnd() cdef PetscErrorCode MatMultHermitian_Python( PetscMat mat, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"MatMultHermitian_Python") cdef multHermitian = PyMat(mat).multHermitian cdef PetscBool hermset, hermknown if multHermitian is None: hermset = hermknown = PETSC_FALSE CHKERR( MatIsHermitianKnown(mat,&hermset,&hermknown) ) if hermset and hermknown: CHKERR( MatMult(mat,x,y) ) return FunctionEnd() if multHermitian is None: return UNSUPPORTED(b"multHermitian") multHermitian(Mat_(mat), Vec_(x), Vec_(y)) return FunctionEnd() cdef PetscErrorCode MatMultAdd_Python( PetscMat mat, PetscVec x, PetscVec v, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"MatMultAdd_Python") cdef multAdd = PyMat(mat).multAdd cdef PetscVec t = NULL if multAdd is None: if v == y: CHKERR( VecDuplicate(y, &t) ) CHKERR( MatMult(mat,x,t) ) CHKERR( VecAXPY(y,1.0,t) ) CHKERR( VecDestroy(&t) ) else: CHKERR( MatMult(mat,x,y) ) CHKERR( VecAXPY(y,1.0,v) ) return FunctionEnd() if multAdd is None: return UNSUPPORTED(b"multAdd") multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) return FunctionEnd() cdef PetscErrorCode MatMultTransposeAdd_Python( PetscMat mat, PetscVec x, PetscVec v, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"MatMultTransposeAdd_Python") cdef multTransposeAdd = PyMat(mat).multTransposeAdd if multTransposeAdd is None: CHKERR( MatMultTranspose(mat,x,y) ) CHKERR( VecAXPY(y,1.0,v) ) return FunctionEnd() if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd") multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) return FunctionEnd() cdef PetscErrorCode MatMultHermitianAdd_Python( PetscMat mat, PetscVec x, PetscVec v, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"MatMultHermitianAdd_Python") cdef multHermitianAdd = PyMat(mat).multHermitianAdd if multHermitianAdd is None: CHKERR( MatMultHermitian(mat,x,y) ) CHKERR( VecAXPY(y,1.0,v) ) return FunctionEnd() if multHermitianAdd is None: return UNSUPPORTED(b"multHermitianAdd") multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y)) return FunctionEnd() cdef PetscErrorCode MatMultDiagonalBlock_Python( PetscMat mat, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"MatMultDiagonalBlock_Python") cdef multDiagonalBlock = PyMat(mat).multDiagonalBlock if multDiagonalBlock is None: return UNSUPPORTED(b"multDiagonalBlock") multDiagonalBlock(Mat_(mat), Vec_(x), Vec_(y)) return FunctionEnd() cdef PetscErrorCode MatSolve_Python( PetscMat mat, PetscVec b, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"MatSolve_Python") cdef solve = PyMat(mat).solve if solve is None: return UNSUPPORTED(b"solve") solve(Mat_(mat), Vec_(b), Vec_(x)) return FunctionEnd() cdef PetscErrorCode MatSolveTranspose_Python( PetscMat mat, PetscVec b, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"MatSolveTranspose_Python") cdef solveTranspose = PyMat(mat).solveTranspose cdef PetscBool symmset, symmknown if solveTranspose is None: symmset = symmknown = PETSC_FALSE CHKERR( MatIsSymmetricKnown(mat,&symmset,&symmknown) ) if symmset and symmknown: CHKERR( MatSolve(mat,b,x) ) return FunctionEnd() if solveTranspose is None: return UNSUPPORTED(b"solveTranspose") solveTranspose(Mat_(mat), Vec_(b), Vec_(x)) return FunctionEnd() cdef PetscErrorCode MatSolveAdd_Python( PetscMat mat, PetscVec b, PetscVec y, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"MatSolveAdd_Python") cdef solveAdd = PyMat(mat).solveAdd if solveAdd is None: CHKERR( MatSolve(mat,b,x) ) CHKERR( VecAXPY(x,1.0,y) ) return FunctionEnd() if solveAdd is None: return UNSUPPORTED(b"solveAdd") solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) return FunctionEnd() cdef PetscErrorCode MatSolveTransposeAdd_Python( PetscMat mat, PetscVec b, PetscVec y, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"MatSolveTransposeAdd_Python") cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd if solveTransposeAdd is None: CHKERR( MatSolveTranspose(mat,b,x) ) CHKERR( VecAXPY(x,1.0,y) ) return FunctionEnd() if solveTransposeAdd is None: return UNSUPPORTED(b"solveTransposeAdd") solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x)) return FunctionEnd() cdef PetscErrorCode MatSOR_Python( PetscMat mat, PetscVec b, PetscReal omega, MatSORType sortype, PetscReal shift, PetscInt its, PetscInt lits, PetscVec x )\ except IERR with gil: FunctionBegin(b"MatSOR_Python") cdef SOR = PyMat(mat).SOR if SOR is None: return UNSUPPORTED(b"SOR") SOR(Mat_(mat), Vec_(b), asReal(omega), asInt(sortype), asReal(shift), asInt(its), asInt(lits), Vec_(x)) return FunctionEnd() cdef PetscErrorCode MatGetDiagonal_Python( PetscMat mat, PetscVec v, ) \ except IERR with gil: FunctionBegin(b"MatGetDiagonal_Python") cdef getDiagonal = PyMat(mat).getDiagonal if getDiagonal is None: return UNSUPPORTED(b"getDiagonal") getDiagonal(Mat_(mat), Vec_(v)) return FunctionEnd() cdef PetscErrorCode MatSetDiagonal_Python( PetscMat mat, PetscVec v, InsertMode im, ) \ except IERR with gil: FunctionBegin(b"MatSetDiagonal_Python") cdef setDiagonal = PyMat(mat).setDiagonal cdef bint addv = True if im == ADD_VALUES else False if setDiagonal is None: return UNSUPPORTED(b"setDiagonal") setDiagonal(Mat_(mat), Vec_(v), addv) return FunctionEnd() cdef PetscErrorCode MatDiagonalScale_Python( PetscMat mat, PetscVec l, PetscVec r, ) \ except IERR with gil: FunctionBegin(b"MatDiagonalScale_Python") cdef diagonalScale = PyMat(mat).diagonalScale if diagonalScale is None: return UNSUPPORTED(b"diagonalScale") diagonalScale(Mat_(mat), Vec_(l), Vec_(r)) return FunctionEnd() cdef PetscErrorCode MatMissingDiagonal_Python( PetscMat mat, PetscBool *missing, PetscInt *loc ) \ except IERR with gil: FunctionBegin(b"MatMissingDiagonal_Python") cdef missingDiagonal = PyMat(mat).missingDiagonal if missingDiagonal is None: return UNSUPPORTED(b"missingDiagonal") pymissing, pyloc = missingDiagonal(Mat_(mat)) missing[0] = pymissing if loc: loc[0] = asInt(pyloc) return FunctionEnd() cdef PetscErrorCode MatNorm_Python( PetscMat mat, NormType ntype, PetscReal *nrm, ) \ except IERR with gil: FunctionBegin(b"MatNorm_Python") cdef norm = PyMat(mat).norm if norm is None: return UNSUPPORTED(b"norm") retval = norm(Mat_(mat), ntype) nrm[0] = retval return FunctionEnd() cdef PetscErrorCode MatRealPart_Python( PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatRealPart_Python") cdef realPart = PyMat(mat).realPart if realPart is None: return UNSUPPORTED(b"realPart") realPart(Mat_(mat)) return FunctionEnd() cdef PetscErrorCode MatImagPart_Python( PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatImagPart_Python") cdef imagPart = PyMat(mat).imagPart if imagPart is None: return UNSUPPORTED(b"imagPart") imagPart(Mat_(mat)) return FunctionEnd() cdef PetscErrorCode MatConjugate_Python( PetscMat mat, ) \ except IERR with gil: FunctionBegin(b"MatConjugate_Python") cdef conjugate = PyMat(mat).conjugate if conjugate is None: return UNSUPPORTED(b"conjugate") conjugate(Mat_(mat)) return FunctionEnd() # -------------------------------------------------------------------- cdef extern from * nogil: struct _PCOps: PetscErrorCode (*destroy)(PetscPC) except IERR PetscErrorCode (*setup)(PetscPC) except IERR PetscErrorCode (*reset)(PetscPC) except IERR PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscPC) except IERR PetscErrorCode (*view)(PetscPC,PetscViewer) except IERR PetscErrorCode (*presolve)(PetscPC,PetscKSP,PetscVec,PetscVec) except IERR PetscErrorCode (*postsolve)(PetscPC,PetscKSP,PetscVec,PetscVec) except IERR PetscErrorCode (*apply)(PetscPC,PetscVec,PetscVec) except IERR PetscErrorCode (*applytranspose)(PetscPC,PetscVec,PetscVec) except IERR PetscErrorCode (*applysymmetricleft)(PetscPC,PetscVec,PetscVec) except IERR PetscErrorCode (*applysymmetricright)(PetscPC,PetscVec,PetscVec) except IERR ctypedef _PCOps *PCOps struct _p_PC: void *data PCOps ops @cython.internal cdef class _PyPC(_PyObj): pass cdef inline _PyPC PyPC(PetscPC pc): if pc != NULL and pc.data != NULL: return <_PyPC>pc.data else: return _PyPC.__new__(_PyPC) cdef public PetscErrorCode PCPythonGetContext(PetscPC pc, void **ctx) \ except IERR: FunctionBegin(b"PCPythonGetContext") PyPC(pc).getcontext(ctx) return FunctionEnd() cdef public PetscErrorCode PCPythonSetContext(PetscPC pc, void *ctx) \ except IERR: FunctionBegin(b"PCPythonSetContext") PyPC(pc).setcontext(ctx, PC_(pc)) return FunctionEnd() cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, char name[]) \ except IERR with gil: FunctionBegin(b"PCPythonSetType_PYTHON") if name == NULL: return FunctionEnd() # XXX cdef object ctx = createcontext(name) PCPythonSetContext(pc, ctx) PyPC(pc).setname(name) return FunctionEnd() cdef PetscErrorCode PCCreate_Python( PetscPC pc, ) \ except IERR with gil: FunctionBegin(b"PCCreate_Python") # cdef PCOps ops = pc.ops ops.reset = PCReset_Python ops.destroy = PCDestroy_Python ops.setup = PCSetUp_Python ops.setfromoptions = PCSetFromOptions_Python ops.view = PCView_Python ops.presolve = PCPreSolve_Python ops.postsolve = PCPostSolve_Python ops.apply = PCApply_Python ops.applytranspose = PCApplyTranspose_Python ops.applysymmetricleft = PCApplySymmetricLeft_Python ops.applysymmetricright = PCApplySymmetricRight_Python # CHKERR( PetscObjectComposeFunction( pc, b"PCPythonSetType_C", PCPythonSetType_PYTHON) ) # cdef ctx = PyPC(NULL) pc.data = ctx Py_INCREF(pc.data) return FunctionEnd() cdef PetscErrorCode PCDestroy_Python( PetscPC pc, ) \ except IERR with gil: FunctionBegin(b"PCDestroy_Python") CHKERR( PetscObjectComposeFunction( pc, b"PCPythonSetType_C", NULL) ) # if not Py_IsInitialized(): return FunctionEnd() try: addRef(pc) PCPythonSetContext(pc, NULL) finally: delRef(pc) Py_DECREF(pc.data) pc.data = NULL return FunctionEnd() cdef PetscErrorCode PCSetUp_Python( PetscPC pc, ) \ except IERR with gil: FunctionBegin(b"PCSetUp_Python") # cdef char name[2048] cdef PetscBool found = PETSC_FALSE if PyPC(pc).self is None: CHKERR( PetscOptionsGetString(NULL, getPrefix(pc), b"-pc_python_type", name,sizeof(name),&found) ) if found and name[0]: CHKERR( PCPythonSetType_PYTHON(pc,name) ) if PyPC(pc).self is None: return PetscSETERR(PETSC_ERR_USER, "Python context not set, call one of \n" " * PCPythonSetType(pc,\"[package.]module.class\")\n" " * PCSetFromOptions(pc) and pass option " "-pc_python_type [package.]module.class") # cdef setUp = PyPC(pc).setUp if setUp is not None: setUp(PC_(pc)) # cdef o = PyPC(pc) cdef PCOps ops = pc.ops if o.applyTranspose is None: ops.applytranspose = NULL if o.applySymmetricLeft is None: ops.applysymmetricleft = NULL if o.applySymmetricRight is None: ops.applysymmetricright = NULL # return FunctionEnd() cdef PetscErrorCode PCReset_Python( PetscPC pc, ) \ except IERR with gil: if getRef(pc) == 0: return 0 FunctionBegin(b"PCReset_Python") cdef reset = PyPC(pc).reset if reset is not None: reset(PC_(pc)) return FunctionEnd() cdef PetscErrorCode PCSetFromOptions_Python( PetscOptionItems *PetscOptionsObject, PetscPC pc, ) \ except IERR with gil: FunctionBegin(b"PCSetFromOptions_Python") # cdef char name[2048], *defval = PyPC(pc).getname() cdef PetscBool found = PETSC_FALSE cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject CHKERR( PetscOptionsString( b"-pc_python_type",b"Python [package.]module[.{class|function}]", b"PCPythonSetType",defval,name,sizeof(name),&found) ); opts; if found and name[0]: CHKERR( PCPythonSetType_PYTHON(pc,name) ) # cdef setFromOptions = PyPC(pc).setFromOptions if setFromOptions is not None: setFromOptions(PC_(pc)) return FunctionEnd() cdef PetscErrorCode PCView_Python( PetscPC pc, PetscViewer vwr, ) \ except IERR with gil: FunctionBegin(b"PCView_Python") viewcontext(PyPC(pc), vwr) cdef view = PyPC(pc).view if view is not None: view(PC_(pc), Viewer_(vwr)) return FunctionEnd() cdef PetscErrorCode PCPreSolve_Python( PetscPC pc, PetscKSP ksp, PetscVec b, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"PCPreSolve_Python") cdef preSolve = PyPC(pc).preSolve if preSolve is not None: preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) return FunctionEnd() cdef PetscErrorCode PCPostSolve_Python( PetscPC pc, PetscKSP ksp, PetscVec b, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"PCPostSolve_Python") cdef postSolve = PyPC(pc).postSolve if postSolve is not None: postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x)) return FunctionEnd() cdef PetscErrorCode PCApply_Python( PetscPC pc, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"PCApply_Python") cdef apply = PyPC(pc).apply apply(PC_(pc), Vec_(x), Vec_(y)) return FunctionEnd() cdef PetscErrorCode PCApplyTranspose_Python( PetscPC pc, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"PCApplyTranspose_Python") cdef applyTranspose = PyPC(pc).applyTranspose applyTranspose(PC_(pc), Vec_(x), Vec_(y)) return FunctionEnd() cdef PetscErrorCode PCApplySymmetricLeft_Python( PetscPC pc, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"PCApplySymmetricLeft_Python") cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y)) return FunctionEnd() cdef PetscErrorCode PCApplySymmetricRight_Python( PetscPC pc, PetscVec x, PetscVec y, ) \ except IERR with gil: FunctionBegin(b"PCApplySymmetricRight_Python") cdef applySymmetricRight = PyPC(pc).applySymmetricRight applySymmetricRight(PC_(pc), Vec_(x), Vec_(y)) return FunctionEnd() # -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum KSPNormType: KSP_NORM_NONE KSP_NORM_PRECONDITIONED KSP_NORM_UNPRECONDITIONED KSP_NORM_NATURAL ctypedef enum PCSide: PC_LEFT PC_RIGHT PC_SYMMETRIC ctypedef enum KSPConvergedReason: KSP_CONVERGED_ITERATING KSP_DIVERGED_ITS cdef extern from * nogil: struct _KSPOps: PetscErrorCode (*destroy)(PetscKSP) except IERR PetscErrorCode (*setup)(PetscKSP) except IERR PetscErrorCode (*reset)(PetscKSP) except IERR PetscErrorCode (*setfromoptions)(PetscOptionItems*, PetscKSP) except IERR PetscErrorCode (*view)(PetscKSP,PetscViewer) except IERR PetscErrorCode (*solve)(PetscKSP) except IERR PetscErrorCode (*buildsolution)(PetscKSP,PetscVec,PetscVec*) except IERR PetscErrorCode (*buildresidual)(PetscKSP,PetscVec,PetscVec,PetscVec*) except IERR ctypedef _KSPOps *KSPOps struct _p_KSP: void *data KSPOps ops PetscBool transpose_solve PetscInt iter"its",max_its"max_it" PetscReal norm"rnorm" KSPConvergedReason reason PetscErrorCode KSPCreate(MPI_Comm,PetscKSP*) PetscErrorCode KSPSetSupportedNorm(PetscKSP,KSPNormType,PCSide,PetscInt) PetscErrorCode KSPSolve(PetscKSP,PetscVec,PetscVec) PetscErrorCode KSPSetOperators(PetscKSP,PetscMat,PetscMat) cdef extern from * nogil: PetscErrorCode KSPGetRhs(PetscKSP,PetscVec*) PetscErrorCode KSPGetSolution(PetscKSP,PetscVec*) PetscErrorCode KSPBuildSolutionDefault(PetscKSP,PetscVec,PetscVec*) PetscErrorCode KSPBuildResidualDefault(PetscKSP,PetscVec,PetscVec,PetscVec*) PetscErrorCode KSPGetIterationNumber(PetscKSP,PetscInt*) PetscErrorCode KSPBuildSolution(PetscKSP,PetscVec,PetscVec*) PetscErrorCode KSPBuildResidual(PetscKSP,PetscVec,PetscVec,PetscVec*) PetscErrorCode KSPConverged(PetscKSP,PetscInt,PetscReal,KSPConvergedReason*) PetscErrorCode KSPLogHistory(PetscKSP,PetscReal) PetscErrorCode KSPMonitor(PetscKSP,PetscInt,PetscReal) @cython.internal cdef class _PyKSP(_PyObj): pass cdef inline _PyKSP PyKSP(PetscKSP ksp): if ksp != NULL and ksp.data != NULL: return <_PyKSP>ksp.data else: return _PyKSP.__new__(_PyKSP) cdef public PetscErrorCode KSPPythonGetContext(PetscKSP ksp, void **ctx) \ except IERR: FunctionBegin(b"KSPPythonGetContext") PyKSP(ksp).getcontext(ctx) return FunctionEnd() cdef public PetscErrorCode KSPPythonSetContext(PetscKSP ksp, void *ctx) \ except IERR: FunctionBegin(b"KSPPythonSetContext") PyKSP(ksp).setcontext(ctx, KSP_(ksp)) return FunctionEnd() cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, char name[]) \ except IERR with gil: FunctionBegin(b"KSPPythonSetType_PYTHON") if name == NULL: return FunctionEnd() # XXX cdef object ctx = createcontext(name) KSPPythonSetContext(ksp, ctx) PyKSP(ksp).setname(name) return FunctionEnd() cdef PetscErrorCode KSPCreate_Python( PetscKSP ksp, ) \ except IERR with gil: FunctionBegin(b"KSPCreate_Python") # cdef KSPOps ops = ksp.ops ops.reset = KSPReset_Python ops.destroy = KSPDestroy_Python ops.setup = KSPSetUp_Python ops.setfromoptions = KSPSetFromOptions_Python ops.view = KSPView_Python ops.solve = KSPSolve_Python ops.buildsolution = KSPBuildSolution_Python ops.buildresidual = KSPBuildResidual_Python # CHKERR( PetscObjectComposeFunction( ksp, b"KSPPythonSetType_C", KSPPythonSetType_PYTHON) ) # cdef ctx = PyKSP(NULL) ksp.data = ctx Py_INCREF(ksp.data) # CHKERR( KSPSetSupportedNorm( ksp, KSP_NORM_PRECONDITIONED, PC_LEFT, 3) ) CHKERR( KSPSetSupportedNorm( ksp, KSP_NORM_UNPRECONDITIONED, PC_RIGHT, 3) ) CHKERR( KSPSetSupportedNorm( ksp, KSP_NORM_UNPRECONDITIONED, PC_LEFT, 2) ) CHKERR( KSPSetSupportedNorm( ksp, KSP_NORM_PRECONDITIONED, PC_RIGHT, 2) ) CHKERR( KSPSetSupportedNorm( ksp, KSP_NORM_PRECONDITIONED, PC_SYMMETRIC, 1) ) CHKERR( KSPSetSupportedNorm( ksp, KSP_NORM_UNPRECONDITIONED, PC_SYMMETRIC, 1) ) return FunctionEnd() cdef PetscErrorCode KSPDestroy_Python( PetscKSP ksp, ) \ except IERR with gil: FunctionBegin(b"KSPDestroy_Python") CHKERR( PetscObjectComposeFunction( ksp, b"KSPPythonSetType_C", NULL)) # if not Py_IsInitialized(): return FunctionEnd() try: addRef(ksp) KSPPythonSetContext(ksp, NULL) finally: delRef(ksp) Py_DECREF(ksp.data) ksp.data = NULL return FunctionEnd() cdef PetscErrorCode KSPSetUp_Python( PetscKSP ksp, ) \ except IERR with gil: FunctionBegin(b"KSPSetUp_Python") # cdef char name[2048] cdef PetscBool found = PETSC_FALSE if PyKSP(ksp).self is None: CHKERR( PetscOptionsGetString(NULL, getPrefix(ksp), b"-ksp_python_type", name,sizeof(name),&found) ) if found and name[0]: CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) if PyKSP(ksp).self is None: return PetscSETERR(PETSC_ERR_USER, "Python context not set, call one of \n" " * KSPPythonSetType(ksp,\"[package.]module.class\")\n" " * KSPSetFromOptions(ksp) and pass option " "-ksp_python_type [package.]module.class") # cdef setUp = PyKSP(ksp).setUp if setUp is not None: setUp(KSP_(ksp)) return FunctionEnd() cdef PetscErrorCode KSPReset_Python( PetscKSP ksp, ) \ except IERR with gil: if getRef(ksp) == 0: return 0 FunctionBegin(b"KSPReset_Python") CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_sol",NULL) ) CHKERR( PetscObjectCompose(ksp,b"@ksp.vec_work_res",NULL) ) cdef reset = PyKSP(ksp).reset if reset is not None: reset(KSP_(ksp)) return FunctionEnd() cdef PetscErrorCode KSPSetFromOptions_Python( PetscOptionItems *PetscOptionsObject, PetscKSP ksp, ) \ except IERR with gil: FunctionBegin(b"KSPSetFromOptions_Python") # cdef char name[2048], *defval = PyKSP(ksp).getname() cdef PetscBool found = PETSC_FALSE cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject CHKERR( PetscOptionsString( b"-ksp_python_type",b"Python [package.]module[.{class|function}]", b"KSPPythonSetType",defval,name,sizeof(name),&found) ); opts; if found and name[0]: CHKERR( KSPPythonSetType_PYTHON(ksp,name) ) # cdef setFromOptions = PyKSP(ksp).setFromOptions if setFromOptions is not None: setFromOptions(KSP_(ksp)) return FunctionEnd() cdef PetscErrorCode KSPView_Python( PetscKSP ksp, PetscViewer vwr, ) \ except IERR with gil: FunctionBegin(b"KSPView_Python") viewcontext(PyKSP(ksp), vwr) cdef view = PyKSP(ksp).view if view is not None: view(KSP_(ksp), Viewer_(vwr)) return FunctionEnd() cdef PetscErrorCode KSPBuildSolution_Python( PetscKSP ksp, PetscVec v, PetscVec *V, ) \ except IERR with gil: FunctionBegin(b"KSPBuildSolution_Python") cdef PetscVec x = v cdef buildSolution = PyKSP(ksp).buildSolution if buildSolution is not None: if x == NULL: pass # XXX buildSolution(KSP_(ksp), Vec_(x)) if V != NULL: V[0] = x else: CHKERR( KSPBuildSolutionDefault(ksp, v, V) ) return FunctionEnd() cdef PetscErrorCode KSPBuildResidual_Python( PetscKSP ksp, PetscVec t, PetscVec v, PetscVec *V, ) \ except IERR with gil: FunctionBegin(b"KSPBuildResidual_Python") cdef buildResidual = PyKSP(ksp).buildResidual if buildResidual is not None: buildResidual(KSP_(ksp), Vec_(t), Vec_(v)) if V != NULL: V[0] = v else: CHKERR( KSPBuildResidualDefault(ksp, t, v, V) ) return FunctionEnd() cdef PetscErrorCode KSPSolve_Python( PetscKSP ksp, ) \ except IERR with gil: FunctionBegin(b"KSPSolve_Python") cdef PetscVec B = NULL, X = NULL CHKERR( KSPGetRhs(ksp,&B) ) CHKERR( KSPGetSolution(ksp,&X) ) # ksp.iter = 0 ksp.reason = KSP_CONVERGED_ITERATING # cdef solve = None if ksp.transpose_solve: solve = PyKSP(ksp).solveTranspose else: solve = PyKSP(ksp).solve if solve is not None: solve(KSP_(ksp),Vec_(B),Vec_(X)) else: KSPSolve_Python_default(ksp,B,X) return FunctionEnd() cdef PetscErrorCode KSPSolve_Python_default( PetscKSP ksp, PetscVec B, PetscVec X, ) \ except IERR with gil: FunctionBegin(b"KSPSolve_Python_default") # cdef PetscVec t = NULL CHKERR( PetscObjectQuery( ksp, b"@ksp.vec_work_sol", &t) ) if t == NULL: CHKERR( VecDuplicate(X,&t) ) CHKERR( PetscObjectCompose( ksp, b"@ksp.vec_work_sol", t) ) cdef PetscVec v = NULL CHKERR( PetscObjectQuery( ksp, b"@ksp.vec_work_res", &v) ) if v == NULL: CHKERR( VecDuplicate(B,&v) ) CHKERR( PetscObjectCompose( ksp, b"@ksp.vec_work_res", v) ) # cdef PetscInt its = 0 cdef PetscVec R = NULL cdef PetscReal rnorm = 0 # CHKERR( KSPBuildResidual(ksp,t,v,&R) ) CHKERR( VecNorm(R,NORM_2,&rnorm) ) # CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) CHKERR( KSPLogHistory(ksp,ksp.norm) ) CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) for its from 0 <= its < ksp.max_its: if ksp.reason: break KSPPreStep_Python(ksp) # KSPStep_Python(ksp,B,X) CHKERR( KSPBuildResidual(ksp,t,v,&R) ) CHKERR( VecNorm(R,NORM_2,&rnorm) ) ksp.iter += 1 # KSPPostStep_Python(ksp) CHKERR( KSPConverged(ksp,ksp.iter,rnorm,&ksp.reason) ) CHKERR( KSPLogHistory(ksp,ksp.norm) ) CHKERR( KSPMonitor(ksp,ksp.iter,ksp.norm) ) if ksp.iter == ksp.max_its: if ksp.reason == KSP_CONVERGED_ITERATING: ksp.reason = KSP_DIVERGED_ITS # return FunctionEnd() cdef PetscErrorCode KSPPreStep_Python( PetscKSP ksp, ) \ except IERR with gil: FunctionBegin(b"KSPPreStep_Python") cdef preStep = PyKSP(ksp).preStep if preStep is not None: preStep(KSP_(ksp)) return FunctionEnd() cdef PetscErrorCode KSPPostStep_Python( PetscKSP ksp, ) \ except IERR with gil: FunctionBegin(b"KSPPostStep_Python") cdef postStep = PyKSP(ksp).postStep if postStep is not None: postStep(KSP_(ksp)) return FunctionEnd() cdef PetscErrorCode KSPStep_Python( PetscKSP ksp, PetscVec B, PetscVec X, ) \ except IERR with gil: FunctionBegin(b"KSPStep_Python") cdef step = None if ksp.transpose_solve: step = PyKSP(ksp).stepTranspose if step is None: return UNSUPPORTED(b"stepTranspose") else: step = PyKSP(ksp).step if step is None: return UNSUPPORTED(b"step") step(KSP_(ksp),Vec_(B),Vec_(X)) return FunctionEnd() # -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum SNESConvergedReason: SNES_CONVERGED_ITERATING SNES_DIVERGED_MAX_IT cdef extern from * nogil: struct _SNESOps: PetscErrorCode (*destroy)(PetscSNES) except IERR PetscErrorCode (*setup)(PetscSNES) except IERR PetscErrorCode (*reset)(PetscSNES) except IERR PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscSNES) except IERR PetscErrorCode (*view)(PetscSNES,PetscViewer) except IERR PetscErrorCode (*solve)(PetscSNES) except IERR ctypedef _SNESOps *SNESOps struct _p_SNES: void *data SNESOps ops PetscInt iter,max_its,linear_its PetscReal norm,rtol,ttol SNESConvergedReason reason PetscVec vec_sol,vec_sol_update,vec_func PetscMat jacobian,jacobian_pre PetscKSP ksp PetscErrorCode SNESCreate(MPI_Comm,PetscSNES*) PetscErrorCode SNESSolve(PetscSNES,PetscVec,PetscVec) ctypedef PetscErrorCode (*SNESFunction)(PetscSNES,PetscVec,PetscVec,void*) PetscErrorCode SNESGetFunction(PetscSNES,PetscVec*,SNESFunction*,void*) PetscErrorCode SNESSetFunction(PetscSNES,PetscVec,SNESFunction,void*) int SNESComputeFunction(PetscSNES,PetscVec,PetscVec) ctypedef PetscErrorCode (*SNESJacobian)(PetscSNES,PetscVec,PetscMat,PetscMat,void*) PetscErrorCode SNESGetJacobian(PetscSNES,PetscMat*,PetscMat*,SNESJacobian*,void*) PetscErrorCode SNESSetJacobian(PetscSNES,PetscMat,PetscMat,SNESJacobian,void*) int SNESComputeJacobian(PetscSNES,PetscVec,PetscMat,PetscMat) SNESJacobian MatMFFDComputeJacobian PetscErrorCode SNESGetKSP(PetscSNES,PetscKSP*) PetscErrorCode SNESGetLineSearch(PetscSNES,PetscSNESLineSearch*) PetscErrorCode SNESLineSearchApply(PetscSNESLineSearch,PetscVec,PetscVec,PetscReal*,PetscVec) cdef extern from * nogil: PetscErrorCode SNESGetRhs(PetscSNES,PetscVec*) PetscErrorCode SNESGetSolution(PetscSNES,PetscVec*) PetscErrorCode SNESGetSolutionUpdate(PetscSNES,PetscVec*) PetscErrorCode SNESGetIterationNumber(PetscSNES,PetscInt*) PetscErrorCode SNESGetLinearSolveIterations(PetscSNES,PetscInt*) PetscErrorCode SNESGetConvergedReason(PetscSNES,SNESConvergedReason*) PetscErrorCode SNESConverged(PetscSNES,PetscInt,PetscReal,PetscReal,PetscReal,SNESConvergedReason*) PetscErrorCode SNESLogHistory(PetscSNES,PetscReal,PetscInt) PetscErrorCode SNESMonitor(PetscSNES,PetscInt,PetscReal) PetscErrorCode SNESSetFromOptions(PetscSNES) @cython.internal cdef class _PySNES(_PyObj): pass cdef inline _PySNES PySNES(PetscSNES snes): if snes != NULL and snes.data != NULL: return <_PySNES>snes.data else: return _PySNES.__new__(_PySNES) cdef public PetscErrorCode SNESPythonGetContext(PetscSNES snes, void **ctx) \ except IERR: FunctionBegin(b"SNESPythonGetContext ") PySNES(snes).getcontext(ctx) return FunctionEnd() cdef public PetscErrorCode SNESPythonSetContext(PetscSNES snes, void *ctx) \ except IERR: FunctionBegin(b"SNESPythonSetContext ") PySNES(snes).setcontext(ctx, SNES_(snes)) return FunctionEnd() cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, char name[]) \ except IERR with gil: FunctionBegin(b"SNESPythonSetType_PYTHON") if name == NULL: return FunctionEnd() # XXX cdef object ctx = createcontext(name) SNESPythonSetContext(snes, ctx) PySNES(snes).setname(name) return FunctionEnd() cdef PetscErrorCode SNESCreate_Python( PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESCreate_Python") # cdef SNESOps ops = snes.ops cdef PetscSNESLineSearch ls = NULL ops.reset = SNESReset_Python ops.destroy = SNESDestroy_Python ops.setup = SNESSetUp_Python ops.setfromoptions = SNESSetFromOptions_Python ops.view = SNESView_Python ops.solve = SNESSolve_Python # CHKERR( PetscObjectComposeFunction( snes, b"SNESPythonSetType_C", SNESPythonSetType_PYTHON) ) # cdef ctx = PySNES(NULL) snes.data = ctx # Ensure that the SNES has a linesearch object early enough that # it gets setFromOptions. CHKERR( SNESGetLineSearch(snes, &ls) ) Py_INCREF(snes.data) return FunctionEnd() cdef PetscErrorCode SNESDestroy_Python( PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESDestroy_Python") CHKERR( PetscObjectComposeFunction( snes, b"SNESPythonSetType_C", NULL) ) # if not Py_IsInitialized(): return FunctionEnd() try: addRef(snes) SNESPythonSetContext(snes, NULL) finally: delRef(snes) Py_DECREF(snes.data) snes.data = NULL return FunctionEnd() cdef PetscErrorCode SNESSetUp_Python( PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESSetUp_Python") # #SNESGetKSP(snes,&snes.ksp) # cdef char name[2048] cdef PetscBool found = PETSC_FALSE if PySNES(snes).self is None: CHKERR( PetscOptionsGetString(NULL, getPrefix(snes),b"-snes_python_type", name,sizeof(name),&found) ) if found and name[0]: CHKERR( SNESPythonSetType_PYTHON(snes,name) ) if PySNES(snes).self is None: return PetscSETERR(PETSC_ERR_USER, "Python context not set, call one of \n" " * SNESPythonSetType(snes,\"[package.]module.class\")\n" " * SNESSetFromOptions(snes) and pass option " "-snes_python_type [package.]module.class") # cdef setUp = PySNES(snes).setUp if setUp is not None: setUp(SNES_(snes)) return FunctionEnd() cdef PetscErrorCode SNESReset_Python( PetscSNES snes, ) \ except IERR with gil: if getRef(snes) == 0: return 0 FunctionBegin(b"SNESReset_Python") cdef reset = PySNES(snes).reset if reset is not None: reset(SNES_(snes)) return FunctionEnd() cdef PetscErrorCode SNESSetFromOptions_Python( PetscOptionItems *PetscOptionsObject, PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESSetFromOptions_Python") # cdef char name[2048], *defval = PySNES(snes).getname() cdef PetscBool found = PETSC_FALSE cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject CHKERR( PetscOptionsString( b"-snes_python_type",b"Python [package.]module[.{class|function}]", b"SNESPythonSetType",defval,name,sizeof(name),&found) ); opts; if found and name[0]: CHKERR( SNESPythonSetType_PYTHON(snes,name) ) # cdef setFromOptions = PySNES(snes).setFromOptions if setFromOptions is not None: setFromOptions(SNES_(snes)) return FunctionEnd() cdef PetscErrorCode SNESView_Python( PetscSNES snes, PetscViewer vwr, ) \ except IERR with gil: FunctionBegin(b"SNESView_Python") viewcontext(PySNES(snes), vwr) cdef view = PySNES(snes).view if view is not None: view(SNES_(snes), Viewer_(vwr)) return FunctionEnd() cdef PetscErrorCode SNESSolve_Python( PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESSolve_Python") cdef PetscVec b = NULL, x = NULL CHKERR( SNESGetRhs(snes,&b) ) CHKERR( SNESGetSolution(snes,&x) ) # snes.iter = 0 snes.reason = SNES_CONVERGED_ITERATING # cdef solve = PySNES(snes).solve if solve is not None: solve(SNES_(snes), Vec_(b) if b != NULL else None, Vec_(x)) else: SNESSolve_Python_default(snes) # return FunctionEnd() cdef PetscErrorCode SNESSolve_Python_default( PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESSolve_Python_default") # cdef PetscVec X=NULL, F=NULL, Y=NULL cdef PetscSNESLineSearch ls CHKERR( SNESGetSolution(snes,&X) ) CHKERR( SNESGetFunction(snes,&F,NULL,NULL) ) CHKERR( SNESGetSolutionUpdate(snes,&Y) ) CHKERR( SNESGetLineSearch(snes, &ls) ) cdef PetscInt its=0, lits=0 cdef PetscReal xnorm = 0.0 cdef PetscReal fnorm = 0.0 cdef PetscReal ynorm = 0.0 # CHKERR( VecSet(Y,0.0) ) CHKERR( SNESComputeFunction(snes,X,F) ) CHKERR( VecNorm(X,NORM_2,&xnorm) ) CHKERR( VecNorm(F,NORM_2,&fnorm) ) # CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) CHKERR( SNESLogHistory(snes,snes.norm,lits) ) CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) for its from 0 <= its < snes.max_its: if snes.reason: break SNESPreStep_Python(snes) # lits = -snes.linear_its SNESStep_Python(snes,X,F,Y) lits += snes.linear_its # CHKERR( SNESLineSearchApply(ls,X,F,&fnorm,Y) ) CHKERR( VecNorm(X,NORM_2,&xnorm) ) CHKERR( VecNorm(Y,NORM_2,&ynorm) ) snes.iter += 1 # SNESPostStep_Python(snes) CHKERR( SNESConverged(snes,snes.iter,xnorm,ynorm,fnorm,&snes.reason) ) CHKERR( SNESLogHistory(snes,snes.norm,lits) ) CHKERR( SNESMonitor(snes,snes.iter,snes.norm) ) if snes.iter == snes.max_its: if snes.reason == SNES_CONVERGED_ITERATING: snes.reason = SNES_DIVERGED_MAX_IT # return FunctionEnd() cdef PetscErrorCode SNESPreStep_Python( PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESPreStep_Python") cdef preStep = PySNES(snes).preStep if preStep is not None: preStep(SNES_(snes)) return FunctionEnd() cdef PetscErrorCode SNESPostStep_Python( PetscSNES snes, ) \ except IERR with gil: FunctionBegin(b"SNESPostStep_Python") cdef postStep = PySNES(snes).postStep if postStep is not None: postStep(SNES_(snes)) return FunctionEnd() cdef PetscErrorCode SNESStep_Python( PetscSNES snes, PetscVec X, PetscVec F, PetscVec Y, ) \ except IERR with gil: FunctionBegin(b"SNESStep_Python") cdef step = PySNES(snes).step if step is not None: step(SNES_(snes),Vec_(X),Vec_(F),Vec_(Y)) else: SNESStep_Python_default(snes,X,F,Y) return FunctionEnd() cdef PetscErrorCode SNESStep_Python_default( PetscSNES snes, PetscVec X, PetscVec F, PetscVec Y, ) \ except IERR with gil: FunctionBegin(b"SNESStep_Python_default") cdef PetscMat J = NULL, P = NULL cdef PetscInt lits = 0 CHKERR( SNESGetJacobian(snes,&J,&P,NULL,NULL) ) CHKERR( SNESComputeJacobian(snes,X,J,P) ) CHKERR( KSPSetOperators(snes.ksp,J,P) ) CHKERR( KSPSolve(snes.ksp,F,Y) ) CHKERR( KSPGetIterationNumber(snes.ksp,&lits) ) snes.linear_its += lits return FunctionEnd() # -------------------------------------------------------------------- cdef extern from * nogil: ctypedef enum TSProblemType: TS_LINEAR TS_NONLINEAR ctypedef enum TSConvergedReason: TS_CONVERGED_ITERATING TS_CONVERGED_TIME TS_CONVERGED_ITS TS_DIVERGED_NONLINEAR_SOLVE TS_DIVERGED_STEP_REJECTED cdef extern from * nogil: struct _TSOps: PetscErrorCode (*destroy)(PetscTS) except IERR PetscErrorCode (*setup)(PetscTS) except IERR PetscErrorCode (*reset)(PetscTS) except IERR PetscErrorCode (*setfromoptions)(PetscOptionItems*,PetscTS) except IERR PetscErrorCode (*view)(PetscTS,PetscViewer) except IERR PetscErrorCode (*step)(PetscTS) except IERR PetscErrorCode (*rollback)(PetscTS) except IERR PetscErrorCode (*interpolate)(PetscTS,PetscReal,PetscVec) except IERR PetscErrorCode (*evaluatestep)(PetscTS,PetscInt,PetscVec,PetscBool*) except IERR PetscErrorCode (*solve)(PetscTS) except IERR PetscErrorCode (*snesfunction)(PetscSNES,PetscVec,PetscVec,PetscTS) except IERR PetscErrorCode (*snesjacobian)(PetscSNES,PetscVec,PetscMat,PetscMat,PetscTS) except IERR ctypedef _TSOps *TSOps struct _TSUserOps: PetscErrorCode (*prestep)(PetscTS) except IERR PetscErrorCode (*prestage)(PetscTS,PetscReal) except IERR PetscErrorCode (*poststage)(PetscTS,PetscReal,PetscInt,PetscVec*) except IERR PetscErrorCode (*poststep)(PetscTS) except IERR PetscErrorCode (*rhsfunction)(PetscTS,PetscReal,PetscVec,PetscVec,void*) except IERR PetscErrorCode (*ifunction) (PetscTS,PetscReal,PetscVec,PetscVec,PetscVec,void*) except IERR PetscErrorCode (*rhsjacobian)(PetscTS,PetscReal,PetscVec,PetscMat,PetscMat,void*) except IERR PetscErrorCode (*ijacobian) (PetscTS,PetscReal,PetscVec,PetscVec,PetscReal,PetscMat,PetscMat,void*) except IERR ctypedef _TSUserOps *TSUserOps struct _p_TSAdapt ctypedef _p_TSAdapt *PetscTSAdapt "TSAdapt" struct _p_TS: void *data PetscDM dm PetscTSAdapt adapt TSOps ops TSUserOps userops TSProblemType problem_type PetscInt snes_its PetscInt ksp_its PetscInt reject PetscInt max_reject PetscInt steps PetscReal ptime PetscVec vec_sol PetscReal time_step PetscInt max_steps PetscReal max_time TSConvergedReason reason PetscSNES snes PetscBool usessnes cdef extern from * nogil: PetscErrorCode TSGetKSP(PetscTS,PetscKSP*) PetscErrorCode TSGetSNES(PetscTS,PetscSNES*) PetscErrorCode TSPreStep(PetscTS) PetscErrorCode TSPreStage(PetscTS,PetscReal) PetscErrorCode TSPostStage(PetscTS,PetscReal,PetscInt,PetscVec*) PetscErrorCode TSPostStep(PetscTS) PetscErrorCode TSAdaptCheckStage(PetscTSAdapt,PetscTS,PetscReal,PetscVec,PetscBool*) PetscErrorCode TSMonitor(PetscTS,PetscInt,PetscReal,PetscVec) PetscErrorCode TSComputeIFunction(PetscTS,PetscReal,PetscVec,PetscVec,PetscVec,PetscBool) PetscErrorCode TSComputeIJacobian(PetscTS,PetscReal,PetscVec,PetscVec,PetscReal,PetscMat,PetscMat,PetscBool) PetscErrorCode TSComputeI2Function(PetscTS,PetscReal,PetscVec,PetscVec,PetscVec,PetscVec) PetscErrorCode TSComputeI2Jacobian(PetscTS,PetscReal,PetscVec,PetscVec,PetscVec,PetscReal,PetscReal,PetscMat,PetscMat) PetscErrorCode SNESTSFormFunction(PetscSNES,PetscVec,PetscVec,void*) PetscErrorCode SNESTSFormJacobian(PetscSNES,PetscVec,PetscMat,PetscMat,void*) @cython.internal cdef class _PyTS(_PyObj): pass cdef inline _PyTS PyTS(PetscTS ts): if ts != NULL and ts.data != NULL: return <_PyTS>ts.data else: return _PyTS.__new__(_PyTS) cdef public PetscErrorCode TSPythonGetContext(PetscTS ts, void **ctx) \ except IERR: FunctionBegin(b"TSPythonGetContext") PyTS(ts).getcontext(ctx) return FunctionEnd() cdef public PetscErrorCode TSPythonSetContext(PetscTS ts, void *ctx) \ except IERR: FunctionBegin(b"TSPythonSetContext") PyTS(ts).setcontext(ctx, TS_(ts)) return FunctionEnd() cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, char name[]) \ except IERR with gil: FunctionBegin(b"TSPythonSetType_PYTHON") if name == NULL: return FunctionEnd() # XXX cdef object ctx = createcontext(name) TSPythonSetContext(ts, ctx) PyTS(ts).setname(name) return 0 cdef PetscErrorCode TSCreate_Python( PetscTS ts, ) \ except IERR with gil: FunctionBegin(b"TSCreate_Python") # cdef TSOps ops = ts.ops ops.reset = TSReset_Python ops.destroy = TSDestroy_Python ops.setup = TSSetUp_Python ops.setfromoptions = TSSetFromOptions_Python ops.view = TSView_Python ops.step = TSStep_Python ops.rollback = TSRollBack_Python ops.interpolate = TSInterpolate_Python ops.evaluatestep = TSEvaluateStep_Python ops.snesfunction = SNESTSFormFunction_Python ops.snesjacobian = SNESTSFormJacobian_Python # CHKERR( PetscObjectComposeFunction( ts, b"TSPythonSetType_C", TSPythonSetType_PYTHON) ) # ts.usessnes = PETSC_TRUE # cdef ctx = PyTS(NULL) ts.data = ctx Py_INCREF(ts.data) return FunctionEnd() cdef PetscErrorCode TSDestroy_Python( PetscTS ts, ) \ except IERR with gil: FunctionBegin(b"TSDestroy_Python") CHKERR( PetscObjectComposeFunction( ts, b"TSPythonSetType_C", NULL) ) # if not Py_IsInitialized(): return FunctionEnd() try: addRef(ts) TSPythonSetContext(ts, NULL) finally: delRef(ts) Py_DECREF(ts.data) ts.data = NULL return FunctionEnd() cdef PetscErrorCode TSSetUp_Python( PetscTS ts, ) \ except IERR with gil: FunctionBegin(b"TSSetUp_Python") # cdef PetscVec vec_update = NULL CHKERR( VecDuplicate(ts.vec_sol,&vec_update) ) CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", vec_update) ) CHKERR( VecDestroy(&vec_update) ) cdef PetscVec vec_dot = NULL CHKERR( VecDuplicate(ts.vec_sol,&vec_dot) ) CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", vec_dot) ) CHKERR( VecDestroy(&vec_dot) ) # cdef char name[2048] cdef PetscBool found = PETSC_FALSE if PyTS(ts).self is None: CHKERR( PetscOptionsGetString(NULL, getPrefix(ts),b"-ts_python_type", name,sizeof(name),&found) ) if found and name[0]: CHKERR( TSPythonSetType_PYTHON(ts,name) ) if PyTS(ts).self is None: return PetscSETERR(PETSC_ERR_USER, "Python context not set, call one of \n" " * TSPythonSetType(ts,\"[package.]module.class\")\n" " * TSSetFromOptions(ts) and pass option " "-ts_python_type [package.]module.class") # cdef setUp = PyTS(ts).setUp if setUp is not None: setUp(TS_(ts)) return FunctionEnd() cdef PetscErrorCode TSReset_Python( PetscTS ts, ) \ except IERR with gil: if getRef(ts) == 0: return 0 FunctionBegin(b"TSReset_Python") # CHKERR( PetscObjectCompose(ts, b"@ts.vec_update", NULL) ) CHKERR( PetscObjectCompose(ts, b"@ts.vec_dot", NULL) ) # cdef reset = PyTS(ts).reset if reset is not None: reset(TS_(ts)) return FunctionEnd() cdef PetscErrorCode TSSetFromOptions_Python( PetscOptionItems *PetscOptionsObject, PetscTS ts, ) \ except IERR with gil: FunctionBegin(b"TSSetFromOptions_Python") cdef char name[2048], *defval = PyTS(ts).getname() cdef PetscBool found = PETSC_FALSE cdef PetscOptionItems *opts "PetscOptionsObject" = PetscOptionsObject CHKERR( PetscOptionsString( b"-ts_python_type",b"Python [package.]module[.{class|function}]", b"TSPythonSetType",defval,name,sizeof(name),&found) ); opts; if found and name[0]: CHKERR( TSPythonSetType_PYTHON(ts,name) ) # cdef setFromOptions = PyTS(ts).setFromOptions if setFromOptions is not None: setFromOptions(TS_(ts)) CHKERR( SNESSetFromOptions(ts.snes) ) return FunctionEnd() cdef PetscErrorCode TSView_Python( PetscTS ts, PetscViewer vwr, ) \ except IERR with gil: FunctionBegin(b"TSView_Python") viewcontext(PyTS(ts), vwr) cdef view = PyTS(ts).view if view is not None: view(TS_(ts), Viewer_(vwr)) return FunctionEnd() cdef PetscErrorCode TSStep_Python( PetscTS ts, ) \ except IERR with gil: FunctionBegin(b"TSStep_Python") cdef step = PyTS(ts).step if step is not None: step(TS_(ts)) else: TSStep_Python_default(ts) return FunctionEnd() cdef PetscErrorCode TSRollBack_Python( PetscTS ts, ) \ except IERR with gil: FunctionBegin(b"TSRollBack_Python") cdef rollback = PyTS(ts).rollback if rollback is None: return UNSUPPORTED(b"rollback") rollback(TS_(ts)) return FunctionEnd() cdef PetscErrorCode TSInterpolate_Python( PetscTS ts, PetscReal t, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"TSInterpolate _Python") cdef interpolate = PyTS(ts).interpolate if interpolate is None: return UNSUPPORTED(b"interpolate") interpolate(TS_(ts),toReal(t),Vec_(x)) return FunctionEnd() cdef PetscErrorCode TSEvaluateStep_Python( PetscTS ts, PetscInt o, PetscVec x, PetscBool *flag, ) \ except IERR with gil: FunctionBegin(b"TSEvaluateStep _Python") cdef evaluatestep = PyTS(ts).evaluatestep if evaluatestep is None: return UNSUPPORTED(b"evaluatestep") cdef done = evaluatestep(TS_(ts),toInt(o),Vec_(x)) if flag != NULL: flag[0] = PETSC_TRUE if done else PETSC_FALSE elif not done: return PetscSETERR(PETSC_ERR_USER, "Cannot evaluate step") return FunctionEnd() cdef PetscErrorCode SNESTSFormFunction_Python( PetscSNES snes, PetscVec x, PetscVec f, PetscTS ts, ) \ except IERR with gil: # cdef formSNESFunction = PyTS(ts).formSNESFunction if formSNESFunction is not None: args = (SNES_(snes),Vec_(x),Vec_(f),TS_(ts)) formSNESFunction(args) return FunctionEnd() # cdef PetscVec dx = NULL CHKERR( PetscObjectQuery( ts, b"@ts.vec_dot", &dx) ) # cdef PetscReal t = ts.ptime + ts.time_step cdef PetscReal a = 1.0/ts.time_step CHKERR( VecCopy(ts.vec_sol,dx) ) CHKERR( VecAXPBY(dx,+a,-a,x) ) CHKERR( TSComputeIFunction(ts,t,x,dx,f,PETSC_FALSE) ) return FunctionEnd() cdef PetscErrorCode SNESTSFormJacobian_Python( PetscSNES snes, PetscVec x, PetscMat A, PetscMat B, PetscTS ts, ) \ except IERR with gil: # cdef formSNESJacobian = PyTS(ts).formSNESJacobian if formSNESJacobian is not None: args = (SNES_(snes),Vec_(x),Mat_(A),Mat_(B),TS_(ts)) formSNESJacobian(*args) return FunctionEnd() # cdef PetscVec dx = NULL CHKERR( PetscObjectQuery( ts, b"@ts.vec_dot", &dx) ) # cdef PetscReal t = ts.ptime + ts.time_step cdef PetscReal a = 1.0/ts.time_step CHKERR( VecCopy(ts.vec_sol,dx) ) CHKERR( VecAXPBY(dx,+a,-a,x) ) CHKERR( TSComputeIJacobian(ts,t,x,dx,a,A,B,PETSC_FALSE) ) return FunctionEnd() cdef PetscErrorCode TSSolveStep_Python( PetscTS ts, PetscReal t, PetscVec x, ) \ except IERR with gil: FunctionBegin(b"TSSolveStep_Python") # cdef solveStep = PyTS(ts).solveStep if solveStep is not None: solveStep(TS_(ts), t, Vec_(x)) return FunctionEnd() # cdef PetscInt nits = 0, lits = 0 CHKERR( SNESSolve(ts.snes, NULL, x) ) CHKERR( SNESGetIterationNumber(ts.snes,&nits) ) CHKERR( SNESGetLinearSolveIterations(ts.snes,&lits) ) ts.snes_its += nits ts.ksp_its += lits return FunctionEnd() cdef PetscErrorCode TSAdaptStep_Python( PetscTS ts, PetscReal t, PetscVec x, PetscReal *nextdt, PetscBool *stepok, ) \ except IERR with gil: FunctionBegin(b"TSAdaptStep_Python") nextdt[0] = ts.time_step stepok[0] = PETSC_TRUE # cdef adaptStep = PyTS(ts).adaptStep if adaptStep is None: return FunctionEnd() cdef object retval cdef double dt cdef bint ok retval = adaptStep(TS_(ts), t, Vec_(x)) if retval is None: pass elif isinstance(retval, float): dt = retval nextdt[0] = dt stepok[0] = PETSC_TRUE elif isinstance(retval, bool): ok = retval nextdt[0] = ts.time_step stepok[0] = PETSC_TRUE if ok else PETSC_FALSE else: dt, ok = retval nextdt[0] = dt stepok[0] = PETSC_TRUE if ok else PETSC_FALSE return FunctionEnd() cdef PetscErrorCode TSStep_Python_default( PetscTS ts, ) \ except IERR with gil: FunctionBegin(b"TSStep_Python_default") cdef PetscVec vec_update = NULL CHKERR( PetscObjectQuery( ts, b"@ts.vec_update", &vec_update) ) # cdef PetscInt r = 0 cdef PetscReal tt = ts.ptime cdef PetscReal dt = ts.time_step cdef PetscBool accept = PETSC_TRUE cdef PetscBool stageok = PETSC_TRUE for r from 0 <= r < ts.max_reject: tt = ts.ptime + ts.time_step CHKERR( VecCopy(ts.vec_sol,vec_update) ) CHKERR( TSPreStage(ts,tt+dt) ) TSSolveStep_Python(ts,tt,vec_update) CHKERR( TSPostStage(ts,tt+dt,0,&vec_update) ); CHKERR( TSAdaptCheckStage(ts.adapt,ts,tt+dt,vec_update,&stageok) ); if not stageok: ts.reject += 1 continue TSAdaptStep_Python(ts,tt,vec_update,&dt,&accept) if not accept: ts.time_step = dt ts.reject += 1 continue CHKERR( VecCopy(vec_update,ts.vec_sol) ) ts.ptime += ts.time_step ts.time_step = dt break if (not stageok or not accept) and ts.reason == 0: ts.reason = TS_DIVERGED_STEP_REJECTED return FunctionEnd() # -------------------------------------------------------------------- cdef PetscErrorCode PetscPythonMonitorSet_Python( PetscObject obj_p, const char *url_p, ) \ except IERR with gil: FunctionBegin(b"PetscPythonMonitorSet_Python") assert obj_p != NULL assert url_p != NULL assert url_p[0] != 0 # cdef PetscClassId classid = 0 CHKERR( PetscObjectGetClassId(obj_p,&classid) ) cdef type klass = PyPetscType_Lookup(classid) cdef Object ob = klass() ob.obj[0] = newRef(obj_p) # cdef url = bytes2str(url_p) if ':' in url: path, names = parse_url(url) else: path, names = url, 'monitor' module = load_module(path) for attr in names.split(','): monitor = getattr(module, attr) if isinstance(monitor, type): monitor = monitor(ob) ob.setMonitor(monitor) # return FunctionEnd() # -------------------------------------------------------------------- cdef extern from * nogil: const char* MATPYTHON '"python"' const char* KSPPYTHON '"python"' const char* PCPYTHON '"python"' const char* SNESPYTHON '"python"' const char* TSPYTHON '"python"' ctypedef PetscErrorCode MatCreateFunction (PetscMat) except IERR ctypedef PetscErrorCode PCCreateFunction (PetscPC) except IERR ctypedef PetscErrorCode KSPCreateFunction (PetscKSP) except IERR ctypedef PetscErrorCode SNESCreateFunction (PetscSNES) except IERR ctypedef PetscErrorCode TSCreateFunction (PetscTS) except IERR PetscErrorCode MatRegister (const char[],MatCreateFunction* ) PetscErrorCode PCRegister (const char[],PCCreateFunction* ) PetscErrorCode KSPRegister (const char[],KSPCreateFunction* ) PetscErrorCode SNESRegister (const char[],SNESCreateFunction*) PetscErrorCode TSRegister (const char[],TSCreateFunction* ) PetscErrorCode (*PetscPythonMonitorSet_C) \ (PetscObject, const char[]) except IERR cdef public PetscErrorCode PetscPythonRegisterAll() except IERR: FunctionBegin(b"PetscPythonRegisterAll") # Python subtypes CHKERR( MatRegister ( MATPYTHON, MatCreate_Python ) ) CHKERR( PCRegister ( PCPYTHON, PCCreate_Python ) ) CHKERR( KSPRegister ( KSPPYTHON, KSPCreate_Python ) ) CHKERR( SNESRegister( SNESPYTHON, SNESCreate_Python ) ) CHKERR( TSRegister ( TSPYTHON, TSCreate_Python ) ) # Python monitors global PetscPythonMonitorSet_C PetscPythonMonitorSet_C = PetscPythonMonitorSet_Python return FunctionEnd() # -------------------------------------------------------------------- # Cython 0.16 - Function prototypes for unused entries are not emitted # despite them being marked as 'public'. The lack of explicit extern # "C" binding causes trouble with C++ builds of PETSc. The bogus calls # below trick Cython to treat all these entries as used. if PETSC_FALSE: import_libpetsc4py() MatPythonGetContext(NULL,NULL) MatPythonSetContext(NULL,NULL) PCPythonGetContext(NULL,NULL) PCPythonSetContext(NULL,NULL) KSPPythonGetContext(NULL,NULL) KSPPythonSetContext(NULL,NULL) SNESPythonGetContext(NULL,NULL) SNESPythonSetContext(NULL,NULL) TSPythonGetContext(NULL,NULL) TSPythonSetContext(NULL,NULL) PetscPythonRegisterAll() # -------------------------------------------------------------------- petsc4py-3.15.1/src/libpetsc4py/custom.h0000644000175000017500000000607413750315427020310 0ustar balaybalay00000000000000#include "petsc/private/vecimpl.h" #include "petsc/private/matimpl.h" #include "petsc/private/pcimpl.h" #include "petsc/private/kspimpl.h" #include "petsc/private/snesimpl.h" #include "petsc/private/tsimpl.h" PETSC_EXTERN PetscErrorCode (*PetscPythonMonitorSet_C)(PetscObject,const char*); PETSC_STATIC_INLINE PetscErrorCode KSPLogHistory(KSP ksp,PetscReal rnorm) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(ksp,KSP_CLASSID,1); ierr = KSPLogResidualHistory(ksp,rnorm);CHKERRQ(ierr); PetscFunctionReturn(0); } PETSC_STATIC_INLINE PetscErrorCode SNESLogHistory(SNES snes,PetscReal rnorm,PetscInt lits) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(snes,SNES_CLASSID,1); ierr = SNESLogConvergenceHistory(snes,rnorm,lits);CHKERRQ(ierr); PetscFunctionReturn(0); } PETSC_STATIC_INLINE PetscErrorCode KSPConverged(KSP ksp, PetscInt iter,PetscReal rnorm, KSPConvergedReason *reason) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(ksp,KSP_CLASSID,1); if (reason) PetscValidPointer(reason,2); if (!iter) ksp->rnorm0 = rnorm; if (!iter) { ksp->reason = KSP_CONVERGED_ITERATING; ksp->ttol = PetscMax(rnorm*ksp->rtol,ksp->abstol); } if (ksp->converged) { ierr = (*ksp->converged)(ksp,iter,rnorm,&ksp->reason,ksp->cnvP);CHKERRQ(ierr); } else { ierr = KSPConvergedSkip(ksp,iter,rnorm,&ksp->reason,NULL);CHKERRQ(ierr); /*ierr = KSPConvergedDefault(ksp,iter,rnorm,&ksp->reason,NULL);CHKERRQ(ierr);*/ } ksp->rnorm = rnorm; if (reason) *reason = ksp->reason; PetscFunctionReturn(0); } PETSC_STATIC_INLINE PetscErrorCode SNESConverged(SNES snes, PetscInt iter,PetscReal xnorm,PetscReal ynorm,PetscReal fnorm, SNESConvergedReason *reason) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(snes,SNES_CLASSID,1); if (reason) PetscValidPointer(reason,2); if (!iter) { snes->reason = SNES_CONVERGED_ITERATING; snes->ttol = fnorm*snes->rtol; } if (snes->ops->converged) { ierr = (*snes->ops->converged)(snes,iter,xnorm,ynorm,fnorm,&snes->reason,snes->cnvP);CHKERRQ(ierr); } else { ierr = SNESConvergedSkip(snes,iter,xnorm,ynorm,fnorm,&snes->reason,0);CHKERRQ(ierr); /*ierr = SNESConvergedDefault(snes,iter,xnorm,ynorm,fnorm,&snes->reason,0);CHKERRQ(ierr);*/ } snes->norm = fnorm; if (reason) *reason = snes->reason; PetscFunctionReturn(0); } #ifndef PETSC_ERR_PYTHON #define PETSC_ERR_PYTHON ((PetscErrorCode)(-1)) #endif #define PetscERROR(comm,FUNCT,n,t,msg,arg) \ PetscError(comm,__LINE__,FUNCT,__FILE__,n,t,msg,arg) #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initlibpetsc4py(void); #else #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 PyMODINIT_FUNC PyInit_libpetsc4py(void); static void initlibpetsc4py(void) { PyObject *M, *m; M = PyImport_GetModuleDict(); if (!M) return; m = PyInit_libpetsc4py(); if (!m) return; PyDict_SetItemString(M, "libpetsc4py", m); Py_DECREF(m); } #endif petsc4py-3.15.1/src/lib/0000755000175000017500000000000014062764472015127 5ustar balaybalay00000000000000petsc4py-3.15.1/src/lib/__init__.py0000644000175000017500000001312414030740317017224 0ustar balaybalay00000000000000# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com # -------------------------------------------------------------------- """ Extension modules for different PETSc configurations. PETSc can be configured with different options (eg. debug/optimized, single/double precisionm, C/C++ compilers, external packages). Each configuration variant is associated to a name, frequently available as an environmental variable named ``PETSC_ARCH``. This package is a holds all the available variants of the PETSc extension module built agaist specific PETSc configurations. It also provides a convenience function using of the builtin ``imp`` module for easily importing any of the available extension modules depending on the value of a user-provided configuration name, the ``PETSC_ARCH`` environmental variable, or a configuration file. """ # -------------------------------------------------------------------- def ImportPETSc(arch=None): """ Import the PETSc extension module for a given configuration name. """ path, arch = getPathArchPETSc(arch) return Import('petsc4py', 'PETSc', path, arch) def getPathArchPETSc(arch=None): """ Undocumented. """ import sys, os path = os.path.abspath(os.path.dirname(__file__)) rcvar, rcfile = 'PETSC_ARCH', 'petsc.cfg' path, arch = getPathArch(path, arch, rcvar, rcfile) return (path, arch) # -------------------------------------------------------------------- def Import(pkg, name, path, arch): """ Import helper for PETSc-based extension modules. """ import sys, os, warnings # TODO: use 'importlib' module under Python 3 with warnings.catch_warnings(): warnings.filterwarnings("ignore") import imp def get_ext_suffix(): return imp.get_suffixes()[0][0] def import_module(pkg, name, path, arch): fullname = '%s.%s' % (pkg, name) pathlist = [os.path.join(path, arch)] f, fn, info = imp.find_module(name, pathlist) with f: return imp.load_module(fullname, f, fn, info) # test if extension module was already imported module = sys.modules.get('%s.%s' % (pkg, name)) filename = getattr(module, '__file__', '') if filename.endswith(get_ext_suffix()): # if 'arch' is None, do nothing; otherwise this # call may be invalid if extension module for # other 'arch' has been already imported. if arch is not None and arch != module.__arch__: raise ImportError("%s already imported" % module) return module # silence annoying Cython warning warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ndarray size changed") # import extension module from 'path/arch' directory module = import_module(pkg, name, path, arch) module.__arch__ = arch # save arch value setattr(sys.modules[pkg], name, module) return module def getPathArch(path, arch, rcvar='PETSC_ARCH', rcfile='petsc.cfg'): """ Undocumented. """ import os, warnings # path if not path: path = '.' elif os.path.isfile(path): path = os.path.dirname(path) elif not os.path.isdir(path): raise ValueError("invalid path: '%s'" % path) # arch if arch is not None: if not isinstance(arch, str): raise TypeError( "arch argument must be string") if not os.path.isdir(os.path.join(path, arch)): raise TypeError("invalid arch value: '%s'" % arch) return (path, arch) # helper function def arch_list(arch): arch = arch.strip().split(os.path.pathsep) arch = [a.strip() for a in arch if a] arch = [a for a in arch if a] return arch # try to get arch from the environment arch_env = arch_list(os.environ.get(rcvar, '')) for arch in arch_env: if os.path.isdir(os.path.join(path, arch)): return (path, arch) # configuration file if not os.path.isfile(rcfile): rcfile = os.path.join(path, rcfile) if not os.path.isfile(rcfile): # now point to continue return (path, '') # helper function def parse_rc(rcfile): with open(rcfile) as f: rcdata = f.read() lines = [ln.strip() for ln in rcdata.splitlines()] lines = [ln for ln in lines if not ln.startswith('#')] entries = [ln.split('=') for ln in lines if ln] entries = [(k.strip(), v.strip()) for k, v in entries] return dict(entries) # try to get arch from data in config file configrc = parse_rc(rcfile) arch_cfg = arch_list(configrc.get(rcvar, '')) for arch in arch_cfg: if os.path.isdir(os.path.join(path, arch)): if arch_env: warnings.warn( "ignored arch: '%s', using: '%s'" % \ (os.path.pathsep.join(arch_env), arch)) return (path, arch) # nothing good found return (path, '') def getInitArgs(args): """ Undocumented. """ import sys, shlex if args is None: args = [] elif isinstance(args, str): args = shlex.split(args) else: args = [str(a) for a in args] args = [a for a in args if a] if args and args[0].startswith('-'): sys_argv = getattr(sys, 'argv', None) sys_exec = getattr(sys, 'executable', 'python') if (sys_argv and sys_argv[0] and sys_argv[0] != '-c'): prog_name = sys_argv[0] else: prog_name = sys_exec args.insert(0, prog_name) return args # -------------------------------------------------------------------- petsc4py-3.15.1/src/lib/petsc.cfg0000644000175000017500000000006713750315427016724 0ustar balaybalay00000000000000PETSC_DIR = %(PETSC_DIR)s PETSC_ARCH = %(PETSC_ARCH)s petsc4py-3.15.1/src/include/0000755000175000017500000000000014062764472016004 5ustar balaybalay00000000000000petsc4py-3.15.1/src/include/petsc4py/0000755000175000017500000000000014062764472017557 5ustar balaybalay00000000000000petsc4py-3.15.1/src/include/petsc4py/__init__.pxd0000644000175000017500000000007013750315427022023 0ustar balaybalay00000000000000# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com petsc4py-3.15.1/src/include/petsc4py/petsc4py.PETSc.h0000644000175000017500000002551514062764416022426 0ustar balaybalay00000000000000/* Generated by Cython 0.29.22 */ #ifndef __PYX_HAVE__petsc4py__PETSc #define __PYX_HAVE__petsc4py__PETSc #include "Python.h" struct PyPetscCommObject; struct PyPetscObjectObject; struct PyPetscViewerObject; struct PyPetscRandomObject; struct PyPetscISObject; struct PyPetscLGMapObject; struct PyPetscSFObject; struct PyPetscVecObject; struct PyPetscFEObject; struct PyPetscQuadObject; struct PyPetscScatterObject; struct PyPetscSectionObject; struct PyPetscMatObject; struct PyPetscNullSpaceObject; struct PyPetscPCObject; struct PyPetscKSPObject; struct PyPetscSNESObject; struct PyPetscTSObject; struct PyPetscTAOObject; struct PyPetscAOObject; struct PyPetscDMObject; struct PyPetscDSObject; struct PyPetscPartitionerObject; struct PyPetscDMLabelObject; /* "petsc4py/PETSc.pxd":91 * # -------------------------------------------------------------------- * * ctypedef public api class Comm [ # <<<<<<<<<<<<<< * type PyPetscComm_Type, * object PyPetscCommObject, */ struct PyPetscCommObject { PyObject_HEAD MPI_Comm comm; int isdup; PyObject *base; }; typedef struct PyPetscCommObject PyPetscCommObject; /* "petsc4py/PETSc.pxd":99 * cdef object base * * ctypedef public api class Object [ # <<<<<<<<<<<<<< * type PyPetscObject_Type, * object PyPetscObjectObject, */ struct PyPetscObjectObject { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtab; PyObject *__weakref__; PyObject *__pyx___dummy__; PetscObject oval; PetscObject *obj; }; typedef struct PyPetscObjectObject PyPetscObjectObject; /* "petsc4py/PETSc.pxd":111 * cdef object get_dict(self) * * ctypedef public api class Viewer(Object) [ # <<<<<<<<<<<<<< * type PyPetscViewer_Type, * object PyPetscViewerObject, */ struct PyPetscViewerObject { struct PyPetscObjectObject __pyx_base; PetscViewer vwr; }; typedef struct PyPetscViewerObject PyPetscViewerObject; /* "petsc4py/PETSc.pxd":117 * cdef PetscViewer vwr * * ctypedef public api class Random(Object) [ # <<<<<<<<<<<<<< * type PyPetscRandom_Type, * object PyPetscRandomObject, */ struct PyPetscRandomObject { struct PyPetscObjectObject __pyx_base; PetscRandom rnd; }; typedef struct PyPetscRandomObject PyPetscRandomObject; /* "petsc4py/PETSc.pxd":123 * cdef PetscRandom rnd * * ctypedef public api class IS(Object) [ # <<<<<<<<<<<<<< * type PyPetscIS_Type, * object PyPetscISObject, */ struct PyPetscISObject { struct PyPetscObjectObject __pyx_base; IS iset; }; typedef struct PyPetscISObject PyPetscISObject; /* "petsc4py/PETSc.pxd":129 * cdef PetscIS iset * * ctypedef public api class LGMap(Object) [ # <<<<<<<<<<<<<< * type PyPetscLGMap_Type, * object PyPetscLGMapObject, */ struct PyPetscLGMapObject { struct PyPetscObjectObject __pyx_base; ISLocalToGlobalMapping lgm; }; typedef struct PyPetscLGMapObject PyPetscLGMapObject; /* "petsc4py/PETSc.pxd":135 * cdef PetscLGMap lgm * * ctypedef public api class SF(Object) [ # <<<<<<<<<<<<<< * type PyPetscSF_Type, * object PyPetscSFObject, */ struct PyPetscSFObject { struct PyPetscObjectObject __pyx_base; PetscSF sf; }; typedef struct PyPetscSFObject PyPetscSFObject; /* "petsc4py/PETSc.pxd":141 * cdef PetscSF sf * * ctypedef public api class Vec(Object) [ # <<<<<<<<<<<<<< * type PyPetscVec_Type, * object PyPetscVecObject, */ struct PyPetscVecObject { struct PyPetscObjectObject __pyx_base; Vec vec; }; typedef struct PyPetscVecObject PyPetscVecObject; /* "petsc4py/PETSc.pxd":147 * cdef PetscVec vec * * ctypedef public api class FE(Object) [ # <<<<<<<<<<<<<< * type PyPetscFE_Type, * object PyPetscFEObject, */ struct PyPetscFEObject { struct PyPetscObjectObject __pyx_base; PetscFE fe; }; typedef struct PyPetscFEObject PyPetscFEObject; /* "petsc4py/PETSc.pxd":153 * cdef PetscFE fe * * ctypedef public api class Quad(Object) [ # <<<<<<<<<<<<<< * type PyPetscQuad_Type, * object PyPetscQuadObject, */ struct PyPetscQuadObject { struct PyPetscObjectObject __pyx_base; PetscQuadrature quad; }; typedef struct PyPetscQuadObject PyPetscQuadObject; /* "petsc4py/PETSc.pxd":159 * cdef PetscQuadrature quad * * ctypedef public api class Scatter(Object) [ # <<<<<<<<<<<<<< * type PyPetscScatter_Type, * object PyPetscScatterObject, */ struct PyPetscScatterObject { struct PyPetscObjectObject __pyx_base; VecScatter sct; }; typedef struct PyPetscScatterObject PyPetscScatterObject; /* "petsc4py/PETSc.pxd":165 * cdef PetscScatter sct * * ctypedef public api class Section(Object) [ # <<<<<<<<<<<<<< * type PyPetscSection_Type, * object PyPetscSectionObject, */ struct PyPetscSectionObject { struct PyPetscObjectObject __pyx_base; PetscSection sec; }; typedef struct PyPetscSectionObject PyPetscSectionObject; /* "petsc4py/PETSc.pxd":171 * cdef PetscSection sec * * ctypedef public api class Mat(Object) [ # <<<<<<<<<<<<<< * type PyPetscMat_Type, * object PyPetscMatObject, */ struct PyPetscMatObject { struct PyPetscObjectObject __pyx_base; Mat mat; }; typedef struct PyPetscMatObject PyPetscMatObject; /* "petsc4py/PETSc.pxd":177 * cdef PetscMat mat * * ctypedef public api class NullSpace(Object) [ # <<<<<<<<<<<<<< * type PyPetscNullSpace_Type, * object PyPetscNullSpaceObject, */ struct PyPetscNullSpaceObject { struct PyPetscObjectObject __pyx_base; MatNullSpace nsp; }; typedef struct PyPetscNullSpaceObject PyPetscNullSpaceObject; /* "petsc4py/PETSc.pxd":183 * cdef PetscNullSpace nsp * * ctypedef public api class PC(Object) [ # <<<<<<<<<<<<<< * type PyPetscPC_Type, * object PyPetscPCObject, */ struct PyPetscPCObject { struct PyPetscObjectObject __pyx_base; PC pc; }; typedef struct PyPetscPCObject PyPetscPCObject; /* "petsc4py/PETSc.pxd":189 * cdef PetscPC pc * * ctypedef public api class KSP(Object) [ # <<<<<<<<<<<<<< * type PyPetscKSP_Type, * object PyPetscKSPObject, */ struct PyPetscKSPObject { struct PyPetscObjectObject __pyx_base; KSP ksp; }; typedef struct PyPetscKSPObject PyPetscKSPObject; /* "petsc4py/PETSc.pxd":195 * cdef PetscKSP ksp * * ctypedef public api class SNES(Object) [ # <<<<<<<<<<<<<< * type PyPetscSNES_Type, * object PyPetscSNESObject, */ struct PyPetscSNESObject { struct PyPetscObjectObject __pyx_base; SNES snes; }; typedef struct PyPetscSNESObject PyPetscSNESObject; /* "petsc4py/PETSc.pxd":201 * cdef PetscSNES snes * * ctypedef public api class TS(Object) [ # <<<<<<<<<<<<<< * type PyPetscTS_Type, * object PyPetscTSObject, */ struct PyPetscTSObject { struct PyPetscObjectObject __pyx_base; TS ts; }; typedef struct PyPetscTSObject PyPetscTSObject; /* "petsc4py/PETSc.pxd":207 * cdef PetscTS ts * * ctypedef public api class TAO(Object) [ # <<<<<<<<<<<<<< * type PyPetscTAO_Type, * object PyPetscTAOObject, */ struct PyPetscTAOObject { struct PyPetscObjectObject __pyx_base; Tao tao; }; typedef struct PyPetscTAOObject PyPetscTAOObject; /* "petsc4py/PETSc.pxd":213 * cdef PetscTAO tao * * ctypedef public api class AO(Object) [ # <<<<<<<<<<<<<< * type PyPetscAO_Type, * object PyPetscAOObject, */ struct PyPetscAOObject { struct PyPetscObjectObject __pyx_base; AO ao; }; typedef struct PyPetscAOObject PyPetscAOObject; /* "petsc4py/PETSc.pxd":219 * cdef PetscAO ao * * ctypedef public api class DM(Object) [ # <<<<<<<<<<<<<< * type PyPetscDM_Type, * object PyPetscDMObject, */ struct PyPetscDMObject { struct PyPetscObjectObject __pyx_base; DM dm; }; typedef struct PyPetscDMObject PyPetscDMObject; /* "petsc4py/PETSc.pxd":225 * cdef PetscDM dm * * ctypedef public api class DS(Object) [ # <<<<<<<<<<<<<< * type PyPetscDS_Type, * object PyPetscDSObject, */ struct PyPetscDSObject { struct PyPetscObjectObject __pyx_base; PetscDS ds; }; typedef struct PyPetscDSObject PyPetscDSObject; /* "petsc4py/PETSc.pxd":231 * cdef PetscDS ds * * ctypedef public api class Partitioner(Object) [ # <<<<<<<<<<<<<< * type PyPetscPartitioner_Type, * object PyPetscPartitionerObject, */ struct PyPetscPartitionerObject { struct PyPetscObjectObject __pyx_base; PetscPartitioner part; }; typedef struct PyPetscPartitionerObject PyPetscPartitionerObject; /* "petsc4py/PETSc.pxd":237 * cdef PetscPartitioner part * * ctypedef public api class DMLabel(Object) [ # <<<<<<<<<<<<<< * type PyPetscDMLabel_Type, * object PyPetscDMLabelObject, */ struct PyPetscDMLabelObject { struct PyPetscObjectObject __pyx_base; DMLabel dmlabel; }; typedef struct PyPetscDMLabelObject PyPetscDMLabelObject; #ifndef __PYX_HAVE_API__petsc4py__PETSc #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(_T) _T #endif __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscComm_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscObject_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscViewer_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscRandom_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscIS_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscLGMap_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscSF_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscVec_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscFE_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscQuad_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscScatter_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscSection_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscMat_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscNullSpace_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscPC_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscKSP_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscSNES_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscTS_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscTAO_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscAO_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscDM_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscDS_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscPartitioner_Type; __PYX_EXTERN_C DL_IMPORT(PyTypeObject) PyPetscDMLabel_Type; #endif /* !__PYX_HAVE_API__petsc4py__PETSc */ /* WARNING: the interface of the module init function changed in CPython 3.5. */ /* It now returns a PyModuleDef instance instead of a PyModule instance. */ #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initPETSc(void); #else PyMODINIT_FUNC PyInit_PETSc(void); #endif #endif /* !__PYX_HAVE__petsc4py__PETSc */ petsc4py-3.15.1/src/include/petsc4py/PETSc.pxd0000644000175000017500000001327513750315427021215 0ustar balaybalay00000000000000# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com # -------------------------------------------------------------------- cdef extern from "petsc.h": ctypedef struct _p_MPI_Comm ctypedef _p_MPI_Comm* MPI_Comm ctypedef struct _p_MPI_Op ctypedef _p_MPI_Op* MPI_Op ctypedef struct _p_MPI_Datatype ctypedef _p_MPI_Datatype* MPI_Datatype ctypedef struct _p_PetscObject ctypedef _p_PetscObject* PetscObject struct _p_PetscViewer ctypedef _p_PetscViewer* PetscViewer struct _p_PetscRandom ctypedef _p_PetscRandom* PetscRandom struct _p_IS ctypedef _p_IS* PetscIS "IS" struct _p_ISLocalToGlobalMapping ctypedef _p_ISLocalToGlobalMapping* PetscLGMap "ISLocalToGlobalMapping" struct _p_PetscSF ctypedef _p_PetscSF* PetscSF "PetscSF" struct _p_Vec ctypedef _p_Vec* PetscVec "Vec" struct _p_VecScatter ctypedef _p_VecScatter* PetscScatter "VecScatter" struct _p_PetscFE ctypedef _p_PetscFE* PetscFE "PetscFE" struct _p_PetscQuadrature ctypedef _p_PetscQuadrature* PetscQuadrature "PetscQuadrature" struct _p_DMLabel ctypedef _p_DMLabel* PetscDMLabel "DMLabel" struct _p_PetscSection ctypedef _p_PetscSection* PetscSection struct _p_Mat ctypedef _p_Mat* PetscMat "Mat" struct _p_MatNullSpace ctypedef _p_MatNullSpace* PetscNullSpace "MatNullSpace" struct _p_PC ctypedef _p_PC* PetscPC "PC" struct _p_KSP ctypedef _p_KSP* PetscKSP "KSP" struct _p_SNES ctypedef _p_SNES* PetscSNES "SNES" struct _p_SNESLineSearch ctypedef _p_SNESLineSearch* PetscSNESLineSearch "SNESLineSearch" struct _p_TS ctypedef _p_TS* PetscTS "TS" struct _p_TAO "_p_Tao" ctypedef _p_TAO* PetscTAO "Tao" struct _p_AO ctypedef _p_AO* PetscAO "AO" struct _p_DM ctypedef _p_DM* PetscDM "DM" struct _p_PetscDS ctypedef _p_PetscDS* PetscDS struct _p_PetscPartitioner ctypedef _p_PetscPartitioner* PetscPartitioner "PetscPartitioner" # -------------------------------------------------------------------- ctypedef public api class Comm [ type PyPetscComm_Type, object PyPetscCommObject, ]: cdef MPI_Comm comm cdef int isdup cdef object base ctypedef public api class Object [ type PyPetscObject_Type, object PyPetscObjectObject, ]: cdef __weakref__ cdef __dummy__ cdef PetscObject oval cdef PetscObject *obj cdef object get_attr(self, char name[]) cdef object set_attr(self, char name[], object attr) cdef object get_dict(self) ctypedef public api class Viewer(Object) [ type PyPetscViewer_Type, object PyPetscViewerObject, ]: cdef PetscViewer vwr ctypedef public api class Random(Object) [ type PyPetscRandom_Type, object PyPetscRandomObject, ]: cdef PetscRandom rnd ctypedef public api class IS(Object) [ type PyPetscIS_Type, object PyPetscISObject, ]: cdef PetscIS iset ctypedef public api class LGMap(Object) [ type PyPetscLGMap_Type, object PyPetscLGMapObject, ]: cdef PetscLGMap lgm ctypedef public api class SF(Object) [ type PyPetscSF_Type, object PyPetscSFObject, ]: cdef PetscSF sf ctypedef public api class Vec(Object) [ type PyPetscVec_Type, object PyPetscVecObject, ]: cdef PetscVec vec ctypedef public api class FE(Object) [ type PyPetscFE_Type, object PyPetscFEObject, ]: cdef PetscFE fe ctypedef public api class Quad(Object) [ type PyPetscQuad_Type, object PyPetscQuadObject, ]: cdef PetscQuadrature quad ctypedef public api class Scatter(Object) [ type PyPetscScatter_Type, object PyPetscScatterObject, ]: cdef PetscScatter sct ctypedef public api class Section(Object) [ type PyPetscSection_Type, object PyPetscSectionObject, ]: cdef PetscSection sec ctypedef public api class Mat(Object) [ type PyPetscMat_Type, object PyPetscMatObject, ]: cdef PetscMat mat ctypedef public api class NullSpace(Object) [ type PyPetscNullSpace_Type, object PyPetscNullSpaceObject, ]: cdef PetscNullSpace nsp ctypedef public api class PC(Object) [ type PyPetscPC_Type, object PyPetscPCObject, ]: cdef PetscPC pc ctypedef public api class KSP(Object) [ type PyPetscKSP_Type, object PyPetscKSPObject, ]: cdef PetscKSP ksp ctypedef public api class SNES(Object) [ type PyPetscSNES_Type, object PyPetscSNESObject, ]: cdef PetscSNES snes ctypedef public api class TS(Object) [ type PyPetscTS_Type, object PyPetscTSObject, ]: cdef PetscTS ts ctypedef public api class TAO(Object) [ type PyPetscTAO_Type, object PyPetscTAOObject, ]: cdef PetscTAO tao ctypedef public api class AO(Object) [ type PyPetscAO_Type, object PyPetscAOObject, ]: cdef PetscAO ao ctypedef public api class DM(Object) [ type PyPetscDM_Type, object PyPetscDMObject, ]: cdef PetscDM dm ctypedef public api class DS(Object) [ type PyPetscDS_Type, object PyPetscDSObject, ]: cdef PetscDS ds ctypedef public api class Partitioner(Object) [ type PyPetscPartitioner_Type, object PyPetscPartitionerObject, ]: cdef PetscPartitioner part ctypedef public api class DMLabel(Object) [ type PyPetscDMLabel_Type, object PyPetscDMLabelObject, ]: cdef PetscDMLabel dmlabel # -------------------------------------------------------------------- cdef MPI_Comm GetComm(object, MPI_Comm) except * cdef MPI_Comm GetCommDefault() cdef int PyPetscType_Register(int, type) except -1 cdef type PyPetscType_Lookup(int) # -------------------------------------------------------------------- petsc4py-3.15.1/src/include/petsc4py/numpy.h0000644000175000017500000000263514030740317021071 0ustar balaybalay00000000000000#ifndef PETSC4PY_NUMPY_H #define PETSC4PY_NUMPY_H #include "Python.h" /* #ifndef NPY_NO_DEPRECATED_API #define NPY_NO_DEPRECATED_API NPY_API_VERSION #endif */ #include "numpy/arrayobject.h" #ifndef NPY_ARRAY_ALIGNED #define NPY_ARRAY_ALIGNED NPY_ALIGNED #endif #ifndef NPY_ARRAY_WRITEABLE #define NPY_ARRAY_WRITEABLE NPY_WRITEABLE #endif #ifndef NPY_ARRAY_NOTSWAPPED #define NPY_ARRAY_NOTSWAPPED NPY_NOTSWAPPED #endif #ifndef NPY_ARRAY_CARRAY #define NPY_ARRAY_CARRAY NPY_CARRAY #endif #ifndef NPY_ARRAY_FARRAY #define NPY_ARRAY_FARRAY NPY_FARRAY #endif #include "petsc.h" # define NPY_PETSC_BOOL NPY_INT #if defined(PETSC_USE_64BIT_INDICES) # define NPY_PETSC_INT NPY_LONGLONG #else # define NPY_PETSC_INT NPY_INT #endif #if defined(PETSC_USE_REAL_SINGLE) # define NPY_PETSC_REAL NPY_FLOAT # define NPY_PETSC_COMPLEX NPY_CFLOAT #elif defined(PETSC_USE_REAL_DOUBLE) # define NPY_PETSC_REAL NPY_DOUBLE # define NPY_PETSC_COMPLEX NPY_CDOUBLE #elif defined(PETSC_USE_REAL_LONG_DOUBLE) # define NPY_PETSC_REAL NPY_LONGDOUBLE # define NPY_PETSC_COMPLEX NPY_CLONGDOUBLE #elif defined(PETSC_USE_REAL___FLOAT128) # define NPY_PETSC_REAL NPY_FLOAT128 # define NPY_PETSC_COMPLEX NPY_COMPLEX256 #else # error "unsupported real precision" #endif #if defined(PETSC_USE_COMPLEX) # define NPY_PETSC_SCALAR NPY_PETSC_COMPLEX #else # define NPY_PETSC_SCALAR NPY_PETSC_REAL #endif #endif /* !PETSC4PY_NUMPY_H */ petsc4py-3.15.1/src/include/petsc4py/__init__.pyx0000644000175000017500000000007013750315427022050 0ustar balaybalay00000000000000# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com petsc4py-3.15.1/src/include/petsc4py/petsc4py.i0000644000175000017500000004706013750315427021506 0ustar balaybalay00000000000000/* Author: Lisandro Dalcin */ /* Contact: dalcinl@gmail.com */ /* ---------------------------------------------------------------- */ %header %{#include "petsc4py/petsc4py.h"%} %init %{import_petsc4py();%} /* ---------------------------------------------------------------- */ %runtime %{ SWIGINTERNINLINE PyObject* SWIG_getattr_this(PyObject* obj) { if (!obj) return NULL; obj = PyObject_GetAttr(obj, SWIG_This()); if (!obj) PyErr_Clear(); return obj; } SWIGINTERNINLINE int SWIG_convert_ptr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) { int res = SWIG_ConvertPtr(obj, ptr, ty, flags); if (!SWIG_IsOK(res)) { PyObject* _this = SWIG_getattr_this(obj); res = SWIG_ConvertPtr(_this, ptr, ty, flags); Py_XDECREF(_this); } return res; } #undef SWIG_ConvertPtr #define SWIG_ConvertPtr(obj, pptr, type, flags) \ SWIG_convert_ptr(obj, pptr, type, flags) %} /* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */ /* PETSc Error Codes */ /* ---------------------------------------------------------------- */ %define %petsc4py_errt(Pkg, PyType, Type) %wrapper %{ #ifndef Py##Pkg##_ChkErrQ #define Py##Pkg##_ChkErrQ(ierr) \ do { \ if (ierr != 0) { \ Py##Pkg##PyType##_Set((ierr)); SWIG_fail; \ } \ } while (0) #endif /* defined Py##Pkg##_ChkErrQ */ %} %typemap(out,noblock=1) Type { Py##Pkg##_ChkErrQ($1); %set_output(VOID_Object); } %enddef /* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */ /* Numeric Types */ /* ---------------------------------------------------------------- */ %define SWIG_TYPECHECK_PETSC_INT SWIG_TYPECHECK_INT32 %enddef %define SWIG_TYPECHECK_PETSC_REAL SWIG_TYPECHECK_DOUBLE %enddef %define SWIG_TYPECHECK_PETSC_COMPLEX SWIG_TYPECHECK_CPLXDBL %enddef %define SWIG_TYPECHECK_PETSC_SCALAR SWIG_TYPECHECK_CPLXDBL %enddef /* PetscInt */ /* -------- */ %fragment(SWIG_From_frag(PetscInt64),"header", fragment=SWIG_From_frag(long long), fragment=SWIG_From_frag(long)) { SWIGINTERN SWIG_Object SWIG_From_dec(PetscInt64)(PetscInt64 val) { %#if PETSC_SIZEOF_LONG == 8 return SWIG_From(long)(%numeric_cast(val,long)); %#else return SWIG_From(long long)(%numeric_cast(val,long long)); %#endif } } %fragment(SWIG_AsVal_frag(PetscInt64),"header", fragment=SWIG_AsVal_frag(long long), fragment=SWIG_AsVal_frag(long)) { SWIGINTERN int SWIG_AsVal_dec(PetscInt64)(SWIG_Object obj, PetscInt64 *val) { %#if PETSC_SIZEOF_LONG == 8 long v; int res = SWIG_AsVal(long)(obj, &v); %#else long long v; int res = SWIG_AsVal(long long)(obj, &v); %#endif if (SWIG_IsOK(res) && val) if (val) *val = %numeric_cast(v,PetscInt64); return res; } } %fragment(SWIG_From_frag(PetscInt),"header", fragment=SWIG_From_frag(PetscInt64), fragment=SWIG_From_frag(int)) { %#if defined(PETSC_USE_64BIT_INDICES) %define_as(SWIG_From(PetscInt), SWIG_From(PetscInt64)) %#else %define_as(SWIG_From(PetscInt), SWIG_From(int)) %#endif } %fragment(SWIG_AsVal_frag(PetscInt),"header", fragment=SWIG_AsVal_frag(PetscInt64), fragment=SWIG_AsVal_frag(int)) { %#if defined(PETSC_USE_64BIT_INDICES) %define_as(SWIG_AsVal(PetscInt), SWIG_AsVal(PetscInt64)) %#else %define_as(SWIG_AsVal(PetscInt), SWIG_AsVal(int)) %#endif } /* PetscReal */ /* --------- */ %fragment(SWIG_From_frag(long double),"header", fragment=SWIG_From_frag(double)) { SWIGINTERN SWIG_Object SWIG_From_dec(long double)(long double val) { return SWIG_From(double)((double)val); } } %fragment(SWIG_AsVal_frag(long double),"header", fragment=SWIG_AsVal_frag(double)) { SWIGINTERN int SWIG_AsVal_dec(long double)(SWIG_Object obj, long double *val) { double v; int res = SWIG_AsVal(double)(obj, &v); if (SWIG_IsOK(res) && val) if (val) *val = %numeric_cast(v,long double); return res; } } %fragment(SWIG_From_frag(PetscReal),"header", fragment=SWIG_From_frag(long double), fragment=SWIG_From_frag(double), fragment=SWIG_From_frag(float)) { %#if defined(PETSC_USE_REAL_SINGLE) %define_as(SWIG_From(PetscReal), SWIG_From(float)) %#elif defined(PETSC_USE_REAL_DOUBLE) %define_as(SWIG_From(PetscReal), SWIG_From(double)) %#elif defined(PETSC_USE_REAL_LONG_DOUBLE) %define_as(SWIG_From(PetscReal), SWIG_From(long double)) %#endif } %fragment(SWIG_AsVal_frag(PetscReal),"header", fragment=SWIG_AsVal_frag(long double), fragment=SWIG_AsVal_frag(double), fragment=SWIG_AsVal_frag(float)) { %#if defined(PETSC_USE_REAL_SINGLE) %define_as(SWIG_AsVal(PetscReal), SWIG_AsVal(float)) %#elif defined(PETSC_USE_REAL_DOUBLE) %define_as(SWIG_AsVal(PetscReal), SWIG_AsVal(double)) %#elif defined(PETSC_USE_REAL_LONG_DOUBLE) %define_as(SWIG_AsVal(PetscReal), SWIG_AsVal(long double)) %#endif } /* PetscComplex */ /* ------------ */ %include complex.i %fragment(SWIG_From_frag(PetscComplex),"header", #ifdef __cplusplus fragment=SWIG_From_frag(std::complex), fragment=SWIG_From_frag(std::complex), fragment=SWIG_From_frag(std::complex)) #else fragment=SWIG_From_frag(long double complex), fragment=SWIG_From_frag(double complex), fragment=SWIG_From_frag(float complex)) #endif { %#if defined(PETSC_CLANGUAGE_CXX) %define_as(SWIG_From(PetscComplex), SWIG_From(std::complex)) %#else %define_as(SWIG_From(PetscComplex), SWIG_From(double complex)) %#endif } %fragment(SWIG_AsVal_frag(PetscComplex),"header", #ifdef __cplusplus fragment=SWIG_AsVal_frag(std::complex), fragment=SWIG_AsVal_frag(std::complex), fragment=SWIG_AsVal_frag(std::complex)) #else fragment=SWIG_AsVal_frag(long double complex), fragment=SWIG_AsVal_frag(double complex), fragment=SWIG_AsVal_frag(float complex)) #endif { %#if defined(PETSC_CLANGUAGE_CXX) %define_as(SWIG_AsVal(PetscComplex), SWIG_AsVal(std::complex)) %#else %define_as(SWIG_AsVal(PetscComplex), SWIG_AsVal(double complex)) %#endif } /* PetscScalar */ /* ----------- */ %fragment(SWIG_From_frag(PetscScalar), "header", fragment=SWIG_From_frag(PetscReal), fragment=SWIG_From_frag(PetscComplex)) { %#if defined(PETSC_USE_COMPLEX) %define_as(SWIG_From(PetscScalar), SWIG_From(PetscComplex)) %#else %define_as(SWIG_From(PetscScalar), SWIG_From(PetscReal)) %#endif } %fragment(SWIG_AsVal_frag(PetscScalar), "header", fragment=SWIG_AsVal_frag(PetscReal), fragment=SWIG_AsVal_frag(PetscComplex)) { %#if defined(PETSC_USE_COMPLEX) %define_as(SWIG_AsVal(PetscScalar), SWIG_AsVal(PetscComplex)) %#else %define_as(SWIG_AsVal(PetscScalar), SWIG_AsVal(PetscReal)) %#endif } %define %petsc4py_numt(Pkg, PyType, Type, CheckCode, UNUSED) %types(Type,Type*); %typemaps_primitive(%checkcode(CheckCode), Type); /* INPUT value typemap*/ %typemap(typecheck, precedence=%checkcode(CheckCode), fragment=SWIG_AsVal_frag(Type)) Type, const Type & { int res = SWIG_AsVal(Type)($input, 0); $1 = SWIG_CheckState(res); } %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(Type)) Type (Type val, int ecode = 0) { ecode = SWIG_AsVal(Type)($input, &val); if (!SWIG_IsOK(ecode)) %argument_fail(ecode, "$ltype", $symname, $argnum); $1 = %static_cast(val,$ltype); } %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(Type)) const Type & ($*ltype temp, Type val, int ecode = 0) { ecode = SWIG_AsVal(Type)($input, &val); if (!SWIG_IsOK(ecode)) %argument_fail(ecode, "$*ltype", $symname, $argnum); temp = %static_cast(val,$*ltype); $1 = &temp; } %typemap(freearg) Type, const Type & ""; /* INPUT pointer/reference typemap */ %typemap(typecheck, precedence=%checkcode(CheckCode), fragment=SWIG_AsVal_frag(Type)) Type *INPUT, Type &INPUT { int res = SWIG_AsVal(Type)($input, 0); $1 = SWIG_CheckState(res); } %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(Type)) Type *INPUT ($*ltype temp, int res = 0) { res = SWIG_AsVal(Type)($input, &temp); if (!SWIG_IsOK(res)) %argument_fail(res, "$*ltype",$symname, $argnum); $1 = &temp; } %typemap(in,noblock=1,fragment=SWIG_AsVal_frag(Type)) Type &INPUT ($*ltype temp, int res = 0) { res = SWIG_AsVal(Type)($input, &temp); if (!SWIG_IsOK(res)) %argument_fail(res, "$*ltype",$symname, $argnum); $1 = &temp; } %typemap(freearg) Type *INPUT, Type &INPUT ""; /* OUTPUT pointer/reference typemap */ %typemap(in,numinputs=0,noblock=1) Type *OUTPUT ($*ltype temp=0) "$1 = &temp;"; %typemap(in,numinputs=0,noblock=1) Type &OUTPUT ($*ltype temp=0) "$1 = &temp;"; %typemap(argout,noblock=1,fragment=SWIG_From_frag(Type)) Type* OUTPUT, Type &OUTPUT { %append_output(SWIG_From(Type)((*$1))); } %typemap(freearg) Type *OUTPUT ""; /* INOUT pointer/reference typemap */ %typemap(typecheck) Type *INOUT = Type *INPUT; %typemap(in) Type *INOUT = Type *INPUT; %typemap(argout) Type *INOUT = Type *OUTPUT; %typemap(freearg) Type *INOUT ""; %typemap(typecheck) Type &INOUT = Type &INPUT; %typemap(in) Type &INOUT = Type &INPUT; %typemap(argout) Type &INOUT = Type &OUTPUT; %typemap(freearg) Type &INOUT ""; /* default typemap for pointer argument */ %apply Type *OUTPUT { Type * } %enddef /* %petsc4py_numt */ /* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */ /* Enumerations */ /* ---------------------------------------------------------------- */ %define SWIG_TYPECHECK_PETSC_ENUM SWIG_TYPECHECK_INT32 %enddef %fragment(SWIG_From_frag(PetscEnum),"header", fragment=SWIG_From_frag(int)) { SWIGINTERN SWIG_Object SWIG_From_dec(PetscEnum)(PetscEnum val) { return SWIG_From(int)((PetscEnum)val); } } %fragment(SWIG_AsVal_frag(PetscEnum),"header", fragment=SWIG_AsVal_frag(int)) { SWIGINTERN int SWIG_AsVal_dec(PetscEnum)(SWIG_Object obj, PetscEnum *val) { int v; int res = SWIG_AsVal(int)(obj, &v); if (SWIG_IsOK(res) && val) *val = %static_cast(v,PetscEnum); return res; } } %typemaps_primitive(%checkcode(PETSC_ENUM), PetscEnum); %typemap(in,numinputs=0) PetscEnum *OUTPUT ($*ltype temp) "$1 = &temp;" %typemap(argout,noblock=1,fragment=SWIG_From_frag(PetscEnum)) PetscEnum *OUTPUT { %append_output(SWIG_From(PetscEnum)(%static_cast(*$1,PetscEnum))); } %apply PetscEnum *INPUT { PetscEnum const * } %typemap(argout) PetscEnum const* ""; %apply PetscEnum *OUTPUT { PetscEnum * } %define %petsc4py_enum(EnumType) %apply PetscEnum { EnumType } %apply PetscEnum * { EnumType * } %apply PetscEnum *INPUT { EnumType *INPUT } %apply PetscEnum *OUTPUT { EnumType *OUTPUT } %apply PetscEnum *INOUT { EnumType *INOUT } %enddef /* ---------------------------------------------------------------- */ %define %petsc4py_fragments(Pkg, PyType, Type, OBJECT_DEFAULT) /* AsVal */ /* ----- */ %fragment(SWIG_AsVal_frag(Type),"header") { SWIGINTERN int SWIG_AsVal_dec(Type)(SWIG_Object input, Type *v) { if (input == Py_None) { if (v) *v = OBJECT_DEFAULT; return SWIG_OK; } else if (PyObject_TypeCheck(input,&Py##Pkg##PyType##_Type)) { if (v) *v = Py##Pkg##PyType##_Get(input); return SWIG_OK; } else { void *argp = 0; int res = SWIG_ConvertPtr(input,&argp,%descriptor(p_##Type), 0); if (!SWIG_IsOK(res)) return res; if (!argp) return SWIG_ValueError; if (v) *v = *(%static_cast(argp,Type*)); return SWIG_OK; } } } /* AsPtr */ /* ----- */ %fragment(SWIG_AsPtr_frag(Type),"header", fragment=%fragment_name(GetPtr,Type)) { SWIGINTERN int SWIG_AsPtr_dec(Type)(SWIG_Object input, Type **p) { if (input == Py_None) { if (p) *p = 0; return SWIG_OK; } else if (PyObject_TypeCheck(input,&Py##Pkg##PyType##_Type)) { if (p) *p = Py##Pkg##PyType##_GetPtr(input); return SWIG_OK; } else { void *argp = 0; int res = SWIG_ConvertPtr(input,&argp,%descriptor(p_##Type), 0); if (!SWIG_IsOK(res)) return res; if (!argp) return SWIG_ValueError; if (p) *p = %static_cast(argp,Type*); return SWIG_OK; } } } /* From */ /* ---- */ %fragment(SWIG_From_frag(Type),"header") { SWIGINTERN SWIG_Object SWIG_From_dec(Type)(Type v) { return Py##Pkg##PyType##_New(v); } } %enddef /*petsc4py_fragments*/ /* ---------------------------------------------------------------- */ /* MPI Communicator */ /* ---------------------------------------------------------------- */ %define SWIG_TYPECHECK_MPI_COMM 600 %enddef %define %petsc4py_comm(Pkg, PyType, Type, CODE, OBJECT_NULL) /* pointer type */ %types(Type*); /* XXX find better way */ /* fragments */ %fragment(%fragment_name(GetPtr,MPI_Comm),"header") { } %petsc4py_fragments(Pkg, PyType, Type, PETSC_COMM_WORLD) /* base typemaps */ %typemaps_asvalfromn(%checkcode(MPI_COMM), Type); /* custom typemaps */ %typemap(check,noblock=1) Type { if ($1 == OBJECT_NULL) %argument_nullref("$ltype",$symname,$argnum); } %enddef /* %petsc4py_comm */ /* ---------------------------------------------------------------- */ /* PETSc Objects */ /* ---------------------------------------------------------------- */ %define SWIG_TYPECHECK_PETSC_OBJECT 500 %enddef %define SWIG_TYPECHECK_PETSC_VIEWER 501 %enddef %define SWIG_TYPECHECK_PETSC_RANDOM 502 %enddef %define SWIG_TYPECHECK_PETSC_IS 510 %enddef %define SWIG_TYPECHECK_PETSC_IS_LTOGM 511 %enddef %define SWIG_TYPECHECK_PETSC_SF 512 %enddef %define SWIG_TYPECHECK_PETSC_VEC 513 %enddef %define SWIG_TYPECHECK_PETSC_VEC_SCATTER 514 %enddef %define SWIG_TYPECHECK_PETSC_SECTION 515 %enddef %define SWIG_TYPECHECK_PETSC_MAT 520 %enddef %define SWIG_TYPECHECK_PETSC_MAT_NULLSPACE 521 %enddef %define SWIG_TYPECHECK_PETSC_KSP 530 %enddef %define SWIG_TYPECHECK_PETSC_PC 531 %enddef %define SWIG_TYPECHECK_PETSC_SNES 532 %enddef %define SWIG_TYPECHECK_PETSC_TS 533 %enddef %define SWIG_TYPECHECK_PETSC_TAO 534 %enddef %define SWIG_TYPECHECK_PETSC_AO 540 %enddef %define SWIG_TYPECHECK_PETSC_DM 541 %enddef %define SWIG_TYPECHECK_PETSC_DS 542 %enddef %define SWIG_TYPECHECK_PETSC_PARTITIONER 543 %enddef %define SWIG_TYPECHECK_PETSC_FE 550 %enddef %define SWIG_TYPECHECK_PETSC_QUADRATURE 551 %enddef %define SWIG_TYPECHECK_PETSC_DMLABEL 560 %enddef %define %petsc4py_objt(Pkg, PyType, Type, CODE) /* pointer type */ %types(Type*); /* XXX find better way */ /* fragments */ %fragment(%fragment_name(GetPtr,Type),"header") { /* XXX implement this better*/ %define_as(Py##Pkg##PyType##_GetPtr(ob), (Type *)PyPetscObject_GetPtr(ob)) } %petsc4py_fragments(Pkg, PyType, Type, NULL) /* base typemaps */ %typemaps_asptrfromn(%checkcode(CODE), Type); /* Custom Typemaps */ /* --------------- */ /* freearg */ %typemap(freearg) Type, Type*, Type& ""; /* check */ %typemap(check,noblock=1) Type INPUT { if ($1 == NULL) %argument_nullref("$type", $symname, $argnum); } /* input pointer */ %typemap(in,fragment=SWIG_AsPtr_frag(Type)) Type *INPUT (int res = SWIG_OLDOBJ) { Type *ptr = (Type *)0; res = SWIG_AsPtr(Type)($input, &ptr); if (!SWIG_IsOK(res)) { %argument_fail(res,"$type", $symname, $argnum); } $1 = ptr; } %typemap(check,noblock=1) Type *INPUT { if ($1 == NULL || (*$1) == NULL) %argument_nullref("$type", $symname, $argnum); } /* input reference */ %apply Type *INPUT { Type& } /* optional value */ %typemap(arginit) Type OPTIONAL "$1 = NULL;" %typemap(in,fragment=SWIG_AsPtr_frag(Type)) Type OPTIONAL (int res = 0) { Type *ptr = (Type *)0; res = SWIG_AsPtr(Type)($input, &ptr); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (ptr) $1 = *ptr; } /* optional reference */ %typemap(in,fragment=SWIG_AsPtr_frag(Type)) Type& OPTIONAL (int res = 0) { Type *ptr = (Type *)0; res = SWIG_AsPtr(Type)($input, &ptr); if (!SWIG_IsOK(res)) { %argument_fail(res, "$type", $symname, $argnum); } if (!ptr) %argument_nullref("$type", $symname, $argnum); $1 = ptr; if (SWIG_IsNewObj(res)) %delete(ptr); } %typemap(in,numinputs=0) Type* OUTREF, Type* OUTNEW ($*ltype temp = NULL) "$1 = &temp;"; %typemap(freearg) Type* OUTREF, Type* OUTNEW ""; %typemap(check) Type* OUTREF, Type* OUTNEW ""; %typemap(argout) Type* OUTREF { SWIG_Object o = Py##Pkg##PyType##_New(*$1); %append_output(o); } %typemap(argout) Type* OUTNEW { SWIG_Object o = Py##Pkg##PyType##_New(*$1); if (o!=NULL) PetscObjectDereference((PetscObject)(*$1)); %append_output(o); } %apply Type OPTIONAL { Type MAYBE } %apply Type& OPTIONAL { Type& MAYBE } %apply Type* OUTNEW { Type* NEWOBJ } %apply Type* OUTREF { Type* NEWREF } %enddef /* %petsc4py_objt */ /* ---------------------------------------------------------------- */ /* */ /* ---------------------------------------------------------------- */ %petsc4py_errt( Petsc, Error , PetscErrorCode ) %petsc4py_numt( Petsc , Int , PetscInt , PETSC_INT , 0 ) %petsc4py_numt( Petsc , Real , PetscReal , PETSC_REAL , 0 ) %petsc4py_numt( Petsc , Complex , PetscComplex , PETSC_COMPLEX , 0 ) %petsc4py_numt( Petsc , Scalar , PetscScalar , PETSC_SCALAR , 0 ) %petsc4py_comm( Petsc, Comm , MPI_Comm , MPI_COMM , MPI_COMM_NULL ) %petsc4py_objt( Petsc , Object , PetscObject , PETSC_OBJECT ) %petsc4py_objt( Petsc , Viewer , PetscViewer , PETSC_VIEWER ) %petsc4py_objt( Petsc , Random , PetscRandom , PETSC_RANDOM ) %petsc4py_objt( Petsc , IS , IS , PETSC_IS ) %petsc4py_objt( Petsc , LGMap , ISLocalToGlobalMapping , PETSC_IS_LTOGM ) %petsc4py_objt( Petsc , SF , PetscSF , PETSC_SF ) %petsc4py_objt( Petsc , Vec , Vec , PETSC_VEC ) %petsc4py_objt( Petsc , Scatter , VecScatter , PETSC_VEC_SCATTER ) %petsc4py_objt( Petsc , Section , PetscSection , PETSC_SECTION ) %petsc4py_objt( Petsc , Mat , Mat , PETSC_MAT ) %petsc4py_objt( Petsc , NullSpace , MatNullSpace , PETSC_MAT_NULLSPACE ) %petsc4py_objt( Petsc , KSP , KSP , PETSC_KSP ) %petsc4py_objt( Petsc , PC , PC , PETSC_PC ) %petsc4py_objt( Petsc , SNES , SNES , PETSC_SNES ) %petsc4py_objt( Petsc , TS , TS , PETSC_TS ) %petsc4py_objt( Petsc , TAO , Tao , PETSC_TAO ) %petsc4py_objt( Petsc , AO , AO , PETSC_AO ) %petsc4py_objt( Petsc , DM , DM , PETSC_DM ) %petsc4py_objt( Petsc , DS , PetscDS , PETSC_DS ) %petsc4py_objt( Petsc , Partitioner , PetscPartitioner , PETSC_PARTITIONER ) %petsc4py_objt( Petsc , FE , PetscFE , PETSC_FE ) %petsc4py_objt( Petsc , Quad , PetscQuadrature , PETSC_QUADRATURE ) %petsc4py_objt( Petsc , DMLabel , PetscDMLabel , PETSC_DMLABEL ) /* ---------------------------------------------------------------- */ /* * Local Variables: * mode: C * End: */ petsc4py-3.15.1/src/include/petsc4py/petsc4py.h0000644000175000017500000000047613750315427021505 0ustar balaybalay00000000000000/* Author: Lisandro Dalcin */ /* Contact: dalcinl@gmail.com */ #ifndef PETSC4PY_H #define PETSC4PY_H #include #include #include "petsc4py.PETSc_api.h" static int import_petsc4py(void) { if (import_petsc4py__PETSc() < 0) goto bad; return 0; bad: return -1; } #endif /* !PETSC4PY_H */ petsc4py-3.15.1/src/include/petsc4py/petsc4py.PETSc_api.h0000644000175000017500000006644614062764416023267 0ustar balaybalay00000000000000/* Generated by Cython 0.29.22 */ #ifndef __PYX_HAVE_API__petsc4py__PETSc #define __PYX_HAVE_API__petsc4py__PETSc #ifdef __MINGW64__ #define MS_WIN64 #endif #include "Python.h" #include "petsc4py.PETSc.h" static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Comm = 0; #define PyPetscComm_Type (*__pyx_ptype_8petsc4py_5PETSc_Comm) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Object = 0; #define PyPetscObject_Type (*__pyx_ptype_8petsc4py_5PETSc_Object) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Viewer = 0; #define PyPetscViewer_Type (*__pyx_ptype_8petsc4py_5PETSc_Viewer) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Random = 0; #define PyPetscRandom_Type (*__pyx_ptype_8petsc4py_5PETSc_Random) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_IS = 0; #define PyPetscIS_Type (*__pyx_ptype_8petsc4py_5PETSc_IS) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LGMap = 0; #define PyPetscLGMap_Type (*__pyx_ptype_8petsc4py_5PETSc_LGMap) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SF = 0; #define PyPetscSF_Type (*__pyx_ptype_8petsc4py_5PETSc_SF) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Vec = 0; #define PyPetscVec_Type (*__pyx_ptype_8petsc4py_5PETSc_Vec) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_FE = 0; #define PyPetscFE_Type (*__pyx_ptype_8petsc4py_5PETSc_FE) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Quad = 0; #define PyPetscQuad_Type (*__pyx_ptype_8petsc4py_5PETSc_Quad) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Scatter = 0; #define PyPetscScatter_Type (*__pyx_ptype_8petsc4py_5PETSc_Scatter) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Section = 0; #define PyPetscSection_Type (*__pyx_ptype_8petsc4py_5PETSc_Section) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Mat = 0; #define PyPetscMat_Type (*__pyx_ptype_8petsc4py_5PETSc_Mat) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_NullSpace = 0; #define PyPetscNullSpace_Type (*__pyx_ptype_8petsc4py_5PETSc_NullSpace) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_PC = 0; #define PyPetscPC_Type (*__pyx_ptype_8petsc4py_5PETSc_PC) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_KSP = 0; #define PyPetscKSP_Type (*__pyx_ptype_8petsc4py_5PETSc_KSP) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SNES = 0; #define PyPetscSNES_Type (*__pyx_ptype_8petsc4py_5PETSc_SNES) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TS = 0; #define PyPetscTS_Type (*__pyx_ptype_8petsc4py_5PETSc_TS) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAO = 0; #define PyPetscTAO_Type (*__pyx_ptype_8petsc4py_5PETSc_TAO) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_AO = 0; #define PyPetscAO_Type (*__pyx_ptype_8petsc4py_5PETSc_AO) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DM = 0; #define PyPetscDM_Type (*__pyx_ptype_8petsc4py_5PETSc_DM) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DS = 0; #define PyPetscDS_Type (*__pyx_ptype_8petsc4py_5PETSc_DS) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Partitioner = 0; #define PyPetscPartitioner_Type (*__pyx_ptype_8petsc4py_5PETSc_Partitioner) static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMLabel = 0; #define PyPetscDMLabel_Type (*__pyx_ptype_8petsc4py_5PETSc_DMLabel) static int (*__pyx_api_f_8petsc4py_5PETSc_PyPetscError_Set)(int) = 0; #define PyPetscError_Set __pyx_api_f_8petsc4py_5PETSc_PyPetscError_Set static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_New)(MPI_Comm) = 0; #define PyPetscComm_New __pyx_api_f_8petsc4py_5PETSc_PyPetscComm_New static MPI_Comm (*__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_Get)(PyObject *) = 0; #define PyPetscComm_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscComm_Get static MPI_Comm *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_GetPtr)(PyObject *) = 0; #define PyPetscComm_GetPtr __pyx_api_f_8petsc4py_5PETSc_PyPetscComm_GetPtr static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_New)(PetscObject) = 0; #define PyPetscObject_New __pyx_api_f_8petsc4py_5PETSc_PyPetscObject_New static PetscObject (*__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_Get)(PyObject *) = 0; #define PyPetscObject_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscObject_Get static PetscObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_GetPtr)(PyObject *) = 0; #define PyPetscObject_GetPtr __pyx_api_f_8petsc4py_5PETSc_PyPetscObject_GetPtr static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_New)(PetscViewer) = 0; #define PyPetscViewer_New __pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_New static PetscViewer (*__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_Get)(PyObject *) = 0; #define PyPetscViewer_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_New)(PetscRandom) = 0; #define PyPetscRandom_New __pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_New static PetscRandom (*__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_Get)(PyObject *) = 0; #define PyPetscRandom_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_New)(IS) = 0; #define PyPetscIS_New __pyx_api_f_8petsc4py_5PETSc_PyPetscIS_New static IS (*__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_Get)(PyObject *) = 0; #define PyPetscIS_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscIS_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_New)(ISLocalToGlobalMapping) = 0; #define PyPetscLGMap_New __pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_New static ISLocalToGlobalMapping (*__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_Get)(PyObject *) = 0; #define PyPetscLGMap_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_New)(PetscSF) = 0; #define PyPetscSF_New __pyx_api_f_8petsc4py_5PETSc_PyPetscSF_New static PetscSF (*__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_Get)(PyObject *) = 0; #define PyPetscSF_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscSF_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_New)(Vec) = 0; #define PyPetscVec_New __pyx_api_f_8petsc4py_5PETSc_PyPetscVec_New static Vec (*__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_Get)(PyObject *) = 0; #define PyPetscVec_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscVec_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_New)(VecScatter) = 0; #define PyPetscScatter_New __pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_New static VecScatter (*__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_Get)(PyObject *) = 0; #define PyPetscScatter_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_New)(PetscSection) = 0; #define PyPetscSection_New __pyx_api_f_8petsc4py_5PETSc_PyPetscSection_New static PetscSection (*__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_Get)(PyObject *) = 0; #define PyPetscSection_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscSection_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_New)(Mat) = 0; #define PyPetscMat_New __pyx_api_f_8petsc4py_5PETSc_PyPetscMat_New static Mat (*__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_Get)(PyObject *) = 0; #define PyPetscMat_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscMat_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_New)(PC) = 0; #define PyPetscPC_New __pyx_api_f_8petsc4py_5PETSc_PyPetscPC_New static PC (*__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_Get)(PyObject *) = 0; #define PyPetscPC_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscPC_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_New)(KSP) = 0; #define PyPetscKSP_New __pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_New static KSP (*__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_Get)(PyObject *) = 0; #define PyPetscKSP_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_New)(SNES) = 0; #define PyPetscSNES_New __pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_New static SNES (*__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_Get)(PyObject *) = 0; #define PyPetscSNES_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_New)(TS) = 0; #define PyPetscTS_New __pyx_api_f_8petsc4py_5PETSc_PyPetscTS_New static TS (*__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_Get)(PyObject *) = 0; #define PyPetscTS_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscTS_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_New)(Tao) = 0; #define PyPetscTAO_New __pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_New static Tao (*__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_Get)(PyObject *) = 0; #define PyPetscTAO_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_New)(AO) = 0; #define PyPetscAO_New __pyx_api_f_8petsc4py_5PETSc_PyPetscAO_New static AO (*__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_Get)(PyObject *) = 0; #define PyPetscAO_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscAO_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_New)(DM) = 0; #define PyPetscDM_New __pyx_api_f_8petsc4py_5PETSc_PyPetscDM_New static DM (*__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_Get)(PyObject *) = 0; #define PyPetscDM_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscDM_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscDS_New)(PetscDS) = 0; #define PyPetscDS_New __pyx_api_f_8petsc4py_5PETSc_PyPetscDS_New static PetscDS (*__pyx_api_f_8petsc4py_5PETSc_PyPetscDS_Get)(PyObject *) = 0; #define PyPetscDS_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscDS_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_New)(PetscPartitioner) = 0; #define PyPetscPartitioner_New __pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_New static PetscPartitioner (*__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_Get)(PyObject *) = 0; #define PyPetscPartitioner_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscFE_New)(PetscFE) = 0; #define PyPetscFE_New __pyx_api_f_8petsc4py_5PETSc_PyPetscFE_New static PetscFE (*__pyx_api_f_8petsc4py_5PETSc_PyPetscFE_Get)(PyObject *) = 0; #define PyPetscFE_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscFE_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscQuad_New)(PetscQuadrature) = 0; #define PyPetscQuad_New __pyx_api_f_8petsc4py_5PETSc_PyPetscQuad_New static PetscQuadrature (*__pyx_api_f_8petsc4py_5PETSc_PyPetscQuad_Get)(PyObject *) = 0; #define PyPetscQuad_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscQuad_Get static PyObject *(*__pyx_api_f_8petsc4py_5PETSc_PyPetscDMLabel_New)(DMLabel) = 0; #define PyPetscDMLabel_New __pyx_api_f_8petsc4py_5PETSc_PyPetscDMLabel_New static DMLabel (*__pyx_api_f_8petsc4py_5PETSc_PyPetscDMLabel_Get)(PyObject *) = 0; #define PyPetscDMLabel_Get __pyx_api_f_8petsc4py_5PETSc_PyPetscDMLabel_Get #if !defined(__Pyx_PyIdentifier_FromString) #if PY_MAJOR_VERSION < 3 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) #else #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) #endif #endif #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); if (!cobj) { PyErr_Format(PyExc_ImportError, "%.200s does not export expected C function %.200s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX >= 0x02070000 if (!PyCapsule_IsValid(cobj, sig)) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); goto bad; } tmp.p = PyCapsule_GetPointer(cobj, sig); #else {const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; s1 = desc; s2 = sig; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)", PyModule_GetName(module), funcname, sig, desc); goto bad; } tmp.p = PyCObject_AsVoidPtr(cobj);} #endif *f = tmp.fp; if (!(*f)) goto bad; Py_DECREF(d); return 0; bad: Py_XDECREF(d); return -1; } #endif #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif static int import_petsc4py__PETSc(void) { PyObject *module = 0; module = PyImport_ImportModule("petsc4py.PETSc"); if (!module) goto bad; if (__Pyx_ImportFunction(module, "PyPetscError_Set", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscError_Set, "int (int)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscComm_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_New, "PyObject *(MPI_Comm)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscComm_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_Get, "MPI_Comm (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscComm_GetPtr", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscComm_GetPtr, "MPI_Comm *(PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscObject_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_New, "PyObject *(PetscObject)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscObject_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_Get, "PetscObject (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscObject_GetPtr", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscObject_GetPtr, "PetscObject *(PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscViewer_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_New, "PyObject *(PetscViewer)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscViewer_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscViewer_Get, "PetscViewer (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscRandom_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_New, "PyObject *(PetscRandom)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscRandom_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscRandom_Get, "PetscRandom (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscIS_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_New, "PyObject *(IS)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscIS_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscIS_Get, "IS (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscLGMap_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_New, "PyObject *(ISLocalToGlobalMapping)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscLGMap_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscLGMap_Get, "ISLocalToGlobalMapping (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscSF_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_New, "PyObject *(PetscSF)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscSF_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSF_Get, "PetscSF (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscVec_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_New, "PyObject *(Vec)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscVec_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscVec_Get, "Vec (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscScatter_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_New, "PyObject *(VecScatter)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscScatter_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscScatter_Get, "VecScatter (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscSection_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_New, "PyObject *(PetscSection)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscSection_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSection_Get, "PetscSection (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscMat_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_New, "PyObject *(Mat)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscMat_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscMat_Get, "Mat (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscPC_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_New, "PyObject *(PC)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscPC_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPC_Get, "PC (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscKSP_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_New, "PyObject *(KSP)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscKSP_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscKSP_Get, "KSP (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscSNES_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_New, "PyObject *(SNES)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscSNES_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscSNES_Get, "SNES (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscTS_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_New, "PyObject *(TS)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscTS_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTS_Get, "TS (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscTAO_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_New, "PyObject *(Tao)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscTAO_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscTAO_Get, "Tao (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscAO_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_New, "PyObject *(AO)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscAO_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscAO_Get, "AO (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscDM_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_New, "PyObject *(DM)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscDM_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDM_Get, "DM (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscDS_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDS_New, "PyObject *(PetscDS)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscDS_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDS_Get, "PetscDS (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscPartitioner_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_New, "PyObject *(PetscPartitioner)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscPartitioner_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscPartitioner_Get, "PetscPartitioner (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscFE_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscFE_New, "PyObject *(PetscFE)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscFE_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscFE_Get, "PetscFE (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscQuad_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscQuad_New, "PyObject *(PetscQuadrature)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscQuad_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscQuad_Get, "PetscQuadrature (PyObject *)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscDMLabel_New", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDMLabel_New, "PyObject *(DMLabel)") < 0) goto bad; if (__Pyx_ImportFunction(module, "PyPetscDMLabel_Get", (void (**)(void))&__pyx_api_f_8petsc4py_5PETSc_PyPetscDMLabel_Get, "DMLabel (PyObject *)") < 0) goto bad; __pyx_ptype_8petsc4py_5PETSc_Comm = __Pyx_ImportType(module, "petsc4py.PETSc", "Comm", sizeof(struct PyPetscCommObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Comm) goto bad; __pyx_ptype_8petsc4py_5PETSc_Object = __Pyx_ImportType(module, "petsc4py.PETSc", "Object", sizeof(struct PyPetscObjectObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Object) goto bad; __pyx_ptype_8petsc4py_5PETSc_Viewer = __Pyx_ImportType(module, "petsc4py.PETSc", "Viewer", sizeof(struct PyPetscViewerObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Viewer) goto bad; __pyx_ptype_8petsc4py_5PETSc_Random = __Pyx_ImportType(module, "petsc4py.PETSc", "Random", sizeof(struct PyPetscRandomObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Random) goto bad; __pyx_ptype_8petsc4py_5PETSc_IS = __Pyx_ImportType(module, "petsc4py.PETSc", "IS", sizeof(struct PyPetscISObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_IS) goto bad; __pyx_ptype_8petsc4py_5PETSc_LGMap = __Pyx_ImportType(module, "petsc4py.PETSc", "LGMap", sizeof(struct PyPetscLGMapObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_LGMap) goto bad; __pyx_ptype_8petsc4py_5PETSc_SF = __Pyx_ImportType(module, "petsc4py.PETSc", "SF", sizeof(struct PyPetscSFObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_SF) goto bad; __pyx_ptype_8petsc4py_5PETSc_Vec = __Pyx_ImportType(module, "petsc4py.PETSc", "Vec", sizeof(struct PyPetscVecObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Vec) goto bad; __pyx_ptype_8petsc4py_5PETSc_FE = __Pyx_ImportType(module, "petsc4py.PETSc", "FE", sizeof(struct PyPetscFEObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_FE) goto bad; __pyx_ptype_8petsc4py_5PETSc_Quad = __Pyx_ImportType(module, "petsc4py.PETSc", "Quad", sizeof(struct PyPetscQuadObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Quad) goto bad; __pyx_ptype_8petsc4py_5PETSc_Scatter = __Pyx_ImportType(module, "petsc4py.PETSc", "Scatter", sizeof(struct PyPetscScatterObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Scatter) goto bad; __pyx_ptype_8petsc4py_5PETSc_Section = __Pyx_ImportType(module, "petsc4py.PETSc", "Section", sizeof(struct PyPetscSectionObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Section) goto bad; __pyx_ptype_8petsc4py_5PETSc_Mat = __Pyx_ImportType(module, "petsc4py.PETSc", "Mat", sizeof(struct PyPetscMatObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Mat) goto bad; __pyx_ptype_8petsc4py_5PETSc_NullSpace = __Pyx_ImportType(module, "petsc4py.PETSc", "NullSpace", sizeof(struct PyPetscNullSpaceObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_NullSpace) goto bad; __pyx_ptype_8petsc4py_5PETSc_PC = __Pyx_ImportType(module, "petsc4py.PETSc", "PC", sizeof(struct PyPetscPCObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_PC) goto bad; __pyx_ptype_8petsc4py_5PETSc_KSP = __Pyx_ImportType(module, "petsc4py.PETSc", "KSP", sizeof(struct PyPetscKSPObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_KSP) goto bad; __pyx_ptype_8petsc4py_5PETSc_SNES = __Pyx_ImportType(module, "petsc4py.PETSc", "SNES", sizeof(struct PyPetscSNESObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_SNES) goto bad; __pyx_ptype_8petsc4py_5PETSc_TS = __Pyx_ImportType(module, "petsc4py.PETSc", "TS", sizeof(struct PyPetscTSObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_TS) goto bad; __pyx_ptype_8petsc4py_5PETSc_TAO = __Pyx_ImportType(module, "petsc4py.PETSc", "TAO", sizeof(struct PyPetscTAOObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_TAO) goto bad; __pyx_ptype_8petsc4py_5PETSc_AO = __Pyx_ImportType(module, "petsc4py.PETSc", "AO", sizeof(struct PyPetscAOObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_AO) goto bad; __pyx_ptype_8petsc4py_5PETSc_DM = __Pyx_ImportType(module, "petsc4py.PETSc", "DM", sizeof(struct PyPetscDMObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_DM) goto bad; __pyx_ptype_8petsc4py_5PETSc_DS = __Pyx_ImportType(module, "petsc4py.PETSc", "DS", sizeof(struct PyPetscDSObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_DS) goto bad; __pyx_ptype_8petsc4py_5PETSc_Partitioner = __Pyx_ImportType(module, "petsc4py.PETSc", "Partitioner", sizeof(struct PyPetscPartitionerObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_Partitioner) goto bad; __pyx_ptype_8petsc4py_5PETSc_DMLabel = __Pyx_ImportType(module, "petsc4py.PETSc", "DMLabel", sizeof(struct PyPetscDMLabelObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_DMLabel) goto bad; Py_DECREF(module); module = 0; return 0; bad: Py_XDECREF(module); return -1; } #endif /* !__PYX_HAVE_API__petsc4py__PETSc */ petsc4py-3.15.1/src/include/compat/0000755000175000017500000000000014062764472017267 5ustar balaybalay00000000000000petsc4py-3.15.1/src/include/compat/hypre.h0000644000175000017500000000214013750315427020557 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_HYPRE_H #define PETSC4PY_COMPAT_HYPRE_H #if !defined(PETSC_HAVE_HYPRE) #define PetscPCHYPREError do { \ PetscFunctionBegin; \ SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"%s() requires HYPRE",PETSC_FUNCTION_NAME); \ PetscFunctionReturn(PETSC_ERR_SUP);} while (0) PetscErrorCode PCHYPREGetType(PETSC_UNUSED PC pc,PETSC_UNUSED const char *name[]){PetscPCHYPREError;} PetscErrorCode PCHYPRESetType(PETSC_UNUSED PC pc,PETSC_UNUSED const char name[]){PetscPCHYPREError;} PetscErrorCode PCHYPRESetDiscreteCurl(PETSC_UNUSED PC pc,PETSC_UNUSED Mat C){PetscPCHYPREError;} PetscErrorCode PCHYPRESetDiscreteGradient(PETSC_UNUSED PC pc,PETSC_UNUSED Mat G){PetscPCHYPREError;} PetscErrorCode PCHYPRESetAlphaPoissonMatrix(PETSC_UNUSED PC pc,PETSC_UNUSED Mat A){PetscPCHYPREError;} PetscErrorCode PCHYPRESetBetaPoissonMatrix(PETSC_UNUSED PC pc,PETSC_UNUSED Mat B){PetscPCHYPREError;} PetscErrorCode PCHYPRESetEdgeConstantVectors(PETSC_UNUSED PC pc,PETSC_UNUSED Vec ozz,PETSC_UNUSED Vec zoz,PETSC_UNUSED Vec zzo){PetscPCHYPREError;} #undef PetscPCHYPREError #endif #endif/*PETSC4PY_COMPAT_HYPRE_H*/ petsc4py-3.15.1/src/include/compat/tao.h0000644000175000017500000000303314030740317020205 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_TAO_H #define PETSC4PY_COMPAT_TAO_H #if defined(PETSC_USE_COMPLEX) #define PetscTaoError do { \ PetscFunctionBegin; \ SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"%s() not supported with complex scalars",PETSC_FUNCTION_NAME); \ PetscFunctionReturn(PETSC_ERR_SUP);} while (0) PetscErrorCode TaoLMVMSetH0(PETSC_UNUSED Tao tao,PETSC_UNUSED Mat mat) {PetscTaoError;} PetscErrorCode TaoLMVMGetH0(PETSC_UNUSED Tao tao,PETSC_UNUSED Mat *mat) {PetscTaoError;} PetscErrorCode TaoLMVMGetH0KSP(PETSC_UNUSED Tao tao,PETSC_UNUSED KSP *ksp) {PetscTaoError;} PetscErrorCode TaoBRGNGetSubsolver(PETSC_UNUSED Tao tao,PETSC_UNUSED Tao *subsolver) {PetscTaoError;} PetscErrorCode TaoBRGNSetRegularizerObjectiveAndGradientRoutine(PETSC_UNUSED Tao tao,PETSC_UNUSED PetscErrorCode (*func)(Tao,Vec,PetscReal*,Vec,void*),PETSC_UNUSED void *ctx) {PetscTaoError;} PetscErrorCode TaoBRGNSetRegularizerHessianRoutine(PETSC_UNUSED Tao tao,PETSC_UNUSED Mat H,PETSC_UNUSED PetscErrorCode (*func)(Tao,Vec,Mat,void*),PETSC_UNUSED void *ctx) {PetscTaoError;} PetscErrorCode TaoBRGNSetRegularizerWeight(PETSC_UNUSED Tao tao,PETSC_UNUSED PetscReal weight) {PetscTaoError;} PetscErrorCode TaoBRGNSetL1SmoothEpsilon(PETSC_UNUSED Tao tao,PETSC_UNUSED PetscReal epsilon) {PetscTaoError;} PetscErrorCode TaoBRGNSetDictionaryMatrix(PETSC_UNUSED Tao tao,PETSC_UNUSED Mat D) {PetscTaoError;} PetscErrorCode TaoBRGNGetDampingVector(PETSC_UNUSED Tao tao,PETSC_UNUSED Vec *d) {PetscTaoError;} #undef PetscTaoError #endif/*PETSC_USE_COMPLEX*/ #endif/*PETSC4PY_COMPAT_TAO_H*/ petsc4py-3.15.1/src/include/compat/hdf5.h0000644000175000017500000000206713750315427020266 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_HDF5_H #define PETSC4PY_COMPAT_HDF5_H #include #if !defined(PETSC_HAVE_HDF5) #define PetscViewerHDF5Error do { \ PetscFunctionBegin; \ SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"%s() requires HDF5",PETSC_FUNCTION_NAME); \ PetscFunctionReturn(PETSC_ERR_SUP);} while (0) PetscErrorCode PetscViewerHDF5PushGroup(PETSC_UNUSED PetscViewer vw,PETSC_UNUSED const char g[]){PetscViewerHDF5Error;} PetscErrorCode PetscViewerHDF5PopGroup(PETSC_UNUSED PetscViewer vw){PetscViewerHDF5Error;} PetscErrorCode PetscViewerHDF5GetGroup(PETSC_UNUSED PetscViewer vw,PETSC_UNUSED const char *g[]){PetscViewerHDF5Error;} PetscErrorCode PetscViewerHDF5SetTimestep(PETSC_UNUSED PetscViewer vw, PETSC_UNUSED PetscInt n){PetscViewerHDF5Error;} PetscErrorCode PetscViewerHDF5GetTimestep(PETSC_UNUSED PetscViewer vw, PETSC_UNUSED PetscInt*n){PetscViewerHDF5Error;} PetscErrorCode PetscViewerHDF5IncrementTimestep(PETSC_UNUSED PetscViewer vw){PetscViewerHDF5Error;} #undef PetscViewerHDF5Error #endif #endif/*PETSC4PY_COMPAT_HDF5_H*/ petsc4py-3.15.1/src/include/compat/mumps.h0000644000175000017500000000257713750315427020607 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_MUMPS_H #define PETSC4PY_COMPAT_MUMPS_H #include #if !defined(PETSC_HAVE_MUMPS) #define PetscMUMPSError do { \ PetscFunctionBegin; \ SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"%s() requires MUMPS",PETSC_FUNCTION_NAME); \ PetscFunctionReturn(PETSC_ERR_SUP);} while (0) PetscErrorCode MatMumpsSetIcntl(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscInt ival){PetscMUMPSError;} PetscErrorCode MatMumpsGetIcntl(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscInt *ival){PetscMUMPSError;} PetscErrorCode MatMumpsSetCntl(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscReal val){PetscMUMPSError;} PetscErrorCode MatMumpsGetCntl(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscReal *val){PetscMUMPSError;} PetscErrorCode MatMumpsGetInfo(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscInt *ival){PetscMUMPSError;} PetscErrorCode MatMumpsGetInfog(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscInt *ival){PetscMUMPSError;} PetscErrorCode MatMumpsGetRinfo(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscReal *val){PetscMUMPSError;} PetscErrorCode MatMumpsGetRinfog(PETSC_UNUSED Mat F,PETSC_UNUSED PetscInt icntl,PETSC_UNUSED PetscReal *val){PetscMUMPSError;} #undef PetscMUMPSError #endif #endif/*PETSC4PY_COMPAT_MUMPS_H*/ petsc4py-3.15.1/src/include/compat/cuda.h0000644000175000017500000000171114030740317020337 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_CUDA_H #define PETSC4PY_COMPAT_CUDA_H #if !defined(PETSC_HAVE_CUDA) #define PetscCUDAError do { \ PetscFunctionBegin; \ SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"%s() requires CUDA",PETSC_FUNCTION_NAME); \ PetscFunctionReturn(PETSC_ERR_SUP);} while (0) PetscErrorCode VecCreateSeqCUDAWithArrays(MPI_Comm comm,PetscInt bs,PetscInt n,const PetscScalar cpuarray[],const PetscScalar gpuarray[],Vec *V) {PetscCUDAError;} PetscErrorCode VecCreateMPICUDAWithArrays(MPI_Comm comm,PetscInt bs,PetscInt n,PetscInt N,const PetscScalar cpuarray[],const PetscScalar gpuarray[],Vec *vv) {PetscCUDAError;} PetscErrorCode VecCreateSeqCUDAWithArray(MPI_Comm comm,PetscInt bs,PetscInt n,const PetscScalar gpuarray[],Vec*V) {PetscCUDAError;} PetscErrorCode VecCreateMPICUDAWithArray(MPI_Comm comm,PetscInt bs,PetscInt n,PetscInt N,const PetscScalar gpuarray[],Vec*V) {PetscCUDAError;} #undef PetscCUDAError #endif #endif/*PETSC4PY_COMPAT_CUDA_H*/ petsc4py-3.15.1/src/include/compat/viennacl.h0000644000175000017500000000170314030740317021223 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_VIENNACL_H #define PETSC4PY_COMPAT_VIENNACL_H #if !defined(PETSC_HAVE_VIENNACL) #define PetscViennaCLError do { \ PetscFunctionBegin; \ SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"%s() requires ViennaCL",PETSC_FUNCTION_NAME); \ PetscFunctionReturn(PETSC_ERR_SUP);} while (0) PetscErrorCode VecCreateSeqViennaCLWithArrays(MPI_Comm comm,PetscInt bs,PetscInt n,PetscScalar cpuarray[],PetscScalar* viennaclvec,Vec *V) {PetscViennaCLError;} PetscErrorCode VecCreateMPIViennaCLWithArrays(MPI_Comm comm,PetscInt bs,PetscInt n,PetscInt N,PetscScalar cpuarray[],PetscScalar *viennaclvec,Vec *vv) {PetscViennaCLError;} #undef PetscViennaCLError # else PetscErrorCode VecCreateSeqViennaCLWithArrays(MPI_Comm,PetscInt,PetscInt,PetscScalar[],PetscScalar[],PetscVec*); PetscErrorCode VecCreateMPIViennaCLWithArrays(MPI_Comm,PetscInt,PetscInt,PetscInt,PetscScalar[],PetscScalar[],PetscVec*); #endif #endif/*PETSC4PY_COMPAT_VIENNACL_H*/ petsc4py-3.15.1/src/include/compat/mpi.h0000644000175000017500000001113713750315427020223 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_MPI_H #define PETSC4PY_COMPAT_MPI_H #if defined(OPEN_MPI) /* * The hackery below redefines the actuall calls to 'MPI_Init()' and * 'MPI_Init_thread()' in order to preload the main MPI dynamic * library with appropriate flags to 'dlopen()' ensuring global * availability of library symbols. */ #if !defined(OPENMPI_DLOPEN_LIBMPI) && defined(OMPI_MAJOR_VERSION) #if OMPI_MAJOR_VERSION >= 3 && OMPI_MAJOR_VERSION < 10 #define OPENMPI_DLOPEN_LIBMPI 0 #endif #endif #ifndef OPENMPI_DLOPEN_LIBMPI #define OPENMPI_DLOPEN_LIBMPI 1 #endif #if OPENMPI_DLOPEN_LIBMPI #if HAVE_DLOPEN #if HAVE_DLFCN_H #include #else #if defined(__linux__) #define RTLD_LAZY 0x00001 #define RTLD_NOW 0x00002 #define RTLD_LOCAL 0x00000 #define RTLD_GLOBAL 0x00100 #define RTLD_NOLOAD 0x00004 #define RTLD_NODELETE 0x01000 #define RTLD_DEEPBIND 0x00008 #elif defined(__APPLE__) #define RTLD_LAZY 0x1 #define RTLD_NOW 0x2 #define RTLD_LOCAL 0x4 #define RTLD_GLOBAL 0x8 #define RTLD_NOLOAD 0x10 #define RTLD_NODELETE 0x80 #define RTLD_FIRST 0x100 #elif defined(__CYGWIN__) #define RTLD_LAZY 1 #define RTLD_NOW 2 #define RTLD_LOCAL 0 #define RTLD_GLOBAL 4 #endif #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern void *dlopen(const char *, int); extern void *dlsym(void *, const char *); extern int dlclose(void *); extern char *dlerror(void); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif #ifndef RTLD_LAZY #define RTLD_LAZY 1 #endif #ifndef RTLD_NOW #define RTLD_NOW RTLD_LAZY #endif #ifndef RTLD_LOCAL #define RTLD_LOCAL 0 #endif #ifndef RTLD_GLOBAL #define RTLD_GLOBAL RTLD_LOCAL #endif /* static void * my_dlopen(const char *name, int mode) { void *handle; static int called = 0; if (!called) { called = 1; #if HAVE_DLFCN_H printf("HAVE_DLFCN_H: yes\n"); #else printf("HAVE_DLFCN_H: no\n"); #endif printf("\n"); printf("RTLD_LAZY: 0x%X\n", RTLD_LAZY); printf("RTLD_NOW: 0x%X\n", RTLD_NOW); printf("RTLD_LOCAL: 0x%X\n", RTLD_LOCAL); printf("RTLD_GLOBAL: 0x%X\n", RTLD_GLOBAL); #ifdef RTLD_NOLOAD printf("RTLD_NOLOAD: 0x%X\n", RTLD_NOLOAD); #endif printf("\n"); } handle = dlopen(name, mode); printf("dlopen(\"%s\",0x%X) -> %p\n", name, mode, handle); printf("dlerror() -> %s\n\n", dlerror()); return handle; } #define dlopen my_dlopen */ static void OPENMPI_dlopen_libmpi(void) { void *handle = 0; int mode = RTLD_NOW | RTLD_GLOBAL; #if defined(__APPLE__) /* macOS */ #ifdef RTLD_NOLOAD mode |= RTLD_NOLOAD; #endif #if defined(OMPI_MAJOR_VERSION) #if OMPI_MAJOR_VERSION == 3 if (!handle) handle = dlopen("libmpi.40.dylib", mode); #elif OMPI_MAJOR_VERSION == 2 if (!handle) handle = dlopen("libmpi.20.dylib", mode); #elif OMPI_MAJOR_VERSION == 1 && OMPI_MINOR_VERSION >= 10 if (!handle) handle = dlopen("libmpi.12.dylib", mode); #elif OMPI_MAJOR_VERSION == 1 && OMPI_MINOR_VERSION >= 6 if (!handle) handle = dlopen("libmpi.1.dylib", mode); #elif OMPI_MAJOR_VERSION == 1 if (!handle) handle = dlopen("libmpi.0.dylib", mode); #endif #endif if (!handle) handle = dlopen("libmpi.dylib", mode); #else /* GNU/Linux and others */ #ifdef RTLD_NOLOAD mode |= RTLD_NOLOAD; #endif #if defined(OMPI_MAJOR_VERSION) #if OMPI_MAJOR_VERSION >= 10 /* IBM Spectrum MPI */ if (!handle) handle = dlopen("libmpi_ibm.so.2", mode); if (!handle) handle = dlopen("libmpi_ibm.so.1", mode); if (!handle) handle = dlopen("libmpi_ibm.so", mode); #elif OMPI_MAJOR_VERSION == 3 if (!handle) handle = dlopen("libmpi.so.40", mode); #elif OMPI_MAJOR_VERSION == 2 if (!handle) handle = dlopen("libmpi.so.20", mode); #elif OMPI_MAJOR_VERSION == 1 && OMPI_MINOR_VERSION >= 10 if (!handle) handle = dlopen("libmpi.so.12", mode); #elif OMPI_MAJOR_VERSION == 1 && OMPI_MINOR_VERSION >= 6 if (!handle) handle = dlopen("libmpi.so.1", mode); #elif OMPI_MAJOR_VERSION == 1 if (!handle) handle = dlopen("libmpi.so.0", mode); #endif #endif if (!handle) handle = dlopen("libmpi.so", mode); #endif } static PetscErrorCode PetscInitialize_OpenMPI(int *argc,char ***args, const char file[], const char help[]) { OPENMPI_dlopen_libmpi(); return PetscInitialize(argc,args,file,help); } #undef PetscInitialize #define PetscInitialize PetscInitialize_OpenMPI #endif /* HAVE_DLOPEN */ #endif /* OPENMPI_DLOPEN_LIBMPI */ #endif /* OPEN_MPI */ #endif/*PETSC4PY_COMPAT_MPI_H*/ petsc4py-3.15.1/src/include/initpkg.h0000644000175000017500000000243414030740317017610 0ustar balaybalay00000000000000/* ------------------------------------------------------------------------- */ static PetscErrorCode PetscInitializePackageAll(void) { PetscErrorCode ierr; PetscFunctionBegin; ierr = PetscSysInitializePackage();CHKERRQ(ierr); ierr = PetscDrawInitializePackage();CHKERRQ(ierr); ierr = PetscViewerInitializePackage();CHKERRQ(ierr); ierr = PetscRandomInitializePackage();CHKERRQ(ierr); ierr = ISInitializePackage();CHKERRQ(ierr); ierr = AOInitializePackage();CHKERRQ(ierr); ierr = PFInitializePackage();CHKERRQ(ierr); ierr = PetscSFInitializePackage();CHKERRQ(ierr); ierr = VecInitializePackage();CHKERRQ(ierr); ierr = MatInitializePackage();CHKERRQ(ierr); ierr = PCInitializePackage();CHKERRQ(ierr); ierr = KSPInitializePackage();CHKERRQ(ierr); ierr = SNESInitializePackage();CHKERRQ(ierr); ierr = TaoInitializePackage();CHKERRQ(ierr); ierr = TSInitializePackage();CHKERRQ(ierr); ierr = PetscPartitionerInitializePackage();CHKERRQ(ierr); ierr = DMInitializePackage();CHKERRQ(ierr); ierr = PetscDSInitializePackage();CHKERRQ(ierr); ierr = PetscFEInitializePackage();CHKERRQ(ierr); PetscFunctionReturn(0); } /* ------------------------------------------------------------------------- */ /* Local variables: c-basic-offset: 2 indent-tabs-mode: nil End: */ petsc4py-3.15.1/src/include/scalar.h0000644000175000017500000000131613750315427017416 0ustar balaybalay00000000000000#ifndef PETSC4PY_SCALAR_H #define PETSC4PY_SCALAR_H #include "Python.h" #include "petsc.h" PETSC_STATIC_INLINE PyObject *PyPetscScalar_FromPetscScalar(PetscScalar s) { #if defined(PETSC_USE_COMPLEX) double a = (double)PetscRealPart(s); double b = (double)PetscImaginaryPart(s); return PyComplex_FromDoubles(a, b); #else return PyFloat_FromDouble((double)s); #endif } PETSC_STATIC_INLINE PetscScalar PyPetscScalar_AsPetscScalar(PyObject *o) { #if defined(PETSC_USE_COMPLEX) Py_complex cval = PyComplex_AsCComplex(o); PetscReal a = (PetscReal)cval.real; PetscReal b = (PetscReal)cval.imag; return a + b * PETSC_i; #else return (PetscScalar)PyFloat_AsDouble(o); #endif } #endif/*PETSC4PY_SCALAR_H*/ petsc4py-3.15.1/src/include/arraynpy.pxi0000644000175000017500000001667114030740317020371 0ustar balaybalay00000000000000# -------------------------------------------------------------------- cdef extern from "petsc4py/numpy.h": int import_array "_import_array" () except -1 ctypedef long npy_intp ctypedef extern class numpy.dtype [object PyArray_Descr]: pass ctypedef extern class numpy.ndarray [object PyArrayObject]: pass void* PyArray_DATA(ndarray) npy_intp PyArray_SIZE(ndarray) int PyArray_NDIM(ndarray) npy_intp* PyArray_DIMS(ndarray) npy_intp PyArray_DIM(ndarray, int) enum: NPY_INTP dtype PyArray_DescrFromType(int) object PyArray_TypeObjectFromType(int) enum: NPY_ARRAY_ALIGNED enum: NPY_ARRAY_WRITEABLE enum: NPY_ARRAY_NOTSWAPPED enum: NPY_ARRAY_CARRAY enum: NPY_ARRAY_FARRAY ndarray PyArray_FROM_O(object) ndarray PyArray_FROM_OT(object,int) ndarray PyArray_FROM_OTF(object,int,int) ndarray PyArray_Copy(ndarray) ndarray PyArray_ArangeObj(object,object,object,dtype) ndarray PyArray_EMPTY(int,npy_intp[],int,int) ndarray PyArray_ZEROS(int,npy_intp[],int,int) bint PyArray_ISCONTIGUOUS(ndarray) bint PyArray_ISFORTRAN(ndarray) ctypedef enum NPY_ORDER: NPY_ANYORDER NPY_CORDER NPY_FORTRANORDER ndarray PyArray_NewCopy(ndarray,NPY_ORDER) ctypedef struct PyObject ctypedef struct PyTypeObject ndarray PyArray_New(PyTypeObject*,int,npy_intp[],int,npy_intp[],void*,int,int,PyObject*) ndarray PyArray_SimpleNewFromData(int,npy_intp[],int,void*) cdef extern from "petsc4py/numpy.h": enum: NPY_INT enum: NPY_DOUBLE enum: NPY_PETSC_BOOL enum: NPY_PETSC_INT enum: NPY_PETSC_REAL enum: NPY_PETSC_SCALAR enum: NPY_PETSC_COMPLEX # -------------------------------------------------------------------- cdef inline ndarray asarray(object ob): return PyArray_FROM_O(ob) cdef inline ndarray arange(start, stop, stride): cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) return PyArray_ArangeObj(start, stop, stride, descr) # -------------------------------------------------------------------- cdef inline ndarray empty_i(PetscInt size): cdef npy_intp s = size return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) cdef inline ndarray empty_r(PetscInt size): cdef npy_intp s = size return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) cdef inline ndarray empty_s(PetscInt size): cdef npy_intp s = size return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) cdef inline ndarray empty_c(PetscInt size): cdef npy_intp s = size return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) cdef inline ndarray empty_p(PetscInt size): cdef npy_intp s = size return PyArray_EMPTY(1, &s, NPY_INTP, 0) # -------------------------------------------------------------------- cdef inline ndarray array_i(PetscInt size, const PetscInt* data): cdef npy_intp s = size cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) if data != NULL: memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) return ary cdef inline ndarray array_r(PetscInt size, const PetscReal* data): cdef npy_intp s = size cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) if data != NULL: memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) return ary cdef inline ndarray array_b(PetscInt size, const PetscBool* data): cdef npy_intp s = size cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) if data != NULL: memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) return ary cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): cdef npy_intp s = size cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) if data != NULL: memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) return ary # -------------------------------------------------------------------- cdef inline ndarray iarray(object ob, int typenum): cdef ndarray ary = PyArray_FROM_OTF( ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) if PyArray_ISCONTIGUOUS(ary): return ary if PyArray_ISFORTRAN(ary): return ary return PyArray_Copy(ary) cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): cdef ndarray ary = iarray(ob, NPY_PETSC_INT) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary # -------------------------------------------------------------------- cdef inline ndarray oarray(object ob, int typenum): cdef ndarray ary = PyArray_FROM_OTF( ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) if PyArray_ISCONTIGUOUS(ary): return ary if PyArray_ISFORTRAN(ary): return ary return PyArray_Copy(ary) cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): cdef ndarray ary = oarray(ob, NPY_PETSC_INT) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): cdef ndarray ary = oarray(ob, NPY_INTP) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary # -------------------------------------------------------------------- cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): cdef ndarray ary = PyArray_FROM_OTF( ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): cdef ndarray ary = PyArray_FROM_OTF( ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) if size != NULL: size[0] = PyArray_SIZE(ary) if data != NULL: data[0] = PyArray_DATA(ary) return ary # -------------------------------------------------------------------- petsc4py-3.15.1/src/include/pep3118.h0000644000175000017500000000565513750315427017264 0ustar balaybalay00000000000000#ifndef PETSC4PY_PEP3118_H #define PETSC4PY_PEP3118_H #include "Python.h" #include "petsc.h" #if defined(PETSC_USE_64BIT_INDICES) # define _PyPetsc_FMT_PETSC_INT "q" #else # define _PyPetsc_FMT_PETSC_INT "i" #endif #if defined(PETSC_USE_REAL_SINGLE) # define _PyPetsc_FMT_PETSC_REAL "f" # define _PyPetsc_FMT_PETSC_COMPLEX "Zf" #elif defined(PETSC_USE_REAL_DOUBLE) # define _PyPetsc_FMT_PETSC_REAL "d" # define _PyPetsc_FMT_PETSC_COMPLEX "Zd" #elif defined(PETSC_USE_REAL_LONG_DOUBLE) # define _PyPetsc_FMT_PETSC_REAL "g" # define _PyPetsc_FMT_PETSC_COMPLEX "Zg" #elif defined(PETSC_USE_REAL___FLOAT128) # define _PyPetsc_FMT_PETSC_REAL "g" # define _PyPetsc_FMT_PETSC_COMPLEX "Zg" #else # error "unsupported real precision" #endif #if defined(PETSC_USE_COMPLEX) # define _PyPetsc_FMT_PETSC_SCALAR _PyPetsc_FMT_PETSC_COMPLEX #else # define _PyPetsc_FMT_PETSC_SCALAR _PyPetsc_FMT_PETSC_REAL #endif PETSC_STATIC_INLINE int PyPetscBuffer_FillInfo(Py_buffer *view, void *buf, PetscInt count, char typechar, int readonly, int flags) { if (view == NULL) return 0; if (((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) && (readonly == 1)) { PyErr_SetString(PyExc_BufferError, "Object is not writable."); return -1; } view->buf = buf; switch (typechar) { case 'i': view->itemsize = sizeof(PetscInt); break; case 'r': view->itemsize = sizeof(PetscReal); break; case 's': view->itemsize = sizeof(PetscScalar); break; case 'c': view->itemsize = sizeof(PetscReal)*2; break; default: view->itemsize = 1; } view->len = count*view->itemsize; view->readonly = readonly; view->format = NULL; if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT) { switch (typechar) { case 'i': view->format = (char *) _PyPetsc_FMT_PETSC_INT; break; case 'r': view->format = (char *) _PyPetsc_FMT_PETSC_REAL; break; case 's': view->format = (char *) _PyPetsc_FMT_PETSC_SCALAR; break; case 'c': view->format = (char *) _PyPetsc_FMT_PETSC_COMPLEX; break; default: view->format = (char *) "B"; } } view->ndim = 0; view->shape = NULL; view->strides = NULL; view->suboffsets = NULL; view->internal = NULL; if ((flags & PyBUF_ND) == PyBUF_ND) { view->ndim = 1; view->internal = PyMem_Malloc(2*sizeof(Py_ssize_t)); if (!view->internal) { PyErr_NoMemory(); return -1; } view->shape = (Py_ssize_t *) view->internal; view->shape[0] = view->len/view->itemsize; if ((flags & PyBUF_STRIDES) == PyBUF_STRIDES) { view->strides = view->shape + 1; view->strides[0] = view->itemsize; } } return 0; } PETSC_STATIC_INLINE void PyPetscBuffer_Release(Py_buffer *view) { if (view == NULL) return; if (view->internal) PyMem_Free(view->internal); view->internal = NULL; } #undef _PyPetsc_FMT_PETSC_INT #undef _PyPetsc_FMT_PETSC_REAL #undef _PyPetsc_FMT_PETSC_SCALAR #undef _PyPetsc_FMT_PETSC_COMPLEX #endif/*!PETSC4PY_PEP3118_H*/ petsc4py-3.15.1/src/include/custom.h0000644000175000017500000004047314030740317017462 0ustar balaybalay00000000000000#ifndef PETSC4PY_CUSTOM_H #define PETSC4PY_CUSTOM_H #include "petsc/private/vecimpl.h" #include "petsc/private/matimpl.h" #include "petsc/private/kspimpl.h" #include "petsc/private/pcimpl.h" #include "petsc/private/snesimpl.h" #include "petsc/private/tsimpl.h" #include "petsc/private/taoimpl.h" #include "petsc/private/sfimpl.h" /* ---------------------------------------------------------------- */ #ifndef PETSC_ERR_PYTHON #define PETSC_ERR_PYTHON ((PetscErrorCode)(-1)) #endif /* ---------------------------------------------------------------- */ typedef PetscErrorCode (*PetscErrorHandlerFunction) (MPI_Comm,int,const char*,const char*, PetscErrorCode,PetscErrorType,const char*,void*); #define PetscTBEH PetscTraceBackErrorHandler /* ---------------------------------------------------------------- */ #if !defined(PETSC_USE_LOG) static PetscStageLog petsc_stageLog = NULL; #endif #define PetscCLASSID(stageLog,index) \ ((stageLog)->classLog->classInfo[(index)].classid) static PetscErrorCode PetscLogStageFindId(const char name[], PetscLogStage *stageid) { int s; PetscStageLog stageLog = 0; PetscBool match = PETSC_FALSE; PetscErrorCode ierr; PetscFunctionBegin; PetscValidCharPointer(name,1); PetscValidIntPointer(stageid,2); *stageid = -1; if (!(stageLog=petsc_stageLog)) PetscFunctionReturn(0); /* logging is off ? */ for (s = 0; s < stageLog->numStages; s++) { const char *sname = stageLog->stageInfo[s].name; ierr = PetscStrcasecmp(sname, name, &match);CHKERRQ(ierr); if (match) { *stageid = s; break; } } PetscFunctionReturn(0); } static PetscErrorCode PetscLogClassFindId(const char name[], PetscClassId *classid) { int c; PetscStageLog stageLog = 0; PetscBool match = PETSC_FALSE; PetscErrorCode ierr; PetscFunctionBegin; PetscValidCharPointer(name,1); PetscValidIntPointer(classid,2); *classid = -1; if (!(stageLog=petsc_stageLog)) PetscFunctionReturn(0); /* logging is off ? */ for (c = 0; c < stageLog->classLog->numClasses; c++) { const char *cname = stageLog->classLog->classInfo[c].name; PetscClassId id = PetscCLASSID(stageLog,c); ierr = PetscStrcasecmp(cname, name, &match);CHKERRQ(ierr); if (match) { *classid = id; break; } } PetscFunctionReturn(0); } static PetscErrorCode PetscLogEventFindId(const char name[], PetscLogEvent *eventid) { int e; PetscStageLog stageLog = 0; PetscBool match = PETSC_FALSE; PetscErrorCode ierr; PetscFunctionBegin; PetscValidCharPointer(name,1); PetscValidIntPointer(eventid,2); *eventid = -1; if (!(stageLog=petsc_stageLog)) PetscFunctionReturn(0); /* logging is off ? */ for (e = 0; e < stageLog->eventLog->numEvents; e++) { const char *ename = stageLog->eventLog->eventInfo[e].name; ierr = PetscStrcasecmp(ename, name, &match);CHKERRQ(ierr); if (match) { *eventid = e; break; } } PetscFunctionReturn(0); } static PetscErrorCode PetscLogStageFindName(PetscLogStage stageid, const char *name[]) { PetscStageLog stageLog = 0; PetscFunctionBegin; PetscValidPointer(name,3); *name = 0; if (!(stageLog=petsc_stageLog)) PetscFunctionReturn(0); /* logging is off ? */ if (stageid >=0 && stageid < stageLog->numStages) { *name = stageLog->stageInfo[stageid].name; } PetscFunctionReturn(0); } static PetscErrorCode PetscLogClassFindName(PetscClassId classid, const char *name[]) { int c; PetscStageLog stageLog = 0; PetscFunctionBegin; PetscValidPointer(name,3); *name = 0; if (!(stageLog=petsc_stageLog)) PetscFunctionReturn(0); /* logging is off ? */ for (c = 0; c < stageLog->classLog->numClasses; c++) { if (classid == PetscCLASSID(stageLog,c)) { *name = stageLog->classLog->classInfo[c].name; break; } } PetscFunctionReturn(0); } static PetscErrorCode PetscLogEventFindName(PetscLogEvent eventid, const char *name[]) { PetscStageLog stageLog = 0; PetscFunctionBegin; PetscValidPointer(name,3); *name = 0; if (!(stageLog=petsc_stageLog)) PetscFunctionReturn(0); /* logging is off ? */ if (eventid >=0 && eventid < stageLog->eventLog->numEvents) { *name = stageLog->eventLog->eventInfo[eventid].name; } PetscFunctionReturn(0); } #if !defined(PETSC_USE_LOG) #undef PetscLogEventGetPerfInfo static PetscErrorCode PetscLogEventGetPerfInfo(int stage,PetscLogEvent event,PetscEventPerfInfo *info) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidPointer(info,3); (void)stage; (void)event; /* unused */ ierr = PetscMemzero(info,sizeof(PetscEventPerfInfo));CHKERRQ(ierr); PetscFunctionReturn(0); } #endif /* ---------------------------------------------------------------- */ PETSC_STATIC_INLINE PetscErrorCode VecStrideSum(Vec v, PetscInt start, PetscScalar *a) { PetscInt i,n,bs; const PetscScalar *x; PetscScalar sum; MPI_Comm comm; PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(v,VEC_CLASSID,1); PetscValidType(v,1); PetscValidScalarPointer(a,2); ierr = VecGetBlockSize(v,&bs);CHKERRQ(ierr); if (start < 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "Negative start %D",start); if (start >= bs) SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG, "Start of stride subvector (%D) is too large " "for block size (%D)",start,bs); ierr = VecGetLocalSize(v,&n);CHKERRQ(ierr); ierr = VecGetArrayRead(v,&x);CHKERRQ(ierr); sum = (PetscScalar)0.0; for (i=start; ipreallocated; PetscFunctionReturn(0); } PETSC_STATIC_INLINE PetscErrorCode MatHasPreallocationAIJ(Mat A,PetscBool *aij,PetscBool *baij,PetscBool *sbaij) { void (*f)(void) = 0; PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(A,MAT_CLASSID,1); PetscValidType(A,1); PetscValidPointer(aij,2); PetscValidPointer(baij,3); PetscValidPointer(sbaij,4); *aij = *baij = *sbaij = PETSC_FALSE; if (!f) {ierr = PetscObjectQueryFunction((PetscObject)A,"MatMPIAIJSetPreallocation_C",&f);CHKERRQ(ierr);} if (!f) {ierr = PetscObjectQueryFunction((PetscObject)A,"MatSeqAIJSetPreallocation_C",&f);CHKERRQ(ierr);} if (f) {*aij = PETSC_TRUE; goto done;}; if (!f) {ierr = PetscObjectQueryFunction((PetscObject)A,"MatMPIBAIJSetPreallocation_C",&f);CHKERRQ(ierr);} if (!f) {ierr = PetscObjectQueryFunction((PetscObject)A,"MatSeqBAIJSetPreallocation_C",&f);CHKERRQ(ierr);} if (f) {*baij = PETSC_TRUE; goto done;}; if (!f) {ierr = PetscObjectQueryFunction((PetscObject)A,"MatMPISBAIJSetPreallocation_C",&f);CHKERRQ(ierr);} if (!f) {ierr = PetscObjectQueryFunction((PetscObject)A,"MatSeqSBAIJSetPreallocation_C",&f);CHKERRQ(ierr);} if (f) {*sbaij = PETSC_TRUE; goto done;}; done: PetscFunctionReturn(0); } #ifndef MatNullSpaceFunction typedef PetscErrorCode MatNullSpaceFunction(MatNullSpace,Vec,void*); #endif /* ---------------------------------------------------------------- */ static PetscErrorCode MatFactorInfoDefaults(PetscBool incomplete,PetscBool cholesky, MatFactorInfo *info) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidPointer(info,2); ierr = MatFactorInfoInitialize(info);CHKERRQ(ierr); if (incomplete) { info->levels = (PetscReal)0; info->diagonal_fill = (PetscReal)0; info->fill = (PetscReal)1.0; info->usedt = (PetscReal)0; info->dt = (PetscReal)PETSC_DEFAULT; info->dtcount = (PetscReal)PETSC_DEFAULT; info->dtcol = (PetscReal)PETSC_DEFAULT; info->zeropivot = (PetscReal)100.0*PETSC_MACHINE_EPSILON; info->pivotinblocks = (PetscReal)1; } else { info->fill = (PetscReal)5.0; info->dtcol = (PetscReal)1.e-6; info->zeropivot = (PetscReal)100.0*PETSC_MACHINE_EPSILON; info->pivotinblocks = (PetscReal)1; } if (incomplete) { if (cholesky) info->shifttype = (PetscReal)MAT_SHIFT_POSITIVE_DEFINITE; else info->shifttype = (PetscReal)MAT_SHIFT_NONZERO; info->shiftamount = (PetscReal)100.0*PETSC_MACHINE_EPSILON; } else { info->shifttype = (PetscReal)MAT_SHIFT_NONE; info->shiftamount = (PetscReal)0.0; } PetscFunctionReturn(0); } /* ---------------------------------------------------------------- */ static PetscErrorCode KSPSetIterationNumber(KSP ksp, PetscInt its) { PetscFunctionBegin; PetscValidHeaderSpecific(ksp,KSP_CLASSID,1); if (its < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "iteration number must be nonnegative"); ksp->its = its; PetscFunctionReturn(0); } static PetscErrorCode KSPSetResidualNorm(KSP ksp, PetscReal rnorm) { PetscFunctionBegin; PetscValidHeaderSpecific(ksp,KSP_CLASSID,1); if (rnorm < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "residual norm must be nonnegative"); ksp->rnorm = rnorm; PetscFunctionReturn(0); } static PetscErrorCode KSPConvergenceTestCall(KSP ksp, PetscInt its, PetscReal rnorm, KSPConvergedReason *reason) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(ksp,KSP_CLASSID,1); PetscValidPointer(reason,4); if (its < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "iteration number must be nonnegative"); if (rnorm < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "residual norm must be nonnegative"); ierr = (*ksp->converged)(ksp,its,rnorm,reason,ksp->cnvP);CHKERRQ(ierr); PetscFunctionReturn(0); } static PetscErrorCode KSPSetConvergedReason(KSP ksp, KSPConvergedReason reason) { PetscFunctionBegin; PetscValidHeaderSpecific(ksp,KSP_CLASSID,1); ksp->reason = reason; PetscFunctionReturn(0); } /* ---------------------------------------------------------------- */ static PetscErrorCode SNESConvergenceTestCall(SNES snes, PetscInt its, PetscReal xnorm, PetscReal ynorm, PetscReal fnorm, SNESConvergedReason *reason) { PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(snes,SNES_CLASSID,1); PetscValidPointer(reason,4); if (its < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "iteration number must be nonnegative"); if (xnorm < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "solution norm must be nonnegative"); if (ynorm < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "step norm must be nonnegative"); if (fnorm < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE, "function norm must be nonnegative"); ierr = (*snes->ops->converged)(snes,its,xnorm,ynorm,fnorm,reason,snes->cnvP);CHKERRQ(ierr); PetscFunctionReturn(0); } static PetscErrorCode SNESGetUseMFFD(SNES snes,PetscBool *flag) { PetscErrorCode (*jac)(SNES,Vec,Mat,Mat,void*) = PETSC_NULL; Mat J = PETSC_NULL; PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(snes,SNES_CLASSID,1); PetscValidPointer(flag,2); *flag = PETSC_FALSE; ierr = SNESGetJacobian(snes,&J,0,&jac,0);CHKERRQ(ierr); if (J) { ierr = PetscObjectTypeCompare((PetscObject)J,MATMFFD,flag);CHKERRQ(ierr); } else if (jac == MatMFFDComputeJacobian) *flag = PETSC_TRUE; PetscFunctionReturn(0); } static PetscErrorCode SNESSetUseMFFD(SNES snes,PetscBool flag) { const char* prefix = PETSC_NULL; PetscBool flg = PETSC_FALSE; Vec r = PETSC_NULL; Mat A = PETSC_NULL,B = PETSC_NULL,J = PETSC_NULL; void* funP = PETSC_NULL; void* jacP = PETSC_NULL; PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(snes,SNES_CLASSID,1); ierr = SNESGetUseMFFD(snes,&flg);CHKERRQ(ierr); if (flg && flag) PetscFunctionReturn(0); if (!flg && !flag) PetscFunctionReturn(0); if (flg && !flag) { SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE, "cannot change matrix-free once it is set"); PetscFunctionReturn(PETSC_ERR_ARG_WRONGSTATE); } ierr = SNESGetOptionsPrefix(snes,&prefix);CHKERRQ(ierr); ierr = SNESGetFunction(snes,&r,0,&funP);CHKERRQ(ierr); ierr = SNESGetJacobian(snes,&A,&B,0,&jacP);CHKERRQ(ierr); if (!r) { SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE,"SNESSetFunction() must be called first"); PetscFunctionReturn(PETSC_ERR_ARG_WRONGSTATE); } ierr = MatCreateSNESMF(snes,&J);CHKERRQ(ierr); ierr = MatSetOptionsPrefix(J,prefix);CHKERRQ(ierr); ierr = MatSetFromOptions(J);CHKERRQ(ierr); if (!B) { KSP ksp; PC pc; PetscBool shell,python; ierr = SNESSetJacobian(snes,J,J,MatMFFDComputeJacobian,jacP);CHKERRQ(ierr); ierr = SNESGetKSP(snes,&ksp);CHKERRQ(ierr); ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr); ierr = PetscObjectTypeCompare((PetscObject)pc,PCSHELL,&shell);CHKERRQ(ierr); ierr = PetscObjectTypeCompare((PetscObject)pc,PCPYTHON,&python);CHKERRQ(ierr); if (!shell && !python) { ierr = PCSetType(pc,PCNONE);CHKERRQ(ierr); } } else { ierr = SNESSetJacobian(snes,J,0,0,0);CHKERRQ(ierr); } ierr = MatDestroy(&J);CHKERRQ(ierr); PetscFunctionReturn(0); } static PetscErrorCode SNESGetUseFDColoring(SNES snes,PetscBool *flag) { PetscErrorCode (*jac)(SNES,Vec,Mat,Mat,void*) = PETSC_NULL; PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(snes,SNES_CLASSID,1); PetscValidPointer(flag,2); *flag = PETSC_FALSE; ierr = SNESGetJacobian(snes,0,0,&jac,0);CHKERRQ(ierr); if (jac == SNESComputeJacobianDefaultColor) *flag = PETSC_TRUE; PetscFunctionReturn(0); } static PetscErrorCode SNESSetUseFDColoring(SNES snes,PetscBool flag) { PetscBool flg = PETSC_FALSE; PetscErrorCode (*fun)(SNES,Vec,Vec,void*) = PETSC_NULL; void* funP = PETSC_NULL; Mat A = PETSC_NULL,B = PETSC_NULL; PetscErrorCode (*jac)(SNES,Vec,Mat,Mat,void*) = PETSC_NULL; void* jacP = PETSC_NULL; PetscErrorCode ierr; PetscFunctionBegin; PetscValidHeaderSpecific(snes,SNES_CLASSID,1); ierr = SNESGetUseFDColoring(snes,&flg);CHKERRQ(ierr); if (flg && flag) PetscFunctionReturn(0); if (!flg && !flag) PetscFunctionReturn(0); if (flg && !flag) { SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE, "cannot change colored finite diferences once it is set"); PetscFunctionReturn(PETSC_ERR_ARG_WRONGSTATE); } ierr = SNESGetFunction(snes,NULL,&fun,&funP);CHKERRQ(ierr); ierr = SNESGetJacobian(snes,&A,&B,&jac,&jacP);CHKERRQ(ierr); ierr = SNESSetJacobian(snes,A,B,SNESComputeJacobianDefaultColor,0);CHKERRQ(ierr); { DM dm; DMSNES sdm; ierr = SNESGetDM(snes,&dm);CHKERRQ(ierr); ierr = DMGetDMSNES(dm,&sdm);CHKERRQ(ierr); sdm->jacobianctx = NULL; } PetscFunctionReturn(0); } /* ---------------------------------------------------------------- */ static PetscErrorCode DMDACreateND(MPI_Comm comm, PetscInt dim,PetscInt dof, PetscInt M,PetscInt N,PetscInt P, PetscInt m,PetscInt n,PetscInt p, const PetscInt lx[],const PetscInt ly[],const PetscInt lz[], DMBoundaryType bx,DMBoundaryType by,DMBoundaryType bz, DMDAStencilType stencil_type,PetscInt stencil_width, DM *dm) { DM da; PetscErrorCode ierr; PetscFunctionBegin; PetscValidPointer(dm,18); ierr = DMDACreate(comm,&da);CHKERRQ(ierr); ierr = DMSetDimension(da,dim);CHKERRQ(ierr); ierr = DMDASetDof(da,dof);CHKERRQ(ierr); ierr = DMDASetSizes(da,M,N,P);CHKERRQ(ierr); ierr = DMDASetNumProcs(da,m,n,p);CHKERRQ(ierr); ierr = DMDASetOwnershipRanges(da,lx,ly,lz);CHKERRQ(ierr); ierr = DMDASetBoundaryType(da,bx,by,bz);CHKERRQ(ierr); ierr = DMDASetStencilType(da,stencil_type);CHKERRQ(ierr); ierr = DMDASetStencilWidth(da,stencil_width);CHKERRQ(ierr); *dm = (DM)da; PetscFunctionReturn(0); } /* ---------------------------------------------------------------- */ #endif/* PETSC4PY_CUSTOM_H*/ /* Local variables: c-basic-offset: 2 indent-tabs-mode: nil End: */ petsc4py-3.15.1/src/include/cython.h0000644000175000017500000000320613750315427017455 0ustar balaybalay00000000000000static void *Cython_ImportFunction(PyObject *module, const char *funcname, const char *signature) { PyObject *capi = NULL, *capsule = NULL; void *p = NULL; capi = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); if (!capi) goto bad; capsule = PyDict_GetItemString(capi, (char *)funcname); if (!capsule) { PyErr_Format(PyExc_ImportError, "%s does not export expected C function %s", PyModule_GetName(module), funcname); goto bad; } #if PY_VERSION_HEX < 0x03020000 if (PyCObject_Check(capsule)) { const char *desc, *s1, *s2; desc = (const char *)PyCObject_GetDesc(capsule); if (!desc) goto bad; s1 = desc; s2 = signature; while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } if (*s1 != *s2) { PyErr_Format(PyExc_TypeError, "C function %s.%s has wrong signature " "(expected %s, got %s)", PyModule_GetName(module), funcname, signature, desc); goto bad; } p = PyCObject_AsVoidPtr(capsule); } #endif #if PY_VERSION_HEX >= 0x02070000 if (PyCapsule_CheckExact(capsule)) { if (!PyCapsule_IsValid(capsule, signature)) { const char *desc = PyCapsule_GetName(capsule); PyErr_Format(PyExc_TypeError, "C function %s.%s has wrong signature " "(expected %s, got %s)", PyModule_GetName(module), funcname, signature, desc); goto bad; } p = PyCapsule_GetPointer(capsule, signature); } #endif Py_DECREF(capi); return p; bad: Py_XDECREF(capi); return NULL; } petsc4py-3.15.1/src/include/compat.h0000644000175000017500000000043014030740317017420 0ustar balaybalay00000000000000#ifndef PETSC4PY_COMPAT_H #define PETSC4PY_COMPAT_H #include #include "compat/mpi.h" #include "compat/hdf5.h" #include "compat/mumps.h" #include "compat/hypre.h" #include "compat/viennacl.h" #include "compat/cuda.h" #include "compat/tao.h" #endif/*PETSC4PY_COMPAT_H*/ petsc4py-3.15.1/src/petsc4py.PETSc.pyx0000644000175000017500000000056013750315427017607 0ustar balaybalay00000000000000#cython: embedsignature=True #cython: cdivision=True #cython: binding=False #cython: auto_pickle=False #cython: always_allow_keywords=True #cython: allow_none_for_extension_args=False #cython: autotestdict=False #cython: warn.multiple_declarators=False #cython: optimize.use_switch=False from __future__ import absolute_import cimport cython include "PETSc/PETSc.pyx" petsc4py-3.15.1/src/petsc4py.PETSc.c0000644000175000017500007070227414062764416017236 0ustar balaybalay00000000000000/* Generated by Cython 0.29.22 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_22" #define CYTHON_HEX_VERSION 0x001D16F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) #endif #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #ifndef PyObject_Unicode #define PyObject_Unicode PyObject_Str #endif #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_VERSION_HEX >= 0x030900A4 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) #else #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__petsc4py__PETSc #define __PYX_HAVE_API__petsc4py__PETSc /* Early includes */ #include "petsc.h" #include "compat.h" #include "custom.h" #include "scalar.h" #include "petsc4py/numpy.h" #include "cython.h" #include "pep3118.h" #include "stdlib.h" #include "libpetsc4py.h" #include "stdio.h" #include "string.h" #include "initpkg.h" #include "pythread.h" #include #include #include #include "pystate.h" #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "PETSc/Const.pyx", "PETSc/Error.pyx", "PETSc/petscdef.pxi", "PETSc/petscopt.pxi", "PETSc/petscis.pxi", "PETSc/petscvec.pxi", "PETSc/petscmat.pxi", "PETSc/petscpc.pxi", "PETSc/petscdmda.pxi", "PETSc/Comm.pyx", "PETSc/Object.pyx", "PETSc/PETSc.pyx", "include/arraynpy.pxi", "PETSc/petscmpi.pxi", "PETSc/petscsys.pxi", "PETSc/petsclog.pxi", "PETSc/petscobj.pxi", "PETSc/petscvwr.pxi", "PETSc/petscksp.pxi", "PETSc/petscsnes.pxi", "PETSc/petscts.pxi", "PETSc/petsctao.pxi", "PETSc/petscdm.pxi", "PETSc/petscdmstag.pxi", "PETSc/petscdmcomposite.pxi", "PETSc/petscdmshell.pxi", "PETSc/Options.pyx", "PETSc/Sys.pyx", "PETSc/Log.pyx", "PETSc/Viewer.pyx", "PETSc/Random.pyx", "PETSc/IS.pyx", "PETSc/SF.pyx", "PETSc/Vec.pyx", "PETSc/DT.pyx", "PETSc/FE.pyx", "PETSc/Scatter.pyx", "PETSc/Section.pyx", "PETSc/Mat.pyx", "PETSc/PC.pyx", "PETSc/KSP.pyx", "PETSc/SNES.pyx", "PETSc/TS.pyx", "PETSc/TAO.pyx", "PETSc/AO.pyx", "PETSc/DM.pyx", "PETSc/DS.pyx", "PETSc/DMDA.pyx", "PETSc/DMPlex.pyx", "PETSc/DMStag.pyx", "PETSc/DMComposite.pyx", "PETSc/DMShell.pyx", "PETSc/DMLabel.pyx", "PETSc/DMSwarm.pyx", "PETSc/Partitioner.pyx", "PETSc/CAPI.pyx", "stringsource", "petsc4py.PETSc.pyx", }; /* ForceInitThreads.proto */ #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure #define __Pyx_PyGILState_Release PyGILState_Release #define __Pyx_FastGIL_Remember() #define __Pyx_FastGIL_Forget() #define __Pyx_FastGilFuncInit() /* MemviewSliceStruct.proto */ struct __pyx_memoryview_obj; typedef struct { struct __pyx_memoryview_obj *memview; char *data; Py_ssize_t shape[8]; Py_ssize_t strides[8]; Py_ssize_t suboffsets[8]; } __Pyx_memviewslice; #define __Pyx_MemoryView_Len(m) (m.shape[0]) /* Atomics.proto */ #include #ifndef CYTHON_ATOMICS #define CYTHON_ATOMICS 1 #endif #define __pyx_atomic_int_type int #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\ !defined(__i386__) #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1) #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1) #ifdef __PYX_DEBUG_ATOMICS #warning "Using GNU atomics" #endif #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0 #include #undef __pyx_atomic_int_type #define __pyx_atomic_int_type LONG #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value) #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value) #ifdef __PYX_DEBUG_ATOMICS #pragma message ("Using MSVC atomics") #endif #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value) #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value) #ifdef __PYX_DEBUG_ATOMICS #warning "Using Intel atomics" #endif #else #undef CYTHON_ATOMICS #define CYTHON_ATOMICS 0 #ifdef __PYX_DEBUG_ATOMICS #warning "Not using atomics" #endif #endif typedef volatile __pyx_atomic_int_type __pyx_atomic_int; #if CYTHON_ATOMICS #define __pyx_add_acquisition_count(memview)\ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) #define __pyx_sub_acquisition_count(memview)\ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock) #else #define __pyx_add_acquisition_count(memview)\ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) #define __pyx_sub_acquisition_count(memview)\ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) #endif /* BufferFormatStructs.proto */ #define IS_UNSIGNED(type) (((type) -1) > 0) struct __Pyx_StructField_; #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) typedef struct { const char* name; struct __Pyx_StructField_* fields; size_t size; size_t arraysize[8]; int ndim; char typegroup; char is_unsigned; int flags; } __Pyx_TypeInfo; typedef struct __Pyx_StructField_ { __Pyx_TypeInfo* type; const char* name; size_t offset; } __Pyx_StructField; typedef struct { __Pyx_StructField* field; size_t parent_offset; } __Pyx_BufFmt_StackElem; typedef struct { __Pyx_StructField root; __Pyx_BufFmt_StackElem* head; size_t fmt_offset; size_t new_count, enc_count; size_t struct_alignment; int is_complex; char enc_type; char new_packmode; char enc_packmode; char is_valid_array; } __Pyx_BufFmt_Context; /*--- Type declarations ---*/ struct PyPetscCommObject; struct PyPetscObjectObject; struct PyPetscViewerObject; struct PyPetscRandomObject; struct PyPetscISObject; struct PyPetscLGMapObject; struct PyPetscSFObject; struct PyPetscVecObject; struct PyPetscFEObject; struct PyPetscQuadObject; struct PyPetscScatterObject; struct PyPetscSectionObject; struct PyPetscMatObject; struct PyPetscNullSpaceObject; struct PyPetscPCObject; struct PyPetscKSPObject; struct PyPetscSNESObject; struct PyPetscTSObject; struct PyPetscTAOObject; struct PyPetscAOObject; struct PyPetscDMObject; struct PyPetscDSObject; struct PyPetscPartitionerObject; struct PyPetscDMLabelObject; struct __pyx_obj_8petsc4py_5PETSc__IS_buffer; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer; struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm; struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil; struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array; struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access; struct __pyx_obj_8petsc4py_5PETSc_Options; struct __pyx_obj_8petsc4py_5PETSc_Sys; struct __pyx_obj_8petsc4py_5PETSc_Log; struct __pyx_obj_8petsc4py_5PETSc_LogStage; struct __pyx_obj_8petsc4py_5PETSc_LogClass; struct __pyx_obj_8petsc4py_5PETSc_LogEvent; struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5; struct __pyx_obj_8petsc4py_5PETSc_DMDA; struct __pyx_obj_8petsc4py_5PETSc_DMPlex; struct __pyx_obj_8petsc4py_5PETSc_DMStag; struct __pyx_obj_8petsc4py_5PETSc_DMComposite; struct __pyx_obj_8petsc4py_5PETSc_DMShell; struct __pyx_obj_8petsc4py_5PETSc_DMSwarm; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator; struct __pyx_array_obj; struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; struct __pyx_opt_args_8petsc4py_5PETSc_getprefix; struct __pyx_t_8petsc4py_5PETSc_DLDataType; struct __pyx_t_8petsc4py_5PETSc_DLContext; typedef struct __pyx_t_8petsc4py_5PETSc_DLContext __pyx_t_8petsc4py_5PETSc_DLContext; struct __pyx_t_8petsc4py_5PETSc_DLTensor; struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor; /* "PETSc/petscopt.pxi":103 * * * cdef enum PetscOptType: # <<<<<<<<<<<<<< * OPT_BOOL * OPT_INT */ enum __pyx_t_8petsc4py_5PETSc_PetscOptType { __pyx_e_8petsc4py_5PETSc_OPT_BOOL, __pyx_e_8petsc4py_5PETSc_OPT_INT, __pyx_e_8petsc4py_5PETSc_OPT_REAL, __pyx_e_8petsc4py_5PETSc_OPT_SCALAR, __pyx_e_8petsc4py_5PETSc_OPT_STRING }; /* "PETSc/petscvec.pxi":605 * int device_id * * cdef enum DLDataTypeCode: # <<<<<<<<<<<<<< * kDLInt = 0 * kDLUInt = 1 */ enum __pyx_t_8petsc4py_5PETSc_DLDataTypeCode { /* "PETSc/petscvec.pxi":608 * kDLInt = 0 * kDLUInt = 1 * kDLFloat = 2 # <<<<<<<<<<<<<< * * cdef struct DLTensor: */ __pyx_e_8petsc4py_5PETSc_kDLInt = ((unsigned int)0), __pyx_e_8petsc4py_5PETSc_kDLUInt = ((unsigned int)1), __pyx_e_8petsc4py_5PETSc_kDLFloat = ((unsigned int)2) }; /* "PETSc/petscopt.pxi":38 * # * * cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<< * if prefix is None: * prefix = deft */ struct __pyx_opt_args_8petsc4py_5PETSc_getprefix { int __pyx_n; PyObject *deft; }; /* "PETSc/petscmpi.pxi":39 * void *Cython_ImportFunction(object, char[], char[]) except? NULL * * ctypedef MPI_Comm* PyMPICommGet(object) except NULL # <<<<<<<<<<<<<< * ctypedef object PyMPICommNew(MPI_Comm) * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL */ typedef MPI_Comm *__pyx_t_8petsc4py_5PETSc_PyMPICommGet(PyObject *); /* "PETSc/petscmpi.pxi":40 * * ctypedef MPI_Comm* PyMPICommGet(object) except NULL * ctypedef object PyMPICommNew(MPI_Comm) # <<<<<<<<<<<<<< * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL * ctypedef MPI_Op* PyMPIOpGet(object) except NULL */ typedef PyObject *__pyx_t_8petsc4py_5PETSc_PyMPICommNew(MPI_Comm); /* "PETSc/petscmpi.pxi":41 * ctypedef MPI_Comm* PyMPICommGet(object) except NULL * ctypedef object PyMPICommNew(MPI_Comm) * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL # <<<<<<<<<<<<<< * ctypedef MPI_Op* PyMPIOpGet(object) except NULL * */ typedef MPI_Datatype *__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet(PyObject *); /* "PETSc/petscmpi.pxi":42 * ctypedef object PyMPICommNew(MPI_Comm) * ctypedef MPI_Datatype* PyMPIDatatypeGet(object) except NULL * ctypedef MPI_Op* PyMPIOpGet(object) except NULL # <<<<<<<<<<<<<< * * cdef inline MPI_Comm mpi4py_Comm_Get(object comm) except *: */ typedef MPI_Op *__pyx_t_8petsc4py_5PETSc_PyMPIOpGet(PyObject *); /* "PETSc/petscvec.pxi":308 * # -------------------------------------------------------------------- * * ctypedef int VecSetValuesFcn(PetscVec, # <<<<<<<<<<<<<< * PetscInt,const PetscInt*, * const PetscScalar*,PetscInsertMode) */ typedef int __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn(Vec, PetscInt, PetscInt const *, PetscScalar const *, InsertMode); /* "PETSc/petscvec.pxi":596 * void* malloc(size_t size) * * cdef struct DLDataType: # <<<<<<<<<<<<<< * uint8_t code * uint8_t bits */ struct __pyx_t_8petsc4py_5PETSc_DLDataType { uint8_t code; uint8_t bits; uint16_t lanes; }; /* "PETSc/petscvec.pxi":601 * uint16_t lanes * * ctypedef struct DLContext: # <<<<<<<<<<<<<< * int device_type * int device_id */ struct __pyx_t_8petsc4py_5PETSc_DLContext { int device_type; int device_id; }; /* "PETSc/petscvec.pxi":610 * kDLFloat = 2 * * cdef struct DLTensor: # <<<<<<<<<<<<<< * void* data * DLContext ctx */ struct __pyx_t_8petsc4py_5PETSc_DLTensor { void *data; __pyx_t_8petsc4py_5PETSc_DLContext ctx; int ndim; struct __pyx_t_8petsc4py_5PETSc_DLDataType dtype; int64_t *shape; int64_t *strides; uint64_t byte_offset; }; /* "PETSc/petscvec.pxi":619 * uint64_t byte_offset * * cdef struct DLManagedTensor: # <<<<<<<<<<<<<< * DLTensor dl_tensor * void* manager_ctx */ struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor { struct __pyx_t_8petsc4py_5PETSc_DLTensor dl_tensor; void *manager_ctx; void (*manager_deleter)(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *); }; /* "PETSc/petscmat.pxi":799 * # ----------------------------------------------------------------------------- * * ctypedef int MatSetValuesFcn(PetscMat, # <<<<<<<<<<<<<< * PetscInt,const PetscInt*, * PetscInt,const PetscInt*, */ typedef int __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn(Mat, PetscInt, PetscInt const *, PetscInt, PetscInt const *, PetscScalar const *, InsertMode); /* "PETSc/petscdmshell.pxi":1 * ctypedef int (*PetscDMShellXToYFunction)(PetscDM, # <<<<<<<<<<<<<< * PetscVec, * PetscInsertMode, */ typedef int (*__pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction)(DM, Vec, InsertMode, Vec); /* "petsc4py/PETSc.pxd":91 * # -------------------------------------------------------------------- * * ctypedef public api class Comm [ # <<<<<<<<<<<<<< * type PyPetscComm_Type, * object PyPetscCommObject, */ struct PyPetscCommObject { PyObject_HEAD MPI_Comm comm; int isdup; PyObject *base; }; typedef struct PyPetscCommObject PyPetscCommObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscComm_Type; /* "petsc4py/PETSc.pxd":99 * cdef object base * * ctypedef public api class Object [ # <<<<<<<<<<<<<< * type PyPetscObject_Type, * object PyPetscObjectObject, */ struct PyPetscObjectObject { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtab; PyObject *__weakref__; PyObject *__pyx___dummy__; PetscObject oval; PetscObject *obj; }; typedef struct PyPetscObjectObject PyPetscObjectObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type; /* "petsc4py/PETSc.pxd":111 * cdef object get_dict(self) * * ctypedef public api class Viewer(Object) [ # <<<<<<<<<<<<<< * type PyPetscViewer_Type, * object PyPetscViewerObject, */ struct PyPetscViewerObject { struct PyPetscObjectObject __pyx_base; PetscViewer vwr; }; typedef struct PyPetscViewerObject PyPetscViewerObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type; /* "petsc4py/PETSc.pxd":117 * cdef PetscViewer vwr * * ctypedef public api class Random(Object) [ # <<<<<<<<<<<<<< * type PyPetscRandom_Type, * object PyPetscRandomObject, */ struct PyPetscRandomObject { struct PyPetscObjectObject __pyx_base; PetscRandom rnd; }; typedef struct PyPetscRandomObject PyPetscRandomObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRandom_Type; /* "petsc4py/PETSc.pxd":123 * cdef PetscRandom rnd * * ctypedef public api class IS(Object) [ # <<<<<<<<<<<<<< * type PyPetscIS_Type, * object PyPetscISObject, */ struct PyPetscISObject { struct PyPetscObjectObject __pyx_base; IS iset; }; typedef struct PyPetscISObject PyPetscISObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type; /* "petsc4py/PETSc.pxd":129 * cdef PetscIS iset * * ctypedef public api class LGMap(Object) [ # <<<<<<<<<<<<<< * type PyPetscLGMap_Type, * object PyPetscLGMapObject, */ struct PyPetscLGMapObject { struct PyPetscObjectObject __pyx_base; ISLocalToGlobalMapping lgm; }; typedef struct PyPetscLGMapObject PyPetscLGMapObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscLGMap_Type; /* "petsc4py/PETSc.pxd":135 * cdef PetscLGMap lgm * * ctypedef public api class SF(Object) [ # <<<<<<<<<<<<<< * type PyPetscSF_Type, * object PyPetscSFObject, */ struct PyPetscSFObject { struct PyPetscObjectObject __pyx_base; PetscSF sf; }; typedef struct PyPetscSFObject PyPetscSFObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type; /* "petsc4py/PETSc.pxd":141 * cdef PetscSF sf * * ctypedef public api class Vec(Object) [ # <<<<<<<<<<<<<< * type PyPetscVec_Type, * object PyPetscVecObject, */ struct PyPetscVecObject { struct PyPetscObjectObject __pyx_base; Vec vec; }; typedef struct PyPetscVecObject PyPetscVecObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscVec_Type; /* "petsc4py/PETSc.pxd":147 * cdef PetscVec vec * * ctypedef public api class FE(Object) [ # <<<<<<<<<<<<<< * type PyPetscFE_Type, * object PyPetscFEObject, */ struct PyPetscFEObject { struct PyPetscObjectObject __pyx_base; PetscFE fe; }; typedef struct PyPetscFEObject PyPetscFEObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type; /* "petsc4py/PETSc.pxd":153 * cdef PetscFE fe * * ctypedef public api class Quad(Object) [ # <<<<<<<<<<<<<< * type PyPetscQuad_Type, * object PyPetscQuadObject, */ struct PyPetscQuadObject { struct PyPetscObjectObject __pyx_base; PetscQuadrature quad; }; typedef struct PyPetscQuadObject PyPetscQuadObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscQuad_Type; /* "petsc4py/PETSc.pxd":159 * cdef PetscQuadrature quad * * ctypedef public api class Scatter(Object) [ # <<<<<<<<<<<<<< * type PyPetscScatter_Type, * object PyPetscScatterObject, */ struct PyPetscScatterObject { struct PyPetscObjectObject __pyx_base; VecScatter sct; }; typedef struct PyPetscScatterObject PyPetscScatterObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscScatter_Type; /* "petsc4py/PETSc.pxd":165 * cdef PetscScatter sct * * ctypedef public api class Section(Object) [ # <<<<<<<<<<<<<< * type PyPetscSection_Type, * object PyPetscSectionObject, */ struct PyPetscSectionObject { struct PyPetscObjectObject __pyx_base; PetscSection sec; }; typedef struct PyPetscSectionObject PyPetscSectionObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSection_Type; /* "petsc4py/PETSc.pxd":171 * cdef PetscSection sec * * ctypedef public api class Mat(Object) [ # <<<<<<<<<<<<<< * type PyPetscMat_Type, * object PyPetscMatObject, */ struct PyPetscMatObject { struct PyPetscObjectObject __pyx_base; Mat mat; }; typedef struct PyPetscMatObject PyPetscMatObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMat_Type; /* "petsc4py/PETSc.pxd":177 * cdef PetscMat mat * * ctypedef public api class NullSpace(Object) [ # <<<<<<<<<<<<<< * type PyPetscNullSpace_Type, * object PyPetscNullSpaceObject, */ struct PyPetscNullSpaceObject { struct PyPetscObjectObject __pyx_base; MatNullSpace nsp; }; typedef struct PyPetscNullSpaceObject PyPetscNullSpaceObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type; /* "petsc4py/PETSc.pxd":183 * cdef PetscNullSpace nsp * * ctypedef public api class PC(Object) [ # <<<<<<<<<<<<<< * type PyPetscPC_Type, * object PyPetscPCObject, */ struct PyPetscPCObject { struct PyPetscObjectObject __pyx_base; PC pc; }; typedef struct PyPetscPCObject PyPetscPCObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPC_Type; /* "petsc4py/PETSc.pxd":189 * cdef PetscPC pc * * ctypedef public api class KSP(Object) [ # <<<<<<<<<<<<<< * type PyPetscKSP_Type, * object PyPetscKSPObject, */ struct PyPetscKSPObject { struct PyPetscObjectObject __pyx_base; KSP ksp; }; typedef struct PyPetscKSPObject PyPetscKSPObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscKSP_Type; /* "petsc4py/PETSc.pxd":195 * cdef PetscKSP ksp * * ctypedef public api class SNES(Object) [ # <<<<<<<<<<<<<< * type PyPetscSNES_Type, * object PyPetscSNESObject, */ struct PyPetscSNESObject { struct PyPetscObjectObject __pyx_base; SNES snes; }; typedef struct PyPetscSNESObject PyPetscSNESObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNES_Type; /* "petsc4py/PETSc.pxd":201 * cdef PetscSNES snes * * ctypedef public api class TS(Object) [ # <<<<<<<<<<<<<< * type PyPetscTS_Type, * object PyPetscTSObject, */ struct PyPetscTSObject { struct PyPetscObjectObject __pyx_base; TS ts; }; typedef struct PyPetscTSObject PyPetscTSObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type; /* "petsc4py/PETSc.pxd":207 * cdef PetscTS ts * * ctypedef public api class TAO(Object) [ # <<<<<<<<<<<<<< * type PyPetscTAO_Type, * object PyPetscTAOObject, */ struct PyPetscTAOObject { struct PyPetscObjectObject __pyx_base; Tao tao; }; typedef struct PyPetscTAOObject PyPetscTAOObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAO_Type; /* "petsc4py/PETSc.pxd":213 * cdef PetscTAO tao * * ctypedef public api class AO(Object) [ # <<<<<<<<<<<<<< * type PyPetscAO_Type, * object PyPetscAOObject, */ struct PyPetscAOObject { struct PyPetscObjectObject __pyx_base; AO ao; }; typedef struct PyPetscAOObject PyPetscAOObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscAO_Type; /* "petsc4py/PETSc.pxd":219 * cdef PetscAO ao * * ctypedef public api class DM(Object) [ # <<<<<<<<<<<<<< * type PyPetscDM_Type, * object PyPetscDMObject, */ struct PyPetscDMObject { struct PyPetscObjectObject __pyx_base; DM dm; }; typedef struct PyPetscDMObject PyPetscDMObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDM_Type; /* "petsc4py/PETSc.pxd":225 * cdef PetscDM dm * * ctypedef public api class DS(Object) [ # <<<<<<<<<<<<<< * type PyPetscDS_Type, * object PyPetscDSObject, */ struct PyPetscDSObject { struct PyPetscObjectObject __pyx_base; PetscDS ds; }; typedef struct PyPetscDSObject PyPetscDSObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type; /* "petsc4py/PETSc.pxd":231 * cdef PetscDS ds * * ctypedef public api class Partitioner(Object) [ # <<<<<<<<<<<<<< * type PyPetscPartitioner_Type, * object PyPetscPartitionerObject, */ struct PyPetscPartitionerObject { struct PyPetscObjectObject __pyx_base; PetscPartitioner part; }; typedef struct PyPetscPartitionerObject PyPetscPartitionerObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type; /* "petsc4py/PETSc.pxd":237 * cdef PetscPartitioner part * * ctypedef public api class DMLabel(Object) [ # <<<<<<<<<<<<<< * type PyPetscDMLabel_Type, * object PyPetscDMLabelObject, */ struct PyPetscDMLabelObject { struct PyPetscObjectObject __pyx_base; DMLabel dmlabel; }; typedef struct PyPetscDMLabelObject PyPetscDMLabelObject; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type; /* "PETSc/petscis.pxi":118 * # -------------------------------------------------------------------- * * cdef class _IS_buffer: # <<<<<<<<<<<<<< * * cdef PetscIS iset */ struct __pyx_obj_8petsc4py_5PETSc__IS_buffer { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *__pyx_vtab; IS iset; PetscInt size; PetscInt const *data; int hasarray; }; /* "PETSc/petscvec.pxi":437 * return 0 * * cdef class _Vec_buffer: # <<<<<<<<<<<<<< * * cdef PetscVec vec */ struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *__pyx_vtab; Vec vec; PetscInt size; PetscScalar *data; int readonly; int hasarray; }; /* "PETSc/petscvec.pxi":557 * # -------------------------------------------------------------------- * * cdef class _Vec_LocalForm: # <<<<<<<<<<<<<< * * "Context manager for `Vec` local form" */ struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm { PyObject_HEAD struct PyPetscVecObject *gvec; struct PyPetscVecObject *lvec; }; /* "PETSc/petscmat.pxi":1079 * * #@cython.internal * cdef class _Mat_Stencil: # <<<<<<<<<<<<<< * cdef PetscMatStencil stencil * property i: */ struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil { PyObject_HEAD MatStencil stencil; }; /* "PETSc/petscdmda.pxi":198 * # -------------------------------------------------------------------- * * cdef class _DMDA_Vec_array(object): # <<<<<<<<<<<<<< * * cdef _Vec_buffer vecbuf */ struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array { PyObject_HEAD struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_vtab; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *vecbuf; PyObject *starts; PyObject *sizes; PyObject *shape; PyObject *strides; PyArrayObject *array; }; /* "PETSc/petscdmcomposite.pxi":17 * int DMCompositeGetISLocalToGlobalMappings(PetscDM,PetscLGMap**) * * cdef class _DMComposite_access: # <<<<<<<<<<<<<< * cdef PetscDM dm * cdef PetscVec gvec */ struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access { PyObject_HEAD DM dm; Vec gvec; PetscInt nlocs; PetscInt *locs; Vec *vecs; PyObject *locs_mem; PyObject *vecs_mem; PyObject *access; }; /* "PETSc/Options.pyx":3 * # -------------------------------------------------------------------- * * cdef class Options: # <<<<<<<<<<<<<< * * cdef PetscOptions opt */ struct __pyx_obj_8petsc4py_5PETSc_Options { PyObject_HEAD PetscOptions opt; PyObject *_prefix; }; /* "PETSc/Sys.pyx":3 * # -------------------------------------------------------------------- * * cdef class Sys: # <<<<<<<<<<<<<< * * @classmethod */ struct __pyx_obj_8petsc4py_5PETSc_Sys { PyObject_HEAD }; /* "PETSc/Log.pyx":5 * * * cdef class Log: # <<<<<<<<<<<<<< * * @classmethod */ struct __pyx_obj_8petsc4py_5PETSc_Log { PyObject_HEAD }; /* "PETSc/Log.pyx":122 * # -------------------------------------------------------------------- * * cdef class LogStage: # <<<<<<<<<<<<<< * * cdef readonly PetscLogStage id */ struct __pyx_obj_8petsc4py_5PETSc_LogStage { PyObject_HEAD PetscLogStage id; }; /* "PETSc/Log.pyx":218 * # -------------------------------------------------------------------- * * cdef class LogClass: # <<<<<<<<<<<<<< * * cdef readonly PetscLogClass id */ struct __pyx_obj_8petsc4py_5PETSc_LogClass { PyObject_HEAD PetscClassId id; }; /* "PETSc/Log.pyx":280 * # -------------------------------------------------------------------- * * cdef class LogEvent: # <<<<<<<<<<<<<< * * cdef readonly PetscLogEvent id */ struct __pyx_obj_8petsc4py_5PETSc_LogEvent { PyObject_HEAD PetscLogEvent id; }; /* "PETSc/Viewer.pyx":365 * # -------------------------------------------------------------------- * * cdef class ViewerHDF5(Viewer): # <<<<<<<<<<<<<< * * def create(self, name, mode=None, comm=None): */ struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 { struct PyPetscViewerObject __pyx_base; }; /* "PETSc/DMDA.pyx":17 * # -------------------------------------------------------------------- * * cdef class DMDA(DM): # <<<<<<<<<<<<<< * * StencilType = DMDAStencilType */ struct __pyx_obj_8petsc4py_5PETSc_DMDA { struct PyPetscDMObject __pyx_base; }; /* "PETSc/DMPlex.pyx":3 * # -------------------------------------------------------------------- * * cdef class DMPlex(DM): # <<<<<<<<<<<<<< * * def create(self, comm=None): */ struct __pyx_obj_8petsc4py_5PETSc_DMPlex { struct PyPetscDMObject __pyx_base; }; /* "PETSc/DMStag.pyx":40 * # -------------------------------------------------------------------- * * cdef class DMStag(DM): # <<<<<<<<<<<<<< * * StencilType = DMStagStencilType */ struct __pyx_obj_8petsc4py_5PETSc_DMStag { struct PyPetscDMObject __pyx_base; }; /* "PETSc/DMComposite.pyx":3 * # -------------------------------------------------------------------- * * cdef class DMComposite(DM): # <<<<<<<<<<<<<< * * def create(self, comm=None): */ struct __pyx_obj_8petsc4py_5PETSc_DMComposite { struct PyPetscDMObject __pyx_base; }; /* "PETSc/DMShell.pyx":1 * cdef class DMShell(DM): # <<<<<<<<<<<<<< * * def create(self, comm=None): */ struct __pyx_obj_8petsc4py_5PETSc_DMShell { struct PyPetscDMObject __pyx_base; }; /* "PETSc/DMSwarm.pyx":25 * * * cdef class DMSwarm(DM): # <<<<<<<<<<<<<< * * Type = DMSwarmType */ struct __pyx_obj_8petsc4py_5PETSc_DMSwarm { struct PyPetscDMObject __pyx_base; }; /* "PETSc/Log.pyx":92 * * @classmethod * def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<< * """Decorate a function with a PETSc event. * */ struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator { PyObject_HEAD PyTypeObject *__pyx_v_cls; PyObject *__pyx_v_klass; PyObject *__pyx_v_name; }; /* "PETSc/Log.pyx":108 * ... * """ * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator { PyObject_HEAD struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_outer_scope; PyObject *__pyx_v_func; }; /* "View.MemoryView":105 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< * * cdef: */ struct __pyx_array_obj { PyObject_HEAD struct __pyx_vtabstruct_array *__pyx_vtab; char *data; Py_ssize_t len; char *format; int ndim; Py_ssize_t *_shape; Py_ssize_t *_strides; Py_ssize_t itemsize; PyObject *mode; PyObject *_format; void (*callback_free_data)(void *); int free_data; int dtype_is_object; }; /* "View.MemoryView":279 * * @cname('__pyx_MemviewEnum') * cdef class Enum(object): # <<<<<<<<<<<<<< * cdef object name * def __init__(self, name): */ struct __pyx_MemviewEnum_obj { PyObject_HEAD PyObject *name; }; /* "View.MemoryView":330 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< * * cdef object obj */ struct __pyx_memoryview_obj { PyObject_HEAD struct __pyx_vtabstruct_memoryview *__pyx_vtab; PyObject *obj; PyObject *_size; PyObject *_array_interface; PyThread_type_lock lock; __pyx_atomic_int acquisition_count[2]; __pyx_atomic_int *acquisition_count_aligned_p; Py_buffer view; int flags; int dtype_is_object; __Pyx_TypeInfo *typeinfo; }; /* "View.MemoryView":965 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" * */ struct __pyx_memoryviewslice_obj { struct __pyx_memoryview_obj __pyx_base; __Pyx_memviewslice from_slice; PyObject *from_object; PyObject *(*to_object_func)(char *); int (*to_dtype_func)(char *, PyObject *); }; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type; /* "PETSc/Object.pyx":3 * # -------------------------------------------------------------------- * * cdef class Object: # <<<<<<<<<<<<<< * * # --- special methods --- */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Object { PyObject *(*get_attr)(struct PyPetscObjectObject *, char *); PyObject *(*set_attr)(struct PyPetscObjectObject *, char *, PyObject *); PyObject *(*get_dict)(struct PyPetscObjectObject *); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *__pyx_vtabptr_8petsc4py_5PETSc_Object; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscViewer_Type; /* "PETSc/Viewer.pyx":85 * # -------------------------------------------------------------------- * * cdef class Viewer(Object): # <<<<<<<<<<<<<< * * Type = ViewerType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer *__pyx_vtabptr_8petsc4py_5PETSc_Viewer; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRandom_Type; /* "PETSc/Random.pyx":12 * # -------------------------------------------------------------------- * * cdef class Random(Object): # <<<<<<<<<<<<<< * * Type = RandomType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Random { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Random *__pyx_vtabptr_8petsc4py_5PETSc_Random; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscIS_Type; /* "PETSc/IS.pyx":10 * # -------------------------------------------------------------------- * * cdef class IS(Object): # <<<<<<<<<<<<<< * * Type = ISType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_IS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *__pyx_vtabptr_8petsc4py_5PETSc_IS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscLGMap_Type; /* "PETSc/IS.pyx":362 * # -------------------------------------------------------------------- * * cdef class LGMap(Object): # <<<<<<<<<<<<<< * * MapMode = GLMapMode */ struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap *__pyx_vtabptr_8petsc4py_5PETSc_LGMap; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSF_Type; /* "PETSc/SF.pyx":15 * # -------------------------------------------------------------------- * * cdef class SF(Object): # <<<<<<<<<<<<<< * * Type = SFType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_SF { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SF *__pyx_vtabptr_8petsc4py_5PETSc_SF; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscVec_Type; /* "PETSc/Vec.pyx":25 * # -------------------------------------------------------------------- * * cdef class Vec(Object): # <<<<<<<<<<<<<< * * Type = VecType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *__pyx_vtabptr_8petsc4py_5PETSc_Vec; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscFE_Type; /* "PETSc/FE.pyx":10 * # -------------------------------------------------------------------- * * cdef class FE(Object): # <<<<<<<<<<<<<< * * Type = FEType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_FE { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_FE *__pyx_vtabptr_8petsc4py_5PETSc_FE; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscQuad_Type; /* "PETSc/DT.pyx":3 * # -------------------------------------------------------------------- * * cdef class Quad(Object): # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad *__pyx_vtabptr_8petsc4py_5PETSc_Quad; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscScatter_Type; /* "PETSc/Scatter.pyx":15 * # -------------------------------------------------------------------- * * cdef class Scatter(Object): # <<<<<<<<<<<<<< * * Type = ScatterType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter *__pyx_vtabptr_8petsc4py_5PETSc_Scatter; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSection_Type; /* "PETSc/Section.pyx":3 * # -------------------------------------------------------------------- * * cdef class Section(Object): # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Section { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Section *__pyx_vtabptr_8petsc4py_5PETSc_Section; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscMat_Type; /* "PETSc/Mat.pyx":196 * # -------------------------------------------------------------------- * * cdef class Mat(Object): # <<<<<<<<<<<<<< * * Type = MatType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *__pyx_vtabptr_8petsc4py_5PETSc_Mat; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type; /* "PETSc/Mat.pyx":1656 * # -------------------------------------------------------------------- * * cdef class NullSpace(Object): # <<<<<<<<<<<<<< * * # */ struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *__pyx_vtabptr_8petsc4py_5PETSc_NullSpace; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPC_Type; /* "PETSc/PC.pyx":120 * # -------------------------------------------------------------------- * * cdef class PC(Object): # <<<<<<<<<<<<<< * * Type = PCType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_PC { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *__pyx_vtabptr_8petsc4py_5PETSc_PC; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscKSP_Type; /* "PETSc/KSP.pyx":93 * # -------------------------------------------------------------------- * * cdef class KSP(Object): # <<<<<<<<<<<<<< * * Type = KSPType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *__pyx_vtabptr_8petsc4py_5PETSc_KSP; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNES_Type; /* "PETSc/SNES.pyx":65 * # -------------------------------------------------------------------- * * cdef class SNES(Object): # <<<<<<<<<<<<<< * * Type = SNESType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *__pyx_vtabptr_8petsc4py_5PETSc_SNES; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type; /* "PETSc/TS.pyx":102 * # ----------------------------------------------------------------------------- * * cdef class TS(Object): # <<<<<<<<<<<<<< * * Type = TSType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_TS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *__pyx_vtabptr_8petsc4py_5PETSc_TS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAO_Type; /* "PETSc/TAO.pyx":65 * # -------------------------------------------------------------------- * * cdef class TAO(Object): # <<<<<<<<<<<<<< * * """ */ struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *__pyx_vtabptr_8petsc4py_5PETSc_TAO; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscAO_Type; /* "PETSc/AO.pyx":11 * # -------------------------------------------------------------------- * * cdef class AO(Object): # <<<<<<<<<<<<<< * * Type = AOType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_AO { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_AO *__pyx_vtabptr_8petsc4py_5PETSc_AO; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDM_Type; /* "PETSc/DM.pyx":29 * # -------------------------------------------------------------------- * * cdef class DM(Object): # <<<<<<<<<<<<<< * * Type = DMType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DM { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *__pyx_vtabptr_8petsc4py_5PETSc_DM; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type; /* "PETSc/DS.pyx":8 * # -------------------------------------------------------------------- * * cdef class DS(Object): # <<<<<<<<<<<<<< * * Type = DSType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DS { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DS *__pyx_vtabptr_8petsc4py_5PETSc_DS; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type; /* "PETSc/Partitioner.pyx":14 * # -------------------------------------------------------------------- * * cdef class Partitioner(Object): # <<<<<<<<<<<<<< * * Type = PartitionerType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner *__pyx_vtabptr_8petsc4py_5PETSc_Partitioner; __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type; /* "PETSc/DMLabel.pyx":2 * * cdef class DMLabel(Object): # <<<<<<<<<<<<<< * * def __cinit__(self): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel { struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel *__pyx_vtabptr_8petsc4py_5PETSc_DMLabel; /* "PETSc/petscis.pxi":118 * # -------------------------------------------------------------------- * * cdef class _IS_buffer: # <<<<<<<<<<<<<< * * cdef PetscIS iset */ struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer { int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); int (*release)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); int (*acquirebuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *, int); int (*releasebuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *); PyObject *(*enter)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); PyObject *(*exit)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *); Py_ssize_t (*getbuffer)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, void **); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *__pyx_vtabptr_8petsc4py_5PETSc__IS_buffer; /* "PETSc/petscvec.pxi":437 * return 0 * * cdef class _Vec_buffer: # <<<<<<<<<<<<<< * * cdef PetscVec vec */ struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer { int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); int (*release)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); int (*acquirebuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *, int); int (*releasebuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *); PyObject *(*enter)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); PyObject *(*exit)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *); Py_ssize_t (*getbuffer)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, void **); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *__pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer; /* "PETSc/petscdmda.pxi":198 * # -------------------------------------------------------------------- * * cdef class _DMDA_Vec_array(object): # <<<<<<<<<<<<<< * * cdef _Vec_buffer vecbuf */ struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array { int (*acquire)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *); int (*release)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *); }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array; /* "PETSc/Viewer.pyx":365 * # -------------------------------------------------------------------- * * cdef class ViewerHDF5(Viewer): # <<<<<<<<<<<<<< * * def create(self, name, mode=None, comm=None): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 { struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 *__pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5; /* "PETSc/DMDA.pyx":17 * # -------------------------------------------------------------------- * * cdef class DMDA(DM): # <<<<<<<<<<<<<< * * StencilType = DMDAStencilType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA *__pyx_vtabptr_8petsc4py_5PETSc_DMDA; /* "PETSc/DMPlex.pyx":3 * # -------------------------------------------------------------------- * * cdef class DMPlex(DM): # <<<<<<<<<<<<<< * * def create(self, comm=None): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex *__pyx_vtabptr_8petsc4py_5PETSc_DMPlex; /* "PETSc/DMStag.pyx":40 * # -------------------------------------------------------------------- * * cdef class DMStag(DM): # <<<<<<<<<<<<<< * * StencilType = DMStagStencilType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMStag { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMStag *__pyx_vtabptr_8petsc4py_5PETSc_DMStag; /* "PETSc/DMComposite.pyx":3 * # -------------------------------------------------------------------- * * cdef class DMComposite(DM): # <<<<<<<<<<<<<< * * def create(self, comm=None): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMComposite { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMComposite *__pyx_vtabptr_8petsc4py_5PETSc_DMComposite; /* "PETSc/DMShell.pyx":1 * cdef class DMShell(DM): # <<<<<<<<<<<<<< * * def create(self, comm=None): */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *__pyx_vtabptr_8petsc4py_5PETSc_DMShell; /* "PETSc/DMSwarm.pyx":25 * * * cdef class DMSwarm(DM): # <<<<<<<<<<<<<< * * Type = DMSwarmType */ struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm { struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_base; }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm *__pyx_vtabptr_8petsc4py_5PETSc_DMSwarm; /* "View.MemoryView":105 * * @cname("__pyx_array") * cdef class array: # <<<<<<<<<<<<<< * * cdef: */ struct __pyx_vtabstruct_array { PyObject *(*get_memview)(struct __pyx_array_obj *); }; static struct __pyx_vtabstruct_array *__pyx_vtabptr_array; /* "View.MemoryView":330 * * @cname('__pyx_memoryview') * cdef class memoryview(object): # <<<<<<<<<<<<<< * * cdef object obj */ struct __pyx_vtabstruct_memoryview { char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *); PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *); PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *); PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *); PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *); PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *); }; static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview; /* "View.MemoryView":965 * * @cname('__pyx_memoryviewslice') * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<< * "Internal class for passing memoryview slices to Python" * */ struct __pyx_vtabstruct__memoryviewslice { struct __pyx_vtabstruct_memoryview __pyx_base; }; static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* decode_bytes.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_bytes( PyObject* string, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { return __Pyx_decode_c_bytes( PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string), start, stop, encoding, errors, decode_func); } /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* WriteUnraisableException.proto */ static void __Pyx_WriteUnraisable(const char *name, int clineno, int lineno, const char *filename, int full_traceback, int nogil); /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* pop_index.proto */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix); static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix); #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\ __Pyx__PyList_PopIndex(L, py_ix, ix) : (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix))) #else #define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\ __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) #define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\ (unlikely((py_ix) == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\ __Pyx__PyObject_PopIndex(L, py_ix)) #endif /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* ExtTypeTest.proto */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* py_dict_pop.proto */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* py_dict_keys.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); /* CallUnboundCMethod0.proto */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ (likely((cfunc)->func) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ (PY_VERSION_HEX >= 0x030700A0 ?\ (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif /* MemviewSliceInit.proto */ #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d #define __Pyx_MEMVIEW_DIRECT 1 #define __Pyx_MEMVIEW_PTR 2 #define __Pyx_MEMVIEW_FULL 4 #define __Pyx_MEMVIEW_CONTIG 8 #define __Pyx_MEMVIEW_STRIDED 16 #define __Pyx_MEMVIEW_FOLLOW 32 #define __Pyx_IS_C_CONTIG 1 #define __Pyx_IS_F_CONTIG 2 static int __Pyx_init_memviewslice( struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, int memview_is_new_reference); static CYTHON_INLINE int __pyx_add_acquisition_count_locked( __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); static CYTHON_INLINE int __pyx_sub_acquisition_count_locked( __pyx_atomic_int *acquisition_count, PyThread_type_lock lock); #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p) #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview)) #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__) #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__) static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int); static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int); /* PyIntCompare.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* SetItemInt.proto */ #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\ __Pyx_SetItemInt_Generic(o, to_py_func(i), v))) static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v); static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); __Pyx_SET_SIZE(list, len + 1); return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* StringJoin.proto */ #if PY_MAJOR_VERSION < 3 #define __Pyx_PyString_Join __Pyx_PyBytes_Join #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v)) #else #define __Pyx_PyString_Join PyUnicode_Join #define __Pyx_PyBaseString_Join PyUnicode_Join #endif #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION < 3 #define __Pyx_PyBytes_Join _PyString_Join #else #define __Pyx_PyBytes_Join _PyBytes_Join #endif #else static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); #endif /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); #if PY_MAJOR_VERSION < 3 if (unlikely(PyInstance_Check(obj))) return __Pyx_PyObject_GetAttrStr(obj, attr_name); #endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; if (!f) { Py_INCREF(res); } else { res = f(res, obj, (PyObject *)tp); } } else { PyErr_SetObject(PyExc_AttributeError, attr_name); } return res; } #else #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunctionShared.proto */ #define __Pyx_CyFunction_USED 1 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; size_t defaults_size; // used by FusedFunction for copying defaults int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* CythonFunction.proto */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject *globals, PyObject* code); /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); /* pop.proto */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) #else #define __Pyx_PyList_Pop(L) __Pyx__PyObject_Pop(L) #define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) #endif /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* SliceObject.proto */ #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) static CYTHON_INLINE int __Pyx_PyObject_SetSlice( PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* CallableCheck.proto */ #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif /* SliceTupleAndList.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop); #else #define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #endif /* py_dict_clear.proto */ #define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0) /* UnaryNegOverflows.proto */ #define UNARY_NEG_WOULD_OVERFLOW(x)\ (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x))) static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/ /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* RaiseNoneIterError.proto */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ /* ListExtend.proto */ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { #if CYTHON_COMPILING_IN_CPYTHON PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; Py_DECREF(none); return 0; #else return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v); #endif } /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* PyObject_Unicode.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) #else #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) #endif /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* PyObjectGetAttrStrNoError.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* ClassMethod.proto */ #include "descrobject.h" static CYTHON_UNUSED PyObject* __Pyx_Method_ClassMethod(PyObject *method); /* GetNameInClass.proto */ #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); /* RegisterModuleCleanup.proto */ static void __pyx_module_cleanup(PyObject *self); #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static int __Pyx_RegisterCleanup(void); #else #define __Pyx_RegisterCleanup() (0) #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags); static void __Pyx_ReleaseBuffer(Py_buffer *view); #else #define __Pyx_GetBuffer PyObject_GetBuffer #define __Pyx_ReleaseBuffer PyBuffer_Release #endif /* BufferStructDeclare.proto */ typedef struct { Py_ssize_t shape, strides, suboffsets; } __Pyx_Buf_DimInfo; typedef struct { size_t refcount; Py_buffer pybuffer; } __Pyx_Buffer; typedef struct { __Pyx_Buffer *rcbuffer; char *data; __Pyx_Buf_DimInfo diminfo[8]; } __Pyx_LocalBuf_ND; /* MemviewSliceIsContig.proto */ static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim); /* OverlappingSlices.proto */ static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, __Pyx_memviewslice *slice2, int ndim, size_t itemsize); /* Capsule.proto */ static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig); /* GCCDiagnostics.proto */ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) #define __Pyx_HAS_GCC_DIAGNOSTIC #endif /* MemviewDtypeToObject.proto */ static CYTHON_INLINE PyObject *__pyx_memview_get_nn_PetscInt(const char *itemp); static CYTHON_INLINE int __pyx_memview_set_nn_PetscInt(const char *itemp, PyObject *obj); static PyObject* __pyx_convert__to_py_PetscEventPerfInfo(PetscEventPerfInfo s); struct __pyx_t_8petsc4py_5PETSc_DLDataType; static PyObject* __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(struct __pyx_t_8petsc4py_5PETSc_DLDataType s); static PyObject* __pyx_convert__to_py_MatInfo(MatInfo s); /* MemviewSliceCopyTemplate.proto */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, const char *mode, int ndim, size_t sizeof_dtype, int contig_flag, int dtype_is_object); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_InsertMode(InsertMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ScatterMode(ScatterMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NormType(NormType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscViewerFormat(PetscViewerFormat value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscFileMode(PetscFileMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ISGlobalToLocalMappingMode(ISGlobalToLocalMappingMode value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_VecOption(VecOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatOption(MatOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatAssemblyType(MatAssemblyType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatInfoType(MatInfoType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatStructure(MatStructure value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatFactorShiftType(MatFactorShiftType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatSORType(MatSORType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCSide(PCSide value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCASMType(PCASMType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCGASMType(PCGASMType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGType(PCMGType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGCycleType(PCMGCycleType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCCompositeType(PCCompositeType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurPreType(PCFieldSplitSchurPreType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurFactType(PCFieldSplitSchurFactType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCPatchConstructType(PCPatchConstructType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPNormType(KSPNormType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPConvergedReason(KSPConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESNormSchedule(SNESNormSchedule value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESConvergedReason(SNESConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSProblemType(TSProblemType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSEquationType(TSEquationType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSExactFinalTimeOption(TSExactFinalTimeOption value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSConvergedReason(TSConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoConvergedReason(TaoConvergedReason value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMBoundaryType(DMBoundaryType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAStencilType(DMDAStencilType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAInterpolationType(DMDAInterpolationType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAElementType(DMDAElementType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilType(DMStagStencilType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilLocation(DMStagStencilLocation value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmType(DMSwarmType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmMigrateType(DMSwarmMigrateType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmCollectType(DMSwarmCollectType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSwarmPICLayoutType value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* TypeInfoToFormat.proto */ struct __pyx_typeinfo_string { char string[3]; }; static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type); /* CIntFromPy.proto */ static CYTHON_INLINE PetscInt __Pyx_PyInt_As_PetscInt(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscInt(PetscInt value); /* CIntFromPy.proto */ static CYTHON_INLINE InsertMode __Pyx_PyInt_As_InsertMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE ScatterMode __Pyx_PyInt_As_ScatterMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscFileMode __Pyx_PyInt_As_PetscFileMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatStructure __Pyx_PyInt_As_MatStructure(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatAssemblyType __Pyx_PyInt_As_MatAssemblyType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatInfoType __Pyx_PyInt_As_MatInfoType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE MatFactorShiftType __Pyx_PyInt_As_MatFactorShiftType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE KSPConvergedReason __Pyx_PyInt_As_KSPConvergedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SNESConvergedReason __Pyx_PyInt_As_SNESConvergedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TaoConvergedReason __Pyx_PyInt_As_TaoConvergedReason(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMBoundaryType __Pyx_PyInt_As_DMBoundaryType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMDAStencilType __Pyx_PyInt_As_DMDAStencilType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMDAInterpolationType __Pyx_PyInt_As_DMDAInterpolationType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMDAElementType __Pyx_PyInt_As_DMDAElementType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMStagStencilType __Pyx_PyInt_As_DMStagStencilType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMStagStencilLocation __Pyx_PyInt_As_DMStagStencilLocation(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscClassId __Pyx_PyInt_As_PetscClassId(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogStage(PetscLogStage value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscClassId(PetscClassId value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogEvent(PetscLogEvent value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MPI_Fint(MPI_Fint value); /* CIntFromPy.proto */ static CYTHON_INLINE PetscViewerFormat __Pyx_PyInt_As_PetscViewerFormat(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PetscBool __Pyx_PyInt_As_PetscBool(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); /* CIntFromPy.proto */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE ISGlobalToLocalMappingMode __Pyx_PyInt_As_ISGlobalToLocalMappingMode(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value); /* CIntFromPy.proto */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value); /* CIntFromPy.proto */ static CYTHON_INLINE VecOption __Pyx_PyInt_As_VecOption(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE NormType __Pyx_PyInt_As_NormType(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscOffloadMask(PetscOffloadMask value); /* CIntFromPy.proto */ static CYTHON_INLINE MatOption __Pyx_PyInt_As_MatOption(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatDuplicateOption(MatDuplicateOption value); /* CIntFromPy.proto */ static CYTHON_INLINE PCASMType __Pyx_PyInt_As_PCASMType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCGASMType __Pyx_PyInt_As_PCGASMType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCCompositeType __Pyx_PyInt_As_PCCompositeType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCFieldSplitSchurFactType __Pyx_PyInt_As_PCFieldSplitSchurFactType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCFieldSplitSchurPreType __Pyx_PyInt_As_PCFieldSplitSchurPreType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCMGType __Pyx_PyInt_As_PCMGType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCMGCycleType __Pyx_PyInt_As_PCMGCycleType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCPatchConstructType __Pyx_PyInt_As_PCPatchConstructType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE PCSide __Pyx_PyInt_As_PCSide(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE KSPNormType __Pyx_PyInt_As_KSPNormType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE SNESNormSchedule __Pyx_PyInt_As_SNESNormSchedule(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSProblemType __Pyx_PyInt_As_TSProblemType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSEquationType __Pyx_PyInt_As_TSEquationType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSExactFinalTimeOption __Pyx_PyInt_As_TSExactFinalTimeOption(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE TSConvergedReason __Pyx_PyInt_As_TSConvergedReason(PyObject *); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscBool(PetscBool value); /* CIntFromPy.proto */ static CYTHON_INLINE DMSwarmType __Pyx_PyInt_As_DMSwarmType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE DMSwarmPICLayoutType __Pyx_PyInt_As_DMSwarmPICLayoutType(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); /* IsLittleEndian.proto */ static CYTHON_INLINE int __Pyx_Is_Little_Endian(void); /* BufferFormatCheck.proto */ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts); static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, __Pyx_TypeInfo* type); /* TypeInfoCompare.proto */ static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b); /* MemviewSliceValidateAndInit.proto */ static int __Pyx_ValidateAndInit_memviewslice( int *axes_specs, int c_or_f_flag, int buf_flags, int ndim, __Pyx_TypeInfo *dtype, __Pyx_BufFmt_StackElem stack[], __Pyx_memviewslice *memviewslice, PyObject *original_obj); /* ObjectToMemviewSlice.proto */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(PyObject *, int writable_flag); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto*/ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, void **__pyx_v_p); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto*/ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, void **__pyx_v_p); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto*/ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_release(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_set_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name, PyObject *__pyx_v_attr); /* proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_dict(struct PyPetscObjectObject *__pyx_v_self); /* proto*/ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ /* Module declarations from 'cython.view' */ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ /* Module declarations from 'cython' */ /* Module declarations from 'numpy' */ /* Module declarations from 'petsc4py.PETSc' */ static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Comm = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Object = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Viewer = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Random = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_IS = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LGMap = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SF = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Vec = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_FE = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Quad = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Scatter = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Section = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Mat = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_NullSpace = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_PC = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_KSP = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_SNES = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TS = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAO = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_AO = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DM = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DS = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Partitioner = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMLabel = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_dtype = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_ndarray = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__IS_buffer = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Vec_buffer = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__Mat_Stencil = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc__DMComposite_access = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Options = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Sys = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Log = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogStage = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogClass = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_LogEvent = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMDA = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMPlex = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMStag = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMComposite = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMShell = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMSwarm = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = 0; static PyTypeObject *__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = 0; static PyTypeObject *__pyx_array_type = 0; static PyTypeObject *__pyx_MemviewEnum_type = 0; static PyTypeObject *__pyx_memoryview_type = 0; static PyTypeObject *__pyx_memoryviewslice_type = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_PetscError = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_citations_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_stage_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_class_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_event_registry = 0; static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_NULL__ = 0; static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_SELF__ = 0; static struct PyPetscCommObject *__pyx_v_8petsc4py_5PETSc___COMM_WORLD__ = 0; static MPI_Comm __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT; static PyObject *__pyx_v_8petsc4py_5PETSc_type_registry = 0; static PyObject *__pyx_v_8petsc4py_5PETSc_tracebacklist = 0; static int __pyx_v_8petsc4py_5PETSc_PyPetsc_Argc; static char **__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv; static int __pyx_v_8petsc4py_5PETSc_registercalled; static char const *__pyx_v_8petsc4py_5PETSc_citation; static PyObject *generic = 0; static PyObject *strided = 0; static PyObject *indirect = 0; static PyObject *contiguous = 0; static PyObject *indirect_contiguous = 0; static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; static int __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(int, PyTypeObject *); /*proto*/ static PyTypeObject *__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_bytes2str(char const *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_str2bytes(PyObject *, char const **); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_S_(char const *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_SETERR(int); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_CHKERR(int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toBool(PetscBool); /*proto*/ static CYTHON_INLINE PetscBool __pyx_f_8petsc4py_5PETSc_asBool(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toInt(PetscInt); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asInt(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toReal(PetscReal); /*proto*/ static CYTHON_INLINE PetscReal __pyx_f_8petsc4py_5PETSc_asReal(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toScalar(PetscScalar); /*proto*/ static CYTHON_INLINE PetscScalar __pyx_f_8petsc4py_5PETSc_asScalar(PyObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_asarray(PyObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_arange(PyObject *, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_i(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_r(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_s(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_c(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_p(PetscInt); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_i(PetscInt, PetscInt const *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_r(PetscInt, PetscReal const *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_s(PetscInt, PetscScalar const *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray(PyObject *, int); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_i(PyObject *, PetscInt *, PetscInt **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_r(PyObject *, PetscInt *, PetscReal **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_b(PyObject *, PetscInt *, PetscBool **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray(PyObject *, int); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_i(PyObject *, PetscInt *, PetscInt **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_r(PyObject *, PetscInt *, PetscReal **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_p(PyObject *, PetscInt *, void **); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ofarray_s(PyObject *, PetscInt *, PetscScalar **); /*proto*/ static CYTHON_INLINE InsertMode __pyx_f_8petsc4py_5PETSc_insertmode(PyObject *); /*proto*/ static CYTHON_INLINE ScatterMode __pyx_f_8petsc4py_5PETSc_scattermode(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getprefix(PyObject *, struct __pyx_opt_args_8petsc4py_5PETSc_getprefix *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_opt2str(char const *, char const *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Bool(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Int(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Real(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Scalar(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_String(PetscOptions, char const *, char const *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getpair(PyObject *, PyObject *, char const **, char const **); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt(PetscOptions, enum __pyx_t_8petsc4py_5PETSc_PetscOptType, PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_tokenize(PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_iskey(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_gettok(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_getkey(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_parseopt(PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(MPI_Comm); /*proto*/ static CYTHON_INLINE MPI_Datatype __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(PyObject *); /*proto*/ static CYTHON_INLINE MPI_Op __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC(MPI_Comm *); /*proto*/ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_def_Comm(PyObject *, MPI_Comm); /*proto*/ static CYTHON_INLINE struct PyPetscCommObject *__pyx_f_8petsc4py_5PETSc_new_Comm(MPI_Comm); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_size(MPI_Comm); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_rank(MPI_Comm); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Sys_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Sys_Layout(MPI_Comm, PetscInt, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_event_args2objs(PyObject *, PetscObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscINCREF(PetscObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscCLEAR(PetscObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscDEALLOC(PetscObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscINCSTATE(PetscObject *); /*proto*/ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_Py_DecRef(PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PetscDelPyDict(void *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyDict(PetscObject, int); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyObj(PetscObject, char *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscSetPyObj(PetscObject, char *, PyObject *); /*proto*/ static CYTHON_INLINE Py_intptr_t __pyx_f_8petsc4py_5PETSc_Object_toFortran(PetscObject); /*proto*/ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_DM(DM); /*proto*/ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_Object(PetscObject); /*proto*/ static CYTHON_INLINE PetscFileMode __pyx_f_8petsc4py_5PETSc_filemode(PyObject *); /*proto*/ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_ref_IS(IS); /*proto*/ static CYTHON_INLINE struct PyPetscLGMapObject *__pyx_f_8petsc4py_5PETSc_ref_LGMap(ISLocalToGlobalMapping); /*proto*/ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_ref_Vec(Vec); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_pos(struct PyPetscVecObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_neg(struct PyPetscVecObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_abs(struct PyPetscVecObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_iadd(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_isub(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_imul(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_idiv(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_add(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_sub(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_mul(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_div(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_radd(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rsub(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rmul(struct PyPetscVecObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rdiv(struct PyPetscVecObject *, PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Vec_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vecsetvalues(Vec, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_vecgetvalues(Vec, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_r(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_w(struct PyPetscVecObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vec_setarray(struct PyPetscVecObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_getitem(struct PyPetscVecObject *, PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_vec_setitem(struct PyPetscVecObject *, PyObject *, PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_Vec_AcquireArray(Vec, PetscScalar **, int); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(Vec, PetscScalar **, int); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_pycapsule_deleter(PyObject *); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_manager_deleter(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *); /*proto*/ static CYTHON_INLINE struct PyPetscNullSpaceObject *__pyx_f_8petsc4py_5PETSc_ref_NullSpace(MatNullSpace); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_NullSpace_Function(MatNullSpace, Vec, void *); /*proto*/ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_ref_Mat(Mat); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_pos(struct PyPetscMatObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_neg(struct PyPetscMatObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_iadd(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_isub(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_imul(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_idiv(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_add(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_sub(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_mul(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_mat_mul_vec(struct PyPetscMatObject *, struct PyPetscVecObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_div(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_radd(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rsub(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rmul(struct PyPetscMatObject *, PyObject *); /*proto*/ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rdiv(struct PyPetscMatObject *, PyObject *); /*proto*/ static CYTHON_INLINE MatStructure __pyx_f_8petsc4py_5PETSc_matstructure(PyObject *); /*proto*/ static CYTHON_INLINE MatAssemblyType __pyx_f_8petsc4py_5PETSc_assemblytype(PyObject *); /*proto*/ static CYTHON_INLINE MatInfoType __pyx_f_8petsc4py_5PETSc_infotype(PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_Sizes(PyObject *, PyObject *, PetscInt *, PetscInt *, PetscInt *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_Create(MatType, PyObject *, PyObject *, PyObject *, Mat *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(Mat, PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(Mat, PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(Mat, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_Mat_AllocDense(Mat, PyObject *); /*proto*/ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(Mat, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(Mat, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_matgetvalues(Mat, PyObject *, PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE MatFactorShiftType __pyx_f_8petsc4py_5PETSc_matfactorshifttype(PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_matfactorinfo(PetscBool, PetscBool, PyObject *, MatFactorInfo *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_getitem(struct PyPetscMatObject *, PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_mat_setitem(struct PyPetscMatObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_matsetvaluestencil(Mat, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *, PyObject *, InsertMode, int); /*proto*/ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_ref_PC(PC); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator(PC, PetscInt, Vec, Mat, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction(PC, PetscInt, Vec, Vec, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets(PC, PetscInt, Vec, Mat, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets(PC, PetscInt, Vec, Vec, IS, PetscInt, PetscInt const *, PetscInt const *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator(PC, PetscInt *, IS **, IS *, void *); /*proto*/ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_ref_KSP(KSP); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_KSP_Converged(KSP, PetscInt, PetscReal, KSPConvergedReason *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_KSP_Monitor(KSP, PetscInt, PetscReal, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS(KSP, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps(KSP, Mat, Mat, void *); /*proto*/ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_ref_SNES(SNES); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess(SNES, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_PreCheck(SNESLineSearch, Vec, Vec, PetscBool *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_Function(SNES, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_Update(SNES, PetscInt); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_Jacobian(SNES, Vec, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_Objective(SNES, Vec, PetscReal *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_NGS(SNES, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_Converged(SNES, PetscInt, PetscReal, PetscReal, PetscReal, SNESConvergedReason *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_SNES_Monitor(SNES, PetscInt, PetscReal, void *); /*proto*/ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_ref_TS(TS); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_RHSFunction(TS, PetscReal, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_RHSJacobian(TS, PetscReal, Vec, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_IFunction(TS, PetscReal, Vec, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_IJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_IJacobianP(TS, PetscReal, Vec, Vec, PetscReal, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_I2Function(TS, PetscReal, Vec, Vec, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_I2Jacobian(TS, PetscReal, Vec, Vec, Vec, PetscReal, PetscReal, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_Monitor(TS, PetscInt, PetscReal, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_EventHandler(TS, PetscReal, Vec, PetscScalar *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_PostEvent(TS, PetscInt, PetscInt *, PetscReal, Vec, PetscBool, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_PreStep(TS); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_PostStep(TS); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP(TS, PetscReal, Vec, Mat, void *); /*proto*/ static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_ref_TAO(Tao); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Objective(Tao, Vec, PetscReal *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Residual(Tao, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Gradient(Tao, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_ObjGrad(Tao, Vec, PetscReal *, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegObjGrad(Tao, Vec, PetscReal *, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Constraints(Tao, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_VarBounds(Tao, Vec, Vec, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Hessian(Tao, Vec, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegHessian(Tao, Vec, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Jacobian(Tao, Vec, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_JacobianResidual(Tao, Vec, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_JacobianState(Tao, Vec, Mat, Mat, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_JacobianDesign(Tao, Vec, Mat, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Converged(Tao, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_TAO_Monitor(Tao, void *); /*proto*/ static CYTHON_INLINE DMBoundaryType __pyx_f_8petsc4py_5PETSc_asBoundaryType(PyObject *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asBoundary(PyObject *, DMBoundaryType *, DMBoundaryType *, DMBoundaryType *); /*proto*/ static CYTHON_INLINE struct PyPetscDMObject *__pyx_f_8petsc4py_5PETSc_ref_DM(DM); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DM_PyCoarsenHook(DM, DM, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DM_PyRestrictHook(DM, Mat, Vec, Mat, DM, void *); /*proto*/ static CYTHON_INLINE DMDAStencilType __pyx_f_8petsc4py_5PETSc_asStencil(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStencil(DMDAStencilType); /*proto*/ static CYTHON_INLINE DMDAInterpolationType __pyx_f_8petsc4py_5PETSc_dainterpolationtype(PyObject *); /*proto*/ static CYTHON_INLINE DMDAElementType __pyx_f_8petsc4py_5PETSc_daelementtype(PyObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_DMDAGetDim(DM, PetscInt *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDims(PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDims(PetscInt, PetscInt, PetscInt, PetscInt); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asOwnershipRanges(PyObject *, PetscInt, PetscInt *, PetscInt *, PetscInt *, PetscInt **, PetscInt **, PetscInt **); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toOwnershipRanges(PetscInt, PetscInt, PetscInt, PetscInt, PetscInt const *, PetscInt const *, PetscInt const *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index_exp(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index(PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE DMStagStencilType __pyx_f_8petsc4py_5PETSc_asStagStencil(PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagStencil(DMStagStencilType); /*proto*/ static CYTHON_INLINE DMStagStencilLocation __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(PyObject *); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asStagDims(PyObject *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagDims(PetscInt, PetscInt, PetscInt, PetscInt); /*proto*/ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDofs(PyObject *, PetscInt *, PetscInt *, PetscInt *, PetscInt *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDofs(PetscInt, PetscInt, PetscInt, PetscInt, PetscInt); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(PyObject *, PetscInt, PetscInt *, PetscInt *, PetscInt *, PetscInt **, PetscInt **, PetscInt **); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagOwnershipRanges(PetscInt, PetscInt, PetscInt, PetscInt, PetscInt const *, PetscInt const *, PetscInt const *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundary(DMBoundaryType); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundaryTypes(PetscInt, DMBoundaryType, DMBoundaryType, DMBoundaryType); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateGlobalVector(DM, Vec *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateLocalVector(DM, Vec *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalBegin(DM, Vec, InsertMode, Vec); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalEnd(DM, Vec, InsertMode, Vec); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalBegin(DM, Vec, InsertMode, Vec); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalEnd(DM, Vec, InsertMode, Vec); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalBegin(DM, Vec, InsertMode, Vec); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalEnd(DM, Vec, InsertMode, Vec); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateMatrix(DM, Mat *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_Coarsen(DM, MPI_Comm, DM *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_Refine(DM, MPI_Comm, DM *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInterpolation(DM, DM, Mat *, Vec *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInjection(DM, DM, Mat *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateRestriction(DM, DM, Mat *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateFieldDecomposition(DM, PetscInt *, char ***, IS **, DM **); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecomposition(DM, PetscInt *, char ***, IS **, IS **, DM **); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecompositionScatters(DM, PetscInt, DM *, VecScatter **, VecScatter **, VecScatter **); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateSubDM(DM, PetscInt, PetscInt const *, IS *, DM *); /*proto*/ static PetscBool __pyx_f_8petsc4py_5PETSc_get_citation(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_set_citation(PyObject *, int); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_get_LogStage(PyObject *); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_reg_LogStage(PyObject *, PetscLogStage); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_get_LogClass(PyObject *); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_reg_LogClass(PyObject *, PetscClassId); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_get_LogEvent(PyObject *); /*proto*/ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_reg_LogEvent(PyObject *, PetscLogEvent); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_tp_traverse(PyObject *, visitproc, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_tp_clear(PyObject *); /*proto*/ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_TypeEnableGC(PyTypeObject *); /*proto*/ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_setref(void *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PyPetscError_Set(int); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscComm_New(MPI_Comm); /*proto*/ static MPI_Comm __pyx_f_8petsc4py_5PETSc_PyPetscComm_Get(PyObject *); /*proto*/ static MPI_Comm *__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_New(PetscObject); /*proto*/ static PetscObject __pyx_f_8petsc4py_5PETSc_PyPetscObject_Get(PyObject *); /*proto*/ static PetscObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New(PetscViewer); /*proto*/ static PetscViewer __pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New(PetscRandom); /*proto*/ static PetscRandom __pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscIS_New(IS); /*proto*/ static IS __pyx_f_8petsc4py_5PETSc_PyPetscIS_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New(ISLocalToGlobalMapping); /*proto*/ static ISLocalToGlobalMapping __pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSF_New(PetscSF); /*proto*/ static PetscSF __pyx_f_8petsc4py_5PETSc_PyPetscSF_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscVec_New(Vec); /*proto*/ static Vec __pyx_f_8petsc4py_5PETSc_PyPetscVec_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New(VecScatter); /*proto*/ static VecScatter __pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSection_New(PetscSection); /*proto*/ static PetscSection __pyx_f_8petsc4py_5PETSc_PyPetscSection_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMat_New(Mat); /*proto*/ static Mat __pyx_f_8petsc4py_5PETSc_PyPetscMat_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPC_New(PC); /*proto*/ static PC __pyx_f_8petsc4py_5PETSc_PyPetscPC_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New(KSP); /*proto*/ static KSP __pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New(SNES); /*proto*/ static SNES __pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTS_New(TS); /*proto*/ static TS __pyx_f_8petsc4py_5PETSc_PyPetscTS_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New(Tao); /*proto*/ static Tao __pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscAO_New(AO); /*proto*/ static AO __pyx_f_8petsc4py_5PETSc_PyPetscAO_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDM_New(DM); /*proto*/ static DM __pyx_f_8petsc4py_5PETSc_PyPetscDM_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDS_New(PetscDS); /*proto*/ static PetscDS __pyx_f_8petsc4py_5PETSc_PyPetscDS_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New(PetscPartitioner); /*proto*/ static PetscPartitioner __pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscFE_New(PetscFE); /*proto*/ static PetscFE __pyx_f_8petsc4py_5PETSc_PyPetscFE_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New(PetscQuadrature); /*proto*/ static PetscQuadrature __pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get(PyObject *); /*proto*/ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New(DMLabel); /*proto*/ static DMLabel __pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get(PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_traceback(MPI_Comm, int, char const *, char const *, int, PetscErrorType, char const *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler(MPI_Comm, int, char const *, char const *, int, PetscErrorType, char const *, void *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_getinitargs(PyObject *, int *, char ***); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_delinitargs(int *, char ***); /*proto*/ static void __pyx_f_8petsc4py_5PETSc_finalize(void); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_initialize(PyObject *, PyObject *); /*proto*/ static int __pyx_f_8petsc4py_5PETSc_register(void); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static void *__pyx_align_pointer(void *, size_t); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/ static PyObject *_unellipsify(PyObject *, int); /*proto*/ static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/ static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/ static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/ static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/ static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/ static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/ static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/ static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/ static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/ static int __pyx_memoryview_err(PyObject *, char *); /*proto*/ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/ static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/ static __Pyx_TypeInfo __Pyx_TypeInfo_nn_PetscInt = { "PetscInt", NULL, sizeof(PetscInt), { 0 }, 0, IS_UNSIGNED(PetscInt) ? 'U' : 'I', IS_UNSIGNED(PetscInt), 0 }; #define __Pyx_MODULE_NAME "petsc4py.PETSc" extern int __pyx_module_is_main_petsc4py__PETSc; int __pyx_module_is_main_petsc4py__PETSc = 0; /* Implementation of 'petsc4py.PETSc' */ static PyObject *__pyx_builtin_object; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_SystemError; static PyObject *__pyx_builtin_Ellipsis; static PyObject *__pyx_builtin_NotImplementedError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_NotImplemented; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_A[] = "A"; static const char __pyx_k_B[] = "B"; static const char __pyx_k_C[] = "C"; static const char __pyx_k_D[] = "D"; static const char __pyx_k_G[] = "G"; static const char __pyx_k_H[] = "H"; static const char __pyx_k_I[] = "I"; static const char __pyx_k_J[] = "J"; static const char __pyx_k_L[] = "L"; static const char __pyx_k_O[] = "O"; static const char __pyx_k_P[] = "P"; static const char __pyx_k_R[] = "R"; static const char __pyx_k_S[] = "S"; static const char __pyx_k_T[] = "T"; static const char __pyx_k_U[] = "U"; static const char __pyx_k_V[] = "V"; static const char __pyx_k_W[] = "W"; static const char __pyx_k_X[] = "X"; static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_e[] = "e"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_j[] = "j"; static const char __pyx_k_l[] = "l"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_p[] = "p"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "%s"; static const char __pyx_k_t[] = "t"; static const char __pyx_k_u[] = "u"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_AO[] = "AO"; static const char __pyx_k_AU[] = "AU"; static const char __pyx_k_BE[] = "BE"; static const char __pyx_k_CG[] = "CG"; static const char __pyx_k_CN[] = "CN"; static const char __pyx_k_CP[] = "CP"; static const char __pyx_k_CR[] = "CR"; static const char __pyx_k_DA[] = "DA"; static const char __pyx_k_DM[] = "DM"; static const char __pyx_k_DS[] = "DS"; static const char __pyx_k_FE[] = "FE"; static const char __pyx_k_IS[] = "IS"; static const char __pyx_k_LU[] = "LU"; static const char __pyx_k_MG[] = "MG"; static const char __pyx_k_ML[] = "ML"; static const char __pyx_k_MS[] = "MS"; static const char __pyx_k_N1[] = "N1"; static const char __pyx_k_N2[] = "N2"; static const char __pyx_k_ND[] = "ND"; static const char __pyx_k_NM[] = "NM"; static const char __pyx_k_NN[] = "NN"; static const char __pyx_k_NO[] = "NO"; static const char __pyx_k_NZ[] = "NZ"; static const char __pyx_k_P1[] = "P1"; static const char __pyx_k_PC[] = "PC"; static const char __pyx_k_PD[] = "PD"; static const char __pyx_k_Q0[] = "Q0"; static const char __pyx_k_Q1[] = "Q1"; static const char __pyx_k_QN[] = "QN"; static const char __pyx_k_RK[] = "RK"; static const char __pyx_k_SF[] = "SF"; static const char __pyx_k_TH[] = "TH"; static const char __pyx_k_TS[] = "TS"; static const char __pyx_k_UA[] = "UA"; static const char __pyx_k_UP[] = "UP"; static const char __pyx_k_VU[] = "VU"; static const char __pyx_k__2[] = " "; static const char __pyx_k__4[] = "-"; static const char __pyx_k__7[] = ""; static const char __pyx_k_au[] = "au"; static const char __pyx_k_bs[] = "bs"; static const char __pyx_k_da[] = "da"; static const char __pyx_k_dm[] = "dm"; static const char __pyx_k_dt[] = "dt"; static const char __pyx_k_gv[] = "gv"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_is[] = "is_"; static const char __pyx_k_lv[] = "lv"; static const char __pyx_k_na[] = "na"; static const char __pyx_k_nc[] = "nc"; static const char __pyx_k_op[] = "op"; static const char __pyx_k_p1[] = "p1"; static const char __pyx_k_pc[] = "pc"; static const char __pyx_k_pd[] = "pd"; static const char __pyx_k_pi[] = "pi"; static const char __pyx_k_pj[] = "pj"; static const char __pyx_k_q0[] = "q0"; static const char __pyx_k_q1[] = "q1"; static const char __pyx_k_rw[] = "rw"; static const char __pyx_k_sf[] = "sf"; static const char __pyx_k_sx[] = "sx"; static const char __pyx_k_ua[] = "ua"; static const char __pyx_k_up[] = "up"; static const char __pyx_k_vg[] = "vg"; static const char __pyx_k_vl[] = "vl"; static const char __pyx_k_vm[] = "vm"; static const char __pyx_k_vn[] = "vn"; static const char __pyx_k_xl[] = "xl"; static const char __pyx_k_xu[] = "xu"; static const char __pyx_k_A11[] = "A11"; static const char __pyx_k_ADD[] = "ADD"; static const char __pyx_k_AGG[] = "AGG"; static const char __pyx_k_AIJ[] = "AIJ"; static const char __pyx_k_AMD[] = "AMD"; static const char __pyx_k_ASM[] = "ASM"; static const char __pyx_k_BAS[] = "BAS"; static const char __pyx_k_BDF[] = "BDF"; static const char __pyx_k_BOX[] = "BOX"; static const char __pyx_k_CGS[] = "CGS"; static const char __pyx_k_DOF[] = "DOF"; static const char __pyx_k_Dup[] = "Dup"; static const char __pyx_k_FAS[] = "FAS"; static const char __pyx_k_FCG[] = "FCG"; static const char __pyx_k_FFT[] = "FFT"; static const char __pyx_k_FRB[] = "FRB"; static const char __pyx_k_GCR[] = "GCR"; static const char __pyx_k_GEO[] = "GEO"; static const char __pyx_k_HMG[] = "HMG"; static const char __pyx_k_ICC[] = "ICC"; static const char __pyx_k_ILU[] = "ILU"; static const char __pyx_k_INF[] = "INF"; static const char __pyx_k_IPM[] = "IPM"; static const char __pyx_k_KLU[] = "KLU"; static const char __pyx_k_KSP[] = "KSP"; static const char __pyx_k_LCD[] = "LCD"; static const char __pyx_k_LCL[] = "LCL"; static const char __pyx_k_LRC[] = "LRC"; static const char __pyx_k_LSC[] = "LSC"; static const char __pyx_k_Log[] = "Log"; static const char __pyx_k_MAT[] = "MAT"; static const char __pyx_k_MAX[] = "MAX"; static const char __pyx_k_MPI[] = "MPI"; static const char __pyx_k_Mat[] = "Mat"; static const char __pyx_k_N12[] = "N12"; static const char __pyx_k_NCG[] = "NCG"; static const char __pyx_k_NGS[] = "NGS"; static const char __pyx_k_NLS[] = "NLS"; static const char __pyx_k_NTL[] = "NTL"; static const char __pyx_k_NTR[] = "NTR"; static const char __pyx_k_OWD[] = "OWD"; static const char __pyx_k_PIC[] = "PIC"; static const char __pyx_k_QCG[] = "QCG"; static const char __pyx_k_QMD[] = "QMD"; static const char __pyx_k_RCM[] = "RCM"; static const char __pyx_k_RK3[] = "RK3"; static const char __pyx_k_RK4[] = "RK4"; static const char __pyx_k_SEQ[] = "SEQ"; static const char __pyx_k_SOR[] = "SOR"; static const char __pyx_k_SPD[] = "SPD"; static const char __pyx_k_SSP[] = "SSP"; static const char __pyx_k_SVD[] = "SVD"; static const char __pyx_k_Sys[] = "Sys"; static const char __pyx_k_TAO[] = "TAO"; static const char __pyx_k_TFS[] = "TFS"; static const char __pyx_k_T_2[] = "T{"; static const char __pyx_k_VTK[] = "VTK"; static const char __pyx_k_Vec[] = "Vec"; static const char __pyx_k_WBM[] = "WBM"; static const char __pyx_k__13[] = "\n"; static const char __pyx_k__14[] = ","; static const char __pyx_k__20[] = "."; static const char __pyx_k__72[] = "^"; static const char __pyx_k__73[] = ":"; static const char __pyx_k__74[] = "}"; static const char __pyx_k_a_2[] = "a+"; static const char __pyx_k_all[] = "all"; static const char __pyx_k_app[] = "app"; static const char __pyx_k_box[] = "box"; static const char __pyx_k_c_d[] = "=%c%d"; static const char __pyx_k_col[] = "col"; static const char __pyx_k_csr[] = "csr"; static const char __pyx_k_d_s[] = "[%*d] %s"; static const char __pyx_k_dim[] = "dim"; static const char __pyx_k_div[] = "div"; static const char __pyx_k_dms[] = "dms"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_dof[] = "dof"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_fix[] = "fix"; static const char __pyx_k_flg[] = "flg"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_idx[] = "idx"; static const char __pyx_k_int[] = "int"; static const char __pyx_k_its[] = "its"; static const char __pyx_k_ksp[] = "ksp"; static const char __pyx_k_l2l[] = "l2l"; static const char __pyx_k_loc[] = "loc"; static const char __pyx_k_mat[] = "mat"; static const char __pyx_k_max[] = "max"; static const char __pyx_k_min[] = "min"; static const char __pyx_k_msg[] = "msg"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_ngs[] = "ngs"; static const char __pyx_k_nnz[] = "nnz"; static const char __pyx_k_nsd[] = "nsd"; static const char __pyx_k_nsp[] = "nsp"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_out[] = "out"; static const char __pyx_k_ozz[] = "ozz"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_pre[] = "pre"; static const char __pyx_k_r_2[] = "r+"; static const char __pyx_k_rhs[] = "rhs"; static const char __pyx_k_row[] = "row"; static const char __pyx_k_s_2[] = "(%s)"; static const char __pyx_k_s_s[] = "-%s%s"; static const char __pyx_k_sec[] = "sec"; static const char __pyx_k_sep[] = "sep"; static const char __pyx_k_str[] = "__str__"; static const char __pyx_k_tab[] = "tab"; static const char __pyx_k_tol[] = "tol"; static const char __pyx_k_typ[] = "typ"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_vec[] = "vec"; static const char __pyx_k_vlg[] = "vlg"; static const char __pyx_k_w_2[] = "w+"; static const char __pyx_k_zoz[] = "zoz"; static const char __pyx_k_zzo[] = "zzo"; static const char __pyx_k_ADMM[] = "ADMM"; static const char __pyx_k_ALMM[] = "ALMM"; static const char __pyx_k_BACK[] = "BACK"; static const char __pyx_k_BAIJ[] = "BAIJ"; static const char __pyx_k_BCGS[] = "BCGS"; static const char __pyx_k_BDDC[] = "BDDC"; static const char __pyx_k_BFBT[] = "BFBT"; static const char __pyx_k_BICG[] = "BICG"; static const char __pyx_k_BMRM[] = "BMRM"; static const char __pyx_k_BNCG[] = "BNCG"; static const char __pyx_k_BNLS[] = "BNLS"; static const char __pyx_k_BNTL[] = "BNTL"; static const char __pyx_k_BNTR[] = "BNTR"; static const char __pyx_k_BRGN[] = "BRGN"; static const char __pyx_k_CGLS[] = "CGLS"; static const char __pyx_k_CGNE[] = "CGNE"; static const char __pyx_k_CUDA[] = "CUDA"; static const char __pyx_k_Comm[] = "Comm"; static const char __pyx_k_DIAG[] = "DIAG"; static const char __pyx_k_DMDA[] = "DMDA"; static const char __pyx_k_DOWN[] = "DOWN"; static const char __pyx_k_DRAW[] = "DRAW"; static const char __pyx_k_DROP[] = "DROP"; static const char __pyx_k_ESSL[] = "ESSL"; static const char __pyx_k_FFTW[] = "FFTW"; static const char __pyx_k_FULL[] = "FULL"; static const char __pyx_k_Free[] = "Free"; static const char __pyx_k_GAMG[] = "GAMG"; static const char __pyx_k_GASM[] = "GASM"; static const char __pyx_k_GLEE[] = "GLEE"; static const char __pyx_k_GLLE[] = "GLLE"; static const char __pyx_k_GLTR[] = "GLTR"; static const char __pyx_k_GPCG[] = "GPCG"; static const char __pyx_k_HALF[] = "HALF"; static const char __pyx_k_HARA[] = "HARA"; static const char __pyx_k_HASH[] = "HASH"; static const char __pyx_k_HDF5[] = "HDF5"; static const char __pyx_k_KAIJ[] = "KAIJ"; static const char __pyx_k_LEFT[] = "LEFT"; static const char __pyx_k_LMVM[] = "LMVM"; static const char __pyx_k_LSQR[] = "LSQR"; static const char __pyx_k_Left[] = "Left"; static const char __pyx_k_MAIJ[] = "MAIJ"; static const char __pyx_k_MASK[] = "MASK"; static const char __pyx_k_MFFD[] = "MFFD"; static const char __pyx_k_MOAB[] = "MOAB"; static const char __pyx_k_MPRK[] = "MPRK"; static const char __pyx_k_Mode[] = "Mode"; static const char __pyx_k_NASH[] = "NASH"; static const char __pyx_k_NASM[] = "NASM"; static const char __pyx_k_NEST[] = "NEST"; static const char __pyx_k_NONE[] = "NONE"; static const char __pyx_k_PFMG[] = "PFMG"; static const char __pyx_k_PLEX[] = "PLEX"; static const char __pyx_k_Quad[] = "Quad"; static const char __pyx_k_RAND[] = "RAND"; static const char __pyx_k_READ[] = "READ"; static const char __pyx_k_RK2A[] = "RK2A"; static const char __pyx_k_RK5F[] = "RK5F"; static const char __pyx_k_ROSW[] = "ROSW"; static const char __pyx_k_SAME[] = "SAME"; static const char __pyx_k_SAWS[] = "SAWS"; static const char __pyx_k_SELF[] = "SELF"; static const char __pyx_k_SELL[] = "SELL"; static const char __pyx_k_SNES[] = "SNES"; static const char __pyx_k_SPAI[] = "SPAI"; static const char __pyx_k_STAG[] = "STAG"; static const char __pyx_k_STAR[] = "STAR"; static const char __pyx_k_STCG[] = "STCG"; static const char __pyx_k_Side[] = "Side"; static const char __pyx_k_Size[] = "Size"; static const char __pyx_k_TRON[] = "TRON"; static const char __pyx_k_Type[] = "Type"; static const char __pyx_k_USER[] = "USER"; static const char __pyx_k_addv[] = "addv"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_atol[] = "atol"; static const char __pyx_k_attr[] = "attr"; static const char __pyx_k_axpy[] = "axpy"; static const char __pyx_k_back[] = "back"; static const char __pyx_k_base[] = "base"; static const char __pyx_k_beta[] = "beta"; static const char __pyx_k_bits[] = "bits"; static const char __pyx_k_bndr[] = "bndr"; static const char __pyx_k_cell[] = "cell"; static const char __pyx_k_cgid[] = "cgid"; static const char __pyx_k_cmap[] = "cmap"; static const char __pyx_k_code[] = "code"; static const char __pyx_k_cols[] = "cols"; static const char __pyx_k_comm[] = "comm"; static const char __pyx_k_cone[] = "cone"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_date[] = "date"; static const char __pyx_k_diag[] = "diag"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_dims[] = "dims"; static const char __pyx_k_disc[] = "disc"; static const char __pyx_k_dmTo[] = "dmTo"; static const char __pyx_k_dofs[] = "dofs"; static const char __pyx_k_down[] = "down"; static const char __pyx_k_drop[] = "drop"; static const char __pyx_k_exit[] = "__exit__"; static const char __pyx_k_fill[] = "fill"; static const char __pyx_k_flag[] = "flag"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_gord[] = "gord"; static const char __pyx_k_gsec[] = "gsec"; static const char __pyx_k_gtol[] = "gtol"; static const char __pyx_k_gvec[] = "gvec"; static const char __pyx_k_idxm[] = "idxm"; static const char __pyx_k_ierr[] = "ierr"; static const char __pyx_k_imag[] = "imag"; static const char __pyx_k_imex[] = "imex"; static const char __pyx_k_info[] = "info"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_iset[] = "iset"; static const char __pyx_k_ival[] = "ival"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_lits[] = "lits"; static const char __pyx_k_locs[] = "locs"; static const char __pyx_k_ltog[] = "ltog"; static const char __pyx_k_ltol[] = "ltol"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mats[] = "mats"; static const char __pyx_k_memo[] = "memo"; static const char __pyx_k_mode[] = "mode"; static const char __pyx_k_mult[] = "mult"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_ndim[] = "ndim"; static const char __pyx_k_nmax[] = "nmax"; static const char __pyx_k_nmin[] = "nmin"; static const char __pyx_k_none[] = "none"; static const char __pyx_k_norm[] = "norm"; static const char __pyx_k_null[] = "null"; static const char __pyx_k_onnz[] = "onnz"; static const char __pyx_k_opts[] = "opts"; static const char __pyx_k_pEnd[] = "pEnd"; static const char __pyx_k_pack[] = "pack"; static const char __pyx_k_part[] = "part"; static const char __pyx_k_perm[] = "perm"; static const char __pyx_k_push[] = "push"; static const char __pyx_k_quad[] = "quad"; static const char __pyx_k_rank[] = "rank"; static const char __pyx_k_real[] = "real"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_rmap[] = "rmap"; static const char __pyx_k_rows[] = "rows"; static const char __pyx_k_rtol[] = "rtol"; static const char __pyx_k_seed[] = "seed"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_side[] = "side"; static const char __pyx_k_size[] = "size"; static const char __pyx_k_skip[] = "skip"; static const char __pyx_k_snes[] = "snes"; static const char __pyx_k_star[] = "star"; static const char __pyx_k_step[] = "step"; static const char __pyx_k_stol[] = "stol"; static const char __pyx_k_stop[] = "stop"; static const char __pyx_k_supp[] = "supp"; static const char __pyx_k_tabs[] = "tabs"; static const char __pyx_k_time[] = "time"; static const char __pyx_k_unit[] = "unit"; static const char __pyx_k_vecs[] = "vecs"; static const char __pyx_k_view[] = "view"; static const char __pyx_k_vtol[] = "vtol"; static const char __pyx_k_xdot[] = "xdot"; static const char __pyx_k_xmax[] = "xmax"; static const char __pyx_k_xmin[] = "xmin"; static const char __pyx_k_ymax[] = "ymax"; static const char __pyx_k_ymin[] = "ymin"; static const char __pyx_k_zmax[] = "zmax"; static const char __pyx_k_zmin[] = "zmin"; static const char __pyx_k_ADIOS[] = "ADIOS"; static const char __pyx_k_ALPHA[] = "ALPHA"; static const char __pyx_k_ASCII[] = "ASCII"; static const char __pyx_k_ASFLS[] = "ASFLS"; static const char __pyx_k_ASILS[] = "ASILS"; static const char __pyx_k_ASPIN[] = "ASPIN"; static const char __pyx_k_BASIC[] = "BASIC"; static const char __pyx_k_BCGSL[] = "BCGSL"; static const char __pyx_k_BLMVM[] = "BLMVM"; static const char __pyx_k_BLOCK[] = "BLOCK"; static const char __pyx_k_BQNLS[] = "BQNLS"; static const char __pyx_k_BQPIP[] = "BQPIP"; static const char __pyx_k_CHACO[] = "CHACO"; static const char __pyx_k_Class[] = "Class"; static const char __pyx_k_Clone[] = "Clone"; static const char __pyx_k_DENSE[] = "DENSE"; static const char __pyx_k_DUMMY[] = "DUMMY"; static const char __pyx_k_EIMEX[] = "EIMEX"; static const char __pyx_k_EULER[] = "EULER"; static const char __pyx_k_Error[] = "Error"; static const char __pyx_k_Event[] = "Event"; static const char __pyx_k_FBCGS[] = "FBCGS"; static const char __pyx_k_FINAL[] = "FINAL"; static const char __pyx_k_FLUSH[] = "FLUSH"; static const char __pyx_k_FRONT[] = "FRONT"; static const char __pyx_k_GLVIS[] = "GLVIS"; static const char __pyx_k_GMRES[] = "GMRES"; static const char __pyx_k_HPDDM[] = "HPDDM"; static const char __pyx_k_HYPRE[] = "HYPRE"; static const char __pyx_k_IBCGS[] = "IBCGS"; static const char __pyx_k_LGMap[] = "LGMap"; static const char __pyx_k_LOCAL[] = "LOCAL"; static const char __pyx_k_LOWER[] = "LOWER"; static const char __pyx_k_LUSOL[] = "LUSOL"; static const char __pyx_k_MIMEX[] = "MIMEX"; static const char __pyx_k_MUMPS[] = "MUMPS"; static const char __pyx_k_OWLQN[] = "OWLQN"; static const char __pyx_k_P4EST[] = "P4EST"; static const char __pyx_k_P8EST[] = "P8EST"; static const char __pyx_k_PARMS[] = "PARMS"; static const char __pyx_k_PATCH[] = "PATCH"; static const char __pyx_k_PDIPM[] = "PDIPM"; static const char __pyx_k_PETSC[] = "PETSC"; static const char __pyx_k_Print[] = "Print"; static const char __pyx_k_RIGHT[] = "RIGHT"; static const char __pyx_k_RK1FE[] = "RK1FE"; static const char __pyx_k_RK3BS[] = "RK3BS"; static const char __pyx_k_RK5BS[] = "RK5BS"; static const char __pyx_k_RK5DP[] = "RK5DP"; static const char __pyx_k_RK6VR[] = "RK6VR"; static const char __pyx_k_RK7VR[] = "RK7VR"; static const char __pyx_k_RK8VR[] = "RK8VR"; static const char __pyx_k_Right[] = "Right"; static const char __pyx_k_SBAIJ[] = "SBAIJ"; static const char __pyx_k_SCHUR[] = "SCHUR"; static const char __pyx_k_SELFP[] = "SELFP"; static const char __pyx_k_SHELL[] = "SHELL"; static const char __pyx_k_SPRNG[] = "SPRNG"; static const char __pyx_k_SSFLS[] = "SSFLS"; static const char __pyx_k_SSILS[] = "SSILS"; static const char __pyx_k_SWARM[] = "SWARM"; static const char __pyx_k_Stage[] = "Stage"; static const char __pyx_k_TCQMR[] = "TCQMR"; static const char __pyx_k_TFQMR[] = "TFQMR"; static const char __pyx_k_THETA[] = "THETA"; static const char __pyx_k_THIRD[] = "THIRD"; static const char __pyx_k_TSIRM[] = "TSIRM"; static const char __pyx_k_TWIST[] = "TWIST"; static const char __pyx_k_UPPER[] = "UPPER"; static const char __pyx_k_VANKA[] = "VANKA"; static const char __pyx_k_WRITE[] = "WRITE"; static const char __pyx_k_abort[] = "abort"; static const char __pyx_k_alpha[] = "alpha"; static const char __pyx_k_apply[] = "apply"; static const char __pyx_k_array[] = "array"; static const char __pyx_k_begin[] = "begin"; static const char __pyx_k_bsize[] = "bsize"; static const char __pyx_k_catol[] = "catol"; static const char __pyx_k_cells[] = "cells"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_comms[] = "comms"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_crank[] = "crank"; static const char __pyx_k_crtol[] = "crtol"; static const char __pyx_k_csize[] = "csize"; static const char __pyx_k_ctype[] = "ctype"; static const char __pyx_k_devel[] = "devel"; static const char __pyx_k_dtcol[] = "dtcol"; static const char __pyx_k_dtype[] = "dtype"; static const char __pyx_k_edges[] = "edges"; static const char __pyx_k_emacs[] = "emacs"; static const char __pyx_k_enter[] = "__enter__"; static const char __pyx_k_entry[] = "entry"; static const char __pyx_k_error[] = "error"; static const char __pyx_k_exoid[] = "exoid"; static const char __pyx_k_faces[] = "faces"; static const char __pyx_k_field[] = "field"; static const char __pyx_k_first[] = "first"; static const char __pyx_k_flags[] = "flags"; static const char __pyx_k_flops[] = "flops"; static const char __pyx_k_flush[] = "flush"; static const char __pyx_k_fnorm[] = "fnorm"; static const char __pyx_k_force[] = "force"; static const char __pyx_k_front[] = "front"; static const char __pyx_k_gamma[] = "gamma"; static const char __pyx_k_gatol[] = "gatol"; static const char __pyx_k_getDM[] = "getDM"; static const char __pyx_k_getDS[] = "getDS"; static const char __pyx_k_getPC[] = "getPC"; static const char __pyx_k_group[] = "group"; static const char __pyx_k_grtol[] = "grtol"; static const char __pyx_k_gttol[] = "gttol"; static const char __pyx_k_icntl[] = "icntl"; static const char __pyx_k_imode[] = "imode"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_is_to[] = "is_to"; static const char __pyx_k_iscol[] = "iscol"; static const char __pyx_k_isets[] = "isets"; static const char __pyx_k_isrow[] = "isrow"; static const char __pyx_k_kargs[] = "kargs"; static const char __pyx_k_klass[] = "klass"; static const char __pyx_k_label[] = "label"; static const char __pyx_k_lanes[] = "lanes"; static const char __pyx_k_level[] = "level"; static const char __pyx_k_lgmap[] = "lgmap"; static const char __pyx_k_local[] = "local"; static const char __pyx_k_lower[] = "lower"; static const char __pyx_k_lvecs[] = "lvecs"; static const char __pyx_k_major[] = "major"; static const char __pyx_k_minor[] = "minor"; static const char __pyx_k_model[] = "model"; static const char __pyx_k_omega[] = "omega"; static const char __pyx_k_order[] = "order"; static const char __pyx_k_otype[] = "otype"; static const char __pyx_k_petsc[] = "petsc"; static const char __pyx_k_point[] = "point"; static const char __pyx_k_primv[] = "primv"; static const char __pyx_k_ptype[] = "ptype"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_ready[] = "ready"; static const char __pyx_k_reset[] = "reset"; static const char __pyx_k_reuse[] = "reuse"; static const char __pyx_k_right[] = "right"; static const char __pyx_k_rnorm[] = "rnorm"; static const char __pyx_k_scale[] = "scale"; static const char __pyx_k_setDM[] = "setDM"; static const char __pyx_k_setDS[] = "setDS"; static const char __pyx_k_setUp[] = "setUp"; static const char __pyx_k_setup[] = "setup"; static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_shift[] = "shift"; static const char __pyx_k_sizes[] = "sizes"; static const char __pyx_k_sleep[] = "sleep"; static const char __pyx_k_solve[] = "solve"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_stage[] = "stage"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_strip[] = "strip"; static const char __pyx_k_theta[] = "theta"; static const char __pyx_k_title[] = "title"; static const char __pyx_k_toAll[] = "toAll"; static const char __pyx_k_trans[] = "trans"; static const char __pyx_k_twist[] = "twist"; static const char __pyx_k_upper[] = "upper"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_vecTo[] = "vecTo"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_wraps[] = "wraps"; static const char __pyx_k_xnorm[] = "xnorm"; static const char __pyx_k_ynorm[] = "ynorm"; static const char __pyx_k_ADD_BC[] = "ADD_BC"; static const char __pyx_k_ADIOS2[] = "ADIOS2"; static const char __pyx_k_AIJCRL[] = "AIJCRL"; static const char __pyx_k_AIJMKL[] = "AIJMKL"; static const char __pyx_k_ALPHA2[] = "ALPHA2"; static const char __pyx_k_ALWAYS[] = "ALWAYS"; static const char __pyx_k_AOType[] = "AOType"; static const char __pyx_k_APPEND[] = "APPEND"; static const char __pyx_k_BEULER[] = "BEULER"; static const char __pyx_k_BINARY[] = "BINARY"; static const char __pyx_k_BQNKLS[] = "BQNKLS"; static const char __pyx_k_BQNKTL[] = "BQNKTL"; static const char __pyx_k_BQNKTR[] = "BQNKTR"; static const char __pyx_k_DECIDE[] = "DECIDE"; static const char __pyx_k_DGMRES[] = "DGMRES"; static const char __pyx_k_DMPlex[] = "DMPlex"; static const char __pyx_k_DMStag[] = "DMStag"; static const char __pyx_k_DMType[] = "DMType"; static const char __pyx_k_DSType[] = "DSType"; static const char __pyx_k_EXOTIC[] = "EXOTIC"; static const char __pyx_k_FAILED[] = "FAILED"; static const char __pyx_k_FBCGSR[] = "FBCGSR"; static const char __pyx_k_FETIDP[] = "FETIDP"; static const char __pyx_k_FEType[] = "FEType"; static const char __pyx_k_FGMRES[] = "FGMRES"; static const char __pyx_k_FOREST[] = "FOREST"; static const char __pyx_k_Format[] = "Format"; static const char __pyx_k_GATHER[] = "GATHER"; static const char __pyx_k_INSERT[] = "INSERT"; static const char __pyx_k_ISType[] = "ISType"; static const char __pyx_k_JACOBI[] = "JACOBI"; static const char __pyx_k_KOKKOS[] = "KOKKOS"; static const char __pyx_k_LGMRES[] = "LGMRES"; static const char __pyx_k_LINEAR[] = "LINEAR"; static const char __pyx_k_MATLAB[] = "MATLAB"; static const char __pyx_k_MGType[] = "MGType"; static const char __pyx_k_MINRES[] = "MINRES"; static const char __pyx_k_MIRROR[] = "MIRROR"; static const char __pyx_k_MPIADJ[] = "MPIADJ"; static const char __pyx_k_MPIAIJ[] = "MPIAIJ"; static const char __pyx_k_NATIVE[] = "NATIVE"; static const char __pyx_k_NGMRES[] = "NGMRES"; static const char __pyx_k_NORMAL[] = "NORMAL"; static const char __pyx_k_NORM_1[] = "NORM_1"; static const char __pyx_k_NORM_2[] = "NORM_2"; static const char __pyx_k_OPENCL[] = "OPENCL"; static const char __pyx_k_Object[] = "Object"; static const char __pyx_k_Option[] = "Option"; static const char __pyx_k_PASTIX[] = "PASTIX"; static const char __pyx_k_PCSide[] = "PCSide"; static const char __pyx_k_PCType[] = "PCType"; static const char __pyx_k_PGMRES[] = "PGMRES"; static const char __pyx_k_PIPECG[] = "PIPECG"; static const char __pyx_k_PIPECR[] = "PIPECR"; static const char __pyx_k_PSEUDO[] = "PSEUDO"; static const char __pyx_k_PYTHON[] = "PYTHON"; static const char __pyx_k_RADAU5[] = "RADAU5"; static const char __pyx_k_RAND48[] = "RAND48"; static const char __pyx_k_RKType[] = "RKType"; static const char __pyx_k_Random[] = "Random"; static const char __pyx_k_Reason[] = "Reason"; static const char __pyx_k_SEQAIJ[] = "SEQAIJ"; static const char __pyx_k_SFType[] = "SFType"; static const char __pyx_k_SHARED[] = "SHARED"; static const char __pyx_k_SIMPLE[] = "SIMPLE"; static const char __pyx_k_SLICED[] = "SLICED"; static const char __pyx_k_SOCKET[] = "SOCKET"; static const char __pyx_k_STDERR[] = "STDERR"; static const char __pyx_k_STDOUT[] = "STDOUT"; static const char __pyx_k_STRIDE[] = "STRIDE"; static const char __pyx_k_STRING[] = "STRING"; static const char __pyx_k_SUBSET[] = "SUBSET"; static const char __pyx_k_SYMMLQ[] = "SYMMLQ"; static const char __pyx_k_TSType[] = "TSType"; static const char __pyx_k_UPDATE[] = "UPDATE"; static const char __pyx_k_Viewer[] = "Viewer"; static const char __pyx_k_WINDOW[] = "WINDOW"; static const char __pyx_k_alpha2[] = "alpha2"; static const char __pyx_k_alphas[] = "alphas"; static const char __pyx_k_amount[] = "amount"; static const char __pyx_k_appctx[] = "appctx"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_author[] = "author"; static const char __pyx_k_buffer[] = "buffer"; static const char __pyx_k_column[] = "column"; static const char __pyx_k_coords[] = "coords"; static const char __pyx_k_cratio[] = "cratio"; static const char __pyx_k_decode[] = "decode"; static const char __pyx_k_decomp[] = "decomp"; static const char __pyx_k_design[] = "design"; static const char __pyx_k_divtol[] = "divtol"; static const char __pyx_k_dlpack[] = "__dlpack__"; static const char __pyx_k_dmtype[] = "dmtype"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_eqtype[] = "eqtype"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_getDim[] = "getDim"; static const char __pyx_k_getDof[] = "getDof"; static const char __pyx_k_getKSP[] = "getKSP"; static const char __pyx_k_getNPC[] = "getNPC"; static const char __pyx_k_getRhs[] = "getRhs"; static const char __pyx_k_ghosts[] = "ghosts"; static const char __pyx_k_handle[] = "handle"; static const char __pyx_k_ignore[] = "ignore"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_insert[] = "insert"; static const char __pyx_k_invert[] = "invert"; static const char __pyx_k_iscols[] = "iscols"; static const char __pyx_k_isperm[] = "isperm"; static const char __pyx_k_isrows[] = "isrows"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_length[] = "length"; static const char __pyx_k_levels[] = "levels"; static const char __pyx_k_max_it[] = "max_it"; static const char __pyx_k_memory[] = "memory"; static const char __pyx_k_metric[] = "metric"; static const char __pyx_k_mgtype[] = "mgtype"; static const char __pyx_k_mirror[] = "mirror"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_mpi4py[] = "mpi4py"; static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_name_3[] = "name_"; static const char __pyx_k_newsec[] = "newsec"; static const char __pyx_k_newvec[] = "newvec"; static const char __pyx_k_nlocal[] = "nlocal"; static const char __pyx_k_nroots[] = "nroots"; static const char __pyx_k_numDof[] = "numDof"; static const char __pyx_k_nzdiag[] = "nzdiag"; static const char __pyx_k_object[] = "object"; static const char __pyx_k_offset[] = "offset"; static const char __pyx_k_option[] = "option"; static const char __pyx_k_output[] = "output"; static const char __pyx_k_pStart[] = "pStart"; static const char __pyx_k_parent[] = "parent"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_points[] = "points"; static const char __pyx_k_prefix[] = "prefix"; static const char __pyx_k_python[] = "python"; static const char __pyx_k_qorder[] = "qorder"; static const char __pyx_k_radius[] = "radius"; static const char __pyx_k_random[] = "random"; static const char __pyx_k_ranges[] = "ranges"; static const char __pyx_k_reason[] = "reason"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_refine[] = "refine"; static const char __pyx_k_remote[] = "remote"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_rowmap[] = "rowmap"; static const char __pyx_k_rscale[] = "rscale"; static const char __pyx_k_rtol_0[] = "rtol_0"; static const char __pyx_k_setKSP[] = "setKSP"; static const char __pyx_k_setNPC[] = "setNPC"; static const char __pyx_k_solver[] = "solver"; static const char __pyx_k_starts[] = "starts"; static const char __pyx_k_string[] = "string"; static const char __pyx_k_struct[] = "struct"; static const char __pyx_k_submat[] = "submat"; static const char __pyx_k_subvec[] = "subvec"; static const char __pyx_k_svalue[] = "svalue"; static const char __pyx_k_swidth[] = "swidth"; static const char __pyx_k_tbline[] = "tbline"; static const char __pyx_k_tblist[] = "tblist"; static const char __pyx_k_toZero[] = "toZero"; static const char __pyx_k_unpack[] = "unpack"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_values[] = "values"; static const char __pyx_k_vec_to[] = "vec_to"; static const char __pyx_k_viewer[] = "viewer"; static const char __pyx_k_weight[] = "weight"; static const char __pyx_k_ADD_ALL[] = "ADD_ALL"; static const char __pyx_k_AIJPERM[] = "AIJPERM"; static const char __pyx_k_AIJSELL[] = "AIJSELL"; static const char __pyx_k_ARKIMEX[] = "ARKIMEX"; static const char __pyx_k_ASMType[] = "ASMType"; static const char __pyx_k_BACK_UP[] = "BACK_UP"; static const char __pyx_k_BAIJMKL[] = "BAIJMKL"; static const char __pyx_k_BJACOBI[] = "BJACOBI"; static const char __pyx_k_Barrier[] = "Barrier"; static const char __pyx_k_CHOLMOD[] = "CHOLMOD"; static const char __pyx_k_DEFAULT[] = "DEFAULT"; static const char __pyx_k_DMLabel[] = "DMLabel"; static const char __pyx_k_DMShell[] = "DMShell"; static const char __pyx_k_DMSwarm[] = "DMSwarm"; static const char __pyx_k_DRAW_LG[] = "DRAW_LG"; static const char __pyx_k_ELEMENT[] = "ELEMENT"; static const char __pyx_k_FORWARD[] = "FORWARD"; static const char __pyx_k_GATHERV[] = "GATHERV"; static const char __pyx_k_GENERAL[] = "GENERAL"; static const char __pyx_k_GHOSTED[] = "GHOSTED"; static const char __pyx_k_GROPPCG[] = "GROPPCG"; static const char __pyx_k_IntType[] = "IntType"; static const char __pyx_k_KASKADE[] = "KASKADE"; static const char __pyx_k_KSPONLY[] = "KSPONLY"; static const char __pyx_k_KSPType[] = "KSPType"; static const char __pyx_k_LMVMDFP[] = "LMVMDFP"; static const char __pyx_k_LMVMSR1[] = "LMVMSR1"; static const char __pyx_k_MAPPING[] = "MAPPING"; static const char __pyx_k_MPIBAIJ[] = "MPIBAIJ"; static const char __pyx_k_MPICUDA[] = "MPICUDA"; static const char __pyx_k_MPIKAIJ[] = "MPIKAIJ"; static const char __pyx_k_MPIMAIJ[] = "MPIMAIJ"; static const char __pyx_k_MPISELL[] = "MPISELL"; static const char __pyx_k_MapMode[] = "MapMode"; static const char __pyx_k_MatType[] = "MatType"; static const char __pyx_k_NATURAL[] = "NATURAL"; static const char __pyx_k_NETWORK[] = "NETWORK"; static const char __pyx_k_NONZERO[] = "NONZERO"; static const char __pyx_k_NULLLOC[] = "NULLLOC"; static const char __pyx_k_Options[] = "Options"; static const char __pyx_k_PIPECG2[] = "PIPECG2"; static const char __pyx_k_PIPEFCG[] = "PIPEFCG"; static const char __pyx_k_PIPEGCR[] = "PIPEGCR"; static const char __pyx_k_PIPELCG[] = "PIPELCG"; static const char __pyx_k_PREONLY[] = "PREONLY"; static const char __pyx_k_PRODUCT[] = "PRODUCT"; static const char __pyx_k_QUARTER[] = "QUARTER"; static const char __pyx_k_REVERSE[] = "REVERSE"; static const char __pyx_k_SAME_NZ[] = "SAME_NZ"; static const char __pyx_k_SCATTER[] = "SCATTER"; static const char __pyx_k_SEQBAIJ[] = "SEQBAIJ"; static const char __pyx_k_SEQCUDA[] = "SEQCUDA"; static const char __pyx_k_SEQKAIJ[] = "SEQKAIJ"; static const char __pyx_k_SEQMAIJ[] = "SEQMAIJ"; static const char __pyx_k_SEQSELL[] = "SEQSELL"; static const char __pyx_k_SORType[] = "SORType"; static const char __pyx_k_SPECIAL[] = "SPECIAL"; static const char __pyx_k_SUPERLU[] = "SUPERLU"; static const char __pyx_k_SYSPFMG[] = "SYSPFMG"; static const char __pyx_k_Scatter[] = "Scatter"; static const char __pyx_k_Section[] = "Section"; static const char __pyx_k_Stencil[] = "Stencil"; static const char __pyx_k_TAOType[] = "TAOType"; static const char __pyx_k_UMFPACK[] = "UMFPACK"; static const char __pyx_k_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_UP_LEFT[] = "UP_LEFT"; static const char __pyx_k_VTK_VTR[] = "VTK_VTR"; static const char __pyx_k_VTK_VTS[] = "VTK_VTS"; static const char __pyx_k_VTK_VTU[] = "VTK_VTU"; static const char __pyx_k_VecType[] = "VecType"; static const char __pyx_k_alpha_f[] = "alpha_f"; static const char __pyx_k_alpha_m[] = "alpha_m"; static const char __pyx_k_array_w[] = "array_w"; static const char __pyx_k_asmtype[] = "asmtype"; static const char __pyx_k_back_up[] = "back_up"; static const char __pyx_k_barrier[] = "barrier"; static const char __pyx_k_bcComps[] = "bcComps"; static const char __pyx_k_bcField[] = "bcField"; static const char __pyx_k_coarsen[] = "coarsen"; static const char __pyx_k_conePos[] = "conePos"; static const char __pyx_k_context[] = "context"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_destroy[] = "destroy"; static const char __pyx_k_display[] = "display"; static const char __pyx_k_dm_type[] = "dm_type"; static const char __pyx_k_ds_type[] = "ds_type"; static const char __pyx_k_dtcount[] = "dtcount"; static const char __pyx_k_element[] = "element"; static const char __pyx_k_epsilon[] = "epsilon"; static const char __pyx_k_fe_type[] = "fe_type"; static const char __pyx_k_fortran[] = "fortran"; static const char __pyx_k_forward[] = "forward"; static const char __pyx_k_getComm[] = "getComm"; static const char __pyx_k_getInfo[] = "getInfo"; static const char __pyx_k_getName[] = "getName"; static const char __pyx_k_getRank[] = "getRank"; static const char __pyx_k_getSNES[] = "getSNES"; static const char __pyx_k_getSeed[] = "getSeed"; static const char __pyx_k_getSize[] = "getSize"; static const char __pyx_k_getTime[] = "getTime"; static const char __pyx_k_getType[] = "getType"; static const char __pyx_k_getVecs[] = "getVecs"; static const char __pyx_k_ghosted[] = "ghosted"; static const char __pyx_k_hasName[] = "hasName"; static const char __pyx_k_hessian[] = "hessian"; static const char __pyx_k_indices[] = "indices"; static const char __pyx_k_is_from[] = "is_from"; static const char __pyx_k_is_type[] = "is_type"; static const char __pyx_k_mallocs[] = "mallocs"; static const char __pyx_k_matMult[] = "matMult"; static const char __pyx_k_memview[] = "memview"; static const char __pyx_k_monitor[] = "monitor"; static const char __pyx_k_nlevels[] = "nlevels"; static const char __pyx_k_nonzero[] = "nonzero"; static const char __pyx_k_npoints[] = "npoints"; static const char __pyx_k_numComp[] = "numComp"; static const char __pyx_k_nz_used[] = "nz_used"; static const char __pyx_k_objgrad[] = "objgrad"; static const char __pyx_k_options[] = "options"; static const char __pyx_k_overlap[] = "overlap"; static const char __pyx_k_package[] = "package"; static const char __pyx_k_pc_type[] = "pc_type"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_prestep[] = "prestep"; static const char __pyx_k_py_type[] = "py_type"; static const char __pyx_k_release[] = "release"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_reshape[] = "reshape"; static const char __pyx_k_restart[] = "restart"; static const char __pyx_k_reverse[] = "reverse"; static const char __pyx_k_scatter[] = "scatter"; static const char __pyx_k_seconds[] = "seconds"; static const char __pyx_k_setName[] = "setName"; static const char __pyx_k_setSeed[] = "setSeed"; static const char __pyx_k_setTime[] = "setTime"; static const char __pyx_k_setType[] = "setType"; static const char __pyx_k_sf_type[] = "sf_type"; static const char __pyx_k_simplex[] = "simplex"; static const char __pyx_k_smooths[] = "smooths"; static const char __pyx_k_sortype[] = "sortype"; static const char __pyx_k_strides[] = "strides"; static const char __pyx_k_subcomm[] = "subcomm"; static const char __pyx_k_submats[] = "submats"; static const char __pyx_k_ts_type[] = "ts_type"; static const char __pyx_k_typestr[] = "typestr"; static const char __pyx_k_up_left[] = "up_left"; static const char __pyx_k_useCone[] = "useCone"; static const char __pyx_k_vectors[] = "vectors"; static const char __pyx_k_version[] = "version"; static const char __pyx_k_xdotdot[] = "xdotdot"; static const char __pyx_k_ADDITIVE[] = "ADDITIVE"; static const char __pyx_k_ADVANCED[] = "ADVANCED"; static const char __pyx_k_ALLTOALL[] = "ALLTOALL"; static const char __pyx_k_ANDERSON[] = "ANDERSON"; static const char __pyx_k_ARKIMEX3[] = "ARKIMEX3"; static const char __pyx_k_ARKIMEX4[] = "ARKIMEX4"; static const char __pyx_k_ARKIMEX5[] = "ARKIMEX5"; static const char __pyx_k_BLOCKMAT[] = "BLOCKMAT"; static const char __pyx_k_CHOLESKY[] = "CHOLESKY"; static const char __pyx_k_CUSPARSE[] = "CUSPARSE"; static const char __pyx_k_DISCGRAD[] = "DISCGRAD"; static const char __pyx_k_DrawSize[] = "DrawSize"; static const char __pyx_k_EXODUSII[] = "EXODUSII"; static const char __pyx_k_EXPLICIT[] = "EXPLICIT"; static const char __pyx_k_Ellipsis[] = "Ellipsis"; static const char __pyx_k_FRONT_UP[] = "FRONT_UP"; static const char __pyx_k_FileMode[] = "FileMode"; static const char __pyx_k_GALERKIN[] = "GALERKIN"; static const char __pyx_k_GAMGType[] = "GAMGType"; static const char __pyx_k_GASMType[] = "GASMType"; static const char __pyx_k_GIT_Date[] = "GIT Date:"; static const char __pyx_k_Get_rank[] = "Get_rank"; static const char __pyx_k_Get_size[] = "Get_size"; static const char __pyx_k_HDF5_MAT[] = "HDF5_MAT"; static const char __pyx_k_HDF5_VIZ[] = "HDF5_VIZ"; static const char __pyx_k_IMPLICIT[] = "IMPLICIT"; static const char __pyx_k_INBLOCKS[] = "INBLOCKS"; static const char __pyx_k_INFINITY[] = "INFINITY"; static const char __pyx_k_InfoType[] = "InfoType"; static const char __pyx_k_KACZMARZ[] = "KACZMARZ"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_LMVMBFGS[] = "LMVMBFGS"; static const char __pyx_k_LOCALREF[] = "LOCALREF"; static const char __pyx_k_LogClass[] = "LogClass"; static const char __pyx_k_LogEvent[] = "LogEvent"; static const char __pyx_k_LogStage[] = "LogStage"; static const char __pyx_k_MPIDENSE[] = "MPIDENSE"; static const char __pyx_k_MPISBAIJ[] = "MPISBAIJ"; static const char __pyx_k_NEIGHBOR[] = "NEIGHBOR"; static const char __pyx_k_NEWTONLS[] = "NEWTONLS"; static const char __pyx_k_NEWTONTR[] = "NEWTONTR"; static const char __pyx_k_NOFORMAT[] = "NOFORMAT"; static const char __pyx_k_NORM_MAX[] = "NORM_MAX"; static const char __pyx_k_NormType[] = "NormType"; static const char __pyx_k_PARMETIS[] = "PARMETIS"; static const char __pyx_k_PBJACOBI[] = "PBJACOBI"; static const char __pyx_k_PCMGType[] = "PCMGType"; static const char __pyx_k_PERIODIC[] = "PERIODIC"; static const char __pyx_k_PIPEBCGS[] = "PIPEBCGS"; static const char __pyx_k_PIPECGRR[] = "PIPECGRR"; static const char __pyx_k_PIPEPRCG[] = "PIPEPRCG"; static const char __pyx_k_POUNDERS[] = "POUNDERS"; static const char __pyx_k_PTSCOTCH[] = "PTSCOTCH"; static const char __pyx_k_RANDER48[] = "RANDER48"; static const char __pyx_k_RESTRICT[] = "RESTRICT"; static const char __pyx_k_RealType[] = "RealType"; static const char __pyx_k_SEQCUFFT[] = "SEQCUFFT"; static const char __pyx_k_SEQDENSE[] = "SEQDENSE"; static const char __pyx_k_SEQSBAIJ[] = "SEQSBAIJ"; static const char __pyx_k_SNESType[] = "SNESType"; static const char __pyx_k_SPECTRAL[] = "SPECTRAL"; static const char __pyx_k_STANDARD[] = "STANDARD"; static const char __pyx_k_STEPOVER[] = "STEPOVER"; static const char __pyx_k_SUNDIALS[] = "SUNDIALS"; static const char __pyx_k_TSRKType[] = "TSRKType"; static const char __pyx_k_UP_RIGHT[] = "UP_RIGHT"; static const char __pyx_k_VIENNACL[] = "VIENNACL"; static const char __pyx_k_addFlops[] = "addFlops"; static const char __pyx_k_assembly[] = "assembly"; static const char __pyx_k_bcPoints[] = "bcPoints"; static const char __pyx_k_boundary[] = "boundary"; static const char __pyx_k_buffer_w[] = "buffer_w"; static const char __pyx_k_citation[] = "citation"; static const char __pyx_k_constant[] = "constant"; static const char __pyx_k_cpuarray[] = "cpuarray"; static const char __pyx_k_debugger[] = "debugger"; static const char __pyx_k_delValue[] = "delValue"; static const char __pyx_k_dltensor[] = "dltensor"; static const char __pyx_k_end_args[] = "end_args"; static const char __pyx_k_filename[] = "filename"; static const char __pyx_k_finalize[] = "_finalize"; static const char __pyx_k_front_up[] = "front_up"; static const char __pyx_k_function[] = "function"; static const char __pyx_k_gamgtype[] = "gamgtype"; static const char __pyx_k_gasmtype[] = "gasmtype"; static const char __pyx_k_getArray[] = "getArray"; static const char __pyx_k_getFlops[] = "getFlops"; static const char __pyx_k_getSizes[] = "getSizes"; static const char __pyx_k_getUseEW[] = "getUseEW"; static const char __pyx_k_getUseFD[] = "getUseFD"; static const char __pyx_k_getUseMF[] = "getUseMF"; static const char __pyx_k_getValue[] = "getValue"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_gradient[] = "gradient"; static const char __pyx_k_hasLabel[] = "hasLabel"; static const char __pyx_k_inblocks[] = "inblocks"; static const char __pyx_k_interior[] = "interior"; static const char __pyx_k_interval[] = "interval"; static const char __pyx_k_isSorted[] = "isSorted"; static const char __pyx_k_is_local[] = "is_local"; static const char __pyx_k_isfields[] = "isfields"; static const char __pyx_k_itemsize[] = "itemsize"; static const char __pyx_k_jacobian[] = "jacobian"; static const char __pyx_k_ksp_type[] = "ksp_type"; static const char __pyx_k_leafdata[] = "leafdata"; static const char __pyx_k_localsec[] = "localsec"; static const char __pyx_k_logFlops[] = "logFlops"; static const char __pyx_k_mat_type[] = "mat_type"; static const char __pyx_k_max_time[] = "max_time"; static const char __pyx_k_mpiabort[] = "mpiabort"; static const char __pyx_k_normtype[] = "normtype"; static const char __pyx_k_nsubcomm[] = "nsubcomm"; static const char __pyx_k_numProcs[] = "numProcs"; static const char __pyx_k_only_and[] = "only '==' and '!='"; static const char __pyx_k_operator[] = "operator"; static const char __pyx_k_ord_type[] = "ord_type"; static const char __pyx_k_parallel[] = "parallel"; static const char __pyx_k_periodic[] = "periodic"; static const char __pyx_k_position[] = "position"; static const char __pyx_k_poststep[] = "poststep"; static const char __pyx_k_precheck[] = "precheck"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_readonly[] = "readonly"; static const char __pyx_k_refine_x[] = "refine_x"; static const char __pyx_k_refine_y[] = "refine_y"; static const char __pyx_k_refine_z[] = "refine_z"; static const char __pyx_k_residual[] = "residual"; static const char __pyx_k_rnd_type[] = "rnd_type"; static const char __pyx_k_rootdata[] = "rootdata"; static const char __pyx_k_rtol_max[] = "rtol_max"; static const char __pyx_k_selected[] = "selected"; static const char __pyx_k_setSizes[] = "setSizes"; static const char __pyx_k_setUseEW[] = "setUseEW"; static const char __pyx_k_setUseFD[] = "setUseFD"; static const char __pyx_k_setUseMF[] = "setUseMF"; static const char __pyx_k_setValue[] = "setValue"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_subminor[] = "subminor"; static const char __pyx_k_tao_type[] = "tao_type"; static const char __pyx_k_timestep[] = "timestep"; static const char __pyx_k_up_right[] = "up_right"; static const char __pyx_k_vec_from[] = "vec_from"; static const char __pyx_k_vec_type[] = "vec_type"; static const char __pyx_k_vwr_type[] = "vwr_type"; static const char __pyx_k_ALLGATHER[] = "ALLGATHER"; static const char __pyx_k_ARKIMEX2C[] = "ARKIMEX2C"; static const char __pyx_k_ARKIMEX2D[] = "ARKIMEX2D"; static const char __pyx_k_ARKIMEX2E[] = "ARKIMEX2E"; static const char __pyx_k_ARKIMEXA2[] = "ARKIMEXA2"; static const char __pyx_k_ARKIMEXL2[] = "ARKIMEXL2"; static const char __pyx_k_ASCII_CSV[] = "ASCII_CSV"; static const char __pyx_k_ASCII_VTK[] = "ASCII_VTK"; static const char __pyx_k_ASCII_XML[] = "ASCII_XML"; static const char __pyx_k_BACK_DOWN[] = "BACK_DOWN"; static const char __pyx_k_BACK_LEFT[] = "BACK_LEFT"; static const char __pyx_k_CHEBYSHEV[] = "CHEBYSHEV"; static const char __pyx_k_CLASSICAL[] = "CLASSICAL"; static const char __pyx_k_COMM_NULL[] = "COMM_NULL"; static const char __pyx_k_COMM_SELF[] = "COMM_SELF"; static const char __pyx_k_COMPOSITE[] = "COMPOSITE"; static const char __pyx_k_DEFLATION[] = "DEFLATION"; static const char __pyx_k_DETERMINE[] = "DETERMINE"; static const char __pyx_k_DIFFERENT[] = "DIFFERENT"; static const char __pyx_k_DOWN_LEFT[] = "DOWN_LEFT"; static const char __pyx_k_EISENSTAT[] = "EISENSTAT"; static const char __pyx_k_ELEMENTAL[] = "ELEMENTAL"; static const char __pyx_k_FROBENIUS[] = "FROBENIUS"; static const char __pyx_k_FULL_SIZE[] = "FULL_SIZE"; static const char __pyx_k_GLMapMode[] = "GLMapMode"; static const char __pyx_k_HALF_SIZE[] = "HALF_SIZE"; static const char __pyx_k_HDF5_XDMF[] = "HDF5_XDMF"; static const char __pyx_k_HERMITIAN[] = "HERMITIAN"; static const char __pyx_k_INSERT_BC[] = "INSERT_BC"; static const char __pyx_k_IS_buffer[] = "_IS_buffer"; static const char __pyx_k_ITERATING[] = "ITERATING"; static const char __pyx_k_LGMapType[] = "LGMapType"; static const char __pyx_k_MATCHSTEP[] = "MATCHSTEP"; static const char __pyx_k_MPIAIJCRL[] = "MPIAIJCRL"; static const char __pyx_k_MPIAIJMKL[] = "MPIAIJMKL"; static const char __pyx_k_MPIKOKKOS[] = "MPIKOKKOS"; static const char __pyx_k_MatOption[] = "MatOption"; static const char __pyx_k_NINFINITY[] = "NINFINITY"; static const char __pyx_k_NONLINEAR[] = "NONLINEAR"; static const char __pyx_k_NORM_NONE[] = "NORM_NONE"; static const char __pyx_k_NullSpace[] = "NullSpace"; static const char __pyx_k_PARDECOMP[] = "PARDECOMP"; static const char __pyx_k_PCASMType[] = "PCASMType"; static const char __pyx_k_PINFINITY[] = "PINFINITY"; static const char __pyx_k_RANDOM123[] = "RANDOM123"; static const char __pyx_k_REDUNDANT[] = "REDUNDANT"; static const char __pyx_k_ROWLENGTH[] = "ROWLENGTH"; static const char __pyx_k_SCALAPACK[] = "SCALAPACK"; static const char __pyx_k_SEQAIJCRL[] = "SEQAIJCRL"; static const char __pyx_k_SEQAIJMKL[] = "SEQAIJMKL"; static const char __pyx_k_SEQKOKKOS[] = "SEQKOKKOS"; static const char __pyx_k_STRUMPACK[] = "STRUMPACK"; static const char __pyx_k_SUBMATRIX[] = "SUBMATRIX"; static const char __pyx_k_SUBSET_NZ[] = "SUBSET_NZ"; static const char __pyx_k_SYMMETRIC[] = "SYMMETRIC"; static const char __pyx_k_Structure[] = "Structure"; static const char __pyx_k_TELESCOPE[] = "TELESCOPE"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_VPBJACOBI[] = "VPBJACOBI"; static const char __pyx_k_VecOption[] = "VecOption"; static const char __pyx_k_back_down[] = "back_down"; static const char __pyx_k_back_left[] = "back_left"; static const char __pyx_k_blocksize[] = "blocksize"; static const char __pyx_k_col_bsize[] = "col_bsize"; static const char __pyx_k_conePoint[] = "conePoint"; static const char __pyx_k_converged[] = "converged"; static const char __pyx_k_createMat[] = "createMat"; static const char __pyx_k_decorator[] = "decorator"; static const char __pyx_k_direction[] = "direction"; static const char __pyx_k_down_left[] = "down_left"; static const char __pyx_k_duplicate[] = "duplicate"; static const char __pyx_k_elem_type[] = "elem_type"; static const char __pyx_k_end_kargs[] = "end_kargs"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_fieldName[] = "fieldName"; static const char __pyx_k_fieldname[] = "fieldname"; static const char __pyx_k_functools[] = "functools"; static const char __pyx_k_getActive[] = "getActive"; static const char __pyx_k_getAppCtx[] = "getAppCtx"; static const char __pyx_k_getBuffer[] = "getBuffer"; static const char __pyx_k_getMatrix[] = "getMatrix"; static const char __pyx_k_getNumber[] = "getNumber"; static const char __pyx_k_getPCSide[] = "getPCSide"; static const char __pyx_k_getRanges[] = "getRanges"; static const char __pyx_k_getString[] = "getString"; static const char __pyx_k_globalsec[] = "globalsec"; static const char __pyx_k_hypretype[] = "hypretype"; static const char __pyx_k_infoAllow[] = "infoAllow"; static const char __pyx_k_isSimplex[] = "isSimplex"; static const char __pyx_k_jacobianp[] = "jacobianp"; static const char __pyx_k_labelName[] = "labelName"; static const char __pyx_k_max_fails[] = "max_fails"; static const char __pyx_k_max_funcs[] = "max_funcs"; static const char __pyx_k_max_steps[] = "max_steps"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_nonzero_2[] = "__nonzero__"; static const char __pyx_k_norm_type[] = "norm_type"; static const char __pyx_k_normsched[] = "normsched"; static const char __pyx_k_numFields[] = "numFields"; static const char __pyx_k_objective[] = "objective"; static const char __pyx_k_operators[] = "operators"; static const char __pyx_k_part_type[] = "part_type"; static const char __pyx_k_postevent[] = "postevent"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_redundant[] = "redundant"; static const char __pyx_k_row_bsize[] = "row_bsize"; static const char __pyx_k_setActive[] = "setActive"; static const char __pyx_k_setAppCtx[] = "setAppCtx"; static const char __pyx_k_setPCSide[] = "setPCSide"; static const char __pyx_k_shifttype[] = "shifttype"; static const char __pyx_k_snes_type[] = "snes_type"; static const char __pyx_k_structure[] = "structure"; static const char __pyx_k_symmetric[] = "symmetric"; static const char __pyx_k_syncFlush[] = "syncFlush"; static const char __pyx_k_syncPrint[] = "syncPrint"; static const char __pyx_k_terminate[] = "terminate"; static const char __pyx_k_threshold[] = "threshold"; static const char __pyx_k_time_step[] = "time_step"; static const char __pyx_k_traceback[] = "_traceback_"; static const char __pyx_k_transpose[] = "transpose"; static const char __pyx_k_varbounds[] = "varbounds"; static const char __pyx_k_zeropivot[] = "zeropivot"; static const char __pyx_k_ADD_VALUES[] = "ADD_VALUES"; static const char __pyx_k_ALLGATHERV[] = "ALLGATHERV"; static const char __pyx_k_ASCII_IMPL[] = "ASCII_IMPL"; static const char __pyx_k_ASCII_INFO[] = "ASCII_INFO"; static const char __pyx_k_BACK_RIGHT[] = "BACK_RIGHT"; static const char __pyx_k_COMM_WORLD[] = "COMM_WORLD"; static const char __pyx_k_DOWN_RIGHT[] = "DOWN_RIGHT"; static const char __pyx_k_DRAW_BASIC[] = "DRAW_BASIC"; static const char __pyx_k_DRAW_PORTS[] = "DRAW_PORTS"; static const char __pyx_k_FIELDSPLIT[] = "FIELDSPLIT"; static const char __pyx_k_FINAL_ONLY[] = "FINAL_ONLY"; static const char __pyx_k_FRONT_DOWN[] = "FRONT_DOWN"; static const char __pyx_k_FRONT_LEFT[] = "FRONT_LEFT"; static const char __pyx_k_GLOBAL_MAX[] = "GLOBAL_MAX"; static const char __pyx_k_GLOBAL_SUM[] = "GLOBAL_SUM"; static const char __pyx_k_HDF5_PETSC[] = "HDF5_PETSC"; static const char __pyx_k_INSERT_ALL[] = "INSERT_ALL"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_InsertMode[] = "InsertMode"; static const char __pyx_k_MAX_VALUES[] = "MAX_VALUES"; static const char __pyx_k_MPIAIJPERM[] = "MPIAIJPERM"; static const char __pyx_k_MPIAIJSELL[] = "MPIAIJSELL"; static const char __pyx_k_MPIBAIJMKL[] = "MPIBAIJMKL"; static const char __pyx_k_MatSORType[] = "MatSORType"; static const char __pyx_k_OPTION_MAX[] = "OPTION_MAX"; static const char __pyx_k_OPTION_MIN[] = "OPTION_MIN"; static const char __pyx_k_PCGAMGType[] = "PCGAMGType"; static const char __pyx_k_PCGASMType[] = "PCGASMType"; static const char __pyx_k_PIPEFGMRES[] = "PIPEFGMRES"; static const char __pyx_k_RICHARDSON[] = "RICHARDSON"; static const char __pyx_k_RandomType[] = "RandomType"; static const char __pyx_k_SAVIENNACL[] = "SAVIENNACL"; static const char __pyx_k_SEQAIJPERM[] = "SEQAIJPERM"; static const char __pyx_k_SEQAIJSELL[] = "SEQAIJSELL"; static const char __pyx_k_SEQBAIJMKL[] = "SEQBAIJMKL"; static const char __pyx_k_ScalarType[] = "ScalarType"; static const char __pyx_k_SolverType[] = "SolverType"; static const char __pyx_k_THIRD_SIZE[] = "THIRD_SIZE"; static const char __pyx_k_UNKNOWN_NZ[] = "UNKNOWN_NZ"; static const char __pyx_k_USE_INODES[] = "USE_INODES"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_Vec_buffer[] = "_Vec_buffer"; static const char __pyx_k_ViewerHDF5[] = "ViewerHDF5"; static const char __pyx_k_ViewerType[] = "ViewerType"; static const char __pyx_k_assemblies[] = "assemblies"; static const char __pyx_k_authorinfo[] = "authorinfo"; static const char __pyx_k_back_right[] = "back_right"; static const char __pyx_k_begin_args[] = "begin_args"; static const char __pyx_k_block_size[] = "block_size"; static const char __pyx_k_compressed[] = "compressed"; static const char __pyx_k_conforming[] = "conforming"; static const char __pyx_k_createVecs[] = "createVecs"; static const char __pyx_k_cudahandle[] = "cudahandle"; static const char __pyx_k_cycle_type[] = "cycle_type"; static const char __pyx_k_down_right[] = "down_right"; static const char __pyx_k_empty_name[] = "empty name"; static const char __pyx_k_errhandler[] = "errhandler"; static const char __pyx_k_fieldnames[] = "fieldnames"; static const char __pyx_k_fill_param[] = "fill_param"; static const char __pyx_k_front_down[] = "front_down"; static const char __pyx_k_front_left[] = "front_left"; static const char __pyx_k_getCPUTime[] = "getCPUTime"; static const char __pyx_k_getClassId[] = "getClassId"; static const char __pyx_k_getCorners[] = "getCorners"; static const char __pyx_k_getIndices[] = "getIndices"; static const char __pyx_k_getMaxTime[] = "getMaxTime"; static const char __pyx_k_getSection[] = "getSection"; static const char __pyx_k_getStencil[] = "getStencil"; static const char __pyx_k_getVecLeft[] = "getVecLeft"; static const char __pyx_k_getVersion[] = "getVersion"; static const char __pyx_k_getVisible[] = "getVisible"; static const char __pyx_k_initialize[] = "_initialize"; static const char __pyx_k_isIdentity[] = "isIdentity"; static const char __pyx_k_layoutType[] = "layoutType"; static const char __pyx_k_leafupdate[] = "leafupdate"; static const char __pyx_k_lgmap_type[] = "lgmap_type"; static const char __pyx_k_linear_its[] = "linear_its"; static const char __pyx_k_mpi4py_MPI[] = "mpi4py.MPI"; static const char __pyx_k_proc_sizes[] = "proc_sizes"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_reciprocal[] = "reciprocal"; static const char __pyx_k_setMaxTime[] = "setMaxTime"; static const char __pyx_k_setSection[] = "setSection"; static const char __pyx_k_setVisible[] = "setVisible"; static const char __pyx_k_shift_type[] = "shift_type"; static const char __pyx_k_startswith[] = "startswith"; static const char __pyx_k_useAnchors[] = "useAnchors"; static const char __pyx_k_useClosure[] = "useClosure"; static const char __pyx_k_AIJCUSPARSE[] = "AIJCUSPARSE"; static const char __pyx_k_AIJVIENNACL[] = "AIJVIENNACL"; static const char __pyx_k_APPLY_LOWER[] = "APPLY_LOWER"; static const char __pyx_k_APPLY_UPPER[] = "APPLY_UPPER"; static const char __pyx_k_ARKIMEX1BEE[] = "ARKIMEX1BEE"; static const char __pyx_k_ARKIMEXBPR3[] = "ARKIMEXBPR3"; static const char __pyx_k_ARKIMEXType[] = "ARKIMEXType"; static const char __pyx_k_ASCII_DENSE[] = "ASCII_DENSE"; static const char __pyx_k_ASCII_GLVIS[] = "ASCII_GLVIS"; static const char __pyx_k_ASCII_INDEX[] = "ASCII_INDEX"; static const char __pyx_k_ASCII_LATEX[] = "ASCII_LATEX"; static const char __pyx_k_ASCII_PCICE[] = "ASCII_PCICE"; static const char __pyx_k_CollectType[] = "CollectType"; static const char __pyx_k_ComplexType[] = "ComplexType"; static const char __pyx_k_DMComposite[] = "DMComposite"; static const char __pyx_k_DMSwarmType[] = "DMSwarmType"; static const char __pyx_k_ElementType[] = "ElementType"; static const char __pyx_k_Error___str[] = "Error.__str__"; static const char __pyx_k_FRONT_RIGHT[] = "FRONT_RIGHT"; static const char __pyx_k_HYPRESTRUCT[] = "HYPRESTRUCT"; static const char __pyx_k_INTERPOLATE[] = "INTERPOLATE"; static const char __pyx_k_KSPNormType[] = "KSPNormType"; static const char __pyx_k_LMVMBROYDEN[] = "LMVMBROYDEN"; static const char __pyx_k_MATHEMATICA[] = "MATHEMATICA"; static const char __pyx_k_MGCycleType[] = "MGCycleType"; static const char __pyx_k_MKL_PARDISO[] = "MKL_PARDISO"; static const char __pyx_k_MPIVIENNACL[] = "MPIVIENNACL"; static const char __pyx_k_MatInfoType[] = "MatInfoType"; static const char __pyx_k_Mat_Stencil[] = "_Mat_Stencil"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_MigrateType[] = "MigrateType"; static const char __pyx_k_NORM_ALWAYS[] = "NORM_ALWAYS"; static const char __pyx_k_NRICHARDSON[] = "NRICHARDSON"; static const char __pyx_k_Partitioner[] = "Partitioner"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_ProblemType[] = "ProblemType"; static const char __pyx_k_RUNGE_KUTTA[] = "RUNGE_KUTTA"; static const char __pyx_k_SEQVIENNACL[] = "SEQVIENNACL"; static const char __pyx_k_SORTED_FULL[] = "SORTED_FULL"; static const char __pyx_k_ScatterMode[] = "ScatterMode"; static const char __pyx_k_ScatterType[] = "ScatterType"; static const char __pyx_k_StencilType[] = "StencilType"; static const char __pyx_k_SystemError[] = "SystemError"; static const char __pyx_k_UNSPECIFIED[] = "UNSPECIFIED"; static const char __pyx_k_begin_kargs[] = "begin_kargs"; static const char __pyx_k_coarsenhook[] = "coarsenhook"; static const char __pyx_k_constraints[] = "constraints"; static const char __pyx_k_coordinates[] = "coordinates"; static const char __pyx_k_createLabel[] = "createLabel"; static const char __pyx_k_create_gvec[] = "create_gvec"; static const char __pyx_k_create_lvec[] = "create_lvec"; static const char __pyx_k_entityDepth[] = "entityDepth"; static const char __pyx_k_front_right[] = "front_right"; static const char __pyx_k_getGradient[] = "getGradient"; static const char __pyx_k_getInterval[] = "getInterval"; static const char __pyx_k_getMaxSteps[] = "getMaxSteps"; static const char __pyx_k_getNormType[] = "getNormType"; static const char __pyx_k_getNumberDM[] = "getNumberDM"; static const char __pyx_k_getRefCount[] = "getRefCount"; static const char __pyx_k_getSolution[] = "getSolution"; static const char __pyx_k_getTimeStep[] = "getTimeStep"; static const char __pyx_k_getVecRight[] = "getVecRight"; static const char __pyx_k_hasLagrange[] = "hasLagrange"; static const char __pyx_k_interp_type[] = "interp_type"; static const char __pyx_k_interpolate[] = "interpolate"; static const char __pyx_k_isAssembled[] = "isAssembled"; static const char __pyx_k_isFinalized[] = "isFinalized"; static const char __pyx_k_isHermitian[] = "isHermitian"; static const char __pyx_k_isSymmetric[] = "isSymmetric"; static const char __pyx_k_numMessages[] = "numMessages"; static const char __pyx_k_nz_unneeded[] = "nz_unneeded"; static const char __pyx_k_orientation[] = "orientation"; static const char __pyx_k_setDiagonal[] = "setDiagonal"; static const char __pyx_k_setInterval[] = "setInterval"; static const char __pyx_k_setMaxSteps[] = "setMaxSteps"; static const char __pyx_k_setNormType[] = "setNormType"; static const char __pyx_k_setParamsEW[] = "setParamsEW"; static const char __pyx_k_setTimeStep[] = "setTimeStep"; static const char __pyx_k_shiftamount[] = "shiftamount"; static const char __pyx_k_stenciltype[] = "stenciltype"; static const char __pyx_k_step_number[] = "step_number"; static const char __pyx_k_traceback_2[] = "traceback"; static const char __pyx_k_ASCII_COMMON[] = "ASCII_COMMON"; static const char __pyx_k_ASCII_MATLAB[] = "ASCII_MATLAB"; static const char __pyx_k_ASCII_PYTHON[] = "ASCII_PYTHON"; static const char __pyx_k_AssemblyType[] = "AssemblyType"; static const char __pyx_k_BACK_UP_LEFT[] = "BACK_UP_LEFT"; static const char __pyx_k_BoundaryType[] = "BoundaryType"; static const char __pyx_k_COLLECT_USER[] = "COLLECT_USER"; static const char __pyx_k_DIFFERENT_NZ[] = "DIFFERENT_NZ"; static const char __pyx_k_DIVERGED_NAN[] = "DIVERGED_NAN"; static const char __pyx_k_DRAW_CONTOUR[] = "DRAW_CONTOUR"; static const char __pyx_k_EquationType[] = "EquationType"; static const char __pyx_k_Error___init[] = "Error.__init__"; static const char __pyx_k_Error___repr[] = "Error.__repr__"; static const char __pyx_k_HYPRESSTRUCT[] = "HYPRESSTRUCT"; static const char __pyx_k_INITIAL_ONLY[] = "INITIAL_ONLY"; static const char __pyx_k_LAYOUT_GAUSS[] = "LAYOUT_GAUSS"; static const char __pyx_k_LOAD_BALANCE[] = "LOAD_BALANCE"; static const char __pyx_k_MIGRATE_USER[] = "MIGRATE_USER"; static const char __pyx_k_MKL_CPARDISO[] = "MKL_CPARDISO"; static const char __pyx_k_MatStructure[] = "MatStructure"; static const char __pyx_k_NORM_1_AND_2[] = "NORM_1_AND_2"; static const char __pyx_k_NORM_DEFAULT[] = "NORM_DEFAULT"; static const char __pyx_k_NORM_NATURAL[] = "NORM_NATURAL"; static const char __pyx_k_NormSchedule[] = "NormSchedule"; static const char __pyx_k_ODE_EXPLICIT[] = "ODE_EXPLICIT"; static const char __pyx_k_ODE_IMPLICIT[] = "ODE_IMPLICIT"; static const char __pyx_k_OrderingType[] = "OrderingType"; static const char __pyx_k_PREALLOCATOR[] = "PREALLOCATOR"; static const char __pyx_k_QUARTER_SIZE[] = "QUARTER_SIZE"; static const char __pyx_k_REDISTRIBUTE[] = "REDISTRIBUTE"; static const char __pyx_k_ROW_ORIENTED[] = "ROW_ORIENTED"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_SEQDENSECUDA[] = "SEQDENSECUDA"; static const char __pyx_k_SUPERLU_DIST[] = "SUPERLU_DIST"; static const char __pyx_k_SchurPreType[] = "SchurPreType"; static const char __pyx_k_TRANSPOSEMAT[] = "TRANSPOSEMAT"; static const char __pyx_k_VINEWTONRSLS[] = "VINEWTONRSLS"; static const char __pyx_k_VINEWTONSSLS[] = "VINEWTONSSLS"; static const char __pyx_k_ViewerFormat[] = "ViewerFormat"; static const char __pyx_k_back_up_left[] = "back_up_left"; static const char __pyx_k_cellNodeMaps[] = "cellNodeMaps"; static const char __pyx_k_createMatrix[] = "createMatrix"; static const char __pyx_k_create_subdm[] = "create_subdm"; static const char __pyx_k_dmswarm_type[] = "dmswarm_type"; static const char __pyx_k_error_code_d[] = "error code %d"; static const char __pyx_k_eventhandler[] = "eventhandler"; static const char __pyx_k_getActiveAll[] = "getActiveAll"; static const char __pyx_k_getBlockInfo[] = "getBlockInfo"; static const char __pyx_k_getBlockSize[] = "getBlockSize"; static const char __pyx_k_getClassName[] = "getClassName"; static const char __pyx_k_getDefaultSF[] = "getDefaultSF"; static const char __pyx_k_getDimension[] = "getDimension"; static const char __pyx_k_getLocalSize[] = "getLocalSize"; static const char __pyx_k_getOperators[] = "getOperators"; static const char __pyx_k_getProcSizes[] = "getProcSizes"; static const char __pyx_k_getSectionSF[] = "getSectionSF"; static const char __pyx_k_ghostBcNodes[] = "ghostBcNodes"; static const char __pyx_k_initialguess[] = "initialguess"; static const char __pyx_k_nz_allocated[] = "nz_allocated"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_restricthook[] = "restricthook"; static const char __pyx_k_rhsjacobianp[] = "rhsjacobianp"; static const char __pyx_k_scatter_type[] = "scatter_type"; static const char __pyx_k_setActiveAll[] = "setActiveAll"; static const char __pyx_k_setDefaultSF[] = "setDefaultSF"; static const char __pyx_k_setDimension[] = "setDimension"; static const char __pyx_k_setSectionSF[] = "setSectionSF"; static const char __pyx_k_stencil_type[] = "stencil_type"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_wrapped_func[] = "wrapped_func"; static const char __pyx_k_ADD_BC_VALUES[] = "ADD_BC_VALUES"; static const char __pyx_k_APPEND_UPDATE[] = "APPEND_UPDATE"; static const char __pyx_k_ARKIMEXARS122[] = "ARKIMEXARS122"; static const char __pyx_k_ARKIMEXARS443[] = "ARKIMEXARS443"; static const char __pyx_k_ARKIMEXPRSSP2[] = "ARKIMEXPRSSP2"; static const char __pyx_k_ASCII_SYMMODU[] = "ASCII_SYMMODU"; static const char __pyx_k_BACK_UP_RIGHT[] = "BACK_UP_RIGHT"; static const char __pyx_k_BINARY_MATLAB[] = "BINARY_MATLAB"; static const char __pyx_k_COLLECT_BASIC[] = "COLLECT_BASIC"; static const char __pyx_k_CONVERGED_ITS[] = "CONVERGED_ITS"; static const char __pyx_k_CompositeType[] = "CompositeType"; static const char __pyx_k_DIVERGED_DTOL[] = "DIVERGED_DTOL"; static const char __pyx_k_DIVERGED_NULL[] = "DIVERGED_NULL"; static const char __pyx_k_DIVERGED_USER[] = "DIVERGED_USER"; static const char __pyx_k_FORWARD_LOCAL[] = "FORWARD_LOCAL"; static const char __pyx_k_FORWARD_SWEEP[] = "FORWARD_SWEEP"; static const char __pyx_k_FRONT_UP_LEFT[] = "FRONT_UP_LEFT"; static const char __pyx_k_INSERT_VALUES[] = "INSERT_VALUES"; static const char __pyx_k_MIGRATE_BASIC[] = "MIGRATE_BASIC"; static const char __pyx_k_MatSolverType[] = "MatSolverType"; static const char __pyx_k_NORM_INFINITY[] = "NORM_INFINITY"; static const char __pyx_k_PCMGCycleType[] = "PCMGCycleType"; static const char __pyx_k_PETSc_Error_d[] = "PETSc.Error(%d)"; static const char __pyx_k_PETSc_Log_pyx[] = "PETSc/Log.pyx"; static const char __pyx_k_PICLayoutType[] = "PICLayoutType"; static const char __pyx_k_REVERSE_LOCAL[] = "REVERSE_LOCAL"; static const char __pyx_k_SCATTER_LOCAL[] = "SCATTER_LOCAL"; static const char __pyx_k_SchurFactType[] = "SchurFactType"; static const char __pyx_k_TSARKIMEXType[] = "TSARKIMEXType"; static const char __pyx_k_TSProblemType[] = "TSProblemType"; static const char __pyx_k_Vec_LocalForm[] = "_Vec_LocalForm"; static const char __pyx_k_adjoint_steps[] = "adjoint_steps"; static const char __pyx_k_back_up_right[] = "back_up_right"; static const char __pyx_k_boundary_type[] = "boundary_type"; static const char __pyx_k_createVecLeft[] = "createVecLeft"; static const char __pyx_k_create_matrix[] = "create_matrix"; static const char __pyx_k_diagonalScale[] = "diagonalScale"; static const char __pyx_k_diagonal_fill[] = "diagonal_fill"; static const char __pyx_k_front_up_left[] = "front_up_left"; static const char __pyx_k_getBlockSizes[] = "getBlockSizes"; static const char __pyx_k_getLocalSizes[] = "getLocalSizes"; static const char __pyx_k_getStepNumber[] = "getStepNumber"; static const char __pyx_k_getTolerances[] = "getTolerances"; static const char __pyx_k_globalBcNodes[] = "globalBcNodes"; static const char __pyx_k_isInitialized[] = "isInitialized"; static const char __pyx_k_isPermutation[] = "isPermutation"; static const char __pyx_k_messageLength[] = "messageLength"; static const char __pyx_k_multirootdata[] = "multirootdata"; static const char __pyx_k_numReductions[] = "numReductions"; static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_s_line_d_in_s[] = "%s() line %d in %s"; static const char __pyx_k_setStepNumber[] = "setStepNumber"; static const char __pyx_k_setTolerances[] = "setTolerances"; static const char __pyx_k_stencil_width[] = "stencil_width"; static const char __pyx_k_type_registry[] = "__type_registry__"; static const char __pyx_k_ADD_ALL_VALUES[] = "ADD_ALL_VALUES"; static const char __pyx_k_ASCII_VTK_CELL[] = "ASCII_VTK_CELL"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_BACKWARD_SWEEP[] = "BACKWARD_SWEEP"; static const char __pyx_k_BACK_DOWN_LEFT[] = "BACK_DOWN_LEFT"; static const char __pyx_k_CONVERGED_ATOL[] = "CONVERGED_ATOL"; static const char __pyx_k_CONVERGED_MINF[] = "CONVERGED_MINF"; static const char __pyx_k_CONVERGED_RTOL[] = "CONVERGED_RTOL"; static const char __pyx_k_CONVERGED_TIME[] = "CONVERGED_TIME"; static const char __pyx_k_CONVERGED_USER[] = "CONVERGED_USER"; static const char __pyx_k_CRANK_NICOLSON[] = "CRANK_NICOLSON"; static const char __pyx_k_DIVERGED_INNER[] = "DIVERGED_INNER"; static const char __pyx_k_DMBoundaryType[] = "DMBoundaryType"; static const char __pyx_k_DMDA_Vec_array[] = "_DMDA_Vec_array"; static const char __pyx_k_DRAW_LG_XRANGE[] = "DRAW_LG_XRANGE"; static const char __pyx_k_EventDecorator[] = "EventDecorator"; static const char __pyx_k_ExactFinalTime[] = "ExactFinalTime"; static const char __pyx_k_FINAL_ASSEMBLY[] = "FINAL_ASSEMBLY"; static const char __pyx_k_FLUSH_ASSEMBLY[] = "FLUSH_ASSEMBLY"; static const char __pyx_k_FRONT_UP_RIGHT[] = "FRONT_UP_RIGHT"; static const char __pyx_k_LAYOUT_REGULAR[] = "LAYOUT_REGULAR"; static const char __pyx_k_LMVMBADBROYDEN[] = "LMVMBADBROYDEN"; static const char __pyx_k_LMVMSYMBROYDEN[] = "LMVMSYMBROYDEN"; static const char __pyx_k_MEMORYSCALABLE[] = "MEMORYSCALABLE"; static const char __pyx_k_MPIAIJCUSPARSE[] = "MPIAIJCUSPARSE"; static const char __pyx_k_MPIAIJVIENNACL[] = "MPIAIJVIENNACL"; static const char __pyx_k_MULTIPLICATIVE[] = "MULTIPLICATIVE"; static const char __pyx_k_NORM_FROBENIUS[] = "NORM_FROBENIUS"; static const char __pyx_k_NOT_SET_VALUES[] = "NOT_SET_VALUES"; static const char __pyx_k_NotImplemented[] = "NotImplemented"; static const char __pyx_k_PRECONDITIONED[] = "PRECONDITIONED"; static const char __pyx_k_SEQAIJCUSPARSE[] = "SEQAIJCUSPARSE"; static const char __pyx_k_SEQAIJVIENNACL[] = "SEQAIJVIENNACL"; static const char __pyx_k_STRUCTURE_ONLY[] = "STRUCTURE_ONLY"; static const char __pyx_k_SYMMETRY_SWEEP[] = "SYMMETRY_SWEEP"; static const char __pyx_k_TSEquationType[] = "TSEquationType"; static const char __pyx_k_USE_HASH_TABLE[] = "USE_HASH_TABLE"; static const char __pyx_k_back_down_left[] = "back_down_left"; static const char __pyx_k_boundary_types[] = "boundary_types"; static const char __pyx_k_createLocalVec[] = "createLocalVec"; static const char __pyx_k_createVecRight[] = "createVecRight"; static const char __pyx_k_empty_citation[] = "empty citation"; static const char __pyx_k_factor_mallocs[] = "factor_mallocs"; static const char __pyx_k_front_up_right[] = "front_up_right"; static const char __pyx_k_getDefaultComm[] = "getDefaultComm"; static const char __pyx_k_getGhostRanges[] = "getGhostRanges"; static const char __pyx_k_getGlobalSizes[] = "getGlobalSizes"; static const char __pyx_k_getKSPFailures[] = "getKSPFailures"; static const char __pyx_k_getProblemType[] = "getProblemType"; static const char __pyx_k_getStencilType[] = "getStencilType"; static const char __pyx_k_getVersionInfo[] = "getVersionInfo"; static const char __pyx_k_jacobian_state[] = "jacobian_state"; static const char __pyx_k_petsc4py_PETSc[] = "petsc4py.PETSc"; static const char __pyx_k_setDefaultComm[] = "setDefaultComm"; static const char __pyx_k_setProblemType[] = "setProblemType"; static const char __pyx_k_splitOwnership[] = "splitOwnership"; static const char __pyx_k_BACK_DOWN_RIGHT[] = "BACK_DOWN_RIGHT"; static const char __pyx_k_BASICSYMPLECTIC[] = "BASICSYMPLECTIC"; static const char __pyx_k_CHOWILUVIENNACL[] = "CHOWILUVIENNACL"; static const char __pyx_k_COLLECT_GENERAL[] = "COLLECT_GENERAL"; static const char __pyx_k_CONVERGED_EVENT[] = "CONVERGED_EVENT"; static const char __pyx_k_CONVERGED_GATOL[] = "CONVERGED_GATOL"; static const char __pyx_k_CONVERGED_GRTOL[] = "CONVERGED_GRTOL"; static const char __pyx_k_CONVERGED_GTTOL[] = "CONVERGED_GTTOL"; static const char __pyx_k_ConvergedReason[] = "ConvergedReason"; static const char __pyx_k_DIVERGED_MAXFCN[] = "DIVERGED_MAXFCN"; static const char __pyx_k_DIVERGED_MAXITS[] = "DIVERGED_MAXITS"; static const char __pyx_k_DIVERGED_MAX_IT[] = "DIVERGED_MAX_IT"; static const char __pyx_k_DMDAElementType[] = "DMDAElementType"; static const char __pyx_k_DMDAStencilType[] = "DMDAStencilType"; static const char __pyx_k_Error___nonzero[] = "Error.__nonzero__"; static const char __pyx_k_FRONT_DOWN_LEFT[] = "FRONT_DOWN_LEFT"; static const char __pyx_k_FactorShiftType[] = "FactorShiftType"; static const char __pyx_k_MATPARTITIONING[] = "MATPARTITIONING"; static const char __pyx_k_MatAssemblyType[] = "MatAssemblyType"; static const char __pyx_k_MatOrderingType[] = "MatOrderingType"; static const char __pyx_k_NORMALHERMITIAN[] = "NORMALHERMITIAN"; static const char __pyx_k_NORM_FINAL_ONLY[] = "NORM_FINAL_ONLY"; static const char __pyx_k_PCCompositeType[] = "PCCompositeType"; static const char __pyx_k_PETSc_Error_pyx[] = "PETSc/Error.pyx"; static const char __pyx_k_PETSc_PETSc_pyx[] = "PETSc/PETSc.pyx"; static const char __pyx_k_PartitionerType[] = "PartitionerType"; static const char __pyx_k_SCATTER_FORWARD[] = "SCATTER_FORWARD"; static const char __pyx_k_SCATTER_REVERSE[] = "SCATTER_REVERSE"; static const char __pyx_k_SCHURCOMPLEMENT[] = "SCHURCOMPLEMENT"; static const char __pyx_k_SPARSEELEMENTAL[] = "SPARSEELEMENTAL"; static const char __pyx_k_SUBMAT_SINGLEIS[] = "SUBMAT_SINGLEIS"; static const char __pyx_k_StencilLocation[] = "StencilLocation"; static const char __pyx_k_View_MemoryView[] = "View.MemoryView"; static const char __pyx_k_allocate_buffer[] = "allocate_buffer"; static const char __pyx_k_array_interface[] = "__array_interface__"; static const char __pyx_k_back_down_right[] = "back_down_right"; static const char __pyx_k_coneOrientation[] = "coneOrientation"; static const char __pyx_k_createDefaultSF[] = "createDefaultSF"; static const char __pyx_k_createGlobalVec[] = "createGlobalVec"; static const char __pyx_k_createSectionSF[] = "createSectionSF"; static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; static const char __pyx_k_front_down_left[] = "front_down_left"; static const char __pyx_k_getBlockIndices[] = "getBlockIndices"; static const char __pyx_k_getBoundaryType[] = "getBoundaryType"; static const char __pyx_k_getEquationType[] = "getEquationType"; static const char __pyx_k_getFunctionNorm[] = "getFunctionNorm"; static const char __pyx_k_getGhostCorners[] = "getGhostCorners"; static const char __pyx_k_getResidualNorm[] = "getResidualNorm"; static const char __pyx_k_getSolutionNorm[] = "getSolutionNorm"; static const char __pyx_k_getStencilWidth[] = "getStencilWidth"; static const char __pyx_k_getStepFailures[] = "getStepFailures"; static const char __pyx_k_jacobian_design[] = "jacobian_design"; static const char __pyx_k_popErrorHandler[] = "popErrorHandler"; static const char __pyx_k_prefix_s_name_s[] = "(prefix:%s, name:%s)"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_refinementLimit[] = "refinementLimit"; static const char __pyx_k_setEquationType[] = "setEquationType"; static const char __pyx_k_setFunctionNorm[] = "setFunctionNorm"; static const char __pyx_k_setResidualNorm[] = "setResidualNorm"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_subspaceOffsets[] = "subspaceOffsets"; static const char __pyx_k_useInitialGuess[] = "useInitialGuess"; static const char __pyx_k_ASCII_VTK_COORDS[] = "ASCII_VTK_COORDS"; static const char __pyx_k_CONSTANTDIAGONAL[] = "CONSTANTDIAGONAL"; static const char __pyx_k_FRONT_DOWN_RIGHT[] = "FRONT_DOWN_RIGHT"; static const char __pyx_k_INSERT_BC_VALUES[] = "INSERT_BC_VALUES"; static const char __pyx_k_KSPTRANSPOSEONLY[] = "KSPTRANSPOSEONLY"; static const char __pyx_k_LMVMDIAGBBROYDEN[] = "LMVMDIAGBBROYDEN"; static const char __pyx_k_SNESNormSchedule[] = "SNESNormSchedule"; static const char __pyx_k_SYMMETRY_ETERNAL[] = "SYMMETRY_ETERNAL"; static const char __pyx_k_TAO_Solver_Types[] = "\n TAO Solver Types\n "; static const char __pyx_k_TSExactFinalTime[] = "TSExactFinalTime"; static const char __pyx_k_UNPRECONDITIONED[] = "UNPRECONDITIONED"; static const char __pyx_k_createNaturalVec[] = "createNaturalVec"; static const char __pyx_k_create_injection[] = "create_injection"; static const char __pyx_k_fill_ratio_given[] = "fill_ratio_given"; static const char __pyx_k_front_down_right[] = "front_down_right"; static const char __pyx_k_getBoundaryTypes[] = "getBoundaryTypes"; static const char __pyx_k_getFunctionValue[] = "getFunctionValue"; static const char __pyx_k_getGlobalSection[] = "getGlobalSection"; static const char __pyx_k_getOptionsPrefix[] = "getOptionsPrefix"; static const char __pyx_k_ownership_ranges[] = "ownership_ranges"; static const char __pyx_k_popSignalHandler[] = "popSignalHandler"; static const char __pyx_k_pushErrorHandler[] = "pushErrorHandler"; static const char __pyx_k_registerCitation[] = "registerCitation"; static const char __pyx_k_setGlobalSection[] = "setGlobalSection"; static const char __pyx_k_setOptionsPrefix[] = "setOptionsPrefix"; static const char __pyx_k_ASCII_FACTOR_INFO[] = "ASCII_FACTOR_INFO"; static const char __pyx_k_ASCII_INFO_DETAIL[] = "ASCII_INFO_DETAIL"; static const char __pyx_k_ASCII_MATHEMATICA[] = "ASCII_MATHEMATICA"; static const char __pyx_k_CONVERGED_STEPTOL[] = "CONVERGED_STEPTOL"; static const char __pyx_k_DIVERGED_NANORINF[] = "DIVERGED_NANORINF"; static const char __pyx_k_DIVERGED_TR_DELTA[] = "DIVERGED_TR_DELTA"; static const char __pyx_k_DMStagStencilType[] = "DMStagStencilType"; static const char __pyx_k_INSERT_ALL_VALUES[] = "INSERT_ALL_VALUES"; static const char __pyx_k_InterpolationType[] = "InterpolationType"; static const char __pyx_k_LMVMSYMBADBROYDEN[] = "LMVMSYMBADBROYDEN"; static const char __pyx_k_NORM_INITIAL_ONLY[] = "NORM_INITIAL_ONLY"; static const char __pyx_k_POSITIVE_DEFINITE[] = "POSITIVE_DEFINITE"; static const char __pyx_k_TSConvergedReason[] = "TSConvergedReason"; static const char __pyx_k_createLocalVector[] = "createLocalVector"; static const char __pyx_k_fill_ratio_needed[] = "fill_ratio_needed"; static const char __pyx_k_getDefaultSection[] = "getDefaultSection"; static const char __pyx_k_getMaxKSPFailures[] = "getMaxKSPFailures"; static const char __pyx_k_getObjectiveValue[] = "getObjectiveValue"; static const char __pyx_k_getOwnershipRange[] = "getOwnershipRange"; static const char __pyx_k_getSolutionUpdate[] = "getSolutionUpdate"; static const char __pyx_k_null_communicator[] = "null communicator"; static const char __pyx_k_positive_definite[] = "positive_definite"; static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; static const char __pyx_k_refinementUniform[] = "refinementUniform"; static const char __pyx_k_setDefaultSection[] = "setDefaultSection"; static const char __pyx_k_setMaxKSPFailures[] = "setMaxKSPFailures"; static const char __pyx_k_unknown_options_s[] = "unknown options: %s"; static const char __pyx_k_viennaclvechandle[] = "viennaclvechandle"; static const char __pyx_k_ASCII_MATRIXMARKET[] = "ASCII_MATRIXMARKET"; static const char __pyx_k_CONTINUE_ITERATING[] = "CONTINUE_ITERATING"; static const char __pyx_k_DIVERGED_BREAKDOWN[] = "DIVERGED_BREAKDOWN"; static const char __pyx_k_DIVERGED_FNORM_NAN[] = "DIVERGED_FNORM_NAN"; static const char __pyx_k_DIVERGED_LOCAL_MIN[] = "DIVERGED_LOCAL_MIN"; static const char __pyx_k_DMComposite_access[] = "_DMComposite_access"; static const char __pyx_k_DMSwarmCollectType[] = "DMSwarmCollectType"; static const char __pyx_k_DMSwarmMigrateType[] = "DMSwarmMigrateType"; static const char __pyx_k_INITIAL_FINAL_ONLY[] = "INITIAL_FINAL_ONLY"; static const char __pyx_k_KSPConvergedReason[] = "KSPConvergedReason"; static const char __pyx_k_LAYOUT_SUBDIVISION[] = "LAYOUT_SUBDIVISION"; static const char __pyx_k_MatFactorShiftType[] = "MatFactorShiftType"; static const char __pyx_k_PatchConstructType[] = "PatchConstructType"; static const char __pyx_k_ROWSCALINGVIENNACL[] = "ROWSCALINGVIENNACL"; static const char __pyx_k_TAOConvergedReason[] = "TAOConvergedReason"; static const char __pyx_k_ZERO_INITIAL_GUESS[] = "ZERO_INITIAL_GUESS"; static const char __pyx_k_block_size_not_set[] = "block size not set"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_createGlobalVector[] = "createGlobalVector"; static const char __pyx_k_create_restriction[] = "create_restriction"; static const char __pyx_k_getConvergedReason[] = "getConvergedReason"; static const char __pyx_k_getIterationNumber[] = "getIterationNumber"; static const char __pyx_k_getMaxStepFailures[] = "getMaxStepFailures"; static const char __pyx_k_getOwnershipRanges[] = "getOwnershipRanges"; static const char __pyx_k_hasExternalPackage[] = "hasExternalPackage"; static const char __pyx_k_readonly_attribute[] = "readonly attribute"; static const char __pyx_k_remove_sent_points[] = "remove_sent_points"; static const char __pyx_k_setConvergedReason[] = "setConvergedReason"; static const char __pyx_k_setIterationNumber[] = "setIterationNumber"; static const char __pyx_k_setMaxStepFailures[] = "setMaxStepFailures"; static const char __pyx_k_strided_and_direct[] = ""; static const char __pyx_k_CONVERGED_FNORM_ABS[] = "CONVERGED_FNORM_ABS"; static const char __pyx_k_CONVERGED_ITERATING[] = "CONVERGED_ITERATING"; static const char __pyx_k_DAE_IMPLICIT_INDEX1[] = "DAE_IMPLICIT_INDEX1"; static const char __pyx_k_DAE_IMPLICIT_INDEX2[] = "DAE_IMPLICIT_INDEX2"; static const char __pyx_k_DAE_IMPLICIT_INDEX3[] = "DAE_IMPLICIT_INDEX3"; static const char __pyx_k_DIVERGED_LS_FAILURE[] = "DIVERGED_LS_FAILURE"; static const char __pyx_k_IGNORE_ZERO_ENTRIES[] = "IGNORE_ZERO_ENTRIES"; static const char __pyx_k_I_0_is_d_expected_d[] = "I[0] is %d, expected %d"; static const char __pyx_k_LOCAL_FORWARD_SWEEP[] = "LOCAL_FORWARD_SWEEP"; static const char __pyx_k_MIGRATE_DMCELLEXACT[] = "MIGRATE_DMCELLEXACT"; static const char __pyx_k_NORM_PRECONDITIONED[] = "NORM_PRECONDITIONED"; static const char __pyx_k_NO_OFF_PROC_ENTRIES[] = "NO_OFF_PROC_ENTRIES"; static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; static const char __pyx_k_SNESConvergedReason[] = "SNESConvergedReason"; static const char __pyx_k_createNaturalVector[] = "createNaturalVector"; static const char __pyx_k_DAE_IMPLICIT_INDEXHI[] = "DAE_IMPLICIT_INDEXHI"; static const char __pyx_k_DIVERGED_LINE_SEARCH[] = "DIVERGED_LINE_SEARCH"; static const char __pyx_k_DMSwarmPICLayoutType[] = "DMSwarmPICLayoutType"; static const char __pyx_k_ExactFinalTimeOption[] = "ExactFinalTimeOption"; static const char __pyx_k_KEEP_NONZERO_PATTERN[] = "KEEP_NONZERO_PATTERN"; static const char __pyx_k_LOCAL_BACKWARD_SWEEP[] = "LOCAL_BACKWARD_SWEEP"; static const char __pyx_k_PCPatchConstructType[] = "PCPatchConstructType"; static const char __pyx_k_SAME_NONZERO_PATTERN[] = "SAME_NONZERO_PATTERN"; static const char __pyx_k_create_interpolation[] = "create_interpolation"; static const char __pyx_k_getEntriesPerElement[] = "getEntriesPerElement"; static const char __pyx_k_getInitialGuessKnoll[] = "getInitialGuessKnoll"; static const char __pyx_k_setInitialGuessKnoll[] = "setInitialGuessKnoll"; static const char __pyx_k_strided_and_indirect[] = ""; static const char __pyx_k_unknown_shift_type_s[] = "unknown shift type: %s"; static const char __pyx_k_CONVERGED_ATOL_NORMAL[] = "CONVERGED_ATOL_NORMAL"; static const char __pyx_k_CONVERGED_RTOL_NORMAL[] = "CONVERGED_RTOL_NORMAL"; static const char __pyx_k_CONVERGED_STEP_LENGTH[] = "CONVERGED_STEP_LENGTH"; static const char __pyx_k_DIVERGED_LINEAR_SOLVE[] = "DIVERGED_LINEAR_SOLVE"; static const char __pyx_k_DIVERGED_NONSYMMETRIC[] = "DIVERGED_NONSYMMETRIC"; static const char __pyx_k_DIVERGED_TR_REDUCTION[] = "DIVERGED_TR_REDUCTION"; static const char __pyx_k_DMDAInterpolationType[] = "DMDAInterpolationType"; static const char __pyx_k_DMStagStencilLocation[] = "DMStagStencilLocation"; static const char __pyx_k_LOCAL_SYMMETRIC_SWEEP[] = "LOCAL_SYMMETRIC_SWEEP"; static const char __pyx_k_NEW_NONZERO_LOCATIONS[] = "NEW_NONZERO_LOCATIONS"; static const char __pyx_k_NORM_UNPRECONDITIONED[] = "NORM_UNPRECONDITIONED"; static const char __pyx_k_NO_OFF_PROC_ZERO_ROWS[] = "NO_OFF_PROC_ZERO_ROWS"; static const char __pyx_k_SCATTER_FORWARD_LOCAL[] = "SCATTER_FORWARD_LOCAL"; static const char __pyx_k_SCATTER_REVERSE_LOCAL[] = "SCATTER_REVERSE_LOCAL"; static const char __pyx_k_contiguous_and_direct[] = ""; static const char __pyx_k_getConvergenceHistory[] = "getConvergenceHistory"; static const char __pyx_k_getFunctionTolerances[] = "getFunctionTolerances"; static const char __pyx_k_getGradientTolerances[] = "getGradientTolerances"; static const char __pyx_k_setFunctionTolerances[] = "setFunctionTolerances"; static const char __pyx_k_side_r_not_understood[] = "side '%r' not understood"; static const char __pyx_k_CONVERGED_CG_NEG_CURVE[] = "CONVERGED_CG_NEG_CURVE"; static const char __pyx_k_DIVERGED_INDEFINITE_PC[] = "DIVERGED_INDEFINITE_PC"; static const char __pyx_k_DIVERGED_STEP_REJECTED[] = "DIVERGED_STEP_REJECTED"; static const char __pyx_k_ERROR_LOWER_TRIANGULAR[] = "ERROR_LOWER_TRIANGULAR"; static const char __pyx_k_FORCE_DIAGONAL_ENTRIES[] = "FORCE_DIAGONAL_ENTRIES"; static const char __pyx_k_GETROW_UPPERTRIANGULAR[] = "GETROW_UPPERTRIANGULAR"; static const char __pyx_k_MIGRATE_DMCELLNSCATTER[] = "MIGRATE_DMCELLNSCATTER"; static const char __pyx_k_MemoryView_of_r_object[] = ""; static const char __pyx_k_Object_is_not_writable[] = "Object is not writable."; static const char __pyx_k_STRUCTURALLY_SYMMETRIC[] = "STRUCTURALLY_SYMMETRIC"; static const char __pyx_k_SUBSET_NONZERO_PATTERN[] = "SUBSET_NONZERO_PATTERN"; static const char __pyx_k_communicator_not_owned[] = "communicator not owned"; static const char __pyx_k_getInitialGuessNonzero[] = "getInitialGuessNonzero"; static const char __pyx_k_getLinearSolveFailures[] = "getLinearSolveFailures"; static const char __pyx_k_setInitialGuessNonzero[] = "setInitialGuessNonzero"; static const char __pyx_k_size_I_is_d_expected_d[] = "size(I) is %d, expected %d"; static const char __pyx_k_size_J_is_d_expected_d[] = "size(J) is %d, expected %d"; static const char __pyx_k_size_V_is_d_expected_d[] = "size(V) is %d, expected %d"; static const char __pyx_k_unknown_element_type_s[] = "unknown element type: %s"; static const char __pyx_k_unknown_scatter_mode_s[] = "unknown scatter mode: %s"; static const char __pyx_k_unknown_stencil_type_s[] = "unknown stencil type: %s"; static const char __pyx_k_COLLECT_DMDABOUNDINGBOX[] = "COLLECT_DMDABOUNDINGBOX"; static const char __pyx_k_DIVERGED_BREAKDOWN_BICG[] = "DIVERGED_BREAKDOWN_BICG"; static const char __pyx_k_DIVERGED_FUNCTION_COUNT[] = "DIVERGED_FUNCTION_COUNT"; static const char __pyx_k_DIVERGED_INDEFINITE_MAT[] = "DIVERGED_INDEFINITE_MAT"; static const char __pyx_k_DIVERGED_PCSETUP_FAILED[] = "DIVERGED_PCSETUP_FAILED"; static const char __pyx_k_IGNORE_LOWER_TRIANGULAR[] = "IGNORE_LOWER_TRIANGULAR"; static const char __pyx_k_IGNORE_NEGATIVE_INDICES[] = "IGNORE_NEGATIVE_INDICES"; static const char __pyx_k_IGNORE_OFF_PROC_ENTRIES[] = "IGNORE_OFF_PROC_ENTRIES"; static const char __pyx_k_MemoryView_of_r_at_0x_x[] = ""; static const char __pyx_k_NORM_INITIAL_FINAL_ONLY[] = "NORM_INITIAL_FINAL_ONLY"; static const char __pyx_k_SUBSET_OFF_PROC_ENTRIES[] = "SUBSET_OFF_PROC_ENTRIES"; static const char __pyx_k_UNKNOWN_NONZERO_PATTERN[] = "UNKNOWN_NONZERO_PATTERN"; static const char __pyx_k_contiguous_and_indirect[] = ""; static const char __pyx_k_getConstraintTolerances[] = "getConstraintTolerances"; static const char __pyx_k_getDefaultGlobalSection[] = "getDefaultGlobalSection"; static const char __pyx_k_isStructurallySymmetric[] = "isStructurallySymmetric"; static const char __pyx_k_setDefaultGlobalSection[] = "setDefaultGlobalSection"; static const char __pyx_k_unknown_boundary_type_s[] = "unknown boundary type: %s"; static const char __pyx_k_unknown_error_handler_s[] = "unknown error handler: %s"; static const char __pyx_k_CONVERGED_CG_CONSTRAINED[] = "CONVERGED_CG_CONSTRAINED"; static const char __pyx_k_CONVERGED_FNORM_RELATIVE[] = "CONVERGED_FNORM_RELATIVE"; static const char __pyx_k_CONVERGED_SNORM_RELATIVE[] = "CONVERGED_SNORM_RELATIVE"; static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX1[] = "DAE_SEMI_EXPLICIT_INDEX1"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX2[] = "DAE_SEMI_EXPLICIT_INDEX2"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEX3[] = "DAE_SEMI_EXPLICIT_INDEX3"; static const char __pyx_k_DIVERGED_FUNCTION_DOMAIN[] = "DIVERGED_FUNCTION_DOMAIN"; static const char __pyx_k_DIVERGED_JACOBIAN_DOMAIN[] = "DIVERGED_JACOBIAN_DOMAIN"; static const char __pyx_k_DIVERGED_NONLINEAR_SOLVE[] = "DIVERGED_NONLINEAR_SOLVE"; static const char __pyx_k_Missing_input_parameters[] = "Missing input parameters"; static const char __pyx_k_NEW_NONZERO_LOCATION_ERR[] = "NEW_NONZERO_LOCATION_ERR"; static const char __pyx_k_PCFieldSplitSchurPreType[] = "PCFieldSplitSchurPreType"; static const char __pyx_k_SYMMETRIC_MULTIPLICATIVE[] = "SYMMETRIC_MULTIPLICATIVE"; static const char __pyx_k_getNonlinearStepFailures[] = "getNonlinearStepFailures"; static const char __pyx_k_incompatible_array_sizes[] = "incompatible array sizes"; static const char __pyx_k_CONVERGED_HAPPY_BREAKDOWN[] = "CONVERGED_HAPPY_BREAKDOWN"; static const char __pyx_k_DAE_SEMI_EXPLICIT_INDEXHI[] = "DAE_SEMI_EXPLICIT_INDEXHI"; static const char __pyx_k_DIFFERENT_NONZERO_PATTERN[] = "DIFFERENT_NONZERO_PATTERN"; static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d."; static const char __pyx_k_PCFieldSplitSchurFactType[] = "PCFieldSplitSchurFactType"; static const char __pyx_k_getMaxFunctionEvaluations[] = "getMaxFunctionEvaluations"; static const char __pyx_k_getMaxLinearSolveFailures[] = "getMaxLinearSolveFailures"; static const char __pyx_k_setMaxFunctionEvaluations[] = "setMaxFunctionEvaluations"; static const char __pyx_k_setMaxLinearSolveFailures[] = "setMaxLinearSolveFailures"; static const char __pyx_k_Missing_tensor_information[] = "Missing tensor information"; static const char __pyx_k_NEW_NONZERO_ALLOCATION_ERR[] = "NEW_NONZERO_ALLOCATION_ERR"; static const char __pyx_k_size_d_nnz_is_d_expected_d[] = "size(d_nnz) is %d, expected %d"; static const char __pyx_k_size_o_nnz_is_d_expected_d[] = "size(o_nnz) is %d, expected %d"; static const char __pyx_k_UNUSED_NONZERO_LOCATION_ERR[] = "UNUSED_NONZERO_LOCATION_ERR"; static const char __pyx_k_getMaxNonlinearStepFailures[] = "getMaxNonlinearStepFailures"; static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_setMaxNonlinearStepFailures[] = "setMaxNonlinearStepFailures"; static const char __pyx_k_Unsupported_PetscScalar_type[] = "Unsupported PetscScalar type"; static const char __pyx_k_expecting_tuple_list_or_dict[] = "expecting tuple/list or dict"; static const char __pyx_k_option_prefix_must_be_string[] = "option prefix must be string"; static const char __pyx_k_unknown_interpolation_type_s[] = "unknown interpolation type: %s"; static const char __pyx_k_block_size_d_must_be_positive[] = "block size %d must be positive"; static const char __pyx_k_incompatible_array_sizes_nv_d[] = "incompatible array sizes: nv=%d"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_TAO_Solver_Termination_Reasons[] = "\n TAO Solver Termination Reasons\n "; static const char __pyx_k_expecting_a_C_contiguous_array[] = "expecting a C-contiguous array"; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; static const char __pyx_k_A_matrix_with_d_rows_requires_a[] = "A matrix with %d rows requires a row pointer of length %d (given: %d)"; static const char __pyx_k_EventDecorator_locals_decorator[] = "EventDecorator..decorator..wrapped_func"; static const char __pyx_k_Invalid_mode_expected_r_w_or_rw[] = "Invalid mode: expected 'r', 'w' or 'rw'"; static const char __pyx_k_Invalid_mode_expected_rw_r_or_w[] = "Invalid mode: expected 'rw', 'r', or 'w'"; static const char __pyx_k_Portable_Extensible_Toolkit_for[] = "\nPortable, Extensible Toolkit for Scientific Computation\n"; static const char __pyx_k_bcPoints_is_a_required_argument[] = "bcPoints is a required argument"; static const char __pyx_k_cannot_place_input_array_size_d[] = "cannot place input array size %d, vector size %d"; static const char __pyx_k_key_d_cannot_register_s_already[] = "key: %d, cannot register: %s, already registered: %s"; static const char __pyx_k_size_array_is_d_expected_dx_d_d[] = "size(array) is %d, expected %dx%d=%d"; static const char __pyx_k_unknown_stencil_location_type_s[] = "unknown stencil location type: %s"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview"; static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview"; static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array"; static const char __pyx_k_Expect_a_dltensor_field_pycapsul[] = "Expect a dltensor field, pycapsule.PyCapsule can only be consumed once"; static const char __pyx_k_Expect_a_dltensor_or_used_dltens[] = "Expect a dltensor or used_dltensor field"; static const char __pyx_k_Given_d_column_indices_but_d_non[] = "Given %d column indices but %d non-zero values"; static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))"; static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported"; static const char __pyx_k_Input_vector_has_no_tensor_infor[] = "Input vector has no tensor information"; static const char __pyx_k_Input_vector_type_does_not_match[] = "Input vector type {} does not match current vector type {}"; static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s"; static const char __pyx_k_Must_provide_as_many_communicato[] = "Must provide as many communicators as levels"; static const char __pyx_k_Must_provide_both_sizes_and_poin[] = "Must provide both sizes and points arrays"; static const char __pyx_k_Must_provide_operator_for_USER_o[] = "Must provide operator for USER or PYTHON type"; static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)"; static const char __pyx_k_Out_of_memory_Allocated_d_Used_b[] = "Out of memory. Allocated: %d, Used by process: %d"; static const char __pyx_k_Tensor_dtype_does_not_match_PETS[] = "Tensor dtype = {} does not match PETSc precision"; static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object"; static const char __pyx_k_Vector_local_size_d_is_not_compa[] = "Vector local size %d is not compatible with DMDA local sizes %s"; static const char __pyx_k_accessing_non_existent_buffer_se[] = "accessing non-existent buffer segment"; static const char __pyx_k_array_size_d_and_vector_local_si[] = "array size %d and vector local size %d block size %d"; static const char __pyx_k_array_size_d_incompatible_with_v[] = "array size %d incompatible with vector local size %d"; static const char __pyx_k_cell_indices_must_have_two_dimen[] = "cell indices must have two dimensions: cells.ndim=%d"; static const char __pyx_k_column_indices_must_have_two_dim[] = "column indices must have two dimensions: cols.ndim=%d"; static const char __pyx_k_coordinates_must_have_two_dimens[] = "coordinates must have two dimensions: coordinates.ndim=%d"; static const char __pyx_k_coords_vertices_must_have_two_di[] = "coords vertices must have two dimensions: coords.ndim=%d"; static const char __pyx_k_get1dCoordinatecArrays_for_DMSta[] = "get1dCoordinatecArrays for DMStag not yet implemented in petsc4py"; static const char __pyx_k_getValuesStagStencil_not_yet_imp[] = "getValuesStagStencil not yet implemented in petsc4py"; static const char __pyx_k_getVecArray_for_DMStag_not_yet_i[] = "getVecArray for DMStag not yet implemented in petsc4py"; static const char __pyx_k_ghosts_size_d_array_size_d_and_v[] = "ghosts size %d, array size %d, and vector local size %d block size %d"; static const char __pyx_k_global_size_d_not_divisible_by_b[] = "global size %d not divisible by block size %d"; static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)"; static const char __pyx_k_incompatible_array_sizes_ni_d_nj[] = "incompatible array sizes: ni=%d, nj=%d, nv=%d"; static const char __pyx_k_incompatible_array_sizes_ni_d_nv[] = "incompatible array sizes: ni=%d, nv=%d, bs=%d"; static const char __pyx_k_input_arrays_have_incompatible_s[] = "input arrays have incompatible shapes: rows.shape=%s, cols.shape=%s, vals.shape=%s"; static const char __pyx_k_local_and_global_sizes_cannot_be[] = "local and global sizes cannot be both 'DECIDE'"; static const char __pyx_k_local_size_d_not_divisible_by_bl[] = "local size %d not divisible by block size %d"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_number_of_dimensions_d_and_numbe[] = "number of dimensions %d and number ownership ranges %d"; static const char __pyx_k_option_prefix_should_not_have_sp[] = "option prefix should not have spaces"; static const char __pyx_k_option_prefix_should_not_start_w[] = "option prefix should not start with a hypen"; static const char __pyx_k_ownership_range_size_d_and_numbe[] = "ownership range size %d and number or processors %d"; static const char __pyx_k_row_indices_must_have_two_dimens[] = "row indices must have two dimensions: rows.ndim=%d"; static const char __pyx_k_setValueBlockedStagStencil_not_y[] = "setValueBlockedStagStencil not yet implemented in petsc4py"; static const char __pyx_k_setValueStagStencil_not_yet_impl[] = "setValueStagStencil not yet implemented in petsc4py"; static const char __pyx_k_setValuesStagStencil_not_yet_imp[] = "setValuesStagStencil not yet implemented in petsc4py"; static const char __pyx_k_sizes_array_should_have_d_entrie[] = "sizes array should have %d entries (has %d)"; static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides."; static const char __pyx_k_values_must_have_two_or_more_dim[] = "values must have two or more dimensions: vals.ndim=%d"; static const char __pyx_k_EventDecorator_locals_decorator_2[] = "EventDecorator..decorator"; static const char __pyx_k_incompatible_array_sizes_ni_d_nv_2[] = "incompatible array sizes: ni=%d, nv=%d"; static PyObject *__pyx_n_s_A; static PyObject *__pyx_n_s_A11; static PyObject *__pyx_n_s_ADD; static PyObject *__pyx_n_s_ADDITIVE; static PyObject *__pyx_n_s_ADD_ALL; static PyObject *__pyx_n_s_ADD_ALL_VALUES; static PyObject *__pyx_n_s_ADD_BC; static PyObject *__pyx_n_s_ADD_BC_VALUES; static PyObject *__pyx_n_s_ADD_VALUES; static PyObject *__pyx_n_s_ADIOS; static PyObject *__pyx_n_s_ADIOS2; static PyObject *__pyx_n_s_ADMM; static PyObject *__pyx_n_s_ADVANCED; static PyObject *__pyx_n_s_AGG; static PyObject *__pyx_n_s_AIJ; static PyObject *__pyx_n_s_AIJCRL; static PyObject *__pyx_n_s_AIJCUSPARSE; static PyObject *__pyx_n_s_AIJMKL; static PyObject *__pyx_n_s_AIJPERM; static PyObject *__pyx_n_s_AIJSELL; static PyObject *__pyx_n_s_AIJVIENNACL; static PyObject *__pyx_n_s_ALLGATHER; static PyObject *__pyx_n_s_ALLGATHERV; static PyObject *__pyx_n_s_ALLTOALL; static PyObject *__pyx_n_s_ALMM; static PyObject *__pyx_n_s_ALPHA; static PyObject *__pyx_n_s_ALPHA2; static PyObject *__pyx_n_s_ALWAYS; static PyObject *__pyx_n_s_AMD; static PyObject *__pyx_n_s_ANDERSON; static PyObject *__pyx_n_s_AO; static PyObject *__pyx_n_s_AOType; static PyObject *__pyx_n_s_APPEND; static PyObject *__pyx_n_s_APPEND_UPDATE; static PyObject *__pyx_n_s_APPLY_LOWER; static PyObject *__pyx_n_s_APPLY_UPPER; static PyObject *__pyx_n_s_ARKIMEX; static PyObject *__pyx_n_s_ARKIMEX1BEE; static PyObject *__pyx_n_s_ARKIMEX2C; static PyObject *__pyx_n_s_ARKIMEX2D; static PyObject *__pyx_n_s_ARKIMEX2E; static PyObject *__pyx_n_s_ARKIMEX3; static PyObject *__pyx_n_s_ARKIMEX4; static PyObject *__pyx_n_s_ARKIMEX5; static PyObject *__pyx_n_s_ARKIMEXA2; static PyObject *__pyx_n_s_ARKIMEXARS122; static PyObject *__pyx_n_s_ARKIMEXARS443; static PyObject *__pyx_n_s_ARKIMEXBPR3; static PyObject *__pyx_n_s_ARKIMEXL2; static PyObject *__pyx_n_s_ARKIMEXPRSSP2; static PyObject *__pyx_n_s_ARKIMEXType; static PyObject *__pyx_n_s_ASCII; static PyObject *__pyx_n_s_ASCII_COMMON; static PyObject *__pyx_n_s_ASCII_CSV; static PyObject *__pyx_n_s_ASCII_DENSE; static PyObject *__pyx_n_s_ASCII_FACTOR_INFO; static PyObject *__pyx_n_s_ASCII_GLVIS; static PyObject *__pyx_n_s_ASCII_IMPL; static PyObject *__pyx_n_s_ASCII_INDEX; static PyObject *__pyx_n_s_ASCII_INFO; static PyObject *__pyx_n_s_ASCII_INFO_DETAIL; static PyObject *__pyx_n_s_ASCII_LATEX; static PyObject *__pyx_n_s_ASCII_MATHEMATICA; static PyObject *__pyx_n_s_ASCII_MATLAB; static PyObject *__pyx_n_s_ASCII_MATRIXMARKET; static PyObject *__pyx_n_s_ASCII_PCICE; static PyObject *__pyx_n_s_ASCII_PYTHON; static PyObject *__pyx_n_s_ASCII_SYMMODU; static PyObject *__pyx_n_s_ASCII_VTK; static PyObject *__pyx_n_s_ASCII_VTK_CELL; static PyObject *__pyx_n_s_ASCII_VTK_COORDS; static PyObject *__pyx_n_s_ASCII_XML; static PyObject *__pyx_n_s_ASFLS; static PyObject *__pyx_n_s_ASILS; static PyObject *__pyx_n_s_ASM; static PyObject *__pyx_n_s_ASMType; static PyObject *__pyx_n_s_ASPIN; static PyObject *__pyx_n_s_AU; static PyObject *__pyx_kp_s_A_matrix_with_d_rows_requires_a; static PyObject *__pyx_n_s_AssemblyType; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_n_s_B; static PyObject *__pyx_n_s_BACK; static PyObject *__pyx_n_s_BACKWARD_SWEEP; static PyObject *__pyx_n_s_BACK_DOWN; static PyObject *__pyx_n_s_BACK_DOWN_LEFT; static PyObject *__pyx_n_s_BACK_DOWN_RIGHT; static PyObject *__pyx_n_s_BACK_LEFT; static PyObject *__pyx_n_s_BACK_RIGHT; static PyObject *__pyx_n_s_BACK_UP; static PyObject *__pyx_n_s_BACK_UP_LEFT; static PyObject *__pyx_n_s_BACK_UP_RIGHT; static PyObject *__pyx_n_s_BAIJ; static PyObject *__pyx_n_s_BAIJMKL; static PyObject *__pyx_n_s_BAS; static PyObject *__pyx_n_s_BASIC; static PyObject *__pyx_n_s_BASICSYMPLECTIC; static PyObject *__pyx_n_s_BCGS; static PyObject *__pyx_n_s_BCGSL; static PyObject *__pyx_n_s_BDDC; static PyObject *__pyx_n_s_BDF; static PyObject *__pyx_n_s_BE; static PyObject *__pyx_n_s_BEULER; static PyObject *__pyx_n_s_BFBT; static PyObject *__pyx_n_s_BICG; static PyObject *__pyx_n_s_BINARY; static PyObject *__pyx_n_s_BINARY_MATLAB; static PyObject *__pyx_n_s_BJACOBI; static PyObject *__pyx_n_s_BLMVM; static PyObject *__pyx_n_s_BLOCK; static PyObject *__pyx_n_s_BLOCKMAT; static PyObject *__pyx_n_s_BMRM; static PyObject *__pyx_n_s_BNCG; static PyObject *__pyx_n_s_BNLS; static PyObject *__pyx_n_s_BNTL; static PyObject *__pyx_n_s_BNTR; static PyObject *__pyx_n_s_BOX; static PyObject *__pyx_n_s_BQNKLS; static PyObject *__pyx_n_s_BQNKTL; static PyObject *__pyx_n_s_BQNKTR; static PyObject *__pyx_n_s_BQNLS; static PyObject *__pyx_n_s_BQPIP; static PyObject *__pyx_n_s_BRGN; static PyObject *__pyx_n_s_Barrier; static PyObject *__pyx_n_s_BoundaryType; static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri; static PyObject *__pyx_n_s_C; static PyObject *__pyx_n_s_CG; static PyObject *__pyx_n_s_CGLS; static PyObject *__pyx_n_s_CGNE; static PyObject *__pyx_n_s_CGS; static PyObject *__pyx_n_s_CHACO; static PyObject *__pyx_n_s_CHEBYSHEV; static PyObject *__pyx_n_s_CHOLESKY; static PyObject *__pyx_n_s_CHOLMOD; static PyObject *__pyx_n_s_CHOWILUVIENNACL; static PyObject *__pyx_n_s_CLASSICAL; static PyObject *__pyx_n_s_CN; static PyObject *__pyx_n_s_COLLECT_BASIC; static PyObject *__pyx_n_s_COLLECT_DMDABOUNDINGBOX; static PyObject *__pyx_n_s_COLLECT_GENERAL; static PyObject *__pyx_n_s_COLLECT_USER; static PyObject *__pyx_n_s_COMM_NULL; static PyObject *__pyx_n_s_COMM_SELF; static PyObject *__pyx_n_s_COMM_WORLD; static PyObject *__pyx_n_s_COMPOSITE; static PyObject *__pyx_n_s_CONSTANTDIAGONAL; static PyObject *__pyx_n_s_CONTINUE_ITERATING; static PyObject *__pyx_n_s_CONVERGED_ATOL; static PyObject *__pyx_n_s_CONVERGED_ATOL_NORMAL; static PyObject *__pyx_n_s_CONVERGED_CG_CONSTRAINED; static PyObject *__pyx_n_s_CONVERGED_CG_NEG_CURVE; static PyObject *__pyx_n_s_CONVERGED_EVENT; static PyObject *__pyx_n_s_CONVERGED_FNORM_ABS; static PyObject *__pyx_n_s_CONVERGED_FNORM_RELATIVE; static PyObject *__pyx_n_s_CONVERGED_GATOL; static PyObject *__pyx_n_s_CONVERGED_GRTOL; static PyObject *__pyx_n_s_CONVERGED_GTTOL; static PyObject *__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN; static PyObject *__pyx_n_s_CONVERGED_ITERATING; static PyObject *__pyx_n_s_CONVERGED_ITS; static PyObject *__pyx_n_s_CONVERGED_MINF; static PyObject *__pyx_n_s_CONVERGED_RTOL; static PyObject *__pyx_n_s_CONVERGED_RTOL_NORMAL; static PyObject *__pyx_n_s_CONVERGED_SNORM_RELATIVE; static PyObject *__pyx_n_s_CONVERGED_STEPTOL; static PyObject *__pyx_n_s_CONVERGED_STEP_LENGTH; static PyObject *__pyx_n_s_CONVERGED_TIME; static PyObject *__pyx_n_s_CONVERGED_USER; static PyObject *__pyx_n_s_CP; static PyObject *__pyx_n_s_CR; static PyObject *__pyx_n_s_CRANK_NICOLSON; static PyObject *__pyx_n_s_CUDA; static PyObject *__pyx_n_s_CUSPARSE; static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is; static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor; static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi; static PyObject *__pyx_kp_s_Cannot_index_with_type_s; static PyObject *__pyx_n_s_Class; static PyObject *__pyx_n_s_Clone; static PyObject *__pyx_n_s_CollectType; static PyObject *__pyx_n_s_Comm; static PyObject *__pyx_n_s_ComplexType; static PyObject *__pyx_n_s_CompositeType; static PyObject *__pyx_n_s_ConvergedReason; static PyObject *__pyx_n_s_D; static PyObject *__pyx_n_s_DA; static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX1; static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX2; static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEX3; static PyObject *__pyx_n_s_DAE_IMPLICIT_INDEXHI; static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1; static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2; static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3; static PyObject *__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI; static PyObject *__pyx_n_s_DECIDE; static PyObject *__pyx_n_s_DEFAULT; static PyObject *__pyx_n_s_DEFLATION; static PyObject *__pyx_n_s_DENSE; static PyObject *__pyx_n_s_DETERMINE; static PyObject *__pyx_n_s_DGMRES; static PyObject *__pyx_n_s_DIAG; static PyObject *__pyx_n_s_DIFFERENT; static PyObject *__pyx_n_s_DIFFERENT_NONZERO_PATTERN; static PyObject *__pyx_n_s_DIFFERENT_NZ; static PyObject *__pyx_n_s_DISCGRAD; static PyObject *__pyx_n_s_DIVERGED_BREAKDOWN; static PyObject *__pyx_n_s_DIVERGED_BREAKDOWN_BICG; static PyObject *__pyx_n_s_DIVERGED_DTOL; static PyObject *__pyx_n_s_DIVERGED_FNORM_NAN; static PyObject *__pyx_n_s_DIVERGED_FUNCTION_COUNT; static PyObject *__pyx_n_s_DIVERGED_FUNCTION_DOMAIN; static PyObject *__pyx_n_s_DIVERGED_INDEFINITE_MAT; static PyObject *__pyx_n_s_DIVERGED_INDEFINITE_PC; static PyObject *__pyx_n_s_DIVERGED_INNER; static PyObject *__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN; static PyObject *__pyx_n_s_DIVERGED_LINEAR_SOLVE; static PyObject *__pyx_n_s_DIVERGED_LINE_SEARCH; static PyObject *__pyx_n_s_DIVERGED_LOCAL_MIN; static PyObject *__pyx_n_s_DIVERGED_LS_FAILURE; static PyObject *__pyx_n_s_DIVERGED_MAXFCN; static PyObject *__pyx_n_s_DIVERGED_MAXITS; static PyObject *__pyx_n_s_DIVERGED_MAX_IT; static PyObject *__pyx_n_s_DIVERGED_NAN; static PyObject *__pyx_n_s_DIVERGED_NANORINF; static PyObject *__pyx_n_s_DIVERGED_NONLINEAR_SOLVE; static PyObject *__pyx_n_s_DIVERGED_NONSYMMETRIC; static PyObject *__pyx_n_s_DIVERGED_NULL; static PyObject *__pyx_n_s_DIVERGED_PCSETUP_FAILED; static PyObject *__pyx_n_s_DIVERGED_STEP_REJECTED; static PyObject *__pyx_n_s_DIVERGED_TR_DELTA; static PyObject *__pyx_n_s_DIVERGED_TR_REDUCTION; static PyObject *__pyx_n_s_DIVERGED_USER; static PyObject *__pyx_n_s_DM; static PyObject *__pyx_n_s_DMBoundaryType; static PyObject *__pyx_n_s_DMComposite; static PyObject *__pyx_n_s_DMComposite_access; static PyObject *__pyx_n_s_DMDA; static PyObject *__pyx_n_s_DMDAElementType; static PyObject *__pyx_n_s_DMDAInterpolationType; static PyObject *__pyx_n_s_DMDAStencilType; static PyObject *__pyx_n_s_DMDA_Vec_array; static PyObject *__pyx_n_s_DMLabel; static PyObject *__pyx_n_s_DMPlex; static PyObject *__pyx_n_s_DMShell; static PyObject *__pyx_n_s_DMStag; static PyObject *__pyx_n_s_DMStagStencilLocation; static PyObject *__pyx_n_s_DMStagStencilType; static PyObject *__pyx_n_s_DMSwarm; static PyObject *__pyx_n_s_DMSwarmCollectType; static PyObject *__pyx_n_s_DMSwarmMigrateType; static PyObject *__pyx_n_s_DMSwarmPICLayoutType; static PyObject *__pyx_n_s_DMSwarmType; static PyObject *__pyx_n_s_DMType; static PyObject *__pyx_n_s_DOF; static PyObject *__pyx_n_s_DOWN; static PyObject *__pyx_n_s_DOWN_LEFT; static PyObject *__pyx_n_s_DOWN_RIGHT; static PyObject *__pyx_n_s_DRAW; static PyObject *__pyx_n_s_DRAW_BASIC; static PyObject *__pyx_n_s_DRAW_CONTOUR; static PyObject *__pyx_n_s_DRAW_LG; static PyObject *__pyx_n_s_DRAW_LG_XRANGE; static PyObject *__pyx_n_s_DRAW_PORTS; static PyObject *__pyx_n_s_DROP; static PyObject *__pyx_n_s_DS; static PyObject *__pyx_n_s_DSType; static PyObject *__pyx_n_s_DUMMY; static PyObject *__pyx_n_s_DrawSize; static PyObject *__pyx_n_s_Dup; static PyObject *__pyx_n_s_EIMEX; static PyObject *__pyx_n_s_EISENSTAT; static PyObject *__pyx_n_s_ELEMENT; static PyObject *__pyx_n_s_ELEMENTAL; static PyObject *__pyx_n_s_ERROR_LOWER_TRIANGULAR; static PyObject *__pyx_n_s_ESSL; static PyObject *__pyx_n_s_EULER; static PyObject *__pyx_n_s_EXODUSII; static PyObject *__pyx_n_s_EXOTIC; static PyObject *__pyx_n_s_EXPLICIT; static PyObject *__pyx_n_s_ElementType; static PyObject *__pyx_n_s_Ellipsis; static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr; static PyObject *__pyx_n_s_EquationType; static PyObject *__pyx_n_s_Error; static PyObject *__pyx_n_s_Error___init; static PyObject *__pyx_n_s_Error___nonzero; static PyObject *__pyx_n_s_Error___repr; static PyObject *__pyx_n_s_Error___str; static PyObject *__pyx_n_s_Event; static PyObject *__pyx_n_s_EventDecorator; static PyObject *__pyx_n_s_EventDecorator_locals_decorator; static PyObject *__pyx_n_s_EventDecorator_locals_decorator_2; static PyObject *__pyx_n_s_ExactFinalTime; static PyObject *__pyx_n_s_ExactFinalTimeOption; static PyObject *__pyx_kp_s_Expect_a_dltensor_field_pycapsul; static PyObject *__pyx_kp_s_Expect_a_dltensor_or_used_dltens; static PyObject *__pyx_n_s_FAILED; static PyObject *__pyx_n_s_FAS; static PyObject *__pyx_n_s_FBCGS; static PyObject *__pyx_n_s_FBCGSR; static PyObject *__pyx_n_s_FCG; static PyObject *__pyx_n_s_FE; static PyObject *__pyx_n_s_FETIDP; static PyObject *__pyx_n_s_FEType; static PyObject *__pyx_n_s_FFT; static PyObject *__pyx_n_s_FFTW; static PyObject *__pyx_n_s_FGMRES; static PyObject *__pyx_n_s_FIELDSPLIT; static PyObject *__pyx_n_s_FINAL; static PyObject *__pyx_n_s_FINAL_ASSEMBLY; static PyObject *__pyx_n_s_FINAL_ONLY; static PyObject *__pyx_n_s_FLUSH; static PyObject *__pyx_n_s_FLUSH_ASSEMBLY; static PyObject *__pyx_n_s_FORCE_DIAGONAL_ENTRIES; static PyObject *__pyx_n_s_FOREST; static PyObject *__pyx_n_s_FORWARD; static PyObject *__pyx_n_s_FORWARD_LOCAL; static PyObject *__pyx_n_s_FORWARD_SWEEP; static PyObject *__pyx_n_s_FRB; static PyObject *__pyx_n_s_FROBENIUS; static PyObject *__pyx_n_s_FRONT; static PyObject *__pyx_n_s_FRONT_DOWN; static PyObject *__pyx_n_s_FRONT_DOWN_LEFT; static PyObject *__pyx_n_s_FRONT_DOWN_RIGHT; static PyObject *__pyx_n_s_FRONT_LEFT; static PyObject *__pyx_n_s_FRONT_RIGHT; static PyObject *__pyx_n_s_FRONT_UP; static PyObject *__pyx_n_s_FRONT_UP_LEFT; static PyObject *__pyx_n_s_FRONT_UP_RIGHT; static PyObject *__pyx_n_s_FULL; static PyObject *__pyx_n_s_FULL_SIZE; static PyObject *__pyx_n_s_FactorShiftType; static PyObject *__pyx_n_s_FileMode; static PyObject *__pyx_n_s_Format; static PyObject *__pyx_n_s_Free; static PyObject *__pyx_n_s_G; static PyObject *__pyx_n_s_GALERKIN; static PyObject *__pyx_n_s_GAMG; static PyObject *__pyx_n_s_GAMGType; static PyObject *__pyx_n_s_GASM; static PyObject *__pyx_n_s_GASMType; static PyObject *__pyx_n_s_GATHER; static PyObject *__pyx_n_s_GATHERV; static PyObject *__pyx_n_s_GCR; static PyObject *__pyx_n_s_GENERAL; static PyObject *__pyx_n_s_GEO; static PyObject *__pyx_n_s_GETROW_UPPERTRIANGULAR; static PyObject *__pyx_n_s_GHOSTED; static PyObject *__pyx_kp_s_GIT_Date; static PyObject *__pyx_n_s_GLEE; static PyObject *__pyx_n_s_GLLE; static PyObject *__pyx_n_s_GLMapMode; static PyObject *__pyx_n_s_GLOBAL_MAX; static PyObject *__pyx_n_s_GLOBAL_SUM; static PyObject *__pyx_n_s_GLTR; static PyObject *__pyx_n_s_GLVIS; static PyObject *__pyx_n_s_GMRES; static PyObject *__pyx_n_s_GPCG; static PyObject *__pyx_n_s_GROPPCG; static PyObject *__pyx_n_s_Get_rank; static PyObject *__pyx_n_s_Get_size; static PyObject *__pyx_kp_s_Given_d_column_indices_but_d_non; static PyObject *__pyx_n_s_H; static PyObject *__pyx_n_s_HALF; static PyObject *__pyx_n_s_HALF_SIZE; static PyObject *__pyx_n_s_HARA; static PyObject *__pyx_n_s_HASH; static PyObject *__pyx_n_s_HDF5; static PyObject *__pyx_n_s_HDF5_MAT; static PyObject *__pyx_n_s_HDF5_PETSC; static PyObject *__pyx_n_s_HDF5_VIZ; static PyObject *__pyx_n_s_HDF5_XDMF; static PyObject *__pyx_n_s_HERMITIAN; static PyObject *__pyx_n_s_HMG; static PyObject *__pyx_n_s_HPDDM; static PyObject *__pyx_n_s_HYPRE; static PyObject *__pyx_n_s_HYPRESSTRUCT; static PyObject *__pyx_n_s_HYPRESTRUCT; static PyObject *__pyx_n_s_I; static PyObject *__pyx_n_s_IBCGS; static PyObject *__pyx_n_s_ICC; static PyObject *__pyx_n_s_IGNORE_LOWER_TRIANGULAR; static PyObject *__pyx_n_s_IGNORE_NEGATIVE_INDICES; static PyObject *__pyx_n_s_IGNORE_OFF_PROC_ENTRIES; static PyObject *__pyx_n_s_IGNORE_ZERO_ENTRIES; static PyObject *__pyx_n_s_ILU; static PyObject *__pyx_n_s_IMPLICIT; static PyObject *__pyx_n_s_INBLOCKS; static PyObject *__pyx_n_s_INF; static PyObject *__pyx_n_s_INFINITY; static PyObject *__pyx_n_s_INITIAL_FINAL_ONLY; static PyObject *__pyx_n_s_INITIAL_ONLY; static PyObject *__pyx_n_s_INSERT; static PyObject *__pyx_n_s_INSERT_ALL; static PyObject *__pyx_n_s_INSERT_ALL_VALUES; static PyObject *__pyx_n_s_INSERT_BC; static PyObject *__pyx_n_s_INSERT_BC_VALUES; static PyObject *__pyx_n_s_INSERT_VALUES; static PyObject *__pyx_n_s_INTERPOLATE; static PyObject *__pyx_n_s_IPM; static PyObject *__pyx_n_s_IS; static PyObject *__pyx_n_s_ISType; static PyObject *__pyx_n_s_IS_buffer; static PyObject *__pyx_n_s_ITERATING; static PyObject *__pyx_kp_s_I_0_is_d_expected_d; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte; static PyObject *__pyx_n_s_InfoType; static PyObject *__pyx_kp_s_Input_vector_has_no_tensor_infor; static PyObject *__pyx_kp_s_Input_vector_type_does_not_match; static PyObject *__pyx_n_s_InsertMode; static PyObject *__pyx_n_s_IntType; static PyObject *__pyx_n_s_InterpolationType; static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr; static PyObject *__pyx_kp_s_Invalid_mode_expected_r_w_or_rw; static PyObject *__pyx_kp_s_Invalid_mode_expected_rw_r_or_w; static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d; static PyObject *__pyx_n_s_J; static PyObject *__pyx_n_s_JACOBI; static PyObject *__pyx_n_s_KACZMARZ; static PyObject *__pyx_n_s_KAIJ; static PyObject *__pyx_n_s_KASKADE; static PyObject *__pyx_n_s_KEEP_NONZERO_PATTERN; static PyObject *__pyx_n_s_KLU; static PyObject *__pyx_n_s_KOKKOS; static PyObject *__pyx_n_s_KSP; static PyObject *__pyx_n_s_KSPConvergedReason; static PyObject *__pyx_n_s_KSPNormType; static PyObject *__pyx_n_s_KSPONLY; static PyObject *__pyx_n_s_KSPTRANSPOSEONLY; static PyObject *__pyx_n_s_KSPType; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_n_s_L; static PyObject *__pyx_n_s_LAYOUT_GAUSS; static PyObject *__pyx_n_s_LAYOUT_REGULAR; static PyObject *__pyx_n_s_LAYOUT_SUBDIVISION; static PyObject *__pyx_n_s_LCD; static PyObject *__pyx_n_s_LCL; static PyObject *__pyx_n_s_LEFT; static PyObject *__pyx_n_s_LGMRES; static PyObject *__pyx_n_s_LGMap; static PyObject *__pyx_n_s_LGMapType; static PyObject *__pyx_n_s_LINEAR; static PyObject *__pyx_n_s_LMVM; static PyObject *__pyx_n_s_LMVMBADBROYDEN; static PyObject *__pyx_n_s_LMVMBFGS; static PyObject *__pyx_n_s_LMVMBROYDEN; static PyObject *__pyx_n_s_LMVMDFP; static PyObject *__pyx_n_s_LMVMDIAGBBROYDEN; static PyObject *__pyx_n_s_LMVMSR1; static PyObject *__pyx_n_s_LMVMSYMBADBROYDEN; static PyObject *__pyx_n_s_LMVMSYMBROYDEN; static PyObject *__pyx_n_s_LOAD_BALANCE; static PyObject *__pyx_n_s_LOCAL; static PyObject *__pyx_n_s_LOCALREF; static PyObject *__pyx_n_s_LOCAL_BACKWARD_SWEEP; static PyObject *__pyx_n_s_LOCAL_FORWARD_SWEEP; static PyObject *__pyx_n_s_LOCAL_SYMMETRIC_SWEEP; static PyObject *__pyx_n_s_LOWER; static PyObject *__pyx_n_s_LRC; static PyObject *__pyx_n_s_LSC; static PyObject *__pyx_n_s_LSQR; static PyObject *__pyx_n_s_LU; static PyObject *__pyx_n_s_LUSOL; static PyObject *__pyx_n_s_Left; static PyObject *__pyx_n_s_Log; static PyObject *__pyx_n_s_LogClass; static PyObject *__pyx_n_s_LogEvent; static PyObject *__pyx_n_s_LogStage; static PyObject *__pyx_n_s_MAIJ; static PyObject *__pyx_n_s_MAPPING; static PyObject *__pyx_n_s_MASK; static PyObject *__pyx_n_s_MAT; static PyObject *__pyx_n_s_MATCHSTEP; static PyObject *__pyx_n_s_MATHEMATICA; static PyObject *__pyx_n_s_MATLAB; static PyObject *__pyx_n_s_MATPARTITIONING; static PyObject *__pyx_n_s_MAX; static PyObject *__pyx_n_s_MAX_VALUES; static PyObject *__pyx_n_s_MEMORYSCALABLE; static PyObject *__pyx_n_s_MFFD; static PyObject *__pyx_n_s_MG; static PyObject *__pyx_n_s_MGCycleType; static PyObject *__pyx_n_s_MGType; static PyObject *__pyx_n_s_MIGRATE_BASIC; static PyObject *__pyx_n_s_MIGRATE_DMCELLEXACT; static PyObject *__pyx_n_s_MIGRATE_DMCELLNSCATTER; static PyObject *__pyx_n_s_MIGRATE_USER; static PyObject *__pyx_n_s_MIMEX; static PyObject *__pyx_n_s_MINRES; static PyObject *__pyx_n_s_MIRROR; static PyObject *__pyx_n_s_MKL_CPARDISO; static PyObject *__pyx_n_s_MKL_PARDISO; static PyObject *__pyx_n_s_ML; static PyObject *__pyx_n_s_MOAB; static PyObject *__pyx_n_s_MPI; static PyObject *__pyx_n_s_MPIADJ; static PyObject *__pyx_n_s_MPIAIJ; static PyObject *__pyx_n_s_MPIAIJCRL; static PyObject *__pyx_n_s_MPIAIJCUSPARSE; static PyObject *__pyx_n_s_MPIAIJMKL; static PyObject *__pyx_n_s_MPIAIJPERM; static PyObject *__pyx_n_s_MPIAIJSELL; static PyObject *__pyx_n_s_MPIAIJVIENNACL; static PyObject *__pyx_n_s_MPIBAIJ; static PyObject *__pyx_n_s_MPIBAIJMKL; static PyObject *__pyx_n_s_MPICUDA; static PyObject *__pyx_n_s_MPIDENSE; static PyObject *__pyx_n_s_MPIKAIJ; static PyObject *__pyx_n_s_MPIKOKKOS; static PyObject *__pyx_n_s_MPIMAIJ; static PyObject *__pyx_n_s_MPISBAIJ; static PyObject *__pyx_n_s_MPISELL; static PyObject *__pyx_n_s_MPIVIENNACL; static PyObject *__pyx_n_s_MPRK; static PyObject *__pyx_n_s_MS; static PyObject *__pyx_n_s_MULTIPLICATIVE; static PyObject *__pyx_n_s_MUMPS; static PyObject *__pyx_n_s_MapMode; static PyObject *__pyx_n_s_Mat; static PyObject *__pyx_n_s_MatAssemblyType; static PyObject *__pyx_n_s_MatFactorShiftType; static PyObject *__pyx_n_s_MatInfoType; static PyObject *__pyx_n_s_MatOption; static PyObject *__pyx_n_s_MatOrderingType; static PyObject *__pyx_n_s_MatSORType; static PyObject *__pyx_n_s_MatSolverType; static PyObject *__pyx_n_s_MatStructure; static PyObject *__pyx_n_s_MatType; static PyObject *__pyx_n_s_Mat_Stencil; static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x; static PyObject *__pyx_kp_s_MemoryView_of_r_object; static PyObject *__pyx_n_s_MigrateType; static PyObject *__pyx_kp_s_Missing_input_parameters; static PyObject *__pyx_kp_s_Missing_tensor_information; static PyObject *__pyx_n_s_Mode; static PyObject *__pyx_kp_s_Must_provide_as_many_communicato; static PyObject *__pyx_kp_s_Must_provide_both_sizes_and_poin; static PyObject *__pyx_kp_s_Must_provide_operator_for_USER_o; static PyObject *__pyx_n_s_N1; static PyObject *__pyx_n_s_N12; static PyObject *__pyx_n_s_N2; static PyObject *__pyx_n_s_NASH; static PyObject *__pyx_n_s_NASM; static PyObject *__pyx_n_s_NATIVE; static PyObject *__pyx_n_s_NATURAL; static PyObject *__pyx_n_s_NCG; static PyObject *__pyx_n_s_ND; static PyObject *__pyx_n_s_NEIGHBOR; static PyObject *__pyx_n_s_NEST; static PyObject *__pyx_n_s_NETWORK; static PyObject *__pyx_n_s_NEWTONLS; static PyObject *__pyx_n_s_NEWTONTR; static PyObject *__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR; static PyObject *__pyx_n_s_NEW_NONZERO_LOCATIONS; static PyObject *__pyx_n_s_NEW_NONZERO_LOCATION_ERR; static PyObject *__pyx_n_s_NGMRES; static PyObject *__pyx_n_s_NGS; static PyObject *__pyx_n_s_NINFINITY; static PyObject *__pyx_n_s_NLS; static PyObject *__pyx_n_s_NM; static PyObject *__pyx_n_s_NN; static PyObject *__pyx_n_s_NO; static PyObject *__pyx_n_s_NOFORMAT; static PyObject *__pyx_n_s_NONE; static PyObject *__pyx_n_s_NONLINEAR; static PyObject *__pyx_n_s_NONZERO; static PyObject *__pyx_n_s_NORMAL; static PyObject *__pyx_n_s_NORMALHERMITIAN; static PyObject *__pyx_n_s_NORM_1; static PyObject *__pyx_n_s_NORM_1_AND_2; static PyObject *__pyx_n_s_NORM_2; static PyObject *__pyx_n_s_NORM_ALWAYS; static PyObject *__pyx_n_s_NORM_DEFAULT; static PyObject *__pyx_n_s_NORM_FINAL_ONLY; static PyObject *__pyx_n_s_NORM_FROBENIUS; static PyObject *__pyx_n_s_NORM_INFINITY; static PyObject *__pyx_n_s_NORM_INITIAL_FINAL_ONLY; static PyObject *__pyx_n_s_NORM_INITIAL_ONLY; static PyObject *__pyx_n_s_NORM_MAX; static PyObject *__pyx_n_s_NORM_NATURAL; static PyObject *__pyx_n_s_NORM_NONE; static PyObject *__pyx_n_s_NORM_PRECONDITIONED; static PyObject *__pyx_n_s_NORM_UNPRECONDITIONED; static PyObject *__pyx_n_s_NOT_SET_VALUES; static PyObject *__pyx_n_s_NO_OFF_PROC_ENTRIES; static PyObject *__pyx_n_s_NO_OFF_PROC_ZERO_ROWS; static PyObject *__pyx_n_s_NRICHARDSON; static PyObject *__pyx_n_s_NTL; static PyObject *__pyx_n_s_NTR; static PyObject *__pyx_n_s_NULLLOC; static PyObject *__pyx_n_s_NZ; static PyObject *__pyx_n_s_NormSchedule; static PyObject *__pyx_n_s_NormType; static PyObject *__pyx_n_s_NotImplemented; static PyObject *__pyx_n_s_NotImplementedError; static PyObject *__pyx_n_s_NullSpace; static PyObject *__pyx_n_b_O; static PyObject *__pyx_n_s_ODE_EXPLICIT; static PyObject *__pyx_n_s_ODE_IMPLICIT; static PyObject *__pyx_n_s_OPENCL; static PyObject *__pyx_n_s_OPTION_MAX; static PyObject *__pyx_n_s_OPTION_MIN; static PyObject *__pyx_n_s_OWD; static PyObject *__pyx_n_s_OWLQN; static PyObject *__pyx_n_s_Object; static PyObject *__pyx_kp_s_Object_is_not_writable; static PyObject *__pyx_n_s_Option; static PyObject *__pyx_n_s_Options; static PyObject *__pyx_n_s_OrderingType; static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a; static PyObject *__pyx_kp_s_Out_of_memory_Allocated_d_Used_b; static PyObject *__pyx_n_s_P; static PyObject *__pyx_n_s_P1; static PyObject *__pyx_n_s_P4EST; static PyObject *__pyx_n_s_P8EST; static PyObject *__pyx_n_s_PARDECOMP; static PyObject *__pyx_n_s_PARMETIS; static PyObject *__pyx_n_s_PARMS; static PyObject *__pyx_n_s_PASTIX; static PyObject *__pyx_n_s_PATCH; static PyObject *__pyx_n_s_PBJACOBI; static PyObject *__pyx_n_s_PC; static PyObject *__pyx_n_s_PCASMType; static PyObject *__pyx_n_s_PCCompositeType; static PyObject *__pyx_n_s_PCFieldSplitSchurFactType; static PyObject *__pyx_n_s_PCFieldSplitSchurPreType; static PyObject *__pyx_n_s_PCGAMGType; static PyObject *__pyx_n_s_PCGASMType; static PyObject *__pyx_n_s_PCMGCycleType; static PyObject *__pyx_n_s_PCMGType; static PyObject *__pyx_n_s_PCPatchConstructType; static PyObject *__pyx_n_s_PCSide; static PyObject *__pyx_n_s_PCType; static PyObject *__pyx_n_s_PD; static PyObject *__pyx_n_s_PDIPM; static PyObject *__pyx_n_s_PERIODIC; static PyObject *__pyx_n_s_PETSC; static PyObject *__pyx_kp_s_PETSc_Error_d; static PyObject *__pyx_kp_s_PETSc_Error_pyx; static PyObject *__pyx_kp_s_PETSc_Log_pyx; static PyObject *__pyx_kp_s_PETSc_PETSc_pyx; static PyObject *__pyx_n_s_PFMG; static PyObject *__pyx_n_s_PGMRES; static PyObject *__pyx_n_s_PIC; static PyObject *__pyx_n_s_PICLayoutType; static PyObject *__pyx_n_s_PINFINITY; static PyObject *__pyx_n_s_PIPEBCGS; static PyObject *__pyx_n_s_PIPECG; static PyObject *__pyx_n_s_PIPECG2; static PyObject *__pyx_n_s_PIPECGRR; static PyObject *__pyx_n_s_PIPECR; static PyObject *__pyx_n_s_PIPEFCG; static PyObject *__pyx_n_s_PIPEFGMRES; static PyObject *__pyx_n_s_PIPEGCR; static PyObject *__pyx_n_s_PIPELCG; static PyObject *__pyx_n_s_PIPEPRCG; static PyObject *__pyx_n_s_PLEX; static PyObject *__pyx_n_s_POSITIVE_DEFINITE; static PyObject *__pyx_n_s_POUNDERS; static PyObject *__pyx_n_s_PREALLOCATOR; static PyObject *__pyx_n_s_PRECONDITIONED; static PyObject *__pyx_n_s_PREONLY; static PyObject *__pyx_n_s_PRODUCT; static PyObject *__pyx_n_s_PSEUDO; static PyObject *__pyx_n_s_PTSCOTCH; static PyObject *__pyx_n_s_PYTHON; static PyObject *__pyx_n_s_Partitioner; static PyObject *__pyx_n_s_PartitionerType; static PyObject *__pyx_n_s_PatchConstructType; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_kp_u_Portable_Extensible_Toolkit_for; static PyObject *__pyx_n_s_Print; static PyObject *__pyx_n_s_ProblemType; static PyObject *__pyx_n_s_Q0; static PyObject *__pyx_n_s_Q1; static PyObject *__pyx_n_s_QCG; static PyObject *__pyx_n_s_QMD; static PyObject *__pyx_n_s_QN; static PyObject *__pyx_n_s_QUARTER; static PyObject *__pyx_n_s_QUARTER_SIZE; static PyObject *__pyx_n_s_Quad; static PyObject *__pyx_n_s_R; static PyObject *__pyx_n_s_RADAU5; static PyObject *__pyx_n_s_RAND; static PyObject *__pyx_n_s_RAND48; static PyObject *__pyx_n_s_RANDER48; static PyObject *__pyx_n_s_RANDOM123; static PyObject *__pyx_n_s_RCM; static PyObject *__pyx_n_s_READ; static PyObject *__pyx_n_s_REDISTRIBUTE; static PyObject *__pyx_n_s_REDUNDANT; static PyObject *__pyx_n_s_RESTRICT; static PyObject *__pyx_n_s_REVERSE; static PyObject *__pyx_n_s_REVERSE_LOCAL; static PyObject *__pyx_n_s_RICHARDSON; static PyObject *__pyx_n_s_RIGHT; static PyObject *__pyx_n_s_RK; static PyObject *__pyx_n_s_RK1FE; static PyObject *__pyx_n_s_RK2A; static PyObject *__pyx_n_s_RK3; static PyObject *__pyx_n_s_RK3BS; static PyObject *__pyx_n_s_RK4; static PyObject *__pyx_n_s_RK5BS; static PyObject *__pyx_n_s_RK5DP; static PyObject *__pyx_n_s_RK5F; static PyObject *__pyx_n_s_RK6VR; static PyObject *__pyx_n_s_RK7VR; static PyObject *__pyx_n_s_RK8VR; static PyObject *__pyx_n_s_RKType; static PyObject *__pyx_n_s_ROSW; static PyObject *__pyx_n_s_ROWLENGTH; static PyObject *__pyx_n_s_ROWSCALINGVIENNACL; static PyObject *__pyx_n_s_ROW_ORIENTED; static PyObject *__pyx_n_s_RUNGE_KUTTA; static PyObject *__pyx_n_s_Random; static PyObject *__pyx_n_s_RandomType; static PyObject *__pyx_n_s_RealType; static PyObject *__pyx_n_s_Reason; static PyObject *__pyx_n_s_Right; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_S; static PyObject *__pyx_n_s_SAME; static PyObject *__pyx_n_s_SAME_NONZERO_PATTERN; static PyObject *__pyx_n_s_SAME_NZ; static PyObject *__pyx_n_s_SAVIENNACL; static PyObject *__pyx_n_s_SAWS; static PyObject *__pyx_n_s_SBAIJ; static PyObject *__pyx_n_s_SCALAPACK; static PyObject *__pyx_n_s_SCATTER; static PyObject *__pyx_n_s_SCATTER_FORWARD; static PyObject *__pyx_n_s_SCATTER_FORWARD_LOCAL; static PyObject *__pyx_n_s_SCATTER_LOCAL; static PyObject *__pyx_n_s_SCATTER_REVERSE; static PyObject *__pyx_n_s_SCATTER_REVERSE_LOCAL; static PyObject *__pyx_n_s_SCHUR; static PyObject *__pyx_n_s_SCHURCOMPLEMENT; static PyObject *__pyx_n_s_SELF; static PyObject *__pyx_n_s_SELFP; static PyObject *__pyx_n_s_SELL; static PyObject *__pyx_n_s_SEQ; static PyObject *__pyx_n_s_SEQAIJ; static PyObject *__pyx_n_s_SEQAIJCRL; static PyObject *__pyx_n_s_SEQAIJCUSPARSE; static PyObject *__pyx_n_s_SEQAIJMKL; static PyObject *__pyx_n_s_SEQAIJPERM; static PyObject *__pyx_n_s_SEQAIJSELL; static PyObject *__pyx_n_s_SEQAIJVIENNACL; static PyObject *__pyx_n_s_SEQBAIJ; static PyObject *__pyx_n_s_SEQBAIJMKL; static PyObject *__pyx_n_s_SEQCUDA; static PyObject *__pyx_n_s_SEQCUFFT; static PyObject *__pyx_n_s_SEQDENSE; static PyObject *__pyx_n_s_SEQDENSECUDA; static PyObject *__pyx_n_s_SEQKAIJ; static PyObject *__pyx_n_s_SEQKOKKOS; static PyObject *__pyx_n_s_SEQMAIJ; static PyObject *__pyx_n_s_SEQSBAIJ; static PyObject *__pyx_n_s_SEQSELL; static PyObject *__pyx_n_s_SEQVIENNACL; static PyObject *__pyx_n_s_SF; static PyObject *__pyx_n_s_SFType; static PyObject *__pyx_n_s_SHARED; static PyObject *__pyx_n_s_SHELL; static PyObject *__pyx_n_s_SIMPLE; static PyObject *__pyx_n_s_SLICED; static PyObject *__pyx_n_s_SNES; static PyObject *__pyx_n_s_SNESConvergedReason; static PyObject *__pyx_n_s_SNESNormSchedule; static PyObject *__pyx_n_s_SNESType; static PyObject *__pyx_n_s_SOCKET; static PyObject *__pyx_n_s_SOR; static PyObject *__pyx_n_s_SORTED_FULL; static PyObject *__pyx_n_s_SORType; static PyObject *__pyx_n_s_SPAI; static PyObject *__pyx_n_s_SPARSEELEMENTAL; static PyObject *__pyx_n_s_SPD; static PyObject *__pyx_n_s_SPECIAL; static PyObject *__pyx_n_s_SPECTRAL; static PyObject *__pyx_n_s_SPRNG; static PyObject *__pyx_n_s_SSFLS; static PyObject *__pyx_n_s_SSILS; static PyObject *__pyx_n_s_SSP; static PyObject *__pyx_n_s_STAG; static PyObject *__pyx_n_s_STANDARD; static PyObject *__pyx_n_s_STAR; static PyObject *__pyx_n_s_STCG; static PyObject *__pyx_n_s_STDERR; static PyObject *__pyx_n_s_STDOUT; static PyObject *__pyx_n_s_STEPOVER; static PyObject *__pyx_n_s_STRIDE; static PyObject *__pyx_n_s_STRING; static PyObject *__pyx_n_s_STRUCTURALLY_SYMMETRIC; static PyObject *__pyx_n_s_STRUCTURE_ONLY; static PyObject *__pyx_n_s_STRUMPACK; static PyObject *__pyx_n_s_SUBMATRIX; static PyObject *__pyx_n_s_SUBMAT_SINGLEIS; static PyObject *__pyx_n_s_SUBSET; static PyObject *__pyx_n_s_SUBSET_NONZERO_PATTERN; static PyObject *__pyx_n_s_SUBSET_NZ; static PyObject *__pyx_n_s_SUBSET_OFF_PROC_ENTRIES; static PyObject *__pyx_n_s_SUNDIALS; static PyObject *__pyx_n_s_SUPERLU; static PyObject *__pyx_n_s_SUPERLU_DIST; static PyObject *__pyx_n_s_SVD; static PyObject *__pyx_n_s_SWARM; static PyObject *__pyx_n_s_SYMMETRIC; static PyObject *__pyx_n_s_SYMMETRIC_MULTIPLICATIVE; static PyObject *__pyx_n_s_SYMMETRY_ETERNAL; static PyObject *__pyx_n_s_SYMMETRY_SWEEP; static PyObject *__pyx_n_s_SYMMLQ; static PyObject *__pyx_n_s_SYSPFMG; static PyObject *__pyx_n_s_ScalarType; static PyObject *__pyx_n_s_Scatter; static PyObject *__pyx_n_s_ScatterMode; static PyObject *__pyx_n_s_ScatterType; static PyObject *__pyx_n_s_SchurFactType; static PyObject *__pyx_n_s_SchurPreType; static PyObject *__pyx_n_s_Section; static PyObject *__pyx_n_s_Side; static PyObject *__pyx_n_s_Size; static PyObject *__pyx_n_s_SolverType; static PyObject *__pyx_n_s_Stage; static PyObject *__pyx_n_s_Stencil; static PyObject *__pyx_n_s_StencilLocation; static PyObject *__pyx_n_s_StencilType; static PyObject *__pyx_n_s_Structure; static PyObject *__pyx_n_s_Sys; static PyObject *__pyx_n_s_SystemError; static PyObject *__pyx_n_s_T; static PyObject *__pyx_n_s_TAO; static PyObject *__pyx_n_s_TAOConvergedReason; static PyObject *__pyx_n_s_TAOType; static PyObject *__pyx_kp_s_TAO_Solver_Termination_Reasons; static PyObject *__pyx_kp_s_TAO_Solver_Types; static PyObject *__pyx_n_s_TCQMR; static PyObject *__pyx_n_s_TELESCOPE; static PyObject *__pyx_n_s_TFQMR; static PyObject *__pyx_n_s_TFS; static PyObject *__pyx_n_s_TH; static PyObject *__pyx_n_s_THETA; static PyObject *__pyx_n_s_THIRD; static PyObject *__pyx_n_s_THIRD_SIZE; static PyObject *__pyx_n_s_TRANSPOSEMAT; static PyObject *__pyx_n_s_TRON; static PyObject *__pyx_n_s_TS; static PyObject *__pyx_n_s_TSARKIMEXType; static PyObject *__pyx_n_s_TSConvergedReason; static PyObject *__pyx_n_s_TSEquationType; static PyObject *__pyx_n_s_TSExactFinalTime; static PyObject *__pyx_n_s_TSIRM; static PyObject *__pyx_n_s_TSProblemType; static PyObject *__pyx_n_s_TSRKType; static PyObject *__pyx_n_s_TSType; static PyObject *__pyx_n_s_TWIST; static PyObject *__pyx_kp_b_T_2; static PyObject *__pyx_kp_s_Tensor_dtype_does_not_match_PETS; static PyObject *__pyx_n_s_Type; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_U; static PyObject *__pyx_n_s_UA; static PyObject *__pyx_n_s_UMFPACK; static PyObject *__pyx_n_s_UNKNOWN; static PyObject *__pyx_n_s_UNKNOWN_NONZERO_PATTERN; static PyObject *__pyx_n_s_UNKNOWN_NZ; static PyObject *__pyx_n_s_UNPRECONDITIONED; static PyObject *__pyx_n_s_UNSPECIFIED; static PyObject *__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR; static PyObject *__pyx_n_s_UP; static PyObject *__pyx_n_s_UPDATE; static PyObject *__pyx_n_s_UPPER; static PyObject *__pyx_n_s_UP_LEFT; static PyObject *__pyx_n_s_UP_RIGHT; static PyObject *__pyx_n_s_USER; static PyObject *__pyx_n_s_USE_HASH_TABLE; static PyObject *__pyx_n_s_USE_INODES; static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object; static PyObject *__pyx_kp_s_Unsupported_PetscScalar_type; static PyObject *__pyx_n_s_V; static PyObject *__pyx_n_s_VANKA; static PyObject *__pyx_n_s_VIENNACL; static PyObject *__pyx_n_s_VINEWTONRSLS; static PyObject *__pyx_n_s_VINEWTONSSLS; static PyObject *__pyx_n_s_VPBJACOBI; static PyObject *__pyx_n_s_VTK; static PyObject *__pyx_n_s_VTK_VTR; static PyObject *__pyx_n_s_VTK_VTS; static PyObject *__pyx_n_s_VTK_VTU; static PyObject *__pyx_n_s_VU; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_Vec; static PyObject *__pyx_n_s_VecOption; static PyObject *__pyx_n_s_VecType; static PyObject *__pyx_n_s_Vec_LocalForm; static PyObject *__pyx_n_s_Vec_buffer; static PyObject *__pyx_kp_s_Vector_local_size_d_is_not_compa; static PyObject *__pyx_n_s_View_MemoryView; static PyObject *__pyx_n_s_Viewer; static PyObject *__pyx_n_s_ViewerFormat; static PyObject *__pyx_n_s_ViewerHDF5; static PyObject *__pyx_n_s_ViewerType; static PyObject *__pyx_n_s_W; static PyObject *__pyx_n_s_WBM; static PyObject *__pyx_n_s_WINDOW; static PyObject *__pyx_n_s_WRITE; static PyObject *__pyx_n_s_X; static PyObject *__pyx_n_s_ZERO_INITIAL_GUESS; static PyObject *__pyx_kp_s__13; static PyObject *__pyx_kp_s__14; static PyObject *__pyx_kp_u__14; static PyObject *__pyx_kp_s__2; static PyObject *__pyx_kp_s__20; static PyObject *__pyx_kp_b__4; static PyObject *__pyx_kp_s__4; static PyObject *__pyx_kp_b__7; static PyObject *__pyx_kp_s__7; static PyObject *__pyx_kp_b__72; static PyObject *__pyx_kp_b__73; static PyObject *__pyx_kp_b__74; static PyObject *__pyx_n_s_a; static PyObject *__pyx_kp_s_a_2; static PyObject *__pyx_n_s_abort; static PyObject *__pyx_kp_s_accessing_non_existent_buffer_se; static PyObject *__pyx_n_s_addFlops; static PyObject *__pyx_n_s_addv; static PyObject *__pyx_n_s_adjoint_steps; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_allocate_buffer; static PyObject *__pyx_n_s_alpha; static PyObject *__pyx_n_s_alpha2; static PyObject *__pyx_n_s_alpha_f; static PyObject *__pyx_n_s_alpha_m; static PyObject *__pyx_n_s_alphas; static PyObject *__pyx_n_s_amount; static PyObject *__pyx_n_s_app; static PyObject *__pyx_n_s_appctx; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_apply; static PyObject *__pyx_n_s_args; static PyObject *__pyx_n_s_array; static PyObject *__pyx_n_s_array_interface; static PyObject *__pyx_kp_s_array_size_d_and_vector_local_si; static PyObject *__pyx_kp_s_array_size_d_incompatible_with_v; static PyObject *__pyx_n_s_array_w; static PyObject *__pyx_n_s_asmtype; static PyObject *__pyx_n_s_assemblies; static PyObject *__pyx_n_s_assembly; static PyObject *__pyx_n_s_atol; static PyObject *__pyx_n_s_attr; static PyObject *__pyx_n_s_au; static PyObject *__pyx_n_s_author; static PyObject *__pyx_n_s_authorinfo; static PyObject *__pyx_n_s_axpy; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_back; static PyObject *__pyx_n_s_back_down; static PyObject *__pyx_n_s_back_down_left; static PyObject *__pyx_n_s_back_down_right; static PyObject *__pyx_n_s_back_left; static PyObject *__pyx_n_s_back_right; static PyObject *__pyx_n_s_back_up; static PyObject *__pyx_n_s_back_up_left; static PyObject *__pyx_n_s_back_up_right; static PyObject *__pyx_n_s_barrier; static PyObject *__pyx_n_s_base; static PyObject *__pyx_n_s_bcComps; static PyObject *__pyx_n_s_bcField; static PyObject *__pyx_n_s_bcPoints; static PyObject *__pyx_kp_s_bcPoints_is_a_required_argument; static PyObject *__pyx_n_s_begin; static PyObject *__pyx_n_s_begin_args; static PyObject *__pyx_n_s_begin_kargs; static PyObject *__pyx_n_s_beta; static PyObject *__pyx_n_s_bits; static PyObject *__pyx_n_s_block_size; static PyObject *__pyx_kp_s_block_size_d_must_be_positive; static PyObject *__pyx_kp_s_block_size_not_set; static PyObject *__pyx_n_s_blocksize; static PyObject *__pyx_n_s_bndr; static PyObject *__pyx_n_s_boundary; static PyObject *__pyx_n_s_boundary_type; static PyObject *__pyx_n_s_boundary_types; static PyObject *__pyx_n_s_box; static PyObject *__pyx_n_s_bs; static PyObject *__pyx_n_s_bsize; static PyObject *__pyx_n_s_buffer; static PyObject *__pyx_n_s_buffer_w; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_u_c; static PyObject *__pyx_kp_s_c_d; static PyObject *__pyx_kp_s_cannot_place_input_array_size_d; static PyObject *__pyx_n_s_catol; static PyObject *__pyx_n_s_cell; static PyObject *__pyx_n_s_cellNodeMaps; static PyObject *__pyx_kp_s_cell_indices_must_have_two_dimen; static PyObject *__pyx_n_s_cells; static PyObject *__pyx_n_s_cgid; static PyObject *__pyx_n_s_citation; static PyObject *__pyx_n_s_class; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_cmap; static PyObject *__pyx_n_s_coarsen; static PyObject *__pyx_n_s_coarsenhook; static PyObject *__pyx_n_s_code; static PyObject *__pyx_n_s_col; static PyObject *__pyx_n_s_col_bsize; static PyObject *__pyx_n_s_cols; static PyObject *__pyx_n_s_column; static PyObject *__pyx_kp_s_column_indices_must_have_two_dim; static PyObject *__pyx_n_s_comm; static PyObject *__pyx_n_s_comms; static PyObject *__pyx_kp_s_communicator_not_owned; static PyObject *__pyx_n_s_compressed; static PyObject *__pyx_n_s_cone; static PyObject *__pyx_n_s_coneOrientation; static PyObject *__pyx_n_s_conePoint; static PyObject *__pyx_n_s_conePos; static PyObject *__pyx_n_s_conforming; static PyObject *__pyx_n_s_constant; static PyObject *__pyx_n_s_constraints; static PyObject *__pyx_n_s_context; static PyObject *__pyx_kp_s_contiguous_and_direct; static PyObject *__pyx_kp_s_contiguous_and_indirect; static PyObject *__pyx_n_s_converged; static PyObject *__pyx_n_s_coordinates; static PyObject *__pyx_kp_s_coordinates_must_have_two_dimens; static PyObject *__pyx_n_s_coords; static PyObject *__pyx_kp_s_coords_vertices_must_have_two_di; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_count; static PyObject *__pyx_n_s_cpuarray; static PyObject *__pyx_n_s_crank; static PyObject *__pyx_n_s_cratio; static PyObject *__pyx_n_s_createDefaultSF; static PyObject *__pyx_n_s_createGlobalVec; static PyObject *__pyx_n_s_createGlobalVector; static PyObject *__pyx_n_s_createLabel; static PyObject *__pyx_n_s_createLocalVec; static PyObject *__pyx_n_s_createLocalVector; static PyObject *__pyx_n_s_createMat; static PyObject *__pyx_n_s_createMatrix; static PyObject *__pyx_n_s_createNaturalVec; static PyObject *__pyx_n_s_createNaturalVector; static PyObject *__pyx_n_s_createSectionSF; static PyObject *__pyx_n_s_createVecLeft; static PyObject *__pyx_n_s_createVecRight; static PyObject *__pyx_n_s_createVecs; static PyObject *__pyx_n_s_create_gvec; static PyObject *__pyx_n_s_create_injection; static PyObject *__pyx_n_s_create_interpolation; static PyObject *__pyx_n_s_create_lvec; static PyObject *__pyx_n_s_create_matrix; static PyObject *__pyx_n_s_create_restriction; static PyObject *__pyx_n_s_create_subdm; static PyObject *__pyx_n_s_crtol; static PyObject *__pyx_n_s_csize; static PyObject *__pyx_n_s_csr; static PyObject *__pyx_n_s_ctype; static PyObject *__pyx_n_s_cudahandle; static PyObject *__pyx_n_s_cycle_type; static PyObject *__pyx_kp_s_d_s; static PyObject *__pyx_n_s_da; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_date; static PyObject *__pyx_n_s_debugger; static PyObject *__pyx_n_s_decode; static PyObject *__pyx_n_s_decomp; static PyObject *__pyx_n_s_decorator; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_delValue; static PyObject *__pyx_n_s_design; static PyObject *__pyx_n_s_destroy; static PyObject *__pyx_n_s_devel; static PyObject *__pyx_n_s_diag; static PyObject *__pyx_n_s_diagonalScale; static PyObject *__pyx_n_s_diagonal_fill; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dim; static PyObject *__pyx_n_s_dims; static PyObject *__pyx_n_s_direction; static PyObject *__pyx_n_s_disc; static PyObject *__pyx_n_s_display; static PyObject *__pyx_n_s_div; static PyObject *__pyx_n_s_divtol; static PyObject *__pyx_n_s_dlpack; static PyObject *__pyx_n_s_dltensor; static PyObject *__pyx_n_s_dm; static PyObject *__pyx_n_s_dmTo; static PyObject *__pyx_n_s_dm_type; static PyObject *__pyx_n_s_dms; static PyObject *__pyx_n_s_dmswarm_type; static PyObject *__pyx_n_s_dmtype; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_dof; static PyObject *__pyx_n_s_dofs; static PyObject *__pyx_n_s_down; static PyObject *__pyx_n_s_down_left; static PyObject *__pyx_n_s_down_right; static PyObject *__pyx_n_s_drop; static PyObject *__pyx_n_s_ds_type; static PyObject *__pyx_n_s_dt; static PyObject *__pyx_n_s_dtcol; static PyObject *__pyx_n_s_dtcount; static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtype_is_object; static PyObject *__pyx_n_s_duplicate; static PyObject *__pyx_n_s_e; static PyObject *__pyx_n_s_edges; static PyObject *__pyx_n_s_elem_type; static PyObject *__pyx_n_s_element; static PyObject *__pyx_n_s_emacs; static PyObject *__pyx_kp_s_empty_citation; static PyObject *__pyx_kp_s_empty_name; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_end; static PyObject *__pyx_n_s_end_args; static PyObject *__pyx_n_s_end_kargs; static PyObject *__pyx_n_s_enter; static PyObject *__pyx_n_s_entityDepth; static PyObject *__pyx_n_s_entry; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_epsilon; static PyObject *__pyx_n_s_eqtype; static PyObject *__pyx_n_s_errhandler; static PyObject *__pyx_n_s_error; static PyObject *__pyx_kp_s_error_code_d; static PyObject *__pyx_n_s_eventhandler; static PyObject *__pyx_n_s_exit; static PyObject *__pyx_n_s_exoid; static PyObject *__pyx_kp_s_expecting_a_C_contiguous_array; static PyObject *__pyx_kp_s_expecting_tuple_list_or_dict; static PyObject *__pyx_n_s_f; static PyObject *__pyx_n_s_faces; static PyObject *__pyx_n_s_factor_mallocs; static PyObject *__pyx_n_s_fe_type; static PyObject *__pyx_n_s_field; static PyObject *__pyx_n_s_fieldName; static PyObject *__pyx_n_s_fieldname; static PyObject *__pyx_n_s_fieldnames; static PyObject *__pyx_n_s_filename; static PyObject *__pyx_n_s_fill; static PyObject *__pyx_n_s_fill_param; static PyObject *__pyx_n_s_fill_ratio_given; static PyObject *__pyx_n_s_fill_ratio_needed; static PyObject *__pyx_n_s_finalize; static PyObject *__pyx_n_s_first; static PyObject *__pyx_n_s_fix; static PyObject *__pyx_n_s_flag; static PyObject *__pyx_n_s_flags; static PyObject *__pyx_n_s_flg; static PyObject *__pyx_n_s_flops; static PyObject *__pyx_n_s_flush; static PyObject *__pyx_n_s_fnorm; static PyObject *__pyx_n_s_force; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_fortran; static PyObject *__pyx_n_u_fortran; static PyObject *__pyx_n_s_forward; static PyObject *__pyx_n_s_front; static PyObject *__pyx_n_s_front_down; static PyObject *__pyx_n_s_front_down_left; static PyObject *__pyx_n_s_front_down_right; static PyObject *__pyx_n_s_front_left; static PyObject *__pyx_n_s_front_right; static PyObject *__pyx_n_s_front_up; static PyObject *__pyx_n_s_front_up_left; static PyObject *__pyx_n_s_front_up_right; static PyObject *__pyx_n_s_func; static PyObject *__pyx_n_s_function; static PyObject *__pyx_n_s_functools; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_gamgtype; static PyObject *__pyx_n_s_gamma; static PyObject *__pyx_n_s_gasmtype; static PyObject *__pyx_n_s_gatol; static PyObject *__pyx_n_s_get; static PyObject *__pyx_kp_s_get1dCoordinatecArrays_for_DMSta; static PyObject *__pyx_n_s_getActive; static PyObject *__pyx_n_s_getActiveAll; static PyObject *__pyx_n_s_getAppCtx; static PyObject *__pyx_n_s_getArray; static PyObject *__pyx_n_s_getBlockIndices; static PyObject *__pyx_n_s_getBlockInfo; static PyObject *__pyx_n_s_getBlockSize; static PyObject *__pyx_n_s_getBlockSizes; static PyObject *__pyx_n_s_getBoundaryType; static PyObject *__pyx_n_s_getBoundaryTypes; static PyObject *__pyx_n_s_getBuffer; static PyObject *__pyx_n_s_getCPUTime; static PyObject *__pyx_n_s_getClassId; static PyObject *__pyx_n_s_getClassName; static PyObject *__pyx_n_s_getComm; static PyObject *__pyx_n_s_getConstraintTolerances; static PyObject *__pyx_n_s_getConvergedReason; static PyObject *__pyx_n_s_getConvergenceHistory; static PyObject *__pyx_n_s_getCorners; static PyObject *__pyx_n_s_getDM; static PyObject *__pyx_n_s_getDS; static PyObject *__pyx_n_s_getDefaultComm; static PyObject *__pyx_n_s_getDefaultGlobalSection; static PyObject *__pyx_n_s_getDefaultSF; static PyObject *__pyx_n_s_getDefaultSection; static PyObject *__pyx_n_s_getDim; static PyObject *__pyx_n_s_getDimension; static PyObject *__pyx_n_s_getDof; static PyObject *__pyx_n_s_getEntriesPerElement; static PyObject *__pyx_n_s_getEquationType; static PyObject *__pyx_n_s_getFlops; static PyObject *__pyx_n_s_getFunctionNorm; static PyObject *__pyx_n_s_getFunctionTolerances; static PyObject *__pyx_n_s_getFunctionValue; static PyObject *__pyx_n_s_getGhostCorners; static PyObject *__pyx_n_s_getGhostRanges; static PyObject *__pyx_n_s_getGlobalSection; static PyObject *__pyx_n_s_getGlobalSizes; static PyObject *__pyx_n_s_getGradient; static PyObject *__pyx_n_s_getGradientTolerances; static PyObject *__pyx_n_s_getIndices; static PyObject *__pyx_n_s_getInfo; static PyObject *__pyx_n_s_getInitialGuessKnoll; static PyObject *__pyx_n_s_getInitialGuessNonzero; static PyObject *__pyx_n_s_getInterval; static PyObject *__pyx_n_s_getIterationNumber; static PyObject *__pyx_n_s_getKSP; static PyObject *__pyx_n_s_getKSPFailures; static PyObject *__pyx_n_s_getLinearSolveFailures; static PyObject *__pyx_n_s_getLocalSize; static PyObject *__pyx_n_s_getLocalSizes; static PyObject *__pyx_n_s_getMatrix; static PyObject *__pyx_n_s_getMaxFunctionEvaluations; static PyObject *__pyx_n_s_getMaxKSPFailures; static PyObject *__pyx_n_s_getMaxLinearSolveFailures; static PyObject *__pyx_n_s_getMaxNonlinearStepFailures; static PyObject *__pyx_n_s_getMaxStepFailures; static PyObject *__pyx_n_s_getMaxSteps; static PyObject *__pyx_n_s_getMaxTime; static PyObject *__pyx_n_s_getNPC; static PyObject *__pyx_n_s_getName; static PyObject *__pyx_n_s_getNonlinearStepFailures; static PyObject *__pyx_n_s_getNormType; static PyObject *__pyx_n_s_getNumber; static PyObject *__pyx_n_s_getNumberDM; static PyObject *__pyx_n_s_getObjectiveValue; static PyObject *__pyx_n_s_getOperators; static PyObject *__pyx_n_s_getOptionsPrefix; static PyObject *__pyx_n_s_getOwnershipRange; static PyObject *__pyx_n_s_getOwnershipRanges; static PyObject *__pyx_n_s_getPC; static PyObject *__pyx_n_s_getPCSide; static PyObject *__pyx_n_s_getProblemType; static PyObject *__pyx_n_s_getProcSizes; static PyObject *__pyx_n_s_getRanges; static PyObject *__pyx_n_s_getRank; static PyObject *__pyx_n_s_getRefCount; static PyObject *__pyx_n_s_getResidualNorm; static PyObject *__pyx_n_s_getRhs; static PyObject *__pyx_n_s_getSNES; static PyObject *__pyx_n_s_getSection; static PyObject *__pyx_n_s_getSectionSF; static PyObject *__pyx_n_s_getSeed; static PyObject *__pyx_n_s_getSize; static PyObject *__pyx_n_s_getSizes; static PyObject *__pyx_n_s_getSolution; static PyObject *__pyx_n_s_getSolutionNorm; static PyObject *__pyx_n_s_getSolutionUpdate; static PyObject *__pyx_n_s_getStencil; static PyObject *__pyx_n_s_getStencilType; static PyObject *__pyx_n_s_getStencilWidth; static PyObject *__pyx_n_s_getStepFailures; static PyObject *__pyx_n_s_getStepNumber; static PyObject *__pyx_n_s_getString; static PyObject *__pyx_n_s_getTime; static PyObject *__pyx_n_s_getTimeStep; static PyObject *__pyx_n_s_getTolerances; static PyObject *__pyx_n_s_getType; static PyObject *__pyx_n_s_getUseEW; static PyObject *__pyx_n_s_getUseFD; static PyObject *__pyx_n_s_getUseMF; static PyObject *__pyx_n_s_getValue; static PyObject *__pyx_kp_s_getValuesStagStencil_not_yet_imp; static PyObject *__pyx_kp_s_getVecArray_for_DMStag_not_yet_i; static PyObject *__pyx_n_s_getVecLeft; static PyObject *__pyx_n_s_getVecRight; static PyObject *__pyx_n_s_getVecs; static PyObject *__pyx_n_s_getVersion; static PyObject *__pyx_n_s_getVersionInfo; static PyObject *__pyx_n_s_getVisible; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_ghostBcNodes; static PyObject *__pyx_n_s_ghosted; static PyObject *__pyx_n_s_ghosts; static PyObject *__pyx_kp_s_ghosts_size_d_array_size_d_and_v; static PyObject *__pyx_n_s_globalBcNodes; static PyObject *__pyx_kp_s_global_size_d_not_divisible_by_b; static PyObject *__pyx_n_s_globalsec; static PyObject *__pyx_n_s_gord; static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi; static PyObject *__pyx_n_s_gradient; static PyObject *__pyx_n_s_group; static PyObject *__pyx_n_s_grtol; static PyObject *__pyx_n_s_gsec; static PyObject *__pyx_n_s_gtol; static PyObject *__pyx_n_s_gttol; static PyObject *__pyx_n_s_gv; static PyObject *__pyx_n_s_gvec; static PyObject *__pyx_n_s_handle; static PyObject *__pyx_n_s_hasExternalPackage; static PyObject *__pyx_n_s_hasLabel; static PyObject *__pyx_n_s_hasLagrange; static PyObject *__pyx_n_s_hasName; static PyObject *__pyx_n_s_hessian; static PyObject *__pyx_n_s_hypretype; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_icntl; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_idx; static PyObject *__pyx_n_s_idxm; static PyObject *__pyx_n_s_ierr; static PyObject *__pyx_n_s_ignore; static PyObject *__pyx_n_s_imag; static PyObject *__pyx_n_s_imex; static PyObject *__pyx_n_s_imode; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_inblocks; static PyObject *__pyx_kp_s_incompatible_array_sizes; static PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nj; static PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nv; static PyObject *__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2; static PyObject *__pyx_kp_s_incompatible_array_sizes_nv_d; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_indices; static PyObject *__pyx_n_s_info; static PyObject *__pyx_n_s_infoAllow; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_initialguess; static PyObject *__pyx_n_s_initialize; static PyObject *__pyx_kp_s_input_arrays_have_incompatible_s; static PyObject *__pyx_n_s_insert; static PyObject *__pyx_n_s_int; static PyObject *__pyx_n_s_interior; static PyObject *__pyx_n_s_interp_type; static PyObject *__pyx_n_s_interpolate; static PyObject *__pyx_n_s_interval; static PyObject *__pyx_n_s_invert; static PyObject *__pyx_n_s_is; static PyObject *__pyx_n_s_isAssembled; static PyObject *__pyx_n_s_isFinalized; static PyObject *__pyx_n_s_isHermitian; static PyObject *__pyx_n_s_isIdentity; static PyObject *__pyx_n_s_isInitialized; static PyObject *__pyx_n_s_isPermutation; static PyObject *__pyx_n_s_isSimplex; static PyObject *__pyx_n_s_isSorted; static PyObject *__pyx_n_s_isStructurallySymmetric; static PyObject *__pyx_n_s_isSymmetric; static PyObject *__pyx_n_s_is_from; static PyObject *__pyx_n_s_is_local; static PyObject *__pyx_n_s_is_to; static PyObject *__pyx_n_s_is_type; static PyObject *__pyx_n_s_iscol; static PyObject *__pyx_n_s_iscols; static PyObject *__pyx_n_s_iset; static PyObject *__pyx_n_s_isets; static PyObject *__pyx_n_s_isfields; static PyObject *__pyx_n_s_isperm; static PyObject *__pyx_n_s_isrow; static PyObject *__pyx_n_s_isrows; static PyObject *__pyx_n_s_itemsize; static PyObject *__pyx_kp_s_itemsize_0_for_cython_array; static PyObject *__pyx_n_s_its; static PyObject *__pyx_n_s_ival; static PyObject *__pyx_n_s_j; static PyObject *__pyx_n_s_jacobian; static PyObject *__pyx_n_s_jacobian_design; static PyObject *__pyx_n_s_jacobian_state; static PyObject *__pyx_n_s_jacobianp; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_kargs; static PyObject *__pyx_kp_s_key_d_cannot_register_s_already; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_kind; static PyObject *__pyx_n_s_klass; static PyObject *__pyx_n_s_ksp; static PyObject *__pyx_n_s_ksp_type; static PyObject *__pyx_n_s_kwargs; static PyObject *__pyx_n_s_l; static PyObject *__pyx_n_s_l2l; static PyObject *__pyx_n_s_label; static PyObject *__pyx_n_s_labelName; static PyObject *__pyx_n_s_lanes; static PyObject *__pyx_n_s_layoutType; static PyObject *__pyx_n_s_leafdata; static PyObject *__pyx_n_s_leafupdate; static PyObject *__pyx_n_s_left; static PyObject *__pyx_n_s_length; static PyObject *__pyx_n_s_level; static PyObject *__pyx_n_s_levels; static PyObject *__pyx_n_s_lgmap; static PyObject *__pyx_n_s_lgmap_type; static PyObject *__pyx_n_s_linear_its; static PyObject *__pyx_n_s_lits; static PyObject *__pyx_n_s_loc; static PyObject *__pyx_n_s_local; static PyObject *__pyx_kp_s_local_and_global_sizes_cannot_be; static PyObject *__pyx_kp_s_local_size_d_not_divisible_by_bl; static PyObject *__pyx_n_s_localsec; static PyObject *__pyx_n_s_locs; static PyObject *__pyx_n_s_logFlops; static PyObject *__pyx_n_s_lower; static PyObject *__pyx_n_s_ltog; static PyObject *__pyx_n_s_ltol; static PyObject *__pyx_n_s_lv; static PyObject *__pyx_n_s_lvecs; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_major; static PyObject *__pyx_n_s_mallocs; static PyObject *__pyx_n_s_mat; static PyObject *__pyx_n_s_matMult; static PyObject *__pyx_n_s_mat_type; static PyObject *__pyx_n_s_mats; static PyObject *__pyx_n_s_max; static PyObject *__pyx_n_s_max_fails; static PyObject *__pyx_n_s_max_funcs; static PyObject *__pyx_n_s_max_it; static PyObject *__pyx_n_s_max_steps; static PyObject *__pyx_n_s_max_time; static PyObject *__pyx_n_s_memo; static PyObject *__pyx_n_s_memory; static PyObject *__pyx_n_s_memview; static PyObject *__pyx_n_s_messageLength; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_metric; static PyObject *__pyx_n_s_mgtype; static PyObject *__pyx_n_s_min; static PyObject *__pyx_n_s_minor; static PyObject *__pyx_n_s_mirror; static PyObject *__pyx_n_s_mode; static PyObject *__pyx_n_s_model; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_monitor; static PyObject *__pyx_n_s_mpi4py; static PyObject *__pyx_kp_s_mpi4py_MPI; static PyObject *__pyx_n_s_mpiabort; static PyObject *__pyx_n_s_msg; static PyObject *__pyx_n_s_mult; static PyObject *__pyx_n_s_multirootdata; static PyObject *__pyx_n_s_n; static PyObject *__pyx_n_s_na; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_n_s_name_3; static PyObject *__pyx_n_s_nc; static PyObject *__pyx_n_s_ndim; static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_newsec; static PyObject *__pyx_n_s_newvec; static PyObject *__pyx_n_s_ngs; static PyObject *__pyx_n_s_nlevels; static PyObject *__pyx_n_s_nlocal; static PyObject *__pyx_n_s_nmax; static PyObject *__pyx_n_s_nmin; static PyObject *__pyx_n_s_nnz; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_none; static PyObject *__pyx_n_s_nonzero; static PyObject *__pyx_n_s_nonzero_2; static PyObject *__pyx_n_s_norm; static PyObject *__pyx_n_s_norm_type; static PyObject *__pyx_n_s_normsched; static PyObject *__pyx_n_s_normtype; static PyObject *__pyx_n_s_npoints; static PyObject *__pyx_n_s_nroots; static PyObject *__pyx_n_s_nsd; static PyObject *__pyx_n_s_nsp; static PyObject *__pyx_n_s_nsubcomm; static PyObject *__pyx_n_s_null; static PyObject *__pyx_kp_s_null_communicator; static PyObject *__pyx_n_s_numComp; static PyObject *__pyx_n_s_numDof; static PyObject *__pyx_n_s_numFields; static PyObject *__pyx_n_s_numMessages; static PyObject *__pyx_n_s_numProcs; static PyObject *__pyx_n_s_numReductions; static PyObject *__pyx_kp_s_number_of_dimensions_d_and_numbe; static PyObject *__pyx_n_s_nz_allocated; static PyObject *__pyx_n_s_nz_unneeded; static PyObject *__pyx_n_s_nz_used; static PyObject *__pyx_n_s_nzdiag; static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_object; static PyObject *__pyx_n_s_objective; static PyObject *__pyx_n_s_objgrad; static PyObject *__pyx_n_s_offset; static PyObject *__pyx_n_s_omega; static PyObject *__pyx_kp_s_only_and; static PyObject *__pyx_n_s_onnz; static PyObject *__pyx_n_s_op; static PyObject *__pyx_n_s_operator; static PyObject *__pyx_n_s_operators; static PyObject *__pyx_n_s_option; static PyObject *__pyx_kp_s_option_prefix_must_be_string; static PyObject *__pyx_kp_s_option_prefix_should_not_have_sp; static PyObject *__pyx_kp_s_option_prefix_should_not_start_w; static PyObject *__pyx_n_s_options; static PyObject *__pyx_n_s_opts; static PyObject *__pyx_n_s_ord_type; static PyObject *__pyx_n_s_order; static PyObject *__pyx_n_s_orientation; static PyObject *__pyx_n_s_otype; static PyObject *__pyx_n_s_out; static PyObject *__pyx_n_s_output; static PyObject *__pyx_n_s_overlap; static PyObject *__pyx_kp_s_ownership_range_size_d_and_numbe; static PyObject *__pyx_n_s_ownership_ranges; static PyObject *__pyx_n_s_ozz; static PyObject *__pyx_n_s_p; static PyObject *__pyx_n_s_p1; static PyObject *__pyx_n_s_pEnd; static PyObject *__pyx_n_s_pStart; static PyObject *__pyx_n_s_pack; static PyObject *__pyx_n_s_package; static PyObject *__pyx_n_s_parallel; static PyObject *__pyx_n_s_parent; static PyObject *__pyx_n_s_part; static PyObject *__pyx_n_s_part_type; static PyObject *__pyx_n_s_pc; static PyObject *__pyx_n_s_pc_type; static PyObject *__pyx_n_s_pd; static PyObject *__pyx_n_s_periodic; static PyObject *__pyx_n_s_perm; static PyObject *__pyx_n_s_petsc; static PyObject *__pyx_n_s_petsc4py_PETSc; static PyObject *__pyx_n_s_pi; static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pj; static PyObject *__pyx_n_s_point; static PyObject *__pyx_n_s_points; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_popErrorHandler; static PyObject *__pyx_n_s_popSignalHandler; static PyObject *__pyx_n_s_position; static PyObject *__pyx_n_s_positive_definite; static PyObject *__pyx_n_s_postevent; static PyObject *__pyx_n_s_poststep; static PyObject *__pyx_n_s_pre; static PyObject *__pyx_n_s_precheck; static PyObject *__pyx_n_s_prefix; static PyObject *__pyx_kp_s_prefix_s_name_s; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_prestep; static PyObject *__pyx_n_s_primv; static PyObject *__pyx_n_s_proc_sizes; static PyObject *__pyx_n_s_ptype; static PyObject *__pyx_n_s_push; static PyObject *__pyx_n_s_pushErrorHandler; static PyObject *__pyx_n_s_py_type; static PyObject *__pyx_n_s_python; static PyObject *__pyx_n_s_pyx_PickleError; static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_getbuffer; static PyObject *__pyx_n_s_pyx_result; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle_Enum; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_q0; static PyObject *__pyx_n_s_q1; static PyObject *__pyx_n_s_qorder; static PyObject *__pyx_n_s_quad; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_r; static PyObject *__pyx_kp_s_r_2; static PyObject *__pyx_n_s_radius; static PyObject *__pyx_n_s_random; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_ranges; static PyObject *__pyx_n_s_rank; static PyObject *__pyx_n_s_readonly; static PyObject *__pyx_kp_s_readonly_attribute; static PyObject *__pyx_n_s_ready; static PyObject *__pyx_n_s_real; static PyObject *__pyx_n_s_reason; static PyObject *__pyx_n_s_reciprocal; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_redundant; static PyObject *__pyx_n_s_refine; static PyObject *__pyx_n_s_refine_x; static PyObject *__pyx_n_s_refine_y; static PyObject *__pyx_n_s_refine_z; static PyObject *__pyx_n_s_refinementLimit; static PyObject *__pyx_n_s_refinementUniform; static PyObject *__pyx_n_s_registerCitation; static PyObject *__pyx_n_s_release; static PyObject *__pyx_n_s_remote; static PyObject *__pyx_n_s_remove; static PyObject *__pyx_n_s_remove_sent_points; static PyObject *__pyx_n_s_replace; static PyObject *__pyx_n_s_repr; static PyObject *__pyx_n_s_reset; static PyObject *__pyx_n_s_reshape; static PyObject *__pyx_n_s_residual; static PyObject *__pyx_n_s_restart; static PyObject *__pyx_n_s_restricthook; static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_reuse; static PyObject *__pyx_n_s_reverse; static PyObject *__pyx_n_s_rhs; static PyObject *__pyx_n_s_rhsjacobianp; static PyObject *__pyx_n_s_right; static PyObject *__pyx_n_s_rmap; static PyObject *__pyx_n_s_rnd_type; static PyObject *__pyx_n_s_rnorm; static PyObject *__pyx_n_s_rootdata; static PyObject *__pyx_n_s_row; static PyObject *__pyx_n_s_row_bsize; static PyObject *__pyx_kp_s_row_indices_must_have_two_dimens; static PyObject *__pyx_n_s_rowmap; static PyObject *__pyx_n_s_rows; static PyObject *__pyx_n_s_rscale; static PyObject *__pyx_n_s_rtol; static PyObject *__pyx_n_s_rtol_0; static PyObject *__pyx_n_s_rtol_max; static PyObject *__pyx_n_s_rw; static PyObject *__pyx_kp_s_s; static PyObject *__pyx_kp_u_s_2; static PyObject *__pyx_kp_s_s_line_d_in_s; static PyObject *__pyx_kp_s_s_s; static PyObject *__pyx_n_s_scale; static PyObject *__pyx_n_s_scatter; static PyObject *__pyx_n_s_scatter_type; static PyObject *__pyx_n_s_sec; static PyObject *__pyx_n_s_seconds; static PyObject *__pyx_n_s_seed; static PyObject *__pyx_n_s_selected; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_sep; static PyObject *__pyx_n_s_setActive; static PyObject *__pyx_n_s_setActiveAll; static PyObject *__pyx_n_s_setAppCtx; static PyObject *__pyx_n_s_setConvergedReason; static PyObject *__pyx_n_s_setDM; static PyObject *__pyx_n_s_setDS; static PyObject *__pyx_n_s_setDefaultComm; static PyObject *__pyx_n_s_setDefaultGlobalSection; static PyObject *__pyx_n_s_setDefaultSF; static PyObject *__pyx_n_s_setDefaultSection; static PyObject *__pyx_n_s_setDiagonal; static PyObject *__pyx_n_s_setDimension; static PyObject *__pyx_n_s_setEquationType; static PyObject *__pyx_n_s_setFunctionNorm; static PyObject *__pyx_n_s_setFunctionTolerances; static PyObject *__pyx_n_s_setGlobalSection; static PyObject *__pyx_n_s_setInitialGuessKnoll; static PyObject *__pyx_n_s_setInitialGuessNonzero; static PyObject *__pyx_n_s_setInterval; static PyObject *__pyx_n_s_setIterationNumber; static PyObject *__pyx_n_s_setKSP; static PyObject *__pyx_n_s_setMaxFunctionEvaluations; static PyObject *__pyx_n_s_setMaxKSPFailures; static PyObject *__pyx_n_s_setMaxLinearSolveFailures; static PyObject *__pyx_n_s_setMaxNonlinearStepFailures; static PyObject *__pyx_n_s_setMaxStepFailures; static PyObject *__pyx_n_s_setMaxSteps; static PyObject *__pyx_n_s_setMaxTime; static PyObject *__pyx_n_s_setNPC; static PyObject *__pyx_n_s_setName; static PyObject *__pyx_n_s_setNormType; static PyObject *__pyx_n_s_setOptionsPrefix; static PyObject *__pyx_n_s_setPCSide; static PyObject *__pyx_n_s_setParamsEW; static PyObject *__pyx_n_s_setProblemType; static PyObject *__pyx_n_s_setResidualNorm; static PyObject *__pyx_n_s_setSection; static PyObject *__pyx_n_s_setSectionSF; static PyObject *__pyx_n_s_setSeed; static PyObject *__pyx_n_s_setSizes; static PyObject *__pyx_n_s_setStepNumber; static PyObject *__pyx_n_s_setTime; static PyObject *__pyx_n_s_setTimeStep; static PyObject *__pyx_n_s_setTolerances; static PyObject *__pyx_n_s_setType; static PyObject *__pyx_n_s_setUp; static PyObject *__pyx_n_s_setUseEW; static PyObject *__pyx_n_s_setUseFD; static PyObject *__pyx_n_s_setUseMF; static PyObject *__pyx_n_s_setValue; static PyObject *__pyx_kp_s_setValueBlockedStagStencil_not_y; static PyObject *__pyx_kp_s_setValueStagStencil_not_yet_impl; static PyObject *__pyx_kp_s_setValuesStagStencil_not_yet_imp; static PyObject *__pyx_n_s_setVisible; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_setup; static PyObject *__pyx_n_s_sf; static PyObject *__pyx_n_s_sf_type; static PyObject *__pyx_n_s_shape; static PyObject *__pyx_n_s_shift; static PyObject *__pyx_n_s_shift_type; static PyObject *__pyx_n_s_shiftamount; static PyObject *__pyx_n_s_shifttype; static PyObject *__pyx_n_s_side; static PyObject *__pyx_kp_s_side_r_not_understood; static PyObject *__pyx_n_s_simplex; static PyObject *__pyx_n_s_size; static PyObject *__pyx_kp_s_size_I_is_d_expected_d; static PyObject *__pyx_kp_s_size_J_is_d_expected_d; static PyObject *__pyx_kp_s_size_V_is_d_expected_d; static PyObject *__pyx_kp_s_size_array_is_d_expected_dx_d_d; static PyObject *__pyx_kp_s_size_d_nnz_is_d_expected_d; static PyObject *__pyx_kp_s_size_o_nnz_is_d_expected_d; static PyObject *__pyx_n_s_sizes; static PyObject *__pyx_kp_s_sizes_array_should_have_d_entrie; static PyObject *__pyx_n_s_skip; static PyObject *__pyx_n_s_sleep; static PyObject *__pyx_n_s_smooths; static PyObject *__pyx_n_s_snes; static PyObject *__pyx_n_s_snes_type; static PyObject *__pyx_n_s_solve; static PyObject *__pyx_n_s_solver; static PyObject *__pyx_n_s_sortype; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_splitOwnership; static PyObject *__pyx_n_s_stage; static PyObject *__pyx_n_s_star; static PyObject *__pyx_n_s_start; static PyObject *__pyx_n_s_starts; static PyObject *__pyx_n_s_startswith; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_stencil_type; static PyObject *__pyx_n_s_stencil_width; static PyObject *__pyx_n_s_stenciltype; static PyObject *__pyx_n_s_step; static PyObject *__pyx_n_s_step_number; static PyObject *__pyx_n_s_stol; static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_s_str; static PyObject *__pyx_kp_s_strided_and_direct; static PyObject *__pyx_kp_s_strided_and_direct_or_indirect; static PyObject *__pyx_kp_s_strided_and_indirect; static PyObject *__pyx_n_s_strides; static PyObject *__pyx_n_s_string; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_strip; static PyObject *__pyx_n_s_struct; static PyObject *__pyx_n_s_structure; static PyObject *__pyx_n_s_subcomm; static PyObject *__pyx_n_s_submat; static PyObject *__pyx_n_s_submats; static PyObject *__pyx_n_s_subminor; static PyObject *__pyx_n_s_subspaceOffsets; static PyObject *__pyx_n_s_subvec; static PyObject *__pyx_n_s_supp; static PyObject *__pyx_n_s_svalue; static PyObject *__pyx_n_s_swidth; static PyObject *__pyx_n_s_sx; static PyObject *__pyx_n_s_symmetric; static PyObject *__pyx_n_s_syncFlush; static PyObject *__pyx_n_s_syncPrint; static PyObject *__pyx_n_s_t; static PyObject *__pyx_n_s_tab; static PyObject *__pyx_n_s_tabs; static PyObject *__pyx_n_s_tao_type; static PyObject *__pyx_n_s_tbline; static PyObject *__pyx_n_s_tblist; static PyObject *__pyx_n_s_terminate; static PyObject *__pyx_n_s_theta; static PyObject *__pyx_n_s_threshold; static PyObject *__pyx_n_s_time; static PyObject *__pyx_n_s_time_step; static PyObject *__pyx_n_s_timestep; static PyObject *__pyx_n_s_title; static PyObject *__pyx_n_s_toAll; static PyObject *__pyx_n_s_toZero; static PyObject *__pyx_n_s_tol; static PyObject *__pyx_n_s_traceback; static PyObject *__pyx_n_s_traceback_2; static PyObject *__pyx_n_s_trans; static PyObject *__pyx_n_s_transpose; static PyObject *__pyx_n_s_ts_type; static PyObject *__pyx_n_s_twist; static PyObject *__pyx_n_s_typ; static PyObject *__pyx_n_s_type_registry; static PyObject *__pyx_n_s_typestr; static PyObject *__pyx_n_s_u; static PyObject *__pyx_n_s_ua; static PyObject *__pyx_kp_s_unable_to_allocate_array_data; static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str; static PyObject *__pyx_n_s_unit; static PyObject *__pyx_kp_s_unknown_boundary_type_s; static PyObject *__pyx_kp_s_unknown_element_type_s; static PyObject *__pyx_kp_s_unknown_error_handler_s; static PyObject *__pyx_kp_s_unknown_interpolation_type_s; static PyObject *__pyx_kp_s_unknown_options_s; static PyObject *__pyx_kp_s_unknown_scatter_mode_s; static PyObject *__pyx_kp_s_unknown_shift_type_s; static PyObject *__pyx_kp_s_unknown_stencil_location_type_s; static PyObject *__pyx_kp_s_unknown_stencil_type_s; static PyObject *__pyx_n_s_unpack; static PyObject *__pyx_n_s_up; static PyObject *__pyx_n_s_up_left; static PyObject *__pyx_n_s_up_right; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_upper; static PyObject *__pyx_n_s_useAnchors; static PyObject *__pyx_n_s_useClosure; static PyObject *__pyx_n_s_useCone; static PyObject *__pyx_n_s_useInitialGuess; static PyObject *__pyx_n_s_v; static PyObject *__pyx_n_s_val; static PyObject *__pyx_n_s_value; static PyObject *__pyx_n_s_values; static PyObject *__pyx_kp_s_values_must_have_two_or_more_dim; static PyObject *__pyx_n_s_varbounds; static PyObject *__pyx_n_s_vec; static PyObject *__pyx_n_s_vecTo; static PyObject *__pyx_n_s_vec_from; static PyObject *__pyx_n_s_vec_to; static PyObject *__pyx_n_s_vec_type; static PyObject *__pyx_n_s_vecs; static PyObject *__pyx_n_s_vectors; static PyObject *__pyx_n_s_version; static PyObject *__pyx_n_s_vg; static PyObject *__pyx_n_s_viennaclvechandle; static PyObject *__pyx_n_s_view; static PyObject *__pyx_n_s_viewer; static PyObject *__pyx_n_s_vl; static PyObject *__pyx_n_s_vlg; static PyObject *__pyx_n_s_vm; static PyObject *__pyx_n_s_vn; static PyObject *__pyx_n_s_vtol; static PyObject *__pyx_n_s_vwr_type; static PyObject *__pyx_n_s_w; static PyObject *__pyx_kp_s_w_2; static PyObject *__pyx_n_s_weight; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_wrapped_func; static PyObject *__pyx_n_s_wraps; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_xdot; static PyObject *__pyx_n_s_xdotdot; static PyObject *__pyx_n_s_xl; static PyObject *__pyx_n_s_xmax; static PyObject *__pyx_n_s_xmin; static PyObject *__pyx_n_s_xnorm; static PyObject *__pyx_n_s_xu; static PyObject *__pyx_n_s_y; static PyObject *__pyx_n_s_ymax; static PyObject *__pyx_n_s_ymin; static PyObject *__pyx_n_s_ynorm; static PyObject *__pyx_n_s_zeropivot; static PyObject *__pyx_n_s_zmax; static PyObject *__pyx_n_s_zmin; static PyObject *__pyx_n_s_zoz; static PyObject *__pyx_n_s_zzo; static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /* proto */ #endif #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_readonly); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /* proto */ #endif #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */ #endif #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1i___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1j___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1k___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1c___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5index___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5field___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_DOF); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_2__getitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_4__setitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5array___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_ierr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_2__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options___init__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_7Options_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6prefix___get__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_2__set__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_4__del__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_12create(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_14destroy(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_16clear(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_18view(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_24hasName(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_26setValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28delValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_30getBool(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getInt(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_34getReal(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_38getString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_40insertString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_string); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_42getAll(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_devel, PyObject *__pyx_v_date, PyObject *__pyx_v_author); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_12Print(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_16syncFlush(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_18splitOwnership(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_20sleep(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_22pushErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_errhandler); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_28infoAllow(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flag, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_30registerCitation(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_citation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_32hasExternalPackage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_package); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_Stage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_2Class(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_4Event(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_6begin(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_all); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_8view(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_10logFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_12addFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_16getTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(PyObject *__pyx_self, PyObject *__pyx_v_func); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_8push(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_24setVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_12setActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_24setActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_26getPerfInfo(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_stage); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4Comm___cinit__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_4Comm_2__dealloc__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4Comm_6__nonzero__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_7fortran___get__(struct PyPetscCommObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(struct PyPetscCommObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_6Object_2__dealloc__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_6__nonzero__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_memo); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_12view(struct PyPetscObjectObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_14destroy(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_16getType(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_22setFromOptions(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_24viewFromOptions(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_26getComm(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28getName(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30setName(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32getClassId(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getClassName(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36getRefCount(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38compose(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40query(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42incRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44decRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46getAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48setAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50getDict(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52stateIncrease(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54incrementTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_tab, struct PyPetscObjectObject *__pyx_v_parent); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56setTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58getTabLevel(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6handle___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7fortran___get__(struct PyPetscObjectObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_4view(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_8create(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_10createASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_12createBinary(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_14createMPIIO(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_16createVTK(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_18createHDF5(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_20createDraw(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_22setType(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_vwr_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32STDOUT(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34STDERR(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36ASCII(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38BINARY(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40DRAW(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42setASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44getASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46addASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48subtractASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50pushASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52popASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58useASCIITabs(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60printfASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62printfASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64flush(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66setFileMode(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68getFileMode(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileName(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileName(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setDrawInfo(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76clearDraw(struct PyPetscViewerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2getTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4setTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_timestep); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6incrementTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_8pushGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_group); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10popGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_12getGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_2__call__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4view(struct PyPetscRandomObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_6destroy(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8create(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_10setType(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_rnd_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_12getType(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_16getValue(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_22setSeed(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_seed); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_26setInterval(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_interval); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(struct PyPetscRandomObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(struct PyPetscISObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_2IS_4__releasebuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(struct PyPetscISObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10view(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_12destroy(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_14create(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_16setType(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_is_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_18getType(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_20createGeneral(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_22createBlock(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_24createStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_28copy(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_30load(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_32allGather(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_36invertPermutation(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nlocal); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_38getSize(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_40getLocalSize(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42getSizes(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getBlockSize(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46setBlockSize(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48sort(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50isSorted(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52setPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54isPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56setIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58isIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60equal(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62sum(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64expand(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66union(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68difference(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70complement(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nmin, PyObject *__pyx_v_nmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72embed(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_drop); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74renumber(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_mult); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76setIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78getIndices(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80setBlockIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82getBlockIndices(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84setStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86getStride(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88getInfo(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5array___get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(struct PyPetscISObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4setType(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_lgmap_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_8view(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12create(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, PyObject *__pyx_v_start); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(struct PyPetscLGMapObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(struct PyPetscSFObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4view(struct PyPetscSFObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6destroy(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8create(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10setType(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_sf_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12getType(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16setUp(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18reset(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_nroots, PyObject *__pyx_v_local, PyObject *__pyx_v_remote); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(struct PyPetscSFObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_36bcastBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38bcastEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40reduceBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_42reduceEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_44scatterBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_46scatterEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_48gatherBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_50gatherEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_52fetchAndOpBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_54fetchAndOpEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_2__pos__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4__neg__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6__abs__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8__iadd__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10__isub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12__imul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_16__itruediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_20__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_22__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_24__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_26__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_28__getitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_30__setitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_32__getbuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_3Vec_34__releasebuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_36__enter__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_38__exit__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_40view(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_42destroy(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_44create(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_46setType(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_48setSizes(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_50createSeq(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_52createMPI(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_54createWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_56createCUDAWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_cudahandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_58createViennaCLWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_viennaclvechandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_60createWithDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_dltensor, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_62attachDLPackInfo(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_dltensor); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_64clearDLPackInfo(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_66toDLPack(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_68createGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_70createGhostWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_72createShared(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_74createNest(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_isets, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_76setOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_78getOptionsPrefix(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_80setFromOptions(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_82setUp(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_84setOption(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_86getType(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_88getSize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_90getLocalSize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_92getSizes(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_94setBlockSize(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_96getBlockSize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_98getOwnershipRange(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_100getOwnershipRanges(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_102getBuffer(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_104getArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_106setArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_108placeArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_110resetArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_force); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_112bindToCPU(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_114getCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_116restoreCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_118getOffloadMask(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_120getCLContextHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_122getCLQueueHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_124getCLMemHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_126restoreCLMemHandle(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_128duplicate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_130copy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_132chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_134load(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_136equal(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_138dot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_140dotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_142dotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_144tDot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_146tDotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_148tDotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_150mDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_152mDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_154mDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_156mtDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_158mtDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_160mtDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_162norm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_164normBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_166normEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_168sum(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_170min(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_172max(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_174normalize(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_176reciprocal(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_178exp(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_180log(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_182sqrtabs(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184abs(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186conjugate(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188setRandom(struct PyPetscVecObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190permute(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_order, PyObject *__pyx_v_invert); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192zeroEntries(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_194set(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_196isset(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_198scale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_200shift(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_202chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_204swap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206axpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208isaxpy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210aypx(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212axpby(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_beta, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214waxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216maxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alphas, PyObject *__pyx_v_vecs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218pointwiseMult(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220pointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222pointwiseMin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224pointwiseMax(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226pointwiseMaxAbs(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228maxPointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_230getValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232getValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234getValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_236setValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238setValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240setValuesBlocked(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242setValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_244setLGMap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_lgmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246getLGMap(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_248setValueLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_250setValuesLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252setValuesBlockedLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254assemblyBegin(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_256assemblyEnd(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_258assemble(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_260strideScale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_262strideSum(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_264strideMin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266strideMax(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268strideNorm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_270strideScatter(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_272strideGather(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_274localForm(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_276ghostUpdateBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_278ghostUpdateEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280ghostUpdate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282setMPIGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_284getSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_286restoreSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_288getNestSubVecs(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290setNestSubVecs(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_sx, PyObject *__pyx_v_idxm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6buffer___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5array___get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Vec_5array_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(struct PyPetscVecObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_2create(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_4destroy(struct PyPetscQuadObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_2destroy(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_4create(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_6createDefault(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_qorder, PyObject *__pyx_v_prefix, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_8getQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_10getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12setQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_14setFaceQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16setType(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_fe_type); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_4view(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_8create(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscISObject *__pyx_v_is_from, struct PyPetscVecObject *__pyx_v_vec_to, struct PyPetscISObject *__pyx_v_is_to); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_scatter_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(struct PyPetscScatterObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_24begin(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_26end(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_28scatterBegin(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_30scatterEnd(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_32scatter(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static void __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4view(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6destroy(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8create(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10clone(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12setUp(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14reset(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_fieldName); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_numComp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28getChart(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30setChart(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32getDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34setDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36addDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38getFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40setFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42addFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_44getConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_46setConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48addConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50getFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52setFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54addFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_56getConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_58setConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60getFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62setFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64getMaxDof(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_66getStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getConstrainedStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72setOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_offset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74getFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76setFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_offset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78getOffsetRange(struct PyPetscSectionObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_80createGlobalSection(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_2__pos__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4__neg__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_6__iadd__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_8__isub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10__imul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_14__itruediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_18__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_20__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_22__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ #endif static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_24__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_26__getitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Mat_28__setitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_30__call__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_32view(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_34destroy(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_36create(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_38setType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_40setSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_42setBlockSize(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_44setBlockSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row_bsize, PyObject *__pyx_v_col_bsize); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_46createAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_48createBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_50createSBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_52createAIJCRL(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_54setPreallocationNNZ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_56setPreallocationCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_csr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_58createAIJWithArrays(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_csr, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60createDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_array, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62setPreallocationDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_64createScatter(struct PyPetscMatObject *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_scatter, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_66createNormal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_68createTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_70createLRC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_U, struct PyPetscVecObject *__pyx_v_c, struct PyPetscMatObject *__pyx_v_V); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_72createSubMatrixVirtual(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_74createNest(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mats, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76createPython(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78setPythonContext(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80getPythonContext(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_82setPythonType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_84setOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_86getOptionsPrefix(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_88setFromOptions(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_90setUp(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_92setOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94getType(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96getSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98getLocalSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100getSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102getBlockSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104getBlockSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_106getOwnershipRange(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_108getOwnershipRanges(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_110getOwnershipRangeColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_112getOwnershipRangesColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114getOwnershipIS(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116getInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_info); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_118duplicate(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_copy); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120copy(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_structure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_122load(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124convert(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126transpose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128realPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130imagPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132conjugate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134permute(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_row, struct PyPetscISObject *__pyx_v_col); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136equal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138isTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140isSymmetric(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142isSymmetricKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144isHermitian(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146isHermitianKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148isStructurallySymmetric(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150zeroEntries(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152getValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154getValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156getValuesCSR(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158getRow(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160getRowIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162getColumnIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164setValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166setValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168setValuesRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170setValuesIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172setValuesCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174setValuesBlocked(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176setValuesBlockedRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178setValuesBlockedIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_180setValuesBlockedCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182setLGMap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_rmap, struct PyPetscLGMapObject *__pyx_v_cmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184getLGMap(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186setValueLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188setValuesLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_190setValuesLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_192setValuesLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_194setValuesLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_196setValuesBlockedLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_198setValuesBlockedLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_200setValuesBlockedLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_202setValuesBlockedLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_204setStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_dims, PyObject *__pyx_v_starts, PyObject *__pyx_v_dof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_206setValueStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208setValueStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210setValueBlockedStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_212setValueBlockedStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_214zeroRows(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_216zeroRowsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_218zeroRowsColumns(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_220zeroRowsColumnsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_222storeValues(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_224retrieveValues(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_226assemblyBegin(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_228assemblyEnd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_230assemble(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_232isAssembled(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_234createVecs(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_236createVecRight(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_238createVecLeft(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_240getColumnVector(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_column, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_242getRedundantMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nsubcomm, PyObject *__pyx_v_subcomm, struct PyPetscMatObject *__pyx_v_out); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_244getDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_246getRowSum(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_248setDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_250diagonalScale(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_L, struct PyPetscVecObject *__pyx_v_R); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_252invertBlockDiagonal(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_254setNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_256getNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_258setTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_260getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_262setNearNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_264getNearNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_266mult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_268multAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_270multTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_272multTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_274multHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_276multHermitianAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_278SOR(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x, PyObject *__pyx_v_omega, PyObject *__pyx_v_sortype, PyObject *__pyx_v_shift, PyObject *__pyx_v_its, PyObject *__pyx_v_lits); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_280getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_282increaseOverlap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284createSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286createSubMatrices(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_submats); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288getLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290restoreLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292norm(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294scale(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296shift(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_298chop(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300axpy(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_302aypx(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304matMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_306matTransposeMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_308transposeMatMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310PtAP(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312getOrdering(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ord_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_314reorderForNonzeroDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_atol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_316factorLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_318factorSymbolicLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_320factorNumericLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322factorILU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324factorSymbolicILU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326factorCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328factorSymbolicCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330factorNumericCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_332factorICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_334factorSymbolicICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_336getInertia(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_338setUnfactored(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_340fixISLocalEmpty(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_fix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_342getISLocalMat(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_344restoreISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_346setISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_348setISPreallocation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz, PyObject *__pyx_v_onnz); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_350getLRCMats(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352setMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_ival); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354getMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_356setMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_val); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_358getMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360getMumpsInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362getMumpsInfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_364getMumpsRinfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_366getMumpsRinfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368solveForward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_370solveBackward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_372solve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_374solveTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_376solveAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_378solveTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_380matSolve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_382getDenseArray(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_384getDenseLocalMatrix(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386getNestSize(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388getNestISs(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390getNestLocalISs(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392getNestSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_394getISLocalMat(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_396getDM(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_398setDM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(struct PyPetscMatObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_constant, PyObject *__pyx_v_vectors, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_coords); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_12setFunction(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(struct PyPetscNullSpaceObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_2__call__(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_4view(struct PyPetscPCObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_6destroy(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_8create(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_10setType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_12getType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_14setOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_18setFromOptions(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_20setOperators(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_22getOperators(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_24setUseAmat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_26setReusePreconditioner(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_28setUp(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_30reset(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_32setUpOnBlocks(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_34apply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_36applyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38applySymmetricLeft(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40applySymmetricRight(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42getDM(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44setDM(struct PyPetscPCObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46setCoordinates(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48createPython(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_50setPythonContext(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_52getPythonContext(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_54setPythonType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_56setASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_asmtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_58setASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_60setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_62setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_64getASMSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_66setGASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gasmtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_68setGASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_70setGAMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gamgtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setGAMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setGAMGSmooths(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_smooths); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76getHYPREType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78setHYPREType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_hypretype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80setHYPREDiscreteCurl(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setHYPREDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setHYPRESetAlphaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setHYPRESetBetaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setHYPRESetEdgeConstantVectors(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_ozz, struct PyPetscVecObject *__pyx_v_zoz, struct PyPetscVecObject *__pyx_v_zzo); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setFactorSolverType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_solver); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92getFactorSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94setFactorSetUpSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setFactorOrdering(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ord_type, PyObject *__pyx_v_nzdiag, PyObject *__pyx_v_reuse); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setFactorPivot(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_zeropivot, PyObject *__pyx_v_inblocks); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setFactorShift(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_shift_type, PyObject *__pyx_v_amount); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setFactorLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104getFactorMatrix(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setFieldSplitType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_108setFieldSplitIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_110setFieldSplitFields(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_fields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFieldSplitSchurFactType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFieldSplitSchurPreType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ptype, struct PyPetscMatObject *__pyx_v_pre); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_120setCompositeType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122getCompositePC(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124addCompositePCType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126getKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128getMGType(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_130setMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_mgtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132getMGLevels(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134setMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138setMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140getMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142setMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144getMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146setMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rscale); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148getMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150getMGSmoother(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGSmootherDown(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154getMGSmootherUp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156setMGCycleType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cycle_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGCycleTypeOnLevel(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_cycle_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160setMGRhs(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rhs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGX(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164setMGR(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setBDDCDivergenceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_div, PyObject *__pyx_v_trans, struct PyPetscISObject *__pyx_v_l2l); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168setBDDCDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_G, PyObject *__pyx_v_order, PyObject *__pyx_v_field, PyObject *__pyx_v_gord, PyObject *__pyx_v_conforming); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170setBDDCChangeOfBasisMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_T, PyObject *__pyx_v_interior); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172setBDDCPrimalVerticesIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174setBDDCPrimalVerticesLocalIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176setBDDCCoarseningRatio(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cratio); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178setBDDCLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setBDDCDirichletBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setBDDCDirichletBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setBDDCNeumannBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCNeumannBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDofsSplitting(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCDofsSplittingLocal(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setPatchCellNumbering(struct PyPetscPCObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_194setPatchDiscretisationInfo(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_196setPatchComputeOperator(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setPatchComputeOperatorInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setPatchComputeFunction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setPatchComputeFunctionInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setPatchConstructType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_b, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4view(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8create(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_10setType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_ksp_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12getType(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_14setOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_18setFromOptions(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_20setAppCtx(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_22getAppCtx(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_24getDM(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_26setDM(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_28setDMActive(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_30setComputeRHS(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rhs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_32setComputeOperators(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_34setOperators(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_36getOperators(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_38setPC(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscPCObject *__pyx_v_pc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_40getPC(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_42setTolerances(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_divtol, PyObject *__pyx_v_max_it); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_44getTolerances(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_46setConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_48getConvergenceTest(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_50callConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52setConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54getConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56logConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58setMonitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60getMonitor(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62cancelMonitor(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_64monitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66setPCSide(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68getPCSide(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70setNormType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_normtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72getNormType(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74setComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76getComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78setComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80getComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82setInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84getInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86setInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88getInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90setUseFischerGuess(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_model, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92setUp(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94reset(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96setUpOnBlocks(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98solve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100solveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102setIterationNumber(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104getIterationNumber(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106setResidualNorm(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108getResidualNorm(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110setConvergedReason(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112getConvergedReason(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114getRhs(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116getSolution(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118getWorkVecs(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_right, PyObject *__pyx_v_left); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120buildSolution(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122buildResidual(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_r); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124computeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126computeExtremeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128setGMRESRestart(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_restart); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130createPython(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132setPythonContext(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134getPythonContext(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136setPythonType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9iterating___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9converged___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8diverged___get__(struct PyPetscKSPObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2view(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6create(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8setType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_snes_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10getType(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12setOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_16setFromOptions(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_18setAppCtx(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_20getAppCtx(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_22getDM(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_24setDM(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_26setFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_28getFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30setFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32getFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34setFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36getFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38setFASRScale(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASLevels(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_levels, PyObject *__pyx_v_comms); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42getFASLevels(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44getFASCycleSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48getFASSmoother(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmootherDown(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherUp(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56hasNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58setNPC(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESObject *__pyx_v_snes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60setLineSearchPreCheck(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_precheck, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62setInitialGuess(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_initialguess, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getInitialGuess(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66setFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68getFunction(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70setUpdate(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72getUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74setJacobian(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_76getJacobian(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_78setObjective(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80getObjective(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_82computeFunction(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84computeJacobian(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_86computeObjective(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88setNGS(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_ngs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_90getNGS(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92computeNGS(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_94setTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_stol, PyObject *__pyx_v_max_it); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96getTolerances(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98setNormSchedule(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_normsched); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_100getNormSchedule(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102setConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_104getConvergenceTest(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106callConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112logConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm, PyObject *__pyx_v_linear_its); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114setResetCounters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reset); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116setMonitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118getMonitor(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120cancelMonitor(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_122monitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_124setMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_funcs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_126getMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_128getFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130setMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132getMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134getStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136setMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_138getMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140getKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142setUp(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144reset(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146solve(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148setConvergedReason(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150getConvergedReason(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152setIterationNumber(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154getIterationNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156setFunctionNorm(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158getFunctionNorm(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getLinearSolveIterations(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162getRhs(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164getSolution(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166setSolution(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170setKSP(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172getKSP(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174setUseEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_targs, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getUseEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178setParamsEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_version, PyObject *__pyx_v_rtol_0, PyObject *__pyx_v_rtol_max, PyObject *__pyx_v_gamma, PyObject *__pyx_v_alpha, PyObject *__pyx_v_alpha2, PyObject *__pyx_v_threshold); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getParamsEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setUseMF(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184getUseMF(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186setUseFD(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_188getUseFD(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190setVariableBounds(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_192getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194createPython(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196setPythonContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198getPythonContext(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200setPythonType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202getCompositeSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_204getCompositeNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206getNASMSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_208getNASMNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210setPatchCellNumbering(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212setPatchDiscretisationInfo(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214setPatchComputeOperator(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216setPatchComputeFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218setPatchConstructType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9iterating___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9converged___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8diverged___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2view(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4load(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6destroy(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8create(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_10clone(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12setType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_14setRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_16setARKIMEXType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_18getType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_20getRKType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_22getARKIMEXType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_24setProblemType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ptype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_26getProblemType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_28setEquationType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_eqtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_30getEquationType(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_32setOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_34getOptionsPrefix(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_36setFromOptions(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_38setAppCtx(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_40getAppCtx(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_42setRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_44setRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_46computeRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_48computeRHSFunctionLinear(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_50computeRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_52computeRHSJacobianConstant(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_54getRHSFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_56getRHSJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_58setIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_60setIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_62setIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_64computeIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_imex); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_66computeIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_imex); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_68computeIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_imex); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_70getIFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_72getIJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_74setI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_76setI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_78computeI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_80computeI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, PyObject *__pyx_v_v, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_82getI2Function(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_84getI2Jacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_86setSolution(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_88getSolution(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_90setSolution2(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u, struct PyPetscVecObject *__pyx_v_v); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_92getSolution2(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_94getSNES(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_96getKSP(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_98getDM(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_100setDM(struct PyPetscTSObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_102setTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_104getTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_106getPrevTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_108getSolveTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_110setTimeStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_time_step); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_112getTimeStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_114setStepNumber(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step_number); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_116getStepNumber(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_118setMaxTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_time); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_120getMaxTime(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_122setMaxSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_steps); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_124getMaxSteps(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_126getSNESIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_128getKSPIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_130setMaxStepRejections(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_132getStepRejections(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_134setMaxSNESFailures(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_136getSNESFailures(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_138setErrorIfStepFails(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_140setTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_142getTolerances(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_144setExactFinalTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_option); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_146setConvergedReason(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_148getConvergedReason(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_150setMonitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_152getMonitor(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_154cancelMonitor(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_156monitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step, PyObject *__pyx_v_time, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_158setEventHandler(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_direction, PyObject *__pyx_v_terminate, PyObject *__pyx_v_eventhandler, PyObject *__pyx_v_postevent, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_160setEventTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tol, PyObject *__pyx_v_vtol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_162getNumEvents(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_164setPreStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prestep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_166getPreStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_168setPostStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_poststep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_170getPostStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_172setUp(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_174reset(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_176step(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_178restartStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_180rollBack(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_182solve(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_184interpolate(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_u); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_186setSaveTrajectory(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_188getCostIntegral(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_190setCostGradients(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_vl, PyObject *__pyx_v_vm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_192getCostGradients(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_194setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_196createQuadratureTS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_forward); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_198getQuadratureTS(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_200setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rhsjacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_202computeRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_204adjointSetSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_adjoint_steps); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_206adjointSetUp(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_208adjointSolve(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_210adjointStep(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_212createPython(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_214setPythonContext(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_216getPythonContext(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_218setPythonType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_220setTheta(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_theta); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_222getTheta(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_224setThetaEndpoint(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_226getThetaEndpoint(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_228setAlphaRadius(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_radius); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_230setAlphaParams(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_alpha_m, PyObject *__pyx_v_alpha_f, PyObject *__pyx_v_gamma); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_232getAlphaParams(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6appctx___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_6appctx_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2dm___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_2dm_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12problem_type___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_13equation_type___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4snes___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_3ksp___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_7vec_sol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4time___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_4time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9time_step___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_9time_step_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_11step_number___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_11step_number_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8max_time___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_8max_time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9max_steps___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4rtol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_4rtol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4atol___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_4atol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6reason___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2TS_6reason_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9iterating___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9converged___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8diverged___get__(struct PyPetscTSObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO___cinit__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_2view(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4destroy(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6create(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8setType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_tao_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_10getType(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_12setOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_14getOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_16setFromOptions(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_18setUp(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_20setInitialTrustRegionRadius(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_radius); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_22setAppCtx(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_24getAppCtx(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_26setInitial(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_28setObjective(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_30setResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_residual, struct PyPetscVecObject *__pyx_v_R, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_32setJacobianResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_34setGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gradient, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_36setObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_38setVariableBounds(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_varbounds, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_40setConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_constraints, struct PyPetscVecObject *__pyx_v_C, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_42setHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_44setJacobian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_46setStateDesignIS(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_state, struct PyPetscISObject *__pyx_v_design); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_48setJacobianState(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_state, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_I, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_50setJacobianDesign(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_design, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_52computeObjective(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_54computeResidual(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_56computeGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_58computeObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_60computeDualVariables(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_62computeVariableBounds(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_64computeConstraints(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_66computeHessian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_68computeJacobian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_70setTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gatol, PyObject *__pyx_v_grtol, PyObject *__pyx_v_gttol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_72getTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_74setConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_catol, PyObject *__pyx_v_crtol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_76getConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_78setConvergenceTest(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_80getConvergenceTest(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_82setConvergedReason(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_84getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_86setMonitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_88getMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_90cancelMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_92solve(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_94getSolution(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_96getGradient(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_98setGradientNorm(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_100getGradientNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_102setLMVMH0(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_104getLMVMH0(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_106getLMVMH0KSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_108getVariableBounds(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_110getIterationNumber(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_112getObjectiveValue(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_114getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_116getSolutionNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_118getSolutionStatus(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_120getKSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_122getBRGNSubsolver(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_124setBRGNRegularizerObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_126setBRGNRegularizerHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_128setBRGNRegularizerWeight(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_weight); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_130setBRGNSmoothL1Epsilon(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_epsilon); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_132setBRGNDictionaryMatrix(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_D); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_134getBRGNDampingVector(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6appctx___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3ksp___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ftol___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4gtol___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ctol___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3its___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5gnorm___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5cnorm___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8solution___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9objective___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8function___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8gradient___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6reason___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9iterating___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9converged___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8diverged___get__(struct PyPetscTAOObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2AO___cinit__(struct PyPetscAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_2view(struct PyPetscAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_4destroy(struct PyPetscAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_6createBasic(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_8createMemoryScalable(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_10createMapping(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_12getType(struct PyPetscAOObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_14app2petsc(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_16petsc2app(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DM___cinit__(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2view(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_4load(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6destroy(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_8create(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_10clone(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_12setType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_14getType(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_16getDimension(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_18setDimension(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_20getCoordinateDim(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_22setCoordinateDim(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_24setOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_26setFromOptions(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_28viewFromOptions(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_30setUp(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_32setAppCtx(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_34getAppCtx(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_36setBasicAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_38getBasicAdjacency(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_40setFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_42getFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_44setNumFields(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_46getNumFields(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_48setField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_50getField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_52addField(struct PyPetscDMObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_54copyFields(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_56createDS(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_58clearDS(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_60getDS(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_62copyDS(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_64copyDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_66getBlockSize(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_68setVecType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_70createGlobalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_72createLocalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_74getGlobalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_76restoreGlobalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_78getLocalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_80restoreLocalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_82globalToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vl, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_84localToGlobal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_86localToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vlg, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_88getLGMap(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_90getCoordinateDM(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_92getCoordinateSection(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_94setCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_96getCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_98setCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_100getCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_102getBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_104getLocalBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_106localizeCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_108setMatType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_mat_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_110createMat(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_112createInterpolation(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_114createInjection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_116createRestriction(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_118convert(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_120refine(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_122coarsen(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_124refineHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_126coarsenHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_128getRefineLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_130setRefineLevel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_132getCoarsenLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_134adaptLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_136adaptMetric(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, PyObject *__pyx_v_label); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_138getLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_140setSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_142getSection(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_144setGlobalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_146getGlobalSection(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_148createSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_localsec, struct PyPetscSectionObject *__pyx_v_globalsec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_150getSectionSF(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_152setSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_154getPointSF(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_156setPointSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_158getNumLabels(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_160getLabelName(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_162hasLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_164createLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_166removeLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_168getLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_170setLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_172clearLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_174getLabelSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_176getLabelIdIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_178getStratumSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_180getStratumIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_182clearLabelStratum(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_184setLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_output); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_186getLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_188setKSPComputeOperators(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_190createFieldDecomposition(struct PyPetscDMObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_192setSNESFunction(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_194setSNESJacobian(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_jacobian, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_196addCoarsenHook(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_coarsenhook, PyObject *__pyx_v_restricthook, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6appctx___get__(struct PyPetscDMObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DM_6appctx_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2ds___get__(struct PyPetscDMObject *__pyx_v_self); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DM_2ds_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_2DS___cinit__(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_2view(struct PyPetscDSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_4destroy(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_6create(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_8setType(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_ds_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_10getType(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_12setFromOptions(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_14setUp(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_16getSpatialDimension(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_18getCoordinateDimension(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_20getNumFields(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_22getFieldIndex(struct PyPetscDSObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_disc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_24getTotalDimensions(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_26getTotalComponents(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_28getDimensions(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_30getComponents(struct PyPetscDSObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_32setDiscretisation(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_disc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_create(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dof, PyObject *__pyx_v_sizes, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, int __pyx_v_setup, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_2duplicate(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_4setDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6getDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10getDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12setSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_14getSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_16setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_proc_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_18getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_20setBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_boundary_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_22getBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_24setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_26getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_28setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_width); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_30getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_32setStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_34getStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_36getRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_38getGhostRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_42getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_44getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_46setFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_48getFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_54setCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_56getCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_58createNaturalVec(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_60globalToNatural(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vn, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_62naturalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vn, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_64getAO(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_66getScatter(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_68setRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_refine_x, PyObject *__pyx_v_refine_y, PyObject *__pyx_v_refine_z); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_70getRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_72setInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_interp_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_74getInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_76setElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_78getElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_80getElements(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dof___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13boundary_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7stencil___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12ghost_ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_create(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_2createFromCellList(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_cells, PyObject *__pyx_v_coords, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_4createBoxMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_simplex, PyObject *__pyx_v_periodic, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_6createFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_8createCGNS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cgid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_10createCGNSFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_12createExodusFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_14createExodus(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_exoid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_16createGmsh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_18createCohesiveSubmesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hasLagrange, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_20getChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_22setChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_24getConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_26setConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_28getCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_30setCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_cone, PyObject *__pyx_v_orientation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_32insertCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_conePoint); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_34insertConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_coneOrientation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_36getConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_38setConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_orientation); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_40getSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_42setSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_44getSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_46setSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_supp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_48getMaxSizes(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_50symmetrize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_52stratify(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_54orient(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_56getCellNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_58getVertexNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_60createPointNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_62getDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_64getDepthStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_66getHeightStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_68getMeet(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_70getJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_72getTransitiveClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_useCone); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_74vecGetClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_76getVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_78setVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_80setMatClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscSectionObject *__pyx_v_gsec, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_82generate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_boundary, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_84setTriangleOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_86setTetGenOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_88createSquareBoundary(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_edges); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_90createCubeBoundary(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_faces); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_92markBoundaryFaces(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_94setAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_useAnchors); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_96getAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_98getAdjacency(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_100setPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscPartitionerObject *__pyx_v_part); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_102getPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_104rebalanceSharedPoints(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_entityDepth, PyObject *__pyx_v_useInitialGuess, PyObject *__pyx_v_parallel); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_106distribute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_108distributeOverlap(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_110isDistributed(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_112interpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_114uninterpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_116distributeField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscSectionObject *__pyx_v_newsec, struct PyPetscVecObject *__pyx_v_newvec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_118createCoarsePointIS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_120createSection(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_numComp, PyObject *__pyx_v_numDof, PyObject *__pyx_v_bcField, PyObject *__pyx_v_bcComps, PyObject *__pyx_v_bcPoints, struct PyPetscISObject *__pyx_v_perm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_122getPointLocal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_124getPointLocalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_126getPointGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_128getPointGlobalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_130createClosureIndex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_132setRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementUniform); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_134getRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_136setRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementLimit); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_138getRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_140getOrdering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_otype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_142permute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_144computeCellGeometryFVM(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cell); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_146constructGhostCells(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_labelName); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_create(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dofs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_boundary_types, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm, PyObject *__pyx_v_setUp); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_2setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_swidth); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_stenciltype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_boundary_types); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10setGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_ranges); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_16getDim(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_20getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_22getDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_24getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_26getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_28getLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_30getGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_32getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_34getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_40getIsFirstRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_42getIsLastRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dmtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_52getLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_56getLocationDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_58migrateVec(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscDMObject *__pyx_v_dmTo, struct PyPetscVecObject *__pyx_v_vecTo); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_loc, PyObject *__pyx_v_c); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_64getVecArray(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_vec); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4dofs___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_19entries_per_element___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12global_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_11local_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14boundary_types___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_create(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_2addDM(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_args); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_4getNumber(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_6getEntries(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_8scatter(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_lvecs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_10gather(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_imode, PyObject *__pyx_v_lvecs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_12getGlobalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_14getLocalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_16getLGMaps(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_18getAccess(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_create(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_2setMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_4setGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_6setLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lv); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_gvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_lvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_gtol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltog); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_20setLocalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltol); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_24setCreateMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_matrix, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_26setCoarsen(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_coarsen, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_28setRefine(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_refine, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_interpolation, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_32setCreateInjection(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_injection, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_34setCreateRestriction(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_restriction, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_scatter, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_42setCreateSubDM(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_subdm, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_7DMLabel___cinit__(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_2destroy(struct PyPetscDMLabelObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_4create(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_6insertIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_create(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_nlocal, PyObject *__pyx_v_buffer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_16registerField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname, PyObject *__pyx_v_blocksize, PyObject *__pyx_v_dtype); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_18getField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_20restoreField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_24addPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_26addNPoints(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_npoints); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_28removePoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_32copyPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_pi, PyObject *__pyx_v_pj); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_34getLocalSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_36getSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_38migrate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_remove_sent_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_44setCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_46getCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_48setType(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_dmswarm_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_min, PyObject *__pyx_v_max, PyObject *__pyx_v_npoints, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates, PyObject *__pyx_v_redundant, PyObject *__pyx_v_mode); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_layoutType, PyObject *__pyx_v_fill_param); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_fieldnames); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_60viewXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_74projectFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames, PyObject *__pyx_v_reuse); /* proto */ static int __pyx_pf_8petsc4py_5PETSc_11Partitioner___cinit__(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_2view(struct PyPetscPartitionerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_4destroy(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_6create(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_8setType(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_part_type); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_10getType(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_12setFromOptions(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_14setUp(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_16reset(struct PyPetscPartitionerObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_18setShellPartition(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_numProcs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc__initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_comm); /* proto */ static PyObject *__pyx_pf_8petsc4py_5PETSc_2_finalize(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */ static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */ static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */ static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */ static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */ static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Comm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Object(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Viewer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Random(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_IS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LGMap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SF(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Vec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_FE(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Quad(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Scatter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Section(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Mat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_NullSpace(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_PC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_KSP(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SNES(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_AO(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DM(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DS(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Partitioner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMLabel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__IS_buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_buffer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Mat_Stencil(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMDA_Vec_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMComposite_access(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Options(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Sys(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Log(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogStage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogClass(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogEvent(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_ViewerHDF5(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMDA(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMStag(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMComposite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMShell(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMSwarm(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, &__pyx_n_s_keys, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0}; static PyObject *__pyx_float_0_; static PyObject *__pyx_float_0_0; static PyObject *__pyx_float_1_0; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_2; static PyObject *__pyx_int_3; static PyObject *__pyx_int_184977713; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_k__53; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__6; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_slice__39; static PyObject *__pyx_slice__48; static PyObject *__pyx_slice__49; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__27; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__31; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__33; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__35; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__37; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__41; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__43; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__65; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__67; static PyObject *__pyx_tuple__68; static PyObject *__pyx_tuple__69; static PyObject *__pyx_tuple__70; static PyObject *__pyx_tuple__71; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__76; static PyObject *__pyx_tuple__77; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__81; static PyObject *__pyx_tuple__83; static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__87; static PyObject *__pyx_tuple__88; static PyObject *__pyx_tuple__89; static PyObject *__pyx_tuple__90; static PyObject *__pyx_tuple__91; static PyObject *__pyx_tuple__92; static PyObject *__pyx_tuple__93; static PyObject *__pyx_tuple__94; static PyObject *__pyx_tuple__95; static PyObject *__pyx_tuple__96; static PyObject *__pyx_tuple__97; static PyObject *__pyx_tuple__98; static PyObject *__pyx_tuple__99; static PyObject *__pyx_tuple__100; static PyObject *__pyx_tuple__101; static PyObject *__pyx_tuple__102; static PyObject *__pyx_tuple__103; static PyObject *__pyx_tuple__104; static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__106; static PyObject *__pyx_tuple__107; static PyObject *__pyx_tuple__108; static PyObject *__pyx_tuple__109; static PyObject *__pyx_tuple__110; static PyObject *__pyx_tuple__111; static PyObject *__pyx_tuple__112; static PyObject *__pyx_tuple__113; static PyObject *__pyx_tuple__114; static PyObject *__pyx_tuple__115; static PyObject *__pyx_tuple__116; static PyObject *__pyx_tuple__117; static PyObject *__pyx_tuple__118; static PyObject *__pyx_tuple__119; static PyObject *__pyx_tuple__120; static PyObject *__pyx_tuple__121; static PyObject *__pyx_tuple__122; static PyObject *__pyx_tuple__123; static PyObject *__pyx_tuple__124; static PyObject *__pyx_tuple__125; static PyObject *__pyx_tuple__126; static PyObject *__pyx_tuple__127; static PyObject *__pyx_tuple__128; static PyObject *__pyx_tuple__129; static PyObject *__pyx_tuple__130; static PyObject *__pyx_tuple__131; static PyObject *__pyx_tuple__132; static PyObject *__pyx_tuple__133; static PyObject *__pyx_tuple__134; static PyObject *__pyx_tuple__135; static PyObject *__pyx_tuple__136; static PyObject *__pyx_tuple__137; static PyObject *__pyx_tuple__138; static PyObject *__pyx_tuple__139; static PyObject *__pyx_tuple__140; static PyObject *__pyx_tuple__141; static PyObject *__pyx_tuple__142; static PyObject *__pyx_tuple__143; static PyObject *__pyx_tuple__144; static PyObject *__pyx_tuple__145; static PyObject *__pyx_tuple__146; static PyObject *__pyx_tuple__147; static PyObject *__pyx_tuple__150; static PyObject *__pyx_tuple__151; static PyObject *__pyx_tuple__152; static PyObject *__pyx_tuple__153; static PyObject *__pyx_tuple__154; static PyObject *__pyx_tuple__155; static PyObject *__pyx_codeobj__23; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__80; static PyObject *__pyx_codeobj__82; static PyObject *__pyx_codeobj__84; static PyObject *__pyx_codeobj__86; static PyObject *__pyx_codeobj__148; static PyObject *__pyx_codeobj__149; static PyObject *__pyx_codeobj__156; /* Late includes */ /* "PETSc/PETSc.pyx":9 * # -------------------------------------------------------------------- * * cdef inline object bytes2str(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: * return None */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_bytes2str(char const *__pyx_v_p) { PyObject *__pyx_v_s = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bytes2str", 0); /* "PETSc/PETSc.pyx":10 * * cdef inline object bytes2str(const char p[]): * if p == NULL: # <<<<<<<<<<<<<< * return None * cdef bytes s = p */ __pyx_t_1 = ((__pyx_v_p == NULL) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":11 * cdef inline object bytes2str(const char p[]): * if p == NULL: * return None # <<<<<<<<<<<<<< * cdef bytes s = p * if isinstance(s, str): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/PETSc.pyx":10 * * cdef inline object bytes2str(const char p[]): * if p == NULL: # <<<<<<<<<<<<<< * return None * cdef bytes s = p */ } /* "PETSc/PETSc.pyx":12 * if p == NULL: * return None * cdef bytes s = p # <<<<<<<<<<<<<< * if isinstance(s, str): * return s */ __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)__pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_s = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PETSc.pyx":13 * return None * cdef bytes s = p * if isinstance(s, str): # <<<<<<<<<<<<<< * return s * else: */ __pyx_t_1 = PyString_Check(__pyx_v_s); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "PETSc/PETSc.pyx":14 * cdef bytes s = p * if isinstance(s, str): * return s # <<<<<<<<<<<<<< * else: * return s.decode() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; /* "PETSc/PETSc.pyx":13 * return None * cdef bytes s = p * if isinstance(s, str): # <<<<<<<<<<<<<< * return s * else: */ } /* "PETSc/PETSc.pyx":16 * return s * else: * return s.decode() # <<<<<<<<<<<<<< * * cdef inline object str2bytes(object s, const char *p[]): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_decode_bytes(__pyx_v_s, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "PETSc/PETSc.pyx":9 * # -------------------------------------------------------------------- * * cdef inline object bytes2str(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.bytes2str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":18 * return s.decode() * * cdef inline object str2bytes(object s, const char *p[]): # <<<<<<<<<<<<<< * if s is None: * p[0] = NULL */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_str2bytes(PyObject *__pyx_v_s, char const **__pyx_v_p) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; char *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("str2bytes", 0); __Pyx_INCREF(__pyx_v_s); /* "PETSc/PETSc.pyx":19 * * cdef inline object str2bytes(object s, const char *p[]): * if s is None: # <<<<<<<<<<<<<< * p[0] = NULL * return None */ __pyx_t_1 = (__pyx_v_s == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/PETSc.pyx":20 * cdef inline object str2bytes(object s, const char *p[]): * if s is None: * p[0] = NULL # <<<<<<<<<<<<<< * return None * if not isinstance(s, bytes): */ (__pyx_v_p[0]) = NULL; /* "PETSc/PETSc.pyx":21 * if s is None: * p[0] = NULL * return None # <<<<<<<<<<<<<< * if not isinstance(s, bytes): * s = s.encode() */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/PETSc.pyx":19 * * cdef inline object str2bytes(object s, const char *p[]): * if s is None: # <<<<<<<<<<<<<< * p[0] = NULL * return None */ } /* "PETSc/PETSc.pyx":22 * p[0] = NULL * return None * if not isinstance(s, bytes): # <<<<<<<<<<<<<< * s = s.encode() * p[0] = (s) */ __pyx_t_2 = PyBytes_Check(__pyx_v_s); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":23 * return None * if not isinstance(s, bytes): * s = s.encode() # <<<<<<<<<<<<<< * p[0] = (s) * return s */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PETSc.pyx":22 * p[0] = NULL * return None * if not isinstance(s, bytes): # <<<<<<<<<<<<<< * s = s.encode() * p[0] = (s) */ } /* "PETSc/PETSc.pyx":24 * if not isinstance(s, bytes): * s = s.encode() * p[0] = (s) # <<<<<<<<<<<<<< * return s * */ __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(11, 24, __pyx_L1_error) (__pyx_v_p[0]) = ((char const *)((char *)__pyx_t_6)); /* "PETSc/PETSc.pyx":25 * s = s.encode() * p[0] = (s) * return s # <<<<<<<<<<<<<< * * cdef inline object S_(const char p[]): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; /* "PETSc/PETSc.pyx":18 * return s.decode() * * cdef inline object str2bytes(object s, const char *p[]): # <<<<<<<<<<<<<< * if s is None: * p[0] = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.str2bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":27 * return s * * cdef inline object S_(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: return None * cdef object s = p */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_S_(char const *__pyx_v_p) { PyObject *__pyx_v_s = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("S_", 0); /* "PETSc/PETSc.pyx":28 * * cdef inline object S_(const char p[]): * if p == NULL: return None # <<<<<<<<<<<<<< * cdef object s = p * return s if isinstance(s, str) else s.decode() */ __pyx_t_1 = ((__pyx_v_p == NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/PETSc.pyx":29 * cdef inline object S_(const char p[]): * if p == NULL: return None * cdef object s = p # <<<<<<<<<<<<<< * return s if isinstance(s, str) else s.decode() * */ __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)__pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_s = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/PETSc.pyx":30 * if p == NULL: return None * cdef object s = p * return s if isinstance(s, str) else s.decode() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyString_Check(__pyx_v_s); if ((__pyx_t_1 != 0)) { __Pyx_INCREF(__pyx_v_s); __pyx_t_2 = __pyx_v_s; } else { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":27 * return s * * cdef inline object S_(const char p[]): # <<<<<<<<<<<<<< * if p == NULL: return None * cdef object s = p */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.S_", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":46 * cdef object PetscError = PyExc_RuntimeError * * cdef inline int SETERR(int ierr) with gil: # <<<<<<<<<<<<<< * if (PetscError) != NULL: * PyErr_SetObject(PetscError, ierr) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_SETERR(int __pyx_v_ierr) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SETERR", 0); /* "PETSc/PETSc.pyx":47 * * cdef inline int SETERR(int ierr) with gil: * if (PetscError) != NULL: # <<<<<<<<<<<<<< * PyErr_SetObject(PetscError, ierr) * else: */ __pyx_t_1 = ((((void *)__pyx_v_8petsc4py_5PETSc_PetscError) != NULL) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":48 * cdef inline int SETERR(int ierr) with gil: * if (PetscError) != NULL: * PyErr_SetObject(PetscError, ierr) # <<<<<<<<<<<<<< * else: * PyErr_SetObject(PyExc_RuntimeError, ierr) */ __pyx_t_2 = __pyx_v_8petsc4py_5PETSc_PetscError; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); PyErr_SetObject(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PETSc.pyx":47 * * cdef inline int SETERR(int ierr) with gil: * if (PetscError) != NULL: # <<<<<<<<<<<<<< * PyErr_SetObject(PetscError, ierr) * else: */ goto __pyx_L3; } /* "PETSc/PETSc.pyx":50 * PyErr_SetObject(PetscError, ierr) * else: * PyErr_SetObject(PyExc_RuntimeError, ierr) # <<<<<<<<<<<<<< * return ierr * */ /*else*/ { __pyx_t_3 = ((PyObject *)PyExc_RuntimeError); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); PyErr_SetObject(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "PETSc/PETSc.pyx":51 * else: * PyErr_SetObject(PyExc_RuntimeError, ierr) * return ierr # <<<<<<<<<<<<<< * * cdef inline int CHKERR(int ierr) nogil except -1: */ __pyx_r = __pyx_v_ierr; goto __pyx_L0; /* "PETSc/PETSc.pyx":46 * cdef object PetscError = PyExc_RuntimeError * * cdef inline int SETERR(int ierr) with gil: # <<<<<<<<<<<<<< * if (PetscError) != NULL: * PyErr_SetObject(PetscError, ierr) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_WriteUnraisable("petsc4py.PETSc.SETERR", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/PETSc.pyx":53 * return ierr * * cdef inline int CHKERR(int ierr) nogil except -1: # <<<<<<<<<<<<<< * if ierr == 0: * return 0 # no error */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_CHKERR(int __pyx_v_ierr) { int __pyx_r; int __pyx_t_1; /* "PETSc/PETSc.pyx":54 * * cdef inline int CHKERR(int ierr) nogil except -1: * if ierr == 0: # <<<<<<<<<<<<<< * return 0 # no error * if ierr == PETSC_ERR_PYTHON: */ __pyx_t_1 = ((__pyx_v_ierr == 0) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":55 * cdef inline int CHKERR(int ierr) nogil except -1: * if ierr == 0: * return 0 # no error # <<<<<<<<<<<<<< * if ierr == PETSC_ERR_PYTHON: * return -1 # error in Python call */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":54 * * cdef inline int CHKERR(int ierr) nogil except -1: * if ierr == 0: # <<<<<<<<<<<<<< * return 0 # no error * if ierr == PETSC_ERR_PYTHON: */ } /* "PETSc/PETSc.pyx":56 * if ierr == 0: * return 0 # no error * if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * return -1 # error in Python call * SETERR(ierr) */ __pyx_t_1 = ((__pyx_v_ierr == PETSC_ERR_PYTHON) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":57 * return 0 # no error * if ierr == PETSC_ERR_PYTHON: * return -1 # error in Python call # <<<<<<<<<<<<<< * SETERR(ierr) * return -1 */ __pyx_r = -1; goto __pyx_L0; /* "PETSc/PETSc.pyx":56 * if ierr == 0: * return 0 # no error * if ierr == PETSC_ERR_PYTHON: # <<<<<<<<<<<<<< * return -1 # error in Python call * SETERR(ierr) */ } /* "PETSc/PETSc.pyx":58 * if ierr == PETSC_ERR_PYTHON: * return -1 # error in Python call * SETERR(ierr) # <<<<<<<<<<<<<< * return -1 * */ ((void)__pyx_f_8petsc4py_5PETSc_SETERR(__pyx_v_ierr)); /* "PETSc/PETSc.pyx":59 * return -1 # error in Python call * SETERR(ierr) * return -1 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = -1; goto __pyx_L0; /* "PETSc/PETSc.pyx":53 * return ierr * * cdef inline int CHKERR(int ierr) nogil except -1: # <<<<<<<<<<<<<< * if ierr == 0: * return 0 # no error */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/PETSc.pyx":78 * PetscScalar PyPetscScalar_AsPetscScalar(object) except? -1.0 * * cdef inline object toBool(PetscBool value): # <<<<<<<<<<<<<< * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toBool(PetscBool __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("toBool", 0); /* "PETSc/PETSc.pyx":79 * * cdef inline object toBool(PetscBool value): * return True if value else False # <<<<<<<<<<<<<< * cdef inline PetscBool asBool(object value) except? 0: * return PETSC_TRUE if value else PETSC_FALSE */ __Pyx_XDECREF(__pyx_r); if (__pyx_v_value) { __Pyx_INCREF(Py_True); __pyx_t_1 = Py_True; } else { __Pyx_INCREF(Py_False); __pyx_t_1 = Py_False; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":78 * PetscScalar PyPetscScalar_AsPetscScalar(object) except? -1.0 * * cdef inline object toBool(PetscBool value): # <<<<<<<<<<<<<< * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":80 * cdef inline object toBool(PetscBool value): * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: # <<<<<<<<<<<<<< * return PETSC_TRUE if value else PETSC_FALSE * */ static CYTHON_INLINE PetscBool __pyx_f_8petsc4py_5PETSc_asBool(PyObject *__pyx_v_value) { PetscBool __pyx_r; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asBool", 0); /* "PETSc/PETSc.pyx":81 * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: * return PETSC_TRUE if value else PETSC_FALSE # <<<<<<<<<<<<<< * * cdef inline object toInt(PetscInt value): */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(11, 81, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_1 = PETSC_TRUE; } else { __pyx_t_1 = PETSC_FALSE; } __pyx_r = __pyx_t_1; goto __pyx_L0; /* "PETSc/PETSc.pyx":80 * cdef inline object toBool(PetscBool value): * return True if value else False * cdef inline PetscBool asBool(object value) except? 0: # <<<<<<<<<<<<<< * return PETSC_TRUE if value else PETSC_FALSE * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asBool", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscBool)0); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":83 * return PETSC_TRUE if value else PETSC_FALSE * * cdef inline object toInt(PetscInt value): # <<<<<<<<<<<<<< * return value * cdef inline PetscInt asInt(object value) except? -1: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toInt(PetscInt __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toInt", 0); /* "PETSc/PETSc.pyx":84 * * cdef inline object toInt(PetscInt value): * return value # <<<<<<<<<<<<<< * cdef inline PetscInt asInt(object value) except? -1: * return value */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscInt(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":83 * return PETSC_TRUE if value else PETSC_FALSE * * cdef inline object toInt(PetscInt value): # <<<<<<<<<<<<<< * return value * cdef inline PetscInt asInt(object value) except? -1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.toInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":85 * cdef inline object toInt(PetscInt value): * return value * cdef inline PetscInt asInt(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asInt(PyObject *__pyx_v_value) { PetscInt __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asInt", 0); /* "PETSc/PETSc.pyx":86 * return value * cdef inline PetscInt asInt(object value) except? -1: * return value # <<<<<<<<<<<<<< * * cdef inline object toReal(PetscReal value): */ __pyx_t_1 = __Pyx_PyInt_As_PetscInt(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(11, 86, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "PETSc/PETSc.pyx":85 * cdef inline object toInt(PetscInt value): * return value * cdef inline PetscInt asInt(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":88 * return value * * cdef inline object toReal(PetscReal value): # <<<<<<<<<<<<<< * return value * cdef inline PetscReal asReal(object value) except? -1: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toReal(PetscReal __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toReal", 0); /* "PETSc/PETSc.pyx":89 * * cdef inline object toReal(PetscReal value): * return value # <<<<<<<<<<<<<< * cdef inline PetscReal asReal(object value) except? -1: * return value */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":88 * return value * * cdef inline object toReal(PetscReal value): # <<<<<<<<<<<<<< * return value * cdef inline PetscReal asReal(object value) except? -1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.toReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":90 * cdef inline object toReal(PetscReal value): * return value * cdef inline PetscReal asReal(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ static CYTHON_INLINE PetscReal __pyx_f_8petsc4py_5PETSc_asReal(PyObject *__pyx_v_value) { PetscReal __pyx_r; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asReal", 0); /* "PETSc/PETSc.pyx":91 * return value * cdef inline PetscReal asReal(object value) except? -1: * return value # <<<<<<<<<<<<<< * * cdef inline object toScalar(PetscScalar value): */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(11, 91, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "PETSc/PETSc.pyx":90 * cdef inline object toReal(PetscReal value): * return value * cdef inline PetscReal asReal(object value) except? -1: # <<<<<<<<<<<<<< * return value * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1.0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":93 * return value * * cdef inline object toScalar(PetscScalar value): # <<<<<<<<<<<<<< * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toScalar(PetscScalar __pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toScalar", 0); /* "PETSc/PETSc.pyx":94 * * cdef inline object toScalar(PetscScalar value): * return PyPetscScalar_FromPetscScalar(value) # <<<<<<<<<<<<<< * cdef inline PetscScalar asScalar(object value) except? -1.0: * return PyPetscScalar_AsPetscScalar(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyPetscScalar_FromPetscScalar(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":93 * return value * * cdef inline object toScalar(PetscScalar value): # <<<<<<<<<<<<<< * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.toScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":95 * cdef inline object toScalar(PetscScalar value): * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: # <<<<<<<<<<<<<< * return PyPetscScalar_AsPetscScalar(value) * */ static CYTHON_INLINE PetscScalar __pyx_f_8petsc4py_5PETSc_asScalar(PyObject *__pyx_v_value) { PetscScalar __pyx_r; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asScalar", 0); /* "PETSc/PETSc.pyx":96 * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: * return PyPetscScalar_AsPetscScalar(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = PyPetscScalar_AsPetscScalar(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(11, 96, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "PETSc/PETSc.pyx":95 * cdef inline object toScalar(PetscScalar value): * return PyPetscScalar_FromPetscScalar(value) * cdef inline PetscScalar asScalar(object value) except? -1.0: # <<<<<<<<<<<<<< * return PyPetscScalar_AsPetscScalar(value) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.asScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscScalar)(-1.0)); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":68 * # -------------------------------------------------------------------- * * cdef inline ndarray asarray(object ob): # <<<<<<<<<<<<<< * return PyArray_FROM_O(ob) * */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_asarray(PyObject *__pyx_v_ob) { PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asarray", 0); /* "include/arraynpy.pxi":69 * * cdef inline ndarray asarray(object ob): * return PyArray_FROM_O(ob) # <<<<<<<<<<<<<< * * cdef inline ndarray arange(start, stop, stride): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_FROM_O(__pyx_v_ob)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":68 * # -------------------------------------------------------------------- * * cdef inline ndarray asarray(object ob): # <<<<<<<<<<<<<< * return PyArray_FROM_O(ob) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.asarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":71 * return PyArray_FROM_O(ob) * * cdef inline ndarray arange(start, stop, stride): # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_arange(PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_stride) { PyArray_Descr *__pyx_v_descr = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("arange", 0); /* "include/arraynpy.pxi":72 * * cdef inline ndarray arange(start, stop, stride): * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<< * return PyArray_ArangeObj(start, stop, stride, descr) * */ __pyx_t_1 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_descr = ((PyArray_Descr *)__pyx_t_2); __pyx_t_2 = 0; /* "include/arraynpy.pxi":73 * cdef inline ndarray arange(start, stop, stride): * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_2 = ((PyObject *)PyArray_ArangeObj(__pyx_v_start, __pyx_v_stop, __pyx_v_stride, __pyx_v_descr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":71 * return PyArray_FROM_O(ob) * * cdef inline ndarray arange(start, stop, stride): # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * return PyArray_ArangeObj(start, stop, stride, descr) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.arange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":77 * # -------------------------------------------------------------------- * * cdef inline ndarray empty_i(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_i(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_i", 0); /* "include/arraynpy.pxi":78 * * cdef inline ndarray empty_i(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":79 * cdef inline ndarray empty_i(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_r(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_INT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":77 * # -------------------------------------------------------------------- * * cdef inline ndarray empty_i(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":81 * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * * cdef inline ndarray empty_r(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_r(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_r", 0); /* "include/arraynpy.pxi":82 * * cdef inline ndarray empty_r(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":83 * cdef inline ndarray empty_r(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_s(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_REAL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":81 * return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * * cdef inline ndarray empty_r(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":85 * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * * cdef inline ndarray empty_s(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_s(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_s", 0); /* "include/arraynpy.pxi":86 * * cdef inline ndarray empty_s(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":87 * cdef inline ndarray empty_s(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_c(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_SCALAR, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":85 * return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * * cdef inline ndarray empty_s(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":89 * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * * cdef inline ndarray empty_c(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_c(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_c", 0); /* "include/arraynpy.pxi":90 * * cdef inline ndarray empty_c(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":91 * cdef inline ndarray empty_c(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) # <<<<<<<<<<<<<< * * cdef inline ndarray empty_p(PetscInt size): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_COMPLEX, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":89 * return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * * cdef inline ndarray empty_c(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_c", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":93 * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * * cdef inline ndarray empty_p(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_p(PetscInt __pyx_v_size) { npy_intp __pyx_v_s; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("empty_p", 0); /* "include/arraynpy.pxi":94 * * cdef inline ndarray empty_p(PetscInt size): * cdef npy_intp s = size # <<<<<<<<<<<<<< * return PyArray_EMPTY(1, &s, NPY_INTP, 0) * */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":95 * cdef inline ndarray empty_p(PetscInt size): * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_INTP, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":93 * return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0) * * cdef inline ndarray empty_p(PetscInt size): # <<<<<<<<<<<<<< * cdef npy_intp s = size * return PyArray_EMPTY(1, &s, NPY_INTP, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.empty_p", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":99 * # -------------------------------------------------------------------- * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_i(PetscInt __pyx_v_size, PetscInt const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_i", 0); /* "include/arraynpy.pxi":100 * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":101 * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_INT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":102 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":103 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscInt))))); /* "include/arraynpy.pxi":102 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary */ } /* "include/arraynpy.pxi":104 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscInt)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":99 * # -------------------------------------------------------------------- * * cdef inline ndarray array_i(PetscInt size, const PetscInt* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":106 * return ary * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_r(PetscInt __pyx_v_size, PetscReal const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_r", 0); /* "include/arraynpy.pxi":107 * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":108 * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_REAL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":109 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":110 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscReal))))); /* "include/arraynpy.pxi":109 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary */ } /* "include/arraynpy.pxi":111 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscReal)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":106 * return ary * * cdef inline ndarray array_r(PetscInt size, const PetscReal* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":113 * return ary * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_b(PetscInt __pyx_v_size, PetscBool const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_b", 0); /* "include/arraynpy.pxi":114 * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":115 * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_BOOL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":116 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":117 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscBool))))); /* "include/arraynpy.pxi":116 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary */ } /* "include/arraynpy.pxi":118 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscBool)) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":113 * return ary * * cdef inline ndarray array_b(PetscInt size, const PetscBool* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_b", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":120 * return ary * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_array_s(PetscInt __pyx_v_size, PetscScalar const *__pyx_v_data) { npy_intp __pyx_v_s; PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_s", 0); /* "include/arraynpy.pxi":121 * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): * cdef npy_intp s = size # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: */ __pyx_v_s = ((npy_intp)__pyx_v_size); /* "include/arraynpy.pxi":122 * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) # <<<<<<<<<<<<<< * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) */ __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_SCALAR, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":123 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { /* "include/arraynpy.pxi":124 * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) # <<<<<<<<<<<<<< * return ary * */ (void)(memcpy(PyArray_DATA(__pyx_v_ary), __pyx_v_data, (((size_t)__pyx_v_size) * (sizeof(PetscScalar))))); /* "include/arraynpy.pxi":123 * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) * if data != NULL: # <<<<<<<<<<<<<< * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary */ } /* "include/arraynpy.pxi":125 * if data != NULL: * memcpy(PyArray_DATA(ary), data, size*sizeof(PetscScalar)) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":120 * return ary * * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data): # <<<<<<<<<<<<<< * cdef npy_intp s = size * cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.array_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":129 * # -------------------------------------------------------------------- * * cdef inline ndarray iarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray(PyObject *__pyx_v_ob, int __pyx_v_typenum) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray", 0); /* "include/arraynpy.pxi":130 * * cdef inline ndarray iarray(object ob, int typenum): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, __pyx_v_typenum, (NPY_ARRAY_ALIGNED | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":132 * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) */ __pyx_t_2 = (PyArray_ISCONTIGUOUS(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":133 * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary # <<<<<<<<<<<<<< * return PyArray_Copy(ary) * */ __pyx_t_2 = (PyArray_ISFORTRAN(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":134 * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":129 * # -------------------------------------------------------------------- * * cdef inline ndarray iarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":136 * return PyArray_Copy(ary) * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_i(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscInt **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_i", 0); /* "include/arraynpy.pxi":137 * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":138 * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":139 * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":140 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":136 * return PyArray_Copy(ary) * * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":142 * return ary * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_r(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscReal **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_r", 0); /* "include/arraynpy.pxi":143 * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":144 * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":145 * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":146 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":142 * return ary * * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":148 * return ary * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_b(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscBool **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_b", 0); /* "include/arraynpy.pxi":149 * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_BOOL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":150 * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":151 * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscBool *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":152 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":148 * return ary * * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_b", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":154 * return ary * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_iarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iarray_s", 0); /* "include/arraynpy.pxi":155 * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":156 * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":157 * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":158 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":154 * return ary * * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.iarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":162 * # -------------------------------------------------------------------- * * cdef inline ndarray oarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray(PyObject *__pyx_v_ob, int __pyx_v_typenum) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray", 0); /* "include/arraynpy.pxi":163 * * cdef inline ndarray oarray(object ob, int typenum): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, __pyx_v_typenum, ((NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE) | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":165 * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) */ __pyx_t_2 = (PyArray_ISCONTIGUOUS(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":166 * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary # <<<<<<<<<<<<<< * return PyArray_Copy(ary) * */ __pyx_t_2 = (PyArray_ISFORTRAN(__pyx_v_ary) != 0); if (__pyx_t_2) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; } /* "include/arraynpy.pxi":167 * if PyArray_ISCONTIGUOUS(ary): return ary * if PyArray_ISFORTRAN(ary): return ary * return PyArray_Copy(ary) # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "include/arraynpy.pxi":162 * # -------------------------------------------------------------------- * * cdef inline ndarray oarray(object ob, int typenum): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, typenum, NPY_ARRAY_ALIGNED|NPY_ARRAY_WRITEABLE|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":169 * return PyArray_Copy(ary) * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_i(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscInt **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_i", 0); /* "include/arraynpy.pxi":170 * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":171 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":172 * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscInt *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":173 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":169 * return PyArray_Copy(ary) * * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_INT) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_i", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":175 * return ary * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_r(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscReal **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_r", 0); /* "include/arraynpy.pxi":176 * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":177 * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":178 * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscReal *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":179 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":175 * return ary * * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_REAL) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":181 * return ary * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_s", 0); /* "include/arraynpy.pxi":182 * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":183 * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":184 * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":185 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":181 * return ary * * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":187 * return ary * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_p(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, void **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("oarray_p", 0); /* "include/arraynpy.pxi":188 * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): * cdef ndarray ary = oarray(ob, NPY_INTP) # <<<<<<<<<<<<<< * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_INTP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":189 * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":190 * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((void *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":191 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":187 * return ary * * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data): # <<<<<<<<<<<<<< * cdef ndarray ary = oarray(ob, NPY_INTP) * if size != NULL: size[0] = PyArray_SIZE(ary) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.oarray_p", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":195 * # -------------------------------------------------------------------- * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ocarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ocarray_s", 0); /* "include/arraynpy.pxi":196 * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, NPY_PETSC_SCALAR, (NPY_ARRAY_CARRAY | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":198 * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":199 * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":200 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":195 * # -------------------------------------------------------------------- * * cdef inline ndarray ocarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.ocarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "include/arraynpy.pxi":202 * return ary * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_ofarray_s(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscScalar **__pyx_v_data) { PyArrayObject *__pyx_v_ary = 0; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ofarray_s", 0); /* "include/arraynpy.pxi":203 * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): * cdef ndarray ary = PyArray_FROM_OTF( # <<<<<<<<<<<<<< * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) */ __pyx_t_1 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_ob, NPY_PETSC_SCALAR, (NPY_ARRAY_FARRAY | NPY_ARRAY_NOTSWAPPED))); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "include/arraynpy.pxi":205 * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) # <<<<<<<<<<<<<< * if data != NULL: data[0] = PyArray_DATA(ary) * return ary */ __pyx_t_2 = ((__pyx_v_size != NULL) != 0); if (__pyx_t_2) { (__pyx_v_size[0]) = ((PetscInt)PyArray_SIZE(__pyx_v_ary)); } /* "include/arraynpy.pxi":206 * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) # <<<<<<<<<<<<<< * return ary * */ __pyx_t_2 = ((__pyx_v_data != NULL) != 0); if (__pyx_t_2) { (__pyx_v_data[0]) = ((PetscScalar *)PyArray_DATA(__pyx_v_ary)); } /* "include/arraynpy.pxi":207 * if size != NULL: size[0] = PyArray_SIZE(ary) * if data != NULL: data[0] = PyArray_DATA(ary) * return ary # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ary)); __pyx_r = __pyx_v_ary; goto __pyx_L0; /* "include/arraynpy.pxi":202 * return ary * * cdef inline ndarray ofarray_s(object ob, PetscInt* size, PetscScalar** data): # <<<<<<<<<<<<<< * cdef ndarray ary = PyArray_FROM_OTF( * ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.ofarray_s", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdef.pxi":62 * * * cdef inline PetscInsertMode insertmode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_INSERT_VALUES */ static CYTHON_INLINE InsertMode __pyx_f_8petsc4py_5PETSc_insertmode(PyObject *__pyx_v_mode) { InsertMode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; InsertMode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertmode", 0); /* "PETSc/petscdef.pxi":64 * cdef inline PetscInsertMode insertmode(object mode) \ * except (-1): * if mode is None: return PETSC_INSERT_VALUES # <<<<<<<<<<<<<< * elif mode is True: return PETSC_ADD_VALUES * elif mode is False: return PETSC_INSERT_VALUES */ __pyx_t_1 = (__pyx_v_mode == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = INSERT_VALUES; goto __pyx_L0; } /* "PETSc/petscdef.pxi":65 * except (-1): * if mode is None: return PETSC_INSERT_VALUES * elif mode is True: return PETSC_ADD_VALUES # <<<<<<<<<<<<<< * elif mode is False: return PETSC_INSERT_VALUES * else: return mode */ __pyx_t_2 = (__pyx_v_mode == Py_True); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_r = ADD_VALUES; goto __pyx_L0; } /* "PETSc/petscdef.pxi":66 * if mode is None: return PETSC_INSERT_VALUES * elif mode is True: return PETSC_ADD_VALUES * elif mode is False: return PETSC_INSERT_VALUES # <<<<<<<<<<<<<< * else: return mode * */ __pyx_t_1 = (__pyx_v_mode == Py_False); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = INSERT_VALUES; goto __pyx_L0; } /* "PETSc/petscdef.pxi":67 * elif mode is True: return PETSC_ADD_VALUES * elif mode is False: return PETSC_INSERT_VALUES * else: return mode # <<<<<<<<<<<<<< * * cdef inline PetscScatterMode scattermode(object mode) \ */ /*else*/ { __pyx_t_3 = ((InsertMode)__Pyx_PyInt_As_InsertMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 67, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; } /* "PETSc/petscdef.pxi":62 * * * cdef inline PetscInsertMode insertmode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_INSERT_VALUES */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.insertmode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((InsertMode)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdef.pxi":69 * else: return mode * * cdef inline PetscScatterMode scattermode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD */ static CYTHON_INLINE ScatterMode __pyx_f_8petsc4py_5PETSc_scattermode(PyObject *__pyx_v_mode) { ScatterMode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; ScatterMode __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scattermode", 0); /* "PETSc/petscdef.pxi":71 * cdef inline PetscScatterMode scattermode(object mode) \ * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE */ __pyx_t_1 = (__pyx_v_mode == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = SCATTER_FORWARD; goto __pyx_L0; } /* "PETSc/petscdef.pxi":72 * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD * if mode is False: return PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): */ __pyx_t_2 = (__pyx_v_mode == Py_False); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_r = SCATTER_FORWARD; goto __pyx_L0; } /* "PETSc/petscdef.pxi":73 * if mode is None: return PETSC_SCATTER_FORWARD * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<< * if isinstance(mode, str): * if mode == 'forward': return PETSC_SCATTER_FORWARD */ __pyx_t_1 = (__pyx_v_mode == Py_True); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = SCATTER_REVERSE; goto __pyx_L0; } /* "PETSc/petscdef.pxi":74 * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE */ __pyx_t_2 = PyString_Check(__pyx_v_mode); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscdef.pxi":75 * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): * if mode == 'forward': return PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * if mode == 'reverse': return PETSC_SCATTER_REVERSE * else: raise ValueError("unknown scatter mode: %s" % mode) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_forward, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 75, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = SCATTER_FORWARD; goto __pyx_L0; } /* "PETSc/petscdef.pxi":76 * if isinstance(mode, str): * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<< * else: raise ValueError("unknown scatter mode: %s" % mode) * return mode */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_reverse, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 76, __pyx_L1_error) if (likely(__pyx_t_1)) { __pyx_r = SCATTER_REVERSE; goto __pyx_L0; } /* "PETSc/petscdef.pxi":77 * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE * else: raise ValueError("unknown scatter mode: %s" % mode) # <<<<<<<<<<<<<< * return mode * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_scatter_mode_s, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(2, 77, __pyx_L1_error) } /* "PETSc/petscdef.pxi":74 * if mode is False: return PETSC_SCATTER_FORWARD * if mode is True: return PETSC_SCATTER_REVERSE * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'forward': return PETSC_SCATTER_FORWARD * if mode == 'reverse': return PETSC_SCATTER_REVERSE */ } /* "PETSc/petscdef.pxi":78 * if mode == 'reverse': return PETSC_SCATTER_REVERSE * else: raise ValueError("unknown scatter mode: %s" % mode) * return mode # <<<<<<<<<<<<<< * */ __pyx_t_5 = ((ScatterMode)__Pyx_PyInt_As_ScatterMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 78, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscdef.pxi":69 * else: return mode * * cdef inline PetscScatterMode scattermode(object mode) \ # <<<<<<<<<<<<<< * except (-1): * if mode is None: return PETSC_SCATTER_FORWARD */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.scattermode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((ScatterMode)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":38 * # * * cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<< * if prefix is None: * prefix = deft */ static PyObject *__pyx_f_8petsc4py_5PETSc_getprefix(PyObject *__pyx_v_prefix, struct __pyx_opt_args_8petsc4py_5PETSc_getprefix *__pyx_optional_args) { PyObject *__pyx_v_deft = ((PyObject *)Py_None); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getprefix", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_deft = __pyx_optional_args->deft; } } __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/petscopt.pxi":39 * * cdef getprefix(prefix, deft=None): * if prefix is None: # <<<<<<<<<<<<<< * prefix = deft * elif isinstance(prefix, Options): */ __pyx_t_1 = (__pyx_v_prefix == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscopt.pxi":40 * cdef getprefix(prefix, deft=None): * if prefix is None: * prefix = deft # <<<<<<<<<<<<<< * elif isinstance(prefix, Options): * prefix = prefix.prefix */ __Pyx_INCREF(__pyx_v_deft); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_v_deft); /* "PETSc/petscopt.pxi":39 * * cdef getprefix(prefix, deft=None): * if prefix is None: # <<<<<<<<<<<<<< * prefix = deft * elif isinstance(prefix, Options): */ goto __pyx_L3; } /* "PETSc/petscopt.pxi":41 * if prefix is None: * prefix = deft * elif isinstance(prefix, Options): # <<<<<<<<<<<<<< * prefix = prefix.prefix * elif isinstance(prefix, Object): */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_prefix, __pyx_ptype_8petsc4py_5PETSc_Options); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscopt.pxi":42 * prefix = deft * elif isinstance(prefix, Options): * prefix = prefix.prefix # <<<<<<<<<<<<<< * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":41 * if prefix is None: * prefix = deft * elif isinstance(prefix, Options): # <<<<<<<<<<<<<< * prefix = prefix.prefix * elif isinstance(prefix, Object): */ goto __pyx_L3; } /* "PETSc/petscopt.pxi":43 * elif isinstance(prefix, Options): * prefix = prefix.prefix * elif isinstance(prefix, Object): # <<<<<<<<<<<<<< * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_prefix, __pyx_ptype_8petsc4py_5PETSc_Object); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscopt.pxi":44 * prefix = prefix.prefix * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() # <<<<<<<<<<<<<< * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_getOptionsPrefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":43 * elif isinstance(prefix, Options): * prefix = prefix.prefix * elif isinstance(prefix, Object): # <<<<<<<<<<<<<< * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): */ goto __pyx_L3; } /* "PETSc/petscopt.pxi":45 * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): # <<<<<<<<<<<<<< * raise TypeError('option prefix must be string') * if not prefix: */ __pyx_t_2 = PyString_Check(__pyx_v_prefix); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/petscopt.pxi":46 * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') # <<<<<<<<<<<<<< * if not prefix: * return None */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 46, __pyx_L1_error) /* "PETSc/petscopt.pxi":45 * elif isinstance(prefix, Object): * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): # <<<<<<<<<<<<<< * raise TypeError('option prefix must be string') * if not prefix: */ } __pyx_L3:; /* "PETSc/petscopt.pxi":47 * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') * if not prefix: # <<<<<<<<<<<<<< * return None * if prefix.count(' '): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 47, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "PETSc/petscopt.pxi":48 * raise TypeError('option prefix must be string') * if not prefix: * return None # <<<<<<<<<<<<<< * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscopt.pxi":47 * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') * if not prefix: # <<<<<<<<<<<<<< * return None * if prefix.count(' '): */ } /* "PETSc/petscopt.pxi":49 * if not prefix: * return None * if prefix.count(' '): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s__2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s__2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { /* "PETSc/petscopt.pxi":50 * return None * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') # <<<<<<<<<<<<<< * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hypen') */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 50, __pyx_L1_error) /* "PETSc/petscopt.pxi":49 * if not prefix: * return None * if prefix.count(' '): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): */ } /* "PETSc/petscopt.pxi":51 * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not start with a hypen') * return prefix */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s__4) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s__4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { /* "PETSc/petscopt.pxi":52 * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hypen') # <<<<<<<<<<<<<< * return prefix * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(3, 52, __pyx_L1_error) /* "PETSc/petscopt.pxi":51 * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): # <<<<<<<<<<<<<< * raise ValueError('option prefix should not start with a hypen') * return prefix */ } /* "PETSc/petscopt.pxi":53 * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hypen') * return prefix # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_prefix); __pyx_r = __pyx_v_prefix; goto __pyx_L0; /* "PETSc/petscopt.pxi":38 * # * * cdef getprefix(prefix, deft=None): # <<<<<<<<<<<<<< * if prefix is None: * prefix = deft */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.getprefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":57 * # * * cdef opt2str(const char *pre, const char *name): # <<<<<<<<<<<<<< * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) */ static PyObject *__pyx_f_8petsc4py_5PETSc_opt2str(char const *__pyx_v_pre, char const *__pyx_v_name) { PyObject *__pyx_v_p = NULL; PyObject *__pyx_v_n = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("opt2str", 0); /* "PETSc/petscopt.pxi":58 * * cdef opt2str(const char *pre, const char *name): * p = bytes2str(pre) if pre!=NULL else None # <<<<<<<<<<<<<< * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) * return '(prefix:%s, name:%s)' % (p, n) */ if (((__pyx_v_pre != NULL) != 0)) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pre); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } __pyx_v_p = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":59 * cdef opt2str(const char *pre, const char *name): * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) # <<<<<<<<<<<<<< * return '(prefix:%s, name:%s)' % (p, n) * */ if ((((__pyx_v_name[0]) != '-') != 0)) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_name[1]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_v_n = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":60 * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) * return '(prefix:%s, name:%s)' % (p, n) # <<<<<<<<<<<<<< * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_p); __Pyx_INCREF(__pyx_v_n); __Pyx_GIVEREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_n); __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_prefix_s_name_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscopt.pxi":57 * # * * cdef opt2str(const char *pre, const char *name): # <<<<<<<<<<<<<< * p = bytes2str(pre) if pre!=NULL else None * n = bytes2str(name) if name[0]!=c'-' else bytes2str(&name[1]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.opt2str", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_p); __Pyx_XDECREF(__pyx_v_n); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":62 * return '(prefix:%s, name:%s)' % (p, n) * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Bool(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscBool __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Bool", 0); /* "PETSc/petscopt.pxi":63 * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscBool value = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) */ __pyx_v_value = PETSC_FALSE; /* "PETSc/petscopt.pxi":64 * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toBool(value) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/petscopt.pxi":65 * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toBool(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetBool(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 65, __pyx_L1_error) /* "PETSc/petscopt.pxi":66 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toBool(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":67 * CHKERR( PetscOptionsGetBool(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toBool(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "PETSc/petscopt.pxi":68 * if flag==PETSC_TRUE: return toBool(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 68, __pyx_L1_error) /* "PETSc/petscopt.pxi":62 * return '(prefix:%s, name:%s)' % (p, n) * * cdef getopt_Bool(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscBool value = PETSC_FALSE * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Bool", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":70 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Int(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscInt __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Int", 0); /* "PETSc/petscopt.pxi":71 * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscInt value = 0 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) */ __pyx_v_value = 0; /* "PETSc/petscopt.pxi":72 * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toInt(value) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/petscopt.pxi":73 * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toInt(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetInt(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 73, __pyx_L1_error) /* "PETSc/petscopt.pxi":74 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toInt(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":75 * CHKERR( PetscOptionsGetInt(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toInt(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "PETSc/petscopt.pxi":76 * if flag==PETSC_TRUE: return toInt(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 76, __pyx_L1_error) /* "PETSc/petscopt.pxi":70 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscInt value = 0 * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Int", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":78 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Real(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscReal __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Real", 0); /* "PETSc/petscopt.pxi":79 * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscReal value = 0 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) */ __pyx_v_value = 0.0; /* "PETSc/petscopt.pxi":80 * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toReal(value) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/petscopt.pxi":81 * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toReal(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetReal(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 81, __pyx_L1_error) /* "PETSc/petscopt.pxi":82 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toReal(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":83 * CHKERR( PetscOptionsGetReal(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toReal(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "PETSc/petscopt.pxi":84 * if flag==PETSC_TRUE: return toReal(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 84, __pyx_L1_error) /* "PETSc/petscopt.pxi":78 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Real(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscReal value = 0 * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Real", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":86 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_Scalar(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { PetscScalar __pyx_v_value; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_Scalar", 0); /* "PETSc/petscopt.pxi":87 * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscScalar value = 0 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) */ __pyx_v_value = 0.0; /* "PETSc/petscopt.pxi":88 * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toScalar(value) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/petscopt.pxi":89 * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return toScalar(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetScalar(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, (&__pyx_v_value), (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 89, __pyx_L1_error) /* "PETSc/petscopt.pxi":90 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toScalar(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":91 * CHKERR( PetscOptionsGetScalar(opt, pre, name, &value, &flag) ) * if flag==PETSC_TRUE: return toScalar(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "PETSc/petscopt.pxi":92 * if flag==PETSC_TRUE: return toScalar(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 92, __pyx_L1_error) /* "PETSc/petscopt.pxi":86 * raise KeyError(opt2str(pre, name)) * * cdef getopt_Scalar(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef PetscScalar value = 0 * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.getopt_Scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":94 * raise KeyError(opt2str(pre, name)) * * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_String(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) { char __pyx_v_value[(0x400 + 1)]; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt_String", 0); /* "PETSc/petscopt.pxi":96 * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) * if flag==PETSC_TRUE: return bytes2str(value) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/petscopt.pxi":97 * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) # <<<<<<<<<<<<<< * if flag==PETSC_TRUE: return bytes2str(value) * if deft is not None: return deft */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_value, 0x400, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 97, __pyx_L1_error) /* "PETSc/petscopt.pxi":98 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) * if flag==PETSC_TRUE: return bytes2str(value) # <<<<<<<<<<<<<< * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) */ __pyx_t_2 = ((__pyx_v_flag == PETSC_TRUE) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":99 * CHKERR( PetscOptionsGetString(opt, pre, name, value, 1024, &flag) ) * if flag==PETSC_TRUE: return bytes2str(value) * if deft is not None: return deft # <<<<<<<<<<<<<< * raise KeyError(opt2str(pre, name)) * */ __pyx_t_2 = (__pyx_v_deft != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_deft); __pyx_r = __pyx_v_deft; goto __pyx_L0; } /* "PETSc/petscopt.pxi":100 * if flag==PETSC_TRUE: return bytes2str(value) * if deft is not None: return deft * raise KeyError(opt2str(pre, name)) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(3, 100, __pyx_L1_error) /* "PETSc/petscopt.pxi":94 * raise KeyError(opt2str(pre, name)) * * cdef getopt_String(PetscOptions opt, const char *pre, const char *name, object deft): # <<<<<<<<<<<<<< * cdef char value[1024+1] * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.getopt_String", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":110 * OPT_STRING * * cdef getpair(prefix, name, const char **pr, const char **nm): # <<<<<<<<<<<<<< * # -- * cdef const char *p = NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_getpair(PyObject *__pyx_v_prefix, PyObject *__pyx_v_name, char const **__pyx_v_pr, char const **__pyx_v_nm) { char const *__pyx_v_p; char const *__pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getpair", 0); __Pyx_INCREF(__pyx_v_prefix); __Pyx_INCREF(__pyx_v_name); /* "PETSc/petscopt.pxi":112 * cdef getpair(prefix, name, const char **pr, const char **nm): * # -- * cdef const char *p = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': */ __pyx_v_p = NULL; /* "PETSc/petscopt.pxi":113 * # -- * cdef const char *p = NULL * prefix = str2bytes(prefix, &p) # <<<<<<<<<<<<<< * if p != NULL and p[0] == c'-': * p = &p[1] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_p)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":114 * cdef const char *p = NULL * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': # <<<<<<<<<<<<<< * p = &p[1] * # -- */ __pyx_t_3 = ((__pyx_v_p != NULL) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (((__pyx_v_p[0]) == '-') != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/petscopt.pxi":115 * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': * p = &p[1] # <<<<<<<<<<<<<< * # -- * cdef const char *n = NULL */ __pyx_v_p = (&(__pyx_v_p[1])); /* "PETSc/petscopt.pxi":114 * cdef const char *p = NULL * prefix = str2bytes(prefix, &p) * if p != NULL and p[0] == c'-': # <<<<<<<<<<<<<< * p = &p[1] * # -- */ } /* "PETSc/petscopt.pxi":117 * p = &p[1] * # -- * cdef const char *n = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': */ __pyx_v_n = NULL; /* "PETSc/petscopt.pxi":118 * # -- * cdef const char *n = NULL * name = str2bytes(name, &n) # <<<<<<<<<<<<<< * if n != NULL and n[0] != c'-': * name = b'-' + name */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":119 * cdef const char *n = NULL * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': # <<<<<<<<<<<<<< * name = b'-' + name * name = str2bytes(name, &n) */ __pyx_t_3 = ((__pyx_v_n != NULL) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = (((__pyx_v_n[0]) != '-') != 0); __pyx_t_2 = __pyx_t_3; __pyx_L7_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/petscopt.pxi":120 * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': * name = b'-' + name # <<<<<<<<<<<<<< * name = str2bytes(name, &n) * # -- */ __pyx_t_1 = PyNumber_Add(__pyx_kp_b__4, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":121 * if n != NULL and n[0] != c'-': * name = b'-' + name * name = str2bytes(name, &n) # <<<<<<<<<<<<<< * # -- * pr[0] = p */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":119 * cdef const char *n = NULL * name = str2bytes(name, &n) * if n != NULL and n[0] != c'-': # <<<<<<<<<<<<<< * name = b'-' + name * name = str2bytes(name, &n) */ } /* "PETSc/petscopt.pxi":123 * name = str2bytes(name, &n) * # -- * pr[0] = p # <<<<<<<<<<<<<< * nm[0] = n * return (prefix, name) */ (__pyx_v_pr[0]) = __pyx_v_p; /* "PETSc/petscopt.pxi":124 * # -- * pr[0] = p * nm[0] = n # <<<<<<<<<<<<<< * return (prefix, name) * */ (__pyx_v_nm[0]) = __pyx_v_n; /* "PETSc/petscopt.pxi":125 * pr[0] = p * nm[0] = n * return (prefix, name) # <<<<<<<<<<<<<< * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_prefix); __Pyx_GIVEREF(__pyx_v_prefix); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix); __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscopt.pxi":110 * OPT_STRING * * cdef getpair(prefix, name, const char **pr, const char **nm): # <<<<<<<<<<<<<< * # -- * cdef const char *p = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.getpair", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":127 * return (prefix, name) * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_getopt(PetscOptions __pyx_v_opt, enum __pyx_t_8petsc4py_5PETSc_PetscOptType __pyx_v_otype, PyObject *__pyx_v_prefix, PyObject *__pyx_v_name, PyObject *__pyx_v_deft) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getopt", 0); /* "PETSc/petscopt.pxi":128 * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "PETSc/petscopt.pxi":129 * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(prefix, name, &pr, &nm) * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) */ __pyx_v_nm = NULL; /* "PETSc/petscopt.pxi":130 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_v_prefix, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tmp = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":131 * cdef const char *nm = NULL * tmp = getpair(prefix, name, &pr, &nm) * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) */ __pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_BOOL) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Bool(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":132 * tmp = getpair(prefix, name, &pr, &nm) * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) */ __pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_INT) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Int(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":133 * if otype == OPT_BOOL : return getopt_Bool (opt, pr, nm, deft) * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) * if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) */ __pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_REAL) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Real(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":134 * if otype == OPT_INT : return getopt_Int (opt, pr, nm, deft) * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) # <<<<<<<<<<<<<< * if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) * */ __pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_SCALAR) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_Scalar(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":135 * if otype == OPT_REAL : return getopt_Real (opt, pr, nm, deft) * if otype == OPT_SCALAR : return getopt_Scalar (opt, pr, nm, deft) * if otype == OPT_STRING : return getopt_String (opt, pr, nm, deft) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = ((__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_STRING) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_String(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "PETSc/petscopt.pxi":127 * return (prefix, name) * * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.getopt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":140 * # simple minded options parser * * cdef tokenize(options): # <<<<<<<<<<<<<< * cdef PetscToken t = NULL * cdef const char *s = NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_tokenize(PyObject *__pyx_v_options) { PetscToken __pyx_v_t; char const *__pyx_v_s; char const *__pyx_v_p; PyObject *__pyx_v_tokens = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tokenize", 0); __Pyx_INCREF(__pyx_v_options); /* "PETSc/petscopt.pxi":141 * * cdef tokenize(options): * cdef PetscToken t = NULL # <<<<<<<<<<<<<< * cdef const char *s = NULL * cdef const char *p = NULL */ __pyx_v_t = NULL; /* "PETSc/petscopt.pxi":142 * cdef tokenize(options): * cdef PetscToken t = NULL * cdef const char *s = NULL # <<<<<<<<<<<<<< * cdef const char *p = NULL * options = str2bytes(options, &s) */ __pyx_v_s = NULL; /* "PETSc/petscopt.pxi":143 * cdef PetscToken t = NULL * cdef const char *s = NULL * cdef const char *p = NULL # <<<<<<<<<<<<<< * options = str2bytes(options, &s) * cdef list tokens = [] */ __pyx_v_p = NULL; /* "PETSc/petscopt.pxi":144 * cdef const char *s = NULL * cdef const char *p = NULL * options = str2bytes(options, &s) # <<<<<<<<<<<<<< * cdef list tokens = [] * CHKERR( PetscTokenCreate(s, c' ', &t) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_options, (&__pyx_v_s)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_options, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":145 * cdef const char *p = NULL * options = str2bytes(options, &s) * cdef list tokens = [] # <<<<<<<<<<<<<< * CHKERR( PetscTokenCreate(s, c' ', &t) ) * try: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tokens = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":146 * options = str2bytes(options, &s) * cdef list tokens = [] * CHKERR( PetscTokenCreate(s, c' ', &t) ) # <<<<<<<<<<<<<< * try: * CHKERR( PetscTokenFind(t, &p) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenCreate(__pyx_v_s, ' ', (&__pyx_v_t))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 146, __pyx_L1_error) /* "PETSc/petscopt.pxi":147 * cdef list tokens = [] * CHKERR( PetscTokenCreate(s, c' ', &t) ) * try: # <<<<<<<<<<<<<< * CHKERR( PetscTokenFind(t, &p) ) * while p != NULL: */ /*try:*/ { /* "PETSc/petscopt.pxi":148 * CHKERR( PetscTokenCreate(s, c' ', &t) ) * try: * CHKERR( PetscTokenFind(t, &p) ) # <<<<<<<<<<<<<< * while p != NULL: * tokens.append(bytes2str(p)) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 148, __pyx_L4_error) /* "PETSc/petscopt.pxi":149 * try: * CHKERR( PetscTokenFind(t, &p) ) * while p != NULL: # <<<<<<<<<<<<<< * tokens.append(bytes2str(p)) * CHKERR( PetscTokenFind(t, &p) ) */ while (1) { __pyx_t_3 = ((__pyx_v_p != NULL) != 0); if (!__pyx_t_3) break; /* "PETSc/petscopt.pxi":150 * CHKERR( PetscTokenFind(t, &p) ) * while p != NULL: * tokens.append(bytes2str(p)) # <<<<<<<<<<<<<< * CHKERR( PetscTokenFind(t, &p) ) * finally: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 150, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_tokens, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 150, __pyx_L4_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscopt.pxi":151 * while p != NULL: * tokens.append(bytes2str(p)) * CHKERR( PetscTokenFind(t, &p) ) # <<<<<<<<<<<<<< * finally: * CHKERR( PetscTokenDestroy(&t) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 151, __pyx_L4_error) } } /* "PETSc/petscopt.pxi":153 * CHKERR( PetscTokenFind(t, &p) ) * finally: * CHKERR( PetscTokenDestroy(&t) ) # <<<<<<<<<<<<<< * return tokens * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 153, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_2 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenDestroy((&__pyx_v_t))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(3, 153, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/petscopt.pxi":154 * finally: * CHKERR( PetscTokenDestroy(&t) ) * return tokens # <<<<<<<<<<<<<< * * cdef bint iskey(key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_tokens); __pyx_r = __pyx_v_tokens; goto __pyx_L0; /* "PETSc/petscopt.pxi":140 * # simple minded options parser * * cdef tokenize(options): # <<<<<<<<<<<<<< * cdef PetscToken t = NULL * cdef const char *s = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.tokenize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tokens); __Pyx_XDECREF(__pyx_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":156 * return tokens * * cdef bint iskey(key): # <<<<<<<<<<<<<< * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE */ static int __pyx_f_8petsc4py_5PETSc_iskey(PyObject *__pyx_v_key) { char const *__pyx_v_k; PetscBool __pyx_v_b; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("iskey", 0); __Pyx_INCREF(__pyx_v_key); /* "PETSc/petscopt.pxi":157 * * cdef bint iskey(key): * cdef const char *k = NULL # <<<<<<<<<<<<<< * cdef PetscBool b = PETSC_FALSE * if key: */ __pyx_v_k = NULL; /* "PETSc/petscopt.pxi":158 * cdef bint iskey(key): * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE # <<<<<<<<<<<<<< * if key: * key = str2bytes(key, &k) */ __pyx_v_b = PETSC_FALSE; /* "PETSc/petscopt.pxi":159 * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE * if key: # <<<<<<<<<<<<<< * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 159, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/petscopt.pxi":160 * cdef PetscBool b = PETSC_FALSE * if key: * key = str2bytes(key, &k) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_key, (&__pyx_v_k)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscopt.pxi":161 * if key: * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) # <<<<<<<<<<<<<< * if b == PETSC_TRUE: * return True */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsValidKey(__pyx_v_k, (&__pyx_v_b))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 161, __pyx_L1_error) /* "PETSc/petscopt.pxi":162 * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: # <<<<<<<<<<<<<< * return True * return False */ __pyx_t_1 = ((__pyx_v_b == PETSC_TRUE) != 0); if (__pyx_t_1) { /* "PETSc/petscopt.pxi":163 * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: * return True # <<<<<<<<<<<<<< * return False * */ __pyx_r = 1; goto __pyx_L0; /* "PETSc/petscopt.pxi":162 * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) * if b == PETSC_TRUE: # <<<<<<<<<<<<<< * return True * return False */ } /* "PETSc/petscopt.pxi":159 * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE * if key: # <<<<<<<<<<<<<< * key = str2bytes(key, &k) * CHKERR( PetscOptionsValidKey(k, &b) ) */ } /* "PETSc/petscopt.pxi":164 * if b == PETSC_TRUE: * return True * return False # <<<<<<<<<<<<<< * * cdef gettok(tokens): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscopt.pxi":156 * return tokens * * cdef bint iskey(key): # <<<<<<<<<<<<<< * cdef const char *k = NULL * cdef PetscBool b = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_WriteUnraisable("petsc4py.PETSc.iskey", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":166 * return False * * cdef gettok(tokens): # <<<<<<<<<<<<<< * if tokens: * return tokens.pop(0) */ static PyObject *__pyx_f_8petsc4py_5PETSc_gettok(PyObject *__pyx_v_tokens) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gettok", 0); /* "PETSc/petscopt.pxi":167 * * cdef gettok(tokens): * if tokens: # <<<<<<<<<<<<<< * return tokens.pop(0) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_tokens); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 167, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/petscopt.pxi":168 * cdef gettok(tokens): * if tokens: * return tokens.pop(0) # <<<<<<<<<<<<<< * else: * return None */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_PopIndex(__pyx_v_tokens, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscopt.pxi":167 * * cdef gettok(tokens): * if tokens: # <<<<<<<<<<<<<< * return tokens.pop(0) * else: */ } /* "PETSc/petscopt.pxi":170 * return tokens.pop(0) * else: * return None # <<<<<<<<<<<<<< * * cdef getkey(key, prefix): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/petscopt.pxi":166 * return False * * cdef gettok(tokens): # <<<<<<<<<<<<<< * if tokens: * return tokens.pop(0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.gettok", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":172 * return None * * cdef getkey(key, prefix): # <<<<<<<<<<<<<< * if not iskey(key): * return None */ static PyObject *__pyx_f_8petsc4py_5PETSc_getkey(PyObject *__pyx_v_key, PyObject *__pyx_v_prefix) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getkey", 0); __Pyx_INCREF(__pyx_v_key); /* "PETSc/petscopt.pxi":173 * * cdef getkey(key, prefix): * if not iskey(key): # <<<<<<<<<<<<<< * return None * key = key[1:] */ __pyx_t_1 = ((!(__pyx_f_8petsc4py_5PETSc_iskey(__pyx_v_key) != 0)) != 0); if (__pyx_t_1) { /* "PETSc/petscopt.pxi":174 * cdef getkey(key, prefix): * if not iskey(key): * return None # <<<<<<<<<<<<<< * key = key[1:] * if key[0] == '-': */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscopt.pxi":173 * * cdef getkey(key, prefix): * if not iskey(key): # <<<<<<<<<<<<<< * return None * key = key[1:] */ } /* "PETSc/petscopt.pxi":175 * if not iskey(key): * return None * key = key[1:] # <<<<<<<<<<<<<< * if key[0] == '-': * key = key[1:] */ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__6, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscopt.pxi":176 * return None * key = key[1:] * if key[0] == '-': # <<<<<<<<<<<<<< * key = key[1:] * if not key.startswith(prefix): */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_key, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "PETSc/petscopt.pxi":177 * key = key[1:] * if key[0] == '-': * key = key[1:] # <<<<<<<<<<<<<< * if not key.startswith(prefix): * return None */ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_key, 1, 0, NULL, NULL, &__pyx_slice__6, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscopt.pxi":176 * return None * key = key[1:] * if key[0] == '-': # <<<<<<<<<<<<<< * key = key[1:] * if not key.startswith(prefix): */ } /* "PETSc/petscopt.pxi":178 * if key[0] == '-': * key = key[1:] * if not key.startswith(prefix): # <<<<<<<<<<<<<< * return None * return key.replace(prefix, '', 1) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_prefix); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = ((!__pyx_t_1) != 0); if (__pyx_t_5) { /* "PETSc/petscopt.pxi":179 * key = key[1:] * if not key.startswith(prefix): * return None # <<<<<<<<<<<<<< * return key.replace(prefix, '', 1) * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscopt.pxi":178 * if key[0] == '-': * key = key[1:] * if not key.startswith(prefix): # <<<<<<<<<<<<<< * return None * return key.replace(prefix, '', 1) */ } /* "PETSc/petscopt.pxi":180 * if not key.startswith(prefix): * return None * return key.replace(prefix, '', 1) # <<<<<<<<<<<<<< * * cdef parseopt(options, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_prefix, __pyx_kp_s__7, __pyx_int_1}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_prefix, __pyx_kp_s__7, __pyx_int_1}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_prefix); __Pyx_GIVEREF(__pyx_v_prefix); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_prefix); __Pyx_INCREF(__pyx_kp_s__7); __Pyx_GIVEREF(__pyx_kp_s__7); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s__7); __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_int_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscopt.pxi":172 * return None * * cdef getkey(key, prefix): # <<<<<<<<<<<<<< * if not iskey(key): * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.getkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscopt.pxi":182 * return key.replace(prefix, '', 1) * * cdef parseopt(options, prefix): # <<<<<<<<<<<<<< * if isinstance(options, str): * tokens = tokenize(options) */ static PyObject *__pyx_f_8petsc4py_5PETSc_parseopt(PyObject *__pyx_v_options, PyObject *__pyx_v_prefix) { PyObject *__pyx_v_tokens = NULL; PyObject *__pyx_v_opts = NULL; PyObject *__pyx_v_first = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_second = NULL; PyObject *__pyx_v_value = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parseopt", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/petscopt.pxi":183 * * cdef parseopt(options, prefix): * if isinstance(options, str): # <<<<<<<<<<<<<< * tokens = tokenize(options) * else: */ __pyx_t_1 = PyString_Check(__pyx_v_options); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscopt.pxi":184 * cdef parseopt(options, prefix): * if isinstance(options, str): * tokens = tokenize(options) # <<<<<<<<<<<<<< * else: * tokens = list(options) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_tokenize(__pyx_v_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tokens = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":183 * * cdef parseopt(options, prefix): * if isinstance(options, str): # <<<<<<<<<<<<<< * tokens = tokenize(options) * else: */ goto __pyx_L3; } /* "PETSc/petscopt.pxi":186 * tokens = tokenize(options) * else: * tokens = list(options) # <<<<<<<<<<<<<< * prefix = prefix or '' * # parser loop */ /*else*/ { __pyx_t_3 = PySequence_List(__pyx_v_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tokens = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L3:; /* "PETSc/petscopt.pxi":187 * else: * tokens = list(options) * prefix = prefix or '' # <<<<<<<<<<<<<< * # parser loop * opts = {} */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 187, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_prefix); __pyx_t_3 = __pyx_v_prefix; goto __pyx_L4_bool_binop_done; } __Pyx_INCREF(__pyx_kp_s__7); __pyx_t_3 = __pyx_kp_s__7; __pyx_L4_bool_binop_done:; __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":189 * prefix = prefix or '' * # parser loop * opts = {} # <<<<<<<<<<<<<< * first = gettok(tokens) * while first: */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_opts = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":190 * # parser loop * opts = {} * first = gettok(tokens) # <<<<<<<<<<<<<< * while first: * key = getkey(first, prefix) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_first = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":191 * opts = {} * first = gettok(tokens) * while first: # <<<<<<<<<<<<<< * key = getkey(first, prefix) * if not key: */ while (1) { __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_first); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 191, __pyx_L1_error) if (!__pyx_t_2) break; /* "PETSc/petscopt.pxi":192 * first = gettok(tokens) * while first: * key = getkey(first, prefix) # <<<<<<<<<<<<<< * if not key: * first = gettok(tokens) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_getkey(__pyx_v_first, __pyx_v_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":193 * while first: * key = getkey(first, prefix) * if not key: # <<<<<<<<<<<<<< * first = gettok(tokens) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 193, __pyx_L1_error) __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "PETSc/petscopt.pxi":194 * key = getkey(first, prefix) * if not key: * first = gettok(tokens) # <<<<<<<<<<<<<< * else: * second = gettok(tokens) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_first, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":193 * while first: * key = getkey(first, prefix) * if not key: # <<<<<<<<<<<<<< * first = gettok(tokens) * else: */ goto __pyx_L8; } /* "PETSc/petscopt.pxi":196 * first = gettok(tokens) * else: * second = gettok(tokens) # <<<<<<<<<<<<<< * if getkey(second, prefix): * value = None */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_second, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscopt.pxi":197 * else: * second = gettok(tokens) * if getkey(second, prefix): # <<<<<<<<<<<<<< * value = None * first = second */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_getkey(__pyx_v_second, __pyx_v_prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "PETSc/petscopt.pxi":198 * second = gettok(tokens) * if getkey(second, prefix): * value = None # <<<<<<<<<<<<<< * first = second * else: */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_value, Py_None); /* "PETSc/petscopt.pxi":199 * if getkey(second, prefix): * value = None * first = second # <<<<<<<<<<<<<< * else: * value = second */ __Pyx_INCREF(__pyx_v_second); __Pyx_DECREF_SET(__pyx_v_first, __pyx_v_second); /* "PETSc/petscopt.pxi":197 * else: * second = gettok(tokens) * if getkey(second, prefix): # <<<<<<<<<<<<<< * value = None * first = second */ goto __pyx_L9; } /* "PETSc/petscopt.pxi":201 * first = second * else: * value = second # <<<<<<<<<<<<<< * first = gettok(tokens) * opts[key] = value */ /*else*/ { __Pyx_INCREF(__pyx_v_second); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_v_second); /* "PETSc/petscopt.pxi":202 * else: * value = second * first = gettok(tokens) # <<<<<<<<<<<<<< * opts[key] = value * # we are done */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_gettok(__pyx_v_tokens); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_first, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L9:; /* "PETSc/petscopt.pxi":203 * value = second * first = gettok(tokens) * opts[key] = value # <<<<<<<<<<<<<< * # we are done * return opts */ if (unlikely(PyDict_SetItem(__pyx_v_opts, __pyx_v_key, __pyx_v_value) < 0)) __PYX_ERR(3, 203, __pyx_L1_error) } __pyx_L8:; } /* "PETSc/petscopt.pxi":205 * opts[key] = value * # we are done * return opts # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_opts); __pyx_r = __pyx_v_opts; goto __pyx_L0; /* "PETSc/petscopt.pxi":182 * return key.replace(prefix, '', 1) * * cdef parseopt(options, prefix): # <<<<<<<<<<<<<< * if isinstance(options, str): * tokens = tokenize(options) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.parseopt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tokens); __Pyx_XDECREF(__pyx_v_opts); __Pyx_XDECREF(__pyx_v_first); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_second); __Pyx_XDECREF(__pyx_v_value); __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":44 * ctypedef MPI_Op* PyMPIOpGet(object) except NULL * * cdef inline MPI_Comm mpi4py_Comm_Get(object comm) except *: # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPICommGet *commget = \ */ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(PyObject *__pyx_v_comm) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPICommGet *__pyx_v_commget; MPI_Comm *__pyx_v_ptr; MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; MPI_Comm *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Comm_Get", 0); /* "PETSc/petscmpi.pxi":45 * * cdef inline MPI_Comm mpi4py_Comm_Get(object comm) except *: * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPICommGet *commget = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmpi.pxi":47 * from mpi4py import MPI * cdef PyMPICommGet *commget = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)") * if commget == NULL: return MPI_COMM_NULL */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_Get"), ((char *)"MPI_Comm *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 47, __pyx_L1_error) __pyx_v_commget = ((__pyx_t_8petsc4py_5PETSc_PyMPICommGet *)__pyx_t_3); /* "PETSc/petscmpi.pxi":49 * Cython_ImportFunction( * MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)") * if commget == NULL: return MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef MPI_Comm *ptr = commget(comm) * if ptr == NULL: return MPI_COMM_NULL */ __pyx_t_4 = ((__pyx_v_commget == NULL) != 0); if (__pyx_t_4) { __pyx_r = MPI_COMM_NULL; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":50 * MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)") * if commget == NULL: return MPI_COMM_NULL * cdef MPI_Comm *ptr = commget(comm) # <<<<<<<<<<<<<< * if ptr == NULL: return MPI_COMM_NULL * return ptr[0] */ __pyx_t_5 = __pyx_v_commget(__pyx_v_comm); if (unlikely(__pyx_t_5 == ((MPI_Comm *)NULL))) __PYX_ERR(13, 50, __pyx_L1_error) __pyx_v_ptr = __pyx_t_5; /* "PETSc/petscmpi.pxi":51 * if commget == NULL: return MPI_COMM_NULL * cdef MPI_Comm *ptr = commget(comm) * if ptr == NULL: return MPI_COMM_NULL # <<<<<<<<<<<<<< * return ptr[0] * */ __pyx_t_4 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_4) { __pyx_r = MPI_COMM_NULL; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":52 * cdef MPI_Comm *ptr = commget(comm) * if ptr == NULL: return MPI_COMM_NULL * return ptr[0] # <<<<<<<<<<<<<< * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): */ __pyx_r = (__pyx_v_ptr[0]); goto __pyx_L0; /* "PETSc/petscmpi.pxi":44 * ctypedef MPI_Op* PyMPIOpGet(object) except NULL * * cdef inline MPI_Comm mpi4py_Comm_Get(object comm) except *: # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPICommGet *commget = \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Comm_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":54 * return ptr[0] * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPICommNew *commnew = \ */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(MPI_Comm __pyx_v_comm) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPICommNew *__pyx_v_commnew; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Comm_New", 0); /* "PETSc/petscmpi.pxi":55 * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPICommNew *commnew = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmpi.pxi":57 * from mpi4py import MPI * cdef PyMPICommNew *commnew = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)") * if commnew == NULL: return None */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_New"), ((char *)"PyObject *(MPI_Comm)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 57, __pyx_L1_error) __pyx_v_commnew = ((__pyx_t_8petsc4py_5PETSc_PyMPICommNew *)__pyx_t_3); /* "PETSc/petscmpi.pxi":59 * Cython_ImportFunction( * MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)") * if commnew == NULL: return None # <<<<<<<<<<<<<< * return commnew(comm) * */ __pyx_t_4 = ((__pyx_v_commnew == NULL) != 0); if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/petscmpi.pxi":60 * MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)") * if commnew == NULL: return None * return commnew(comm) # <<<<<<<<<<<<<< * * cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_commnew(__pyx_v_comm); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscmpi.pxi":54 * return ptr[0] * * cdef inline object mpi4py_Comm_New(MPI_Comm comm): # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPICommNew *commnew = \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Comm_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":62 * return commnew(comm) * * cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *: # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPIDatatypeGet *datatypeget = \ */ static CYTHON_INLINE MPI_Datatype __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(PyObject *__pyx_v_datatype) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet *__pyx_v_datatypeget; MPI_Datatype *__pyx_v_ptr; MPI_Datatype __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; MPI_Datatype *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Datatype_Get", 0); /* "PETSc/petscmpi.pxi":63 * * cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *: * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPIDatatypeGet *datatypeget = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmpi.pxi":65 * from mpi4py import MPI * cdef PyMPIDatatypeGet *datatypeget = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)") * if datatypeget == NULL: return MPI_DATATYPE_NULL */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIDatatype_Get"), ((char *)"MPI_Datatype *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 65, __pyx_L1_error) __pyx_v_datatypeget = ((__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet *)__pyx_t_3); /* "PETSc/petscmpi.pxi":67 * Cython_ImportFunction( * MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)") * if datatypeget == NULL: return MPI_DATATYPE_NULL # <<<<<<<<<<<<<< * cdef MPI_Datatype *ptr = datatypeget(datatype) * if ptr == NULL: return MPI_DATATYPE_NULL */ __pyx_t_4 = ((__pyx_v_datatypeget == NULL) != 0); if (__pyx_t_4) { __pyx_r = MPI_DATATYPE_NULL; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":68 * MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)") * if datatypeget == NULL: return MPI_DATATYPE_NULL * cdef MPI_Datatype *ptr = datatypeget(datatype) # <<<<<<<<<<<<<< * if ptr == NULL: return MPI_DATATYPE_NULL * return ptr[0] */ __pyx_t_5 = __pyx_v_datatypeget(__pyx_v_datatype); if (unlikely(__pyx_t_5 == ((MPI_Datatype *)NULL))) __PYX_ERR(13, 68, __pyx_L1_error) __pyx_v_ptr = __pyx_t_5; /* "PETSc/petscmpi.pxi":69 * if datatypeget == NULL: return MPI_DATATYPE_NULL * cdef MPI_Datatype *ptr = datatypeget(datatype) * if ptr == NULL: return MPI_DATATYPE_NULL # <<<<<<<<<<<<<< * return ptr[0] * */ __pyx_t_4 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_4) { __pyx_r = MPI_DATATYPE_NULL; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":70 * cdef MPI_Datatype *ptr = datatypeget(datatype) * if ptr == NULL: return MPI_DATATYPE_NULL * return ptr[0] # <<<<<<<<<<<<<< * * cdef inline MPI_Op mpi4py_Op_Get(object op) except *: */ __pyx_r = (__pyx_v_ptr[0]); goto __pyx_L0; /* "PETSc/petscmpi.pxi":62 * return commnew(comm) * * cdef inline MPI_Datatype mpi4py_Datatype_Get(object datatype) except *: # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPIDatatypeGet *datatypeget = \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Datatype_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":72 * return ptr[0] * * cdef inline MPI_Op mpi4py_Op_Get(object op) except *: # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPIOpGet *opget = \ */ static CYTHON_INLINE MPI_Op __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(PyObject *__pyx_v_op) { PyObject *__pyx_v_MPI = NULL; __pyx_t_8petsc4py_5PETSc_PyMPIOpGet *__pyx_v_opget; MPI_Op *__pyx_v_ptr; MPI_Op __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; void *__pyx_t_3; int __pyx_t_4; MPI_Op *__pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mpi4py_Op_Get", 0); /* "PETSc/petscmpi.pxi":73 * * cdef inline MPI_Op mpi4py_Op_Get(object op) except *: * from mpi4py import MPI # <<<<<<<<<<<<<< * cdef PyMPIOpGet *opget = \ * Cython_ImportFunction( */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_MPI); __Pyx_GIVEREF(__pyx_n_s_MPI); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI); __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_1); __pyx_v_MPI = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmpi.pxi":75 * from mpi4py import MPI * cdef PyMPIOpGet *opget = \ * Cython_ImportFunction( # <<<<<<<<<<<<<< * MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)") * if opget == NULL: return MPI_OP_NULL */ __pyx_t_3 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIOp_Get"), ((char *)"MPI_Op *(PyObject *)")); if (unlikely(__pyx_t_3 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(13, 75, __pyx_L1_error) __pyx_v_opget = ((__pyx_t_8petsc4py_5PETSc_PyMPIOpGet *)__pyx_t_3); /* "PETSc/petscmpi.pxi":77 * Cython_ImportFunction( * MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)") * if opget == NULL: return MPI_OP_NULL # <<<<<<<<<<<<<< * cdef MPI_Op *ptr = opget(op) * if ptr == NULL: return MPI_OP_NULL */ __pyx_t_4 = ((__pyx_v_opget == NULL) != 0); if (__pyx_t_4) { __pyx_r = MPI_OP_NULL; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":78 * MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)") * if opget == NULL: return MPI_OP_NULL * cdef MPI_Op *ptr = opget(op) # <<<<<<<<<<<<<< * if ptr == NULL: return MPI_OP_NULL * return ptr[0] */ __pyx_t_5 = __pyx_v_opget(__pyx_v_op); if (unlikely(__pyx_t_5 == ((MPI_Op *)NULL))) __PYX_ERR(13, 78, __pyx_L1_error) __pyx_v_ptr = __pyx_t_5; /* "PETSc/petscmpi.pxi":79 * if opget == NULL: return MPI_OP_NULL * cdef MPI_Op *ptr = opget(op) * if ptr == NULL: return MPI_OP_NULL # <<<<<<<<<<<<<< * return ptr[0] * */ __pyx_t_4 = ((__pyx_v_ptr == NULL) != 0); if (__pyx_t_4) { __pyx_r = MPI_OP_NULL; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":80 * cdef MPI_Op *ptr = opget(op) * if ptr == NULL: return MPI_OP_NULL * return ptr[0] # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = (__pyx_v_ptr[0]); goto __pyx_L0; /* "PETSc/petscmpi.pxi":72 * return ptr[0] * * cdef inline MPI_Op mpi4py_Op_Get(object op) except *: # <<<<<<<<<<<<<< * from mpi4py import MPI * cdef PyMPIOpGet *opget = \ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mpi4py_Op_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_MPI); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":84 * # -------------------------------------------------------------------- * * cdef inline int PetscCommDEALLOC(MPI_Comm* comm): # <<<<<<<<<<<<<< * if comm == NULL: return 0 * cdef MPI_Comm tmp = comm[0] */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC(MPI_Comm *__pyx_v_comm) { MPI_Comm __pyx_v_tmp; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("PetscCommDEALLOC", 0); /* "PETSc/petscmpi.pxi":85 * * cdef inline int PetscCommDEALLOC(MPI_Comm* comm): * if comm == NULL: return 0 # <<<<<<<<<<<<<< * cdef MPI_Comm tmp = comm[0] * if tmp == MPI_COMM_NULL: return 0 */ __pyx_t_1 = ((__pyx_v_comm == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":86 * cdef inline int PetscCommDEALLOC(MPI_Comm* comm): * if comm == NULL: return 0 * cdef MPI_Comm tmp = comm[0] # <<<<<<<<<<<<<< * if tmp == MPI_COMM_NULL: return 0 * comm[0] = MPI_COMM_NULL */ __pyx_v_tmp = (__pyx_v_comm[0]); /* "PETSc/petscmpi.pxi":87 * if comm == NULL: return 0 * cdef MPI_Comm tmp = comm[0] * if tmp == MPI_COMM_NULL: return 0 # <<<<<<<<<<<<<< * comm[0] = MPI_COMM_NULL * if not (PetscInitializeCalled): return 0 */ __pyx_t_1 = ((__pyx_v_tmp == MPI_COMM_NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":88 * cdef MPI_Comm tmp = comm[0] * if tmp == MPI_COMM_NULL: return 0 * comm[0] = MPI_COMM_NULL # <<<<<<<<<<<<<< * if not (PetscInitializeCalled): return 0 * if (PetscFinalizeCalled): return 0 */ (__pyx_v_comm[0]) = MPI_COMM_NULL; /* "PETSc/petscmpi.pxi":89 * if tmp == MPI_COMM_NULL: return 0 * comm[0] = MPI_COMM_NULL * if not (PetscInitializeCalled): return 0 # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return 0 * return PetscCommDestroy(&tmp) */ __pyx_t_1 = ((!(((int)PetscInitializeCalled) != 0)) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":90 * comm[0] = MPI_COMM_NULL * if not (PetscInitializeCalled): return 0 * if (PetscFinalizeCalled): return 0 # <<<<<<<<<<<<<< * return PetscCommDestroy(&tmp) * */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscmpi.pxi":91 * if not (PetscInitializeCalled): return 0 * if (PetscFinalizeCalled): return 0 * return PetscCommDestroy(&tmp) # <<<<<<<<<<<<<< * * cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: */ __pyx_r = PetscCommDestroy((&__pyx_v_tmp)); goto __pyx_L0; /* "PETSc/petscmpi.pxi":84 * # -------------------------------------------------------------------- * * cdef inline int PetscCommDEALLOC(MPI_Comm* comm): # <<<<<<<<<<<<<< * if comm == NULL: return 0 * cdef MPI_Comm tmp = comm[0] */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":93 * return PetscCommDestroy(&tmp) * * cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<< * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: */ static CYTHON_INLINE MPI_Comm __pyx_f_8petsc4py_5PETSc_def_Comm(PyObject *__pyx_v_comm, MPI_Comm __pyx_v_defv) { MPI_Comm __pyx_v_retv; MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; MPI_Comm __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("def_Comm", 0); /* "PETSc/petscmpi.pxi":94 * * cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: * cdef MPI_Comm retv = MPI_COMM_NULL # <<<<<<<<<<<<<< * if comm is None: * retv = defv */ __pyx_v_retv = MPI_COMM_NULL; /* "PETSc/petscmpi.pxi":95 * cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * retv = defv * elif isinstance(comm, Comm): */ __pyx_t_1 = (__pyx_v_comm == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmpi.pxi":96 * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: * retv = defv # <<<<<<<<<<<<<< * elif isinstance(comm, Comm): * retv = (comm).comm */ __pyx_v_retv = __pyx_v_defv; /* "PETSc/petscmpi.pxi":95 * cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: # <<<<<<<<<<<<<< * retv = defv * elif isinstance(comm, Comm): */ goto __pyx_L3; } /* "PETSc/petscmpi.pxi":97 * if comm is None: * retv = defv * elif isinstance(comm, Comm): # <<<<<<<<<<<<<< * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_comm, __pyx_ptype_8petsc4py_5PETSc_Comm); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscmpi.pxi":98 * retv = defv * elif isinstance(comm, Comm): * retv = (comm).comm # <<<<<<<<<<<<<< * elif type(comm).__module__ == 'mpi4py.MPI': * retv = mpi4py_Comm_Get(comm) */ __pyx_t_3 = ((struct PyPetscCommObject *)__pyx_v_comm)->comm; __pyx_v_retv = __pyx_t_3; /* "PETSc/petscmpi.pxi":97 * if comm is None: * retv = defv * elif isinstance(comm, Comm): # <<<<<<<<<<<<<< * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': */ goto __pyx_L3; } /* "PETSc/petscmpi.pxi":99 * elif isinstance(comm, Comm): * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': # <<<<<<<<<<<<<< * retv = mpi4py_Comm_Get(comm) * else: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_comm)), __pyx_n_s_module); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_mpi4py_MPI, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(13, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "PETSc/petscmpi.pxi":100 * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': * retv = mpi4py_Comm_Get(comm) # <<<<<<<<<<<<<< * else: * retv = (comm).comm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(__pyx_v_comm); if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 100, __pyx_L1_error) __pyx_v_retv = __pyx_t_3; /* "PETSc/petscmpi.pxi":99 * elif isinstance(comm, Comm): * retv = (comm).comm * elif type(comm).__module__ == 'mpi4py.MPI': # <<<<<<<<<<<<<< * retv = mpi4py_Comm_Get(comm) * else: */ goto __pyx_L3; } /* "PETSc/petscmpi.pxi":102 * retv = mpi4py_Comm_Get(comm) * else: * retv = (comm).comm # <<<<<<<<<<<<<< * return retv * */ /*else*/ { if (!(likely(__Pyx_TypeTest(__pyx_v_comm, __pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(13, 102, __pyx_L1_error) __pyx_t_3 = ((struct PyPetscCommObject *)__pyx_v_comm)->comm; __pyx_v_retv = __pyx_t_3; } __pyx_L3:; /* "PETSc/petscmpi.pxi":103 * else: * retv = (comm).comm * return retv # <<<<<<<<<<<<<< * * cdef inline Comm new_Comm(MPI_Comm comm): */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/petscmpi.pxi":93 * return PetscCommDestroy(&tmp) * * cdef inline MPI_Comm def_Comm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<< * cdef MPI_Comm retv = MPI_COMM_NULL * if comm is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.def_Comm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":105 * return retv * * cdef inline Comm new_Comm(MPI_Comm comm): # <<<<<<<<<<<<<< * cdef Comm ob = Comm() * ob.comm = comm */ static CYTHON_INLINE struct PyPetscCommObject *__pyx_f_8petsc4py_5PETSc_new_Comm(MPI_Comm __pyx_v_comm) { struct PyPetscCommObject *__pyx_v_ob = 0; struct PyPetscCommObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_Comm", 0); /* "PETSc/petscmpi.pxi":106 * * cdef inline Comm new_Comm(MPI_Comm comm): * cdef Comm ob = Comm() # <<<<<<<<<<<<<< * ob.comm = comm * return ob */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmpi.pxi":107 * cdef inline Comm new_Comm(MPI_Comm comm): * cdef Comm ob = Comm() * ob.comm = comm # <<<<<<<<<<<<<< * return ob * */ __pyx_v_ob->comm = __pyx_v_comm; /* "PETSc/petscmpi.pxi":108 * cdef Comm ob = Comm() * ob.comm = comm * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscmpi.pxi":105 * return retv * * cdef inline Comm new_Comm(MPI_Comm comm): # <<<<<<<<<<<<<< * cdef Comm ob = Comm() * ob.comm = comm */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.new_Comm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":112 * # -------------------------------------------------------------------- * * cdef inline int comm_size(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_size(MPI_Comm __pyx_v_comm) { int __pyx_v_size; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("comm_size", 0); /* "PETSc/petscmpi.pxi":113 * * cdef inline int comm_size(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = ((__pyx_v_comm == MPI_COMM_NULL) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(13, 113, __pyx_L1_error) } /* "PETSc/petscmpi.pxi":114 * cdef inline int comm_size(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return size */ __pyx_v_size = 0; /* "PETSc/petscmpi.pxi":115 * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return size * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 115, __pyx_L1_error) /* "PETSc/petscmpi.pxi":116 * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) * return size # <<<<<<<<<<<<<< * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "PETSc/petscmpi.pxi":112 * # -------------------------------------------------------------------- * * cdef inline int comm_size(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int size = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.comm_size", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmpi.pxi":118 * return size * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_comm_rank(MPI_Comm __pyx_v_comm) { int __pyx_v_rank; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("comm_rank", 0); /* "PETSc/petscmpi.pxi":119 * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int rank = 0 * CHKERR( MPI_Comm_rank(comm, &rank) ) */ __pyx_t_1 = ((__pyx_v_comm == MPI_COMM_NULL) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(13, 119, __pyx_L1_error) } /* "PETSc/petscmpi.pxi":120 * cdef inline int comm_rank(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_rank(comm, &rank) ) * return rank */ __pyx_v_rank = 0; /* "PETSc/petscmpi.pxi":121 * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 * CHKERR( MPI_Comm_rank(comm, &rank) ) # <<<<<<<<<<<<<< * return rank * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MPI_Comm_rank(__pyx_v_comm, (&__pyx_v_rank))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(13, 121, __pyx_L1_error) /* "PETSc/petscmpi.pxi":122 * cdef int rank = 0 * CHKERR( MPI_Comm_rank(comm, &rank) ) * return rank # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_v_rank; goto __pyx_L0; /* "PETSc/petscmpi.pxi":118 * return size * * cdef inline int comm_rank(MPI_Comm comm) except ? -1: # <<<<<<<<<<<<<< * if comm == MPI_COMM_NULL: raise ValueError("null communicator") * cdef int rank = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.comm_rank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscsys.pxi":58 * * * cdef inline int Sys_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *_b, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Sys_Sizes(PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PetscInt *__pyx_v__b, PetscInt *__pyx_v__n, PetscInt *__pyx_v__N) { PetscInt __pyx_v_bs; PetscInt __pyx_v_b; PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_v_on = 0; PyObject *__pyx_v_oN = 0; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Sys_Sizes", 0); /* "PETSc/petscsys.pxi":65 * ) except -1: * # get block size * cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE # <<<<<<<<<<<<<< * if bsize is not None: bs = b = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_v_bs = PETSC_DECIDE; __pyx_v_b = PETSC_DECIDE; /* "PETSc/petscsys.pxi":66 * # get block size * cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE * if bsize is not None: bs = b = asInt(bsize) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * # unpack and get local and global sizes */ __pyx_t_1 = (__pyx_v_bsize != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(14, 66, __pyx_L1_error) __pyx_v_bs = __pyx_t_3; __pyx_v_b = __pyx_t_3; } /* "PETSc/petscsys.pxi":67 * cdef PetscInt bs=PETSC_DECIDE, b=PETSC_DECIDE * if bsize is not None: bs = b = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * # unpack and get local and global sizes * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE */ __pyx_t_2 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_2) { __pyx_v_bs = 1; } /* "PETSc/petscsys.pxi":69 * if bs == PETSC_DECIDE: bs = 1 * # unpack and get local and global sizes * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object on, oN * try: */ __pyx_v_n = PETSC_DECIDE; __pyx_v_N = PETSC_DECIDE; /* "PETSc/petscsys.pxi":71 * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE * cdef object on, oN * try: # <<<<<<<<<<<<<< * on, oN = size * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "PETSc/petscsys.pxi":72 * cdef object on, oN * try: * on, oN = size # <<<<<<<<<<<<<< * except (TypeError, ValueError): * on = None; oN = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(14, 72, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 72, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 72, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 72, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(14, 72, __pyx_L5_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(14, 72, __pyx_L5_error) __pyx_L12_unpacking_done:; } __pyx_v_on = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_oN = __pyx_t_8; __pyx_t_8 = 0; /* "PETSc/petscsys.pxi":71 * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE * cdef object on, oN * try: # <<<<<<<<<<<<<< * on, oN = size * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscsys.pxi":73 * try: * on, oN = size * except (TypeError, ValueError): # <<<<<<<<<<<<<< * on = None; oN = size * if on is not None: n = asInt(on) */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("petsc4py.PETSc.Sys_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(14, 73, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_9); /* "PETSc/petscsys.pxi":74 * on, oN = size * except (TypeError, ValueError): * on = None; oN = size # <<<<<<<<<<<<<< * if on is not None: n = asInt(on) * if oN is not None: N = asInt(oN) */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_on, Py_None); __Pyx_INCREF(__pyx_v_size); __Pyx_XDECREF_SET(__pyx_v_oN, __pyx_v_size); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_exception_handled; } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "PETSc/petscsys.pxi":71 * cdef PetscInt n=PETSC_DECIDE, N=PETSC_DECIDE * cdef object on, oN * try: # <<<<<<<<<<<<<< * on, oN = size * except (TypeError, ValueError): */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L10_try_end:; } /* "PETSc/petscsys.pxi":75 * except (TypeError, ValueError): * on = None; oN = size * if on is not None: n = asInt(on) # <<<<<<<<<<<<<< * if oN is not None: N = asInt(oN) * # check block, local, and and global sizes */ __pyx_t_2 = (__pyx_v_on != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_on); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(14, 75, __pyx_L1_error) __pyx_v_n = __pyx_t_3; } /* "PETSc/petscsys.pxi":76 * on = None; oN = size * if on is not None: n = asInt(on) * if oN is not None: N = asInt(oN) # <<<<<<<<<<<<<< * # check block, local, and and global sizes * if (bs < 1): raise ValueError( */ __pyx_t_1 = (__pyx_v_oN != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_oN); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(14, 76, __pyx_L1_error) __pyx_v_N = __pyx_t_3; } /* "PETSc/petscsys.pxi":78 * if oN is not None: N = asInt(oN) * # check block, local, and and global sizes * if (bs < 1): raise ValueError( # <<<<<<<<<<<<<< * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( */ __pyx_t_2 = ((__pyx_v_bs < 1) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/petscsys.pxi":79 * # check block, local, and and global sizes * if (bs < 1): raise ValueError( * "block size %d must be positive" % toInt(bs)) # <<<<<<<<<<<<<< * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( * "local and global sizes cannot be both 'DECIDE'") */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_block_size_d_must_be_positive, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscsys.pxi":78 * if oN is not None: N = asInt(oN) * # check block, local, and and global sizes * if (bs < 1): raise ValueError( # <<<<<<<<<<<<<< * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(14, 78, __pyx_L1_error) } /* "PETSc/petscsys.pxi":80 * if (bs < 1): raise ValueError( * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( # <<<<<<<<<<<<<< * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( */ __pyx_t_1 = ((__pyx_v_n == PETSC_DECIDE) != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L19_bool_binop_done; } __pyx_t_1 = ((__pyx_v_N == PETSC_DECIDE) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L19_bool_binop_done:; if (unlikely(__pyx_t_2)) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(14, 80, __pyx_L1_error) } /* "PETSc/petscsys.pxi":82 * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( # <<<<<<<<<<<<<< * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) */ __pyx_t_1 = ((__pyx_v_n > 0) != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L22_bool_binop_done; } __pyx_t_1 = ((__pyx_v_n % __pyx_v_bs) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L22_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "PETSc/petscsys.pxi":84 * if (n > 0) and (n % bs): raise ValueError( * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) # <<<<<<<<<<<<<< * if (N > 0) and (N % bs): raise ValueError( * "global size %d not divisible by block size %d" % */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_9 = 0; __pyx_t_7 = 0; /* "PETSc/petscsys.pxi":83 * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( * "local size %d not divisible by block size %d" % # <<<<<<<<<<<<<< * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( */ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_local_size_d_not_divisible_by_bl, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscsys.pxi":82 * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( # <<<<<<<<<<<<<< * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(14, 82, __pyx_L1_error) } /* "PETSc/petscsys.pxi":85 * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( # <<<<<<<<<<<<<< * "global size %d not divisible by block size %d" % * (toInt(N), toInt(bs)) ) */ __pyx_t_1 = ((__pyx_v_N > 0) != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L25_bool_binop_done; } __pyx_t_1 = ((__pyx_v_N % __pyx_v_bs) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L25_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "PETSc/petscsys.pxi":87 * if (N > 0) and (N % bs): raise ValueError( * "global size %d not divisible by block size %d" % * (toInt(N), toInt(bs)) ) # <<<<<<<<<<<<<< * # return result to the caller * if _b != NULL: _b[0] = b */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); __pyx_t_8 = 0; __pyx_t_7 = 0; /* "PETSc/petscsys.pxi":86 * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( * "global size %d not divisible by block size %d" % # <<<<<<<<<<<<<< * (toInt(N), toInt(bs)) ) * # return result to the caller */ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_global_size_d_not_divisible_by_b, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscsys.pxi":85 * "local size %d not divisible by block size %d" % * (toInt(n), toInt(bs)) ) * if (N > 0) and (N % bs): raise ValueError( # <<<<<<<<<<<<<< * "global size %d not divisible by block size %d" % * (toInt(N), toInt(bs)) ) */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(14, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(14, 85, __pyx_L1_error) } /* "PETSc/petscsys.pxi":89 * (toInt(N), toInt(bs)) ) * # return result to the caller * if _b != NULL: _b[0] = b # <<<<<<<<<<<<<< * if _n != NULL: _n[0] = n * if _N != NULL: _N[0] = N */ __pyx_t_2 = ((__pyx_v__b != NULL) != 0); if (__pyx_t_2) { (__pyx_v__b[0]) = __pyx_v_b; } /* "PETSc/petscsys.pxi":90 * # return result to the caller * if _b != NULL: _b[0] = b * if _n != NULL: _n[0] = n # <<<<<<<<<<<<<< * if _N != NULL: _N[0] = N * return 0 */ __pyx_t_2 = ((__pyx_v__n != NULL) != 0); if (__pyx_t_2) { (__pyx_v__n[0]) = __pyx_v_n; } /* "PETSc/petscsys.pxi":91 * if _b != NULL: _b[0] = b * if _n != NULL: _n[0] = n * if _N != NULL: _N[0] = N # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = ((__pyx_v__N != NULL) != 0); if (__pyx_t_2) { (__pyx_v__N[0]) = __pyx_v_N; } /* "PETSc/petscsys.pxi":92 * if _n != NULL: _n[0] = n * if _N != NULL: _N[0] = N * return 0 # <<<<<<<<<<<<<< * * cdef inline int Sys_Layout( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsys.pxi":58 * * * cdef inline int Sys_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *_b, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Sys_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_on); __Pyx_XDECREF(__pyx_v_oN); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscsys.pxi":94 * return 0 * * cdef inline int Sys_Layout( # <<<<<<<<<<<<<< * MPI_Comm comm, * PetscInt bs, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Sys_Layout(MPI_Comm __pyx_v_comm, PetscInt __pyx_v_bs, PetscInt *__pyx_v__n, PetscInt *__pyx_v__N) { PetscInt __pyx_v_n; PetscInt __pyx_v_N; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Sys_Layout", 0); /* "PETSc/petscsys.pxi":100 * PetscInt *_N, * ) except -1: * cdef PetscInt n = _n[0] # <<<<<<<<<<<<<< * cdef PetscInt N = _N[0] * if bs < 0: bs = 1 */ __pyx_v_n = (__pyx_v__n[0]); /* "PETSc/petscsys.pxi":101 * ) except -1: * cdef PetscInt n = _n[0] * cdef PetscInt N = _N[0] # <<<<<<<<<<<<<< * if bs < 0: bs = 1 * if n > 0: n = n // bs */ __pyx_v_N = (__pyx_v__N[0]); /* "PETSc/petscsys.pxi":102 * cdef PetscInt n = _n[0] * cdef PetscInt N = _N[0] * if bs < 0: bs = 1 # <<<<<<<<<<<<<< * if n > 0: n = n // bs * if N > 0: N = N // bs */ __pyx_t_1 = ((__pyx_v_bs < 0) != 0); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "PETSc/petscsys.pxi":103 * cdef PetscInt N = _N[0] * if bs < 0: bs = 1 * if n > 0: n = n // bs # <<<<<<<<<<<<<< * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(comm, &n, &N) ) */ __pyx_t_1 = ((__pyx_v_n > 0) != 0); if (__pyx_t_1) { __pyx_v_n = (__pyx_v_n / __pyx_v_bs); } /* "PETSc/petscsys.pxi":104 * if bs < 0: bs = 1 * if n > 0: n = n // bs * if N > 0: N = N // bs # <<<<<<<<<<<<<< * CHKERR( PetscSplitOwnership(comm, &n, &N) ) * _n[0] = n * bs */ __pyx_t_1 = ((__pyx_v_N > 0) != 0); if (__pyx_t_1) { __pyx_v_N = (__pyx_v_N / __pyx_v_bs); } /* "PETSc/petscsys.pxi":105 * if n > 0: n = n // bs * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(comm, &n, &N) ) # <<<<<<<<<<<<<< * _n[0] = n * bs * _N[0] = N * bs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSplitOwnership(__pyx_v_comm, (&__pyx_v_n), (&__pyx_v_N))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(14, 105, __pyx_L1_error) /* "PETSc/petscsys.pxi":106 * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(comm, &n, &N) ) * _n[0] = n * bs # <<<<<<<<<<<<<< * _N[0] = N * bs * return 0 */ (__pyx_v__n[0]) = (__pyx_v_n * __pyx_v_bs); /* "PETSc/petscsys.pxi":107 * CHKERR( PetscSplitOwnership(comm, &n, &N) ) * _n[0] = n * bs * _N[0] = N * bs # <<<<<<<<<<<<<< * return 0 */ (__pyx_v__N[0]) = (__pyx_v_N * __pyx_v_bs); /* "PETSc/petscsys.pxi":108 * _n[0] = n * bs * _N[0] = N * bs * return 0 # <<<<<<<<<<<<<< */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsys.pxi":94 * return 0 * * cdef inline int Sys_Layout( # <<<<<<<<<<<<<< * MPI_Comm comm, * PetscInt bs, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys_Layout", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petsclog.pxi":59 * * * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: # <<<<<<<<<<<<<< * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_event_args2objs(PyObject *__pyx_v_args, PetscObject *__pyx_v_o) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; struct PyPetscObjectObject *__pyx_v_tmp = 0; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("event_args2objs", 0); /* "PETSc/petsclog.pxi":60 * * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: * o[0] = o[1] = o[2] = o[3] = NULL # <<<<<<<<<<<<<< * cdef Py_ssize_t i=0, n = len(args) * cdef Object tmp = None */ (__pyx_v_o[0]) = NULL; (__pyx_v_o[1]) = NULL; (__pyx_v_o[2]) = NULL; (__pyx_v_o[3]) = NULL; /* "PETSc/petsclog.pxi":61 * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) # <<<<<<<<<<<<<< * cdef Object tmp = None * if n > 4: n = 4 */ __pyx_v_i = 0; __pyx_t_1 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(15, 61, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "PETSc/petsclog.pxi":62 * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) * cdef Object tmp = None # <<<<<<<<<<<<<< * if n > 4: n = 4 * for 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_tmp = ((struct PyPetscObjectObject *)Py_None); /* "PETSc/petsclog.pxi":63 * cdef Py_ssize_t i=0, n = len(args) * cdef Object tmp = None * if n > 4: n = 4 # <<<<<<<<<<<<<< * for 0 <= i < n: * tmp = args[i] */ __pyx_t_2 = ((__pyx_v_n > 4) != 0); if (__pyx_t_2) { __pyx_v_n = 4; } /* "PETSc/petsclog.pxi":64 * cdef Object tmp = None * if n > 4: n = 4 * for 0 <= i < n: # <<<<<<<<<<<<<< * tmp = args[i] * if tmp is not None: */ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { /* "PETSc/petsclog.pxi":65 * if n > 4: n = 4 * for 0 <= i < n: * tmp = args[i] # <<<<<<<<<<<<<< * if tmp is not None: * o[i] = tmp.obj[0] */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(15, 65, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_tmp, ((struct PyPetscObjectObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/petsclog.pxi":66 * for 0 <= i < n: * tmp = args[i] * if tmp is not None: # <<<<<<<<<<<<<< * o[i] = tmp.obj[0] * return 0 */ __pyx_t_2 = (((PyObject *)__pyx_v_tmp) != Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "PETSc/petsclog.pxi":67 * tmp = args[i] * if tmp is not None: * o[i] = tmp.obj[0] # <<<<<<<<<<<<<< * return 0 */ (__pyx_v_o[__pyx_v_i]) = (__pyx_v_tmp->obj[0]); /* "PETSc/petsclog.pxi":66 * for 0 <= i < n: * tmp = args[i] * if tmp is not None: # <<<<<<<<<<<<<< * o[i] = tmp.obj[0] * return 0 */ } } /* "PETSc/petsclog.pxi":68 * if tmp is not None: * o[i] = tmp.obj[0] * return 0 # <<<<<<<<<<<<<< */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsclog.pxi":59 * * * cdef inline int event_args2objs(object args, PetscObject o[4]) except -1: # <<<<<<<<<<<<<< * o[0] = o[1] = o[2] = o[3] = NULL * cdef Py_ssize_t i=0, n = len(args) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.event_args2objs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tmp); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscobj.pxi":38 * # -------------------------------------------------------------------- * * cdef inline int PetscINCREF(PetscObject *obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscINCREF(PetscObject *__pyx_v_obj) { int __pyx_r; int __pyx_t_1; /* "PETSc/petscobj.pxi":39 * * cdef inline int PetscINCREF(PetscObject *obj) nogil: * if obj == NULL: return 0 # <<<<<<<<<<<<<< * if obj[0] == NULL: return 0 * return PetscObjectReference(obj[0]) */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":40 * cdef inline int PetscINCREF(PetscObject *obj) nogil: * if obj == NULL: return 0 * if obj[0] == NULL: return 0 # <<<<<<<<<<<<<< * return PetscObjectReference(obj[0]) * */ __pyx_t_1 = (((__pyx_v_obj[0]) == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":41 * if obj == NULL: return 0 * if obj[0] == NULL: return 0 * return PetscObjectReference(obj[0]) # <<<<<<<<<<<<<< * * cdef inline int PetscCLEAR(PetscObject* obj) nogil: */ __pyx_r = PetscObjectReference((__pyx_v_obj[0])); goto __pyx_L0; /* "PETSc/petscobj.pxi":38 * # -------------------------------------------------------------------- * * cdef inline int PetscINCREF(PetscObject *obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/petscobj.pxi":43 * return PetscObjectReference(obj[0]) * * cdef inline int PetscCLEAR(PetscObject* obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscCLEAR(PetscObject *__pyx_v_obj) { PetscObject __pyx_v_tmp; int __pyx_r; int __pyx_t_1; /* "PETSc/petscobj.pxi":44 * * cdef inline int PetscCLEAR(PetscObject* obj) nogil: * if obj == NULL: return 0 # <<<<<<<<<<<<<< * if obj[0] == NULL: return 0 * cdef PetscObject tmp */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":45 * cdef inline int PetscCLEAR(PetscObject* obj) nogil: * if obj == NULL: return 0 * if obj[0] == NULL: return 0 # <<<<<<<<<<<<<< * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL */ __pyx_t_1 = (((__pyx_v_obj[0]) == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":47 * if obj[0] == NULL: return 0 * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL # <<<<<<<<<<<<<< * return PetscObjectDestroy(&tmp) * */ __pyx_v_tmp = (__pyx_v_obj[0]); (__pyx_v_obj[0]) = NULL; /* "PETSc/petscobj.pxi":48 * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL * return PetscObjectDestroy(&tmp) # <<<<<<<<<<<<<< * * cdef inline int PetscDEALLOC(PetscObject* obj) nogil: */ __pyx_r = PetscObjectDestroy((&__pyx_v_tmp)); goto __pyx_L0; /* "PETSc/petscobj.pxi":43 * return PetscObjectReference(obj[0]) * * cdef inline int PetscCLEAR(PetscObject* obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/petscobj.pxi":50 * return PetscObjectDestroy(&tmp) * * cdef inline int PetscDEALLOC(PetscObject* obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscDEALLOC(PetscObject *__pyx_v_obj) { PetscObject __pyx_v_tmp; int __pyx_r; int __pyx_t_1; /* "PETSc/petscobj.pxi":51 * * cdef inline int PetscDEALLOC(PetscObject* obj) nogil: * if obj == NULL: return 0 # <<<<<<<<<<<<<< * if obj[0] == NULL: return 0 * cdef PetscObject tmp */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":52 * cdef inline int PetscDEALLOC(PetscObject* obj) nogil: * if obj == NULL: return 0 * if obj[0] == NULL: return 0 # <<<<<<<<<<<<<< * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL */ __pyx_t_1 = (((__pyx_v_obj[0]) == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":54 * if obj[0] == NULL: return 0 * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL # <<<<<<<<<<<<<< * if not (PetscInitializeCalled): return 0 * if (PetscFinalizeCalled): return 0 */ __pyx_v_tmp = (__pyx_v_obj[0]); (__pyx_v_obj[0]) = NULL; /* "PETSc/petscobj.pxi":55 * cdef PetscObject tmp * tmp = obj[0]; obj[0] = NULL * if not (PetscInitializeCalled): return 0 # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return 0 * return PetscObjectDestroy(&tmp) */ __pyx_t_1 = ((!(((int)PetscInitializeCalled) != 0)) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":56 * tmp = obj[0]; obj[0] = NULL * if not (PetscInitializeCalled): return 0 * if (PetscFinalizeCalled): return 0 # <<<<<<<<<<<<<< * return PetscObjectDestroy(&tmp) * */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":57 * if not (PetscInitializeCalled): return 0 * if (PetscFinalizeCalled): return 0 * return PetscObjectDestroy(&tmp) # <<<<<<<<<<<<<< * * cdef inline int PetscINCSTATE(PetscObject *obj) nogil: */ __pyx_r = PetscObjectDestroy((&__pyx_v_tmp)); goto __pyx_L0; /* "PETSc/petscobj.pxi":50 * return PetscObjectDestroy(&tmp) * * cdef inline int PetscDEALLOC(PetscObject* obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/petscobj.pxi":59 * return PetscObjectDestroy(&tmp) * * cdef inline int PetscINCSTATE(PetscObject *obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_PetscINCSTATE(PetscObject *__pyx_v_obj) { int __pyx_r; int __pyx_t_1; /* "PETSc/petscobj.pxi":60 * * cdef inline int PetscINCSTATE(PetscObject *obj) nogil: * if obj == NULL: return 0 # <<<<<<<<<<<<<< * if obj[0] == NULL: return 0 * return PetscObjectStateIncrease(obj[0]) */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":61 * cdef inline int PetscINCSTATE(PetscObject *obj) nogil: * if obj == NULL: return 0 * if obj[0] == NULL: return 0 # <<<<<<<<<<<<<< * return PetscObjectStateIncrease(obj[0]) * */ __pyx_t_1 = (((__pyx_v_obj[0]) == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscobj.pxi":62 * if obj == NULL: return 0 * if obj[0] == NULL: return 0 * return PetscObjectStateIncrease(obj[0]) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = PetscObjectStateIncrease((__pyx_v_obj[0])); goto __pyx_L0; /* "PETSc/petscobj.pxi":59 * return PetscObjectDestroy(&tmp) * * cdef inline int PetscINCSTATE(PetscObject *obj) nogil: # <<<<<<<<<<<<<< * if obj == NULL: return 0 * if obj[0] == NULL: return 0 */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/petscobj.pxi":79 * int (*python_destroy)(void*) * * cdef inline void Py_DecRef(PyObject *ob) with gil: # <<<<<<<<<<<<<< * _Py_DecRef(ob) * */ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_Py_DecRef(PyObject *__pyx_v_ob) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("Py_DecRef", 0); /* "PETSc/petscobj.pxi":80 * * cdef inline void Py_DecRef(PyObject *ob) with gil: * _Py_DecRef(ob) # <<<<<<<<<<<<<< * * cdef int PetscDelPyDict(void* ptr) nogil: */ Py_DECREF(__pyx_v_ob); /* "PETSc/petscobj.pxi":79 * int (*python_destroy)(void*) * * cdef inline void Py_DecRef(PyObject *ob) with gil: # <<<<<<<<<<<<<< * _Py_DecRef(ob) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } /* "PETSc/petscobj.pxi":82 * _Py_DecRef(ob) * * cdef int PetscDelPyDict(void* ptr) nogil: # <<<<<<<<<<<<<< * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) */ static int __pyx_f_8petsc4py_5PETSc_PetscDelPyDict(void *__pyx_v_ptr) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; /* "PETSc/petscobj.pxi":83 * * cdef int PetscDelPyDict(void* ptr) nogil: * if ptr != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<< * Py_DecRef(ptr) * return 0 */ __pyx_t_2 = ((__pyx_v_ptr != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (Py_IsInitialized() != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/petscobj.pxi":84 * cdef int PetscDelPyDict(void* ptr) nogil: * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) # <<<<<<<<<<<<<< * return 0 * */ __pyx_f_8petsc4py_5PETSc_Py_DecRef(((PyObject *)__pyx_v_ptr)); /* "PETSc/petscobj.pxi":83 * * cdef int PetscDelPyDict(void* ptr) nogil: * if ptr != NULL and Py_IsInitialized(): # <<<<<<<<<<<<<< * Py_DecRef(ptr) * return 0 */ } /* "PETSc/petscobj.pxi":85 * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) * return 0 # <<<<<<<<<<<<<< * * cdef object PetscGetPyDict(PetscObject obj, bint create): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscobj.pxi":82 * _Py_DecRef(ob) * * cdef int PetscDelPyDict(void* ptr) nogil: # <<<<<<<<<<<<<< * if ptr != NULL and Py_IsInitialized(): * Py_DecRef(ptr) */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/petscobj.pxi":87 * return 0 * * cdef object PetscGetPyDict(PetscObject obj, bint create): # <<<<<<<<<<<<<< * if obj.python_context != NULL: * return obj.python_context */ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyDict(PetscObject __pyx_v_obj, int __pyx_v_create) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PetscGetPyDict", 0); /* "PETSc/petscobj.pxi":88 * * cdef object PetscGetPyDict(PetscObject obj, bint create): * if obj.python_context != NULL: # <<<<<<<<<<<<<< * return obj.python_context * if create: */ __pyx_t_1 = ((__pyx_v_obj->python_context != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscobj.pxi":89 * cdef object PetscGetPyDict(PetscObject obj, bint create): * if obj.python_context != NULL: * return obj.python_context # <<<<<<<<<<<<<< * if create: * obj.python_destroy = PetscDelPyDict */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_obj->python_context)); __pyx_r = ((PyObject *)__pyx_v_obj->python_context); goto __pyx_L0; /* "PETSc/petscobj.pxi":88 * * cdef object PetscGetPyDict(PetscObject obj, bint create): * if obj.python_context != NULL: # <<<<<<<<<<<<<< * return obj.python_context * if create: */ } /* "PETSc/petscobj.pxi":90 * if obj.python_context != NULL: * return obj.python_context * if create: # <<<<<<<<<<<<<< * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() */ __pyx_t_1 = (__pyx_v_create != 0); if (__pyx_t_1) { /* "PETSc/petscobj.pxi":91 * return obj.python_context * if create: * obj.python_destroy = PetscDelPyDict # <<<<<<<<<<<<<< * obj.python_context = PyDict_New() * return obj.python_context */ __pyx_v_obj->python_destroy = __pyx_f_8petsc4py_5PETSc_PetscDelPyDict; /* "PETSc/petscobj.pxi":92 * if create: * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() # <<<<<<<<<<<<<< * return obj.python_context * return None */ __pyx_t_2 = PyDict_New(); if (unlikely(__pyx_t_2 == ((PyObject *)NULL))) __PYX_ERR(16, 92, __pyx_L1_error) __pyx_v_obj->python_context = ((void *)__pyx_t_2); /* "PETSc/petscobj.pxi":93 * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() * return obj.python_context # <<<<<<<<<<<<<< * return None * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_obj->python_context)); __pyx_r = ((PyObject *)__pyx_v_obj->python_context); goto __pyx_L0; /* "PETSc/petscobj.pxi":90 * if obj.python_context != NULL: * return obj.python_context * if create: # <<<<<<<<<<<<<< * obj.python_destroy = PetscDelPyDict * obj.python_context = PyDict_New() */ } /* "PETSc/petscobj.pxi":94 * obj.python_context = PyDict_New() * return obj.python_context * return None # <<<<<<<<<<<<<< * * cdef object PetscGetPyObj(PetscObject o, char name[]): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscobj.pxi":87 * return 0 * * cdef object PetscGetPyDict(PetscObject obj, bint create): # <<<<<<<<<<<<<< * if obj.python_context != NULL: * return obj.python_context */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PetscGetPyDict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscobj.pxi":96 * return None * * cdef object PetscGetPyObj(PetscObject o, char name[]): # <<<<<<<<<<<<<< * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None */ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscGetPyObj(PetscObject __pyx_v_o, char *__pyx_v_name) { PyObject *__pyx_v_dct = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_d; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PetscGetPyObj", 0); /* "PETSc/petscobj.pxi":97 * * cdef object PetscGetPyObj(PetscObject o, char name[]): * cdef object dct = PetscGetPyDict(o, False) # <<<<<<<<<<<<<< * if dct is None: return None * cdef object key = bytes2str(name) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dct = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscobj.pxi":98 * cdef object PetscGetPyObj(PetscObject o, char name[]): * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None # <<<<<<<<<<<<<< * cdef object key = bytes2str(name) * cdef PyObject *d = dct */ __pyx_t_2 = (__pyx_v_dct == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/petscobj.pxi":99 * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None * cdef object key = bytes2str(name) # <<<<<<<<<<<<<< * cdef PyObject *d = dct * cdef PyObject *k = key */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscobj.pxi":100 * if dct is None: return None * cdef object key = bytes2str(name) * cdef PyObject *d = dct # <<<<<<<<<<<<<< * cdef PyObject *k = key * cdef PyObject *v = NULL */ __pyx_v_d = ((PyObject *)__pyx_v_dct); /* "PETSc/petscobj.pxi":101 * cdef object key = bytes2str(name) * cdef PyObject *d = dct * cdef PyObject *k = key # <<<<<<<<<<<<<< * cdef PyObject *v = NULL * v = PyDict_GetItem(d, k) */ __pyx_v_k = ((PyObject *)__pyx_v_key); /* "PETSc/petscobj.pxi":102 * cdef PyObject *d = dct * cdef PyObject *k = key * cdef PyObject *v = NULL # <<<<<<<<<<<<<< * v = PyDict_GetItem(d, k) * if v != NULL: return v */ __pyx_v_v = NULL; /* "PETSc/petscobj.pxi":103 * cdef PyObject *k = key * cdef PyObject *v = NULL * v = PyDict_GetItem(d, k) # <<<<<<<<<<<<<< * if v != NULL: return v * return None */ __pyx_t_4 = PyDict_GetItem(__pyx_v_d, __pyx_v_k); if (unlikely(PyErr_Occurred())) __PYX_ERR(16, 103, __pyx_L1_error) __pyx_v_v = __pyx_t_4; /* "PETSc/petscobj.pxi":104 * cdef PyObject *v = NULL * v = PyDict_GetItem(d, k) * if v != NULL: return v # <<<<<<<<<<<<<< * return None * */ __pyx_t_3 = ((__pyx_v_v != NULL) != 0); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_v)); __pyx_r = ((PyObject *)__pyx_v_v); goto __pyx_L0; } /* "PETSc/petscobj.pxi":105 * v = PyDict_GetItem(d, k) * if v != NULL: return v * return None # <<<<<<<<<<<<<< * * cdef object PetscSetPyObj(PetscObject o, char name[], object p): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscobj.pxi":96 * return None * * cdef object PetscGetPyObj(PetscObject o, char name[]): # <<<<<<<<<<<<<< * cdef object dct = PetscGetPyDict(o, False) * if dct is None: return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PetscGetPyObj", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dct); __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscobj.pxi":107 * return None * * cdef object PetscSetPyObj(PetscObject o, char name[], object p): # <<<<<<<<<<<<<< * cdef object dct * if p is not None: */ static PyObject *__pyx_f_8petsc4py_5PETSc_PetscSetPyObj(PetscObject __pyx_v_o, char *__pyx_v_name, PyObject *__pyx_v_p) { PyObject *__pyx_v_dct = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_d; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PetscSetPyObj", 0); /* "PETSc/petscobj.pxi":109 * cdef object PetscSetPyObj(PetscObject o, char name[], object p): * cdef object dct * if p is not None: # <<<<<<<<<<<<<< * dct = PetscGetPyDict(o, True) * else: */ __pyx_t_1 = (__pyx_v_p != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscobj.pxi":110 * cdef object dct * if p is not None: * dct = PetscGetPyDict(o, True) # <<<<<<<<<<<<<< * else: * dct = PetscGetPyDict(o, False) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_dct = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscobj.pxi":109 * cdef object PetscSetPyObj(PetscObject o, char name[], object p): * cdef object dct * if p is not None: # <<<<<<<<<<<<<< * dct = PetscGetPyDict(o, True) * else: */ goto __pyx_L3; } /* "PETSc/petscobj.pxi":112 * dct = PetscGetPyDict(o, True) * else: * dct = PetscGetPyDict(o, False) # <<<<<<<<<<<<<< * if dct is None: return None * cdef str key = bytes2str(name) */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict(__pyx_v_o, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_dct = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscobj.pxi":113 * else: * dct = PetscGetPyDict(o, False) * if dct is None: return None # <<<<<<<<<<<<<< * cdef str key = bytes2str(name) * cdef PyObject *d = dct */ __pyx_t_2 = (__pyx_v_dct == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } } __pyx_L3:; /* "PETSc/petscobj.pxi":114 * dct = PetscGetPyDict(o, False) * if dct is None: return None * cdef str key = bytes2str(name) # <<<<<<<<<<<<<< * cdef PyObject *d = dct * cdef PyObject *k = key */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(16, 114, __pyx_L1_error) __pyx_v_key = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscobj.pxi":115 * if dct is None: return None * cdef str key = bytes2str(name) * cdef PyObject *d = dct # <<<<<<<<<<<<<< * cdef PyObject *k = key * cdef PyObject *v = p */ __pyx_v_d = ((PyObject *)__pyx_v_dct); /* "PETSc/petscobj.pxi":116 * cdef str key = bytes2str(name) * cdef PyObject *d = dct * cdef PyObject *k = key # <<<<<<<<<<<<<< * cdef PyObject *v = p * PyDict_SetItem(d, k, v) */ __pyx_v_k = ((PyObject *)__pyx_v_key); /* "PETSc/petscobj.pxi":117 * cdef PyObject *d = dct * cdef PyObject *k = key * cdef PyObject *v = p # <<<<<<<<<<<<<< * PyDict_SetItem(d, k, v) * if v == None: */ __pyx_v_v = ((PyObject *)__pyx_v_p); /* "PETSc/petscobj.pxi":118 * cdef PyObject *k = key * cdef PyObject *v = p * PyDict_SetItem(d, k, v) # <<<<<<<<<<<<<< * if v == None: * PyDict_DelItem(d, k) */ __pyx_t_4 = PyDict_SetItem(__pyx_v_d, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(16, 118, __pyx_L1_error) /* "PETSc/petscobj.pxi":119 * cdef PyObject *v = p * PyDict_SetItem(d, k, v) * if v == None: # <<<<<<<<<<<<<< * PyDict_DelItem(d, k) * return None */ __pyx_t_1 = ((__pyx_v_v == ((PyObject *)Py_None)) != 0); if (__pyx_t_1) { /* "PETSc/petscobj.pxi":120 * PyDict_SetItem(d, k, v) * if v == None: * PyDict_DelItem(d, k) # <<<<<<<<<<<<<< * return None * */ __pyx_t_4 = PyDict_DelItem(__pyx_v_d, __pyx_v_k); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(16, 120, __pyx_L1_error) /* "PETSc/petscobj.pxi":119 * cdef PyObject *v = p * PyDict_SetItem(d, k, v) * if v == None: # <<<<<<<<<<<<<< * PyDict_DelItem(d, k) * return None */ } /* "PETSc/petscobj.pxi":121 * if v == None: * PyDict_DelItem(d, k) * return None # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscobj.pxi":107 * return None * * cdef object PetscSetPyObj(PetscObject o, char name[], object p): # <<<<<<<<<<<<<< * cdef object dct * if p is not None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PetscSetPyObj", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dct); __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscobj.pxi":128 * object PyLong_FromVoidPtr(void*) * * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: # <<<<<<<<<<<<<< * return o * */ static CYTHON_INLINE Py_intptr_t __pyx_f_8petsc4py_5PETSc_Object_toFortran(PetscObject __pyx_v_o) { Py_intptr_t __pyx_r; /* "PETSc/petscobj.pxi":129 * * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: * return o # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = ((Py_intptr_t)__pyx_v_o); goto __pyx_L0; /* "PETSc/petscobj.pxi":128 * object PyLong_FromVoidPtr(void*) * * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil: # <<<<<<<<<<<<<< * return o * */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/petscobj.pxi":133 * # -------------------------------------------------------------------- * * cdef inline type subtype_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef PetscObject obj = dm * if obj == NULL: return DM */ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_DM(DM __pyx_v_dm) { PetscObject __pyx_v_obj; PetscBool __pyx_v_match; PyTypeObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subtype_DM", 0); /* "PETSc/petscobj.pxi":134 * * cdef inline type subtype_DM(PetscDM dm): * cdef PetscObject obj = dm # <<<<<<<<<<<<<< * if obj == NULL: return DM * # --- */ __pyx_v_obj = ((PetscObject)__pyx_v_dm); /* "PETSc/petscobj.pxi":135 * cdef inline type subtype_DM(PetscDM dm): * cdef PetscObject obj = dm * if obj == NULL: return DM # <<<<<<<<<<<<<< * # --- * cdef PetscBool match = PETSC_FALSE */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DM; goto __pyx_L0; } /* "PETSc/petscobj.pxi":137 * if obj == NULL: return DM * # --- * cdef PetscBool match = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) * if match == PETSC_TRUE: return DMDA */ __pyx_v_match = PETSC_FALSE; /* "PETSc/petscobj.pxi":138 * # --- * cdef PetscBool match = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMDA * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"da"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 138, __pyx_L1_error) /* "PETSc/petscobj.pxi":139 * cdef PetscBool match = PETSC_FALSE * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) * if match == PETSC_TRUE: return DMDA # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) * if match == PETSC_TRUE: return DMPlex */ __pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMDA; goto __pyx_L0; } /* "PETSc/petscobj.pxi":140 * CHKERR( PetscObjectTypeCompare(obj, b"da", &match) ) * if match == PETSC_TRUE: return DMDA * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMPlex * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"plex"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 140, __pyx_L1_error) /* "PETSc/petscobj.pxi":141 * if match == PETSC_TRUE: return DMDA * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) * if match == PETSC_TRUE: return DMPlex # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) * if match == PETSC_TRUE: return DMComposite */ __pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMPlex; goto __pyx_L0; } /* "PETSc/petscobj.pxi":142 * CHKERR( PetscObjectTypeCompare(obj, b"plex", &match) ) * if match == PETSC_TRUE: return DMPlex * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMComposite * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"composite"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 142, __pyx_L1_error) /* "PETSc/petscobj.pxi":143 * if match == PETSC_TRUE: return DMPlex * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) * if match == PETSC_TRUE: return DMComposite # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) * if match == PETSC_TRUE: return DMShell */ __pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMComposite)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMComposite; goto __pyx_L0; } /* "PETSc/petscobj.pxi":144 * CHKERR( PetscObjectTypeCompare(obj, b"composite", &match) ) * if match == PETSC_TRUE: return DMComposite * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMShell * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"shell"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 144, __pyx_L1_error) /* "PETSc/petscobj.pxi":145 * if match == PETSC_TRUE: return DMComposite * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) * if match == PETSC_TRUE: return DMShell # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) * if match == PETSC_TRUE: return DMStag */ __pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMShell)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMShell; goto __pyx_L0; } /* "PETSc/petscobj.pxi":146 * CHKERR( PetscObjectTypeCompare(obj, b"shell", &match) ) * if match == PETSC_TRUE: return DMShell * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMStag * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"stag"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 146, __pyx_L1_error) /* "PETSc/petscobj.pxi":147 * if match == PETSC_TRUE: return DMShell * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) * if match == PETSC_TRUE: return DMStag # <<<<<<<<<<<<<< * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) * if match == PETSC_TRUE: return DMSwarm */ __pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMStag)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMStag; goto __pyx_L0; } /* "PETSc/petscobj.pxi":148 * CHKERR( PetscObjectTypeCompare(obj, b"stag", &match) ) * if match == PETSC_TRUE: return DMStag * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) # <<<<<<<<<<<<<< * if match == PETSC_TRUE: return DMSwarm * # --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(__pyx_v_obj, ((char *)"swarm"), (&__pyx_v_match))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 148, __pyx_L1_error) /* "PETSc/petscobj.pxi":149 * if match == PETSC_TRUE: return DMStag * CHKERR( PetscObjectTypeCompare(obj, b"swarm", &match) ) * if match == PETSC_TRUE: return DMSwarm # <<<<<<<<<<<<<< * # --- * return DM */ __pyx_t_1 = ((__pyx_v_match == PETSC_TRUE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DMSwarm; goto __pyx_L0; } /* "PETSc/petscobj.pxi":151 * if match == PETSC_TRUE: return DMSwarm * # --- * return DM # <<<<<<<<<<<<<< * * cdef inline type subtype_Object(PetscObject obj): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); __pyx_r = __pyx_ptype_8petsc4py_5PETSc_DM; goto __pyx_L0; /* "PETSc/petscobj.pxi":133 * # -------------------------------------------------------------------- * * cdef inline type subtype_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef PetscObject obj = dm * if obj == NULL: return DM */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.subtype_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscobj.pxi":153 * return DM * * cdef inline type subtype_Object(PetscObject obj): # <<<<<<<<<<<<<< * cdef type klass = Object * if obj == NULL: return klass */ static CYTHON_INLINE PyTypeObject *__pyx_f_8petsc4py_5PETSc_subtype_Object(PetscObject __pyx_v_obj) { PyTypeObject *__pyx_v_klass = 0; PetscClassId __pyx_v_classid; PyTypeObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subtype_Object", 0); /* "PETSc/petscobj.pxi":154 * * cdef inline type subtype_Object(PetscObject obj): * cdef type klass = Object # <<<<<<<<<<<<<< * if obj == NULL: return klass * cdef PetscClassId classid = 0 */ __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object)); __pyx_v_klass = __pyx_ptype_8petsc4py_5PETSc_Object; /* "PETSc/petscobj.pxi":155 * cdef inline type subtype_Object(PetscObject obj): * cdef type klass = Object * if obj == NULL: return klass # <<<<<<<<<<<<<< * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_klass)); __pyx_r = __pyx_v_klass; goto __pyx_L0; } /* "PETSc/petscobj.pxi":156 * cdef type klass = Object * if obj == NULL: return klass * cdef PetscClassId classid = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: */ __pyx_v_classid = 0; /* "PETSc/petscobj.pxi":157 * if obj == NULL: return klass * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) # <<<<<<<<<<<<<< * if classid == PETSC_DM_CLASSID: * klass = subtype_DM(obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassId(__pyx_v_obj, (&__pyx_v_classid))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(16, 157, __pyx_L1_error) /* "PETSc/petscobj.pxi":158 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: # <<<<<<<<<<<<<< * klass = subtype_DM(obj) * else: */ __pyx_t_1 = ((__pyx_v_classid == DM_CLASSID) != 0); if (__pyx_t_1) { /* "PETSc/petscobj.pxi":159 * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: * klass = subtype_DM(obj) # <<<<<<<<<<<<<< * else: * klass = PyPetscType_Lookup(classid) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(((DM)__pyx_v_obj))); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_klass, ((PyTypeObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/petscobj.pxi":158 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(obj,&classid) ) * if classid == PETSC_DM_CLASSID: # <<<<<<<<<<<<<< * klass = subtype_DM(obj) * else: */ goto __pyx_L4; } /* "PETSc/petscobj.pxi":161 * klass = subtype_DM(obj) * else: * klass = PyPetscType_Lookup(classid) # <<<<<<<<<<<<<< * return klass * */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(__pyx_v_classid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_klass, ((PyTypeObject*)__pyx_t_3)); __pyx_t_3 = 0; } __pyx_L4:; /* "PETSc/petscobj.pxi":162 * else: * klass = PyPetscType_Lookup(classid) * return klass # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_klass)); __pyx_r = __pyx_v_klass; goto __pyx_L0; /* "PETSc/petscobj.pxi":153 * return DM * * cdef inline type subtype_Object(PetscObject obj): # <<<<<<<<<<<<<< * cdef type klass = Object * if obj == NULL: return klass */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.subtype_Object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_klass); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvwr.pxi":142 * # --- * * cdef inline PetscFileMode filemode(object mode) except (-1): # <<<<<<<<<<<<<< * if mode is None: * return PETSC_FILE_MODE_READ */ static CYTHON_INLINE PetscFileMode __pyx_f_8petsc4py_5PETSc_filemode(PyObject *__pyx_v_mode) { PetscFileMode __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscFileMode __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("filemode", 0); /* "PETSc/petscvwr.pxi":143 * * cdef inline PetscFileMode filemode(object mode) except (-1): * if mode is None: # <<<<<<<<<<<<<< * return PETSC_FILE_MODE_READ * if isinstance(mode, str): */ __pyx_t_1 = (__pyx_v_mode == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscvwr.pxi":144 * cdef inline PetscFileMode filemode(object mode) except (-1): * if mode is None: * return PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * if isinstance(mode, str): * if mode == 'r' : return PETSC_FILE_MODE_READ */ __pyx_r = FILE_MODE_READ; goto __pyx_L0; /* "PETSc/petscvwr.pxi":143 * * cdef inline PetscFileMode filemode(object mode) except (-1): * if mode is None: # <<<<<<<<<<<<<< * return PETSC_FILE_MODE_READ * if isinstance(mode, str): */ } /* "PETSc/petscvwr.pxi":145 * if mode is None: * return PETSC_FILE_MODE_READ * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE */ __pyx_t_2 = PyString_Check(__pyx_v_mode); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscvwr.pxi":146 * return PETSC_FILE_MODE_READ * if isinstance(mode, str): * if mode == 'r' : return PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * elif mode == 'w' : return PETSC_FILE_MODE_WRITE * elif mode == 'a' : return PETSC_FILE_MODE_APPEND */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 146, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_READ; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":147 * if isinstance(mode, str): * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE # <<<<<<<<<<<<<< * elif mode == 'a' : return PETSC_FILE_MODE_APPEND * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 147, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_WRITE; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":148 * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE * elif mode == 'a' : return PETSC_FILE_MODE_APPEND # <<<<<<<<<<<<<< * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_a, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 148, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":149 * elif mode == 'w' : return PETSC_FILE_MODE_WRITE * elif mode == 'a' : return PETSC_FILE_MODE_APPEND * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_r_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 149, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_UPDATE; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":150 * elif mode == 'a' : return PETSC_FILE_MODE_APPEND * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_w_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 150, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_UPDATE; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":151 * elif mode == 'r+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_kp_s_a_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 151, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND_UPDATE; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":152 * elif mode == 'w+' : return PETSC_FILE_MODE_UPDATE * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_u, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 152, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_UPDATE; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":153 * elif mode == 'a+' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE * return mode */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_au, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 153, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND_UPDATE; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":154 * elif mode == 'u' : return PETSC_FILE_MODE_UPDATE * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * return mode */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_ua, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(17, 154, __pyx_L1_error) if (__pyx_t_1) { __pyx_r = FILE_MODE_APPEND_UPDATE; goto __pyx_L0; } /* "PETSc/petscvwr.pxi":145 * if mode is None: * return PETSC_FILE_MODE_READ * if isinstance(mode, str): # <<<<<<<<<<<<<< * if mode == 'r' : return PETSC_FILE_MODE_READ * elif mode == 'w' : return PETSC_FILE_MODE_WRITE */ } /* "PETSc/petscvwr.pxi":155 * elif mode == 'au' : return PETSC_FILE_MODE_APPEND_UPDATE * elif mode == 'ua' : return PETSC_FILE_MODE_APPEND_UPDATE * return mode # <<<<<<<<<<<<<< */ __pyx_t_3 = ((PetscFileMode)__Pyx_PyInt_As_PetscFileMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 155, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/petscvwr.pxi":142 * # --- * * cdef inline PetscFileMode filemode(object mode) except (-1): # <<<<<<<<<<<<<< * if mode is None: * return PETSC_FILE_MODE_READ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.filemode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((PetscFileMode)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":96 * # -------------------------------------------------------------------- * * cdef inline IS ref_IS(PetscIS iset): # <<<<<<<<<<<<<< * cdef IS ob = IS() * ob.iset = iset */ static CYTHON_INLINE struct PyPetscISObject *__pyx_f_8petsc4py_5PETSc_ref_IS(IS __pyx_v_iset) { struct PyPetscISObject *__pyx_v_ob = 0; struct PyPetscISObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_IS", 0); /* "PETSc/petscis.pxi":97 * * cdef inline IS ref_IS(PetscIS iset): * cdef IS ob = IS() # <<<<<<<<<<<<<< * ob.iset = iset * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscis.pxi":98 * cdef inline IS ref_IS(PetscIS iset): * cdef IS ob = IS() * ob.iset = iset # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->iset = __pyx_v_iset; /* "PETSc/petscis.pxi":99 * cdef IS ob = IS() * ob.iset = iset * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscis.pxi":100 * ob.iset = iset * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscis.pxi":96 * # -------------------------------------------------------------------- * * cdef inline IS ref_IS(PetscIS iset): # <<<<<<<<<<<<<< * cdef IS ob = IS() * ob.iset = iset */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_IS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":102 * return ob * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): # <<<<<<<<<<<<<< * cdef LGMap ob = LGMap() * ob.lgm = lgm */ static CYTHON_INLINE struct PyPetscLGMapObject *__pyx_f_8petsc4py_5PETSc_ref_LGMap(ISLocalToGlobalMapping __pyx_v_lgm) { struct PyPetscLGMapObject *__pyx_v_ob = 0; struct PyPetscLGMapObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_LGMap", 0); /* "PETSc/petscis.pxi":103 * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): * cdef LGMap ob = LGMap() # <<<<<<<<<<<<<< * ob.lgm = lgm * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscLGMapObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscis.pxi":104 * cdef inline LGMap ref_LGMap(PetscLGMap lgm): * cdef LGMap ob = LGMap() * ob.lgm = lgm # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->lgm = __pyx_v_lgm; /* "PETSc/petscis.pxi":105 * cdef LGMap ob = LGMap() * ob.lgm = lgm * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscis.pxi":106 * ob.lgm = lgm * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscis.pxi":102 * return ob * * cdef inline LGMap ref_LGMap(PetscLGMap lgm): # <<<<<<<<<<<<<< * cdef LGMap ob = LGMap() * ob.lgm = lgm */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_LGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":125 * cdef bint hasarray * * def __cinit__(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 125, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 125, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(4, 125, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { IS __pyx_v_i; int __pyx_r; __Pyx_RefNannyDeclarations IS __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/petscis.pxi":126 * * def __cinit__(self, IS iset): * cdef PetscIS i = iset.iset # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&i) ) * self.iset = i */ __pyx_t_1 = __pyx_v_iset->iset; __pyx_v_i = __pyx_t_1; /* "PETSc/petscis.pxi":127 * def __cinit__(self, IS iset): * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) # <<<<<<<<<<<<<< * self.iset = i * self.size = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_i)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 127, __pyx_L1_error) /* "PETSc/petscis.pxi":128 * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) * self.iset = i # <<<<<<<<<<<<<< * self.size = 0 * self.data = NULL */ __pyx_v_self->iset = __pyx_v_i; /* "PETSc/petscis.pxi":129 * CHKERR( PetscINCREF(&i) ) * self.iset = i * self.size = 0 # <<<<<<<<<<<<<< * self.data = NULL * self.hasarray = 0 */ __pyx_v_self->size = 0; /* "PETSc/petscis.pxi":130 * self.iset = i * self.size = 0 * self.data = NULL # <<<<<<<<<<<<<< * self.hasarray = 0 * */ __pyx_v_self->data = NULL; /* "PETSc/petscis.pxi":131 * self.size = 0 * self.data = NULL * self.hasarray = 0 # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->hasarray = 0; /* "PETSc/petscis.pxi":125 * cdef bint hasarray * * def __cinit__(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscIS i = iset.iset * CHKERR( PetscINCREF(&i) ) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":133 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/petscis.pxi":134 * * def __dealloc__(self): * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * CHKERR( ISDestroy(&self.iset) ) */ __pyx_t_2 = (__pyx_v_self->hasarray != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->iset != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/petscis.pxi":135 * def __dealloc__(self): * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&self.iset) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 135, __pyx_L1_error) /* "PETSc/petscis.pxi":134 * * def __dealloc__(self): * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * CHKERR( ISDestroy(&self.iset) ) */ } /* "PETSc/petscis.pxi":136 * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * CHKERR( ISDestroy(&self.iset) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&__pyx_v_self->iset))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 136, __pyx_L1_error) /* "PETSc/petscis.pxi":133 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._IS_buffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/petscis.pxi":140 * # * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acquire", 0); /* "PETSc/petscis.pxi":141 * * cdef int acquire(self) except -1: * if not self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) */ __pyx_t_2 = ((!(__pyx_v_self->hasarray != 0)) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->iset != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/petscis.pxi":142 * cdef int acquire(self) except -1: * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) # <<<<<<<<<<<<<< * CHKERR( ISGetIndices(self.iset, &self.data) ) * self.hasarray = 1 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_self->size))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 142, __pyx_L1_error) /* "PETSc/petscis.pxi":143 * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<< * self.hasarray = 1 * return 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 143, __pyx_L1_error) /* "PETSc/petscis.pxi":144 * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) * self.hasarray = 1 # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->hasarray = 1; /* "PETSc/petscis.pxi":141 * * cdef int acquire(self) except -1: * if not self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &self.size) ) * CHKERR( ISGetIndices(self.iset, &self.data) ) */ } /* "PETSc/petscis.pxi":145 * CHKERR( ISGetIndices(self.iset, &self.data) ) * self.hasarray = 1 * return 0 # <<<<<<<<<<<<<< * * cdef int release(self) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":140 * # * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * if not self.hasarray and self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &self.size) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":147 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * self.size = 0 */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("release", 0); /* "PETSc/petscis.pxi":148 * * cdef int release(self) except -1: * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ __pyx_t_2 = (__pyx_v_self->hasarray != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->iset != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/petscis.pxi":149 * cdef int release(self) except -1: * if self.hasarray and self.iset != NULL: * self.size = 0 # <<<<<<<<<<<<<< * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * self.hasarray = 0 */ __pyx_v_self->size = 0; /* "PETSc/petscis.pxi":150 * if self.hasarray and self.iset != NULL: * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) # <<<<<<<<<<<<<< * self.hasarray = 0 * self.data = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_self->data))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 150, __pyx_L1_error) /* "PETSc/petscis.pxi":151 * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * self.hasarray = 0 # <<<<<<<<<<<<<< * self.data = NULL * return 0 */ __pyx_v_self->hasarray = 0; /* "PETSc/petscis.pxi":152 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) * self.hasarray = 0 * self.data = NULL # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->data = NULL; /* "PETSc/petscis.pxi":148 * * cdef int release(self) except -1: * if self.hasarray and self.iset != NULL: # <<<<<<<<<<<<<< * self.size = 0 * CHKERR( ISRestoreIndices(self.iset, &self.data) ) */ } /* "PETSc/petscis.pxi":153 * self.hasarray = 0 * self.data = NULL * return 0 # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":147 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * if self.hasarray and self.iset != NULL: * self.size = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.release", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":157 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acquirebuffer", 0); /* "PETSc/petscis.pxi":158 * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() # <<<<<<<<<<<<<< * PyPetscBuffer_FillInfo(view, self.data, self.size, * c'i', 1, flags) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 158, __pyx_L1_error) /* "PETSc/petscis.pxi":159 * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, # <<<<<<<<<<<<<< * c'i', 1, flags) * view.obj = self */ __pyx_t_1 = PyPetscBuffer_FillInfo(__pyx_v_view, ((void *)__pyx_v_self->data), __pyx_v_self->size, 'i', 1, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 159, __pyx_L1_error) /* "PETSc/petscis.pxi":161 * PyPetscBuffer_FillInfo(view, self.data, self.size, * c'i', 1, flags) * view.obj = self # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = ((PyObject *)__pyx_v_self); /* "PETSc/petscis.pxi":162 * c'i', 1, flags) * view.obj = self * return 0 # <<<<<<<<<<<<<< * * cdef int releasebuffer(self, Py_buffer *view) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":157 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.acquirebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":164 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ static int __pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("releasebuffer", 0); /* "PETSc/petscis.pxi":165 * * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) # <<<<<<<<<<<<<< * self.release() * return 0 */ PyPetscBuffer_Release(__pyx_v_view); /* "PETSc/petscis.pxi":166 * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) * self.release() # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 166, __pyx_L1_error) /* "PETSc/petscis.pxi":167 * PyPetscBuffer_Release(view) * self.release() * return 0 # <<<<<<<<<<<<<< * * def __getbuffer__(self, Py_buffer *view, int flags): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":164 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.releasebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":169 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_4__getbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (__pyx_v_view == NULL) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "PETSc/petscis.pxi":170 * * def __getbuffer__(self, Py_buffer *view, int flags): * self.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquirebuffer(__pyx_v_self, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 170, __pyx_L1_error) /* "PETSc/petscis.pxi":169 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":172 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* Python wrapper */ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_6__releasebuffer__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__releasebuffer__", 0); /* "PETSc/petscis.pxi":173 * * def __releasebuffer__(self, Py_buffer *view): * self.releasebuffer(view) # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->releasebuffer(__pyx_v_self, __pyx_v_view); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 173, __pyx_L1_error) /* "PETSc/petscis.pxi":172 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._IS_buffer.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/petscis.pxi":177 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("enter", 0); /* "PETSc/petscis.pxi":178 * * cdef object enter(self): * self.acquire() # <<<<<<<<<<<<<< * return asarray(self) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 178, __pyx_L1_error) /* "PETSc/petscis.pxi":179 * cdef object enter(self): * self.acquire() * return asarray(self) # <<<<<<<<<<<<<< * * cdef object exit(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":177 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.enter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":181 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ static PyObject *__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exit", 0); /* "PETSc/petscis.pxi":182 * * cdef object exit(self): * self.release() # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 182, __pyx_L1_error) /* "PETSc/petscis.pxi":183 * cdef object exit(self): * self.release() * return None # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscis.pxi":181 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.exit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":185 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_8__enter__[] = "_IS_buffer.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/petscis.pxi":186 * * def __enter__(self): * return self.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->enter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":185 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":188 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_10__exit__[] = "_IS_buffer.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/petscis.pxi":189 * * def __exit__(self, *exc): * return self.exit() # <<<<<<<<<<<<<< * * # buffer interface (legacy) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->exit(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":188 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":193 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, void **__pyx_v_p) { PetscInt __pyx_v_n; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getbuffer", 0); /* "PETSc/petscis.pxi":194 * * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if p != NULL: * self.acquire() */ __pyx_v_n = 0; /* "PETSc/petscis.pxi":195 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ __pyx_t_1 = ((__pyx_v_p != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscis.pxi":196 * cdef PetscInt n = 0 * if p != NULL: * self.acquire() # <<<<<<<<<<<<<< * p[0] = self.data * n = self.size */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 196, __pyx_L1_error) /* "PETSc/petscis.pxi":197 * if p != NULL: * self.acquire() * p[0] = self.data # <<<<<<<<<<<<<< * n = self.size * elif self.iset != NULL: */ (__pyx_v_p[0]) = ((void *)__pyx_v_self->data); /* "PETSc/petscis.pxi":198 * self.acquire() * p[0] = self.data * n = self.size # <<<<<<<<<<<<<< * elif self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) */ __pyx_t_3 = __pyx_v_self->size; __pyx_v_n = __pyx_t_3; /* "PETSc/petscis.pxi":195 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ goto __pyx_L3; } /* "PETSc/petscis.pxi":199 * p[0] = self.data * n = self.size * elif self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * return (n*sizeof(PetscInt)) */ __pyx_t_1 = ((__pyx_v_self->iset != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscis.pxi":200 * n = self.size * elif self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * return (n*sizeof(PetscInt)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 200, __pyx_L1_error) /* "PETSc/petscis.pxi":199 * p[0] = self.data * n = self.size * elif self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * return (n*sizeof(PetscInt)) */ } __pyx_L3:; /* "PETSc/petscis.pxi":201 * elif self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) * return (n*sizeof(PetscInt)) # <<<<<<<<<<<<<< * * def __getsegcount__(self, Py_ssize_t *lenp): */ __pyx_r = ((Py_ssize_t)(((size_t)__pyx_v_n) * (sizeof(PetscInt)))); goto __pyx_L0; /* "PETSc/petscis.pxi":193 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.getbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscis.pxi":203 * return (n*sizeof(PetscInt)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_lenp)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getsegcount__", 0); /* "PETSc/petscis.pxi":204 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ __pyx_t_1 = ((__pyx_v_lenp != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscis.pxi":205 * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) # <<<<<<<<<<<<<< * return 1 * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, NULL); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(4, 205, __pyx_L1_error) (__pyx_v_lenp[0]) = __pyx_t_2; /* "PETSc/petscis.pxi":204 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ } /* "PETSc/petscis.pxi":206 * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) * return 1 # <<<<<<<<<<<<<< * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): */ __pyx_r = 1; goto __pyx_L0; /* "PETSc/petscis.pxi":203 * return (n*sizeof(PetscInt)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "PETSc/petscis.pxi":208 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getreadbuffer__", 0); /* "PETSc/petscis.pxi":209 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * return self.getbuffer(p) */ __pyx_t_1 = ((__pyx_v_idx != 0) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(4, 209, __pyx_L1_error) } /* "PETSc/petscis.pxi":211 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * return self.getbuffer(p) # <<<<<<<<<<<<<< * * # NumPy array interface (legacy) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(4, 211, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/petscis.pxi":208 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "PETSc/petscis.pxi":216 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.iset != NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_10_IS_buffer_19__array_interface_____get__(((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10_IS_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_v_size = 0; PyArray_Descr *__pyx_v_descr = 0; PyObject *__pyx_v_typestr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/petscis.pxi":217 * property __array_interface__: * def __get__(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) */ __pyx_v_n = 0; /* "PETSc/petscis.pxi":218 * def __get__(self): * cdef PetscInt n = 0 * if self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) */ __pyx_t_1 = ((__pyx_v_self->iset != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscis.pxi":219 * cdef PetscInt n = 0 * if self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 219, __pyx_L1_error) /* "PETSc/petscis.pxi":218 * def __get__(self): * cdef PetscInt n = 0 * if self.iset != NULL: # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) */ } /* "PETSc/petscis.pxi":220 * if self.iset != NULL: * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_size = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscis.pxi":221 * CHKERR( ISGetLocalSize(self.iset, &n) ) * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<< * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, */ __pyx_t_3 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_INT)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscis.pxi":222 * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) # <<<<<<<<<<<<<< * return dict(version=3, * data=self, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_typestr = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscis.pxi":223 * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_INT) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, # <<<<<<<<<<<<<< * data=self, * shape=(size,), */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_version, __pyx_int_3) < 0) __PYX_ERR(4, 223, __pyx_L1_error) /* "PETSc/petscis.pxi":224 * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, * data=self, # <<<<<<<<<<<<<< * shape=(size,), * typestr=typestr) */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(4, 223, __pyx_L1_error) /* "PETSc/petscis.pxi":225 * return dict(version=3, * data=self, * shape=(size,), # <<<<<<<<<<<<<< * typestr=typestr) * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(4, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscis.pxi":226 * data=self, * shape=(size,), * typestr=typestr) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_typestr, __pyx_v_typestr) < 0) __PYX_ERR(4, 223, __pyx_L1_error) __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/petscis.pxi":216 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.iset != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc._IS_buffer.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_XDECREF(__pyx_v_typestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":186 * # -------------------------------------------------------------------- * * cdef inline Vec ref_Vec(PetscVec vec): # <<<<<<<<<<<<<< * cdef Vec ob = Vec() * ob.vec = vec */ static CYTHON_INLINE struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_ref_Vec(Vec __pyx_v_vec) { struct PyPetscVecObject *__pyx_v_ob = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_Vec", 0); /* "PETSc/petscvec.pxi":187 * * cdef inline Vec ref_Vec(PetscVec vec): * cdef Vec ob = Vec() # <<<<<<<<<<<<<< * ob.vec = vec * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscvec.pxi":188 * cdef inline Vec ref_Vec(PetscVec vec): * cdef Vec ob = Vec() * ob.vec = vec # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->vec = __pyx_v_vec; /* "PETSc/petscvec.pxi":189 * cdef Vec ob = Vec() * ob.vec = vec * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscvec.pxi":190 * ob.vec = vec * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscvec.pxi":186 * # -------------------------------------------------------------------- * * cdef inline Vec ref_Vec(PetscVec vec): # <<<<<<<<<<<<<< * cdef Vec ob = Vec() * ob.vec = vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_Vec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":196 * # unary operations * * cdef Vec vec_pos(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_pos(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_pos", 0); /* "PETSc/petscvec.pxi":197 * * cdef Vec vec_pos(Vec self): * cdef Vec vec = type(self)() # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * CHKERR( VecCopy(self.vec, vec.vec) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 197, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":198 * cdef Vec vec_pos(Vec self): * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecCopy(self.vec, vec.vec) ) * return vec */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 198, __pyx_L1_error) /* "PETSc/petscvec.pxi":199 * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * CHKERR( VecCopy(self.vec, vec.vec) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 199, __pyx_L1_error) /* "PETSc/petscvec.pxi":200 * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * CHKERR( VecCopy(self.vec, vec.vec) ) * return vec # <<<<<<<<<<<<<< * * cdef Vec vec_neg(Vec self): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "PETSc/petscvec.pxi":196 * # unary operations * * cdef Vec vec_pos(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.vec_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":202 * return vec * * cdef Vec vec_neg(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_neg(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_neg", 0); /* "PETSc/petscvec.pxi":203 * * cdef Vec vec_neg(Vec self): * cdef Vec vec = vec_pos(self) # <<<<<<<<<<<<<< * CHKERR( VecScale(vec.vec, -1) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscvec.pxi":204 * cdef Vec vec_neg(Vec self): * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_vec->vec, -1.0)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 204, __pyx_L1_error) /* "PETSc/petscvec.pxi":205 * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) * return vec # <<<<<<<<<<<<<< * * cdef Vec vec_abs(Vec self): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "PETSc/petscvec.pxi":202 * return vec * * cdef Vec vec_neg(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecScale(vec.vec, -1) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_neg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":207 * return vec * * cdef Vec vec_abs(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_abs(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_abs", 0); /* "PETSc/petscvec.pxi":208 * * cdef Vec vec_abs(Vec self): * cdef Vec vec = vec_pos(self) # <<<<<<<<<<<<<< * CHKERR( VecAbs(vec.vec) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscvec.pxi":209 * cdef Vec vec_abs(Vec self): * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAbs(__pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 209, __pyx_L1_error) /* "PETSc/petscvec.pxi":210 * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) * return vec # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "PETSc/petscvec.pxi":207 * return vec * * cdef Vec vec_abs(Vec self): # <<<<<<<<<<<<<< * cdef Vec vec = vec_pos(self) * CHKERR( VecAbs(vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_abs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":214 * # inplace binary operations * * cdef Vec vec_iadd(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_iadd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PetscScalar __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_iadd", 0); __Pyx_INCREF(__pyx_v_other); /* "PETSc/petscvec.pxi":215 * * cdef Vec vec_iadd(Vec self, other): * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "PETSc/petscvec.pxi":217 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscvec.pxi":218 * cdef Vec vec * if isinstance(other, Vec): * alpha = 1; vec = other # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): */ __pyx_v_alpha = 1.0; if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 218, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":219 * if isinstance(other, Vec): * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) # <<<<<<<<<<<<<< * elif isinstance(other, tuple) or isinstance(other, list): * other, vec = other */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_alpha, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 219, __pyx_L1_error) /* "PETSc/petscvec.pxi":217 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) */ goto __pyx_L3; } /* "PETSc/petscvec.pxi":220 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ __pyx_t_1 = PyTuple_Check(__pyx_v_other); __pyx_t_5 = (__pyx_t_1 != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = PyList_Check(__pyx_v_other); __pyx_t_1 = (__pyx_t_5 != 0); __pyx_t_2 = __pyx_t_1; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/petscvec.pxi":221 * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): * other, vec = other # <<<<<<<<<<<<<< * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(5, 221, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(5, 221, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(5, 221, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 221, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscvec.pxi":222 * elif isinstance(other, tuple) or isinstance(other, list): * other, vec = other * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * else: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(5, 222, __pyx_L1_error) __pyx_v_alpha = __pyx_t_9; /* "PETSc/petscvec.pxi":223 * other, vec = other * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_alpha, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 223, __pyx_L1_error) /* "PETSc/petscvec.pxi":220 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ goto __pyx_L3; } /* "PETSc/petscvec.pxi":225 * CHKERR( VecAXPY(self.vec, alpha, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecShift(self.vec, alpha) ) * return self */ /*else*/ { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(5, 225, __pyx_L1_error) __pyx_v_alpha = __pyx_t_9; /* "PETSc/petscvec.pxi":226 * else: * alpha = asScalar(other) * CHKERR( VecShift(self.vec, alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, __pyx_v_alpha)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 226, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscvec.pxi":227 * alpha = asScalar(other) * CHKERR( VecShift(self.vec, alpha) ) * return self # <<<<<<<<<<<<<< * * cdef Vec vec_isub(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscvec.pxi":214 * # inplace binary operations * * cdef Vec vec_iadd(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.vec_iadd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":229 * return self * * cdef Vec vec_isub(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_isub(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PetscScalar __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_isub", 0); __Pyx_INCREF(__pyx_v_other); /* "PETSc/petscvec.pxi":230 * * cdef Vec vec_isub(Vec self, other): * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "PETSc/petscvec.pxi":232 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscvec.pxi":233 * cdef Vec vec * if isinstance(other, Vec): * alpha = 1; vec = other # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): */ __pyx_v_alpha = 1.0; if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 233, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":234 * if isinstance(other, Vec): * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) # <<<<<<<<<<<<<< * elif isinstance(other, tuple) or isinstance(other, list): * other, vec = other */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, (-__pyx_v_alpha), __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 234, __pyx_L1_error) /* "PETSc/petscvec.pxi":232 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) */ goto __pyx_L3; } /* "PETSc/petscvec.pxi":235 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ __pyx_t_1 = PyTuple_Check(__pyx_v_other); __pyx_t_5 = (__pyx_t_1 != 0); if (!__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = PyList_Check(__pyx_v_other); __pyx_t_1 = (__pyx_t_5 != 0); __pyx_t_2 = __pyx_t_1; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/petscvec.pxi":236 * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): * other, vec = other # <<<<<<<<<<<<<< * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(5, 236, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(5, 236, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(5, 236, __pyx_L1_error) __pyx_L7_unpacking_done:; } if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 236, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3); __pyx_t_3 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscvec.pxi":237 * elif isinstance(other, tuple) or isinstance(other, list): * other, vec = other * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * else: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(5, 237, __pyx_L1_error) __pyx_v_alpha = __pyx_t_9; /* "PETSc/petscvec.pxi":238 * other, vec = other * alpha = asScalar(other) * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, (-__pyx_v_alpha), __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 238, __pyx_L1_error) /* "PETSc/petscvec.pxi":235 * alpha = 1; vec = other * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * elif isinstance(other, tuple) or isinstance(other, list): # <<<<<<<<<<<<<< * other, vec = other * alpha = asScalar(other) */ goto __pyx_L3; } /* "PETSc/petscvec.pxi":240 * CHKERR( VecAXPY(self.vec, -alpha, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecShift(self.vec, -alpha) ) * return self */ /*else*/ { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_9 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(5, 240, __pyx_L1_error) __pyx_v_alpha = __pyx_t_9; /* "PETSc/petscvec.pxi":241 * else: * alpha = asScalar(other) * CHKERR( VecShift(self.vec, -alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, (-__pyx_v_alpha))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 241, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscvec.pxi":242 * alpha = asScalar(other) * CHKERR( VecShift(self.vec, -alpha) ) * return self # <<<<<<<<<<<<<< * * cdef Vec vec_imul(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscvec.pxi":229 * return self * * cdef Vec vec_isub(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.vec_isub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":244 * return self * * cdef Vec vec_imul(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_imul(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscScalar __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_imul", 0); /* "PETSc/petscvec.pxi":245 * * cdef Vec vec_imul(Vec self, other): * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "PETSc/petscvec.pxi":247 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscvec.pxi":248 * cdef Vec vec * if isinstance(other, Vec): * vec = other # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) * else: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 248, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":249 * if isinstance(other, Vec): * vec = other * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMult(__pyx_v_self->vec, __pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 249, __pyx_L1_error) /* "PETSc/petscvec.pxi":247 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) */ goto __pyx_L3; } /* "PETSc/petscvec.pxi":251 * CHKERR( VecPointwiseMult(self.vec, self.vec, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecScale(self.vec, alpha) ) * return self */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(5, 251, __pyx_L1_error) __pyx_v_alpha = __pyx_t_5; /* "PETSc/petscvec.pxi":252 * else: * alpha = asScalar(other) * CHKERR( VecScale(self.vec, alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, __pyx_v_alpha)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 252, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscvec.pxi":253 * alpha = asScalar(other) * CHKERR( VecScale(self.vec, alpha) ) * return self # <<<<<<<<<<<<<< * * cdef Vec vec_idiv(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscvec.pxi":244 * return self * * cdef Vec vec_imul(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.vec_imul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":255 * return self * * cdef Vec vec_idiv(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar one = 1 * cdef PetscScalar alpha = 1 */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_idiv(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PetscScalar __pyx_v_one; PetscScalar __pyx_v_alpha; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscScalar __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_idiv", 0); /* "PETSc/petscvec.pxi":256 * * cdef Vec vec_idiv(Vec self, other): * cdef PetscScalar one = 1 # <<<<<<<<<<<<<< * cdef PetscScalar alpha = 1 * cdef Vec vec */ __pyx_v_one = 1.0; /* "PETSc/petscvec.pxi":257 * cdef Vec vec_idiv(Vec self, other): * cdef PetscScalar one = 1 * cdef PetscScalar alpha = 1 # <<<<<<<<<<<<<< * cdef Vec vec * if isinstance(other, Vec): */ __pyx_v_alpha = 1.0; /* "PETSc/petscvec.pxi":259 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscvec.pxi":260 * cdef Vec vec * if isinstance(other, Vec): * vec = other # <<<<<<<<<<<<<< * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) * else: */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 260, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":261 * if isinstance(other, Vec): * vec = other * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) # <<<<<<<<<<<<<< * else: * alpha = asScalar(other) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseDivide(__pyx_v_self->vec, __pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 261, __pyx_L1_error) /* "PETSc/petscvec.pxi":259 * cdef PetscScalar alpha = 1 * cdef Vec vec * if isinstance(other, Vec): # <<<<<<<<<<<<<< * vec = other * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) */ goto __pyx_L3; } /* "PETSc/petscvec.pxi":263 * CHKERR( VecPointwiseDivide(self.vec, self.vec, vec.vec) ) * else: * alpha = asScalar(other) # <<<<<<<<<<<<<< * CHKERR( VecScale(self.vec, one/alpha) ) * return self */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_other); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(5, 263, __pyx_L1_error) __pyx_v_alpha = __pyx_t_5; /* "PETSc/petscvec.pxi":264 * else: * alpha = asScalar(other) * CHKERR( VecScale(self.vec, one/alpha) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, (__pyx_v_one / __pyx_v_alpha))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 264, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscvec.pxi":265 * alpha = asScalar(other) * CHKERR( VecScale(self.vec, one/alpha) ) * return self # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscvec.pxi":255 * return self * * cdef Vec vec_idiv(Vec self, other): # <<<<<<<<<<<<<< * cdef PetscScalar one = 1 * cdef PetscScalar alpha = 1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.vec_idiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":269 * # binary operations * * cdef Vec vec_add(Vec self, other): # <<<<<<<<<<<<<< * return vec_iadd(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_add(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_add", 0); /* "PETSc/petscvec.pxi":270 * * cdef Vec vec_add(Vec self, other): * return vec_iadd(vec_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec vec_sub(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_iadd(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":269 * # binary operations * * cdef Vec vec_add(Vec self, other): # <<<<<<<<<<<<<< * return vec_iadd(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":272 * return vec_iadd(vec_pos(self), other) * * cdef Vec vec_sub(Vec self, other): # <<<<<<<<<<<<<< * return vec_isub(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_sub(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_sub", 0); /* "PETSc/petscvec.pxi":273 * * cdef Vec vec_sub(Vec self, other): * return vec_isub(vec_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec vec_mul(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_isub(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":272 * return vec_iadd(vec_pos(self), other) * * cdef Vec vec_sub(Vec self, other): # <<<<<<<<<<<<<< * return vec_isub(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":275 * return vec_isub(vec_pos(self), other) * * cdef Vec vec_mul(Vec self, other): # <<<<<<<<<<<<<< * return vec_imul(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_mul(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_mul", 0); /* "PETSc/petscvec.pxi":276 * * cdef Vec vec_mul(Vec self, other): * return vec_imul(vec_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec vec_div(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_imul(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":275 * return vec_isub(vec_pos(self), other) * * cdef Vec vec_mul(Vec self, other): # <<<<<<<<<<<<<< * return vec_imul(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":278 * return vec_imul(vec_pos(self), other) * * cdef Vec vec_div(Vec self, other): # <<<<<<<<<<<<<< * return vec_idiv(vec_pos(self), other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_div(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_div", 0); /* "PETSc/petscvec.pxi":279 * * cdef Vec vec_div(Vec self, other): * return vec_idiv(vec_pos(self), other) # <<<<<<<<<<<<<< * * # reflected binary operations */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_idiv(((struct PyPetscVecObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":278 * return vec_imul(vec_pos(self), other) * * cdef Vec vec_div(Vec self, other): # <<<<<<<<<<<<<< * return vec_idiv(vec_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":283 * # reflected binary operations * * cdef Vec vec_radd(Vec self, other): # <<<<<<<<<<<<<< * return vec_add(self, other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_radd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_radd", 0); /* "PETSc/petscvec.pxi":284 * * cdef Vec vec_radd(Vec self, other): * return vec_add(self, other) # <<<<<<<<<<<<<< * * cdef Vec vec_rsub(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_add(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":283 * # reflected binary operations * * cdef Vec vec_radd(Vec self, other): # <<<<<<<<<<<<<< * return vec_add(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_radd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":286 * return vec_add(self, other) * * cdef Vec vec_rsub(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rsub(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_rsub", 0); /* "PETSc/petscvec.pxi":287 * * cdef Vec vec_rsub(Vec self, other): * cdef Vec vec = vec_sub(self, other) # <<<<<<<<<<<<<< * CHKERR( VecScale(vec.vec, -1) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_sub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscvec.pxi":288 * cdef Vec vec_rsub(Vec self, other): * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_vec->vec, -1.0)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 288, __pyx_L1_error) /* "PETSc/petscvec.pxi":289 * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) * return vec # <<<<<<<<<<<<<< * * cdef Vec vec_rmul(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "PETSc/petscvec.pxi":286 * return vec_add(self, other) * * cdef Vec vec_rsub(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_sub(self, other) * CHKERR( VecScale(vec.vec, -1) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":291 * return vec * * cdef Vec vec_rmul(Vec self, other): # <<<<<<<<<<<<<< * return vec_mul(self, other) * */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rmul(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_rmul", 0); /* "PETSc/petscvec.pxi":292 * * cdef Vec vec_rmul(Vec self, other): * return vec_mul(self, other) # <<<<<<<<<<<<<< * * cdef Vec vec_rdiv(Vec self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_mul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":291 * return vec * * cdef Vec vec_rmul(Vec self, other): # <<<<<<<<<<<<<< * return vec_mul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_rmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":294 * return vec_mul(self, other) * * cdef Vec vec_rdiv(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_vec_rdiv(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_rdiv", 0); /* "PETSc/petscvec.pxi":295 * * cdef Vec vec_rdiv(Vec self, other): * cdef Vec vec = vec_div(self, other) # <<<<<<<<<<<<<< * CHKERR( VecReciprocal(vec.vec) ) * return vec */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscvec.pxi":296 * cdef Vec vec_rdiv(Vec self, other): * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecReciprocal(__pyx_v_vec->vec)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 296, __pyx_L1_error) /* "PETSc/petscvec.pxi":297 * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) * return vec # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = __pyx_v_vec; goto __pyx_L0; /* "PETSc/petscvec.pxi":294 * return vec_mul(self, other) * * cdef Vec vec_rdiv(Vec self, other): # <<<<<<<<<<<<<< * cdef Vec vec = vec_div(self, other) * CHKERR( VecReciprocal(vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":301 * # -------------------------------------------------------------------- * * cdef inline int Vec_Sizes(object size, object bsize, # <<<<<<<<<<<<<< * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Vec_Sizes(PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PetscInt *__pyx_v_b, PetscInt *__pyx_v_n, PetscInt *__pyx_v_N) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Vec_Sizes", 0); /* "PETSc/petscvec.pxi":303 * cdef inline int Vec_Sizes(object size, object bsize, * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_size, __pyx_v_bsize, __pyx_v_b, __pyx_v_n, __pyx_v_N); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 303, __pyx_L1_error) /* "PETSc/petscvec.pxi":304 * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) * return 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":301 * # -------------------------------------------------------------------- * * cdef inline int Vec_Sizes(object size, object bsize, # <<<<<<<<<<<<<< * PetscInt *b, PetscInt *n, PetscInt *N) except -1: * Sys_Sizes(size, bsize, b, n, N) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":312 * const PetscScalar*,PetscInsertMode) * * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal */ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(int __pyx_v_blocked, int __pyx_v_local) { __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_v_setvalues; __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("vecsetvalues_fcn", 0); /* "PETSc/petscvec.pxi":313 * * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): * cdef VecSetValuesFcn *setvalues = NULL # <<<<<<<<<<<<<< * if blocked and local: setvalues = VecSetValuesBlockedLocal * elif blocked: setvalues = VecSetValuesBlocked */ __pyx_v_setvalues = NULL; /* "PETSc/petscvec.pxi":314 * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal # <<<<<<<<<<<<<< * elif blocked: setvalues = VecSetValuesBlocked * elif local: setvalues = VecSetValuesLocal */ __pyx_t_2 = (__pyx_v_blocked != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_local != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { __pyx_v_setvalues = VecSetValuesBlockedLocal; goto __pyx_L3; } /* "PETSc/petscvec.pxi":315 * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal * elif blocked: setvalues = VecSetValuesBlocked # <<<<<<<<<<<<<< * elif local: setvalues = VecSetValuesLocal * else: setvalues = VecSetValues */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_v_setvalues = VecSetValuesBlocked; goto __pyx_L3; } /* "PETSc/petscvec.pxi":316 * if blocked and local: setvalues = VecSetValuesBlockedLocal * elif blocked: setvalues = VecSetValuesBlocked * elif local: setvalues = VecSetValuesLocal # <<<<<<<<<<<<<< * else: setvalues = VecSetValues * return setvalues */ __pyx_t_1 = (__pyx_v_local != 0); if (__pyx_t_1) { __pyx_v_setvalues = VecSetValuesLocal; goto __pyx_L3; } /* "PETSc/petscvec.pxi":317 * elif blocked: setvalues = VecSetValuesBlocked * elif local: setvalues = VecSetValuesLocal * else: setvalues = VecSetValues # <<<<<<<<<<<<<< * return setvalues * */ /*else*/ { __pyx_v_setvalues = VecSetValues; } __pyx_L3:; /* "PETSc/petscvec.pxi":318 * elif local: setvalues = VecSetValuesLocal * else: setvalues = VecSetValues * return setvalues # <<<<<<<<<<<<<< * * cdef inline int vecsetvalues(PetscVec V, */ __pyx_r = __pyx_v_setvalues; goto __pyx_L0; /* "PETSc/petscvec.pxi":312 * const PetscScalar*,PetscInsertMode) * * cdef inline VecSetValuesFcn* vecsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef VecSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = VecSetValuesBlockedLocal */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":320 * return setvalues * * cdef inline int vecsetvalues(PetscVec V, # <<<<<<<<<<<<<< * object oi, object ov, object oim, * int blocked, int local) except -1: */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vecsetvalues(Vec __pyx_v_V, PyObject *__pyx_v_oi, PyObject *__pyx_v_ov, PyObject *__pyx_v_oim, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_bs; PetscInt __pyx_v_ni; PetscInt __pyx_v_nv; PetscInt *__pyx_v_i; PetscScalar *__pyx_v_v; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; InsertMode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vecsetvalues", 0); /* "PETSc/petscvec.pxi":324 * int blocked, int local) except -1: * # block size * cdef PetscInt bs=1 # <<<<<<<<<<<<<< * if blocked: * CHKERR( VecGetBlockSize(V, &bs) ) */ __pyx_v_bs = 1; /* "PETSc/petscvec.pxi":325 * # block size * cdef PetscInt bs=1 * if blocked: # <<<<<<<<<<<<<< * CHKERR( VecGetBlockSize(V, &bs) ) * if bs < 1: bs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":326 * cdef PetscInt bs=1 * if blocked: * CHKERR( VecGetBlockSize(V, &bs) ) # <<<<<<<<<<<<<< * if bs < 1: bs = 1 * # indices and values */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetBlockSize(__pyx_v_V, (&__pyx_v_bs))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 326, __pyx_L1_error) /* "PETSc/petscvec.pxi":327 * if blocked: * CHKERR( VecGetBlockSize(V, &bs) ) * if bs < 1: bs = 1 # <<<<<<<<<<<<<< * # indices and values * cdef PetscInt ni=0, nv=0 */ __pyx_t_1 = ((__pyx_v_bs < 1) != 0); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "PETSc/petscvec.pxi":325 * # block size * cdef PetscInt bs=1 * if blocked: # <<<<<<<<<<<<<< * CHKERR( VecGetBlockSize(V, &bs) ) * if bs < 1: bs = 1 */ } /* "PETSc/petscvec.pxi":329 * if bs < 1: bs = 1 * # indices and values * cdef PetscInt ni=0, nv=0 # <<<<<<<<<<<<<< * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL */ __pyx_v_ni = 0; __pyx_v_nv = 0; /* "PETSc/petscvec.pxi":330 * # indices and values * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef object tmp1 = iarray_i(oi, &ni, &i) */ __pyx_v_i = NULL; /* "PETSc/petscvec.pxi":331 * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) */ __pyx_v_v = NULL; /* "PETSc/petscvec.pxi":332 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL * cdef object tmp1 = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tmp1 = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":333 * cdef PetscScalar *v=NULL * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * if ni*bs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tmp2 = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":334 * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % * (toInt(ni), toInt(nv), toInt(bs)) ) */ __pyx_t_1 = (((__pyx_v_ni * __pyx_v_bs) != __pyx_v_nv) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/petscvec.pxi":336 * if ni*bs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % * (toInt(ni), toInt(nv), toInt(bs)) ) # <<<<<<<<<<<<<< * # VecSetValuesXXX function and insert mode * cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "PETSc/petscvec.pxi":335 * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nv), toInt(bs)) ) * # VecSetValuesXXX function and insert mode */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nv, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscvec.pxi":334 * cdef object tmp1 = iarray_i(oi, &ni, &i) * cdef object tmp2 = iarray_s(ov, &nv, &v) * if ni*bs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nv=%d, bs=%d" % * (toInt(ni), toInt(nv), toInt(bs)) ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(5, 334, __pyx_L1_error) } /* "PETSc/petscvec.pxi":338 * (toInt(ni), toInt(nv), toInt(bs)) ) * # VecSetValuesXXX function and insert mode * cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oim) * # actual call */ __pyx_v_setvalues = __pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); /* "PETSc/petscvec.pxi":339 * # VecSetValuesXXX function and insert mode * cdef VecSetValuesFcn *setvalues = vecsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oim) # <<<<<<<<<<<<<< * # actual call * CHKERR( setvalues(V, ni, i, v, addv) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oim); if (unlikely(__pyx_t_7 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(5, 339, __pyx_L1_error) __pyx_v_addv = __pyx_t_7; /* "PETSc/petscvec.pxi":341 * cdef PetscInsertMode addv = insertmode(oim) * # actual call * CHKERR( setvalues(V, ni, i, v, addv) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_V, __pyx_v_ni, __pyx_v_i, __pyx_v_v, __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 341, __pyx_L1_error) /* "PETSc/petscvec.pxi":342 * # actual call * CHKERR( setvalues(V, ni, i, v, addv) ) * return 0 # <<<<<<<<<<<<<< * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":320 * return setvalues * * cdef inline int vecsetvalues(PetscVec V, # <<<<<<<<<<<<<< * object oi, object ov, object oim, * int blocked, int local) except -1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.vecsetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":344 * return 0 * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL */ static PyObject *__pyx_f_8petsc4py_5PETSc_vecgetvalues(Vec __pyx_v_vec, PyObject *__pyx_v_oindices, PyObject *__pyx_v_values) { PetscInt __pyx_v_ni; PetscInt __pyx_v_nv; PetscInt *__pyx_v_i; PetscScalar *__pyx_v_v; PyObject *__pyx_v_indices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vecgetvalues", 0); __Pyx_INCREF(__pyx_v_values); /* "PETSc/petscvec.pxi":345 * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): * cdef PetscInt ni=0, nv=0 # <<<<<<<<<<<<<< * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL */ __pyx_v_ni = 0; __pyx_v_nv = 0; /* "PETSc/petscvec.pxi":346 * cdef object vecgetvalues(PetscVec vec, object oindices, object values): * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) */ __pyx_v_i = NULL; /* "PETSc/petscvec.pxi":347 * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: */ __pyx_v_v = NULL; /* "PETSc/petscvec.pxi":348 * cdef PetscInt *i=NULL * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) # <<<<<<<<<<<<<< * if values is None: * values = empty_s(ni) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oindices, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_indices = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":349 * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni) * values.shape = indices.shape */ __pyx_t_2 = (__pyx_v_values == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscvec.pxi":350 * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: * values = empty_s(ni) # <<<<<<<<<<<<<< * values.shape = indices.shape * values = oarray_s(values, &nv, &v) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s(__pyx_v_ni)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":351 * if values is None: * values = empty_s(ni) * values.shape = indices.shape # <<<<<<<<<<<<<< * values = oarray_s(values, &nv, &v) * if (ni != nv): raise ValueError( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_indices, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_values, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(5, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":349 * cdef PetscScalar *v=NULL * cdef object indices = iarray_i(oindices, &ni, &i) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni) * values.shape = indices.shape */ } /* "PETSc/petscvec.pxi":352 * values = empty_s(ni) * values.shape = indices.shape * values = oarray_s(values, &nv, &v) # <<<<<<<<<<<<<< * if (ni != nv): raise ValueError( * ("incompatible array sizes: " */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_values, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":353 * values.shape = indices.shape * values = oarray_s(values, &nv, &v) * if (ni != nv): raise ValueError( # <<<<<<<<<<<<<< * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) */ __pyx_t_3 = ((__pyx_v_ni != __pyx_v_nv) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscvec.pxi":355 * if (ni != nv): raise ValueError( * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) # <<<<<<<<<<<<<< * CHKERR( VecGetValues(vec, ni, i, v) ) * return values */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscvec.pxi":353 * values.shape = indices.shape * values = oarray_s(values, &nv, &v) * if (ni != nv): raise ValueError( # <<<<<<<<<<<<<< * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(5, 353, __pyx_L1_error) } /* "PETSc/petscvec.pxi":356 * ("incompatible array sizes: " * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) * CHKERR( VecGetValues(vec, ni, i, v) ) # <<<<<<<<<<<<<< * return values * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetValues(__pyx_v_vec, __pyx_v_ni, __pyx_v_i, __pyx_v_v)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 356, __pyx_L1_error) /* "PETSc/petscvec.pxi":357 * "ni=%d, nv=%d") % (toInt(ni), toInt(nv))) * CHKERR( VecGetValues(vec, ni, i, v) ) * return values # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_values); __pyx_r = __pyx_v_values; goto __pyx_L0; /* "PETSc/petscvec.pxi":344 * return 0 * * cdef object vecgetvalues(PetscVec vec, object oindices, object values): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, nv=0 * cdef PetscInt *i=NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.vecgetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XDECREF(__pyx_v_values); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":361 * # -------------------------------------------------------------------- * * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(struct PyPetscVecObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getbuffer_r", 0); /* "PETSc/petscvec.pxi":362 * * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * buf.readonly = 1 * return buf */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":363 * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 # <<<<<<<<<<<<<< * return buf * */ __pyx_v_buf->readonly = 1; /* "PETSc/petscvec.pxi":364 * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 * return buf # <<<<<<<<<<<<<< * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_buf)); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "PETSc/petscvec.pxi":361 * # -------------------------------------------------------------------- * * cdef inline _Vec_buffer vec_getbuffer_r(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_getbuffer_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":366 * return buf * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 */ static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(struct PyPetscVecObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getbuffer_w", 0); /* "PETSc/petscvec.pxi":367 * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * buf.readonly = 0 * return buf */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":368 * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 # <<<<<<<<<<<<<< * return buf * */ __pyx_v_buf->readonly = 0; /* "PETSc/petscvec.pxi":369 * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 * return buf # <<<<<<<<<<<<<< * * cdef inline ndarray vec_getarray_r(Vec self): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_buf)); __pyx_r = __pyx_v_buf; goto __pyx_L0; /* "PETSc/petscvec.pxi":366 * return buf * * cdef inline _Vec_buffer vec_getbuffer_w(Vec self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.readonly = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.vec_getbuffer_w", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":371 * return buf * * cdef inline ndarray vec_getarray_r(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_r(self)) * */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_r(struct PyPetscVecObject *__pyx_v_self) { PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getarray_r", 0); /* "PETSc/petscvec.pxi":372 * * cdef inline ndarray vec_getarray_r(Vec self): * return asarray(vec_getbuffer_r(self)) # <<<<<<<<<<<<<< * * cdef inline ndarray vec_getarray_w(Vec self): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":371 * return buf * * cdef inline ndarray vec_getarray_r(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_r(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_getarray_r", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":374 * return asarray(vec_getbuffer_r(self)) * * cdef inline ndarray vec_getarray_w(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_w(self)) * */ static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_vec_getarray_w(struct PyPetscVecObject *__pyx_v_self) { PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getarray_w", 0); /* "PETSc/petscvec.pxi":375 * * cdef inline ndarray vec_getarray_w(Vec self): * return asarray(vec_getbuffer_w(self)) # <<<<<<<<<<<<<< * * cdef inline int vec_setarray(Vec self, object o) except -1: */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":374 * return asarray(vec_getbuffer_r(self)) * * cdef inline ndarray vec_getarray_w(Vec self): # <<<<<<<<<<<<<< * return asarray(vec_getbuffer_w(self)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.vec_getarray_w", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":377 * return asarray(vec_getbuffer_w(self)) * * cdef inline int vec_setarray(Vec self, object o) except -1: # <<<<<<<<<<<<<< * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_vec_setarray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_o) { PetscInt __pyx_v_na; PetscInt __pyx_v_nv; PetscInt __pyx_v_i; PetscScalar *__pyx_v_va; PetscScalar *__pyx_v_vv; PyArrayObject *__pyx_v_ary = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PetscInt __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_setarray", 0); /* "PETSc/petscvec.pxi":378 * * cdef inline int vec_setarray(Vec self, object o) except -1: * cdef PetscInt na=0, nv=0, i=0 # <<<<<<<<<<<<<< * cdef PetscScalar *va=NULL, *vv=NULL * cdef ndarray ary = iarray_s(o, &na, &va) */ __pyx_v_na = 0; __pyx_v_nv = 0; __pyx_v_i = 0; /* "PETSc/petscvec.pxi":379 * cdef inline int vec_setarray(Vec self, object o) except -1: * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL # <<<<<<<<<<<<<< * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) */ __pyx_v_va = NULL; __pyx_v_vv = NULL; /* "PETSc/petscvec.pxi":380 * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL * cdef ndarray ary = iarray_s(o, &na, &va) # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_o, (&__pyx_v_na), (&__pyx_v_va))); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ary = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":381 * cdef PetscScalar *va=NULL, *vv=NULL * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) # <<<<<<<<<<<<<< * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( * "array size %d incompatible with vector local size %d" % */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_nv))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 381, __pyx_L1_error) /* "PETSc/petscvec.pxi":382 * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( # <<<<<<<<<<<<<< * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) */ __pyx_t_4 = ((__pyx_v_na != __pyx_v_nv) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((PyArray_NDIM(__pyx_v_ary) > 0) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_3)) { /* "PETSc/petscvec.pxi":384 * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) # <<<<<<<<<<<<<< * CHKERR( VecGetArray(self.vec, &vv) ) * try: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_1 = 0; __pyx_t_5 = 0; /* "PETSc/petscvec.pxi":383 * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( * "array size %d incompatible with vector local size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(nv)) ) * CHKERR( VecGetArray(self.vec, &vv) ) */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_incompatible_with_v, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscvec.pxi":382 * cdef ndarray ary = iarray_s(o, &na, &va) * CHKERR( VecGetLocalSize(self.vec, &nv) ) * if (na != nv) and PyArray_NDIM(ary) > 0: raise ValueError( # <<<<<<<<<<<<<< * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(5, 382, __pyx_L1_error) } /* "PETSc/petscvec.pxi":385 * "array size %d incompatible with vector local size %d" % * (toInt(na), toInt(nv)) ) * CHKERR( VecGetArray(self.vec, &vv) ) # <<<<<<<<<<<<<< * try: * if PyArray_NDIM(ary) == 0: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 385, __pyx_L1_error) /* "PETSc/petscvec.pxi":386 * (toInt(na), toInt(nv)) ) * CHKERR( VecGetArray(self.vec, &vv) ) * try: # <<<<<<<<<<<<<< * if PyArray_NDIM(ary) == 0: * for i from 0 <= i < nv: */ /*try:*/ { /* "PETSc/petscvec.pxi":387 * CHKERR( VecGetArray(self.vec, &vv) ) * try: * if PyArray_NDIM(ary) == 0: # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * vv[i] = va[0] */ __pyx_t_3 = ((PyArray_NDIM(__pyx_v_ary) == 0) != 0); if (__pyx_t_3) { /* "PETSc/petscvec.pxi":388 * try: * if PyArray_NDIM(ary) == 0: * for i from 0 <= i < nv: # <<<<<<<<<<<<<< * vv[i] = va[0] * else: */ __pyx_t_7 = __pyx_v_nv; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { /* "PETSc/petscvec.pxi":389 * if PyArray_NDIM(ary) == 0: * for i from 0 <= i < nv: * vv[i] = va[0] # <<<<<<<<<<<<<< * else: * CHKERR( PetscMemcpy(vv, va, nv*sizeof(PetscScalar)) ) */ (__pyx_v_vv[__pyx_v_i]) = (__pyx_v_va[0]); } /* "PETSc/petscvec.pxi":387 * CHKERR( VecGetArray(self.vec, &vv) ) * try: * if PyArray_NDIM(ary) == 0: # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * vv[i] = va[0] */ goto __pyx_L9; } /* "PETSc/petscvec.pxi":391 * vv[i] = va[0] * else: * CHKERR( PetscMemcpy(vv, va, nv*sizeof(PetscScalar)) ) # <<<<<<<<<<<<<< * finally: * CHKERR( VecRestoreArray(self.vec, &vv) ) */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy(__pyx_v_vv, __pyx_v_va, (((size_t)__pyx_v_nv) * (sizeof(PetscScalar))))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 391, __pyx_L7_error) } __pyx_L9:; } /* "PETSc/petscvec.pxi":393 * CHKERR( PetscMemcpy(vv, va, nv*sizeof(PetscScalar)) ) * finally: * CHKERR( VecRestoreArray(self.vec, &vv) ) # <<<<<<<<<<<<<< * return 0 * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 393, __pyx_L1_error) goto __pyx_L8; } __pyx_L7_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_2 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { __pyx_t_16 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, (&__pyx_v_vv))); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(5, 393, __pyx_L13_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; __pyx_L13_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; goto __pyx_L1_error; } __pyx_L8:; } /* "PETSc/petscvec.pxi":394 * finally: * CHKERR( VecRestoreArray(self.vec, &vv) ) * return 0 # <<<<<<<<<<<<<< * * cdef object vec_getitem(Vec self, object i): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":377 * return asarray(vec_getbuffer_w(self)) * * cdef inline int vec_setarray(Vec self, object o) except -1: # <<<<<<<<<<<<<< * cdef PetscInt na=0, nv=0, i=0 * cdef PetscScalar *va=NULL, *vv=NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.vec_setarray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ary); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":396 * return 0 * * cdef object vec_getitem(Vec self, object i): # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ static PyObject *__pyx_f_8petsc4py_5PETSc_vec_getitem(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i) { PetscInt __pyx_v_N; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_getitem", 0); __Pyx_INCREF(__pyx_v_i); /* "PETSc/petscvec.pxi":397 * * cdef object vec_getitem(Vec self, object i): * cdef PetscInt N=0 # <<<<<<<<<<<<<< * if i is Ellipsis: * return asarray(self) */ __pyx_v_N = 0; /* "PETSc/petscvec.pxi":398 * cdef object vec_getitem(Vec self, object i): * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return asarray(self) * if isinstance(i, slice): */ __pyx_t_1 = (__pyx_v_i == __pyx_builtin_Ellipsis); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscvec.pxi":399 * cdef PetscInt N=0 * if i is Ellipsis: * return asarray(self) # <<<<<<<<<<<<<< * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":398 * cdef object vec_getitem(Vec self, object i): * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return asarray(self) * if isinstance(i, slice): */ } /* "PETSc/petscvec.pxi":400 * if i is Ellipsis: * return asarray(self) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ __pyx_t_2 = PySlice_Check(__pyx_v_i); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":401 * return asarray(self) * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 401, __pyx_L1_error) /* "PETSc/petscvec.pxi":402 * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) # <<<<<<<<<<<<<< * i = arange(start, stop, stride) * return vecgetvalues(self.vec, i, None) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(5, 402, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(5, 402, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(5, 402, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_start = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_stop = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_stride = __pyx_t_7; __pyx_t_7 = 0; /* "PETSc/petscvec.pxi":403 * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) # <<<<<<<<<<<<<< * return vecgetvalues(self.vec, i, None) * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":400 * if i is Ellipsis: * return asarray(self) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ } /* "PETSc/petscvec.pxi":404 * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) * return vecgetvalues(self.vec, i, None) # <<<<<<<<<<<<<< * * cdef int vec_setitem(Vec self, object i, object v) except -1: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_vecgetvalues(__pyx_v_self->vec, __pyx_v_i, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":396 * return 0 * * cdef object vec_getitem(Vec self, object i): # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.vec_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":406 * return vecgetvalues(self.vec, i, None) * * cdef int vec_setitem(Vec self, object i, object v) except -1: # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ static int __pyx_f_8petsc4py_5PETSc_vec_setitem(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) { PetscInt __pyx_v_N; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vec_setitem", 0); __Pyx_INCREF(__pyx_v_i); /* "PETSc/petscvec.pxi":407 * * cdef int vec_setitem(Vec self, object i, object v) except -1: * cdef PetscInt N=0 # <<<<<<<<<<<<<< * if i is Ellipsis: * return vec_setarray(self, v) */ __pyx_v_N = 0; /* "PETSc/petscvec.pxi":408 * cdef int vec_setitem(Vec self, object i, object v) except -1: * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return vec_setarray(self, v) * if isinstance(i, slice): */ __pyx_t_1 = (__pyx_v_i == __pyx_builtin_Ellipsis); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscvec.pxi":409 * cdef PetscInt N=0 * if i is Ellipsis: * return vec_setarray(self, v) # <<<<<<<<<<<<<< * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_self, __pyx_v_v); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 409, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/petscvec.pxi":408 * cdef int vec_setitem(Vec self, object i, object v) except -1: * cdef PetscInt N=0 * if i is Ellipsis: # <<<<<<<<<<<<<< * return vec_setarray(self, v) * if isinstance(i, slice): */ } /* "PETSc/petscvec.pxi":410 * if i is Ellipsis: * return vec_setarray(self, v) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ __pyx_t_2 = PySlice_Check(__pyx_v_i); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":411 * return vec_setarray(self, v) * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 411, __pyx_L1_error) /* "PETSc/petscvec.pxi":412 * if isinstance(i, slice): * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) # <<<<<<<<<<<<<< * i = arange(start, stop, stride) * vecsetvalues(self.vec, i, v, None, 0, 0) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { PyObject* sequence = __pyx_t_4; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(5, 412, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(5, 412, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(5, 412, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_start = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_stop = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_stride = __pyx_t_7; __pyx_t_7 = 0; /* "PETSc/petscvec.pxi":413 * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) # <<<<<<<<<<<<<< * vecsetvalues(self.vec, i, v, None, 0, 0) * return 0 */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscvec.pxi":410 * if i is Ellipsis: * return vec_setarray(self, v) * if isinstance(i, slice): # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * start, stop, stride = i.indices(toInt(N)) */ } /* "PETSc/petscvec.pxi":414 * start, stop, stride = i.indices(toInt(N)) * i = arange(start, stop, stride) * vecsetvalues(self.vec, i, v, None, 0, 0) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_i, __pyx_v_v, Py_None, 0, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 414, __pyx_L1_error) /* "PETSc/petscvec.pxi":415 * i = arange(start, stop, stride) * vecsetvalues(self.vec, i, v, None, 0, 0) * return 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":406 * return vecgetvalues(self.vec, i, None) * * cdef int vec_setitem(Vec self, object i, object v) except -1: # <<<<<<<<<<<<<< * cdef PetscInt N=0 * if i is Ellipsis: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.vec_setitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XDECREF(__pyx_v_i); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":427 * # -------------------------------------------------------------------- * * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<< * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) */ static int __pyx_f_8petsc4py_5PETSc_Vec_AcquireArray(Vec __pyx_v_v, PetscScalar **__pyx_v_a, int __pyx_v_ro) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "PETSc/petscvec.pxi":428 * * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: * if ro: CHKERR( VecGetArrayRead(v, a) ) # <<<<<<<<<<<<<< * else: CHKERR( VecGetArray(v, a) ) * return 0 */ __pyx_t_1 = (__pyx_v_ro != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayRead(__pyx_v_v, ((PetscScalar const **)__pyx_v_a))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 428, __pyx_L1_error) goto __pyx_L3; } /* "PETSc/petscvec.pxi":429 * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_v, __pyx_v_a)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 429, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscvec.pxi":430 * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) * return 0 # <<<<<<<<<<<<<< * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":427 * # -------------------------------------------------------------------- * * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<< * if ro: CHKERR( VecGetArrayRead(v, a) ) * else: CHKERR( VecGetArray(v, a) ) */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.Vec_AcquireArray", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "PETSc/petscvec.pxi":432 * return 0 * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<< * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) */ static int __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(Vec __pyx_v_v, PetscScalar **__pyx_v_a, int __pyx_v_ro) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "PETSc/petscvec.pxi":433 * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: * if ro: CHKERR( VecRestoreArrayRead(v, a) ) # <<<<<<<<<<<<<< * else: CHKERR( VecRestoreArray(v, a) ) * return 0 */ __pyx_t_1 = (__pyx_v_ro != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayRead(__pyx_v_v, ((PetscScalar const **)__pyx_v_a))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 433, __pyx_L1_error) goto __pyx_L3; } /* "PETSc/petscvec.pxi":434 * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_v, __pyx_v_a)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 434, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscvec.pxi":435 * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) * return 0 # <<<<<<<<<<<<<< * * cdef class _Vec_buffer: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":432 * return 0 * * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) nogil except -1: # <<<<<<<<<<<<<< * if ro: CHKERR( VecRestoreArrayRead(v, a) ) * else: CHKERR( VecRestoreArray(v, a) ) */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc.Vec_ReleaseArray", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "PETSc/petscvec.pxi":445 * cdef bint hasarray * * def __cinit__(self, Vec vec, bint readonly=0): # <<<<<<<<<<<<<< * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_v_readonly; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_readonly,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(5, 445, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); if (values[1]) { __pyx_v_readonly = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_readonly == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 445, __pyx_L3_error) } else { __pyx_v_readonly = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 445, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(5, 445, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), __pyx_v_vec, __pyx_v_readonly); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer___cinit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_readonly) { Vec __pyx_v_v; int __pyx_r; __Pyx_RefNannyDeclarations Vec __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/petscvec.pxi":446 * * def __cinit__(self, Vec vec, bint readonly=0): * cdef PetscVec v = vec.vec # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&v) ) * self.vec = v */ __pyx_t_1 = __pyx_v_vec->vec; __pyx_v_v = __pyx_t_1; /* "PETSc/petscvec.pxi":447 * def __cinit__(self, Vec vec, bint readonly=0): * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) # <<<<<<<<<<<<<< * self.vec = v * self.size = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_v)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 447, __pyx_L1_error) /* "PETSc/petscvec.pxi":448 * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) * self.vec = v # <<<<<<<<<<<<<< * self.size = 0 * self.data = NULL */ __pyx_v_self->vec = __pyx_v_v; /* "PETSc/petscvec.pxi":449 * CHKERR( PetscINCREF(&v) ) * self.vec = v * self.size = 0 # <<<<<<<<<<<<<< * self.data = NULL * self.readonly = 1 if readonly else 0 */ __pyx_v_self->size = 0; /* "PETSc/petscvec.pxi":450 * self.vec = v * self.size = 0 * self.data = NULL # <<<<<<<<<<<<<< * self.readonly = 1 if readonly else 0 * self.hasarray = 0 */ __pyx_v_self->data = NULL; /* "PETSc/petscvec.pxi":451 * self.size = 0 * self.data = NULL * self.readonly = 1 if readonly else 0 # <<<<<<<<<<<<<< * self.hasarray = 0 * */ if ((__pyx_v_readonly != 0)) { __pyx_t_3 = 1; } else { __pyx_t_3 = 0; } __pyx_v_self->readonly = __pyx_t_3; /* "PETSc/petscvec.pxi":452 * self.data = NULL * self.readonly = 1 if readonly else 0 * self.hasarray = 0 # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->hasarray = 0; /* "PETSc/petscvec.pxi":445 * cdef bint hasarray * * def __cinit__(self, Vec vec, bint readonly=0): # <<<<<<<<<<<<<< * cdef PetscVec v = vec.vec * CHKERR( PetscINCREF(&v) ) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":454 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/petscvec.pxi":455 * * def __dealloc__(self): * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * CHKERR( VecDestroy(&self.vec) ) */ __pyx_t_2 = (__pyx_v_self->hasarray != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->vec != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/petscvec.pxi":456 * def __dealloc__(self): * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&self.vec) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 456, __pyx_L1_error) /* "PETSc/petscvec.pxi":455 * * def __dealloc__(self): * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * CHKERR( VecDestroy(&self.vec) ) */ } /* "PETSc/petscvec.pxi":457 * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * CHKERR( VecDestroy(&self.vec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->vec))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 457, __pyx_L1_error) /* "PETSc/petscvec.pxi":454 * self.hasarray = 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._Vec_buffer.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/petscvec.pxi":461 * # * * cdef int acquire(self) nogil except -1: # <<<<<<<<<<<<<< * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquire(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "PETSc/petscvec.pxi":462 * * cdef int acquire(self) nogil except -1: * if not self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) */ __pyx_t_2 = ((!(__pyx_v_self->hasarray != 0)) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->vec != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/petscvec.pxi":463 * cdef int acquire(self) nogil except -1: * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) # <<<<<<<<<<<<<< * Vec_AcquireArray(self.vec, &self.data, self.readonly) * self.hasarray = 1 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_self->size))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 463, __pyx_L1_error) /* "PETSc/petscvec.pxi":464 * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<< * self.hasarray = 1 * return 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_AcquireArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 464, __pyx_L1_error) /* "PETSc/petscvec.pxi":465 * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) * self.hasarray = 1 # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->hasarray = 1; /* "PETSc/petscvec.pxi":462 * * cdef int acquire(self) nogil except -1: * if not self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &self.size) ) * Vec_AcquireArray(self.vec, &self.data, self.readonly) */ } /* "PETSc/petscvec.pxi":466 * Vec_AcquireArray(self.vec, &self.data, self.readonly) * self.hasarray = 1 * return 0 # <<<<<<<<<<<<<< * * cdef int release(self) nogil except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":461 * # * * cdef int acquire(self) nogil except -1: # <<<<<<<<<<<<<< * if not self.hasarray and self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &self.size) ) */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "PETSc/petscvec.pxi":468 * return 0 * * cdef int release(self) nogil except -1: # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * self.size = 0 */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_release(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "PETSc/petscvec.pxi":469 * * cdef int release(self) nogil except -1: * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ __pyx_t_2 = (__pyx_v_self->hasarray != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_self->vec != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/petscvec.pxi":470 * cdef int release(self) nogil except -1: * if self.hasarray and self.vec != NULL: * self.size = 0 # <<<<<<<<<<<<<< * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * self.hasarray = 0 */ __pyx_v_self->size = 0; /* "PETSc/petscvec.pxi":471 * if self.hasarray and self.vec != NULL: * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) # <<<<<<<<<<<<<< * self.hasarray = 0 * return 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_ReleaseArray(__pyx_v_self->vec, (&__pyx_v_self->data), __pyx_v_self->readonly); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 471, __pyx_L1_error) /* "PETSc/petscvec.pxi":472 * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * self.hasarray = 0 # <<<<<<<<<<<<<< * return 0 * */ __pyx_v_self->hasarray = 0; /* "PETSc/petscvec.pxi":469 * * cdef int release(self) nogil except -1: * if self.hasarray and self.vec != NULL: # <<<<<<<<<<<<<< * self.size = 0 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) */ } /* "PETSc/petscvec.pxi":473 * Vec_ReleaseArray(self.vec, &self.data, self.readonly) * self.hasarray = 0 * return 0 # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":468 * return 0 * * cdef int release(self) nogil except -1: # <<<<<<<<<<<<<< * if self.hasarray and self.vec != NULL: * self.size = 0 */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.release", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "PETSc/petscvec.pxi":477 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquirebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acquirebuffer", 0); /* "PETSc/petscvec.pxi":478 * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() # <<<<<<<<<<<<<< * PyPetscBuffer_FillInfo(view, self.data, self.size, * c's', self.readonly, flags) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 478, __pyx_L1_error) /* "PETSc/petscvec.pxi":479 * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, # <<<<<<<<<<<<<< * c's', self.readonly, flags) * view.obj = self */ __pyx_t_1 = PyPetscBuffer_FillInfo(__pyx_v_view, ((void *)__pyx_v_self->data), __pyx_v_self->size, 's', __pyx_v_self->readonly, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 479, __pyx_L1_error) /* "PETSc/petscvec.pxi":481 * PyPetscBuffer_FillInfo(view, self.data, self.size, * c's', self.readonly, flags) * view.obj = self # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = ((PyObject *)__pyx_v_self); /* "PETSc/petscvec.pxi":482 * c's', self.readonly, flags) * view.obj = self * return 0 # <<<<<<<<<<<<<< * * cdef int releasebuffer(self, Py_buffer *view) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":477 * # buffer interface (PEP 3118) * * cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1: # <<<<<<<<<<<<<< * self.acquire() * PyPetscBuffer_FillInfo(view, self.data, self.size, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.acquirebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":484 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ static int __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_releasebuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("releasebuffer", 0); /* "PETSc/petscvec.pxi":485 * * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) # <<<<<<<<<<<<<< * self.release() * return 0 */ PyPetscBuffer_Release(__pyx_v_view); /* "PETSc/petscvec.pxi":486 * cdef int releasebuffer(self, Py_buffer *view) except -1: * PyPetscBuffer_Release(view) * self.release() # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 486, __pyx_L1_error) /* "PETSc/petscvec.pxi":487 * PyPetscBuffer_Release(view) * self.release() * return 0 # <<<<<<<<<<<<<< * * def __getbuffer__(self, Py_buffer *view, int flags): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":484 * return 0 * * cdef int releasebuffer(self, Py_buffer *view) except -1: # <<<<<<<<<<<<<< * PyPetscBuffer_Release(view) * self.release() */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.releasebuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":489 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_4__getbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_4__getbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (__pyx_v_view == NULL) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "PETSc/petscvec.pxi":490 * * def __getbuffer__(self, Py_buffer *view, int flags): * self.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquirebuffer(__pyx_v_self, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 490, __pyx_L1_error) /* "PETSc/petscvec.pxi":489 * return 0 * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * self.acquirebuffer(view, flags) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":492 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* Python wrapper */ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_6__releasebuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_6__releasebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_buffer *__pyx_v_view) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__releasebuffer__", 0); /* "PETSc/petscvec.pxi":493 * * def __releasebuffer__(self, Py_buffer *view): * self.releasebuffer(view) # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->releasebuffer(__pyx_v_self, __pyx_v_view); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 493, __pyx_L1_error) /* "PETSc/petscvec.pxi":492 * self.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * self.releasebuffer(view) * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._Vec_buffer.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/petscvec.pxi":497 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_enter(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("enter", 0); /* "PETSc/petscvec.pxi":498 * * cdef object enter(self): * self.acquire() # <<<<<<<<<<<<<< * return asarray(self) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 498, __pyx_L1_error) /* "PETSc/petscvec.pxi":499 * cdef object enter(self): * self.acquire() * return asarray(self) # <<<<<<<<<<<<<< * * cdef object exit(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":497 * # 'with' statement (PEP 343) * * cdef object enter(self): # <<<<<<<<<<<<<< * self.acquire() * return asarray(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.enter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":501 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ static PyObject *__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_exit(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exit", 0); /* "PETSc/petscvec.pxi":502 * * cdef object exit(self): * self.release() # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 502, __pyx_L1_error) /* "PETSc/petscvec.pxi":503 * cdef object exit(self): * self.release() * return None # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscvec.pxi":501 * return asarray(self) * * cdef object exit(self): # <<<<<<<<<<<<<< * self.release() * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.exit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":505 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_9__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_8__enter__[] = "_Vec_buffer.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_9__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_8__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/petscvec.pxi":506 * * def __enter__(self): * return self.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->enter(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":505 * return None * * def __enter__(self): # <<<<<<<<<<<<<< * return self.enter() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":508 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_10__exit__[] = "_Vec_buffer.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_10__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/petscvec.pxi":509 * * def __exit__(self, *exc): * return self.exit() # <<<<<<<<<<<<<< * * # buffer interface (legacy) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->exit(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":508 * return self.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * return self.exit() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":513 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ static Py_ssize_t __pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, void **__pyx_v_p) { PetscInt __pyx_v_n; Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getbuffer", 0); /* "PETSc/petscvec.pxi":514 * * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if p != NULL: * self.acquire() */ __pyx_v_n = 0; /* "PETSc/petscvec.pxi":515 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ __pyx_t_1 = ((__pyx_v_p != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":516 * cdef PetscInt n = 0 * if p != NULL: * self.acquire() # <<<<<<<<<<<<<< * p[0] = self.data * n = self.size */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 516, __pyx_L1_error) /* "PETSc/petscvec.pxi":517 * if p != NULL: * self.acquire() * p[0] = self.data # <<<<<<<<<<<<<< * n = self.size * elif self.vec != NULL: */ (__pyx_v_p[0]) = ((void *)__pyx_v_self->data); /* "PETSc/petscvec.pxi":518 * self.acquire() * p[0] = self.data * n = self.size # <<<<<<<<<<<<<< * elif self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) */ __pyx_t_3 = __pyx_v_self->size; __pyx_v_n = __pyx_t_3; /* "PETSc/petscvec.pxi":515 * cdef Py_ssize_t getbuffer(self, void **p) except -1: * cdef PetscInt n = 0 * if p != NULL: # <<<<<<<<<<<<<< * self.acquire() * p[0] = self.data */ goto __pyx_L3; } /* "PETSc/petscvec.pxi":519 * p[0] = self.data * n = self.size * elif self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * return (n*sizeof(PetscScalar)) */ __pyx_t_1 = ((__pyx_v_self->vec != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":520 * n = self.size * elif self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * return (n*sizeof(PetscScalar)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 520, __pyx_L1_error) /* "PETSc/petscvec.pxi":519 * p[0] = self.data * n = self.size * elif self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * return (n*sizeof(PetscScalar)) */ } __pyx_L3:; /* "PETSc/petscvec.pxi":521 * elif self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) * return (n*sizeof(PetscScalar)) # <<<<<<<<<<<<<< * * def __getsegcount__(self, Py_ssize_t *lenp): */ __pyx_r = ((Py_ssize_t)(((size_t)__pyx_v_n) * (sizeof(PetscScalar)))); goto __pyx_L0; /* "PETSc/petscvec.pxi":513 * # buffer interface (legacy) * * cdef Py_ssize_t getbuffer(self, void **p) except -1: # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if p != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.getbuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":523 * return (n*sizeof(PetscScalar)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getsegcount__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t *)__pyx_v_lenp)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_12__getsegcount__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t *__pyx_v_lenp) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getsegcount__", 0); /* "PETSc/petscvec.pxi":524 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ __pyx_t_1 = ((__pyx_v_lenp != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":525 * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) # <<<<<<<<<<<<<< * return 1 * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, NULL); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 525, __pyx_L1_error) (__pyx_v_lenp[0]) = __pyx_t_2; /* "PETSc/petscvec.pxi":524 * * def __getsegcount__(self, Py_ssize_t *lenp): * if lenp != NULL: # <<<<<<<<<<<<<< * lenp[0] = self.getbuffer(NULL) * return 1 */ } /* "PETSc/petscvec.pxi":526 * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) * return 1 # <<<<<<<<<<<<<< * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): */ __pyx_r = 1; goto __pyx_L0; /* "PETSc/petscvec.pxi":523 * return (n*sizeof(PetscScalar)) * * def __getsegcount__(self, Py_ssize_t *lenp): # <<<<<<<<<<<<<< * if lenp != NULL: * lenp[0] = self.getbuffer(NULL) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getsegcount__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "PETSc/petscvec.pxi":528 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getreadbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_14__getreadbuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getreadbuffer__", 0); /* "PETSc/petscvec.pxi":529 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * return self.getbuffer(p) */ __pyx_t_1 = ((__pyx_v_idx != 0) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(5, 529, __pyx_L1_error) } /* "PETSc/petscvec.pxi":531 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * return self.getbuffer(p) # <<<<<<<<<<<<<< * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 531, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/petscvec.pxi":528 * return 1 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getreadbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "PETSc/petscvec.pxi":533 * return self.getbuffer(p) * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p); /*proto*/ static Py_ssize_t __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getwritebuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self), ((Py_ssize_t)__pyx_v_idx), ((void **)__pyx_v_p)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ #if PY_MAJOR_VERSION < 3 static Py_ssize_t __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_16__getwritebuffer__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self, Py_ssize_t __pyx_v_idx, void **__pyx_v_p) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getwritebuffer__", 0); /* "PETSc/petscvec.pxi":534 * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * if self.readonly: raise TypeError( */ __pyx_t_1 = ((__pyx_v_idx != 0) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(5, 534, __pyx_L1_error) } /* "PETSc/petscvec.pxi":536 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * if self.readonly: raise TypeError( # <<<<<<<<<<<<<< * "Object is not writable.") * return self.getbuffer(p) */ __pyx_t_1 = (__pyx_v_self->readonly != 0); if (unlikely(__pyx_t_1)) { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(5, 536, __pyx_L1_error) } /* "PETSc/petscvec.pxi":538 * if self.readonly: raise TypeError( * "Object is not writable.") * return self.getbuffer(p) # <<<<<<<<<<<<<< * * # NumPy array interface (legacy) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->__pyx_vtab)->getbuffer(__pyx_v_self, __pyx_v_p); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(5, 538, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/petscvec.pxi":533 * return self.getbuffer(p) * * def __getwritebuffer__(self, Py_ssize_t idx, void **p): # <<<<<<<<<<<<<< * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__getwritebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ /* "PETSc/petscvec.pxi":543 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.vec != NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface_____get__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface_____get__(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_v_size = 0; PyArray_Descr *__pyx_v_descr = 0; PyObject *__pyx_v_typestr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/petscvec.pxi":544 * property __array_interface__: * def __get__(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * if self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) */ __pyx_v_n = 0; /* "PETSc/petscvec.pxi":545 * def __get__(self): * cdef PetscInt n = 0 * if self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) */ __pyx_t_1 = ((__pyx_v_self->vec != NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":546 * cdef PetscInt n = 0 * if self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 546, __pyx_L1_error) /* "PETSc/petscvec.pxi":545 * def __get__(self): * cdef PetscInt n = 0 * if self.vec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) */ } /* "PETSc/petscvec.pxi":547 * if self.vec != NULL: * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) # <<<<<<<<<<<<<< * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_size = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":548 * CHKERR( VecGetLocalSize(self.vec, &n) ) * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, */ __pyx_t_3 = ((PyObject *)PyArray_DescrFromType(NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscvec.pxi":549 * cdef object size = toInt(n) * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) # <<<<<<<<<<<<<< * return dict(version=3, * data=self, */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_typestr = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscvec.pxi":550 * cdef dtype descr = PyArray_DescrFromType(NPY_PETSC_SCALAR) * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, # <<<<<<<<<<<<<< * data=self, * shape=(size,), */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_version, __pyx_int_3) < 0) __PYX_ERR(5, 550, __pyx_L1_error) /* "PETSc/petscvec.pxi":551 * cdef str typestr = "=%c%d" % (descr.kind, descr.itemsize) * return dict(version=3, * data=self, # <<<<<<<<<<<<<< * shape=(size,), * typestr=typestr) */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_data, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(5, 550, __pyx_L1_error) /* "PETSc/petscvec.pxi":552 * return dict(version=3, * data=self, * shape=(size,), # <<<<<<<<<<<<<< * typestr=typestr) * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(5, 550, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscvec.pxi":553 * data=self, * shape=(size,), * typestr=typestr) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_typestr, __pyx_v_typestr) < 0) __PYX_ERR(5, 550, __pyx_L1_error) __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/petscvec.pxi":543 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * if self.vec != NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_size); __Pyx_XDECREF((PyObject *)__pyx_v_descr); __Pyx_XDECREF(__pyx_v_typestr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":564 * cdef Vec lvec * * def __init__(self, Vec gvec): # <<<<<<<<<<<<<< * self.gvec = gvec * self.lvec = Vec() */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_gvec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gvec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(5, 564, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 564, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(5, 564, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self), __pyx_v_gvec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___init__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "PETSc/petscvec.pxi":565 * * def __init__(self, Vec gvec): * self.gvec = gvec # <<<<<<<<<<<<<< * self.lvec = Vec() * */ __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); __Pyx_GOTREF(__pyx_v_self->gvec); __Pyx_DECREF(((PyObject *)__pyx_v_self->gvec)); __pyx_v_self->gvec = __pyx_v_gvec; /* "PETSc/petscvec.pxi":566 * def __init__(self, Vec gvec): * self.gvec = gvec * self.lvec = Vec() # <<<<<<<<<<<<<< * * def __enter__(self): */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->lvec); __Pyx_DECREF(((PyObject *)__pyx_v_self->lvec)); __pyx_v_self->lvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscvec.pxi":564 * cdef Vec lvec * * def __init__(self, Vec gvec): # <<<<<<<<<<<<<< * self.gvec = gvec * self.lvec = Vec() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":568 * self.lvec = Vec() * * def __enter__(self): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__[] = "_Vec_LocalForm.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self) { Vec __pyx_v_gvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Vec __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/petscvec.pxi":569 * * def __enter__(self): * cdef PetscVec gvec = self.gvec.vec # <<<<<<<<<<<<<< * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) * return self.lvec */ __pyx_t_1 = __pyx_v_self->gvec->vec; __pyx_v_gvec = __pyx_t_1; /* "PETSc/petscvec.pxi":570 * def __enter__(self): * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) # <<<<<<<<<<<<<< * return self.lvec * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostGetLocalForm(__pyx_v_gvec, (&__pyx_v_self->lvec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 570, __pyx_L1_error) /* "PETSc/petscvec.pxi":571 * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) * return self.lvec # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->lvec)); __pyx_r = ((PyObject *)__pyx_v_self->lvec); goto __pyx_L0; /* "PETSc/petscvec.pxi":568 * self.lvec = Vec() * * def __enter__(self): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostGetLocalForm(gvec, &self.lvec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":573 * return self.lvec * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__[] = "_Vec_LocalForm.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { Vec __pyx_v_gvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Vec __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/petscvec.pxi":574 * * def __exit__(self, *exc): * cdef PetscVec gvec = self.gvec.vec # <<<<<<<<<<<<<< * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) * self.lvec.vec = NULL */ __pyx_t_1 = __pyx_v_self->gvec->vec; __pyx_v_gvec = __pyx_t_1; /* "PETSc/petscvec.pxi":575 * def __exit__(self, *exc): * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) # <<<<<<<<<<<<<< * self.lvec.vec = NULL * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostRestoreLocalForm(__pyx_v_gvec, (&__pyx_v_self->lvec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 575, __pyx_L1_error) /* "PETSc/petscvec.pxi":576 * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) * self.lvec.vec = NULL # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_v_self->lvec->vec = NULL; /* "PETSc/petscvec.pxi":573 * return self.lvec * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef PetscVec gvec = self.gvec.vec * CHKERR( VecGhostRestoreLocalForm(gvec, &self.lvec.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscvec.pxi":624 * void (*manager_deleter)(DLManagedTensor*) nogil * * cdef void pycapsule_deleter(object dltensor): # <<<<<<<<<<<<<< * cdef DLManagedTensor* dlm_tensor = NULL * try: */ static void __pyx_f_8petsc4py_5PETSc_pycapsule_deleter(PyObject *__pyx_v_dltensor) { struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_dlm_tensor; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; void *__pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pycapsule_deleter", 0); /* "PETSc/petscvec.pxi":625 * * cdef void pycapsule_deleter(object dltensor): * cdef DLManagedTensor* dlm_tensor = NULL # <<<<<<<<<<<<<< * try: * dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') */ __pyx_v_dlm_tensor = NULL; /* "PETSc/petscvec.pxi":626 * cdef void pycapsule_deleter(object dltensor): * cdef DLManagedTensor* dlm_tensor = NULL * try: # <<<<<<<<<<<<<< * dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') * return # we do not call a used capsule's deleter */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "PETSc/petscvec.pxi":627 * cdef DLManagedTensor* dlm_tensor = NULL * try: * dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') # <<<<<<<<<<<<<< * return # we do not call a used capsule's deleter * except Exception: */ __pyx_t_4 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_4 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 627, __pyx_L3_error) __pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_4); /* "PETSc/petscvec.pxi":628 * try: * dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') * return # we do not call a used capsule's deleter # <<<<<<<<<<<<<< * except Exception: * dlm_tensor = PyCapsule_GetPointer(dltensor, 'dltensor') */ goto __pyx_L7_try_return; /* "PETSc/petscvec.pxi":626 * cdef void pycapsule_deleter(object dltensor): * cdef DLManagedTensor* dlm_tensor = NULL * try: # <<<<<<<<<<<<<< * dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') * return # we do not call a used capsule's deleter */ } __pyx_L3_error:; /* "PETSc/petscvec.pxi":629 * dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') * return # we do not call a used capsule's deleter * except Exception: # <<<<<<<<<<<<<< * dlm_tensor = PyCapsule_GetPointer(dltensor, 'dltensor') * manager_deleter(dlm_tensor) */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.pycapsule_deleter", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(5, 629, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); /* "PETSc/petscvec.pxi":630 * return # we do not call a used capsule's deleter * except Exception: * dlm_tensor = PyCapsule_GetPointer(dltensor, 'dltensor') # <<<<<<<<<<<<<< * manager_deleter(dlm_tensor) * */ __pyx_t_4 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_4 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 630, __pyx_L5_except_error) __pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "PETSc/petscvec.pxi":626 * cdef void pycapsule_deleter(object dltensor): * cdef DLManagedTensor* dlm_tensor = NULL * try: # <<<<<<<<<<<<<< * dlm_tensor = PyCapsule_GetPointer(dltensor, 'used_dltensor') * return # we do not call a used capsule's deleter */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L7_try_return:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L0; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); } /* "PETSc/petscvec.pxi":631 * except Exception: * dlm_tensor = PyCapsule_GetPointer(dltensor, 'dltensor') * manager_deleter(dlm_tensor) # <<<<<<<<<<<<<< * * cdef void manager_deleter(DLManagedTensor* tensor) nogil: */ __pyx_f_8petsc4py_5PETSc_manager_deleter(__pyx_v_dlm_tensor); /* "PETSc/petscvec.pxi":624 * void (*manager_deleter)(DLManagedTensor*) nogil * * cdef void pycapsule_deleter(object dltensor): # <<<<<<<<<<<<<< * cdef DLManagedTensor* dlm_tensor = NULL * try: */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("petsc4py.PETSc.pycapsule_deleter", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/petscvec.pxi":633 * manager_deleter(dlm_tensor) * * cdef void manager_deleter(DLManagedTensor* tensor) nogil: # <<<<<<<<<<<<<< * if tensor.manager_ctx is NULL: * return */ static void __pyx_f_8petsc4py_5PETSc_manager_deleter(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_tensor) { int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "PETSc/petscvec.pxi":634 * * cdef void manager_deleter(DLManagedTensor* tensor) nogil: * if tensor.manager_ctx is NULL: # <<<<<<<<<<<<<< * return * free(tensor.dl_tensor.shape) */ __pyx_t_1 = ((__pyx_v_tensor->manager_ctx == NULL) != 0); if (__pyx_t_1) { /* "PETSc/petscvec.pxi":635 * cdef void manager_deleter(DLManagedTensor* tensor) nogil: * if tensor.manager_ctx is NULL: * return # <<<<<<<<<<<<<< * free(tensor.dl_tensor.shape) * CHKERR( PetscDEALLOC(&tensor.manager_ctx) ) */ goto __pyx_L0; /* "PETSc/petscvec.pxi":634 * * cdef void manager_deleter(DLManagedTensor* tensor) nogil: * if tensor.manager_ctx is NULL: # <<<<<<<<<<<<<< * return * free(tensor.dl_tensor.shape) */ } /* "PETSc/petscvec.pxi":636 * if tensor.manager_ctx is NULL: * return * free(tensor.dl_tensor.shape) # <<<<<<<<<<<<<< * CHKERR( PetscDEALLOC(&tensor.manager_ctx) ) * free(tensor) */ free(__pyx_v_tensor->dl_tensor.shape); /* "PETSc/petscvec.pxi":637 * return * free(tensor.dl_tensor.shape) * CHKERR( PetscDEALLOC(&tensor.manager_ctx) ) # <<<<<<<<<<<<<< * free(tensor) * tensor.manager_ctx = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC(((PetscObject *)(&__pyx_v_tensor->manager_ctx)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 637, __pyx_L1_error) /* "PETSc/petscvec.pxi":638 * free(tensor.dl_tensor.shape) * CHKERR( PetscDEALLOC(&tensor.manager_ctx) ) * free(tensor) # <<<<<<<<<<<<<< * tensor.manager_ctx = NULL * */ free(__pyx_v_tensor); /* "PETSc/petscvec.pxi":639 * CHKERR( PetscDEALLOC(&tensor.manager_ctx) ) * free(tensor) * tensor.manager_ctx = NULL # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_v_tensor->manager_ctx = NULL; /* "PETSc/petscvec.pxi":633 * manager_deleter(dlm_tensor) * * cdef void manager_deleter(DLManagedTensor* tensor) nogil: # <<<<<<<<<<<<<< * if tensor.manager_ctx is NULL: * return */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.manager_deleter", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1); __pyx_L0:; } /* "PETSc/petscmat.pxi":473 * int MatGetNearNullSpace(PetscMat,PetscNullSpace*) * * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): # <<<<<<<<<<<<<< * cdef NullSpace ob = NullSpace() * ob.nsp = nsp */ static CYTHON_INLINE struct PyPetscNullSpaceObject *__pyx_f_8petsc4py_5PETSc_ref_NullSpace(MatNullSpace __pyx_v_nsp) { struct PyPetscNullSpaceObject *__pyx_v_ob = 0; struct PyPetscNullSpaceObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_NullSpace", 0); /* "PETSc/petscmat.pxi":474 * * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): * cdef NullSpace ob = NullSpace() # <<<<<<<<<<<<<< * ob.nsp = nsp * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscNullSpaceObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":475 * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): * cdef NullSpace ob = NullSpace() * ob.nsp = nsp # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->nsp = __pyx_v_nsp; /* "PETSc/petscmat.pxi":476 * cdef NullSpace ob = NullSpace() * ob.nsp = nsp * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscmat.pxi":477 * ob.nsp = nsp * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * cdef int NullSpace_Function( */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscmat.pxi":473 * int MatGetNearNullSpace(PetscMat,PetscNullSpace*) * * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp): # <<<<<<<<<<<<<< * cdef NullSpace ob = NullSpace() * ob.nsp = nsp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_NullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":479 * return ob * * cdef int NullSpace_Function( # <<<<<<<<<<<<<< * PetscNullSpace n, * PetscVec v, */ static int __pyx_f_8petsc4py_5PETSc_NullSpace_Function(MatNullSpace __pyx_v_n, Vec __pyx_v_v, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("NullSpace_Function", 0); /* "PETSc/petscmat.pxi":484 * void * ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef NullSpace nsp = ref_NullSpace(n) # <<<<<<<<<<<<<< * cdef Vec vec = ref_Vec(v) * (function, args, kargs) = nsp.get_attr('__function__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_NullSpace(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":485 * ) except PETSC_ERR_PYTHON with gil: * cdef NullSpace nsp = ref_NullSpace(n) * cdef Vec vec = ref_Vec(v) # <<<<<<<<<<<<<< * (function, args, kargs) = nsp.get_attr('__function__') * function(nsp, vec, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_v)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":486 * cdef NullSpace nsp = ref_NullSpace(n) * cdef Vec vec = ref_Vec(v) * (function, args, kargs) = nsp.get_attr('__function__') # <<<<<<<<<<<<<< * function(nsp, vec, *args, **kargs) * return 0 */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_nsp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_nsp), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 486, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(6, 486, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 486, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_function = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":487 * cdef Vec vec = ref_Vec(v) * (function, args, kargs) = nsp.get_attr('__function__') * function(nsp, vec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_nsp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_nsp)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_nsp)); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_vec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_vec)); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(6, 487, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":488 * (function, args, kargs) = nsp.get_attr('__function__') * function(nsp, vec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":479 * return ob * * cdef int NullSpace_Function( # <<<<<<<<<<<<<< * PetscNullSpace n, * PetscVec v, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace_Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscmat.pxi":492 * # ----------------------------------------------------------------------------- * * cdef inline Mat ref_Mat(PetscMat mat): # <<<<<<<<<<<<<< * cdef Mat ob = Mat() * ob.mat = mat */ static CYTHON_INLINE struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_ref_Mat(Mat __pyx_v_mat) { struct PyPetscMatObject *__pyx_v_ob = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_Mat", 0); /* "PETSc/petscmat.pxi":493 * * cdef inline Mat ref_Mat(PetscMat mat): * cdef Mat ob = Mat() # <<<<<<<<<<<<<< * ob.mat = mat * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":494 * cdef inline Mat ref_Mat(PetscMat mat): * cdef Mat ob = Mat() * ob.mat = mat # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->mat = __pyx_v_mat; /* "PETSc/petscmat.pxi":495 * cdef Mat ob = Mat() * ob.mat = mat * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscmat.pxi":496 * ob.mat = mat * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscmat.pxi":492 * # ----------------------------------------------------------------------------- * * cdef inline Mat ref_Mat(PetscMat mat): # <<<<<<<<<<<<<< * cdef Mat ob = Mat() * ob.mat = mat */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_Mat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":502 * # unary operations * * cdef Mat mat_pos(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_pos(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_pos", 0); /* "PETSc/petscmat.pxi":503 * * cdef Mat mat_pos(Mat self): * cdef Mat mat = type(self)() # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) * return mat */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(6, 503, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":504 * cdef Mat mat_pos(Mat self): * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 504, __pyx_L1_error) /* "PETSc/petscmat.pxi":505 * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * cdef Mat mat_neg(Mat self): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = __pyx_v_mat; goto __pyx_L0; /* "PETSc/petscmat.pxi":502 * # unary operations * * cdef Mat mat_pos(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.mat_pos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":507 * return mat * * cdef Mat mat_neg(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_neg(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_neg", 0); /* "PETSc/petscmat.pxi":508 * * cdef Mat mat_neg(Mat self): * cdef Mat mat = mat_pos(self) # <<<<<<<<<<<<<< * CHKERR( MatScale(mat.mat, -1) ) * return mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":509 * cdef Mat mat_neg(Mat self): * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatScale(__pyx_v_mat->mat, -1.0)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 509, __pyx_L1_error) /* "PETSc/petscmat.pxi":510 * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) * return mat # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = __pyx_v_mat; goto __pyx_L0; /* "PETSc/petscmat.pxi":507 * return mat * * cdef Mat mat_neg(Mat self): # <<<<<<<<<<<<<< * cdef Mat mat = mat_pos(self) * CHKERR( MatScale(mat.mat, -1) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_neg", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":514 * # inplace binary operations * * cdef Mat mat_iadd(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(1, other) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_iadd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_alpha = NULL; PyObject *__pyx_v_mat = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_iadd", 0); /* "PETSc/petscmat.pxi":515 * * cdef Mat mat_iadd(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(1, other) * elif isinstance(other, (tuple, list)): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":516 * cdef Mat mat_iadd(Mat self, other): * if isinstance(other, Mat): * self.axpy(1, other) # <<<<<<<<<<<<<< * elif isinstance(other, (tuple, list)): * alpha, mat = other */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_1, __pyx_v_other}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 516, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_1, __pyx_v_other}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 516, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_1); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_other); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":515 * * cdef Mat mat_iadd(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(1, other) * elif isinstance(other, (tuple, list)): */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":517 * if isinstance(other, Mat): * self.axpy(1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(alpha, mat) */ __pyx_t_1 = PyTuple_Check(__pyx_v_other); __pyx_t_8 = (__pyx_t_1 != 0); if (!__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L4_bool_binop_done; } __pyx_t_8 = PyList_Check(__pyx_v_other); __pyx_t_1 = (__pyx_t_8 != 0); __pyx_t_2 = __pyx_t_1; __pyx_L4_bool_binop_done:; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscmat.pxi":518 * self.axpy(1, other) * elif isinstance(other, (tuple, list)): * alpha, mat = other # <<<<<<<<<<<<<< * self.axpy(alpha, mat) * elif isinstance(other, Vec): */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 518, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(6, 518, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 518, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_alpha = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_mat = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":519 * elif isinstance(other, (tuple, list)): * alpha, mat = other * self.axpy(alpha, mat) # <<<<<<<<<<<<<< * elif isinstance(other, Vec): * self.setDiagonal(other, PETSC_ADD_VALUES) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_alpha, __pyx_v_mat}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 519, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_alpha, __pyx_v_mat}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 519, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_alpha); __Pyx_GIVEREF(__pyx_v_alpha); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_alpha); __Pyx_INCREF(__pyx_v_mat); __Pyx_GIVEREF(__pyx_v_mat); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_mat); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":517 * if isinstance(other, Mat): * self.axpy(1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(alpha, mat) */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":520 * alpha, mat = other * self.axpy(alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * self.setDiagonal(other, PETSC_ADD_VALUES) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":521 * self.axpy(alpha, mat) * elif isinstance(other, Vec): * self.setDiagonal(other, PETSC_ADD_VALUES) # <<<<<<<<<<<<<< * else: * self.shift(other) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_other, __pyx_t_5}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_other, __pyx_t_5}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_v_other); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":520 * alpha, mat = other * self.axpy(alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * self.setDiagonal(other, PETSC_ADD_VALUES) * else: */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":523 * self.setDiagonal(other, PETSC_ADD_VALUES) * else: * self.shift(other) # <<<<<<<<<<<<<< * return self * */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shift); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "PETSc/petscmat.pxi":524 * else: * self.shift(other) * return self # <<<<<<<<<<<<<< * * cdef Mat mat_isub(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscmat.pxi":514 * # inplace binary operations * * cdef Mat mat_iadd(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(1, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.mat_iadd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_alpha); __Pyx_XDECREF(__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":526 * return self * * cdef Mat mat_isub(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(-1, other) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_isub(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_alpha = NULL; PyObject *__pyx_v_mat = NULL; PyObject *__pyx_v_diag = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_isub", 0); /* "PETSc/petscmat.pxi":527 * * cdef Mat mat_isub(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":528 * cdef Mat mat_isub(Mat self, other): * if isinstance(other, Mat): * self.axpy(-1, other) # <<<<<<<<<<<<<< * elif isinstance(other, (tuple, list)): * alpha, mat = other */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_neg_1, __pyx_v_other}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 528, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_neg_1, __pyx_v_other}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 528, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_int_neg_1); __Pyx_INCREF(__pyx_v_other); __Pyx_GIVEREF(__pyx_v_other); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_other); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":527 * * cdef Mat mat_isub(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":529 * if isinstance(other, Mat): * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(-alpha, mat) */ __pyx_t_1 = PyTuple_Check(__pyx_v_other); __pyx_t_8 = (__pyx_t_1 != 0); if (!__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L4_bool_binop_done; } __pyx_t_8 = PyList_Check(__pyx_v_other); __pyx_t_1 = (__pyx_t_8 != 0); __pyx_t_2 = __pyx_t_1; __pyx_L4_bool_binop_done:; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscmat.pxi":530 * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): * alpha, mat = other # <<<<<<<<<<<<<< * self.axpy(-alpha, mat) * elif isinstance(other, Vec): */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 530, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_7), 2) < 0) __PYX_ERR(6, 530, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 530, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_alpha = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_mat = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":531 * elif isinstance(other, (tuple, list)): * alpha, mat = other * self.axpy(-alpha, mat) # <<<<<<<<<<<<<< * elif isinstance(other, Vec): * diag = other.copy() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_axpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Negative(__pyx_v_alpha); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_v_mat}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 531, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_v_mat}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 531, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_v_mat); __Pyx_GIVEREF(__pyx_v_mat); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_v_mat); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":529 * if isinstance(other, Mat): * self.axpy(-1, other) * elif isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * alpha, mat = other * self.axpy(-alpha, mat) */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":532 * alpha, mat = other * self.axpy(-alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * diag = other.copy() * diag.scale(-1) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":533 * self.axpy(-alpha, mat) * elif isinstance(other, Vec): * diag = other.copy() # <<<<<<<<<<<<<< * diag.scale(-1) * self.setDiagonal(diag, PETSC_ADD_VALUES) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_diag = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":534 * elif isinstance(other, Vec): * diag = other.copy() * diag.scale(-1) # <<<<<<<<<<<<<< * self.setDiagonal(diag, PETSC_ADD_VALUES) * diag.destroy() */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_diag, __pyx_n_s_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_10, __pyx_int_neg_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_neg_1); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":535 * diag = other.copy() * diag.scale(-1) * self.setDiagonal(diag, PETSC_ADD_VALUES) # <<<<<<<<<<<<<< * diag.destroy() * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDiagonal); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_diag, __pyx_t_10}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 535, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_diag, __pyx_t_10}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 535, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_diag); __Pyx_GIVEREF(__pyx_v_diag); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_diag); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":536 * diag.scale(-1) * self.setDiagonal(diag, PETSC_ADD_VALUES) * diag.destroy() # <<<<<<<<<<<<<< * else: * self.shift(other) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_diag, __pyx_n_s_destroy); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":532 * alpha, mat = other * self.axpy(-alpha, mat) * elif isinstance(other, Vec): # <<<<<<<<<<<<<< * diag = other.copy() * diag.scale(-1) */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":538 * diag.destroy() * else: * self.shift(other) # <<<<<<<<<<<<<< * return self * */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_shift); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "PETSc/petscmat.pxi":539 * else: * self.shift(other) * return self # <<<<<<<<<<<<<< * * cdef Mat mat_imul(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscmat.pxi":526 * return self * * cdef Mat mat_isub(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * self.axpy(-1, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.mat_isub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_alpha); __Pyx_XDECREF(__pyx_v_mat); __Pyx_XDECREF(__pyx_v_diag); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":541 * return self * * cdef Mat mat_imul(Mat self, other): # <<<<<<<<<<<<<< * if (isinstance(other, tuple) or * isinstance(other, list)): */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_imul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_L = NULL; PyObject *__pyx_v_R = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_imul", 0); /* "PETSc/petscmat.pxi":542 * * cdef Mat mat_imul(Mat self, other): * if (isinstance(other, tuple) or # <<<<<<<<<<<<<< * isinstance(other, list)): * L, R = other */ __pyx_t_2 = PyTuple_Check(__pyx_v_other); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } /* "PETSc/petscmat.pxi":543 * cdef Mat mat_imul(Mat self, other): * if (isinstance(other, tuple) or * isinstance(other, list)): # <<<<<<<<<<<<<< * L, R = other * self.diagonalScale(L, R) */ __pyx_t_3 = PyList_Check(__pyx_v_other); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; /* "PETSc/petscmat.pxi":542 * * cdef Mat mat_imul(Mat self, other): * if (isinstance(other, tuple) or # <<<<<<<<<<<<<< * isinstance(other, list)): * L, R = other */ if (__pyx_t_1) { /* "PETSc/petscmat.pxi":544 * if (isinstance(other, tuple) or * isinstance(other, list)): * L, R = other # <<<<<<<<<<<<<< * self.diagonalScale(L, R) * else: */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 544, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(6, 544, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 544, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_L = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_R = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":545 * isinstance(other, list)): * L, R = other * self.diagonalScale(L, R) # <<<<<<<<<<<<<< * else: * self.scale(other) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 545, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 545, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_L); __Pyx_GIVEREF(__pyx_v_L); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_L); __Pyx_INCREF(__pyx_v_R); __Pyx_GIVEREF(__pyx_v_R); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_R); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":542 * * cdef Mat mat_imul(Mat self, other): * if (isinstance(other, tuple) or # <<<<<<<<<<<<<< * isinstance(other, list)): * L, R = other */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":547 * self.diagonalScale(L, R) * else: * self.scale(other) # <<<<<<<<<<<<<< * return self * */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L3:; /* "PETSc/petscmat.pxi":548 * else: * self.scale(other) * return self # <<<<<<<<<<<<<< * * cdef Mat mat_idiv(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscmat.pxi":541 * return self * * cdef Mat mat_imul(Mat self, other): # <<<<<<<<<<<<<< * if (isinstance(other, tuple) or * isinstance(other, list)): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.mat_imul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_L); __Pyx_XDECREF(__pyx_v_R); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":550 * return self * * cdef Mat mat_idiv(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, (tuple, list)): * L, R = other */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_idiv(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_v_L = NULL; PyObject *__pyx_v_R = NULL; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_idiv", 0); __Pyx_INCREF(__pyx_v_other); /* "PETSc/petscmat.pxi":551 * * cdef Mat mat_idiv(Mat self, other): * if isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * L, R = other * if isinstance(L, Vec): */ __pyx_t_2 = PyTuple_Check(__pyx_v_other); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_other); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":552 * cdef Mat mat_idiv(Mat self, other): * if isinstance(other, (tuple, list)): * L, R = other # <<<<<<<<<<<<<< * if isinstance(L, Vec): * L = L.copy() */ if ((likely(PyTuple_CheckExact(__pyx_v_other))) || (PyList_CheckExact(__pyx_v_other))) { PyObject* sequence = __pyx_v_other; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 552, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(6, 552, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 552, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_L = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_R = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":553 * if isinstance(other, (tuple, list)): * L, R = other * if isinstance(L, Vec): # <<<<<<<<<<<<<< * L = L.copy() * L.reciprocal() */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_L, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscmat.pxi":554 * L, R = other * if isinstance(L, Vec): * L = L.copy() # <<<<<<<<<<<<<< * L.reciprocal() * if isinstance(R, Vec): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_L, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":555 * if isinstance(L, Vec): * L = L.copy() * L.reciprocal() # <<<<<<<<<<<<<< * if isinstance(R, Vec): * R = R.copy() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_reciprocal); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":553 * if isinstance(other, (tuple, list)): * L, R = other * if isinstance(L, Vec): # <<<<<<<<<<<<<< * L = L.copy() * L.reciprocal() */ } /* "PETSc/petscmat.pxi":556 * L = L.copy() * L.reciprocal() * if isinstance(R, Vec): # <<<<<<<<<<<<<< * R = R.copy() * R.reciprocal() */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_R, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":557 * L.reciprocal() * if isinstance(R, Vec): * R = R.copy() # <<<<<<<<<<<<<< * R.reciprocal() * self.diagonalScale(L, R) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_R, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_R, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":558 * if isinstance(R, Vec): * R = R.copy() * R.reciprocal() # <<<<<<<<<<<<<< * self.diagonalScale(L, R) * else: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_R, __pyx_n_s_reciprocal); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":556 * L = L.copy() * L.reciprocal() * if isinstance(R, Vec): # <<<<<<<<<<<<<< * R = R.copy() * R.reciprocal() */ } /* "PETSc/petscmat.pxi":559 * R = R.copy() * R.reciprocal() * self.diagonalScale(L, R) # <<<<<<<<<<<<<< * else: * other = 1/other */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_diagonalScale); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 559, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_L, __pyx_v_R}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 559, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_L); __Pyx_GIVEREF(__pyx_v_L); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_L); __Pyx_INCREF(__pyx_v_R); __Pyx_GIVEREF(__pyx_v_R); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_R); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":551 * * cdef Mat mat_idiv(Mat self, other): * if isinstance(other, (tuple, list)): # <<<<<<<<<<<<<< * L, R = other * if isinstance(L, Vec): */ goto __pyx_L3; } /* "PETSc/petscmat.pxi":561 * self.diagonalScale(L, R) * else: * other = 1/other # <<<<<<<<<<<<<< * self.scale(other) * return self */ /*else*/ { __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":562 * else: * other = 1/other * self.scale(other) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scale); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L3:; /* "PETSc/petscmat.pxi":563 * other = 1/other * self.scale(other) * return self # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = __pyx_v_self; goto __pyx_L0; /* "PETSc/petscmat.pxi":550 * return self * * cdef Mat mat_idiv(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, (tuple, list)): * L, R = other */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.mat_idiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_L); __Pyx_XDECREF(__pyx_v_R); __Pyx_XDECREF(__pyx_v_other); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":567 * # binary operations * * cdef Mat mat_add(Mat self, other): # <<<<<<<<<<<<<< * return mat_iadd(mat_pos(self), other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_add(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_add", 0); /* "PETSc/petscmat.pxi":568 * * cdef Mat mat_add(Mat self, other): * return mat_iadd(mat_pos(self), other) # <<<<<<<<<<<<<< * * cdef Mat mat_sub(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_iadd(((struct PyPetscMatObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":567 * # binary operations * * cdef Mat mat_add(Mat self, other): # <<<<<<<<<<<<<< * return mat_iadd(mat_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_add", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":570 * return mat_iadd(mat_pos(self), other) * * cdef Mat mat_sub(Mat self, other): # <<<<<<<<<<<<<< * return mat_isub(mat_pos(self), other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_sub(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_sub", 0); /* "PETSc/petscmat.pxi":571 * * cdef Mat mat_sub(Mat self, other): * return mat_isub(mat_pos(self), other) # <<<<<<<<<<<<<< * * cdef Mat mat_mul(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_isub(((struct PyPetscMatObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":570 * return mat_iadd(mat_pos(self), other) * * cdef Mat mat_sub(Mat self, other): # <<<<<<<<<<<<<< * return mat_isub(mat_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":573 * return mat_isub(mat_pos(self), other) * * cdef Mat mat_mul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * return self.matMult(other) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_mul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_mul", 0); /* "PETSc/petscmat.pxi":574 * * cdef Mat mat_mul(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * return self.matMult(other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":575 * cdef Mat mat_mul(Mat self, other): * if isinstance(other, Mat): * return self.matMult(other) # <<<<<<<<<<<<<< * else: * return mat_imul(mat_pos(self), other) */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_matMult); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_other); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(6, 575, __pyx_L1_error) __pyx_r = ((struct PyPetscMatObject *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":574 * * cdef Mat mat_mul(Mat self, other): * if isinstance(other, Mat): # <<<<<<<<<<<<<< * return self.matMult(other) * else: */ } /* "PETSc/petscmat.pxi":577 * return self.matMult(other) * else: * return mat_imul(mat_pos(self), other) # <<<<<<<<<<<<<< * * cdef Vec mat_mul_vec(Mat self, Vec other): */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_imul(((struct PyPetscMatObject *)__pyx_t_3), __pyx_v_other)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = ((struct PyPetscMatObject *)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "PETSc/petscmat.pxi":573 * return mat_isub(mat_pos(self), other) * * cdef Mat mat_mul(Mat self, other): # <<<<<<<<<<<<<< * if isinstance(other, Mat): * return self.matMult(other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.mat_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":579 * return mat_imul(mat_pos(self), other) * * cdef Vec mat_mul_vec(Mat self, Vec other): # <<<<<<<<<<<<<< * cdef Vec result = self.createVecLeft() * self.mult(other, result) */ static struct PyPetscVecObject *__pyx_f_8petsc4py_5PETSc_mat_mul_vec(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_other) { struct PyPetscVecObject *__pyx_v_result = 0; struct PyPetscVecObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_mul_vec", 0); /* "PETSc/petscmat.pxi":580 * * cdef Vec mat_mul_vec(Mat self, Vec other): * cdef Vec result = self.createVecLeft() # <<<<<<<<<<<<<< * self.mult(other, result) * return result */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(6, 580, __pyx_L1_error) __pyx_v_result = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":581 * cdef Vec mat_mul_vec(Mat self, Vec other): * cdef Vec result = self.createVecLeft() * self.mult(other, result) # <<<<<<<<<<<<<< * return result * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mult); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_result)}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 581, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_result)}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 581, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_other)); __Pyx_GIVEREF(((PyObject *)__pyx_v_other)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_other)); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __Pyx_GIVEREF(((PyObject *)__pyx_v_result)); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_result)); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":582 * cdef Vec result = self.createVecLeft() * self.mult(other, result) * return result # <<<<<<<<<<<<<< * * cdef Mat mat_div(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "PETSc/petscmat.pxi":579 * return mat_imul(mat_pos(self), other) * * cdef Vec mat_mul_vec(Mat self, Vec other): # <<<<<<<<<<<<<< * cdef Vec result = self.createVecLeft() * self.mult(other, result) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.mat_mul_vec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":584 * return result * * cdef Mat mat_div(Mat self, other): # <<<<<<<<<<<<<< * return mat_idiv(mat_pos(self), other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_div(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_div", 0); /* "PETSc/petscmat.pxi":585 * * cdef Mat mat_div(Mat self, other): * return mat_idiv(mat_pos(self), other) # <<<<<<<<<<<<<< * * # reflected binary operations */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_idiv(((struct PyPetscMatObject *)__pyx_t_1), __pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":584 * return result * * cdef Mat mat_div(Mat self, other): # <<<<<<<<<<<<<< * return mat_idiv(mat_pos(self), other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.mat_div", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":589 * # reflected binary operations * * cdef Mat mat_radd(Mat self, other): # <<<<<<<<<<<<<< * return mat_add(self, other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_radd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_radd", 0); /* "PETSc/petscmat.pxi":590 * * cdef Mat mat_radd(Mat self, other): * return mat_add(self, other) # <<<<<<<<<<<<<< * * cdef Mat mat_rsub(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_add(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":589 * # reflected binary operations * * cdef Mat mat_radd(Mat self, other): # <<<<<<<<<<<<<< * return mat_add(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.mat_radd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":592 * return mat_add(self, other) * * cdef Mat mat_rsub(Mat self, other): # <<<<<<<<<<<<<< * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rsub(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_rsub", 0); /* "PETSc/petscmat.pxi":593 * * cdef Mat mat_rsub(Mat self, other): * cdef Mat mat = mat_sub(self, other) # <<<<<<<<<<<<<< * mat.scale(-1) * return mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_sub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":594 * cdef Mat mat_rsub(Mat self, other): * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_mat), __pyx_n_s_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_int_neg_1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_neg_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":595 * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) * return mat # <<<<<<<<<<<<<< * * cdef Mat mat_rmul(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = __pyx_v_mat; goto __pyx_L0; /* "PETSc/petscmat.pxi":592 * return mat_add(self, other) * * cdef Mat mat_rsub(Mat self, other): # <<<<<<<<<<<<<< * cdef Mat mat = mat_sub(self, other) * mat.scale(-1) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.mat_rsub", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":597 * return mat * * cdef Mat mat_rmul(Mat self, other): # <<<<<<<<<<<<<< * return mat_mul(self, other) * */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rmul(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_rmul", 0); /* "PETSc/petscmat.pxi":598 * * cdef Mat mat_rmul(Mat self, other): * return mat_mul(self, other) # <<<<<<<<<<<<<< * * cdef Mat mat_rdiv(Mat self, other): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":597 * return mat * * cdef Mat mat_rmul(Mat self, other): # <<<<<<<<<<<<<< * return mat_mul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.mat_rmul", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":600 * return mat_mul(self, other) * * cdef Mat mat_rdiv(Mat self, other): # <<<<<<<<<<<<<< * self; other; # unused * raise NotImplementedError */ static struct PyPetscMatObject *__pyx_f_8petsc4py_5PETSc_mat_rdiv(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { struct PyPetscMatObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_rdiv", 0); /* "PETSc/petscmat.pxi":601 * * cdef Mat mat_rdiv(Mat self, other): * self; other; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_other); /* "PETSc/petscmat.pxi":602 * cdef Mat mat_rdiv(Mat self, other): * self; other; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(6, 602, __pyx_L1_error) /* "PETSc/petscmat.pxi":600 * return mat_mul(self, other) * * cdef Mat mat_rdiv(Mat self, other): # <<<<<<<<<<<<<< * self; other; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.mat_rdiv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":606 * # ----------------------------------------------------------------------------- * * cdef inline PetscMatStructure matstructure(object structure) \ # <<<<<<<<<<<<<< * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN */ static CYTHON_INLINE MatStructure __pyx_f_8petsc4py_5PETSc_matstructure(PyObject *__pyx_v_structure) { MatStructure __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; MatStructure __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matstructure", 0); /* "PETSc/petscmat.pxi":608 * cdef inline PetscMatStructure matstructure(object structure) \ * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is True: return MAT_SAME_NONZERO_PATTERN */ __pyx_t_1 = (__pyx_v_structure == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = DIFFERENT_NONZERO_PATTERN; goto __pyx_L0; } /* "PETSc/petscmat.pxi":609 * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * elif structure is True: return MAT_SAME_NONZERO_PATTERN * else: return structure */ __pyx_t_2 = (__pyx_v_structure == Py_False); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_r = DIFFERENT_NONZERO_PATTERN; goto __pyx_L0; } /* "PETSc/petscmat.pxi":610 * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is True: return MAT_SAME_NONZERO_PATTERN # <<<<<<<<<<<<<< * else: return structure * */ __pyx_t_1 = (__pyx_v_structure == Py_True); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = SAME_NONZERO_PATTERN; goto __pyx_L0; } /* "PETSc/petscmat.pxi":611 * elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN * elif structure is True: return MAT_SAME_NONZERO_PATTERN * else: return structure # <<<<<<<<<<<<<< * * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ */ /*else*/ { __pyx_t_3 = ((MatStructure)__Pyx_PyInt_As_MatStructure(__pyx_v_structure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 611, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; } /* "PETSc/petscmat.pxi":606 * # ----------------------------------------------------------------------------- * * cdef inline PetscMatStructure matstructure(object structure) \ # <<<<<<<<<<<<<< * except (-1): * if structure is None: return MAT_DIFFERENT_NONZERO_PATTERN */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.matstructure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatStructure)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":613 * else: return structure * * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ # <<<<<<<<<<<<<< * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY */ static CYTHON_INLINE MatAssemblyType __pyx_f_8petsc4py_5PETSc_assemblytype(PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; MatAssemblyType __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblytype", 0); /* "PETSc/petscmat.pxi":615 * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY # <<<<<<<<<<<<<< * elif assembly is False: return MAT_FINAL_ASSEMBLY * elif assembly is True: return MAT_FLUSH_ASSEMBLY */ __pyx_t_1 = (__pyx_v_assembly == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = MAT_FINAL_ASSEMBLY; goto __pyx_L0; } /* "PETSc/petscmat.pxi":616 * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY * elif assembly is False: return MAT_FINAL_ASSEMBLY # <<<<<<<<<<<<<< * elif assembly is True: return MAT_FLUSH_ASSEMBLY * else: return assembly */ __pyx_t_2 = (__pyx_v_assembly == Py_False); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_r = MAT_FINAL_ASSEMBLY; goto __pyx_L0; } /* "PETSc/petscmat.pxi":617 * if assembly is None: return MAT_FINAL_ASSEMBLY * elif assembly is False: return MAT_FINAL_ASSEMBLY * elif assembly is True: return MAT_FLUSH_ASSEMBLY # <<<<<<<<<<<<<< * else: return assembly * */ __pyx_t_1 = (__pyx_v_assembly == Py_True); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = MAT_FLUSH_ASSEMBLY; goto __pyx_L0; } /* "PETSc/petscmat.pxi":618 * elif assembly is False: return MAT_FINAL_ASSEMBLY * elif assembly is True: return MAT_FLUSH_ASSEMBLY * else: return assembly # <<<<<<<<<<<<<< * * cdef inline PetscMatInfoType infotype(object info) \ */ /*else*/ { __pyx_t_3 = ((MatAssemblyType)__Pyx_PyInt_As_MatAssemblyType(__pyx_v_assembly)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 618, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; } /* "PETSc/petscmat.pxi":613 * else: return structure * * cdef inline PetscMatAssemblyType assemblytype(object assembly) \ # <<<<<<<<<<<<<< * except (-1): * if assembly is None: return MAT_FINAL_ASSEMBLY */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.assemblytype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatAssemblyType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":620 * else: return assembly * * cdef inline PetscMatInfoType infotype(object info) \ # <<<<<<<<<<<<<< * except (-1): * if info is None: return MAT_GLOBAL_SUM */ static CYTHON_INLINE MatInfoType __pyx_f_8petsc4py_5PETSc_infotype(PyObject *__pyx_v_info) { MatInfoType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; MatInfoType __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("infotype", 0); /* "PETSc/petscmat.pxi":622 * cdef inline PetscMatInfoType infotype(object info) \ * except (-1): * if info is None: return MAT_GLOBAL_SUM # <<<<<<<<<<<<<< * else: return info * */ __pyx_t_1 = (__pyx_v_info == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_r = MAT_GLOBAL_SUM; goto __pyx_L0; } /* "PETSc/petscmat.pxi":623 * except (-1): * if info is None: return MAT_GLOBAL_SUM * else: return info # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ /*else*/ { __pyx_t_3 = ((MatInfoType)__Pyx_PyInt_As_MatInfoType(__pyx_v_info)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 623, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; } /* "PETSc/petscmat.pxi":620 * else: return assembly * * cdef inline PetscMatInfoType infotype(object info) \ # <<<<<<<<<<<<<< * except (-1): * if info is None: return MAT_GLOBAL_SUM */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.infotype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatInfoType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":627 * # ----------------------------------------------------------------------------- * * cdef inline int Mat_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *r, PetscInt *c, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_Sizes(PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PetscInt *__pyx_v_r, PetscInt *__pyx_v_c, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_M, PetscInt *__pyx_v_N) { PyObject *__pyx_v_rsize = 0; PyObject *__pyx_v_csize = 0; PyObject *__pyx_v_rbsize = 0; PyObject *__pyx_v_cbsize = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_Sizes", 0); /* "PETSc/petscmat.pxi":635 * # unpack row and column sizes * cdef object rsize, csize * try: # <<<<<<<<<<<<<< * rsize , csize = size * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "PETSc/petscmat.pxi":636 * cdef object rsize, csize * try: * rsize , csize = size # <<<<<<<<<<<<<< * except (TypeError, ValueError): * rsize = csize = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 636, __pyx_L3_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 636, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 636, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 636, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(6, 636, __pyx_L3_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 636, __pyx_L3_error) __pyx_L10_unpacking_done:; } __pyx_v_rsize = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_csize = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":635 * # unpack row and column sizes * cdef object rsize, csize * try: # <<<<<<<<<<<<<< * rsize , csize = size * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":637 * try: * rsize , csize = size * except (TypeError, ValueError): # <<<<<<<<<<<<<< * rsize = csize = size * # unpack row and column block sizes */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_8) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(6, 637, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); /* "PETSc/petscmat.pxi":638 * rsize , csize = size * except (TypeError, ValueError): * rsize = csize = size # <<<<<<<<<<<<<< * # unpack row and column block sizes * cdef object rbsize, cbsize */ __Pyx_INCREF(__pyx_v_size); __Pyx_XDECREF_SET(__pyx_v_rsize, __pyx_v_size); __Pyx_INCREF(__pyx_v_size); __Pyx_XDECREF_SET(__pyx_v_csize, __pyx_v_size); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "PETSc/petscmat.pxi":635 * # unpack row and column sizes * cdef object rsize, csize * try: # <<<<<<<<<<<<<< * rsize , csize = size * except (TypeError, ValueError): */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "PETSc/petscmat.pxi":641 * # unpack row and column block sizes * cdef object rbsize, cbsize * try: # <<<<<<<<<<<<<< * rbsize , cbsize = bsize * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); /*try:*/ { /* "PETSc/petscmat.pxi":642 * cdef object rbsize, cbsize * try: * rbsize , cbsize = bsize # <<<<<<<<<<<<<< * except (TypeError, ValueError): * rbsize = cbsize = bsize */ if ((likely(PyTuple_CheckExact(__pyx_v_bsize))) || (PyList_CheckExact(__pyx_v_bsize))) { PyObject* sequence = __pyx_v_bsize; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 642, __pyx_L13_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 642, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 642, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_bsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 642, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_5), 2) < 0) __PYX_ERR(6, 642, __pyx_L13_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 642, __pyx_L13_error) __pyx_L20_unpacking_done:; } __pyx_v_rbsize = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_cbsize = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":641 * # unpack row and column block sizes * cdef object rbsize, cbsize * try: # <<<<<<<<<<<<<< * rbsize , cbsize = bsize * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L18_try_end; __pyx_L13_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":643 * try: * rbsize , cbsize = bsize * except (TypeError, ValueError): # <<<<<<<<<<<<<< * rbsize = cbsize = bsize * # split row and column sizes */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_8) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(6, 643, __pyx_L15_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_5); /* "PETSc/petscmat.pxi":644 * rbsize , cbsize = bsize * except (TypeError, ValueError): * rbsize = cbsize = bsize # <<<<<<<<<<<<<< * # split row and column sizes * Sys_Sizes(rsize, rbsize, r, m, M) */ __Pyx_INCREF(__pyx_v_bsize); __Pyx_XDECREF_SET(__pyx_v_rbsize, __pyx_v_bsize); __Pyx_INCREF(__pyx_v_bsize); __Pyx_XDECREF_SET(__pyx_v_cbsize, __pyx_v_bsize); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L14_exception_handled; } goto __pyx_L15_except_error; __pyx_L15_except_error:; /* "PETSc/petscmat.pxi":641 * # unpack row and column block sizes * cdef object rbsize, cbsize * try: # <<<<<<<<<<<<<< * rbsize , cbsize = bsize * except (TypeError, ValueError): */ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); goto __pyx_L1_error; __pyx_L14_exception_handled:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); __pyx_L18_try_end:; } /* "PETSc/petscmat.pxi":646 * rbsize = cbsize = bsize * # split row and column sizes * Sys_Sizes(rsize, rbsize, r, m, M) # <<<<<<<<<<<<<< * Sys_Sizes(csize, cbsize, c, n, N) * return 0 */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_rsize, __pyx_v_rbsize, __pyx_v_r, __pyx_v_m, __pyx_v_M); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 646, __pyx_L1_error) /* "PETSc/petscmat.pxi":647 * # split row and column sizes * Sys_Sizes(rsize, rbsize, r, m, M) * Sys_Sizes(csize, cbsize, c, n, N) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_csize, __pyx_v_cbsize, __pyx_v_c, __pyx_v_n, __pyx_v_N); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 647, __pyx_L1_error) /* "PETSc/petscmat.pxi":648 * Sys_Sizes(rsize, rbsize, r, m, M) * Sys_Sizes(csize, cbsize, c, n, N) * return 0 # <<<<<<<<<<<<<< * * cdef inline int Mat_Create( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":627 * # ----------------------------------------------------------------------------- * * cdef inline int Mat_Sizes( # <<<<<<<<<<<<<< * object size, object bsize, * PetscInt *r, PetscInt *c, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat_Sizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rsize); __Pyx_XDECREF(__pyx_v_csize); __Pyx_XDECREF(__pyx_v_rbsize); __Pyx_XDECREF(__pyx_v_cbsize); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":650 * return 0 * * cdef inline int Mat_Create( # <<<<<<<<<<<<<< * PetscMatType mtype, * object comm, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_Create(MatType __pyx_v_mtype, PyObject *__pyx_v_comm, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, Mat *__pyx_v_A) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; Mat __pyx_v_mat; int __pyx_r; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_Create", 0); /* "PETSc/petscmat.pxi":658 * ) except -1: * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 658, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/petscmat.pxi":660 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/petscmat.pxi":661 * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 661, __pyx_L1_error) /* "PETSc/petscmat.pxi":662 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 # <<<<<<<<<<<<<< * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_t_3 = ((__pyx_v_rbs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_rbs = 1; } /* "PETSc/petscmat.pxi":663 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_3 = ((__pyx_v_cbs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_cbs = __pyx_v_rbs; } /* "PETSc/petscmat.pxi":664 * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix and set sizes */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 664, __pyx_L1_error) /* "PETSc/petscmat.pxi":665 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # create matrix and set sizes * cdef PetscMat mat = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 665, __pyx_L1_error) /* "PETSc/petscmat.pxi":667 * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix and set sizes * cdef PetscMat mat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreate(ccomm, &mat) ) * CHKERR( MatSetSizes(mat, m, n, M, N) ) */ __pyx_v_mat = NULL; /* "PETSc/petscmat.pxi":668 * # create matrix and set sizes * cdef PetscMat mat = NULL * CHKERR( MatCreate(ccomm, &mat) ) # <<<<<<<<<<<<<< * CHKERR( MatSetSizes(mat, m, n, M, N) ) * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_ccomm, (&__pyx_v_mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 668, __pyx_L1_error) /* "PETSc/petscmat.pxi":669 * cdef PetscMat mat = NULL * CHKERR( MatCreate(ccomm, &mat) ) * CHKERR( MatSetSizes(mat, m, n, M, N) ) # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) * CHKERR( MatSetType(mat, mtype) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetSizes(__pyx_v_mat, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 669, __pyx_L1_error) /* "PETSc/petscmat.pxi":670 * CHKERR( MatCreate(ccomm, &mat) ) * CHKERR( MatSetSizes(mat, m, n, M, N) ) * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) # <<<<<<<<<<<<<< * CHKERR( MatSetType(mat, mtype) ) * A[0] = mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_mat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 670, __pyx_L1_error) /* "PETSc/petscmat.pxi":671 * CHKERR( MatSetSizes(mat, m, n, M, N) ) * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) * CHKERR( MatSetType(mat, mtype) ) # <<<<<<<<<<<<<< * A[0] = mat * return 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetType(__pyx_v_mat, __pyx_v_mtype)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 671, __pyx_L1_error) /* "PETSc/petscmat.pxi":672 * CHKERR( MatSetBlockSizes(mat, rbs, cbs) ) * CHKERR( MatSetType(mat, mtype) ) * A[0] = mat # <<<<<<<<<<<<<< * return 0 * */ (__pyx_v_A[0]) = __pyx_v_mat; /* "PETSc/petscmat.pxi":673 * CHKERR( MatSetType(mat, mtype) ) * A[0] = mat * return 0 # <<<<<<<<<<<<<< * * cdef inline int Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":650 * return 0 * * cdef inline int Mat_Create( # <<<<<<<<<<<<<< * PetscMatType mtype, * object comm, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat_Create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":675 * return 0 * * cdef inline int Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except -1: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(Mat __pyx_v_A, PyObject *__pyx_v_NNZ) { PetscBool __pyx_v_aij; PetscBool __pyx_v_baij; PetscBool __pyx_v_sbaij; PetscInt __pyx_v_m; PetscInt __pyx_v_bs; PyObject *__pyx_v_od_nnz = 0; PyObject *__pyx_v_oo_nnz = 0; PetscInt __pyx_v_d_nz; PetscInt __pyx_v_d_n; PetscInt *__pyx_v_d_nnz; PetscInt __pyx_v_o_nz; PetscInt __pyx_v_o_n; PetscInt *__pyx_v_o_nnz; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_AllocAIJ_NNZ", 0); /* "PETSc/petscmat.pxi":677 * cdef inline int Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except -1: * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) * # local row size and block size */ __pyx_v_aij = PETSC_FALSE; __pyx_v_baij = PETSC_FALSE; __pyx_v_sbaij = PETSC_FALSE; /* "PETSc/petscmat.pxi":678 * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) # <<<<<<<<<<<<<< * # local row size and block size * cdef PetscInt m=0, bs=1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHasPreallocationAIJ(__pyx_v_A, (&__pyx_v_aij), (&__pyx_v_baij), (&__pyx_v_sbaij))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 678, __pyx_L1_error) /* "PETSc/petscmat.pxi":680 * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) * # local row size and block size * cdef PetscInt m=0, bs=1 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: */ __pyx_v_m = 0; __pyx_v_bs = 1; /* "PETSc/petscmat.pxi":681 * # local row size and block size * cdef PetscInt m=0, bs=1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 681, __pyx_L1_error) /* "PETSc/petscmat.pxi":682 * cdef PetscInt m=0, bs=1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ __pyx_t_3 = ((__pyx_v_baij == PETSC_TRUE) != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_sbaij == PETSC_TRUE) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/petscmat.pxi":683 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) # <<<<<<<<<<<<<< * assert bs > 0, "block size not set" * # unpack NNZ argument */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_A, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 683, __pyx_L1_error) /* "PETSc/petscmat.pxi":684 * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" # <<<<<<<<<<<<<< * # unpack NNZ argument * cdef object od_nnz, oo_nnz */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_bs > 0) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_block_size_not_set); __PYX_ERR(6, 684, __pyx_L1_error) } } #endif /* "PETSc/petscmat.pxi":682 * cdef PetscInt m=0, bs=1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ } /* "PETSc/petscmat.pxi":687 * # unpack NNZ argument * cdef object od_nnz, oo_nnz * try: # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "PETSc/petscmat.pxi":688 * cdef object od_nnz, oo_nnz * try: * od_nnz, oo_nnz = NNZ # <<<<<<<<<<<<<< * except (TypeError, ValueError): * od_nnz, oo_nnz = NNZ, None */ if ((likely(PyTuple_CheckExact(__pyx_v_NNZ))) || (PyList_CheckExact(__pyx_v_NNZ))) { PyObject* sequence = __pyx_v_NNZ; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 688, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 688, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 688, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_NNZ); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 688, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(6, 688, __pyx_L6_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 688, __pyx_L6_error) __pyx_L13_unpacking_done:; } __pyx_v_od_nnz = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_oo_nnz = __pyx_t_8; __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":687 * # unpack NNZ argument * cdef object od_nnz, oo_nnz * try: # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscmat.pxi":689 * try: * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ, None * # diagonal and off-diagonal number of nonzeros */ __pyx_t_1 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_1) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_NNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(6, 689, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_9); /* "PETSc/petscmat.pxi":690 * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): * od_nnz, oo_nnz = NNZ, None # <<<<<<<<<<<<<< * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL */ __pyx_t_11 = __pyx_v_NNZ; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = Py_None; __Pyx_INCREF(__pyx_t_12); __Pyx_XDECREF_SET(__pyx_v_od_nnz, __pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_oo_nnz, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_exception_handled; } goto __pyx_L8_except_error; __pyx_L8_except_error:; /* "PETSc/petscmat.pxi":687 * # unpack NNZ argument * cdef object od_nnz, oo_nnz * try: # <<<<<<<<<<<<<< * od_nnz, oo_nnz = NNZ * except (TypeError, ValueError): */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L7_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L11_try_end:; } /* "PETSc/petscmat.pxi":692 * od_nnz, oo_nnz = NNZ, None * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL # <<<<<<<<<<<<<< * if od_nnz is not None: * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) */ __pyx_v_d_nz = PETSC_DECIDE; __pyx_v_d_n = 0; __pyx_v_d_nnz = NULL; /* "PETSc/petscmat.pxi":693 * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL * if od_nnz is not None: # <<<<<<<<<<<<<< * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case */ __pyx_t_2 = (__pyx_v_od_nnz != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":694 * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL * if od_nnz is not None: * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) # <<<<<<<<<<<<<< * if d_n == 0: d_nnz = NULL # just in case * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_od_nnz, (&__pyx_v_d_n), (&__pyx_v_d_nnz))); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_od_nnz, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscmat.pxi":695 * if od_nnz is not None: * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case # <<<<<<<<<<<<<< * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL */ __pyx_t_3 = ((__pyx_v_d_n == 0) != 0); if (__pyx_t_3) { __pyx_v_d_nnz = NULL; goto __pyx_L17; } /* "PETSc/petscmat.pxi":696 * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL # <<<<<<<<<<<<<< * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: */ __pyx_t_3 = ((__pyx_v_d_n == 1) != 0); if (__pyx_t_3) { __pyx_v_d_nz = (__pyx_v_d_nnz[0]); __pyx_v_d_n = 0; __pyx_v_d_nnz = NULL; } __pyx_L17:; /* "PETSc/petscmat.pxi":693 * # diagonal and off-diagonal number of nonzeros * cdef PetscInt d_nz=PETSC_DECIDE, d_n=0, *d_nnz=NULL * if od_nnz is not None: # <<<<<<<<<<<<<< * od_nnz = iarray_i(od_nnz, &d_n, &d_nnz) * if d_n == 0: d_nnz = NULL # just in case */ } /* "PETSc/petscmat.pxi":697 * if d_n == 0: d_nnz = NULL # just in case * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL # <<<<<<<<<<<<<< * if oo_nnz is not None: * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) */ __pyx_v_o_nz = PETSC_DECIDE; __pyx_v_o_n = 0; __pyx_v_o_nnz = NULL; /* "PETSc/petscmat.pxi":698 * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: # <<<<<<<<<<<<<< * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case */ __pyx_t_3 = (__pyx_v_oo_nnz != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":699 * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) # <<<<<<<<<<<<<< * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oo_nnz, (&__pyx_v_o_n), (&__pyx_v_o_nnz))); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_oo_nnz, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscmat.pxi":700 * if oo_nnz is not None: * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case # <<<<<<<<<<<<<< * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: */ __pyx_t_2 = ((__pyx_v_o_n == 0) != 0); if (__pyx_t_2) { __pyx_v_o_nnz = NULL; goto __pyx_L19; } /* "PETSc/petscmat.pxi":701 * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL # <<<<<<<<<<<<<< * if m == PETSC_DECIDE: * if d_n > 1 and d_n*bs > m: m = d_n*bs */ __pyx_t_2 = ((__pyx_v_o_n == 1) != 0); if (__pyx_t_2) { __pyx_v_o_nz = (__pyx_v_o_nnz[0]); __pyx_v_o_n = 0; __pyx_v_o_nnz = NULL; } __pyx_L19:; /* "PETSc/petscmat.pxi":698 * elif d_n == 1: d_nz = d_nnz[0]; d_n=0; d_nnz = NULL * cdef PetscInt o_nz=PETSC_DECIDE, o_n=0, *o_nnz=NULL * if oo_nnz is not None: # <<<<<<<<<<<<<< * oo_nnz = iarray_i(oo_nnz, &o_n, &o_nnz) * if o_n == 0: o_nnz = NULL # just in case */ } /* "PETSc/petscmat.pxi":702 * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: # <<<<<<<<<<<<<< * if d_n > 1 and d_n*bs > m: m = d_n*bs * if o_n > 1 and o_n*bs > m: m = o_n*bs */ __pyx_t_2 = ((__pyx_v_m == PETSC_DECIDE) != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":703 * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: * if d_n > 1 and d_n*bs > m: m = d_n*bs # <<<<<<<<<<<<<< * if o_n > 1 and o_n*bs > m: m = o_n*bs * # check array sizes */ __pyx_t_3 = ((__pyx_v_d_n > 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L22_bool_binop_done; } __pyx_t_3 = (((__pyx_v_d_n * __pyx_v_bs) > __pyx_v_m) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L22_bool_binop_done:; if (__pyx_t_2) { __pyx_v_m = (__pyx_v_d_n * __pyx_v_bs); } /* "PETSc/petscmat.pxi":704 * if m == PETSC_DECIDE: * if d_n > 1 and d_n*bs > m: m = d_n*bs * if o_n > 1 and o_n*bs > m: m = o_n*bs # <<<<<<<<<<<<<< * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( */ __pyx_t_3 = ((__pyx_v_o_n > 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L25_bool_binop_done; } __pyx_t_3 = (((__pyx_v_o_n * __pyx_v_bs) > __pyx_v_m) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L25_bool_binop_done:; if (__pyx_t_2) { __pyx_v_m = (__pyx_v_o_n * __pyx_v_bs); } /* "PETSc/petscmat.pxi":702 * if o_n == 0: o_nnz = NULL # just in case * elif o_n == 1: o_nz = o_nnz[0]; o_n=0; o_nnz = NULL * if m == PETSC_DECIDE: # <<<<<<<<<<<<<< * if d_n > 1 and d_n*bs > m: m = d_n*bs * if o_n > 1 and o_n*bs > m: m = o_n*bs */ } /* "PETSc/petscmat.pxi":706 * if o_n > 1 and o_n*bs > m: m = o_n*bs * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) */ __pyx_t_3 = ((__pyx_v_d_n > 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L28_bool_binop_done; } __pyx_t_3 = (((__pyx_v_d_n * __pyx_v_bs) != __pyx_v_m) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L28_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "PETSc/petscmat.pxi":708 * if d_n > 1 and d_n*bs != m: raise ValueError( * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) # <<<<<<<<<<<<<< * if o_n > 1 and o_n*bs != m: raise ValueError( * "size(o_nnz) is %d, expected %d" % */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_d_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_9 = 0; __pyx_t_7 = 0; /* "PETSc/petscmat.pxi":707 * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( * "size(d_nnz) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( */ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_size_d_nnz_is_d_expected_d, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":706 * if o_n > 1 and o_n*bs > m: m = o_n*bs * # check array sizes * if d_n > 1 and d_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(6, 706, __pyx_L1_error) } /* "PETSc/petscmat.pxi":709 * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(o_nnz) is %d, expected %d" % * (toInt(o_n), toInt(m//bs)) ) */ __pyx_t_3 = ((__pyx_v_o_n > 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L31_bool_binop_done; } __pyx_t_3 = (((__pyx_v_o_n * __pyx_v_bs) != __pyx_v_m) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L31_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "PETSc/petscmat.pxi":711 * if o_n > 1 and o_n*bs != m: raise ValueError( * "size(o_nnz) is %d, expected %d" % * (toInt(o_n), toInt(m//bs)) ) # <<<<<<<<<<<<<< * # preallocate * if aij == PETSC_TRUE: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_o_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); __pyx_t_8 = 0; __pyx_t_7 = 0; /* "PETSc/petscmat.pxi":710 * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( * "size(o_nnz) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(o_n), toInt(m//bs)) ) * # preallocate */ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_size_o_nnz_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscmat.pxi":709 * "size(d_nnz) is %d, expected %d" % * (toInt(d_n), toInt(m//bs)) ) * if o_n > 1 and o_n*bs != m: raise ValueError( # <<<<<<<<<<<<<< * "size(o_nnz) is %d, expected %d" % * (toInt(o_n), toInt(m//bs)) ) */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(6, 709, __pyx_L1_error) } /* "PETSc/petscmat.pxi":713 * (toInt(o_n), toInt(m//bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) */ __pyx_t_2 = ((__pyx_v_aij == PETSC_TRUE) != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":714 * # preallocate * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqAIJSetPreallocation(__pyx_v_A, __pyx_v_d_nz, __pyx_v_d_nnz)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 714, __pyx_L1_error) /* "PETSc/petscmat.pxi":715 * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIAIJSetPreallocation(__pyx_v_A, __pyx_v_d_nz, __pyx_v_d_nnz, __pyx_v_o_nz, __pyx_v_o_nnz)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 715, __pyx_L1_error) /* "PETSc/petscmat.pxi":713 * (toInt(o_n), toInt(m//bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) */ } /* "PETSc/petscmat.pxi":716 * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ __pyx_t_2 = ((__pyx_v_baij == PETSC_TRUE) != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":717 * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 717, __pyx_L1_error) /* "PETSc/petscmat.pxi":718 * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) # <<<<<<<<<<<<<< * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz, __pyx_v_o_nz, __pyx_v_o_nnz)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 718, __pyx_L1_error) /* "PETSc/petscmat.pxi":716 * CHKERR( MatSeqAIJSetPreallocation(A, d_nz, d_nnz) ) * CHKERR( MatMPIAIJSetPreallocation(A, d_nz, d_nnz, o_nz, o_nnz) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ } /* "PETSc/petscmat.pxi":719 * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ __pyx_t_2 = ((__pyx_v_sbaij == PETSC_TRUE) != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":720 * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) # <<<<<<<<<<<<<< * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * return 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqSBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 720, __pyx_L1_error) /* "PETSc/petscmat.pxi":721 * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPISBAIJSetPreallocation(__pyx_v_A, __pyx_v_bs, __pyx_v_d_nz, __pyx_v_d_nnz, __pyx_v_o_nz, __pyx_v_o_nnz)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 721, __pyx_L1_error) /* "PETSc/petscmat.pxi":719 * CHKERR( MatSeqBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPIBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) */ } /* "PETSc/petscmat.pxi":722 * CHKERR( MatSeqSBAIJSetPreallocation(A, bs, d_nz, d_nnz) ) * CHKERR( MatMPISBAIJSetPreallocation(A, bs, d_nz, d_nnz, o_nz, o_nnz) ) * return 0 # <<<<<<<<<<<<<< * * cdef inline int Mat_AllocAIJ_CSR(PetscMat A, object CSR) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":675 * return 0 * * cdef inline int Mat_AllocAIJ_NNZ( PetscMat A, object NNZ) except -1: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_NNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_od_nnz); __Pyx_XDECREF(__pyx_v_oo_nnz); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":724 * return 0 * * cdef inline int Mat_AllocAIJ_CSR(PetscMat A, object CSR) except -1: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(Mat __pyx_v_A, PyObject *__pyx_v_CSR) { PetscBool __pyx_v_aij; PetscBool __pyx_v_baij; PetscBool __pyx_v_sbaij; PetscInt __pyx_v_m; PetscInt __pyx_v_bs; PyObject *__pyx_v_oi = 0; PyObject *__pyx_v_oj = 0; PyObject *__pyx_v_ov = 0; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_AllocAIJ_CSR", 0); /* "PETSc/petscmat.pxi":726 * cdef inline int Mat_AllocAIJ_CSR(PetscMat A, object CSR) except -1: * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) * # local row size and block size */ __pyx_v_aij = PETSC_FALSE; __pyx_v_baij = PETSC_FALSE; __pyx_v_sbaij = PETSC_FALSE; /* "PETSc/petscmat.pxi":727 * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) # <<<<<<<<<<<<<< * # local row size and block size * cdef PetscInt m=0, bs = 1 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHasPreallocationAIJ(__pyx_v_A, (&__pyx_v_aij), (&__pyx_v_baij), (&__pyx_v_sbaij))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 727, __pyx_L1_error) /* "PETSc/petscmat.pxi":729 * CHKERR( MatHasPreallocationAIJ(A, &aij, &baij, &sbaij)) * # local row size and block size * cdef PetscInt m=0, bs = 1 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: */ __pyx_v_m = 0; __pyx_v_bs = 1; /* "PETSc/petscmat.pxi":730 * # local row size and block size * cdef PetscInt m=0, bs = 1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 730, __pyx_L1_error) /* "PETSc/petscmat.pxi":731 * cdef PetscInt m=0, bs = 1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ __pyx_t_3 = ((__pyx_v_baij == PETSC_TRUE) != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = ((__pyx_v_sbaij == PETSC_TRUE) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/petscmat.pxi":732 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) # <<<<<<<<<<<<<< * assert bs > 0, "block size not set" * # unpack CSR argument */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_A, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 732, __pyx_L1_error) /* "PETSc/petscmat.pxi":733 * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" # <<<<<<<<<<<<<< * # unpack CSR argument * cdef object oi, oj, ov */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_bs > 0) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_block_size_not_set); __PYX_ERR(6, 733, __pyx_L1_error) } } #endif /* "PETSc/petscmat.pxi":731 * cdef PetscInt m=0, bs = 1 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * if baij == PETSC_TRUE or sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(A, &bs) ) * assert bs > 0, "block size not set" */ } /* "PETSc/petscmat.pxi":736 * # unpack CSR argument * cdef object oi, oj, ov * try: # <<<<<<<<<<<<<< * oi, oj, ov = CSR * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "PETSc/petscmat.pxi":737 * cdef object oi, oj, ov * try: * oi, oj, ov = CSR # <<<<<<<<<<<<<< * except (TypeError, ValueError): * oi, oj = CSR; ov = None */ if ((likely(PyTuple_CheckExact(__pyx_v_CSR))) || (PyList_CheckExact(__pyx_v_CSR))) { PyObject* sequence = __pyx_v_CSR; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 737, __pyx_L6_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 737, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 737, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 737, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_CSR); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 737, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(6, 737, __pyx_L6_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 737, __pyx_L6_error) __pyx_L13_unpacking_done:; } __pyx_v_oi = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_oj = __pyx_t_8; __pyx_t_8 = 0; __pyx_v_ov = __pyx_t_9; __pyx_t_9 = 0; /* "PETSc/petscmat.pxi":736 * # unpack CSR argument * cdef object oi, oj, ov * try: # <<<<<<<<<<<<<< * oi, oj, ov = CSR * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L11_try_end; __pyx_L6_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscmat.pxi":738 * try: * oi, oj, ov = CSR * except (TypeError, ValueError): # <<<<<<<<<<<<<< * oi, oj = CSR; ov = None * # rows, cols, and values */ __pyx_t_1 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_1) { __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0) __PYX_ERR(6, 738, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); /* "PETSc/petscmat.pxi":739 * oi, oj, ov = CSR * except (TypeError, ValueError): * oi, oj = CSR; ov = None # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL */ if ((likely(PyTuple_CheckExact(__pyx_v_CSR))) || (PyList_CheckExact(__pyx_v_CSR))) { PyObject* sequence = __pyx_v_CSR; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 739, __pyx_L8_except_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_10 = PyList_GET_ITEM(sequence, 0); __pyx_t_12 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_12); #else __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 739, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 739, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_12); #endif } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_CSR); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 739, __pyx_L8_except_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = Py_TYPE(__pyx_t_13)->tp_iternext; index = 0; __pyx_t_10 = __pyx_t_11(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_12 = __pyx_t_11(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L16_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_13), 2) < 0) __PYX_ERR(6, 739, __pyx_L8_except_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L17_unpacking_done; __pyx_L16_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 739, __pyx_L8_except_error) __pyx_L17_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_oi, __pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF_SET(__pyx_v_oj, __pyx_t_12); __pyx_t_12 = 0; __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_ov, Py_None); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_exception_handled; } goto __pyx_L8_except_error; __pyx_L8_except_error:; /* "PETSc/petscmat.pxi":736 * # unpack CSR argument * cdef object oi, oj, ov * try: # <<<<<<<<<<<<<< * oi, oj, ov = CSR * except (TypeError, ValueError): */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L7_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L11_try_end:; } /* "PETSc/petscmat.pxi":741 * oi, oj = CSR; ov = None * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/petscmat.pxi":742 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "PETSc/petscmat.pxi":743 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "PETSc/petscmat.pxi":744 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "PETSc/petscmat.pxi":745 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * oj = iarray_i(oj, &nj, &j) * if ov is not None: */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_oi, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscmat.pxi":746 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * if ov is not None: * ov = iarray_s(ov, &nv, &v) */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_oj, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscmat.pxi":747 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * if ov is not None: # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * if m == PETSC_DECIDE: m = (ni-1)*bs */ __pyx_t_2 = (__pyx_v_ov != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":748 * oj = iarray_i(oj, &nj, &j) * if ov is not None: * ov = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * if m == PETSC_DECIDE: m = (ni-1)*bs * # check array sizes */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_ov, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscmat.pxi":747 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * if ov is not None: # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * if m == PETSC_DECIDE: m = (ni-1)*bs */ } /* "PETSc/petscmat.pxi":749 * if ov is not None: * ov = iarray_s(ov, &nv, &v) * if m == PETSC_DECIDE: m = (ni-1)*bs # <<<<<<<<<<<<<< * # check array sizes * if ((ni-1)*bs != m): */ __pyx_t_3 = ((__pyx_v_m == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_m = ((__pyx_v_ni - 1) * __pyx_v_bs); } /* "PETSc/petscmat.pxi":751 * if m == PETSC_DECIDE: m = (ni-1)*bs * # check array sizes * if ((ni-1)*bs != m): # <<<<<<<<<<<<<< * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) */ __pyx_t_3 = ((((__pyx_v_ni - 1) * __pyx_v_bs) != __pyx_v_m) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscmat.pxi":753 * if ((ni-1)*bs != m): * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) # <<<<<<<<<<<<<< * if (i[0] != 0): * raise ValueError("I[0] is %d, expected %d" % */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_m / __pyx_v_bs) + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __pyx_t_7 = 0; __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":752 * # check array sizes * if ((ni-1)*bs != m): * raise ValueError("size(I) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_I_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(6, 752, __pyx_L1_error) /* "PETSc/petscmat.pxi":751 * if m == PETSC_DECIDE: m = (ni-1)*bs * # check array sizes * if ((ni-1)*bs != m): # <<<<<<<<<<<<<< * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) */ } /* "PETSc/petscmat.pxi":754 * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): # <<<<<<<<<<<<<< * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) */ __pyx_t_3 = (((__pyx_v_i[0]) != 0) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscmat.pxi":756 * if (i[0] != 0): * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) # <<<<<<<<<<<<<< * if (i[ni-1] != nj): * raise ValueError("size(J) is %d, expected %d" % */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); __pyx_t_9 = 0; __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":755 * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): * raise ValueError("I[0] is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_I_0_is_d_expected_d, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(6, 755, __pyx_L1_error) /* "PETSc/petscmat.pxi":754 * raise ValueError("size(I) is %d, expected %d" % * (toInt(ni), toInt(m//bs+1)) ) * if (i[0] != 0): # <<<<<<<<<<<<<< * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) */ } /* "PETSc/petscmat.pxi":757 * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): # <<<<<<<<<<<<<< * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ __pyx_t_3 = (((__pyx_v_i[(__pyx_v_ni - 1)]) != __pyx_v_nj) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscmat.pxi":759 * if (i[ni-1] != nj): * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) # <<<<<<<<<<<<<< * if v != NULL and (nj*bs*bs != nv): * raise ValueError("size(V) is %d, expected %d" % */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); __pyx_t_7 = 0; __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":758 * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): * raise ValueError("size(J) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_J_is_d_expected_d, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(6, 758, __pyx_L1_error) /* "PETSc/petscmat.pxi":757 * raise ValueError("I[0] is %d, expected %d" % * (toInt(i[0]), toInt(0)) ) * if (i[ni-1] != nj): # <<<<<<<<<<<<<< * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ } /* "PETSc/petscmat.pxi":760 * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): # <<<<<<<<<<<<<< * raise ValueError("size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*bs*bs)) ) */ __pyx_t_2 = ((__pyx_v_v != NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L24_bool_binop_done; } __pyx_t_2 = ((((__pyx_v_nj * __pyx_v_bs) * __pyx_v_bs) != __pyx_v_nv) != 0); __pyx_t_3 = __pyx_t_2; __pyx_L24_bool_binop_done:; if (unlikely(__pyx_t_3)) { /* "PETSc/petscmat.pxi":762 * if v != NULL and (nj*bs*bs != nv): * raise ValueError("size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*bs*bs)) ) # <<<<<<<<<<<<<< * # preallocate * if aij == PETSC_TRUE: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_bs) * __pyx_v_bs)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); __pyx_t_9 = 0; __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":761 * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): * raise ValueError("size(V) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nv), toInt(nj*bs*bs)) ) * # preallocate */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_size_V_is_d_expected_d, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(6, 761, __pyx_L1_error) /* "PETSc/petscmat.pxi":760 * raise ValueError("size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if v != NULL and (nj*bs*bs != nv): # <<<<<<<<<<<<<< * raise ValueError("size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*bs*bs)) ) */ } /* "PETSc/petscmat.pxi":764 * (toInt(nv), toInt(nj*bs*bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) */ __pyx_t_3 = ((__pyx_v_aij == PETSC_TRUE) != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":765 * # preallocate * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 765, __pyx_L1_error) /* "PETSc/petscmat.pxi":766 * if aij == PETSC_TRUE: * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) # <<<<<<<<<<<<<< * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 766, __pyx_L1_error) /* "PETSc/petscmat.pxi":764 * (toInt(nv), toInt(nj*bs*bs)) ) * # preallocate * if aij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) */ } /* "PETSc/petscmat.pxi":767 * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_3 = ((__pyx_v_baij == PETSC_TRUE) != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":768 * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 768, __pyx_L1_error) /* "PETSc/petscmat.pxi":769 * if baij == PETSC_TRUE: * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 769, __pyx_L1_error) /* "PETSc/petscmat.pxi":767 * CHKERR( MatSeqAIJSetPreallocationCSR(A, i, j, v) ) * CHKERR( MatMPIAIJSetPreallocationCSR(A, i, j, v) ) * if baij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ } /* "PETSc/petscmat.pxi":770 * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ __pyx_t_3 = ((__pyx_v_sbaij == PETSC_TRUE) != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":771 * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) * return 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqSBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 771, __pyx_L1_error) /* "PETSc/petscmat.pxi":772 * if sbaij == PETSC_TRUE: * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPISBAIJSetPreallocationCSR(__pyx_v_A, __pyx_v_bs, __pyx_v_i, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 772, __pyx_L1_error) /* "PETSc/petscmat.pxi":770 * CHKERR( MatSeqBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPIBAIJSetPreallocationCSR(A, bs, i, j, v) ) * if sbaij == PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) */ } /* "PETSc/petscmat.pxi":773 * CHKERR( MatSeqSBAIJSetPreallocationCSR(A, bs, i, j, v) ) * CHKERR( MatMPISBAIJSetPreallocationCSR(A, bs, i, j, v) ) * return 0 # <<<<<<<<<<<<<< * * cdef inline int Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":724 * return 0 * * cdef inline int Mat_AllocAIJ_CSR(PetscMat A, object CSR) except -1: # <<<<<<<<<<<<<< * # * cdef PetscBool aij=PETSC_FALSE, baij=PETSC_FALSE, sbaij=PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oi); __Pyx_XDECREF(__pyx_v_oj); __Pyx_XDECREF(__pyx_v_ov); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":775 * return 0 * * cdef inline int Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except -1: # <<<<<<<<<<<<<< * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(Mat __pyx_v_A, PyObject *__pyx_v_NNZ, PyObject *__pyx_v_CSR) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_AllocAIJ", 0); /* "PETSc/petscmat.pxi":776 * * cdef inline int Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except -1: * if CSR is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: */ __pyx_t_1 = (__pyx_v_CSR != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":777 * cdef inline int Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except -1: * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) # <<<<<<<<<<<<<< * if NNZ is not None: * return Mat_AllocAIJ_NNZ(A, NNZ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(__pyx_v_A, __pyx_v_CSR); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 777, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/petscmat.pxi":776 * * cdef inline int Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except -1: * if CSR is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: */ } /* "PETSc/petscmat.pxi":778 * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_NNZ(A, NNZ) * return 0 */ __pyx_t_2 = (__pyx_v_NNZ != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscmat.pxi":779 * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: * return Mat_AllocAIJ_NNZ(A, NNZ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(__pyx_v_A, __pyx_v_NNZ); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 779, __pyx_L1_error) __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/petscmat.pxi":778 * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) * if NNZ is not None: # <<<<<<<<<<<<<< * return Mat_AllocAIJ_NNZ(A, NNZ) * return 0 */ } /* "PETSc/petscmat.pxi":780 * if NNZ is not None: * return Mat_AllocAIJ_NNZ(A, NNZ) * return 0 # <<<<<<<<<<<<<< * * cdef inline object Mat_AllocDense(PetscMat A, object array): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":775 * return 0 * * cdef inline int Mat_AllocAIJ(PetscMat A,object NNZ, object CSR) except -1: # <<<<<<<<<<<<<< * if CSR is not None: * return Mat_AllocAIJ_CSR(A, CSR) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":782 * return 0 * * cdef inline object Mat_AllocDense(PetscMat A, object array): # <<<<<<<<<<<<<< * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_Mat_AllocDense(Mat __pyx_v_A, PyObject *__pyx_v_array) { PetscInt __pyx_v_m; PetscInt __pyx_v_N; PetscInt __pyx_v_size; PetscScalar *__pyx_v_data; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Mat_AllocDense", 0); __Pyx_INCREF(__pyx_v_array); /* "PETSc/petscmat.pxi":783 * * cdef inline object Mat_AllocDense(PetscMat A, object array): * cdef PetscInt m=0, N=0 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(A, &m, NULL) ) * CHKERR( MatGetSize(A, NULL, &N) ) */ __pyx_v_m = 0; __pyx_v_N = 0; /* "PETSc/petscmat.pxi":784 * cdef inline object Mat_AllocDense(PetscMat A, object array): * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) # <<<<<<<<<<<<<< * CHKERR( MatGetSize(A, NULL, &N) ) * cdef PetscInt size=0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 784, __pyx_L1_error) /* "PETSc/petscmat.pxi":785 * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * CHKERR( MatGetSize(A, NULL, &N) ) # <<<<<<<<<<<<<< * cdef PetscInt size=0 * cdef PetscScalar *data=NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_A, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 785, __pyx_L1_error) /* "PETSc/petscmat.pxi":786 * CHKERR( MatGetLocalSize(A, &m, NULL) ) * CHKERR( MatGetSize(A, NULL, &N) ) * cdef PetscInt size=0 # <<<<<<<<<<<<<< * cdef PetscScalar *data=NULL * if array is not None: */ __pyx_v_size = 0; /* "PETSc/petscmat.pxi":787 * CHKERR( MatGetSize(A, NULL, &N) ) * cdef PetscInt size=0 * cdef PetscScalar *data=NULL # <<<<<<<<<<<<<< * if array is not None: * array = ofarray_s(array, &size, &data) */ __pyx_v_data = NULL; /* "PETSc/petscmat.pxi":788 * cdef PetscInt size=0 * cdef PetscScalar *data=NULL * if array is not None: # <<<<<<<<<<<<<< * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( */ __pyx_t_2 = (__pyx_v_array != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":789 * cdef PetscScalar *data=NULL * if array is not None: * array = ofarray_s(array, &size, &data) # <<<<<<<<<<<<<< * if m*N != size: raise ValueError( * "size(array) is %d, expected %dx%d=%d" % */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ofarray_s(__pyx_v_array, (&__pyx_v_size), (&__pyx_v_data))); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":790 * if array is not None: * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( # <<<<<<<<<<<<<< * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) */ __pyx_t_3 = (((__pyx_v_m * __pyx_v_N) != __pyx_v_size) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscmat.pxi":792 * if m*N != size: raise ValueError( * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) # <<<<<<<<<<<<<< * CHKERR( MatSeqDenseSetPreallocation(A, data) ) * CHKERR( MatMPIDenseSetPreallocation(A, data) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m * __pyx_v_N)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; /* "PETSc/petscmat.pxi":791 * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( * "size(array) is %d, expected %dx%d=%d" % # <<<<<<<<<<<<<< * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) * CHKERR( MatSeqDenseSetPreallocation(A, data) ) */ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_size_array_is_d_expected_dx_d_d, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":790 * if array is not None: * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( # <<<<<<<<<<<<<< * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(6, 790, __pyx_L1_error) } /* "PETSc/petscmat.pxi":788 * cdef PetscInt size=0 * cdef PetscScalar *data=NULL * if array is not None: # <<<<<<<<<<<<<< * array = ofarray_s(array, &size, &data) * if m*N != size: raise ValueError( */ } /* "PETSc/petscmat.pxi":793 * "size(array) is %d, expected %dx%d=%d" % * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) * CHKERR( MatSeqDenseSetPreallocation(A, data) ) # <<<<<<<<<<<<<< * CHKERR( MatMPIDenseSetPreallocation(A, data) ) * return array */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSeqDenseSetPreallocation(__pyx_v_A, __pyx_v_data)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 793, __pyx_L1_error) /* "PETSc/petscmat.pxi":794 * (toInt(size), toInt(m), toInt(N), toInt(m*N)) ) * CHKERR( MatSeqDenseSetPreallocation(A, data) ) * CHKERR( MatMPIDenseSetPreallocation(A, data) ) # <<<<<<<<<<<<<< * return array * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMPIDenseSetPreallocation(__pyx_v_A, __pyx_v_data)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 794, __pyx_L1_error) /* "PETSc/petscmat.pxi":795 * CHKERR( MatSeqDenseSetPreallocation(A, data) ) * CHKERR( MatMPIDenseSetPreallocation(A, data) ) * return array # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "PETSc/petscmat.pxi":782 * return 0 * * cdef inline object Mat_AllocDense(PetscMat A, object array): # <<<<<<<<<<<<<< * cdef PetscInt m=0, N=0 * CHKERR( MatGetLocalSize(A, &m, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Mat_AllocDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":804 * const PetscScalar*,PetscInsertMode) * * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal */ static CYTHON_INLINE __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(int __pyx_v_blocked, int __pyx_v_local) { __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("matsetvalues_fcn", 0); /* "PETSc/petscmat.pxi":805 * * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): * cdef MatSetValuesFcn *setvalues = NULL # <<<<<<<<<<<<<< * if blocked and local: setvalues = MatSetValuesBlockedLocal * elif blocked: setvalues = MatSetValuesBlocked */ __pyx_v_setvalues = NULL; /* "PETSc/petscmat.pxi":806 * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal # <<<<<<<<<<<<<< * elif blocked: setvalues = MatSetValuesBlocked * elif local: setvalues = MatSetValuesLocal */ __pyx_t_2 = (__pyx_v_blocked != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_local != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { __pyx_v_setvalues = MatSetValuesBlockedLocal; goto __pyx_L3; } /* "PETSc/petscmat.pxi":807 * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal * elif blocked: setvalues = MatSetValuesBlocked # <<<<<<<<<<<<<< * elif local: setvalues = MatSetValuesLocal * else: setvalues = MatSetValues */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_v_setvalues = MatSetValuesBlocked; goto __pyx_L3; } /* "PETSc/petscmat.pxi":808 * if blocked and local: setvalues = MatSetValuesBlockedLocal * elif blocked: setvalues = MatSetValuesBlocked * elif local: setvalues = MatSetValuesLocal # <<<<<<<<<<<<<< * else: setvalues = MatSetValues * return setvalues */ __pyx_t_1 = (__pyx_v_local != 0); if (__pyx_t_1) { __pyx_v_setvalues = MatSetValuesLocal; goto __pyx_L3; } /* "PETSc/petscmat.pxi":809 * elif blocked: setvalues = MatSetValuesBlocked * elif local: setvalues = MatSetValuesLocal * else: setvalues = MatSetValues # <<<<<<<<<<<<<< * return setvalues * */ /*else*/ { __pyx_v_setvalues = MatSetValues; } __pyx_L3:; /* "PETSc/petscmat.pxi":810 * elif local: setvalues = MatSetValuesLocal * else: setvalues = MatSetValues * return setvalues # <<<<<<<<<<<<<< * * cdef inline int matsetvalues(PetscMat A, */ __pyx_r = __pyx_v_setvalues; goto __pyx_L0; /* "PETSc/petscmat.pxi":804 * const PetscScalar*,PetscInsertMode) * * cdef inline MatSetValuesFcn* matsetvalues_fcn(int blocked, int local): # <<<<<<<<<<<<<< * cdef MatSetValuesFcn *setvalues = NULL * if blocked and local: setvalues = MatSetValuesBlockedLocal */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":812 * return setvalues * * cdef inline int matsetvalues(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, int blocked, int local) except -1: */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; InsertMode __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvalues", 0); __Pyx_INCREF(__pyx_v_oi); __Pyx_INCREF(__pyx_v_oj); __Pyx_INCREF(__pyx_v_ov); /* "PETSc/petscmat.pxi":816 * object oaddv, int blocked, int local) except -1: * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "PETSc/petscmat.pxi":817 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 817, __pyx_L1_error) } /* "PETSc/petscmat.pxi":818 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # rows, cols, and values */ __pyx_t_1 = ((__pyx_v_rbs < 1) != 0); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "PETSc/petscmat.pxi":819 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL */ __pyx_t_1 = ((__pyx_v_cbs < 1) != 0); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "PETSc/petscmat.pxi":821 * if cbs < 1: cbs = 1 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/petscmat.pxi":822 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "PETSc/petscmat.pxi":823 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "PETSc/petscmat.pxi":824 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "PETSc/petscmat.pxi":825 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oi, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":826 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oj, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":827 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * if ni*nj*rbs*cbs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ov, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":828 * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv)) ) */ __pyx_t_1 = (((((__pyx_v_ni * __pyx_v_nj) * __pyx_v_rbs) * __pyx_v_cbs) != __pyx_v_nv) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/petscmat.pxi":830 * if ni*nj*rbs*cbs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv)) ) # <<<<<<<<<<<<<< * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":829 * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nj), toInt(nv)) ) * # MatSetValuesXXX function and insert mode */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":828 * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) * if ni*nj*rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv)) ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(6, 828, __pyx_L1_error) } /* "PETSc/petscmat.pxi":832 * (toInt(ni), toInt(nj), toInt(nv)) ) * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call */ __pyx_v_setvalues = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); /* "PETSc/petscmat.pxi":833 * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = matsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<< * # actual call * CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_7 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(6, 833, __pyx_L1_error) __pyx_v_addv = __pyx_t_7; /* "PETSc/petscmat.pxi":835 * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call * CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_A, __pyx_v_ni, __pyx_v_i, __pyx_v_nj, __pyx_v_j, __pyx_v_v, __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 835, __pyx_L1_error) /* "PETSc/petscmat.pxi":836 * # actual call * CHKERR( setvalues(A, ni, i, nj, j, v, addv) ) * return 0 # <<<<<<<<<<<<<< * * cdef inline int matsetvalues_rcv(PetscMat A, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":812 * return setvalues * * cdef inline int matsetvalues(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, int blocked, int local) except -1: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oi); __Pyx_XDECREF(__pyx_v_oj); __Pyx_XDECREF(__pyx_v_ov); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":838 * return 0 * * cdef inline int matsetvalues_rcv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; PyArrayObject *__pyx_v_ai = 0; PyArrayObject *__pyx_v_aj = 0; PyArrayObject *__pyx_v_av = 0; Py_ssize_t __pyx_v_nm; Py_ssize_t __pyx_v_si; Py_ssize_t __pyx_v_sj; Py_ssize_t __pyx_v_sv; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; Py_ssize_t __pyx_v_k; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; InsertMode __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvalues_rcv", 0); /* "PETSc/petscmat.pxi":843 * int blocked, int local) except -1: * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "PETSc/petscmat.pxi":844 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 844, __pyx_L1_error) } /* "PETSc/petscmat.pxi":845 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # rows, cols, and values */ __pyx_t_1 = ((__pyx_v_rbs < 1) != 0); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "PETSc/petscmat.pxi":846 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL */ __pyx_t_1 = ((__pyx_v_cbs < 1) != 0); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "PETSc/petscmat.pxi":848 * if cbs < 1: cbs = 1 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/petscmat.pxi":849 * # rows, cols, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "PETSc/petscmat.pxi":850 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef ndarray ai = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "PETSc/petscmat.pxi":851 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef ndarray ai = iarray_i(oi, &ni, &i) * cdef ndarray aj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "PETSc/petscmat.pxi":852 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * cdef ndarray ai = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * cdef ndarray aj = iarray_i(oj, &nj, &j) * cdef ndarray av = iarray_s(ov, &nv, &v) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_ai = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":853 * cdef PetscScalar *v=NULL * cdef ndarray ai = iarray_i(oi, &ni, &i) * cdef ndarray aj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * cdef ndarray av = iarray_s(ov, &nv, &v) * # check various dimensions */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_aj = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":854 * cdef ndarray ai = iarray_i(oi, &ni, &i) * cdef ndarray aj = iarray_i(oj, &nj, &j) * cdef ndarray av = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * # check various dimensions * if PyArray_NDIM(ai) != 2: raise ValueError( */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_av = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":856 * cdef ndarray av = iarray_s(ov, &nv, &v) * # check various dimensions * if PyArray_NDIM(ai) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) */ __pyx_t_1 = ((PyArray_NDIM(__pyx_v_ai) != 2) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/petscmat.pxi":858 * if PyArray_NDIM(ai) != 2: raise ValueError( * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) # <<<<<<<<<<<<<< * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( * "expecting a C-contiguous array") */ __pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_ai)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_row_indices_must_have_two_dimens, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":856 * cdef ndarray av = iarray_s(ov, &nv, &v) * # check various dimensions * if PyArray_NDIM(ai) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 856, __pyx_L1_error) } /* "PETSc/petscmat.pxi":859 * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( */ __pyx_t_1 = ((!(PyArray_ISCONTIGUOUS(__pyx_v_ai) != 0)) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 859, __pyx_L1_error) } /* "PETSc/petscmat.pxi":861 * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) */ __pyx_t_1 = ((PyArray_NDIM(__pyx_v_aj) != 2) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/petscmat.pxi":863 * if PyArray_NDIM(aj) != 2: raise ValueError( * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) # <<<<<<<<<<<<<< * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( * "expecting a C-contiguous array") */ __pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_aj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_column_indices_must_have_two_dim, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 863, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":861 * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 861, __pyx_L1_error) } /* "PETSc/petscmat.pxi":864 * ("column indices must have two dimensions: " * "cols.ndim=%d") % (PyArray_NDIM(aj)) ) * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * if PyArray_NDIM(av) < 2: raise ValueError( */ __pyx_t_1 = ((!(PyArray_ISCONTIGUOUS(__pyx_v_aj) != 0)) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 864, __pyx_L1_error) } /* "PETSc/petscmat.pxi":866 * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(av) < 2: raise ValueError( # <<<<<<<<<<<<<< * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) */ __pyx_t_1 = ((PyArray_NDIM(__pyx_v_av) < 2) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/petscmat.pxi":868 * if PyArray_NDIM(av) < 2: raise ValueError( * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) # <<<<<<<<<<<<<< * elif not PyArray_ISCONTIGUOUS(av): raise ValueError( * "expecting a C-contiguous array") */ __pyx_t_3 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_av)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_values_must_have_two_or_more_dim, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":866 * elif not PyArray_ISCONTIGUOUS(aj): raise ValueError( * "expecting a C-contiguous array") * if PyArray_NDIM(av) < 2: raise ValueError( # <<<<<<<<<<<<<< * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 866, __pyx_L1_error) } /* "PETSc/petscmat.pxi":869 * ("values must have two or more dimensions: " * "vals.ndim=%d") % (PyArray_NDIM(av)) ) * elif not PyArray_ISCONTIGUOUS(av): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * # check various shapes */ __pyx_t_1 = ((!(PyArray_ISCONTIGUOUS(__pyx_v_av) != 0)) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 869, __pyx_L1_error) } /* "PETSc/petscmat.pxi":872 * "expecting a C-contiguous array") * # check various shapes * cdef Py_ssize_t nm = PyArray_DIM(ai, 0) # <<<<<<<<<<<<<< * cdef Py_ssize_t si = PyArray_DIM(ai, 1) * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) */ __pyx_v_nm = PyArray_DIM(__pyx_v_ai, 0); /* "PETSc/petscmat.pxi":873 * # check various shapes * cdef Py_ssize_t nm = PyArray_DIM(ai, 0) * cdef Py_ssize_t si = PyArray_DIM(ai, 1) # <<<<<<<<<<<<<< * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) */ __pyx_v_si = PyArray_DIM(__pyx_v_ai, 1); /* "PETSc/petscmat.pxi":874 * cdef Py_ssize_t nm = PyArray_DIM(ai, 0) * cdef Py_ssize_t si = PyArray_DIM(ai, 1) * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) # <<<<<<<<<<<<<< * cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) * if ((nm != PyArray_DIM(aj, 0)) or */ __pyx_v_sj = PyArray_DIM(__pyx_v_aj, 1); /* "PETSc/petscmat.pxi":875 * cdef Py_ssize_t si = PyArray_DIM(ai, 1) * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) # <<<<<<<<<<<<<< * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or */ __pyx_v_sv = (PyArray_SIZE(__pyx_v_av) / PyArray_DIM(__pyx_v_av, 0)); /* "PETSc/petscmat.pxi":876 * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) * if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<< * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( */ __pyx_t_5 = ((__pyx_v_nm != PyArray_DIM(__pyx_v_aj, 0)) != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } /* "PETSc/petscmat.pxi":877 * cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or # <<<<<<<<<<<<<< * (si*rbs * sj*cbs != sv)): raise ValueError( * ("input arrays have incompatible shapes: " */ __pyx_t_5 = ((__pyx_v_nm != PyArray_DIM(__pyx_v_av, 0)) != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L10_bool_binop_done; } /* "PETSc/petscmat.pxi":878 * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( # <<<<<<<<<<<<<< * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % */ __pyx_t_5 = (((((__pyx_v_si * __pyx_v_rbs) * __pyx_v_sj) * __pyx_v_cbs) != __pyx_v_sv) != 0); __pyx_t_1 = __pyx_t_5; __pyx_L10_bool_binop_done:; /* "PETSc/petscmat.pxi":876 * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) * if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<< * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( */ if (unlikely(__pyx_t_1)) { /* "PETSc/petscmat.pxi":881 * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % * (ai.shape, aj.shape, av.shape)) # <<<<<<<<<<<<<< * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ai), __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_aj), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_av), __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":880 * (si*rbs * sj*cbs != sv)): raise ValueError( * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % # <<<<<<<<<<<<<< * (ai.shape, aj.shape, av.shape)) * # MatSetValuesXXX function and insert mode */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_input_arrays_have_incompatible_s, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscmat.pxi":878 * if ((nm != PyArray_DIM(aj, 0)) or * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( # <<<<<<<<<<<<<< * ("input arrays have incompatible shapes: " * "rows.shape=%s, cols.shape=%s, vals.shape=%s") % */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(6, 878, __pyx_L1_error) /* "PETSc/petscmat.pxi":876 * cdef Py_ssize_t sj = PyArray_DIM(aj, 1) * cdef Py_ssize_t sv = PyArray_SIZE(av) // PyArray_DIM(av, 0) * if ((nm != PyArray_DIM(aj, 0)) or # <<<<<<<<<<<<<< * (nm != PyArray_DIM(av, 0)) or * (si*rbs * sj*cbs != sv)): raise ValueError( */ } /* "PETSc/petscmat.pxi":884 * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oaddv) * # actual calls */ __pyx_v_setvalues = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); /* "PETSc/petscmat.pxi":885 * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<< * # actual calls * cdef Py_ssize_t k=0 */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_8 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(6, 885, __pyx_L1_error) __pyx_v_addv = __pyx_t_8; /* "PETSc/petscmat.pxi":887 * cdef PetscInsertMode addv = insertmode(oaddv) * # actual calls * cdef Py_ssize_t k=0 # <<<<<<<<<<<<<< * for k from 0 <= k < nm: * CHKERR( setvalues(A, */ __pyx_v_k = 0; /* "PETSc/petscmat.pxi":888 * # actual calls * cdef Py_ssize_t k=0 * for k from 0 <= k < nm: # <<<<<<<<<<<<<< * CHKERR( setvalues(A, * si, &i[k*si], */ __pyx_t_9 = __pyx_v_nm; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_9; __pyx_v_k++) { /* "PETSc/petscmat.pxi":889 * cdef Py_ssize_t k=0 * for k from 0 <= k < nm: * CHKERR( setvalues(A, # <<<<<<<<<<<<<< * si, &i[k*si], * sj, &j[k*sj], */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_A, ((PetscInt)__pyx_v_si), (&(__pyx_v_i[(__pyx_v_k * __pyx_v_si)])), ((PetscInt)__pyx_v_sj), (&(__pyx_v_j[(__pyx_v_k * __pyx_v_sj)])), (&(__pyx_v_v[(__pyx_v_k * __pyx_v_sv)])), __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 889, __pyx_L1_error) } /* "PETSc/petscmat.pxi":893 * sj, &j[k*sj], * &v[k*sv], addv) ) * return 0 # <<<<<<<<<<<<<< * * cdef inline int matsetvalues_ijv(PetscMat A, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":838 * return 0 * * cdef inline int matsetvalues_rcv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_rcv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ai); __Pyx_XDECREF((PyObject *)__pyx_v_aj); __Pyx_XDECREF((PyObject *)__pyx_v_av); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":895 * return 0 * * cdef inline int matsetvalues_ijv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, PyObject *__pyx_v_om, int __pyx_v_blocked, int __pyx_v_local) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscInt __pyx_v_nj; PetscInt *__pyx_v_j; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; PetscInt __pyx_v_nm; PetscInt *__pyx_v_m; PetscInt __pyx_v_rs; PetscInt __pyx_v_re; __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_v_setvalues; InsertMode __pyx_v_addv; PetscInt __pyx_v_k; PetscInt __pyx_v_l; PetscInt __pyx_v_irow; PetscInt __pyx_v_ncol; PetscInt *__pyx_v_icol; PetscScalar *__pyx_v_sval; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; InsertMode __pyx_t_7; PetscInt __pyx_t_8; PetscInt __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvalues_ijv", 0); __Pyx_INCREF(__pyx_v_oi); __Pyx_INCREF(__pyx_v_oj); __Pyx_INCREF(__pyx_v_ov); __Pyx_INCREF(__pyx_v_om); /* "PETSc/petscmat.pxi":901 * int blocked, int local) except -1: * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "PETSc/petscmat.pxi":902 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 902, __pyx_L1_error) } /* "PETSc/petscmat.pxi":903 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # column pointers, column indices, and values */ __pyx_t_1 = ((__pyx_v_rbs < 1) != 0); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "PETSc/petscmat.pxi":904 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # column pointers, column indices, and values * cdef PetscInt ni=0, *i=NULL */ __pyx_t_1 = ((__pyx_v_cbs < 1) != 0); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "PETSc/petscmat.pxi":906 * if cbs < 1: cbs = 1 * # column pointers, column indices, and values * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/petscmat.pxi":907 * # column pointers, column indices, and values * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL */ __pyx_v_nj = 0; __pyx_v_j = NULL; /* "PETSc/petscmat.pxi":908 * cdef PetscInt ni=0, *i=NULL * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) */ __pyx_v_nv = 0; /* "PETSc/petscmat.pxi":909 * cdef PetscInt nj=0, *j=NULL * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) */ __pyx_v_v = NULL; /* "PETSc/petscmat.pxi":910 * cdef PetscInt nv=0 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) # <<<<<<<<<<<<<< * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oi, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":911 * cdef PetscScalar *v=NULL * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) # <<<<<<<<<<<<<< * ov = iarray_s(ov, &nv, &v) * # row indices */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 911, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_oj, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":912 * oi = iarray_i(oi, &ni, &i) * oj = iarray_i(oj, &nj, &j) * ov = iarray_s(ov, &nv, &v) # <<<<<<<<<<<<<< * # row indices * cdef PetscInt nm=0, *m=NULL */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ov, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ov, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":914 * ov = iarray_s(ov, &nv, &v) * # row indices * cdef PetscInt nm=0, *m=NULL # <<<<<<<<<<<<<< * cdef PetscInt rs=0, re=ni-1 * if om is not None: */ __pyx_v_nm = 0; __pyx_v_m = NULL; /* "PETSc/petscmat.pxi":915 * # row indices * cdef PetscInt nm=0, *m=NULL * cdef PetscInt rs=0, re=ni-1 # <<<<<<<<<<<<<< * if om is not None: * om = iarray_i(om, &nm, &m) */ __pyx_v_rs = 0; __pyx_v_re = (__pyx_v_ni - 1); /* "PETSc/petscmat.pxi":916 * cdef PetscInt nm=0, *m=NULL * cdef PetscInt rs=0, re=ni-1 * if om is not None: # <<<<<<<<<<<<<< * om = iarray_i(om, &nm, &m) * else: */ __pyx_t_1 = (__pyx_v_om != Py_None); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "PETSc/petscmat.pxi":917 * cdef PetscInt rs=0, re=ni-1 * if om is not None: * om = iarray_i(om, &nm, &m) # <<<<<<<<<<<<<< * else: * if not local: */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_om, (&__pyx_v_nm), (&__pyx_v_m))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_om, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":916 * cdef PetscInt nm=0, *m=NULL * cdef PetscInt rs=0, re=ni-1 * if om is not None: # <<<<<<<<<<<<<< * om = iarray_i(om, &nm, &m) * else: */ goto __pyx_L6; } /* "PETSc/petscmat.pxi":919 * om = iarray_i(om, &nm, &m) * else: * if not local: # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs */ /*else*/ { __pyx_t_4 = ((!(__pyx_v_local != 0)) != 0); if (__pyx_t_4) { /* "PETSc/petscmat.pxi":920 * else: * if not local: * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) # <<<<<<<<<<<<<< * rs //= rbs; re //= rbs * nm = re - rs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRange(__pyx_v_A, (&__pyx_v_rs), (&__pyx_v_re))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 920, __pyx_L1_error) /* "PETSc/petscmat.pxi":921 * if not local: * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs # <<<<<<<<<<<<<< * nm = re - rs * # check various sizes */ __pyx_v_rs = (__pyx_v_rs / __pyx_v_rbs); __pyx_v_re = (__pyx_v_re / __pyx_v_rbs); /* "PETSc/petscmat.pxi":919 * om = iarray_i(om, &nm, &m) * else: * if not local: # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs */ } /* "PETSc/petscmat.pxi":922 * CHKERR( MatGetOwnershipRange(A, &rs, &re) ) * rs //= rbs; re //= rbs * nm = re - rs # <<<<<<<<<<<<<< * # check various sizes * if (ni-1 != nm): raise ValueError( */ __pyx_v_nm = (__pyx_v_re - __pyx_v_rs); } __pyx_L6:; /* "PETSc/petscmat.pxi":924 * nm = re - rs * # check various sizes * if (ni-1 != nm): raise ValueError( # <<<<<<<<<<<<<< * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) */ __pyx_t_4 = (((__pyx_v_ni - 1) != __pyx_v_nm) != 0); if (unlikely(__pyx_t_4)) { /* "PETSc/petscmat.pxi":926 * if (ni-1 != nm): raise ValueError( * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) # <<<<<<<<<<<<<< * if (i[0] != 0):raise ValueError( * "I[0] is %d, expected %d" % */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_nm + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":925 * # check various sizes * if (ni-1 != nm): raise ValueError( * "size(I) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_size_I_is_d_expected_d, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":924 * nm = re - rs * # check various sizes * if (ni-1 != nm): raise ValueError( # <<<<<<<<<<<<<< * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(6, 924, __pyx_L1_error) } /* "PETSc/petscmat.pxi":927 * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( # <<<<<<<<<<<<<< * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) */ __pyx_t_4 = (((__pyx_v_i[0]) != 0) != 0); if (unlikely(__pyx_t_4)) { /* "PETSc/petscmat.pxi":929 * if (i[0] != 0):raise ValueError( * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) # <<<<<<<<<<<<<< * if (i[ni-1] != nj): raise ValueError( * "size(J) is %d, expected %d" % */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":928 * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( * "I[0] is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_I_0_is_d_expected_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":927 * "size(I) is %d, expected %d" % * (toInt(ni), toInt(nm+1)) ) * if (i[0] != 0):raise ValueError( # <<<<<<<<<<<<<< * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(6, 927, __pyx_L1_error) } /* "PETSc/petscmat.pxi":930 * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( # <<<<<<<<<<<<<< * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ __pyx_t_4 = (((__pyx_v_i[(__pyx_v_ni - 1)]) != __pyx_v_nj) != 0); if (unlikely(__pyx_t_4)) { /* "PETSc/petscmat.pxi":932 * if (i[ni-1] != nj): raise ValueError( * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) # <<<<<<<<<<<<<< * if (nj*rbs*cbs != nv): raise ValueError( * "size(V) is %d, expected %d" % */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":931 * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( * "size(J) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_size_J_is_d_expected_d, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":930 * "I[0] is %d, expected %d" % * (toInt(i[0]), 0) ) * if (i[ni-1] != nj): raise ValueError( # <<<<<<<<<<<<<< * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 930, __pyx_L1_error) } /* "PETSc/petscmat.pxi":933 * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( # <<<<<<<<<<<<<< * "size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*rbs*cbs)) ) */ __pyx_t_4 = ((((__pyx_v_nj * __pyx_v_rbs) * __pyx_v_cbs) != __pyx_v_nv) != 0); if (unlikely(__pyx_t_4)) { /* "PETSc/petscmat.pxi":935 * if (nj*rbs*cbs != nv): raise ValueError( * "size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*rbs*cbs)) ) # <<<<<<<<<<<<<< * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_rbs) * __pyx_v_cbs)); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_3 = 0; __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":934 * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( * "size(V) is %d, expected %d" % # <<<<<<<<<<<<<< * (toInt(nv), toInt(nj*rbs*cbs)) ) * # MatSetValuesXXX function and insert mode */ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_size_V_is_d_expected_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":933 * "size(J) is %d, expected %d" % * (toInt(nj), toInt(i[ni-1])) ) * if (nj*rbs*cbs != nv): raise ValueError( # <<<<<<<<<<<<<< * "size(V) is %d, expected %d" % * (toInt(nv), toInt(nj*rbs*cbs)) ) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(6, 933, __pyx_L1_error) } /* "PETSc/petscmat.pxi":938 * # MatSetValuesXXX function and insert mode * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) # <<<<<<<<<<<<<< * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call */ __pyx_v_setvalues = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); /* "PETSc/petscmat.pxi":939 * cdef MatSetValuesFcn *setvalues = \ * matsetvalues_fcn(blocked, local) * cdef PetscInsertMode addv = insertmode(oaddv) # <<<<<<<<<<<<<< * # actual call * cdef PetscInt k=0, l=0 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_7 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(6, 939, __pyx_L1_error) __pyx_v_addv = __pyx_t_7; /* "PETSc/petscmat.pxi":941 * cdef PetscInsertMode addv = insertmode(oaddv) * # actual call * cdef PetscInt k=0, l=0 # <<<<<<<<<<<<<< * cdef PetscInt irow=0, ncol=0, *icol=NULL * cdef PetscScalar *sval=NULL */ __pyx_v_k = 0; __pyx_v_l = 0; /* "PETSc/petscmat.pxi":942 * # actual call * cdef PetscInt k=0, l=0 * cdef PetscInt irow=0, ncol=0, *icol=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *sval=NULL * for k from 0 <= k < nm: */ __pyx_v_irow = 0; __pyx_v_ncol = 0; __pyx_v_icol = NULL; /* "PETSc/petscmat.pxi":943 * cdef PetscInt k=0, l=0 * cdef PetscInt irow=0, ncol=0, *icol=NULL * cdef PetscScalar *sval=NULL # <<<<<<<<<<<<<< * for k from 0 <= k < nm: * irow = m[k] if m!=NULL else rs+k */ __pyx_v_sval = NULL; /* "PETSc/petscmat.pxi":944 * cdef PetscInt irow=0, ncol=0, *icol=NULL * cdef PetscScalar *sval=NULL * for k from 0 <= k < nm: # <<<<<<<<<<<<<< * irow = m[k] if m!=NULL else rs+k * ncol = i[k+1] - i[k] */ __pyx_t_8 = __pyx_v_nm; for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_8; __pyx_v_k++) { /* "PETSc/petscmat.pxi":945 * cdef PetscScalar *sval=NULL * for k from 0 <= k < nm: * irow = m[k] if m!=NULL else rs+k # <<<<<<<<<<<<<< * ncol = i[k+1] - i[k] * icol = j + i[k] */ if (((__pyx_v_m != NULL) != 0)) { __pyx_t_9 = (__pyx_v_m[__pyx_v_k]); } else { __pyx_t_9 = (__pyx_v_rs + __pyx_v_k); } __pyx_v_irow = __pyx_t_9; /* "PETSc/petscmat.pxi":946 * for k from 0 <= k < nm: * irow = m[k] if m!=NULL else rs+k * ncol = i[k+1] - i[k] # <<<<<<<<<<<<<< * icol = j + i[k] * if blocked: */ __pyx_v_ncol = ((__pyx_v_i[(__pyx_v_k + 1)]) - (__pyx_v_i[__pyx_v_k])); /* "PETSc/petscmat.pxi":947 * irow = m[k] if m!=NULL else rs+k * ncol = i[k+1] - i[k] * icol = j + i[k] # <<<<<<<<<<<<<< * if blocked: * sval = v + i[k]*rbs*cbs */ __pyx_v_icol = (__pyx_v_j + (__pyx_v_i[__pyx_v_k])); /* "PETSc/petscmat.pxi":948 * ncol = i[k+1] - i[k] * icol = j + i[k] * if blocked: # <<<<<<<<<<<<<< * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: */ __pyx_t_4 = (__pyx_v_blocked != 0); if (__pyx_t_4) { /* "PETSc/petscmat.pxi":949 * icol = j + i[k] * if blocked: * sval = v + i[k]*rbs*cbs # <<<<<<<<<<<<<< * for l from 0 <= l < ncol: * CHKERR( setvalues(A, 1, &irow, 1, &icol[l], */ __pyx_v_sval = (__pyx_v_v + (((__pyx_v_i[__pyx_v_k]) * __pyx_v_rbs) * __pyx_v_cbs)); /* "PETSc/petscmat.pxi":950 * if blocked: * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: # <<<<<<<<<<<<<< * CHKERR( setvalues(A, 1, &irow, 1, &icol[l], * &sval[l*rbs*cbs], addv) ) */ __pyx_t_9 = __pyx_v_ncol; for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_9; __pyx_v_l++) { /* "PETSc/petscmat.pxi":951 * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: * CHKERR( setvalues(A, 1, &irow, 1, &icol[l], # <<<<<<<<<<<<<< * &sval[l*rbs*cbs], addv) ) * else: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_A, 1, (&__pyx_v_irow), 1, (&(__pyx_v_icol[__pyx_v_l])), (&(__pyx_v_sval[((__pyx_v_l * __pyx_v_rbs) * __pyx_v_cbs)])), __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 951, __pyx_L1_error) } /* "PETSc/petscmat.pxi":948 * ncol = i[k+1] - i[k] * icol = j + i[k] * if blocked: # <<<<<<<<<<<<<< * sval = v + i[k]*rbs*cbs * for l from 0 <= l < ncol: */ goto __pyx_L14; } /* "PETSc/petscmat.pxi":954 * &sval[l*rbs*cbs], addv) ) * else: * sval = v + i[k] # <<<<<<<<<<<<<< * CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) * return 0 */ /*else*/ { __pyx_v_sval = (__pyx_v_v + (__pyx_v_i[__pyx_v_k])); /* "PETSc/petscmat.pxi":955 * else: * sval = v + i[k] * CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_v_setvalues(__pyx_v_A, 1, (&__pyx_v_irow), __pyx_v_ncol, __pyx_v_icol, __pyx_v_sval, __pyx_v_addv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 955, __pyx_L1_error) } __pyx_L14:; } /* "PETSc/petscmat.pxi":956 * sval = v + i[k] * CHKERR( setvalues(A, 1, &irow, ncol, icol, sval, addv) ) * return 0 # <<<<<<<<<<<<<< * * cdef inline int matsetvalues_csr(PetscMat A, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":895 * return 0 * * cdef inline int matsetvalues_ijv(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_ijv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oi); __Pyx_XDECREF(__pyx_v_oj); __Pyx_XDECREF(__pyx_v_ov); __Pyx_XDECREF(__pyx_v_om); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":958 * return 0 * * cdef inline int matsetvalues_csr(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(Mat __pyx_v_A, PyObject *__pyx_v_oi, PyObject *__pyx_v_oj, PyObject *__pyx_v_ov, PyObject *__pyx_v_oaddv, int __pyx_v_blocked, int __pyx_v_local) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvalues_csr", 0); /* "PETSc/petscmat.pxi":962 * object oaddv, * int blocked, int local) except -1: * matsetvalues_ijv(A, oi, oj, ov, oaddv, None, blocked, local) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_A, __pyx_v_oi, __pyx_v_oj, __pyx_v_ov, __pyx_v_oaddv, Py_None, __pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 962, __pyx_L1_error) /* "PETSc/petscmat.pxi":963 * int blocked, int local) except -1: * matsetvalues_ijv(A, oi, oj, ov, oaddv, None, blocked, local) * return 0 # <<<<<<<<<<<<<< * * cdef inline matgetvalues(PetscMat mat, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":958 * return 0 * * cdef inline int matsetvalues_csr(PetscMat A, # <<<<<<<<<<<<<< * object oi, object oj, object ov, * object oaddv, */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_csr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":965 * return 0 * * cdef inline matgetvalues(PetscMat mat, # <<<<<<<<<<<<<< * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_matgetvalues(Mat __pyx_v_mat, PyObject *__pyx_v_orows, PyObject *__pyx_v_ocols, PyObject *__pyx_v_values) { PetscInt __pyx_v_ni; PetscInt __pyx_v_nj; PetscInt __pyx_v_nv; PetscInt *__pyx_v_i; PetscInt *__pyx_v_j; PetscScalar *__pyx_v_v; PyArrayObject *__pyx_v_rows = 0; PyArrayObject *__pyx_v_cols = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matgetvalues", 0); __Pyx_INCREF(__pyx_v_values); /* "PETSc/petscmat.pxi":967 * cdef inline matgetvalues(PetscMat mat, * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 # <<<<<<<<<<<<<< * cdef PetscInt *i=NULL, *j=NULL * cdef PetscScalar *v=NULL */ __pyx_v_ni = 0; __pyx_v_nj = 0; __pyx_v_nv = 0; /* "PETSc/petscmat.pxi":968 * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 * cdef PetscInt *i=NULL, *j=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL * cdef ndarray rows = iarray_i(orows, &ni, &i) */ __pyx_v_i = NULL; __pyx_v_j = NULL; /* "PETSc/petscmat.pxi":969 * cdef PetscInt ni=0, nj=0, nv=0 * cdef PetscInt *i=NULL, *j=NULL * cdef PetscScalar *v=NULL # <<<<<<<<<<<<<< * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) */ __pyx_v_v = NULL; /* "PETSc/petscmat.pxi":970 * cdef PetscInt *i=NULL, *j=NULL * cdef PetscScalar *v=NULL * cdef ndarray rows = iarray_i(orows, &ni, &i) # <<<<<<<<<<<<<< * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_orows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rows = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":971 * cdef PetscScalar *v=NULL * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) # <<<<<<<<<<<<<< * if values is None: * values = empty_s(ni*nj) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ocols, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":972 * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape */ __pyx_t_2 = (__pyx_v_values == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":973 * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: * values = empty_s(ni*nj) # <<<<<<<<<<<<<< * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s((__pyx_v_ni * __pyx_v_nj))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":974 * if values is None: * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape # <<<<<<<<<<<<<< * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rows), __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cols), __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_values, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(6, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":972 * cdef ndarray rows = iarray_i(orows, &ni, &i) * cdef ndarray cols = iarray_i(ocols, &nj, &j) * if values is None: # <<<<<<<<<<<<<< * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape */ } /* "PETSc/petscmat.pxi":975 * values = empty_s(ni*nj) * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) # <<<<<<<<<<<<<< * if (ni*nj != nv): raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_values, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscmat.pxi":976 * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) */ __pyx_t_3 = (((__pyx_v_ni * __pyx_v_nj) != __pyx_v_nv) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscmat.pxi":978 * if (ni*nj != nv): raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) # <<<<<<<<<<<<<< * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) * return values */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":977 * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % # <<<<<<<<<<<<<< * (toInt(ni), toInt(nj), toInt(nv))) * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscmat.pxi":976 * values.shape = rows.shape + cols.shape * values = oarray_s(values, &nv, &v) * if (ni*nj != nv): raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(6, 976, __pyx_L1_error) } /* "PETSc/petscmat.pxi":979 * "incompatible array sizes: ni=%d, nj=%d, nv=%d" % * (toInt(ni), toInt(nj), toInt(nv))) * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) # <<<<<<<<<<<<<< * return values * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetValues(__pyx_v_mat, __pyx_v_ni, __pyx_v_i, __pyx_v_nj, __pyx_v_j, __pyx_v_v)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 979, __pyx_L1_error) /* "PETSc/petscmat.pxi":980 * (toInt(ni), toInt(nj), toInt(nv))) * CHKERR( MatGetValues(mat, ni, i, nj, j, v) ) * return values # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_values); __pyx_r = __pyx_v_values; goto __pyx_L0; /* "PETSc/petscmat.pxi":965 * return 0 * * cdef inline matgetvalues(PetscMat mat, # <<<<<<<<<<<<<< * object orows, object ocols, object values): * cdef PetscInt ni=0, nj=0, nv=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.matgetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rows); __Pyx_XDECREF((PyObject *)__pyx_v_cols); __Pyx_XDECREF(__pyx_v_values); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":987 * int MatFactorInfoDefaults(PetscBool,PetscBool,PetscMatFactorInfo*) * * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(st, str): */ static CYTHON_INLINE MatFactorShiftType __pyx_f_8petsc4py_5PETSc_matfactorshifttype(PyObject *__pyx_v_st) { MatFactorShiftType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; MatFactorShiftType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matfactorshifttype", 0); /* "PETSc/petscmat.pxi":989 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ * except (-1): * if isinstance(st, str): # <<<<<<<<<<<<<< * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO */ __pyx_t_1 = PyString_Check(__pyx_v_st); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":990 * except (-1): * if isinstance(st, str): * if st == "none": return MAT_SHIFT_NONE # <<<<<<<<<<<<<< * if st == "nonzero": return MAT_SHIFT_NONZERO * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 990, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = MAT_SHIFT_NONE; goto __pyx_L0; } /* "PETSc/petscmat.pxi":991 * if isinstance(st, str): * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE * if st == "inblocks": return MAT_SHIFT_INBLOCKS */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_nonzero, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 991, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = MAT_SHIFT_NONZERO; goto __pyx_L0; } /* "PETSc/petscmat.pxi":992 * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * if st == "inblocks": return MAT_SHIFT_INBLOCKS * if st == "na": return MAT_SHIFT_NONZERO */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_positive_definite, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 992, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = MAT_SHIFT_POSITIVE_DEFINITE; goto __pyx_L0; } /* "PETSc/petscmat.pxi":993 * if st == "nonzero": return MAT_SHIFT_NONZERO * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE * if st == "inblocks": return MAT_SHIFT_INBLOCKS # <<<<<<<<<<<<<< * if st == "na": return MAT_SHIFT_NONZERO * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_inblocks, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 993, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = MAT_SHIFT_INBLOCKS; goto __pyx_L0; } /* "PETSc/petscmat.pxi":994 * if st == "positive_definite": return MAT_SHIFT_POSITIVE_DEFINITE * if st == "inblocks": return MAT_SHIFT_INBLOCKS * if st == "na": return MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE * else: raise ValueError("unknown shift type: %s" % st) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_na, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 994, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = MAT_SHIFT_NONZERO; goto __pyx_L0; } /* "PETSc/petscmat.pxi":995 * if st == "inblocks": return MAT_SHIFT_INBLOCKS * if st == "na": return MAT_SHIFT_NONZERO * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * else: raise ValueError("unknown shift type: %s" % st) * return st */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_st, __pyx_n_s_pd, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 995, __pyx_L1_error) if (likely(__pyx_t_2)) { __pyx_r = MAT_SHIFT_POSITIVE_DEFINITE; goto __pyx_L0; } /* "PETSc/petscmat.pxi":996 * if st == "na": return MAT_SHIFT_NONZERO * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE * else: raise ValueError("unknown shift type: %s" % st) # <<<<<<<<<<<<<< * return st * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_shift_type_s, __pyx_v_st); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(6, 996, __pyx_L1_error) } /* "PETSc/petscmat.pxi":989 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ * except (-1): * if isinstance(st, str): # <<<<<<<<<<<<<< * if st == "none": return MAT_SHIFT_NONE * if st == "nonzero": return MAT_SHIFT_NONZERO */ } /* "PETSc/petscmat.pxi":997 * if st == "pd": return MAT_SHIFT_POSITIVE_DEFINITE * else: raise ValueError("unknown shift type: %s" % st) * return st # <<<<<<<<<<<<<< * * cdef int matfactorinfo(PetscBool inc, PetscBool chol, object opts, */ __pyx_t_5 = ((MatFactorShiftType)__Pyx_PyInt_As_MatFactorShiftType(__pyx_v_st)); if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 997, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscmat.pxi":987 * int MatFactorInfoDefaults(PetscBool,PetscBool,PetscMatFactorInfo*) * * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(st, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.matfactorshifttype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((MatFactorShiftType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":999 * return st * * cdef int matfactorinfo(PetscBool inc, PetscBool chol, object opts, # <<<<<<<<<<<<<< * PetscMatFactorInfo *info) except -1: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) */ static int __pyx_f_8petsc4py_5PETSc_matfactorinfo(PetscBool __pyx_v_inc, PetscBool __pyx_v_chol, PyObject *__pyx_v_opts, MatFactorInfo *__pyx_v_info) { PyObject *__pyx_v_options = 0; PyObject *__pyx_v_fill = 0; PyObject *__pyx_v_zeropivot = 0; PyObject *__pyx_v_levels = 0; PyObject *__pyx_v_diagonal_fill = 0; PyObject *__pyx_v_dt = 0; PyObject *__pyx_v_dtcol = 0; PyObject *__pyx_v_dtcount = 0; PyObject *__pyx_v_shifttype = 0; PyObject *__pyx_v_shiftamount = 0; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscReal __pyx_t_5; PetscInt __pyx_t_6; int __pyx_t_7; MatFactorShiftType __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matfactorinfo", 0); /* "PETSc/petscmat.pxi":1001 * cdef int matfactorinfo(PetscBool inc, PetscBool chol, object opts, * PetscMatFactorInfo *info) except -1: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) # <<<<<<<<<<<<<< * if opts is None: return 0 * cdef dict options = dict(opts) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatFactorInfoDefaults(__pyx_v_inc, __pyx_v_chol, __pyx_v_info)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1001, __pyx_L1_error) /* "PETSc/petscmat.pxi":1002 * PetscMatFactorInfo *info) except -1: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) * if opts is None: return 0 # <<<<<<<<<<<<<< * cdef dict options = dict(opts) * # */ __pyx_t_2 = (__pyx_v_opts == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscmat.pxi":1003 * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) * if opts is None: return 0 * cdef dict options = dict(opts) # <<<<<<<<<<<<<< * # * cdef fill = options.pop('fill', None) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_opts); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_options = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1005 * cdef dict options = dict(opts) * # * cdef fill = options.pop('fill', None) # <<<<<<<<<<<<<< * if fill is not None: * info.fill = asReal(fill) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_fill, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1005, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_fill = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1006 * # * cdef fill = options.pop('fill', None) * if fill is not None: # <<<<<<<<<<<<<< * info.fill = asReal(fill) * # */ __pyx_t_3 = (__pyx_v_fill != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":1007 * cdef fill = options.pop('fill', None) * if fill is not None: * info.fill = asReal(fill) # <<<<<<<<<<<<<< * # * cdef zeropivot = options.pop('zeropivot', None) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(6, 1007, __pyx_L1_error) __pyx_v_info->fill = __pyx_t_5; /* "PETSc/petscmat.pxi":1006 * # * cdef fill = options.pop('fill', None) * if fill is not None: # <<<<<<<<<<<<<< * info.fill = asReal(fill) * # */ } /* "PETSc/petscmat.pxi":1009 * info.fill = asReal(fill) * # * cdef zeropivot = options.pop('zeropivot', None) # <<<<<<<<<<<<<< * if zeropivot is not None: * info.zeropivot = asReal(zeropivot) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_zeropivot, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_zeropivot = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1010 * # * cdef zeropivot = options.pop('zeropivot', None) * if zeropivot is not None: # <<<<<<<<<<<<<< * info.zeropivot = asReal(zeropivot) * # */ __pyx_t_2 = (__pyx_v_zeropivot != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":1011 * cdef zeropivot = options.pop('zeropivot', None) * if zeropivot is not None: * info.zeropivot = asReal(zeropivot) # <<<<<<<<<<<<<< * # * cdef levels = options.pop('levels', None) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zeropivot); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(6, 1011, __pyx_L1_error) __pyx_v_info->zeropivot = __pyx_t_5; /* "PETSc/petscmat.pxi":1010 * # * cdef zeropivot = options.pop('zeropivot', None) * if zeropivot is not None: # <<<<<<<<<<<<<< * info.zeropivot = asReal(zeropivot) * # */ } /* "PETSc/petscmat.pxi":1013 * info.zeropivot = asReal(zeropivot) * # * cdef levels = options.pop('levels', None) # <<<<<<<<<<<<<< * if levels is not None: * info.levels = asInt(levels) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_levels, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_levels = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1014 * # * cdef levels = options.pop('levels', None) * if levels is not None: # <<<<<<<<<<<<<< * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) */ __pyx_t_3 = (__pyx_v_levels != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":1015 * cdef levels = options.pop('levels', None) * if levels is not None: * info.levels = asInt(levels) # <<<<<<<<<<<<<< * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_6 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1015, __pyx_L1_error) __pyx_v_info->levels = ((PetscReal)__pyx_t_6); /* "PETSc/petscmat.pxi":1014 * # * cdef levels = options.pop('levels', None) * if levels is not None: # <<<<<<<<<<<<<< * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) */ } /* "PETSc/petscmat.pxi":1016 * if levels is not None: * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) # <<<<<<<<<<<<<< * if diagonal_fill is not None: * info.diagonal_fill = (diagonal_fill) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_diagonal_fill, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_diagonal_fill = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1017 * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: # <<<<<<<<<<<<<< * info.diagonal_fill = (diagonal_fill) * # */ __pyx_t_2 = (__pyx_v_diagonal_fill != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":1018 * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: * info.diagonal_fill = (diagonal_fill) # <<<<<<<<<<<<<< * # * cdef dt = options.pop('dt', None) */ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_diagonal_fill); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 1018, __pyx_L1_error) __pyx_v_info->diagonal_fill = ((PetscReal)__pyx_t_3); /* "PETSc/petscmat.pxi":1017 * info.levels = asInt(levels) * cdef diagonal_fill = options.pop('diagonal_fill', None) * if diagonal_fill is not None: # <<<<<<<<<<<<<< * info.diagonal_fill = (diagonal_fill) * # */ } /* "PETSc/petscmat.pxi":1020 * info.diagonal_fill = (diagonal_fill) * # * cdef dt = options.pop('dt', None) # <<<<<<<<<<<<<< * if dt is not None: * info.dt = asReal(dt) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dt, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_dt = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1021 * # * cdef dt = options.pop('dt', None) * if dt is not None: # <<<<<<<<<<<<<< * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) */ __pyx_t_3 = (__pyx_v_dt != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":1022 * cdef dt = options.pop('dt', None) * if dt is not None: * info.dt = asReal(dt) # <<<<<<<<<<<<<< * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dt); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(6, 1022, __pyx_L1_error) __pyx_v_info->dt = __pyx_t_5; /* "PETSc/petscmat.pxi":1021 * # * cdef dt = options.pop('dt', None) * if dt is not None: # <<<<<<<<<<<<<< * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) */ } /* "PETSc/petscmat.pxi":1023 * if dt is not None: * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) # <<<<<<<<<<<<<< * if dtcol is not None: * info.dtcol = asReal(dtcol) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dtcol, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_dtcol = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1024 * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: # <<<<<<<<<<<<<< * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) */ __pyx_t_2 = (__pyx_v_dtcol != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscmat.pxi":1025 * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: * info.dtcol = asReal(dtcol) # <<<<<<<<<<<<<< * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dtcol); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(6, 1025, __pyx_L1_error) __pyx_v_info->dtcol = __pyx_t_5; /* "PETSc/petscmat.pxi":1024 * info.dt = asReal(dt) * cdef dtcol = options.pop('dtcol', None) * if dtcol is not None: # <<<<<<<<<<<<<< * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) */ } /* "PETSc/petscmat.pxi":1026 * if dtcol is not None: * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) # <<<<<<<<<<<<<< * if dtcount is not None: * info.dtcount = asInt(dtcount) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_dtcount, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1026, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_dtcount = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1027 * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: # <<<<<<<<<<<<<< * info.dtcount = asInt(dtcount) * if ((dt is not None) or */ __pyx_t_3 = (__pyx_v_dtcount != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":1028 * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: * info.dtcount = asInt(dtcount) # <<<<<<<<<<<<<< * if ((dt is not None) or * (dtcol is not None) or */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dtcount); if (unlikely(__pyx_t_6 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1028, __pyx_L1_error) __pyx_v_info->dtcount = ((PetscReal)__pyx_t_6); /* "PETSc/petscmat.pxi":1027 * info.dtcol = asReal(dtcol) * cdef dtcount = options.pop('dtcount', None) * if dtcount is not None: # <<<<<<<<<<<<<< * info.dtcount = asInt(dtcount) * if ((dt is not None) or */ } /* "PETSc/petscmat.pxi":1029 * if dtcount is not None: * info.dtcount = asInt(dtcount) * if ((dt is not None) or # <<<<<<<<<<<<<< * (dtcol is not None) or * (dtcount is not None)): */ __pyx_t_3 = (__pyx_v_dt != Py_None); __pyx_t_7 = (__pyx_t_3 != 0); if (!__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L12_bool_binop_done; } /* "PETSc/petscmat.pxi":1030 * info.dtcount = asInt(dtcount) * if ((dt is not None) or * (dtcol is not None) or # <<<<<<<<<<<<<< * (dtcount is not None)): * info.usedt = PETSC_TRUE */ __pyx_t_7 = (__pyx_v_dtcol != Py_None); __pyx_t_3 = (__pyx_t_7 != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L12_bool_binop_done; } /* "PETSc/petscmat.pxi":1031 * if ((dt is not None) or * (dtcol is not None) or * (dtcount is not None)): # <<<<<<<<<<<<<< * info.usedt = PETSC_TRUE * # */ __pyx_t_3 = (__pyx_v_dtcount != Py_None); __pyx_t_7 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L12_bool_binop_done:; /* "PETSc/petscmat.pxi":1029 * if dtcount is not None: * info.dtcount = asInt(dtcount) * if ((dt is not None) or # <<<<<<<<<<<<<< * (dtcol is not None) or * (dtcount is not None)): */ if (__pyx_t_2) { /* "PETSc/petscmat.pxi":1032 * (dtcol is not None) or * (dtcount is not None)): * info.usedt = PETSC_TRUE # <<<<<<<<<<<<<< * # * cdef shifttype = options.pop('shifttype', None) */ __pyx_v_info->usedt = ((PetscReal)PETSC_TRUE); /* "PETSc/petscmat.pxi":1029 * if dtcount is not None: * info.dtcount = asInt(dtcount) * if ((dt is not None) or # <<<<<<<<<<<<<< * (dtcol is not None) or * (dtcount is not None)): */ } /* "PETSc/petscmat.pxi":1034 * info.usedt = PETSC_TRUE * # * cdef shifttype = options.pop('shifttype', None) # <<<<<<<<<<<<<< * if shifttype is not None: * info.shifttype = matfactorshifttype(shifttype) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_shifttype, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_shifttype = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1035 * # * cdef shifttype = options.pop('shifttype', None) * if shifttype is not None: # <<<<<<<<<<<<<< * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) */ __pyx_t_2 = (__pyx_v_shifttype != Py_None); __pyx_t_7 = (__pyx_t_2 != 0); if (__pyx_t_7) { /* "PETSc/petscmat.pxi":1036 * cdef shifttype = options.pop('shifttype', None) * if shifttype is not None: * info.shifttype = matfactorshifttype(shifttype) # <<<<<<<<<<<<<< * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_matfactorshifttype(__pyx_v_shifttype); if (unlikely(__pyx_t_8 == ((MatFactorShiftType)((MatFactorShiftType)-1L)))) __PYX_ERR(6, 1036, __pyx_L1_error) __pyx_v_info->shifttype = ((PetscReal)__pyx_t_8); /* "PETSc/petscmat.pxi":1035 * # * cdef shifttype = options.pop('shifttype', None) * if shifttype is not None: # <<<<<<<<<<<<<< * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) */ } /* "PETSc/petscmat.pxi":1037 * if shifttype is not None: * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) # <<<<<<<<<<<<<< * if shiftamount is not None: * info.shiftamount = asReal(shiftamount) */ __pyx_t_4 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_n_s_shiftamount, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_shiftamount = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscmat.pxi":1038 * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: # <<<<<<<<<<<<<< * info.shiftamount = asReal(shiftamount) * # */ __pyx_t_7 = (__pyx_v_shiftamount != Py_None); __pyx_t_2 = (__pyx_t_7 != 0); if (__pyx_t_2) { /* "PETSc/petscmat.pxi":1039 * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: * info.shiftamount = asReal(shiftamount) # <<<<<<<<<<<<<< * # * if options: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_shiftamount); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(6, 1039, __pyx_L1_error) __pyx_v_info->shiftamount = __pyx_t_5; /* "PETSc/petscmat.pxi":1038 * info.shifttype = matfactorshifttype(shifttype) * cdef shiftamount = options.pop('shiftamount', None) * if shiftamount is not None: # <<<<<<<<<<<<<< * info.shiftamount = asReal(shiftamount) * # */ } /* "PETSc/petscmat.pxi":1041 * info.shiftamount = asReal(shiftamount) * # * if options: # <<<<<<<<<<<<<< * raise ValueError("unknown options: %s" * % list(options.keys())) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_options); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 1041, __pyx_L1_error) if (unlikely(__pyx_t_2)) { /* "PETSc/petscmat.pxi":1043 * if options: * raise ValueError("unknown options: %s" * % list(options.keys())) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_4 = __Pyx_PyDict_Keys(__pyx_v_options); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unknown_options_s, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscmat.pxi":1042 * # * if options: * raise ValueError("unknown options: %s" # <<<<<<<<<<<<<< * % list(options.keys())) * return 0 */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(6, 1042, __pyx_L1_error) /* "PETSc/petscmat.pxi":1041 * info.shiftamount = asReal(shiftamount) * # * if options: # <<<<<<<<<<<<<< * raise ValueError("unknown options: %s" * % list(options.keys())) */ } /* "PETSc/petscmat.pxi":1044 * raise ValueError("unknown options: %s" * % list(options.keys())) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":999 * return st * * cdef int matfactorinfo(PetscBool inc, PetscBool chol, object opts, # <<<<<<<<<<<<<< * PetscMatFactorInfo *info) except -1: * CHKERR( MatFactorInfoDefaults(inc,chol,info) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.matfactorinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_options); __Pyx_XDECREF(__pyx_v_fill); __Pyx_XDECREF(__pyx_v_zeropivot); __Pyx_XDECREF(__pyx_v_levels); __Pyx_XDECREF(__pyx_v_diagonal_fill); __Pyx_XDECREF(__pyx_v_dt); __Pyx_XDECREF(__pyx_v_dtcol); __Pyx_XDECREF(__pyx_v_dtcount); __Pyx_XDECREF(__pyx_v_shifttype); __Pyx_XDECREF(__pyx_v_shiftamount); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1048 * # ----------------------------------------------------------------------------- * * cdef object mat_getitem(Mat self, object ij): # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ static PyObject *__pyx_f_8petsc4py_5PETSc_mat_getitem(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij) { PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_v_rows = NULL; PyObject *__pyx_v_cols = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_getitem", 0); /* "PETSc/petscmat.pxi":1049 * * cdef object mat_getitem(Mat self, object ij): * cdef PetscInt M=0, N=0 # <<<<<<<<<<<<<< * rows, cols = ij * if isinstance(rows, slice): */ __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/petscmat.pxi":1050 * cdef object mat_getitem(Mat self, object ij): * cdef PetscInt M=0, N=0 * rows, cols = ij # <<<<<<<<<<<<<< * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_ij))) || (PyList_CheckExact(__pyx_v_ij))) { PyObject* sequence = __pyx_v_ij; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 1050, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(6, 1050, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 1050, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_rows = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_cols = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":1051 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ __pyx_t_5 = PySlice_Check(__pyx_v_rows); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "PETSc/petscmat.pxi":1052 * rows, cols = ij * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) # <<<<<<<<<<<<<< * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), NULL)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1052, __pyx_L1_error) /* "PETSc/petscmat.pxi":1053 * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) # <<<<<<<<<<<<<< * rows = arange(start, stop, stride) * if isinstance(cols, slice): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rows, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 1053, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(6, 1053, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 1053, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_start = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_stop = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_stride = __pyx_t_8; __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":1054 * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) # <<<<<<<<<<<<<< * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":1051 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ } /* "PETSc/petscmat.pxi":1055 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ __pyx_t_6 = PySlice_Check(__pyx_v_cols); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "PETSc/petscmat.pxi":1056 * rows = arange(start, stop, stride) * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1056, __pyx_L1_error) /* "PETSc/petscmat.pxi":1057 * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) # <<<<<<<<<<<<<< * cols = arange(start, stop, stride) * return matgetvalues(self.mat, rows, cols, None) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_cols, __pyx_n_s_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 1057, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_1 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(6, 1057, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 1057, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":1058 * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) # <<<<<<<<<<<<<< * return matgetvalues(self.mat, rows, cols, None) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_cols, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":1055 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ } /* "PETSc/petscmat.pxi":1059 * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) * return matgetvalues(self.mat, rows, cols, None) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matgetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1059, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":1048 * # ----------------------------------------------------------------------------- * * cdef object mat_getitem(Mat self, object ij): # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.mat_getitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XDECREF(__pyx_v_cols); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1062 * * * cdef int mat_setitem(Mat self, object ij, object v) except -1: # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ static int __pyx_f_8petsc4py_5PETSc_mat_setitem(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) { PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_v_rows = NULL; PyObject *__pyx_v_cols = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_stride = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mat_setitem", 0); /* "PETSc/petscmat.pxi":1063 * * cdef int mat_setitem(Mat self, object ij, object v) except -1: * cdef PetscInt M=0, N=0 # <<<<<<<<<<<<<< * rows, cols = ij * if isinstance(rows, slice): */ __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/petscmat.pxi":1064 * cdef int mat_setitem(Mat self, object ij, object v) except -1: * cdef PetscInt M=0, N=0 * rows, cols = ij # <<<<<<<<<<<<<< * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_ij))) || (PyList_CheckExact(__pyx_v_ij))) { PyObject* sequence = __pyx_v_ij; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 1064, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(6, 1064, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 1064, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_rows = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_cols = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":1065 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ __pyx_t_5 = PySlice_Check(__pyx_v_rows); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "PETSc/petscmat.pxi":1066 * rows, cols = ij * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) # <<<<<<<<<<<<<< * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), NULL)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1066, __pyx_L1_error) /* "PETSc/petscmat.pxi":1067 * if isinstance(rows, slice): * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) # <<<<<<<<<<<<<< * rows = arange(start, stop, stride) * if isinstance(cols, slice): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rows, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 1067, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(6, 1067, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 1067, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_start = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_stop = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_stride = __pyx_t_8; __pyx_t_8 = 0; /* "PETSc/petscmat.pxi":1068 * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) # <<<<<<<<<<<<<< * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":1065 * cdef PetscInt M=0, N=0 * rows, cols = ij * if isinstance(rows, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, NULL) ) * start, stop, stride = rows.indices(toInt(M)) */ } /* "PETSc/petscmat.pxi":1069 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ __pyx_t_6 = PySlice_Check(__pyx_v_cols); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "PETSc/petscmat.pxi":1070 * rows = arange(start, stop, stride) * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) # <<<<<<<<<<<<<< * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1070, __pyx_L1_error) /* "PETSc/petscmat.pxi":1071 * if isinstance(cols, slice): * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) # <<<<<<<<<<<<<< * cols = arange(start, stop, stride) * matsetvalues(self.mat, rows, cols, v, None, 0, 0) */ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_cols, __pyx_n_s_indices); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_8, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(6, 1071, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_8 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_1 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1071, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < 0) __PYX_ERR(6, 1071, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(6, 1071, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscmat.pxi":1072 * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, v, None, 0, 0) * return 0 */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_v_start, __pyx_v_stop, __pyx_v_stride)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_cols, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscmat.pxi":1069 * start, stop, stride = rows.indices(toInt(M)) * rows = arange(start, stop, stride) * if isinstance(cols, slice): # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * start, stop, stride = cols.indices(toInt(N)) */ } /* "PETSc/petscmat.pxi":1073 * start, stop, stride = cols.indices(toInt(N)) * cols = arange(start, stop, stride) * matsetvalues(self.mat, rows, cols, v, None, 0, 0) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_v, Py_None, 0, 0); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 1073, __pyx_L1_error) /* "PETSc/petscmat.pxi":1074 * cols = arange(start, stop, stride) * matsetvalues(self.mat, rows, cols, v, None, 0, 0) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscmat.pxi":1062 * * * cdef int mat_setitem(Mat self, object ij, object v) except -1: # <<<<<<<<<<<<<< * cdef PetscInt M=0, N=0 * rows, cols = ij */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.mat_setitem", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XDECREF(__pyx_v_cols); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_stride); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1082 * cdef PetscMatStencil stencil * property i: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.i = asInt(value) * property j: */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1i_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1i_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1i___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1i___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/petscmat.pxi":1083 * property i: * def __set__(self, value): * self.stencil.i = asInt(value) # <<<<<<<<<<<<<< * property j: * def __set__(self, value): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1083, __pyx_L1_error) __pyx_v_self->stencil.i = __pyx_t_1; /* "PETSc/petscmat.pxi":1082 * cdef PetscMatStencil stencil * property i: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.i = asInt(value) * property j: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.i.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1085 * self.stencil.i = asInt(value) * property j: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.j = asInt(value) * property k: */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1j_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1j_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1j___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1j___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/petscmat.pxi":1086 * property j: * def __set__(self, value): * self.stencil.j = asInt(value) # <<<<<<<<<<<<<< * property k: * def __set__(self, value): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1086, __pyx_L1_error) __pyx_v_self->stencil.j = __pyx_t_1; /* "PETSc/petscmat.pxi":1085 * self.stencil.i = asInt(value) * property j: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.j = asInt(value) * property k: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.j.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1088 * self.stencil.j = asInt(value) * property k: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.k = asInt(value) * property c: */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1k_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1k_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1k___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1k___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/petscmat.pxi":1089 * property k: * def __set__(self, value): * self.stencil.k = asInt(value) # <<<<<<<<<<<<<< * property c: * def __set__(self, value): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1089, __pyx_L1_error) __pyx_v_self->stencil.k = __pyx_t_1; /* "PETSc/petscmat.pxi":1088 * self.stencil.j = asInt(value) * property k: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.k = asInt(value) * property c: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.k.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1091 * self.stencil.k = asInt(value) * property c: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.c = asInt(value) * property index: */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1c_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1c_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1c___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_1c___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/petscmat.pxi":1092 * property c: * def __set__(self, value): * self.stencil.c = asInt(value) # <<<<<<<<<<<<<< * property index: * def __set__(self, value): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1092, __pyx_L1_error) __pyx_v_self->stencil.c = __pyx_t_1; /* "PETSc/petscmat.pxi":1091 * self.stencil.k = asInt(value) * property c: * def __set__(self, value): # <<<<<<<<<<<<<< * self.stencil.c = asInt(value) * property index: */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.c.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1094 * self.stencil.c = asInt(value) * property index: * def __set__(self, value): # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.k = s.j = s.i = 0 */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5index___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5index___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) { MatStencil *__pyx_v_s; int __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/petscmat.pxi":1095 * property index: * def __set__(self, value): * cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<< * s.k = s.j = s.i = 0 * asDims(value, &s.i, &s.j, &s.k) */ __pyx_v_s = (&__pyx_v_self->stencil); /* "PETSc/petscmat.pxi":1096 * def __set__(self, value): * cdef PetscMatStencil *s = &self.stencil * s.k = s.j = s.i = 0 # <<<<<<<<<<<<<< * asDims(value, &s.i, &s.j, &s.k) * property field: */ __pyx_v_s->k = 0; __pyx_v_s->j = 0; __pyx_v_s->i = 0; /* "PETSc/petscmat.pxi":1097 * cdef PetscMatStencil *s = &self.stencil * s.k = s.j = s.i = 0 * asDims(value, &s.i, &s.j, &s.k) # <<<<<<<<<<<<<< * property field: * def __set__(self, value): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_value, (&__pyx_v_s->i), (&__pyx_v_s->j), (&__pyx_v_s->k)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1097, __pyx_L1_error) /* "PETSc/petscmat.pxi":1094 * self.stencil.c = asInt(value) * property index: * def __set__(self, value): # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.k = s.j = s.i = 0 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1099 * asDims(value, &s.i, &s.j, &s.k) * property field: * def __set__(self, value): # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.c = asInt(value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5field_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5field_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5field___set__(((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_12_Mat_Stencil_5field___set__(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_self, PyObject *__pyx_v_value) { MatStencil *__pyx_v_s; int __pyx_r; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/petscmat.pxi":1100 * property field: * def __set__(self, value): * cdef PetscMatStencil *s = &self.stencil # <<<<<<<<<<<<<< * s.c = asInt(value) * */ __pyx_v_s = (&__pyx_v_self->stencil); /* "PETSc/petscmat.pxi":1101 * def __set__(self, value): * cdef PetscMatStencil *s = &self.stencil * s.c = asInt(value) # <<<<<<<<<<<<<< * * cdef matsetvaluestencil(PetscMat A, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(6, 1101, __pyx_L1_error) __pyx_v_s->c = __pyx_t_1; /* "PETSc/petscmat.pxi":1099 * asDims(value, &s.i, &s.j, &s.k) * property field: * def __set__(self, value): # <<<<<<<<<<<<<< * cdef PetscMatStencil *s = &self.stencil * s.c = asInt(value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._Mat_Stencil.field.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscmat.pxi":1103 * s.c = asInt(value) * * cdef matsetvaluestencil(PetscMat A, # <<<<<<<<<<<<<< * _Mat_Stencil r, _Mat_Stencil c, object value, * PetscInsertMode im, int blocked): */ static PyObject *__pyx_f_8petsc4py_5PETSc_matsetvaluestencil(Mat __pyx_v_A, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_r, struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_c, PyObject *__pyx_v_value, InsertMode __pyx_v_im, int __pyx_v_blocked) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_nv; PetscScalar *__pyx_v_v; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matsetvaluestencil", 0); __Pyx_INCREF(__pyx_v_value); /* "PETSc/petscmat.pxi":1107 * PetscInsertMode im, int blocked): * # block size * cdef PetscInt rbs=1, cbs=1 # <<<<<<<<<<<<<< * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 */ __pyx_v_rbs = 1; __pyx_v_cbs = 1; /* "PETSc/petscmat.pxi":1108 * # block size * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) # <<<<<<<<<<<<<< * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_A, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1108, __pyx_L1_error) } /* "PETSc/petscmat.pxi":1109 * cdef PetscInt rbs=1, cbs=1 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 # <<<<<<<<<<<<<< * if cbs < 1: cbs = 1 * # values */ __pyx_t_1 = ((__pyx_v_rbs < 1) != 0); if (__pyx_t_1) { __pyx_v_rbs = 1; } /* "PETSc/petscmat.pxi":1110 * if blocked: CHKERR( MatGetBlockSizes(A, &rbs, &cbs) ) * if rbs < 1: rbs = 1 * if cbs < 1: cbs = 1 # <<<<<<<<<<<<<< * # values * cdef PetscInt nv = 1 */ __pyx_t_1 = ((__pyx_v_cbs < 1) != 0); if (__pyx_t_1) { __pyx_v_cbs = 1; } /* "PETSc/petscmat.pxi":1112 * if cbs < 1: cbs = 1 * # values * cdef PetscInt nv = 1 # <<<<<<<<<<<<<< * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) */ __pyx_v_nv = 1; /* "PETSc/petscmat.pxi":1113 * # values * cdef PetscInt nv = 1 * cdef PetscScalar *v = NULL # <<<<<<<<<<<<<< * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( */ __pyx_v_v = NULL; /* "PETSc/petscmat.pxi":1114 * cdef PetscInt nv = 1 * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) # <<<<<<<<<<<<<< * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_value, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":1115 * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: */ __pyx_t_1 = (((__pyx_v_rbs * __pyx_v_cbs) != __pyx_v_nv) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/petscmat.pxi":1116 * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) # <<<<<<<<<<<<<< * if blocked: * CHKERR( MatSetValuesBlockedStencil(A, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_incompatible_array_sizes_nv_d, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscmat.pxi":1115 * cdef PetscScalar *v = NULL * value = iarray_s(value, &nv, &v) * if rbs*cbs != nv: raise ValueError( # <<<<<<<<<<<<<< * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(6, 1115, __pyx_L1_error) } /* "PETSc/petscmat.pxi":1117 * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: # <<<<<<<<<<<<<< * CHKERR( MatSetValuesBlockedStencil(A, * 1, &r.stencil, */ __pyx_t_1 = (__pyx_v_blocked != 0); if (__pyx_t_1) { /* "PETSc/petscmat.pxi":1118 * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: * CHKERR( MatSetValuesBlockedStencil(A, # <<<<<<<<<<<<<< * 1, &r.stencil, * 1, &c.stencil, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValuesBlockedStencil(__pyx_v_A, 1, (&__pyx_v_r->stencil), 1, (&__pyx_v_c->stencil), __pyx_v_v, __pyx_v_im)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1118, __pyx_L1_error) /* "PETSc/petscmat.pxi":1117 * if rbs*cbs != nv: raise ValueError( * "incompatible array sizes: nv=%d" % toInt(nv) ) * if blocked: # <<<<<<<<<<<<<< * CHKERR( MatSetValuesBlockedStencil(A, * 1, &r.stencil, */ goto __pyx_L7; } /* "PETSc/petscmat.pxi":1123 * v, im) ) * else: * CHKERR( MatSetValuesStencil(A, # <<<<<<<<<<<<<< * 1, &r.stencil, * 1, &c.stencil, */ /*else*/ { /* "PETSc/petscmat.pxi":1126 * 1, &r.stencil, * 1, &c.stencil, * v, im) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValuesStencil(__pyx_v_A, 1, (&__pyx_v_r->stencil), 1, (&__pyx_v_c->stencil), __pyx_v_v, __pyx_v_im)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 1123, __pyx_L1_error) } __pyx_L7:; /* "PETSc/petscmat.pxi":1127 * 1, &c.stencil, * v, im) ) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; /* "PETSc/petscmat.pxi":1103 * s.c = asInt(value) * * cdef matsetvaluestencil(PetscMat A, # <<<<<<<<<<<<<< * _Mat_Stencil r, _Mat_Stencil c, object value, * PetscInsertMode im, int blocked): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.matsetvaluestencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscpc.pxi":294 * # -------------------------------------------------------------------- * * cdef inline PC ref_PC(PetscPC pc): # <<<<<<<<<<<<<< * cdef PC ob = PC() * ob.pc = pc */ static CYTHON_INLINE struct PyPetscPCObject *__pyx_f_8petsc4py_5PETSc_ref_PC(PC __pyx_v_pc) { struct PyPetscPCObject *__pyx_v_ob = 0; struct PyPetscPCObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_PC", 0); /* "PETSc/petscpc.pxi":295 * * cdef inline PC ref_PC(PetscPC pc): * cdef PC ob = PC() # <<<<<<<<<<<<<< * ob.pc = pc * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscpc.pxi":296 * cdef inline PC ref_PC(PetscPC pc): * cdef PC ob = PC() * ob.pc = pc # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->pc = __pyx_v_pc; /* "PETSc/petscpc.pxi":297 * cdef PC ob = PC() * ob.pc = pc * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscpc.pxi":298 * ob.pc = pc * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * cdef int PCPatch_ComputeOperator( */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscpc.pxi":294 * # -------------------------------------------------------------------- * * cdef inline PC ref_PC(PetscPC pc): # <<<<<<<<<<<<<< * cdef PC ob = PC() * ob.pc = pc */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_PC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscpc.pxi":300 * return ob * * cdef int PCPatch_ComputeOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Mat __pyx_v_mat, IS __pyx_v_cells, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscMatObject *__pyx_v_Mat = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; PyArrayObject *__pyx_v_dofsall = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); struct __pyx_array_obj *__pyx_t_9 = NULL; __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeOperator", 0); /* "PETSc/petscpc.pxi":310 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":311 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":312 * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_operator__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":313 * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_operator__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":314 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_operator__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_operator__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":315 * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_operator__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscpc.pxi":316 * cdef object context = Pc.get_attr("__patch_compute_operator__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(7, 316, __pyx_L1_error) } } #endif /* "PETSc/petscpc.pxi":317 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 317, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(7, 317, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 317, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscpc.pxi":318 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 318, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 318, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofs = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":320 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ __pyx_t_2 = ((__pyx_v_dofmapWithAll != NULL) != 0); if (__pyx_t_2) { /* "PETSc/petscpc.pxi":321 * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * dofsall = asarray(pydofsWithAll) * else: */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 321, __pyx_L1_error) } __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 321, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofsWithAll = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":322 * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) # <<<<<<<<<<<<<< * else: * dofsall = None */ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_dofsall = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscpc.pxi":320 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ goto __pyx_L10; } /* "PETSc/petscpc.pxi":324 * dofsall = asarray(pydofsWithAll) * else: * dofsall = None # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return 0 */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dofsall = ((PyArrayObject *)Py_None); } __pyx_L10:; /* "PETSc/petscpc.pxi":325 * else: * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pc)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Vec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Vec)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Vec)); __Pyx_INCREF(((PyObject *)__pyx_v_Mat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Mat)); PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_Mat)); __Pyx_INCREF(((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Is)); PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_dofsall)); __Pyx_GIVEREF(((PyObject *)__pyx_v_dofsall)); PyTuple_SET_ITEM(__pyx_t_6, 6, ((PyObject *)__pyx_v_dofsall)); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(7, 325, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscpc.pxi":326 * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int PCPatch_ComputeFunction( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscpc.pxi":300 * return ob * * cdef int PCPatch_ComputeOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(((PyObject *)__pyx_t_9)); __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Mat); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_XDECREF((PyObject *)__pyx_v_dofsall); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscpc.pxi":328 * return 0 * * cdef int PCPatch_ComputeFunction( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Vec __pyx_v_out, IS __pyx_v_cells, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Out = 0; struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); struct __pyx_array_obj *__pyx_t_9 = NULL; __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeFunction", 0); /* "PETSc/petscpc.pxi":338 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) # <<<<<<<<<<<<<< * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":339 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":340 * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_function__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":341 * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_function__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":342 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_function__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":343 * cdef IS Is = ref_IS(cells) * cdef object context = Pc.get_attr("__patch_compute_function__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscpc.pxi":344 * cdef object context = Pc.get_attr("__patch_compute_function__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(7, 344, __pyx_L1_error) } } #endif /* "PETSc/petscpc.pxi":345 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 345, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(7, 345, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 345, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscpc.pxi":346 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 346, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 346, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofs = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":347 * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return 0 */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 347, __pyx_L1_error) } __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 347, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofsWithAll = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":348 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pc)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Vec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Vec)); PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Vec)); __Pyx_INCREF(((PyObject *)__pyx_v_Out)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Out)); PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Out)); __Pyx_INCREF(((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Is)); PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(7, 348, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_7 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_7 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscpc.pxi":349 * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int PCPatch_ComputeOperatorInteriorFacets( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscpc.pxi":328 * return 0 * * cdef int PCPatch_ComputeFunction( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(((PyObject *)__pyx_t_9)); __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Out); __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscpc.pxi":351 * return 0 * * cdef int PCPatch_ComputeOperatorInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Mat __pyx_v_mat, IS __pyx_v_facets, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscMatObject *__pyx_v_Mat = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; PyArrayObject *__pyx_v_dofsall = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); struct __pyx_array_obj *__pyx_t_9 = NULL; __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeOperatorInteriorFacets", 0); /* "PETSc/petscpc.pxi":361 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":362 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":363 * cdef Vec Vec = ref_Vec(vec) * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":364 * cdef Mat Mat = ref_Mat(mat) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":365 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_operator_interior_facets__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":366 * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscpc.pxi":367 * cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(7, 367, __pyx_L1_error) } } #endif /* "PETSc/petscpc.pxi":368 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 368, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(7, 368, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 368, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscpc.pxi":369 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 369, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 369, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofs = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":371 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ __pyx_t_2 = ((__pyx_v_dofmapWithAll != NULL) != 0); if (__pyx_t_2) { /* "PETSc/petscpc.pxi":372 * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * dofsall = asarray(pydofsWithAll) * else: */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 372, __pyx_L1_error) } __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 372, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofsWithAll = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":373 * if dofmapWithAll != NULL: * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) # <<<<<<<<<<<<<< * else: * dofsall = None */ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_dofsall = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscpc.pxi":371 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll * if dofmapWithAll != NULL: # <<<<<<<<<<<<<< * pydofsWithAll = dofmapWithAll * dofsall = asarray(pydofsWithAll) */ goto __pyx_L10; } /* "PETSc/petscpc.pxi":375 * dofsall = asarray(pydofsWithAll) * else: * dofsall = None # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return 0 */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_dofsall = ((PyArrayObject *)Py_None); } __pyx_L10:; /* "PETSc/petscpc.pxi":376 * else: * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pc)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Vec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Vec)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Vec)); __Pyx_INCREF(((PyObject *)__pyx_v_Mat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Mat)); PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_Mat)); __Pyx_INCREF(((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Is)); PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_dofsall)); __Pyx_GIVEREF(((PyObject *)__pyx_v_dofsall)); PyTuple_SET_ITEM(__pyx_t_6, 6, ((PyObject *)__pyx_v_dofsall)); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(7, 376, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscpc.pxi":377 * dofsall = None * op(Pc, toInt(point), Vec, Mat, Is, asarray(pydofs), dofsall, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int PCPatch_ComputeFunctionInteriorFacets( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscpc.pxi":351 * return 0 * * cdef int PCPatch_ComputeOperatorInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(((PyObject *)__pyx_t_9)); __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeOperatorInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Mat); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_XDECREF((PyObject *)__pyx_v_dofsall); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscpc.pxi":379 * return 0 * * cdef int PCPatch_ComputeFunctionInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ static int __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets(PC __pyx_v_pc, PetscInt __pyx_v_point, Vec __pyx_v_vec, Vec __pyx_v_out, IS __pyx_v_facets, CYTHON_UNUSED PetscInt __pyx_v_ndof, PetscInt const *__pyx_v_dofmap, PetscInt const *__pyx_v_dofmapWithAll, void *__pyx_v_ctx) { struct PyPetscVecObject *__pyx_v_Out = 0; struct PyPetscVecObject *__pyx_v_Vec = 0; struct PyPetscPCObject *__pyx_v_Pc = 0; struct PyPetscISObject *__pyx_v_Is = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; __Pyx_memviewslice __pyx_v_pydofs = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_v_pydofsWithAll = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); struct __pyx_array_obj *__pyx_t_9 = NULL; __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_ComputeFunctionInteriorFacets", 0); /* "PETSc/petscpc.pxi":389 * const PetscInt *dofmapWithAll, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) # <<<<<<<<<<<<<< * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_out)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":390 * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) # <<<<<<<<<<<<<< * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":391 * cdef Vec Out = ref_Vec(out) * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":392 * cdef Vec Vec = ref_Vec(vec) * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) # <<<<<<<<<<<<<< * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":393 * cdef PC Pc = ref_PC(pc) * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_compute_function_interior_facets__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":394 * cdef IS Is = ref_IS(facets) * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscpc.pxi":395 * cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(7, 395, __pyx_L1_error) } } #endif /* "PETSc/petscpc.pxi":396 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 396, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(7, 396, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 396, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscpc.pxi":397 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap # <<<<<<<<<<<<<< * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) */ if (!__pyx_v_dofmap) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 397, __pyx_L1_error) } __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_array_new(__pyx_t_6, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_5), (char *) "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 397, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofs = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":398 * (op, args, kargs) = context * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll # <<<<<<<<<<<<<< * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return 0 */ if (!__pyx_v_dofmapWithAll) { PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer"); __PYX_ERR(7, 398, __pyx_L1_error) } __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_9), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(7, 398, __pyx_L1_error) __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __pyx_v_pydofsWithAll = __pyx_t_10; __pyx_t_10.memview = NULL; __pyx_t_10.data = NULL; /* "PETSc/petscpc.pxi":399 * cdef PetscInt[:] pydofs = dofmap * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_point); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofs, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_pydofsWithAll, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_PetscInt, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_PetscInt, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pc)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Vec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Vec)); PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Vec)); __Pyx_INCREF(((PyObject *)__pyx_v_Out)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Out)); PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Out)); __Pyx_INCREF(((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Is)); PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Is)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(7, 399, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_7 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } else { __pyx_t_7 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscpc.pxi":400 * cdef PetscInt[:] pydofsWithAll = dofmapWithAll * op(Pc, toInt(point), Vec, Out, Is, asarray(pydofs), asarray(pydofsWithAll), *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int PCPatch_UserConstructOperator( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscpc.pxi":379 * return 0 * * cdef int PCPatch_ComputeFunctionInteriorFacets( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt point, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(((PyObject *)__pyx_t_9)); __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_ComputeFunctionInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Out); __Pyx_XDECREF((PyObject *)__pyx_v_Vec); __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF((PyObject *)__pyx_v_Is); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofs, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_pydofsWithAll, 1); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscpc.pxi":402 * return 0 * * cdef int PCPatch_UserConstructOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt *n, */ static int __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator(PC __pyx_v_pc, PetscInt *__pyx_v_n, IS **__pyx_v_userIS, IS *__pyx_v_userIterationSet, void *__pyx_v_ctx) { struct PyPetscPCObject *__pyx_v_Pc = 0; PetscInt __pyx_v_i; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_op = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_patches = NULL; PyObject *__pyx_v_iterationSet = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Py_ssize_t __pyx_t_9; int __pyx_t_10; PetscInt __pyx_t_11; PetscInt __pyx_t_12; PetscInt __pyx_t_13; IS __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("PCPatch_UserConstructOperator", 0); /* "PETSc/petscpc.pxi":408 * PetscIS *userIterationSet, * void *ctx) except PETSC_ERR_PYTHON with gil: * cdef PC Pc = ref_PC(pc) # <<<<<<<<<<<<<< * cdef PetscInt i * cdef object context = Pc.get_attr("__patch_construction_operator__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_PC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":410 * cdef PC Pc = ref_PC(pc) * cdef PetscInt i * cdef object context = Pc.get_attr("__patch_construction_operator__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_Pc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Pc), ((char *)"__patch_construction_operator__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":411 * cdef PetscInt i * cdef object context = Pc.get_attr("__patch_construction_operator__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (op, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscpc.pxi":412 * cdef object context = Pc.get_attr("__patch_construction_operator__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (op, args, kargs) = context * (patches, iterationSet) = op(Pc, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(7, 412, __pyx_L1_error) } } #endif /* "PETSc/petscpc.pxi":413 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple * (op, args, kargs) = context # <<<<<<<<<<<<<< * (patches, iterationSet) = op(Pc, *args, **kargs) * n[0] = len(patches) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 413, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(7, 413, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 413, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_op = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscpc.pxi":414 * assert context is not None and type(context) is tuple * (op, args, kargs) = context * (patches, iterationSet) = op(Pc, *args, **kargs) # <<<<<<<<<<<<<< * n[0] = len(patches) * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Pc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pc)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Pc)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(7, 414, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_op, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(7, 414, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(7, 414, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(7, 414, __pyx_L1_error) __pyx_L11_unpacking_done:; } __pyx_v_patches = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_iterationSet = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscpc.pxi":415 * (op, args, kargs) = context * (patches, iterationSet) = op(Pc, *args, **kargs) * n[0] = len(patches) # <<<<<<<<<<<<<< * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) * for i in range(n[0]): */ __pyx_t_9 = PyObject_Length(__pyx_v_patches); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(7, 415, __pyx_L1_error) (__pyx_v_n[0]) = __pyx_t_9; /* "PETSc/petscpc.pxi":416 * (patches, iterationSet) = op(Pc, *args, **kargs) * n[0] = len(patches) * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) # <<<<<<<<<<<<<< * for i in range(n[0]): * userIS[0][i] = (patches[i]).iset */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_n[0])) * (sizeof(IS))), __pyx_v_userIS)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 416, __pyx_L1_error) /* "PETSc/petscpc.pxi":417 * n[0] = len(patches) * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) * for i in range(n[0]): # <<<<<<<<<<<<<< * userIS[0][i] = (patches[i]).iset * PetscINCREF(&(userIS[0][i])) */ __pyx_t_11 = (__pyx_v_n[0]); __pyx_t_12 = __pyx_t_11; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "PETSc/petscpc.pxi":418 * CHKERR(PetscMalloc(n[0]*sizeof(PetscIS), userIS)) * for i in range(n[0]): * userIS[0][i] = (patches[i]).iset # <<<<<<<<<<<<<< * PetscINCREF(&(userIS[0][i])) * userIterationSet[0] = (iterationSet).iset */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_patches, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(7, 418, __pyx_L1_error) __pyx_t_14 = ((struct PyPetscISObject *)__pyx_t_6)->iset; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; ((__pyx_v_userIS[0])[__pyx_v_i]) = __pyx_t_14; /* "PETSc/petscpc.pxi":419 * for i in range(n[0]): * userIS[0][i] = (patches[i]).iset * PetscINCREF(&(userIS[0][i])) # <<<<<<<<<<<<<< * userIterationSet[0] = (iterationSet).iset * PetscINCREF(&(userIterationSet[0])) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&((__pyx_v_userIS[0])[__pyx_v_i]))))); } /* "PETSc/petscpc.pxi":420 * userIS[0][i] = (patches[i]).iset * PetscINCREF(&(userIS[0][i])) * userIterationSet[0] = (iterationSet).iset # <<<<<<<<<<<<<< * PetscINCREF(&(userIterationSet[0])) * return 0 */ if (!(likely(__Pyx_TypeTest(__pyx_v_iterationSet, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(7, 420, __pyx_L1_error) __pyx_t_14 = ((struct PyPetscISObject *)__pyx_v_iterationSet)->iset; (__pyx_v_userIterationSet[0]) = __pyx_t_14; /* "PETSc/petscpc.pxi":421 * PetscINCREF(&(userIS[0][i])) * userIterationSet[0] = (iterationSet).iset * PetscINCREF(&(userIterationSet[0])) # <<<<<<<<<<<<<< * return 0 */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&(__pyx_v_userIterationSet[0]))))); /* "PETSc/petscpc.pxi":422 * userIterationSet[0] = (iterationSet).iset * PetscINCREF(&(userIterationSet[0])) * return 0 # <<<<<<<<<<<<<< */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscpc.pxi":402 * return 0 * * cdef int PCPatch_UserConstructOperator( # <<<<<<<<<<<<<< * PetscPC pc, * PetscInt *n, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.PCPatch_UserConstructOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Pc); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_op); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_patches); __Pyx_XDECREF(__pyx_v_iterationSet); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscksp.pxi":203 * # ----------------------------------------------------------------------------- * * cdef inline KSP ref_KSP(PetscKSP ksp): # <<<<<<<<<<<<<< * cdef KSP ob = KSP() * ob.ksp = ksp */ static CYTHON_INLINE struct PyPetscKSPObject *__pyx_f_8petsc4py_5PETSc_ref_KSP(KSP __pyx_v_ksp) { struct PyPetscKSPObject *__pyx_v_ob = 0; struct PyPetscKSPObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_KSP", 0); /* "PETSc/petscksp.pxi":204 * * cdef inline KSP ref_KSP(PetscKSP ksp): * cdef KSP ob = KSP() # <<<<<<<<<<<<<< * ob.ksp = ksp * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscksp.pxi":205 * cdef inline KSP ref_KSP(PetscKSP ksp): * cdef KSP ob = KSP() * ob.ksp = ksp # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->ksp = __pyx_v_ksp; /* "PETSc/petscksp.pxi":206 * cdef KSP ob = KSP() * ob.ksp = ksp * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscksp.pxi":207 * ob.ksp = ksp * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscksp.pxi":203 * # ----------------------------------------------------------------------------- * * cdef inline KSP ref_KSP(PetscKSP ksp): # <<<<<<<<<<<<<< * cdef KSP ob = KSP() * ob.ksp = ksp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_KSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscksp.pxi":211 * # ----------------------------------------------------------------------------- * * cdef int KSP_Converged( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ static int __pyx_f_8petsc4py_5PETSc_KSP_Converged(KSP __pyx_v_ksp, PetscInt __pyx_v_its, PetscReal __pyx_v_rnm, KSPConvergedReason *__pyx_v_r, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; PyObject *__pyx_v_converged = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_reason = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; KSPConvergedReason __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_Converged", 0); /* "PETSc/petscksp.pxi":218 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * (converged, args, kargs) = Ksp.get_attr('__converged__') * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":219 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * (converged, args, kargs) = Ksp.get_attr('__converged__') # <<<<<<<<<<<<<< * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) * if reason is None: r[0] = KSP_CONVERGED_ITERATING */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(18, 219, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(18, 219, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(18, 219, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_converged = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscksp.pxi":220 * cdef KSP Ksp = ref_KSP(ksp) * (converged, args, kargs) = Ksp.get_attr('__converged__') * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) # <<<<<<<<<<<<<< * if reason is None: r[0] = KSP_CONVERGED_ITERATING * elif reason is False: r[0] = KSP_CONVERGED_ITERATING */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnm); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_Ksp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Ksp)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(18, 220, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_reason = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscksp.pxi":221 * (converged, args, kargs) = Ksp.get_attr('__converged__') * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) * if reason is None: r[0] = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is False: r[0] = KSP_CONVERGED_ITERATING * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? */ __pyx_t_7 = (__pyx_v_reason == Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { (__pyx_v_r[0]) = KSP_CONVERGED_ITERATING; goto __pyx_L5; } /* "PETSc/petscksp.pxi":222 * reason = converged(Ksp, toInt(its), toReal(rnm), *args, **kargs) * if reason is None: r[0] = KSP_CONVERGED_ITERATING * elif reason is False: r[0] = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? * else: r[0] = reason */ __pyx_t_8 = (__pyx_v_reason == Py_False); __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { (__pyx_v_r[0]) = KSP_CONVERGED_ITERATING; goto __pyx_L5; } /* "PETSc/petscksp.pxi":223 * if reason is None: r[0] = KSP_CONVERGED_ITERATING * elif reason is False: r[0] = KSP_CONVERGED_ITERATING * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? # <<<<<<<<<<<<<< * else: r[0] = reason * return 0 */ __pyx_t_7 = (__pyx_v_reason == Py_True); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { (__pyx_v_r[0]) = KSP_CONVERGED_ITS; goto __pyx_L5; } /* "PETSc/petscksp.pxi":224 * elif reason is False: r[0] = KSP_CONVERGED_ITERATING * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? * else: r[0] = reason # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __pyx_t_9 = ((KSPConvergedReason)__Pyx_PyInt_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(18, 224, __pyx_L1_error) (__pyx_v_r[0]) = __pyx_t_9; } __pyx_L5:; /* "PETSc/petscksp.pxi":225 * elif reason is True: r[0] = KSP_CONVERGED_ITS # XXX ? * else: r[0] = reason * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscksp.pxi":211 * # ----------------------------------------------------------------------------- * * cdef int KSP_Converged( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSP_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF(__pyx_v_converged); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_reason); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscksp.pxi":229 * # ----------------------------------------------------------------------------- * * cdef int KSP_Monitor( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ static int __pyx_f_8petsc4py_5PETSc_KSP_Monitor(KSP __pyx_v_ksp, PetscInt __pyx_v_its, PetscReal __pyx_v_rnm, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_Monitor", 0); /* "PETSc/petscksp.pxi":235 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":236 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * cdef object monitorlist = Ksp.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":237 * cdef KSP Ksp = ref_KSP(ksp) * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return 0 # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscksp.pxi":238 * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) * return 0 */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 238, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(18, 238, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(18, 238, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(18, 238, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(18, 238, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(18, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(18, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(18, 238, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(18, 238, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscksp.pxi":239 * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnm); if (unlikely(!__pyx_t_9)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_Ksp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Ksp)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9); __pyx_t_6 = 0; __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(18, 239, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(18, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscksp.pxi":238 * cdef object monitorlist = Ksp.get_attr('__monitor__') * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) * return 0 */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":240 * for (monitor, args, kargs) in monitorlist: * monitor(Ksp, toInt(its), toReal(rnm), *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscksp.pxi":229 * # ----------------------------------------------------------------------------- * * cdef int KSP_Monitor( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscInt its, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.KSP_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscksp.pxi":244 * # ----------------------------------------------------------------------------- * * cdef int KSP_ComputeRHS( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec rhs, */ static int __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS(KSP __pyx_v_ksp, Vec __pyx_v_rhs, void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; struct PyPetscVecObject *__pyx_v_Rhs = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_computerhs = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_ComputeRHS", 0); /* "PETSc/petscksp.pxi":249 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * cdef Vec Rhs = ref_Vec(rhs) * cdef object context = Ksp.get_attr('__rhs__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":250 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * cdef Vec Rhs = ref_Vec(rhs) # <<<<<<<<<<<<<< * cdef object context = Ksp.get_attr('__rhs__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Rhs = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":251 * cdef KSP Ksp = ref_KSP(ksp) * cdef Vec Rhs = ref_Vec(rhs) * cdef object context = Ksp.get_attr('__rhs__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__rhs__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":252 * cdef Vec Rhs = ref_Vec(rhs) * cdef object context = Ksp.get_attr('__rhs__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (computerhs, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscksp.pxi":253 * cdef object context = Ksp.get_attr('__rhs__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (computerhs, args, kargs) = context * computerhs(Ksp, Rhs, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(18, 253, __pyx_L1_error) } } #endif /* "PETSc/petscksp.pxi":254 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (computerhs, args, kargs) = context # <<<<<<<<<<<<<< * computerhs(Ksp, Rhs, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(18, 254, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(18, 254, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(18, 254, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_computerhs = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscksp.pxi":255 * assert context is not None and type(context) is tuple # sanity check * (computerhs, args, kargs) = context * computerhs(Ksp, Rhs, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Ksp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Ksp)); __Pyx_INCREF(((PyObject *)__pyx_v_Rhs)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Rhs)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Rhs)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(18, 255, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_computerhs, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscksp.pxi":256 * (computerhs, args, kargs) = context * computerhs(Ksp, Rhs, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int KSP_ComputeOps( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscksp.pxi":244 * # ----------------------------------------------------------------------------- * * cdef int KSP_ComputeRHS( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscVec rhs, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.KSP_ComputeRHS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF((PyObject *)__pyx_v_Rhs); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_computerhs); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscksp.pxi":258 * return 0 * * cdef int KSP_ComputeOps( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscMat A, */ static int __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps(KSP __pyx_v_ksp, Mat __pyx_v_A, Mat __pyx_v_B, void *__pyx_v_ctx) { struct PyPetscKSPObject *__pyx_v_Ksp = 0; struct PyPetscMatObject *__pyx_v_Amat = 0; struct PyPetscMatObject *__pyx_v_Bmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_computeops = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("KSP_ComputeOps", 0); /* "PETSc/petscksp.pxi":264 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) # <<<<<<<<<<<<<< * cdef Mat Amat = ref_Mat(A) * cdef Mat Bmat = ref_Mat(B) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":265 * ) except PETSC_ERR_PYTHON with gil: * cdef KSP Ksp = ref_KSP(ksp) * cdef Mat Amat = ref_Mat(A) # <<<<<<<<<<<<<< * cdef Mat Bmat = ref_Mat(B) * cdef object context = Ksp.get_attr('__operators__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_A)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Amat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":266 * cdef KSP Ksp = ref_KSP(ksp) * cdef Mat Amat = ref_Mat(A) * cdef Mat Bmat = ref_Mat(B) # <<<<<<<<<<<<<< * cdef object context = Ksp.get_attr('__operators__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_B)); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Bmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":267 * cdef Mat Amat = ref_Mat(A) * cdef Mat Bmat = ref_Mat(B) * cdef object context = Ksp.get_attr('__operators__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_Ksp->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ksp), ((char *)"__operators__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscksp.pxi":268 * cdef Mat Bmat = ref_Mat(B) * cdef object context = Ksp.get_attr('__operators__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (computeops, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscksp.pxi":269 * cdef object context = Ksp.get_attr('__operators__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (computeops, args, kargs) = context * computeops(Ksp, Amat, Bmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(18, 269, __pyx_L1_error) } } #endif /* "PETSc/petscksp.pxi":270 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (computeops, args, kargs) = context # <<<<<<<<<<<<<< * computeops(Ksp, Amat, Bmat, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(18, 270, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(18, 270, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(18, 270, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_computeops = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscksp.pxi":271 * assert context is not None and type(context) is tuple # sanity check * (computeops, args, kargs) = context * computeops(Ksp, Amat, Bmat, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Ksp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ksp)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Ksp)); __Pyx_INCREF(((PyObject *)__pyx_v_Amat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Amat)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Amat)); __Pyx_INCREF(((PyObject *)__pyx_v_Bmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Bmat)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Bmat)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(18, 271, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_computeops, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(18, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscksp.pxi":272 * (computeops, args, kargs) = context * computeops(Ksp, Amat, Bmat, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscksp.pxi":258 * return 0 * * cdef int KSP_ComputeOps( # <<<<<<<<<<<<<< * PetscKSP ksp, * PetscMat A, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.KSP_ComputeOps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ksp); __Pyx_XDECREF((PyObject *)__pyx_v_Amat); __Pyx_XDECREF((PyObject *)__pyx_v_Bmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_computeops); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":257 * # ----------------------------------------------------------------------------- * * cdef inline SNES ref_SNES(PetscSNES snes): # <<<<<<<<<<<<<< * cdef SNES ob = SNES() * ob.snes = snes */ static CYTHON_INLINE struct PyPetscSNESObject *__pyx_f_8petsc4py_5PETSc_ref_SNES(SNES __pyx_v_snes) { struct PyPetscSNESObject *__pyx_v_ob = 0; struct PyPetscSNESObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_SNES", 0); /* "PETSc/petscsnes.pxi":258 * * cdef inline SNES ref_SNES(PetscSNES snes): * cdef SNES ob = SNES() # <<<<<<<<<<<<<< * ob.snes = snes * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscsnes.pxi":259 * cdef inline SNES ref_SNES(PetscSNES snes): * cdef SNES ob = SNES() * ob.snes = snes # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->snes = __pyx_v_snes; /* "PETSc/petscsnes.pxi":260 * cdef SNES ob = SNES() * ob.snes = snes * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscsnes.pxi":261 * ob.snes = snes * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscsnes.pxi":257 * # ----------------------------------------------------------------------------- * * cdef inline SNES ref_SNES(PetscSNES snes): # <<<<<<<<<<<<<< * cdef SNES ob = SNES() * ob.snes = snes */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_SNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscsnes.pxi":265 * # ----------------------------------------------------------------------------- * * cdef int SNES_InitialGuess( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static int __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess(SNES __pyx_v_snes, Vec __pyx_v_x, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_initialguess = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_InitialGuess", 0); /* "PETSc/petscsnes.pxi":270 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__initialguess__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":271 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__initialguess__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":272 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__initialguess__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__initialguess__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":273 * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__initialguess__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (initialguess, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscsnes.pxi":274 * cdef object context = Snes.get_attr('__initialguess__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (initialguess, args, kargs) = context * initialguess(Snes, Xvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 274, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":275 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (initialguess, args, kargs) = context # <<<<<<<<<<<<<< * initialguess(Snes, Xvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 275, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(19, 275, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 275, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_initialguess = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":276 * assert context is not None and type(context) is tuple # sanity check * (initialguess, args, kargs) = context * initialguess(Snes, Xvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 276, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_initialguess, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":277 * (initialguess, args, kargs) = context * initialguess(Snes, Xvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":265 * # ----------------------------------------------------------------------------- * * cdef int SNES_InitialGuess( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_InitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_initialguess); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":281 * # ----------------------------------------------------------------------------- * * cdef int SNES_PreCheck( # <<<<<<<<<<<<<< * PetscSNESLineSearch linesearch, * PetscVec x, */ static int __pyx_f_8petsc4py_5PETSc_SNES_PreCheck(SNESLineSearch __pyx_v_linesearch, Vec __pyx_v_x, Vec __pyx_v_y, PetscBool *__pyx_v_changed, void *__pyx_v_ctx) { SNES __pyx_v_snes; PyObject *__pyx_v_b = 0; struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Yvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_precheck = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); PetscBool __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_PreCheck", 0); /* "PETSc/petscsnes.pxi":288 * void* ctx * ) except PETSC_ERR_PYTHON with gil: * cdef PetscSNES snes = NULL; # <<<<<<<<<<<<<< * CHKERR(SNESLineSearchGetSNES(linesearch, &snes)); * cdef object b = False */ __pyx_v_snes = NULL; /* "PETSc/petscsnes.pxi":289 * ) except PETSC_ERR_PYTHON with gil: * cdef PetscSNES snes = NULL; * CHKERR(SNESLineSearchGetSNES(linesearch, &snes)); # <<<<<<<<<<<<<< * cdef object b = False * cdef SNES Snes = ref_SNES(snes) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetSNES(__pyx_v_linesearch, (&__pyx_v_snes))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(19, 289, __pyx_L1_error) /* "PETSc/petscsnes.pxi":290 * cdef PetscSNES snes = NULL; * CHKERR(SNESLineSearchGetSNES(linesearch, &snes)); * cdef object b = False # <<<<<<<<<<<<<< * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) */ __Pyx_INCREF(Py_False); __pyx_v_b = Py_False; /* "PETSc/petscsnes.pxi":291 * CHKERR(SNESLineSearchGetSNES(linesearch, &snes)); * cdef object b = False * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Yvec = ref_Vec(y) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscsnes.pxi":292 * cdef object b = False * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Yvec = ref_Vec(y) * cdef object context = Snes.get_attr('__precheck__') */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscsnes.pxi":293 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Yvec = ref_Vec(y) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__precheck__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_y)); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Yvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscsnes.pxi":294 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Yvec = ref_Vec(y) * cdef object context = Snes.get_attr('__precheck__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__precheck__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscsnes.pxi":295 * cdef Vec Yvec = ref_Vec(y) * cdef object context = Snes.get_attr('__precheck__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (precheck, args, kargs) = context */ __pyx_t_4 = (__pyx_v_context == Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { __pyx_t_2 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/petscsnes.pxi":296 * cdef object context = Snes.get_attr('__precheck__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (precheck, args, kargs) = context * b = precheck(Xvec, Yvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = (__pyx_v_context != Py_None); __pyx_t_4 = (__pyx_t_5 != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L6_bool_binop_done; } __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_5 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 296, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":297 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (precheck, args, kargs) = context # <<<<<<<<<<<<<< * b = precheck(Xvec, Yvec, *args, **kargs) * changed[0] = asBool(b) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 297, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(19, 297, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 297, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_precheck = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_kargs = __pyx_t_7; __pyx_t_7 = 0; /* "PETSc/petscsnes.pxi":298 * assert context is not None and type(context) is tuple # sanity check * (precheck, args, kargs) = context * b = precheck(Xvec, Yvec, *args, **kargs) # <<<<<<<<<<<<<< * changed[0] = asBool(b) * return 0 */ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Yvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Yvec)); PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_Yvec)); __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 298, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_precheck, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscsnes.pxi":299 * (precheck, args, kargs) = context * b = precheck(Xvec, Yvec, *args, **kargs) * changed[0] = asBool(b) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_b); if (unlikely(__pyx_t_10 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(19, 299, __pyx_L1_error) (__pyx_v_changed[0]) = __pyx_t_10; /* "PETSc/petscsnes.pxi":300 * b = precheck(Xvec, Yvec, *args, **kargs) * changed[0] = asBool(b) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":281 * # ----------------------------------------------------------------------------- * * cdef int SNES_PreCheck( # <<<<<<<<<<<<<< * PetscSNESLineSearch linesearch, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.SNES_PreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Yvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_precheck); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":305 * * * cdef int SNES_Function( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static int __pyx_f_8petsc4py_5PETSc_SNES_Function(SNES __pyx_v_snes, Vec __pyx_v_x, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Function", 0); /* "PETSc/petscsnes.pxi":311 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":312 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Snes.get_attr('__function__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":313 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__function__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":314 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Snes.get_attr('__function__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":315 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Snes.get_attr('__function__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscsnes.pxi":316 * cdef object context = Snes.get_attr('__function__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Snes, Xvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 316, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":317 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Snes, Xvec, Fvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 317, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(19, 317, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 317, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":318 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Snes, Xvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Fvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Fvec)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 318, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":319 * (function, args, kargs) = context * function(Snes, Xvec, Fvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":305 * * * cdef int SNES_Function( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":323 * # ----------------------------------------------------------------------------- * * cdef int SNES_Update( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt its, */ static int __pyx_f_8petsc4py_5PETSc_SNES_Update(SNES __pyx_v_snes, PetscInt __pyx_v_its) { struct PyPetscSNESObject *__pyx_v_Snes = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_update = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Update", 0); /* "PETSc/petscsnes.pxi":327 * PetscInt its, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__update__') * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":328 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef object context = Snes.get_attr('__update__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (update, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":329 * cdef SNES Snes = ref_SNES(snes) * cdef object context = Snes.get_attr('__update__') * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (update, args, kargs) = context * update(Snes, toInt(its), *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = (__pyx_v_context != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 329, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":330 * cdef object context = Snes.get_attr('__update__') * assert context is not None and type(context) is tuple # sanity check * (update, args, kargs) = context # <<<<<<<<<<<<<< * update(Snes, toInt(its), *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 330, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(19, 330, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 330, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_update = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":331 * assert context is not None and type(context) is tuple # sanity check * (update, args, kargs) = context * update(Snes, toInt(its), *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 331, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_update, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscsnes.pxi":332 * (update, args, kargs) = context * update(Snes, toInt(its), *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":323 * # ----------------------------------------------------------------------------- * * cdef int SNES_Update( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt its, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Update", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_update); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":336 * # ----------------------------------------------------------------------------- * * cdef int SNES_Jacobian( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static int __pyx_f_8petsc4py_5PETSc_SNES_Jacobian(SNES __pyx_v_snes, Vec __pyx_v_x, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Jacobian", 0); /* "PETSc/petscsnes.pxi":343 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":344 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":345 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Snes.get_attr('__jacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":346 * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__jacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":347 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Snes.get_attr('__jacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":348 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Snes.get_attr('__jacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscsnes.pxi":349 * cdef object context = Snes.get_attr('__jacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 349, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":350 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 350, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(19, 350, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 350, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":351 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Jmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Jmat)); __Pyx_INCREF(((PyObject *)__pyx_v_Pmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat)); PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_Pmat)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 351, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":352 * (jacobian, args, kargs) = context * jacobian(Snes, Xvec, Jmat, Pmat, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":336 * # ----------------------------------------------------------------------------- * * cdef int SNES_Jacobian( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":356 * # ----------------------------------------------------------------------------- * * cdef int SNES_Objective( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static int __pyx_f_8petsc4py_5PETSc_SNES_Objective(SNES __pyx_v_snes, Vec __pyx_v_x, PetscReal *__pyx_v_o, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_objective = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_obj = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PetscReal __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Objective", 0); /* "PETSc/petscsnes.pxi":362 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__objective__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":363 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__objective__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":364 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__objective__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__objective__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":365 * cdef Vec Xvec = ref_Vec(x) * cdef object context = Snes.get_attr('__objective__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscsnes.pxi":366 * cdef object context = Snes.get_attr('__objective__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objective, args, kargs) = context * obj = objective(Snes, Xvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 366, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":367 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context # <<<<<<<<<<<<<< * obj = objective(Snes, Xvec, *args, **kargs) * o[0] = asReal(obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 367, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(19, 367, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 367, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objective = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":368 * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context * obj = objective(Snes, Xvec, *args, **kargs) # <<<<<<<<<<<<<< * o[0] = asReal(obj) * return 0 */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 368, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objective, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_obj = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":369 * (objective, args, kargs) = context * obj = objective(Snes, Xvec, *args, **kargs) * o[0] = asReal(obj) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_obj); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(19, 369, __pyx_L1_error) (__pyx_v_o[0]) = __pyx_t_9; /* "PETSc/petscsnes.pxi":370 * obj = objective(Snes, Xvec, *args, **kargs) * o[0] = asReal(obj) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":356 * # ----------------------------------------------------------------------------- * * cdef int SNES_Objective( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objective); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_obj); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":374 * # ----------------------------------------------------------------------------- * * cdef int SNES_NGS( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ static int __pyx_f_8petsc4py_5PETSc_SNES_NGS(SNES __pyx_v_snes, Vec __pyx_v_x, Vec __pyx_v_b, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Bvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_ngs = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_NGS", 0); /* "PETSc/petscsnes.pxi":380 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Bvec = ref_Vec(b) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":381 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Bvec = ref_Vec(b) * cdef object context = Snes.get_attr('__ngs__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":382 * cdef SNES Snes = ref_SNES(snes) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Bvec = ref_Vec(b) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__ngs__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Bvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":383 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Bvec = ref_Vec(b) * cdef object context = Snes.get_attr('__ngs__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__ngs__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":384 * cdef Vec Bvec = ref_Vec(b) * cdef object context = Snes.get_attr('__ngs__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (ngs, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscsnes.pxi":385 * cdef object context = Snes.get_attr('__ngs__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (ngs, args, kargs) = context * ngs(Snes, Xvec, Bvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 385, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":386 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (ngs, args, kargs) = context # <<<<<<<<<<<<<< * ngs(Snes, Xvec, Bvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 386, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(19, 386, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 386, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_ngs = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":387 * assert context is not None and type(context) is tuple # sanity check * (ngs, args, kargs) = context * ngs(Snes, Xvec, Bvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Bvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Bvec)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_Bvec)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 387, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_ngs, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":388 * (ngs, args, kargs) = context * ngs(Snes, Xvec, Bvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":374 * # ----------------------------------------------------------------------------- * * cdef int SNES_NGS( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscVec x, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_NGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Bvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_ngs); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":392 * # ----------------------------------------------------------------------------- * * cdef int SNES_Converged( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ static int __pyx_f_8petsc4py_5PETSc_SNES_Converged(SNES __pyx_v_snes, PetscInt __pyx_v_iters, PetscReal __pyx_v_xnorm, PetscReal __pyx_v_gnorm, PetscReal __pyx_v_fnorm, SNESConvergedReason *__pyx_v_r, void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; PyObject *__pyx_v_it = 0; PyObject *__pyx_v_xn = 0; PyObject *__pyx_v_gn = 0; PyObject *__pyx_v_fn = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_converged = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_reason = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); SNESConvergedReason __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Converged", 0); /* "PETSc/petscsnes.pxi":401 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef object it = toInt(iters) * cdef object xn = toReal(xnorm) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":402 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef object it = toInt(iters) # <<<<<<<<<<<<<< * cdef object xn = toReal(xnorm) * cdef object gn = toReal(gnorm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_iters); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_it = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":403 * cdef SNES Snes = ref_SNES(snes) * cdef object it = toInt(iters) * cdef object xn = toReal(xnorm) # <<<<<<<<<<<<<< * cdef object gn = toReal(gnorm) * cdef object fn = toReal(fnorm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_xnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xn = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":404 * cdef object it = toInt(iters) * cdef object xn = toReal(xnorm) * cdef object gn = toReal(gnorm) # <<<<<<<<<<<<<< * cdef object fn = toReal(fnorm) * cdef object context = Snes.get_attr('__converged__') */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gn = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":405 * cdef object xn = toReal(xnorm) * cdef object gn = toReal(gnorm) * cdef object fn = toReal(fnorm) # <<<<<<<<<<<<<< * cdef object context = Snes.get_attr('__converged__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fn = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":406 * cdef object gn = toReal(gnorm) * cdef object fn = toReal(fnorm) * cdef object context = Snes.get_attr('__converged__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":407 * cdef object fn = toReal(fnorm) * cdef object context = Snes.get_attr('__converged__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (converged, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscsnes.pxi":408 * cdef object context = Snes.get_attr('__converged__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (converged, args, kargs) = context * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(19, 408, __pyx_L1_error) } } #endif /* "PETSc/petscsnes.pxi":409 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (converged, args, kargs) = context # <<<<<<<<<<<<<< * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) * if reason is None: r[0] = SNES_CONVERGED_ITERATING */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 409, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(19, 409, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 409, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_converged = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":410 * assert context is not None and type(context) is tuple # sanity check * (converged, args, kargs) = context * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) # <<<<<<<<<<<<<< * if reason is None: r[0] = SNES_CONVERGED_ITERATING * elif reason is False: r[0] = SNES_CONVERGED_ITERATING */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_xn); __Pyx_GIVEREF(__pyx_v_xn); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_xn); __Pyx_INCREF(__pyx_v_gn); __Pyx_GIVEREF(__pyx_v_gn); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_gn); __Pyx_INCREF(__pyx_v_fn); __Pyx_GIVEREF(__pyx_v_fn); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_fn); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_INCREF(__pyx_v_it); __Pyx_GIVEREF(__pyx_v_it); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_it); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 410, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_reason = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/petscsnes.pxi":411 * (converged, args, kargs) = context * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) * if reason is None: r[0] = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is False: r[0] = SNES_CONVERGED_ITERATING * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? */ __pyx_t_2 = (__pyx_v_reason == Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { (__pyx_v_r[0]) = SNES_CONVERGED_ITERATING; goto __pyx_L10; } /* "PETSc/petscsnes.pxi":412 * reason = converged(Snes, it, (xn, gn, fn), *args, **kargs) * if reason is None: r[0] = SNES_CONVERGED_ITERATING * elif reason is False: r[0] = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? * else: r[0] = reason */ __pyx_t_4 = (__pyx_v_reason == Py_False); __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { (__pyx_v_r[0]) = SNES_CONVERGED_ITERATING; goto __pyx_L10; } /* "PETSc/petscsnes.pxi":413 * if reason is None: r[0] = SNES_CONVERGED_ITERATING * elif reason is False: r[0] = SNES_CONVERGED_ITERATING * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? # <<<<<<<<<<<<<< * else: r[0] = reason * return 0 */ __pyx_t_2 = (__pyx_v_reason == Py_True); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { (__pyx_v_r[0]) = SNES_CONVERGED_ITS; goto __pyx_L10; } /* "PETSc/petscsnes.pxi":414 * elif reason is False: r[0] = SNES_CONVERGED_ITERATING * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? * else: r[0] = reason # <<<<<<<<<<<<<< * return 0 * */ /*else*/ { __pyx_t_9 = ((SNESConvergedReason)__Pyx_PyInt_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 414, __pyx_L1_error) (__pyx_v_r[0]) = __pyx_t_9; } __pyx_L10:; /* "PETSc/petscsnes.pxi":415 * elif reason is True: r[0] = SNES_CONVERGED_ITS # XXX ? * else: r[0] = reason * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":392 * # ----------------------------------------------------------------------------- * * cdef int SNES_Converged( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF(__pyx_v_it); __Pyx_XDECREF(__pyx_v_xn); __Pyx_XDECREF(__pyx_v_gn); __Pyx_XDECREF(__pyx_v_fn); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_converged); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_reason); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscsnes.pxi":419 * # ----------------------------------------------------------------------------- * * cdef int SNES_Monitor( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ static int __pyx_f_8petsc4py_5PETSc_SNES_Monitor(SNES __pyx_v_snes, PetscInt __pyx_v_iters, PetscReal __pyx_v_rnorm, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscSNESObject *__pyx_v_Snes = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_it = 0; PyObject *__pyx_v_rn = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("SNES_Monitor", 0); /* "PETSc/petscsnes.pxi":425 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) # <<<<<<<<<<<<<< * cdef object monitorlist = Snes.get_attr('__monitor__') * if monitorlist is None: return 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_SNES(__pyx_v_snes)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":426 * ) except PETSC_ERR_PYTHON with gil: * cdef SNES Snes = ref_SNES(snes) * cdef object monitorlist = Snes.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return 0 * cdef object it = toInt(iters) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_Snes->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Snes), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":427 * cdef SNES Snes = ref_SNES(snes) * cdef object monitorlist = Snes.get_attr('__monitor__') * if monitorlist is None: return 0 # <<<<<<<<<<<<<< * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscsnes.pxi":428 * cdef object monitorlist = Snes.get_attr('__monitor__') * if monitorlist is None: return 0 * cdef object it = toInt(iters) # <<<<<<<<<<<<<< * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_iters); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_it = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":429 * if monitorlist is None: return 0 * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(Snes, it, rn, *args, **kargs) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rn = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":430 * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Snes, it, rn, *args, **kargs) * return 0 */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 430, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(19, 430, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(19, 430, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(19, 430, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(19, 430, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(19, 430, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(19, 430, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscsnes.pxi":431 * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: * monitor(Snes, it, rn, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Snes)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Snes)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Snes)); __Pyx_INCREF(__pyx_v_it); __Pyx_GIVEREF(__pyx_v_it); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_it); __Pyx_INCREF(__pyx_v_rn); __Pyx_GIVEREF(__pyx_v_rn); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_rn); __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(19, 431, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscsnes.pxi":430 * cdef object it = toInt(iters) * cdef object rn = toReal(rnorm) * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Snes, it, rn, *args, **kargs) * return 0 */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscsnes.pxi":432 * for (monitor, args, kargs) in monitorlist: * monitor(Snes, it, rn, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscsnes.pxi":419 * # ----------------------------------------------------------------------------- * * cdef int SNES_Monitor( # <<<<<<<<<<<<<< * PetscSNES snes, * PetscInt iters, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.SNES_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Snes); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_it); __Pyx_XDECREF(__pyx_v_rn); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":316 * # ----------------------------------------------------------------------------- * * cdef inline TS ref_TS(PetscTS ts): # <<<<<<<<<<<<<< * cdef TS ob = TS() * ob.ts = ts */ static CYTHON_INLINE struct PyPetscTSObject *__pyx_f_8petsc4py_5PETSc_ref_TS(TS __pyx_v_ts) { struct PyPetscTSObject *__pyx_v_ob = 0; struct PyPetscTSObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_TS", 0); /* "PETSc/petscts.pxi":317 * * cdef inline TS ref_TS(PetscTS ts): * cdef TS ob = TS() # <<<<<<<<<<<<<< * ob.ts = ts * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscts.pxi":318 * cdef inline TS ref_TS(PetscTS ts): * cdef TS ob = TS() * ob.ts = ts # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->ts = __pyx_v_ts; /* "PETSc/petscts.pxi":319 * cdef TS ob = TS() * ob.ts = ts * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscts.pxi":320 * ob.ts = ts * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscts.pxi":316 * # ----------------------------------------------------------------------------- * * cdef inline TS ref_TS(PetscTS ts): # <<<<<<<<<<<<<< * cdef TS ob = TS() * ob.ts = ts */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_TS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscts.pxi":324 * # ----------------------------------------------------------------------------- * * cdef int TS_RHSFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_RHSFunction(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_RHSFunction", 0); /* "PETSc/petscts.pxi":331 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":332 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__rhsfunction__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":333 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__rhsfunction__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":334 * cdef Vec Xvec = ref_Vec(x) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__rhsfunction__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__rhsfunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":335 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__rhsfunction__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":336 * cdef object context = Ts.get_attr('__rhsfunction__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 336, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":337 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 337, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 337, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 337, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":338 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Fvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec)); PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Fvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 338, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscts.pxi":339 * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, Fvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_RHSJacobian( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":324 * # ----------------------------------------------------------------------------- * * cdef int TS_RHSFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_RHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":341 * return 0 * * cdef int TS_RHSJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_RHSJacobian(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_RHSJacobian", 0); /* "PETSc/petscts.pxi":349 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":350 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":351 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__rhsjacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":352 * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__rhsjacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":353 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__rhsjacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__rhsjacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":354 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__rhsjacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":355 * cdef object context = Ts.get_attr('__rhsjacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 355, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":356 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 356, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 356, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 356, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":357 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Jmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat)); PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Jmat)); __Pyx_INCREF(((PyObject *)__pyx_v_Pmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat)); PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Pmat)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 357, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscts.pxi":358 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, Jmat, Pmat, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":341 * return 0 * * cdef int TS_RHSJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_RHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":362 * # ----------------------------------------------------------------------------- * * cdef int TS_IFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_IFunction(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_IFunction", 0); /* "PETSc/petscts.pxi":370 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":371 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":372 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__ifunction__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":373 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__ifunction__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":374 * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__ifunction__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__ifunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":375 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__ifunction__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":376 * cdef object context = Ts.get_attr('__ifunction__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 376, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":377 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 377, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 377, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 377, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":378 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_XDvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec)); PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_XDvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Fvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec)); PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Fvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 378, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscts.pxi":379 * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, Fvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_IJacobian( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":362 * # ----------------------------------------------------------------------------- * * cdef int TS_IFunction( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_IFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":381 * return 0 * * cdef int TS_IJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_IJacobian(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, PetscReal __pyx_v_a, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_IJacobian", 0); /* "PETSc/petscts.pxi":391 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":392 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":393 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":394 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__ijacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":395 * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__ijacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":396 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__ijacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__ijacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":397 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__ijacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":398 * cdef object context = Ts.get_attr('__ijacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 398, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":399 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 399, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 399, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 399, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":400 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_XDvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_XDvec)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Jmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat)); PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_v_Jmat)); __Pyx_INCREF(((PyObject *)__pyx_v_Pmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat)); PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_v_Pmat)); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 400, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":401 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, Pmat, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_IJacobianP( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":381 * return 0 * * cdef int TS_IJacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_IJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":403 * return 0 * * cdef int TS_IJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_IJacobianP(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, PetscReal __pyx_v_a, Mat __pyx_v_J, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_IJacobianP", 0); /* "PETSc/petscts.pxi":412 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":413 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":414 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__ijacobianp__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":415 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__ijacobianp__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":416 * cdef Vec XDvec = ref_Vec(xdot) * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__ijacobianp__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__ijacobianp__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":417 * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__ijacobianp__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":418 * cdef object context = Ts.get_attr('__ijacobianp__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 418, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":419 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 419, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 419, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 419, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":420 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_XDvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_XDvec)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Jmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat)); PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_v_Jmat)); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 420, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":421 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, toReal(a), Jmat, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_I2Function( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":403 * return 0 * * cdef int TS_IJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_IJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":423 * return 0 * * cdef int TS_I2Function( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_I2Function(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, Vec __pyx_v_xdotdot, Vec __pyx_v_f, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscVecObject *__pyx_v_XDDvec = 0; struct PyPetscVecObject *__pyx_v_Fvec = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_function = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_I2Function", 0); /* "PETSc/petscts.pxi":432 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":433 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":434 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Vec Fvec = ref_Vec(f) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":435 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) # <<<<<<<<<<<<<< * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__i2function__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdotdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":436 * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Vec Fvec = ref_Vec(f) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__i2function__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":437 * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__i2function__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__i2function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":438 * cdef Vec Fvec = ref_Vec(f) * cdef object context = Ts.get_attr('__i2function__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":439 * cdef object context = Ts.get_attr('__i2function__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 439, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":440 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context # <<<<<<<<<<<<<< * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 440, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 440, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 440, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":441 * assert context is not None and type(context) is tuple # sanity check * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_XDvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec)); PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_XDvec)); __Pyx_INCREF(((PyObject *)__pyx_v_XDDvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_XDDvec)); PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_XDDvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Fvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Fvec)); PyTuple_SET_ITEM(__pyx_t_5, 5, ((PyObject *)__pyx_v_Fvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 441, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_function, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscts.pxi":442 * (function, args, kargs) = context * function(Ts, toReal(t), Xvec, XDvec, XDDvec, Fvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_I2Jacobian( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":423 * return 0 * * cdef int TS_I2Function( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_I2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Fvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":444 * return 0 * * cdef int TS_I2Jacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_I2Jacobian(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Vec __pyx_v_xdot, Vec __pyx_v_xdotdot, PetscReal __pyx_v_v, PetscReal __pyx_v_a, Mat __pyx_v_J, Mat __pyx_v_P, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscVecObject *__pyx_v_XDvec = 0; struct PyPetscVecObject *__pyx_v_XDDvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; struct PyPetscMatObject *__pyx_v_Pmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_I2Jacobian", 0); /* "PETSc/petscts.pxi":456 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":457 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":458 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) # <<<<<<<<<<<<<< * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":459 * cdef Vec Xvec = ref_Vec(x) * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_xdotdot)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":460 * cdef Vec XDvec = ref_Vec(xdot) * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__i2jacobian__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":461 * cdef Vec XDDvec = ref_Vec(xdotdot) * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__i2jacobian__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":462 * cdef Mat Jmat = ref_Mat(J) * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__i2jacobian__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__i2jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":463 * cdef Mat Pmat = ref_Mat(P) * cdef object context = Ts.get_attr('__i2jacobian__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":464 * cdef object context = Ts.get_attr('__i2jacobian__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 464, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":465 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 465, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 465, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 465, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":466 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyTuple_New(9); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_XDvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_XDvec)); PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_v_XDvec)); __Pyx_INCREF(((PyObject *)__pyx_v_XDDvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_XDDvec)); PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_v_XDDvec)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Jmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat)); PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_v_Jmat)); __Pyx_INCREF(((PyObject *)__pyx_v_Pmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Pmat)); PyTuple_SET_ITEM(__pyx_t_7, 8, ((PyObject *)__pyx_v_Pmat)); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 466, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscts.pxi":467 * (jacobian, args, kargs) = context * jacobian(Ts, toReal(t), Xvec, XDvec, XDDvec, toReal(v), toReal(a), Jmat, Pmat, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":444 * return 0 * * cdef int TS_I2Jacobian( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_I2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDvec); __Pyx_XDECREF((PyObject *)__pyx_v_XDDvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF((PyObject *)__pyx_v_Pmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":471 * # ----------------------------------------------------------------------------- * * cdef int TS_Monitor( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt step, */ static int __pyx_f_8petsc4py_5PETSc_TS_Monitor(TS __pyx_v_ts, PetscInt __pyx_v_step, PetscReal __pyx_v_time, Vec __pyx_v_u, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Vu = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_Monitor", 0); /* "PETSc/petscts.pxi":478 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Vu = ref_Vec(u) * cdef object monitorlist = Ts.get_attr('__monitor__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":479 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<< * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":480 * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) * cdef object monitorlist = Ts.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":481 * cdef Vec Vu = ref_Vec(u) * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return 0 # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscts.pxi":482 * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) * return 0 */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 482, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(20, 482, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(20, 482, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(20, 482, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 482, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(20, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(20, 482, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 482, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscts.pxi":483 * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_step); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_v_Vu)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Vu)); PyTuple_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_v_Vu)); __pyx_t_6 = 0; __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 483, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscts.pxi":482 * cdef object monitorlist = Ts.get_attr('__monitor__') * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) * return 0 */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":484 * for (monitor, args, kargs) in monitorlist: * monitor(Ts, toInt(step), toReal(time), Vu, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":471 * # ----------------------------------------------------------------------------- * * cdef int TS_Monitor( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt step, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.TS_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Vu); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":488 * # ----------------------------------------------------------------------------- * * cdef int TS_EventHandler( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal time, */ static int __pyx_f_8petsc4py_5PETSc_TS_EventHandler(TS __pyx_v_ts, PetscReal __pyx_v_time, Vec __pyx_v_u, PetscScalar *__pyx_v_fvalue, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Vu = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_eventhandler = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PetscInt __pyx_v_nevents; npy_intp __pyx_v_s; PyArrayObject *__pyx_v_fvalue_array = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_EventHandler", 0); /* "PETSc/petscts.pxi":495 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__eventhandler__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":496 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__eventhandler__') * if context is None: return 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":497 * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__eventhandler__') # <<<<<<<<<<<<<< * if context is None: return 0 * (eventhandler, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__eventhandler__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":498 * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__eventhandler__') * if context is None: return 0 # <<<<<<<<<<<<<< * (eventhandler, args, kargs) = context * cdef PetscInt nevents = 0 */ __pyx_t_2 = (__pyx_v_context == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscts.pxi":499 * cdef object context = Ts.get_attr('__eventhandler__') * if context is None: return 0 * (eventhandler, args, kargs) = context # <<<<<<<<<<<<<< * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(ts, &nevents) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 499, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(20, 499, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 499, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_eventhandler = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/petscts.pxi":500 * if context is None: return 0 * (eventhandler, args, kargs) = context * cdef PetscInt nevents = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(ts, &nevents) ) * cdef npy_intp s = nevents */ __pyx_v_nevents = 0; /* "PETSc/petscts.pxi":501 * (eventhandler, args, kargs) = context * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(ts, &nevents) ) # <<<<<<<<<<<<<< * cdef npy_intp s = nevents * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetNumEvents(__pyx_v_ts, (&__pyx_v_nevents))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(20, 501, __pyx_L1_error) /* "PETSc/petscts.pxi":502 * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(ts, &nevents) ) * cdef npy_intp s = nevents # <<<<<<<<<<<<<< * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) */ __pyx_v_s = ((npy_intp)__pyx_v_nevents); /* "PETSc/petscts.pxi":503 * CHKERR( TSGetNumEvents(ts, &nevents) ) * cdef npy_intp s = nevents * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) # <<<<<<<<<<<<<< * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) * return 0 */ __pyx_t_5 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), NPY_PETSC_SCALAR, __pyx_v_fvalue)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_fvalue_array = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscts.pxi":504 * cdef npy_intp s = nevents * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Vu)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Vu)); PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_Vu)); __Pyx_INCREF(((PyObject *)__pyx_v_fvalue_array)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fvalue_array)); PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_fvalue_array)); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 504, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_eventhandler, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscts.pxi":505 * fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_SCALAR, fvalue) * eventhandler(Ts, toReal(time), Vu, fvalue_array, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_PostEvent( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":488 * # ----------------------------------------------------------------------------- * * cdef int TS_EventHandler( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal time, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_EventHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Vu); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_eventhandler); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF((PyObject *)__pyx_v_fvalue_array); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":507 * return 0 * * cdef int TS_PostEvent( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt nevents_zero, */ static int __pyx_f_8petsc4py_5PETSc_TS_PostEvent(TS __pyx_v_ts, PetscInt __pyx_v_nevents_zero, PetscInt *__pyx_v_events_zero, PetscReal __pyx_v_time, Vec __pyx_v_u, PetscBool __pyx_v_forward, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Vu = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_postevent = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; npy_intp __pyx_v_s; PyArrayObject *__pyx_v_events_zero_array = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_PostEvent", 0); /* "PETSc/petscts.pxi":516 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__postevent__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":517 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__postevent__') * if context is None: return 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_u)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":518 * cdef TS Ts = ref_TS(ts) * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__postevent__') # <<<<<<<<<<<<<< * if context is None: return 0 * (postevent, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__postevent__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":519 * cdef Vec Vu = ref_Vec(u) * cdef object context = Ts.get_attr('__postevent__') * if context is None: return 0 # <<<<<<<<<<<<<< * (postevent, args, kargs) = context * cdef npy_intp s = nevents_zero */ __pyx_t_2 = (__pyx_v_context == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petscts.pxi":520 * cdef object context = Ts.get_attr('__postevent__') * if context is None: return 0 * (postevent, args, kargs) = context # <<<<<<<<<<<<<< * cdef npy_intp s = nevents_zero * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 520, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(20, 520, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 520, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_postevent = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_kargs = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/petscts.pxi":521 * if context is None: return 0 * (postevent, args, kargs) = context * cdef npy_intp s = nevents_zero # <<<<<<<<<<<<<< * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) */ __pyx_v_s = ((npy_intp)__pyx_v_nevents_zero); /* "PETSc/petscts.pxi":522 * (postevent, args, kargs) = context * cdef npy_intp s = nevents_zero * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) # <<<<<<<<<<<<<< * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) * return 0 */ __pyx_t_5 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), NPY_PETSC_INT, __pyx_v_events_zero)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_events_zero_array = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscts.pxi":523 * cdef npy_intp s = nevents_zero * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_forward); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_INCREF(((PyObject *)__pyx_v_events_zero_array)); __Pyx_GIVEREF(((PyObject *)__pyx_v_events_zero_array)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_events_zero_array)); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Vu)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Vu)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_Vu)); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 523, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_postevent, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":524 * events_zero_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_INT, events_zero) * postevent(Ts, events_zero_array, toReal(time), Vu, toBool(forward), *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_PreStep( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":507 * return 0 * * cdef int TS_PostEvent( # <<<<<<<<<<<<<< * PetscTS ts, * PetscInt nevents_zero, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TS_PostEvent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Vu); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_postevent); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF((PyObject *)__pyx_v_events_zero_array); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":526 * return 0 * * cdef int TS_PreStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TS_PreStep(TS __pyx_v_ts) { struct PyPetscTSObject *__pyx_v_Ts = 0; PyObject *__pyx_v_prestep = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_PreStep", 0); /* "PETSc/petscts.pxi":529 * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * (prestep, args, kargs) = Ts.get_attr('__prestep__') * prestep(Ts, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":530 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * (prestep, args, kargs) = Ts.get_attr('__prestep__') # <<<<<<<<<<<<<< * prestep(Ts, *args, **kargs) * return 0 */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__prestep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 530, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(20, 530, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 530, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_prestep = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscts.pxi":531 * cdef TS Ts = ref_TS(ts) * (prestep, args, kargs) = Ts.get_attr('__prestep__') * prestep(Ts, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts)); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 531, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_prestep, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":532 * (prestep, args, kargs) = Ts.get_attr('__prestep__') * prestep(Ts, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TS_PostStep( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":526 * return 0 * * cdef int TS_PreStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS_PreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF(__pyx_v_prestep); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":534 * return 0 * * cdef int TS_PostStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TS_PostStep(TS __pyx_v_ts) { struct PyPetscTSObject *__pyx_v_Ts = 0; PyObject *__pyx_v_poststep = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_PostStep", 0); /* "PETSc/petscts.pxi":537 * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * (poststep, args, kargs) = Ts.get_attr('__poststep__') * poststep(Ts, *args, **kargs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":538 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * (poststep, args, kargs) = Ts.get_attr('__poststep__') # <<<<<<<<<<<<<< * poststep(Ts, *args, **kargs) * return 0 */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__poststep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 538, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(20, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(20, 538, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 538, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_poststep = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_kargs = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/petscts.pxi":539 * cdef TS Ts = ref_TS(ts) * (poststep, args, kargs) = Ts.get_attr('__poststep__') * poststep(Ts, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Ts)); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(20, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 539, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_4 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } else { __pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_poststep, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":540 * (poststep, args, kargs) = Ts.get_attr('__poststep__') * poststep(Ts, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":534 * return 0 * * cdef int TS_PostStep( # <<<<<<<<<<<<<< * PetscTS ts, * ) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS_PostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF(__pyx_v_poststep); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscts.pxi":544 * # ----------------------------------------------------------------------------- * * cdef int TS_RHSJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ static int __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP(TS __pyx_v_ts, PetscReal __pyx_v_t, Vec __pyx_v_x, Mat __pyx_v_J, void *__pyx_v_ctx) { struct PyPetscTSObject *__pyx_v_Ts = 0; struct PyPetscVecObject *__pyx_v_Xvec = 0; struct PyPetscMatObject *__pyx_v_Jmat = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_jacobianp = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TS_RHSJacobianP", 0); /* "PETSc/petscts.pxi":551 * void* ctx, * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) # <<<<<<<<<<<<<< * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":552 * ) except PETSC_ERR_PYTHON with gil: * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) # <<<<<<<<<<<<<< * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__rhsjacobianp__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":553 * cdef TS Ts = ref_TS(ts) * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) # <<<<<<<<<<<<<< * cdef object context = Ts.get_attr('__rhsjacobianp__') * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscts.pxi":554 * cdef Vec Xvec = ref_Vec(x) * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__rhsjacobianp__') # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_Ts->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Ts), ((char *)"__rhsjacobianp__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscts.pxi":555 * cdef Mat Jmat = ref_Mat(J) * cdef object context = Ts.get_attr('__rhsjacobianp__') * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobianp, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petscts.pxi":556 * cdef object context = Ts.get_attr('__rhsjacobianp__') * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobianp, args, kargs) = context * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(20, 556, __pyx_L1_error) } } #endif /* "PETSc/petscts.pxi":557 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobianp, args, kargs) = context # <<<<<<<<<<<<<< * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(20, 557, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(20, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(20, 557, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(20, 557, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobianp = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscts.pxi":558 * assert context is not None and type(context) is tuple # sanity check * (jacobianp, args, kargs) = context * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Ts)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_Ts)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Xvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Xvec)); PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_Xvec)); __Pyx_INCREF(((PyObject *)__pyx_v_Jmat)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Jmat)); PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Jmat)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(20, 558, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(20, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_jacobianp, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscts.pxi":559 * (jacobianp, args, kargs) = context * jacobianp(Ts, toReal(t), Xvec, Jmat, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscts.pxi":544 * # ----------------------------------------------------------------------------- * * cdef int TS_RHSJacobianP( # <<<<<<<<<<<<<< * PetscTS ts, * PetscReal t, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TS_RHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Ts); __Pyx_XDECREF((PyObject *)__pyx_v_Xvec); __Pyx_XDECREF((PyObject *)__pyx_v_Jmat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobianp); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":181 * # -------------------------------------------------------------------- * * cdef inline TAO ref_TAO(PetscTAO tao): # <<<<<<<<<<<<<< * cdef TAO ob = TAO() * ob.tao = tao */ static CYTHON_INLINE struct PyPetscTAOObject *__pyx_f_8petsc4py_5PETSc_ref_TAO(Tao __pyx_v_tao) { struct PyPetscTAOObject *__pyx_v_ob = 0; struct PyPetscTAOObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_TAO", 0); /* "PETSc/petsctao.pxi":182 * * cdef inline TAO ref_TAO(PetscTAO tao): * cdef TAO ob = TAO() # <<<<<<<<<<<<<< * ob.tao = tao * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscTAOObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petsctao.pxi":183 * cdef inline TAO ref_TAO(PetscTAO tao): * cdef TAO ob = TAO() * ob.tao = tao # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->tao = __pyx_v_tao; /* "PETSc/petsctao.pxi":184 * cdef TAO ob = TAO() * ob.tao = tao * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petsctao.pxi":185 * ob.tao = tao * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petsctao.pxi":181 * # -------------------------------------------------------------------- * * cdef inline TAO ref_TAO(PetscTAO tao): # <<<<<<<<<<<<<< * cdef TAO ob = TAO() * ob.tao = tao */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_TAO", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petsctao.pxi":189 * # -------------------------------------------------------------------- * * cdef int TAO_Objective(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TAO_Objective(Tao __pyx_v__tao, Vec __pyx_v__x, PetscReal *__pyx_v__f, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_objective = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PetscReal __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Objective", 0); /* "PETSc/petsctao.pxi":193 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * context = tao.get_attr("__objective__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":194 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * context = tao.get_attr("__objective__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":195 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * context = tao.get_attr("__objective__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__objective__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":196 * cdef Vec x = ref_Vec(_x) * context = tao.get_attr("__objective__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":197 * context = tao.get_attr("__objective__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objective, args, kargs) = context * retv = objective(tao, x, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 197, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":198 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context # <<<<<<<<<<<<<< * retv = objective(tao, x, *args, **kargs) * _f[0] = asReal(retv) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 198, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 198, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 198, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objective = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":199 * assert context is not None and type(context) is tuple # sanity check * (objective, args, kargs) = context * retv = objective(tao, x, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return 0 */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 199, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objective, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_retv = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":200 * (objective, args, kargs) = context * retv = objective(tao, x, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(21, 200, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_9; /* "PETSc/petsctao.pxi":201 * retv = objective(tao, x, *args, **kargs) * _f[0] = asReal(retv) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_Residual(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":189 * # -------------------------------------------------------------------- * * cdef int TAO_Objective(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Objective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objective); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":203 * return 0 * * cdef int TAO_Residual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TAO_Residual(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__r, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_r = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_residual = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Residual", 0); /* "PETSc/petsctao.pxi":207 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":208 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__residual__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":209 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) # <<<<<<<<<<<<<< * context = tao.get_attr("__residual__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":210 * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__residual__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__residual__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":211 * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__residual__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (residual, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":212 * context = tao.get_attr("__residual__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (residual, args, kargs) = context * residual(tao, x, r, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 212, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":213 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (residual, args, kargs) = context # <<<<<<<<<<<<<< * residual(tao, x, r, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 213, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 213, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 213, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_residual = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":214 * assert context is not None and type(context) is tuple # sanity check * (residual, args, kargs) = context * residual(tao, x, r, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_r)); __Pyx_GIVEREF(((PyObject *)__pyx_v_r)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_r)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 214, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_residual, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":215 * (residual, args, kargs) = context * residual(tao, x, r, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_Gradient(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":203 * return 0 * * cdef int TAO_Residual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Residual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_residual); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":217 * return 0 * * cdef int TAO_Gradient(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TAO_Gradient(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__g, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_gradient = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Gradient", 0); /* "PETSc/petsctao.pxi":221 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":222 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__gradient__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":223 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * context = tao.get_attr("__gradient__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":224 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__gradient__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__gradient__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":225 * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__gradient__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (gradient, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":226 * context = tao.get_attr("__gradient__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (gradient, args, kargs) = context * gradient(tao, x, g, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 226, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":227 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (gradient, args, kargs) = context # <<<<<<<<<<<<<< * gradient(tao, x, g, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 227, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 227, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 227, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_gradient = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":228 * assert context is not None and type(context) is tuple # sanity check * (gradient, args, kargs) = context * gradient(tao, x, g, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_g)); __Pyx_GIVEREF(((PyObject *)__pyx_v_g)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_g)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 228, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_gradient, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":229 * (gradient, args, kargs) = context * gradient(tao, x, g, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":217 * return 0 * * cdef int TAO_Gradient(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Gradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_gradient); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":232 * * * cdef int TAO_ObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TAO_ObjGrad(Tao __pyx_v__tao, Vec __pyx_v__x, PetscReal *__pyx_v__f, Vec __pyx_v__g, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_objgrad = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PetscReal __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_ObjGrad", 0); /* "PETSc/petsctao.pxi":236 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":237 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__objgrad__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":238 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * context = tao.get_attr("__objgrad__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":239 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__objgrad__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__objgrad__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":240 * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__objgrad__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":241 * context = tao.get_attr("__objgrad__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 241, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":242 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context # <<<<<<<<<<<<<< * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 242, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 242, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 242, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objgrad = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":243 * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return 0 */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_g)); __Pyx_GIVEREF(((PyObject *)__pyx_v_g)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_g)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 243, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objgrad, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_retv = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":244 * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(21, 244, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_9; /* "PETSc/petsctao.pxi":245 * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_BRGNRegObjGrad(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":232 * * * cdef int TAO_ObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_ObjGrad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objgrad); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":247 * return 0 * * cdef int TAO_BRGNRegObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegObjGrad(Tao __pyx_v__tao, Vec __pyx_v__x, PetscReal *__pyx_v__f, Vec __pyx_v__g, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_objgrad = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_retv = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PetscReal __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_BRGNRegObjGrad", 0); /* "PETSc/petsctao.pxi":251 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":252 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__brgnregobjgrad__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":253 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) # <<<<<<<<<<<<<< * context = tao.get_attr("__brgnregobjgrad__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":254 * cdef Vec x = ref_Vec(_x) * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__brgnregobjgrad__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__brgnregobjgrad__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":255 * cdef Vec g = ref_Vec(_g) * context = tao.get_attr("__brgnregobjgrad__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":256 * context = tao.get_attr("__brgnregobjgrad__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 256, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":257 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context # <<<<<<<<<<<<<< * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 257, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 257, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 257, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_objgrad = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":258 * assert context is not None and type(context) is tuple # sanity check * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) # <<<<<<<<<<<<<< * _f[0] = asReal(retv) * return 0 */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_g)); __Pyx_GIVEREF(((PyObject *)__pyx_v_g)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_g)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 258, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_objgrad, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_retv = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":259 * (objgrad, args, kargs) = context * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_retv); if (unlikely(__pyx_t_9 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(21, 259, __pyx_L1_error) (__pyx_v__f[0]) = __pyx_t_9; /* "PETSc/petsctao.pxi":260 * retv = objgrad(tao, x, g, *args, **kargs) * _f[0] = asReal(retv) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_Constraints(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":247 * return 0 * * cdef int TAO_BRGNRegObjGrad(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscReal *_f, PetscVec _g, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_BRGNRegObjGrad", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_g); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_objgrad); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_retv); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":262 * return 0 * * cdef int TAO_Constraints(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TAO_Constraints(Tao __pyx_v__tao, Vec __pyx_v__x, Vec __pyx_v__r, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_r = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_constraints = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Constraints", 0); /* "PETSc/petsctao.pxi":266 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":267 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__constraints__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":268 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) # <<<<<<<<<<<<<< * context = tao.get_attr("__constraints__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":269 * cdef Vec x = ref_Vec(_x) * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__constraints__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__constraints__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":270 * cdef Vec r = ref_Vec(_r) * context = tao.get_attr("__constraints__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (constraints, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":271 * context = tao.get_attr("__constraints__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (constraints, args, kargs) = context * constraints(tao, x, r, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 271, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":272 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (constraints, args, kargs) = context # <<<<<<<<<<<<<< * constraints(tao, x, r, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 272, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 272, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 272, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_constraints = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":273 * assert context is not None and type(context) is tuple # sanity check * (constraints, args, kargs) = context * constraints(tao, x, r, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_r)); __Pyx_GIVEREF(((PyObject *)__pyx_v_r)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_r)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 273, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_constraints, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":274 * (constraints, args, kargs) = context * constraints(tao, x, r, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_VarBounds(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":262 * return 0 * * cdef int TAO_Constraints(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, PetscVec _r, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_constraints); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":276 * return 0 * * cdef int TAO_VarBounds(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _xl, PetscVec _xu, * void *ctx) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_TAO_VarBounds(Tao __pyx_v__tao, Vec __pyx_v__xl, Vec __pyx_v__xu, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_varbounds = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_VarBounds", 0); /* "PETSc/petsctao.pxi":280 * void *ctx) except PETSC_ERR_PYTHON with gil: * * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec xl = ref_Vec(_xl) * cdef Vec xu = ref_Vec(_xu) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":281 * * cdef TAO tao = ref_TAO(_tao) * cdef Vec xl = ref_Vec(_xl) # <<<<<<<<<<<<<< * cdef Vec xu = ref_Vec(_xu) * context = tao.get_attr("__varbounds__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__xl)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":282 * cdef TAO tao = ref_TAO(_tao) * cdef Vec xl = ref_Vec(_xl) * cdef Vec xu = ref_Vec(_xu) # <<<<<<<<<<<<<< * context = tao.get_attr("__varbounds__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__xu)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":283 * cdef Vec xl = ref_Vec(_xl) * cdef Vec xu = ref_Vec(_xu) * context = tao.get_attr("__varbounds__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__varbounds__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":284 * cdef Vec xu = ref_Vec(_xu) * context = tao.get_attr("__varbounds__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (varbounds, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":285 * context = tao.get_attr("__varbounds__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (varbounds, args, kargs) = context * varbounds(tao, xl, xu, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 285, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":286 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (varbounds, args, kargs) = context # <<<<<<<<<<<<<< * varbounds(tao, xl, xu, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 286, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 286, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 286, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_varbounds = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":287 * assert context is not None and type(context) is tuple # sanity check * (varbounds, args, kargs) = context * varbounds(tao, xl, xu, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_xl)); __Pyx_GIVEREF(((PyObject *)__pyx_v_xl)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_xl)); __Pyx_INCREF(((PyObject *)__pyx_v_xu)); __Pyx_GIVEREF(((PyObject *)__pyx_v_xu)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_xu)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 287, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_varbounds, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":288 * (varbounds, args, kargs) = context * varbounds(tao, xl, xu, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_Hessian(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":276 * return 0 * * cdef int TAO_VarBounds(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _xl, PetscVec _xu, * void *ctx) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_VarBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_xl); __Pyx_XDECREF((PyObject *)__pyx_v_xu); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_varbounds); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":290 * return 0 * * cdef int TAO_Hessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ static int __pyx_f_8petsc4py_5PETSc_TAO_Hessian(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__H, Mat __pyx_v__P, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_H = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_hessian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Hessian", 0); /* "PETSc/petsctao.pxi":295 * PetscMat _P, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":296 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat H = ref_Mat(_H) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":297 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__hessian__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__H)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":298 * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * context = tao.get_attr("__hessian__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":299 * cdef Mat H = ref_Mat(_H) * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__hessian__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__hessian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":300 * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__hessian__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":301 * context = tao.get_attr("__hessian__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (hessian, args, kargs) = context * hessian(tao, x, H, P, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 301, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":302 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context # <<<<<<<<<<<<<< * hessian(tao, x, H, P, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 302, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 302, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 302, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_hessian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":303 * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context * hessian(tao, x, H, P, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_H)); __Pyx_GIVEREF(((PyObject *)__pyx_v_H)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_H)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 303, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_hessian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":304 * (hessian, args, kargs) = context * hessian(tao, x, H, P, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_BRGNRegHessian(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":290 * return 0 * * cdef int TAO_Hessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Hessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_H); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_hessian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":306 * return 0 * * cdef int TAO_BRGNRegHessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ static int __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegHessian(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__H, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_H = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_hessian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_BRGNRegHessian", 0); /* "PETSc/petsctao.pxi":310 * PetscMat _H, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":311 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat H = ref_Mat(_H) * context = tao.get_attr("__brgnreghessian__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":312 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) # <<<<<<<<<<<<<< * context = tao.get_attr("__brgnreghessian__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__H)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":313 * cdef Vec x = ref_Vec(_x) * cdef Mat H = ref_Mat(_H) * context = tao.get_attr("__brgnreghessian__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__brgnreghessian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":314 * cdef Mat H = ref_Mat(_H) * context = tao.get_attr("__brgnreghessian__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":315 * context = tao.get_attr("__brgnreghessian__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (hessian, args, kargs) = context * hessian(tao, x, H, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 315, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":316 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context # <<<<<<<<<<<<<< * hessian(tao, x, H, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 316, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 316, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 316, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_hessian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":317 * assert context is not None and type(context) is tuple # sanity check * (hessian, args, kargs) = context * hessian(tao, x, H, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_H)); __Pyx_GIVEREF(((PyObject *)__pyx_v_H)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_H)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 317, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_hessian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":318 * (hessian, args, kargs) = context * hessian(tao, x, H, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_Jacobian(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":306 * return 0 * * cdef int TAO_BRGNRegHessian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _H, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_BRGNRegHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_H); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_hessian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":320 * return 0 * * cdef int TAO_Jacobian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static int __pyx_f_8petsc4py_5PETSc_TAO_Jacobian(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Jacobian", 0); /* "PETSc/petsctao.pxi":325 * PetscMat _P, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":326 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":327 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":328 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":329 * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":330 * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":331 * context = tao.get_attr("__jacobian__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 331, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":332 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, P, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 332, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 332, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 332, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":333 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 333, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":334 * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_JacobianResidual(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":320 * return 0 * * cdef int TAO_Jacobian(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":336 * return 0 * * cdef int TAO_JacobianResidual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static int __pyx_f_8petsc4py_5PETSc_TAO_JacobianResidual(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_JacobianResidual", 0); /* "PETSc/petsctao.pxi":341 * PetscMat _P, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":342 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":343 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_residual__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":344 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian_residual__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":345 * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_residual__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian_residual__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":346 * cdef Mat P = ref_Mat(_P) * context = tao.get_attr("__jacobian_residual__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":347 * context = tao.get_attr("__jacobian_residual__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 347, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":348 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, P, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 348, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 348, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 348, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":349 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 349, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":350 * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_JacobianState(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":336 * return 0 * * cdef int TAO_JacobianResidual(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":352 * return 0 * * cdef int TAO_JacobianState(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static int __pyx_f_8petsc4py_5PETSc_TAO_JacobianState(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, Mat __pyx_v__P, Mat __pyx_v__I, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; struct PyPetscMatObject *__pyx_v_I = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_JacobianState", 0); /* "PETSc/petsctao.pxi":358 * PetscMat _I, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":359 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":360 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * cdef Mat P = ref_Mat(_P) * cdef Mat I = ref_Mat(_I) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":361 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) # <<<<<<<<<<<<<< * cdef Mat I = ref_Mat(_I) * context = tao.get_attr("__jacobian_state__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":362 * cdef Mat J = ref_Mat(_J) * cdef Mat P = ref_Mat(_P) * cdef Mat I = ref_Mat(_I) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian_state__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__I)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_I = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":363 * cdef Mat P = ref_Mat(_P) * cdef Mat I = ref_Mat(_I) * context = tao.get_attr("__jacobian_state__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian_state__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":364 * cdef Mat I = ref_Mat(_I) * context = tao.get_attr("__jacobian_state__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":365 * context = tao.get_attr("__jacobian_state__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, I, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 365, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":366 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, P, I, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 366, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 366, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 366, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":367 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, I, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_P)); __Pyx_INCREF(((PyObject *)__pyx_v_I)); __Pyx_GIVEREF(((PyObject *)__pyx_v_I)); PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_I)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 367, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":368 * (jacobian, args, kargs) = context * jacobian(tao, x, J, P, I, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_JacobianDesign(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":352 * return 0 * * cdef int TAO_JacobianState(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF((PyObject *)__pyx_v_I); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":370 * return 0 * * cdef int TAO_JacobianDesign(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ static int __pyx_f_8petsc4py_5PETSc_TAO_JacobianDesign(Tao __pyx_v__tao, Vec __pyx_v__x, Mat __pyx_v__J, void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_jacobian = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_JacobianDesign", 0); /* "PETSc/petsctao.pxi":374 * PetscMat _J, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":375 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) # <<<<<<<<<<<<<< * cdef Mat J = ref_Mat(_J) * context = tao.get_attr("__jacobian_design__") */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":376 * cdef TAO tao = ref_TAO(_tao) * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) # <<<<<<<<<<<<<< * context = tao.get_attr("__jacobian_design__") * if context is None and ctx != NULL: context = ctx */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":377 * cdef Vec x = ref_Vec(_x) * cdef Mat J = ref_Mat(_J) * context = tao.get_attr("__jacobian_design__") # <<<<<<<<<<<<<< * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__jacobian_design__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":378 * cdef Mat J = ref_Mat(_J) * context = tao.get_attr("__jacobian_design__") * if context is None and ctx != NULL: context = ctx # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context */ __pyx_t_3 = (__pyx_v_context == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_ctx != NULL) != 0); __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_context, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/petsctao.pxi":379 * context = tao.get_attr("__jacobian_design__") * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check # <<<<<<<<<<<<<< * (jacobian, args, kargs) = context * jacobian(tao, x, J, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L6_bool_binop_done; } __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_4; __pyx_L6_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 379, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":380 * if context is None and ctx != NULL: context = ctx * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context # <<<<<<<<<<<<<< * jacobian(tao, x, J, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 380, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 380, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 380, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":381 * assert context is not None and type(context) is tuple # sanity check * (jacobian, args, kargs) = context * jacobian(tao, x, J, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __Pyx_GIVEREF(((PyObject *)__pyx_v_x)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_x)); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_J)); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 381, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_5 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_jacobian, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":382 * (jacobian, args, kargs) = context * jacobian(tao, x, J, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_Converged(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":370 * return 0 * * cdef int TAO_JacobianDesign(PetscTAO _tao, # <<<<<<<<<<<<<< * PetscVec _x, * PetscMat _J, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_JacobianDesign", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":384 * return 0 * * cdef int TAO_Converged(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * # call first the default convergence test */ static int __pyx_f_8petsc4py_5PETSc_TAO_Converged(Tao __pyx_v__tao, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; PyObject *__pyx_v_converged = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_reason = NULL; TaoConvergedReason __pyx_v_creason; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_t_9; int __pyx_t_10; int __pyx_t_11; TaoConvergedReason __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Converged", 0); /* "PETSc/petsctao.pxi":387 * void* ctx) except PETSC_ERR_PYTHON with gil: * # call first the default convergence test * CHKERR( TaoDefaultConvergenceTest(_tao, NULL) ) # <<<<<<<<<<<<<< * # call next the user-provided convergence test * cdef TAO tao = ref_TAO(_tao) */ __pyx_t_1 = TaoDefaultConvergenceTest(__pyx_v__tao, NULL); if (unlikely(__pyx_t_1 == ((int)PETSC_ERR_PYTHON))) __PYX_ERR(21, 387, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(21, 387, __pyx_L1_error) /* "PETSc/petsctao.pxi":389 * CHKERR( TaoDefaultConvergenceTest(_tao, NULL) ) * # call next the user-provided convergence test * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * (converged, args, kargs) = tao.get_attr('__converged__') * reason = converged(tao, *args, **kargs) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petsctao.pxi":390 * # call next the user-provided convergence test * cdef TAO tao = ref_TAO(_tao) * (converged, args, kargs) = tao.get_attr('__converged__') # <<<<<<<<<<<<<< * reason = converged(tao, *args, **kargs) * if reason is None: return 0 */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__converged__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 390, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(21, 390, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 390, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_converged = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_args = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":391 * cdef TAO tao = ref_TAO(_tao) * (converged, args, kargs) = tao.get_attr('__converged__') * reason = converged(tao, *args, **kargs) # <<<<<<<<<<<<<< * if reason is None: return 0 * # handle value of convergence reason */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_tao)); __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 391, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_converged, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_reason = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petsctao.pxi":392 * (converged, args, kargs) = tao.get_attr('__converged__') * reason = converged(tao, *args, **kargs) * if reason is None: return 0 # <<<<<<<<<<<<<< * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING */ __pyx_t_9 = (__pyx_v_reason == Py_None); __pyx_t_10 = (__pyx_t_9 != 0); if (__pyx_t_10) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petsctao.pxi":394 * if reason is None: return 0 * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER */ __pyx_v_creason = TAO_CONTINUE_ITERATING; /* "PETSc/petsctao.pxi":395 * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * if reason is False or reason == -1: # <<<<<<<<<<<<<< * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: */ __pyx_t_9 = (__pyx_v_reason == Py_False); __pyx_t_11 = (__pyx_t_9 != 0); if (!__pyx_t_11) { } else { __pyx_t_10 = __pyx_t_11; goto __pyx_L7_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_reason, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(21, 395, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __pyx_t_11; __pyx_L7_bool_binop_done:; if (__pyx_t_10) { /* "PETSc/petsctao.pxi":396 * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER # <<<<<<<<<<<<<< * elif reason is True or reason == 1: * creason = TAO_CONVERGED_USER */ __pyx_v_creason = TAO_DIVERGED_USER; /* "PETSc/petsctao.pxi":395 * # handle value of convergence reason * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * if reason is False or reason == -1: # <<<<<<<<<<<<<< * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: */ goto __pyx_L6; } /* "PETSc/petsctao.pxi":397 * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: # <<<<<<<<<<<<<< * creason = TAO_CONVERGED_USER * else: */ __pyx_t_11 = (__pyx_v_reason == Py_True); __pyx_t_9 = (__pyx_t_11 != 0); if (!__pyx_t_9) { } else { __pyx_t_10 = __pyx_t_9; goto __pyx_L9_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_reason, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(21, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __pyx_t_9; __pyx_L9_bool_binop_done:; if (__pyx_t_10) { /* "PETSc/petsctao.pxi":398 * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: * creason = TAO_CONVERGED_USER # <<<<<<<<<<<<<< * else: * creason = reason */ __pyx_v_creason = TAO_CONVERGED_USER; /* "PETSc/petsctao.pxi":397 * if reason is False or reason == -1: * creason = TAO_DIVERGED_USER * elif reason is True or reason == 1: # <<<<<<<<<<<<<< * creason = TAO_CONVERGED_USER * else: */ goto __pyx_L6; } /* "PETSc/petsctao.pxi":400 * creason = TAO_CONVERGED_USER * else: * creason = reason # <<<<<<<<<<<<<< * assert creason >= TAO_DIVERGED_USER * assert creason <= TAO_CONVERGED_USER */ /*else*/ { __pyx_t_12 = ((TaoConvergedReason)__Pyx_PyInt_As_TaoConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(21, 400, __pyx_L1_error) __pyx_v_creason = __pyx_t_12; /* "PETSc/petsctao.pxi":401 * else: * creason = reason * assert creason >= TAO_DIVERGED_USER # <<<<<<<<<<<<<< * assert creason <= TAO_CONVERGED_USER * CHKERR( TaoSetConvergedReason(_tao, creason) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_creason >= TAO_DIVERGED_USER) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 401, __pyx_L1_error) } } #endif /* "PETSc/petsctao.pxi":402 * creason = reason * assert creason >= TAO_DIVERGED_USER * assert creason <= TAO_CONVERGED_USER # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergedReason(_tao, creason) ) * return 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_creason <= TAO_CONVERGED_USER) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(21, 402, __pyx_L1_error) } } #endif } __pyx_L6:; /* "PETSc/petsctao.pxi":403 * assert creason >= TAO_DIVERGED_USER * assert creason <= TAO_CONVERGED_USER * CHKERR( TaoSetConvergedReason(_tao, creason) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergedReason(__pyx_v__tao, __pyx_v_creason)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(21, 403, __pyx_L1_error) /* "PETSc/petsctao.pxi":404 * assert creason <= TAO_CONVERGED_USER * CHKERR( TaoSetConvergedReason(_tao, creason) ) * return 0 # <<<<<<<<<<<<<< * * cdef int TAO_Monitor(PetscTAO _tao, */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":384 * return 0 * * cdef int TAO_Converged(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * # call first the default convergence test */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Converged", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF(__pyx_v_converged); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_reason); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petsctao.pxi":406 * return 0 * * cdef int TAO_Monitor(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) */ static int __pyx_f_8petsc4py_5PETSc_TAO_Monitor(Tao __pyx_v__tao, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscTAOObject *__pyx_v_tao = 0; PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_monitor = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("TAO_Monitor", 0); /* "PETSc/petsctao.pxi":408 * cdef int TAO_Monitor(PetscTAO _tao, * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) # <<<<<<<<<<<<<< * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TAO(__pyx_v__tao)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":409 * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) * cdef object monitorlist = tao.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_tao->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_tao), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_monitorlist = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":410 * cdef TAO tao = ref_TAO(_tao) * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return 0 # <<<<<<<<<<<<<< * for (monitor, args, kargs) in monitorlist: * monitor(tao, *args, **kargs) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/petsctao.pxi":411 * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(tao, *args, **kargs) * return 0 */ if (likely(PyList_CheckExact(__pyx_v_monitorlist)) || PyTuple_CheckExact(__pyx_v_monitorlist)) { __pyx_t_1 = __pyx_v_monitorlist; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_monitorlist); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 411, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(21, 411, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(21, 411, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(21, 411, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(21, 411, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(21, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(21, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(21, 411, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(21, 411, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petsctao.pxi":412 * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: * monitor(tao, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_tao)); __Pyx_GIVEREF(((PyObject *)__pyx_v_tao)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_tao)); __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_9)) __PYX_ERR(21, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(21, 412, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_9 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_9)) __PYX_ERR(21, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } else { __pyx_t_9 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(21, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_monitor, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petsctao.pxi":411 * cdef object monitorlist = tao.get_attr('__monitor__') * if monitorlist is None: return 0 * for (monitor, args, kargs) in monitorlist: # <<<<<<<<<<<<<< * monitor(tao, *args, **kargs) * return 0 */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petsctao.pxi":413 * for (monitor, args, kargs) in monitorlist: * monitor(tao, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petsctao.pxi":406 * return 0 * * cdef int TAO_Monitor(PetscTAO _tao, # <<<<<<<<<<<<<< * void* ctx) except PETSC_ERR_PYTHON with gil: * cdef TAO tao = ref_TAO(_tao) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.TAO_Monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tao); __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_monitor); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdm.pxi":161 * # -------------------------------------------------------------------- * * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ # <<<<<<<<<<<<<< * except (-1): * if boundary is None: */ static CYTHON_INLINE DMBoundaryType __pyx_f_8petsc4py_5PETSc_asBoundaryType(PyObject *__pyx_v_boundary) { DMBoundaryType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; DMBoundaryType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asBoundaryType", 0); /* "PETSc/petscdm.pxi":163 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ * except (-1): * if boundary is None: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is False: */ __pyx_t_1 = (__pyx_v_boundary == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdm.pxi":164 * except (-1): * if boundary is None: * return DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * if boundary is False: * return DM_BOUNDARY_NONE */ __pyx_r = DM_BOUNDARY_NONE; goto __pyx_L0; /* "PETSc/petscdm.pxi":163 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ * except (-1): * if boundary is None: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is False: */ } /* "PETSc/petscdm.pxi":165 * if boundary is None: * return DM_BOUNDARY_NONE * if boundary is False: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is True: */ __pyx_t_2 = (__pyx_v_boundary == Py_False); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscdm.pxi":166 * return DM_BOUNDARY_NONE * if boundary is False: * return DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * if boundary is True: * return DM_BOUNDARY_PERIODIC */ __pyx_r = DM_BOUNDARY_NONE; goto __pyx_L0; /* "PETSc/petscdm.pxi":165 * if boundary is None: * return DM_BOUNDARY_NONE * if boundary is False: # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * if boundary is True: */ } /* "PETSc/petscdm.pxi":167 * if boundary is False: * return DM_BOUNDARY_NONE * if boundary is True: # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): */ __pyx_t_1 = (__pyx_v_boundary == Py_True); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdm.pxi":168 * return DM_BOUNDARY_NONE * if boundary is True: * return DM_BOUNDARY_PERIODIC # <<<<<<<<<<<<<< * if isinstance(boundary, str): * if boundary == 'none': */ __pyx_r = DM_BOUNDARY_PERIODIC; goto __pyx_L0; /* "PETSc/petscdm.pxi":167 * if boundary is False: * return DM_BOUNDARY_NONE * if boundary is True: # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): */ } /* "PETSc/petscdm.pxi":169 * if boundary is True: * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): # <<<<<<<<<<<<<< * if boundary == 'none': * return DM_BOUNDARY_NONE */ __pyx_t_2 = PyString_Check(__pyx_v_boundary); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscdm.pxi":170 * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): * if boundary == 'none': # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(22, 170, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/petscdm.pxi":171 * if isinstance(boundary, str): * if boundary == 'none': * return DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED */ __pyx_r = DM_BOUNDARY_NONE; goto __pyx_L0; /* "PETSc/petscdm.pxi":170 * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): * if boundary == 'none': # <<<<<<<<<<<<<< * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': */ } /* "PETSc/petscdm.pxi":172 * if boundary == 'none': * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': # <<<<<<<<<<<<<< * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_ghosted, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(22, 172, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/petscdm.pxi":173 * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED # <<<<<<<<<<<<<< * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR */ __pyx_r = DM_BOUNDARY_GHOSTED; goto __pyx_L0; /* "PETSc/petscdm.pxi":172 * if boundary == 'none': * return DM_BOUNDARY_NONE * elif boundary == 'ghosted': # <<<<<<<<<<<<<< * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': */ } /* "PETSc/petscdm.pxi":174 * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': # <<<<<<<<<<<<<< * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_mirror, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(22, 174, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/petscdm.pxi":175 * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR # <<<<<<<<<<<<<< * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC */ __pyx_r = DM_BOUNDARY_MIRROR; goto __pyx_L0; /* "PETSc/petscdm.pxi":174 * elif boundary == 'ghosted': * return DM_BOUNDARY_GHOSTED * elif boundary == 'mirror': # <<<<<<<<<<<<<< * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': */ } /* "PETSc/petscdm.pxi":176 * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_periodic, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(22, 176, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/petscdm.pxi":177 * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC # <<<<<<<<<<<<<< * elif boundary == 'twist': * return DM_BOUNDARY_TWIST */ __pyx_r = DM_BOUNDARY_PERIODIC; goto __pyx_L0; /* "PETSc/petscdm.pxi":176 * elif boundary == 'mirror': * return DM_BOUNDARY_MIRROR * elif boundary == 'periodic': # <<<<<<<<<<<<<< * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': */ } /* "PETSc/petscdm.pxi":178 * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': # <<<<<<<<<<<<<< * return DM_BOUNDARY_TWIST * else: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_boundary, __pyx_n_s_twist, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(22, 178, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "PETSc/petscdm.pxi":179 * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': * return DM_BOUNDARY_TWIST # <<<<<<<<<<<<<< * else: * raise ValueError("unknown boundary type: %s" % boundary) */ __pyx_r = DM_BOUNDARY_TWIST; goto __pyx_L0; /* "PETSc/petscdm.pxi":178 * elif boundary == 'periodic': * return DM_BOUNDARY_PERIODIC * elif boundary == 'twist': # <<<<<<<<<<<<<< * return DM_BOUNDARY_TWIST * else: */ } /* "PETSc/petscdm.pxi":181 * return DM_BOUNDARY_TWIST * else: * raise ValueError("unknown boundary type: %s" % boundary) # <<<<<<<<<<<<<< * return boundary * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_boundary_type_s, __pyx_v_boundary); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(22, 181, __pyx_L1_error) } /* "PETSc/petscdm.pxi":169 * if boundary is True: * return DM_BOUNDARY_PERIODIC * if isinstance(boundary, str): # <<<<<<<<<<<<<< * if boundary == 'none': * return DM_BOUNDARY_NONE */ } /* "PETSc/petscdm.pxi":182 * else: * raise ValueError("unknown boundary type: %s" % boundary) * return boundary # <<<<<<<<<<<<<< * * cdef inline PetscInt asBoundary(object boundary, */ __pyx_t_5 = ((DMBoundaryType)__Pyx_PyInt_As_DMBoundaryType(__pyx_v_boundary)); if (unlikely(PyErr_Occurred())) __PYX_ERR(22, 182, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscdm.pxi":161 * # -------------------------------------------------------------------- * * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \ # <<<<<<<<<<<<<< * except (-1): * if boundary is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.asBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMBoundaryType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdm.pxi":184 * return boundary * * cdef inline PetscInt asBoundary(object boundary, # <<<<<<<<<<<<<< * PetscDMBoundaryType *_x, * PetscDMBoundaryType *_y, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asBoundary(PyObject *__pyx_v_boundary, DMBoundaryType *__pyx_v__x, DMBoundaryType *__pyx_v__y, DMBoundaryType *__pyx_v__z) { PetscInt __pyx_v_dim; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_z = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; DMBoundaryType __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asBoundary", 0); __Pyx_INCREF(__pyx_v_boundary); /* "PETSc/petscdm.pxi":188 * PetscDMBoundaryType *_y, * PetscDMBoundaryType *_z) except -1: * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef object x=None, y=None, z=None * if (boundary is None or */ __pyx_v_dim = 0; /* "PETSc/petscdm.pxi":189 * PetscDMBoundaryType *_z) except -1: * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None # <<<<<<<<<<<<<< * if (boundary is None or * isinstance(boundary, str) or */ __Pyx_INCREF(Py_None); __pyx_v_x = Py_None; __Pyx_INCREF(Py_None); __pyx_v_y = Py_None; __Pyx_INCREF(Py_None); __pyx_v_z = Py_None; /* "PETSc/petscdm.pxi":190 * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None * if (boundary is None or # <<<<<<<<<<<<<< * isinstance(boundary, str) or * isinstance(boundary, int)): */ __pyx_t_2 = (__pyx_v_boundary == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } /* "PETSc/petscdm.pxi":191 * cdef object x=None, y=None, z=None * if (boundary is None or * isinstance(boundary, str) or # <<<<<<<<<<<<<< * isinstance(boundary, int)): * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) */ __pyx_t_3 = PyString_Check(__pyx_v_boundary); __pyx_t_2 = (__pyx_t_3 != 0); if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } /* "PETSc/petscdm.pxi":192 * if (boundary is None or * isinstance(boundary, str) or * isinstance(boundary, int)): # <<<<<<<<<<<<<< * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_IsInstance(__pyx_v_boundary, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(22, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__pyx_t_2 != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; /* "PETSc/petscdm.pxi":190 * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None * if (boundary is None or # <<<<<<<<<<<<<< * isinstance(boundary, str) or * isinstance(boundary, int)): */ if (__pyx_t_1) { /* "PETSc/petscdm.pxi":193 * isinstance(boundary, str) or * isinstance(boundary, int)): * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) # <<<<<<<<<<<<<< * else: * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_boundary); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(22, 193, __pyx_L1_error) (__pyx_v__x[0]) = __pyx_t_5; (__pyx_v__y[0]) = __pyx_t_5; (__pyx_v__z[0]) = __pyx_t_5; /* "PETSc/petscdm.pxi":190 * cdef PetscInt dim = 0 * cdef object x=None, y=None, z=None * if (boundary is None or # <<<<<<<<<<<<<< * isinstance(boundary, str) or * isinstance(boundary, int)): */ goto __pyx_L3; } /* "PETSc/petscdm.pxi":195 * _x[0] = _y[0] = _z[0] = asBoundaryType(boundary) * else: * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * boundary = tuple(boundary) * dim = len(boundary) */ /*else*/ { (__pyx_v__x[0]) = DM_BOUNDARY_NONE; (__pyx_v__y[0]) = DM_BOUNDARY_NONE; (__pyx_v__z[0]) = DM_BOUNDARY_NONE; /* "PETSc/petscdm.pxi":196 * else: * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE * boundary = tuple(boundary) # <<<<<<<<<<<<<< * dim = len(boundary) * if dim == 0: pass */ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_boundary); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_boundary, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdm.pxi":197 * _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE * boundary = tuple(boundary) * dim = len(boundary) # <<<<<<<<<<<<<< * if dim == 0: pass * elif dim == 1: (x,) = boundary */ __pyx_t_6 = PyObject_Length(__pyx_v_boundary); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(22, 197, __pyx_L1_error) __pyx_v_dim = ((PetscInt)__pyx_t_6); /* "PETSc/petscdm.pxi":198 * boundary = tuple(boundary) * dim = len(boundary) * if dim == 0: pass # <<<<<<<<<<<<<< * elif dim == 1: (x,) = boundary * elif dim == 2: (x, y) = boundary */ __pyx_t_1 = ((__pyx_v_dim == 0) != 0); if (__pyx_t_1) { goto __pyx_L7; } /* "PETSc/petscdm.pxi":199 * dim = len(boundary) * if dim == 0: pass * elif dim == 1: (x,) = boundary # <<<<<<<<<<<<<< * elif dim == 2: (x, y) = boundary * elif dim == 3: (x, y, z) = boundary */ __pyx_t_1 = ((__pyx_v_dim == 1) != 0); if (__pyx_t_1) { if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) { PyObject* sequence = __pyx_v_boundary; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 1)) { if (size > 1) __Pyx_RaiseTooManyValuesError(1); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 199, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_4); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 1) < 0) __PYX_ERR(22, 199, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 199, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7; } /* "PETSc/petscdm.pxi":200 * if dim == 0: pass * elif dim == 1: (x,) = boundary * elif dim == 2: (x, y) = boundary # <<<<<<<<<<<<<< * elif dim == 3: (x, y, z) = boundary * if dim >= 1: _x[0] = asBoundaryType(x) */ __pyx_t_1 = ((__pyx_v_dim == 2) != 0); if (__pyx_t_1) { if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) { PyObject* sequence = __pyx_v_boundary; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 200, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_9), 2) < 0) __PYX_ERR(22, 200, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_unpacking_done; __pyx_L10_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 200, __pyx_L1_error) __pyx_L11_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7; } /* "PETSc/petscdm.pxi":201 * elif dim == 1: (x,) = boundary * elif dim == 2: (x, y) = boundary * elif dim == 3: (x, y, z) = boundary # <<<<<<<<<<<<<< * if dim >= 1: _x[0] = asBoundaryType(x) * if dim >= 2: _y[0] = asBoundaryType(y) */ __pyx_t_1 = ((__pyx_v_dim == 3) != 0); if (__pyx_t_1) { if ((likely(PyTuple_CheckExact(__pyx_v_boundary))) || (PyList_CheckExact(__pyx_v_boundary))) { PyObject* sequence = __pyx_v_boundary; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 201, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_10)) __PYX_ERR(22, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 2; __pyx_t_9 = __pyx_t_8(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 3) < 0) __PYX_ERR(22, 201, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L13_unpacking_done; __pyx_L12_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 201, __pyx_L1_error) __pyx_L13_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_9); __pyx_t_9 = 0; } __pyx_L7:; /* "PETSc/petscdm.pxi":202 * elif dim == 2: (x, y) = boundary * elif dim == 3: (x, y, z) = boundary * if dim >= 1: _x[0] = asBoundaryType(x) # <<<<<<<<<<<<<< * if dim >= 2: _y[0] = asBoundaryType(y) * if dim >= 3: _z[0] = asBoundaryType(z) */ __pyx_t_1 = ((__pyx_v_dim >= 1) != 0); if (__pyx_t_1) { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_x); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(22, 202, __pyx_L1_error) (__pyx_v__x[0]) = __pyx_t_5; } /* "PETSc/petscdm.pxi":203 * elif dim == 3: (x, y, z) = boundary * if dim >= 1: _x[0] = asBoundaryType(x) * if dim >= 2: _y[0] = asBoundaryType(y) # <<<<<<<<<<<<<< * if dim >= 3: _z[0] = asBoundaryType(z) * return dim */ __pyx_t_1 = ((__pyx_v_dim >= 2) != 0); if (__pyx_t_1) { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_y); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(22, 203, __pyx_L1_error) (__pyx_v__y[0]) = __pyx_t_5; } /* "PETSc/petscdm.pxi":204 * if dim >= 1: _x[0] = asBoundaryType(x) * if dim >= 2: _y[0] = asBoundaryType(y) * if dim >= 3: _z[0] = asBoundaryType(z) # <<<<<<<<<<<<<< * return dim * */ __pyx_t_1 = ((__pyx_v_dim >= 3) != 0); if (__pyx_t_1) { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_z); if (unlikely(__pyx_t_5 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(22, 204, __pyx_L1_error) (__pyx_v__z[0]) = __pyx_t_5; } } __pyx_L3:; /* "PETSc/petscdm.pxi":205 * if dim >= 2: _y[0] = asBoundaryType(y) * if dim >= 3: _z[0] = asBoundaryType(z) * return dim # <<<<<<<<<<<<<< * * cdef inline object toBoundary(PetscInt dim, */ __pyx_r = __pyx_v_dim; goto __pyx_L0; /* "PETSc/petscdm.pxi":184 * return boundary * * cdef inline PetscInt asBoundary(object boundary, # <<<<<<<<<<<<<< * PetscDMBoundaryType *_x, * PetscDMBoundaryType *_y, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.asBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_z); __Pyx_XDECREF(__pyx_v_boundary); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdm.pxi":207 * return dim * * cdef inline object toBoundary(PetscInt dim, # <<<<<<<<<<<<<< * PetscDMBoundaryType x, * PetscDMBoundaryType y, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toBoundary(PetscInt __pyx_v_dim, DMBoundaryType __pyx_v_x, DMBoundaryType __pyx_v_y, DMBoundaryType __pyx_v_z) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toBoundary", 0); /* "PETSc/petscdm.pxi":211 * PetscDMBoundaryType y, * PetscDMBoundaryType z): * if dim == 0: return () # <<<<<<<<<<<<<< * elif dim == 1: return (x,) * elif dim == 2: return (x, y) */ __pyx_t_1 = ((__pyx_v_dim == 0) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; } /* "PETSc/petscdm.pxi":212 * PetscDMBoundaryType z): * if dim == 0: return () * elif dim == 1: return (x,) # <<<<<<<<<<<<<< * elif dim == 2: return (x, y) * elif dim == 3: return (x, y, z) */ __pyx_t_1 = ((__pyx_v_dim == 1) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscdm.pxi":213 * if dim == 0: return () * elif dim == 1: return (x,) * elif dim == 2: return (x, y) # <<<<<<<<<<<<<< * elif dim == 3: return (x, y, z) * */ __pyx_t_1 = ((__pyx_v_dim == 2) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "PETSc/petscdm.pxi":214 * elif dim == 1: return (x,) * elif dim == 2: return (x, y) * elif dim == 3: return (x, y, z) # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_t_1 = ((__pyx_v_dim == 3) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_DMBoundaryType(__pyx_v_z); if (unlikely(!__pyx_t_3)) __PYX_ERR(22, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/petscdm.pxi":207 * return dim * * cdef inline object toBoundary(PetscInt dim, # <<<<<<<<<<<<<< * PetscDMBoundaryType x, * PetscDMBoundaryType y, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdm.pxi":218 * # ----------------------------------------------------------------------------- * * cdef inline DM ref_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef DM ob = DM() * ob.dm = dm */ static CYTHON_INLINE struct PyPetscDMObject *__pyx_f_8petsc4py_5PETSc_ref_DM(DM __pyx_v_dm) { struct PyPetscDMObject *__pyx_v_ob = 0; struct PyPetscDMObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ref_DM", 0); /* "PETSc/petscdm.pxi":219 * * cdef inline DM ref_DM(PetscDM dm): * cdef DM ob = DM() # <<<<<<<<<<<<<< * ob.dm = dm * PetscINCREF(ob.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ob = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdm.pxi":220 * cdef inline DM ref_DM(PetscDM dm): * cdef DM ob = DM() * ob.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(ob.obj) * return ob */ __pyx_v_ob->dm = __pyx_v_dm; /* "PETSc/petscdm.pxi":221 * cdef DM ob = DM() * ob.dm = dm * PetscINCREF(ob.obj) # <<<<<<<<<<<<<< * return ob * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); /* "PETSc/petscdm.pxi":222 * ob.dm = dm * PetscINCREF(ob.obj) * return ob # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); __pyx_r = __pyx_v_ob; goto __pyx_L0; /* "PETSc/petscdm.pxi":218 * # ----------------------------------------------------------------------------- * * cdef inline DM ref_DM(PetscDM dm): # <<<<<<<<<<<<<< * cdef DM ob = DM() * ob.dm = dm */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ref_DM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdm.pxi":226 * # -------------------------------------------------------------------- * * cdef int DM_PyCoarsenHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscDM coarse, */ static int __pyx_f_8petsc4py_5PETSc_DM_PyCoarsenHook(DM __pyx_v_fine, DM __pyx_v_coarse, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscDMObject *__pyx_v_Fine = 0; struct PyPetscDMObject *__pyx_v_Coarse = 0; PyObject *__pyx_v_hooks = 0; PyObject *__pyx_v_hook = NULL; PyObject *__pyx_v_hookop = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DM_PyCoarsenHook", 0); /* "PETSc/petscdm.pxi":232 * ) except PETSC_ERR_PYTHON with gil: * * cdef DM Fine = ref_DM(fine) # <<<<<<<<<<<<<< * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__coarsenhooks__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_fine)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":233 * * cdef DM Fine = ref_DM(fine) * cdef DM Coarse = ref_DM(coarse) # <<<<<<<<<<<<<< * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_coarse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":234 * cdef DM Fine = ref_DM(fine) * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__coarsenhooks__') # <<<<<<<<<<<<<< * assert hooks is not None and type(hooks) is list * for hook in hooks: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Fine->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Fine), ((char *)"__coarsenhooks__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hooks = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":235 * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list # <<<<<<<<<<<<<< * for hook in hooks: * (hookop, args, kargs) = hook */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = (__pyx_v_hooks != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_hooks)) == ((PyObject *)(&PyList_Type))); __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(22, 235, __pyx_L1_error) } } #endif /* "PETSc/petscdm.pxi":236 * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) */ if (likely(PyList_CheckExact(__pyx_v_hooks)) || PyTuple_CheckExact(__pyx_v_hooks)) { __pyx_t_1 = __pyx_v_hooks; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 236, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(22, 236, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(22, 236, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(22, 236, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscdm.pxi":237 * assert hooks is not None and type(hooks) is list * for hook in hooks: * (hookop, args, kargs) = hook # <<<<<<<<<<<<<< * hookop(Fine, Coarse, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_hook))) || (PyList_CheckExact(__pyx_v_hook))) { PyObject* sequence = __pyx_v_hook; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 237, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_hook); if (unlikely(!__pyx_t_10)) __PYX_ERR(22, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(22, 237, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 237, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_hookop, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscdm.pxi":238 * for hook in hooks: * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_v_Fine)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Fine)); PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_Fine)); __Pyx_INCREF(((PyObject *)__pyx_v_Coarse)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Coarse)); PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_Coarse)); __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(22, 238, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_8 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_8 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_hookop, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscdm.pxi":236 * cdef object hooks = Fine.get_attr('__coarsenhooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":239 * (hookop, args, kargs) = hook * hookop(Fine, Coarse, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int DM_PyRestrictHook( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdm.pxi":226 * # -------------------------------------------------------------------- * * cdef int DM_PyCoarsenHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscDM coarse, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.DM_PyCoarsenHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Fine); __Pyx_XDECREF((PyObject *)__pyx_v_Coarse); __Pyx_XDECREF(__pyx_v_hooks); __Pyx_XDECREF(__pyx_v_hook); __Pyx_XDECREF(__pyx_v_hookop); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdm.pxi":241 * return 0 * * cdef int DM_PyRestrictHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscMat mrestrict, */ static int __pyx_f_8petsc4py_5PETSc_DM_PyRestrictHook(DM __pyx_v_fine, Mat __pyx_v_mrestrict, Vec __pyx_v_rscale, Mat __pyx_v_inject, DM __pyx_v_coarse, CYTHON_UNUSED void *__pyx_v_ctx) { struct PyPetscDMObject *__pyx_v_Fine = 0; struct PyPetscMatObject *__pyx_v_Mrestrict = 0; struct PyPetscVecObject *__pyx_v_Rscale = 0; struct PyPetscMatObject *__pyx_v_Inject = 0; struct PyPetscDMObject *__pyx_v_Coarse = 0; PyObject *__pyx_v_hooks = 0; PyObject *__pyx_v_hook = NULL; PyObject *__pyx_v_hookop = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *(*__pyx_t_11)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DM_PyRestrictHook", 0); /* "PETSc/petscdm.pxi":250 * ) except PETSC_ERR_PYTHON with gil: * * cdef DM Fine = ref_DM(fine) # <<<<<<<<<<<<<< * cdef Mat Mrestrict = ref_Mat(mrestrict) * cdef Vec Rscale = ref_Vec(rscale) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_fine)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":251 * * cdef DM Fine = ref_DM(fine) * cdef Mat Mrestrict = ref_Mat(mrestrict) # <<<<<<<<<<<<<< * cdef Vec Rscale = ref_Vec(rscale) * cdef Mat Inject = ref_Mat(inject) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_mrestrict)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Mrestrict = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":252 * cdef DM Fine = ref_DM(fine) * cdef Mat Mrestrict = ref_Mat(mrestrict) * cdef Vec Rscale = ref_Vec(rscale) # <<<<<<<<<<<<<< * cdef Mat Inject = ref_Mat(inject) * cdef DM Coarse = ref_DM(coarse) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rscale)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Rscale = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":253 * cdef Mat Mrestrict = ref_Mat(mrestrict) * cdef Vec Rscale = ref_Vec(rscale) * cdef Mat Inject = ref_Mat(inject) # <<<<<<<<<<<<<< * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__restricthooks__') */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_inject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Inject = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":254 * cdef Vec Rscale = ref_Vec(rscale) * cdef Mat Inject = ref_Mat(inject) * cdef DM Coarse = ref_DM(coarse) # <<<<<<<<<<<<<< * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_DM(__pyx_v_coarse)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":255 * cdef Mat Inject = ref_Mat(inject) * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__restricthooks__') # <<<<<<<<<<<<<< * assert hooks is not None and type(hooks) is list * for hook in hooks: */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Fine->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Fine), ((char *)"__restricthooks__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_hooks = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":256 * cdef DM Coarse = ref_DM(coarse) * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list # <<<<<<<<<<<<<< * for hook in hooks: * (hookop, args, kargs) = hook */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = (__pyx_v_hooks != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_hooks)) == ((PyObject *)(&PyList_Type))); __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(22, 256, __pyx_L1_error) } } #endif /* "PETSc/petscdm.pxi":257 * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) */ if (likely(PyList_CheckExact(__pyx_v_hooks)) || PyTuple_CheckExact(__pyx_v_hooks)) { __pyx_t_1 = __pyx_v_hooks; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_hooks); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 257, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(22, 257, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(22, 257, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(22, 257, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscdm.pxi":258 * assert hooks is not None and type(hooks) is list * for hook in hooks: * (hookop, args, kargs) = hook # <<<<<<<<<<<<<< * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_hook))) || (PyList_CheckExact(__pyx_v_hook))) { PyObject* sequence = __pyx_v_hook; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(22, 258, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { Py_ssize_t index = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_hook); if (unlikely(!__pyx_t_10)) __PYX_ERR(22, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) __PYX_ERR(22, 258, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(22, 258, __pyx_L1_error) __pyx_L8_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_hookop, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_args, __pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_kargs, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscdm.pxi":259 * for hook in hooks: * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * # ----------------------------------------------------------------------------- */ __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(((PyObject *)__pyx_v_Fine)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Fine)); PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_Fine)); __Pyx_INCREF(((PyObject *)__pyx_v_Mrestrict)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Mrestrict)); PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_Mrestrict)); __Pyx_INCREF(((PyObject *)__pyx_v_Rscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Rscale)); PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_v_Rscale)); __Pyx_INCREF(((PyObject *)__pyx_v_Inject)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Inject)); PyTuple_SET_ITEM(__pyx_t_9, 3, ((PyObject *)__pyx_v_Inject)); __Pyx_INCREF(((PyObject *)__pyx_v_Coarse)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Coarse)); PyTuple_SET_ITEM(__pyx_t_9, 4, ((PyObject *)__pyx_v_Coarse)); __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(22, 259, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_8 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } else { __pyx_t_8 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); } __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_hookop, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(22, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscdm.pxi":257 * cdef object hooks = Fine.get_attr('__restricthooks__') * assert hooks is not None and type(hooks) is list * for hook in hooks: # <<<<<<<<<<<<<< * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdm.pxi":260 * (hookop, args, kargs) = hook * hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * # ----------------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdm.pxi":241 * return 0 * * cdef int DM_PyRestrictHook( # <<<<<<<<<<<<<< * PetscDM fine, * PetscMat mrestrict, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.DM_PyRestrictHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Fine); __Pyx_XDECREF((PyObject *)__pyx_v_Mrestrict); __Pyx_XDECREF((PyObject *)__pyx_v_Rscale); __Pyx_XDECREF((PyObject *)__pyx_v_Inject); __Pyx_XDECREF((PyObject *)__pyx_v_Coarse); __Pyx_XDECREF(__pyx_v_hooks); __Pyx_XDECREF(__pyx_v_hook); __Pyx_XDECREF(__pyx_v_hookop); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmda.pxi":88 * # -------------------------------------------------------------------- * * cdef inline PetscDMDAStencilType asStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ static CYTHON_INLINE DMDAStencilType __pyx_f_8petsc4py_5PETSc_asStencil(PyObject *__pyx_v_stencil) { DMDAStencilType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; DMDAStencilType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStencil", 0); /* "PETSc/petscdmda.pxi":90 * cdef inline PetscDMDAStencilType asStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX */ __pyx_t_1 = PyString_Check(__pyx_v_stencil); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdmda.pxi":91 * except (-1): * if isinstance(stencil, str): * if stencil == "star": return DMDA_STENCIL_STAR # <<<<<<<<<<<<<< * elif stencil == "box": return DMDA_STENCIL_BOX * else: raise ValueError("unknown stencil type: %s" % stencil) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_star, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(8, 91, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMDA_STENCIL_STAR; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":92 * if isinstance(stencil, str): * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_box, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(8, 92, __pyx_L1_error) if (likely(__pyx_t_2)) { __pyx_r = DMDA_STENCIL_BOX; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":93 * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX * else: raise ValueError("unknown stencil type: %s" % stencil) # <<<<<<<<<<<<<< * return stencil * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(8, 93, __pyx_L1_error) } /* "PETSc/petscdmda.pxi":90 * cdef inline PetscDMDAStencilType asStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMDA_STENCIL_STAR * elif stencil == "box": return DMDA_STENCIL_BOX */ } /* "PETSc/petscdmda.pxi":94 * elif stencil == "box": return DMDA_STENCIL_BOX * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil # <<<<<<<<<<<<<< * * cdef inline object toStencil(PetscDMDAStencilType stype): */ __pyx_t_5 = ((DMDAStencilType)__Pyx_PyInt_As_DMDAStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 94, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscdmda.pxi":88 * # -------------------------------------------------------------------- * * cdef inline PetscDMDAStencilType asStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.asStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMDAStencilType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":96 * return stencil * * cdef inline object toStencil(PetscDMDAStencilType stype): # <<<<<<<<<<<<<< * if stype == DMDA_STENCIL_STAR: return "star" * elif stype == DMDA_STENCIL_BOX: return "box" */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStencil(DMDAStencilType __pyx_v_stype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("toStencil", 0); /* "PETSc/petscdmda.pxi":97 * * cdef inline object toStencil(PetscDMDAStencilType stype): * if stype == DMDA_STENCIL_STAR: return "star" # <<<<<<<<<<<<<< * elif stype == DMDA_STENCIL_BOX: return "box" * */ __pyx_t_1 = ((__pyx_v_stype == DMDA_STENCIL_STAR) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_star); __pyx_r = __pyx_n_s_star; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":98 * cdef inline object toStencil(PetscDMDAStencilType stype): * if stype == DMDA_STENCIL_STAR: return "star" * elif stype == DMDA_STENCIL_BOX: return "box" # <<<<<<<<<<<<<< * * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ */ __pyx_t_1 = ((__pyx_v_stype == DMDA_STENCIL_BOX) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_box); __pyx_r = __pyx_n_s_box; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":96 * return stencil * * cdef inline object toStencil(PetscDMDAStencilType stype): # <<<<<<<<<<<<<< * if stype == DMDA_STENCIL_STAR: return "star" * elif stype == DMDA_STENCIL_BOX: return "box" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":100 * elif stype == DMDA_STENCIL_BOX: return "box" * * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(itype, str)): */ static CYTHON_INLINE DMDAInterpolationType __pyx_f_8petsc4py_5PETSc_dainterpolationtype(PyObject *__pyx_v_itype) { DMDAInterpolationType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; DMDAInterpolationType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dainterpolationtype", 0); /* "PETSc/petscdmda.pxi":102 * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ * except (-1): * if (isinstance(itype, str)): # <<<<<<<<<<<<<< * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 */ __pyx_t_1 = PyString_Check(__pyx_v_itype); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdmda.pxi":103 * except (-1): * if (isinstance(itype, str)): * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 # <<<<<<<<<<<<<< * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 * else: raise ValueError("unknown interpolation type: %s" % itype) */ __Pyx_INCREF(__pyx_v_itype); __pyx_t_3 = __pyx_v_itype; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_q0, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(8, 103, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Q0, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(8, 103, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_r = DMDA_Q0; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":104 * if (isinstance(itype, str)): * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 # <<<<<<<<<<<<<< * else: raise ValueError("unknown interpolation type: %s" % itype) * return itype */ __Pyx_INCREF(__pyx_v_itype); __pyx_t_3 = __pyx_v_itype; __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(8, 104, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(8, 104, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__pyx_t_1 != 0); if (likely(__pyx_t_2)) { __pyx_r = DMDA_Q1; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":105 * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 * else: raise ValueError("unknown interpolation type: %s" % itype) # <<<<<<<<<<<<<< * return itype * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_interpolation_type_s, __pyx_v_itype); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(8, 105, __pyx_L1_error) } /* "PETSc/petscdmda.pxi":102 * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ * except (-1): * if (isinstance(itype, str)): # <<<<<<<<<<<<<< * if itype in ("q0", "Q0"): return DMDA_INTERPOLATION_Q0 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 */ } /* "PETSc/petscdmda.pxi":106 * if itype in ("q1", "Q1"): return DMDA_INTERPOLATION_Q1 * else: raise ValueError("unknown interpolation type: %s" % itype) * return itype # <<<<<<<<<<<<<< * * cdef inline PetscDMDAElementType daelementtype(object etype) \ */ __pyx_t_5 = ((DMDAInterpolationType)__Pyx_PyInt_As_DMDAInterpolationType(__pyx_v_itype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 106, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscdmda.pxi":100 * elif stype == DMDA_STENCIL_BOX: return "box" * * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(itype, str)): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.dainterpolationtype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMDAInterpolationType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":108 * return itype * * cdef inline PetscDMDAElementType daelementtype(object etype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(etype, str)): */ static CYTHON_INLINE DMDAElementType __pyx_f_8petsc4py_5PETSc_daelementtype(PyObject *__pyx_v_etype) { DMDAElementType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; DMDAElementType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("daelementtype", 0); /* "PETSc/petscdmda.pxi":110 * cdef inline PetscDMDAElementType daelementtype(object etype) \ * except (-1): * if (isinstance(etype, str)): # <<<<<<<<<<<<<< * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 */ __pyx_t_1 = PyString_Check(__pyx_v_etype); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdmda.pxi":111 * except (-1): * if (isinstance(etype, str)): * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 # <<<<<<<<<<<<<< * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 * else: raise ValueError("unknown element type: %s" % etype) */ __Pyx_INCREF(__pyx_v_etype); __pyx_t_3 = __pyx_v_etype; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_p1, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(8, 111, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_P1, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(8, 111, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_r = DMDA_ELEMENT_P1; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":112 * if (isinstance(etype, str)): * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 # <<<<<<<<<<<<<< * else: raise ValueError("unknown element type: %s" % etype) * return etype */ __Pyx_INCREF(__pyx_v_etype); __pyx_t_3 = __pyx_v_etype; __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(8, 112, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L8_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Q1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(8, 112, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__pyx_t_1 != 0); if (likely(__pyx_t_2)) { __pyx_r = DMDA_ELEMENT_Q1; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":113 * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 * else: raise ValueError("unknown element type: %s" % etype) # <<<<<<<<<<<<<< * return etype * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_element_type_s, __pyx_v_etype); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(8, 113, __pyx_L1_error) } /* "PETSc/petscdmda.pxi":110 * cdef inline PetscDMDAElementType daelementtype(object etype) \ * except (-1): * if (isinstance(etype, str)): # <<<<<<<<<<<<<< * if etype in ("p1", "P1"): return DMDA_ELEMENT_P1 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 */ } /* "PETSc/petscdmda.pxi":114 * if etype in ("q1", "Q1"): return DMDA_ELEMENT_Q1 * else: raise ValueError("unknown element type: %s" % etype) * return etype # <<<<<<<<<<<<<< * * cdef inline int DMDAGetDim(PetscDM da, PetscInt *dim) nogil: */ __pyx_t_5 = ((DMDAElementType)__Pyx_PyInt_As_DMDAElementType(__pyx_v_etype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 114, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscdmda.pxi":108 * return itype * * cdef inline PetscDMDAElementType daelementtype(object etype) \ # <<<<<<<<<<<<<< * except (-1): * if (isinstance(etype, str)): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.daelementtype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMDAElementType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":116 * return etype * * cdef inline int DMDAGetDim(PetscDM da, PetscInt *dim) nogil: # <<<<<<<<<<<<<< * return DMDAGetInfo(da, dim, * NULL, NULL, NULL, */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_DMDAGetDim(DM __pyx_v_da, PetscInt *__pyx_v_dim) { int __pyx_r; /* "PETSc/petscdmda.pxi":117 * * cdef inline int DMDAGetDim(PetscDM da, PetscInt *dim) nogil: * return DMDAGetInfo(da, dim, # <<<<<<<<<<<<<< * NULL, NULL, NULL, * NULL, NULL, NULL, */ __pyx_r = DMDAGetInfo(__pyx_v_da, __pyx_v_dim, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); goto __pyx_L0; /* "PETSc/petscdmda.pxi":116 * return etype * * cdef inline int DMDAGetDim(PetscDM da, PetscInt *dim) nogil: # <<<<<<<<<<<<<< * return DMDAGetInfo(da, dim, * NULL, NULL, NULL, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/petscdmda.pxi":124 * NULL) * * cdef inline PetscInt asDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDims(PyObject *__pyx_v_dims, PetscInt *__pyx_v__M, PetscInt *__pyx_v__N, PetscInt *__pyx_v__P) { PetscInt __pyx_v_dim; PyObject *__pyx_v_M = 0; PyObject *__pyx_v_N = 0; PyObject *__pyx_v_P = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PetscInt __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asDims", 0); __Pyx_INCREF(__pyx_v_dims); /* "PETSc/petscdmda.pxi":128 * PetscInt *_N, * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object M=None, N=None, P=None * dims = tuple(dims) */ __pyx_v_dim = PETSC_DECIDE; /* "PETSc/petscdmda.pxi":129 * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None # <<<<<<<<<<<<<< * dims = tuple(dims) * dim = len(dims) */ __Pyx_INCREF(Py_None); __pyx_v_M = Py_None; __Pyx_INCREF(Py_None); __pyx_v_N = Py_None; __Pyx_INCREF(Py_None); __pyx_v_P = Py_None; /* "PETSc/petscdmda.pxi":130 * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None * dims = tuple(dims) # <<<<<<<<<<<<<< * dim = len(dims) * if dim == 0: pass */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dims, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmda.pxi":131 * cdef object M=None, N=None, P=None * dims = tuple(dims) * dim = len(dims) # <<<<<<<<<<<<<< * if dim == 0: pass * elif dim == 1: M, = dims */ __pyx_t_2 = PyObject_Length(__pyx_v_dims); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(8, 131, __pyx_L1_error) __pyx_v_dim = ((PetscInt)__pyx_t_2); /* "PETSc/petscdmda.pxi":132 * dims = tuple(dims) * dim = len(dims) * if dim == 0: pass # <<<<<<<<<<<<<< * elif dim == 1: M, = dims * elif dim == 2: M, N = dims */ __pyx_t_3 = ((__pyx_v_dim == 0) != 0); if (__pyx_t_3) { goto __pyx_L3; } /* "PETSc/petscdmda.pxi":133 * dim = len(dims) * if dim == 0: pass * elif dim == 1: M, = dims # <<<<<<<<<<<<<< * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims */ __pyx_t_3 = ((__pyx_v_dim == 1) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 1)) { if (size > 1) __Pyx_RaiseTooManyValuesError(1); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 133, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_1); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 1) < 0) __PYX_ERR(8, 133, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 133, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } /* "PETSc/petscdmda.pxi":134 * if dim == 0: pass * elif dim == 1: M, = dims * elif dim == 2: M, N = dims # <<<<<<<<<<<<<< * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) */ __pyx_t_3 = ((__pyx_v_dim == 2) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 134, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_6), 2) < 0) __PYX_ERR(8, 134, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 134, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } /* "PETSc/petscdmda.pxi":135 * elif dim == 1: M, = dims * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims # <<<<<<<<<<<<<< * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) */ __pyx_t_3 = ((__pyx_v_dim == 3) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(8, 135, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_7), 3) < 0) __PYX_ERR(8, 135, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(8, 135, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_P, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:; /* "PETSc/petscdmda.pxi":136 * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) # <<<<<<<<<<<<<< * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) */ __pyx_t_3 = ((__pyx_v_dim >= 1) != 0); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_M); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(8, 136, __pyx_L1_error) (__pyx_v__M[0]) = __pyx_t_8; } /* "PETSc/petscdmda.pxi":137 * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) # <<<<<<<<<<<<<< * if dim >= 3: _P[0] = asInt(P) * return dim */ __pyx_t_3 = ((__pyx_v_dim >= 2) != 0); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_N); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(8, 137, __pyx_L1_error) (__pyx_v__N[0]) = __pyx_t_8; } /* "PETSc/petscdmda.pxi":138 * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) # <<<<<<<<<<<<<< * return dim * */ __pyx_t_3 = ((__pyx_v_dim >= 3) != 0); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_P); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(8, 138, __pyx_L1_error) (__pyx_v__P[0]) = __pyx_t_8; } /* "PETSc/petscdmda.pxi":139 * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) * return dim # <<<<<<<<<<<<<< * * cdef inline tuple toDims(PetscInt dim, */ __pyx_r = __pyx_v_dim; goto __pyx_L0; /* "PETSc/petscdmda.pxi":124 * NULL) * * cdef inline PetscInt asDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.asDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_M); __Pyx_XDECREF(__pyx_v_N); __Pyx_XDECREF(__pyx_v_P); __Pyx_XDECREF(__pyx_v_dims); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":141 * return dim * * cdef inline tuple toDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDims(PetscInt __pyx_v_dim, PetscInt __pyx_v_M, PetscInt __pyx_v_N, PetscInt __pyx_v_P) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDims", 0); /* "PETSc/petscdmda.pxi":145 * PetscInt N, * PetscInt P): * if dim == 0: return () # <<<<<<<<<<<<<< * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) */ __pyx_t_1 = ((__pyx_v_dim == 0) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":146 * PetscInt P): * if dim == 0: return () * elif dim == 1: return (toInt(M),) # <<<<<<<<<<<<<< * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) */ __pyx_t_1 = ((__pyx_v_dim == 1) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":147 * if dim == 0: return () * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) # <<<<<<<<<<<<<< * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * */ __pyx_t_1 = ((__pyx_v_dim == 2) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":148 * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) # <<<<<<<<<<<<<< * * cdef inline tuple asOwnershipRanges(object ownership_ranges, */ __pyx_t_1 = ((__pyx_v_dim == 3) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_P); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/petscdmda.pxi":141 * return dim * * cdef inline tuple toDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":150 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline tuple asOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asOwnershipRanges(PyObject *__pyx_v_ownership_ranges, PetscInt __pyx_v_dim, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_p, PetscInt **__pyx_v__x, PetscInt **__pyx_v__y, PetscInt **__pyx_v__z) { PyObject *__pyx_v_ranges = 0; PetscInt __pyx_v_rdim; PetscInt __pyx_v_nlx; PetscInt __pyx_v_nly; PetscInt __pyx_v_nlz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asOwnershipRanges", 0); /* "PETSc/petscdmda.pxi":156 * PetscInt **_y, * PetscInt **_z): * cdef object ranges = list(ownership_ranges) # <<<<<<<<<<<<<< * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 */ __pyx_t_1 = PySequence_List(__pyx_v_ownership_ranges); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ranges = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdmda.pxi":157 * PetscInt **_z): * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) # <<<<<<<<<<<<<< * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim */ __pyx_t_2 = PyObject_Length(__pyx_v_ranges); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(8, 157, __pyx_L1_error) __pyx_v_rdim = ((PetscInt)__pyx_t_2); /* "PETSc/petscdmda.pxi":158 * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( */ __pyx_v_nlx = 0; __pyx_v_nly = 0; __pyx_v_nlz = 0; /* "PETSc/petscdmda.pxi":159 * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim # <<<<<<<<<<<<<< * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % */ __pyx_t_3 = ((__pyx_v_dim == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_dim = __pyx_v_rdim; goto __pyx_L3; } /* "PETSc/petscdmda.pxi":160 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_3 = ((__pyx_v_dim != __pyx_v_rdim) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmda.pxi":162 * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) # <<<<<<<<<<<<<< * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "PETSc/petscdmda.pxi":161 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % # <<<<<<<<<<<<<< * (toInt(dim), toInt(rdim))) * if dim >= 1: */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmda.pxi":160 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(8, 160, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscdmda.pxi":163 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ __pyx_t_3 = ((__pyx_v_dim >= 1) != 0); if (__pyx_t_3) { /* "PETSc/petscdmda.pxi":164 * (toInt(dim), toInt(rdim))) * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) # <<<<<<<<<<<<<< * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(8, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdmda.pxi":165 * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx # <<<<<<<<<<<<<< * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = (((__pyx_v_m[0]) == PETSC_DECIDE) != 0); if (__pyx_t_3) { (__pyx_v_m[0]) = __pyx_v_nlx; goto __pyx_L5; } /* "PETSc/petscdmda.pxi":166 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_3 = (((__pyx_v_m[0]) != __pyx_v_nlx) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmda.pxi":168 * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) # <<<<<<<<<<<<<< * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlx); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; /* "PETSc/petscdmda.pxi":167 * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlx), toInt(m[0]))) * if dim >= 2: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmda.pxi":166 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(8, 166, __pyx_L1_error) } __pyx_L5:; /* "PETSc/petscdmda.pxi":163 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ } /* "PETSc/petscdmda.pxi":169 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ __pyx_t_3 = ((__pyx_v_dim >= 2) != 0); if (__pyx_t_3) { /* "PETSc/petscdmda.pxi":170 * (toInt(nlx), toInt(m[0]))) * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) # <<<<<<<<<<<<<< * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(8, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmda.pxi":171 * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly # <<<<<<<<<<<<<< * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = (((__pyx_v_n[0]) == PETSC_DECIDE) != 0); if (__pyx_t_3) { (__pyx_v_n[0]) = __pyx_v_nly; goto __pyx_L7; } /* "PETSc/petscdmda.pxi":172 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_3 = (((__pyx_v_n[0]) != __pyx_v_nly) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmda.pxi":174 * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) # <<<<<<<<<<<<<< * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; /* "PETSc/petscdmda.pxi":173 * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nly), toInt(n[0]))) * if dim >= 3: */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdmda.pxi":172 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(8, 172, __pyx_L1_error) } __pyx_L7:; /* "PETSc/petscdmda.pxi":169 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ } /* "PETSc/petscdmda.pxi":175 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ __pyx_t_3 = ((__pyx_v_dim >= 3) != 0); if (__pyx_t_3) { /* "PETSc/petscdmda.pxi":176 * (toInt(nly), toInt(n[0]))) * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) # <<<<<<<<<<<<<< * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ranges, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_4, (&__pyx_v_nlz), __pyx_v__z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(8, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmda.pxi":177 * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz # <<<<<<<<<<<<<< * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = (((__pyx_v_p[0]) == PETSC_DECIDE) != 0); if (__pyx_t_3) { (__pyx_v_p[0]) = __pyx_v_nlz; goto __pyx_L9; } /* "PETSc/petscdmda.pxi":178 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_3 = (((__pyx_v_p[0]) != __pyx_v_nlz) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmda.pxi":180 * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "PETSc/petscdmda.pxi":179 * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmda.pxi":178 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(8, 178, __pyx_L1_error) } __pyx_L9:; /* "PETSc/petscdmda.pxi":175 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ } /* "PETSc/petscdmda.pxi":181 * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) # <<<<<<<<<<<<<< * * cdef inline tuple toOwnershipRanges(PetscInt dim, */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/petscdmda.pxi":150 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline tuple asOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.asOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":183 * return tuple(ranges) * * cdef inline tuple toOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toOwnershipRanges(PetscInt __pyx_v_dim, PetscInt __pyx_v_m, PetscInt __pyx_v_n, PetscInt __pyx_v_p, PetscInt const *__pyx_v_lx, PetscInt const *__pyx_v_ly, PetscInt const *__pyx_v_lz) { PyObject *__pyx_v_ranges = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toOwnershipRanges", 0); /* "PETSc/petscdmda.pxi":189 * const PetscInt *lz): * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] # <<<<<<<<<<<<<< * if dim > 1: * ranges.append(array_i(n, ly)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_m, __pyx_v_lx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_ranges = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmda.pxi":190 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ __pyx_t_3 = ((__pyx_v_dim > 1) != 0); if (__pyx_t_3) { /* "PETSc/petscdmda.pxi":191 * ranges = [array_i(m, lx)] * if dim > 1: * ranges.append(array_i(n, ly)) # <<<<<<<<<<<<<< * if dim > 2: * ranges.append(array_i(p, lz)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_n, __pyx_v_ly)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmda.pxi":190 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ } /* "PETSc/petscdmda.pxi":192 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ __pyx_t_3 = ((__pyx_v_dim > 2) != 0); if (__pyx_t_3) { /* "PETSc/petscdmda.pxi":193 * ranges.append(array_i(n, ly)) * if dim > 2: * ranges.append(array_i(p, lz)) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_p, __pyx_v_lz)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmda.pxi":192 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ } /* "PETSc/petscdmda.pxi":194 * if dim > 2: * ranges.append(array_i(p, lz)) * return tuple(ranges) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyList_AsTuple(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscdmda.pxi":183 * return tuple(ranges) * * cdef inline tuple toOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.toOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":205 * cdef readonly ndarray array * * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): # <<<<<<<<<<<<<< * # * cdef PetscInt dim=0, dof=0 */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da = 0; struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_v_DOF; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_da,&__pyx_n_s_vec,&__pyx_n_s_DOF,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_da)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(8, 205, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DOF); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(8, 205, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_da = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); if (values[2]) { __pyx_v_DOF = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_DOF == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 205, __pyx_L3_error) } else { __pyx_v_DOF = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 205, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_da), __pyx_ptype_8petsc4py_5PETSc_DMDA, 0, "da", 0))) __PYX_ERR(8, 205, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(8, 205, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), __pyx_v_da, __pyx_v_vec, __pyx_v_DOF); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da, struct PyPetscVecObject *__pyx_v_vec, int __pyx_v_DOF) { PetscInt __pyx_v_dim; PetscInt __pyx_v_dof; PetscInt __pyx_v_lxs; PetscInt __pyx_v_lys; PetscInt __pyx_v_lzs; PetscInt __pyx_v_lxm; PetscInt __pyx_v_lym; PetscInt __pyx_v_lzm; PetscInt __pyx_v_gxs; PetscInt __pyx_v_gys; PetscInt __pyx_v_gzs; PetscInt __pyx_v_gxm; PetscInt __pyx_v_gym; PetscInt __pyx_v_gzm; PetscInt __pyx_v_n; PetscInt __pyx_v_xs; PetscInt __pyx_v_ys; PetscInt __pyx_v_zs; PetscInt __pyx_v_xm; PetscInt __pyx_v_ym; PetscInt __pyx_v_zm; PyObject *__pyx_v_starts = 0; PyObject *__pyx_v_sizes = 0; Py_ssize_t __pyx_v_k; Py_ssize_t __pyx_v_f; Py_ssize_t __pyx_v_d; PyObject *__pyx_v_shape = 0; PyObject *__pyx_v_strides = 0; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/petscdmda.pxi":207 * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): * # * cdef PetscInt dim=0, dof=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(da.dm, * &dim, NULL, NULL, NULL, NULL, NULL, NULL, */ __pyx_v_dim = 0; __pyx_v_dof = 0; /* "PETSc/petscdmda.pxi":208 * # * cdef PetscInt dim=0, dof=0 * CHKERR( DMDAGetInfo(da.dm, # <<<<<<<<<<<<<< * &dim, NULL, NULL, NULL, NULL, NULL, NULL, * &dof, NULL, NULL, NULL, NULL, NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_da->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_dof), NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 208, __pyx_L1_error) /* "PETSc/petscdmda.pxi":211 * &dim, NULL, NULL, NULL, NULL, NULL, NULL, * &dof, NULL, NULL, NULL, NULL, NULL) ) * cdef PetscInt lxs=0, lys=0, lzs=0 # <<<<<<<<<<<<<< * cdef PetscInt lxm=0, lym=0, lzm=0 * CHKERR( DMDAGetCorners(da.dm, */ __pyx_v_lxs = 0; __pyx_v_lys = 0; __pyx_v_lzs = 0; /* "PETSc/petscdmda.pxi":212 * &dof, NULL, NULL, NULL, NULL, NULL) ) * cdef PetscInt lxs=0, lys=0, lzs=0 * cdef PetscInt lxm=0, lym=0, lzm=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetCorners(da.dm, * &lxs, &lys, &lzs, */ __pyx_v_lxm = 0; __pyx_v_lym = 0; __pyx_v_lzm = 0; /* "PETSc/petscdmda.pxi":213 * cdef PetscInt lxs=0, lys=0, lzs=0 * cdef PetscInt lxm=0, lym=0, lzm=0 * CHKERR( DMDAGetCorners(da.dm, # <<<<<<<<<<<<<< * &lxs, &lys, &lzs, * &lxm, &lym, &lzm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCorners(__pyx_v_da->__pyx_base.dm, (&__pyx_v_lxs), (&__pyx_v_lys), (&__pyx_v_lzs), (&__pyx_v_lxm), (&__pyx_v_lym), (&__pyx_v_lzm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 213, __pyx_L1_error) /* "PETSc/petscdmda.pxi":216 * &lxs, &lys, &lzs, * &lxm, &lym, &lzm) ) * cdef PetscInt gxs=0, gys=0, gzs=0 # <<<<<<<<<<<<<< * cdef PetscInt gxm=0, gym=0, gzm=0 * CHKERR( DMDAGetGhostCorners(da.dm, */ __pyx_v_gxs = 0; __pyx_v_gys = 0; __pyx_v_gzs = 0; /* "PETSc/petscdmda.pxi":217 * &lxm, &lym, &lzm) ) * cdef PetscInt gxs=0, gys=0, gzs=0 * cdef PetscInt gxm=0, gym=0, gzm=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetGhostCorners(da.dm, * &gxs, &gys, &gzs, */ __pyx_v_gxm = 0; __pyx_v_gym = 0; __pyx_v_gzm = 0; /* "PETSc/petscdmda.pxi":218 * cdef PetscInt gxs=0, gys=0, gzs=0 * cdef PetscInt gxm=0, gym=0, gzm=0 * CHKERR( DMDAGetGhostCorners(da.dm, # <<<<<<<<<<<<<< * &gxs, &gys, &gzs, * &gxm, &gym, &gzm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetGhostCorners(__pyx_v_da->__pyx_base.dm, (&__pyx_v_gxs), (&__pyx_v_gys), (&__pyx_v_gzs), (&__pyx_v_gxm), (&__pyx_v_gym), (&__pyx_v_gzm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 218, __pyx_L1_error) /* "PETSc/petscdmda.pxi":222 * &gxm, &gym, &gzm) ) * # * cdef PetscInt n=0 # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(vec.vec, &n) ) * cdef PetscInt xs, ys, zs, xm, ym, zm */ __pyx_v_n = 0; /* "PETSc/petscdmda.pxi":223 * # * cdef PetscInt n=0 * CHKERR( VecGetLocalSize(vec.vec, &n) ) # <<<<<<<<<<<<<< * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_vec->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 223, __pyx_L1_error) /* "PETSc/petscdmda.pxi":225 * CHKERR( VecGetLocalSize(vec.vec, &n) ) * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm */ __pyx_t_2 = ((__pyx_v_n == (((__pyx_v_lxm * __pyx_v_lym) * __pyx_v_lzm) * __pyx_v_dof)) != 0); if (__pyx_t_2) { /* "PETSc/petscdmda.pxi":226 * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): * xs, ys, zs = lxs, lys, lzs # <<<<<<<<<<<<<< * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): */ __pyx_t_3 = __pyx_v_lxs; __pyx_t_4 = __pyx_v_lys; __pyx_t_5 = __pyx_v_lzs; __pyx_v_xs = __pyx_t_3; __pyx_v_ys = __pyx_t_4; __pyx_v_zs = __pyx_t_5; /* "PETSc/petscdmda.pxi":227 * if (n == lxm*lym*lzm*dof): * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm # <<<<<<<<<<<<<< * elif (n == gxm*gym*gzm*dof): * xs, ys, zs = gxs, gys, gzs */ __pyx_t_5 = __pyx_v_lxm; __pyx_t_4 = __pyx_v_lym; __pyx_t_3 = __pyx_v_lzm; __pyx_v_xm = __pyx_t_5; __pyx_v_ym = __pyx_t_4; __pyx_v_zm = __pyx_t_3; /* "PETSc/petscdmda.pxi":225 * CHKERR( VecGetLocalSize(vec.vec, &n) ) * cdef PetscInt xs, ys, zs, xm, ym, zm * if (n == lxm*lym*lzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm */ goto __pyx_L3; } /* "PETSc/petscdmda.pxi":228 * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = gxs, gys, gzs * xm, ym, zm = gxm, gym, gzm */ __pyx_t_2 = ((__pyx_v_n == (((__pyx_v_gxm * __pyx_v_gym) * __pyx_v_gzm) * __pyx_v_dof)) != 0); if (likely(__pyx_t_2)) { /* "PETSc/petscdmda.pxi":229 * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): * xs, ys, zs = gxs, gys, gzs # <<<<<<<<<<<<<< * xm, ym, zm = gxm, gym, gzm * else: */ __pyx_t_3 = __pyx_v_gxs; __pyx_t_4 = __pyx_v_gys; __pyx_t_5 = __pyx_v_gzs; __pyx_v_xs = __pyx_t_3; __pyx_v_ys = __pyx_t_4; __pyx_v_zs = __pyx_t_5; /* "PETSc/petscdmda.pxi":230 * elif (n == gxm*gym*gzm*dof): * xs, ys, zs = gxs, gys, gzs * xm, ym, zm = gxm, gym, gzm # <<<<<<<<<<<<<< * else: * raise ValueError( */ __pyx_t_5 = __pyx_v_gxm; __pyx_t_4 = __pyx_v_gym; __pyx_t_3 = __pyx_v_gzm; __pyx_v_xm = __pyx_t_5; __pyx_v_ym = __pyx_t_4; __pyx_v_zm = __pyx_t_3; /* "PETSc/petscdmda.pxi":228 * xs, ys, zs = lxs, lys, lzs * xm, ym, zm = lxm, lym, lzm * elif (n == gxm*gym*gzm*dof): # <<<<<<<<<<<<<< * xs, ys, zs = gxs, gys, gzs * xm, ym, zm = gxm, gym, gzm */ goto __pyx_L3; } /* "PETSc/petscdmda.pxi":232 * xm, ym, zm = gxm, gym, gzm * else: * raise ValueError( # <<<<<<<<<<<<<< * "Vector local size %d is not compatible " * "with DMDA local sizes %s" */ /*else*/ { /* "PETSc/petscdmda.pxi":235 * "Vector local size %d is not compatible " * "with DMDA local sizes %s" * % (n, toDims(dim, lxm, lym, lzm))) # <<<<<<<<<<<<<< * # * cdef tuple starts = toDims(dim, xs, ys, zs) */ __pyx_t_6 = PyInt_FromSsize_t(((Py_ssize_t)__pyx_v_n)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_lxm, __pyx_v_lym, __pyx_v_lzm); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Vector_local_size_d_is_not_compa, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscdmda.pxi":232 * xm, ym, zm = gxm, gym, gzm * else: * raise ValueError( # <<<<<<<<<<<<<< * "Vector local size %d is not compatible " * "with DMDA local sizes %s" */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(8, 232, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscdmda.pxi":237 * % (n, toDims(dim, lxm, lym, lzm))) * # * cdef tuple starts = toDims(dim, xs, ys, zs) # <<<<<<<<<<<<<< * cdef tuple sizes = toDims(dim, xm, ym, zm) * cdef Py_ssize_t k = sizeof(PetscScalar) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xs, __pyx_v_ys, __pyx_v_zs); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_starts = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscdmda.pxi":238 * # * cdef tuple starts = toDims(dim, xs, ys, zs) * cdef tuple sizes = toDims(dim, xm, ym, zm) # <<<<<<<<<<<<<< * cdef Py_ssize_t k = sizeof(PetscScalar) * cdef Py_ssize_t f = dof */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_sizes = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscdmda.pxi":239 * cdef tuple starts = toDims(dim, xs, ys, zs) * cdef tuple sizes = toDims(dim, xm, ym, zm) * cdef Py_ssize_t k = sizeof(PetscScalar) # <<<<<<<<<<<<<< * cdef Py_ssize_t f = dof * cdef Py_ssize_t d = dim */ __pyx_v_k = ((Py_ssize_t)(sizeof(PetscScalar))); /* "PETSc/petscdmda.pxi":240 * cdef tuple sizes = toDims(dim, xm, ym, zm) * cdef Py_ssize_t k = sizeof(PetscScalar) * cdef Py_ssize_t f = dof # <<<<<<<<<<<<<< * cdef Py_ssize_t d = dim * cdef tuple shape = toDims(dim, xm, ym, zm) */ __pyx_v_f = ((Py_ssize_t)__pyx_v_dof); /* "PETSc/petscdmda.pxi":241 * cdef Py_ssize_t k = sizeof(PetscScalar) * cdef Py_ssize_t f = dof * cdef Py_ssize_t d = dim # <<<<<<<<<<<<<< * cdef tuple shape = toDims(dim, xm, ym, zm) * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] */ __pyx_v_d = ((Py_ssize_t)__pyx_v_dim); /* "PETSc/petscdmda.pxi":242 * cdef Py_ssize_t f = dof * cdef Py_ssize_t d = dim * cdef tuple shape = toDims(dim, xm, ym, zm) # <<<<<<<<<<<<<< * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] * if DOF or f > 1: shape += (f,) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_shape = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscdmda.pxi":243 * cdef Py_ssize_t d = dim * cdef tuple shape = toDims(dim, xm, ym, zm) * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] # <<<<<<<<<<<<<< * if DOF or f > 1: shape += (f,) * if DOF or f > 1: strides += (k,) */ __pyx_t_8 = PyInt_FromSsize_t((__pyx_v_k * __pyx_v_f)); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyInt_FromSsize_t(((__pyx_v_k * __pyx_v_f) * __pyx_v_xm)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyInt_FromSsize_t((((__pyx_v_k * __pyx_v_f) * __pyx_v_xm) * __pyx_v_ym)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_9, 0, __pyx_v_d, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (!(likely(PyTuple_CheckExact(__pyx_t_6))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(8, 243, __pyx_L1_error) __pyx_v_strides = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmda.pxi":244 * cdef tuple shape = toDims(dim, xm, ym, zm) * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] * if DOF or f > 1: shape += (f,) # <<<<<<<<<<<<<< * if DOF or f > 1: strides += (k,) * # */ __pyx_t_10 = (__pyx_v_DOF != 0); if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L5_bool_binop_done; } __pyx_t_10 = ((__pyx_v_f > 1) != 0); __pyx_t_2 = __pyx_t_10; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_f); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_shape, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_shape, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; } /* "PETSc/petscdmda.pxi":245 * cdef tuple strides = (k*f, k*f*xm, k*f*xm*ym)[:d] * if DOF or f > 1: shape += (f,) * if DOF or f > 1: strides += (k,) # <<<<<<<<<<<<<< * # * self.vecbuf = _Vec_buffer(vec) */ __pyx_t_10 = (__pyx_v_DOF != 0); if (!__pyx_t_10) { } else { __pyx_t_2 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } __pyx_t_10 = ((__pyx_v_f > 1) != 0); __pyx_t_2 = __pyx_t_10; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_strides, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_strides, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0; } /* "PETSc/petscdmda.pxi":247 * if DOF or f > 1: strides += (k,) * # * self.vecbuf = _Vec_buffer(vec) # <<<<<<<<<<<<<< * self.starts = starts * self.sizes = sizes */ __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_vec)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->vecbuf); __Pyx_DECREF(((PyObject *)__pyx_v_self->vecbuf)); __pyx_v_self->vecbuf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmda.pxi":248 * # * self.vecbuf = _Vec_buffer(vec) * self.starts = starts # <<<<<<<<<<<<<< * self.sizes = sizes * self.shape = shape */ __Pyx_INCREF(__pyx_v_starts); __Pyx_GIVEREF(__pyx_v_starts); __Pyx_GOTREF(__pyx_v_self->starts); __Pyx_DECREF(__pyx_v_self->starts); __pyx_v_self->starts = __pyx_v_starts; /* "PETSc/petscdmda.pxi":249 * self.vecbuf = _Vec_buffer(vec) * self.starts = starts * self.sizes = sizes # <<<<<<<<<<<<<< * self.shape = shape * self.strides = strides */ __Pyx_INCREF(__pyx_v_sizes); __Pyx_GIVEREF(__pyx_v_sizes); __Pyx_GOTREF(__pyx_v_self->sizes); __Pyx_DECREF(__pyx_v_self->sizes); __pyx_v_self->sizes = __pyx_v_sizes; /* "PETSc/petscdmda.pxi":250 * self.starts = starts * self.sizes = sizes * self.shape = shape # <<<<<<<<<<<<<< * self.strides = strides * */ __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); __Pyx_GOTREF(__pyx_v_self->shape); __Pyx_DECREF(__pyx_v_self->shape); __pyx_v_self->shape = __pyx_v_shape; /* "PETSc/petscdmda.pxi":251 * self.sizes = sizes * self.shape = shape * self.strides = strides # <<<<<<<<<<<<<< * * cdef int acquire(self) except -1: */ __Pyx_INCREF(__pyx_v_strides); __Pyx_GIVEREF(__pyx_v_strides); __Pyx_GOTREF(__pyx_v_self->strides); __Pyx_DECREF(__pyx_v_self->strides); __pyx_v_self->strides = __pyx_v_strides; /* "PETSc/petscdmda.pxi":205 * cdef readonly ndarray array * * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): # <<<<<<<<<<<<<< * # * cdef PetscInt dim=0, dof=0 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_starts); __Pyx_XDECREF(__pyx_v_sizes); __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_strides); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":253 * self.strides = strides * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.acquire() * if self.array is None: */ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("acquire", 0); /* "PETSc/petscdmda.pxi":254 * * cdef int acquire(self) except -1: * self.vecbuf.acquire() # <<<<<<<<<<<<<< * if self.array is None: * self.array = asarray(self.vecbuf) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->vecbuf->__pyx_vtab)->acquire(__pyx_v_self->vecbuf); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 254, __pyx_L1_error) /* "PETSc/petscdmda.pxi":255 * cdef int acquire(self) except -1: * self.vecbuf.acquire() * if self.array is None: # <<<<<<<<<<<<<< * self.array = asarray(self.vecbuf) * self.array.shape = self.shape */ __pyx_t_2 = (((PyObject *)__pyx_v_self->array) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/petscdmda.pxi":256 * self.vecbuf.acquire() * if self.array is None: * self.array = asarray(self.vecbuf) # <<<<<<<<<<<<<< * self.array.shape = self.shape * self.array.strides = self.strides */ __pyx_t_4 = ((PyObject *)__pyx_v_self->vecbuf); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->array); __Pyx_DECREF(((PyObject *)__pyx_v_self->array)); __pyx_v_self->array = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmda.pxi":257 * if self.array is None: * self.array = asarray(self.vecbuf) * self.array.shape = self.shape # <<<<<<<<<<<<<< * self.array.strides = self.strides * return 0 */ __pyx_t_5 = __pyx_v_self->shape; __Pyx_INCREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->array), __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(8, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmda.pxi":258 * self.array = asarray(self.vecbuf) * self.array.shape = self.shape * self.array.strides = self.strides # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_5 = __pyx_v_self->strides; __Pyx_INCREF(__pyx_t_5); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->array), __pyx_n_s_strides, __pyx_t_5) < 0) __PYX_ERR(8, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmda.pxi":255 * cdef int acquire(self) except -1: * self.vecbuf.acquire() * if self.array is None: # <<<<<<<<<<<<<< * self.array = asarray(self.vecbuf) * self.array.shape = self.shape */ } /* "PETSc/petscdmda.pxi":259 * self.array.shape = self.shape * self.array.strides = self.strides * return 0 # <<<<<<<<<<<<<< * * cdef int release(self) except -1: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmda.pxi":253 * self.strides = strides * * cdef int acquire(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.acquire() * if self.array is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":261 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.release() * self.array = None */ static int __pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_release(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("release", 0); /* "PETSc/petscdmda.pxi":262 * * cdef int release(self) except -1: * self.vecbuf.release() # <<<<<<<<<<<<<< * self.array = None * return 0 */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_self->vecbuf->__pyx_vtab)->release(__pyx_v_self->vecbuf); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 262, __pyx_L1_error) /* "PETSc/petscdmda.pxi":263 * cdef int release(self) except -1: * self.vecbuf.release() * self.array = None # <<<<<<<<<<<<<< * return 0 * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->array); __Pyx_DECREF(((PyObject *)__pyx_v_self->array)); __pyx_v_self->array = ((PyArrayObject *)Py_None); /* "PETSc/petscdmda.pxi":264 * self.vecbuf.release() * self.array = None * return 0 # <<<<<<<<<<<<<< * * # */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmda.pxi":261 * return 0 * * cdef int release(self) except -1: # <<<<<<<<<<<<<< * self.vecbuf.release() * self.array = None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.release", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":268 * # * * def __getitem__(self, index): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_2__getitem__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), ((PyObject *)__pyx_v_index)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_2__getitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); __Pyx_INCREF(__pyx_v_index); /* "PETSc/petscdmda.pxi":269 * * def __getitem__(self, index): * self.acquire() # <<<<<<<<<<<<<< * index = adjust_index_exp(self.starts, index) * return self.array[index] */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 269, __pyx_L1_error) /* "PETSc/petscdmda.pxi":270 * def __getitem__(self, index): * self.acquire() * index = adjust_index_exp(self.starts, index) # <<<<<<<<<<<<<< * return self.array[index] * */ __pyx_t_2 = __pyx_v_self->starts; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_adjust_index_exp(__pyx_t_2, __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscdmda.pxi":271 * self.acquire() * index = adjust_index_exp(self.starts, index) * return self.array[index] # <<<<<<<<<<<<<< * * def __setitem__(self, index, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->array), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/petscdmda.pxi":268 * # * * def __getitem__(self, index): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":273 * return self.array[index] * * def __setitem__(self, index, value): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_4__setitem__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_4__setitem__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); /* "PETSc/petscdmda.pxi":274 * * def __setitem__(self, index, value): * self.acquire() # <<<<<<<<<<<<<< * index = adjust_index_exp(self.starts, index) * self.array[index] = value */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 274, __pyx_L1_error) /* "PETSc/petscdmda.pxi":275 * def __setitem__(self, index, value): * self.acquire() * index = adjust_index_exp(self.starts, index) # <<<<<<<<<<<<<< * self.array[index] = value * */ __pyx_t_2 = __pyx_v_self->starts; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_adjust_index_exp(__pyx_t_2, __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscdmda.pxi":276 * self.acquire() * index = adjust_index_exp(self.starts, index) * self.array[index] = value # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->array), __pyx_v_index, __pyx_v_value) < 0)) __PYX_ERR(8, 276, __pyx_L1_error) /* "PETSc/petscdmda.pxi":273 * return self.array[index] * * def __setitem__(self, index, value): # <<<<<<<<<<<<<< * self.acquire() * index = adjust_index_exp(self.starts, index) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_index); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":280 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * self.acquire() * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__[] = "_DMDA_Vec_array.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/petscdmda.pxi":281 * * def __enter__(self): * self.acquire() # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->acquire(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 281, __pyx_L1_error) /* "PETSc/petscdmda.pxi":282 * def __enter__(self): * self.acquire() * return self # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/petscdmda.pxi":280 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * self.acquire() * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":284 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.release() * return None */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__[] = "_DMDA_Vec_array.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/petscdmda.pxi":285 * * def __exit__(self, *exc): * self.release() # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self->__pyx_vtab)->release(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 285, __pyx_L1_error) /* "PETSc/petscdmda.pxi":286 * def __exit__(self, *exc): * self.release() * return None # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/petscdmda.pxi":284 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.release() * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMDA_Vec_array.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":201 * * cdef _Vec_buffer vecbuf * cdef readonly tuple starts, sizes # <<<<<<<<<<<<<< * cdef readonly tuple shape, strides * cdef readonly ndarray array */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->starts); __pyx_r = __pyx_v_self->starts; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->sizes); __pyx_r = __pyx_v_self->sizes; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":202 * cdef _Vec_buffer vecbuf * cdef readonly tuple starts, sizes * cdef readonly tuple shape, strides # <<<<<<<<<<<<<< * cdef readonly ndarray array * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->shape); __pyx_r = __pyx_v_self->shape; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->strides); __pyx_r = __pyx_v_self->strides; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":203 * cdef readonly tuple starts, sizes * cdef readonly tuple shape, strides * cdef readonly ndarray array # <<<<<<<<<<<<<< * * def __cinit__(self, DMDA da, Vec vec, bint DOF=False): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5array_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5array_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5array___get__(((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_15_DMDA_Vec_array_5array___get__(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self->array)); __pyx_r = ((PyObject *)__pyx_v_self->array); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":289 * * * cdef object adjust_index_exp(object starts, object index): # <<<<<<<<<<<<<< * if not isinstance(index, tuple): * return adjust_index(starts[0], index) */ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index_exp(PyObject *__pyx_v_starts, PyObject *__pyx_v_index) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_start = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjust_index_exp", 0); __Pyx_INCREF(__pyx_v_index); /* "PETSc/petscdmda.pxi":290 * * cdef object adjust_index_exp(object starts, object index): * if not isinstance(index, tuple): # <<<<<<<<<<<<<< * return adjust_index(starts[0], index) * index = list(index) */ __pyx_t_1 = PyTuple_Check(__pyx_v_index); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "PETSc/petscdmda.pxi":291 * cdef object adjust_index_exp(object starts, object index): * if not isinstance(index, tuple): * return adjust_index(starts[0], index) # <<<<<<<<<<<<<< * index = list(index) * for i, start in enumerate(starts): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_starts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_adjust_index(__pyx_t_3, __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/petscdmda.pxi":290 * * cdef object adjust_index_exp(object starts, object index): * if not isinstance(index, tuple): # <<<<<<<<<<<<<< * return adjust_index(starts[0], index) * index = list(index) */ } /* "PETSc/petscdmda.pxi":292 * if not isinstance(index, tuple): * return adjust_index(starts[0], index) * index = list(index) # <<<<<<<<<<<<<< * for i, start in enumerate(starts): * index[i] = adjust_index(start, index[i]) */ __pyx_t_4 = PySequence_List(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdmda.pxi":293 * return adjust_index(starts[0], index) * index = list(index) * for i, start in enumerate(starts): # <<<<<<<<<<<<<< * index[i] = adjust_index(start, index[i]) * index = tuple(index) */ __Pyx_INCREF(__pyx_int_0); __pyx_t_4 = __pyx_int_0; if (likely(PyList_CheckExact(__pyx_v_starts)) || PyTuple_CheckExact(__pyx_v_starts)) { __pyx_t_3 = __pyx_v_starts; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_starts); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 293, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(8, 293, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(8, 293, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(8, 293, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4); __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; /* "PETSc/petscdmda.pxi":294 * index = list(index) * for i, start in enumerate(starts): * index[i] = adjust_index(start, index[i]) # <<<<<<<<<<<<<< * index = tuple(index) * return index */ __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_index, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_adjust_index(__pyx_v_start, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(PyObject_SetItem(__pyx_v_index, __pyx_v_i, __pyx_t_8) < 0)) __PYX_ERR(8, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscdmda.pxi":293 * return adjust_index(starts[0], index) * index = list(index) * for i, start in enumerate(starts): # <<<<<<<<<<<<<< * index[i] = adjust_index(start, index[i]) * index = tuple(index) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdmda.pxi":295 * for i, start in enumerate(starts): * index[i] = adjust_index(start, index[i]) * index = tuple(index) # <<<<<<<<<<<<<< * return index * */ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdmda.pxi":296 * index[i] = adjust_index(start, index[i]) * index = tuple(index) * return index # <<<<<<<<<<<<<< * * cdef object adjust_index(object lbound, object index): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; goto __pyx_L0; /* "PETSc/petscdmda.pxi":289 * * * cdef object adjust_index_exp(object starts, object index): # <<<<<<<<<<<<<< * if not isinstance(index, tuple): * return adjust_index(starts[0], index) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.adjust_index_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_index); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmda.pxi":298 * return index * * cdef object adjust_index(object lbound, object index): # <<<<<<<<<<<<<< * if index is None: * return index */ static PyObject *__pyx_f_8petsc4py_5PETSc_adjust_index(PyObject *__pyx_v_lbound, PyObject *__pyx_v_index) { PyObject *__pyx_v_start = NULL; PyObject *__pyx_v_stop = NULL; PyObject *__pyx_v_step = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjust_index", 0); /* "PETSc/petscdmda.pxi":299 * * cdef object adjust_index(object lbound, object index): * if index is None: # <<<<<<<<<<<<<< * return index * if index is Ellipsis: */ __pyx_t_1 = (__pyx_v_index == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdmda.pxi":300 * cdef object adjust_index(object lbound, object index): * if index is None: * return index # <<<<<<<<<<<<<< * if index is Ellipsis: * return index */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; goto __pyx_L0; /* "PETSc/petscdmda.pxi":299 * * cdef object adjust_index(object lbound, object index): * if index is None: # <<<<<<<<<<<<<< * return index * if index is Ellipsis: */ } /* "PETSc/petscdmda.pxi":301 * if index is None: * return index * if index is Ellipsis: # <<<<<<<<<<<<<< * return index * if isinstance(index, slice): */ __pyx_t_2 = (__pyx_v_index == __pyx_builtin_Ellipsis); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/petscdmda.pxi":302 * return index * if index is Ellipsis: * return index # <<<<<<<<<<<<<< * if isinstance(index, slice): * start = index.start */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; goto __pyx_L0; /* "PETSc/petscdmda.pxi":301 * if index is None: * return index * if index is Ellipsis: # <<<<<<<<<<<<<< * return index * if isinstance(index, slice): */ } /* "PETSc/petscdmda.pxi":303 * if index is Ellipsis: * return index * if isinstance(index, slice): # <<<<<<<<<<<<<< * start = index.start * stop = index.stop */ __pyx_t_1 = PySlice_Check(__pyx_v_index); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdmda.pxi":304 * return index * if isinstance(index, slice): * start = index.start # <<<<<<<<<<<<<< * stop = index.stop * step = index.step */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_start = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscdmda.pxi":305 * if isinstance(index, slice): * start = index.start * stop = index.stop # <<<<<<<<<<<<<< * step = index.step * if start is not None: start -= lbound */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_stop = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscdmda.pxi":306 * start = index.start * stop = index.stop * step = index.step # <<<<<<<<<<<<<< * if start is not None: start -= lbound * if stop is not None: stop -= lbound */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_step = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscdmda.pxi":307 * stop = index.stop * step = index.step * if start is not None: start -= lbound # <<<<<<<<<<<<<< * if stop is not None: stop -= lbound * return slice(start, stop, step) */ __pyx_t_2 = (__pyx_v_start != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_v_start, __pyx_v_lbound); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/petscdmda.pxi":308 * step = index.step * if start is not None: start -= lbound * if stop is not None: stop -= lbound # <<<<<<<<<<<<<< * return slice(start, stop, step) * try: */ __pyx_t_1 = (__pyx_v_stop != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_v_stop, __pyx_v_lbound); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/petscdmda.pxi":309 * if start is not None: start -= lbound * if stop is not None: stop -= lbound * return slice(start, stop, step) # <<<<<<<<<<<<<< * try: * return index - lbound */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/petscdmda.pxi":303 * if index is Ellipsis: * return index * if isinstance(index, slice): # <<<<<<<<<<<<<< * start = index.start * stop = index.stop */ } /* "PETSc/petscdmda.pxi":310 * if stop is not None: stop -= lbound * return slice(start, stop, step) * try: # <<<<<<<<<<<<<< * return index - lbound * except TypeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "PETSc/petscdmda.pxi":311 * return slice(start, stop, step) * try: * return index - lbound # <<<<<<<<<<<<<< * except TypeError: * return index */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyNumber_Subtract(__pyx_v_index, __pyx_v_lbound); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 311, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L12_try_return; /* "PETSc/petscdmda.pxi":310 * if stop is not None: stop -= lbound * return slice(start, stop, step) * try: # <<<<<<<<<<<<<< * return index - lbound * except TypeError: */ } __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/petscdmda.pxi":312 * try: * return index - lbound * except TypeError: # <<<<<<<<<<<<<< * return index * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_7) { __Pyx_AddTraceback("petsc4py.PETSc.adjust_index", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(8, 312, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_9); /* "PETSc/petscdmda.pxi":313 * return index - lbound * except TypeError: * return index # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_index); __pyx_r = __pyx_v_index; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_except_return; } goto __pyx_L10_except_error; __pyx_L10_except_error:; /* "PETSc/petscdmda.pxi":310 * if stop is not None: stop -= lbound * return slice(start, stop, step) * try: # <<<<<<<<<<<<<< * return index - lbound * except TypeError: */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; __pyx_L11_except_return:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L0; } /* "PETSc/petscdmda.pxi":298 * return index * * cdef object adjust_index(object lbound, object index): # <<<<<<<<<<<<<< * if index is None: * return index */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.adjust_index", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_start); __Pyx_XDECREF(__pyx_v_stop); __Pyx_XDECREF(__pyx_v_step); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":85 * # -------------------------------------------------------------------- * * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ static CYTHON_INLINE DMStagStencilType __pyx_f_8petsc4py_5PETSc_asStagStencil(PyObject *__pyx_v_stencil) { DMStagStencilType __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; DMStagStencilType __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagStencil", 0); /* "PETSc/petscdmstag.pxi":87 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX */ __pyx_t_1 = PyString_Check(__pyx_v_stencil); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdmstag.pxi":88 * except (-1): * if isinstance(stencil, str): * if stencil == "star": return DMSTAG_STENCIL_STAR # <<<<<<<<<<<<<< * elif stencil == "box": return DMSTAG_STENCIL_BOX * elif stencil == "none": return DMSTAG_STENCIL_NONE */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_star, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 88, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_STENCIL_STAR; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":89 * if isinstance(stencil, str): * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX # <<<<<<<<<<<<<< * elif stencil == "none": return DMSTAG_STENCIL_NONE * else: raise ValueError("unknown stencil type: %s" % stencil) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_box, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 89, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_STENCIL_BOX; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":90 * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX * elif stencil == "none": return DMSTAG_STENCIL_NONE # <<<<<<<<<<<<<< * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 90, __pyx_L1_error) if (likely(__pyx_t_2)) { __pyx_r = DMSTAG_STENCIL_NONE; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":91 * elif stencil == "box": return DMSTAG_STENCIL_BOX * elif stencil == "none": return DMSTAG_STENCIL_NONE * else: raise ValueError("unknown stencil type: %s" % stencil) # <<<<<<<<<<<<<< * return stencil * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(23, 91, __pyx_L1_error) } /* "PETSc/petscdmstag.pxi":87 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ * except (-1): * if isinstance(stencil, str): # <<<<<<<<<<<<<< * if stencil == "star": return DMSTAG_STENCIL_STAR * elif stencil == "box": return DMSTAG_STENCIL_BOX */ } /* "PETSc/petscdmstag.pxi":92 * elif stencil == "none": return DMSTAG_STENCIL_NONE * else: raise ValueError("unknown stencil type: %s" % stencil) * return stencil # <<<<<<<<<<<<<< * * cdef inline object toStagStencil(PetscDMStagStencilType stype): */ __pyx_t_5 = ((DMStagStencilType)__Pyx_PyInt_As_DMStagStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(23, 92, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscdmstag.pxi":85 * # -------------------------------------------------------------------- * * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.asStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMStagStencilType)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":94 * return stencil * * cdef inline object toStagStencil(PetscDMStagStencilType stype): # <<<<<<<<<<<<<< * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagStencil(DMStagStencilType __pyx_v_stype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("toStagStencil", 0); /* "PETSc/petscdmstag.pxi":95 * * cdef inline object toStagStencil(PetscDMStagStencilType stype): * if stype == DMSTAG_STENCIL_STAR: return "star" # <<<<<<<<<<<<<< * elif stype == DMSTAG_STENCIL_BOX: return "box" * elif stype == DMSTAG_STENCIL_NONE: return "none" */ __pyx_t_1 = ((__pyx_v_stype == DMSTAG_STENCIL_STAR) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_star); __pyx_r = __pyx_n_s_star; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":96 * cdef inline object toStagStencil(PetscDMStagStencilType stype): * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" # <<<<<<<<<<<<<< * elif stype == DMSTAG_STENCIL_NONE: return "none" * */ __pyx_t_1 = ((__pyx_v_stype == DMSTAG_STENCIL_BOX) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_box); __pyx_r = __pyx_n_s_box; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":97 * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" * elif stype == DMSTAG_STENCIL_NONE: return "none" # <<<<<<<<<<<<<< * * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ */ __pyx_t_1 = ((__pyx_v_stype == DMSTAG_STENCIL_NONE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_none); __pyx_r = __pyx_n_s_none; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":94 * return stencil * * cdef inline object toStagStencil(PetscDMStagStencilType stype): # <<<<<<<<<<<<<< * if stype == DMSTAG_STENCIL_STAR: return "star" * elif stype == DMSTAG_STENCIL_BOX: return "box" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":99 * elif stype == DMSTAG_STENCIL_NONE: return "none" * * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil_location, str): */ static CYTHON_INLINE DMStagStencilLocation __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(PyObject *__pyx_v_stencil_location) { DMStagStencilLocation __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; DMStagStencilLocation __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagStencilLocation", 0); /* "PETSc/petscdmstag.pxi":101 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ * except (-1): * if isinstance(stencil_location, str): # <<<<<<<<<<<<<< * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT */ __pyx_t_1 = PyString_Check(__pyx_v_stencil_location); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/petscdmstag.pxi":102 * except (-1): * if isinstance(stencil_location, str): * if stencil_location == "null": return DMSTAG_NULL_LOCATION # <<<<<<<<<<<<<< * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_null, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 102, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_NULL_LOCATION; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":103 * if isinstance(stencil_location, str): * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 103, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_DOWN_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":104 * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN # <<<<<<<<<<<<<< * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 104, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_DOWN; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":105 * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT * elif stencil_location == "back": return DMSTAG_BACK */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_down_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 105, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_DOWN_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":106 * elif stencil_location == "back_down": return DMSTAG_BACK_DOWN * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "back": return DMSTAG_BACK * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 106, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":107 * elif stencil_location == "back_down_right": return DMSTAG_BACK_DOWN_RIGHT * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT * elif stencil_location == "back": return DMSTAG_BACK # <<<<<<<<<<<<<< * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 107, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":108 * elif stencil_location == "back_left": return DMSTAG_BACK_LEFT * elif stencil_location == "back": return DMSTAG_BACK * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT * elif stencil_location == "back_up": return DMSTAG_BACK_UP */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 108, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":109 * elif stencil_location == "back": return DMSTAG_BACK * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "back_up": return DMSTAG_BACK_UP * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 109, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_UP_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":110 * elif stencil_location == "back_right": return DMSTAG_BACK_RIGHT * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT * elif stencil_location == "back_up": return DMSTAG_BACK_UP # <<<<<<<<<<<<<< * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 110, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_UP; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":111 * elif stencil_location == "back_up_left": return DMSTAG_BACK_UP_LEFT * elif stencil_location == "back_up": return DMSTAG_BACK_UP * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT * elif stencil_location == "down": return DMSTAG_DOWN */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_back_up_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 111, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_BACK_UP_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":112 * elif stencil_location == "back_up": return DMSTAG_BACK_UP * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "down": return DMSTAG_DOWN * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 112, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_DOWN_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":113 * elif stencil_location == "back_up_right": return DMSTAG_BACK_UP_RIGHT * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT * elif stencil_location == "down": return DMSTAG_DOWN # <<<<<<<<<<<<<< * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT * elif stencil_location == "left": return DMSTAG_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 113, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_DOWN; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":114 * elif stencil_location == "down_left": return DMSTAG_DOWN_LEFT * elif stencil_location == "down": return DMSTAG_DOWN * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "left": return DMSTAG_LEFT * elif stencil_location == "element": return DMSTAG_ELEMENT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_down_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 114, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_DOWN_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":115 * elif stencil_location == "down": return DMSTAG_DOWN * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT * elif stencil_location == "left": return DMSTAG_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "element": return DMSTAG_ELEMENT * elif stencil_location == "right": return DMSTAG_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 115, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":116 * elif stencil_location == "down_right": return DMSTAG_DOWN_RIGHT * elif stencil_location == "left": return DMSTAG_LEFT * elif stencil_location == "element": return DMSTAG_ELEMENT # <<<<<<<<<<<<<< * elif stencil_location == "right": return DMSTAG_RIGHT * elif stencil_location == "up_left": return DMSTAG_UP_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_element, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 116, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_ELEMENT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":117 * elif stencil_location == "left": return DMSTAG_LEFT * elif stencil_location == "element": return DMSTAG_ELEMENT * elif stencil_location == "right": return DMSTAG_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "up_left": return DMSTAG_UP_LEFT * elif stencil_location == "up": return DMSTAG_UP */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 117, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":118 * elif stencil_location == "element": return DMSTAG_ELEMENT * elif stencil_location == "right": return DMSTAG_RIGHT * elif stencil_location == "up_left": return DMSTAG_UP_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "up": return DMSTAG_UP * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 118, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_UP_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":119 * elif stencil_location == "right": return DMSTAG_RIGHT * elif stencil_location == "up_left": return DMSTAG_UP_LEFT * elif stencil_location == "up": return DMSTAG_UP # <<<<<<<<<<<<<< * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 119, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_UP; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":120 * elif stencil_location == "up_left": return DMSTAG_UP_LEFT * elif stencil_location == "up": return DMSTAG_UP * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_up_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 120, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_UP_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":121 * elif stencil_location == "up": return DMSTAG_UP * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 121, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT_DOWN_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":122 * elif stencil_location == "up_right": return DMSTAG_UP_RIGHT * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN # <<<<<<<<<<<<<< * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 122, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT_DOWN; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":123 * elif stencil_location == "front_down_left": return DMSTAG_FRONT_DOWN_LEFT * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT * elif stencil_location == "front": return DMSTAG_FRONT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_down_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 123, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT_DOWN_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":124 * elif stencil_location == "front_down": return DMSTAG_FRONT_DOWN * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "front": return DMSTAG_FRONT * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 124, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":125 * elif stencil_location == "front_down_right": return DMSTAG_FRONT_DOWN_RIGHT * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT * elif stencil_location == "front": return DMSTAG_FRONT # <<<<<<<<<<<<<< * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 125, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":126 * elif stencil_location == "front_left": return DMSTAG_FRONT_LEFT * elif stencil_location == "front": return DMSTAG_FRONT * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT # <<<<<<<<<<<<<< * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT * elif stencil_location == "front_up": return DMSTAG_FRONT_UP */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 126, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":127 * elif stencil_location == "front": return DMSTAG_FRONT * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT # <<<<<<<<<<<<<< * elif stencil_location == "front_up": return DMSTAG_FRONT_UP * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 127, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT_UP_LEFT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":128 * elif stencil_location == "front_right": return DMSTAG_FRONT_RIGHT * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT * elif stencil_location == "front_up": return DMSTAG_FRONT_UP # <<<<<<<<<<<<<< * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT * else: raise ValueError("unknown stencil location type: %s" % stencil_location) */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 128, __pyx_L1_error) if (__pyx_t_2) { __pyx_r = DMSTAG_FRONT_UP; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":129 * elif stencil_location == "front_up_left": return DMSTAG_FRONT_UP_LEFT * elif stencil_location == "front_up": return DMSTAG_FRONT_UP * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT # <<<<<<<<<<<<<< * else: raise ValueError("unknown stencil location type: %s" % stencil_location) * return stencil_location */ __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_stencil_location, __pyx_n_s_front_up_right, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(23, 129, __pyx_L1_error) if (likely(__pyx_t_2)) { __pyx_r = DMSTAG_FRONT_UP_RIGHT; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":130 * elif stencil_location == "front_up": return DMSTAG_FRONT_UP * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT * else: raise ValueError("unknown stencil location type: %s" % stencil_location) # <<<<<<<<<<<<<< * return stencil_location * */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_stencil_location_type_s, __pyx_v_stencil_location); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(23, 130, __pyx_L1_error) } /* "PETSc/petscdmstag.pxi":101 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ * except (-1): * if isinstance(stencil_location, str): # <<<<<<<<<<<<<< * if stencil_location == "null": return DMSTAG_NULL_LOCATION * elif stencil_location == "back_down_left": return DMSTAG_BACK_DOWN_LEFT */ } /* "PETSc/petscdmstag.pxi":131 * elif stencil_location == "front_up_right": return DMSTAG_FRONT_UP_RIGHT * else: raise ValueError("unknown stencil location type: %s" % stencil_location) * return stencil_location # <<<<<<<<<<<<<< * * */ __pyx_t_5 = ((DMStagStencilLocation)__Pyx_PyInt_As_DMStagStencilLocation(__pyx_v_stencil_location)); if (unlikely(PyErr_Occurred())) __PYX_ERR(23, 131, __pyx_L1_error) __pyx_r = __pyx_t_5; goto __pyx_L0; /* "PETSc/petscdmstag.pxi":99 * elif stype == DMSTAG_STENCIL_NONE: return "none" * * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \ # <<<<<<<<<<<<<< * except (-1): * if isinstance(stencil_location, str): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.asStagStencilLocation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = ((DMStagStencilLocation)-1L); __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":134 * * * cdef inline PetscInt asStagDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asStagDims(PyObject *__pyx_v_dims, PetscInt *__pyx_v__M, PetscInt *__pyx_v__N, PetscInt *__pyx_v__P) { PetscInt __pyx_v_dim; PyObject *__pyx_v_M = 0; PyObject *__pyx_v_N = 0; PyObject *__pyx_v_P = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PetscInt __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagDims", 0); __Pyx_INCREF(__pyx_v_dims); /* "PETSc/petscdmstag.pxi":138 * PetscInt *_N, * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object M=None, N=None, P=None * dims = tuple(dims) */ __pyx_v_dim = PETSC_DECIDE; /* "PETSc/petscdmstag.pxi":139 * PetscInt *_P) except? -1: * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None # <<<<<<<<<<<<<< * dims = tuple(dims) * dim = len(dims) */ __Pyx_INCREF(Py_None); __pyx_v_M = Py_None; __Pyx_INCREF(Py_None); __pyx_v_N = Py_None; __Pyx_INCREF(Py_None); __pyx_v_P = Py_None; /* "PETSc/petscdmstag.pxi":140 * cdef PetscInt dim = PETSC_DECIDE * cdef object M=None, N=None, P=None * dims = tuple(dims) # <<<<<<<<<<<<<< * dim = len(dims) * if dim == 0: pass */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dims, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmstag.pxi":141 * cdef object M=None, N=None, P=None * dims = tuple(dims) * dim = len(dims) # <<<<<<<<<<<<<< * if dim == 0: pass * elif dim == 1: M, = dims */ __pyx_t_2 = PyObject_Length(__pyx_v_dims); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(23, 141, __pyx_L1_error) __pyx_v_dim = ((PetscInt)__pyx_t_2); /* "PETSc/petscdmstag.pxi":142 * dims = tuple(dims) * dim = len(dims) * if dim == 0: pass # <<<<<<<<<<<<<< * elif dim == 1: M, = dims * elif dim == 2: M, N = dims */ __pyx_t_3 = ((__pyx_v_dim == 0) != 0); if (__pyx_t_3) { goto __pyx_L3; } /* "PETSc/petscdmstag.pxi":143 * dim = len(dims) * if dim == 0: pass * elif dim == 1: M, = dims # <<<<<<<<<<<<<< * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims */ __pyx_t_3 = ((__pyx_v_dim == 1) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 1)) { if (size > 1) __Pyx_RaiseTooManyValuesError(1); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 143, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); } __Pyx_INCREF(__pyx_t_1); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 1) < 0) __PYX_ERR(23, 143, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 143, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3; } /* "PETSc/petscdmstag.pxi":144 * if dim == 0: pass * elif dim == 1: M, = dims * elif dim == 2: M, N = dims # <<<<<<<<<<<<<< * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) */ __pyx_t_3 = ((__pyx_v_dim == 2) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 144, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_6), 2) < 0) __PYX_ERR(23, 144, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 144, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } /* "PETSc/petscdmstag.pxi":145 * elif dim == 1: M, = dims * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims # <<<<<<<<<<<<<< * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) */ __pyx_t_3 = ((__pyx_v_dim == 3) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dims))) || (PyList_CheckExact(__pyx_v_dims))) { PyObject* sequence = __pyx_v_dims; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 145, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_5(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_7), 3) < 0) __PYX_ERR(23, 145, __pyx_L1_error) __pyx_t_5 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_5 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 145, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_M, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_P, __pyx_t_6); __pyx_t_6 = 0; } __pyx_L3:; /* "PETSc/petscdmstag.pxi":146 * elif dim == 2: M, N = dims * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) # <<<<<<<<<<<<<< * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) */ __pyx_t_3 = ((__pyx_v_dim >= 1) != 0); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_M); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(23, 146, __pyx_L1_error) (__pyx_v__M[0]) = __pyx_t_8; } /* "PETSc/petscdmstag.pxi":147 * elif dim == 3: M, N, P = dims * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) # <<<<<<<<<<<<<< * if dim >= 3: _P[0] = asInt(P) * return dim */ __pyx_t_3 = ((__pyx_v_dim >= 2) != 0); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_N); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(23, 147, __pyx_L1_error) (__pyx_v__N[0]) = __pyx_t_8; } /* "PETSc/petscdmstag.pxi":148 * if dim >= 1: _M[0] = asInt(M) * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) # <<<<<<<<<<<<<< * return dim * */ __pyx_t_3 = ((__pyx_v_dim >= 3) != 0); if (__pyx_t_3) { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_P); if (unlikely(__pyx_t_8 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(23, 148, __pyx_L1_error) (__pyx_v__P[0]) = __pyx_t_8; } /* "PETSc/petscdmstag.pxi":149 * if dim >= 2: _N[0] = asInt(N) * if dim >= 3: _P[0] = asInt(P) * return dim # <<<<<<<<<<<<<< * * cdef inline tuple toStagDims(PetscInt dim, */ __pyx_r = __pyx_v_dim; goto __pyx_L0; /* "PETSc/petscdmstag.pxi":134 * * * cdef inline PetscInt asStagDims(dims, # <<<<<<<<<<<<<< * PetscInt *_M, * PetscInt *_N, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.asStagDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_M); __Pyx_XDECREF(__pyx_v_N); __Pyx_XDECREF(__pyx_v_P); __Pyx_XDECREF(__pyx_v_dims); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":151 * return dim * * cdef inline tuple toStagDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagDims(PetscInt __pyx_v_dim, PetscInt __pyx_v_M, PetscInt __pyx_v_N, PetscInt __pyx_v_P) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toStagDims", 0); /* "PETSc/petscdmstag.pxi":155 * PetscInt N, * PetscInt P): * if dim == 0: return () # <<<<<<<<<<<<<< * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) */ __pyx_t_1 = ((__pyx_v_dim == 0) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":156 * PetscInt P): * if dim == 0: return () * elif dim == 1: return (toInt(M),) # <<<<<<<<<<<<<< * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) */ __pyx_t_1 = ((__pyx_v_dim == 1) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":157 * if dim == 0: return () * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) # <<<<<<<<<<<<<< * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * */ __pyx_t_1 = ((__pyx_v_dim == 2) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":158 * elif dim == 1: return (toInt(M),) * elif dim == 2: return (toInt(M), toInt(N)) * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) # <<<<<<<<<<<<<< * * cdef inline PetscInt asDofs(dofs, */ __pyx_t_1 = ((__pyx_v_dim == 3) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_P); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":151 * return dim * * cdef inline tuple toStagDims(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt M, * PetscInt N, */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toStagDims", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":160 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline PetscInt asDofs(dofs, # <<<<<<<<<<<<<< * PetscInt *_dof0, * PetscInt *_dof1, */ static CYTHON_INLINE PetscInt __pyx_f_8petsc4py_5PETSc_asDofs(PyObject *__pyx_v_dofs, PetscInt *__pyx_v__dof0, PetscInt *__pyx_v__dof1, PetscInt *__pyx_v__dof2, PetscInt *__pyx_v__dof3) { PetscInt __pyx_v_ndofs; PyObject *__pyx_v_dof0 = 0; PyObject *__pyx_v_dof1 = 0; PyObject *__pyx_v_dof2 = 0; PyObject *__pyx_v_dof3 = 0; PetscInt __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PetscInt __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asDofs", 0); __Pyx_INCREF(__pyx_v_dofs); /* "PETSc/petscdmstag.pxi":165 * PetscInt *_dof2, * PetscInt *_dof3) except? -1: * cdef PetscInt ndofs = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef object dof0=None, dof1=None, dof2=None, dof3=None * dofs = tuple(dofs) */ __pyx_v_ndofs = PETSC_DECIDE; /* "PETSc/petscdmstag.pxi":166 * PetscInt *_dof3) except? -1: * cdef PetscInt ndofs = PETSC_DECIDE * cdef object dof0=None, dof1=None, dof2=None, dof3=None # <<<<<<<<<<<<<< * dofs = tuple(dofs) * ndofs = len(dofs) */ __Pyx_INCREF(Py_None); __pyx_v_dof0 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dof1 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dof2 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_dof3 = Py_None; /* "PETSc/petscdmstag.pxi":167 * cdef PetscInt ndofs = PETSC_DECIDE * cdef object dof0=None, dof1=None, dof2=None, dof3=None * dofs = tuple(dofs) # <<<<<<<<<<<<<< * ndofs = len(dofs) * if ndofs == 2: dof0, dof1 = dofs */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dofs, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmstag.pxi":168 * cdef object dof0=None, dof1=None, dof2=None, dof3=None * dofs = tuple(dofs) * ndofs = len(dofs) # <<<<<<<<<<<<<< * if ndofs == 2: dof0, dof1 = dofs * elif ndofs == 3: dof0, dof1, dof2 = dofs */ __pyx_t_2 = PyObject_Length(__pyx_v_dofs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(23, 168, __pyx_L1_error) __pyx_v_ndofs = ((PetscInt)__pyx_t_2); /* "PETSc/petscdmstag.pxi":169 * dofs = tuple(dofs) * ndofs = len(dofs) * if ndofs == 2: dof0, dof1 = dofs # <<<<<<<<<<<<<< * elif ndofs == 3: dof0, dof1, dof2 = dofs * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs */ __pyx_t_3 = ((__pyx_v_ndofs == 2) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) { PyObject* sequence = __pyx_v_dofs; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 169, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(23, 169, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 169, __pyx_L1_error) __pyx_L5_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } /* "PETSc/petscdmstag.pxi":170 * ndofs = len(dofs) * if ndofs == 2: dof0, dof1 = dofs * elif ndofs == 3: dof0, dof1, dof2 = dofs # <<<<<<<<<<<<<< * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs * if ndofs >= 2: _dof0[0] = asInt(dof0) */ __pyx_t_3 = ((__pyx_v_ndofs == 3) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) { PyObject* sequence = __pyx_v_dofs; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 170, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_5 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_7), 3) < 0) __PYX_ERR(23, 170, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 170, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dof2, __pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3; } /* "PETSc/petscdmstag.pxi":171 * if ndofs == 2: dof0, dof1 = dofs * elif ndofs == 3: dof0, dof1, dof2 = dofs * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs # <<<<<<<<<<<<<< * if ndofs >= 2: _dof0[0] = asInt(dof0) * if ndofs >= 2: _dof1[0] = asInt(dof1) */ __pyx_t_3 = ((__pyx_v_ndofs == 4) != 0); if (__pyx_t_3) { if ((likely(PyTuple_CheckExact(__pyx_v_dofs))) || (PyList_CheckExact(__pyx_v_dofs))) { PyObject* sequence = __pyx_v_dofs; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(23, 171, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_7 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_4,&__pyx_t_7}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(23, 171, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_1,&__pyx_t_4,&__pyx_t_7}; __pyx_t_8 = PyObject_GetIter(__pyx_v_dofs); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_6(__pyx_t_8); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_8), 4) < 0) __PYX_ERR(23, 171, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(23, 171, __pyx_L1_error) __pyx_L9_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_dof0, __pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_dof1, __pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_dof2, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_dof3, __pyx_t_7); __pyx_t_7 = 0; } __pyx_L3:; /* "PETSc/petscdmstag.pxi":172 * elif ndofs == 3: dof0, dof1, dof2 = dofs * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs * if ndofs >= 2: _dof0[0] = asInt(dof0) # <<<<<<<<<<<<<< * if ndofs >= 2: _dof1[0] = asInt(dof1) * if ndofs >= 3: _dof2[0] = asInt(dof2) */ __pyx_t_3 = ((__pyx_v_ndofs >= 2) != 0); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof0); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(23, 172, __pyx_L1_error) (__pyx_v__dof0[0]) = __pyx_t_9; } /* "PETSc/petscdmstag.pxi":173 * elif ndofs == 4: dof0, dof1, dof2, dof3 = dofs * if ndofs >= 2: _dof0[0] = asInt(dof0) * if ndofs >= 2: _dof1[0] = asInt(dof1) # <<<<<<<<<<<<<< * if ndofs >= 3: _dof2[0] = asInt(dof2) * if ndofs >= 4: _dof3[0] = asInt(dof3) */ __pyx_t_3 = ((__pyx_v_ndofs >= 2) != 0); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof1); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(23, 173, __pyx_L1_error) (__pyx_v__dof1[0]) = __pyx_t_9; } /* "PETSc/petscdmstag.pxi":174 * if ndofs >= 2: _dof0[0] = asInt(dof0) * if ndofs >= 2: _dof1[0] = asInt(dof1) * if ndofs >= 3: _dof2[0] = asInt(dof2) # <<<<<<<<<<<<<< * if ndofs >= 4: _dof3[0] = asInt(dof3) * return ndofs */ __pyx_t_3 = ((__pyx_v_ndofs >= 3) != 0); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof2); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(23, 174, __pyx_L1_error) (__pyx_v__dof2[0]) = __pyx_t_9; } /* "PETSc/petscdmstag.pxi":175 * if ndofs >= 2: _dof1[0] = asInt(dof1) * if ndofs >= 3: _dof2[0] = asInt(dof2) * if ndofs >= 4: _dof3[0] = asInt(dof3) # <<<<<<<<<<<<<< * return ndofs * */ __pyx_t_3 = ((__pyx_v_ndofs >= 4) != 0); if (__pyx_t_3) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof3); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(23, 175, __pyx_L1_error) (__pyx_v__dof3[0]) = __pyx_t_9; } /* "PETSc/petscdmstag.pxi":176 * if ndofs >= 3: _dof2[0] = asInt(dof2) * if ndofs >= 4: _dof3[0] = asInt(dof3) * return ndofs # <<<<<<<<<<<<<< * * cdef inline tuple toDofs(PetscInt ndofs, */ __pyx_r = __pyx_v_ndofs; goto __pyx_L0; /* "PETSc/petscdmstag.pxi":160 * elif dim == 3: return (toInt(M), toInt(N), toInt(P)) * * cdef inline PetscInt asDofs(dofs, # <<<<<<<<<<<<<< * PetscInt *_dof0, * PetscInt *_dof1, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.asDofs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1L; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dof0); __Pyx_XDECREF(__pyx_v_dof1); __Pyx_XDECREF(__pyx_v_dof2); __Pyx_XDECREF(__pyx_v_dof3); __Pyx_XDECREF(__pyx_v_dofs); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":178 * return ndofs * * cdef inline tuple toDofs(PetscInt ndofs, # <<<<<<<<<<<<<< * PetscInt dof0, * PetscInt dof1, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toDofs(PetscInt __pyx_v_ndofs, PetscInt __pyx_v_dof0, PetscInt __pyx_v_dof1, PetscInt __pyx_v_dof2, PetscInt __pyx_v_dof3) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDofs", 0); /* "PETSc/petscdmstag.pxi":183 * PetscInt dof2, * PetscInt dof3): * if ndofs == 2: return (toInt(dof0), toInt(dof1)) # <<<<<<<<<<<<<< * elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) */ __pyx_t_1 = ((__pyx_v_ndofs == 2) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":184 * PetscInt dof3): * if ndofs == 2: return (toInt(dof0), toInt(dof1)) * elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) # <<<<<<<<<<<<<< * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) * */ __pyx_t_1 = ((__pyx_v_ndofs == 3) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof2); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":185 * if ndofs == 2: return (toInt(dof0), toInt(dof1)) * elif ndofs == 3: return (toInt(dof0), toInt(dof1), toInt(dof2)) * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) # <<<<<<<<<<<<<< * * cdef inline tuple asStagOwnershipRanges(object ownership_ranges, */ __pyx_t_1 = ((__pyx_v_ndofs == 4) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof0); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof1); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof2); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof3); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":178 * return ndofs * * cdef inline tuple toDofs(PetscInt ndofs, # <<<<<<<<<<<<<< * PetscInt dof0, * PetscInt dof1, */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.toDofs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":187 * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) * * cdef inline tuple asStagOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(PyObject *__pyx_v_ownership_ranges, PetscInt __pyx_v_dim, PetscInt *__pyx_v_m, PetscInt *__pyx_v_n, PetscInt *__pyx_v_p, PetscInt **__pyx_v__x, PetscInt **__pyx_v__y, PetscInt **__pyx_v__z) { PyObject *__pyx_v_ranges = 0; PetscInt __pyx_v_rdim; PetscInt __pyx_v_nlx; PetscInt __pyx_v_nly; PetscInt __pyx_v_nlz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("asStagOwnershipRanges", 0); /* "PETSc/petscdmstag.pxi":193 * PetscInt **_y, * PetscInt **_z): * cdef object ranges = list(ownership_ranges) # <<<<<<<<<<<<<< * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 */ __pyx_t_1 = PySequence_List(__pyx_v_ownership_ranges); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ranges = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdmstag.pxi":194 * PetscInt **_z): * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) # <<<<<<<<<<<<<< * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim */ __pyx_t_2 = PyObject_Length(__pyx_v_ranges); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(23, 194, __pyx_L1_error) __pyx_v_rdim = ((PetscInt)__pyx_t_2); /* "PETSc/petscdmstag.pxi":195 * cdef object ranges = list(ownership_ranges) * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( */ __pyx_v_nlx = 0; __pyx_v_nly = 0; __pyx_v_nlz = 0; /* "PETSc/petscdmstag.pxi":196 * cdef PetscInt rdim = len(ranges) * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim # <<<<<<<<<<<<<< * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % */ __pyx_t_3 = ((__pyx_v_dim == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_dim = __pyx_v_rdim; goto __pyx_L3; } /* "PETSc/petscdmstag.pxi":197 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_3 = ((__pyx_v_dim != __pyx_v_rdim) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmstag.pxi":199 * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) # <<<<<<<<<<<<<< * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "PETSc/petscdmstag.pxi":198 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( * "number of dimensions %d and number ownership ranges %d" % # <<<<<<<<<<<<<< * (toInt(dim), toInt(rdim))) * if dim >= 1: */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmstag.pxi":197 * cdef PetscInt nlx=0, nly=0, nlz=0 * if dim == PETSC_DECIDE: dim = rdim * elif dim != rdim: raise ValueError( # <<<<<<<<<<<<<< * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(23, 197, __pyx_L1_error) } __pyx_L3:; /* "PETSc/petscdmstag.pxi":200 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ __pyx_t_3 = ((__pyx_v_dim >= 1) != 0); if (__pyx_t_3) { /* "PETSc/petscdmstag.pxi":201 * (toInt(dim), toInt(rdim))) * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) # <<<<<<<<<<<<<< * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(23, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdmstag.pxi":202 * if dim >= 1: * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx # <<<<<<<<<<<<<< * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = (((__pyx_v_m[0]) == PETSC_DECIDE) != 0); if (__pyx_t_3) { (__pyx_v_m[0]) = __pyx_v_nlx; goto __pyx_L5; } /* "PETSc/petscdmstag.pxi":203 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_3 = (((__pyx_v_m[0]) != __pyx_v_nlx) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmstag.pxi":205 * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) # <<<<<<<<<<<<<< * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlx); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; /* "PETSc/petscdmstag.pxi":204 * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlx), toInt(m[0]))) * if dim >= 2: */ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmstag.pxi":203 * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx * elif m[0] != nlx: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(23, 203, __pyx_L1_error) } __pyx_L5:; /* "PETSc/petscdmstag.pxi":200 * "number of dimensions %d and number ownership ranges %d" % * (toInt(dim), toInt(rdim))) * if dim >= 1: # <<<<<<<<<<<<<< * ranges[0] = iarray_i(ranges[0], &nlx, _x) * if m[0] == PETSC_DECIDE: m[0] = nlx */ } /* "PETSc/petscdmstag.pxi":206 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ __pyx_t_3 = ((__pyx_v_dim >= 2) != 0); if (__pyx_t_3) { /* "PETSc/petscdmstag.pxi":207 * (toInt(nlx), toInt(m[0]))) * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) # <<<<<<<<<<<<<< * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(23, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmstag.pxi":208 * if dim >= 2: * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly # <<<<<<<<<<<<<< * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = (((__pyx_v_n[0]) == PETSC_DECIDE) != 0); if (__pyx_t_3) { (__pyx_v_n[0]) = __pyx_v_nly; goto __pyx_L7; } /* "PETSc/petscdmstag.pxi":209 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_3 = (((__pyx_v_n[0]) != __pyx_v_nly) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmstag.pxi":211 * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) # <<<<<<<<<<<<<< * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; /* "PETSc/petscdmstag.pxi":210 * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nly), toInt(n[0]))) * if dim >= 3: */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/petscdmstag.pxi":209 * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly * elif n[0] != nly: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(23, 209, __pyx_L1_error) } __pyx_L7:; /* "PETSc/petscdmstag.pxi":206 * "ownership range size %d and number or processors %d" % * (toInt(nlx), toInt(m[0]))) * if dim >= 2: # <<<<<<<<<<<<<< * ranges[1] = iarray_i(ranges[1], &nly, _y) * if n[0] == PETSC_DECIDE: n[0] = nly */ } /* "PETSc/petscdmstag.pxi":212 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ __pyx_t_3 = ((__pyx_v_dim >= 3) != 0); if (__pyx_t_3) { /* "PETSc/petscdmstag.pxi":213 * (toInt(nly), toInt(n[0]))) * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) # <<<<<<<<<<<<<< * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ranges, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_4, (&__pyx_v_nlz), __pyx_v__z)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_ranges, 2, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(23, 213, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmstag.pxi":214 * if dim >= 3: * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz # <<<<<<<<<<<<<< * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % */ __pyx_t_3 = (((__pyx_v_p[0]) == PETSC_DECIDE) != 0); if (__pyx_t_3) { (__pyx_v_p[0]) = __pyx_v_nlz; goto __pyx_L9; } /* "PETSc/petscdmstag.pxi":215 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_3 = (((__pyx_v_p[0]) != __pyx_v_nlz) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/petscdmstag.pxi":217 * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; /* "PETSc/petscdmstag.pxi":216 * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( * "ownership range size %d and number or processors %d" % # <<<<<<<<<<<<<< * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/petscdmstag.pxi":215 * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz * elif p[0] != nlz: raise ValueError( # <<<<<<<<<<<<<< * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(23, 215, __pyx_L1_error) } __pyx_L9:; /* "PETSc/petscdmstag.pxi":212 * "ownership range size %d and number or processors %d" % * (toInt(nly), toInt(n[0]))) * if dim >= 3: # <<<<<<<<<<<<<< * ranges[2] = iarray_i(ranges[2], &nlz, _z) * if p[0] == PETSC_DECIDE: p[0] = nlz */ } /* "PETSc/petscdmstag.pxi":218 * "ownership range size %d and number or processors %d" % * (toInt(nlz), toInt(p[0]))) * return tuple(ranges) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/petscdmstag.pxi":187 * elif ndofs == 4: return (toInt(dof0), toInt(dof1), toInt(dof2), toInt(dof3)) * * cdef inline tuple asStagOwnershipRanges(object ownership_ranges, # <<<<<<<<<<<<<< * PetscInt dim, * PetscInt *m, PetscInt *n, PetscInt *p, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.asStagOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":221 * * * cdef inline tuple toStagOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagOwnershipRanges(PetscInt __pyx_v_dim, PetscInt __pyx_v_m, PetscInt __pyx_v_n, PetscInt __pyx_v_p, PetscInt const *__pyx_v_lx, PetscInt const *__pyx_v_ly, PetscInt const *__pyx_v_lz) { PyObject *__pyx_v_ranges = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toStagOwnershipRanges", 0); /* "PETSc/petscdmstag.pxi":227 * const PetscInt *lz): * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] # <<<<<<<<<<<<<< * if dim > 1: * ranges.append(array_i(n, ly)) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_m, __pyx_v_lx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_ranges = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmstag.pxi":228 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ __pyx_t_3 = ((__pyx_v_dim > 1) != 0); if (__pyx_t_3) { /* "PETSc/petscdmstag.pxi":229 * ranges = [array_i(m, lx)] * if dim > 1: * ranges.append(array_i(n, ly)) # <<<<<<<<<<<<<< * if dim > 2: * ranges.append(array_i(p, lz)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_n, __pyx_v_ly)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(23, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmstag.pxi":228 * # Returns tuple of arrays containing ownership ranges as Python arrays * ranges = [array_i(m, lx)] * if dim > 1: # <<<<<<<<<<<<<< * ranges.append(array_i(n, ly)) * if dim > 2: */ } /* "PETSc/petscdmstag.pxi":230 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ __pyx_t_3 = ((__pyx_v_dim > 2) != 0); if (__pyx_t_3) { /* "PETSc/petscdmstag.pxi":231 * ranges.append(array_i(n, ly)) * if dim > 2: * ranges.append(array_i(p, lz)) # <<<<<<<<<<<<<< * return tuple(ranges) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_p, __pyx_v_lz)); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_ranges, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(23, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmstag.pxi":230 * if dim > 1: * ranges.append(array_i(n, ly)) * if dim > 2: # <<<<<<<<<<<<<< * ranges.append(array_i(p, lz)) * return tuple(ranges) */ } /* "PETSc/petscdmstag.pxi":232 * if dim > 2: * ranges.append(array_i(p, lz)) * return tuple(ranges) # <<<<<<<<<<<<<< * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyList_AsTuple(__pyx_v_ranges); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/petscdmstag.pxi":221 * * * cdef inline tuple toStagOwnershipRanges(PetscInt dim, # <<<<<<<<<<<<<< * PetscInt m, PetscInt n, PetscInt p, * const PetscInt *lx, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.toStagOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":234 * return tuple(ranges) * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): # <<<<<<<<<<<<<< * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundary(DMBoundaryType __pyx_v_btype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("toStagBoundary", 0); /* "PETSc/petscdmstag.pxi":235 * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): * if btype == DM_BOUNDARY_NONE: return "none" # <<<<<<<<<<<<<< * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" */ __pyx_t_1 = ((__pyx_v_btype == DM_BOUNDARY_NONE) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_none); __pyx_r = __pyx_n_s_none; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":236 * cdef inline object toStagBoundary(PetscDMBoundaryType btype): * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" # <<<<<<<<<<<<<< * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" * */ __pyx_t_1 = ((__pyx_v_btype == DM_BOUNDARY_PERIODIC) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_periodic); __pyx_r = __pyx_n_s_periodic; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":237 * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" # <<<<<<<<<<<<<< * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): */ __pyx_t_1 = ((__pyx_v_btype == DM_BOUNDARY_GHOSTED) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_ghosted); __pyx_r = __pyx_n_s_ghosted; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":234 * return tuple(ranges) * * cdef inline object toStagBoundary(PetscDMBoundaryType btype): # <<<<<<<<<<<<<< * if btype == DM_BOUNDARY_NONE: return "none" * elif btype == DM_BOUNDARY_PERIODIC: return "periodic" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmstag.pxi":239 * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): # <<<<<<<<<<<<<< * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) */ static CYTHON_INLINE PyObject *__pyx_f_8petsc4py_5PETSc_toStagBoundaryTypes(PetscInt __pyx_v_dim, DMBoundaryType __pyx_v_btx, DMBoundaryType __pyx_v_bty, DMBoundaryType __pyx_v_btz) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toStagBoundaryTypes", 0); /* "PETSc/petscdmstag.pxi":240 * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): * if dim == 1: return (toStagBoundary(btx), ) # <<<<<<<<<<<<<< * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) * if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) */ __pyx_t_1 = ((__pyx_v_dim == 1) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":241 * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) # <<<<<<<<<<<<<< * if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) * */ __pyx_t_1 = ((__pyx_v_dim == 2) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_bty); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":242 * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) * if dim == 3: return (toStagBoundary(btx), toStagBoundary(bty), toStagBoundary(btz)) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = ((__pyx_v_dim == 3) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btx); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_bty); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toStagBoundary(__pyx_v_btz); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/petscdmstag.pxi":239 * elif btype == DM_BOUNDARY_GHOSTED: return "ghosted" * * cdef inline tuple toStagBoundaryTypes(PetscInt dim, PetscDMBoundaryType btx, PetscDMBoundaryType bty, PetscDMBoundaryType btz): # <<<<<<<<<<<<<< * if dim == 1: return (toStagBoundary(btx), ) * if dim == 2: return (toStagBoundary(btx), toStagBoundary(bty)) */ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.toStagBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmcomposite.pxi":27 * cdef object access * * def __cinit__(self, DM dm, Vec gvec, locs=None): # <<<<<<<<<<<<<< * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_locs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,&__pyx_n_s_gvec,&__pyx_n_s_locs,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gvec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(24, 27, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_locs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(24, 27, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); __pyx_v_gvec = ((struct PyPetscVecObject *)values[1]); __pyx_v_locs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(24, 27, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(24, 27, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(24, 27, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self), __pyx_v_dm, __pyx_v_gvec, __pyx_v_locs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access___cinit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs) { int __pyx_r; __Pyx_RefNannyDeclarations DM __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_locs); /* "PETSc/petscdmcomposite.pxi":28 * * def __cinit__(self, DM dm, Vec gvec, locs=None): * self.dm = dm.dm # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&self.dm) ) * self.gvec = gvec.vec */ __pyx_t_1 = __pyx_v_dm->dm; __pyx_v_self->dm = __pyx_t_1; /* "PETSc/petscdmcomposite.pxi":29 * def __cinit__(self, DM dm, Vec gvec, locs=None): * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) # <<<<<<<<<<<<<< * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_self->dm)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(24, 29, __pyx_L1_error) /* "PETSc/petscdmcomposite.pxi":30 * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) * self.gvec = gvec.vec # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: */ __pyx_t_3 = __pyx_v_gvec->vec; __pyx_v_self->gvec = __pyx_t_3; /* "PETSc/petscdmcomposite.pxi":31 * CHKERR( PetscINCREF(&self.dm) ) * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) # <<<<<<<<<<<<<< * if locs is None: * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&__pyx_v_self->gvec)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(24, 31, __pyx_L1_error) /* "PETSc/petscdmcomposite.pxi":32 * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) */ __pyx_t_4 = (__pyx_v_locs == Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { /* "PETSc/petscdmcomposite.pxi":33 * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) # <<<<<<<<<<<<<< * locs = arange(0, self.nlocs, 1) * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->dm, (&__pyx_v_self->nlocs))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(24, 33, __pyx_L1_error) /* "PETSc/petscdmcomposite.pxi":34 * if locs is None: * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) # <<<<<<<<<<<<<< * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) */ __pyx_t_6 = __Pyx_PyInt_From_long(((long)__pyx_v_self->nlocs)); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_int_0, __pyx_t_6, __pyx_int_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_locs, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscdmcomposite.pxi":32 * self.gvec = gvec.vec * CHKERR( PetscINCREF(&self.gvec) ) * if locs is None: # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) */ } /* "PETSc/petscdmcomposite.pxi":35 * CHKERR( DMCompositeGetNumberDM(self.dm, &self.nlocs) ) * locs = arange(0, self.nlocs, 1) * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) # <<<<<<<<<<<<<< * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) * self.access = None */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_locs, (&__pyx_v_self->nlocs), (&__pyx_v_self->locs))); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __Pyx_GOTREF(__pyx_v_self->locs_mem); __Pyx_DECREF(__pyx_v_self->locs_mem); __pyx_v_self->locs_mem = __pyx_t_7; __pyx_t_7 = 0; /* "PETSc/petscdmcomposite.pxi":36 * locs = arange(0, self.nlocs, 1) * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) # <<<<<<<<<<<<<< * self.access = None * */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_self->nlocs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_7, NULL, ((void **)(&__pyx_v_self->vecs)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->vecs_mem); __Pyx_DECREF(__pyx_v_self->vecs_mem); __pyx_v_self->vecs_mem = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmcomposite.pxi":37 * self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs) * self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, &self.vecs) * self.access = None # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->access); __Pyx_DECREF(__pyx_v_self->access); __pyx_v_self->access = Py_None; /* "PETSc/petscdmcomposite.pxi":27 * cdef object access * * def __cinit__(self, DM dm, Vec gvec, locs=None): # <<<<<<<<<<<<<< * self.dm = dm.dm * CHKERR( PetscINCREF(&self.dm) ) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_locs); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmcomposite.pxi":39 * self.access = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&self.dm) ) * CHKERR( VecDestroy(&self.gvec) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/petscdmcomposite.pxi":40 * * def __dealloc__(self): * CHKERR( DMDestroy(&self.dm) ) # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&self.gvec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDestroy((&__pyx_v_self->dm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 40, __pyx_L1_error) /* "PETSc/petscdmcomposite.pxi":41 * def __dealloc__(self): * CHKERR( DMDestroy(&self.dm) ) * CHKERR( VecDestroy(&self.gvec) ) # <<<<<<<<<<<<<< * * def __enter__(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->gvec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(24, 41, __pyx_L1_error) /* "PETSc/petscdmcomposite.pxi":39 * self.access = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&self.dm) ) * CHKERR( VecDestroy(&self.gvec) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc._DMComposite_access.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/petscdmcomposite.pxi":43 * CHKERR( VecDestroy(&self.gvec) ) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_4__enter__[] = "_DMComposite_access.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_4__enter__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self) { Py_ssize_t __pyx_v_n; Py_ssize_t __pyx_7genexpr__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/petscdmcomposite.pxi":44 * * def __enter__(self): * cdef Py_ssize_t i, n = self.nlocs # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_v_self->nlocs; __pyx_v_n = __pyx_t_1; /* "PETSc/petscdmcomposite.pxi":45 * def __enter__(self): * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) # <<<<<<<<<<<<<< * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] * return tuple(self.access) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetAccessArray(__pyx_v_self->dm, __pyx_v_self->gvec, __pyx_v_self->nlocs, __pyx_v_self->locs, __pyx_v_self->vecs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(24, 45, __pyx_L1_error) /* "PETSc/petscdmcomposite.pxi":46 * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * return tuple(self.access) * */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_n; for (__pyx_7genexpr__pyx_v_i = 0; __pyx_7genexpr__pyx_v_i < __pyx_t_4; __pyx_7genexpr__pyx_v_i++) { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_self->vecs[__pyx_7genexpr__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(24, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->access); __Pyx_DECREF(__pyx_v_self->access); __pyx_v_self->access = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/petscdmcomposite.pxi":47 * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = [ref_Vec(self.vecs[i]) for i from 0 <= i < n] * return tuple(self.access) # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_self->access); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/petscdmcomposite.pxi":43 * CHKERR( VecDestroy(&self.gvec) ) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * CHKERR( DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmcomposite.pxi":49 * return tuple(self.access) * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_6__exit__[] = "_DMComposite_access.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_19_DMComposite_access_6__exit__(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/petscdmcomposite.pxi":50 * * def __exit__(self, *exc): * cdef Py_ssize_t i, n = self.nlocs # <<<<<<<<<<<<<< * for i from 0 <= i < n: (self.access[i]).vec = NULL * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) */ __pyx_t_1 = __pyx_v_self->nlocs; __pyx_v_n = __pyx_t_1; /* "PETSc/petscdmcomposite.pxi":51 * def __exit__(self, *exc): * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = None */ __pyx_t_2 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->access, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); ((struct PyPetscVecObject *)__pyx_t_3)->vec = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/petscdmcomposite.pxi":52 * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) # <<<<<<<<<<<<<< * self.access = None */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeRestoreAccessArray(__pyx_v_self->dm, __pyx_v_self->gvec, __pyx_v_self->nlocs, __pyx_v_self->locs, __pyx_v_self->vecs)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(24, 52, __pyx_L1_error) /* "PETSc/petscdmcomposite.pxi":53 * for i from 0 <= i < n: (self.access[i]).vec = NULL * CHKERR( DMCompositeRestoreAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs) ) * self.access = None # <<<<<<<<<<<<<< */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->access); __Pyx_DECREF(__pyx_v_self->access); __pyx_v_self->access = Py_None; /* "PETSc/petscdmcomposite.pxi":49 * return tuple(self.access) * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = self.nlocs * for i from 0 <= i < n: (self.access[i]).vec = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc._DMComposite_access.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/petscdmshell.pxi":74 * * * cdef int DMSHELL_CreateGlobalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateGlobalVector(DM __pyx_v_dm, Vec *__pyx_v_v) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_create_gvec = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; DM __pyx_v_odm; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Vec __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateGlobalVector", 0); /* "PETSc/petscdmshell.pxi":77 * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec vec * Dm.dm = dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 77, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":79 * cdef DM Dm = subtype_DM(dm)() * cdef Vec vec * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_global_vector__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":80 * cdef Vec vec * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_global_vector__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":81 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_global_vector__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (create_gvec, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_global_vector__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":82 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_global_vector__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (create_gvec, args, kargs) = context * vec = create_gvec(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 82, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":83 * context = Dm.get_attr('__create_global_vector__') * assert context is not None and type(context) is tuple * (create_gvec, args, kargs) = context # <<<<<<<<<<<<<< * vec = create_gvec(Dm, *args, **kargs) * PetscINCREF(vec.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 83, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 83, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 83, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_create_gvec = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":84 * assert context is not None and type(context) is tuple * (create_gvec, args, kargs) = context * vec = create_gvec(Dm, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * v[0] = vec.vec */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 84, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_gvec, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(25, 84, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":85 * (create_gvec, args, kargs) = context * vec = create_gvec(Dm, *args, **kargs) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * v[0] = vec.vec * cdef PetscDM odm = NULL */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":86 * vec = create_gvec(Dm, *args, **kargs) * PetscINCREF(vec.obj) * v[0] = vec.vec # <<<<<<<<<<<<<< * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) */ __pyx_t_9 = __pyx_v_vec->vec; (__pyx_v_v[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":87 * PetscINCREF(vec.obj) * v[0] = vec.vec * cdef PetscDM odm = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: */ __pyx_v_odm = NULL; /* "PETSc/petscdmshell.pxi":88 * v[0] = vec.vec * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) # <<<<<<<<<<<<<< * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(25, 88, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":89 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return 0 */ __pyx_t_3 = ((__pyx_v_odm == NULL) != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":90 * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(25, 90, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":89 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return 0 */ } /* "PETSc/petscdmshell.pxi":91 * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateLocalVector( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":74 * * * cdef int DMSHELL_CreateGlobalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_create_gvec); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":93 * return 0 * * cdef int DMSHELL_CreateLocalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateLocalVector(DM __pyx_v_dm, Vec *__pyx_v_v) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_create_lvec = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; DM __pyx_v_odm; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Vec __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateLocalVector", 0); /* "PETSc/petscdmshell.pxi":96 * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec vec * Dm.dm = dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 96, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":98 * cdef DM Dm = subtype_DM(dm)() * cdef Vec vec * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_local_vector__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":99 * cdef Vec vec * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_local_vector__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":100 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_local_vector__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (create_lvec, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_local_vector__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":101 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_local_vector__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (create_lvec, args, kargs) = context * vec = create_lvec(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 101, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":102 * context = Dm.get_attr('__create_local_vector__') * assert context is not None and type(context) is tuple * (create_lvec, args, kargs) = context # <<<<<<<<<<<<<< * vec = create_lvec(Dm, *args, **kargs) * PetscINCREF(vec.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 102, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 102, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_create_lvec = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":103 * assert context is not None and type(context) is tuple * (create_lvec, args, kargs) = context * vec = create_lvec(Dm, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * v[0] = vec.vec */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 103, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_lvec, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(25, 103, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":104 * (create_lvec, args, kargs) = context * vec = create_lvec(Dm, *args, **kargs) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * v[0] = vec.vec * cdef PetscDM odm = NULL */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":105 * vec = create_lvec(Dm, *args, **kargs) * PetscINCREF(vec.obj) * v[0] = vec.vec # <<<<<<<<<<<<<< * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) */ __pyx_t_9 = __pyx_v_vec->vec; (__pyx_v_v[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":106 * PetscINCREF(vec.obj) * v[0] = vec.vec * cdef PetscDM odm = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: */ __pyx_v_odm = NULL; /* "PETSc/petscdmshell.pxi":107 * v[0] = vec.vec * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) # <<<<<<<<<<<<<< * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(25, 107, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":108 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return 0 */ __pyx_t_3 = ((__pyx_v_odm == NULL) != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":109 * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(25, 109, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":108 * cdef PetscDM odm = NULL * CHKERR( VecGetDM(v[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( VecSetDM(v[0], dm) ) * return 0 */ } /* "PETSc/petscdmshell.pxi":110 * if odm == NULL: * CHKERR( VecSetDM(v[0], dm) ) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_GlobalToLocalBegin( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":93 * return 0 * * cdef int DMSHELL_CreateLocalVector( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec *v) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_create_lvec); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":112 * return 0 * * cdef int DMSHELL_GlobalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_begin = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_GlobalToLocalBegin", 0); /* "PETSc/petscdmshell.pxi":117 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 117, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":118 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":119 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":120 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__g2l_begin__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":121 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__g2l_begin__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":122 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__g2l_begin__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (begin, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__g2l_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":123 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__g2l_begin__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 123, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":124 * context = Dm.get_attr('__g2l_begin__') * assert context is not None and type(context) is tuple * (begin, args, kargs) = context # <<<<<<<<<<<<<< * begin(Dm, gvec, mode, lvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 124, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 124, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 124, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_begin = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":125 * assert context is not None and type(context) is tuple * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_lvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_lvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 125, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":126 * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_GlobalToLocalEnd( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":112 * return 0 * * cdef int DMSHELL_GlobalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_GlobalToLocalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":128 * return 0 * * cdef int DMSHELL_GlobalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_GlobalToLocalEnd", 0); /* "PETSc/petscdmshell.pxi":133 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 133, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":134 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":135 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":136 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__g2l_end__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":137 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__g2l_end__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":138 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__g2l_end__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (end, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__g2l_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":139 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__g2l_end__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 139, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":140 * context = Dm.get_attr('__g2l_end__') * assert context is not None and type(context) is tuple * (end, args, kargs) = context # <<<<<<<<<<<<<< * end(Dm, gvec, mode, lvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 140, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 140, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 140, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_end = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":141 * assert context is not None and type(context) is tuple * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_lvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_lvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 141, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":142 * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_LocalToGlobalBegin( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":128 * return 0 * * cdef int DMSHELL_GlobalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_GlobalToLocalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":144 * return 0 * * cdef int DMSHELL_LocalToGlobalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_begin = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToGlobalBegin", 0); /* "PETSc/petscdmshell.pxi":149 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 149, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":150 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":151 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":152 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2g_begin__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":153 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2g_begin__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":154 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2g_begin__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (begin, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2g_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":155 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2g_begin__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 155, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":156 * context = Dm.get_attr('__l2g_begin__') * assert context is not None and type(context) is tuple * (begin, args, kargs) = context # <<<<<<<<<<<<<< * begin(Dm, gvec, mode, lvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 156, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 156, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 156, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_begin = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":157 * assert context is not None and type(context) is tuple * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_lvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_lvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 157, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":158 * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_LocalToGlobalEnd( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":144 * return 0 * * cdef int DMSHELL_LocalToGlobalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToGlobalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":160 * return 0 * * cdef int DMSHELL_LocalToGlobalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToGlobalEnd", 0); /* "PETSc/petscdmshell.pxi":165 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 165, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":166 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":167 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":168 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2g_end__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":169 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2g_end__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":170 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2g_end__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (end, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2g_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":171 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2g_end__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 171, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":172 * context = Dm.get_attr('__l2g_end__') * assert context is not None and type(context) is tuple * (end, args, kargs) = context # <<<<<<<<<<<<<< * end(Dm, gvec, mode, lvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 172, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 172, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 172, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_end = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":173 * assert context is not None and type(context) is tuple * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_lvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_lvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 173, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":174 * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_LocalToLocalBegin( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":160 * return 0 * * cdef int DMSHELL_LocalToGlobalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToGlobalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":176 * return 0 * * cdef int DMSHELL_LocalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalBegin(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_begin = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToLocalBegin", 0); /* "PETSc/petscdmshell.pxi":181 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 181, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":182 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":183 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":184 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2l_begin__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":185 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2l_begin__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":186 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2l_begin__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (begin, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2l_begin__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":187 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2l_begin__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 187, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":188 * context = Dm.get_attr('__l2l_begin__') * assert context is not None and type(context) is tuple * (begin, args, kargs) = context # <<<<<<<<<<<<<< * begin(Dm, gvec, mode, lvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 188, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 188, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 188, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_begin = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":189 * assert context is not None and type(context) is tuple * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_lvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_lvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 189, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":190 * (begin, args, kargs) = context * begin(Dm, gvec, mode, lvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_LocalToLocalEnd( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":176 * return 0 * * cdef int DMSHELL_LocalToLocalBegin( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToLocalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":192 * return 0 * * cdef int DMSHELL_LocalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalEnd(DM __pyx_v_dm, Vec __pyx_v_g, InsertMode __pyx_v_mode, Vec __pyx_v_l) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscVecObject *__pyx_v_gvec = 0; struct PyPetscVecObject *__pyx_v_lvec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_end = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_LocalToLocalEnd", 0); /* "PETSc/petscdmshell.pxi":197 * PetscInsertMode mode, * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 197, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":198 * PetscVec l) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) # <<<<<<<<<<<<<< * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":199 * cdef DM Dm = subtype_DM(dm)() * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":200 * cdef Vec gvec = ref_Vec(g) * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2l_end__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":201 * cdef Vec lvec = ref_Vec(l) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__l2l_end__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":202 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2l_end__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (end, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__l2l_end__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":203 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__l2l_end__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 203, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":204 * context = Dm.get_attr('__l2l_end__') * assert context is not None and type(context) is tuple * (end, args, kargs) = context # <<<<<<<<<<<<<< * end(Dm, gvec, mode, lvec, *args, **kargs) * return 0 */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 204, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 204, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 204, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_end = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":205 * assert context is not None and type(context) is tuple * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_6 = __Pyx_PyInt_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_lvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_lvec)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_lvec)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 205, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } else { __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":206 * (end, args, kargs) = context * end(Dm, gvec, mode, lvec, *args, **kargs) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateMatrix( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":192 * return 0 * * cdef int DMSHELL_LocalToLocalEnd( # <<<<<<<<<<<<<< * PetscDM dm, * PetscVec g, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_LocalToLocalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_gvec); __Pyx_XDECREF((PyObject *)__pyx_v_lvec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":208 * return 0 * * cdef int DMSHELL_CreateMatrix( # <<<<<<<<<<<<<< * PetscDM dm, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateMatrix(DM __pyx_v_dm, Mat *__pyx_v_cmat) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_matrix = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; DM __pyx_v_odm; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateMatrix", 0); /* "PETSc/petscdmshell.pxi":211 * PetscDM dm, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef Mat mat * Dm.dm = dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 211, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":213 * cdef DM Dm = subtype_DM(dm)() * cdef Mat mat * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_matrix__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":214 * cdef Mat mat * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_matrix__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":215 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_matrix__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (matrix, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_matrix__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":216 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_matrix__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (matrix, args, kargs) = context * mat = matrix(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 216, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":217 * context = Dm.get_attr('__create_matrix__') * assert context is not None and type(context) is tuple * (matrix, args, kargs) = context # <<<<<<<<<<<<<< * mat = matrix(Dm, *args, **kargs) * PetscINCREF(mat.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 217, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 217, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 217, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_matrix = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":218 * assert context is not None and type(context) is tuple * (matrix, args, kargs) = context * mat = matrix(Dm, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 218, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_matrix, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(25, 218, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":219 * (matrix, args, kargs) = context * mat = matrix(Dm, *args, **kargs) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * cdef PetscDM odm = NULL */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":220 * mat = matrix(Dm, *args, **kargs) * PetscINCREF(mat.obj) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":221 * PetscINCREF(mat.obj) * cmat[0] = mat.mat * cdef PetscDM odm = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: */ __pyx_v_odm = NULL; /* "PETSc/petscdmshell.pxi":222 * cmat[0] = mat.mat * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) # <<<<<<<<<<<<<< * if odm == NULL: * CHKERR( MatSetDM(cmat[0], dm) ) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDM((__pyx_v_cmat[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(25, 222, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":223 * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( MatSetDM(cmat[0], dm) ) * return 0 */ __pyx_t_3 = ((__pyx_v_odm == NULL) != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":224 * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: * CHKERR( MatSetDM(cmat[0], dm) ) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetDM((__pyx_v_cmat[0]), __pyx_v_dm)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(25, 224, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":223 * cdef PetscDM odm = NULL * CHKERR( MatGetDM(cmat[0], &odm) ) * if odm == NULL: # <<<<<<<<<<<<<< * CHKERR( MatSetDM(cmat[0], dm) ) * return 0 */ } /* "PETSc/petscdmshell.pxi":225 * if odm == NULL: * CHKERR( MatSetDM(cmat[0], dm) ) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_Coarsen( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":208 * return 0 * * cdef int DMSHELL_CreateMatrix( # <<<<<<<<<<<<<< * PetscDM dm, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_matrix); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":227 * return 0 * * cdef int DMSHELL_Coarsen( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_Coarsen(DM __pyx_v_dm, MPI_Comm __pyx_v_comm, DM *__pyx_v_dmc) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscCommObject *__pyx_v_Comm = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_coarsen = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); DM __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_Coarsen", 0); /* "PETSc/petscdmshell.pxi":231 * MPI_Comm comm, * PetscDM *dmc) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef DM Dmc * cdef Comm Comm = new_Comm(comm) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 231, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":233 * cdef DM Dm = subtype_DM(dm)() * cdef DM Dmc * cdef Comm Comm = new_Comm(comm) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":234 * cdef DM Dmc * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__coarsen__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":235 * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__coarsen__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":236 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__coarsen__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (coarsen, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__coarsen__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":237 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__coarsen__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (coarsen, args, kargs) = context * Dmc = coarsen(Dm, Comm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 237, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":238 * context = Dm.get_attr('__coarsen__') * assert context is not None and type(context) is tuple * (coarsen, args, kargs) = context # <<<<<<<<<<<<<< * Dmc = coarsen(Dm, Comm, *args, **kargs) * PetscINCREF(Dmc.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 238, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 238, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 238, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_coarsen = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":239 * assert context is not None and type(context) is tuple * (coarsen, args, kargs) = context * Dmc = coarsen(Dm, Comm, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(Dmc.obj) * dmc[0] = Dmc.dm */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_Comm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Comm)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Comm)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 239, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_coarsen, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 239, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":240 * (coarsen, args, kargs) = context * Dmc = coarsen(Dm, Comm, *args, **kargs) * PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<< * dmc[0] = Dmc.dm * return 0 */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":241 * Dmc = coarsen(Dm, Comm, *args, **kargs) * PetscINCREF(Dmc.obj) * dmc[0] = Dmc.dm # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_v_Dmc->dm; (__pyx_v_dmc[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":242 * PetscINCREF(Dmc.obj) * dmc[0] = Dmc.dm * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_Refine( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":227 * return 0 * * cdef int DMSHELL_Coarsen( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_Coarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_Comm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_coarsen); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":244 * return 0 * * cdef int DMSHELL_Refine( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_Refine(DM __pyx_v_dm, MPI_Comm __pyx_v_comm, DM *__pyx_v_dmf) { struct PyPetscDMObject *__pyx_v_Dm = 0; struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscCommObject *__pyx_v_Comm = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_refine = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); DM __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_Refine", 0); /* "PETSc/petscdmshell.pxi":248 * MPI_Comm comm, * PetscDM *dmf) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef DM Dmf * cdef Comm Comm = new_Comm(comm) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 248, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":250 * cdef DM Dm = subtype_DM(dm)() * cdef DM Dmf * cdef Comm Comm = new_Comm(comm) # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":251 * cdef DM Dmf * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__refine__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":252 * cdef Comm Comm = new_Comm(comm) * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__refine__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":253 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__refine__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (refine, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__refine__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":254 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__refine__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (refine, args, kargs) = context * Dmf = refine(Dm, Comm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 254, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":255 * context = Dm.get_attr('__refine__') * assert context is not None and type(context) is tuple * (refine, args, kargs) = context # <<<<<<<<<<<<<< * Dmf = refine(Dm, Comm, *args, **kargs) * PetscINCREF(Dmf.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 255, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 255, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 255, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_refine = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":256 * assert context is not None and type(context) is tuple * (refine, args, kargs) = context * Dmf = refine(Dm, Comm, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(Dmf.obj) * dmf[0] = Dmf.dm */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(((PyObject *)__pyx_v_Comm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Comm)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Comm)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 256, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_refine, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 256, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":257 * (refine, args, kargs) = context * Dmf = refine(Dm, Comm, *args, **kargs) * PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<< * dmf[0] = Dmf.dm * return 0 */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":258 * Dmf = refine(Dm, Comm, *args, **kargs) * PetscINCREF(Dmf.obj) * dmf[0] = Dmf.dm # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_v_Dmf->dm; (__pyx_v_dmf[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":259 * PetscINCREF(Dmf.obj) * dmf[0] = Dmf.dm * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateInterpolation( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":244 * return 0 * * cdef int DMSHELL_Refine( # <<<<<<<<<<<<<< * PetscDM dm, * MPI_Comm comm, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_Refine", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_Comm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_refine); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":261 * return 0 * * cdef int DMSHELL_CreateInterpolation( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInterpolation(DM __pyx_v_dmc, DM __pyx_v_dmf, Mat *__pyx_v_cmat, Vec *__pyx_v_cvec) { struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_interpolation = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; Vec __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateInterpolation", 0); /* "PETSc/petscdmshell.pxi":266 * PetscMat *cmat, * PetscVec *cvec) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<< * cdef DM Dmf = subtype_DM(dmf)() * cdef Mat mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 266, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":267 * PetscVec *cvec) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() * cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<< * cdef Mat mat * cdef Vec vec */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 267, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":270 * cdef Mat mat * cdef Vec vec * Dmc.dm = dmc # <<<<<<<<<<<<<< * PetscINCREF(Dmc.obj) * Dmf.dm = dmf */ __pyx_v_Dmc->dm = __pyx_v_dmc; /* "PETSc/petscdmshell.pxi":271 * cdef Vec vec * Dmc.dm = dmc * PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<< * Dmf.dm = dmf * PetscINCREF(Dmf.obj) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":272 * Dmc.dm = dmc * PetscINCREF(Dmc.obj) * Dmf.dm = dmf # <<<<<<<<<<<<<< * PetscINCREF(Dmf.obj) * context = Dmc.get_attr('__create_interpolation__') */ __pyx_v_Dmf->dm = __pyx_v_dmf; /* "PETSc/petscdmshell.pxi":273 * PetscINCREF(Dmc.obj) * Dmf.dm = dmf * PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<< * context = Dmc.get_attr('__create_interpolation__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":274 * Dmf.dm = dmf * PetscINCREF(Dmf.obj) * context = Dmc.get_attr('__create_interpolation__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (interpolation, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmc), ((char *)"__create_interpolation__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":275 * PetscINCREF(Dmf.obj) * context = Dmc.get_attr('__create_interpolation__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (interpolation, args, kargs) = context * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 275, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":276 * context = Dmc.get_attr('__create_interpolation__') * assert context is not None and type(context) is tuple * (interpolation, args, kargs) = context # <<<<<<<<<<<<<< * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) * PetscINCREF(mat.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 276, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 276, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 276, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_interpolation = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":277 * assert context is not None and type(context) is tuple * (interpolation, args, kargs) = context * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dmc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dmc)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmc)); __Pyx_INCREF(((PyObject *)__pyx_v_Dmf)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dmf)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmf)); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 277, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_interpolation, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 277, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(25, 277, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 277, __pyx_L1_error) __pyx_L8_unpacking_done:; } if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(25, 277, __pyx_L1_error) if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(25, 277, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":278 * (interpolation, args, kargs) = context * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * if cvec == NULL: */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":279 * mat, vec = interpolation(Dmc, Dmf, *args, **kargs) * PetscINCREF(mat.obj) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * if cvec == NULL: * return 0 */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":280 * PetscINCREF(mat.obj) * cmat[0] = mat.mat * if cvec == NULL: # <<<<<<<<<<<<<< * return 0 * if vec is None: */ __pyx_t_3 = ((__pyx_v_cvec == NULL) != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":281 * cmat[0] = mat.mat * if cvec == NULL: * return 0 # <<<<<<<<<<<<<< * if vec is None: * cvec[0] = NULL */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":280 * PetscINCREF(mat.obj) * cmat[0] = mat.mat * if cvec == NULL: # <<<<<<<<<<<<<< * return 0 * if vec is None: */ } /* "PETSc/petscdmshell.pxi":282 * if cvec == NULL: * return 0 * if vec is None: # <<<<<<<<<<<<<< * cvec[0] = NULL * else: */ __pyx_t_3 = (((PyObject *)__pyx_v_vec) == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":283 * return 0 * if vec is None: * cvec[0] = NULL # <<<<<<<<<<<<<< * else: * PetscINCREF(vec.obj) */ (__pyx_v_cvec[0]) = NULL; /* "PETSc/petscdmshell.pxi":282 * if cvec == NULL: * return 0 * if vec is None: # <<<<<<<<<<<<<< * cvec[0] = NULL * else: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":285 * cvec[0] = NULL * else: * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * cvec[0] = vec.vec * return 0 */ /*else*/ { (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":286 * else: * PetscINCREF(vec.obj) * cvec[0] = vec.vec # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_10 = __pyx_v_vec->vec; (__pyx_v_cvec[0]) = __pyx_t_10; } __pyx_L10:; /* "PETSc/petscdmshell.pxi":287 * PetscINCREF(vec.obj) * cvec[0] = vec.vec * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateInjection( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":261 * return 0 * * cdef int DMSHELL_CreateInterpolation( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_interpolation); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":289 * return 0 * * cdef int DMSHELL_CreateInjection( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInjection(DM __pyx_v_dmc, DM __pyx_v_dmf, Mat *__pyx_v_cmat) { struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_injection = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateInjection", 0); /* "PETSc/petscdmshell.pxi":293 * PetscDM dmf, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<< * cdef DM Dmf = subtype_DM(dmf)() * cdef Mat mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 293, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":294 * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmc = subtype_DM(dmc)() * cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<< * cdef Mat mat * Dmc.dm = dmc */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 294, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":296 * cdef DM Dmf = subtype_DM(dmf)() * cdef Mat mat * Dmc.dm = dmc # <<<<<<<<<<<<<< * PetscINCREF(Dmc.obj) * Dmf.dm = dmf */ __pyx_v_Dmc->dm = __pyx_v_dmc; /* "PETSc/petscdmshell.pxi":297 * cdef Mat mat * Dmc.dm = dmc * PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<< * Dmf.dm = dmf * PetscINCREF(Dmf.obj) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":298 * Dmc.dm = dmc * PetscINCREF(Dmc.obj) * Dmf.dm = dmf # <<<<<<<<<<<<<< * PetscINCREF(Dmf.obj) * context = Dmc.get_attr('__create_injection__') */ __pyx_v_Dmf->dm = __pyx_v_dmf; /* "PETSc/petscdmshell.pxi":299 * PetscINCREF(Dmc.obj) * Dmf.dm = dmf * PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<< * context = Dmc.get_attr('__create_injection__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":300 * Dmf.dm = dmf * PetscINCREF(Dmf.obj) * context = Dmc.get_attr('__create_injection__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (injection, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmc->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmc), ((char *)"__create_injection__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":301 * PetscINCREF(Dmf.obj) * context = Dmc.get_attr('__create_injection__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (injection, args, kargs) = context * mat = injection(Dmc, Dmf, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 301, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":302 * context = Dmc.get_attr('__create_injection__') * assert context is not None and type(context) is tuple * (injection, args, kargs) = context # <<<<<<<<<<<<<< * mat = injection(Dmc, Dmf, *args, **kargs) * PetscINCREF(mat.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 302, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 302, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 302, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_injection = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":303 * assert context is not None and type(context) is tuple * (injection, args, kargs) = context * mat = injection(Dmc, Dmf, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dmc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dmc)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmc)); __Pyx_INCREF(((PyObject *)__pyx_v_Dmf)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dmf)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmf)); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 303, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_injection, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(25, 303, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":304 * (injection, args, kargs) = context * mat = injection(Dmc, Dmf, *args, **kargs) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * return 0 */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":305 * mat = injection(Dmc, Dmf, *args, **kargs) * PetscINCREF(mat.obj) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":306 * PetscINCREF(mat.obj) * cmat[0] = mat.mat * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateRestriction( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":289 * return 0 * * cdef int DMSHELL_CreateInjection( # <<<<<<<<<<<<<< * PetscDM dmc, * PetscDM dmf, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_injection); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":308 * return 0 * * cdef int DMSHELL_CreateRestriction( # <<<<<<<<<<<<<< * PetscDM dmf, * PetscDM dmc, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateRestriction(DM __pyx_v_dmf, DM __pyx_v_dmc, Mat *__pyx_v_cmat) { struct PyPetscDMObject *__pyx_v_Dmf = 0; struct PyPetscDMObject *__pyx_v_Dmc = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_restriction = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); Mat __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateRestriction", 0); /* "PETSc/petscdmshell.pxi":312 * PetscDM dmc, * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmf = subtype_DM(dmf)() # <<<<<<<<<<<<<< * cdef DM Dmc = subtype_DM(dmc)() * cdef Mat mat */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 312, __pyx_L1_error) __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":313 * PetscMat *cmat) except PETSC_ERR_PYTHON with gil: * cdef DM Dmf = subtype_DM(dmf)() * cdef DM Dmc = subtype_DM(dmc)() # <<<<<<<<<<<<<< * cdef Mat mat * Dmf.dm = dmf */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 313, __pyx_L1_error) __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":315 * cdef DM Dmc = subtype_DM(dmc)() * cdef Mat mat * Dmf.dm = dmf # <<<<<<<<<<<<<< * PetscINCREF(Dmf.obj) * Dmc.dm = dmc */ __pyx_v_Dmf->dm = __pyx_v_dmf; /* "PETSc/petscdmshell.pxi":316 * cdef Mat mat * Dmf.dm = dmf * PetscINCREF(Dmf.obj) # <<<<<<<<<<<<<< * Dmc.dm = dmc * PetscINCREF(Dmc.obj) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":317 * Dmf.dm = dmf * PetscINCREF(Dmf.obj) * Dmc.dm = dmc # <<<<<<<<<<<<<< * PetscINCREF(Dmc.obj) * context = Dmf.get_attr('__create_restriction__') */ __pyx_v_Dmc->dm = __pyx_v_dmc; /* "PETSc/petscdmshell.pxi":318 * PetscINCREF(Dmf.obj) * Dmc.dm = dmc * PetscINCREF(Dmc.obj) # <<<<<<<<<<<<<< * context = Dmf.get_attr('__create_restriction__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":319 * Dmc.dm = dmc * PetscINCREF(Dmc.obj) * context = Dmf.get_attr('__create_restriction__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (restriction, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dmf->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dmf), ((char *)"__create_restriction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":320 * PetscINCREF(Dmc.obj) * context = Dmf.get_attr('__create_restriction__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (restriction, args, kargs) = context * mat = restriction(Dmf, Dmc, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 320, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":321 * context = Dmf.get_attr('__create_restriction__') * assert context is not None and type(context) is tuple * (restriction, args, kargs) = context # <<<<<<<<<<<<<< * mat = restriction(Dmf, Dmc, *args, **kargs) * PetscINCREF(mat.obj) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 321, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 321, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 321, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_restriction = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":322 * assert context is not None and type(context) is tuple * (restriction, args, kargs) = context * mat = restriction(Dmf, Dmc, *args, **kargs) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * cmat[0] = mat.mat */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dmf)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dmf)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dmf)); __Pyx_INCREF(((PyObject *)__pyx_v_Dmc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dmc)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_Dmc)); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 322, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_restriction, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(25, 322, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":323 * (restriction, args, kargs) = context * mat = restriction(Dmf, Dmc, *args, **kargs) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * cmat[0] = mat.mat * return 0 */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":324 * mat = restriction(Dmf, Dmc, *args, **kargs) * PetscINCREF(mat.obj) * cmat[0] = mat.mat # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __pyx_v_mat->mat; (__pyx_v_cmat[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":325 * PetscINCREF(mat.obj) * cmat[0] = mat.mat * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateFieldDecomposition( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":308 * return 0 * * cdef int DMSHELL_CreateRestriction( # <<<<<<<<<<<<<< * PetscDM dmf, * PetscDM dmc, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dmf); __Pyx_XDECREF((PyObject *)__pyx_v_Dmc); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_restriction); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":327 * return 0 * * cdef int DMSHELL_CreateFieldDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateFieldDecomposition(DM __pyx_v_dm, PetscInt *__pyx_v_clen, char ***__pyx_v_namelist, IS **__pyx_v_islist, DM **__pyx_v_dmlist) { struct PyPetscDMObject *__pyx_v_Dm = 0; int __pyx_v_i; char const *__pyx_v_cname; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_decomp = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_ises = NULL; PyObject *__pyx_v_dms = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; int __pyx_t_13; IS __pyx_t_14; DM __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateFieldDecomposition", 0); /* "PETSc/petscdmshell.pxi":333 * PetscIS **islist, * PetscDM **dmlist) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef int i * cdef const char *cname = NULL */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 333, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":335 * cdef DM Dm = subtype_DM(dm)() * cdef int i * cdef const char *cname = NULL # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_v_cname = NULL; /* "PETSc/petscdmshell.pxi":336 * cdef int i * cdef const char *cname = NULL * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_field_decomp__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":337 * cdef const char *cname = NULL * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_field_decomp__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":338 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_field_decomp__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_field_decomp__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":339 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_field_decomp__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (decomp, args, kargs) = context * names, ises, dms = decomp(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 339, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":340 * context = Dm.get_attr('__create_field_decomp__') * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context # <<<<<<<<<<<<<< * names, ises, dms = decomp(Dm, *args, **kargs) * */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 340, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 340, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 340, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_decomp = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":341 * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context * names, ises, dms = decomp(Dm, *args, **kargs) # <<<<<<<<<<<<<< * * if clen != NULL: */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 341, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 341, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_9), 3) < 0) __PYX_ERR(25, 341, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 341, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_v_names = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_ises = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_dms = __pyx_t_7; __pyx_t_7 = 0; /* "PETSc/petscdmshell.pxi":343 * names, ises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ __pyx_t_3 = ((__pyx_v_clen != NULL) != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":344 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif ises is not None: */ __pyx_t_3 = (__pyx_v_names != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":345 * if clen != NULL: * if names is not None: * clen[0] = len(names) # <<<<<<<<<<<<<< * elif ises is not None: * clen[0] = len(ises) */ __pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 345, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10); /* "PETSc/petscdmshell.pxi":344 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif ises is not None: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":346 * if names is not None: * clen[0] = len(names) * elif ises is not None: # <<<<<<<<<<<<<< * clen[0] = len(ises) * elif dms is not None: */ __pyx_t_4 = (__pyx_v_ises != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":347 * clen[0] = len(names) * elif ises is not None: * clen[0] = len(ises) # <<<<<<<<<<<<<< * elif dms is not None: * clen[0] = len(dms) */ __pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 347, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10); /* "PETSc/petscdmshell.pxi":346 * if names is not None: * clen[0] = len(names) * elif ises is not None: # <<<<<<<<<<<<<< * clen[0] = len(ises) * elif dms is not None: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":348 * elif ises is not None: * clen[0] = len(ises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ __pyx_t_3 = (__pyx_v_dms != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":349 * clen[0] = len(ises) * elif dms is not None: * clen[0] = len(dms) # <<<<<<<<<<<<<< * else: * clen[0] = 0 */ __pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 349, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_10); /* "PETSc/petscdmshell.pxi":348 * elif ises is not None: * clen[0] = len(ises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":351 * clen[0] = len(dms) * else: * clen[0] = 0 # <<<<<<<<<<<<<< * * if namelist != NULL and names is not None: */ /*else*/ { (__pyx_v_clen[0]) = 0; } __pyx_L10:; /* "PETSc/petscdmshell.pxi":343 * names, ises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ } /* "PETSc/petscdmshell.pxi":353 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ __pyx_t_3 = ((__pyx_v_namelist != NULL) != 0); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L12_bool_binop_done; } __pyx_t_3 = (__pyx_v_names != Py_None); __pyx_t_5 = (__pyx_t_3 != 0); __pyx_t_4 = __pyx_t_5; __pyx_L12_bool_binop_done:; if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":354 * * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) # <<<<<<<<<<<<<< * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) */ __pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 354, __pyx_L1_error) __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(25, 354, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":355 * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): # <<<<<<<<<<<<<< * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) */ __pyx_t_10 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 355, __pyx_L1_error) __pyx_t_12 = __pyx_t_10; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "PETSc/petscdmshell.pxi":356 * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) # <<<<<<<<<<<<<< * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_6, (&__pyx_v_cname)); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_7, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(25, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/petscdmshell.pxi":357 * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) # <<<<<<<<<<<<<< * * if islist != NULL and ises is not None: */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(25, 357, __pyx_L1_error) } /* "PETSc/petscdmshell.pxi":353 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ } /* "PETSc/petscdmshell.pxi":359 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if islist != NULL and ises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): */ __pyx_t_5 = ((__pyx_v_islist != NULL) != 0); if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L17_bool_binop_done; } __pyx_t_5 = (__pyx_v_ises != Py_None); __pyx_t_3 = (__pyx_t_5 != 0); __pyx_t_4 = __pyx_t_3; __pyx_L17_bool_binop_done:; if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":360 * * if islist != NULL and ises is not None: * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) # <<<<<<<<<<<<<< * for i in range(len(ises)): * islist[0][i] = (ises[i]).iset */ __pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 360, __pyx_L1_error) __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(IS))), __pyx_v_islist)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(25, 360, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":361 * if islist != NULL and ises is not None: * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): # <<<<<<<<<<<<<< * islist[0][i] = (ises[i]).iset * PetscINCREF((ises[i]).obj) */ __pyx_t_10 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 361, __pyx_L1_error) __pyx_t_12 = __pyx_t_10; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "PETSc/petscdmshell.pxi":362 * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): * islist[0][i] = (ises[i]).iset # <<<<<<<<<<<<<< * PetscINCREF((ises[i]).obj) * */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(25, 362, __pyx_L1_error) __pyx_t_14 = ((struct PyPetscISObject *)__pyx_t_7)->iset; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; ((__pyx_v_islist[0])[__pyx_v_i]) = __pyx_t_14; /* "PETSc/petscdmshell.pxi":363 * for i in range(len(ises)): * islist[0][i] = (ises[i]).iset * PetscINCREF((ises[i]).obj) # <<<<<<<<<<<<<< * * if dmlist != NULL and dms is not None: */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(25, 363, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_7)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "PETSc/petscdmshell.pxi":359 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if islist != NULL and ises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(ises)*sizeof(PetscIS), islist) ) * for i in range(len(ises)): */ } /* "PETSc/petscdmshell.pxi":365 * PetscINCREF((ises[i]).obj) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ __pyx_t_3 = ((__pyx_v_dmlist != NULL) != 0); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L22_bool_binop_done; } __pyx_t_3 = (__pyx_v_dms != Py_None); __pyx_t_5 = (__pyx_t_3 != 0); __pyx_t_4 = __pyx_t_5; __pyx_L22_bool_binop_done:; if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":366 * * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) # <<<<<<<<<<<<<< * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm */ __pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 366, __pyx_L1_error) __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_10 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(25, 366, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":367 * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): # <<<<<<<<<<<<<< * dmlist[0][i] = (dms[i]).dm * PetscINCREF((dms[i]).obj) */ __pyx_t_10 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(25, 367, __pyx_L1_error) __pyx_t_12 = __pyx_t_10; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_12; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "PETSc/petscdmshell.pxi":368 * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm # <<<<<<<<<<<<<< * PetscINCREF((dms[i]).obj) * return 0 */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(25, 368, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscDMObject *)__pyx_t_7)->dm; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; ((__pyx_v_dmlist[0])[__pyx_v_i]) = __pyx_t_15; /* "PETSc/petscdmshell.pxi":369 * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm * PetscINCREF((dms[i]).obj) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(25, 369, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_7)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "PETSc/petscdmshell.pxi":365 * PetscINCREF((ises[i]).obj) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ } /* "PETSc/petscdmshell.pxi":370 * dmlist[0][i] = (dms[i]).dm * PetscINCREF((dms[i]).obj) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateDomainDecomposition( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":327 * return 0 * * cdef int DMSHELL_CreateFieldDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_decomp); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_ises); __Pyx_XDECREF(__pyx_v_dms); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":372 * return 0 * * cdef int DMSHELL_CreateDomainDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecomposition(DM __pyx_v_dm, PetscInt *__pyx_v_clen, char ***__pyx_v_namelist, IS **__pyx_v_innerislist, IS **__pyx_v_outerislist, DM **__pyx_v_dmlist) { struct PyPetscDMObject *__pyx_v_Dm = 0; int __pyx_v_i; char const *__pyx_v_cname; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_decomp = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_names = NULL; PyObject *__pyx_v_innerises = NULL; PyObject *__pyx_v_outerises = NULL; PyObject *__pyx_v_dms = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; int __pyx_t_12; Py_ssize_t __pyx_t_13; int __pyx_t_14; IS __pyx_t_15; DM __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateDomainDecomposition", 0); /* "PETSc/petscdmshell.pxi":379 * PetscIS **outerislist, * PetscDM **dmlist) except PETSC_ERR_PYTHON with gil: * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef int i * cdef const char *cname = NULL */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 379, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":381 * cdef DM Dm = subtype_DM(dm)() * cdef int i * cdef const char *cname = NULL # <<<<<<<<<<<<<< * Dm.dm = dm * PetscINCREF(Dm.obj) */ __pyx_v_cname = NULL; /* "PETSc/petscdmshell.pxi":382 * cdef int i * cdef const char *cname = NULL * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_domain_decomp__') */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":383 * cdef const char *cname = NULL * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * context = Dm.get_attr('__create_domain_decomp__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":384 * Dm.dm = dm * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_domain_decomp__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_domain_decomp__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":385 * PetscINCREF(Dm.obj) * context = Dm.get_attr('__create_domain_decomp__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (decomp, args, kargs) = context * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 385, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":386 * context = Dm.get_attr('__create_domain_decomp__') * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context # <<<<<<<<<<<<<< * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) * */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 386, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 386, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 386, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_decomp = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":387 * assert context is not None and type(context) is tuple * (decomp, args, kargs) = context * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) # <<<<<<<<<<<<<< * * if clen != NULL: */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_Dm)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 387, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 387, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_7 = PyList_GET_ITEM(sequence, 2); __pyx_t_9 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_9}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_7,&__pyx_t_9}; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(25, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_10)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_8(__pyx_t_10); if (unlikely(!item)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_10), 4) < 0) __PYX_ERR(25, 387, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 387, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_v_names = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_innerises = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_outerises = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_dms = __pyx_t_9; __pyx_t_9 = 0; /* "PETSc/petscdmshell.pxi":389 * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ __pyx_t_3 = ((__pyx_v_clen != NULL) != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":390 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif innerises is not None: */ __pyx_t_3 = (__pyx_v_names != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":391 * if clen != NULL: * if names is not None: * clen[0] = len(names) # <<<<<<<<<<<<<< * elif innerises is not None: * clen[0] = len(innerises) */ __pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 391, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "PETSc/petscdmshell.pxi":390 * * if clen != NULL: * if names is not None: # <<<<<<<<<<<<<< * clen[0] = len(names) * elif innerises is not None: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":392 * if names is not None: * clen[0] = len(names) * elif innerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(innerises) * elif outerises is not None: */ __pyx_t_4 = (__pyx_v_innerises != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":393 * clen[0] = len(names) * elif innerises is not None: * clen[0] = len(innerises) # <<<<<<<<<<<<<< * elif outerises is not None: * clen[0] = len(outerises) */ __pyx_t_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 393, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "PETSc/petscdmshell.pxi":392 * if names is not None: * clen[0] = len(names) * elif innerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(innerises) * elif outerises is not None: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":394 * elif innerises is not None: * clen[0] = len(innerises) * elif outerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(outerises) * elif dms is not None: */ __pyx_t_3 = (__pyx_v_outerises != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/petscdmshell.pxi":395 * clen[0] = len(innerises) * elif outerises is not None: * clen[0] = len(outerises) # <<<<<<<<<<<<<< * elif dms is not None: * clen[0] = len(dms) */ __pyx_t_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 395, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "PETSc/petscdmshell.pxi":394 * elif innerises is not None: * clen[0] = len(innerises) * elif outerises is not None: # <<<<<<<<<<<<<< * clen[0] = len(outerises) * elif dms is not None: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":396 * elif outerises is not None: * clen[0] = len(outerises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ __pyx_t_4 = (__pyx_v_dms != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":397 * clen[0] = len(outerises) * elif dms is not None: * clen[0] = len(dms) # <<<<<<<<<<<<<< * else: * clen[0] = 0 */ __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 397, __pyx_L1_error) (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11); /* "PETSc/petscdmshell.pxi":396 * elif outerises is not None: * clen[0] = len(outerises) * elif dms is not None: # <<<<<<<<<<<<<< * clen[0] = len(dms) * else: */ goto __pyx_L10; } /* "PETSc/petscdmshell.pxi":399 * clen[0] = len(dms) * else: * clen[0] = 0 # <<<<<<<<<<<<<< * * if namelist != NULL and names is not None: */ /*else*/ { (__pyx_v_clen[0]) = 0; } __pyx_L10:; /* "PETSc/petscdmshell.pxi":389 * names, innerises, outerises, dms = decomp(Dm, *args, **kargs) * * if clen != NULL: # <<<<<<<<<<<<<< * if names is not None: * clen[0] = len(names) */ } /* "PETSc/petscdmshell.pxi":401 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ __pyx_t_4 = ((__pyx_v_namelist != NULL) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L12_bool_binop_done; } __pyx_t_4 = (__pyx_v_names != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_5; __pyx_L12_bool_binop_done:; if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":402 * * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) # <<<<<<<<<<<<<< * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) */ __pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 402, __pyx_L1_error) __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(25, 402, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":403 * if namelist != NULL and names is not None: * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): # <<<<<<<<<<<<<< * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) */ __pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 403, __pyx_L1_error) __pyx_t_13 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "PETSc/petscdmshell.pxi":404 * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) # <<<<<<<<<<<<<< * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_6, (&__pyx_v_cname)); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_9, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(25, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/petscdmshell.pxi":405 * for i in range(len(names)): * names[i] = str2bytes(names[i], &cname) * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) # <<<<<<<<<<<<<< * * if innerislist != NULL and innerises is not None: */ __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(25, 405, __pyx_L1_error) } /* "PETSc/petscdmshell.pxi":401 * clen[0] = 0 * * if namelist != NULL and names is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(names)*sizeof(char**), namelist) ) * for i in range(len(names)): */ } /* "PETSc/petscdmshell.pxi":407 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if innerislist != NULL and innerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): */ __pyx_t_5 = ((__pyx_v_innerislist != NULL) != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L17_bool_binop_done; } __pyx_t_5 = (__pyx_v_innerises != Py_None); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L17_bool_binop_done:; if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":408 * * if innerislist != NULL and innerises is not None: * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) # <<<<<<<<<<<<<< * for i in range(len(innerises)): * innerislist[0][i] = (innerises[i]).iset */ __pyx_t_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 408, __pyx_L1_error) __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(IS))), __pyx_v_innerislist)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(25, 408, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":409 * if innerislist != NULL and innerises is not None: * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): # <<<<<<<<<<<<<< * innerislist[0][i] = (innerises[i]).iset * PetscINCREF((innerises[i]).obj) */ __pyx_t_11 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 409, __pyx_L1_error) __pyx_t_13 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "PETSc/petscdmshell.pxi":410 * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): * innerislist[0][i] = (innerises[i]).iset # <<<<<<<<<<<<<< * PetscINCREF((innerises[i]).obj) * */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(25, 410, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscISObject *)__pyx_t_9)->iset; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; ((__pyx_v_innerislist[0])[__pyx_v_i]) = __pyx_t_15; /* "PETSc/petscdmshell.pxi":411 * for i in range(len(innerises)): * innerislist[0][i] = (innerises[i]).iset * PetscINCREF((innerises[i]).obj) # <<<<<<<<<<<<<< * * if outerislist != NULL and outerises is not None: */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(25, 411, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_9)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "PETSc/petscdmshell.pxi":407 * CHKERR( PetscStrallocpy(cname, &(namelist[0][i])) ) * * if innerislist != NULL and innerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist) ) * for i in range(len(innerises)): */ } /* "PETSc/petscdmshell.pxi":413 * PetscINCREF((innerises[i]).obj) * * if outerislist != NULL and outerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): */ __pyx_t_4 = ((__pyx_v_outerislist != NULL) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L22_bool_binop_done; } __pyx_t_4 = (__pyx_v_outerises != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); __pyx_t_3 = __pyx_t_5; __pyx_L22_bool_binop_done:; if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":414 * * if outerislist != NULL and outerises is not None: * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) # <<<<<<<<<<<<<< * for i in range(len(outerises)): * outerislist[0][i] = (outerises[i]).iset */ __pyx_t_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 414, __pyx_L1_error) __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(IS))), __pyx_v_outerislist)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(25, 414, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":415 * if outerislist != NULL and outerises is not None: * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): # <<<<<<<<<<<<<< * outerislist[0][i] = (outerises[i]).iset * PetscINCREF((outerises[i]).obj) */ __pyx_t_11 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 415, __pyx_L1_error) __pyx_t_13 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "PETSc/petscdmshell.pxi":416 * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): * outerislist[0][i] = (outerises[i]).iset # <<<<<<<<<<<<<< * PetscINCREF((outerises[i]).obj) * */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(25, 416, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscISObject *)__pyx_t_9)->iset; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; ((__pyx_v_outerislist[0])[__pyx_v_i]) = __pyx_t_15; /* "PETSc/petscdmshell.pxi":417 * for i in range(len(outerises)): * outerislist[0][i] = (outerises[i]).iset * PetscINCREF((outerises[i]).obj) # <<<<<<<<<<<<<< * * if dmlist != NULL and dms is not None: */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(25, 417, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_9)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "PETSc/petscdmshell.pxi":413 * PetscINCREF((innerises[i]).obj) * * if outerislist != NULL and outerises is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist) ) * for i in range(len(outerises)): */ } /* "PETSc/petscdmshell.pxi":419 * PetscINCREF((outerises[i]).obj) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ __pyx_t_5 = ((__pyx_v_dmlist != NULL) != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L27_bool_binop_done; } __pyx_t_5 = (__pyx_v_dms != Py_None); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L27_bool_binop_done:; if (__pyx_t_3) { /* "PETSc/petscdmshell.pxi":420 * * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) # <<<<<<<<<<<<<< * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm */ __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 420, __pyx_L1_error) __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(25, 420, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":421 * if dmlist != NULL and dms is not None: * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): # <<<<<<<<<<<<<< * dmlist[0][i] = (dms[i]).dm * PetscINCREF((dms[i]).obj) */ __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(25, 421, __pyx_L1_error) __pyx_t_13 = __pyx_t_11; for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_13; __pyx_t_12+=1) { __pyx_v_i = __pyx_t_12; /* "PETSc/petscdmshell.pxi":422 * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm # <<<<<<<<<<<<<< * PetscINCREF((dms[i]).obj) * return 0 */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(25, 422, __pyx_L1_error) __pyx_t_16 = ((struct PyPetscDMObject *)__pyx_t_9)->dm; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; ((__pyx_v_dmlist[0])[__pyx_v_i]) = __pyx_t_16; /* "PETSc/petscdmshell.pxi":423 * for i in range(len(dms)): * dmlist[0][i] = (dms[i]).dm * PetscINCREF((dms[i]).obj) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (!(likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(25, 423, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_9)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } /* "PETSc/petscdmshell.pxi":419 * PetscINCREF((outerises[i]).obj) * * if dmlist != NULL and dms is not None: # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(len(dms)*sizeof(PetscDM), dmlist) ) * for i in range(len(dms)): */ } /* "PETSc/petscdmshell.pxi":424 * dmlist[0][i] = (dms[i]).dm * PetscINCREF((dms[i]).obj) * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateDomainDecompositionScatters( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":372 * return 0 * * cdef int DMSHELL_CreateDomainDecomposition( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt *clen, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateDomainDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_decomp); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF(__pyx_v_innerises); __Pyx_XDECREF(__pyx_v_outerises); __Pyx_XDECREF(__pyx_v_dms); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":426 * return 0 * * cdef int DMSHELL_CreateDomainDecompositionScatters( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt clen, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecompositionScatters(DM __pyx_v_dm, PetscInt __pyx_v_clen, DM *__pyx_v_subdms, VecScatter **__pyx_v_iscat, VecScatter **__pyx_v_oscat, VecScatter **__pyx_v_gscat) { struct PyPetscDMObject *__pyx_v_Dm = 0; int __pyx_v_i; CYTHON_UNUSED char const *__pyx_v_cname; struct PyPetscDMObject *__pyx_v_subdm = 0; PyObject *__pyx_v_psubdms = NULL; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_scatters = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyObject *__pyx_v_iscatter = NULL; PyObject *__pyx_v_oscatter = NULL; PyObject *__pyx_v_gscatter = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; Py_ssize_t __pyx_t_12; int __pyx_t_13; PetscInt __pyx_t_14; VecScatter __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateDomainDecompositionScatters", 0); /* "PETSc/petscdmshell.pxi":434 * PetscScatter** gscat) except PETSC_ERR_PYTHON with gil: * * cdef DM Dm = subtype_DM(dm)() # <<<<<<<<<<<<<< * cdef int i * cdef const char *cname = NULL */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 434, __pyx_L1_error) __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":436 * cdef DM Dm = subtype_DM(dm)() * cdef int i * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef DM subdm = None * */ __pyx_v_cname = NULL; /* "PETSc/petscdmshell.pxi":437 * cdef int i * cdef const char *cname = NULL * cdef DM subdm = None # <<<<<<<<<<<<<< * * Dm.dm = dm */ __Pyx_INCREF(Py_None); __pyx_v_subdm = ((struct PyPetscDMObject *)Py_None); /* "PETSc/petscdmshell.pxi":439 * cdef DM subdm = None * * Dm.dm = dm # <<<<<<<<<<<<<< * PetscINCREF(Dm.obj) * */ __pyx_v_Dm->dm = __pyx_v_dm; /* "PETSc/petscdmshell.pxi":440 * * Dm.dm = dm * PetscINCREF(Dm.obj) # <<<<<<<<<<<<<< * * psubdms = [] */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":442 * PetscINCREF(Dm.obj) * * psubdms = [] # <<<<<<<<<<<<<< * for i from 0 <= i < clen: * subdm = subtype_DM(subdms[i])() */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_psubdms = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":443 * * psubdms = [] * for i from 0 <= i < clen: # <<<<<<<<<<<<<< * subdm = subtype_DM(subdms[i])() * subdm.dm = subdms[i] */ __pyx_t_3 = __pyx_v_clen; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/petscdmshell.pxi":444 * psubdms = [] * for i from 0 <= i < clen: * subdm = subtype_DM(subdms[i])() # <<<<<<<<<<<<<< * subdm.dm = subdms[i] * PetscINCREF(subdm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_subdms[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 444, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_subdm, ((struct PyPetscDMObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":445 * for i from 0 <= i < clen: * subdm = subtype_DM(subdms[i])() * subdm.dm = subdms[i] # <<<<<<<<<<<<<< * PetscINCREF(subdm.obj) * psubdms.append(subdm) */ __pyx_v_subdm->dm = (__pyx_v_subdms[__pyx_v_i]); /* "PETSc/petscdmshell.pxi":446 * subdm = subtype_DM(subdms[i])() * subdm.dm = subdms[i] * PetscINCREF(subdm.obj) # <<<<<<<<<<<<<< * psubdms.append(subdm) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":447 * subdm.dm = subdms[i] * PetscINCREF(subdm.obj) * psubdms.append(subdm) # <<<<<<<<<<<<<< * * context = Dm.get_attr('__create_domain_decomp_scatters__') */ __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_psubdms, ((PyObject *)__pyx_v_subdm)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(25, 447, __pyx_L1_error) } /* "PETSc/petscdmshell.pxi":449 * psubdms.append(subdm) * * context = Dm.get_attr('__create_domain_decomp_scatters__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (scatters, args, kargs) = context */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_Dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_Dm), ((char *)"__create_domain_decomp_scatters__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/petscdmshell.pxi":450 * * context = Dm.get_attr('__create_domain_decomp_scatters__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (scatters, args, kargs) = context * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = (__pyx_v_context != Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { } else { __pyx_t_5 = __pyx_t_7; goto __pyx_L5_bool_binop_done; } __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_5 = __pyx_t_6; __pyx_L5_bool_binop_done:; if (unlikely(!__pyx_t_5)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 450, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":451 * context = Dm.get_attr('__create_domain_decomp_scatters__') * assert context is not None and type(context) is tuple * (scatters, args, kargs) = context # <<<<<<<<<<<<<< * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) * */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 451, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_8 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(25, 451, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 451, __pyx_L1_error) __pyx_L8_unpacking_done:; } __pyx_v_scatters = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_args = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_kargs = __pyx_t_8; __pyx_t_8 = 0; /* "PETSc/petscdmshell.pxi":452 * assert context is not None and type(context) is tuple * (scatters, args, kargs) = context * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) # <<<<<<<<<<<<<< * * assert len(iscatter) == clen */ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_Dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_Dm)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_Dm)); __Pyx_INCREF(__pyx_v_psubdms); __Pyx_GIVEREF(__pyx_v_psubdms); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_psubdms); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 452, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_2 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } else { __pyx_t_2 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_8 = __Pyx_PyObject_Call(__pyx_v_scatters, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 452, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(25, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_11)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_9 = __pyx_t_10(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_11), 3) < 0) __PYX_ERR(25, 452, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L10_unpacking_done; __pyx_L9_unpacking_failed:; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 452, __pyx_L1_error) __pyx_L10_unpacking_done:; } __pyx_v_iscatter = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_oscatter = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_gscatter = __pyx_t_9; __pyx_t_9 = 0; /* "PETSc/petscdmshell.pxi":454 * (iscatter, oscatter, gscatter) = scatters(Dm, psubdms, *args, **kargs) * * assert len(iscatter) == clen # <<<<<<<<<<<<<< * assert len(oscatter) == clen * assert len(gscatter) == clen */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_12 = PyObject_Length(__pyx_v_iscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(25, 454, __pyx_L1_error) if (unlikely(!((__pyx_t_12 == __pyx_v_clen) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 454, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":455 * * assert len(iscatter) == clen * assert len(oscatter) == clen # <<<<<<<<<<<<<< * assert len(gscatter) == clen * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_12 = PyObject_Length(__pyx_v_oscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(25, 455, __pyx_L1_error) if (unlikely(!((__pyx_t_12 == __pyx_v_clen) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 455, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":456 * assert len(iscatter) == clen * assert len(oscatter) == clen * assert len(gscatter) == clen # <<<<<<<<<<<<<< * * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_12 = PyObject_Length(__pyx_v_gscatter); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(25, 456, __pyx_L1_error) if (unlikely(!((__pyx_t_12 == __pyx_v_clen) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 456, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":458 * assert len(gscatter) == clen * * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) # <<<<<<<<<<<<<< * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_iscat)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(25, 458, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":459 * * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) # <<<<<<<<<<<<<< * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) * */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_oscat)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(25, 459, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":460 * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), iscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), oscat) ) * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) # <<<<<<<<<<<<<< * * for i in range(clen): */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_gscat)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(25, 460, __pyx_L1_error) /* "PETSc/petscdmshell.pxi":462 * CHKERR ( PetscMalloc(clen*sizeof(PetscScatter), gscat) ) * * for i in range(clen): # <<<<<<<<<<<<<< * iscat[0][i] = (iscatter[i]).sct * PetscINCREF((iscatter[i]).obj) */ __pyx_t_3 = __pyx_v_clen; __pyx_t_14 = __pyx_t_3; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_14; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "PETSc/petscdmshell.pxi":463 * * for i in range(clen): * iscat[0][i] = (iscatter[i]).sct # <<<<<<<<<<<<<< * PetscINCREF((iscatter[i]).obj) * */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(25, 463, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ((__pyx_v_iscat[0])[__pyx_v_i]) = __pyx_t_15; /* "PETSc/petscdmshell.pxi":464 * for i in range(clen): * iscat[0][i] = (iscatter[i]).sct * PetscINCREF((iscatter[i]).obj) # <<<<<<<<<<<<<< * * oscat[0][i] = (oscatter[i]).sct */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(25, 464, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscdmshell.pxi":466 * PetscINCREF((iscatter[i]).obj) * * oscat[0][i] = (oscatter[i]).sct # <<<<<<<<<<<<<< * PetscINCREF((oscatter[i]).obj) * */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(25, 466, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ((__pyx_v_oscat[0])[__pyx_v_i]) = __pyx_t_15; /* "PETSc/petscdmshell.pxi":467 * * oscat[0][i] = (oscatter[i]).sct * PetscINCREF((oscatter[i]).obj) # <<<<<<<<<<<<<< * * gscat[0][i] = (gscatter[i]).sct */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(25, 467, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/petscdmshell.pxi":469 * PetscINCREF((oscatter[i]).obj) * * gscat[0][i] = (gscatter[i]).sct # <<<<<<<<<<<<<< * PetscINCREF((gscatter[i]).obj) * */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(25, 469, __pyx_L1_error) __pyx_t_15 = ((struct PyPetscScatterObject *)__pyx_t_8)->sct; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ((__pyx_v_gscat[0])[__pyx_v_i]) = __pyx_t_15; /* "PETSc/petscdmshell.pxi":470 * * gscat[0][i] = (gscatter[i]).sct * PetscINCREF((gscatter[i]).obj) # <<<<<<<<<<<<<< * * return 0 */ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(25, 470, __pyx_L1_error) (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_8)->__pyx_base.obj)); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "PETSc/petscdmshell.pxi":472 * PetscINCREF((gscatter[i]).obj) * * return 0 # <<<<<<<<<<<<<< * * cdef int DMSHELL_CreateSubDM( */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/petscdmshell.pxi":426 * return 0 * * cdef int DMSHELL_CreateDomainDecompositionScatters( # <<<<<<<<<<<<<< * PetscDM dm, * PetscInt clen, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateDomainDecompositionScatters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_Dm); __Pyx_XDECREF((PyObject *)__pyx_v_subdm); __Pyx_XDECREF(__pyx_v_psubdms); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_scatters); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF(__pyx_v_iscatter); __Pyx_XDECREF(__pyx_v_oscatter); __Pyx_XDECREF(__pyx_v_gscatter); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/petscdmshell.pxi":474 * return 0 * * cdef int DMSHELL_CreateSubDM( # <<<<<<<<<<<<<< * PetscDM cdm, * PetscInt numFields, */ static int __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateSubDM(DM __pyx_v_cdm, PetscInt __pyx_v_numFields, PetscInt const *__pyx_v_cfields, IS *__pyx_v_ciset, DM *__pyx_v_csubdm) { struct PyPetscDMObject *__pyx_v_dm = 0; struct PyPetscISObject *__pyx_v_iset = 0; struct PyPetscDMObject *__pyx_v_subdm = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_v_create_subdm = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_kargs = NULL; PyArrayObject *__pyx_v_fields = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); IS __pyx_t_9; DM __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("DMSHELL_CreateSubDM", 0); /* "PETSc/petscdmshell.pxi":480 * PetscIS *ciset, * PetscDM *csubdm) except PETSC_ERR_PYTHON with gil: * cdef DM dm = subtype_DM(cdm)() # <<<<<<<<<<<<<< * cdef IS iset * cdef DM subdm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_cdm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 480, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":483 * cdef IS iset * cdef DM subdm * dm.dm = cdm # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * context = dm.get_attr('__create_subdm__') */ __pyx_v_dm->dm = __pyx_v_cdm; /* "PETSc/petscdmshell.pxi":484 * cdef DM subdm * dm.dm = cdm * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * context = dm.get_attr('__create_subdm__') * assert context is not None and type(context) is tuple */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":485 * dm.dm = cdm * PetscINCREF(dm.obj) * context = dm.get_attr('__create_subdm__') # <<<<<<<<<<<<<< * assert context is not None and type(context) is tuple * (create_subdm, args, kargs) = context */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_dm->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_dm), ((char *)"__create_subdm__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_context = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":486 * PetscINCREF(dm.obj) * context = dm.get_attr('__create_subdm__') * assert context is not None and type(context) is tuple # <<<<<<<<<<<<<< * (create_subdm, args, kargs) = context * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L3_bool_binop_done; } __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); __pyx_t_4 = (__pyx_t_5 != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(25, 486, __pyx_L1_error) } } #endif /* "PETSc/petscdmshell.pxi":487 * context = dm.get_attr('__create_subdm__') * assert context is not None and type(context) is tuple * (create_subdm, args, kargs) = context # <<<<<<<<<<<<<< * * fields = array_i(numFields, cfields) */ if ((likely(PyTuple_CheckExact(__pyx_v_context))) || (PyList_CheckExact(__pyx_v_context))) { PyObject* sequence = __pyx_v_context; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 487, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_1 = PyList_GET_ITEM(sequence, 1); __pyx_t_6 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(25, 487, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 487, __pyx_L1_error) __pyx_L6_unpacking_done:; } __pyx_v_create_subdm = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_kargs = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":489 * (create_subdm, args, kargs) = context * * fields = array_i(numFields, cfields) # <<<<<<<<<<<<<< * * iset, subdm = create_subdm(dm, fields, *args, **kargs) */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numFields, __pyx_v_cfields)); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_fields = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/petscdmshell.pxi":491 * fields = array_i(numFields, cfields) * * iset, subdm = create_subdm(dm, fields, *args, **kargs) # <<<<<<<<<<<<<< * * PetscINCREF(iset.obj) */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __Pyx_GIVEREF(((PyObject *)__pyx_v_dm)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_dm)); __Pyx_INCREF(((PyObject *)__pyx_v_fields)); __Pyx_GIVEREF(((PyObject *)__pyx_v_fields)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_fields)); __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_v_kargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(25, 491, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_kargs))) { __pyx_t_1 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } else { __pyx_t_1 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_kargs, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_create_subdm, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(25, 491, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(25, 491, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L8_unpacking_done; __pyx_L7_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(25, 491, __pyx_L1_error) __pyx_L8_unpacking_done:; } if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(25, 491, __pyx_L1_error) if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(25, 491, __pyx_L1_error) __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/petscdmshell.pxi":493 * iset, subdm = create_subdm(dm, fields, *args, **kargs) * * PetscINCREF(iset.obj) # <<<<<<<<<<<<<< * PetscINCREF(subdm.obj) * ciset[0] = iset.iset */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":494 * * PetscINCREF(iset.obj) * PetscINCREF(subdm.obj) # <<<<<<<<<<<<<< * ciset[0] = iset.iset * csubdm[0] = subdm.dm */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj)); /* "PETSc/petscdmshell.pxi":495 * PetscINCREF(iset.obj) * PetscINCREF(subdm.obj) * ciset[0] = iset.iset # <<<<<<<<<<<<<< * csubdm[0] = subdm.dm */ __pyx_t_9 = __pyx_v_iset->iset; (__pyx_v_ciset[0]) = __pyx_t_9; /* "PETSc/petscdmshell.pxi":496 * PetscINCREF(subdm.obj) * ciset[0] = iset.iset * csubdm[0] = subdm.dm # <<<<<<<<<<<<<< */ __pyx_t_10 = __pyx_v_subdm->dm; (__pyx_v_csubdm[0]) = __pyx_t_10; /* "PETSc/petscdmshell.pxi":474 * return 0 * * cdef int DMSHELL_CreateSubDM( # <<<<<<<<<<<<<< * PetscDM cdm, * PetscInt numFields, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMSHELL_CreateSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = PETSC_ERR_PYTHON; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XDECREF((PyObject *)__pyx_v_subdm); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_create_subdm); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XDECREF((PyObject *)__pyx_v_fields); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/Error.pyx":7 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5Error___init__[] = "Error.__init__(self, int ierr=0)"; static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error___init__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_v_ierr; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ierr,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ierr); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 7, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_self = values[0]; if (values[1]) { __pyx_v_ierr = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ierr == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 7, __pyx_L3_error) } else { __pyx_v_ierr = ((int)((int)0)); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 7, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error___init__(__pyx_self, __pyx_v_self, __pyx_v_ierr); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_ierr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "PETSc/Error.pyx":8 * * def __init__(self, int ierr=0): * self.ierr = ierr # <<<<<<<<<<<<<< * RuntimeError.__init__(self, self.ierr) * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ierr, __pyx_t_1) < 0) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Error.pyx":9 * def __init__(self, int ierr=0): * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) # <<<<<<<<<<<<<< * * def __nonzero__(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_self, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Error.pyx":7 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Error.pyx":11 * RuntimeError.__init__(self, self.ierr) * * def __nonzero__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_3__nonzero__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5Error_2__nonzero__[] = "Error.__nonzero__(self)"; static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_3__nonzero__ = {"__nonzero__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_3__nonzero__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_2__nonzero__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_3__nonzero__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__nonzero__") < 0)) __PYX_ERR(1, 11, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__nonzero__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 11, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Error.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error_2__nonzero__(__pyx_self, __pyx_v_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_2__nonzero__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_ierr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__nonzero__", 0); /* "PETSc/Error.pyx":12 * * def __nonzero__(self): * cdef int ierr = self.ierr # <<<<<<<<<<<<<< * return ierr != 0 * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ierr = __pyx_t_2; /* "PETSc/Error.pyx":13 * def __nonzero__(self): * cdef int ierr = self.ierr * return ierr != 0 # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ierr != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Error.pyx":11 * RuntimeError.__init__(self, self.ierr) * * def __nonzero__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Error.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Error.pyx":15 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5Error_4__repr__[] = "Error.__repr__(self)"; static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_5__repr__ = {"__repr__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_4__repr__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_5__repr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__repr__") < 0)) __PYX_ERR(1, 15, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 15, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Error.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error_4__repr__(__pyx_self, __pyx_v_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "PETSc/Error.pyx":16 * * def __repr__(self): * return 'PETSc.Error(%d)' % self.ierr # <<<<<<<<<<<<<< * * def __str__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_PETSc_Error_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Error.pyx":15 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Error.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Error.pyx":18 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_7__str__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5Error_6__str__[] = "Error.__str__(self)"; static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_7__str__ = {"__str__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Error_7__str__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Error_6__str__}; static PyObject *__pyx_pw_8petsc4py_5PETSc_5Error_7__str__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__str__") < 0)) __PYX_ERR(1, 18, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_self = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 18, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Error.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5Error_6__str__(__pyx_self, __pyx_v_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5Error_6__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { int __pyx_v_csize; int __pyx_v_crank; Py_ssize_t __pyx_v_width; int __pyx_v_rank; PyObject *__pyx_v_tblist = NULL; PyObject *__pyx_v_entry = NULL; PyObject *__pyx_v_tbline = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); /* "PETSc/Error.pyx":19 * * def __str__(self): * cdef int csize=1, crank=0 # <<<<<<<<<<<<<< * if not (PetscFinalizeCalled): * MPI_Comm_size(PETSC_COMM_WORLD, &csize) */ __pyx_v_csize = 1; __pyx_v_crank = 0; /* "PETSc/Error.pyx":20 * def __str__(self): * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): # <<<<<<<<<<<<<< * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) */ __pyx_t_1 = ((!(((int)PetscFinalizeCalled) != 0)) != 0); if (__pyx_t_1) { /* "PETSc/Error.pyx":21 * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): * MPI_Comm_size(PETSC_COMM_WORLD, &csize) # <<<<<<<<<<<<<< * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) * width, rank = len(str(csize-1)), crank */ (void)(MPI_Comm_size(PETSC_COMM_WORLD, (&__pyx_v_csize))); /* "PETSc/Error.pyx":22 * if not (PetscFinalizeCalled): * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) # <<<<<<<<<<<<<< * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] */ (void)(MPI_Comm_rank(PETSC_COMM_WORLD, (&__pyx_v_crank))); /* "PETSc/Error.pyx":20 * def __str__(self): * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): # <<<<<<<<<<<<<< * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) */ } /* "PETSc/Error.pyx":23 * MPI_Comm_size(PETSC_COMM_WORLD, &csize) * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) * width, rank = len(str(csize-1)), crank # <<<<<<<<<<<<<< * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: */ __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_csize - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_v_crank; __pyx_v_width = __pyx_t_4; __pyx_v_rank = __pyx_t_5; /* "PETSc/Error.pyx":24 * MPI_Comm_rank(PETSC_COMM_WORLD, &crank) * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] # <<<<<<<<<<<<<< * for entry in self._traceback_: * tbline = '[%*d] %s' % (width, rank, entry) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_error_code_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_v_tblist = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Error.pyx":25 * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: # <<<<<<<<<<<<<< * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_traceback); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; __pyx_t_6 = NULL; } else { __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 25, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 25, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(1, 25, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(1, 25, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Error.pyx":26 * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: * tbline = '[%*d] %s' % (width, rank, entry) # <<<<<<<<<<<<<< * tblist.append(tbline) * return '\n'.join(tblist) */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_rank); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __Pyx_INCREF(__pyx_v_entry); __Pyx_GIVEREF(__pyx_v_entry); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_entry); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_d_s, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_tbline, ((PyObject*)__pyx_t_7)); __pyx_t_7 = 0; /* "PETSc/Error.pyx":27 * for entry in self._traceback_: * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) # <<<<<<<<<<<<<< * return '\n'.join(tblist) * */ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_tblist, __pyx_v_tbline); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 27, __pyx_L1_error) /* "PETSc/Error.pyx":25 * width, rank = len(str(csize-1)), crank * tblist = ['error code %d' % self.ierr] * for entry in self._traceback_: # <<<<<<<<<<<<<< * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Error.pyx":28 * tbline = '[%*d] %s' % (width, rank, entry) * tblist.append(tbline) * return '\n'.join(tblist) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__13, __pyx_v_tblist); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Error.pyx":18 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Error.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tblist); __Pyx_XDECREF(__pyx_v_entry); __Pyx_XDECREF(__pyx_v_tbline); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":8 * cdef object _prefix * * def __init__(self, prefix=None): # <<<<<<<<<<<<<< * self.opt = NULL * self.prefix = prefix */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(26, 8, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 8, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options___init__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options___init__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); /* "PETSc/Options.pyx":9 * * def __init__(self, prefix=None): * self.opt = NULL # <<<<<<<<<<<<<< * self.prefix = prefix * */ __pyx_v_self->opt = NULL; /* "PETSc/Options.pyx":10 * def __init__(self, prefix=None): * self.opt = NULL * self.prefix = prefix # <<<<<<<<<<<<<< * * def __dealloc__(self): */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix, __pyx_v_prefix) < 0) __PYX_ERR(26, 10, __pyx_L1_error) /* "PETSc/Options.pyx":8 * cdef object _prefix * * def __init__(self, prefix=None): # <<<<<<<<<<<<<< * self.opt = NULL * self.prefix = prefix */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":12 * self.prefix = prefix * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_7Options_2__dealloc__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_7Options_2__dealloc__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/Options.pyx":13 * * def __dealloc__(self): * if self.opt == NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsDestroy(&self.opt) ) * */ __pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0); if (__pyx_t_1) { goto __pyx_L0; } /* "PETSc/Options.pyx":14 * def __dealloc__(self): * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) # <<<<<<<<<<<<<< * * def __contains__(self, item): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 14, __pyx_L1_error) /* "PETSc/Options.pyx":12 * self.prefix = prefix * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Options.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/Options.pyx":16 * CHKERR( PetscOptionsDestroy(&self.opt) ) * * def __contains__(self, item): # <<<<<<<<<<<<<< * return self.hasName(item) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_4__contains__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__contains__", 0); /* "PETSc/Options.pyx":17 * * def __contains__(self, item): * return self.hasName(item) # <<<<<<<<<<<<<< * * def __getitem__(self, item): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hasName); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(26, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; goto __pyx_L0; /* "PETSc/Options.pyx":16 * CHKERR( PetscOptionsDestroy(&self.opt) ) * * def __contains__(self, item): # <<<<<<<<<<<<<< * return self.hasName(item) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":19 * return self.hasName(item) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.getString(item) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6__getitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "PETSc/Options.pyx":20 * * def __getitem__(self, item): * return self.getString(item) # <<<<<<<<<<<<<< * * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getString); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":19 * return self.hasName(item) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.getString(item) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":22 * return self.getString(item) * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.setValue(item, value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_8__setitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); /* "PETSc/Options.pyx":23 * * def __setitem__(self, item, value): * self.setValue(item, value) # <<<<<<<<<<<<<< * * def __delitem__(self, item): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, __pyx_v_value}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 23, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_item, __pyx_v_value}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 23, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_item); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_value); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":22 * return self.getString(item) * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.setValue(item, value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Options.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":25 * self.setValue(item, value) * * def __delitem__(self, item): # <<<<<<<<<<<<<< * self.delValue(item) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_10__delitem__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_item) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__delitem__", 0); /* "PETSc/Options.pyx":26 * * def __delitem__(self, item): * self.delValue(item) # <<<<<<<<<<<<<< * * property prefix: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_delValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":25 * self.setValue(item, value) * * def __delitem__(self, item): # <<<<<<<<<<<<<< * self.delValue(item) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":29 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self._prefix * def __set__(self, prefix): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6prefix___get__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_6prefix___get__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Options.pyx":30 * property prefix: * def __get__(self): * return self._prefix # <<<<<<<<<<<<<< * def __set__(self, prefix): * self._prefix = getprefix(prefix) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_prefix); __pyx_r = __pyx_v_self->_prefix; goto __pyx_L0; /* "PETSc/Options.pyx":29 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self._prefix * def __set__(self, prefix): */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":31 * def __get__(self): * return self._prefix * def __set__(self, prefix): # <<<<<<<<<<<<<< * self._prefix = getprefix(prefix) * def __del__(self): */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), ((PyObject *)__pyx_v_prefix)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_2__set__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Options.pyx":32 * return self._prefix * def __set__(self, prefix): * self._prefix = getprefix(prefix) # <<<<<<<<<<<<<< * def __del__(self): * self._prefix = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getprefix(__pyx_v_prefix, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_prefix); __Pyx_DECREF(__pyx_v_self->_prefix); __pyx_v_self->_prefix = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Options.pyx":31 * def __get__(self): * return self._prefix * def __set__(self, prefix): # <<<<<<<<<<<<<< * self._prefix = getprefix(prefix) * def __del__(self): */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Options.prefix.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":33 * def __set__(self, prefix): * self._prefix = getprefix(prefix) * def __del__(self): # <<<<<<<<<<<<<< * self._prefix = None * # */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_4__del__(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Options_6prefix_4__del__(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__", 0); /* "PETSc/Options.pyx":34 * self._prefix = getprefix(prefix) * def __del__(self): * self._prefix = None # <<<<<<<<<<<<<< * # * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_prefix); __Pyx_DECREF(__pyx_v_self->_prefix); __pyx_v_self->_prefix = Py_None; /* "PETSc/Options.pyx":33 * def __set__(self, prefix): * self._prefix = getprefix(prefix) * def __del__(self): # <<<<<<<<<<<<<< * self._prefix = None * # */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":37 * # * * def create(self): # <<<<<<<<<<<<<< * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_12create[] = "Options.create(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("create", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "create", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_12create(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_12create(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Options.pyx":38 * * def create(self): * if self.opt != NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsCreate(&self.opt) ) * return self */ __pyx_t_1 = ((__pyx_v_self->opt != NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/Options.pyx":39 * def create(self): * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsCreate((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 39, __pyx_L1_error) /* "PETSc/Options.pyx":40 * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) * return self # <<<<<<<<<<<<<< * * def destroy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Options.pyx":37 * # * * def create(self): # <<<<<<<<<<<<<< * if self.opt != NULL: return * CHKERR( PetscOptionsCreate(&self.opt) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":42 * return self * * def destroy(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_14destroy[] = "Options.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_14destroy(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_14destroy(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Options.pyx":43 * * def destroy(self): * if self.opt == NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsDestroy(&self.opt) ) * return self */ __pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/Options.pyx":44 * def destroy(self): * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsDestroy((&__pyx_v_self->opt))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 44, __pyx_L1_error) /* "PETSc/Options.pyx":45 * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) * return self # <<<<<<<<<<<<<< * * def clear(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Options.pyx":42 * return self * * def destroy(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsDestroy(&self.opt) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":47 * return self * * def clear(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_17clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_16clear[] = "Options.clear(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_17clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("clear", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_16clear(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_16clear(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 0); /* "PETSc/Options.pyx":48 * * def clear(self): * if self.opt == NULL: return # <<<<<<<<<<<<<< * CHKERR( PetscOptionsClear(self.opt) ) * return self */ __pyx_t_1 = ((__pyx_v_self->opt == NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/Options.pyx":49 * def clear(self): * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClear(__pyx_v_self->opt)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 49, __pyx_L1_error) /* "PETSc/Options.pyx":50 * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) * return self # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Options.pyx":47 * return self * * def clear(self): # <<<<<<<<<<<<<< * if self.opt == NULL: return * CHKERR( PetscOptionsClear(self.opt) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":52 * return self * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_19view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_18view[] = "Options.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_19view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(26, 52, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 52, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(26, 52, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_18view(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_18view(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Options.pyx":53 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscOptionsView(self.opt, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Options.pyx":54 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscOptionsView(self.opt, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Options.pyx":55 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscOptionsView(self.opt, vwr) ) # <<<<<<<<<<<<<< * * def prefixPush(self, prefix): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsView(__pyx_v_self->opt, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(26, 55, __pyx_L1_error) /* "PETSc/Options.pyx":52 * return self * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":57 * CHKERR( PetscOptionsView(self.opt, vwr) ) * * def prefixPush(self, prefix): # <<<<<<<<<<<<<< * prefix = getprefix(prefix) * cdef const char *cprefix = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_20prefixPush[] = "Options.prefixPush(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prefixPush (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prefixPush") < 0)) __PYX_ERR(26, 57, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("prefixPush", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 57, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPush", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_20prefixPush(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("prefixPush", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/Options.pyx":58 * * def prefixPush(self, prefix): * prefix = getprefix(prefix) # <<<<<<<<<<<<<< * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getprefix(__pyx_v_prefix, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":59 * def prefixPush(self, prefix): * prefix = getprefix(prefix) * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) */ __pyx_v_cprefix = NULL; /* "PETSc/Options.pyx":60 * prefix = getprefix(prefix) * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":61 * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) # <<<<<<<<<<<<<< * * def prefixPop(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPush(__pyx_v_self->opt, __pyx_v_cprefix)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 61, __pyx_L1_error) /* "PETSc/Options.pyx":57 * CHKERR( PetscOptionsView(self.opt, vwr) ) * * def prefixPush(self, prefix): # <<<<<<<<<<<<<< * prefix = getprefix(prefix) * cdef const char *cprefix = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPush", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":63 * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) * * def prefixPop(self): # <<<<<<<<<<<<<< * CHKERR( PetscOptionsPrefixPop(self.opt) ) * # */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_22prefixPop[] = "Options.prefixPop(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("prefixPop (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("prefixPop", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "prefixPop", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_22prefixPop(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("prefixPop", 0); /* "PETSc/Options.pyx":64 * * def prefixPop(self): * CHKERR( PetscOptionsPrefixPop(self.opt) ) # <<<<<<<<<<<<<< * # * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsPrefixPop(__pyx_v_self->opt)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(26, 64, __pyx_L1_error) /* "PETSc/Options.pyx":63 * CHKERR( PetscOptionsPrefixPush(self.opt, cprefix) ) * * def prefixPop(self): # <<<<<<<<<<<<<< * CHKERR( PetscOptionsPrefixPop(self.opt) ) * # */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.prefixPop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":67 * # * * def hasName(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_25hasName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_24hasName[] = "Options.hasName(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_25hasName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hasName") < 0)) __PYX_ERR(26, 67, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 67, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.hasName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_24hasName(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_24hasName(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasName", 0); /* "PETSc/Options.pyx":68 * * def hasName(self, name): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "PETSc/Options.pyx":69 * def hasName(self, name): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(self.prefix, name, &pr, &nm) * cdef PetscBool flag = PETSC_FALSE */ __pyx_v_nm = NULL; /* "PETSc/Options.pyx":70 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Options.pyx":71 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Options.pyx":72 * tmp = getpair(self.prefix, name, &pr, &nm) * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsHasName(__pyx_v_self->opt, __pyx_v_pr, __pyx_v_nm, (&__pyx_v_flag))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(26, 72, __pyx_L1_error) /* "PETSc/Options.pyx":73 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscOptionsHasName(self.opt, pr, nm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setValue(self, name, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":67 * # * * def hasName(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.hasName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":75 * return toBool(flag) * * def setValue(self, name, value): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_26setValue[] = "Options.setValue(self, name, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, 1); __PYX_ERR(26, 75, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValue") < 0)) __PYX_ERR(26, 75, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 75, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_26setValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_26setValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PyObject *__pyx_v_option = NULL; char const *__pyx_v_key; char const *__pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValue", 0); __Pyx_INCREF(__pyx_v_value); /* "PETSc/Options.pyx":76 * * def setValue(self, name, value): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "PETSc/Options.pyx":77 * def setValue(self, name, value): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: */ __pyx_v_nm = NULL; /* "PETSc/Options.pyx":78 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * if pr == NULL: * option = bytes2str(nm) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Options.pyx":79 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ __pyx_t_3 = ((__pyx_v_pr == NULL) != 0); if (__pyx_t_3) { /* "PETSc/Options.pyx":80 * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: * option = bytes2str(nm) # <<<<<<<<<<<<<< * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_nm); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_option = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Options.pyx":79 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ goto __pyx_L3; } /* "PETSc/Options.pyx":82 * option = bytes2str(nm) * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) # <<<<<<<<<<<<<< * if type(value) is bool: * value = str(value).lower() */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pr); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_option = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "PETSc/Options.pyx":83 * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * if type(value) is bool: # <<<<<<<<<<<<<< * value = str(value).lower() * elif value is not None : */ __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_value)) == ((PyObject*)&PyBool_Type)); __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { /* "PETSc/Options.pyx":84 * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * if type(value) is bool: * value = str(value).lower() # <<<<<<<<<<<<<< * elif value is not None : * value = str(value) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":83 * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * if type(value) is bool: # <<<<<<<<<<<<<< * value = str(value).lower() * elif value is not None : */ goto __pyx_L4; } /* "PETSc/Options.pyx":85 * if type(value) is bool: * value = str(value).lower() * elif value is not None : # <<<<<<<<<<<<<< * value = str(value) * cdef const char *key = NULL */ __pyx_t_5 = (__pyx_v_value != Py_None); __pyx_t_3 = (__pyx_t_5 != 0); if (__pyx_t_3) { /* "PETSc/Options.pyx":86 * value = str(value).lower() * elif value is not None : * value = str(value) # <<<<<<<<<<<<<< * cdef const char *key = NULL * cdef const char *val = NULL */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":85 * if type(value) is bool: * value = str(value).lower() * elif value is not None : # <<<<<<<<<<<<<< * value = str(value) * cdef const char *key = NULL */ } __pyx_L4:; /* "PETSc/Options.pyx":87 * elif value is not None : * value = str(value) * cdef const char *key = NULL # <<<<<<<<<<<<<< * cdef const char *val = NULL * option = str2bytes(option, &key) */ __pyx_v_key = NULL; /* "PETSc/Options.pyx":88 * value = str(value) * cdef const char *key = NULL * cdef const char *val = NULL # <<<<<<<<<<<<<< * option = str2bytes(option, &key) * value = str2bytes(value, &val) */ __pyx_v_val = NULL; /* "PETSc/Options.pyx":89 * cdef const char *key = NULL * cdef const char *val = NULL * option = str2bytes(option, &key) # <<<<<<<<<<<<<< * value = str2bytes(value, &val) * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":90 * cdef const char *val = NULL * option = str2bytes(option, &key) * value = str2bytes(value, &val) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_value, (&__pyx_v_val)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":91 * option = str2bytes(option, &key) * value = str2bytes(value, &val) * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) # <<<<<<<<<<<<<< * * def delValue(self, name): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsSetValue(__pyx_v_self->opt, __pyx_v_key, __pyx_v_val)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(26, 91, __pyx_L1_error) /* "PETSc/Options.pyx":75 * return toBool(flag) * * def setValue(self, name, value): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Options.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_option); __Pyx_XDECREF(__pyx_v_value); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":93 * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) * * def delValue(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29delValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_28delValue[] = "Options.delValue(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29delValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("delValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delValue") < 0)) __PYX_ERR(26, 93, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("delValue", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 93, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.delValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_28delValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28delValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_pr; char const *__pyx_v_nm; CYTHON_UNUSED PyObject *__pyx_v_tmp = NULL; PyObject *__pyx_v_option = NULL; char const *__pyx_v_key; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("delValue", 0); /* "PETSc/Options.pyx":94 * * def delValue(self, name): * cdef const char *pr = NULL # <<<<<<<<<<<<<< * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) */ __pyx_v_pr = NULL; /* "PETSc/Options.pyx":95 * def delValue(self, name): * cdef const char *pr = NULL * cdef const char *nm = NULL # <<<<<<<<<<<<<< * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: */ __pyx_v_nm = NULL; /* "PETSc/Options.pyx":96 * cdef const char *pr = NULL * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) # <<<<<<<<<<<<<< * if pr == NULL: * option = bytes2str(nm) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getpair(__pyx_t_1, __pyx_v_name, (&__pyx_v_pr), (&__pyx_v_nm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Options.pyx":97 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ __pyx_t_3 = ((__pyx_v_pr == NULL) != 0); if (__pyx_t_3) { /* "PETSc/Options.pyx":98 * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: * option = bytes2str(nm) # <<<<<<<<<<<<<< * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_nm); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_option = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Options.pyx":97 * cdef const char *nm = NULL * tmp = getpair(self.prefix, name, &pr, &nm) * if pr == NULL: # <<<<<<<<<<<<<< * option = bytes2str(nm) * else: */ goto __pyx_L3; } /* "PETSc/Options.pyx":100 * option = bytes2str(nm) * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) # <<<<<<<<<<<<<< * cdef const char *key = NULL * option = str2bytes(option, &key) */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pr); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_option = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "PETSc/Options.pyx":101 * else: * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * cdef const char *key = NULL # <<<<<<<<<<<<<< * option = str2bytes(option, &key) * CHKERR( PetscOptionsClearValue(self.opt, key) ) */ __pyx_v_key = NULL; /* "PETSc/Options.pyx":102 * option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1])) * cdef const char *key = NULL * option = str2bytes(option, &key) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsClearValue(self.opt, key) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":103 * cdef const char *key = NULL * option = str2bytes(option, &key) * CHKERR( PetscOptionsClearValue(self.opt, key) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClearValue(__pyx_v_self->opt, __pyx_v_key)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(26, 103, __pyx_L1_error) /* "PETSc/Options.pyx":93 * CHKERR( PetscOptionsSetValue(self.opt, key, val) ) * * def delValue(self, name): # <<<<<<<<<<<<<< * cdef const char *pr = NULL * cdef const char *nm = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Options.delValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_option); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":107 * # * * def getBool(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31getBool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_30getBool[] = "Options.getBool(self, name, default=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31getBool(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBool (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getBool") < 0)) __PYX_ERR(26, 107, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getBool", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 107, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.getBool", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_30getBool(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_30getBool(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBool", 0); /* "PETSc/Options.pyx":108 * * def getBool(self, name, default=None): * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getInt(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_BOOL, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":107 * # * * def getBool(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getBool", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":110 * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * * def getInt(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_INT, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getInt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_32getInt[] = "Options.getInt(self, name, default=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getInt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInt (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getInt") < 0)) __PYX_ERR(26, 110, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getInt", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 110, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.getInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_32getInt(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getInt(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInt", 0); /* "PETSc/Options.pyx":111 * * def getInt(self, name, default=None): * return getopt(self.opt, OPT_INT, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getReal(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_INT, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":110 * return getopt(self.opt, OPT_BOOL, self.prefix, name, default) * * def getInt(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_INT, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getInt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":113 * return getopt(self.opt, OPT_INT, self.prefix, name, default) * * def getReal(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_34getReal[] = "Options.getReal(self, name, default=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getReal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getReal") < 0)) __PYX_ERR(26, 113, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getReal", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 113, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.getReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_34getReal(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_34getReal(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getReal", 0); /* "PETSc/Options.pyx":114 * * def getReal(self, name, default=None): * return getopt(self.opt, OPT_REAL, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getScalar(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_REAL, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":113 * return getopt(self.opt, OPT_INT, self.prefix, name, default) * * def getReal(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":116 * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * * def getScalar(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_36getScalar[] = "Options.getScalar(self, name, default=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getScalar (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getScalar") < 0)) __PYX_ERR(26, 116, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getScalar", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 116, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.getScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_36getScalar(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getScalar", 0); /* "PETSc/Options.pyx":117 * * def getScalar(self, name, default=None): * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) # <<<<<<<<<<<<<< * * def getString(self, name, default=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_SCALAR, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":116 * return getopt(self.opt, OPT_REAL, self.prefix, name, default) * * def getScalar(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getScalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":119 * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * * def getString(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_STRING, self.prefix, name, default) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_38getString[] = "Options.getString(self, name, default=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_default = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getString (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getString") < 0)) __PYX_ERR(26, 119, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getString", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 119, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.getString", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_38getString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_38getString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getString", 0); /* "PETSc/Options.pyx":120 * * def getString(self, name, default=None): * return getopt(self.opt, OPT_STRING, self.prefix, name, default) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getopt(__pyx_v_self->opt, __pyx_e_8petsc4py_5PETSc_OPT_STRING, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":119 * return getopt(self.opt, OPT_SCALAR, self.prefix, name, default) * * def getString(self, name, default=None): # <<<<<<<<<<<<<< * return getopt(self.opt, OPT_STRING, self.prefix, name, default) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Options.getString", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":124 * # * * def insertString(self, string): # <<<<<<<<<<<<<< * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41insertString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_40insertString[] = "Options.insertString(self, string)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41insertString(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_string = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertString (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_string,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_string)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertString") < 0)) __PYX_ERR(26, 124, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_string = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertString", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(26, 124, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Options.insertString", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_40insertString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_string); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_40insertString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_string) { char const *__pyx_v_cstring; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertString", 0); __Pyx_INCREF(__pyx_v_string); /* "PETSc/Options.pyx":125 * * def insertString(self, string): * cdef const char *cstring = NULL # <<<<<<<<<<<<<< * string = str2bytes(string, &cstring) * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) */ __pyx_v_cstring = NULL; /* "PETSc/Options.pyx":126 * def insertString(self, string): * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) # <<<<<<<<<<<<<< * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_string, (&__pyx_v_cstring)); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_string, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Options.pyx":127 * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) # <<<<<<<<<<<<<< * * def getAll(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsInsertString(__pyx_v_self->opt, __pyx_v_cstring)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(26, 127, __pyx_L1_error) /* "PETSc/Options.pyx":124 * # * * def insertString(self, string): # <<<<<<<<<<<<<< * cdef const char *cstring = NULL * string = str2bytes(string, &cstring) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Options.insertString", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_string); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Options.pyx":129 * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) * * def getAll(self): # <<<<<<<<<<<<<< * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Options_42getAll[] = "Options.getAll(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAll (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAll", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAll", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_42getAll(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_42getAll(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self) { char *__pyx_v_allopts; PyObject *__pyx_v_options = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAll", 0); /* "PETSc/Options.pyx":130 * * def getAll(self): * cdef char *allopts = NULL # <<<<<<<<<<<<<< * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) * options = bytes2str(allopts) */ __pyx_v_allopts = NULL; /* "PETSc/Options.pyx":131 * def getAll(self): * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) # <<<<<<<<<<<<<< * options = bytes2str(allopts) * CHKERR( PetscFree(allopts) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetAll(__pyx_v_self->opt, (&__pyx_v_allopts))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(26, 131, __pyx_L1_error) /* "PETSc/Options.pyx":132 * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) * options = bytes2str(allopts) # <<<<<<<<<<<<<< * CHKERR( PetscFree(allopts) ) * return parseopt(options, self.prefix) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_allopts); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_options = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Options.pyx":133 * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) * options = bytes2str(allopts) * CHKERR( PetscFree(allopts) ) # <<<<<<<<<<<<<< * return parseopt(options, self.prefix) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_allopts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(26, 133, __pyx_L1_error) /* "PETSc/Options.pyx":134 * options = bytes2str(allopts) * CHKERR( PetscFree(allopts) ) * return parseopt(options, self.prefix) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_parseopt(__pyx_v_options, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Options.pyx":129 * CHKERR( PetscOptionsInsertString(self.opt, cstring) ) * * def getAll(self): # <<<<<<<<<<<<<< * cdef char *allopts = NULL * CHKERR( PetscOptionsGetAll(self.opt, &allopts) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Options.getAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_options); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":6 * * @classmethod * def getVersion(cls, devel=False, date=False, author=False): # <<<<<<<<<<<<<< * cdef char cversion[256] * cdef PetscInt major=0, minor=0, micro=0, release=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_getVersion[] = "Sys.getVersion(type cls, devel=False, date=False, author=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_devel = 0; PyObject *__pyx_v_date = 0; PyObject *__pyx_v_author = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVersion (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_devel,&__pyx_n_s_date,&__pyx_n_s_author,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_False); values[1] = ((PyObject *)Py_False); values[2] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_devel); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_date); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_author); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getVersion") < 0)) __PYX_ERR(27, 6, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_devel = values[0]; __pyx_v_date = values[1]; __pyx_v_author = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVersion", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 6, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(((PyTypeObject*)__pyx_v_cls), __pyx_v_devel, __pyx_v_date, __pyx_v_author); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_getVersion(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_devel, PyObject *__pyx_v_date, PyObject *__pyx_v_author) { char __pyx_v_cversion[0x100]; PetscInt __pyx_v_major; PetscInt __pyx_v_minor; PetscInt __pyx_v_micro; PetscInt __pyx_v_release; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_version = NULL; PyObject *__pyx_v_vstr = NULL; PyObject *__pyx_8genexpr1__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVersion", 0); __Pyx_INCREF(__pyx_v_date); __Pyx_INCREF(__pyx_v_author); /* "PETSc/Sys.pyx":8 * def getVersion(cls, devel=False, date=False, author=False): * cdef char cversion[256] * cdef PetscInt major=0, minor=0, micro=0, release=0 # <<<<<<<<<<<<<< * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) */ __pyx_v_major = 0; __pyx_v_minor = 0; __pyx_v_micro = 0; __pyx_v_release = 0; /* "PETSc/Sys.pyx":9 * cdef char cversion[256] * cdef PetscInt major=0, minor=0, micro=0, release=0 * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) # <<<<<<<<<<<<<< * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetVersion(__pyx_v_cversion, (sizeof(__pyx_v_cversion)))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(27, 9, __pyx_L1_error) /* "PETSc/Sys.pyx":10 * cdef PetscInt major=0, minor=0, micro=0, release=0 * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) # <<<<<<<<<<<<<< * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetVersionNumber((&__pyx_v_major), (&__pyx_v_minor), (&__pyx_v_micro), (&__pyx_v_release))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(27, 10, __pyx_L1_error) /* "PETSc/Sys.pyx":11 * CHKERR( PetscGetVersion(cversion, sizeof(cversion)) ) * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) # <<<<<<<<<<<<<< * if devel or date or author: * out = [version] */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_major); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_minor); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_micro); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __Pyx_INCREF(__pyx_t_5); __pyx_v_out = __pyx_t_5; __Pyx_INCREF(__pyx_t_5); __pyx_v_version = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":12 * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: # <<<<<<<<<<<<<< * out = [version] * if devel: */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_devel); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(27, 12, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_date); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(27, 12, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_6 = __pyx_t_7; goto __pyx_L4_bool_binop_done; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_author); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(27, 12, __pyx_L1_error) __pyx_t_6 = __pyx_t_7; __pyx_L4_bool_binop_done:; if (__pyx_t_6) { /* "PETSc/Sys.pyx":13 * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: * out = [version] # <<<<<<<<<<<<<< * if devel: * out.append(not release) */ __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_version); __Pyx_GIVEREF(__pyx_v_version); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_version); __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":14 * if devel or date or author: * out = [version] * if devel: # <<<<<<<<<<<<<< * out.append(not release) * if date: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_devel); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(27, 14, __pyx_L1_error) if (__pyx_t_6) { /* "PETSc/Sys.pyx":15 * out = [version] * if devel: * out.append(not release) # <<<<<<<<<<<<<< * if date: * vstr = bytes2str(cversion) */ __pyx_t_5 = __Pyx_PyBool_FromLong((!((__pyx_v_release != 0) != 0))); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(27, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":14 * if devel or date or author: * out = [version] * if devel: # <<<<<<<<<<<<<< * out.append(not release) * if date: */ } /* "PETSc/Sys.pyx":16 * if devel: * out.append(not release) * if date: # <<<<<<<<<<<<<< * vstr = bytes2str(cversion) * if release != 0: */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_date); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(27, 16, __pyx_L1_error) if (__pyx_t_6) { /* "PETSc/Sys.pyx":17 * out.append(not release) * if date: * vstr = bytes2str(cversion) # <<<<<<<<<<<<<< * if release != 0: * date = vstr.split(",", 1)[-1].strip() */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cversion); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_vstr = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/Sys.pyx":18 * if date: * vstr = bytes2str(cversion) * if release != 0: # <<<<<<<<<<<<<< * date = vstr.split(",", 1)[-1].strip() * else: */ __pyx_t_6 = ((__pyx_v_release != 0) != 0); if (__pyx_t_6) { /* "PETSc/Sys.pyx":19 * vstr = bytes2str(cversion) * if release != 0: * date = vstr.split(",", 1)[-1].strip() # <<<<<<<<<<<<<< * else: * date = vstr.split("GIT Date:")[-1].strip() */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vstr, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":18 * if date: * vstr = bytes2str(cversion) * if release != 0: # <<<<<<<<<<<<<< * date = vstr.split(",", 1)[-1].strip() * else: */ goto __pyx_L9; } /* "PETSc/Sys.pyx":21 * date = vstr.split(",", 1)[-1].strip() * else: * date = vstr.split("GIT Date:")[-1].strip() # <<<<<<<<<<<<<< * out.append(date) * if author: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vstr, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_kp_s_GIT_Date) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_GIT_Date); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5); __pyx_t_5 = 0; } __pyx_L9:; /* "PETSc/Sys.pyx":22 * else: * date = vstr.split("GIT Date:")[-1].strip() * out.append(date) # <<<<<<<<<<<<<< * if author: * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') */ __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_v_date); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(27, 22, __pyx_L1_error) /* "PETSc/Sys.pyx":16 * if devel: * out.append(not release) * if date: # <<<<<<<<<<<<<< * vstr = bytes2str(cversion) * if release != 0: */ } /* "PETSc/Sys.pyx":23 * date = vstr.split("GIT Date:")[-1].strip() * out.append(date) * if author: # <<<<<<<<<<<<<< * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_author); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(27, 23, __pyx_L1_error) if (__pyx_t_6) { /* "PETSc/Sys.pyx":24 * out.append(date) * if author: * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') # <<<<<<<<<<<<<< * author = tuple([s.strip() for s in author if s]) * out.append(author) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(PETSC_AUTHOR_INFO); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_s__13) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s__13); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_author, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":25 * if author: * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) # <<<<<<<<<<<<<< * out.append(author) * return tuple(out) */ { /* enter inner scope */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 25, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_v_author)) || PyTuple_CheckExact(__pyx_v_author)) { __pyx_t_4 = __pyx_v_author; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_author); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 25, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(27, 25, __pyx_L13_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(27, 25, __pyx_L13_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 25, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(27, 25, __pyx_L13_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 25, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(27, 25, __pyx_L13_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_8genexpr1__pyx_v_s); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(27, 25, __pyx_L13_error) if (__pyx_t_6) { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 25, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_11) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 25, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_3))) __PYX_ERR(27, 25, __pyx_L13_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0; goto __pyx_L17_exit_scope; __pyx_L13_error:; __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __pyx_8genexpr1__pyx_v_s = 0; goto __pyx_L1_error; __pyx_L17_exit_scope:; } /* exit inner scope */ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_author, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Sys.pyx":26 * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) * out.append(author) # <<<<<<<<<<<<<< * return tuple(out) * */ __pyx_t_8 = __Pyx_PyObject_Append(__pyx_v_out, __pyx_v_author); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(27, 26, __pyx_L1_error) /* "PETSc/Sys.pyx":23 * date = vstr.split("GIT Date:")[-1].strip() * out.append(date) * if author: # <<<<<<<<<<<<<< * author = bytes2str(PETSC_AUTHOR_INFO).split('\n') * author = tuple([s.strip() for s in author if s]) */ } /* "PETSc/Sys.pyx":12 * CHKERR( PetscGetVersionNumber(&major, &minor, µ, &release) ) * out = version = (toInt(major), toInt(minor), toInt(micro)) * if devel or date or author: # <<<<<<<<<<<<<< * out = [version] * if devel: */ } /* "PETSc/Sys.pyx":27 * author = tuple([s.strip() for s in author if s]) * out.append(author) * return tuple(out) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Sys.pyx":6 * * @classmethod * def getVersion(cls, devel=False, date=False, author=False): # <<<<<<<<<<<<<< * cdef char cversion[256] * cdef PetscInt major=0, minor=0, micro=0, release=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.Sys.getVersion", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_out); __Pyx_XDECREF(__pyx_v_version); __Pyx_XDECREF(__pyx_v_vstr); __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_s); __Pyx_XDECREF(__pyx_v_date); __Pyx_XDECREF(__pyx_v_author); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":30 * * @classmethod * def getVersionInfo(cls): # <<<<<<<<<<<<<< * version, dev, date, author = cls.getVersion(True, True, True) * return dict(major = version[0], */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_2getVersionInfo[] = "Sys.getVersionInfo(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVersionInfo (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getVersionInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVersionInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_2getVersionInfo(PyTypeObject *__pyx_v_cls) { PyObject *__pyx_v_version = NULL; PyObject *__pyx_v_dev = NULL; PyObject *__pyx_v_date = NULL; PyObject *__pyx_v_author = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVersionInfo", 0); /* "PETSc/Sys.pyx":31 * @classmethod * def getVersionInfo(cls): * version, dev, date, author = cls.getVersion(True, True, True) # <<<<<<<<<<<<<< * return dict(major = version[0], * minor = version[1], */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_getVersion); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(27, 31, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); __pyx_t_4 = PyList_GET_ITEM(sequence, 2); __pyx_t_5 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(27, 31, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5}; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(27, 31, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(27, 31, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_version = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_dev = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_date = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_author = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/Sys.pyx":32 * def getVersionInfo(cls): * version, dev, date, author = cls.getVersion(True, True, True) * return dict(major = version[0], # <<<<<<<<<<<<<< * minor = version[1], * subminor = version[2], */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_major, __pyx_t_5) < 0) __PYX_ERR(27, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":33 * version, dev, date, author = cls.getVersion(True, True, True) * return dict(major = version[0], * minor = version[1], # <<<<<<<<<<<<<< * subminor = version[2], * release = not dev, */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_minor, __pyx_t_5) < 0) __PYX_ERR(27, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":34 * return dict(major = version[0], * minor = version[1], * subminor = version[2], # <<<<<<<<<<<<<< * release = not dev, * date = date, */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_subminor, __pyx_t_5) < 0) __PYX_ERR(27, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":35 * minor = version[1], * subminor = version[2], * release = not dev, # <<<<<<<<<<<<<< * date = date, * authorinfo = author) */ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_dev); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(27, 35, __pyx_L1_error) __pyx_t_5 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_release, __pyx_t_5) < 0) __PYX_ERR(27, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Sys.pyx":36 * subminor = version[2], * release = not dev, * date = date, # <<<<<<<<<<<<<< * authorinfo = author) * */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_date, __pyx_v_date) < 0) __PYX_ERR(27, 32, __pyx_L1_error) /* "PETSc/Sys.pyx":37 * release = not dev, * date = date, * authorinfo = author) # <<<<<<<<<<<<<< * * # --- xxx --- */ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_authorinfo, __pyx_v_author) < 0) __PYX_ERR(27, 32, __pyx_L1_error) __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Sys.pyx":30 * * @classmethod * def getVersionInfo(cls): # <<<<<<<<<<<<<< * version, dev, date, author = cls.getVersion(True, True, True) * return dict(major = version[0], */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Sys.getVersionInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_version); __Pyx_XDECREF(__pyx_v_dev); __Pyx_XDECREF(__pyx_v_date); __Pyx_XDECREF(__pyx_v_author); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":42 * * @classmethod * def isInitialized(cls): # <<<<<<<<<<<<<< * return toBool(PetscInitializeCalled) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_4isInitialized[] = "Sys.isInitialized(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isInitialized (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isInitialized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isInitialized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_4isInitialized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isInitialized", 0); /* "PETSc/Sys.pyx":43 * @classmethod * def isInitialized(cls): * return toBool(PetscInitializeCalled) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(PetscInitializeCalled); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Sys.pyx":42 * * @classmethod * def isInitialized(cls): # <<<<<<<<<<<<<< * return toBool(PetscInitializeCalled) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.isInitialized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":46 * * @classmethod * def isFinalized(cls): # <<<<<<<<<<<<<< * return toBool(PetscFinalizeCalled) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_6isFinalized[] = "Sys.isFinalized(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isFinalized (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isFinalized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isFinalized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_6isFinalized(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isFinalized", 0); /* "PETSc/Sys.pyx":47 * @classmethod * def isFinalized(cls): * return toBool(PetscFinalizeCalled) # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(PetscFinalizeCalled); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Sys.pyx":46 * * @classmethod * def isFinalized(cls): # <<<<<<<<<<<<<< * return toBool(PetscFinalizeCalled) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.isFinalized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":52 * * @classmethod * def getDefaultComm(cls): # <<<<<<<<<<<<<< * cdef Comm comm = Comm() * comm.comm = PETSC_COMM_DEFAULT */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_8getDefaultComm[] = "Sys.getDefaultComm(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDefaultComm (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDefaultComm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDefaultComm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_8getDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { struct PyPetscCommObject *__pyx_v_comm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDefaultComm", 0); /* "PETSc/Sys.pyx":53 * @classmethod * def getDefaultComm(cls): * cdef Comm comm = Comm() # <<<<<<<<<<<<<< * comm.comm = PETSC_COMM_DEFAULT * return comm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Sys.pyx":54 * def getDefaultComm(cls): * cdef Comm comm = Comm() * comm.comm = PETSC_COMM_DEFAULT # <<<<<<<<<<<<<< * return comm * */ __pyx_v_comm->comm = __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT; /* "PETSc/Sys.pyx":55 * cdef Comm comm = Comm() * comm.comm = PETSC_COMM_DEFAULT * return comm # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_comm)); __pyx_r = ((PyObject *)__pyx_v_comm); goto __pyx_L0; /* "PETSc/Sys.pyx":52 * * @classmethod * def getDefaultComm(cls): # <<<<<<<<<<<<<< * cdef Comm comm = Comm() * comm.comm = PETSC_COMM_DEFAULT */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.getDefaultComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":58 * * @classmethod * def setDefaultComm(cls, comm): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_10setDefaultComm[] = "Sys.setDefaultComm(type cls, comm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDefaultComm (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDefaultComm") < 0)) __PYX_ERR(27, 58, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDefaultComm", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 58, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.setDefaultComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_10setDefaultComm(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDefaultComm", 0); /* "PETSc/Sys.pyx":59 * @classmethod * def setDefaultComm(cls, comm): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) # <<<<<<<<<<<<<< * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_WORLD); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 59, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Sys.pyx":60 * def setDefaultComm(cls, comm): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * global PETSC_COMM_DEFAULT */ __pyx_t_2 = ((__pyx_v_ccomm == MPI_COMM_NULL) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/Sys.pyx":61 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = ccomm */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(27, 61, __pyx_L1_error) /* "PETSc/Sys.pyx":60 * def setDefaultComm(cls, comm): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * global PETSC_COMM_DEFAULT */ } /* "PETSc/Sys.pyx":63 * raise ValueError("null communicator") * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = ccomm # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = __pyx_v_ccomm; /* "PETSc/Sys.pyx":58 * * @classmethod * def setDefaultComm(cls, comm): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Sys.setDefaultComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":68 * * @classmethod * def Print(cls, *args, **kargs): # <<<<<<<<<<<<<< * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_13Print(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_12Print[] = "Sys.Print(type cls, *args, **kargs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_13Print(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Print (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "Print", 1))) return NULL; __pyx_v_kargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL; __Pyx_GOTREF(__pyx_v_kargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_12Print(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_12Print(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_comm = 0; MPI_Comm __pyx_v_ccomm; PyObject *__pyx_v_sep = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_format = NULL; PyObject *__pyx_v_message = NULL; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; MPI_Comm __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Print", 0); __Pyx_INCREF(__pyx_v_args); /* "PETSc/Sys.pyx":69 * @classmethod * def Print(cls, *args, **kargs): * cdef object comm = kargs.get('comm', None) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef object sep = kargs.get('sep', ' ') */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_comm, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comm = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Sys.pyx":70 * def Print(cls, *args, **kargs): * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef object sep = kargs.get('sep', ' ') * cdef object end = kargs.get('end', '\n') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 70, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_2; /* "PETSc/Sys.pyx":71 * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef object sep = kargs.get('sep', ' ') # <<<<<<<<<<<<<< * cdef object end = kargs.get('end', '\n') * if comm_rank(ccomm) == 0: */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_sep, __pyx_kp_s__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sep = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Sys.pyx":72 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef object sep = kargs.get('sep', ' ') * cdef object end = kargs.get('end', '\n') # <<<<<<<<<<<<<< * if comm_rank(ccomm) == 0: * if not args: args = ('',) */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_end, __pyx_kp_s__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_end = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Sys.pyx":73 * cdef object sep = kargs.get('sep', ' ') * cdef object end = kargs.get('end', '\n') * if comm_rank(ccomm) == 0: # <<<<<<<<<<<<<< * if not args: args = ('',) * format = ['%s', sep] * len(args) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_comm_rank(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(27, 73, __pyx_L1_error) __pyx_t_4 = ((__pyx_t_3 == 0) != 0); if (__pyx_t_4) { /* "PETSc/Sys.pyx":74 * cdef object end = kargs.get('end', '\n') * if comm_rank(ccomm) == 0: * if not args: args = ('',) # <<<<<<<<<<<<<< * format = ['%s', sep] * len(args) * format[-1] = end */ __pyx_t_4 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); __pyx_t_5 = ((!__pyx_t_4) != 0); if (__pyx_t_5) { __Pyx_INCREF(__pyx_tuple__17); __Pyx_DECREF_SET(__pyx_v_args, __pyx_tuple__17); } /* "PETSc/Sys.pyx":75 * if comm_rank(ccomm) == 0: * if not args: args = ('',) * format = ['%s', sep] * len(args) # <<<<<<<<<<<<<< * format[-1] = end * message = ''.join(format) % args */ __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(27, 75, __pyx_L1_error) __pyx_t_1 = PyList_New(2 * ((__pyx_t_6<0) ? 0:__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_t_6; __pyx_temp++) { __Pyx_INCREF(__pyx_kp_s_s); __Pyx_GIVEREF(__pyx_kp_s_s); PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2, __pyx_kp_s_s); __Pyx_INCREF(__pyx_v_sep); __Pyx_GIVEREF(__pyx_v_sep); PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2 + 1, __pyx_v_sep); } } __pyx_v_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Sys.pyx":76 * if not args: args = ('',) * format = ['%s', sep] * len(args) * format[-1] = end # <<<<<<<<<<<<<< * message = ''.join(format) % args * else: */ if (unlikely(__Pyx_SetItemInt(__pyx_v_format, -1L, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(27, 76, __pyx_L1_error) /* "PETSc/Sys.pyx":77 * format = ['%s', sep] * len(args) * format[-1] = end * message = ''.join(format) % args # <<<<<<<<<<<<<< * else: * message = '' */ __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyNumber_Remainder(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_message = __pyx_t_7; __pyx_t_7 = 0; /* "PETSc/Sys.pyx":73 * cdef object sep = kargs.get('sep', ' ') * cdef object end = kargs.get('end', '\n') * if comm_rank(ccomm) == 0: # <<<<<<<<<<<<<< * if not args: args = ('',) * format = ['%s', sep] * len(args) */ goto __pyx_L3; } /* "PETSc/Sys.pyx":79 * message = ''.join(format) % args * else: * message = '' # <<<<<<<<<<<<<< * cdef const char *m = NULL * message = str2bytes(message, &m) */ /*else*/ { __Pyx_INCREF(__pyx_kp_s__7); __pyx_v_message = __pyx_kp_s__7; } __pyx_L3:; /* "PETSc/Sys.pyx":80 * else: * message = '' * cdef const char *m = NULL # <<<<<<<<<<<<<< * message = str2bytes(message, &m) * CHKERR( PetscPrintf(ccomm, m) ) */ __pyx_v_m = NULL; /* "PETSc/Sys.pyx":81 * message = '' * cdef const char *m = NULL * message = str2bytes(message, &m) # <<<<<<<<<<<<<< * CHKERR( PetscPrintf(ccomm, m) ) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_message, (&__pyx_v_m)); if (unlikely(!__pyx_t_7)) __PYX_ERR(27, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Sys.pyx":82 * cdef const char *m = NULL * message = str2bytes(message, &m) * CHKERR( PetscPrintf(ccomm, m) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPrintf(__pyx_v_ccomm, __pyx_v_m)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(27, 82, __pyx_L1_error) /* "PETSc/Sys.pyx":68 * * @classmethod * def Print(cls, *args, **kargs): # <<<<<<<<<<<<<< * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Sys.Print", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_comm); __Pyx_XDECREF(__pyx_v_sep); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":85 * * @classmethod * def syncPrint(cls, *args, **kargs): # <<<<<<<<<<<<<< * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_14syncPrint[] = "Sys.syncPrint(type cls, *args, **kargs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("syncPrint (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "syncPrint", 1))) return NULL; __pyx_v_kargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL; __Pyx_GOTREF(__pyx_v_kargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(((PyTypeObject*)__pyx_v_cls), __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_14syncPrint(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_comm = 0; MPI_Comm __pyx_v_ccomm; PyObject *__pyx_v_sep = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_flush = 0; PyObject *__pyx_v_format = NULL; PyObject *__pyx_v_message = NULL; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; MPI_Comm __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("syncPrint", 0); __Pyx_INCREF(__pyx_v_args); /* "PETSc/Sys.pyx":86 * @classmethod * def syncPrint(cls, *args, **kargs): * cdef object comm = kargs.get('comm', None) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef object sep = kargs.get('sep', ' ') */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_comm, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comm = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Sys.pyx":87 * def syncPrint(cls, *args, **kargs): * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef object sep = kargs.get('sep', ' ') * cdef object end = kargs.get('end', '\n') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 87, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_2; /* "PETSc/Sys.pyx":88 * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef object sep = kargs.get('sep', ' ') # <<<<<<<<<<<<<< * cdef object end = kargs.get('end', '\n') * cdef object flush = kargs.get('flush', False) */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_sep, __pyx_kp_s__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sep = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Sys.pyx":89 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef object sep = kargs.get('sep', ' ') * cdef object end = kargs.get('end', '\n') # <<<<<<<<<<<<<< * cdef object flush = kargs.get('flush', False) * if not args: args = ('',) */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_end, __pyx_kp_s__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_end = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Sys.pyx":90 * cdef object sep = kargs.get('sep', ' ') * cdef object end = kargs.get('end', '\n') * cdef object flush = kargs.get('flush', False) # <<<<<<<<<<<<<< * if not args: args = ('',) * format = ['%s', sep] * len(args) */ __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kargs, __pyx_n_s_flush, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_flush = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Sys.pyx":91 * cdef object end = kargs.get('end', '\n') * cdef object flush = kargs.get('flush', False) * if not args: args = ('',) # <<<<<<<<<<<<<< * format = ['%s', sep] * len(args) * format[-1] = end */ __pyx_t_3 = (PyTuple_GET_SIZE(__pyx_v_args) != 0); __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { __Pyx_INCREF(__pyx_tuple__17); __Pyx_DECREF_SET(__pyx_v_args, __pyx_tuple__17); } /* "PETSc/Sys.pyx":92 * cdef object flush = kargs.get('flush', False) * if not args: args = ('',) * format = ['%s', sep] * len(args) # <<<<<<<<<<<<<< * format[-1] = end * message = ''.join(format) % args */ __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(27, 92, __pyx_L1_error) __pyx_t_1 = PyList_New(2 * ((__pyx_t_5<0) ? 0:__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_t_5; __pyx_temp++) { __Pyx_INCREF(__pyx_kp_s_s); __Pyx_GIVEREF(__pyx_kp_s_s); PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2, __pyx_kp_s_s); __Pyx_INCREF(__pyx_v_sep); __Pyx_GIVEREF(__pyx_v_sep); PyList_SET_ITEM(__pyx_t_1, __pyx_temp * 2 + 1, __pyx_v_sep); } } __pyx_v_format = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Sys.pyx":93 * if not args: args = ('',) * format = ['%s', sep] * len(args) * format[-1] = end # <<<<<<<<<<<<<< * message = ''.join(format) % args * cdef const char *m = NULL */ if (unlikely(__Pyx_SetItemInt(__pyx_v_format, -1L, __pyx_v_end, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(27, 93, __pyx_L1_error) /* "PETSc/Sys.pyx":94 * format = ['%s', sep] * len(args) * format[-1] = end * message = ''.join(format) % args # <<<<<<<<<<<<<< * cdef const char *m = NULL * message = str2bytes(message, &m) */ __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyNumber_Remainder(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_message = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/Sys.pyx":95 * format[-1] = end * message = ''.join(format) % args * cdef const char *m = NULL # <<<<<<<<<<<<<< * message = str2bytes(message, &m) * CHKERR( PetscSynchronizedPrintf(ccomm, m) ) */ __pyx_v_m = NULL; /* "PETSc/Sys.pyx":96 * message = ''.join(format) % args * cdef const char *m = NULL * message = str2bytes(message, &m) # <<<<<<<<<<<<<< * CHKERR( PetscSynchronizedPrintf(ccomm, m) ) * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_message, (&__pyx_v_m)); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/Sys.pyx":97 * cdef const char *m = NULL * message = str2bytes(message, &m) * CHKERR( PetscSynchronizedPrintf(ccomm, m) ) # <<<<<<<<<<<<<< * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSynchronizedPrintf(__pyx_v_ccomm, __pyx_v_m)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(27, 97, __pyx_L1_error) /* "PETSc/Sys.pyx":98 * message = str2bytes(message, &m) * CHKERR( PetscSynchronizedPrintf(ccomm, m) ) * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_flush); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(27, 98, __pyx_L1_error) if (__pyx_t_4) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSynchronizedFlush(__pyx_v_ccomm, PETSC_STDOUT)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(27, 98, __pyx_L1_error) } /* "PETSc/Sys.pyx":85 * * @classmethod * def syncPrint(cls, *args, **kargs): # <<<<<<<<<<<<<< * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Sys.syncPrint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_comm); __Pyx_XDECREF(__pyx_v_sep); __Pyx_XDECREF(__pyx_v_end); __Pyx_XDECREF(__pyx_v_flush); __Pyx_XDECREF(__pyx_v_format); __Pyx_XDECREF(__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":101 * * @classmethod * def syncFlush(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_16syncFlush[] = "Sys.syncFlush(type cls, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("syncFlush (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "syncFlush") < 0)) __PYX_ERR(27, 101, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("syncFlush", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 101, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.syncFlush", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_16syncFlush(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_16syncFlush(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("syncFlush", 0); /* "PETSc/Sys.pyx":102 * @classmethod * def syncFlush(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 102, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Sys.pyx":103 * def syncFlush(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSynchronizedFlush(__pyx_v_ccomm, PETSC_STDOUT)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(27, 103, __pyx_L1_error) /* "PETSc/Sys.pyx":101 * * @classmethod * def syncFlush(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.syncFlush", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":108 * * @classmethod * def splitOwnership(cls, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_18splitOwnership[] = "Sys.splitOwnership(type cls, size, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("splitOwnership (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "splitOwnership") < 0)) __PYX_ERR(27, 108, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("splitOwnership", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 108, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.splitOwnership", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_18splitOwnership(((PyTypeObject*)__pyx_v_cls), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_18splitOwnership(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("splitOwnership", 0); /* "PETSc/Sys.pyx":109 * @classmethod * def splitOwnership(cls, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Sys_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(27, 109, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Sys.pyx":110 * def splitOwnership(cls, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Sys_Sizes(size, bsize, &bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Sys.pyx":111 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Sys_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if n > 0: n = n // bs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(27, 111, __pyx_L1_error) /* "PETSc/Sys.pyx":112 * cdef PetscInt bs=0, n=0, N=0 * Sys_Sizes(size, bsize, &bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if n > 0: n = n // bs * if N > 0: N = N // bs */ __pyx_t_3 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_bs = 1; } /* "PETSc/Sys.pyx":113 * Sys_Sizes(size, bsize, &bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if n > 0: n = n // bs # <<<<<<<<<<<<<< * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) */ __pyx_t_3 = ((__pyx_v_n > 0) != 0); if (__pyx_t_3) { __pyx_v_n = (__pyx_v_n / __pyx_v_bs); } /* "PETSc/Sys.pyx":114 * if bs == PETSC_DECIDE: bs = 1 * if n > 0: n = n // bs * if N > 0: N = N // bs # <<<<<<<<<<<<<< * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) * n = n * bs */ __pyx_t_3 = ((__pyx_v_N > 0) != 0); if (__pyx_t_3) { __pyx_v_N = (__pyx_v_N / __pyx_v_bs); } /* "PETSc/Sys.pyx":115 * if n > 0: n = n // bs * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) # <<<<<<<<<<<<<< * n = n * bs * N = N * bs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSplitOwnership(__pyx_v_ccomm, (&__pyx_v_n), (&__pyx_v_N))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(27, 115, __pyx_L1_error) /* "PETSc/Sys.pyx":116 * if N > 0: N = N // bs * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) * n = n * bs # <<<<<<<<<<<<<< * N = N * bs * return (toInt(n), toInt(N)) */ __pyx_v_n = (__pyx_v_n * __pyx_v_bs); /* "PETSc/Sys.pyx":117 * CHKERR( PetscSplitOwnership(ccomm, &n, &N) ) * n = n * bs * N = N * bs # <<<<<<<<<<<<<< * return (toInt(n), toInt(N)) * */ __pyx_v_N = (__pyx_v_N * __pyx_v_bs); /* "PETSc/Sys.pyx":118 * n = n * bs * N = N * bs * return (toInt(n), toInt(N)) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/Sys.pyx":108 * * @classmethod * def splitOwnership(cls, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Sys.splitOwnership", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":121 * * @classmethod * def sleep(cls, seconds=1): # <<<<<<<<<<<<<< * cdef int s = seconds * CHKERR( PetscSleep(s) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_20sleep[] = "Sys.sleep(type cls, seconds=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seconds = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sleep (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seconds,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seconds); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sleep") < 0)) __PYX_ERR(27, 121, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_seconds = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sleep", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 121, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.sleep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_20sleep(((PyTypeObject*)__pyx_v_cls), __pyx_v_seconds); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_20sleep(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_seconds) { int __pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sleep", 0); /* "PETSc/Sys.pyx":122 * @classmethod * def sleep(cls, seconds=1): * cdef int s = seconds # <<<<<<<<<<<<<< * CHKERR( PetscSleep(s) ) * */ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_seconds); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(27, 122, __pyx_L1_error) __pyx_v_s = __pyx_t_1; /* "PETSc/Sys.pyx":123 * def sleep(cls, seconds=1): * cdef int s = seconds * CHKERR( PetscSleep(s) ) # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSleep(__pyx_v_s)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(27, 123, __pyx_L1_error) /* "PETSc/Sys.pyx":121 * * @classmethod * def sleep(cls, seconds=1): # <<<<<<<<<<<<<< * cdef int s = seconds * CHKERR( PetscSleep(s) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.sleep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":128 * * @classmethod * def pushErrorHandler(cls, errhandler): # <<<<<<<<<<<<<< * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_22pushErrorHandler[] = "Sys.pushErrorHandler(type cls, errhandler)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_errhandler = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushErrorHandler (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_errhandler,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_errhandler)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushErrorHandler") < 0)) __PYX_ERR(27, 128, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_errhandler = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pushErrorHandler", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 128, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.pushErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_22pushErrorHandler(((PyTypeObject*)__pyx_v_cls), __pyx_v_errhandler); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_22pushErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_errhandler) { PetscErrorHandlerFunction __pyx_v_handler; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushErrorHandler", 0); /* "PETSc/Sys.pyx":129 * @classmethod * def pushErrorHandler(cls, errhandler): * cdef PetscErrorHandlerFunction handler = NULL # <<<<<<<<<<<<<< * if errhandler == "python": * handler = \ */ __pyx_v_handler = NULL; /* "PETSc/Sys.pyx":130 * def pushErrorHandler(cls, errhandler): * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": # <<<<<<<<<<<<<< * handler = \ * PetscPythonErrorHandler */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_python, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 130, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Sys.pyx":131 * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": * handler = \ # <<<<<<<<<<<<<< * PetscPythonErrorHandler * elif errhandler == "debugger": */ __pyx_v_handler = ((PetscErrorHandlerFunction)__pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler); /* "PETSc/Sys.pyx":130 * def pushErrorHandler(cls, errhandler): * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": # <<<<<<<<<<<<<< * handler = \ * PetscPythonErrorHandler */ goto __pyx_L3; } /* "PETSc/Sys.pyx":133 * handler = \ * PetscPythonErrorHandler * elif errhandler == "debugger": # <<<<<<<<<<<<<< * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_debugger, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 133, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Sys.pyx":134 * PetscPythonErrorHandler * elif errhandler == "debugger": * handler = PetscAttachDebuggerErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler */ __pyx_v_handler = PetscAttachDebuggerErrorHandler; /* "PETSc/Sys.pyx":133 * handler = \ * PetscPythonErrorHandler * elif errhandler == "debugger": # <<<<<<<<<<<<<< * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": */ goto __pyx_L3; } /* "PETSc/Sys.pyx":135 * elif errhandler == "debugger": * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": # <<<<<<<<<<<<<< * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_emacs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 135, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Sys.pyx":136 * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler */ __pyx_v_handler = PetscEmacsClientErrorHandler; /* "PETSc/Sys.pyx":135 * elif errhandler == "debugger": * handler = PetscAttachDebuggerErrorHandler * elif errhandler == "emacs": # <<<<<<<<<<<<<< * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": */ goto __pyx_L3; } /* "PETSc/Sys.pyx":137 * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": # <<<<<<<<<<<<<< * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_traceback_2, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 137, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Sys.pyx":138 * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler */ __pyx_v_handler = PetscTraceBackErrorHandler; /* "PETSc/Sys.pyx":137 * elif errhandler == "emacs": * handler = PetscEmacsClientErrorHandler * elif errhandler == "traceback": # <<<<<<<<<<<<<< * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": */ goto __pyx_L3; } /* "PETSc/Sys.pyx":139 * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": # <<<<<<<<<<<<<< * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_ignore, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 139, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Sys.pyx":140 * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler */ __pyx_v_handler = PetscIgnoreErrorHandler; /* "PETSc/Sys.pyx":139 * elif errhandler == "traceback": * handler = PetscTraceBackErrorHandler * elif errhandler == "ignore": # <<<<<<<<<<<<<< * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": */ goto __pyx_L3; } /* "PETSc/Sys.pyx":141 * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": # <<<<<<<<<<<<<< * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_mpiabort, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 141, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Sys.pyx":142 * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler # <<<<<<<<<<<<<< * elif errhandler == "abort": * handler = PetscAbortErrorHandler */ __pyx_v_handler = PetscMPIAbortErrorHandler; /* "PETSc/Sys.pyx":141 * elif errhandler == "ignore": * handler = PetscIgnoreErrorHandler * elif errhandler == "mpiabort": # <<<<<<<<<<<<<< * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": */ goto __pyx_L3; } /* "PETSc/Sys.pyx":143 * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": # <<<<<<<<<<<<<< * handler = PetscAbortErrorHandler * else: */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_errhandler, __pyx_n_s_abort, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 143, __pyx_L1_error) if (likely(__pyx_t_1)) { /* "PETSc/Sys.pyx":144 * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": * handler = PetscAbortErrorHandler # <<<<<<<<<<<<<< * else: * raise ValueError( */ __pyx_v_handler = PetscAbortErrorHandler; /* "PETSc/Sys.pyx":143 * elif errhandler == "mpiabort": * handler = PetscMPIAbortErrorHandler * elif errhandler == "abort": # <<<<<<<<<<<<<< * handler = PetscAbortErrorHandler * else: */ goto __pyx_L3; } /* "PETSc/Sys.pyx":146 * handler = PetscAbortErrorHandler * else: * raise ValueError( # <<<<<<<<<<<<<< * "unknown error handler: %s" % errhandler) * CHKERR( PetscPushErrorHandler(handler, NULL) ) */ /*else*/ { /* "PETSc/Sys.pyx":147 * else: * raise ValueError( * "unknown error handler: %s" % errhandler) # <<<<<<<<<<<<<< * CHKERR( PetscPushErrorHandler(handler, NULL) ) * */ __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_unknown_error_handler_s, __pyx_v_errhandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(27, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "PETSc/Sys.pyx":146 * handler = PetscAbortErrorHandler * else: * raise ValueError( # <<<<<<<<<<<<<< * "unknown error handler: %s" % errhandler) * CHKERR( PetscPushErrorHandler(handler, NULL) ) */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(27, 146, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Sys.pyx":148 * raise ValueError( * "unknown error handler: %s" % errhandler) * CHKERR( PetscPushErrorHandler(handler, NULL) ) # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPushErrorHandler(__pyx_v_handler, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(27, 148, __pyx_L1_error) /* "PETSc/Sys.pyx":128 * * @classmethod * def pushErrorHandler(cls, errhandler): # <<<<<<<<<<<<<< * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Sys.pushErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":152 * * @classmethod * def popErrorHandler(cls): # <<<<<<<<<<<<<< * CHKERR( PetscPopErrorHandler() ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_24popErrorHandler[] = "Sys.popErrorHandler(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popErrorHandler (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("popErrorHandler", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popErrorHandler", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_24popErrorHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popErrorHandler", 0); /* "PETSc/Sys.pyx":153 * @classmethod * def popErrorHandler(cls): * CHKERR( PetscPopErrorHandler() ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopErrorHandler()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(27, 153, __pyx_L1_error) /* "PETSc/Sys.pyx":152 * * @classmethod * def popErrorHandler(cls): # <<<<<<<<<<<<<< * CHKERR( PetscPopErrorHandler() ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.popErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":156 * * @classmethod * def popSignalHandler(cls): # <<<<<<<<<<<<<< * CHKERR( PetscPopSignalHandler() ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_26popSignalHandler[] = "Sys.popSignalHandler(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popSignalHandler (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("popSignalHandler", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popSignalHandler", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_26popSignalHandler(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popSignalHandler", 0); /* "PETSc/Sys.pyx":157 * @classmethod * def popSignalHandler(cls): * CHKERR( PetscPopSignalHandler() ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopSignalHandler()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(27, 157, __pyx_L1_error) /* "PETSc/Sys.pyx":156 * * @classmethod * def popSignalHandler(cls): # <<<<<<<<<<<<<< * CHKERR( PetscPopSignalHandler() ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.popSignalHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":160 * * @classmethod * def infoAllow(cls, flag, filename=None, mode="w"): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * cdef const char *cfilename = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_28infoAllow[] = "Sys.infoAllow(type cls, flag, filename=None, mode='w')"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("infoAllow (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_filename,&__pyx_n_s_mode,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)__pyx_n_s_w); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "infoAllow") < 0)) __PYX_ERR(27, 160, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; __pyx_v_filename = values[1]; __pyx_v_mode = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("infoAllow", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 160, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.infoAllow", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_28infoAllow(((PyTypeObject*)__pyx_v_cls), __pyx_v_flag, __pyx_v_filename, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_28infoAllow(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flag, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode) { PetscBool __pyx_v_tval; char const *__pyx_v_cfilename; char const *__pyx_v_cmode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("infoAllow", 0); __Pyx_INCREF(__pyx_v_filename); __Pyx_INCREF(__pyx_v_mode); /* "PETSc/Sys.pyx":161 * @classmethod * def infoAllow(cls, flag, filename=None, mode="w"): * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * cdef const char *cfilename = NULL * cdef const char *cmode = NULL */ __pyx_v_tval = PETSC_FALSE; /* "PETSc/Sys.pyx":162 * def infoAllow(cls, flag, filename=None, mode="w"): * cdef PetscBool tval = PETSC_FALSE * cdef const char *cfilename = NULL # <<<<<<<<<<<<<< * cdef const char *cmode = NULL * if flag: tval = PETSC_TRUE */ __pyx_v_cfilename = NULL; /* "PETSc/Sys.pyx":163 * cdef PetscBool tval = PETSC_FALSE * cdef const char *cfilename = NULL * cdef const char *cmode = NULL # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) */ __pyx_v_cmode = NULL; /* "PETSc/Sys.pyx":164 * cdef const char *cfilename = NULL * cdef const char *cmode = NULL * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 164, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "PETSc/Sys.pyx":165 * cdef const char *cmode = NULL * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) # <<<<<<<<<<<<<< * if filename is not None: * filename = str2bytes(filename, &cfilename) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInfoAllow(__pyx_v_tval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(27, 165, __pyx_L1_error) /* "PETSc/Sys.pyx":166 * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) */ __pyx_t_1 = (__pyx_v_filename != Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "PETSc/Sys.pyx":167 * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: * filename = str2bytes(filename, &cfilename) # <<<<<<<<<<<<<< * mode = str2bytes(mode, &cmode) * CHKERR( PetscInfoSetFile(cfilename, cmode) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfilename)); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Sys.pyx":168 * if filename is not None: * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) # <<<<<<<<<<<<<< * CHKERR( PetscInfoSetFile(cfilename, cmode) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_cmode)); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Sys.pyx":169 * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) * CHKERR( PetscInfoSetFile(cfilename, cmode) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInfoSetFile(__pyx_v_cfilename, __pyx_v_cmode)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(27, 169, __pyx_L1_error) /* "PETSc/Sys.pyx":166 * if flag: tval = PETSC_TRUE * CHKERR( PetscInfoAllow(tval) ) * if filename is not None: # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfilename) * mode = str2bytes(mode, &cmode) */ } /* "PETSc/Sys.pyx":160 * * @classmethod * def infoAllow(cls, flag, filename=None, mode="w"): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * cdef const char *cfilename = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Sys.infoAllow", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":172 * * @classmethod * def registerCitation(cls, citation): # <<<<<<<<<<<<<< * if not citation: raise ValueError("empty citation") * cdef const char *cit = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_30registerCitation[] = "Sys.registerCitation(type cls, citation)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_citation = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("registerCitation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_citation,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_citation)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "registerCitation") < 0)) __PYX_ERR(27, 172, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_citation = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("registerCitation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 172, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.registerCitation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_30registerCitation(((PyTypeObject*)__pyx_v_cls), __pyx_v_citation); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_30registerCitation(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_citation) { char const *__pyx_v_cit; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("registerCitation", 0); __Pyx_INCREF(__pyx_v_citation); /* "PETSc/Sys.pyx":173 * @classmethod * def registerCitation(cls, citation): * if not citation: raise ValueError("empty citation") # <<<<<<<<<<<<<< * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_citation); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(27, 173, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(27, 173, __pyx_L1_error) } /* "PETSc/Sys.pyx":174 * def registerCitation(cls, citation): * if not citation: raise ValueError("empty citation") * cdef const char *cit = NULL # <<<<<<<<<<<<<< * citation = str2bytes(citation, &cit) * cdef PetscBool flag = get_citation(citation) */ __pyx_v_cit = NULL; /* "PETSc/Sys.pyx":175 * if not citation: raise ValueError("empty citation") * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) # <<<<<<<<<<<<<< * cdef PetscBool flag = get_citation(citation) * CHKERR( PetscCitationsRegister(cit, &flag) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_citation, (&__pyx_v_cit)); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_citation, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Sys.pyx":176 * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) * cdef PetscBool flag = get_citation(citation) # <<<<<<<<<<<<<< * CHKERR( PetscCitationsRegister(cit, &flag) ) * set_citation(citation, toBool(flag)) */ __pyx_v_flag = __pyx_f_8petsc4py_5PETSc_get_citation(__pyx_v_citation); /* "PETSc/Sys.pyx":177 * citation = str2bytes(citation, &cit) * cdef PetscBool flag = get_citation(citation) * CHKERR( PetscCitationsRegister(cit, &flag) ) # <<<<<<<<<<<<<< * set_citation(citation, toBool(flag)) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCitationsRegister(__pyx_v_cit, (&__pyx_v_flag))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(27, 177, __pyx_L1_error) /* "PETSc/Sys.pyx":178 * cdef PetscBool flag = get_citation(citation) * CHKERR( PetscCitationsRegister(cit, &flag) ) * set_citation(citation, toBool(flag)) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(27, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_set_citation(__pyx_v_citation, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Sys.pyx":172 * * @classmethod * def registerCitation(cls, citation): # <<<<<<<<<<<<<< * if not citation: raise ValueError("empty citation") * cdef const char *cit = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Sys.registerCitation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_citation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":181 * * @classmethod * def hasExternalPackage(cls, package): # <<<<<<<<<<<<<< * cdef const char *cpackage = NULL * package = str2bytes(package, &cpackage) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Sys_32hasExternalPackage[] = "Sys.hasExternalPackage(type cls, package)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_package = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasExternalPackage (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_package,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_package)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hasExternalPackage") < 0)) __PYX_ERR(27, 181, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_package = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasExternalPackage", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(27, 181, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Sys.hasExternalPackage", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Sys_32hasExternalPackage(((PyTypeObject*)__pyx_v_cls), __pyx_v_package); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Sys_32hasExternalPackage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_package) { char const *__pyx_v_cpackage; PetscBool __pyx_v_has; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasExternalPackage", 0); __Pyx_INCREF(__pyx_v_package); /* "PETSc/Sys.pyx":182 * @classmethod * def hasExternalPackage(cls, package): * cdef const char *cpackage = NULL # <<<<<<<<<<<<<< * package = str2bytes(package, &cpackage) * cdef PetscBool has = PETSC_FALSE */ __pyx_v_cpackage = NULL; /* "PETSc/Sys.pyx":183 * def hasExternalPackage(cls, package): * cdef const char *cpackage = NULL * package = str2bytes(package, &cpackage) # <<<<<<<<<<<<<< * cdef PetscBool has = PETSC_FALSE * CHKERR( PetscHasExternalPackage(cpackage, &has) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_package, (&__pyx_v_cpackage)); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_package, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Sys.pyx":184 * cdef const char *cpackage = NULL * package = str2bytes(package, &cpackage) * cdef PetscBool has = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscHasExternalPackage(cpackage, &has) ) * return toBool(has) */ __pyx_v_has = PETSC_FALSE; /* "PETSc/Sys.pyx":185 * package = str2bytes(package, &cpackage) * cdef PetscBool has = PETSC_FALSE * CHKERR( PetscHasExternalPackage(cpackage, &has) ) # <<<<<<<<<<<<<< * return toBool(has) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscHasExternalPackage(__pyx_v_cpackage, (&__pyx_v_has))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(27, 185, __pyx_L1_error) /* "PETSc/Sys.pyx":186 * cdef PetscBool has = PETSC_FALSE * CHKERR( PetscHasExternalPackage(cpackage, &has) ) * return toBool(has) # <<<<<<<<<<<<<< * * cdef dict citations_registry = { } */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_has); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Sys.pyx":181 * * @classmethod * def hasExternalPackage(cls, package): # <<<<<<<<<<<<<< * cdef const char *cpackage = NULL * package = str2bytes(package, &cpackage) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Sys.hasExternalPackage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_package); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":190 * cdef dict citations_registry = { } * * cdef PetscBool get_citation(object citation): # <<<<<<<<<<<<<< * cdef bint is_set = citations_registry.get(citation) * return PETSC_TRUE if is_set else PETSC_FALSE */ static PetscBool __pyx_f_8petsc4py_5PETSc_get_citation(PyObject *__pyx_v_citation) { int __pyx_v_is_set; PetscBool __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscBool __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_citation", 0); /* "PETSc/Sys.pyx":191 * * cdef PetscBool get_citation(object citation): * cdef bint is_set = citations_registry.get(citation) # <<<<<<<<<<<<<< * return PETSC_TRUE if is_set else PETSC_FALSE * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_citations_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(27, 191, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_citations_registry, __pyx_v_citation, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(27, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_is_set = __pyx_t_2; /* "PETSc/Sys.pyx":192 * cdef PetscBool get_citation(object citation): * cdef bint is_set = citations_registry.get(citation) * return PETSC_TRUE if is_set else PETSC_FALSE # <<<<<<<<<<<<<< * * cdef set_citation(object citation, bint is_set): */ if ((__pyx_v_is_set != 0)) { __pyx_t_3 = PETSC_TRUE; } else { __pyx_t_3 = PETSC_FALSE; } __pyx_r = __pyx_t_3; goto __pyx_L0; /* "PETSc/Sys.pyx":190 * cdef dict citations_registry = { } * * cdef PetscBool get_citation(object citation): # <<<<<<<<<<<<<< * cdef bint is_set = citations_registry.get(citation) * return PETSC_TRUE if is_set else PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_WriteUnraisable("petsc4py.PETSc.get_citation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = (PetscBool) 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Sys.pyx":194 * return PETSC_TRUE if is_set else PETSC_FALSE * * cdef set_citation(object citation, bint is_set): # <<<<<<<<<<<<<< * citations_registry[citation] = is_set * */ static PyObject *__pyx_f_8petsc4py_5PETSc_set_citation(PyObject *__pyx_v_citation, int __pyx_v_is_set) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_citation", 0); /* "PETSc/Sys.pyx":195 * * cdef set_citation(object citation, bint is_set): * citations_registry[citation] = is_set # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_is_set); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_8petsc4py_5PETSc_citations_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(27, 195, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_citations_registry, __pyx_v_citation, __pyx_t_1) < 0)) __PYX_ERR(27, 195, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Sys.pyx":194 * return PETSC_TRUE if is_set else PETSC_FALSE * * cdef set_citation(object citation, bint is_set): # <<<<<<<<<<<<<< * citations_registry[citation] = is_set * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.set_citation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":8 * * @classmethod * def Stage(cls, name): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_1Stage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_Stage[] = "Log.Stage(type cls, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_1Stage(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Stage (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Stage") < 0)) __PYX_ERR(28, 8, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Stage", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 8, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.Stage", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_Stage(((PyTypeObject*)__pyx_v_cls), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_Stage(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PetscLogStage __pyx_v_stageid; struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_stage = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Stage", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Log.pyx":9 * @classmethod * def Stage(cls, name): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 9, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(28, 9, __pyx_L1_error) } /* "PETSc/Log.pyx":10 * def Stage(cls, name): * if not name: raise ValueError("empty name") * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscLogStage stageid = -1 */ __pyx_v_cname = NULL; /* "PETSc/Log.pyx":11 * if not name: raise ValueError("empty name") * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscLogStage stageid = -1 * cdef LogStage stage = get_LogStage(name) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":12 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscLogStage stageid = -1 # <<<<<<<<<<<<<< * cdef LogStage stage = get_LogStage(name) * if stage is not None: return stage */ __pyx_v_stageid = -1; /* "PETSc/Log.pyx":13 * name = str2bytes(name, &cname) * cdef PetscLogStage stageid = -1 * cdef LogStage stage = get_LogStage(name) # <<<<<<<<<<<<<< * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_get_LogStage(__pyx_v_name)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_stage = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":14 * cdef PetscLogStage stageid = -1 * cdef LogStage stage = get_LogStage(name) * if stage is not None: return stage # <<<<<<<<<<<<<< * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: */ __pyx_t_2 = (((PyObject *)__pyx_v_stage) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_stage)); __pyx_r = ((PyObject *)__pyx_v_stage); goto __pyx_L0; } /* "PETSc/Log.pyx":15 * cdef LogStage stage = get_LogStage(name) * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) # <<<<<<<<<<<<<< * if stageid == -1: * CHKERR( PetscLogStageRegister(cname, &stageid) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageFindId(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(28, 15, __pyx_L1_error) /* "PETSc/Log.pyx":16 * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) */ __pyx_t_1 = ((__pyx_v_stageid == -1L) != 0); if (__pyx_t_1) { /* "PETSc/Log.pyx":17 * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: * CHKERR( PetscLogStageRegister(cname, &stageid) ) # <<<<<<<<<<<<<< * stage = reg_LogStage(name, stageid) * return stage */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageRegister(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(28, 17, __pyx_L1_error) /* "PETSc/Log.pyx":16 * if stage is not None: return stage * CHKERR( PetscLogStageFindId(cname, &stageid) ) * if stageid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) */ } /* "PETSc/Log.pyx":18 * if stageid == -1: * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) # <<<<<<<<<<<<<< * return stage * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogStage(__pyx_v_name, __pyx_v_stageid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_stage, ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Log.pyx":19 * CHKERR( PetscLogStageRegister(cname, &stageid) ) * stage = reg_LogStage(name, stageid) * return stage # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_stage)); __pyx_r = ((PyObject *)__pyx_v_stage); goto __pyx_L0; /* "PETSc/Log.pyx":8 * * @classmethod * def Stage(cls, name): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Log.Stage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_stage); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":22 * * @classmethod * def Class(cls, name): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_3Class(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_2Class[] = "Log.Class(type cls, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_3Class(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Class (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Class") < 0)) __PYX_ERR(28, 22, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Class", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 22, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.Class", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_2Class(((PyTypeObject*)__pyx_v_cls), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_2Class(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PetscClassId __pyx_v_classid; struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_klass = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Class", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Log.pyx":23 * @classmethod * def Class(cls, name): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 23, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(28, 23, __pyx_L1_error) } /* "PETSc/Log.pyx":24 * def Class(cls, name): * if not name: raise ValueError("empty name") * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscLogClass classid = -1 */ __pyx_v_cname = NULL; /* "PETSc/Log.pyx":25 * if not name: raise ValueError("empty name") * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscLogClass classid = -1 * cdef LogClass klass = get_LogClass(name) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":26 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscLogClass classid = -1 # <<<<<<<<<<<<<< * cdef LogClass klass = get_LogClass(name) * if klass is not None: return klass */ __pyx_v_classid = -1; /* "PETSc/Log.pyx":27 * name = str2bytes(name, &cname) * cdef PetscLogClass classid = -1 * cdef LogClass klass = get_LogClass(name) # <<<<<<<<<<<<<< * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_get_LogClass(__pyx_v_name)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_klass = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":28 * cdef PetscLogClass classid = -1 * cdef LogClass klass = get_LogClass(name) * if klass is not None: return klass # <<<<<<<<<<<<<< * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: */ __pyx_t_2 = (((PyObject *)__pyx_v_klass) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_klass)); __pyx_r = ((PyObject *)__pyx_v_klass); goto __pyx_L0; } /* "PETSc/Log.pyx":29 * cdef LogClass klass = get_LogClass(name) * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) # <<<<<<<<<<<<<< * if classid == -1: * CHKERR( PetscLogClassRegister(cname, &classid) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogClassFindId(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(28, 29, __pyx_L1_error) /* "PETSc/Log.pyx":30 * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) */ __pyx_t_1 = ((__pyx_v_classid == -1L) != 0); if (__pyx_t_1) { /* "PETSc/Log.pyx":31 * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: * CHKERR( PetscLogClassRegister(cname, &classid) ) # <<<<<<<<<<<<<< * klass = reg_LogClass(name, classid) * return klass */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscClassIdRegister(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(28, 31, __pyx_L1_error) /* "PETSc/Log.pyx":30 * if klass is not None: return klass * CHKERR( PetscLogClassFindId(cname, &classid) ) * if classid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) */ } /* "PETSc/Log.pyx":32 * if classid == -1: * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) # <<<<<<<<<<<<<< * return klass * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogClass(__pyx_v_name, __pyx_v_classid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_klass, ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Log.pyx":33 * CHKERR( PetscLogClassRegister(cname, &classid) ) * klass = reg_LogClass(name, classid) * return klass # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_klass)); __pyx_r = ((PyObject *)__pyx_v_klass); goto __pyx_L0; /* "PETSc/Log.pyx":22 * * @classmethod * def Class(cls, name): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Log.Class", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_klass); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":36 * * @classmethod * def Event(cls, name, klass=None): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_5Event(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_4Event[] = "Log.Event(type cls, name, klass=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_5Event(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_klass = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Event (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_klass,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Event") < 0)) __PYX_ERR(28, 36, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_klass = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("Event", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 36, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.Event", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_4Event(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_klass); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_4Event(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass) { char const *__pyx_v_cname; PetscClassId __pyx_v_classid; PetscLogEvent __pyx_v_eventid; struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_event = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscClassId __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("Event", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Log.pyx":37 * @classmethod * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 37, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (unlikely(__pyx_t_2)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(28, 37, __pyx_L1_error) } /* "PETSc/Log.pyx":38 * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID */ __pyx_v_cname = NULL; /* "PETSc/Log.pyx":39 * if not name: raise ValueError("empty name") * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID * cdef PetscLogEvent eventid = -1 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":40 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID # <<<<<<<<<<<<<< * cdef PetscLogEvent eventid = -1 * if klass is not None: classid = klass */ __pyx_v_classid = PETSC_OBJECT_CLASSID; /* "PETSc/Log.pyx":41 * name = str2bytes(name, &cname) * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID * cdef PetscLogEvent eventid = -1 # <<<<<<<<<<<<<< * if klass is not None: classid = klass * cdef LogEvent event = get_LogEvent(name) */ __pyx_v_eventid = -1; /* "PETSc/Log.pyx":42 * cdef PetscLogClass classid = PETSC_OBJECT_CLASSID * cdef PetscLogEvent eventid = -1 * if klass is not None: classid = klass # <<<<<<<<<<<<<< * cdef LogEvent event = get_LogEvent(name) * if event is not None: return event */ __pyx_t_2 = (__pyx_v_klass != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyInt_As_PetscClassId(__pyx_v_klass); if (unlikely((__pyx_t_4 == ((PetscClassId)-1)) && PyErr_Occurred())) __PYX_ERR(28, 42, __pyx_L1_error) __pyx_v_classid = __pyx_t_4; } /* "PETSc/Log.pyx":43 * cdef PetscLogEvent eventid = -1 * if klass is not None: classid = klass * cdef LogEvent event = get_LogEvent(name) # <<<<<<<<<<<<<< * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_get_LogEvent(__pyx_v_name)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_event = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":44 * if klass is not None: classid = klass * cdef LogEvent event = get_LogEvent(name) * if event is not None: return event # <<<<<<<<<<<<<< * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: */ __pyx_t_1 = (((PyObject *)__pyx_v_event) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_event)); __pyx_r = ((PyObject *)__pyx_v_event); goto __pyx_L0; } /* "PETSc/Log.pyx":45 * cdef LogEvent event = get_LogEvent(name) * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) # <<<<<<<<<<<<<< * if eventid == -1: * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventFindId(__pyx_v_cname, (&__pyx_v_eventid))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(28, 45, __pyx_L1_error) /* "PETSc/Log.pyx":46 * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) */ __pyx_t_2 = ((__pyx_v_eventid == -1L) != 0); if (__pyx_t_2) { /* "PETSc/Log.pyx":47 * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) # <<<<<<<<<<<<<< * event = reg_LogEvent(name, eventid) * return event */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventRegister(__pyx_v_cname, __pyx_v_classid, (&__pyx_v_eventid))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(28, 47, __pyx_L1_error) /* "PETSc/Log.pyx":46 * if event is not None: return event * CHKERR( PetscLogEventFindId(cname, &eventid) ) * if eventid == -1: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) */ } /* "PETSc/Log.pyx":48 * if eventid == -1: * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) # <<<<<<<<<<<<<< * return event * */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogEvent(__pyx_v_name, __pyx_v_eventid)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_event, ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Log.pyx":49 * CHKERR( PetscLogEventRegister(cname, classid, &eventid) ) * event = reg_LogEvent(name, eventid) * return event # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_event)); __pyx_r = ((PyObject *)__pyx_v_event); goto __pyx_L0; /* "PETSc/Log.pyx":36 * * @classmethod * def Event(cls, name, klass=None): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Log.Event", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_event); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":52 * * @classmethod * def begin(cls, all=False): # <<<<<<<<<<<<<< * if all: CHKERR( PetscLogAllBegin() ) * else: CHKERR( PetscLogDefaultBegin() ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_7begin(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_6begin[] = "Log.begin(type cls, all=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_7begin(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_all = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("begin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_all,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_all); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "begin") < 0)) __PYX_ERR(28, 52, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_all = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("begin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 52, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_6begin(((PyTypeObject*)__pyx_v_cls), __pyx_v_all); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_6begin(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_all) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("begin", 0); /* "PETSc/Log.pyx":53 * @classmethod * def begin(cls, all=False): * if all: CHKERR( PetscLogAllBegin() ) # <<<<<<<<<<<<<< * else: CHKERR( PetscLogDefaultBegin() ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_all); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 53, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogAllBegin()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 53, __pyx_L1_error) goto __pyx_L3; } /* "PETSc/Log.pyx":54 * def begin(cls, all=False): * if all: CHKERR( PetscLogAllBegin() ) * else: CHKERR( PetscLogDefaultBegin() ) # <<<<<<<<<<<<<< * * @classmethod */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogDefaultBegin()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 54, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Log.pyx":52 * * @classmethod * def begin(cls, all=False): # <<<<<<<<<<<<<< * if all: CHKERR( PetscLogAllBegin() ) * else: CHKERR( PetscLogDefaultBegin() ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":57 * * @classmethod * def view(cls, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_9view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_8view[] = "Log.view(type cls, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_9view(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(28, 57, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 57, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(28, 57, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_8view(((PyTypeObject*)__pyx_v_cls), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_8view(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Log.pyx":58 * @classmethod * def view(cls, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD */ __pyx_v_vwr = NULL; /* "PETSc/Log.pyx":59 * def view(cls, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD * CHKERR( PetscLogView(vwr) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Log.pyx":60 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD # <<<<<<<<<<<<<< * CHKERR( PetscLogView(vwr) ) * */ __pyx_t_2 = ((__pyx_v_vwr == NULL) != 0); if (__pyx_t_2) { __pyx_v_vwr = PETSC_VIEWER_STDOUT_WORLD; } /* "PETSc/Log.pyx":61 * if viewer is not None: vwr = viewer.vwr * if vwr == NULL: vwr = PETSC_VIEWER_STDOUT_WORLD * CHKERR( PetscLogView(vwr) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogView(__pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(28, 61, __pyx_L1_error) /* "PETSc/Log.pyx":57 * * @classmethod * def view(cls, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":64 * * @classmethod * def logFlops(cls, flops): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_10logFlops[] = "Log.logFlops(type cls, flops)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flops = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("logFlops (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flops,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flops)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logFlops") < 0)) __PYX_ERR(28, 64, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flops = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("logFlops", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 64, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.logFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_10logFlops(((PyTypeObject*)__pyx_v_cls), __pyx_v_flops); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_10logFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops) { PetscLogDouble __pyx_v_cflops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscLogDouble __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("logFlops", 0); /* "PETSc/Log.pyx":65 * @classmethod * def logFlops(cls, flops): * cdef PetscLogDouble cflops=flops # <<<<<<<<<<<<<< * CHKERR( PetscLogFlops(cflops) ) * */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_flops); if (unlikely((__pyx_t_1 == ((PetscLogDouble)-1)) && PyErr_Occurred())) __PYX_ERR(28, 65, __pyx_L1_error) __pyx_v_cflops = __pyx_t_1; /* "PETSc/Log.pyx":66 * def logFlops(cls, flops): * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogFlops(__pyx_v_cflops)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 66, __pyx_L1_error) /* "PETSc/Log.pyx":64 * * @classmethod * def logFlops(cls, flops): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.logFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":69 * * @classmethod * def addFlops(cls, flops): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_12addFlops[] = "Log.addFlops(type cls, flops)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flops = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addFlops (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flops,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flops)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addFlops") < 0)) __PYX_ERR(28, 69, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flops = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addFlops", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 69, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.addFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_12addFlops(((PyTypeObject*)__pyx_v_cls), __pyx_v_flops); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_12addFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_flops) { PetscLogDouble __pyx_v_cflops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscLogDouble __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addFlops", 0); /* "PETSc/Log.pyx":70 * @classmethod * def addFlops(cls, flops): * cdef PetscLogDouble cflops=flops # <<<<<<<<<<<<<< * CHKERR( PetscLogFlops(cflops) ) * */ __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_flops); if (unlikely((__pyx_t_1 == ((PetscLogDouble)-1)) && PyErr_Occurred())) __PYX_ERR(28, 70, __pyx_L1_error) __pyx_v_cflops = __pyx_t_1; /* "PETSc/Log.pyx":71 * def addFlops(cls, flops): * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogFlops(__pyx_v_cflops)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 71, __pyx_L1_error) /* "PETSc/Log.pyx":69 * * @classmethod * def addFlops(cls, flops): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.addFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":74 * * @classmethod * def getFlops(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=0 * CHKERR( PetscGetFlops(&cflops) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_14getFlops[] = "Log.getFlops(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFlops (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFlops", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFlops", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14getFlops(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PetscLogDouble __pyx_v_cflops; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFlops", 0); /* "PETSc/Log.pyx":75 * @classmethod * def getFlops(cls): * cdef PetscLogDouble cflops=0 # <<<<<<<<<<<<<< * CHKERR( PetscGetFlops(&cflops) ) * return cflops */ __pyx_v_cflops = 0.0; /* "PETSc/Log.pyx":76 * def getFlops(cls): * cdef PetscLogDouble cflops=0 * CHKERR( PetscGetFlops(&cflops) ) # <<<<<<<<<<<<<< * return cflops * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetFlops((&__pyx_v_cflops))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 76, __pyx_L1_error) /* "PETSc/Log.pyx":77 * cdef PetscLogDouble cflops=0 * CHKERR( PetscGetFlops(&cflops) ) * return cflops # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cflops); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":74 * * @classmethod * def getFlops(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=0 * CHKERR( PetscGetFlops(&cflops) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Log.getFlops", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":80 * * @classmethod * def getTime(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble wctime=0 * CHKERR( PetscTime(&wctime) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_17getTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_16getTime[] = "Log.getTime(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_17getTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTime (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_16getTime(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_16getTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PetscLogDouble __pyx_v_wctime; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTime", 0); /* "PETSc/Log.pyx":81 * @classmethod * def getTime(cls): * cdef PetscLogDouble wctime=0 # <<<<<<<<<<<<<< * CHKERR( PetscTime(&wctime) ) * return wctime */ __pyx_v_wctime = 0.0; /* "PETSc/Log.pyx":82 * def getTime(cls): * cdef PetscLogDouble wctime=0 * CHKERR( PetscTime(&wctime) ) # <<<<<<<<<<<<<< * return wctime * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTime((&__pyx_v_wctime))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 82, __pyx_L1_error) /* "PETSc/Log.pyx":83 * cdef PetscLogDouble wctime=0 * CHKERR( PetscTime(&wctime) ) * return wctime # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_wctime); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":80 * * @classmethod * def getTime(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble wctime=0 * CHKERR( PetscTime(&wctime) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Log.getTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":86 * * @classmethod * def getCPUTime(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble cputime=0 * CHKERR( PetscGetCPUTime(&cputime) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_18getCPUTime[] = "Log.getCPUTime(type cls)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCPUTime (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCPUTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCPUTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(((PyTypeObject*)__pyx_v_cls)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_18getCPUTime(CYTHON_UNUSED PyTypeObject *__pyx_v_cls) { PetscLogDouble __pyx_v_cputime; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCPUTime", 0); /* "PETSc/Log.pyx":87 * @classmethod * def getCPUTime(cls): * cdef PetscLogDouble cputime=0 # <<<<<<<<<<<<<< * CHKERR( PetscGetCPUTime(&cputime) ) * return cputime */ __pyx_v_cputime = 0.0; /* "PETSc/Log.pyx":88 * def getCPUTime(cls): * cdef PetscLogDouble cputime=0 * CHKERR( PetscGetCPUTime(&cputime) ) # <<<<<<<<<<<<<< * return cputime * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGetCPUTime((&__pyx_v_cputime))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 88, __pyx_L1_error) /* "PETSc/Log.pyx":89 * cdef PetscLogDouble cputime=0 * CHKERR( PetscGetCPUTime(&cputime) ) * return cputime # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cputime); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":86 * * @classmethod * def getCPUTime(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble cputime=0 * CHKERR( PetscGetCPUTime(&cputime) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Log.getCPUTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":92 * * @classmethod * def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<< * """Decorate a function with a PETSc event. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Log_20EventDecorator[] = "Log.EventDecorator(type cls, name=None, klass=None)\nDecorate a function with a PETSc event.\n\n If no event name is specified it will default to the name of the function.\n \n Usage:\n @EventDecorator(\"My Function\")\n def myfunc():\n ...\n\n or\n\n @EventDecorator()\n def myfunc():\n ...\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_klass = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("EventDecorator (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_klass,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_klass); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "EventDecorator") < 0)) __PYX_ERR(28, 92, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_klass = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("EventDecorator", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 92, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_klass); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":108 * ... * """ * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator = {"decorator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decorator (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decorator") < 0)) __PYX_ERR(28, 108, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_func = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("decorator", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 108, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(__pyx_self, __pyx_v_func); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":110 * def decorator(func): * @functools.wraps(func) * def wrapped_func(*args, **kwargs): # <<<<<<<<<<<<<< * if name: * name_ = name */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func = {"wrapped_func", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("wrapped_func (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapped_func", 1))) return NULL; if (unlikely(__pyx_kwds)) { __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = NULL; } __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(__pyx_self, __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_wrapped_func(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_cur_scope; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_outer_scope; PyObject *__pyx_v_name_ = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("wrapped_func", 0); __pyx_outer_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "PETSc/Log.pyx":111 * @functools.wraps(func) * def wrapped_func(*args, **kwargs): * if name: # <<<<<<<<<<<<<< * name_ = name * else: */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(28, 111, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 111, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Log.pyx":112 * def wrapped_func(*args, **kwargs): * if name: * name_ = name # <<<<<<<<<<<<<< * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) */ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(28, 112, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_name); __pyx_v_name_ = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_name; /* "PETSc/Log.pyx":111 * @functools.wraps(func) * def wrapped_func(*args, **kwargs): * if name: # <<<<<<<<<<<<<< * name_ = name * else: */ goto __pyx_L3; } /* "PETSc/Log.pyx":114 * name_ = name * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) # <<<<<<<<<<<<<< * with cls.Event(name_, klass): * return func(*args, **kwargs) */ /*else*/ { if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(28, 114, __pyx_L1_error) } __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(28, 114, __pyx_L1_error) } __pyx_t_3 = __pyx_cur_scope->__pyx_v_func; __Pyx_INCREF(__pyx_t_3); if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(28, 114, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_n_s_qualname, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__20, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_name_ = __pyx_t_5; __pyx_t_5 = 0; } __pyx_L3:; /* "PETSc/Log.pyx":115 * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): # <<<<<<<<<<<<<< * return func(*args, **kwargs) * return wrapped_func */ /*with:*/ { if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_cls)) { __Pyx_RaiseClosureNameError("cls"); __PYX_ERR(28, 115, __pyx_L1_error) } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_cls), __pyx_n_s_Event); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass)) { __Pyx_RaiseClosureNameError("klass"); __PYX_ERR(28, 115, __pyx_L1_error) } __pyx_t_2 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name_, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_name_, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_name_); __Pyx_GIVEREF(__pyx_v_name_); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_name_); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 115, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 115, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); /*try:*/ { /* "PETSc/Log.pyx":116 * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): * return func(*args, **kwargs) # <<<<<<<<<<<<<< * return wrapped_func * return decorator */ __Pyx_XDECREF(__pyx_r); if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(28, 116, __pyx_L8_error) } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 116, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L12_try_return; /* "PETSc/Log.pyx":115 * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): # <<<<<<<<<<<<<< * return func(*args, **kwargs) * return wrapped_func */ } __pyx_L8_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(28, 115, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 115, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_11)) __PYX_ERR(28, 115, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_1 < 0) __PYX_ERR(28, 115, __pyx_L10_except_error) __pyx_t_12 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_3); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; __PYX_ERR(28, 115, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L9_exception_handled; } __pyx_L10_except_error:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L1_error; __pyx_L12_try_return:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); goto __pyx_L5_return; __pyx_L9_exception_handled:; __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_7) { __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__21, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } goto __pyx_L7; } __pyx_L5_return: { __pyx_t_10 = __pyx_r; __pyx_r = 0; if (__pyx_t_7) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__21, NULL); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; } __pyx_L7:; } goto __pyx_L17; __pyx_L4_error:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L1_error; __pyx_L17:; } /* "PETSc/Log.pyx":110 * def decorator(func): * @functools.wraps(func) * def wrapped_func(*args, **kwargs): # <<<<<<<<<<<<<< * if name: * name_ = name */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name_); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":108 * ... * """ * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_14EventDecorator_decorator(PyObject *__pyx_self, PyObject *__pyx_v_func) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_cur_scope; PyObject *__pyx_v_wrapped_func = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decorator", 0); __pyx_cur_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(28, 108, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *) __Pyx_CyFunction_GetClosure(__pyx_self); __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_v_func = __pyx_v_func; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func); /* "PETSc/Log.pyx":109 * """ * def decorator(func): * @functools.wraps(func) # <<<<<<<<<<<<<< * def wrapped_func(*args, **kwargs): * if name: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_functools); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_wraps); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_cur_scope->__pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_cur_scope->__pyx_v_func); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Log.pyx":110 * def decorator(func): * @functools.wraps(func) * def wrapped_func(*args, **kwargs): # <<<<<<<<<<<<<< * if name: * name_ = name */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func, 0, __pyx_n_s_EventDecorator_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_4)) __PYX_ERR(28, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_wrapped_func = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Log.pyx":117 * with cls.Event(name_, klass): * return func(*args, **kwargs) * return wrapped_func # <<<<<<<<<<<<<< * return decorator * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_wrapped_func); __pyx_r = __pyx_v_wrapped_func; goto __pyx_L0; /* "PETSc/Log.pyx":108 * ... * """ * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_wrapped_func); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":92 * * @classmethod * def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<< * """Decorate a function with a PETSc event. * */ static PyObject *__pyx_pf_8petsc4py_5PETSc_3Log_20EventDecorator(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_klass) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_cur_scope; PyObject *__pyx_v_decorator = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("EventDecorator", 0); __pyx_cur_scope = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(28, 92, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_cls = __pyx_v_cls; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cls); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cls); __pyx_cur_scope->__pyx_v_name = __pyx_v_name; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name); __pyx_cur_scope->__pyx_v_klass = __pyx_v_klass; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_klass); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_klass); /* "PETSc/Log.pyx":108 * ... * """ * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_1decorator, 0, __pyx_n_s_EventDecorator_locals_decorator_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_decorator = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Log.pyx":118 * return func(*args, **kwargs) * return wrapped_func * return decorator # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_decorator); __pyx_r = __pyx_v_decorator; goto __pyx_L0; /* "PETSc/Log.pyx":92 * * @classmethod * def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<< * """Decorate a function with a PETSc event. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Log.EventDecorator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_decorator); __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":126 * cdef readonly PetscLogStage id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Log.pyx":127 * * def __cinit__(self): * self.id = 0 # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_v_self->id = 0; /* "PETSc/Log.pyx":126 * cdef readonly PetscLogStage id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":129 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_2__int__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 0); /* "PETSc/Log.pyx":130 * * def __int__(self): * return self.id # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":129 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":132 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.push() * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_4__enter__[] = "LogStage.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/Log.pyx":133 * * def __enter__(self): * self.push() # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_push); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":134 * def __enter__(self): * self.push() * return self # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Log.pyx":132 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.push() * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":136 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.pop() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_6__exit__[] = "LogStage.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/Log.pyx":137 * * def __exit__(self, *exc): * self.pop() # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":136 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.pop() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":141 * # * * def push(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogStagePush(self.id) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_9push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_8push[] = "LogStage.push(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_9push(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("push (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("push", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "push", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_8push(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_8push(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("push", 0); /* "PETSc/Log.pyx":142 * * def push(self): * CHKERR( PetscLogStagePush(self.id) ) # <<<<<<<<<<<<<< * * def pop(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStagePush(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 142, __pyx_L1_error) /* "PETSc/Log.pyx":141 * # * * def push(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogStagePush(self.id) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.push", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":144 * CHKERR( PetscLogStagePush(self.id) ) * * def pop(self): # <<<<<<<<<<<<<< * self # unused * CHKERR( PetscLogStagePop() ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_10pop[] = "LogStage.pop(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pop (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("pop", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pop", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_10pop(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pop", 0); /* "PETSc/Log.pyx":145 * * def pop(self): * self # unused # <<<<<<<<<<<<<< * CHKERR( PetscLogStagePop() ) * */ ((void)__pyx_v_self); /* "PETSc/Log.pyx":146 * def pop(self): * self # unused * CHKERR( PetscLogStagePop() ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStagePop()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 146, __pyx_L1_error) /* "PETSc/Log.pyx":144 * CHKERR( PetscLogStagePush(self.id) ) * * def pop(self): # <<<<<<<<<<<<<< * self # unused * CHKERR( PetscLogStagePop() ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.pop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":150 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_12getName[] = "LogStage.getName(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 0); /* "PETSc/Log.pyx":151 * * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscLogStageFindName(self.id, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Log.pyx":152 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 152, __pyx_L1_error) /* "PETSc/Log.pyx":153 * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":150 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogStageFindName(self.id, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":156 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":157 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self; value; # unused */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":156 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":158 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":159 * return self.getName() * def __set__(self, value): * self; value; # unused # <<<<<<<<<<<<<< * raise TypeError("readonly attribute") * */ ((void)__pyx_v_self); ((void)__pyx_v_value); /* "PETSc/Log.pyx":160 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(28, 160, __pyx_L1_error) /* "PETSc/Log.pyx":158 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":164 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_14activate[] = "LogStage.activate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 0); /* "PETSc/Log.pyx":165 * * def activate(self): * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) # <<<<<<<<<<<<<< * * def deactivate(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetActive(__pyx_v_self->id, PETSC_TRUE)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 165, __pyx_L1_error) /* "PETSc/Log.pyx":164 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":167 * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_16deactivate[] = "LogStage.deactivate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("deactivate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("deactivate", 0); /* "PETSc/Log.pyx":168 * * def deactivate(self): * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) # <<<<<<<<<<<<<< * * def getActive(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetActive(__pyx_v_self->id, PETSC_FALSE)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 168, __pyx_L1_error) /* "PETSc/Log.pyx":167 * CHKERR( PetscLogStageSetActive(self.id, PETSC_TRUE) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.deactivate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":170 * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) * * def getActive(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetActive(self.id, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_18getActive[] = "LogStage.getActive(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActive (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActive", 0); /* "PETSc/Log.pyx":171 * * def getActive(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageGetActive(self.id, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Log.pyx":172 * def getActive(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetActive(self.id, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageGetActive(__pyx_v_self->id, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 172, __pyx_L1_error) /* "PETSc/Log.pyx":173 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetActive(self.id, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setActive(self, flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":170 * CHKERR( PetscLogStageSetActive(self.id, PETSC_FALSE) ) * * def getActive(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetActive(self.id, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":175 * return toBool(flag) * * def setActive(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_20setActive[] = "LogStage.setActive(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActive (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActive") < 0)) __PYX_ERR(28, 175, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 175, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_20setActive(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_tval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActive", 0); /* "PETSc/Log.pyx":176 * * def setActive(self, flag): * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetActive(self.id, tval) ) */ __pyx_v_tval = PETSC_FALSE; /* "PETSc/Log.pyx":177 * def setActive(self, flag): * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetActive(self.id, tval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 177, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "PETSc/Log.pyx":178 * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetActive(self.id, tval) ) # <<<<<<<<<<<<<< * * property active: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetActive(__pyx_v_self->id, __pyx_v_tval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 178, __pyx_L1_error) /* "PETSc/Log.pyx":175 * return toBool(flag) * * def setActive(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":181 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":182 * property active: * def __get__(self): * return self.getActive() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActive(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":181 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":183 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":184 * return self.getActive() * def __set__(self, value): * self.setActive(value) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":183 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":188 * # * * def getVisible(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_22getVisible[] = "LogStage.getVisible(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVisible (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getVisible", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVisible", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_22getVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVisible", 0); /* "PETSc/Log.pyx":189 * * def getVisible(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Log.pyx":190 * def getVisible(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageGetVisible(__pyx_v_self->id, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 190, __pyx_L1_error) /* "PETSc/Log.pyx":191 * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setVisible(self, flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":188 * # * * def getVisible(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( PetscLogStageGetVisible(self.id, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.getVisible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":193 * return toBool(flag) * * def setVisible(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogStage_24setVisible[] = "LogStage.setVisible(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVisible (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVisible") < 0)) __PYX_ERR(28, 193, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVisible", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 193, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setVisible", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_24setVisible(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_24setVisible(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_tval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVisible", 0); /* "PETSc/Log.pyx":194 * * def setVisible(self, flag): * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetVisible(self.id, tval) ) */ __pyx_v_tval = PETSC_FALSE; /* "PETSc/Log.pyx":195 * def setVisible(self, flag): * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscLogStageSetVisible(self.id, tval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 195, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "PETSc/Log.pyx":196 * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE * CHKERR( PetscLogStageSetVisible(self.id, tval) ) # <<<<<<<<<<<<<< * * property visible: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageSetVisible(__pyx_v_self->id, __pyx_v_tval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 196, __pyx_L1_error) /* "PETSc/Log.pyx":193 * return toBool(flag) * * def setVisible(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogStage.setVisible", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":199 * * property visible: * def __get__(self): # <<<<<<<<<<<<<< * return self.getVisible() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_7visible___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":200 * property visible: * def __get__(self): * return self.getVisible() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setVisible(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getVisible); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":199 * * property visible: * def __get__(self): # <<<<<<<<<<<<<< * return self.getVisible() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.visible.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":201 * def __get__(self): * return self.getVisible() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setVisible(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogStage_7visible_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":202 * return self.getVisible() * def __set__(self, value): * self.setVisible(value) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setVisible); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":201 * def __get__(self): * return self.getVisible() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setVisible(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.visible.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":124 * cdef class LogStage: * * cdef readonly PetscLogStage id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscLogStage(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogStage.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":207 * cdef dict stage_registry = { } * * cdef LogStage get_LogStage(object name): # <<<<<<<<<<<<<< * return stage_registry.get(name) * */ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_get_LogStage(PyObject *__pyx_v_name) { struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_LogStage", 0); /* "PETSc/Log.pyx":208 * * cdef LogStage get_LogStage(object name): * return stage_registry.get(name) # <<<<<<<<<<<<<< * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_8petsc4py_5PETSc_stage_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(28, 208, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_stage_registry, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogStage))))) __PYX_ERR(28, 208, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":207 * cdef dict stage_registry = { } * * cdef LogStage get_LogStage(object name): # <<<<<<<<<<<<<< * return stage_registry.get(name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.get_LogStage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":210 * return stage_registry.get(name) * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): # <<<<<<<<<<<<<< * cdef LogStage stage = LogStage() * stage.id = stageid */ static struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_f_8petsc4py_5PETSc_reg_LogStage(PyObject *__pyx_v_name, PetscLogStage __pyx_v_stageid) { struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_stage = 0; struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reg_LogStage", 0); /* "PETSc/Log.pyx":211 * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): * cdef LogStage stage = LogStage() # <<<<<<<<<<<<<< * stage.id = stageid * stage_registry[name] = stage */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogStage)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_stage = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":212 * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): * cdef LogStage stage = LogStage() * stage.id = stageid # <<<<<<<<<<<<<< * stage_registry[name] = stage * return stage */ __pyx_v_stage->id = __pyx_v_stageid; /* "PETSc/Log.pyx":213 * cdef LogStage stage = LogStage() * stage.id = stageid * stage_registry[name] = stage # <<<<<<<<<<<<<< * return stage * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_stage_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(28, 213, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_stage_registry, __pyx_v_name, ((PyObject *)__pyx_v_stage)) < 0)) __PYX_ERR(28, 213, __pyx_L1_error) /* "PETSc/Log.pyx":214 * stage.id = stageid * stage_registry[name] = stage * return stage # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_stage)); __pyx_r = __pyx_v_stage; goto __pyx_L0; /* "PETSc/Log.pyx":210 * return stage_registry.get(name) * * cdef LogStage reg_LogStage(object name, PetscLogStage stageid): # <<<<<<<<<<<<<< * cdef LogStage stage = LogStage() * stage.id = stageid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.reg_LogStage", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_stage); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":222 * cdef readonly PetscLogClass id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = PETSC_OBJECT_CLASSID * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogClass___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Log.pyx":223 * * def __cinit__(self): * self.id = PETSC_OBJECT_CLASSID # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_v_self->id = PETSC_OBJECT_CLASSID; /* "PETSc/Log.pyx":222 * cdef readonly PetscLogClass id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = PETSC_OBJECT_CLASSID * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":225 * self.id = PETSC_OBJECT_CLASSID * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_2__int__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 0); /* "PETSc/Log.pyx":226 * * def __int__(self): * return self.id # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":225 * self.id = PETSC_OBJECT_CLASSID * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":230 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogClass_4getName[] = "LogClass.getName(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4getName(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 0); /* "PETSc/Log.pyx":231 * * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscLogClassFindName(self.id, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Log.pyx":232 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogClassFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 232, __pyx_L1_error) /* "PETSc/Log.pyx":233 * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":230 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogClassFindName(self.id, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":236 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":237 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self; value; # unused */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":236 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":238 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogClass_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":239 * return self.getName() * def __set__(self, value): * self; value; # unused # <<<<<<<<<<<<<< * raise TypeError("readonly attribute") * */ ((void)__pyx_v_self); ((void)__pyx_v_value); /* "PETSc/Log.pyx":240 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(28, 240, __pyx_L1_error) /* "PETSc/Log.pyx":238 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":244 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogClass_6activate[] = "LogClass.activate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6activate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 0); /* "PETSc/Log.pyx":245 * * def activate(self): * CHKERR( PetscLogClassActivate(self.id) ) # <<<<<<<<<<<<<< * * def deactivate(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 245, __pyx_L1_error) /* "PETSc/Log.pyx":244 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":247 * CHKERR( PetscLogClassActivate(self.id) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassDeactivate(self.id) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogClass_8deactivate[] = "LogClass.deactivate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("deactivate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_8deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("deactivate", 0); /* "PETSc/Log.pyx":248 * * def deactivate(self): * CHKERR( PetscLogClassDeactivate(self.id) ) # <<<<<<<<<<<<<< * * def getActive(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 248, __pyx_L1_error) /* "PETSc/Log.pyx":247 * CHKERR( PetscLogClassActivate(self.id) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogClassDeactivate(self.id) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.deactivate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":250 * CHKERR( PetscLogClassDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogClass_10getActive[] = "LogClass.getActive(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActive (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_10getActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActive", 0); /* "PETSc/Log.pyx":251 * * def getActive(self): * self # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); /* "PETSc/Log.pyx":252 * def getActive(self): * self # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def setActive(self, flag): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(28, 252, __pyx_L1_error) /* "PETSc/Log.pyx":250 * CHKERR( PetscLogClassDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":254 * raise NotImplementedError * * def setActive(self, flag): # <<<<<<<<<<<<<< * if flag: * CHKERR( PetscLogClassActivate(self.id) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogClass_12setActive[] = "LogClass.setActive(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActive (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActive") < 0)) __PYX_ERR(28, 254, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 254, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_12setActive(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_12setActive(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActive", 0); /* "PETSc/Log.pyx":255 * * def setActive(self, flag): * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 255, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Log.pyx":256 * def setActive(self, flag): * if flag: * CHKERR( PetscLogClassActivate(self.id) ) # <<<<<<<<<<<<<< * else: * CHKERR( PetscLogClassDeactivate(self.id) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 256, __pyx_L1_error) /* "PETSc/Log.pyx":255 * * def setActive(self, flag): * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogClassActivate(self.id) ) * else: */ goto __pyx_L3; } /* "PETSc/Log.pyx":258 * CHKERR( PetscLogClassActivate(self.id) ) * else: * CHKERR( PetscLogClassDeactivate(self.id) ) # <<<<<<<<<<<<<< * * property active: */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivateClass(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 258, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Log.pyx":254 * raise NotImplementedError * * def setActive(self, flag): # <<<<<<<<<<<<<< * if flag: * CHKERR( PetscLogClassActivate(self.id) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogClass.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":261 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":262 * property active: * def __get__(self): * return self.getActive() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActive(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":261 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":263 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogClass_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":264 * return self.getActive() * def __set__(self, value): * self.setActive(value) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":263 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":220 * cdef class LogClass: * * cdef readonly PetscLogClass id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogClass_2id___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogClass_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscClassId(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogClass.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":269 * cdef dict class_registry = { } * * cdef LogClass get_LogClass(object name): # <<<<<<<<<<<<<< * return class_registry.get(name) * */ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_get_LogClass(PyObject *__pyx_v_name) { struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_LogClass", 0); /* "PETSc/Log.pyx":270 * * cdef LogClass get_LogClass(object name): * return class_registry.get(name) # <<<<<<<<<<<<<< * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_8petsc4py_5PETSc_class_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(28, 270, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_class_registry, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogClass))))) __PYX_ERR(28, 270, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":269 * cdef dict class_registry = { } * * cdef LogClass get_LogClass(object name): # <<<<<<<<<<<<<< * return class_registry.get(name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.get_LogClass", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":272 * return class_registry.get(name) * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): # <<<<<<<<<<<<<< * cdef LogClass klass = LogClass() * klass.id = classid */ static struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_f_8petsc4py_5PETSc_reg_LogClass(PyObject *__pyx_v_name, PetscClassId __pyx_v_classid) { struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_v_klass = 0; struct __pyx_obj_8petsc4py_5PETSc_LogClass *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reg_LogClass", 0); /* "PETSc/Log.pyx":273 * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): * cdef LogClass klass = LogClass() # <<<<<<<<<<<<<< * klass.id = classid * class_registry[name] = klass */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogClass)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_klass = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":274 * cdef LogClass reg_LogClass(object name, PetscLogClass classid): * cdef LogClass klass = LogClass() * klass.id = classid # <<<<<<<<<<<<<< * class_registry[name] = klass * return klass */ __pyx_v_klass->id = __pyx_v_classid; /* "PETSc/Log.pyx":275 * cdef LogClass klass = LogClass() * klass.id = classid * class_registry[name] = klass # <<<<<<<<<<<<<< * return klass * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_class_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(28, 275, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_class_registry, __pyx_v_name, ((PyObject *)__pyx_v_klass)) < 0)) __PYX_ERR(28, 275, __pyx_L1_error) /* "PETSc/Log.pyx":276 * klass.id = classid * class_registry[name] = klass * return klass # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_klass)); __pyx_r = __pyx_v_klass; goto __pyx_L0; /* "PETSc/Log.pyx":272 * return class_registry.get(name) * * cdef LogClass reg_LogClass(object name, PetscLogClass classid): # <<<<<<<<<<<<<< * cdef LogClass klass = LogClass() * klass.id = classid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.reg_LogClass", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_klass); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":284 * cdef readonly PetscLogEvent id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent___cinit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Log.pyx":285 * * def __cinit__(self): * self.id = 0 # <<<<<<<<<<<<<< * * def __int__(self): */ __pyx_v_self->id = 0; /* "PETSc/Log.pyx":284 * cdef readonly PetscLogEvent id * * def __cinit__(self): # <<<<<<<<<<<<<< * self.id = 0 * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":287 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__int__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_2__int__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2__int__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__int__", 0); /* "PETSc/Log.pyx":288 * * def __int__(self): * return self.id # <<<<<<<<<<<<<< * * def __enter__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":287 * self.id = 0 * * def __int__(self): # <<<<<<<<<<<<<< * return self.id * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":290 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.begin() * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_4__enter__[] = "LogEvent.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4__enter__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/Log.pyx":291 * * def __enter__(self): * self.begin() # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":292 * def __enter__(self): * self.begin() * return self # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Log.pyx":290 * return self.id * * def __enter__(self): # <<<<<<<<<<<<<< * self.begin() * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":294 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.end() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_6__exit__[] = "LogEvent.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6__exit__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/Log.pyx":295 * * def __exit__(self, *exc): * self.end() # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":294 * return self * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * self.end() * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":299 * # * * def begin(self, *objs): # <<<<<<<<<<<<<< * cdef PetscObject o[4] * event_args2objs(objs, o) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_8begin[] = "LogEvent.begin(self, *objs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("begin (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "begin", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_objs = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_objs); /* function exit code */ __Pyx_XDECREF(__pyx_v_objs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_8begin(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs) { PetscObject __pyx_v_o[4]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("begin", 0); /* "PETSc/Log.pyx":301 * def begin(self, *objs): * cdef PetscObject o[4] * event_args2objs(objs, o) # <<<<<<<<<<<<<< * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_event_args2objs(__pyx_v_objs, __pyx_v_o); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 301, __pyx_L1_error) /* "PETSc/Log.pyx":302 * cdef PetscObject o[4] * event_args2objs(objs, o) * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) # <<<<<<<<<<<<<< * * def end(self, *objs): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventBegin(__pyx_v_self->id, (__pyx_v_o[0]), (__pyx_v_o[1]), (__pyx_v_o[2]), (__pyx_v_o[3]))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 302, __pyx_L1_error) /* "PETSc/Log.pyx":299 * # * * def begin(self, *objs): # <<<<<<<<<<<<<< * cdef PetscObject o[4] * event_args2objs(objs, o) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":304 * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) * * def end(self, *objs): # <<<<<<<<<<<<<< * cdef PetscObject o[4] * event_args2objs(objs, o) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_10end[] = "LogEvent.end(self, *objs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("end (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "end", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_objs = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_objs); /* function exit code */ __Pyx_XDECREF(__pyx_v_objs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10end(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_objs) { PetscObject __pyx_v_o[4]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("end", 0); /* "PETSc/Log.pyx":306 * def end(self, *objs): * cdef PetscObject o[4] * event_args2objs(objs, o) # <<<<<<<<<<<<<< * CHKERR( PetscLogEventEnd(self.id, o[0], o[1], o[2], o[3]) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_event_args2objs(__pyx_v_objs, __pyx_v_o); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 306, __pyx_L1_error) /* "PETSc/Log.pyx":307 * cdef PetscObject o[4] * event_args2objs(objs, o) * CHKERR( PetscLogEventEnd(self.id, o[0], o[1], o[2], o[3]) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventEnd(__pyx_v_self->id, (__pyx_v_o[0]), (__pyx_v_o[1]), (__pyx_v_o[2]), (__pyx_v_o[3]))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 307, __pyx_L1_error) /* "PETSc/Log.pyx":304 * CHKERR( PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]) ) * * def end(self, *objs): # <<<<<<<<<<<<<< * cdef PetscObject o[4] * event_args2objs(objs, o) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.end", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":311 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_12getName[] = "LogEvent.getName(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_12getName(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 0); /* "PETSc/Log.pyx":312 * * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscLogEventFindName(self.id, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Log.pyx":313 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventFindName(__pyx_v_self->id, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 313, __pyx_L1_error) /* "PETSc/Log.pyx":314 * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":311 * # * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscLogEventFindName(self.id, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":317 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_4name___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":318 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self; value; # unused */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":317 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":319 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_4name_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":320 * return self.getName() * def __set__(self, value): * self; value; # unused # <<<<<<<<<<<<<< * raise TypeError("readonly attribute") * */ ((void)__pyx_v_self); ((void)__pyx_v_value); /* "PETSc/Log.pyx":321 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(28, 321, __pyx_L1_error) /* "PETSc/Log.pyx":319 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self; value; # unused * raise TypeError("readonly attribute") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":325 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogEventActivate(self.id) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_14activate[] = "LogEvent.activate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("activate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("activate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "activate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_14activate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("activate", 0); /* "PETSc/Log.pyx":326 * * def activate(self): * CHKERR( PetscLogEventActivate(self.id) ) # <<<<<<<<<<<<<< * * def deactivate(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivate(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 326, __pyx_L1_error) /* "PETSc/Log.pyx":325 * # * * def activate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogEventActivate(self.id) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.activate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":328 * CHKERR( PetscLogEventActivate(self.id) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogEventDeactivate(self.id) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_16deactivate[] = "LogEvent.deactivate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("deactivate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("deactivate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "deactivate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_16deactivate(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("deactivate", 0); /* "PETSc/Log.pyx":329 * * def deactivate(self): * CHKERR( PetscLogEventDeactivate(self.id) ) # <<<<<<<<<<<<<< * * def getActive(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivate(__pyx_v_self->id)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(28, 329, __pyx_L1_error) /* "PETSc/Log.pyx":328 * CHKERR( PetscLogEventActivate(self.id) ) * * def deactivate(self): # <<<<<<<<<<<<<< * CHKERR( PetscLogEventDeactivate(self.id) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.deactivate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":331 * CHKERR( PetscLogEventDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_18getActive[] = "LogEvent.getActive(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActive (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getActive", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActive", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_18getActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActive", 0); /* "PETSc/Log.pyx":332 * * def getActive(self): * self # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); /* "PETSc/Log.pyx":333 * def getActive(self): * self # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def setActive(self, flag): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(28, 333, __pyx_L1_error) /* "PETSc/Log.pyx":331 * CHKERR( PetscLogEventDeactivate(self.id) ) * * def getActive(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":335 * raise NotImplementedError * * def setActive(self, flag): # <<<<<<<<<<<<<< * if flag: * CHKERR( PetscLogEventActivate(self.id) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_20setActive[] = "LogEvent.setActive(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActive (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActive") < 0)) __PYX_ERR(28, 335, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 335, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_20setActive(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_20setActive(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActive", 0); /* "PETSc/Log.pyx":336 * * def setActive(self, flag): * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventActivate(self.id) ) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 336, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Log.pyx":337 * def setActive(self, flag): * if flag: * CHKERR( PetscLogEventActivate(self.id) ) # <<<<<<<<<<<<<< * else: * CHKERR( PetscLogEventDeactivate(self.id) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventActivate(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 337, __pyx_L1_error) /* "PETSc/Log.pyx":336 * * def setActive(self, flag): * if flag: # <<<<<<<<<<<<<< * CHKERR( PetscLogEventActivate(self.id) ) * else: */ goto __pyx_L3; } /* "PETSc/Log.pyx":339 * CHKERR( PetscLogEventActivate(self.id) ) * else: * CHKERR( PetscLogEventDeactivate(self.id) ) # <<<<<<<<<<<<<< * * property active: */ /*else*/ { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventDeactivate(__pyx_v_self->id)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 339, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Log.pyx":335 * raise NotImplementedError * * def setActive(self, flag): # <<<<<<<<<<<<<< * if flag: * CHKERR( PetscLogEventActivate(self.id) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":342 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_6active___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":343 * property active: * def __get__(self): * return self.getActive() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActive(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":342 * * property active: * def __get__(self): # <<<<<<<<<<<<<< * return self.getActive() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":344 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_6active_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":345 * return self.getActive() * def __set__(self, value): * self.setActive(value) # <<<<<<<<<<<<<< * * def getActiveAll(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActive); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":344 * def __get__(self): * return self.getActive() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActive(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":347 * self.setActive(value) * * def getActiveAll(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_22getActiveAll[] = "LogEvent.getActiveAll(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getActiveAll (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getActiveAll", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getActiveAll", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_22getActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getActiveAll", 0); /* "PETSc/Log.pyx":348 * * def getActiveAll(self): * self # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); /* "PETSc/Log.pyx":349 * def getActiveAll(self): * self # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def setActiveAll(self, flag): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(28, 349, __pyx_L1_error) /* "PETSc/Log.pyx":347 * self.setActive(value) * * def getActiveAll(self): # <<<<<<<<<<<<<< * self # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getActiveAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":351 * raise NotImplementedError * * def setActiveAll(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_24setActiveAll[] = "LogEvent.setActiveAll(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setActiveAll (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setActiveAll") < 0)) __PYX_ERR(28, 351, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setActiveAll", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 351, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActiveAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_24setActiveAll(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_24setActiveAll(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_tval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setActiveAll", 0); /* "PETSc/Log.pyx":352 * * def setActiveAll(self, flag): * cdef PetscBool tval = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: tval = PETSC_TRUE * CHKERR( PetscLogEventSetActiveAll(self.id, tval) ) */ __pyx_v_tval = PETSC_FALSE; /* "PETSc/Log.pyx":353 * def setActiveAll(self, flag): * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PetscLogEventSetActiveAll(self.id, tval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(28, 353, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_tval = PETSC_TRUE; } /* "PETSc/Log.pyx":354 * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE * CHKERR( PetscLogEventSetActiveAll(self.id, tval) ) # <<<<<<<<<<<<<< * * property active_all: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventSetActiveAll(__pyx_v_self->id, __pyx_v_tval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(28, 354, __pyx_L1_error) /* "PETSc/Log.pyx":351 * raise NotImplementedError * * def setActiveAll(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * if flag: tval = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.setActiveAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":357 * * property active_all: * def __get__(self): # <<<<<<<<<<<<<< * self.getActiveAll() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Log.pyx":358 * property active_all: * def __get__(self): * self.getActiveAll() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setActiveAll(value) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getActiveAll); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":357 * * property active_all: * def __get__(self): # <<<<<<<<<<<<<< * self.getActiveAll() * def __set__(self, value): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active_all.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":359 * def __get__(self): * self.getActiveAll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActiveAll(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_8LogEvent_10active_all_2__set__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Log.pyx":360 * self.getActiveAll() * def __set__(self, value): * self.setActiveAll(value) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setActiveAll); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":359 * def __get__(self): * self.getActiveAll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setActiveAll(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.active_all.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":364 * # * * def getPerfInfo(self, stage=None): # <<<<<<<<<<<<<< * cdef PetscEventPerfInfo info * cdef PetscInt cstage = PETSC_DETERMINE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_8LogEvent_26getPerfInfo[] = "LogEvent.getPerfInfo(self, stage=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stage = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPerfInfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stage,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stage); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getPerfInfo") < 0)) __PYX_ERR(28, 364, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_stage = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPerfInfo", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(28, 364, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getPerfInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_26getPerfInfo(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self), __pyx_v_stage); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_26getPerfInfo(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self, PyObject *__pyx_v_stage) { PetscEventPerfInfo __pyx_v_info; PetscInt __pyx_v_cstage; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPerfInfo", 0); /* "PETSc/Log.pyx":366 * def getPerfInfo(self, stage=None): * cdef PetscEventPerfInfo info * cdef PetscInt cstage = PETSC_DETERMINE # <<<<<<<<<<<<<< * if stage is not None: cstage = asInt(stage) * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) */ __pyx_v_cstage = PETSC_DETERMINE; /* "PETSc/Log.pyx":367 * cdef PetscEventPerfInfo info * cdef PetscInt cstage = PETSC_DETERMINE * if stage is not None: cstage = asInt(stage) # <<<<<<<<<<<<<< * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) * return info */ __pyx_t_1 = (__pyx_v_stage != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stage); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(28, 367, __pyx_L1_error) __pyx_v_cstage = __pyx_t_3; } /* "PETSc/Log.pyx":368 * cdef PetscInt cstage = PETSC_DETERMINE * if stage is not None: cstage = asInt(stage) * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) # <<<<<<<<<<<<<< * return info * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventGetPerfInfo(__pyx_v_cstage, __pyx_v_self->id, (&__pyx_v_info))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(28, 368, __pyx_L1_error) /* "PETSc/Log.pyx":369 * if stage is not None: cstage = asInt(stage) * CHKERR( PetscLogEventGetPerfInfo(cstage, self.id, &info) ) * return info # <<<<<<<<<<<<<< * * cdef dict event_registry = { } */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_convert__to_py_PetscEventPerfInfo(__pyx_v_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(28, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":364 * # * * def getPerfInfo(self, stage=None): # <<<<<<<<<<<<<< * cdef PetscEventPerfInfo info * cdef PetscInt cstage = PETSC_DETERMINE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.getPerfInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":282 * cdef class LogEvent: * * cdef readonly PetscLogEvent id # <<<<<<<<<<<<<< * * def __cinit__(self): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_8LogEvent_2id___get__(((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_8LogEvent_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscLogEvent(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LogEvent.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":373 * cdef dict event_registry = { } * * cdef LogEvent get_LogEvent(object name): # <<<<<<<<<<<<<< * return event_registry.get(name) * */ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_get_LogEvent(PyObject *__pyx_v_name) { struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_LogEvent", 0); /* "PETSc/Log.pyx":374 * * cdef LogEvent get_LogEvent(object name): * return event_registry.get(name) # <<<<<<<<<<<<<< * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (unlikely(__pyx_v_8petsc4py_5PETSc_event_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get"); __PYX_ERR(28, 374, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_8petsc4py_5PETSc_event_registry, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_LogEvent))))) __PYX_ERR(28, 374, __pyx_L1_error) __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Log.pyx":373 * cdef dict event_registry = { } * * cdef LogEvent get_LogEvent(object name): # <<<<<<<<<<<<<< * return event_registry.get(name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.get_LogEvent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Log.pyx":376 * return event_registry.get(name) * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): # <<<<<<<<<<<<<< * cdef LogEvent event = LogEvent() * event.id = eventid */ static struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_f_8petsc4py_5PETSc_reg_LogEvent(PyObject *__pyx_v_name, PetscLogEvent __pyx_v_eventid) { struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_v_event = 0; struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reg_LogEvent", 0); /* "PETSc/Log.pyx":377 * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): * cdef LogEvent event = LogEvent() # <<<<<<<<<<<<<< * event.id = eventid * event_registry[name] = event */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LogEvent)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_event = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":378 * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): * cdef LogEvent event = LogEvent() * event.id = eventid # <<<<<<<<<<<<<< * event_registry[name] = event * return event */ __pyx_v_event->id = __pyx_v_eventid; /* "PETSc/Log.pyx":379 * cdef LogEvent event = LogEvent() * event.id = eventid * event_registry[name] = event # <<<<<<<<<<<<<< * return event * */ if (unlikely(__pyx_v_8petsc4py_5PETSc_event_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(28, 379, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_event_registry, __pyx_v_name, ((PyObject *)__pyx_v_event)) < 0)) __PYX_ERR(28, 379, __pyx_L1_error) /* "PETSc/Log.pyx":380 * event.id = eventid * event_registry[name] = event * return event # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_event)); __pyx_r = __pyx_v_event; goto __pyx_L0; /* "PETSc/Log.pyx":376 * return event_registry.get(name) * * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid): # <<<<<<<<<<<<<< * cdef LogEvent event = LogEvent() * event.id = eventid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.reg_LogEvent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_event); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":7 * # * * def __cinit__(self, comm=None): # <<<<<<<<<<<<<< * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4Comm_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4Comm_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 7, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 7, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Comm.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm___cinit__(((struct PyPetscCommObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4Comm___cinit__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_comm) { int __pyx_r; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Comm.pyx":8 * * def __cinit__(self, comm=None): * self.comm = def_Comm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<< * self.isdup = 0 * if self.comm != MPI_COMM_NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 8, __pyx_L1_error) __pyx_v_self->comm = __pyx_t_1; /* "PETSc/Comm.pyx":9 * def __cinit__(self, comm=None): * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 # <<<<<<<<<<<<<< * if self.comm != MPI_COMM_NULL: * self.base = comm */ __pyx_v_self->isdup = 0; /* "PETSc/Comm.pyx":10 * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 * if self.comm != MPI_COMM_NULL: # <<<<<<<<<<<<<< * self.base = comm * else: */ __pyx_t_2 = ((__pyx_v_self->comm != MPI_COMM_NULL) != 0); if (__pyx_t_2) { /* "PETSc/Comm.pyx":11 * self.isdup = 0 * if self.comm != MPI_COMM_NULL: * self.base = comm # <<<<<<<<<<<<<< * else: * self.base = None */ __Pyx_INCREF(__pyx_v_comm); __Pyx_GIVEREF(__pyx_v_comm); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = __pyx_v_comm; /* "PETSc/Comm.pyx":10 * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 * if self.comm != MPI_COMM_NULL: # <<<<<<<<<<<<<< * self.base = comm * else: */ goto __pyx_L3; } /* "PETSc/Comm.pyx":13 * self.base = comm * else: * self.base = None # <<<<<<<<<<<<<< * * def __dealloc__(self): */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; } __pyx_L3:; /* "PETSc/Comm.pyx":7 * # * * def __cinit__(self, comm=None): # <<<<<<<<<<<<<< * self.comm = def_Comm(comm, MPI_COMM_NULL) * self.isdup = 0 */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Comm.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":15 * self.base = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_4Comm_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_4Comm_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_4Comm_2__dealloc__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_4Comm_2__dealloc__(struct PyPetscCommObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/Comm.pyx":16 * * def __dealloc__(self): * if self.isdup: # <<<<<<<<<<<<<< * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL */ __pyx_t_1 = (__pyx_v_self->isdup != 0); if (__pyx_t_1) { /* "PETSc/Comm.pyx":17 * def __dealloc__(self): * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) # <<<<<<<<<<<<<< * self.comm = MPI_COMM_NULL * self.isdup = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCommDEALLOC((&__pyx_v_self->comm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(9, 17, __pyx_L1_error) /* "PETSc/Comm.pyx":16 * * def __dealloc__(self): * if self.isdup: # <<<<<<<<<<<<<< * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL */ } /* "PETSc/Comm.pyx":18 * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * self.isdup = 0 * self.base = None */ __pyx_v_self->comm = MPI_COMM_NULL; /* "PETSc/Comm.pyx":19 * CHKERR( PetscCommDEALLOC(&self.comm) ) * self.comm = MPI_COMM_NULL * self.isdup = 0 # <<<<<<<<<<<<<< * self.base = None * */ __pyx_v_self->isdup = 0; /* "PETSc/Comm.pyx":20 * self.comm = MPI_COMM_NULL * self.isdup = 0 * self.base = None # <<<<<<<<<<<<<< * * def __richcmp__(self, other, int op): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; /* "PETSc/Comm.pyx":15 * self.base = None * * def __dealloc__(self): # <<<<<<<<<<<<<< * if self.isdup: * CHKERR( PetscCommDEALLOC(&self.comm) ) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Comm.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/Comm.pyx":22 * self.base = None * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(((struct PyPetscCommObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4__richcmp__(struct PyPetscCommObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { struct PyPetscCommObject *__pyx_v_s = 0; struct PyPetscCommObject *__pyx_v_o = 0; int __pyx_v_eq; MPI_Comm __pyx_v_comm1; MPI_Comm __pyx_v_comm2; int __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; MPI_Comm __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); /* "PETSc/Comm.pyx":23 * * def __richcmp__(self, other, int op): * if not isinstance(self, Comm): return NotImplemented # <<<<<<<<<<<<<< * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_8petsc4py_5PETSc_Comm); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "PETSc/Comm.pyx":24 * def __richcmp__(self, other, int op): * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented # <<<<<<<<<<<<<< * if op!=2 and op!=3: raise TypeError("only '==' and '!='") * cdef Comm s = self */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Comm); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "PETSc/Comm.pyx":25 * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") # <<<<<<<<<<<<<< * cdef Comm s = self * cdef Comm o = other */ __pyx_t_2 = ((__pyx_v_op != 2) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L6_bool_binop_done; } __pyx_t_2 = ((__pyx_v_op != 3) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(9, 25, __pyx_L1_error) } /* "PETSc/Comm.pyx":26 * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") * cdef Comm s = self # <<<<<<<<<<<<<< * cdef Comm o = other * cdef int eq = (op == 2) */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_s = __pyx_v_self; /* "PETSc/Comm.pyx":27 * if op!=2 and op!=3: raise TypeError("only '==' and '!='") * cdef Comm s = self * cdef Comm o = other # <<<<<<<<<<<<<< * cdef int eq = (op == 2) * cdef MPI_Comm comm1 = s.comm */ if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Comm))))) __PYX_ERR(9, 27, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_o = ((struct PyPetscCommObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Comm.pyx":28 * cdef Comm s = self * cdef Comm o = other * cdef int eq = (op == 2) # <<<<<<<<<<<<<< * cdef MPI_Comm comm1 = s.comm * cdef MPI_Comm comm2 = o.comm */ __pyx_v_eq = (__pyx_v_op == 2); /* "PETSc/Comm.pyx":29 * cdef Comm o = other * cdef int eq = (op == 2) * cdef MPI_Comm comm1 = s.comm # <<<<<<<<<<<<<< * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 */ __pyx_t_4 = __pyx_v_s->comm; __pyx_v_comm1 = __pyx_t_4; /* "PETSc/Comm.pyx":30 * cdef int eq = (op == 2) * cdef MPI_Comm comm1 = s.comm * cdef MPI_Comm comm2 = o.comm # <<<<<<<<<<<<<< * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: */ __pyx_t_4 = __pyx_v_o->comm; __pyx_v_comm2 = __pyx_t_4; /* "PETSc/Comm.pyx":31 * cdef MPI_Comm comm1 = s.comm * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 # <<<<<<<<<<<<<< * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) */ __pyx_v_flag = 0; /* "PETSc/Comm.pyx":32 * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) */ __pyx_t_2 = ((__pyx_v_comm1 != MPI_COMM_NULL) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = ((__pyx_v_comm2 != MPI_COMM_NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/Comm.pyx":33 * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) # <<<<<<<<<<<<<< * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MPI_Comm_compare(__pyx_v_comm1, __pyx_v_comm2, (&__pyx_v_flag))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(9, 33, __pyx_L1_error) /* "PETSc/Comm.pyx":34 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) # <<<<<<<<<<<<<< * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) * else: */ __pyx_t_1 = (__pyx_v_eq != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_flag == ((int)MPI_IDENT)); if (!__pyx_t_1) { } else { __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L12_bool_binop_done; } __pyx_t_1 = (__pyx_v_flag == ((int)MPI_CONGRUENT)); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L12_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Comm.pyx":35 * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) # <<<<<<<<<<<<<< * else: * if eq: return (comm1 == comm2) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = (__pyx_v_flag != ((int)MPI_IDENT)); if (__pyx_t_1) { } else { __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L14_bool_binop_done; } __pyx_t_1 = (__pyx_v_flag != ((int)MPI_CONGRUENT)); __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __pyx_t_6 = 0; __pyx_L14_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Comm.pyx":32 * cdef MPI_Comm comm2 = o.comm * cdef int flag = 0 * if comm1 != MPI_COMM_NULL and comm2 != MPI_COMM_NULL: # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_compare(comm1, comm2, &flag) ) * if eq: return (flag==MPI_IDENT or flag==MPI_CONGRUENT) */ } /* "PETSc/Comm.pyx":37 * else: return (flag!=MPI_IDENT and flag!=MPI_CONGRUENT) * else: * if eq: return (comm1 == comm2) # <<<<<<<<<<<<<< * else: return (comm1 != comm2) * */ /*else*/ { __pyx_t_1 = (__pyx_v_eq != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_comm1 == __pyx_v_comm2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Comm.pyx":38 * else: * if eq: return (comm1 == comm2) * else: return (comm1 != comm2) # <<<<<<<<<<<<<< * * def __nonzero__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong((__pyx_v_comm1 != __pyx_v_comm2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } } /* "PETSc/Comm.pyx":22 * self.base = None * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Comm.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_s); __Pyx_XDECREF((PyObject *)__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":40 * else: return (comm1 != comm2) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.comm != MPI_COMM_NULL * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4Comm_7__nonzero__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4Comm_7__nonzero__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_6__nonzero__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4Comm_6__nonzero__(struct PyPetscCommObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__", 0); /* "PETSc/Comm.pyx":41 * * def __nonzero__(self): * return self.comm != MPI_COMM_NULL # <<<<<<<<<<<<<< * * # */ __pyx_r = (__pyx_v_self->comm != MPI_COMM_NULL); goto __pyx_L0; /* "PETSc/Comm.pyx":40 * else: return (comm1 != comm2) * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.comm != MPI_COMM_NULL * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":45 * # * * def destroy(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: return * if not self.isdup: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Comm_8destroy[] = "Comm.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_8destroy(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Comm.pyx":46 * * def destroy(self): * if self.comm == MPI_COMM_NULL: return # <<<<<<<<<<<<<< * if not self.isdup: * raise ValueError("communicator not owned") */ __pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/Comm.pyx":47 * def destroy(self): * if self.comm == MPI_COMM_NULL: return * if not self.isdup: # <<<<<<<<<<<<<< * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) */ __pyx_t_1 = ((!(__pyx_v_self->isdup != 0)) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/Comm.pyx":48 * if self.comm == MPI_COMM_NULL: return * if not self.isdup: * raise ValueError("communicator not owned") # <<<<<<<<<<<<<< * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(9, 48, __pyx_L1_error) /* "PETSc/Comm.pyx":47 * def destroy(self): * if self.comm == MPI_COMM_NULL: return * if not self.isdup: # <<<<<<<<<<<<<< * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) */ } /* "PETSc/Comm.pyx":49 * if not self.isdup: * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) # <<<<<<<<<<<<<< * self.comm = MPI_COMM_NULL * self.isdup = 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDestroy((&__pyx_v_self->comm))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 49, __pyx_L1_error) /* "PETSc/Comm.pyx":50 * raise ValueError("communicator not owned") * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * self.isdup = 0 * self.base = None */ __pyx_v_self->comm = MPI_COMM_NULL; /* "PETSc/Comm.pyx":51 * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL * self.isdup = 0 # <<<<<<<<<<<<<< * self.base = None * */ __pyx_v_self->isdup = 0; /* "PETSc/Comm.pyx":52 * self.comm = MPI_COMM_NULL * self.isdup = 0 * self.base = None # <<<<<<<<<<<<<< * * def duplicate(self): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->base); __Pyx_DECREF(__pyx_v_self->base); __pyx_v_self->base = Py_None; /* "PETSc/Comm.pyx":45 * # * * def destroy(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: return * if not self.isdup: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":54 * self.base = None * * def duplicate(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Comm_10duplicate[] = "Comm.duplicate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_10duplicate(struct PyPetscCommObject *__pyx_v_self) { MPI_Comm __pyx_v_newcomm; struct PyPetscCommObject *__pyx_v_comm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 0); /* "PETSc/Comm.pyx":55 * * def duplicate(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL */ __pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/Comm.pyx":56 * def duplicate(self): * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef MPI_Comm newcomm = MPI_COMM_NULL * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(9, 56, __pyx_L1_error) /* "PETSc/Comm.pyx":55 * * def duplicate(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL */ } /* "PETSc/Comm.pyx":57 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) * cdef Comm comm = type(self)() */ __pyx_v_newcomm = MPI_COMM_NULL; /* "PETSc/Comm.pyx":58 * raise ValueError("null communicator") * cdef MPI_Comm newcomm = MPI_COMM_NULL * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) # <<<<<<<<<<<<<< * cdef Comm comm = type(self)() * comm.comm = newcomm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDuplicate(__pyx_v_self->comm, (&__pyx_v_newcomm), NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 58, __pyx_L1_error) /* "PETSc/Comm.pyx":59 * cdef MPI_Comm newcomm = MPI_COMM_NULL * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) * cdef Comm comm = type(self)() # <<<<<<<<<<<<<< * comm.comm = newcomm * comm.isdup = 1 */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Comm))))) __PYX_ERR(9, 59, __pyx_L1_error) __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Comm.pyx":60 * CHKERR( PetscCommDuplicate(self.comm, &newcomm, NULL) ) * cdef Comm comm = type(self)() * comm.comm = newcomm # <<<<<<<<<<<<<< * comm.isdup = 1 * comm.base = self.base */ __pyx_v_comm->comm = __pyx_v_newcomm; /* "PETSc/Comm.pyx":61 * cdef Comm comm = type(self)() * comm.comm = newcomm * comm.isdup = 1 # <<<<<<<<<<<<<< * comm.base = self.base * return comm */ __pyx_v_comm->isdup = 1; /* "PETSc/Comm.pyx":62 * comm.comm = newcomm * comm.isdup = 1 * comm.base = self.base # <<<<<<<<<<<<<< * return comm * */ __pyx_t_2 = __pyx_v_self->base; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_comm->base); __Pyx_DECREF(__pyx_v_comm->base); __pyx_v_comm->base = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Comm.pyx":63 * comm.isdup = 1 * comm.base = self.base * return comm # <<<<<<<<<<<<<< * * def getSize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_comm)); __pyx_r = ((PyObject *)__pyx_v_comm); goto __pyx_L0; /* "PETSc/Comm.pyx":54 * self.base = None * * def duplicate(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Comm.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":65 * return comm * * def getSize(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Comm_12getSize[] = "Comm.getSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_12getSize(struct PyPetscCommObject *__pyx_v_self) { int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 0); /* "PETSc/Comm.pyx":66 * * def getSize(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int size=0 */ __pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/Comm.pyx":67 * def getSize(self): * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int size=0 * MPI_Comm_size(self.comm, &size) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(9, 67, __pyx_L1_error) /* "PETSc/Comm.pyx":66 * * def getSize(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int size=0 */ } /* "PETSc/Comm.pyx":68 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * cdef int size=0 # <<<<<<<<<<<<<< * MPI_Comm_size(self.comm, &size) * return size */ __pyx_v_size = 0; /* "PETSc/Comm.pyx":69 * raise ValueError("null communicator") * cdef int size=0 * MPI_Comm_size(self.comm, &size) # <<<<<<<<<<<<<< * return size * */ (void)(MPI_Comm_size(__pyx_v_self->comm, (&__pyx_v_size))); /* "PETSc/Comm.pyx":70 * cdef int size=0 * MPI_Comm_size(self.comm, &size) * return size # <<<<<<<<<<<<<< * * def getRank(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Comm.pyx":65 * return comm * * def getSize(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":72 * return size * * def getRank(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Comm_14getRank[] = "Comm.getRank(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRank (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRank", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRank", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_14getRank(struct PyPetscCommObject *__pyx_v_self) { int __pyx_v_rank; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRank", 0); /* "PETSc/Comm.pyx":73 * * def getRank(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int rank=0 */ __pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/Comm.pyx":74 * def getRank(self): * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int rank=0 * MPI_Comm_rank(self.comm, &rank) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(9, 74, __pyx_L1_error) /* "PETSc/Comm.pyx":73 * * def getRank(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * cdef int rank=0 */ } /* "PETSc/Comm.pyx":75 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * cdef int rank=0 # <<<<<<<<<<<<<< * MPI_Comm_rank(self.comm, &rank) * return rank */ __pyx_v_rank = 0; /* "PETSc/Comm.pyx":76 * raise ValueError("null communicator") * cdef int rank=0 * MPI_Comm_rank(self.comm, &rank) # <<<<<<<<<<<<<< * return rank * */ (void)(MPI_Comm_rank(__pyx_v_self->comm, (&__pyx_v_rank))); /* "PETSc/Comm.pyx":77 * cdef int rank=0 * MPI_Comm_rank(self.comm, &rank) * return rank # <<<<<<<<<<<<<< * * def barrier(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rank); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Comm.pyx":72 * return size * * def getRank(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.getRank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":79 * return rank * * def barrier(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Comm_16barrier[] = "Comm.barrier(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("barrier (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("barrier", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "barrier", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_16barrier(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("barrier", 0); /* "PETSc/Comm.pyx":80 * * def barrier(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * MPI_Barrier(self.comm) */ __pyx_t_1 = ((__pyx_v_self->comm == MPI_COMM_NULL) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/Comm.pyx":81 * def barrier(self): * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") # <<<<<<<<<<<<<< * MPI_Barrier(self.comm) * */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(9, 81, __pyx_L1_error) /* "PETSc/Comm.pyx":80 * * def barrier(self): * if self.comm == MPI_COMM_NULL: # <<<<<<<<<<<<<< * raise ValueError("null communicator") * MPI_Barrier(self.comm) */ } /* "PETSc/Comm.pyx":82 * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") * MPI_Barrier(self.comm) # <<<<<<<<<<<<<< * * # --- properties --- */ (void)(MPI_Barrier(__pyx_v_self->comm)); /* "PETSc/Comm.pyx":79 * return rank * * def barrier(self): # <<<<<<<<<<<<<< * if self.comm == MPI_COMM_NULL: * raise ValueError("null communicator") */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.barrier", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":87 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4size___get__(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Comm.pyx":88 * property size: * def __get__(self): * return self.getSize() # <<<<<<<<<<<<<< * * property rank: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Comm.pyx":87 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Comm.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":91 * * property rank: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRank() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4rank_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_4rank_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_4rank___get__(struct PyPetscCommObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Comm.pyx":92 * property rank: * def __get__(self): * return self.getRank() # <<<<<<<<<<<<<< * * # --- Fortran support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRank); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Comm.pyx":91 * * property rank: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRank() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Comm.rank.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":97 * * property fortran: * def __get__(self): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = self.comm * return MPI_Comm_c2f(comm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_7fortran_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_7fortran_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_7fortran___get__(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_7fortran___get__(struct PyPetscCommObject *__pyx_v_self) { MPI_Comm __pyx_v_comm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Comm.pyx":98 * property fortran: * def __get__(self): * cdef MPI_Comm comm = self.comm # <<<<<<<<<<<<<< * return MPI_Comm_c2f(comm) * */ __pyx_t_1 = __pyx_v_self->comm; __pyx_v_comm = __pyx_t_1; /* "PETSc/Comm.pyx":99 * def __get__(self): * cdef MPI_Comm comm = self.comm * return MPI_Comm_c2f(comm) # <<<<<<<<<<<<<< * * # --- mpi4py support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_MPI_Fint(MPI_Comm_c2f(__pyx_v_comm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Comm.pyx":97 * * property fortran: * def __get__(self): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = self.comm * return MPI_Comm_c2f(comm) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.fortran.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":103 * # --- mpi4py support --- * * def tompi4py(self): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = self.comm * return mpi4py_Comm_New(comm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Comm_18tompi4py[] = "Comm.tompi4py(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tompi4py (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("tompi4py", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "tompi4py", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(((struct PyPetscCommObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Comm_18tompi4py(struct PyPetscCommObject *__pyx_v_self) { MPI_Comm __pyx_v_comm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tompi4py", 0); /* "PETSc/Comm.pyx":104 * * def tompi4py(self): * cdef MPI_Comm comm = self.comm # <<<<<<<<<<<<<< * return mpi4py_Comm_New(comm) * */ __pyx_t_1 = __pyx_v_self->comm; __pyx_v_comm = __pyx_t_1; /* "PETSc/Comm.pyx":105 * def tompi4py(self): * cdef MPI_Comm comm = self.comm * return mpi4py_Comm_New(comm) # <<<<<<<<<<<<<< * * # --- mpi4py compatibility API --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_New(__pyx_v_comm); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Comm.pyx":103 * # --- mpi4py support --- * * def tompi4py(self): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = self.comm * return mpi4py_Comm_New(comm) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Comm.tompi4py", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":130 * cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL * * cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<< * return def_Comm(comm, defv) * */ static MPI_Comm __pyx_f_8petsc4py_5PETSc_GetComm(PyObject *__pyx_v_comm, MPI_Comm __pyx_v_defv) { MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("GetComm", 0); /* "PETSc/Comm.pyx":131 * * cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *: * return def_Comm(comm, defv) # <<<<<<<<<<<<<< * * cdef MPI_Comm GetCommDefault(): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_defv); if (unlikely(PyErr_Occurred())) __PYX_ERR(9, 131, __pyx_L1_error) __pyx_r = __pyx_t_1; goto __pyx_L0; /* "PETSc/Comm.pyx":130 * cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL * * cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *: # <<<<<<<<<<<<<< * return def_Comm(comm, defv) * */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.GetComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Comm.pyx":133 * return def_Comm(comm, defv) * * cdef MPI_Comm GetCommDefault(): # <<<<<<<<<<<<<< * return PETSC_COMM_DEFAULT * */ static MPI_Comm __pyx_f_8petsc4py_5PETSc_GetCommDefault(void) { MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("GetCommDefault", 0); /* "PETSc/Comm.pyx":134 * * cdef MPI_Comm GetCommDefault(): * return PETSC_COMM_DEFAULT # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT; goto __pyx_L0; /* "PETSc/Comm.pyx":133 * return def_Comm(comm, defv) * * cdef MPI_Comm GetCommDefault(): # <<<<<<<<<<<<<< * return PETSC_COMM_DEFAULT * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":7 * # --- special methods --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.oval = NULL * self.obj = &self.oval */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object___cinit__(struct PyPetscObjectObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Object.pyx":8 * * def __cinit__(self): * self.oval = NULL # <<<<<<<<<<<<<< * self.obj = &self.oval * */ __pyx_v_self->oval = NULL; /* "PETSc/Object.pyx":9 * def __cinit__(self): * self.oval = NULL * self.obj = &self.oval # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->obj = (&__pyx_v_self->oval); /* "PETSc/Object.pyx":7 * # --- special methods --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.oval = NULL * self.obj = &self.oval */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":11 * self.obj = &self.oval * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscDEALLOC(&self.obj[0]) ) * self.obj = NULL */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_6Object_2__dealloc__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_6Object_2__dealloc__(struct PyPetscObjectObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/Object.pyx":12 * * def __dealloc__(self): * CHKERR( PetscDEALLOC(&self.obj[0]) ) # <<<<<<<<<<<<<< * self.obj = NULL * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC((&(__pyx_v_self->obj[0])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 12, __pyx_L1_error) /* "PETSc/Object.pyx":13 * def __dealloc__(self): * CHKERR( PetscDEALLOC(&self.obj[0]) ) * self.obj = NULL # <<<<<<<<<<<<<< * * def __richcmp__(self, other, int op): */ __pyx_v_self->obj = NULL; /* "PETSc/Object.pyx":11 * self.obj = &self.oval * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscDEALLOC(&self.obj[0]) ) * self.obj = NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Object.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/Object.pyx":15 * self.obj = NULL * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4__richcmp__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { struct PyPetscObjectObject *__pyx_v_s = 0; struct PyPetscObjectObject *__pyx_v_o = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); /* "PETSc/Object.pyx":16 * * def __richcmp__(self, other, int op): * if not isinstance(self, Object): return NotImplemented # <<<<<<<<<<<<<< * if not isinstance(other, Object): return NotImplemented * cdef Object s = self, o = other */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_8petsc4py_5PETSc_Object); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "PETSc/Object.pyx":17 * def __richcmp__(self, other, int op): * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented # <<<<<<<<<<<<<< * cdef Object s = self, o = other * if op == 2: return (s.obj[0] == o.obj[0]) */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Object); __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; } /* "PETSc/Object.pyx":18 * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented * cdef Object s = self, o = other # <<<<<<<<<<<<<< * if op == 2: return (s.obj[0] == o.obj[0]) * elif op == 3: return (s.obj[0] != o.obj[0]) */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_v_s = __pyx_v_self; if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(10, 18, __pyx_L1_error) __pyx_t_3 = __pyx_v_other; __Pyx_INCREF(__pyx_t_3); __pyx_v_o = ((struct PyPetscObjectObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Object.pyx":19 * if not isinstance(other, Object): return NotImplemented * cdef Object s = self, o = other * if op == 2: return (s.obj[0] == o.obj[0]) # <<<<<<<<<<<<<< * elif op == 3: return (s.obj[0] != o.obj[0]) * else: raise TypeError("only '==' and '!='") */ __pyx_t_1 = ((__pyx_v_op == 2) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong(((__pyx_v_s->obj[0]) == (__pyx_v_o->obj[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Object.pyx":20 * cdef Object s = self, o = other * if op == 2: return (s.obj[0] == o.obj[0]) * elif op == 3: return (s.obj[0] != o.obj[0]) # <<<<<<<<<<<<<< * else: raise TypeError("only '==' and '!='") * */ __pyx_t_1 = ((__pyx_v_op == 3) != 0); if (likely(__pyx_t_1)) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyBool_FromLong(((__pyx_v_s->obj[0]) != (__pyx_v_o->obj[0]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Object.pyx":21 * if op == 2: return (s.obj[0] == o.obj[0]) * elif op == 3: return (s.obj[0] != o.obj[0]) * else: raise TypeError("only '==' and '!='") # <<<<<<<<<<<<<< * * def __nonzero__(self): */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(10, 21, __pyx_L1_error) } /* "PETSc/Object.pyx":15 * self.obj = NULL * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * if not isinstance(self, Object): return NotImplemented * if not isinstance(other, Object): return NotImplemented */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_s); __Pyx_XDECREF((PyObject *)__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":23 * else: raise TypeError("only '==' and '!='") * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.obj[0] != NULL * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_7__nonzero__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_7__nonzero__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6__nonzero__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_6__nonzero__(struct PyPetscObjectObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__nonzero__", 0); /* "PETSc/Object.pyx":24 * * def __nonzero__(self): * return self.obj[0] != NULL # <<<<<<<<<<<<<< * * def __copy__(self): */ __pyx_r = ((__pyx_v_self->obj[0]) != NULL); goto __pyx_L0; /* "PETSc/Object.pyx":23 * else: raise TypeError("only '==' and '!='") * * def __nonzero__(self): # <<<<<<<<<<<<<< * return self.obj[0] != NULL * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":26 * return self.obj[0] != NULL * * def __copy__(self): # <<<<<<<<<<<<<< * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_8__copy__[] = "Object.__copy__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__copy__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__copy__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__copy__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8__copy__(struct PyPetscObjectObject *__pyx_v_self) { struct PyPetscObjectObject *__pyx_v_obj = 0; PetscObject __pyx_v_o; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__copy__", 0); /* "PETSc/Object.pyx":27 * * def __copy__(self): * cdef Object obj = type(self)() # <<<<<<<<<<<<<< * cdef PetscObject o = self.obj[0] * if o != NULL: */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(10, 27, __pyx_L1_error) __pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":28 * def __copy__(self): * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] # <<<<<<<<<<<<<< * if o != NULL: * CHKERR( PetscObjectReference(o) ) */ __pyx_v_o = (__pyx_v_self->obj[0]); /* "PETSc/Object.pyx":29 * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] * if o != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o */ __pyx_t_4 = ((__pyx_v_o != NULL) != 0); if (__pyx_t_4) { /* "PETSc/Object.pyx":30 * cdef PetscObject o = self.obj[0] * if o != NULL: * CHKERR( PetscObjectReference(o) ) # <<<<<<<<<<<<<< * obj.obj[0] = o * return obj */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(__pyx_v_o)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(10, 30, __pyx_L1_error) /* "PETSc/Object.pyx":29 * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] * if o != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o */ } /* "PETSc/Object.pyx":31 * if o != NULL: * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o # <<<<<<<<<<<<<< * return obj * */ (__pyx_v_obj->obj[0]) = __pyx_v_o; /* "PETSc/Object.pyx":32 * CHKERR( PetscObjectReference(o) ) * obj.obj[0] = o * return obj # <<<<<<<<<<<<<< * * def __deepcopy__(self, dict memo): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_obj)); __pyx_r = ((PyObject *)__pyx_v_obj); goto __pyx_L0; /* "PETSc/Object.pyx":26 * return self.obj[0] != NULL * * def __copy__(self): # <<<<<<<<<<<<<< * cdef Object obj = type(self)() * cdef PetscObject o = self.obj[0] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.__copy__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":34 * return obj * * def __deepcopy__(self, dict memo): # <<<<<<<<<<<<<< * cdef object obj_copy = None * try: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_10__deepcopy__[] = "Object.__deepcopy__(self, dict memo)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_memo = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__deepcopy__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_memo,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memo)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__deepcopy__") < 0)) __PYX_ERR(10, 34, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_memo = ((PyObject*)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__deepcopy__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 34, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memo), (&PyDict_Type), 0, "memo", 1))) __PYX_ERR(10, 34, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_memo); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_10__deepcopy__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_memo) { PyObject *__pyx_v_obj_copy = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__deepcopy__", 0); /* "PETSc/Object.pyx":35 * * def __deepcopy__(self, dict memo): * cdef object obj_copy = None # <<<<<<<<<<<<<< * try: * obj_copy = self.copy */ __Pyx_INCREF(Py_None); __pyx_v_obj_copy = Py_None; /* "PETSc/Object.pyx":36 * def __deepcopy__(self, dict memo): * cdef object obj_copy = None * try: # <<<<<<<<<<<<<< * obj_copy = self.copy * except AttributeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { /* "PETSc/Object.pyx":37 * cdef object obj_copy = None * try: * obj_copy = self.copy # <<<<<<<<<<<<<< * except AttributeError: * raise NotImplementedError */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 37, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_obj_copy, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Object.pyx":36 * def __deepcopy__(self, dict memo): * cdef object obj_copy = None * try: # <<<<<<<<<<<<<< * obj_copy = self.copy * except AttributeError: */ } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Object.pyx":38 * try: * obj_copy = self.copy * except AttributeError: # <<<<<<<<<<<<<< * raise NotImplementedError * memo # unused */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(10, 38, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); /* "PETSc/Object.pyx":39 * obj_copy = self.copy * except AttributeError: * raise NotImplementedError # <<<<<<<<<<<<<< * memo # unused * return obj_copy() */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(10, 39, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "PETSc/Object.pyx":36 * def __deepcopy__(self, dict memo): * cdef object obj_copy = None * try: # <<<<<<<<<<<<<< * obj_copy = self.copy * except AttributeError: */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L8_try_end:; } /* "PETSc/Object.pyx":40 * except AttributeError: * raise NotImplementedError * memo # unused # <<<<<<<<<<<<<< * return obj_copy() * */ ((void)__pyx_v_memo); /* "PETSc/Object.pyx":41 * raise NotImplementedError * memo # unused * return obj_copy() # <<<<<<<<<<<<<< * * # --- attribute management --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_obj_copy); __pyx_t_6 = __pyx_v_obj_copy; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":34 * return obj * * def __deepcopy__(self, dict memo): # <<<<<<<<<<<<<< * cdef object obj_copy = None * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Object.__deepcopy__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj_copy); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":45 * # --- attribute management --- * * cdef object get_attr(self, char name[]): # <<<<<<<<<<<<<< * return PetscGetPyObj(self.obj[0], name) * */ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_attr", 0); /* "PETSc/Object.pyx":46 * * cdef object get_attr(self, char name[]): * return PetscGetPyObj(self.obj[0], name) # <<<<<<<<<<<<<< * * cdef object set_attr(self, char name[], object attr): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyObj((__pyx_v_self->obj[0]), __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":45 * # --- attribute management --- * * cdef object get_attr(self, char name[]): # <<<<<<<<<<<<<< * return PetscGetPyObj(self.obj[0], name) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.get_attr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":48 * return PetscGetPyObj(self.obj[0], name) * * cdef object set_attr(self, char name[], object attr): # <<<<<<<<<<<<<< * return PetscSetPyObj(self.obj[0], name, attr) * */ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_set_attr(struct PyPetscObjectObject *__pyx_v_self, char *__pyx_v_name, PyObject *__pyx_v_attr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_attr", 0); /* "PETSc/Object.pyx":49 * * cdef object set_attr(self, char name[], object attr): * return PetscSetPyObj(self.obj[0], name, attr) # <<<<<<<<<<<<<< * * cdef object get_dict(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscSetPyObj((__pyx_v_self->obj[0]), __pyx_v_name, __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":48 * return PetscGetPyObj(self.obj[0], name) * * cdef object set_attr(self, char name[], object attr): # <<<<<<<<<<<<<< * return PetscSetPyObj(self.obj[0], name, attr) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.set_attr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":51 * return PetscSetPyObj(self.obj[0], name, attr) * * cdef object get_dict(self): # <<<<<<<<<<<<<< * return PetscGetPyDict(self.obj[0], True) * */ static PyObject *__pyx_f_8petsc4py_5PETSc_6Object_get_dict(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_dict", 0); /* "PETSc/Object.pyx":52 * * cdef object get_dict(self): * return PetscGetPyDict(self.obj[0], True) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscGetPyDict((__pyx_v_self->obj[0]), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":51 * return PetscSetPyObj(self.obj[0], name, attr) * * cdef object get_dict(self): # <<<<<<<<<<<<<< * return PetscGetPyDict(self.obj[0], True) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.get_dict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":56 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_13view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_12view[] = "Object.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_13view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(10, 56, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 56, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(10, 56, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_12view(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_12view(struct PyPetscObjectObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Object.pyx":57 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscObjectView(self.obj[0], vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Object.pyx":58 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscObjectView(self.obj[0], vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Object.pyx":59 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscObjectView(self.obj[0], vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((__pyx_v_self->obj[0]), __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 59, __pyx_L1_error) /* "PETSc/Object.pyx":56 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":61 * CHKERR( PetscObjectView(self.obj[0], vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDestroy(&self.obj[0]) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_14destroy[] = "Object.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_15destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_14destroy(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_14destroy(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Object.pyx":62 * * def destroy(self): * CHKERR( PetscObjectDestroy(&self.obj[0]) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDestroy((&(__pyx_v_self->obj[0])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 62, __pyx_L1_error) /* "PETSc/Object.pyx":63 * def destroy(self): * CHKERR( PetscObjectDestroy(&self.obj[0]) ) * return self # <<<<<<<<<<<<<< * * def getType(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Object.pyx":61 * CHKERR( PetscObjectView(self.obj[0], vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDestroy(&self.obj[0]) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":65 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_17getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_16getType[] = "Object.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_17getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_16getType(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_16getType(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/Object.pyx":66 * * def getType(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":67 * def getType(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetType((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 67, __pyx_L1_error) /* "PETSc/Object.pyx":68 * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":65 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetType(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":72 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_18setOptionsPrefix[] = "Object.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(10, 72, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 72, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_18setOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/Object.pyx":73 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":74 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":75 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetOptionsPrefix((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 75, __pyx_L1_error) /* "PETSc/Object.pyx":72 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":77 * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_20getOptionsPrefix[] = "Object.getOptionsPrefix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_20getOptionsPrefix(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/Object.pyx":78 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":79 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetOptionsPrefix((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 79, __pyx_L1_error) /* "PETSc/Object.pyx":80 * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":77 * CHKERR( PetscObjectSetOptionsPrefix(self.obj[0], cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetOptionsPrefix(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":82 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_23setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_22setFromOptions[] = "Object.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_23setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_22setFromOptions(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_22setFromOptions(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/Object.pyx":83 * * def setFromOptions(self): * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) # <<<<<<<<<<<<<< * * def viewFromOptions(self, name, Object prefix=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetFromOptions((__pyx_v_self->obj[0]))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 83, __pyx_L1_error) /* "PETSc/Object.pyx":82 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":85 * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * * def viewFromOptions(self, name, Object prefix=None): # <<<<<<<<<<<<<< * cdef PetscObject pobj = NULL * cdef const char *cval = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_25viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_24viewFromOptions[] = "Object.viewFromOptions(self, name, Object prefix=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_25viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFromOptions (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_prefix,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscObjectObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "viewFromOptions") < 0)) __PYX_ERR(10, 85, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_prefix = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 85, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_prefix), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "prefix", 0))) __PYX_ERR(10, 85, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_24viewFromOptions(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_prefix); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_24viewFromOptions(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_prefix) { PetscObject __pyx_v_pobj; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscObject __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFromOptions", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Object.pyx":86 * * def viewFromOptions(self, name, Object prefix=None): * cdef PetscObject pobj = NULL # <<<<<<<<<<<<<< * cdef const char *cval = NULL * pobj = prefix.obj[0] if prefix is not None else NULL */ __pyx_v_pobj = NULL; /* "PETSc/Object.pyx":87 * def viewFromOptions(self, name, Object prefix=None): * cdef PetscObject pobj = NULL * cdef const char *cval = NULL # <<<<<<<<<<<<<< * pobj = prefix.obj[0] if prefix is not None else NULL * name = str2bytes(name, &cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":88 * cdef PetscObject pobj = NULL * cdef const char *cval = NULL * pobj = prefix.obj[0] if prefix is not None else NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_prefix) != Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_1 = (__pyx_v_prefix->obj[0]); } else { __pyx_t_1 = NULL; } __pyx_v_pobj = __pyx_t_1; /* "PETSc/Object.pyx":89 * cdef const char *cval = NULL * pobj = prefix.obj[0] if prefix is not None else NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Object.pyx":90 * pobj = prefix.obj[0] if prefix is not None else NULL * name = str2bytes(name, &cval) * CHKERR( PetscObjectViewFromOptions(self.obj[0], pobj, cval) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectViewFromOptions((__pyx_v_self->obj[0]), __pyx_v_pobj, __pyx_v_cval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 90, __pyx_L1_error) /* "PETSc/Object.pyx":85 * CHKERR( PetscObjectSetFromOptions(self.obj[0]) ) * * def viewFromOptions(self, name, Object prefix=None): # <<<<<<<<<<<<<< * cdef PetscObject pobj = NULL * cdef const char *cval = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":94 * # * * def getComm(self): # <<<<<<<<<<<<<< * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_27getComm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_26getComm[] = "Object.getComm(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_27getComm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComm (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getComm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_26getComm(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_26getComm(struct PyPetscObjectObject *__pyx_v_self) { struct PyPetscCommObject *__pyx_v_comm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComm", 0); /* "PETSc/Object.pyx":95 * * def getComm(self): * cdef Comm comm = Comm() # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) * return comm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":96 * def getComm(self): * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) # <<<<<<<<<<<<<< * return comm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm((__pyx_v_self->obj[0]), (&__pyx_v_comm->comm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 96, __pyx_L1_error) /* "PETSc/Object.pyx":97 * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) * return comm # <<<<<<<<<<<<<< * * def getName(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_comm)); __pyx_r = ((PyObject *)__pyx_v_comm); goto __pyx_L0; /* "PETSc/Object.pyx":94 * # * * def getComm(self): # <<<<<<<<<<<<<< * cdef Comm comm = Comm() * CHKERR( PetscObjectGetComm(self.obj[0], &comm.comm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.getComm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":99 * return comm * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_28getName[] = "Object.getName(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29getName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getName (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_28getName(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28getName(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getName", 0); /* "PETSc/Object.pyx":100 * * def getName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":101 * def getName(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetName((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 101, __pyx_L1_error) /* "PETSc/Object.pyx":102 * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setName(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":99 * return comm * * def getName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetName(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":104 * return bytes2str(cval) * * def setName(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31setName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_30setName[] = "Object.setName(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31setName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setName") < 0)) __PYX_ERR(10, 104, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 104, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_30setName(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30setName(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setName", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Object.pyx":105 * * def setName(self, name): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscObjectSetName(self.obj[0], cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":106 * def setName(self, name): * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetName(self.obj[0], cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":107 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( PetscObjectSetName(self.obj[0], cval) ) # <<<<<<<<<<<<<< * * def getClassId(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetName((__pyx_v_self->obj[0]), __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 107, __pyx_L1_error) /* "PETSc/Object.pyx":104 * return bytes2str(cval) * * def setName(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.setName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":109 * CHKERR( PetscObjectSetName(self.obj[0], cval) ) * * def getClassId(self): # <<<<<<<<<<<<<< * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33getClassId(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_32getClassId[] = "Object.getClassId(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33getClassId(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getClassId (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getClassId", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getClassId", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_32getClassId(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32getClassId(struct PyPetscObjectObject *__pyx_v_self) { PetscClassId __pyx_v_classid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getClassId", 0); /* "PETSc/Object.pyx":110 * * def getClassId(self): * cdef PetscClassId classid = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) * return classid */ __pyx_v_classid = 0; /* "PETSc/Object.pyx":111 * def getClassId(self): * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) # <<<<<<<<<<<<<< * return classid * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassId((__pyx_v_self->obj[0]), (&__pyx_v_classid))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 111, __pyx_L1_error) /* "PETSc/Object.pyx":112 * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) * return classid # <<<<<<<<<<<<<< * * def getClassName(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":109 * CHKERR( PetscObjectSetName(self.obj[0], cval) ) * * def getClassId(self): # <<<<<<<<<<<<<< * cdef PetscClassId classid = 0 * CHKERR( PetscObjectGetClassId(self.obj[0], &classid) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getClassId", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":114 * return classid * * def getClassName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getClassName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_34getClassName[] = "Object.getClassName(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getClassName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getClassName (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getClassName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getClassName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_34getClassName(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getClassName(struct PyPetscObjectObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getClassName", 0); /* "PETSc/Object.pyx":115 * * def getClassName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":116 * def getClassName(self): * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetClassName((__pyx_v_self->obj[0]), (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 116, __pyx_L1_error) /* "PETSc/Object.pyx":117 * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getRefCount(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":114 * return classid * * def getClassName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscObjectGetClassName(self.obj[0], &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getClassName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":119 * return bytes2str(cval) * * def getRefCount(self): # <<<<<<<<<<<<<< * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37getRefCount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_36getRefCount[] = "Object.getRefCount(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37getRefCount(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefCount (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRefCount", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefCount", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_36getRefCount(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36getRefCount(struct PyPetscObjectObject *__pyx_v_self) { PetscInt __pyx_v_refcnt; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefCount", 0); /* "PETSc/Object.pyx":120 * * def getRefCount(self): * if self.obj[0] == NULL: return 0 # <<<<<<<<<<<<<< * cdef PetscInt refcnt = 0 * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) */ __pyx_t_1 = (((__pyx_v_self->obj[0]) == NULL) != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_int_0); __pyx_r = __pyx_int_0; goto __pyx_L0; } /* "PETSc/Object.pyx":121 * def getRefCount(self): * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) * return toInt(refcnt) */ __pyx_v_refcnt = 0; /* "PETSc/Object.pyx":122 * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) # <<<<<<<<<<<<<< * return toInt(refcnt) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference((__pyx_v_self->obj[0]), (&__pyx_v_refcnt))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 122, __pyx_L1_error) /* "PETSc/Object.pyx":123 * cdef PetscInt refcnt = 0 * CHKERR( PetscObjectGetReference(self.obj[0], &refcnt) ) * return toInt(refcnt) # <<<<<<<<<<<<<< * * # --- general support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_refcnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":119 * return bytes2str(cval) * * def getRefCount(self): # <<<<<<<<<<<<<< * if self.obj[0] == NULL: return 0 * cdef PetscInt refcnt = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.getRefCount", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":127 * # --- general support --- * * def compose(self, name, Object obj or None): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39compose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_38compose[] = "Object.compose(self, name, Object obj)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39compose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_obj = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("compose", 1, 2, 2, 1); __PYX_ERR(10, 127, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(10, 127, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_obj = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("compose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 127, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(10, 127, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_38compose(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38compose(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) { char const *__pyx_v_cval; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compose", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Object.pyx":128 * * def compose(self, name, Object obj or None): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":129 * def compose(self, name, Object obj or None): * cdef const char *cval = NULL * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * if obj is not None: cobj = obj.obj[0] */ __pyx_v_cobj = NULL; /* "PETSc/Object.pyx":130 * cdef const char *cval = NULL * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":131 * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) * if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<< * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_v_cobj = (__pyx_v_obj->obj[0]); } /* "PETSc/Object.pyx":132 * name = str2bytes(name, &cval) * if obj is not None: cobj = obj.obj[0] * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) # <<<<<<<<<<<<<< * * def query(self, name): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectCompose((__pyx_v_self->obj[0]), __pyx_v_cval, __pyx_v_cobj)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 132, __pyx_L1_error) /* "PETSc/Object.pyx":127 * # --- general support --- * * def compose(self, name, Object obj or None): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":134 * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) * * def query(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_40query[] = "Object.query(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41query(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("query (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "query") < 0)) __PYX_ERR(10, 134, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("query", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 134, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.query", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_40query(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40query(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PetscObject __pyx_v_cobj; struct PyPetscObjectObject *__pyx_v_obj = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("query", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Object.pyx":135 * * def query(self, name): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":136 * def query(self, name): * cdef const char *cval = NULL * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) */ __pyx_v_cobj = NULL; /* "PETSc/Object.pyx":137 * cdef const char *cval = NULL * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) * if cobj == NULL: return None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":138 * cdef PetscObject cobj = NULL * name = str2bytes(name, &cval) * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) # <<<<<<<<<<<<<< * if cobj == NULL: return None * cdef Object obj = subtype_Object(cobj)() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectQuery((__pyx_v_self->obj[0]), __pyx_v_cval, (&__pyx_v_cobj))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 138, __pyx_L1_error) /* "PETSc/Object.pyx":139 * name = str2bytes(name, &cval) * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) * if cobj == NULL: return None # <<<<<<<<<<<<<< * cdef Object obj = subtype_Object(cobj)() * obj.obj[0] = cobj */ __pyx_t_3 = ((__pyx_v_cobj == NULL) != 0); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/Object.pyx":140 * CHKERR( PetscObjectQuery(self.obj[0], cval, &cobj) ) * if cobj == NULL: return None * cdef Object obj = subtype_Object(cobj)() # <<<<<<<<<<<<<< * obj.obj[0] = cobj * PetscINCREF(obj.obj) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_cobj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(10, 140, __pyx_L1_error) __pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Object.pyx":141 * if cobj == NULL: return None * cdef Object obj = subtype_Object(cobj)() * obj.obj[0] = cobj # <<<<<<<<<<<<<< * PetscINCREF(obj.obj) * return obj */ (__pyx_v_obj->obj[0]) = __pyx_v_cobj; /* "PETSc/Object.pyx":142 * cdef Object obj = subtype_Object(cobj)() * obj.obj[0] = cobj * PetscINCREF(obj.obj) # <<<<<<<<<<<<<< * return obj * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_obj->obj)); /* "PETSc/Object.pyx":143 * obj.obj[0] = cobj * PetscINCREF(obj.obj) * return obj # <<<<<<<<<<<<<< * * def incRef(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_obj)); __pyx_r = ((PyObject *)__pyx_v_obj); goto __pyx_L0; /* "PETSc/Object.pyx":134 * CHKERR( PetscObjectCompose(self.obj[0], cval, cobj) ) * * def query(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscObject cobj = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Object.query", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":145 * return obj * * def incRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43incRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_42incRef[] = "Object.incRef(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43incRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("incRef (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("incRef", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "incRef", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_42incRef(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42incRef(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PetscInt __pyx_v_refct; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("incRef", 0); /* "PETSc/Object.pyx":146 * * def incRef(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * cdef PetscInt refct = 0 * if obj != NULL: */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "PETSc/Object.pyx":147 * def incRef(self): * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 # <<<<<<<<<<<<<< * if obj != NULL: * CHKERR( PetscObjectReference(obj) ) */ __pyx_v_refct = 0; /* "PETSc/Object.pyx":148 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) */ __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); if (__pyx_t_1) { /* "PETSc/Object.pyx":149 * cdef PetscInt refct = 0 * if obj != NULL: * CHKERR( PetscObjectReference(obj) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(obj, &refct) ) * return (refct) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(__pyx_v_obj)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 149, __pyx_L1_error) /* "PETSc/Object.pyx":150 * if obj != NULL: * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) # <<<<<<<<<<<<<< * return (refct) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference(__pyx_v_obj, (&__pyx_v_refct))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 150, __pyx_L1_error) /* "PETSc/Object.pyx":148 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) */ } /* "PETSc/Object.pyx":151 * CHKERR( PetscObjectReference(obj) ) * CHKERR( PetscObjectGetReference(obj, &refct) ) * return (refct) # <<<<<<<<<<<<<< * * def decRef(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_refct)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":145 * return obj * * def incRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.incRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":153 * return (refct) * * def decRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45decRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_44decRef[] = "Object.decRef(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45decRef(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("decRef (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("decRef", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "decRef", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_44decRef(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44decRef(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PetscInt __pyx_v_refct; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("decRef", 0); /* "PETSc/Object.pyx":154 * * def decRef(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * cdef PetscInt refct = 0 * if obj != NULL: */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "PETSc/Object.pyx":155 * def decRef(self): * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 # <<<<<<<<<<<<<< * if obj != NULL: * CHKERR( PetscObjectGetReference(obj, &refct) ) */ __pyx_v_refct = 0; /* "PETSc/Object.pyx":156 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) */ __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); if (__pyx_t_1) { /* "PETSc/Object.pyx":157 * cdef PetscInt refct = 0 * if obj != NULL: * CHKERR( PetscObjectGetReference(obj, &refct) ) # <<<<<<<<<<<<<< * CHKERR( PetscObjectDereference(obj) ) * if refct == 1: self.obj[0] = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetReference(__pyx_v_obj, (&__pyx_v_refct))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 157, __pyx_L1_error) /* "PETSc/Object.pyx":158 * if obj != NULL: * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) # <<<<<<<<<<<<<< * if refct == 1: self.obj[0] = NULL * refct -= 1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDereference(__pyx_v_obj)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 158, __pyx_L1_error) /* "PETSc/Object.pyx":159 * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) * if refct == 1: self.obj[0] = NULL # <<<<<<<<<<<<<< * refct -= 1 * return (refct) */ __pyx_t_1 = ((__pyx_v_refct == 1) != 0); if (__pyx_t_1) { (__pyx_v_self->obj[0]) = NULL; } /* "PETSc/Object.pyx":160 * CHKERR( PetscObjectDereference(obj) ) * if refct == 1: self.obj[0] = NULL * refct -= 1 # <<<<<<<<<<<<<< * return (refct) * */ __pyx_v_refct = (__pyx_v_refct - 1); /* "PETSc/Object.pyx":156 * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 * if obj != NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetReference(obj, &refct) ) * CHKERR( PetscObjectDereference(obj) ) */ } /* "PETSc/Object.pyx":161 * if refct == 1: self.obj[0] = NULL * refct -= 1 * return (refct) # <<<<<<<<<<<<<< * * def getAttr(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_From_long(((long)__pyx_v_refct)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":153 * return (refct) * * def decRef(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * cdef PetscInt refct = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.decRef", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":163 * return (refct) * * def getAttr(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47getAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_46getAttr[] = "Object.getAttr(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47getAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAttr (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getAttr") < 0)) __PYX_ERR(10, 163, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getAttr", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 163, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.getAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_46getAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46getAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAttr", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Object.pyx":164 * * def getAttr(self, name): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * return self.get_attr(cval) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":165 * def getAttr(self, name): * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * return self.get_attr(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":166 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * return self.get_attr(cval) # <<<<<<<<<<<<<< * * def setAttr(self, name, attr): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->get_attr(__pyx_v_self, ((char *)__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":163 * return (refct) * * def getAttr(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.getAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":168 * return self.get_attr(cval) * * def setAttr(self, name, attr): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49setAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_48setAttr[] = "Object.setAttr(self, name, attr)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49setAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_attr = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAttr (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_attr,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attr)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, 1); __PYX_ERR(10, 168, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAttr") < 0)) __PYX_ERR(10, 168, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_attr = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 168, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_48setAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_attr); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48setAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_attr) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAttr", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Object.pyx":169 * * def setAttr(self, name, attr): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * self.set_attr(cval, attr) */ __pyx_v_cval = NULL; /* "PETSc/Object.pyx":170 * def setAttr(self, name, attr): * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * self.set_attr(cval, attr) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":171 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * self.set_attr(cval, attr) # <<<<<<<<<<<<<< * * def getDict(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->set_attr(__pyx_v_self, ((char *)__pyx_v_cval), __pyx_v_attr); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":168 * return self.get_attr(cval) * * def setAttr(self, name, attr): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":173 * self.set_attr(cval, attr) * * def getDict(self): # <<<<<<<<<<<<<< * return self.get_dict() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51getDict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_50getDict[] = "Object.getDict(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51getDict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDict (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDict", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDict", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_50getDict(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50getDict(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDict", 0); /* "PETSc/Object.pyx":174 * * def getDict(self): * return self.get_dict() # <<<<<<<<<<<<<< * * def stateIncrease(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->get_dict(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":173 * self.set_attr(cval, attr) * * def getDict(self): # <<<<<<<<<<<<<< * return self.get_dict() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.getDict", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":176 * return self.get_dict() * * def stateIncrease(self): # <<<<<<<<<<<<<< * PetscINCSTATE(self.obj) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53stateIncrease(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_52stateIncrease[] = "Object.stateIncrease(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53stateIncrease(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stateIncrease (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("stateIncrease", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stateIncrease", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_52stateIncrease(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52stateIncrease(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stateIncrease", 0); /* "PETSc/Object.pyx":177 * * def stateIncrease(self): * PetscINCSTATE(self.obj) # <<<<<<<<<<<<<< * * # --- tab level --- */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCSTATE(__pyx_v_self->obj)); /* "PETSc/Object.pyx":176 * return self.get_dict() * * def stateIncrease(self): # <<<<<<<<<<<<<< * PetscINCSTATE(self.obj) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":181 * # --- tab level --- * * def incrementTabLevel(self, tab, Object parent=None): # <<<<<<<<<<<<<< * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55incrementTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_54incrementTabLevel[] = "Object.incrementTabLevel(self, tab, Object parent=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55incrementTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tab = 0; struct PyPetscObjectObject *__pyx_v_parent = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("incrementTabLevel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tab,&__pyx_n_s_parent,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscObjectObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tab)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "incrementTabLevel") < 0)) __PYX_ERR(10, 181, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tab = values[0]; __pyx_v_parent = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("incrementTabLevel", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 181, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.incrementTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "parent", 0))) __PYX_ERR(10, 181, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_54incrementTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_tab, __pyx_v_parent); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54incrementTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_tab, struct PyPetscObjectObject *__pyx_v_parent) { PetscInt __pyx_v_ctab; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscObject __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("incrementTabLevel", 0); /* "PETSc/Object.pyx":182 * * def incrementTabLevel(self, tab, Object parent=None): * cdef PetscInt ctab = asInt(tab) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tab); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(10, 182, __pyx_L1_error) __pyx_v_ctab = __pyx_t_1; /* "PETSc/Object.pyx":183 * def incrementTabLevel(self, tab, Object parent=None): * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] # <<<<<<<<<<<<<< * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) * */ __pyx_t_3 = (((PyObject *)__pyx_v_parent) == Py_None); if ((__pyx_t_3 != 0)) { __pyx_t_2 = ((PetscObject)NULL); } else { __pyx_t_2 = (__pyx_v_parent->obj[0]); } __pyx_v_cobj = __pyx_t_2; /* "PETSc/Object.pyx":184 * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) # <<<<<<<<<<<<<< * * def setTabLevel(self, level): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectIncrementTabLevel((__pyx_v_self->obj[0]), __pyx_v_cobj, __pyx_v_ctab)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(10, 184, __pyx_L1_error) /* "PETSc/Object.pyx":181 * # --- tab level --- * * def incrementTabLevel(self, tab, Object parent=None): # <<<<<<<<<<<<<< * cdef PetscInt ctab = asInt(tab) * cdef PetscObject cobj = NULL if parent is None else parent.obj[0] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.incrementTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":186 * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) * * def setTabLevel(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57setTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_56setTabLevel[] = "Object.setTabLevel(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57setTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTabLevel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTabLevel") < 0)) __PYX_ERR(10, 186, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTabLevel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 186, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_56setTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56setTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTabLevel", 0); /* "PETSc/Object.pyx":187 * * def setTabLevel(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(10, 187, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/Object.pyx":188 * def setTabLevel(self, level): * cdef PetscInt clevel = asInt(level) * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) # <<<<<<<<<<<<<< * * def getTabLevel(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectSetTabLevel((__pyx_v_self->obj[0]), __pyx_v_clevel)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 188, __pyx_L1_error) /* "PETSc/Object.pyx":186 * CHKERR( PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab) ) * * def setTabLevel(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Object.setTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":190 * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) * * def getTabLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59getTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Object_58getTabLevel[] = "Object.getTabLevel(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59getTabLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTabLevel (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTabLevel", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTabLevel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_58getTabLevel(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58getTabLevel(struct PyPetscObjectObject *__pyx_v_self) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTabLevel", 0); /* "PETSc/Object.pyx":191 * * def getTabLevel(self): * cdef PetscInt clevel = 0 # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) * return toInt(clevel) */ __pyx_v_clevel = 0; /* "PETSc/Object.pyx":192 * def getTabLevel(self): * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) # <<<<<<<<<<<<<< * return toInt(clevel) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetTabLevel((__pyx_v_self->obj[0]), (&__pyx_v_clevel))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 192, __pyx_L1_error) /* "PETSc/Object.pyx":193 * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) * return toInt(clevel) # <<<<<<<<<<<<<< * * # --- properties --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_clevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":190 * CHKERR( PetscObjectSetTabLevel(self.obj[0], clevel) ) * * def getTabLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt clevel = 0 * CHKERR( PetscObjectGetTabLevel(self.obj[0], &clevel) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Object.getTabLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":198 * * property type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getType() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4type___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":199 * property type: * def __get__(self): * return self.getType() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":198 * * property type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getType() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":200 * def __get__(self): * return self.getType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_4type_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Object.pyx":201 * return self.getType() * def __set__(self, value): * self.setType(value) # <<<<<<<<<<<<<< * * property prefix: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setType); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":200 * def __get__(self): * return self.getType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":204 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOptionsPrefix() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6prefix___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":205 * property prefix: * def __get__(self): * return self.getOptionsPrefix() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setOptionsPrefix(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOptionsPrefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":204 * * property prefix: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOptionsPrefix() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.prefix.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":206 * def __get__(self): * return self.getOptionsPrefix() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setOptionsPrefix(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_6prefix_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Object.pyx":207 * return self.getOptionsPrefix() * def __set__(self, value): * self.setOptionsPrefix(value) # <<<<<<<<<<<<<< * * property comm: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setOptionsPrefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":206 * def __get__(self): * return self.getOptionsPrefix() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setOptionsPrefix(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.prefix.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":210 * * property comm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getComm() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4comm___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":211 * property comm: * def __get__(self): * return self.getComm() # <<<<<<<<<<<<<< * * property name: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getComm); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":210 * * property comm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getComm() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.comm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":214 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_4name___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":215 * property name: * def __get__(self): * return self.getName() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setName(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getName); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":214 * * property name: * def __get__(self): # <<<<<<<<<<<<<< * return self.getName() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":216 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setName(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(((struct PyPetscObjectObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Object_4name_2__set__(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Object.pyx":217 * return self.getName() * def __set__(self, value): * self.setName(value) # <<<<<<<<<<<<<< * * property classid: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setName); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":216 * def __get__(self): * return self.getName() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setName(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":220 * * property classid: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassId() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7classid___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":221 * property classid: * def __get__(self): * return self.getClassId() # <<<<<<<<<<<<<< * * property klass: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getClassId); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":220 * * property classid: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassId() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.classid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":224 * * property klass: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassName() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_5klass___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":225 * property klass: * def __get__(self): * return self.getClassName() # <<<<<<<<<<<<<< * * property refcount: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getClassName); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":224 * * property klass: * def __get__(self): # <<<<<<<<<<<<<< * return self.getClassName() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.klass.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":228 * * property refcount: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRefCount() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_8refcount___get__(struct PyPetscObjectObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":229 * property refcount: * def __get__(self): * return self.getRefCount() # <<<<<<<<<<<<<< * * # --- ctypes support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRefCount); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":228 * * property refcount: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRefCount() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Object.refcount.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":234 * * property handle: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return PyLong_FromVoidPtr(obj) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6handle_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_6handle_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_6handle___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_6handle___get__(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":235 * property handle: * def __get__(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * return PyLong_FromVoidPtr(obj) * */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "PETSc/Object.pyx":236 * def __get__(self): * cdef PetscObject obj = self.obj[0] * return PyLong_FromVoidPtr(obj) # <<<<<<<<<<<<<< * * # --- Fortran support --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":234 * * property handle: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return PyLong_FromVoidPtr(obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.handle.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":241 * * property fortran: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return Object_toFortran(obj) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_7fortran___get__(((struct PyPetscObjectObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_7fortran___get__(struct PyPetscObjectObject *__pyx_v_self) { PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Object.pyx":242 * property fortran: * def __get__(self): * cdef PetscObject obj = self.obj[0] # <<<<<<<<<<<<<< * return Object_toFortran(obj) * */ __pyx_v_obj = (__pyx_v_self->obj[0]); /* "PETSc/Object.pyx":243 * def __get__(self): * cdef PetscObject obj = self.obj[0] * return Object_toFortran(obj) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_f_8petsc4py_5PETSc_Object_toFortran(__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Object.pyx":241 * * property fortran: * def __get__(self): # <<<<<<<<<<<<<< * cdef PetscObject obj = self.obj[0] * return Object_toFortran(obj) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Object.fortran.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/cyclicgc.pxi":18 * PyTypeObject *Py_TYPE(PyObject *) * * cdef int tp_traverse(PyObject *o, visitproc visit, void *arg): # <<<<<<<<<<<<<< * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] */ static int __pyx_f_8petsc4py_5PETSc_tp_traverse(PyObject *__pyx_v_o, visitproc __pyx_v_visit, void *__pyx_v_arg) { PetscObject __pyx_v_p; PyObject *__pyx_v_d; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("tp_traverse", 0); /* "PETSc/cyclicgc.pxi":20 * cdef int tp_traverse(PyObject *o, visitproc visit, void *arg): * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] # <<<<<<<<<<<<<< * if p == NULL: return 0 * cdef PyObject *d = p.python_context */ __pyx_v_p = (((struct PyPetscObjectObject *)__pyx_v_o)->obj[0]); /* "PETSc/cyclicgc.pxi":21 * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] * if p == NULL: return 0 # <<<<<<<<<<<<<< * cdef PyObject *d = p.python_context * if d == NULL: return 0 */ __pyx_t_1 = ((__pyx_v_p == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/cyclicgc.pxi":22 * cdef PetscObject p = (o).obj[0] * if p == NULL: return 0 * cdef PyObject *d = p.python_context # <<<<<<<<<<<<<< * if d == NULL: return 0 * return visit(d, arg) */ __pyx_v_d = ((PyObject *)__pyx_v_p->python_context); /* "PETSc/cyclicgc.pxi":23 * if p == NULL: return 0 * cdef PyObject *d = p.python_context * if d == NULL: return 0 # <<<<<<<<<<<<<< * return visit(d, arg) * */ __pyx_t_1 = ((__pyx_v_d == NULL) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/cyclicgc.pxi":24 * cdef PyObject *d = p.python_context * if d == NULL: return 0 * return visit(d, arg) # <<<<<<<<<<<<<< * * cdef int tp_clear(PyObject *o): */ __pyx_r = __pyx_v_visit(__pyx_v_d, __pyx_v_arg); goto __pyx_L0; /* "PETSc/cyclicgc.pxi":18 * PyTypeObject *Py_TYPE(PyObject *) * * cdef int tp_traverse(PyObject *o, visitproc visit, void *arg): # <<<<<<<<<<<<<< * ## printf("%s.tp_traverse(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject p = (o).obj[0] */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/cyclicgc.pxi":26 * return visit(d, arg) * * cdef int tp_clear(PyObject *o): # <<<<<<<<<<<<<< * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj */ static int __pyx_f_8petsc4py_5PETSc_tp_clear(PyObject *__pyx_v_o) { PetscObject *__pyx_v_p; int __pyx_r; __Pyx_RefNannyDeclarations PetscObject *__pyx_t_1; __Pyx_RefNannySetupContext("tp_clear", 0); /* "PETSc/cyclicgc.pxi":28 * cdef int tp_clear(PyObject *o): * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj # <<<<<<<<<<<<<< * PetscDEALLOC(p) * return 0 */ __pyx_t_1 = ((struct PyPetscObjectObject *)__pyx_v_o)->obj; __pyx_v_p = __pyx_t_1; /* "PETSc/cyclicgc.pxi":29 * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj * PetscDEALLOC(p) # <<<<<<<<<<<<<< * return 0 * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC(__pyx_v_p)); /* "PETSc/cyclicgc.pxi":30 * cdef PetscObject *p = (o).obj * PetscDEALLOC(p) * return 0 # <<<<<<<<<<<<<< * * cdef inline void TypeEnableGC(PyTypeObject *t): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/cyclicgc.pxi":26 * return visit(d, arg) * * cdef int tp_clear(PyObject *o): # <<<<<<<<<<<<<< * ## printf("%s.tp_clear(%p)\n", Py_TYPE(o).tp_name, o) * cdef PetscObject *p = (o).obj */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/cyclicgc.pxi":32 * return 0 * * cdef inline void TypeEnableGC(PyTypeObject *t): # <<<<<<<<<<<<<< * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse */ static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_TypeEnableGC(PyTypeObject *__pyx_v_t) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("TypeEnableGC", 0); /* "PETSc/cyclicgc.pxi":34 * cdef inline void TypeEnableGC(PyTypeObject *t): * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse # <<<<<<<<<<<<<< * t.tp_clear = tp_clear * */ __pyx_v_t->tp_traverse = __pyx_f_8petsc4py_5PETSc_tp_traverse; /* "PETSc/cyclicgc.pxi":35 * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse * t.tp_clear = tp_clear # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_v_t->tp_clear = __pyx_f_8petsc4py_5PETSc_tp_clear; /* "PETSc/cyclicgc.pxi":32 * return 0 * * cdef inline void TypeEnableGC(PyTypeObject *t): # <<<<<<<<<<<<<< * ## printf("%s: enforcing GC support\n", t.tp_name) * t.tp_traverse = tp_traverse */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "PETSc/Object.pyx":252 * __type_registry__ = type_registry * * cdef int PyPetscType_Register(int classid, type cls) except -1: # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ static int __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(int __pyx_v_classid, PyTypeObject *__pyx_v_cls) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_value = 0; char const *__pyx_v_dummy; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscType_Register", 0); /* "PETSc/Object.pyx":254 * cdef int PyPetscType_Register(int classid, type cls) except -1: * global type_registry * cdef object key = classid # <<<<<<<<<<<<<< * cdef object value = cls * cdef const char *dummy = NULL */ __pyx_t_1 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Object.pyx":255 * global type_registry * cdef object key = classid * cdef object value = cls # <<<<<<<<<<<<<< * cdef const char *dummy = NULL * if key not in type_registry: */ __Pyx_INCREF(((PyObject *)__pyx_v_cls)); __pyx_v_value = ((PyObject *)__pyx_v_cls); /* "PETSc/Object.pyx":256 * cdef object key = classid * cdef object value = cls * cdef const char *dummy = NULL # <<<<<<<<<<<<<< * if key not in type_registry: * type_registry[key] = cls */ __pyx_v_dummy = NULL; /* "PETSc/Object.pyx":257 * cdef object value = cls * cdef const char *dummy = NULL * if key not in type_registry: # <<<<<<<<<<<<<< * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(10, 257, __pyx_L1_error) } __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_key, __pyx_v_8petsc4py_5PETSc_type_registry, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(10, 257, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Object.pyx":258 * cdef const char *dummy = NULL * if key not in type_registry: * type_registry[key] = cls # <<<<<<<<<<<<<< * reg_LogClass(str2bytes(cls.__name__, &dummy), * classid) */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(10, 258, __pyx_L1_error) } if (unlikely(PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key, ((PyObject *)__pyx_v_cls)) < 0)) __PYX_ERR(10, 258, __pyx_L1_error) /* "PETSc/Object.pyx":259 * if key not in type_registry: * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), # <<<<<<<<<<<<<< * classid) * TypeEnableGC(cls) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_1, (&__pyx_v_dummy)); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":260 * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), * classid) # <<<<<<<<<<<<<< * TypeEnableGC(cls) * else: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_reg_LogClass(__pyx_t_4, ((PetscClassId)__pyx_v_classid))); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":261 * reg_LogClass(str2bytes(cls.__name__, &dummy), * classid) * TypeEnableGC(cls) # <<<<<<<<<<<<<< * else: * value = type_registry[key] */ __pyx_f_8petsc4py_5PETSc_TypeEnableGC(((PyTypeObject *)__pyx_v_cls)); /* "PETSc/Object.pyx":257 * cdef object value = cls * cdef const char *dummy = NULL * if key not in type_registry: # <<<<<<<<<<<<<< * type_registry[key] = cls * reg_LogClass(str2bytes(cls.__name__, &dummy), */ goto __pyx_L3; } /* "PETSc/Object.pyx":263 * TypeEnableGC(cls) * else: * value = type_registry[key] # <<<<<<<<<<<<<< * if cls is not value: * raise ValueError( */ /*else*/ { if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(10, 263, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":264 * else: * value = type_registry[key] * if cls is not value: # <<<<<<<<<<<<<< * raise ValueError( * "key: %d, cannot register: %s, " \ */ __pyx_t_3 = (__pyx_v_cls != ((PyTypeObject*)__pyx_v_value)); __pyx_t_2 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/Object.pyx":267 * raise ValueError( * "key: %d, cannot register: %s, " \ * "already registered: %s" % (key, cls, value)) # <<<<<<<<<<<<<< * return 0 * */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); __Pyx_INCREF(((PyObject *)__pyx_v_cls)); __Pyx_GIVEREF(((PyObject *)__pyx_v_cls)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cls)); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_key_d_cannot_register_s_already, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":265 * value = type_registry[key] * if cls is not value: * raise ValueError( # <<<<<<<<<<<<<< * "key: %d, cannot register: %s, " \ * "already registered: %s" % (key, cls, value)) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(10, 265, __pyx_L1_error) /* "PETSc/Object.pyx":264 * else: * value = type_registry[key] * if cls is not value: # <<<<<<<<<<<<<< * raise ValueError( * "key: %d, cannot register: %s, " \ */ } } __pyx_L3:; /* "PETSc/Object.pyx":268 * "key: %d, cannot register: %s, " \ * "already registered: %s" % (key, cls, value)) * return 0 # <<<<<<<<<<<<<< * * cdef type PyPetscType_Lookup(int classid): */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/Object.pyx":252 * __type_registry__ = type_registry * * cdef int PyPetscType_Register(int classid, type cls) except -1: # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_value); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Object.pyx":270 * return 0 * * cdef type PyPetscType_Lookup(int classid): # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ static PyTypeObject *__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup(int __pyx_v_classid) { PyObject *__pyx_v_key = 0; PyTypeObject *__pyx_v_cls = 0; PyTypeObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscType_Lookup", 0); /* "PETSc/Object.pyx":272 * cdef type PyPetscType_Lookup(int classid): * global type_registry * cdef object key = classid # <<<<<<<<<<<<<< * cdef type cls = Object * try: */ __pyx_t_1 = __Pyx_PyInt_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Object.pyx":273 * global type_registry * cdef object key = classid * cdef type cls = Object # <<<<<<<<<<<<<< * try: * cls = type_registry[key] */ __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object)); __pyx_v_cls = __pyx_ptype_8petsc4py_5PETSc_Object; /* "PETSc/Object.pyx":274 * cdef object key = classid * cdef type cls = Object * try: # <<<<<<<<<<<<<< * cls = type_registry[key] * except KeyError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "PETSc/Object.pyx":275 * cdef type cls = Object * try: * cls = type_registry[key] # <<<<<<<<<<<<<< * except KeyError: * cls = Object */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(10, 275, __pyx_L3_error) } __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 275, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyType_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "type", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(10, 275, __pyx_L3_error) __Pyx_DECREF_SET(__pyx_v_cls, ((PyTypeObject*)__pyx_t_1)); __pyx_t_1 = 0; /* "PETSc/Object.pyx":274 * cdef object key = classid * cdef type cls = Object * try: # <<<<<<<<<<<<<< * cls = type_registry[key] * except KeyError: */ } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":276 * try: * cls = type_registry[key] * except KeyError: # <<<<<<<<<<<<<< * cls = Object * return cls */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_5) { __Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(10, 276, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); /* "PETSc/Object.pyx":277 * cls = type_registry[key] * except KeyError: * cls = Object # <<<<<<<<<<<<<< * return cls * */ __Pyx_INCREF(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Object)); __Pyx_DECREF_SET(__pyx_v_cls, __pyx_ptype_8petsc4py_5PETSc_Object); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "PETSc/Object.pyx":274 * cdef object key = classid * cdef type cls = Object * try: # <<<<<<<<<<<<<< * cls = type_registry[key] * except KeyError: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); __pyx_L8_try_end:; } /* "PETSc/Object.pyx":278 * except KeyError: * cls = Object * return cls # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_cls)); __pyx_r = __pyx_v_cls; goto __pyx_L0; /* "PETSc/Object.pyx":270 * return 0 * * cdef type PyPetscType_Lookup(int classid): # <<<<<<<<<<<<<< * global type_registry * cdef object key = classid */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscType_Lookup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_cls); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":94 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vwr * self.vwr = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Viewer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Viewer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Viewer___cinit__(struct PyPetscViewerObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Viewer.pyx":95 * * def __cinit__(self): * self.obj = &self.vwr # <<<<<<<<<<<<<< * self.vwr = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->vwr)); /* "PETSc/Viewer.pyx":96 * def __cinit__(self): * self.obj = &self.vwr * self.vwr = NULL # <<<<<<<<<<<<<< * * def __call__(self, Object obj): */ __pyx_v_self->vwr = NULL; /* "PETSc/Viewer.pyx":94 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vwr * self.vwr = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":98 * self.vwr = NULL * * def __call__(self, Object obj): # <<<<<<<<<<<<<< * assert obj.obj != NULL * CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscObjectObject *__pyx_v_obj = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(29, 98, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_obj = ((struct PyPetscObjectObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 98, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "obj", 0))) __PYX_ERR(29, 98, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_2__call__(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); /* "PETSc/Viewer.pyx":99 * * def __call__(self, Object obj): * assert obj.obj != NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_obj->obj != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(29, 99, __pyx_L1_error) } } #endif /* "PETSc/Viewer.pyx":100 * def __call__(self, Object obj): * assert obj.obj != NULL * CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((__pyx_v_obj->obj[0]), __pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 100, __pyx_L1_error) /* "PETSc/Viewer.pyx":98 * self.vwr = NULL * * def __call__(self, Object obj): # <<<<<<<<<<<<<< * assert obj.obj != NULL * CHKERR( PetscObjectView(obj.obj[0], self.vwr) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":104 * # * * def view(self, obj=None): # <<<<<<<<<<<<<< * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_4view[] = "Viewer.view(self, obj=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_obj = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(29, 104, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_obj = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 104, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_4view(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_obj); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_4view(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Viewer.pyx":105 * * def view(self, obj=None): * if obj is None: # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): */ __pyx_t_1 = (__pyx_v_obj == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Viewer.pyx":106 * def view(self, obj=None): * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) # <<<<<<<<<<<<<< * elif isinstance(obj, Viewer): * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerView(__pyx_v_self->vwr, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(29, 106, __pyx_L1_error) /* "PETSc/Viewer.pyx":105 * * def view(self, obj=None): * if obj is None: # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): */ goto __pyx_L3; } /* "PETSc/Viewer.pyx":107 * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Viewer); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/Viewer.pyx":108 * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) # <<<<<<<<<<<<<< * else: * assert (obj).obj != NULL */ if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(29, 108, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerView(__pyx_v_self->vwr, ((struct PyPetscViewerObject *)__pyx_v_obj)->vwr)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(29, 108, __pyx_L1_error) /* "PETSc/Viewer.pyx":107 * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) * elif isinstance(obj, Viewer): # <<<<<<<<<<<<<< * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) * else: */ goto __pyx_L3; } /* "PETSc/Viewer.pyx":110 * CHKERR( PetscViewerView(self.vwr, (obj).vwr) ) * else: * assert (obj).obj != NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) * */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(29, 110, __pyx_L1_error) if (unlikely(!((((struct PyPetscObjectObject *)__pyx_v_obj)->obj != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(29, 110, __pyx_L1_error) } } #endif /* "PETSc/Viewer.pyx":111 * else: * assert (obj).obj != NULL * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(29, 111, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectView((((struct PyPetscObjectObject *)__pyx_v_obj)->obj[0]), __pyx_v_self->vwr)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(29, 111, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Viewer.pyx":104 * # * * def view(self, obj=None): # <<<<<<<<<<<<<< * if obj is None: * CHKERR( PetscViewerView(self.vwr, NULL) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":113 * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerDestroy(&self.vwr) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_6destroy[] = "Viewer.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_6destroy(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Viewer.pyx":114 * * def destroy(self): * CHKERR( PetscViewerDestroy(&self.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDestroy((&__pyx_v_self->vwr))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 114, __pyx_L1_error) /* "PETSc/Viewer.pyx":115 * def destroy(self): * CHKERR( PetscViewerDestroy(&self.vwr) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":113 * CHKERR( PetscObjectView((obj).obj[0], self.vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerDestroy(&self.vwr) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":117 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscViewer newvwr = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_8create[] = "Viewer.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(29, 117, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 117, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_8create(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_8create(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Viewer.pyx":118 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 118, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":119 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":120 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vwr = newvwr * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 120, __pyx_L1_error) /* "PETSc/Viewer.pyx":121 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":122 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * return self # <<<<<<<<<<<<<< * * def createASCII(self, name, mode=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":117 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscViewer newvwr = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":124 * return self * * def createASCII(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_10createASCII[] = "Viewer.createASCII(self, name, mode=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createASCII (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createASCII") < 0)) __PYX_ERR(29, 124, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createASCII", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 124, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_10createASCII(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_10createASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; PetscFileMode __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createASCII", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":125 * * def createASCII(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 125, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":126 * def createASCII(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE */ __pyx_v_cname = NULL; /* "PETSc/Viewer.pyx":127 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE * if mode is not None: cmode = filemode(mode) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":128 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE # <<<<<<<<<<<<<< * if mode is not None: cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_v_cmode = FILE_MODE_WRITE; /* "PETSc/Viewer.pyx":129 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE * if mode is not None: cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = (__pyx_v_mode != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_5 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(29, 129, __pyx_L1_error) __pyx_v_cmode = __pyx_t_5; } /* "PETSc/Viewer.pyx":130 * cdef PetscFileMode cmode = PETSC_FILE_MODE_WRITE * if mode is not None: cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":131 * if mode is not None: cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(29, 131, __pyx_L1_error) /* "PETSc/Viewer.pyx":132 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":133 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERASCII)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(29, 133, __pyx_L1_error) /* "PETSc/Viewer.pyx":134 * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(29, 134, __pyx_L1_error) /* "PETSc/Viewer.pyx":135 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERASCII) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(29, 135, __pyx_L1_error) /* "PETSc/Viewer.pyx":136 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createBinary(self, name, mode=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":124 * return self * * def createASCII(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":138 * return self * * def createBinary(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_12createBinary[] = "Viewer.createBinary(self, name, mode=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBinary (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBinary") < 0)) __PYX_ERR(29, 138, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBinary", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 138, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createBinary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_12createBinary(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_12createBinary(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBinary", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":139 * * def createBinary(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 139, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":140 * def createBinary(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "PETSc/Viewer.pyx":141 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":142 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(29, 142, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "PETSc/Viewer.pyx":143 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":144 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vwr = newvwr * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerBinaryOpen(__pyx_v_ccomm, __pyx_v_cname, __pyx_v_cmode, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 144, __pyx_L1_error) /* "PETSc/Viewer.pyx":145 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":146 * CHKERR( PetscViewerBinaryOpen(ccomm, cname, cmode, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * return self # <<<<<<<<<<<<<< * * def createMPIIO(self, name, mode=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":138 * return self * * def createBinary(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createBinary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":148 * return self * * def createMPIIO(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_14createMPIIO[] = "Viewer.createMPIIO(self, name, mode=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMPIIO (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createMPIIO") < 0)) __PYX_ERR(29, 148, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMPIIO", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 148, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createMPIIO", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_14createMPIIO(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_14createMPIIO(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMPIIO", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":149 * * def createMPIIO(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 149, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":150 * def createMPIIO(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "PETSc/Viewer.pyx":151 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":152 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(29, 152, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "PETSc/Viewer.pyx":153 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":154 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 154, __pyx_L1_error) /* "PETSc/Viewer.pyx":155 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":156 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERBINARY)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 156, __pyx_L1_error) /* "PETSc/Viewer.pyx":157 * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerBinarySetUseMPIIO(__pyx_v_self->vwr, PETSC_TRUE)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 157, __pyx_L1_error) /* "PETSc/Viewer.pyx":158 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERBINARY) ) * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 158, __pyx_L1_error) /* "PETSc/Viewer.pyx":159 * CHKERR( PetscViewerBinarySetUseMPIIO(self.vwr, PETSC_TRUE) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 159, __pyx_L1_error) /* "PETSc/Viewer.pyx":160 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createVTK(self, name, mode=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":148 * return self * * def createMPIIO(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createMPIIO", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":162 * return self * * def createVTK(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_16createVTK[] = "Viewer.createVTK(self, name, mode=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVTK (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVTK") < 0)) __PYX_ERR(29, 162, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createVTK", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 162, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createVTK", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_16createVTK(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_16createVTK(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVTK", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":163 * * def createVTK(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 163, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":164 * def createVTK(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "PETSc/Viewer.pyx":165 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":166 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(29, 166, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "PETSc/Viewer.pyx":167 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":168 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 168, __pyx_L1_error) /* "PETSc/Viewer.pyx":169 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":170 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERVTK)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 170, __pyx_L1_error) /* "PETSc/Viewer.pyx":171 * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 171, __pyx_L1_error) /* "PETSc/Viewer.pyx":172 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERVTK) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 172, __pyx_L1_error) /* "PETSc/Viewer.pyx":173 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createHDF5(self, name, mode=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":162 * return self * * def createVTK(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createVTK", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":175 * return self * * def createHDF5(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_18createHDF5[] = "Viewer.createHDF5(self, name, mode=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createHDF5 (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createHDF5") < 0)) __PYX_ERR(29, 175, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createHDF5", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 175, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_18createHDF5(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_18createHDF5(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createHDF5", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":176 * * def createHDF5(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 176, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":177 * def createHDF5(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "PETSc/Viewer.pyx":178 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":179 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(29, 179, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "PETSc/Viewer.pyx":180 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":181 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 181, __pyx_L1_error) /* "PETSc/Viewer.pyx":182 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":183 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERHDF5)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 183, __pyx_L1_error) /* "PETSc/Viewer.pyx":184 * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 184, __pyx_L1_error) /* "PETSc/Viewer.pyx":185 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 185, __pyx_L1_error) /* "PETSc/Viewer.pyx":186 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def createDraw(self, display=None, title=None, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":175 * return self * * def createHDF5(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":188 * return self * * def createDraw(self, display=None, title=None, # <<<<<<<<<<<<<< * position=None, size=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_20createDraw[] = "Viewer.createDraw(self, display=None, title=None, position=None, size=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_display = 0; PyObject *__pyx_v_title = 0; PyObject *__pyx_v_position = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDraw (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_display,&__pyx_n_s_title,&__pyx_n_s_position,&__pyx_n_s_size,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); /* "PETSc/Viewer.pyx":189 * * def createDraw(self, display=None, title=None, * position=None, size=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cdisplay = NULL */ values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_display); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDraw") < 0)) __PYX_ERR(29, 188, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_display = values[0]; __pyx_v_title = values[1]; __pyx_v_position = values[2]; __pyx_v_size = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDraw", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 188, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_20createDraw(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_display, __pyx_v_title, __pyx_v_position, __pyx_v_size, __pyx_v_comm); /* "PETSc/Viewer.pyx":188 * return self * * def createDraw(self, display=None, title=None, # <<<<<<<<<<<<<< * position=None, size=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_20createDraw(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cdisplay; char const *__pyx_v_ctitle; int __pyx_v_x; int __pyx_v_y; int __pyx_v_h; int __pyx_v_w; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDraw", 0); __Pyx_INCREF(__pyx_v_display); __Pyx_INCREF(__pyx_v_title); /* "PETSc/Viewer.pyx":190 * def createDraw(self, display=None, title=None, * position=None, size=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 190, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":191 * position=None, size=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cdisplay = NULL # <<<<<<<<<<<<<< * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) */ __pyx_v_cdisplay = NULL; /* "PETSc/Viewer.pyx":192 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL # <<<<<<<<<<<<<< * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) */ __pyx_v_ctitle = NULL; /* "PETSc/Viewer.pyx":193 * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) # <<<<<<<<<<<<<< * title = str2bytes(title, &ctitle) * cdef int x, y, h, w */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_display, (&__pyx_v_cdisplay)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_display, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":194 * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) # <<<<<<<<<<<<<< * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_title, (&__pyx_v_ctitle)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":196 * title = str2bytes(title, &ctitle) * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE # <<<<<<<<<<<<<< * if position not in (None, PETSC_DECIDE): * x, y = position */ __pyx_v_x = PETSC_DECIDE; __pyx_v_y = PETSC_DECIDE; __pyx_v_h = PETSC_DECIDE; __pyx_v_w = PETSC_DECIDE; /* "PETSc/Viewer.pyx":197 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ __Pyx_INCREF(__pyx_v_position); __pyx_t_2 = __pyx_v_position; __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 197, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(29, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(29, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = (__pyx_t_3 != 0); if (__pyx_t_5) { /* "PETSc/Viewer.pyx":198 * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): * x, y = position # <<<<<<<<<<<<<< * if size not in (None, PETSC_DECIDE): * try: */ if ((likely(PyTuple_CheckExact(__pyx_v_position))) || (PyList_CheckExact(__pyx_v_position))) { PyObject* sequence = __pyx_v_position; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 198, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_2 = PyList_GET_ITEM(sequence, 0); __pyx_t_6 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); #else __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { Py_ssize_t index = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_position); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) __PYX_ERR(29, 198, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 198, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_x = __pyx_t_8; __pyx_v_y = __pyx_t_9; /* "PETSc/Viewer.pyx":197 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ } /* "PETSc/Viewer.pyx":199 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ __Pyx_INCREF(__pyx_v_size); __pyx_t_6 = __pyx_v_size; __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 199, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(29, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { } else { __pyx_t_5 = __pyx_t_3; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(29, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_3; __pyx_L9_bool_binop_done:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_3 = (__pyx_t_5 != 0); if (__pyx_t_3) { /* "PETSc/Viewer.pyx":200 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "PETSc/Viewer.pyx":201 * if size not in (None, PETSC_DECIDE): * try: * w, h = size # <<<<<<<<<<<<<< * except TypeError: * w = h = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 201, __pyx_L11_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 201, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 201, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 201, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_6)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) __PYX_ERR(29, 201, __pyx_L11_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 201, __pyx_L11_error) __pyx_L18_unpacking_done:; } __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 201, __pyx_L11_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 201, __pyx_L11_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_w = __pyx_t_9; __pyx_v_h = __pyx_t_8; /* "PETSc/Viewer.pyx":200 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/Viewer.pyx":202 * try: * w, h = size * except TypeError: # <<<<<<<<<<<<<< * w = h = size * cdef PetscViewer newvwr = NULL */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_8) { __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(29, 202, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_2); /* "PETSc/Viewer.pyx":203 * w, h = size * except TypeError: * w = h = size # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, */ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 203, __pyx_L13_except_error) __pyx_v_w = __pyx_t_8; __pyx_v_h = __pyx_t_8; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "PETSc/Viewer.pyx":200 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L1_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_L16_try_end:; } /* "PETSc/Viewer.pyx":199 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ } /* "PETSc/Viewer.pyx":204 * except TypeError: * w = h = size * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, * x, y, w, h, &newvwr) ) */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":205 * w = h = size * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, # <<<<<<<<<<<<<< * x, y, w, h, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDrawOpen(__pyx_v_ccomm, __pyx_v_cdisplay, __pyx_v_ctitle, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(29, 205, __pyx_L1_error) /* "PETSc/Viewer.pyx":207 * CHKERR( PetscViewerDrawOpen(ccomm, cdisplay, ctitle, * x, y, w, h, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":208 * x, y, w, h, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * return self # <<<<<<<<<<<<<< * * def setType(self, vwr_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":188 * return self * * def createDraw(self, display=None, title=None, # <<<<<<<<<<<<<< * position=None, size=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_display); __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":210 * return self * * def setType(self, vwr_type): # <<<<<<<<<<<<<< * cdef PetscViewerType cval = NULL * vwr_type = str2bytes(vwr_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_22setType[] = "Viewer.setType(self, vwr_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vwr_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vwr_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vwr_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(29, 210, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vwr_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 210, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_22setType(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_vwr_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_22setType(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_vwr_type) { PetscViewerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_vwr_type); /* "PETSc/Viewer.pyx":211 * * def setType(self, vwr_type): * cdef PetscViewerType cval = NULL # <<<<<<<<<<<<<< * vwr_type = str2bytes(vwr_type, &cval) * CHKERR( PetscViewerSetType(self.vwr, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Viewer.pyx":212 * def setType(self, vwr_type): * cdef PetscViewerType cval = NULL * vwr_type = str2bytes(vwr_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vwr_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vwr_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":213 * cdef PetscViewerType cval = NULL * vwr_type = str2bytes(vwr_type, &cval) * CHKERR( PetscViewerSetType(self.vwr, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 213, __pyx_L1_error) /* "PETSc/Viewer.pyx":210 * return self * * def setType(self, vwr_type): # <<<<<<<<<<<<<< * cdef PetscViewerType cval = NULL * vwr_type = str2bytes(vwr_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vwr_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":215 * CHKERR( PetscViewerSetType(self.vwr, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscViewerType cval = NULL * CHKERR( PetscViewerGetType(self.vwr, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_24getType[] = "Viewer.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_24getType(struct PyPetscViewerObject *__pyx_v_self) { PetscViewerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/Viewer.pyx":216 * * def getType(self): * cdef PetscViewerType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerGetType(self.vwr, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Viewer.pyx":217 * def getType(self): * cdef PetscViewerType cval = NULL * CHKERR( PetscViewerGetType(self.vwr, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerGetType(__pyx_v_self->vwr, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 217, __pyx_L1_error) /* "PETSc/Viewer.pyx":218 * cdef PetscViewerType cval = NULL * CHKERR( PetscViewerGetType(self.vwr, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getFormat(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Viewer.pyx":215 * CHKERR( PetscViewerSetType(self.vwr, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscViewerType cval = NULL * CHKERR( PetscViewerGetType(self.vwr, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":220 * return bytes2str(cval) * * def getFormat(self): # <<<<<<<<<<<<<< * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_26getFormat[] = "Viewer.getFormat(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFormat (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFormat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFormat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_26getFormat(struct PyPetscViewerObject *__pyx_v_self) { PetscViewerFormat __pyx_v_format; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFormat", 0); /* "PETSc/Viewer.pyx":221 * * def getFormat(self): * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT # <<<<<<<<<<<<<< * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) * return format */ __pyx_v_format = PETSC_VIEWER_DEFAULT; /* "PETSc/Viewer.pyx":222 * def getFormat(self): * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) # <<<<<<<<<<<<<< * return format * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerGetFormat(__pyx_v_self->vwr, (&__pyx_v_format))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 222, __pyx_L1_error) /* "PETSc/Viewer.pyx":223 * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) * return format # <<<<<<<<<<<<<< * * def pushFormat(self, format): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscViewerFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Viewer.pyx":220 * return bytes2str(cval) * * def getFormat(self): # <<<<<<<<<<<<<< * cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT * CHKERR( PetscViewerGetFormat(self.vwr, &format) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":225 * return format * * def pushFormat(self, format): # <<<<<<<<<<<<<< * CHKERR( PetscViewerPushFormat(self.vwr, format) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_28pushFormat[] = "Viewer.pushFormat(self, format)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_format = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushFormat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_format,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushFormat") < 0)) __PYX_ERR(29, 225, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_format = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pushFormat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 225, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_format); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28pushFormat(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_format) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscViewerFormat __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushFormat", 0); /* "PETSc/Viewer.pyx":226 * * def pushFormat(self, format): * CHKERR( PetscViewerPushFormat(self.vwr, format) ) # <<<<<<<<<<<<<< * * def popFormat(self): */ __pyx_t_1 = ((PetscViewerFormat)__Pyx_PyInt_As_PetscViewerFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 226, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPushFormat(__pyx_v_self->vwr, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 226, __pyx_L1_error) /* "PETSc/Viewer.pyx":225 * return format * * def pushFormat(self, format): # <<<<<<<<<<<<<< * CHKERR( PetscViewerPushFormat(self.vwr, format) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":228 * CHKERR( PetscViewerPushFormat(self.vwr, format) ) * * def popFormat(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerPopFormat(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_30popFormat[] = "Viewer.popFormat(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popFormat (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("popFormat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popFormat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30popFormat(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popFormat", 0); /* "PETSc/Viewer.pyx":229 * * def popFormat(self): * CHKERR( PetscViewerPopFormat(self.vwr) ) # <<<<<<<<<<<<<< * * @classmethod */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPopFormat(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 229, __pyx_L1_error) /* "PETSc/Viewer.pyx":228 * CHKERR( PetscViewerPushFormat(self.vwr, format) ) * * def popFormat(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerPopFormat(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.popFormat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":232 * * @classmethod * def STDOUT(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33STDOUT(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_32STDOUT[] = "Viewer.STDOUT(type cls, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33STDOUT(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("STDOUT (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STDOUT") < 0)) __PYX_ERR(29, 232, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("STDOUT", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 232, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDOUT", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_32STDOUT(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32STDOUT(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("STDOUT", 0); /* "PETSc/Viewer.pyx":233 * @classmethod * def STDOUT(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 233, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":234 * def STDOUT(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) * PetscINCREF(viewer.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":235 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) # <<<<<<<<<<<<<< * PetscINCREF(viewer.obj) * return viewer */ __pyx_t_3 = PETSC_VIEWER_STDOUT_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(29, 235, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "PETSc/Viewer.pyx":236 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) * PetscINCREF(viewer.obj) # <<<<<<<<<<<<<< * return viewer * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); /* "PETSc/Viewer.pyx":237 * viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm) * PetscINCREF(viewer.obj) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_viewer)); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "PETSc/Viewer.pyx":232 * * @classmethod * def STDOUT(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDOUT", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":240 * * @classmethod * def STDERR(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35STDERR(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_34STDERR[] = "Viewer.STDERR(type cls, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35STDERR(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("STDERR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "STDERR") < 0)) __PYX_ERR(29, 240, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("STDERR", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 240, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDERR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_34STDERR(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34STDERR(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("STDERR", 0); /* "PETSc/Viewer.pyx":241 * @classmethod * def STDERR(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 241, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":242 * def STDERR(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) * PetscINCREF(viewer.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":243 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) # <<<<<<<<<<<<<< * PetscINCREF(viewer.obj) * return viewer */ __pyx_t_3 = PETSC_VIEWER_STDERR_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(29, 243, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "PETSc/Viewer.pyx":244 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) * PetscINCREF(viewer.obj) # <<<<<<<<<<<<<< * return viewer * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); /* "PETSc/Viewer.pyx":245 * viewer.vwr = PETSC_VIEWER_STDERR_(ccomm) * PetscINCREF(viewer.obj) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_viewer)); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "PETSc/Viewer.pyx":240 * * @classmethod * def STDERR(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.STDERR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":248 * * @classmethod * def ASCII(cls, name, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_37ASCII(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_36ASCII[] = "Viewer.ASCII(type cls, name, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_37ASCII(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ASCII (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ASCII") < 0)) __PYX_ERR(29, 248, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ASCII", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 248, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.ASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_36ASCII(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36ASCII(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ASCII", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":249 * @classmethod * def ASCII(cls, name, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 249, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":250 * def ASCII(cls, name, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef Viewer viewer = Viewer() */ __pyx_v_cname = NULL; /* "PETSc/Viewer.pyx":251 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":252 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) * return viewer */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":253 * name = str2bytes(name, &cname) * cdef Viewer viewer = Viewer() * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) # <<<<<<<<<<<<<< * return viewer * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIOpen(__pyx_v_ccomm, __pyx_v_cname, (&__pyx_v_viewer->vwr))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(29, 253, __pyx_L1_error) /* "PETSc/Viewer.pyx":254 * cdef Viewer viewer = Viewer() * CHKERR( PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr) ) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_viewer)); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "PETSc/Viewer.pyx":248 * * @classmethod * def ASCII(cls, name, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.ASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":257 * * @classmethod * def BINARY(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39BINARY(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_38BINARY[] = "Viewer.BINARY(type cls, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39BINARY(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("BINARY (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "BINARY") < 0)) __PYX_ERR(29, 257, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("BINARY", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 257, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.BINARY", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_38BINARY(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38BINARY(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("BINARY", 0); /* "PETSc/Viewer.pyx":258 * @classmethod * def BINARY(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 258, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":259 * def BINARY(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) * PetscINCREF(viewer.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":260 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) # <<<<<<<<<<<<<< * PetscINCREF(viewer.obj) * return viewer */ __pyx_t_3 = PETSC_VIEWER_BINARY_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(29, 260, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "PETSc/Viewer.pyx":261 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) * PetscINCREF(viewer.obj) # <<<<<<<<<<<<<< * return viewer * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); /* "PETSc/Viewer.pyx":262 * viewer.vwr = PETSC_VIEWER_BINARY_(ccomm) * PetscINCREF(viewer.obj) * return viewer # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_viewer)); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "PETSc/Viewer.pyx":257 * * @classmethod * def BINARY(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.BINARY", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":265 * * @classmethod * def DRAW(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_41DRAW(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_40DRAW[] = "Viewer.DRAW(type cls, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_41DRAW(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("DRAW (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "DRAW") < 0)) __PYX_ERR(29, 265, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("DRAW", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 265, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.DRAW", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_40DRAW(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40DRAW(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscViewer __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("DRAW", 0); /* "PETSc/Viewer.pyx":266 * @classmethod * def DRAW(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 266, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":267 * def DRAW(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() # <<<<<<<<<<<<<< * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) * PetscINCREF(viewer.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":268 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) # <<<<<<<<<<<<<< * PetscINCREF(viewer.obj) * return viewer */ __pyx_t_3 = PETSC_VIEWER_DRAW_(__pyx_v_ccomm); if (unlikely(__pyx_t_3 == ((PetscViewer)NULL) && PyErr_Occurred())) __PYX_ERR(29, 268, __pyx_L1_error) __pyx_v_viewer->vwr = __pyx_t_3; /* "PETSc/Viewer.pyx":269 * cdef Viewer viewer = Viewer() * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) * PetscINCREF(viewer.obj) # <<<<<<<<<<<<<< * return viewer * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); /* "PETSc/Viewer.pyx":270 * viewer.vwr = PETSC_VIEWER_DRAW_(ccomm) * PetscINCREF(viewer.obj) * return viewer # <<<<<<<<<<<<<< * * # --- ASCII viewers --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_viewer)); __pyx_r = ((PyObject *)__pyx_v_viewer); goto __pyx_L0; /* "PETSc/Viewer.pyx":265 * * @classmethod * def DRAW(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.DRAW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_viewer); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":274 * # --- ASCII viewers --- * * def setASCIITab(self, tabs): # <<<<<<<<<<<<<< * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_43setASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_42setASCIITab[] = "Viewer.setASCIITab(self, tabs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_43setASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tabs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASCIITab (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tabs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASCIITab") < 0)) __PYX_ERR(29, 274, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tabs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASCIITab", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 274, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_42setASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42setASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) { PetscInt __pyx_v_ctabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASCIITab", 0); /* "PETSc/Viewer.pyx":275 * * def setASCIITab(self, tabs): * cdef PetscInt ctabs = asInt(tabs) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tabs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(29, 275, __pyx_L1_error) __pyx_v_ctabs = __pyx_t_1; /* "PETSc/Viewer.pyx":276 * def setASCIITab(self, tabs): * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<< * * def getASCIITab(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIISetTab(__pyx_v_self->vwr, __pyx_v_ctabs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 276, __pyx_L1_error) /* "PETSc/Viewer.pyx":274 * # --- ASCII viewers --- * * def setASCIITab(self, tabs): # <<<<<<<<<<<<<< * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":278 * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) * * def getASCIITab(self): # <<<<<<<<<<<<<< * cdef PetscInt tabs = 0 * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_45getASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_44getASCIITab[] = "Viewer.getASCIITab(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_45getASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getASCIITab (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getASCIITab", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getASCIITab", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_44getASCIITab(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44getASCIITab(struct PyPetscViewerObject *__pyx_v_self) { PetscInt __pyx_v_tabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getASCIITab", 0); /* "PETSc/Viewer.pyx":279 * * def getASCIITab(self): * cdef PetscInt tabs = 0 # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) * return toInt(tabs) */ __pyx_v_tabs = 0; /* "PETSc/Viewer.pyx":280 * def getASCIITab(self): * cdef PetscInt tabs = 0 * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) # <<<<<<<<<<<<<< * return toInt(tabs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIGetTab(__pyx_v_self->vwr, (&__pyx_v_tabs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 280, __pyx_L1_error) /* "PETSc/Viewer.pyx":281 * cdef PetscInt tabs = 0 * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) * return toInt(tabs) # <<<<<<<<<<<<<< * * def addASCIITab(self, tabs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tabs); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Viewer.pyx":278 * CHKERR( PetscViewerASCIISetTab(self.vwr, ctabs) ) * * def getASCIITab(self): # <<<<<<<<<<<<<< * cdef PetscInt tabs = 0 * CHKERR( PetscViewerASCIIGetTab(self.vwr, &tabs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":283 * return toInt(tabs) * * def addASCIITab(self, tabs): # <<<<<<<<<<<<<< * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_47addASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_46addASCIITab[] = "Viewer.addASCIITab(self, tabs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_47addASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tabs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addASCIITab (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tabs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addASCIITab") < 0)) __PYX_ERR(29, 283, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tabs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addASCIITab", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 283, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.addASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_46addASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46addASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) { PetscInt __pyx_v_ctabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addASCIITab", 0); /* "PETSc/Viewer.pyx":284 * * def addASCIITab(self, tabs): * cdef PetscInt ctabs = asInt(tabs) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tabs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(29, 284, __pyx_L1_error) __pyx_v_ctabs = __pyx_t_1; /* "PETSc/Viewer.pyx":285 * def addASCIITab(self, tabs): * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<< * * def subtractASCIITab(self, tabs): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIAddTab(__pyx_v_self->vwr, __pyx_v_ctabs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 285, __pyx_L1_error) /* "PETSc/Viewer.pyx":283 * return toInt(tabs) * * def addASCIITab(self, tabs): # <<<<<<<<<<<<<< * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.addASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":287 * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) * * def subtractASCIITab(self, tabs): # <<<<<<<<<<<<<< * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_49subtractASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_48subtractASCIITab[] = "Viewer.subtractASCIITab(self, tabs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_49subtractASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tabs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("subtractASCIITab (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tabs,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tabs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subtractASCIITab") < 0)) __PYX_ERR(29, 287, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tabs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("subtractASCIITab", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 287, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.subtractASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_48subtractASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48subtractASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs) { PetscInt __pyx_v_ctabs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("subtractASCIITab", 0); /* "PETSc/Viewer.pyx":288 * * def subtractASCIITab(self, tabs): * cdef PetscInt ctabs = asInt(tabs) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_tabs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(29, 288, __pyx_L1_error) __pyx_v_ctabs = __pyx_t_1; /* "PETSc/Viewer.pyx":289 * def subtractASCIITab(self, tabs): * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) # <<<<<<<<<<<<<< * * def pushASCIISynchronized(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIISubtractTab(__pyx_v_self->vwr, __pyx_v_ctabs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 289, __pyx_L1_error) /* "PETSc/Viewer.pyx":287 * CHKERR( PetscViewerASCIIAddTab(self.vwr, ctabs) ) * * def subtractASCIITab(self, tabs): # <<<<<<<<<<<<<< * cdef PetscInt ctabs = asInt(tabs) * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.subtractASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":291 * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) * * def pushASCIISynchronized(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51pushASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_50pushASCIISynchronized[] = "Viewer.pushASCIISynchronized(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51pushASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushASCIISynchronized (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("pushASCIISynchronized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushASCIISynchronized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_50pushASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50pushASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushASCIISynchronized", 0); /* "PETSc/Viewer.pyx":292 * * def pushASCIISynchronized(self): * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) # <<<<<<<<<<<<<< * * def popASCIISynchronized(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPushSynchronized(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 292, __pyx_L1_error) /* "PETSc/Viewer.pyx":291 * CHKERR( PetscViewerASCIISubtractTab(self.vwr, ctabs) ) * * def pushASCIISynchronized(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":294 * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) * * def popASCIISynchronized(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53popASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_52popASCIISynchronized[] = "Viewer.popASCIISynchronized(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53popASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popASCIISynchronized (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("popASCIISynchronized", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popASCIISynchronized", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_52popASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52popASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popASCIISynchronized", 0); /* "PETSc/Viewer.pyx":295 * * def popASCIISynchronized(self): * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) # <<<<<<<<<<<<<< * * def pushASCIITab(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPopSynchronized(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 295, __pyx_L1_error) /* "PETSc/Viewer.pyx":294 * CHKERR( PetscViewerASCIIPushSynchronized(self.vwr) ) * * def popASCIISynchronized(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.popASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":297 * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) * * def pushASCIITab(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_54pushASCIITab[] = "Viewer.pushASCIITab(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushASCIITab (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("pushASCIITab", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "pushASCIITab", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIITab(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54pushASCIITab(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushASCIITab", 0); /* "PETSc/Viewer.pyx":298 * * def pushASCIITab(self): * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) # <<<<<<<<<<<<<< * * def popASCIITab(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPushTab(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 298, __pyx_L1_error) /* "PETSc/Viewer.pyx":297 * CHKERR( PetscViewerASCIIPopSynchronized(self.vwr) ) * * def pushASCIITab(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.pushASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":300 * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) * * def popASCIITab(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_56popASCIITab[] = "Viewer.popASCIITab(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIITab(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popASCIITab (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("popASCIITab", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popASCIITab", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIITab(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56popASCIITab(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popASCIITab", 0); /* "PETSc/Viewer.pyx":301 * * def popASCIITab(self): * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) # <<<<<<<<<<<<<< * * def useASCIITabs(self, flag): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPopTab(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 301, __pyx_L1_error) /* "PETSc/Viewer.pyx":300 * CHKERR( PetscViewerASCIIPushTab(self.vwr) ) * * def popASCIITab(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.popASCIITab", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":303 * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) * * def useASCIITabs(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool flg = flag * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59useASCIITabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_58useASCIITabs[] = "Viewer.useASCIITabs(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59useASCIITabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("useASCIITabs (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "useASCIITabs") < 0)) __PYX_ERR(29, 303, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("useASCIITabs", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 303, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.useASCIITabs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_58useASCIITabs(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58useASCIITabs(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_flg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("useASCIITabs", 0); /* "PETSc/Viewer.pyx":304 * * def useASCIITabs(self, flag): * cdef PetscBool flg = flag # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 304, __pyx_L1_error) __pyx_v_flg = __pyx_t_1; /* "PETSc/Viewer.pyx":305 * def useASCIITabs(self, flag): * cdef PetscBool flg = flag * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) # <<<<<<<<<<<<<< * * def printfASCII(self, msg): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIUseTabs(__pyx_v_self->vwr, __pyx_v_flg)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 305, __pyx_L1_error) /* "PETSc/Viewer.pyx":303 * CHKERR( PetscViewerASCIIPopTab(self.vwr) ) * * def useASCIITabs(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool flg = flag * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.useASCIITabs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":307 * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) * * def printfASCII(self, msg): # <<<<<<<<<<<<<< * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61printfASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_60printfASCII[] = "Viewer.printfASCII(self, msg)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61printfASCII(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("printfASCII (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msg,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "printfASCII") < 0)) __PYX_ERR(29, 307, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_msg = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("printfASCII", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 307, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_60printfASCII(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60printfASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg) { char const *__pyx_v_cmsg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("printfASCII", 0); __Pyx_INCREF(__pyx_v_msg); /* "PETSc/Viewer.pyx":308 * * def printfASCII(self, msg): * cdef const char *cmsg = NULL # <<<<<<<<<<<<<< * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIIPrintf(self.vwr, cmsg) ) */ __pyx_v_cmsg = NULL; /* "PETSc/Viewer.pyx":309 * def printfASCII(self, msg): * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIIPrintf(self.vwr, cmsg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_msg, (&__pyx_v_cmsg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":310 * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIIPrintf(self.vwr, cmsg) ) # <<<<<<<<<<<<<< * * def printfASCIISynchronized(self, msg): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIPrintf(__pyx_v_self->vwr, __pyx_v_cmsg)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 310, __pyx_L1_error) /* "PETSc/Viewer.pyx":307 * CHKERR( PetscViewerASCIIUseTabs(self.vwr, flg) ) * * def printfASCII(self, msg): # <<<<<<<<<<<<<< * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCII", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":312 * CHKERR( PetscViewerASCIIPrintf(self.vwr, cmsg) ) * * def printfASCIISynchronized(self, msg): # <<<<<<<<<<<<<< * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63printfASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_62printfASCIISynchronized[] = "Viewer.printfASCIISynchronized(self, msg)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63printfASCIISynchronized(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_msg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("printfASCIISynchronized (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_msg,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "printfASCIISynchronized") < 0)) __PYX_ERR(29, 312, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_msg = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("printfASCIISynchronized", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 312, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_62printfASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62printfASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg) { char const *__pyx_v_cmsg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("printfASCIISynchronized", 0); __Pyx_INCREF(__pyx_v_msg); /* "PETSc/Viewer.pyx":313 * * def printfASCIISynchronized(self, msg): * cdef const char *cmsg = NULL # <<<<<<<<<<<<<< * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, cmsg) ) */ __pyx_v_cmsg = NULL; /* "PETSc/Viewer.pyx":314 * def printfASCIISynchronized(self, msg): * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) # <<<<<<<<<<<<<< * CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, cmsg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_msg, (&__pyx_v_cmsg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":315 * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) * CHKERR( PetscViewerASCIISynchronizedPrintf(self.vwr, cmsg) ) # <<<<<<<<<<<<<< * * # --- methods specific to file viewers --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIISynchronizedPrintf(__pyx_v_self->vwr, __pyx_v_cmsg)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 315, __pyx_L1_error) /* "PETSc/Viewer.pyx":312 * CHKERR( PetscViewerASCIIPrintf(self.vwr, cmsg) ) * * def printfASCIISynchronized(self, msg): # <<<<<<<<<<<<<< * cdef const char *cmsg = NULL * msg = str2bytes(msg, &cmsg) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.printfASCIISynchronized", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_msg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":319 * # --- methods specific to file viewers --- * * def flush(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerFlush(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_65flush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_64flush[] = "Viewer.flush(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_65flush(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flush (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("flush", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flush", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_64flush(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64flush(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flush", 0); /* "PETSc/Viewer.pyx":320 * * def flush(self): * CHKERR( PetscViewerFlush(self.vwr) ) # <<<<<<<<<<<<<< * * def setFileMode(self, mode): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFlush(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 320, __pyx_L1_error) /* "PETSc/Viewer.pyx":319 * # --- methods specific to file viewers --- * * def flush(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerFlush(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.flush", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":322 * CHKERR( PetscViewerFlush(self.vwr) ) * * def setFileMode(self, mode): # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_67setFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_66setFileMode[] = "Viewer.setFileMode(self, mode)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_67setFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFileMode (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFileMode") < 0)) __PYX_ERR(29, 322, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mode = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFileMode", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 322, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_66setFileMode(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66setFileMode(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscFileMode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFileMode", 0); /* "PETSc/Viewer.pyx":323 * * def setFileMode(self, mode): * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) # <<<<<<<<<<<<<< * * def getFileMode(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_1 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(29, 323, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->vwr, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 323, __pyx_L1_error) /* "PETSc/Viewer.pyx":322 * CHKERR( PetscViewerFlush(self.vwr) ) * * def setFileMode(self, mode): # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":325 * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) * * def getFileMode(self): # <<<<<<<<<<<<<< * cdef PetscFileMode mode = PETSC_FILE_MODE_READ * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69getFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_68getFileMode[] = "Viewer.getFileMode(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69getFileMode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFileMode (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFileMode", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFileMode", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_68getFileMode(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68getFileMode(struct PyPetscViewerObject *__pyx_v_self) { PetscFileMode __pyx_v_mode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFileMode", 0); /* "PETSc/Viewer.pyx":326 * * def getFileMode(self): * cdef PetscFileMode mode = PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) * return mode */ __pyx_v_mode = FILE_MODE_READ; /* "PETSc/Viewer.pyx":327 * def getFileMode(self): * cdef PetscFileMode mode = PETSC_FILE_MODE_READ * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) # <<<<<<<<<<<<<< * return mode * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileGetMode(__pyx_v_self->vwr, (&__pyx_v_mode))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 327, __pyx_L1_error) /* "PETSc/Viewer.pyx":328 * cdef PetscFileMode mode = PETSC_FILE_MODE_READ * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) * return mode # <<<<<<<<<<<<<< * * def setFileName(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscFileMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Viewer.pyx":325 * CHKERR( PetscViewerFileSetMode(self.vwr, filemode(mode)) ) * * def getFileMode(self): # <<<<<<<<<<<<<< * cdef PetscFileMode mode = PETSC_FILE_MODE_READ * CHKERR( PetscViewerFileGetMode(self.vwr, &mode) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getFileMode", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":330 * return mode * * def setFileName(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_70setFileName[] = "Viewer.setFileName(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFileName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFileName") < 0)) __PYX_ERR(29, 330, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFileName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 330, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileName(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70setFileName(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFileName", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":331 * * def setFileName(self, name): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Viewer.pyx":332 * def setFileName(self, name): * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":333 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) # <<<<<<<<<<<<<< * * def getFileName(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->vwr, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 333, __pyx_L1_error) /* "PETSc/Viewer.pyx":330 * return mode * * def setFileName(self, name): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setFileName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":335 * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) * * def getFileName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_72getFileName[] = "Viewer.getFileName(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFileName (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFileName", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFileName", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileName(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72getFileName(struct PyPetscViewerObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFileName", 0); /* "PETSc/Viewer.pyx":336 * * def getFileName(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Viewer.pyx":337 * def getFileName(self): * cdef const char *cval = NULL * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileGetName(__pyx_v_self->vwr, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 337, __pyx_L1_error) /* "PETSc/Viewer.pyx":338 * cdef const char *cval = NULL * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # --- methods specific to draw viewers --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Viewer.pyx":335 * CHKERR( PetscViewerFileSetName(self.vwr, cval) ) * * def getFileName(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PetscViewerFileGetName(self.vwr, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getFileName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":342 * # --- methods specific to draw viewers --- * * def setDrawInfo(self, display=None, title=None, position=None, size=None): # <<<<<<<<<<<<<< * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setDrawInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_74setDrawInfo[] = "Viewer.setDrawInfo(self, display=None, title=None, position=None, size=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setDrawInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_display = 0; PyObject *__pyx_v_title = 0; PyObject *__pyx_v_position = 0; PyObject *__pyx_v_size = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDrawInfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_display,&__pyx_n_s_title,&__pyx_n_s_position,&__pyx_n_s_size,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_display); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDrawInfo") < 0)) __PYX_ERR(29, 342, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_display = values[0]; __pyx_v_title = values[1]; __pyx_v_position = values[2]; __pyx_v_size = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDrawInfo", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 342, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_74setDrawInfo(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_display, __pyx_v_title, __pyx_v_position, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setDrawInfo(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_display, PyObject *__pyx_v_title, PyObject *__pyx_v_position, PyObject *__pyx_v_size) { char const *__pyx_v_cdisplay; char const *__pyx_v_ctitle; int __pyx_v_x; int __pyx_v_y; int __pyx_v_h; int __pyx_v_w; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); int __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDrawInfo", 0); __Pyx_INCREF(__pyx_v_display); __Pyx_INCREF(__pyx_v_title); /* "PETSc/Viewer.pyx":343 * * def setDrawInfo(self, display=None, title=None, position=None, size=None): * cdef const char *cdisplay = NULL # <<<<<<<<<<<<<< * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) */ __pyx_v_cdisplay = NULL; /* "PETSc/Viewer.pyx":344 * def setDrawInfo(self, display=None, title=None, position=None, size=None): * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL # <<<<<<<<<<<<<< * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) */ __pyx_v_ctitle = NULL; /* "PETSc/Viewer.pyx":345 * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) # <<<<<<<<<<<<<< * title = str2bytes(title, &ctitle) * cdef int x, y, h, w */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_display, (&__pyx_v_cdisplay)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_display, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":346 * cdef const char *ctitle = NULL * display = str2bytes(display, &cdisplay) * title = str2bytes(title, &ctitle) # <<<<<<<<<<<<<< * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_title, (&__pyx_v_ctitle)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":348 * title = str2bytes(title, &ctitle) * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE # <<<<<<<<<<<<<< * if position not in (None, PETSC_DECIDE): * x, y = position */ __pyx_v_x = PETSC_DECIDE; __pyx_v_y = PETSC_DECIDE; __pyx_v_h = PETSC_DECIDE; __pyx_v_w = PETSC_DECIDE; /* "PETSc/Viewer.pyx":349 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ __Pyx_INCREF(__pyx_v_position); __pyx_t_1 = __pyx_v_position; __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 349, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(29, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(29, 349, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { /* "PETSc/Viewer.pyx":350 * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): * x, y = position # <<<<<<<<<<<<<< * if size not in (None, PETSC_DECIDE): * try: */ if ((likely(PyTuple_CheckExact(__pyx_v_position))) || (PyList_CheckExact(__pyx_v_position))) { PyObject* sequence = __pyx_v_position; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 350, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_position); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) __PYX_ERR(29, 350, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 350, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_x = __pyx_t_7; __pyx_v_y = __pyx_t_8; /* "PETSc/Viewer.pyx":349 * cdef int x, y, h, w * x = y = h = w = PETSC_DECIDE * if position not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * x, y = position * if size not in (None, PETSC_DECIDE): */ } /* "PETSc/Viewer.pyx":351 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ __Pyx_INCREF(__pyx_v_size); __pyx_t_5 = __pyx_v_size; __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 351, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(29, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { } else { __pyx_t_4 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(29, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_2; __pyx_L9_bool_binop_done:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = (__pyx_t_4 != 0); if (__pyx_t_2) { /* "PETSc/Viewer.pyx":352 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { /* "PETSc/Viewer.pyx":353 * if size not in (None, PETSC_DECIDE): * try: * w, h = size # <<<<<<<<<<<<<< * except TypeError: * w = h = size */ if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) { PyObject* sequence = __pyx_v_size; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(29, 353, __pyx_L11_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_5 = PyList_GET_ITEM(sequence, 0); __pyx_t_3 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); #else __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 353, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 353, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 353, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; index = 0; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) __PYX_ERR(29, 353, __pyx_L11_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L18_unpacking_done; __pyx_L17_unpacking_failed:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(29, 353, __pyx_L11_error) __pyx_L18_unpacking_done:; } __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 353, __pyx_L11_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 353, __pyx_L11_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_w = __pyx_t_8; __pyx_v_h = __pyx_t_7; /* "PETSc/Viewer.pyx":352 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L16_try_end; __pyx_L11_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Viewer.pyx":354 * try: * w, h = size * except TypeError: # <<<<<<<<<<<<<< * w = h = size * CHKERR( PetscViewerDrawSetInfo(self.vwr, */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_7) { __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(29, 354, __pyx_L13_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Viewer.pyx":355 * w, h = size * except TypeError: * w = h = size # <<<<<<<<<<<<<< * CHKERR( PetscViewerDrawSetInfo(self.vwr, * cdisplay, ctitle, */ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(29, 355, __pyx_L13_except_error) __pyx_v_w = __pyx_t_7; __pyx_v_h = __pyx_t_7; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L12_exception_handled; } goto __pyx_L13_except_error; __pyx_L13_except_error:; /* "PETSc/Viewer.pyx":352 * x, y = position * if size not in (None, PETSC_DECIDE): * try: # <<<<<<<<<<<<<< * w, h = size * except TypeError: */ __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); goto __pyx_L1_error; __pyx_L12_exception_handled:; __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_L16_try_end:; } /* "PETSc/Viewer.pyx":351 * if position not in (None, PETSC_DECIDE): * x, y = position * if size not in (None, PETSC_DECIDE): # <<<<<<<<<<<<<< * try: * w, h = size */ } /* "PETSc/Viewer.pyx":356 * except TypeError: * w = h = size * CHKERR( PetscViewerDrawSetInfo(self.vwr, # <<<<<<<<<<<<<< * cdisplay, ctitle, * x, y, w, h) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDrawSetInfo(__pyx_v_self->vwr, __pyx_v_cdisplay, __pyx_v_ctitle, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(29, 356, __pyx_L1_error) /* "PETSc/Viewer.pyx":342 * # --- methods specific to draw viewers --- * * def setDrawInfo(self, display=None, title=None, position=None, size=None): # <<<<<<<<<<<<<< * cdef const char *cdisplay = NULL * cdef const char *ctitle = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setDrawInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_display); __Pyx_XDECREF(__pyx_v_title); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":360 * x, y, w, h) ) * * def clearDraw(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerDrawClear(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77clearDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Viewer_76clearDraw[] = "Viewer.clearDraw(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77clearDraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearDraw (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("clearDraw", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDraw", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_76clearDraw(((struct PyPetscViewerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76clearDraw(struct PyPetscViewerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearDraw", 0); /* "PETSc/Viewer.pyx":361 * * def clearDraw(self): * CHKERR( PetscViewerDrawClear(self.vwr) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerDrawClear(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 361, __pyx_L1_error) /* "PETSc/Viewer.pyx":360 * x, y, w, h) ) * * def clearDraw(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerDrawClear(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Viewer.clearDraw", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":367 * cdef class ViewerHDF5(Viewer): * * def create(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_create[] = "ViewerHDF5.create(self, name, mode=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_mode = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_mode,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(29, 367, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_mode = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 367, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self), __pyx_v_name, __pyx_v_mode, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_create(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_mode, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; char const *__pyx_v_cname; PetscFileMode __pyx_v_cmode; PetscViewer __pyx_v_newvwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscFileMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/Viewer.pyx":368 * * def create(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(29, 368, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Viewer.pyx":369 * def create(self, name, mode=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) */ __pyx_v_cname = NULL; /* "PETSc/Viewer.pyx":370 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Viewer.pyx":371 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) # <<<<<<<<<<<<<< * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_filemode(__pyx_v_mode); if (unlikely(__pyx_t_3 == ((PetscFileMode)((PetscFileMode)-1L)))) __PYX_ERR(29, 371, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; /* "PETSc/Viewer.pyx":372 * name = str2bytes(name, &cname) * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr */ __pyx_v_newvwr = NULL; /* "PETSc/Viewer.pyx":373 * cdef PetscFileMode cmode = filemode(mode) * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerCreate(__pyx_v_ccomm, (&__pyx_v_newvwr))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 373, __pyx_L1_error) /* "PETSc/Viewer.pyx":374 * cdef PetscViewer newvwr = NULL * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr # <<<<<<<<<<<<<< * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.vwr = __pyx_v_newvwr; /* "PETSc/Viewer.pyx":375 * CHKERR( PetscViewerCreate(ccomm, &newvwr) ) * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->__pyx_base.vwr, PETSCVIEWERHDF5)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 375, __pyx_L1_error) /* "PETSc/Viewer.pyx":376 * PetscCLEAR(self.obj); self.vwr = newvwr * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) # <<<<<<<<<<<<<< * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetMode(__pyx_v_self->__pyx_base.vwr, __pyx_v_cmode)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 376, __pyx_L1_error) /* "PETSc/Viewer.pyx":377 * CHKERR( PetscViewerSetType(self.vwr, PETSCVIEWERHDF5) ) * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileSetName(__pyx_v_self->__pyx_base.vwr, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(29, 377, __pyx_L1_error) /* "PETSc/Viewer.pyx":378 * CHKERR( PetscViewerFileSetMode(self.vwr, cmode) ) * CHKERR( PetscViewerFileSetName(self.vwr, cname) ) * return self # <<<<<<<<<<<<<< * * def getTimestep(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Viewer.pyx":367 * cdef class ViewerHDF5(Viewer): * * def create(self, name, mode=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":380 * return self * * def getTimestep(self): # <<<<<<<<<<<<<< * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3getTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_2getTimestep[] = "ViewerHDF5.getTimestep(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3getTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTimestep (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTimestep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTimestep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2getTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_2getTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PetscInt __pyx_v_ctimestep; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTimestep", 0); /* "PETSc/Viewer.pyx":381 * * def getTimestep(self): * cdef PetscInt ctimestep = 0 # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) * return toInt(ctimestep) */ __pyx_v_ctimestep = 0; /* "PETSc/Viewer.pyx":382 * def getTimestep(self): * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) # <<<<<<<<<<<<<< * return toInt(ctimestep) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5GetTimestep(__pyx_v_self->__pyx_base.vwr, (&__pyx_v_ctimestep))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 382, __pyx_L1_error) /* "PETSc/Viewer.pyx":383 * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) * return toInt(ctimestep) # <<<<<<<<<<<<<< * * def setTimestep(self, timestep): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ctimestep); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Viewer.pyx":380 * return self * * def getTimestep(self): # <<<<<<<<<<<<<< * cdef PetscInt ctimestep = 0 * CHKERR( PetscViewerHDF5GetTimestep(self.vwr, &ctimestep) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.getTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":385 * return toInt(ctimestep) * * def setTimestep(self, timestep): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5setTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_4setTimestep[] = "ViewerHDF5.setTimestep(self, timestep)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5setTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_timestep = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTimestep (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timestep,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timestep)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTimestep") < 0)) __PYX_ERR(29, 385, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_timestep = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTimestep", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 385, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.setTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4setTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self), __pyx_v_timestep); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_4setTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_timestep) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTimestep", 0); /* "PETSc/Viewer.pyx":386 * * def setTimestep(self, timestep): * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) # <<<<<<<<<<<<<< * * def incrementTimestep(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_timestep); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(29, 386, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5SetTimestep(__pyx_v_self->__pyx_base.vwr, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 386, __pyx_L1_error) /* "PETSc/Viewer.pyx":385 * return toInt(ctimestep) * * def setTimestep(self, timestep): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.setTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":388 * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * * def incrementTimestep(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7incrementTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_6incrementTimestep[] = "ViewerHDF5.incrementTimestep(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7incrementTimestep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("incrementTimestep (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("incrementTimestep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "incrementTimestep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6incrementTimestep(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_6incrementTimestep(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("incrementTimestep", 0); /* "PETSc/Viewer.pyx":389 * * def incrementTimestep(self): * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) # <<<<<<<<<<<<<< * * def pushGroup(self, group): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5IncrementTimestep(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 389, __pyx_L1_error) /* "PETSc/Viewer.pyx":388 * CHKERR( PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)) ) * * def incrementTimestep(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.incrementTimestep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":391 * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * * def pushGroup(self, group): # <<<<<<<<<<<<<< * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9pushGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_8pushGroup[] = "ViewerHDF5.pushGroup(self, group)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9pushGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_group = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushGroup (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_group,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_group)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pushGroup") < 0)) __PYX_ERR(29, 391, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_group = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pushGroup", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(29, 391, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.pushGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_8pushGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self), __pyx_v_group); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_8pushGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self, PyObject *__pyx_v_group) { char const *__pyx_v_cgroup; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pushGroup", 0); __Pyx_INCREF(__pyx_v_group); /* "PETSc/Viewer.pyx":392 * * def pushGroup(self, group): * cdef const char *cgroup = NULL # <<<<<<<<<<<<<< * group = str2bytes(group, &cgroup) * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) */ __pyx_v_cgroup = NULL; /* "PETSc/Viewer.pyx":393 * def pushGroup(self, group): * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_group, (&__pyx_v_cgroup)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_group, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":394 * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) # <<<<<<<<<<<<<< * * def popGroup(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PushGroup(__pyx_v_self->__pyx_base.vwr, __pyx_v_cgroup)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(29, 394, __pyx_L1_error) /* "PETSc/Viewer.pyx":391 * CHKERR( PetscViewerHDF5IncrementTimestep(self.vwr) ) * * def pushGroup(self, group): # <<<<<<<<<<<<<< * cdef const char *cgroup = NULL * group = str2bytes(group, &cgroup) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.pushGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_group); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":396 * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) * * def popGroup(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11popGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_10popGroup[] = "ViewerHDF5.popGroup(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11popGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popGroup (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("popGroup", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "popGroup", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10popGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_10popGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("popGroup", 0); /* "PETSc/Viewer.pyx":397 * * def popGroup(self): * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) # <<<<<<<<<<<<<< * * def getGroup(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5PopGroup(__pyx_v_self->__pyx_base.vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 397, __pyx_L1_error) /* "PETSc/Viewer.pyx":396 * CHKERR( PetscViewerHDF5PushGroup(self.vwr, cgroup) ) * * def popGroup(self): # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.popGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Viewer.pyx":399 * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * * def getGroup(self): # <<<<<<<<<<<<<< * cdef const char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, &cgroup) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13getGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_12getGroup[] = "ViewerHDF5.getGroup(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13getGroup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGroup (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGroup", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGroup", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_12getGroup(((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_10ViewerHDF5_12getGroup(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *__pyx_v_self) { char const *__pyx_v_cgroup; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGroup", 0); /* "PETSc/Viewer.pyx":400 * * def getGroup(self): * cdef const char *cgroup = NULL # <<<<<<<<<<<<<< * CHKERR( PetscViewerHDF5GetGroup(self.vwr, &cgroup) ) * return bytes2str(cgroup) */ __pyx_v_cgroup = NULL; /* "PETSc/Viewer.pyx":401 * def getGroup(self): * cdef const char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, &cgroup) ) # <<<<<<<<<<<<<< * return bytes2str(cgroup) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerHDF5GetGroup(__pyx_v_self->__pyx_base.vwr, (&__pyx_v_cgroup))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(29, 401, __pyx_L1_error) /* "PETSc/Viewer.pyx":402 * cdef const char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, &cgroup) ) * return bytes2str(cgroup) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cgroup); if (unlikely(!__pyx_t_2)) __PYX_ERR(29, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Viewer.pyx":399 * CHKERR( PetscViewerHDF5PopGroup(self.vwr) ) * * def getGroup(self): # <<<<<<<<<<<<<< * cdef const char *cgroup = NULL * CHKERR( PetscViewerHDF5GetGroup(self.vwr, &cgroup) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.ViewerHDF5.getGroup", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":16 * Type = RandomType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.rnd * self.rnd = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Random_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Random_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Random___cinit__(struct PyPetscRandomObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Random.pyx":17 * * def __cinit__(self): * self.obj = &self.rnd # <<<<<<<<<<<<<< * self.rnd = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->rnd)); /* "PETSc/Random.pyx":18 * def __cinit__(self): * self.obj = &self.rnd * self.rnd = NULL # <<<<<<<<<<<<<< * * def __call__(self): */ __pyx_v_self->rnd = NULL; /* "PETSc/Random.pyx":16 * Type = RandomType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.rnd * self.rnd = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":20 * self.rnd = NULL * * def __call__(self): # <<<<<<<<<<<<<< * return self.getValue() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_2__call__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_2__call__(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); /* "PETSc/Random.pyx":21 * * def __call__(self): * return self.getValue() # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":20 * self.rnd = NULL * * def __call__(self): # <<<<<<<<<<<<<< * return self.getValue() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":23 * return self.getValue() * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * assert self.obj != NULL * cdef PetscViewer vwr = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_4view[] = "Random.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(30, 23, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(30, 23, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(30, 23, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4view(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4view(struct PyPetscRandomObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Random.pyx":24 * * def view(self, Viewer viewer=None): * assert self.obj != NULL # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_self->__pyx_base.obj != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(30, 24, __pyx_L1_error) } } #endif /* "PETSc/Random.pyx":25 * def view(self, Viewer viewer=None): * assert self.obj != NULL * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscRandomView(self.rnd, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Random.pyx":26 * assert self.obj != NULL * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscRandomView(self.rnd, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Random.pyx":27 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscRandomView(self.rnd, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomView(__pyx_v_self->rnd, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(30, 27, __pyx_L1_error) /* "PETSc/Random.pyx":23 * return self.getValue() * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * assert self.obj != NULL * cdef PetscViewer vwr = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":29 * CHKERR( PetscRandomView(self.rnd, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscRandomDestroy(&self.rnd) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_6destroy[] = "Random.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_6destroy(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_6destroy(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Random.pyx":30 * * def destroy(self): * CHKERR( PetscRandomDestroy(&self.rnd) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomDestroy((&__pyx_v_self->rnd))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(30, 30, __pyx_L1_error) /* "PETSc/Random.pyx":31 * def destroy(self): * CHKERR( PetscRandomDestroy(&self.rnd) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Random.pyx":29 * CHKERR( PetscRandomView(self.rnd, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscRandomDestroy(&self.rnd) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":33 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_8create[] = "Random.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(30, 33, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(30, 33, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8create(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8create(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Random.pyx":34 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(30, 34, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Random.pyx":35 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomCreate(__pyx_v_ccomm, (&__pyx_v_self->rnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(30, 35, __pyx_L1_error) /* "PETSc/Random.pyx":36 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) * return self # <<<<<<<<<<<<<< * * def setType(self, rnd_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Random.pyx":33 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscRandomCreate(ccomm, &self.rnd) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":38 * return self * * def setType(self, rnd_type): # <<<<<<<<<<<<<< * cdef PetscRandomType cval = NULL * rnd_type = str2bytes(rnd_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_10setType[] = "Random.setType(self, rnd_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rnd_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnd_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnd_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(30, 38, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_rnd_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(30, 38, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_10setType(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_rnd_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_10setType(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_rnd_type) { PetscRandomType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_rnd_type); /* "PETSc/Random.pyx":39 * * def setType(self, rnd_type): * cdef PetscRandomType cval = NULL # <<<<<<<<<<<<<< * rnd_type = str2bytes(rnd_type, &cval) * CHKERR( PetscRandomSetType(self.rnd, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Random.pyx":40 * def setType(self, rnd_type): * cdef PetscRandomType cval = NULL * rnd_type = str2bytes(rnd_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetType(self.rnd, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_rnd_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_rnd_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Random.pyx":41 * cdef PetscRandomType cval = NULL * rnd_type = str2bytes(rnd_type, &cval) * CHKERR( PetscRandomSetType(self.rnd, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetType(__pyx_v_self->rnd, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(30, 41, __pyx_L1_error) /* "PETSc/Random.pyx":38 * return self * * def setType(self, rnd_type): # <<<<<<<<<<<<<< * cdef PetscRandomType cval = NULL * rnd_type = str2bytes(rnd_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Random.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rnd_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":43 * CHKERR( PetscRandomSetType(self.rnd, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscRandomType cval = NULL * CHKERR( PetscRandomGetType(self.rnd, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_12getType[] = "Random.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_12getType(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_12getType(struct PyPetscRandomObject *__pyx_v_self) { PetscRandomType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/Random.pyx":44 * * def getType(self): * cdef PetscRandomType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetType(self.rnd, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Random.pyx":45 * def getType(self): * cdef PetscRandomType cval = NULL * CHKERR( PetscRandomGetType(self.rnd, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetType(__pyx_v_self->rnd, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(30, 45, __pyx_L1_error) /* "PETSc/Random.pyx":46 * cdef PetscRandomType cval = NULL * CHKERR( PetscRandomGetType(self.rnd, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":43 * CHKERR( PetscRandomSetType(self.rnd, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscRandomType cval = NULL * CHKERR( PetscRandomGetType(self.rnd, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":48 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetFromOptions(self.rnd) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_14setFromOptions[] = "Random.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_14setFromOptions(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/Random.pyx":49 * * def setFromOptions(self): * CHKERR( PetscRandomSetFromOptions(self.rnd) ) # <<<<<<<<<<<<<< * * def getValue(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetFromOptions(__pyx_v_self->rnd)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(30, 49, __pyx_L1_error) /* "PETSc/Random.pyx":48 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetFromOptions(self.rnd) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":51 * CHKERR( PetscRandomSetFromOptions(self.rnd) ) * * def getValue(self): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_17getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_16getValue[] = "Random.getValue(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_17getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getValue", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValue", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_16getValue(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_16getValue(struct PyPetscRandomObject *__pyx_v_self) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 0); /* "PETSc/Random.pyx":52 * * def getValue(self): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Random.pyx":53 * def getValue(self): * cdef PetscScalar sval = 0 * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetValue(__pyx_v_self->rnd, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(30, 53, __pyx_L1_error) /* "PETSc/Random.pyx":54 * cdef PetscScalar sval = 0 * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def getValueReal(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":51 * CHKERR( PetscRandomSetFromOptions(self.rnd) ) * * def getValue(self): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( PetscRandomGetValue(self.rnd, &sval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":56 * return toScalar(sval) * * def getValueReal(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_18getValueReal[] = "Random.getValueReal(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValueReal (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getValueReal", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValueReal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_18getValueReal(struct PyPetscRandomObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValueReal", 0); /* "PETSc/Random.pyx":57 * * def getValueReal(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/Random.pyx":58 * def getValueReal(self): * cdef PetscReal rval = 0 * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetValueReal(__pyx_v_self->rnd, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(30, 58, __pyx_L1_error) /* "PETSc/Random.pyx":59 * cdef PetscReal rval = 0 * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getSeed(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":56 * return toScalar(sval) * * def getValueReal(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( PetscRandomGetValueReal(self.rnd, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getValueReal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":61 * return toReal(rval) * * def getSeed(self): # <<<<<<<<<<<<<< * cdef unsigned long seed = 0 * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_20getSeed[] = "Random.getSeed(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSeed (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSeed", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSeed", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_20getSeed(struct PyPetscRandomObject *__pyx_v_self) { unsigned long __pyx_v_seed; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSeed", 0); /* "PETSc/Random.pyx":62 * * def getSeed(self): * cdef unsigned long seed = 0 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) * return seed */ __pyx_v_seed = 0; /* "PETSc/Random.pyx":63 * def getSeed(self): * cdef unsigned long seed = 0 * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) # <<<<<<<<<<<<<< * return seed * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetSeed(__pyx_v_self->rnd, (&__pyx_v_seed))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(30, 63, __pyx_L1_error) /* "PETSc/Random.pyx":64 * cdef unsigned long seed = 0 * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) * return seed # <<<<<<<<<<<<<< * * def setSeed(self, seed=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_seed); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":61 * return toReal(rval) * * def getSeed(self): # <<<<<<<<<<<<<< * cdef unsigned long seed = 0 * CHKERR( PetscRandomGetSeed(self.rnd, &seed) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Random.getSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":66 * return seed * * def setSeed(self, seed=None): # <<<<<<<<<<<<<< * if seed is not None: * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_22setSeed[] = "Random.setSeed(self, seed=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seed = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSeed (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seed,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seed); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSeed") < 0)) __PYX_ERR(30, 66, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_seed = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSeed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(30, 66, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.setSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_22setSeed(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_seed); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_22setSeed(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_seed) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; unsigned long __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSeed", 0); /* "PETSc/Random.pyx":67 * * def setSeed(self, seed=None): * if seed is not None: # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) * CHKERR( PetscRandomSeed(self.rnd) ) */ __pyx_t_1 = (__pyx_v_seed != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Random.pyx":68 * def setSeed(self, seed=None): * if seed is not None: * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) # <<<<<<<<<<<<<< * CHKERR( PetscRandomSeed(self.rnd) ) * */ __pyx_t_3 = __Pyx_PyInt_As_unsigned_long(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(30, 68, __pyx_L1_error) __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetSeed(__pyx_v_self->rnd, __pyx_t_3)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(30, 68, __pyx_L1_error) /* "PETSc/Random.pyx":67 * * def setSeed(self, seed=None): * if seed is not None: # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) * CHKERR( PetscRandomSeed(self.rnd) ) */ } /* "PETSc/Random.pyx":69 * if seed is not None: * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) * CHKERR( PetscRandomSeed(self.rnd) ) # <<<<<<<<<<<<<< * * def getInterval(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSeed(__pyx_v_self->rnd)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(30, 69, __pyx_L1_error) /* "PETSc/Random.pyx":66 * return seed * * def setSeed(self, seed=None): # <<<<<<<<<<<<<< * if seed is not None: * CHKERR( PetscRandomSetSeed(self.rnd, seed) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.setSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":71 * CHKERR( PetscRandomSeed(self.rnd) ) * * def getInterval(self): # <<<<<<<<<<<<<< * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_24getInterval[] = "Random.getInterval(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInterval (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInterval", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInterval", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_24getInterval(struct PyPetscRandomObject *__pyx_v_self) { PetscScalar __pyx_v_sval1; PetscScalar __pyx_v_sval2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInterval", 0); /* "PETSc/Random.pyx":72 * * def getInterval(self): * cdef PetscScalar sval1 = 0 # <<<<<<<<<<<<<< * cdef PetscScalar sval2 = 1 * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) */ __pyx_v_sval1 = 0.0; /* "PETSc/Random.pyx":73 * def getInterval(self): * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 # <<<<<<<<<<<<<< * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) * return (toScalar(sval1), toScalar(sval2)) */ __pyx_v_sval2 = 1.0; /* "PETSc/Random.pyx":74 * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) # <<<<<<<<<<<<<< * return (toScalar(sval1), toScalar(sval2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomGetInterval(__pyx_v_self->rnd, (&__pyx_v_sval1), (&__pyx_v_sval2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(30, 74, __pyx_L1_error) /* "PETSc/Random.pyx":75 * cdef PetscScalar sval2 = 1 * CHKERR( PetscRandomGetInterval(self.rnd, &sval1, &sval2) ) * return (toScalar(sval1), toScalar(sval2)) # <<<<<<<<<<<<<< * * def setInterval(self, interval): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval1); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval2); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":71 * CHKERR( PetscRandomSeed(self.rnd) ) * * def getInterval(self): # <<<<<<<<<<<<<< * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Random.getInterval", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":77 * return (toScalar(sval1), toScalar(sval2)) * * def setInterval(self, interval): # <<<<<<<<<<<<<< * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6Random_26setInterval[] = "Random.setInterval(self, interval)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_interval = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInterval (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interval,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInterval") < 0)) __PYX_ERR(30, 77, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_interval = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInterval", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(30, 77, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Random.setInterval", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_26setInterval(((struct PyPetscRandomObject *)__pyx_v_self), __pyx_v_interval); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_26setInterval(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_interval) { PetscScalar __pyx_v_sval1; PetscScalar __pyx_v_sval2; PyObject *__pyx_v_low = NULL; PyObject *__pyx_v_high = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *(*__pyx_t_4)(PyObject *); PetscScalar __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInterval", 0); /* "PETSc/Random.pyx":78 * * def setInterval(self, interval): * cdef PetscScalar sval1 = 0 # <<<<<<<<<<<<<< * cdef PetscScalar sval2 = 1 * low, high = interval */ __pyx_v_sval1 = 0.0; /* "PETSc/Random.pyx":79 * def setInterval(self, interval): * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 # <<<<<<<<<<<<<< * low, high = interval * sval1 = asScalar(low) */ __pyx_v_sval2 = 1.0; /* "PETSc/Random.pyx":80 * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 * low, high = interval # <<<<<<<<<<<<<< * sval1 = asScalar(low) * sval2 = asScalar(high) */ if ((likely(PyTuple_CheckExact(__pyx_v_interval))) || (PyList_CheckExact(__pyx_v_interval))) { PyObject* sequence = __pyx_v_interval; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(30, 80, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); #else __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { Py_ssize_t index = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_interval); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(30, 80, __pyx_L1_error) __pyx_t_4 = NULL; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(30, 80, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_low = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_high = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Random.pyx":81 * cdef PetscScalar sval2 = 1 * low, high = interval * sval1 = asScalar(low) # <<<<<<<<<<<<<< * sval2 = asScalar(high) * CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_low); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(30, 81, __pyx_L1_error) __pyx_v_sval1 = __pyx_t_5; /* "PETSc/Random.pyx":82 * low, high = interval * sval1 = asScalar(low) * sval2 = asScalar(high) # <<<<<<<<<<<<<< * CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_high); if (unlikely(__pyx_t_5 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(30, 82, __pyx_L1_error) __pyx_v_sval2 = __pyx_t_5; /* "PETSc/Random.pyx":83 * sval1 = asScalar(low) * sval2 = asScalar(high) * CHKERR( PetscRandomSetInterval(self.rnd, sval1, sval2) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRandomSetInterval(__pyx_v_self->rnd, __pyx_v_sval1, __pyx_v_sval2)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(30, 83, __pyx_L1_error) /* "PETSc/Random.pyx":77 * return (toScalar(sval1), toScalar(sval2)) * * def setInterval(self, interval): # <<<<<<<<<<<<<< * cdef PetscScalar sval1 = 0 * cdef PetscScalar sval2 = 1 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.setInterval", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_low); __Pyx_XDECREF(__pyx_v_high); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":88 * * property seed: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSeed() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_4seed_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_4seed_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_4seed___get__(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Random.pyx":89 * property seed: * def __get__(self): * return self.getSeed() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setSeed(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":88 * * property seed: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSeed() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.seed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":90 * def __get__(self): * return self.getSeed() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSeed(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Random_4seed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Random_4seed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(((struct PyPetscRandomObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Random_4seed_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Random.pyx":91 * return self.getSeed() * def __set__(self, value): * self.setSeed(value) # <<<<<<<<<<<<<< * * property interval: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Random.pyx":90 * def __get__(self): * return self.getSeed() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSeed(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.seed.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":94 * * property interval: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInterval() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6Random_8interval_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(((struct PyPetscRandomObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6Random_8interval___get__(struct PyPetscRandomObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Random.pyx":95 * property interval: * def __get__(self): * return self.getInterval() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setInterval(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Random.pyx":94 * * property interval: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInterval() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Random.pyx":96 * def __get__(self): * return self.getInterval() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInterval(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_6Random_8interval_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_6Random_8interval_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(((struct PyPetscRandomObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_6Random_8interval_2__set__(struct PyPetscRandomObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Random.pyx":97 * return self.getInterval() * def __set__(self, value): * self.setInterval(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInterval); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Random.pyx":96 * def __get__(self): * return self.getInterval() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInterval(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Random.interval.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":16 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.iset * self.iset = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2IS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2IS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2IS___cinit__(struct PyPetscISObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/IS.pyx":17 * * def __cinit__(self): * self.obj = &self.iset # <<<<<<<<<<<<<< * self.iset = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->iset)); /* "PETSc/IS.pyx":18 * def __cinit__(self): * self.obj = &self.iset * self.iset = NULL # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_v_self->iset = NULL; /* "PETSc/IS.pyx":16 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.iset * self.iset = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":22 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * buf.acquirebuffer(view, flags) */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(((struct PyPetscISObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2IS_2__getbuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (__pyx_v_view == NULL) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "PETSc/IS.pyx":23 * * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<< * buf.acquirebuffer(view, flags) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":24 * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _IS_buffer buf = _IS_buffer(self) * buf.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->acquirebuffer(__pyx_v_buf, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 24, __pyx_L1_error) /* "PETSc/IS.pyx":22 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * buf.acquirebuffer(view, flags) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":26 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) */ /* Python wrapper */ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_2IS_4__releasebuffer__(((struct PyPetscISObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_2IS_4__releasebuffer__(struct PyPetscISObject *__pyx_v_self, Py_buffer *__pyx_v_view) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__releasebuffer__", 0); /* "PETSc/IS.pyx":27 * * def __releasebuffer__(self, Py_buffer *view): * cdef _IS_buffer buf = <_IS_buffer>(view.obj) # <<<<<<<<<<<<<< * buf.releasebuffer(view) * self # unused */ __pyx_t_1 = __pyx_v_view->obj; __Pyx_INCREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":28 * def __releasebuffer__(self, Py_buffer *view): * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) # <<<<<<<<<<<<<< * self # unused * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->releasebuffer(__pyx_v_buf, __pyx_v_view); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 28, __pyx_L1_error) /* "PETSc/IS.pyx":29 * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) * self # unused # <<<<<<<<<<<<<< * * */ ((void)__pyx_v_self); /* "PETSc/IS.pyx":26 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = <_IS_buffer>(view.obj) * buf.releasebuffer(view) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_WriteUnraisable("petsc4py.PETSc.IS.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); } /* "PETSc/IS.pyx":34 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_6__enter__[] = "IS.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6__enter__(struct PyPetscISObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/IS.pyx":35 * * def __enter__(self): * cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<< * self.set_attr('__buffer__', buf) * return buf.enter() */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":36 * def __enter__(self): * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) # <<<<<<<<<<<<<< * return buf.enter() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":37 * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) * return buf.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->enter(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":34 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * self.set_attr('__buffer__', buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":39 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_8__exit__[] = "IS.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8__exit__(struct PyPetscISObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/IS.pyx":40 * * def __exit__(self, *exc): * cdef _IS_buffer buf = self.get_attr('__buffer__') # <<<<<<<<<<<<<< * self.set_attr('__buffer__', None) * return buf.exit() */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc__IS_buffer))))) __PYX_ERR(31, 40, __pyx_L1_error) __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":41 * def __exit__(self, *exc): * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) # <<<<<<<<<<<<<< * return buf.exit() * # */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_IS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":42 * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) * return buf.exit() # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *)__pyx_v_buf->__pyx_vtab)->exit(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":39 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":45 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_10view[] = "IS.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(31, 45, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(31, 45, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10view(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10view(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/IS.pyx":46 * * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISView(self.iset, cviewer) ) */ __pyx_v_cviewer = NULL; /* "PETSc/IS.pyx":47 * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( ISView(self.iset, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_3; } /* "PETSc/IS.pyx":48 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISView(self.iset, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISView(__pyx_v_self->iset, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(31, 48, __pyx_L1_error) /* "PETSc/IS.pyx":45 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":50 * CHKERR( ISView(self.iset, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&self.iset) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_13destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_12destroy[] = "IS.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_13destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_12destroy(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_12destroy(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/IS.pyx":51 * * def destroy(self): * CHKERR( ISDestroy(&self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&__pyx_v_self->iset))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 51, __pyx_L1_error) /* "PETSc/IS.pyx":52 * def destroy(self): * CHKERR( ISDestroy(&self.iset) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":50 * CHKERR( ISView(self.iset, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&self.iset) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":54 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscIS newiset = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_15create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_14create[] = "IS.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_15create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(31, 54, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 54, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_14create(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_14create(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/IS.pyx":55 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * CHKERR( ISCreate(ccomm, &newiset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 55, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/IS.pyx":56 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * CHKERR( ISCreate(ccomm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset */ __pyx_v_newiset = NULL; /* "PETSc/IS.pyx":57 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscIS newiset = NULL * CHKERR( ISCreate(ccomm, &newiset) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.iset = newiset * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreate(__pyx_v_ccomm, (&__pyx_v_newiset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 57, __pyx_L1_error) /* "PETSc/IS.pyx":58 * cdef PetscIS newiset = NULL * CHKERR( ISCreate(ccomm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->iset = __pyx_v_newiset; /* "PETSc/IS.pyx":59 * CHKERR( ISCreate(ccomm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def setType(self, is_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":54 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscIS newiset = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":61 * return self * * def setType(self, is_type): # <<<<<<<<<<<<<< * cdef PetscISType cval = NULL * is_type = str2bytes(is_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_17setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_16setType[] = "IS.setType(self, is_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_17setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_is_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_is_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(31, 61, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_is_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 61, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_16setType(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_is_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_16setType(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_is_type) { ISType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_is_type); /* "PETSc/IS.pyx":62 * * def setType(self, is_type): * cdef PetscISType cval = NULL # <<<<<<<<<<<<<< * is_type = str2bytes(is_type, &cval) * CHKERR( ISSetType(self.iset, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/IS.pyx":63 * def setType(self, is_type): * cdef PetscISType cval = NULL * is_type = str2bytes(is_type, &cval) # <<<<<<<<<<<<<< * CHKERR( ISSetType(self.iset, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_is_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_is_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":64 * cdef PetscISType cval = NULL * is_type = str2bytes(is_type, &cval) * CHKERR( ISSetType(self.iset, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetType(__pyx_v_self->iset, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 64, __pyx_L1_error) /* "PETSc/IS.pyx":61 * return self * * def setType(self, is_type): # <<<<<<<<<<<<<< * cdef PetscISType cval = NULL * is_type = str2bytes(is_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_is_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":66 * CHKERR( ISSetType(self.iset, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscISType cval = NULL * CHKERR( ISGetType(self.iset, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_18getType[] = "IS.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_18getType(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_18getType(struct PyPetscISObject *__pyx_v_self) { ISType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/IS.pyx":67 * * def getType(self): * cdef PetscISType cval = NULL # <<<<<<<<<<<<<< * CHKERR( ISGetType(self.iset, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/IS.pyx":68 * def getType(self): * cdef PetscISType cval = NULL * CHKERR( ISGetType(self.iset, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetType(__pyx_v_self->iset, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 68, __pyx_L1_error) /* "PETSc/IS.pyx":69 * cdef PetscISType cval = NULL * CHKERR( ISGetType(self.iset, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def createGeneral(self, indices, comm=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":66 * CHKERR( ISSetType(self.iset, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscISType cval = NULL * CHKERR( ISGetType(self.iset, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":71 * return bytes2str(cval) * * def createGeneral(self, indices, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt nidx = 0, *idx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_20createGeneral[] = "IS.createGeneral(self, indices, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGeneral (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGeneral") < 0)) __PYX_ERR(31, 71, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGeneral", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 71, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.createGeneral", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_20createGeneral(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_20createGeneral(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGeneral", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/IS.pyx":72 * * def createGeneral(self, indices, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 72, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/IS.pyx":73 * def createGeneral(self, indices, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "PETSc/IS.pyx":74 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "PETSc/IS.pyx":75 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) */ __pyx_v_newiset = NULL; /* "PETSc/IS.pyx":76 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/IS.pyx":77 * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.iset = newiset * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreateGeneral(__pyx_v_ccomm, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm, (&__pyx_v_newiset))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(31, 77, __pyx_L1_error) /* "PETSc/IS.pyx":78 * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->iset = __pyx_v_newiset; /* "PETSc/IS.pyx":79 * CHKERR( ISCreateGeneral(ccomm, nidx, idx, cm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def createBlock(self, bsize, indices, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":71 * return bytes2str(cval) * * def createGeneral(self, indices, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt nidx = 0, *idx = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.createGeneral", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":81 * return self * * def createBlock(self, bsize, indices, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = asInt(bsize) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_22createBlock[] = "IS.createBlock(self, bsize, indices, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBlock (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,&__pyx_n_s_indices,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createBlock", 0, 2, 3, 1); __PYX_ERR(31, 81, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBlock") < 0)) __PYX_ERR(31, 81, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_bsize = values[0]; __pyx_v_indices = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBlock", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 81, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.createBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_22createBlock(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_indices, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_22createBlock(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBlock", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/IS.pyx":82 * * def createBlock(self, bsize, indices, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 82, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/IS.pyx":83 * def createBlock(self, bsize, indices, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 83, __pyx_L1_error) __pyx_v_bs = __pyx_t_2; /* "PETSc/IS.pyx":84 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "PETSc/IS.pyx":85 * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "PETSc/IS.pyx":86 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) */ __pyx_v_newiset = NULL; /* "PETSc/IS.pyx":87 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/IS.pyx":88 * cdef PetscIS newiset = NULL * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.iset = newiset * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreateBlock(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm, (&__pyx_v_newiset))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(31, 88, __pyx_L1_error) /* "PETSc/IS.pyx":89 * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->iset = __pyx_v_newiset; /* "PETSc/IS.pyx":90 * CHKERR( ISCreateBlock(ccomm, bs, nidx, idx, cm, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def createStride(self, size, first=0, step=0, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":81 * return self * * def createBlock(self, bsize, indices, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = asInt(bsize) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.createBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":92 * return self * * def createStride(self, size, first=0, step=0, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt csize = asInt(size) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_25createStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_24createStride[] = "IS.createStride(self, size, first=0, step=0, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_25createStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_first = 0; PyObject *__pyx_v_step = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createStride (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_first,&__pyx_n_s_step,&__pyx_n_s_comm,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_0); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_first); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createStride") < 0)) __PYX_ERR(31, 92, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_first = values[1]; __pyx_v_step = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createStride", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 92, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.createStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_24createStride(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_size, __pyx_v_first, __pyx_v_step, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_24createStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_csize; PetscInt __pyx_v_cfirst; PetscInt __pyx_v_cstep; IS __pyx_v_newiset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createStride", 0); /* "PETSc/IS.pyx":93 * * def createStride(self, size, first=0, step=0, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 93, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/IS.pyx":94 * def createStride(self, size, first=0, step=0, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt csize = asInt(size) # <<<<<<<<<<<<<< * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 94, __pyx_L1_error) __pyx_v_csize = __pyx_t_2; /* "PETSc/IS.pyx":95 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) # <<<<<<<<<<<<<< * cdef PetscInt cstep = asInt(step) * cdef PetscIS newiset = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_first); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 95, __pyx_L1_error) __pyx_v_cfirst = __pyx_t_2; /* "PETSc/IS.pyx":96 * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) # <<<<<<<<<<<<<< * cdef PetscIS newiset = NULL * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 96, __pyx_L1_error) __pyx_v_cstep = __pyx_t_2; /* "PETSc/IS.pyx":97 * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) * cdef PetscIS newiset = NULL # <<<<<<<<<<<<<< * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset */ __pyx_v_newiset = NULL; /* "PETSc/IS.pyx":98 * cdef PetscInt cstep = asInt(step) * cdef PetscIS newiset = NULL * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.iset = newiset * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreateStride(__pyx_v_ccomm, __pyx_v_csize, __pyx_v_cfirst, __pyx_v_cstep, (&__pyx_v_newiset))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(31, 98, __pyx_L1_error) /* "PETSc/IS.pyx":99 * cdef PetscIS newiset = NULL * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->iset = __pyx_v_newiset; /* "PETSc/IS.pyx":100 * CHKERR( ISCreateStride(ccomm, csize, cfirst, cstep, &newiset) ) * PetscCLEAR(self.obj); self.iset = newiset * return self # <<<<<<<<<<<<<< * * def duplicate(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":92 * return self * * def createStride(self, size, first=0, step=0, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt csize = asInt(size) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.createStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":102 * return self * * def duplicate(self): # <<<<<<<<<<<<<< * cdef IS iset = type(self)() * CHKERR( ISDuplicate(self.iset, &iset.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_26duplicate[] = "IS.duplicate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("duplicate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "duplicate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_26duplicate(struct PyPetscISObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 0); /* "PETSc/IS.pyx":103 * * def duplicate(self): * cdef IS iset = type(self)() # <<<<<<<<<<<<<< * CHKERR( ISDuplicate(self.iset, &iset.iset) ) * return iset */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(31, 103, __pyx_L1_error) __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":104 * def duplicate(self): * cdef IS iset = type(self)() * CHKERR( ISDuplicate(self.iset, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDuplicate(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(31, 104, __pyx_L1_error) /* "PETSc/IS.pyx":105 * cdef IS iset = type(self)() * CHKERR( ISDuplicate(self.iset, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def copy(self, IS result=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_iset)); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "PETSc/IS.pyx":102 * return self * * def duplicate(self): # <<<<<<<<<<<<<< * cdef IS iset = type(self)() * CHKERR( ISDuplicate(self.iset, &iset.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":107 * return iset * * def copy(self, IS result=None): # <<<<<<<<<<<<<< * if result is None: * result = type(self)() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_29copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_28copy[] = "IS.copy(self, IS result=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_29copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscISObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy") < 0)) __PYX_ERR(31, 107, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 107, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "result", 0))) __PYX_ERR(31, 107, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_28copy(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_28copy(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/IS.pyx":108 * * def copy(self, IS result=None): * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.iset == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/IS.pyx":109 * def copy(self, IS result=None): * if result is None: * result = type(self)() # <<<<<<<<<<<<<< * if result.iset == NULL: * CHKERR( ISDuplicate(self.iset, &result.iset) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(31, 109, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscISObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/IS.pyx":108 * * def copy(self, IS result=None): * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.iset == NULL: */ } /* "PETSc/IS.pyx":110 * if result is None: * result = type(self)() * if result.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) */ __pyx_t_2 = ((__pyx_v_result->iset == NULL) != 0); if (__pyx_t_2) { /* "PETSc/IS.pyx":111 * result = type(self)() * if result.iset == NULL: * CHKERR( ISDuplicate(self.iset, &result.iset) ) # <<<<<<<<<<<<<< * CHKERR( ISCopy(self.iset, result.iset) ) * return result */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDuplicate(__pyx_v_self->iset, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(31, 111, __pyx_L1_error) /* "PETSc/IS.pyx":110 * if result is None: * result = type(self)() * if result.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) */ } /* "PETSc/IS.pyx":112 * if result.iset == NULL: * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCopy(__pyx_v_self->iset, __pyx_v_result->iset)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(31, 112, __pyx_L1_error) /* "PETSc/IS.pyx":113 * CHKERR( ISDuplicate(self.iset, &result.iset) ) * CHKERR( ISCopy(self.iset, result.iset) ) * return result # <<<<<<<<<<<<<< * * def load(self, Viewer viewer): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/IS.pyx":107 * return iset * * def copy(self, IS result=None): # <<<<<<<<<<<<<< * if result is None: * result = type(self)() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.IS.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":115 * return result * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_31load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_30load[] = "IS.load(self, Viewer viewer)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_31load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(31, 115, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 115, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(31, 115, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_30load(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_30load(struct PyPetscISObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { MPI_Comm __pyx_v_comm; PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); /* "PETSc/IS.pyx":116 * * def load(self, Viewer viewer): * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: */ __pyx_v_comm = MPI_COMM_NULL; /* "PETSc/IS.pyx":117 * def load(self, Viewer viewer): * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) # <<<<<<<<<<<<<< * if self.iset == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) */ __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr); /* "PETSc/IS.pyx":118 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) */ __pyx_t_1 = ((__pyx_v_self->iset == NULL) != 0); if (__pyx_t_1) { /* "PETSc/IS.pyx":119 * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) # <<<<<<<<<<<<<< * CHKERR( ISCreate(comm, &self.iset) ) * CHKERR( ISLoad(self.iset, viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(__pyx_v_obj, (&__pyx_v_comm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 119, __pyx_L1_error) /* "PETSc/IS.pyx":120 * if self.iset == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) # <<<<<<<<<<<<<< * CHKERR( ISLoad(self.iset, viewer.vwr) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISCreate(__pyx_v_comm, (&__pyx_v_self->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 120, __pyx_L1_error) /* "PETSc/IS.pyx":118 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.iset == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) */ } /* "PETSc/IS.pyx":121 * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( ISCreate(comm, &self.iset) ) * CHKERR( ISLoad(self.iset, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLoad(__pyx_v_self->iset, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 121, __pyx_L1_error) /* "PETSc/IS.pyx":122 * CHKERR( ISCreate(comm, &self.iset) ) * CHKERR( ISLoad(self.iset, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def allGather(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":115 * return result * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":124 * return self * * def allGather(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( ISAllGather(self.iset, &iset.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_33allGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_32allGather[] = "IS.allGather(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_33allGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("allGather (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("allGather", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "allGather", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_32allGather(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_32allGather(struct PyPetscISObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("allGather", 0); /* "PETSc/IS.pyx":125 * * def allGather(self): * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( ISAllGather(self.iset, &iset.iset) ) * return iset */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":126 * def allGather(self): * cdef IS iset = IS() * CHKERR( ISAllGather(self.iset, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISAllGather(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 126, __pyx_L1_error) /* "PETSc/IS.pyx":127 * cdef IS iset = IS() * CHKERR( ISAllGather(self.iset, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def toGeneral(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_iset)); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "PETSc/IS.pyx":124 * return self * * def allGather(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( ISAllGather(self.iset, &iset.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.allGather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":129 * return iset * * def toGeneral(self): # <<<<<<<<<<<<<< * CHKERR( ISToGeneral(self.iset) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_34toGeneral[] = "IS.toGeneral(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toGeneral (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("toGeneral", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "toGeneral", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_34toGeneral(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toGeneral", 0); /* "PETSc/IS.pyx":130 * * def toGeneral(self): * CHKERR( ISToGeneral(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISToGeneral(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 130, __pyx_L1_error) /* "PETSc/IS.pyx":131 * def toGeneral(self): * CHKERR( ISToGeneral(self.iset) ) * return self # <<<<<<<<<<<<<< * * def invertPermutation(self, nlocal=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":129 * return iset * * def toGeneral(self): # <<<<<<<<<<<<<< * CHKERR( ISToGeneral(self.iset) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.toGeneral", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":133 * return self * * def invertPermutation(self, nlocal=None): # <<<<<<<<<<<<<< * cdef PetscInt cnlocal = PETSC_DECIDE * if nlocal is not None: cnlocal = asInt(nlocal) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_37invertPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_36invertPermutation[] = "IS.invertPermutation(self, nlocal=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_37invertPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nlocal = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("invertPermutation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlocal,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nlocal); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "invertPermutation") < 0)) __PYX_ERR(31, 133, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nlocal = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("invertPermutation", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 133, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.invertPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_36invertPermutation(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_nlocal); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_36invertPermutation(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nlocal) { PetscInt __pyx_v_cnlocal; struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("invertPermutation", 0); /* "PETSc/IS.pyx":134 * * def invertPermutation(self, nlocal=None): * cdef PetscInt cnlocal = PETSC_DECIDE # <<<<<<<<<<<<<< * if nlocal is not None: cnlocal = asInt(nlocal) * cdef IS iset = IS() */ __pyx_v_cnlocal = PETSC_DECIDE; /* "PETSc/IS.pyx":135 * def invertPermutation(self, nlocal=None): * cdef PetscInt cnlocal = PETSC_DECIDE * if nlocal is not None: cnlocal = asInt(nlocal) # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) */ __pyx_t_1 = (__pyx_v_nlocal != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlocal); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 135, __pyx_L1_error) __pyx_v_cnlocal = __pyx_t_3; } /* "PETSc/IS.pyx":136 * cdef PetscInt cnlocal = PETSC_DECIDE * if nlocal is not None: cnlocal = asInt(nlocal) * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) * return iset */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/IS.pyx":137 * if nlocal is not None: cnlocal = asInt(nlocal) * cdef IS iset = IS() * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISInvertPermutation(__pyx_v_self->iset, __pyx_v_cnlocal, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(31, 137, __pyx_L1_error) /* "PETSc/IS.pyx":138 * cdef IS iset = IS() * CHKERR( ISInvertPermutation(self.iset, cnlocal, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def getSize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_iset)); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "PETSc/IS.pyx":133 * return self * * def invertPermutation(self, nlocal=None): # <<<<<<<<<<<<<< * cdef PetscInt cnlocal = PETSC_DECIDE * if nlocal is not None: cnlocal = asInt(nlocal) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.IS.invertPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":140 * return iset * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt N = 0 * CHKERR( ISGetSize(self.iset, &N) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_39getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_38getSize[] = "IS.getSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_39getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_38getSize(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_38getSize(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 0); /* "PETSc/IS.pyx":141 * * def getSize(self): * cdef PetscInt N = 0 # <<<<<<<<<<<<<< * CHKERR( ISGetSize(self.iset, &N) ) * return toInt(N) */ __pyx_v_N = 0; /* "PETSc/IS.pyx":142 * def getSize(self): * cdef PetscInt N = 0 * CHKERR( ISGetSize(self.iset, &N) ) # <<<<<<<<<<<<<< * return toInt(N) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetSize(__pyx_v_self->iset, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 142, __pyx_L1_error) /* "PETSc/IS.pyx":143 * cdef PetscInt N = 0 * CHKERR( ISGetSize(self.iset, &N) ) * return toInt(N) # <<<<<<<<<<<<<< * * def getLocalSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":140 * return iset * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt N = 0 * CHKERR( ISGetSize(self.iset, &N) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":145 * return toInt(N) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_40getLocalSize[] = "IS.getLocalSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_40getLocalSize(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_40getLocalSize(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 0); /* "PETSc/IS.pyx":146 * * def getLocalSize(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/IS.pyx":147 * def getLocalSize(self): * cdef PetscInt n = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 147, __pyx_L1_error) /* "PETSc/IS.pyx":148 * cdef PetscInt n = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":145 * return toInt(N) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":150 * return toInt(n) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0, N = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_42getSizes[] = "IS.getSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_42getSizes(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42getSizes(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 0); /* "PETSc/IS.pyx":151 * * def getSizes(self): * cdef PetscInt n = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &n) ) * CHKERR( ISGetSize(self.iset, &N) ) */ __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/IS.pyx":152 * def getSizes(self): * cdef PetscInt n = 0, N = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) # <<<<<<<<<<<<<< * CHKERR( ISGetSize(self.iset, &N) ) * return (toInt(n), toInt(N)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 152, __pyx_L1_error) /* "PETSc/IS.pyx":153 * cdef PetscInt n = 0, N = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) * CHKERR( ISGetSize(self.iset, &N) ) # <<<<<<<<<<<<<< * return (toInt(n), toInt(N)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetSize(__pyx_v_self->iset, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 153, __pyx_L1_error) /* "PETSc/IS.pyx":154 * CHKERR( ISGetLocalSize(self.iset, &n) ) * CHKERR( ISGetSize(self.iset, &N) ) * return (toInt(n), toInt(N)) # <<<<<<<<<<<<<< * * def getBlockSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":150 * return toInt(n) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0, N = 0 * CHKERR( ISGetLocalSize(self.iset, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.IS.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":156 * return (toInt(n), toInt(N)) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 1 * CHKERR( ISGetBlockSize(self.iset, &bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_44getBlockSize[] = "IS.getBlockSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_44getBlockSize(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getBlockSize(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 0); /* "PETSc/IS.pyx":157 * * def getBlockSize(self): * cdef PetscInt bs = 1 # <<<<<<<<<<<<<< * CHKERR( ISGetBlockSize(self.iset, &bs) ) * return toInt(bs) */ __pyx_v_bs = 1; /* "PETSc/IS.pyx":158 * def getBlockSize(self): * cdef PetscInt bs = 1 * CHKERR( ISGetBlockSize(self.iset, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetBlockSize(__pyx_v_self->iset, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 158, __pyx_L1_error) /* "PETSc/IS.pyx":159 * cdef PetscInt bs = 1 * CHKERR( ISGetBlockSize(self.iset, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def setBlockSize(self, bs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":156 * return (toInt(n), toInt(N)) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 1 * CHKERR( ISGetBlockSize(self.iset, &bs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":161 * return toInt(bs) * * def setBlockSize(self, bs): # <<<<<<<<<<<<<< * cdef PetscInt cbs = asInt(bs) * CHKERR( ISSetBlockSize(self.iset, cbs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_47setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_46setBlockSize[] = "IS.setBlockSize(self, bs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_47setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bs,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSize") < 0)) __PYX_ERR(31, 161, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 161, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_46setBlockSize(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46setBlockSize(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bs) { PetscInt __pyx_v_cbs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSize", 0); /* "PETSc/IS.pyx":162 * * def setBlockSize(self, bs): * cdef PetscInt cbs = asInt(bs) # <<<<<<<<<<<<<< * CHKERR( ISSetBlockSize(self.iset, cbs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 162, __pyx_L1_error) __pyx_v_cbs = __pyx_t_1; /* "PETSc/IS.pyx":163 * def setBlockSize(self, bs): * cdef PetscInt cbs = asInt(bs) * CHKERR( ISSetBlockSize(self.iset, cbs) ) # <<<<<<<<<<<<<< * * def sort(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetBlockSize(__pyx_v_self->iset, __pyx_v_cbs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 163, __pyx_L1_error) /* "PETSc/IS.pyx":161 * return toInt(bs) * * def setBlockSize(self, bs): # <<<<<<<<<<<<<< * cdef PetscInt cbs = asInt(bs) * CHKERR( ISSetBlockSize(self.iset, cbs) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":165 * CHKERR( ISSetBlockSize(self.iset, cbs) ) * * def sort(self): # <<<<<<<<<<<<<< * CHKERR( ISSort(self.iset) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_49sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_48sort[] = "IS.sort(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_49sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sort (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("sort", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sort", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_48sort(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48sort(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sort", 0); /* "PETSc/IS.pyx":166 * * def sort(self): * CHKERR( ISSort(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSort(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 166, __pyx_L1_error) /* "PETSc/IS.pyx":167 * def sort(self): * CHKERR( ISSort(self.iset) ) * return self # <<<<<<<<<<<<<< * * def isSorted(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":165 * CHKERR( ISSetBlockSize(self.iset, cbs) ) * * def sort(self): # <<<<<<<<<<<<<< * CHKERR( ISSort(self.iset) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.sort", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":169 * return self * * def isSorted(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_51isSorted(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_50isSorted[] = "IS.isSorted(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_51isSorted(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isSorted (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isSorted", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isSorted", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_50isSorted(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50isSorted(struct PyPetscISObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isSorted", 0); /* "PETSc/IS.pyx":170 * * def isSorted(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISSorted(self.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/IS.pyx":171 * def isSorted(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSorted(__pyx_v_self->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 171, __pyx_L1_error) /* "PETSc/IS.pyx":172 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setPermutation(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":169 * return self * * def isSorted(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.isSorted", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":174 * return toBool(flag) * * def setPermutation(self): # <<<<<<<<<<<<<< * CHKERR( ISSetPermutation(self.iset) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_53setPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_52setPermutation[] = "IS.setPermutation(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_53setPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPermutation (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setPermutation", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setPermutation", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_52setPermutation(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52setPermutation(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPermutation", 0); /* "PETSc/IS.pyx":175 * * def setPermutation(self): * CHKERR( ISSetPermutation(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetPermutation(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 175, __pyx_L1_error) /* "PETSc/IS.pyx":176 * def setPermutation(self): * CHKERR( ISSetPermutation(self.iset) ) * return self # <<<<<<<<<<<<<< * * def isPermutation(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":174 * return toBool(flag) * * def setPermutation(self): # <<<<<<<<<<<<<< * CHKERR( ISSetPermutation(self.iset) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":178 * return self * * def isPermutation(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISPermutation(self.iset, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_55isPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_54isPermutation[] = "IS.isPermutation(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_55isPermutation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isPermutation (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isPermutation", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isPermutation", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_54isPermutation(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54isPermutation(struct PyPetscISObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isPermutation", 0); /* "PETSc/IS.pyx":179 * * def isPermutation(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISPermutation(self.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/IS.pyx":180 * def isPermutation(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISPermutation(self.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISPermutation(__pyx_v_self->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 180, __pyx_L1_error) /* "PETSc/IS.pyx":181 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISPermutation(self.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setIdentity(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":178 * return self * * def isPermutation(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISPermutation(self.iset, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.isPermutation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":183 * return toBool(flag) * * def setIdentity(self): # <<<<<<<<<<<<<< * CHKERR( ISSetIdentity(self.iset) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57setIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_56setIdentity[] = "IS.setIdentity(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57setIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIdentity (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setIdentity", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setIdentity", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_56setIdentity(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56setIdentity(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIdentity", 0); /* "PETSc/IS.pyx":184 * * def setIdentity(self): * CHKERR( ISSetIdentity(self.iset) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSetIdentity(__pyx_v_self->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 184, __pyx_L1_error) /* "PETSc/IS.pyx":185 * def setIdentity(self): * CHKERR( ISSetIdentity(self.iset) ) * return self # <<<<<<<<<<<<<< * * def isIdentity(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":183 * return toBool(flag) * * def setIdentity(self): # <<<<<<<<<<<<<< * CHKERR( ISSetIdentity(self.iset) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setIdentity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":187 * return self * * def isIdentity(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISIdentity(self.iset, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59isIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_58isIdentity[] = "IS.isIdentity(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59isIdentity(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isIdentity (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isIdentity", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isIdentity", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_58isIdentity(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58isIdentity(struct PyPetscISObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isIdentity", 0); /* "PETSc/IS.pyx":188 * * def isIdentity(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISIdentity(self.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/IS.pyx":189 * def isIdentity(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISIdentity(self.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISIdentity(__pyx_v_self->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 189, __pyx_L1_error) /* "PETSc/IS.pyx":190 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISIdentity(self.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def equal(self, IS iset): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":187 * return self * * def isIdentity(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISIdentity(self.iset, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.isIdentity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":192 * return toBool(flag) * * def equal(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_61equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_60equal[] = "IS.equal(self, IS iset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_61equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("equal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(31, 192, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 192, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 192, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_60equal(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60equal(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("equal", 0); /* "PETSc/IS.pyx":193 * * def equal(self, IS iset): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/IS.pyx":194 * def equal(self, IS iset): * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISEqual(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 194, __pyx_L1_error) /* "PETSc/IS.pyx":195 * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def sum(self, IS iset): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":192 * return toBool(flag) * * def equal(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( ISEqual(self.iset, iset.iset, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":197 * return toBool(flag) * * def sum(self, IS iset): # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_62sum[] = "IS.sum(self, IS iset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sum (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sum") < 0)) __PYX_ERR(31, 197, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sum", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 197, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 197, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_62sum(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62sum(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sum", 0); /* "PETSc/IS.pyx":198 * * def sum(self, IS iset): * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * return out */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":199 * def sum(self, IS iset): * cdef IS out = IS() * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSum(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 199, __pyx_L1_error) /* "PETSc/IS.pyx":200 * cdef IS out = IS() * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def expand(self, IS iset): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/IS.pyx":197 * return toBool(flag) * * def sum(self, IS iset): # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":202 * return out * * def expand(self, IS iset): # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_65expand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_64expand[] = "IS.expand(self, IS iset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_65expand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("expand (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "expand") < 0)) __PYX_ERR(31, 202, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("expand", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 202, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.expand", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 202, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_64expand(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64expand(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("expand", 0); /* "PETSc/IS.pyx":203 * * def expand(self, IS iset): * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) * return out */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":204 * def expand(self, IS iset): * cdef IS out = IS() * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISExpand(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 204, __pyx_L1_error) /* "PETSc/IS.pyx":205 * cdef IS out = IS() * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def union(self, IS iset): # XXX review this */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/IS.pyx":202 * return out * * def expand(self, IS iset): # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.expand", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":207 * return out * * def union(self, IS iset): # XXX review this # <<<<<<<<<<<<<< * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag1) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_67union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_66union[] = "IS.union(self, IS iset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_67union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("union (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "union") < 0)) __PYX_ERR(31, 207, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("union", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 207, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 207, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_66union(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66union(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { PetscBool __pyx_v_flag1; PetscBool __pyx_v_flag2; struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union", 0); /* "PETSc/IS.pyx":208 * * def union(self, IS iset): # XXX review this * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( ISSorted(self.iset, &flag1) ) * CHKERR( ISSorted(iset.iset, &flag2) ) */ __pyx_v_flag1 = PETSC_FALSE; __pyx_v_flag2 = PETSC_FALSE; /* "PETSc/IS.pyx":209 * def union(self, IS iset): # XXX review this * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag1) ) # <<<<<<<<<<<<<< * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSorted(__pyx_v_self->iset, (&__pyx_v_flag1))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 209, __pyx_L1_error) /* "PETSc/IS.pyx":210 * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag1) ) * CHKERR( ISSorted(iset.iset, &flag2) ) # <<<<<<<<<<<<<< * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSorted(__pyx_v_iset->iset, (&__pyx_v_flag2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 210, __pyx_L1_error) /* "PETSc/IS.pyx":211 * CHKERR( ISSorted(self.iset, &flag1) ) * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() # <<<<<<<<<<<<<< * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/IS.pyx":212 * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * else: */ __pyx_t_4 = ((__pyx_v_flag1 == PETSC_TRUE) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = ((__pyx_v_flag2 == PETSC_TRUE) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { /* "PETSc/IS.pyx":213 * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * else: * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSum(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 213, __pyx_L1_error) /* "PETSc/IS.pyx":212 * CHKERR( ISSorted(iset.iset, &flag2) ) * cdef IS out = IS() * if flag1==PETSC_TRUE and flag2==PETSC_TRUE: # <<<<<<<<<<<<<< * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * else: */ goto __pyx_L3; } /* "PETSc/IS.pyx":215 * CHKERR( ISSum(self.iset, iset.iset, &out.iset) ) * else: * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISExpand(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 215, __pyx_L1_error) } __pyx_L3:; /* "PETSc/IS.pyx":216 * else: * CHKERR( ISExpand(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def difference(self, IS iset): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/IS.pyx":207 * return out * * def union(self, IS iset): # XXX review this # <<<<<<<<<<<<<< * cdef PetscBool flag1=PETSC_FALSE, flag2=PETSC_FALSE * CHKERR( ISSorted(self.iset, &flag1) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.union", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":218 * return out * * def difference(self, IS iset): # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_69difference(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_68difference[] = "IS.difference(self, IS iset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_69difference(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("difference (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(31, 218, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("difference", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 218, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 218, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_68difference(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68difference(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("difference", 0); /* "PETSc/IS.pyx":219 * * def difference(self, IS iset): * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) * return out */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":220 * def difference(self, IS iset): * cdef IS out = IS() * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDifference(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 220, __pyx_L1_error) /* "PETSc/IS.pyx":221 * cdef IS out = IS() * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def complement(self, nmin, nmax): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/IS.pyx":218 * return out * * def difference(self, IS iset): # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISDifference(self.iset, iset.iset, &out.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.difference", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":223 * return out * * def complement(self, nmin, nmax): # <<<<<<<<<<<<<< * cdef PetscInt cnmin = asInt(nmin) * cdef PetscInt cnmax = asInt(nmax) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_71complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_70complement[] = "IS.complement(self, nmin, nmax)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_71complement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nmin = 0; PyObject *__pyx_v_nmax = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("complement (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nmin,&__pyx_n_s_nmax,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nmin)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nmax)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("complement", 1, 2, 2, 1); __PYX_ERR(31, 223, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "complement") < 0)) __PYX_ERR(31, 223, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_nmin = values[0]; __pyx_v_nmax = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("complement", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 223, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.complement", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_70complement(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_nmin, __pyx_v_nmax); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70complement(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nmin, PyObject *__pyx_v_nmax) { PetscInt __pyx_v_cnmin; PetscInt __pyx_v_cnmax; struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("complement", 0); /* "PETSc/IS.pyx":224 * * def complement(self, nmin, nmax): * cdef PetscInt cnmin = asInt(nmin) # <<<<<<<<<<<<<< * cdef PetscInt cnmax = asInt(nmax) * cdef IS out = IS() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nmin); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 224, __pyx_L1_error) __pyx_v_cnmin = __pyx_t_1; /* "PETSc/IS.pyx":225 * def complement(self, nmin, nmax): * cdef PetscInt cnmin = asInt(nmin) * cdef PetscInt cnmax = asInt(nmax) # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nmax); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 225, __pyx_L1_error) __pyx_v_cnmax = __pyx_t_1; /* "PETSc/IS.pyx":226 * cdef PetscInt cnmin = asInt(nmin) * cdef PetscInt cnmax = asInt(nmax) * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) * return out */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/IS.pyx":227 * cdef PetscInt cnmax = asInt(nmax) * cdef IS out = IS() * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISComplement(__pyx_v_self->iset, __pyx_v_cnmin, __pyx_v_cnmax, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(31, 227, __pyx_L1_error) /* "PETSc/IS.pyx":228 * cdef IS out = IS() * CHKERR( ISComplement(self.iset, cnmin, cnmax, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def embed(self, IS iset, drop): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/IS.pyx":223 * return out * * def complement(self, nmin, nmax): # <<<<<<<<<<<<<< * cdef PetscInt cnmin = asInt(nmin) * cdef PetscInt cnmax = asInt(nmax) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.complement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":230 * return out * * def embed(self, IS iset, drop): # <<<<<<<<<<<<<< * cdef PetscBool bval = drop * cdef IS out = IS() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_73embed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_72embed[] = "IS.embed(self, IS iset, drop)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_73embed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_v_drop = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("embed (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_drop,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_drop)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("embed", 1, 2, 2, 1); __PYX_ERR(31, 230, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "embed") < 0)) __PYX_ERR(31, 230, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_drop = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("embed", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 230, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.embed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 230, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_72embed(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_drop); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72embed(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_drop) { PetscBool __pyx_v_bval; struct PyPetscISObject *__pyx_v_out = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("embed", 0); /* "PETSc/IS.pyx":231 * * def embed(self, IS iset, drop): * cdef PetscBool bval = drop # <<<<<<<<<<<<<< * cdef IS out = IS() * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_drop)); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 231, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "PETSc/IS.pyx":232 * def embed(self, IS iset, drop): * cdef PetscBool bval = drop * cdef IS out = IS() # <<<<<<<<<<<<<< * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) * return out */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/IS.pyx":233 * cdef PetscBool bval = drop * cdef IS out = IS() * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISEmbed(__pyx_v_self->iset, __pyx_v_iset->iset, __pyx_v_bval, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(31, 233, __pyx_L1_error) /* "PETSc/IS.pyx":234 * cdef IS out = IS() * CHKERR( ISEmbed(self.iset, iset.iset, bval, &out.iset) ) * return out # <<<<<<<<<<<<<< * * def renumber(self, IS mult=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/IS.pyx":230 * return out * * def embed(self, IS iset, drop): # <<<<<<<<<<<<<< * cdef PetscBool bval = drop * cdef IS out = IS() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.embed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":236 * return out * * def renumber(self, IS mult=None): # <<<<<<<<<<<<<< * cdef PetscIS mlt = NULL * if mult is not None: mlt = mult.iset */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75renumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_74renumber[] = "IS.renumber(self, IS mult=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75renumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_mult = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("renumber (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mult,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscISObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mult); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "renumber") < 0)) __PYX_ERR(31, 236, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mult = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("renumber", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 236, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.renumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mult), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "mult", 0))) __PYX_ERR(31, 236, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_74renumber(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_mult); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74renumber(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_mult) { IS __pyx_v_mlt; struct PyPetscISObject *__pyx_v_out = 0; PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("renumber", 0); /* "PETSc/IS.pyx":237 * * def renumber(self, IS mult=None): * cdef PetscIS mlt = NULL # <<<<<<<<<<<<<< * if mult is not None: mlt = mult.iset * cdef IS out = IS() */ __pyx_v_mlt = NULL; /* "PETSc/IS.pyx":238 * def renumber(self, IS mult=None): * cdef PetscIS mlt = NULL * if mult is not None: mlt = mult.iset # <<<<<<<<<<<<<< * cdef IS out = IS() * cdef PetscInt n = 0 */ __pyx_t_1 = (((PyObject *)__pyx_v_mult) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_mult->iset; __pyx_v_mlt = __pyx_t_3; } /* "PETSc/IS.pyx":239 * cdef PetscIS mlt = NULL * if mult is not None: mlt = mult.iset * cdef IS out = IS() # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/IS.pyx":240 * if mult is not None: mlt = mult.iset * cdef IS out = IS() * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) * return (toInt(n), out) */ __pyx_v_n = 0; /* "PETSc/IS.pyx":241 * cdef IS out = IS() * cdef PetscInt n = 0 * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) # <<<<<<<<<<<<<< * return (toInt(n), out) * # */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRenumber(__pyx_v_self->iset, __pyx_v_mlt, (&__pyx_v_n), (&__pyx_v_out->iset))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(31, 241, __pyx_L1_error) /* "PETSc/IS.pyx":242 * cdef PetscInt n = 0 * CHKERR( ISRenumber(self.iset, mlt, &n, &out.iset) ) * return (toInt(n), out) # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(31, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __Pyx_GIVEREF(((PyObject *)__pyx_v_out)); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_out)); __pyx_t_4 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":236 * return out * * def renumber(self, IS mult=None): # <<<<<<<<<<<<<< * cdef PetscIS mlt = NULL * if mult is not None: mlt = mult.iset */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.IS.renumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":245 * # * * def setIndices(self, indices): # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_77setIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_76setIndices[] = "IS.setIndices(self, indices)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_77setIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIndices (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIndices") < 0)) __PYX_ERR(31, 245, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_indices = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIndices", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 245, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_76setIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_indices); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76setIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices) { PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/IS.pyx":246 * * def setIndices(self, indices): * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "PETSc/IS.pyx":247 * def setIndices(self, indices): * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "PETSc/IS.pyx":248 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":249 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) # <<<<<<<<<<<<<< * * def getIndices(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGeneralSetIndices(__pyx_v_self->iset, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 249, __pyx_L1_error) /* "PETSc/IS.pyx":245 * # * * def setIndices(self, indices): # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.setIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":251 * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) * * def getIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_78getIndices[] = "IS.getIndices(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIndices (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_78getIndices(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78getIndices(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIndices", 0); /* "PETSc/IS.pyx":252 * * def getIndices(self): * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) */ __pyx_v_size = 0; /* "PETSc/IS.pyx":253 * def getIndices(self): * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetIndices(self.iset, &indices) ) */ __pyx_v_indices = NULL; /* "PETSc/IS.pyx":254 * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) # <<<<<<<<<<<<<< * CHKERR( ISGetIndices(self.iset, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 254, __pyx_L1_error) /* "PETSc/IS.pyx":255 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * cdef object oindices = None * try: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 255, __pyx_L1_error) /* "PETSc/IS.pyx":256 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetIndices(self.iset, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "PETSc/IS.pyx":257 * CHKERR( ISGetIndices(self.iset, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size, indices) * finally: */ /*try:*/ { /* "PETSc/IS.pyx":258 * cdef object oindices = None * try: * oindices = array_i(size, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISRestoreIndices(self.iset, &indices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_size, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 258, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/IS.pyx":260 * oindices = array_i(size, indices) * finally: * CHKERR( ISRestoreIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 260, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_1 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(31, 260, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/IS.pyx":261 * finally: * CHKERR( ISRestoreIndices(self.iset, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def setBlockIndices(self, bsize, indices): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "PETSc/IS.pyx":251 * CHKERR( ISGeneralSetIndices(self.iset, nidx, idx, cm) ) * * def getIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":263 * return oindices * * def setBlockIndices(self, bsize, indices): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81setBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_80setBlockIndices[] = "IS.setBlockIndices(self, bsize, indices)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81setBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_indices = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockIndices (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,&__pyx_n_s_indices,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setBlockIndices", 1, 2, 2, 1); __PYX_ERR(31, 263, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockIndices") < 0)) __PYX_ERR(31, 263, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_bsize = values[0]; __pyx_v_indices = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockIndices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 263, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_80setBlockIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_indices); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80setBlockIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices) { PetscInt __pyx_v_bs; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/IS.pyx":264 * * def setBlockIndices(self, bsize, indices): * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 264, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "PETSc/IS.pyx":265 * def setBlockIndices(self, bsize, indices): * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "PETSc/IS.pyx":266 * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "PETSc/IS.pyx":267 * cdef PetscInt nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/IS.pyx":268 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) # <<<<<<<<<<<<<< * * def getBlockIndices(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockSetIndices(__pyx_v_self->iset, __pyx_v_bs, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(31, 268, __pyx_L1_error) /* "PETSc/IS.pyx":263 * return oindices * * def setBlockIndices(self, bsize, indices): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * cdef PetscInt nidx = 0, *idx = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.setBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":270 * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) * * def getBlockIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_83getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_82getBlockIndices[] = "IS.getBlockIndices(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_83getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockIndices (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_82getBlockIndices(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82getBlockIndices(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt __pyx_v_bs; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockIndices", 0); /* "PETSc/IS.pyx":271 * * def getBlockIndices(self): * cdef PetscInt size = 0, bs = 1 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) */ __pyx_v_size = 0; __pyx_v_bs = 1; /* "PETSc/IS.pyx":272 * def getBlockIndices(self): * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetBlockSize(self.iset, &bs) ) */ __pyx_v_indices = NULL; /* "PETSc/IS.pyx":273 * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) # <<<<<<<<<<<<<< * CHKERR( ISGetBlockSize(self.iset, &bs) ) * CHKERR( ISBlockGetIndices(self.iset, &indices) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 273, __pyx_L1_error) /* "PETSc/IS.pyx":274 * cdef const PetscInt *indices = NULL * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetBlockSize(self.iset, &bs) ) # <<<<<<<<<<<<<< * CHKERR( ISBlockGetIndices(self.iset, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetBlockSize(__pyx_v_self->iset, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 274, __pyx_L1_error) /* "PETSc/IS.pyx":275 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISGetBlockSize(self.iset, &bs) ) * CHKERR( ISBlockGetIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * cdef object oindices = None * try: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockGetIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 275, __pyx_L1_error) /* "PETSc/IS.pyx":276 * CHKERR( ISGetBlockSize(self.iset, &bs) ) * CHKERR( ISBlockGetIndices(self.iset, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size//bs, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "PETSc/IS.pyx":277 * CHKERR( ISBlockGetIndices(self.iset, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size//bs, indices) * finally: */ /*try:*/ { /* "PETSc/IS.pyx":278 * cdef object oindices = None * try: * oindices = array_i(size//bs, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISBlockRestoreIndices(self.iset, &indices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size / __pyx_v_bs), __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 278, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/IS.pyx":280 * oindices = array_i(size//bs, indices) * finally: * CHKERR( ISBlockRestoreIndices(self.iset, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 280, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_1 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBlockRestoreIndices(__pyx_v_self->iset, (&__pyx_v_indices))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(31, 280, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/IS.pyx":281 * finally: * CHKERR( ISBlockRestoreIndices(self.iset, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def setStride(self, size, first=0, step=1): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "PETSc/IS.pyx":270 * CHKERR( ISBlockSetIndices(self.iset, bs, nidx, idx, cm) ) * * def getBlockIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.IS.getBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":283 * return oindices * * def setStride(self, size, first=0, step=1): # <<<<<<<<<<<<<< * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85setStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_84setStride[] = "IS.setStride(self, size, first=0, step=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85setStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_first = 0; PyObject *__pyx_v_step = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStride (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_first,&__pyx_n_s_step,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)__pyx_int_0); values[2] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_first); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStride") < 0)) __PYX_ERR(31, 283, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_first = values[1]; __pyx_v_step = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStride", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 283, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_84setStride(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_size, __pyx_v_first, __pyx_v_step); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84setStride(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_first, PyObject *__pyx_v_step) { PetscInt __pyx_v_csize; PetscInt __pyx_v_cfirst; PetscInt __pyx_v_cstep; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStride", 0); /* "PETSc/IS.pyx":284 * * def setStride(self, size, first=0, step=1): * cdef PetscInt csize = asInt(size) # <<<<<<<<<<<<<< * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 284, __pyx_L1_error) __pyx_v_csize = __pyx_t_1; /* "PETSc/IS.pyx":285 * def setStride(self, size, first=0, step=1): * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) # <<<<<<<<<<<<<< * cdef PetscInt cstep = asInt(step) * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_first); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 285, __pyx_L1_error) __pyx_v_cfirst = __pyx_t_1; /* "PETSc/IS.pyx":286 * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) # <<<<<<<<<<<<<< * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 286, __pyx_L1_error) __pyx_v_cstep = __pyx_t_1; /* "PETSc/IS.pyx":287 * cdef PetscInt cfirst = asInt(first) * cdef PetscInt cstep = asInt(step) * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) # <<<<<<<<<<<<<< * * def getStride(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISStrideSetStride(__pyx_v_self->iset, __pyx_v_csize, __pyx_v_cfirst, __pyx_v_cstep)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 287, __pyx_L1_error) /* "PETSc/IS.pyx":283 * return oindices * * def setStride(self, size, first=0, step=1): # <<<<<<<<<<<<<< * cdef PetscInt csize = asInt(size) * cdef PetscInt cfirst = asInt(first) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.IS.setStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":289 * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) * * def getStride(self): # <<<<<<<<<<<<<< * cdef PetscInt size=0, first=0, step=0 * CHKERR( ISGetLocalSize(self.iset, &size) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_87getStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_86getStride[] = "IS.getStride(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_87getStride(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStride (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStride", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStride", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_86getStride(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86getStride(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt __pyx_v_first; PetscInt __pyx_v_step; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStride", 0); /* "PETSc/IS.pyx":290 * * def getStride(self): * cdef PetscInt size=0, first=0, step=0 # <<<<<<<<<<<<<< * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) */ __pyx_v_size = 0; __pyx_v_first = 0; __pyx_v_step = 0; /* "PETSc/IS.pyx":291 * def getStride(self): * cdef PetscInt size=0, first=0, step=0 * CHKERR( ISGetLocalSize(self.iset, &size) ) # <<<<<<<<<<<<<< * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(size), toInt(first), toInt(step)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGetLocalSize(__pyx_v_self->iset, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 291, __pyx_L1_error) /* "PETSc/IS.pyx":292 * cdef PetscInt size=0, first=0, step=0 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) # <<<<<<<<<<<<<< * return (toInt(size), toInt(first), toInt(step)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISStrideGetInfo(__pyx_v_self->iset, (&__pyx_v_first), (&__pyx_v_step))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 292, __pyx_L1_error) /* "PETSc/IS.pyx":293 * CHKERR( ISGetLocalSize(self.iset, &size) ) * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(size), toInt(first), toInt(step)) # <<<<<<<<<<<<<< * * def getInfo(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_first); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":289 * CHKERR( ISStrideSetStride(self.iset, csize, cfirst, cstep) ) * * def getStride(self): # <<<<<<<<<<<<<< * cdef PetscInt size=0, first=0, step=0 * CHKERR( ISGetLocalSize(self.iset, &size) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.IS.getStride", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":295 * return (toInt(size), toInt(first), toInt(step)) * * def getInfo(self): # <<<<<<<<<<<<<< * cdef PetscInt first = 0, step = 0 * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_89getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2IS_88getInfo[] = "IS.getInfo(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_89getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInfo (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_88getInfo(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88getInfo(struct PyPetscISObject *__pyx_v_self) { PetscInt __pyx_v_first; PetscInt __pyx_v_step; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInfo", 0); /* "PETSc/IS.pyx":296 * * def getInfo(self): * cdef PetscInt first = 0, step = 0 # <<<<<<<<<<<<<< * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(first), toInt(step)) */ __pyx_v_first = 0; __pyx_v_step = 0; /* "PETSc/IS.pyx":297 * def getInfo(self): * cdef PetscInt first = 0, step = 0 * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) # <<<<<<<<<<<<<< * return (toInt(first), toInt(step)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISStrideGetInfo(__pyx_v_self->iset, (&__pyx_v_first), (&__pyx_v_step))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 297, __pyx_L1_error) /* "PETSc/IS.pyx":298 * cdef PetscInt first = 0, step = 0 * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) * return (toInt(first), toInt(step)) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_first); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_step); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":295 * return (toInt(size), toInt(first), toInt(step)) * * def getInfo(self): # <<<<<<<<<<<<<< * cdef PetscInt first = 0, step = 0 * CHKERR( ISStrideGetInfo(self.iset, &first, &step) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.IS.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":303 * * property permutation: * def __get__(self): # <<<<<<<<<<<<<< * return self.isPermutation() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11permutation_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_11permutation_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_11permutation___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":304 * property permutation: * def __get__(self): * return self.isPermutation() # <<<<<<<<<<<<<< * * property identity: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isPermutation); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":303 * * property permutation: * def __get__(self): # <<<<<<<<<<<<<< * return self.isPermutation() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.permutation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":307 * * property identity: * def __get__(self): # <<<<<<<<<<<<<< * return self.isIdentity() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_8identity_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_8identity_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_8identity___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":308 * property identity: * def __get__(self): * return self.isIdentity() # <<<<<<<<<<<<<< * * property sorted: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isIdentity); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":307 * * property identity: * def __get__(self): # <<<<<<<<<<<<<< * return self.isIdentity() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.identity.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":311 * * property sorted: * def __get__(self): # <<<<<<<<<<<<<< * return self.isSorted() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_6sorted_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_6sorted_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_6sorted___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":312 * property sorted: * def __get__(self): * return self.isSorted() # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":311 * * property sorted: * def __get__(self): # <<<<<<<<<<<<<< * return self.isSorted() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.sorted.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":317 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5sizes___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":318 * property sizes: * def __get__(self): * return self.getSizes() # <<<<<<<<<<<<<< * * property size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":317 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":321 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_4size___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":322 * property size: * def __get__(self): * return self.getSize() # <<<<<<<<<<<<<< * * property local_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":321 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":325 * * property local_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10local_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10local_size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10local_size___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":326 * property local_size: * def __get__(self): * return self.getLocalSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":325 * * property local_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":329 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_10block_size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_10block_size___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":330 * property block_size: * def __get__(self): * return self.getBlockSize() # <<<<<<<<<<<<<< * * property indices: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":329 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":333 * * property indices: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIndices() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_7indices_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_7indices___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":334 * property indices: * def __get__(self): * return self.getIndices() # <<<<<<<<<<<<<< * * property array: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":333 * * property indices: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIndices() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.IS.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":337 * * property array: * def __get__(self): # <<<<<<<<<<<<<< * return asarray(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5array_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_5array_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_5array___get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_5array___get__(struct PyPetscISObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":338 * property array: * def __get__(self): * return asarray(self) # <<<<<<<<<<<<<< * * # --- NumPy array interface (legacy) --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":337 * * property array: * def __get__(self): # <<<<<<<<<<<<<< * return asarray(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.array.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":343 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * return buf.__array_interface__ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_19__array_interface___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(((struct PyPetscISObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_19__array_interface_____get__(struct PyPetscISObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":344 * property __array_interface__: * def __get__(self): * cdef _IS_buffer buf = _IS_buffer(self) # <<<<<<<<<<<<<< * return buf.__array_interface__ * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__IS_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":345 * def __get__(self): * cdef _IS_buffer buf = _IS_buffer(self) * return buf.__array_interface__ # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_buf), __pyx_n_s_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":343 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef _IS_buffer buf = _IS_buffer(self) * return buf.__array_interface__ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.IS.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":369 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.lgm * self.lgm = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_5LGMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_5LGMap_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_5LGMap___cinit__(struct PyPetscLGMapObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/IS.pyx":370 * * def __cinit__(self): * self.obj = &self.lgm # <<<<<<<<<<<<<< * self.lgm = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->lgm)); /* "PETSc/IS.pyx":371 * def __cinit__(self): * self.obj = &self.lgm * self.lgm = NULL # <<<<<<<<<<<<<< * * def __call__(self, indices, result=None): */ __pyx_v_self->lgm = NULL; /* "PETSc/IS.pyx":369 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.lgm * self.lgm = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":373 * self.lgm = NULL * * def __call__(self, indices, result=None): # <<<<<<<<<<<<<< * self.apply(indices, result) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(31, 373, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_result = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 373, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_2__call__(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); /* "PETSc/IS.pyx":374 * * def __call__(self, indices, result=None): * self.apply(indices, result) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_indices, __pyx_v_result}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 374, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_indices, __pyx_v_result}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 374, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_indices); __Pyx_GIVEREF(__pyx_v_indices); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_indices); __Pyx_INCREF(__pyx_v_result); __Pyx_GIVEREF(__pyx_v_result); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_result); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":373 * self.lgm = NULL * * def __call__(self, indices, result=None): # <<<<<<<<<<<<<< * self.apply(indices, result) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":378 * # * * def setType(self, lgmap_type): # <<<<<<<<<<<<<< * cdef PetscISLocalToGlobalMappingType cval = NULL * lgmap_type = str2bytes(lgmap_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_4setType[] = "LGMap.setType(self, lgmap_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lgmap_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lgmap_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lgmap_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(31, 378, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_lgmap_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 378, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4setType(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_lgmap_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4setType(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_lgmap_type) { ISLocalToGlobalMappingType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_lgmap_type); /* "PETSc/IS.pyx":379 * * def setType(self, lgmap_type): * cdef PetscISLocalToGlobalMappingType cval = NULL # <<<<<<<<<<<<<< * lgmap_type = str2bytes(lgmap_type, &cval) * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/IS.pyx":380 * def setType(self, lgmap_type): * cdef PetscISLocalToGlobalMappingType cval = NULL * lgmap_type = str2bytes(lgmap_type, &cval) # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_lgmap_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_lgmap_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":381 * cdef PetscISLocalToGlobalMappingType cval = NULL * lgmap_type = str2bytes(lgmap_type, &cval) * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingSetType(__pyx_v_self->lgm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 381, __pyx_L1_error) /* "PETSc/IS.pyx":378 * # * * def setType(self, lgmap_type): # <<<<<<<<<<<<<< * cdef PetscISLocalToGlobalMappingType cval = NULL * lgmap_type = str2bytes(lgmap_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lgmap_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":383 * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_6setFromOptions[] = "LGMap.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_6setFromOptions(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/IS.pyx":384 * * def setFromOptions(self): * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingSetFromOptions(__pyx_v_self->lgm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 384, __pyx_L1_error) /* "PETSc/IS.pyx":383 * CHKERR( ISLocalToGlobalMappingSetType(self.lgm, cval) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":386 * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_9view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_8view[] = "LGMap.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_9view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(31, 386, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 386, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(31, 386, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_8view(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_8view(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/IS.pyx":387 * * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) */ __pyx_v_cviewer = NULL; /* "PETSc/IS.pyx":388 * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_3; } /* "PETSc/IS.pyx":389 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingView(__pyx_v_self->lgm, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(31, 389, __pyx_L1_error) /* "PETSc/IS.pyx":386 * CHKERR( ISLocalToGlobalMappingSetFromOptions(self.lgm) ) * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":391 * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_10destroy[] = "LGMap.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10destroy(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/IS.pyx":392 * * def destroy(self): * CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingDestroy((&__pyx_v_self->lgm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 392, __pyx_L1_error) /* "PETSc/IS.pyx":393 * def destroy(self): * CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) ) * return self # <<<<<<<<<<<<<< * * def create(self, indices, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":391 * CHKERR( ISLocalToGlobalMappingView(self.lgm, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingDestroy(&self.lgm) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":395 * return self * * def create(self, indices, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 1, nidx = 0, *idx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_12create[] = "LGMap.create(self, indices, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(31, 395, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 395, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_12create(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12create(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PetscCopyMode __pyx_v_cm; ISLocalToGlobalMapping __pyx_v_newlgm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PetscInt __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/IS.pyx":396 * * def create(self, indices, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs = 1, nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 396, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/IS.pyx":397 * def create(self, indices, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 1, nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscLGMap newlgm = NULL */ __pyx_v_bs = 1; __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "PETSc/IS.pyx":398 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 1, nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscLGMap newlgm = NULL * if bsize is not None: bs = asInt(bsize) */ __pyx_v_cm = PETSC_COPY_VALUES; /* "PETSc/IS.pyx":399 * cdef PetscInt bs = 1, nidx = 0, *idx = NULL * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<< * if bsize is not None: bs = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_v_newlgm = NULL; /* "PETSc/IS.pyx":400 * cdef PetscCopyMode cm = PETSC_COPY_VALUES * cdef PetscLGMap newlgm = NULL * if bsize is not None: bs = asInt(bsize) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * indices = iarray_i(indices, &nidx, &idx) */ __pyx_t_2 = (__pyx_v_bsize != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 400, __pyx_L1_error) __pyx_v_bs = __pyx_t_4; } /* "PETSc/IS.pyx":401 * cdef PetscLGMap newlgm = NULL * if bsize is not None: bs = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISLocalToGlobalMappingCreate( */ __pyx_t_3 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_bs = 1; } /* "PETSc/IS.pyx":402 * if bsize is not None: bs = asInt(bsize) * if bs == PETSC_DECIDE: bs = 1 * indices = iarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingCreate( * ccomm, bs, nidx, idx, cm, &newlgm) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/IS.pyx":403 * if bs == PETSC_DECIDE: bs = 1 * indices = iarray_i(indices, &nidx, &idx) * CHKERR( ISLocalToGlobalMappingCreate( # <<<<<<<<<<<<<< * ccomm, bs, nidx, idx, cm, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingCreate(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_nidx, __pyx_v_idx, __pyx_v_cm, (&__pyx_v_newlgm))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(31, 403, __pyx_L1_error) /* "PETSc/IS.pyx":405 * CHKERR( ISLocalToGlobalMappingCreate( * ccomm, bs, nidx, idx, cm, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->lgm = __pyx_v_newlgm; /* "PETSc/IS.pyx":406 * ccomm, bs, nidx, idx, cm, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm * return self # <<<<<<<<<<<<<< * * def createIS(self, IS iset): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":395 * return self * * def create(self, indices, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 1, nidx = 0, *idx = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":408 * return self * * def createIS(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscLGMap newlgm = NULL * CHKERR( ISLocalToGlobalMappingCreateIS( */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_14createIS[] = "LGMap.createIS(self, IS iset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createIS") < 0)) __PYX_ERR(31, 408, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 408, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 408, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14createIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { ISLocalToGlobalMapping __pyx_v_newlgm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createIS", 0); /* "PETSc/IS.pyx":409 * * def createIS(self, IS iset): * cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingCreateIS( * iset.iset, &newlgm) ) */ __pyx_v_newlgm = NULL; /* "PETSc/IS.pyx":410 * def createIS(self, IS iset): * cdef PetscLGMap newlgm = NULL * CHKERR( ISLocalToGlobalMappingCreateIS( # <<<<<<<<<<<<<< * iset.iset, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingCreateIS(__pyx_v_iset->iset, (&__pyx_v_newlgm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 410, __pyx_L1_error) /* "PETSc/IS.pyx":412 * CHKERR( ISLocalToGlobalMappingCreateIS( * iset.iset, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->lgm = __pyx_v_newlgm; /* "PETSc/IS.pyx":413 * iset.iset, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm * return self # <<<<<<<<<<<<<< * * def createSF(self, SF sf, start): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":408 * return self * * def createIS(self, IS iset): # <<<<<<<<<<<<<< * cdef PetscLGMap newlgm = NULL * CHKERR( ISLocalToGlobalMappingCreateIS( */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":415 * return self * * def createSF(self, SF sf, start): # <<<<<<<<<<<<<< * cdef PetscLGMap newlgm = NULL * cdef PetscInt cstart = asInt(start) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_16createSF[] = "LGMap.createSF(self, SF sf, start)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_v_start = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,&__pyx_n_s_start,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createSF", 1, 2, 2, 1); __PYX_ERR(31, 415, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSF") < 0)) __PYX_ERR(31, 415, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); __pyx_v_start = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSF", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 415, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(31, 415, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_sf, __pyx_v_start); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_16createSF(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, PyObject *__pyx_v_start) { ISLocalToGlobalMapping __pyx_v_newlgm; PetscInt __pyx_v_cstart; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSF", 0); /* "PETSc/IS.pyx":416 * * def createSF(self, SF sf, start): * cdef PetscLGMap newlgm = NULL # <<<<<<<<<<<<<< * cdef PetscInt cstart = asInt(start) * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) */ __pyx_v_newlgm = NULL; /* "PETSc/IS.pyx":417 * def createSF(self, SF sf, start): * cdef PetscLGMap newlgm = NULL * cdef PetscInt cstart = asInt(start) # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_start); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(31, 417, __pyx_L1_error) __pyx_v_cstart = __pyx_t_1; /* "PETSc/IS.pyx":418 * cdef PetscLGMap newlgm = NULL * cdef PetscInt cstart = asInt(start) * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.lgm = newlgm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingCreateSF(__pyx_v_sf->sf, __pyx_v_cstart, (&__pyx_v_newlgm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 418, __pyx_L1_error) /* "PETSc/IS.pyx":419 * cdef PetscInt cstart = asInt(start) * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->lgm = __pyx_v_newlgm; /* "PETSc/IS.pyx":420 * CHKERR( ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm) ) * PetscCLEAR(self.obj); self.lgm = newlgm * return self # <<<<<<<<<<<<<< * * def getSize(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/IS.pyx":415 * return self * * def createSF(self, SF sf, start): # <<<<<<<<<<<<<< * cdef PetscLGMap newlgm = NULL * cdef PetscInt cstart = asInt(start) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.createSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":422 * return self * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_18getSize[] = "LGMap.getSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18getSize(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 0); /* "PETSc/IS.pyx":423 * * def getSize(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/IS.pyx":424 * def getSize(self): * cdef PetscInt n = 0 * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetSize(__pyx_v_self->lgm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 424, __pyx_L1_error) /* "PETSc/IS.pyx":425 * cdef PetscInt n = 0 * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getBlockSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":422 * return self * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( ISLocalToGlobalMappingGetSize(self.lgm, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":427 * return toInt(n) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 1 * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_20getBlockSize[] = "LGMap.getBlockSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getBlockSize(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 0); /* "PETSc/IS.pyx":428 * * def getBlockSize(self): * cdef PetscInt bs = 1 # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) * return toInt(bs) */ __pyx_v_bs = 1; /* "PETSc/IS.pyx":429 * def getBlockSize(self): * cdef PetscInt bs = 1 * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockSize(__pyx_v_self->lgm, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 429, __pyx_L1_error) /* "PETSc/IS.pyx":430 * cdef PetscInt bs = 1 * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def getIndices(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":427 * return toInt(n) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 1 * CHKERR( ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":432 * return toInt(bs) * * def getIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_22getIndices[] = "LGMap.getIndices(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIndices (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getIndices(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIndices", 0); /* "PETSc/IS.pyx":433 * * def getIndices(self): * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( */ __pyx_v_size = 0; /* "PETSc/IS.pyx":434 * def getIndices(self): * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) */ __pyx_v_indices = NULL; /* "PETSc/IS.pyx":435 * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( # <<<<<<<<<<<<<< * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetIndices( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetSize(__pyx_v_self->lgm, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 435, __pyx_L1_error) /* "PETSc/IS.pyx":437 * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 437, __pyx_L1_error) /* "PETSc/IS.pyx":439 * CHKERR( ISLocalToGlobalMappingGetIndices( * self.lgm, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "PETSc/IS.pyx":440 * self.lgm, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size, indices) * finally: */ /*try:*/ { /* "PETSc/IS.pyx":441 * cdef object oindices = None * try: * oindices = array_i(size, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_size, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 441, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/IS.pyx":443 * oindices = array_i(size, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ /*finally:*/ { /*normal exit:*/{ /* "PETSc/IS.pyx":444 * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( * self.lgm, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 443, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_1 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "PETSc/IS.pyx":443 * oindices = array_i(size, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(31, 443, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/IS.pyx":445 * CHKERR( ISLocalToGlobalMappingRestoreIndices( * self.lgm, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def getBlockIndices(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "PETSc/IS.pyx":432 * return toInt(bs) * * def getIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef const PetscInt *indices = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":447 * return oindices * * def getBlockIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_24getBlockIndices[] = "LGMap.getBlockIndices(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockIndices (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockIndices", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockIndices", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getBlockIndices(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_size; PetscInt __pyx_v_bs; PetscInt const *__pyx_v_indices; PyObject *__pyx_v_oindices = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockIndices", 0); /* "PETSc/IS.pyx":448 * * def getBlockIndices(self): * cdef PetscInt size = 0, bs = 1 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( */ __pyx_v_size = 0; __pyx_v_bs = 1; /* "PETSc/IS.pyx":449 * def getBlockIndices(self): * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) */ __pyx_v_indices = NULL; /* "PETSc/IS.pyx":450 * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL * CHKERR( ISLocalToGlobalMappingGetSize( # <<<<<<<<<<<<<< * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetBlockSize( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetSize(__pyx_v_self->lgm, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 450, __pyx_L1_error) /* "PETSc/IS.pyx":452 * CHKERR( ISLocalToGlobalMappingGetSize( * self.lgm, &size) ) * CHKERR( ISLocalToGlobalMappingGetBlockSize( # <<<<<<<<<<<<<< * self.lgm, &bs) ) * CHKERR( ISLocalToGlobalMappingGetBlockIndices( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockSize(__pyx_v_self->lgm, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 452, __pyx_L1_error) /* "PETSc/IS.pyx":454 * CHKERR( ISLocalToGlobalMappingGetBlockSize( * self.lgm, &bs) ) * CHKERR( ISLocalToGlobalMappingGetBlockIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * cdef object oindices = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 454, __pyx_L1_error) /* "PETSc/IS.pyx":456 * CHKERR( ISLocalToGlobalMappingGetBlockIndices( * self.lgm, &indices) ) * cdef object oindices = None # <<<<<<<<<<<<<< * try: * oindices = array_i(size//bs, indices) */ __Pyx_INCREF(Py_None); __pyx_v_oindices = Py_None; /* "PETSc/IS.pyx":457 * self.lgm, &indices) ) * cdef object oindices = None * try: # <<<<<<<<<<<<<< * oindices = array_i(size//bs, indices) * finally: */ /*try:*/ { /* "PETSc/IS.pyx":458 * cdef object oindices = None * try: * oindices = array_i(size//bs, indices) # <<<<<<<<<<<<<< * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size / __pyx_v_bs), __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 458, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_oindices, __pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/IS.pyx":460 * oindices = array_i(size//bs, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ /*finally:*/ { /*normal exit:*/{ /* "PETSc/IS.pyx":461 * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( * self.lgm, &indices) ) # <<<<<<<<<<<<<< * return oindices * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreBlockIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(31, 460, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_1 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { /* "PETSc/IS.pyx":460 * oindices = array_i(size//bs, indices) * finally: * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( # <<<<<<<<<<<<<< * self.lgm, &indices) ) * return oindices */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingRestoreBlockIndices(__pyx_v_self->lgm, (&__pyx_v_indices))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(31, 460, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/IS.pyx":462 * CHKERR( ISLocalToGlobalMappingRestoreBlockIndices( * self.lgm, &indices) ) * return oindices # <<<<<<<<<<<<<< * * def getInfo(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_oindices); __pyx_r = __pyx_v_oindices; goto __pyx_L0; /* "PETSc/IS.pyx":447 * return oindices * * def getBlockIndices(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0, bs = 1 * cdef const PetscInt *indices = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getBlockIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_oindices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":464 * return oindices * * def getInfo(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_26getInfo[] = "LGMap.getInfo(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInfo (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getInfo(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_nproc; PetscInt *__pyx_v_procs; PetscInt *__pyx_v_numprocs; PetscInt **__pyx_v_indices; PyObject *__pyx_v_neighs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInfo", 0); /* "PETSc/IS.pyx":465 * * def getInfo(self): * cdef PetscInt i, nproc = 0, *procs = NULL, # <<<<<<<<<<<<<< * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } */ __pyx_v_nproc = 0; __pyx_v_procs = NULL; /* "PETSc/IS.pyx":466 * def getInfo(self): * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL # <<<<<<<<<<<<<< * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetInfo( */ __pyx_v_numprocs = NULL; __pyx_v_indices = NULL; /* "PETSc/IS.pyx":467 * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_neighs = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/IS.pyx":468 * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 468, __pyx_L1_error) /* "PETSc/IS.pyx":470 * CHKERR( ISLocalToGlobalMappingGetInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: # <<<<<<<<<<<<<< * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) */ /*try:*/ { /* "PETSc/IS.pyx":471 * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: * for i from 0 <= i < nproc: # <<<<<<<<<<<<<< * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: */ __pyx_t_3 = __pyx_v_nproc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/IS.pyx":472 * try: * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) # <<<<<<<<<<<<<< * finally: * ISLocalToGlobalMappingRestoreInfo( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_numprocs[__pyx_v_i]), (__pyx_v_indices[__pyx_v_i]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 472, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_procs[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 472, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyObject_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(31, 472, __pyx_L4_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } /* "PETSc/IS.pyx":474 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ /*finally:*/ { /*normal exit:*/{ /* "PETSc/IS.pyx":475 * finally: * ISLocalToGlobalMappingRestoreInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) # <<<<<<<<<<<<<< * return neighs * */ (void)(ISLocalToGlobalMappingRestoreInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_2 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { /* "PETSc/IS.pyx":474 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ (void)(ISLocalToGlobalMappingRestoreInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/IS.pyx":476 * ISLocalToGlobalMappingRestoreInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs # <<<<<<<<<<<<<< * * def getBlockInfo(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_neighs); __pyx_r = __pyx_v_neighs; goto __pyx_L0; /* "PETSc/IS.pyx":464 * return oindices * * def getInfo(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_neighs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":478 * return neighs * * def getBlockInfo(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_28getBlockInfo[] = "LGMap.getBlockInfo(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockInfo (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getBlockInfo(struct PyPetscLGMapObject *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_nproc; PetscInt *__pyx_v_procs; PetscInt *__pyx_v_numprocs; PetscInt **__pyx_v_indices; PyObject *__pyx_v_neighs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockInfo", 0); /* "PETSc/IS.pyx":479 * * def getBlockInfo(self): * cdef PetscInt i, nproc = 0, *procs = NULL, # <<<<<<<<<<<<<< * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } */ __pyx_v_nproc = 0; __pyx_v_procs = NULL; /* "PETSc/IS.pyx":480 * def getBlockInfo(self): * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL # <<<<<<<<<<<<<< * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetBlockInfo( */ __pyx_v_numprocs = NULL; __pyx_v_indices = NULL; /* "PETSc/IS.pyx":481 * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingGetBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_neighs = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/IS.pyx":482 * cdef PetscInt *numprocs = NULL, **indices = NULL * cdef object neighs = { } * CHKERR( ISLocalToGlobalMappingGetBlockInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingGetBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 482, __pyx_L1_error) /* "PETSc/IS.pyx":484 * CHKERR( ISLocalToGlobalMappingGetBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: # <<<<<<<<<<<<<< * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) */ /*try:*/ { /* "PETSc/IS.pyx":485 * self.lgm, &nproc, &procs, &numprocs, &indices) ) * try: * for i from 0 <= i < nproc: # <<<<<<<<<<<<<< * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: */ __pyx_t_3 = __pyx_v_nproc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/IS.pyx":486 * try: * for i from 0 <= i < nproc: * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) # <<<<<<<<<<<<<< * finally: * ISLocalToGlobalMappingRestoreBlockInfo( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_numprocs[__pyx_v_i]), (__pyx_v_indices[__pyx_v_i]))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 486, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_procs[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 486, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyObject_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(31, 486, __pyx_L4_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } /* "PETSc/IS.pyx":488 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreBlockInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ /*finally:*/ { /*normal exit:*/{ /* "PETSc/IS.pyx":489 * finally: * ISLocalToGlobalMappingRestoreBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) # <<<<<<<<<<<<<< * return neighs * */ (void)(ISLocalToGlobalMappingRestoreBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_2 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { /* "PETSc/IS.pyx":488 * neighs[toInt(procs[i])] = array_i(numprocs[i], indices[i]) * finally: * ISLocalToGlobalMappingRestoreBlockInfo( # <<<<<<<<<<<<<< * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs */ (void)(ISLocalToGlobalMappingRestoreBlockInfo(__pyx_v_self->lgm, (&__pyx_v_nproc), (&__pyx_v_procs), (&__pyx_v_numprocs), (&__pyx_v_indices))); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/IS.pyx":490 * ISLocalToGlobalMappingRestoreBlockInfo( * self.lgm, &nproc, &procs, &numprocs, &indices) * return neighs # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_neighs); __pyx_r = __pyx_v_neighs; goto __pyx_L0; /* "PETSc/IS.pyx":478 * return neighs * * def getBlockInfo(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nproc = 0, *procs = NULL, * cdef PetscInt *numprocs = NULL, **indices = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.getBlockInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_neighs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":494 * # * * def apply(self, indices, result=None): # <<<<<<<<<<<<<< * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_30apply[] = "LGMap.apply(self, indices, result=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(31, 494, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_result = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("apply", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 494, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30apply(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) { PetscInt __pyx_v_niidx; PetscInt *__pyx_v_iidx; PetscInt __pyx_v_noidx; PetscInt *__pyx_v_oidx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 0); __Pyx_INCREF(__pyx_v_indices); __Pyx_INCREF(__pyx_v_result); /* "PETSc/IS.pyx":495 * * def apply(self, indices, result=None): * cdef PetscInt niidx = 0, *iidx = NULL # <<<<<<<<<<<<<< * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) */ __pyx_v_niidx = 0; __pyx_v_iidx = NULL; /* "PETSc/IS.pyx":496 * def apply(self, indices, result=None): * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) */ __pyx_v_noidx = 0; __pyx_v_oidx = NULL; /* "PETSc/IS.pyx":497 * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) # <<<<<<<<<<<<<< * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_niidx), (&__pyx_v_iidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":498 * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) # <<<<<<<<<<<<<< * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_result == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_niidx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/IS.pyx":499 * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) # <<<<<<<<<<<<<< * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApply( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_result, (&__pyx_v_noidx), (&__pyx_v_oidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":500 * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingApply( * self.lgm, niidx, iidx, oidx) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_niidx == __pyx_v_noidx) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_incompatible_array_sizes); __PYX_ERR(31, 500, __pyx_L1_error) } } #endif /* "PETSc/IS.pyx":501 * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApply( # <<<<<<<<<<<<<< * self.lgm, niidx, iidx, oidx) ) * return result */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApply(__pyx_v_self->lgm, __pyx_v_niidx, __pyx_v_iidx, __pyx_v_oidx)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(31, 501, __pyx_L1_error) /* "PETSc/IS.pyx":503 * CHKERR( ISLocalToGlobalMappingApply( * self.lgm, niidx, iidx, oidx) ) * return result # <<<<<<<<<<<<<< * * def applyBlock(self, indices, result=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "PETSc/IS.pyx":494 * # * * def apply(self, indices, result=None): # <<<<<<<<<<<<<< * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":505 * return result * * def applyBlock(self, indices, result=None): # <<<<<<<<<<<<<< * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_32applyBlock[] = "LGMap.applyBlock(self, indices, result=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyBlock (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_result,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyBlock") < 0)) __PYX_ERR(31, 505, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_result = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyBlock", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 505, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32applyBlock(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result) { PetscInt __pyx_v_niidx; PetscInt *__pyx_v_iidx; PetscInt __pyx_v_noidx; PetscInt *__pyx_v_oidx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyBlock", 0); __Pyx_INCREF(__pyx_v_indices); __Pyx_INCREF(__pyx_v_result); /* "PETSc/IS.pyx":506 * * def applyBlock(self, indices, result=None): * cdef PetscInt niidx = 0, *iidx = NULL # <<<<<<<<<<<<<< * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) */ __pyx_v_niidx = 0; __pyx_v_iidx = NULL; /* "PETSc/IS.pyx":507 * def applyBlock(self, indices, result=None): * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) */ __pyx_v_noidx = 0; __pyx_v_oidx = NULL; /* "PETSc/IS.pyx":508 * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) # <<<<<<<<<<<<<< * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_niidx), (&__pyx_v_iidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":509 * cdef PetscInt noidx = 0, *oidx = NULL * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) # <<<<<<<<<<<<<< * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_result == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_niidx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/IS.pyx":510 * indices = iarray_i(indices, &niidx, &iidx) * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) # <<<<<<<<<<<<<< * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApplyBlock( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_result, (&__pyx_v_noidx), (&__pyx_v_oidx))); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":511 * if result is None: result = empty_i(niidx) * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingApplyBlock( * self.lgm, niidx, iidx, oidx) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_niidx == __pyx_v_noidx) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_incompatible_array_sizes); __PYX_ERR(31, 511, __pyx_L1_error) } } #endif /* "PETSc/IS.pyx":512 * result = oarray_i(result, &noidx, &oidx) * assert niidx == noidx, "incompatible array sizes" * CHKERR( ISLocalToGlobalMappingApplyBlock( # <<<<<<<<<<<<<< * self.lgm, niidx, iidx, oidx) ) * return result */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApplyBlock(__pyx_v_self->lgm, __pyx_v_niidx, __pyx_v_iidx, __pyx_v_oidx)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(31, 512, __pyx_L1_error) /* "PETSc/IS.pyx":514 * CHKERR( ISLocalToGlobalMappingApplyBlock( * self.lgm, niidx, iidx, oidx) ) * return result # <<<<<<<<<<<<<< * * def applyIS(self, IS iset): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "PETSc/IS.pyx":505 * return result * * def applyBlock(self, indices, result=None): # <<<<<<<<<<<<<< * cdef PetscInt niidx = 0, *iidx = NULL * cdef PetscInt noidx = 0, *oidx = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":516 * return result * * def applyIS(self, IS iset): # <<<<<<<<<<<<<< * cdef IS result = IS() * CHKERR( ISLocalToGlobalMappingApplyIS( */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_34applyIS[] = "LGMap.applyIS(self, IS iset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyIS") < 0)) __PYX_ERR(31, 516, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 516, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(31, 516, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset) { struct PyPetscISObject *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyIS", 0); /* "PETSc/IS.pyx":517 * * def applyIS(self, IS iset): * cdef IS result = IS() # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingApplyIS( * self.lgm, iset.iset, &result.iset) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/IS.pyx":518 * def applyIS(self, IS iset): * cdef IS result = IS() * CHKERR( ISLocalToGlobalMappingApplyIS( # <<<<<<<<<<<<<< * self.lgm, iset.iset, &result.iset) ) * return result */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApplyIS(__pyx_v_self->lgm, __pyx_v_iset->iset, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(31, 518, __pyx_L1_error) /* "PETSc/IS.pyx":520 * CHKERR( ISLocalToGlobalMappingApplyIS( * self.lgm, iset.iset, &result.iset) ) * return result # <<<<<<<<<<<<<< * * def applyInverse(self, indices, mode=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/IS.pyx":516 * return result * * def applyIS(self, IS iset): # <<<<<<<<<<<<<< * cdef IS result = IS() * CHKERR( ISLocalToGlobalMappingApplyIS( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":522 * return result * * def applyInverse(self, indices, mode=None): # <<<<<<<<<<<<<< * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_36applyInverse[] = "LGMap.applyInverse(self, indices, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyInverse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_mode,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyInverse") < 0)) __PYX_ERR(31, 522, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyInverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 522, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode) { ISGlobalToLocalMappingMode __pyx_v_cmode; PetscInt __pyx_v_n; PetscInt *__pyx_v_idx; PetscInt __pyx_v_nout; PetscInt *__pyx_v_idxout; PyArrayObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; ISGlobalToLocalMappingMode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyInverse", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/IS.pyx":523 * * def applyInverse(self, indices, mode=None): * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK # <<<<<<<<<<<<<< * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL */ __pyx_v_cmode = IS_GTOLM_MASK; /* "PETSc/IS.pyx":524 * def applyInverse(self, indices, mode=None): * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode # <<<<<<<<<<<<<< * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) */ __pyx_t_1 = (__pyx_v_mode != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = ((ISGlobalToLocalMappingMode)__Pyx_PyInt_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 524, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; } /* "PETSc/IS.pyx":525 * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL */ __pyx_v_n = 0; __pyx_v_idx = NULL; /* "PETSc/IS.pyx":526 * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) # <<<<<<<<<<<<<< * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_n), (&__pyx_v_idx))); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/IS.pyx":527 * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL # <<<<<<<<<<<<<< * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( */ __pyx_v_nout = __pyx_v_n; __pyx_v_idxout = NULL; /* "PETSc/IS.pyx":528 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ __pyx_t_2 = ((__pyx_v_cmode != IS_GTOLM_MASK) != 0); if (__pyx_t_2) { /* "PETSc/IS.pyx":529 * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApply(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(31, 529, __pyx_L1_error) /* "PETSc/IS.pyx":528 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ } /* "PETSc/IS.pyx":531 * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, idxout) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_nout)); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_4, (&__pyx_v_nout), (&__pyx_v_idxout))); if (unlikely(!__pyx_t_6)) __PYX_ERR(31, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_result = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/IS.pyx":532 * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) * CHKERR( ISGlobalToLocalMappingApply( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, idxout) ) * return result */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApply(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), __pyx_v_idxout)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(31, 532, __pyx_L1_error) /* "PETSc/IS.pyx":534 * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, idxout) ) * return result # <<<<<<<<<<<<<< * * def applyBlockInverse(self, indices, mode=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/IS.pyx":522 * return result * * def applyInverse(self, indices, mode=None): # <<<<<<<<<<<<<< * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":536 * return result * * def applyBlockInverse(self, indices, mode=None): # <<<<<<<<<<<<<< * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_5LGMap_38applyBlockInverse[] = "LGMap.applyBlockInverse(self, indices, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyBlockInverse (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_mode,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyBlockInverse") < 0)) __PYX_ERR(31, 536, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyBlockInverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(31, 536, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlockInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyBlockInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode) { ISGlobalToLocalMappingMode __pyx_v_cmode; PetscInt __pyx_v_n; PetscInt *__pyx_v_idx; PetscInt __pyx_v_nout; PetscInt *__pyx_v_idxout; PyArrayObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; ISGlobalToLocalMappingMode __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyBlockInverse", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/IS.pyx":537 * * def applyBlockInverse(self, indices, mode=None): * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK # <<<<<<<<<<<<<< * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL */ __pyx_v_cmode = IS_GTOLM_MASK; /* "PETSc/IS.pyx":538 * def applyBlockInverse(self, indices, mode=None): * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode # <<<<<<<<<<<<<< * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) */ __pyx_t_1 = (__pyx_v_mode != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = ((ISGlobalToLocalMappingMode)__Pyx_PyInt_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(31, 538, __pyx_L1_error) __pyx_v_cmode = __pyx_t_3; } /* "PETSc/IS.pyx":539 * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL */ __pyx_v_n = 0; __pyx_v_idx = NULL; /* "PETSc/IS.pyx":540 * if mode is not None: cmode = mode * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) # <<<<<<<<<<<<<< * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_n), (&__pyx_v_idx))); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/IS.pyx":541 * cdef PetscInt n = 0, *idx = NULL * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL # <<<<<<<<<<<<<< * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( */ __pyx_v_nout = __pyx_v_n; __pyx_v_idxout = NULL; /* "PETSc/IS.pyx":542 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ __pyx_t_2 = ((__pyx_v_cmode != IS_GTOLM_MASK) != 0); if (__pyx_t_2) { /* "PETSc/IS.pyx":543 * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: * CHKERR( ISGlobalToLocalMappingApply( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApply(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(31, 543, __pyx_L1_error) /* "PETSc/IS.pyx":542 * indices = iarray_i(indices, &n, &idx) * cdef PetscInt nout = n, *idxout = NULL * if cmode != PETSC_IS_GTOLM_MASK: # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) */ } /* "PETSc/IS.pyx":545 * CHKERR( ISGlobalToLocalMappingApply( * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) # <<<<<<<<<<<<<< * CHKERR( ISGlobalToLocalMappingApplyBlock( * self.lgm, cmode, n, idx, &nout, idxout) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_nout)); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_4, (&__pyx_v_nout), (&__pyx_v_idxout))); if (unlikely(!__pyx_t_6)) __PYX_ERR(31, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_result = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/IS.pyx":546 * self.lgm, cmode, n, idx, &nout, NULL) ) * result = oarray_i(empty_i(nout), &nout, &idxout) * CHKERR( ISGlobalToLocalMappingApplyBlock( # <<<<<<<<<<<<<< * self.lgm, cmode, n, idx, &nout, idxout) ) * return result */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISGlobalToLocalMappingApplyBlock(__pyx_v_self->lgm, __pyx_v_cmode, __pyx_v_n, __pyx_v_idx, (&__pyx_v_nout), __pyx_v_idxout)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(31, 546, __pyx_L1_error) /* "PETSc/IS.pyx":548 * CHKERR( ISGlobalToLocalMappingApplyBlock( * self.lgm, cmode, n, idx, &nout, idxout) ) * return result # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/IS.pyx":536 * return result * * def applyBlockInverse(self, indices, mode=None): # <<<<<<<<<<<<<< * cdef PetscGLMapMode cmode = PETSC_IS_GTOLM_MASK * if mode is not None: cmode = mode */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.applyBlockInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":552 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4size___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":553 * property size: * def __get__(self): * return self.getSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":552 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":556 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_size___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":557 * property block_size: * def __get__(self): * return self.getBlockSize() # <<<<<<<<<<<<<< * * property indices: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":556 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":560 * * property indices: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIndices() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7indices_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_7indices_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_7indices___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":561 * property indices: * def __get__(self): * return self.getIndices() # <<<<<<<<<<<<<< * * property block_indices: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":560 * * property indices: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIndices() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":564 * * property block_indices: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockIndices() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13block_indices_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_13block_indices_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_13block_indices___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":565 * property block_indices: * def __get__(self): * return self.getBlockIndices() # <<<<<<<<<<<<<< * * property info: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockIndices); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":564 * * property block_indices: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockIndices() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_indices.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":568 * * property info: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInfo() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4info_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_4info_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_4info___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":569 * property info: * def __get__(self): * return self.getInfo() # <<<<<<<<<<<<<< * * property block_info: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":568 * * property info: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInfo() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/IS.pyx":572 * * property block_info: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockInfo() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_info_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_10block_info_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(((struct PyPetscLGMapObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10block_info___get__(struct PyPetscLGMapObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/IS.pyx":573 * property block_info: * def __get__(self): * return self.getBlockInfo() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockInfo); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/IS.pyx":572 * * property block_info: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockInfo() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.LGMap.block_info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":19 * Type = SFType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sf * self.sf = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2SF_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2SF_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2SF___cinit__(struct PyPetscSFObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/SF.pyx":20 * * def __cinit__(self): * self.obj = &self.sf # <<<<<<<<<<<<<< * self.sf = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->sf)); /* "PETSc/SF.pyx":21 * def __cinit__(self): * self.obj = &self.sf * self.sf = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->sf = NULL; /* "PETSc/SF.pyx":19 * Type = SFType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sf * self.sf = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":23 * self.sf = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFDestroy(&self.sf) ) * self.sf = NULL */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_2SF_2__dealloc__(struct PyPetscSFObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/SF.pyx":24 * * def __dealloc__(self): * CHKERR( PetscSFDestroy(&self.sf) ) # <<<<<<<<<<<<<< * self.sf = NULL * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFDestroy((&__pyx_v_self->sf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 24, __pyx_L1_error) /* "PETSc/SF.pyx":25 * def __dealloc__(self): * CHKERR( PetscSFDestroy(&self.sf) ) * self.sf = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_v_self->sf = NULL; /* "PETSc/SF.pyx":23 * self.sf = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFDestroy(&self.sf) ) * self.sf = NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.SF.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/SF.pyx":27 * self.sf = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_4view[] = "SF.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(32, 27, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 27, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(32, 27, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_4view(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4view(struct PyPetscSFObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/SF.pyx":28 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSFView(self.sf, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/SF.pyx":29 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscSFView(self.sf, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/SF.pyx":30 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSFView(self.sf, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFView(__pyx_v_self->sf, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(32, 30, __pyx_L1_error) /* "PETSc/SF.pyx":27 * self.sf = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":32 * CHKERR( PetscSFView(self.sf, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFDestroy(&self.sf) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_6destroy[] = "SF.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_6destroy(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6destroy(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/SF.pyx":33 * * def destroy(self): * CHKERR( PetscSFDestroy(&self.sf) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFDestroy((&__pyx_v_self->sf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 33, __pyx_L1_error) /* "PETSc/SF.pyx":34 * def destroy(self): * CHKERR( PetscSFDestroy(&self.sf) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/SF.pyx":32 * CHKERR( PetscSFView(self.sf, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFDestroy(&self.sf) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":36 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSF newsf = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_8create[] = "SF.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(32, 36, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 36, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_8create(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8create(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscSF __pyx_v_newsf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/SF.pyx":37 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSF newsf = NULL * CHKERR( PetscSFCreate(ccomm, &newsf) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 37, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/SF.pyx":38 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSF newsf = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSFCreate(ccomm, &newsf) ) * PetscCLEAR(self.obj); self.sf = newsf */ __pyx_v_newsf = NULL; /* "PETSc/SF.pyx":39 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSF newsf = NULL * CHKERR( PetscSFCreate(ccomm, &newsf) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.sf = newsf * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreate(__pyx_v_ccomm, (&__pyx_v_newsf))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 39, __pyx_L1_error) /* "PETSc/SF.pyx":40 * cdef PetscSF newsf = NULL * CHKERR( PetscSFCreate(ccomm, &newsf) ) * PetscCLEAR(self.obj); self.sf = newsf # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->sf = __pyx_v_newsf; /* "PETSc/SF.pyx":41 * CHKERR( PetscSFCreate(ccomm, &newsf) ) * PetscCLEAR(self.obj); self.sf = newsf * return self # <<<<<<<<<<<<<< * * def setType(self, sf_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/SF.pyx":36 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSF newsf = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":43 * return self * * def setType(self, sf_type): # <<<<<<<<<<<<<< * cdef PetscSFType cval = NULL * sf_type = str2bytes(sf_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_10setType[] = "SF.setType(self, sf_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sf_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(32, 43, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sf_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 43, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_10setType(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_sf_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10setType(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_sf_type) { PetscSFType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_sf_type); /* "PETSc/SF.pyx":44 * * def setType(self, sf_type): * cdef PetscSFType cval = NULL # <<<<<<<<<<<<<< * sf_type = str2bytes(sf_type, &cval) * CHKERR( PetscSFSetType(self.sf, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/SF.pyx":45 * def setType(self, sf_type): * cdef PetscSFType cval = NULL * sf_type = str2bytes(sf_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscSFSetType(self.sf, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_sf_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_sf_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SF.pyx":46 * cdef PetscSFType cval = NULL * sf_type = str2bytes(sf_type, &cval) * CHKERR( PetscSFSetType(self.sf, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetType(__pyx_v_self->sf, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 46, __pyx_L1_error) /* "PETSc/SF.pyx":43 * return self * * def setType(self, sf_type): # <<<<<<<<<<<<<< * cdef PetscSFType cval = NULL * sf_type = str2bytes(sf_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sf_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":48 * CHKERR( PetscSFSetType(self.sf, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscSFType cval = NULL * CHKERR( PetscSFGetType(self.sf, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_12getType[] = "SF.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_12getType(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12getType(struct PyPetscSFObject *__pyx_v_self) { PetscSFType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/SF.pyx":49 * * def getType(self): * cdef PetscSFType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSFGetType(self.sf, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/SF.pyx":50 * def getType(self): * cdef PetscSFType cval = NULL * CHKERR( PetscSFGetType(self.sf, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetType(__pyx_v_self->sf, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 50, __pyx_L1_error) /* "PETSc/SF.pyx":51 * cdef PetscSFType cval = NULL * CHKERR( PetscSFGetType(self.sf, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SF.pyx":48 * CHKERR( PetscSFSetType(self.sf, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscSFType cval = NULL * CHKERR( PetscSFGetType(self.sf, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":53 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFSetFromOptions(self.sf) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_14setFromOptions[] = "SF.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setFromOptions(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/SF.pyx":54 * * def setFromOptions(self): * CHKERR( PetscSFSetFromOptions(self.sf) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetFromOptions(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 54, __pyx_L1_error) /* "PETSc/SF.pyx":53 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFSetFromOptions(self.sf) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":56 * CHKERR( PetscSFSetFromOptions(self.sf) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFSetUp(self.sf) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_16setUp[] = "SF.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_16setUp(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16setUp(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/SF.pyx":57 * * def setUp(self): * CHKERR( PetscSFSetUp(self.sf) ) # <<<<<<<<<<<<<< * * def reset(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetUp(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 57, __pyx_L1_error) /* "PETSc/SF.pyx":56 * CHKERR( PetscSFSetFromOptions(self.sf) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFSetUp(self.sf) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":59 * CHKERR( PetscSFSetUp(self.sf) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFReset(self.sf) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_18reset[] = "SF.reset(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_18reset(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18reset(struct PyPetscSFObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); /* "PETSc/SF.pyx":60 * * def reset(self): * CHKERR( PetscSFReset(self.sf) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFReset(__pyx_v_self->sf)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 60, __pyx_L1_error) /* "PETSc/SF.pyx":59 * CHKERR( PetscSFSetUp(self.sf) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PetscSFReset(self.sf) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":64 * # * * def getGraph(self): # <<<<<<<<<<<<<< * """nleaves can be determined from the size of local""" * cdef PetscInt nroots = 0, nleaves = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_20getGraph[] = "SF.getGraph(self)\nnleaves can be determined from the size of local"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGraph (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGraph", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGraph", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20getGraph(struct PyPetscSFObject *__pyx_v_self) { PetscInt __pyx_v_nroots; PetscInt __pyx_v_nleaves; PetscInt const *__pyx_v_ilocal; PetscSFNode const *__pyx_v_iremote; PyArrayObject *__pyx_v_local = NULL; PyObject *__pyx_v_remote = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGraph", 0); /* "PETSc/SF.pyx":66 * def getGraph(self): * """nleaves can be determined from the size of local""" * cdef PetscInt nroots = 0, nleaves = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *ilocal = NULL * cdef const PetscSFNode *iremote = NULL */ __pyx_v_nroots = 0; __pyx_v_nleaves = 0; /* "PETSc/SF.pyx":67 * """nleaves can be determined from the size of local""" * cdef PetscInt nroots = 0, nleaves = 0 * cdef const PetscInt *ilocal = NULL # <<<<<<<<<<<<<< * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) */ __pyx_v_ilocal = NULL; /* "PETSc/SF.pyx":68 * cdef PetscInt nroots = 0, nleaves = 0 * cdef const PetscInt *ilocal = NULL * cdef const PetscSFNode *iremote = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: */ __pyx_v_iremote = NULL; /* "PETSc/SF.pyx":69 * cdef const PetscInt *ilocal = NULL * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) # <<<<<<<<<<<<<< * if ilocal == NULL: * local = arange(0, nleaves, 1) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetGraph(__pyx_v_self->sf, (&__pyx_v_nroots), (&__pyx_v_nleaves), (&__pyx_v_ilocal), (&__pyx_v_iremote))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 69, __pyx_L1_error) /* "PETSc/SF.pyx":70 * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: # <<<<<<<<<<<<<< * local = arange(0, nleaves, 1) * else: */ __pyx_t_2 = ((__pyx_v_ilocal == NULL) != 0); if (__pyx_t_2) { /* "PETSc/SF.pyx":71 * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: * local = arange(0, nleaves, 1) # <<<<<<<<<<<<<< * else: * local = array_i(nleaves, ilocal) */ __pyx_t_3 = __Pyx_PyInt_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_int_0, __pyx_t_3, __pyx_int_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_local = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/SF.pyx":70 * cdef const PetscSFNode *iremote = NULL * CHKERR( PetscSFGetGraph(self.sf, &nroots, &nleaves, &ilocal, &iremote) ) * if ilocal == NULL: # <<<<<<<<<<<<<< * local = arange(0, nleaves, 1) * else: */ goto __pyx_L3; } /* "PETSc/SF.pyx":73 * local = arange(0, nleaves, 1) * else: * local = array_i(nleaves, ilocal) # <<<<<<<<<<<<<< * remote = array_i(nleaves*2, iremote) * remote = remote.reshape(nleaves, 2) */ /*else*/ { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nleaves, __pyx_v_ilocal)); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_local = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "PETSc/SF.pyx":74 * else: * local = array_i(nleaves, ilocal) * remote = array_i(nleaves*2, iremote) # <<<<<<<<<<<<<< * remote = remote.reshape(nleaves, 2) * return toInt(nroots), local, remote */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_nleaves * 2), ((PetscInt const *)__pyx_v_iremote))); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_remote = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/SF.pyx":75 * local = array_i(nleaves, ilocal) * remote = array_i(nleaves*2, iremote) * remote = remote.reshape(nleaves, 2) # <<<<<<<<<<<<<< * return toInt(nroots), local, remote * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_remote, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_1 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_1 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_2}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 75, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_int_2}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 75, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_int_2); __Pyx_GIVEREF(__pyx_int_2); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_1, __pyx_int_2); __pyx_t_5 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_remote, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/SF.pyx":76 * remote = array_i(nleaves*2, iremote) * remote = remote.reshape(nleaves, 2) * return toInt(nroots), local, remote # <<<<<<<<<<<<<< * * def setGraph(self, nroots, local, remote): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nroots); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_local)); __Pyx_GIVEREF(((PyObject *)__pyx_v_local)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_local)); __Pyx_INCREF(__pyx_v_remote); __Pyx_GIVEREF(__pyx_v_remote); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_remote); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/SF.pyx":64 * # * * def getGraph(self): # <<<<<<<<<<<<<< * """nleaves can be determined from the size of local""" * cdef PetscInt nroots = 0, nleaves = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.SF.getGraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_local); __Pyx_XDECREF(__pyx_v_remote); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":78 * return toInt(nroots), local, remote * * def setGraph(self, nroots, local, remote): # <<<<<<<<<<<<<< * """ * The nleaves argument is determined from the size of local and/or remote. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_22setGraph[] = "SF.setGraph(self, nroots, local, remote)\n\n The nleaves argument is determined from the size of local and/or remote.\n local may be None, meaning contiguous storage.\n remote should be 2*nleaves long as (rank, index) pairs.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nroots = 0; PyObject *__pyx_v_local = 0; PyObject *__pyx_v_remote = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGraph (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nroots,&__pyx_n_s_local,&__pyx_n_s_remote,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nroots)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, 1); __PYX_ERR(32, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remote)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, 2); __PYX_ERR(32, 78, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGraph") < 0)) __PYX_ERR(32, 78, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_nroots = values[0]; __pyx_v_local = values[1]; __pyx_v_remote = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 78, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setGraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_nroots, __pyx_v_local, __pyx_v_remote); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_22setGraph(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_nroots, PyObject *__pyx_v_local, PyObject *__pyx_v_remote) { PetscInt __pyx_v_cnroots; PetscInt __pyx_v_nleaves; PetscInt __pyx_v_nremote; PetscInt *__pyx_v_ilocal; PetscSFNode *__pyx_v_iremote; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGraph", 0); __Pyx_INCREF(__pyx_v_local); __Pyx_INCREF(__pyx_v_remote); /* "PETSc/SF.pyx":84 * remote should be 2*nleaves long as (rank, index) pairs. * """ * cdef PetscInt cnroots = asInt(nroots) # <<<<<<<<<<<<<< * cdef PetscInt nleaves = 0 * cdef PetscInt nremote = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nroots); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(32, 84, __pyx_L1_error) __pyx_v_cnroots = __pyx_t_1; /* "PETSc/SF.pyx":85 * """ * cdef PetscInt cnroots = asInt(nroots) * cdef PetscInt nleaves = 0 # <<<<<<<<<<<<<< * cdef PetscInt nremote = 0 * cdef PetscInt *ilocal = NULL */ __pyx_v_nleaves = 0; /* "PETSc/SF.pyx":86 * cdef PetscInt cnroots = asInt(nroots) * cdef PetscInt nleaves = 0 * cdef PetscInt nremote = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ilocal = NULL * cdef PetscSFNode* iremote = NULL */ __pyx_v_nremote = 0; /* "PETSc/SF.pyx":87 * cdef PetscInt nleaves = 0 * cdef PetscInt nremote = 0 * cdef PetscInt *ilocal = NULL # <<<<<<<<<<<<<< * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) */ __pyx_v_ilocal = NULL; /* "PETSc/SF.pyx":88 * cdef PetscInt nremote = 0 * cdef PetscInt *ilocal = NULL * cdef PetscSFNode* iremote = NULL # <<<<<<<<<<<<<< * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: */ __pyx_v_iremote = NULL; /* "PETSc/SF.pyx":89 * cdef PetscInt *ilocal = NULL * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) # <<<<<<<<<<<<<< * if local is not None: * local = iarray_i(local, &nleaves, &ilocal) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_remote, (&__pyx_v_nremote), ((PetscInt **)(&__pyx_v_iremote)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_remote, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SF.pyx":90 * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: # <<<<<<<<<<<<<< * local = iarray_i(local, &nleaves, &ilocal) * assert 2*nleaves == nremote */ __pyx_t_3 = (__pyx_v_local != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/SF.pyx":91 * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: * local = iarray_i(local, &nleaves, &ilocal) # <<<<<<<<<<<<<< * assert 2*nleaves == nremote * else: */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_local, (&__pyx_v_nleaves), (&__pyx_v_ilocal))); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_local, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SF.pyx":92 * if local is not None: * local = iarray_i(local, &nleaves, &ilocal) * assert 2*nleaves == nremote # <<<<<<<<<<<<<< * else: * assert nremote % 2 == 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((2 * __pyx_v_nleaves) == __pyx_v_nremote) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(32, 92, __pyx_L1_error) } } #endif /* "PETSc/SF.pyx":90 * cdef PetscSFNode* iremote = NULL * remote = iarray_i(remote, &nremote, &iremote) * if local is not None: # <<<<<<<<<<<<<< * local = iarray_i(local, &nleaves, &ilocal) * assert 2*nleaves == nremote */ goto __pyx_L3; } /* "PETSc/SF.pyx":94 * assert 2*nleaves == nremote * else: * assert nremote % 2 == 0 # <<<<<<<<<<<<<< * nleaves = nremote // 2 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!(((__pyx_v_nremote % 2) == 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(32, 94, __pyx_L1_error) } } #endif /* "PETSc/SF.pyx":95 * else: * assert nremote % 2 == 0 * nleaves = nremote // 2 # <<<<<<<<<<<<<< * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) * */ __pyx_v_nleaves = (__pyx_v_nremote / 2); } __pyx_L3:; /* "PETSc/SF.pyx":96 * assert nremote % 2 == 0 * nleaves = nremote // 2 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) # <<<<<<<<<<<<<< * * def setRankOrder(self, flag): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetGraph(__pyx_v_self->sf, __pyx_v_cnroots, __pyx_v_nleaves, __pyx_v_ilocal, PETSC_COPY_VALUES, __pyx_v_iremote, PETSC_COPY_VALUES)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(32, 96, __pyx_L1_error) /* "PETSc/SF.pyx":78 * return toInt(nroots), local, remote * * def setGraph(self, nroots, local, remote): # <<<<<<<<<<<<<< * """ * The nleaves argument is determined from the size of local and/or remote. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.setGraph", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_local); __Pyx_XDECREF(__pyx_v_remote); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":98 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) * * def setRankOrder(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool bval = asBool(flag) * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_24setRankOrder[] = "SF.setRankOrder(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRankOrder (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRankOrder") < 0)) __PYX_ERR(32, 98, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRankOrder", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 98, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setRankOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24setRankOrder(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRankOrder", 0); /* "PETSc/SF.pyx":99 * * def setRankOrder(self, flag): * cdef PetscBool bval = asBool(flag) # <<<<<<<<<<<<<< * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flag); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(32, 99, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "PETSc/SF.pyx":100 * def setRankOrder(self, flag): * cdef PetscBool bval = asBool(flag) * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFSetRankOrder(__pyx_v_self->sf, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 100, __pyx_L1_error) /* "PETSc/SF.pyx":98 * CHKERR( PetscSFSetGraph(self.sf, cnroots, nleaves, ilocal, PETSC_COPY_VALUES, iremote, PETSC_COPY_VALUES) ) * * def setRankOrder(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool bval = asBool(flag) * CHKERR( PetscSFSetRankOrder(self.sf, bval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.setRankOrder", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":104 * # * * def getMulti(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_26getMulti[] = "SF.getMulti(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMulti (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMulti", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMulti", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26getMulti(struct PyPetscSFObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMulti", 0); /* "PETSc/SF.pyx":105 * * def getMulti(self): * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) * PetscINCREF(sf.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SF.pyx":106 * def getMulti(self): * cdef SF sf = SF() * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) # <<<<<<<<<<<<<< * PetscINCREF(sf.obj) * return sf */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetMultiSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 106, __pyx_L1_error) /* "PETSc/SF.pyx":107 * cdef SF sf = SF() * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) * PetscINCREF(sf.obj) # <<<<<<<<<<<<<< * return sf * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); /* "PETSc/SF.pyx":108 * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) * PetscINCREF(sf.obj) * return sf # <<<<<<<<<<<<<< * * def createInverse(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/SF.pyx":104 * # * * def getMulti(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFGetMultiSF(self.sf, &sf.sf) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.getMulti", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":110 * return sf * * def createInverse(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_28createInverse[] = "SF.createInverse(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createInverse (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createInverse", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createInverse", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28createInverse(struct PyPetscSFObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createInverse", 0); /* "PETSc/SF.pyx":111 * * def createInverse(self): * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) * return sf */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SF.pyx":112 * def createInverse(self): * cdef SF sf = SF() * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateInverseSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 112, __pyx_L1_error) /* "PETSc/SF.pyx":113 * cdef SF sf = SF() * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) * return sf # <<<<<<<<<<<<<< * * def computeDegree(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/SF.pyx":110 * return sf * * def createInverse(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFCreateInverseSF(self.sf, &sf.sf) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SF.createInverse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":115 * return sf * * def computeDegree(self): # <<<<<<<<<<<<<< * cdef const PetscInt *cdegree = NULL * cdef PetscInt nroots */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_30computeDegree[] = "SF.computeDegree(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeDegree (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("computeDegree", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeDegree", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(((struct PyPetscSFObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30computeDegree(struct PyPetscSFObject *__pyx_v_self) { PetscInt const *__pyx_v_cdegree; PetscInt __pyx_v_nroots; PyArrayObject *__pyx_v_degree = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeDegree", 0); /* "PETSc/SF.pyx":116 * * def computeDegree(self): * cdef const PetscInt *cdegree = NULL # <<<<<<<<<<<<<< * cdef PetscInt nroots * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) */ __pyx_v_cdegree = NULL; /* "PETSc/SF.pyx":118 * cdef const PetscInt *cdegree = NULL * cdef PetscInt nroots * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) # <<<<<<<<<<<<<< * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFComputeDegreeBegin(__pyx_v_self->sf, (&__pyx_v_cdegree))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 118, __pyx_L1_error) /* "PETSc/SF.pyx":119 * cdef PetscInt nroots * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) # <<<<<<<<<<<<<< * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) * degree = array_i(nroots, cdegree) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFComputeDegreeEnd(__pyx_v_self->sf, (&__pyx_v_cdegree))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 119, __pyx_L1_error) /* "PETSc/SF.pyx":120 * CHKERR( PetscSFComputeDegreeBegin(self.sf, &cdegree) ) * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) # <<<<<<<<<<<<<< * degree = array_i(nroots, cdegree) * return degree */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetGraph(__pyx_v_self->sf, (&__pyx_v_nroots), NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(32, 120, __pyx_L1_error) /* "PETSc/SF.pyx":121 * CHKERR( PetscSFComputeDegreeEnd(self.sf, &cdegree) ) * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) * degree = array_i(nroots, cdegree) # <<<<<<<<<<<<<< * return degree * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nroots, __pyx_v_cdegree)); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_degree = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SF.pyx":122 * CHKERR( PetscSFGetGraph(self.sf, &nroots, NULL, NULL, NULL) ) * degree = array_i(nroots, cdegree) * return degree # <<<<<<<<<<<<<< * * def createEmbeddedRootSF(self, selected): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_degree)); __pyx_r = ((PyObject *)__pyx_v_degree); goto __pyx_L0; /* "PETSc/SF.pyx":115 * return sf * * def computeDegree(self): # <<<<<<<<<<<<<< * cdef const PetscInt *cdegree = NULL * cdef PetscInt nroots */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.computeDegree", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_degree); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":124 * return degree * * def createEmbeddedRootSF(self, selected): # <<<<<<<<<<<<<< * cdef PetscInt nroots = asInt(len(selected)) * cdef PetscInt *cselected = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF[] = "SF.createEmbeddedRootSF(self, selected)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_selected = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createEmbeddedRootSF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selected,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selected)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createEmbeddedRootSF") < 0)) __PYX_ERR(32, 124, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_selected = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createEmbeddedRootSF", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 124, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedRootSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected) { PetscInt __pyx_v_nroots; PetscInt *__pyx_v_cselected; struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createEmbeddedRootSF", 0); __Pyx_INCREF(__pyx_v_selected); /* "PETSc/SF.pyx":125 * * def createEmbeddedRootSF(self, selected): * cdef PetscInt nroots = asInt(len(selected)) # <<<<<<<<<<<<<< * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nroots, &cselected) */ __pyx_t_1 = PyObject_Length(__pyx_v_selected); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(32, 125, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(32, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nroots = __pyx_t_3; /* "PETSc/SF.pyx":126 * def createEmbeddedRootSF(self, selected): * cdef PetscInt nroots = asInt(len(selected)) * cdef PetscInt *cselected = NULL # <<<<<<<<<<<<<< * selected = iarray_i(selected, &nroots, &cselected) * cdef SF sf = SF() */ __pyx_v_cselected = NULL; /* "PETSc/SF.pyx":127 * cdef PetscInt nroots = asInt(len(selected)) * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nroots, &cselected) # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_selected, (&__pyx_v_nroots), (&__pyx_v_cselected))); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_selected, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SF.pyx":128 * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nroots, &cselected) * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) * return sf */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SF.pyx":129 * selected = iarray_i(selected, &nroots, &cselected) * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedRootSF(__pyx_v_self->sf, __pyx_v_nroots, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(32, 129, __pyx_L1_error) /* "PETSc/SF.pyx":130 * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf) ) * return sf # <<<<<<<<<<<<<< * * def createEmbeddedLeafSF(self, selected): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/SF.pyx":124 * return degree * * def createEmbeddedRootSF(self, selected): # <<<<<<<<<<<<<< * cdef PetscInt nroots = asInt(len(selected)) * cdef PetscInt *cselected = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedRootSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XDECREF(__pyx_v_selected); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":132 * return sf * * def createEmbeddedLeafSF(self, selected): # <<<<<<<<<<<<<< * cdef PetscInt nleaves = asInt(len(selected)) * cdef PetscInt *cselected = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF[] = "SF.createEmbeddedLeafSF(self, selected)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_selected = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createEmbeddedLeafSF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selected,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selected)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createEmbeddedLeafSF") < 0)) __PYX_ERR(32, 132, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_selected = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createEmbeddedLeafSF", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 132, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedLeafSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected) { PetscInt __pyx_v_nleaves; PetscInt *__pyx_v_cselected; struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createEmbeddedLeafSF", 0); __Pyx_INCREF(__pyx_v_selected); /* "PETSc/SF.pyx":133 * * def createEmbeddedLeafSF(self, selected): * cdef PetscInt nleaves = asInt(len(selected)) # <<<<<<<<<<<<<< * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nleaves, &cselected) */ __pyx_t_1 = PyObject_Length(__pyx_v_selected); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(32, 133, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(32, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_nleaves = __pyx_t_3; /* "PETSc/SF.pyx":134 * def createEmbeddedLeafSF(self, selected): * cdef PetscInt nleaves = asInt(len(selected)) * cdef PetscInt *cselected = NULL # <<<<<<<<<<<<<< * selected = iarray_i(selected, &nleaves, &cselected) * cdef SF sf = SF() */ __pyx_v_cselected = NULL; /* "PETSc/SF.pyx":135 * cdef PetscInt nleaves = asInt(len(selected)) * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nleaves, &cselected) # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_selected, (&__pyx_v_nleaves), (&__pyx_v_cselected))); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_selected, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SF.pyx":136 * cdef PetscInt *cselected = NULL * selected = iarray_i(selected, &nleaves, &cselected) * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) * return sf */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SF.pyx":137 * selected = iarray_i(selected, &nleaves, &cselected) * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) # <<<<<<<<<<<<<< * return sf * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedLeafSF(__pyx_v_self->sf, __pyx_v_nleaves, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(32, 137, __pyx_L1_error) /* "PETSc/SF.pyx":138 * cdef SF sf = SF() * CHKERR( PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf) ) * return sf # <<<<<<<<<<<<<< * * def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/SF.pyx":132 * return sf * * def createEmbeddedLeafSF(self, selected): # <<<<<<<<<<<<<< * cdef PetscInt nleaves = asInt(len(selected)) * cdef PetscInt *cselected = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SF.createEmbeddedLeafSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XDECREF(__pyx_v_selected); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":140 * return sf * * def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_37bcastBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_36bcastBegin[] = "SF.bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_37bcastBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_rootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_op = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bcastBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_op,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 1); __PYX_ERR(32, 140, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 2); __PYX_ERR(32, 140, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, 3); __PYX_ERR(32, 140, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bcastBegin") < 0)) __PYX_ERR(32, 140, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_rootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 140, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(32, 140, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 140, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_36bcastBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_36bcastBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bcastBegin", 0); /* "PETSc/SF.pyx":141 * * def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastBegin(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 141, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":142 * def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFBcastBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 142, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "PETSc/SF.pyx":143 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastBegin(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFBcastBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_rootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(32, 143, __pyx_L1_error) /* "PETSc/SF.pyx":140 * return sf * * def bcastBegin(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":146 * PyArray_DATA(leafdata), cop) ) * * def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39bcastEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_38bcastEnd[] = "SF.bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39bcastEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_rootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_op = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bcastEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_op,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 1); __PYX_ERR(32, 146, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 2); __PYX_ERR(32, 146, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, 3); __PYX_ERR(32, 146, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bcastEnd") < 0)) __PYX_ERR(32, 146, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_rootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 146, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(32, 146, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 146, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_38bcastEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38bcastEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_rootdata, PyArrayObject *__pyx_v_leafdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bcastEnd", 0); /* "PETSc/SF.pyx":147 * * def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastEnd(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 147, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":148 * def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFBcastEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 148, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "PETSc/SF.pyx":149 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFBcastEnd(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFBcastEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_rootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(32, 149, __pyx_L1_error) /* "PETSc/SF.pyx":146 * PyArray_DATA(leafdata), cop) ) * * def bcastEnd(self, unit, ndarray rootdata, ndarray leafdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.bcastEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":152 * PyArray_DATA(leafdata), cop) ) * * def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_41reduceBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_40reduceBegin[] = "SF.reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_41reduceBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_op = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reduceBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_rootdata,&__pyx_n_s_op,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 1); __PYX_ERR(32, 152, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 2); __PYX_ERR(32, 152, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, 3); __PYX_ERR(32, 152, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduceBegin") < 0)) __PYX_ERR(32, 152, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_rootdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 152, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 152, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(32, 152, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_40reduceBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_rootdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40reduceBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reduceBegin", 0); /* "PETSc/SF.pyx":153 * * def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceBegin(self.sf, dtype, PyArray_DATA(leafdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 153, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":154 * def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFReduceBegin(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(rootdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 154, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "PETSc/SF.pyx":155 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceBegin(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(rootdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFReduceBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_rootdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(32, 155, __pyx_L1_error) /* "PETSc/SF.pyx":152 * PyArray_DATA(leafdata), cop) ) * * def reduceBegin(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":158 * PyArray_DATA(rootdata), cop) ) * * def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_43reduceEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_42reduceEnd[] = "SF.reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_43reduceEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_op = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reduceEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_rootdata,&__pyx_n_s_op,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 1); __PYX_ERR(32, 158, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 2); __PYX_ERR(32, 158, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, 3); __PYX_ERR(32, 158, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduceEnd") < 0)) __PYX_ERR(32, 158, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_rootdata = ((PyArrayObject *)values[2]); __pyx_v_op = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 158, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 158, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(32, 158, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_42reduceEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_rootdata, __pyx_v_op); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_42reduceEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_rootdata, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reduceEnd", 0); /* "PETSc/SF.pyx":159 * * def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceEnd(self.sf, dtype, PyArray_DATA(leafdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 159, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":160 * def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFReduceEnd(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(rootdata), cop) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 160, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "PETSc/SF.pyx":161 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFReduceEnd(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(rootdata), cop) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFReduceEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_rootdata)), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(32, 161, __pyx_L1_error) /* "PETSc/SF.pyx":158 * PyArray_DATA(rootdata), cop) ) * * def reduceEnd(self, unit, ndarray leafdata, ndarray rootdata, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.reduceEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":164 * PyArray_DATA(rootdata), cop) ) * * def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterBegin(self.sf, dtype, PyArray_DATA(multirootdata), */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_45scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_44scatterBegin[] = "SF.scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_45scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_multirootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatterBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_multirootdata,&__pyx_n_s_leafdata,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, 1); __PYX_ERR(32, 164, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, 2); __PYX_ERR(32, 164, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterBegin") < 0)) __PYX_ERR(32, 164, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_multirootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 164, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(32, 164, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 164, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_44scatterBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_multirootdata, __pyx_v_leafdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_44scatterBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatterBegin", 0); /* "PETSc/SF.pyx":165 * * def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFScatterBegin(self.sf, dtype, PyArray_DATA(multirootdata), * PyArray_DATA(leafdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 165, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":166 * def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterBegin(self.sf, dtype, PyArray_DATA(multirootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFScatterBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_multirootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 166, __pyx_L1_error) /* "PETSc/SF.pyx":164 * PyArray_DATA(rootdata), cop) ) * * def scatterBegin(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterBegin(self.sf, dtype, PyArray_DATA(multirootdata), */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":169 * PyArray_DATA(leafdata)) ) * * def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterEnd(self.sf, dtype, PyArray_DATA(multirootdata), */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_47scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_46scatterEnd[] = "SF.scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_47scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_multirootdata = 0; PyArrayObject *__pyx_v_leafdata = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatterEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_multirootdata,&__pyx_n_s_leafdata,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, 1); __PYX_ERR(32, 169, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, 2); __PYX_ERR(32, 169, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterEnd") < 0)) __PYX_ERR(32, 169, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_multirootdata = ((PyArrayObject *)values[1]); __pyx_v_leafdata = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 169, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(32, 169, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 169, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_46scatterEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_multirootdata, __pyx_v_leafdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_46scatterEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_multirootdata, PyArrayObject *__pyx_v_leafdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatterEnd", 0); /* "PETSc/SF.pyx":170 * * def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFScatterEnd(self.sf, dtype, PyArray_DATA(multirootdata), * PyArray_DATA(leafdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 170, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":171 * def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterEnd(self.sf, dtype, PyArray_DATA(multirootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFScatterEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_multirootdata)), ((void *)PyArray_DATA(__pyx_v_leafdata)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 171, __pyx_L1_error) /* "PETSc/SF.pyx":169 * PyArray_DATA(leafdata)) ) * * def scatterEnd(self, unit, ndarray multirootdata, ndarray leafdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFScatterEnd(self.sf, dtype, PyArray_DATA(multirootdata), */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":174 * PyArray_DATA(leafdata)) ) * * def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherBegin(self.sf, dtype, PyArray_DATA(leafdata), */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_49gatherBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_48gatherBegin[] = "SF.gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_49gatherBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_multirootdata = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gatherBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_multirootdata,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, 1); __PYX_ERR(32, 174, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, 2); __PYX_ERR(32, 174, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gatherBegin") < 0)) __PYX_ERR(32, 174, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_multirootdata = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 174, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 174, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(32, 174, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_48gatherBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_multirootdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_48gatherBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gatherBegin", 0); /* "PETSc/SF.pyx":175 * * def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFGatherBegin(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(multirootdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 175, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":176 * def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherBegin(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(multirootdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGatherBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_multirootdata)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 176, __pyx_L1_error) /* "PETSc/SF.pyx":174 * PyArray_DATA(leafdata)) ) * * def gatherBegin(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherBegin(self.sf, dtype, PyArray_DATA(leafdata), */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":179 * PyArray_DATA(multirootdata)) ) * * def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherEnd(self.sf, dtype, PyArray_DATA(leafdata), */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_51gatherEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_50gatherEnd[] = "SF.gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_51gatherEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyArrayObject *__pyx_v_leafdata = 0; PyArrayObject *__pyx_v_multirootdata = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gatherEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_leafdata,&__pyx_n_s_multirootdata,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, 1); __PYX_ERR(32, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_multirootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, 2); __PYX_ERR(32, 179, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gatherEnd") < 0)) __PYX_ERR(32, 179, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_unit = values[0]; __pyx_v_leafdata = ((PyArrayObject *)values[1]); __pyx_v_multirootdata = ((PyArrayObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 179, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(32, 179, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(32, 179, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_50gatherEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_leafdata, __pyx_v_multirootdata); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_50gatherEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyArrayObject *__pyx_v_leafdata, PyArrayObject *__pyx_v_multirootdata) { MPI_Datatype __pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gatherEnd", 0); /* "PETSc/SF.pyx":180 * * def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * CHKERR( PetscSFGatherEnd(self.sf, dtype, PyArray_DATA(leafdata), * PyArray_DATA(multirootdata)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 180, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":181 * def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherEnd(self.sf, dtype, PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(multirootdata)) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGatherEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void const *)PyArray_DATA(__pyx_v_leafdata)), ((void *)PyArray_DATA(__pyx_v_multirootdata)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(32, 181, __pyx_L1_error) /* "PETSc/SF.pyx":179 * PyArray_DATA(multirootdata)) ) * * def gatherEnd(self, unit, ndarray leafdata, ndarray multirootdata): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * CHKERR( PetscSFGatherEnd(self.sf, dtype, PyArray_DATA(leafdata), */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.gatherEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":184 * PyArray_DATA(multirootdata)) ) * * def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_53fetchAndOpBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_52fetchAndOpBegin[] = "SF.fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_53fetchAndOpBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_leafupdate = 0; PyObject *__pyx_v_op = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fetchAndOpBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_leafupdate,&__pyx_n_s_op,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 1); __PYX_ERR(32, 184, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 2); __PYX_ERR(32, 184, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafupdate)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 3); __PYX_ERR(32, 184, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, 4); __PYX_ERR(32, 184, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetchAndOpBegin") < 0)) __PYX_ERR(32, 184, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_unit = values[0]; __pyx_v_rootdata = values[1]; __pyx_v_leafdata = values[2]; __pyx_v_leafupdate = values[3]; __pyx_v_op = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 184, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_52fetchAndOpBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_52fetchAndOpBegin(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fetchAndOpBegin", 0); /* "PETSc/SF.pyx":185 * * def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 185, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":186 * def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 186, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "PETSc/SF.pyx":187 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ if (!(likely(((__pyx_v_rootdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rootdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(32, 187, __pyx_L1_error) /* "PETSc/SF.pyx":188 * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafupdate), cop) ) * */ if (!(likely(((__pyx_v_leafdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(32, 188, __pyx_L1_error) /* "PETSc/SF.pyx":189 * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) # <<<<<<<<<<<<<< * * def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): */ if (!(likely(((__pyx_v_leafupdate) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafupdate, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(32, 189, __pyx_L1_error) /* "PETSc/SF.pyx":187 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpBegin(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFFetchAndOpBegin(__pyx_v_self->sf, __pyx_v_dtype, ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_rootdata))), ((void const *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafdata))), ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafupdate))), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(32, 187, __pyx_L1_error) /* "PETSc/SF.pyx":184 * PyArray_DATA(multirootdata)) ) * * def fetchAndOpBegin(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SF.pyx":191 * PyArray_DATA(leafupdate), cop) ) * * def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_55fetchAndOpEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2SF_54fetchAndOpEnd[] = "SF.fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_55fetchAndOpEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_unit = 0; PyObject *__pyx_v_rootdata = 0; PyObject *__pyx_v_leafdata = 0; PyObject *__pyx_v_leafupdate = 0; PyObject *__pyx_v_op = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fetchAndOpEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_unit,&__pyx_n_s_rootdata,&__pyx_n_s_leafdata,&__pyx_n_s_leafupdate,&__pyx_n_s_op,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rootdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 1); __PYX_ERR(32, 191, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafdata)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 2); __PYX_ERR(32, 191, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leafupdate)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 3); __PYX_ERR(32, 191, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, 4); __PYX_ERR(32, 191, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetchAndOpEnd") < 0)) __PYX_ERR(32, 191, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_unit = values[0]; __pyx_v_rootdata = values[1]; __pyx_v_leafdata = values[2]; __pyx_v_leafupdate = values[3]; __pyx_v_op = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(32, 191, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_54fetchAndOpEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_54fetchAndOpEnd(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_rootdata, PyObject *__pyx_v_leafdata, PyObject *__pyx_v_leafupdate, PyObject *__pyx_v_op) { MPI_Datatype __pyx_v_dtype; MPI_Op __pyx_v_cop; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Datatype __pyx_t_1; MPI_Op __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fetchAndOpEnd", 0); /* "PETSc/SF.pyx":192 * * def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) # <<<<<<<<<<<<<< * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 192, __pyx_L1_error) __pyx_v_dtype = __pyx_t_1; /* "PETSc/SF.pyx":193 * def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) # <<<<<<<<<<<<<< * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(PyErr_Occurred())) __PYX_ERR(32, 193, __pyx_L1_error) __pyx_v_cop = __pyx_t_2; /* "PETSc/SF.pyx":194 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ if (!(likely(((__pyx_v_rootdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rootdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(32, 194, __pyx_L1_error) /* "PETSc/SF.pyx":195 * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafupdate), cop) ) * */ if (!(likely(((__pyx_v_leafdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafdata, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(32, 195, __pyx_L1_error) /* "PETSc/SF.pyx":196 * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (!(likely(((__pyx_v_leafupdate) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafupdate, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(32, 196, __pyx_L1_error) /* "PETSc/SF.pyx":194 * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) * CHKERR( PetscSFFetchAndOpEnd(self.sf, dtype, PyArray_DATA(rootdata), # <<<<<<<<<<<<<< * PyArray_DATA(leafdata), * PyArray_DATA(leafupdate), cop) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFFetchAndOpEnd(__pyx_v_self->sf, __pyx_v_dtype, ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_rootdata))), ((void const *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafdata))), ((void *)PyArray_DATA(((PyArrayObject *)__pyx_v_leafupdate))), __pyx_v_cop)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(32, 194, __pyx_L1_error) /* "PETSc/SF.pyx":191 * PyArray_DATA(leafupdate), cop) ) * * def fetchAndOpEnd(self, unit, rootdata, leafdata, leafupdate, op): # <<<<<<<<<<<<<< * cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit) * cdef MPI_Op cop = mpi4py_Op_Get(op) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SF.fetchAndOpEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":32 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vec * self.vec = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec___cinit__(struct PyPetscVecObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Vec.pyx":33 * * def __cinit__(self): * self.obj = &self.vec # <<<<<<<<<<<<<< * self.vec = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->vec)); /* "PETSc/Vec.pyx":34 * def __cinit__(self): * self.obj = &self.vec * self.vec = NULL # <<<<<<<<<<<<<< * * # unary operations */ __pyx_v_self->vec = NULL; /* "PETSc/Vec.pyx":32 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.vec * self.vec = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":38 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return vec_pos(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_3__pos__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_3__pos__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_2__pos__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_2__pos__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pos__", 0); /* "PETSc/Vec.pyx":39 * * def __pos__(self): * return vec_pos(self) # <<<<<<<<<<<<<< * * def __neg__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":38 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return vec_pos(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":41 * return vec_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return vec_neg(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5__neg__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5__neg__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_4__neg__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4__neg__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__neg__", 0); /* "PETSc/Vec.pyx":42 * * def __neg__(self): * return vec_neg(self) # <<<<<<<<<<<<<< * * def __abs__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_neg(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":41 * return vec_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return vec_neg(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":44 * return vec_neg(self) * * def __abs__(self): # <<<<<<<<<<<<<< * return vec_abs(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7__abs__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7__abs__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__abs__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_6__abs__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6__abs__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__abs__", 0); /* "PETSc/Vec.pyx":45 * * def __abs__(self): * return vec_abs(self) # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_abs(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":44 * return vec_neg(self) * * def __abs__(self): # <<<<<<<<<<<<<< * return vec_abs(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__abs__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":49 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return vec_iadd(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_9__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8__iadd__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8__iadd__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iadd__", 0); /* "PETSc/Vec.pyx":50 * * def __iadd__(self, other): * return vec_iadd(self, other) # <<<<<<<<<<<<<< * * def __isub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_iadd(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":49 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return vec_iadd(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":52 * return vec_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return vec_isub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__isub__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10__isub__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10__isub__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__isub__", 0); /* "PETSc/Vec.pyx":53 * * def __isub__(self, other): * return vec_isub(self, other) # <<<<<<<<<<<<<< * * def __imul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_isub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":52 * return vec_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return vec_isub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":55 * return vec_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return vec_imul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_13__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_13__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__imul__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_12__imul__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12__imul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__imul__", 0); /* "PETSc/Vec.pyx":56 * * def __imul__(self, other): * return vec_imul(self, other) # <<<<<<<<<<<<<< * * def __idiv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_imul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":55 * return vec_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return vec_imul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":58 * return vec_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__idiv__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__idiv__", 0); /* "PETSc/Vec.pyx":59 * * def __idiv__(self, other): * return vec_idiv(self, other) # <<<<<<<<<<<<<< * * def __itruediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":58 * return vec_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "PETSc/Vec.pyx":61 * return vec_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_17__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_17__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__itruediv__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_16__itruediv__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_16__itruediv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__itruediv__", 0); /* "PETSc/Vec.pyx":62 * * def __itruediv__(self, other): * return vec_idiv(self, other) # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":61 * return vec_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return vec_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__itruediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":66 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_add(self, other) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_18__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 0); /* "PETSc/Vec.pyx":67 * * def __add__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_add(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":68 * def __add__(self, other): * if isinstance(self, Vec): * return vec_add(self, other) # <<<<<<<<<<<<<< * else: * return vec_radd(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 68, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_add(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":67 * * def __add__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_add(self, other) * else: */ } /* "PETSc/Vec.pyx":70 * return vec_add(self, other) * else: * return vec_radd(other, self) # <<<<<<<<<<<<<< * * def __sub__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 70, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_radd(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":66 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_add(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":72 * return vec_radd(other, self) * * def __sub__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_sub(self, other) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_21__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_21__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_20__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_20__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 0); /* "PETSc/Vec.pyx":73 * * def __sub__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_sub(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":74 * def __sub__(self, other): * if isinstance(self, Vec): * return vec_sub(self, other) # <<<<<<<<<<<<<< * else: * return vec_rsub(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 74, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_sub(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":73 * * def __sub__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_sub(self, other) * else: */ } /* "PETSc/Vec.pyx":76 * return vec_sub(self, other) * else: * return vec_rsub(other, self) # <<<<<<<<<<<<<< * * def __mul__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 76, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rsub(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":72 * return vec_radd(other, self) * * def __sub__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_sub(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":78 * return vec_rsub(other, self) * * def __mul__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_mul(self, other) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_23__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_23__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_22__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_22__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 0); /* "PETSc/Vec.pyx":79 * * def __mul__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_mul(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":80 * def __mul__(self, other): * if isinstance(self, Vec): * return vec_mul(self, other) # <<<<<<<<<<<<<< * else: * return vec_rmul(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 80, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_mul(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":79 * * def __mul__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_mul(self, other) * else: */ } /* "PETSc/Vec.pyx":82 * return vec_mul(self, other) * else: * return vec_rmul(other, self) # <<<<<<<<<<<<<< * * def __div__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 82, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rmul(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":78 * return vec_rsub(other, self) * * def __mul__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_mul(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":84 * return vec_rmul(other, self) * * def __div__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_div(self, other) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_25__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_25__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_24__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_24__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 0); /* "PETSc/Vec.pyx":85 * * def __div__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_div(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":86 * def __div__(self, other): * if isinstance(self, Vec): * return vec_div(self, other) # <<<<<<<<<<<<<< * else: * return vec_rdiv(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 86, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":85 * * def __div__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_div(self, other) * else: */ } /* "PETSc/Vec.pyx":88 * return vec_div(self, other) * else: * return vec_rdiv(other, self) # <<<<<<<<<<<<<< * * def __truediv__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 88, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rdiv(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":84 * return vec_rmul(other, self) * * def __div__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_div(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "PETSc/Vec.pyx":90 * return vec_rdiv(other, self) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_div(self, other) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_27__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_27__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_26__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_26__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__truediv__", 0); /* "PETSc/Vec.pyx":91 * * def __truediv__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_div(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":92 * def __truediv__(self, other): * if isinstance(self, Vec): * return vec_div(self, other) # <<<<<<<<<<<<<< * else: * return vec_rdiv(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 92, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_div(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":91 * * def __truediv__(self, other): * if isinstance(self, Vec): # <<<<<<<<<<<<<< * return vec_div(self, other) * else: */ } /* "PETSc/Vec.pyx":94 * return vec_div(self, other) * else: * return vec_rdiv(other, self) # <<<<<<<<<<<<<< * * # */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 94, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_rdiv(((struct PyPetscVecObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":90 * return vec_rdiv(other, self) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Vec): * return vec_div(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":103 * # return size * * def __getitem__(self, i): # <<<<<<<<<<<<<< * return vec_getitem(self, i) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_29__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_29__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_28__getitem__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_i)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_28__getitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "PETSc/Vec.pyx":104 * * def __getitem__(self, i): * return vec_getitem(self, i) # <<<<<<<<<<<<<< * * def __setitem__(self, i, v): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_getitem(__pyx_v_self, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":103 * # return size * * def __getitem__(self, i): # <<<<<<<<<<<<<< * return vec_getitem(self, i) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":106 * return vec_getitem(self, i) * * def __setitem__(self, i, v): # <<<<<<<<<<<<<< * vec_setitem(self, i, v) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_31__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_31__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_30__setitem__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_i), ((PyObject *)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_30__setitem__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); /* "PETSc/Vec.pyx":107 * * def __setitem__(self, i, v): * vec_setitem(self, i, v) # <<<<<<<<<<<<<< * * # buffer interface (PEP 3118) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_setitem(__pyx_v_self, __pyx_v_i, __pyx_v_v); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 107, __pyx_L1_error) /* "PETSc/Vec.pyx":106 * return vec_getitem(self, i) * * def __setitem__(self, i, v): # <<<<<<<<<<<<<< * vec_setitem(self, i, v) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":111 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.acquirebuffer(view, flags) */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_3Vec_33__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_pw_8petsc4py_5PETSc_3Vec_33__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_32__getbuffer__(((struct PyPetscVecObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_32__getbuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view, int __pyx_v_flags) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (__pyx_v_view == NULL) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_view->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_view->obj); /* "PETSc/Vec.pyx":112 * * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * buf.acquirebuffer(view, flags) * */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":113 * def __getbuffer__(self, Py_buffer *view, int flags): * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.acquirebuffer(view, flags) # <<<<<<<<<<<<<< * * def __releasebuffer__(self, Py_buffer *view): */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->acquirebuffer(__pyx_v_buf, __pyx_v_view, __pyx_v_flags); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 113, __pyx_L1_error) /* "PETSc/Vec.pyx":111 * # buffer interface (PEP 3118) * * def __getbuffer__(self, Py_buffer *view, int flags): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * buf.acquirebuffer(view, flags) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_view->obj != NULL) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_view->obj == Py_None) { __Pyx_GOTREF(__pyx_v_view->obj); __Pyx_DECREF(__pyx_v_view->obj); __pyx_v_view->obj = 0; } __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":115 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) */ /* Python wrapper */ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_3Vec_35__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view); /*proto*/ static CYTHON_UNUSED void __pyx_pw_8petsc4py_5PETSc_3Vec_35__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_view) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_3Vec_34__releasebuffer__(((struct PyPetscVecObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_view)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_3Vec_34__releasebuffer__(struct PyPetscVecObject *__pyx_v_self, Py_buffer *__pyx_v_view) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__releasebuffer__", 0); /* "PETSc/Vec.pyx":116 * * def __releasebuffer__(self, Py_buffer *view): * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) # <<<<<<<<<<<<<< * buf.releasebuffer(view) * self # unused */ __pyx_t_1 = __pyx_v_view->obj; __Pyx_INCREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":117 * def __releasebuffer__(self, Py_buffer *view): * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) # <<<<<<<<<<<<<< * self # unused * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->releasebuffer(__pyx_v_buf, __pyx_v_view); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 117, __pyx_L1_error) /* "PETSc/Vec.pyx":118 * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) * self # unused # <<<<<<<<<<<<<< * * # 'with' statement (PEP 343) */ ((void)__pyx_v_self); /* "PETSc/Vec.pyx":115 * buf.acquirebuffer(view, flags) * * def __releasebuffer__(self, Py_buffer *view): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = <_Vec_buffer>(view.obj) * buf.releasebuffer(view) */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_WriteUnraisable("petsc4py.PETSc.Vec.__releasebuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_RefNannyFinishContext(); } /* "PETSc/Vec.pyx":122 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_37__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_36__enter__[] = "Vec.__enter__(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_37__enter__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__enter__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__enter__", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_36__enter__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_36__enter__(struct PyPetscVecObject *__pyx_v_self) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__enter__", 0); /* "PETSc/Vec.pyx":123 * * def __enter__(self): * cdef _Vec_buffer buf = _Vec_buffer(self) # <<<<<<<<<<<<<< * self.set_attr('__buffer__', buf) * return buf.enter() */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_buffer), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":124 * def __enter__(self): * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) # <<<<<<<<<<<<<< * return buf.enter() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":125 * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) * return buf.enter() # <<<<<<<<<<<<<< * * def __exit__(self, *exc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->enter(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":122 * # 'with' statement (PEP 343) * * def __enter__(self): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = _Vec_buffer(self) * self.set_attr('__buffer__', buf) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__enter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":127 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_39__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_38__exit__[] = "Vec.__exit__(self, *exc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_39__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__exit__", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_exc = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_38__exit__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_exc); /* function exit code */ __Pyx_XDECREF(__pyx_v_exc); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_38__exit__(struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__exit__", 0); /* "PETSc/Vec.pyx":128 * * def __exit__(self, *exc): * cdef _Vec_buffer buf = self.get_attr('__buffer__') # <<<<<<<<<<<<<< * self.set_attr('__buffer__', None) * return buf.exit() */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer))))) __PYX_ERR(33, 128, __pyx_L1_error) __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":129 * def __exit__(self, *exc): * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) # <<<<<<<<<<<<<< * return buf.exit() * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":130 * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) * return buf.exit() # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer *)__pyx_v_buf->__pyx_vtab)->exit(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":127 * return buf.enter() * * def __exit__(self, *exc): # <<<<<<<<<<<<<< * cdef _Vec_buffer buf = self.get_attr('__buffer__') * self.set_attr('__buffer__', None) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":134 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_41view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_40view[] = "Vec.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_41view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(33, 134, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 134, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(33, 134, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_40view(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_40view(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Vec.pyx":135 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( VecView(self.vec, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Vec.pyx":136 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( VecView(self.vec, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Vec.pyx":137 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( VecView(self.vec, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecView(__pyx_v_self->vec, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 137, __pyx_L1_error) /* "PETSc/Vec.pyx":134 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":139 * CHKERR( VecView(self.vec, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&self.vec) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_43destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_42destroy[] = "Vec.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_43destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_42destroy(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_42destroy(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Vec.pyx":140 * * def destroy(self): * CHKERR( VecDestroy(&self.vec) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_self->vec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 140, __pyx_L1_error) /* "PETSc/Vec.pyx":141 * def destroy(self): * CHKERR( VecDestroy(&self.vec) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":139 * CHKERR( VecView(self.vec, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( VecDestroy(&self.vec) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":143 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscVec newvec = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_45create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_44create[] = "Vec.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_45create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(33, 143, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 143, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_44create(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_44create(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Vec.pyx":144 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 144, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Vec.pyx":145 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":146 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 146, __pyx_L1_error) /* "PETSc/Vec.pyx":147 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":148 * CHKERR( VecCreate(ccomm, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def setType(self, vec_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":143 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscVec newvec = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":150 * return self * * def setType(self, vec_type): # <<<<<<<<<<<<<< * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_47setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_46setType[] = "Vec.setType(self, vec_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_47setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vec_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(33, 150, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 150, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_46setType(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_46setType(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vec_type) { VecType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_vec_type); /* "PETSc/Vec.pyx":151 * * def setType(self, vec_type): * cdef PetscVecType cval = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(vec_type, &cval) * CHKERR( VecSetType(self.vec, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Vec.pyx":152 * def setType(self, vec_type): * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) # <<<<<<<<<<<<<< * CHKERR( VecSetType(self.vec, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vec_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vec_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":153 * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) * CHKERR( VecSetType(self.vec, cval) ) # <<<<<<<<<<<<<< * * def setSizes(self, size, bsize=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetType(__pyx_v_self->vec, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 153, __pyx_L1_error) /* "PETSc/Vec.pyx":150 * return self * * def setType(self, vec_type): # <<<<<<<<<<<<<< * cdef PetscVecType cval = NULL * vec_type = str2bytes(vec_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":155 * CHKERR( VecSetType(self.vec, cval) ) * * def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_49setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_48setSizes[] = "Vec.setSizes(self, size, bsize=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_49setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSizes") < 0)) __PYX_ERR(33, 155, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 155, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_48setSizes(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_48setSizes(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSizes", 0); /* "PETSc/Vec.pyx":156 * * def setSizes(self, size, bsize=None): * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":157 * def setSizes(self, size, bsize=None): * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 157, __pyx_L1_error) /* "PETSc/Vec.pyx":158 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) # <<<<<<<<<<<<<< * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetSizes(__pyx_v_self->vec, __pyx_v_n, __pyx_v_N)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 158, __pyx_L1_error) /* "PETSc/Vec.pyx":159 * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * */ __pyx_t_2 = ((__pyx_v_bs != PETSC_DECIDE) != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":160 * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_self->vec, __pyx_v_bs)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 160, __pyx_L1_error) /* "PETSc/Vec.pyx":159 * Vec_Sizes(size, bsize, &bs, &n, &N) * CHKERR( VecSetSizes(self.vec, n, N) ) * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * */ } /* "PETSc/Vec.pyx":155 * CHKERR( VecSetType(self.vec, cval) ) * * def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":164 * # * * def createSeq(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscInt bs=0, n=0, N=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_51createSeq(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_50createSeq[] = "Vec.createSeq(self, size, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_51createSeq(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSeq (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSeq") < 0)) __PYX_ERR(33, 164, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSeq", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 164, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createSeq", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_50createSeq(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_50createSeq(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSeq", 0); /* "PETSc/Vec.pyx":165 * * def createSeq(self, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 165, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Vec.pyx":166 * def createSeq(self, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":167 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 167, __pyx_L1_error) /* "PETSc/Vec.pyx":168 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 168, __pyx_L1_error) /* "PETSc/Vec.pyx":169 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm,&newvec) ) */ __pyx_t_3 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_bs = 1; } /* "PETSc/Vec.pyx":170 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm,&newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":171 * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm,&newvec) ) # <<<<<<<<<<<<<< * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 171, __pyx_L1_error) /* "PETSc/Vec.pyx":172 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm,&newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECSEQ) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetSizes(__pyx_v_newvec, __pyx_v_n, __pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 172, __pyx_L1_error) /* "PETSc/Vec.pyx":173 * CHKERR( VecCreate(ccomm,&newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) # <<<<<<<<<<<<<< * CHKERR( VecSetType(newvec, VECSEQ) ) * PetscCLEAR(self.obj); self.vec = newvec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_newvec, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 173, __pyx_L1_error) /* "PETSc/Vec.pyx":174 * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECSEQ) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetType(__pyx_v_newvec, VECSEQ)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 174, __pyx_L1_error) /* "PETSc/Vec.pyx":175 * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECSEQ) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":176 * CHKERR( VecSetType(newvec, VECSEQ) ) * PetscCLEAR(self.obj); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def createMPI(self, size, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":164 * # * * def createSeq(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscInt bs=0, n=0, N=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createSeq", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":178 * return self * * def createMPI(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_53createMPI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_52createMPI[] = "Vec.createMPI(self, size, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_53createMPI(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMPI (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createMPI") < 0)) __PYX_ERR(33, 178, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMPI", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 178, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createMPI", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_52createMPI(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_52createMPI(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMPI", 0); /* "PETSc/Vec.pyx":179 * * def createMPI(self, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 179, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Vec.pyx":180 * def createMPI(self, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":181 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 181, __pyx_L1_error) /* "PETSc/Vec.pyx":182 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 182, __pyx_L1_error) /* "PETSc/Vec.pyx":183 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) */ __pyx_t_3 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_bs = 1; } /* "PETSc/Vec.pyx":184 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":185 * if bs == PETSC_DECIDE: bs = 1 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) # <<<<<<<<<<<<<< * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 185, __pyx_L1_error) /* "PETSc/Vec.pyx":186 * cdef PetscVec newvec = NULL * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECMPI) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetSizes(__pyx_v_newvec, __pyx_v_n, __pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 186, __pyx_L1_error) /* "PETSc/Vec.pyx":187 * CHKERR( VecCreate(ccomm, &newvec) ) * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) # <<<<<<<<<<<<<< * CHKERR( VecSetType(newvec, VECMPI) ) * PetscCLEAR(self.obj); self.vec = newvec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_newvec, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 187, __pyx_L1_error) /* "PETSc/Vec.pyx":188 * CHKERR( VecSetSizes(newvec, n, N) ) * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECMPI) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetType(__pyx_v_newvec, VECMPI)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 188, __pyx_L1_error) /* "PETSc/Vec.pyx":189 * CHKERR( VecSetBlockSize(newvec, bs) ) * CHKERR( VecSetType(newvec, VECMPI) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":190 * CHKERR( VecSetType(newvec, VECMPI) ) * PetscCLEAR(self.obj); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def createWithArray(self, array, size=None, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":178 * return self * * def createMPI(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createMPI", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":192 * return self * * def createWithArray(self, array, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_55createWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_54createWithArray[] = "Vec.createWithArray(self, array, size=None, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_55createWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createWithArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createWithArray") < 0)) __PYX_ERR(33, 192, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_array = values[0]; __pyx_v_size = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createWithArray", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 192, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_54createWithArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_54createWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; MPI_Comm __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createWithArray", 0); __Pyx_INCREF(__pyx_v_array); __Pyx_INCREF(__pyx_v_size); /* "PETSc/Vec.pyx":193 * * def createWithArray(self, array, size=None, bsize=None, comm=None): * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * array = iarray_s(array, &na, &sa) */ __pyx_v_na = 0; /* "PETSc/Vec.pyx":194 * def createWithArray(self, array, size=None, bsize=None, comm=None): * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * array = iarray_s(array, &na, &sa) * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) */ __pyx_v_sa = NULL; /* "PETSc/Vec.pyx":195 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * array = iarray_s(array, &na, &sa) # <<<<<<<<<<<<<< * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_array, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":196 * cdef PetscScalar *sa=NULL * array = iarray_s(array, &na, &sa) * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_2 = (__pyx_v_size == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5); __pyx_t_5 = 0; } /* "PETSc/Vec.pyx":197 * array = iarray_s(array, &na, &sa) * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 197, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_6; /* "PETSc/Vec.pyx":198 * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":199 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(33, 199, __pyx_L1_error) /* "PETSc/Vec.pyx":200 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(33, 200, __pyx_L1_error) /* "PETSc/Vec.pyx":201 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % */ __pyx_t_3 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_bs = 1; } /* "PETSc/Vec.pyx":202 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_3 = ((__pyx_v_na < __pyx_v_n) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/Vec.pyx":204 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":203 * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/Vec.pyx":202 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(33, 202, __pyx_L1_error) } /* "PETSc/Vec.pyx":205 * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":206 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) * else: */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_7 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(33, 206, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_7 == 1) != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":207 * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(33, 207, __pyx_L1_error) /* "PETSc/Vec.pyx":206 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) * else: */ goto __pyx_L6; } /* "PETSc/Vec.pyx":209 * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,sa,&newvec) ) * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', array) */ /*else*/ { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(33, 209, __pyx_L1_error) } __pyx_L6:; /* "PETSc/Vec.pyx":210 * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":211 * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,sa,&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_8 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/Vec.pyx":212 * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * def createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":192 * return self * * def createWithArray(self, array, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":214 * return self * * def createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * """ * Returns an instance of :class:`Vec`, a VECCUDA with user provided */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_57createCUDAWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_56createCUDAWithArrays[] = "Vec.createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None)\n\n Returns an instance of :class:`Vec`, a VECCUDA with user provided\n memory spaces for CPU and GPU arrays.\n\n :arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if\n *None*.\n :arg cudahandle: Address of the array on the GPU. Will be lazily\n allocated if *None*.\n :arg size: A :class:`int` denoting the size of the Vec.\n :arg bsize: A :class:`int` denoting the block size.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_57createCUDAWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cpuarray = 0; PyObject *__pyx_v_cudahandle = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCUDAWithArrays (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_cudahandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cpuarray); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cudahandle); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCUDAWithArrays") < 0)) __PYX_ERR(33, 214, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_cpuarray = values[0]; __pyx_v_cudahandle = values[1]; __pyx_v_size = values[2]; __pyx_v_bsize = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCUDAWithArrays", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 214, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createCUDAWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_56createCUDAWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_cudahandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_56createCUDAWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_cudahandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; PetscScalar *__pyx_v_gpuarray; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_uintptr_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; MPI_Comm __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCUDAWithArrays", 0); __Pyx_INCREF(__pyx_v_cpuarray); __Pyx_INCREF(__pyx_v_size); /* "PETSc/Vec.pyx":226 * :arg bsize: A :class:`int` denoting the block size. * """ * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL */ __pyx_v_na = 0; /* "PETSc/Vec.pyx":227 * """ * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *gpuarray = NULL * if cudahandle: */ __pyx_v_sa = NULL; /* "PETSc/Vec.pyx":228 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL # <<<<<<<<<<<<<< * if cudahandle: * gpuarray = (cudahandle) */ __pyx_v_gpuarray = NULL; /* "PETSc/Vec.pyx":229 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL * if cudahandle: # <<<<<<<<<<<<<< * gpuarray = (cudahandle) * if cpuarray is not None: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cudahandle); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 229, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Vec.pyx":230 * cdef PetscScalar *gpuarray = NULL * if cudahandle: * gpuarray = (cudahandle) # <<<<<<<<<<<<<< * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) */ __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_cudahandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(33, 230, __pyx_L1_error) __pyx_v_gpuarray = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2)); /* "PETSc/Vec.pyx":229 * cdef PetscScalar *sa=NULL * cdef PetscScalar *gpuarray = NULL * if cudahandle: # <<<<<<<<<<<<<< * gpuarray = (cudahandle) * if cpuarray is not None: */ } /* "PETSc/Vec.pyx":231 * if cudahandle: * gpuarray = (cudahandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":232 * gpuarray = (cudahandle) * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) # <<<<<<<<<<<<<< * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Vec.pyx":231 * if cudahandle: * gpuarray = (cudahandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ } /* "PETSc/Vec.pyx":234 * cpuarray = iarray_s(cpuarray, &na, &sa) * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_3 = (__pyx_v_size == Py_None); __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_6); __pyx_t_6 = 0; } /* "PETSc/Vec.pyx":235 * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 235, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_7; /* "PETSc/Vec.pyx":236 * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":237 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 237, __pyx_L1_error) /* "PETSc/Vec.pyx":238 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 238, __pyx_L1_error) /* "PETSc/Vec.pyx":239 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % */ __pyx_t_1 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "PETSc/Vec.pyx":240 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_1 = ((__pyx_v_na < __pyx_v_n) != 0); if (unlikely(__pyx_t_1)) { /* "PETSc/Vec.pyx":242 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; /* "PETSc/Vec.pyx":241 * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( * "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/Vec.pyx":240 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(33, 240, __pyx_L1_error) } /* "PETSc/Vec.pyx":243 * "array size %d and vector local size %d block size %d" % * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":244 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(33, 244, __pyx_L1_error) __pyx_t_1 = ((__pyx_t_8 == 1) != 0); if (__pyx_t_1) { /* "PETSc/Vec.pyx":245 * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqCUDAWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, __pyx_v_sa, __pyx_v_gpuarray, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 245, __pyx_L1_error) /* "PETSc/Vec.pyx":244 * (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: */ goto __pyx_L8; } /* "PETSc/Vec.pyx":247 * CHKERR( VecCreateSeqCUDAWithArrays(ccomm,bs,N,sa,gpuarray,&newvec) ) * else: * CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPICUDAWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_sa, __pyx_v_gpuarray, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 247, __pyx_L1_error) } __pyx_L8:; /* "PETSc/Vec.pyx":248 * else: * CHKERR( VecCreateMPICUDAWithArrays(ccomm,bs,n,N,sa,gpuarray,&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * * if cpuarray is not None: */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":250 * PetscCLEAR(self.obj); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":251 * * if cpuarray is not None: * self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<< * return self * */ __pyx_t_9 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/Vec.pyx":250 * PetscCLEAR(self.obj); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ } /* "PETSc/Vec.pyx":252 * if cpuarray is not None: * self.set_attr('__array__', cpuarray) * return self # <<<<<<<<<<<<<< * * def createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":214 * return self * * def createCUDAWithArrays(self, cpuarray=None, cudahandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * """ * Returns an instance of :class:`Vec`, a VECCUDA with user provided */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createCUDAWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cpuarray); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":254 * return self * * def createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * """ * Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_59createViennaCLWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_58createViennaCLWithArrays[] = "Vec.createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None)\n\n Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory\n spaces for CPU and GPU arrays.\n\n :arg cpuarray: A :class:`numpy.ndarray`. Will be lazily allocated if\n *None*.\n :arg viennaclvechandle: Address of the array on the GPU. Will be lazily\n allocated if *None*.\n :arg size: A :class:`int` denoting the size of the Vec.\n :arg size: A :class:`int` denoting the block size.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_59createViennaCLWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cpuarray = 0; PyObject *__pyx_v_viennaclvechandle = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createViennaCLWithArrays (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpuarray,&__pyx_n_s_viennaclvechandle,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cpuarray); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viennaclvechandle); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createViennaCLWithArrays") < 0)) __PYX_ERR(33, 254, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_cpuarray = values[0]; __pyx_v_viennaclvechandle = values[1]; __pyx_v_size = values[2]; __pyx_v_bsize = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createViennaCLWithArrays", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 254, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createViennaCLWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_58createViennaCLWithArrays(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_cpuarray, __pyx_v_viennaclvechandle, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_58createViennaCLWithArrays(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_cpuarray, PyObject *__pyx_v_viennaclvechandle, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; PetscScalar *__pyx_v_vclvec; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_uintptr_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; MPI_Comm __pyx_t_7; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createViennaCLWithArrays", 0); __Pyx_INCREF(__pyx_v_cpuarray); __Pyx_INCREF(__pyx_v_size); /* "PETSc/Vec.pyx":266 * :arg size: A :class:`int` denoting the block size. * """ * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL */ __pyx_v_na = 0; /* "PETSc/Vec.pyx":267 * """ * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: */ __pyx_v_sa = NULL; /* "PETSc/Vec.pyx":268 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL # <<<<<<<<<<<<<< * if viennaclvechandle: * vclvec = (viennaclvechandle) */ __pyx_v_vclvec = NULL; /* "PETSc/Vec.pyx":269 * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: # <<<<<<<<<<<<<< * vclvec = (viennaclvechandle) * if cpuarray is not None: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_viennaclvechandle); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 269, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Vec.pyx":270 * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: * vclvec = (viennaclvechandle) # <<<<<<<<<<<<<< * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) */ __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_viennaclvechandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(33, 270, __pyx_L1_error) __pyx_v_vclvec = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2)); /* "PETSc/Vec.pyx":269 * cdef PetscScalar *sa=NULL * cdef PetscScalar *vclvec = NULL * if viennaclvechandle: # <<<<<<<<<<<<<< * vclvec = (viennaclvechandle) * if cpuarray is not None: */ } /* "PETSc/Vec.pyx":271 * if viennaclvechandle: * vclvec = (viennaclvechandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":272 * vclvec = (viennaclvechandle) * if cpuarray is not None: * cpuarray = iarray_s(cpuarray, &na, &sa) # <<<<<<<<<<<<<< * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_cpuarray, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_cpuarray, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Vec.pyx":271 * if viennaclvechandle: * vclvec = (viennaclvechandle) * if cpuarray is not None: # <<<<<<<<<<<<<< * cpuarray = iarray_s(cpuarray, &na, &sa) * */ } /* "PETSc/Vec.pyx":274 * cpuarray = iarray_s(cpuarray, &na, &sa) * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_3 = (__pyx_v_size == Py_None); __pyx_t_1 = (__pyx_t_3 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_6); __pyx_t_6 = 0; } /* "PETSc/Vec.pyx":275 * * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 275, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_7; /* "PETSc/Vec.pyx":276 * if size is None: size = (toInt(na), toInt(PETSC_DECIDE)) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":277 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 277, __pyx_L1_error) /* "PETSc/Vec.pyx":278 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 278, __pyx_L1_error) /* "PETSc/Vec.pyx":279 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_1 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_1) { __pyx_v_bs = 1; } /* "PETSc/Vec.pyx":280 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: */ __pyx_t_1 = ((__pyx_v_na < __pyx_v_n) != 0); if (unlikely(__pyx_t_1)) { __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_4); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_9, 0, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __PYX_ERR(33, 280, __pyx_L1_error) } /* "PETSc/Vec.pyx":281 * if bs == PETSC_DECIDE: bs = 1 * if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":282 * if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) * else: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(33, 282, __pyx_L1_error) __pyx_t_1 = ((__pyx_t_8 == 1) != 0); if (__pyx_t_1) { /* "PETSc/Vec.pyx":283 * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqViennaCLWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, __pyx_v_sa, __pyx_v_vclvec, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 283, __pyx_L1_error) /* "PETSc/Vec.pyx":282 * if na < n: raise ValueError( "array size %d and vector local size %d block size %d" % (toInt(na), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) * else: */ goto __pyx_L8; } /* "PETSc/Vec.pyx":285 * CHKERR( VecCreateSeqViennaCLWithArrays(ccomm,bs,N,sa,vclvec,&newvec) ) * else: * CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * */ /*else*/ { __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIViennaCLWithArrays(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_sa, __pyx_v_vclvec, (&__pyx_v_newvec))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(33, 285, __pyx_L1_error) } __pyx_L8:; /* "PETSc/Vec.pyx":286 * else: * CHKERR( VecCreateMPIViennaCLWithArrays(ccomm,bs,n,N,sa,vclvec,&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * * if cpuarray is not None: */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":288 * PetscCLEAR(self.obj); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ __pyx_t_1 = (__pyx_v_cpuarray != Py_None); __pyx_t_3 = (__pyx_t_1 != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":289 * * if cpuarray is not None: * self.set_attr('__array__', cpuarray) # <<<<<<<<<<<<<< * return self * */ __pyx_t_9 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/Vec.pyx":288 * PetscCLEAR(self.obj); self.vec = newvec * * if cpuarray is not None: # <<<<<<<<<<<<<< * self.set_attr('__array__', cpuarray) * return self */ } /* "PETSc/Vec.pyx":290 * if cpuarray is not None: * self.set_attr('__array__', cpuarray) * return self # <<<<<<<<<<<<<< * * def createWithDLPack(self, object dltensor, size=None, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":254 * return self * * def createViennaCLWithArrays(self, cpuarray=None, viennaclvechandle=None, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * """ * Returns an instance :class:`Vec`, a VECVIENNACL with user provided memory */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createViennaCLWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cpuarray); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":292 * return self * * def createWithDLPack(self, object dltensor, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * """ * Returns an instance :class:`Vec`, a PETSc vector from a DLPack object */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_61createWithDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_60createWithDLPack[] = "Vec.createWithDLPack(self, dltensor, size=None, bsize=None, comm=None)\n\n Returns an instance :class:`Vec`, a PETSc vector from a DLPack object\n sharing the same memory.\n This operation does not modify the storage of the original tensor and\n should be used with contiguous tensors only. If the tensor is stored in\n row-major order (e.g. PyTorch tensors), the resulting vector will look\n like an unrolled tensor using row-major order.\n\n :arg dltensor: An object with a __dlpack__ method or a DLPack tensor object (for backward compatibility)\n :arg size: A :class:`int` denoting the size of the Vec.\n :arg bsize: A :class:`int` denoting the block size.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_61createWithDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dltensor = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createWithDLPack (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dltensor,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dltensor)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createWithDLPack") < 0)) __PYX_ERR(33, 292, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dltensor = values[0]; __pyx_v_size = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createWithDLPack", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 292, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_60createWithDLPack(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_dltensor, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_60createWithDLPack(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_dltensor, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_ptr; int __pyx_v_bits; PetscInt __pyx_v_nz; int64_t __pyx_v_ndim; int64_t *__pyx_v_shape; int64_t *__pyx_v_strides; MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; CYTHON_UNUSED __pyx_t_8petsc4py_5PETSc_DLContext *__pyx_v_ctx; PyObject *__pyx_v_s = NULL; Vec __pyx_v_newvec; int64_t *__pyx_v_shape_arr; int64_t *__pyx_v_strides_arr; PyObject *__pyx_v_s1 = 0; PyObject *__pyx_v_s2 = 0; int64_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; void *__pyx_t_6; uint8_t __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int64_t *__pyx_t_10; int64_t *__pyx_t_11; int64_t *__pyx_t_12; PetscInt __pyx_t_13; int __pyx_t_14; int64_t __pyx_t_15; int64_t __pyx_t_16; int64_t __pyx_t_17; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createWithDLPack", 0); __Pyx_INCREF(__pyx_v_dltensor); __Pyx_INCREF(__pyx_v_size); /* "PETSc/Vec.pyx":305 * :arg bsize: A :class:`int` denoting the block size. * """ * cdef DLManagedTensor* ptr = NULL # <<<<<<<<<<<<<< * cdef int bits = 0 * cdef PetscInt nz = 1 */ __pyx_v_ptr = NULL; /* "PETSc/Vec.pyx":306 * """ * cdef DLManagedTensor* ptr = NULL * cdef int bits = 0 # <<<<<<<<<<<<<< * cdef PetscInt nz = 1 * cdef int64_t ndim = 0 */ __pyx_v_bits = 0; /* "PETSc/Vec.pyx":307 * cdef DLManagedTensor* ptr = NULL * cdef int bits = 0 * cdef PetscInt nz = 1 # <<<<<<<<<<<<<< * cdef int64_t ndim = 0 * cdef int64_t* shape = NULL */ __pyx_v_nz = 1; /* "PETSc/Vec.pyx":308 * cdef int bits = 0 * cdef PetscInt nz = 1 * cdef int64_t ndim = 0 # <<<<<<<<<<<<<< * cdef int64_t* shape = NULL * cdef int64_t* strides = NULL */ __pyx_v_ndim = 0; /* "PETSc/Vec.pyx":309 * cdef PetscInt nz = 1 * cdef int64_t ndim = 0 * cdef int64_t* shape = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_shape = NULL; /* "PETSc/Vec.pyx":310 * cdef int64_t ndim = 0 * cdef int64_t* shape = NULL * cdef int64_t* strides = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 0,n = 0,N = 0 */ __pyx_v_strides = NULL; /* "PETSc/Vec.pyx":311 * cdef int64_t* shape = NULL * cdef int64_t* strides = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs = 0,n = 0,N = 0 * cdef DLContext* ctx = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 311, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Vec.pyx":312 * cdef int64_t* strides = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 0,n = 0,N = 0 # <<<<<<<<<<<<<< * cdef DLContext* ctx = NULL * */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":313 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs = 0,n = 0,N = 0 * cdef DLContext* ctx = NULL # <<<<<<<<<<<<<< * * if not PyCapsule_CheckExact(dltensor): */ __pyx_v_ctx = NULL; /* "PETSc/Vec.pyx":315 * cdef DLContext* ctx = NULL * * if not PyCapsule_CheckExact(dltensor): # <<<<<<<<<<<<<< * dltensor = dltensor.__dlpack__() * */ __pyx_t_2 = ((!(PyCapsule_CheckExact(__pyx_v_dltensor) != 0)) != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":316 * * if not PyCapsule_CheckExact(dltensor): * dltensor = dltensor.__dlpack__() # <<<<<<<<<<<<<< * * if PyCapsule_IsValid(dltensor, 'dltensor'): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dltensor, __pyx_n_s_dlpack); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_dltensor, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Vec.pyx":315 * cdef DLContext* ctx = NULL * * if not PyCapsule_CheckExact(dltensor): # <<<<<<<<<<<<<< * dltensor = dltensor.__dlpack__() * */ } /* "PETSc/Vec.pyx":318 * dltensor = dltensor.__dlpack__() * * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits */ __pyx_t_2 = (PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"dltensor")) != 0); if (likely(__pyx_t_2)) { /* "PETSc/Vec.pyx":319 * * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') # <<<<<<<<<<<<<< * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): */ __pyx_t_6 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_6 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(33, 319, __pyx_L1_error) __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_6); /* "PETSc/Vec.pyx":320 * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits # <<<<<<<<<<<<<< * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) */ __pyx_t_7 = __pyx_v_ptr->dl_tensor.dtype.bits; __pyx_v_bits = __pyx_t_7; /* "PETSc/Vec.pyx":321 * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ __pyx_t_2 = ((__pyx_v_bits != (8 * (sizeof(PetscScalar)))) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/Vec.pyx":322 * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) # <<<<<<<<<<<<<< * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(33, 322, __pyx_L1_error) /* "PETSc/Vec.pyx":321 * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ } /* "PETSc/Vec.pyx":323 * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim # <<<<<<<<<<<<<< * shape = ptr.dl_tensor.shape * for s in shape[:ndim]: */ __pyx_t_9 = __pyx_v_ptr->dl_tensor.ndim; __pyx_v_ndim = __pyx_t_9; /* "PETSc/Vec.pyx":324 * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape # <<<<<<<<<<<<<< * for s in shape[:ndim]: * nz = nz*s */ __pyx_t_10 = __pyx_v_ptr->dl_tensor.shape; __pyx_v_shape = __pyx_t_10; /* "PETSc/Vec.pyx":325 * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape * for s in shape[:ndim]: # <<<<<<<<<<<<<< * nz = nz*s * strides = ptr.dl_tensor.strides */ __pyx_t_11 = (__pyx_v_shape + __pyx_v_ndim); for (__pyx_t_12 = __pyx_v_shape; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) { __pyx_t_10 = __pyx_t_12; __pyx_t_4 = __Pyx_PyInt_From_int64_t((__pyx_t_10[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Vec.pyx":326 * shape = ptr.dl_tensor.shape * for s in shape[:ndim]: * nz = nz*s # <<<<<<<<<<<<<< * strides = ptr.dl_tensor.strides * PyCapsule_SetName(dltensor, 'used_dltensor') */ __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_nz); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_13 = __Pyx_PyInt_As_PetscInt(__pyx_t_3); if (unlikely((__pyx_t_13 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(33, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_nz = __pyx_t_13; } /* "PETSc/Vec.pyx":327 * for s in shape[:ndim]: * nz = nz*s * strides = ptr.dl_tensor.strides # <<<<<<<<<<<<<< * PyCapsule_SetName(dltensor, 'used_dltensor') * else: */ __pyx_t_10 = __pyx_v_ptr->dl_tensor.strides; __pyx_v_strides = __pyx_t_10; /* "PETSc/Vec.pyx":328 * nz = nz*s * strides = ptr.dl_tensor.strides * PyCapsule_SetName(dltensor, 'used_dltensor') # <<<<<<<<<<<<<< * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") */ __pyx_t_9 = PyCapsule_SetName(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 328, __pyx_L1_error) /* "PETSc/Vec.pyx":318 * dltensor = dltensor.__dlpack__() * * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * bits = ptr.dl_tensor.dtype.bits */ goto __pyx_L4; } /* "PETSc/Vec.pyx":330 * PyCapsule_SetName(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") # <<<<<<<<<<<<<< * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(33, 330, __pyx_L1_error) } __pyx_L4:; /* "PETSc/Vec.pyx":331 * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_t_2 = (__pyx_v_size == Py_None); __pyx_t_14 = (__pyx_t_2 != 0); if (__pyx_t_14) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_5); __pyx_t_5 = 0; } /* "PETSc/Vec.pyx":332 * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 332, __pyx_L1_error) /* "PETSc/Vec.pyx":333 * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 333, __pyx_L1_error) /* "PETSc/Vec.pyx":334 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 # <<<<<<<<<<<<<< * if nz < n: raise ValueError( * "array size %d and vector local size %d block size %d" % */ __pyx_t_14 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_14) { __pyx_v_bs = 1; } /* "PETSc/Vec.pyx":335 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) */ __pyx_t_14 = ((__pyx_v_nz < __pyx_v_n) != 0); if (unlikely(__pyx_t_14)) { /* "PETSc/Vec.pyx":337 * if nz < n: raise ValueError( * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_3); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_3 = 0; /* "PETSc/Vec.pyx":336 * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( * "array size %d and vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(nz), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL */ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/Vec.pyx":335 * Sys_Layout(ccomm, bs, &n, &N) * if bs == PETSC_DECIDE: bs = 1 * if nz < n: raise ValueError( # <<<<<<<<<<<<<< * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) */ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(33, 335, __pyx_L1_error) } /* "PETSc/Vec.pyx":338 * "array size %d and vector local size %d block size %d" % * (toInt(nz), toInt(n), toInt(bs))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * * if ptr.dl_tensor.ctx.device_type == 2: */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":340 * cdef PetscVec newvec = NULL * * if ptr.dl_tensor.ctx.device_type == 2: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_14 = ((__pyx_v_ptr->dl_tensor.ctx.device_type == 2) != 0); if (__pyx_t_14) { /* "PETSc/Vec.pyx":341 * * if ptr.dl_tensor.ctx.device_type == 2: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_9 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(33, 341, __pyx_L1_error) __pyx_t_14 = ((__pyx_t_9 == 1) != 0); if (__pyx_t_14) { /* "PETSc/Vec.pyx":342 * if ptr.dl_tensor.ctx.device_type == 2: * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqCUDAWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 342, __pyx_L1_error) /* "PETSc/Vec.pyx":341 * * if ptr.dl_tensor.ctx.device_type == 2: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ goto __pyx_L12; } /* "PETSc/Vec.pyx":344 * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * else: * if comm_size(ccomm) == 1: */ /*else*/ { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPICUDAWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 344, __pyx_L1_error) } __pyx_L12:; /* "PETSc/Vec.pyx":340 * cdef PetscVec newvec = NULL * * if ptr.dl_tensor.ctx.device_type == 2: # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqCUDAWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) */ goto __pyx_L11; } /* "PETSc/Vec.pyx":346 * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * else: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ /*else*/ { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_9 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(33, 346, __pyx_L1_error) __pyx_t_14 = ((__pyx_t_9 == 1) != 0); if (__pyx_t_14) { /* "PETSc/Vec.pyx":347 * else: * if comm_size(ccomm) == 1: * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateSeqWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 347, __pyx_L1_error) /* "PETSc/Vec.pyx":346 * CHKERR( VecCreateMPICUDAWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * else: * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: */ goto __pyx_L13; } /* "PETSc/Vec.pyx":349 * CHKERR( VecCreateSeqWithArray(ccomm,bs,N,(ptr.dl_tensor.data),&newvec) ) * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', dltensor) */ /*else*/ { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateMPIWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, ((PetscScalar *)__pyx_v_ptr->dl_tensor.data), (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 349, __pyx_L1_error) } __pyx_L13:; } __pyx_L11:; /* "PETSc/Vec.pyx":350 * else: * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * self.set_attr('__array__', dltensor) * cdef int64_t* shape_arr = NULL */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":351 * CHKERR( VecCreateMPIWithArray(ccomm,bs,n,N,(ptr.dl_tensor.data),&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', dltensor) # <<<<<<<<<<<<<< * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL */ __pyx_t_8 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_dltensor); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/Vec.pyx":352 * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', dltensor) * cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides_arr = NULL * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) */ __pyx_v_shape_arr = NULL; /* "PETSc/Vec.pyx":353 * self.set_attr('__array__', dltensor) * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL # <<<<<<<<<<<<<< * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ __pyx_v_strides_arr = NULL; /* "PETSc/Vec.pyx":354 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) # <<<<<<<<<<<<<< * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): */ __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_8, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_s1 = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/Vec.pyx":355 * cdef int64_t* strides_arr = NULL * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) # <<<<<<<<<<<<<< * for i in range(ndim): * shape_arr[i] = shape[i] */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_s2 = __pyx_t_8; __pyx_t_8 = 0; /* "PETSc/Vec.pyx":356 * cdef object s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] */ __pyx_t_15 = __pyx_v_ndim; __pyx_t_16 = __pyx_t_15; for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) { __pyx_v_i = __pyx_t_17; /* "PETSc/Vec.pyx":357 * cdef object s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): * shape_arr[i] = shape[i] # <<<<<<<<<<<<<< * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) */ (__pyx_v_shape_arr[__pyx_v_i]) = (__pyx_v_shape[__pyx_v_i]); /* "PETSc/Vec.pyx":358 * for i in range(ndim): * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: */ (__pyx_v_strides_arr[__pyx_v_i]) = (__pyx_v_strides[__pyx_v_i]); } /* "PETSc/Vec.pyx":359 * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) # <<<<<<<<<<<<<< * if ptr.manager_deleter != NULL: * ptr.manager_deleter(ptr) # free the manager */ __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __Pyx_INCREF(__pyx_v_s1); __Pyx_GIVEREF(__pyx_v_s1); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_s1); __Pyx_INCREF(__pyx_v_s2); __Pyx_GIVEREF(__pyx_v_s2); PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_s2); __pyx_t_8 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Vec.pyx":360 * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: # <<<<<<<<<<<<<< * ptr.manager_deleter(ptr) # free the manager * return self */ __pyx_t_14 = ((__pyx_v_ptr->manager_deleter != NULL) != 0); if (__pyx_t_14) { /* "PETSc/Vec.pyx":361 * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: * ptr.manager_deleter(ptr) # free the manager # <<<<<<<<<<<<<< * return self * */ __pyx_v_ptr->manager_deleter(__pyx_v_ptr); /* "PETSc/Vec.pyx":360 * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * if ptr.manager_deleter != NULL: # <<<<<<<<<<<<<< * ptr.manager_deleter(ptr) # free the manager * return self */ } /* "PETSc/Vec.pyx":362 * if ptr.manager_deleter != NULL: * ptr.manager_deleter(ptr) # free the manager * return self # <<<<<<<<<<<<<< * * def attachDLPackInfo(self, Vec vec=None, object dltensor=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":292 * return self * * def createWithDLPack(self, object dltensor, size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * """ * Returns an instance :class:`Vec`, a PETSc vector from a DLPack object */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createWithDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XDECREF(__pyx_v_s1); __Pyx_XDECREF(__pyx_v_s2); __Pyx_XDECREF(__pyx_v_dltensor); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":364 * return self * * def attachDLPackInfo(self, Vec vec=None, object dltensor=None): # <<<<<<<<<<<<<< * """ * Attach the tensor information from an input vector (vec) or a */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_63attachDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_62attachDLPackInfo[] = "Vec.attachDLPackInfo(self, Vec vec=None, dltensor=None)\n\n Attach the tensor information from an input vector (vec) or a\n DLPack tensor if it is not available in current vector. The input\n vector is typically created with createWithDlpack(). This operation\n does not copy the data from the input parameters, it simply uses\n their meta information.\n\n Note that the auxiliary tensor information is required when converting\n a PETSc vector to a DLPack object.\n\n See also :meth:`Vec.clearDLPackInfo`.\n\n :arg vec: A :class:'Vec' containing auxiliary tensor information\n :arg dltensor: A DLPack tensor object\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_63attachDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_dltensor = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("attachDLPackInfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_dltensor,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dltensor); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "attachDLPackInfo") < 0)) __PYX_ERR(33, 364, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); __pyx_v_dltensor = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("attachDLPackInfo", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 364, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.attachDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "vec", 0))) __PYX_ERR(33, 364, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_62attachDLPackInfo(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec, __pyx_v_dltensor); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_62attachDLPackInfo(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_dltensor) { CYTHON_UNUSED PyObject *__pyx_v_ctx0 = 0; PyObject *__pyx_v_ctx = 0; struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_ptr; int64_t *__pyx_v_shape_arr; int64_t *__pyx_v_strides_arr; PyObject *__pyx_v_s1 = 0; PyObject *__pyx_v_s2 = 0; PyObject *__pyx_v_t0 = NULL; PyObject *__pyx_v_t1 = NULL; uint8_t __pyx_v_bits; int __pyx_v_ndim; int64_t *__pyx_v_shape; int64_t *__pyx_v_strides; int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; void *__pyx_t_9; uint8_t __pyx_t_10; int64_t *__pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("attachDLPackInfo", 0); /* "PETSc/Vec.pyx":380 * :arg dltensor: A DLPack tensor object * """ * cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None # <<<<<<<<<<<<<< * cdef DLManagedTensor* ptr = NULL * cdef int64_t* shape_arr = NULL */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctx0 = __pyx_t_1; __pyx_t_1 = 0; __Pyx_INCREF(Py_None); __pyx_v_ctx = Py_None; /* "PETSc/Vec.pyx":381 * """ * cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None * cdef DLManagedTensor* ptr = NULL # <<<<<<<<<<<<<< * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL */ __pyx_v_ptr = NULL; /* "PETSc/Vec.pyx":382 * cdef object ctx0 = self.get_attr('__dltensor_ctx__'), ctx = None * cdef DLManagedTensor* ptr = NULL * cdef int64_t* shape_arr = NULL # <<<<<<<<<<<<<< * cdef int64_t* strides_arr = NULL * cdef object s1 = None, s2 = None */ __pyx_v_shape_arr = NULL; /* "PETSc/Vec.pyx":383 * cdef DLManagedTensor* ptr = NULL * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL # <<<<<<<<<<<<<< * cdef object s1 = None, s2 = None * */ __pyx_v_strides_arr = NULL; /* "PETSc/Vec.pyx":384 * cdef int64_t* shape_arr = NULL * cdef int64_t* strides_arr = NULL * cdef object s1 = None, s2 = None # <<<<<<<<<<<<<< * * if vec is None and dltensor is None: */ __Pyx_INCREF(Py_None); __pyx_v_s1 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_s2 = Py_None; /* "PETSc/Vec.pyx":386 * cdef object s1 = None, s2 = None * * if vec is None and dltensor is None: # <<<<<<<<<<<<<< * raise ValueError('Missing input parameters') * if vec is not None: */ __pyx_t_3 = (((PyObject *)__pyx_v_vec) == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = (__pyx_v_dltensor == Py_None); __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_2)) { /* "PETSc/Vec.pyx":387 * * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') # <<<<<<<<<<<<<< * if vec is not None: * t0 = self.getType() */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 387, __pyx_L1_error) /* "PETSc/Vec.pyx":386 * cdef object s1 = None, s2 = None * * if vec is None and dltensor is None: # <<<<<<<<<<<<<< * raise ValueError('Missing input parameters') * if vec is not None: */ } /* "PETSc/Vec.pyx":388 * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') * if vec is not None: # <<<<<<<<<<<<<< * t0 = self.getType() * t1 = vec.getType() */ __pyx_t_2 = (((PyObject *)__pyx_v_vec) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":389 * raise ValueError('Missing input parameters') * if vec is not None: * t0 = self.getType() # <<<<<<<<<<<<<< * t1 = vec.getType() * if t0 != t1: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_t0 = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":390 * if vec is not None: * t0 = self.getType() * t1 = vec.getType() # <<<<<<<<<<<<<< * if t0 != t1: * raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_vec), __pyx_n_s_getType); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_t1 = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":391 * t0 = self.getType() * t1 = vec.getType() * if t0 != t1: # <<<<<<<<<<<<<< * raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) * ctx = (vec).get_attr('__dltensor_ctx__') */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_t0, __pyx_v_t1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 391, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(33, 391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_3)) { /* "PETSc/Vec.pyx":392 * t1 = vec.getType() * if t0 != t1: * raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) # <<<<<<<<<<<<<< * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Input_vector_type_does_not_match, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_t1, __pyx_v_t0}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 392, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_t1, __pyx_v_t0}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 392, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_t1); __Pyx_GIVEREF(__pyx_v_t1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_t1); __Pyx_INCREF(__pyx_v_t0); __Pyx_GIVEREF(__pyx_v_t0); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_t0); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(33, 392, __pyx_L1_error) /* "PETSc/Vec.pyx":391 * t0 = self.getType() * t1 = vec.getType() * if t0 != t1: # <<<<<<<<<<<<<< * raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) * ctx = (vec).get_attr('__dltensor_ctx__') */ } /* "PETSc/Vec.pyx":393 * if t0 != t1: * raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) * ctx = (vec).get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<< * if ctx is None: * raise ValueError('Input vector has no tensor information') */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)((struct PyPetscObjectObject *)__pyx_v_vec)->__pyx_vtab)->get_attr(((struct PyPetscObjectObject *)__pyx_v_vec), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_ctx, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Vec.pyx":394 * raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: # <<<<<<<<<<<<<< * raise ValueError('Input vector has no tensor information') * self.set_attr('__dltensor_ctx__', ctx) */ __pyx_t_3 = (__pyx_v_ctx == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/Vec.pyx":395 * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: * raise ValueError('Input vector has no tensor information') # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', ctx) * else: */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(33, 395, __pyx_L1_error) /* "PETSc/Vec.pyx":394 * raise TypeError('Input vector type {} does not match current vector type {}'.format(t1,t0)) * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: # <<<<<<<<<<<<<< * raise ValueError('Input vector has no tensor information') * self.set_attr('__dltensor_ctx__', ctx) */ } /* "PETSc/Vec.pyx":396 * if ctx is None: * raise ValueError('Input vector has no tensor information') * self.set_attr('__dltensor_ctx__', ctx) # <<<<<<<<<<<<<< * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_v_ctx); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Vec.pyx":388 * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') * if vec is not None: # <<<<<<<<<<<<<< * t0 = self.getType() * t1 = vec.getType() */ goto __pyx_L6; } /* "PETSc/Vec.pyx":398 * self.set_attr('__dltensor_ctx__', ctx) * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): */ /*else*/ { __pyx_t_2 = (PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"dltensor")) != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":399 * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') # <<<<<<<<<<<<<< * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') */ __pyx_t_9 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"dltensor")); if (unlikely(__pyx_t_9 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(33, 399, __pyx_L1_error) __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_9); /* "PETSc/Vec.pyx":398 * self.set_attr('__dltensor_ctx__', ctx) * else: * if PyCapsule_IsValid(dltensor, 'dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): */ goto __pyx_L9; } /* "PETSc/Vec.pyx":400 * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: */ __pyx_t_2 = (PyCapsule_IsValid(__pyx_v_dltensor, ((char const *)"used_dltensor")) != 0); if (likely(__pyx_t_2)) { /* "PETSc/Vec.pyx":401 * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') # <<<<<<<<<<<<<< * else: * raise ValueError("Expect a dltensor or used_dltensor field") */ __pyx_t_9 = PyCapsule_GetPointer(__pyx_v_dltensor, ((char const *)"used_dltensor")); if (unlikely(__pyx_t_9 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(33, 401, __pyx_L1_error) __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_9); /* "PETSc/Vec.pyx":400 * if PyCapsule_IsValid(dltensor, 'dltensor'): * ptr = PyCapsule_GetPointer(dltensor, 'dltensor') * elif PyCapsule_IsValid(dltensor, 'used_dltensor'): # <<<<<<<<<<<<<< * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: */ goto __pyx_L9; } /* "PETSc/Vec.pyx":403 * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor or used_dltensor field") # <<<<<<<<<<<<<< * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(33, 403, __pyx_L1_error) } __pyx_L9:; /* "PETSc/Vec.pyx":404 * else: * raise ValueError("Expect a dltensor or used_dltensor field") * bits = ptr.dl_tensor.dtype.bits # <<<<<<<<<<<<<< * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) */ __pyx_t_10 = __pyx_v_ptr->dl_tensor.dtype.bits; __pyx_v_bits = __pyx_t_10; /* "PETSc/Vec.pyx":405 * raise ValueError("Expect a dltensor or used_dltensor field") * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ __pyx_t_2 = ((__pyx_v_bits != (8 * (sizeof(PetscScalar)))) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/Vec.pyx":406 * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) # <<<<<<<<<<<<<< * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 406, __pyx_L1_error) /* "PETSc/Vec.pyx":405 * raise ValueError("Expect a dltensor or used_dltensor field") * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): # <<<<<<<<<<<<<< * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim */ } /* "PETSc/Vec.pyx":407 * if bits != 8*sizeof(PetscScalar): * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim # <<<<<<<<<<<<<< * shape = ptr.dl_tensor.shape * strides = ptr.dl_tensor.strides */ __pyx_t_7 = __pyx_v_ptr->dl_tensor.ndim; __pyx_v_ndim = __pyx_t_7; /* "PETSc/Vec.pyx":408 * raise TypeError("Tensor dtype = {} does not match PETSc precision".format(ptr.dl_tensor.dtype)) * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape # <<<<<<<<<<<<<< * strides = ptr.dl_tensor.strides * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) */ __pyx_t_11 = __pyx_v_ptr->dl_tensor.shape; __pyx_v_shape = __pyx_t_11; /* "PETSc/Vec.pyx":409 * ndim = ptr.dl_tensor.ndim * shape = ptr.dl_tensor.shape * strides = ptr.dl_tensor.strides # <<<<<<<<<<<<<< * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) */ __pyx_t_11 = __pyx_v_ptr->dl_tensor.strides; __pyx_v_strides = __pyx_t_11; /* "PETSc/Vec.pyx":410 * shape = ptr.dl_tensor.shape * strides = ptr.dl_tensor.strides * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) # <<<<<<<<<<<<<< * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Vec.pyx":411 * strides = ptr.dl_tensor.strides * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) # <<<<<<<<<<<<<< * for i in range(ndim): * shape_arr[i] = shape[i] */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_5, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":412 * s1 = oarray_p(empty_p(ndim), NULL, &shape_arr) * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] */ __pyx_t_7 = __pyx_v_ndim; __pyx_t_12 = __pyx_t_7; for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) { __pyx_v_i = __pyx_t_13; /* "PETSc/Vec.pyx":413 * s2 = oarray_p(empty_p(ndim), NULL, &strides_arr) * for i in range(ndim): * shape_arr[i] = shape[i] # <<<<<<<<<<<<<< * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) */ (__pyx_v_shape_arr[__pyx_v_i]) = (__pyx_v_shape[__pyx_v_i]); /* "PETSc/Vec.pyx":414 * for i in range(ndim): * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * return self */ (__pyx_v_strides_arr[__pyx_v_i]) = (__pyx_v_strides[__pyx_v_i]); } /* "PETSc/Vec.pyx":415 * shape_arr[i] = shape[i] * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_8); __Pyx_INCREF(__pyx_v_s1); __Pyx_GIVEREF(__pyx_v_s1); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_s1); __Pyx_INCREF(__pyx_v_s2); __Pyx_GIVEREF(__pyx_v_s2); PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_s2); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_8 = 0; __pyx_t_8 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_L6:; /* "PETSc/Vec.pyx":416 * strides_arr[i] = strides[i] * self.set_attr('__dltensor_ctx__', (ptr.dl_tensor.ctx.device_type, ptr.dl_tensor.ctx.device_id, ndim, s1, s2)) * return self # <<<<<<<<<<<<<< * * def clearDLPackInfo(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":364 * return self * * def attachDLPackInfo(self, Vec vec=None, object dltensor=None): # <<<<<<<<<<<<<< * """ * Attach the tensor information from an input vector (vec) or a */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Vec.attachDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ctx0); __Pyx_XDECREF(__pyx_v_ctx); __Pyx_XDECREF(__pyx_v_s1); __Pyx_XDECREF(__pyx_v_s2); __Pyx_XDECREF(__pyx_v_t0); __Pyx_XDECREF(__pyx_v_t1); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":418 * return self * * def clearDLPackInfo(self): # <<<<<<<<<<<<<< * """ * Clear the tensor information */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_65clearDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_64clearDLPackInfo[] = "Vec.clearDLPackInfo(self)\n\n Clear the tensor information\n See also :meth:`Vec.attachDLPackInfo`.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_65clearDLPackInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearDLPackInfo (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("clearDLPackInfo", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDLPackInfo", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_64clearDLPackInfo(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_64clearDLPackInfo(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearDLPackInfo", 0); /* "PETSc/Vec.pyx":423 * See also :meth:`Vec.attachDLPackInfo`. * """ * self.set_attr('__dltensor_ctx__', None) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":424 * """ * self.set_attr('__dltensor_ctx__', None) * return self # <<<<<<<<<<<<<< * * def toDLPack(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":418 * return self * * def clearDLPackInfo(self): # <<<<<<<<<<<<<< * """ * Clear the tensor information */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.clearDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":426 * return self * * def toDLPack(self): # <<<<<<<<<<<<<< * """ * Return a DLPack tensor. Error out if the tensor information is missing. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_67toDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_66toDLPack[] = "Vec.toDLPack(self)\n\n Return a DLPack tensor. Error out if the tensor information is missing.\n buildTensorInfo() can be used to get tensor information from an input\n vector that already has tensor information. This input vector is\n typically created with createWithDlpack().\n\n One can do the following to convert vector X to a DLPack tensor whose\n anxiliary information inherits from Y.\n X.buildTensorInfo(Y)\n X.toDLPack()\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_67toDLPack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toDLPack (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("toDLPack", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "toDLPack", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_66toDLPack(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_66toDLPack(struct PyPetscVecObject *__pyx_v_self) { struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *__pyx_v_dlm_tensor; struct __pyx_t_8petsc4py_5PETSc_DLTensor *__pyx_v_dl_tensor; PetscScalar *__pyx_v_a; int64_t __pyx_v_ndim; int64_t *__pyx_v_shape_strides; PyObject *__pyx_v_cval = NULL; __pyx_t_8petsc4py_5PETSc_DLContext *__pyx_v_ctx; PyObject *__pyx_v_ctx0 = 0; PyObject *__pyx_v_device_type = NULL; PyObject *__pyx_v_device_id = NULL; PyObject *__pyx_v_shape = NULL; PyObject *__pyx_v_strides = NULL; PyObject *__pyx_v_i = NULL; struct __pyx_t_8petsc4py_5PETSc_DLDataType *__pyx_v_dtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); int64_t __pyx_t_11; Py_ssize_t __pyx_t_12; PyObject *(*__pyx_t_13)(PyObject *); Py_ssize_t __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toDLPack", 0); /* "PETSc/Vec.pyx":438 * X.toDLPack() * """ * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) # <<<<<<<<<<<<<< * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL */ __pyx_v_dlm_tensor = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)malloc((sizeof(struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor)))); /* "PETSc/Vec.pyx":439 * """ * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor # <<<<<<<<<<<<<< * cdef PetscScalar *a = NULL * cdef int64_t ndim = 0 */ __pyx_v_dl_tensor = (&__pyx_v_dlm_tensor->dl_tensor); /* "PETSc/Vec.pyx":440 * cdef DLManagedTensor* dlm_tensor = malloc(sizeof(DLManagedTensor)) * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL # <<<<<<<<<<<<<< * cdef int64_t ndim = 0 * cdef int64_t* shape_strides = NULL */ __pyx_v_a = NULL; /* "PETSc/Vec.pyx":441 * cdef DLTensor* dl_tensor = &dlm_tensor.dl_tensor * cdef PetscScalar *a = NULL * cdef int64_t ndim = 0 # <<<<<<<<<<<<<< * cdef int64_t* shape_strides = NULL * dl_tensor.byte_offset = 0 */ __pyx_v_ndim = 0; /* "PETSc/Vec.pyx":442 * cdef PetscScalar *a = NULL * cdef int64_t ndim = 0 * cdef int64_t* shape_strides = NULL # <<<<<<<<<<<<<< * dl_tensor.byte_offset = 0 * cval = self.getType() */ __pyx_v_shape_strides = NULL; /* "PETSc/Vec.pyx":443 * cdef int64_t ndim = 0 * cdef int64_t* shape_strides = NULL * dl_tensor.byte_offset = 0 # <<<<<<<<<<<<<< * cval = self.getType() * if cval == self.Type.CUDA or cval == self.Type.SEQCUDA or cval == self.Type.MPICUDA: */ __pyx_v_dl_tensor->byte_offset = 0; /* "PETSc/Vec.pyx":444 * cdef int64_t* shape_strides = NULL * dl_tensor.byte_offset = 0 * cval = self.getType() # <<<<<<<<<<<<<< * if cval == self.Type.CUDA or cval == self.Type.SEQCUDA or cval == self.Type.MPICUDA: * CHKERR( VecCUDAGetArrayWrite(self.vec, &a) ) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getType); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_cval = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":445 * dl_tensor.byte_offset = 0 * cval = self.getType() * if cval == self.Type.CUDA or cval == self.Type.SEQCUDA or cval == self.Type.MPICUDA: # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayWrite(self.vec, &a) ) * else: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Type); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CUDA); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_v_cval, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Type); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEQCUDA); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_v_cval, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Type); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_MPICUDA); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_RichCompare(__pyx_v_cval, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(33, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_4) { /* "PETSc/Vec.pyx":446 * cval = self.getType() * if cval == self.Type.CUDA or cval == self.Type.SEQCUDA or cval == self.Type.MPICUDA: * CHKERR( VecCUDAGetArrayWrite(self.vec, &a) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecGetArrayWrite(self.vec, &a) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDAGetArrayWrite(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(33, 446, __pyx_L1_error) /* "PETSc/Vec.pyx":445 * dl_tensor.byte_offset = 0 * cval = self.getType() * if cval == self.Type.CUDA or cval == self.Type.SEQCUDA or cval == self.Type.MPICUDA: # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayWrite(self.vec, &a) ) * else: */ goto __pyx_L3; } /* "PETSc/Vec.pyx":448 * CHKERR( VecCUDAGetArrayWrite(self.vec, &a) ) * else: * CHKERR( VecGetArrayWrite(self.vec, &a) ) # <<<<<<<<<<<<<< * dl_tensor.data = a * */ /*else*/ { __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayWrite(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(33, 448, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Vec.pyx":449 * else: * CHKERR( VecGetArrayWrite(self.vec, &a) ) * dl_tensor.data = a # <<<<<<<<<<<<<< * * cdef DLContext* ctx = &dl_tensor.ctx */ __pyx_v_dl_tensor->data = ((void *)__pyx_v_a); /* "PETSc/Vec.pyx":451 * dl_tensor.data = a * * cdef DLContext* ctx = &dl_tensor.ctx # <<<<<<<<<<<<<< * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: */ __pyx_v_ctx = (&__pyx_v_dl_tensor->ctx); /* "PETSc/Vec.pyx":452 * * cdef DLContext* ctx = &dl_tensor.ctx * cdef object ctx0 = self.get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<< * if ctx0 is not None: * (device_type, device_id, ndim, shape, strides) = ctx0 */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctx0 = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":453 * cdef DLContext* ctx = &dl_tensor.ctx * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: # <<<<<<<<<<<<<< * (device_type, device_id, ndim, shape, strides) = ctx0 * ctx.device_type = device_type */ __pyx_t_4 = (__pyx_v_ctx0 != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (likely(__pyx_t_5)) { /* "PETSc/Vec.pyx":454 * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: * (device_type, device_id, ndim, shape, strides) = ctx0 # <<<<<<<<<<<<<< * ctx.device_type = device_type * ctx.device_id = device_id */ if ((likely(PyTuple_CheckExact(__pyx_v_ctx0))) || (PyList_CheckExact(__pyx_v_ctx0))) { PyObject* sequence = __pyx_v_ctx0; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 5)) { if (size > 5) __Pyx_RaiseTooManyValuesError(5); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(33, 454, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 4); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_7 = PyList_GET_ITEM(sequence, 3); __pyx_t_8 = PyList_GET_ITEM(sequence, 4); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else { Py_ssize_t i; PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_7,&__pyx_t_8}; for (i=0; i < 5; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(33, 454, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_7,&__pyx_t_8}; __pyx_t_9 = PyObject_GetIter(__pyx_v_ctx0); if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; for (index=0; index < 5; index++) { PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 5) < 0) __PYX_ERR(33, 454, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_unpacking_done; __pyx_L8_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(33, 454, __pyx_L1_error) __pyx_L9_unpacking_done:; } __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(33, 454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_device_type = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_device_id = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_ndim = __pyx_t_11; __pyx_v_shape = __pyx_t_7; __pyx_t_7 = 0; __pyx_v_strides = __pyx_t_8; __pyx_t_8 = 0; /* "PETSc/Vec.pyx":455 * if ctx0 is not None: * (device_type, device_id, ndim, shape, strides) = ctx0 * ctx.device_type = device_type # <<<<<<<<<<<<<< * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_device_type); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(33, 455, __pyx_L1_error) __pyx_v_ctx->device_type = __pyx_t_6; /* "PETSc/Vec.pyx":456 * (device_type, device_id, ndim, shape, strides) = ctx0 * ctx.device_type = device_type * ctx.device_id = device_id # <<<<<<<<<<<<<< * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): */ __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_device_id); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(33, 456, __pyx_L1_error) __pyx_v_ctx->device_id = __pyx_t_6; /* "PETSc/Vec.pyx":457 * ctx.device_type = device_type * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) # <<<<<<<<<<<<<< * for i in range(ndim): * shape_strides[i] = shape[i] */ __pyx_v_shape_strides = ((int64_t *)malloc((((sizeof(int64_t)) * 2) * __pyx_v_ndim))); /* "PETSc/Vec.pyx":458 * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i] = shape[i] * for i in range(ndim): */ __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(33, 458, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(33, 458, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(33, 458, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(33, 458, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":459 * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): * shape_strides[i] = shape[i] # <<<<<<<<<<<<<< * for i in range(ndim): * shape_strides[i+ndim] = strides[i] */ __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_shape, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(33, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(33, 459, __pyx_L1_error) (__pyx_v_shape_strides[__pyx_t_14]) = __pyx_t_11; /* "PETSc/Vec.pyx":458 * ctx.device_id = device_id * shape_strides = malloc(sizeof(int64_t)*2*ndim) * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i] = shape[i] * for i in range(ndim): */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/Vec.pyx":460 * for i in range(ndim): * shape_strides[i] = shape[i] * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i+ndim] = strides[i] * else: */ __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) { __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(33, 460, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(33, 460, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(33, 460, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(33, 460, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":461 * shape_strides[i] = shape[i] * for i in range(ndim): * shape_strides[i+ndim] = strides[i] # <<<<<<<<<<<<<< * else: * raise ValueError('Missing tensor information') */ __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_strides, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(33, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = PyNumber_Add(__pyx_v_i, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(33, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_shape_strides[__pyx_t_14]) = __pyx_t_11; /* "PETSc/Vec.pyx":460 * for i in range(ndim): * shape_strides[i] = shape[i] * for i in range(ndim): # <<<<<<<<<<<<<< * shape_strides[i+ndim] = strides[i] * else: */ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/Vec.pyx":453 * cdef DLContext* ctx = &dl_tensor.ctx * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: # <<<<<<<<<<<<<< * (device_type, device_id, ndim, shape, strides) = ctx0 * ctx.device_type = device_type */ goto __pyx_L7; } /* "PETSc/Vec.pyx":463 * shape_strides[i+ndim] = strides[i] * else: * raise ValueError('Missing tensor information') # <<<<<<<<<<<<<< * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(33, 463, __pyx_L1_error) } __pyx_L7:; /* "PETSc/Vec.pyx":464 * else: * raise ValueError('Missing tensor information') * dl_tensor.ndim = ndim # <<<<<<<<<<<<<< * dl_tensor.shape = shape_strides * dl_tensor.strides = shape_strides + ndim */ __pyx_v_dl_tensor->ndim = __pyx_v_ndim; /* "PETSc/Vec.pyx":465 * raise ValueError('Missing tensor information') * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides # <<<<<<<<<<<<<< * dl_tensor.strides = shape_strides + ndim * */ __pyx_v_dl_tensor->shape = __pyx_v_shape_strides; /* "PETSc/Vec.pyx":466 * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides * dl_tensor.strides = shape_strides + ndim # <<<<<<<<<<<<<< * * cdef DLDataType* dtype = &dl_tensor.dtype */ __pyx_v_dl_tensor->strides = (__pyx_v_shape_strides + __pyx_v_ndim); /* "PETSc/Vec.pyx":468 * dl_tensor.strides = shape_strides + ndim * * cdef DLDataType* dtype = &dl_tensor.dtype # <<<<<<<<<<<<<< * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: */ __pyx_v_dtype = (&__pyx_v_dl_tensor->dtype); /* "PETSc/Vec.pyx":469 * * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat # <<<<<<<<<<<<<< * if sizeof(PetscScalar) == 8: * dtype.bits = 64 */ __pyx_v_dtype->code = ((uint8_t)__pyx_e_8petsc4py_5PETSc_kDLFloat); /* "PETSc/Vec.pyx":470 * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: # <<<<<<<<<<<<<< * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: */ __pyx_t_5 = (((sizeof(PetscScalar)) == 8) != 0); if (__pyx_t_5) { /* "PETSc/Vec.pyx":471 * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: * dtype.bits = 64 # <<<<<<<<<<<<<< * elif sizeof(PetscScalar) == 4: * dtype.bits = 32 */ __pyx_v_dtype->bits = ((uint8_t)64); /* "PETSc/Vec.pyx":470 * cdef DLDataType* dtype = &dl_tensor.dtype * dtype.code = DLDataTypeCode.kDLFloat * if sizeof(PetscScalar) == 8: # <<<<<<<<<<<<<< * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: */ goto __pyx_L14; } /* "PETSc/Vec.pyx":472 * if sizeof(PetscScalar) == 8: * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<< * dtype.bits = 32 * else: */ __pyx_t_5 = (((sizeof(PetscScalar)) == 4) != 0); if (likely(__pyx_t_5)) { /* "PETSc/Vec.pyx":473 * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: * dtype.bits = 32 # <<<<<<<<<<<<<< * else: * raise ValueError('Unsupported PetscScalar type') */ __pyx_v_dtype->bits = ((uint8_t)32); /* "PETSc/Vec.pyx":472 * if sizeof(PetscScalar) == 8: * dtype.bits = 64 * elif sizeof(PetscScalar) == 4: # <<<<<<<<<<<<<< * dtype.bits = 32 * else: */ goto __pyx_L14; } /* "PETSc/Vec.pyx":475 * dtype.bits = 32 * else: * raise ValueError('Unsupported PetscScalar type') # <<<<<<<<<<<<<< * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec */ /*else*/ { __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __PYX_ERR(33, 475, __pyx_L1_error) } __pyx_L14:; /* "PETSc/Vec.pyx":476 * else: * raise ValueError('Unsupported PetscScalar type') * dtype.lanes = 1 # <<<<<<<<<<<<<< * dlm_tensor.manager_ctx = self.vec * CHKERR( PetscObjectReference(self.vec) ) */ __pyx_v_dtype->lanes = ((uint16_t)1); /* "PETSc/Vec.pyx":477 * raise ValueError('Unsupported PetscScalar type') * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference(self.vec) ) * dlm_tensor.manager_deleter = manager_deleter */ __pyx_v_dlm_tensor->manager_ctx = ((void *)__pyx_v_self->vec); /* "PETSc/Vec.pyx":478 * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec * CHKERR( PetscObjectReference(self.vec) ) # <<<<<<<<<<<<<< * dlm_tensor.manager_deleter = manager_deleter * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_self->vec))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(33, 478, __pyx_L1_error) /* "PETSc/Vec.pyx":479 * dlm_tensor.manager_ctx = self.vec * CHKERR( PetscObjectReference(self.vec) ) * dlm_tensor.manager_deleter = manager_deleter # <<<<<<<<<<<<<< * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * */ __pyx_v_dlm_tensor->manager_deleter = __pyx_f_8petsc4py_5PETSc_manager_deleter; /* "PETSc/Vec.pyx":480 * CHKERR( PetscObjectReference(self.vec) ) * dlm_tensor.manager_deleter = manager_deleter * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) # <<<<<<<<<<<<<< * * def createGhost(self, ghosts, size, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyCapsule_New(__pyx_v_dlm_tensor, ((char const *)"dltensor"), __pyx_f_8petsc4py_5PETSc_pycapsule_deleter); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":426 * return self * * def toDLPack(self): # <<<<<<<<<<<<<< * """ * Return a DLPack tensor. Error out if the tensor information is missing. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.Vec.toDLPack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cval); __Pyx_XDECREF(__pyx_v_ctx0); __Pyx_XDECREF(__pyx_v_device_type); __Pyx_XDECREF(__pyx_v_device_id); __Pyx_XDECREF(__pyx_v_shape); __Pyx_XDECREF(__pyx_v_strides); __Pyx_XDECREF(__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":482 * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * * def createGhost(self, ghosts, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_69createGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_68createGhost[] = "Vec.createGhost(self, ghosts, size, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_69createGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ghosts = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGhost (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghosts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createGhost", 0, 2, 4, 1); __PYX_ERR(33, 482, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGhost") < 0)) __PYX_ERR(33, 482, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ghosts = values[0]; __pyx_v_size = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGhost", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 482, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_68createGhost(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_68createGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_ng; PetscInt *__pyx_v_ig; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGhost", 0); __Pyx_INCREF(__pyx_v_ghosts); /* "PETSc/Vec.pyx":483 * * def createGhost(self, ghosts, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 483, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Vec.pyx":484 * def createGhost(self, ghosts, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL # <<<<<<<<<<<<<< * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_v_ng = 0; __pyx_v_ig = NULL; /* "PETSc/Vec.pyx":485 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghosts, (&__pyx_v_ng), (&__pyx_v_ig))); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_ghosts, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Vec.pyx":486 * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":487 * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 487, __pyx_L1_error) /* "PETSc/Vec.pyx":488 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 488, __pyx_L1_error) /* "PETSc/Vec.pyx":489 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhost( */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":490 * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhost( * ccomm, n, N, ng, ig, &newvec) ) */ __pyx_t_4 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_4) { /* "PETSc/Vec.pyx":491 * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhost( # <<<<<<<<<<<<<< * ccomm, n, N, ng, ig, &newvec) ) * else: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhost(__pyx_v_ccomm, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, (&__pyx_v_newvec))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 491, __pyx_L1_error) /* "PETSc/Vec.pyx":490 * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhost( * ccomm, n, N, ng, ig, &newvec) ) */ goto __pyx_L3; } /* "PETSc/Vec.pyx":494 * ccomm, n, N, ng, ig, &newvec) ) * else: * CHKERR( VecCreateGhostBlock( # <<<<<<<<<<<<<< * ccomm, bs, n, N, ng, ig, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec */ /*else*/ { /* "PETSc/Vec.pyx":495 * else: * CHKERR( VecCreateGhostBlock( * ccomm, bs, n, N, ng, ig, &newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhostBlock(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, (&__pyx_v_newvec))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 494, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Vec.pyx":496 * CHKERR( VecCreateGhostBlock( * ccomm, bs, n, N, ng, ig, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":497 * ccomm, bs, n, N, ng, ig, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * return self # <<<<<<<<<<<<<< * * def createGhostWithArray(self, ghosts, array, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":482 * return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter) * * def createGhost(self, ghosts, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ghosts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":499 * return self * * def createGhostWithArray(self, ghosts, array, # <<<<<<<<<<<<<< * size=None, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_71createGhostWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_70createGhostWithArray[] = "Vec.createGhostWithArray(self, ghosts, array, size=None, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_71createGhostWithArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ghosts = 0; PyObject *__pyx_v_array = 0; PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGhostWithArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,&__pyx_n_s_array,&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; /* "PETSc/Vec.pyx":500 * * def createGhostWithArray(self, ghosts, array, * size=None, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL */ values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghosts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createGhostWithArray", 0, 2, 5, 1); __PYX_ERR(33, 499, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGhostWithArray") < 0)) __PYX_ERR(33, 499, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ghosts = values[0]; __pyx_v_array = values[1]; __pyx_v_size = values[2]; __pyx_v_bsize = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGhostWithArray", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 499, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhostWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_70createGhostWithArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts, __pyx_v_array, __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* "PETSc/Vec.pyx":499 * return self * * def createGhostWithArray(self, ghosts, array, # <<<<<<<<<<<<<< * size=None, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_70createGhostWithArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts, PyObject *__pyx_v_array, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_ng; PetscInt *__pyx_v_ig; PetscInt __pyx_v_na; PetscScalar *__pyx_v_sa; PetscInt __pyx_v_b; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; int __pyx_t_4; PetscInt __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGhostWithArray", 0); __Pyx_INCREF(__pyx_v_ghosts); __Pyx_INCREF(__pyx_v_array); __Pyx_INCREF(__pyx_v_size); /* "PETSc/Vec.pyx":501 * def createGhostWithArray(self, ghosts, array, * size=None, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 501, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Vec.pyx":502 * size=None, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL # <<<<<<<<<<<<<< * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt na=0 */ __pyx_v_ng = 0; __pyx_v_ig = NULL; /* "PETSc/Vec.pyx":503 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) # <<<<<<<<<<<<<< * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghosts, (&__pyx_v_ng), (&__pyx_v_ig))); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_ghosts, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Vec.pyx":504 * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *sa=NULL * array = oarray_s(array, &na, &sa) */ __pyx_v_na = 0; /* "PETSc/Vec.pyx":505 * ghosts = iarray_i(ghosts, &ng, &ig) * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL # <<<<<<<<<<<<<< * array = oarray_s(array, &na, &sa) * cdef PetscInt b = 1 if bsize is None else asInt(bsize) */ __pyx_v_sa = NULL; /* "PETSc/Vec.pyx":506 * cdef PetscInt na=0 * cdef PetscScalar *sa=NULL * array = oarray_s(array, &na, &sa) # <<<<<<<<<<<<<< * cdef PetscInt b = 1 if bsize is None else asInt(bsize) * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_array, (&__pyx_v_na), (&__pyx_v_sa))); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Vec.pyx":507 * cdef PetscScalar *sa=NULL * array = oarray_s(array, &na, &sa) * cdef PetscInt b = 1 if bsize is None else asInt(bsize) # <<<<<<<<<<<<<< * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) * cdef PetscInt bs=0, n=0, N=0 */ __pyx_t_4 = (__pyx_v_bsize == Py_None); if ((__pyx_t_4 != 0)) { __pyx_t_3 = 1; } else { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 507, __pyx_L1_error) __pyx_t_3 = __pyx_t_5; } __pyx_v_b = __pyx_t_3; /* "PETSc/Vec.pyx":508 * array = oarray_s(array, &na, &sa) * cdef PetscInt b = 1 if bsize is None else asInt(bsize) * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_4 = (__pyx_v_size == Py_None); __pyx_t_6 = (__pyx_t_4 != 0); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_na - (__pyx_v_ng * __pyx_v_b))); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_2 = 0; __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_8); __pyx_t_8 = 0; } /* "PETSc/Vec.pyx":509 * cdef PetscInt b = 1 if bsize is None else asInt(bsize) * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":510 * if size is None: size = (toInt(na-ng*b), toInt(PETSC_DECIDE)) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * if na < (n+ng*b): raise ValueError( */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 510, __pyx_L1_error) /* "PETSc/Vec.pyx":511 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * if na < (n+ng*b): raise ValueError( * "ghosts size %d, array size %d, and " */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 511, __pyx_L1_error) /* "PETSc/Vec.pyx":512 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if na < (n+ng*b): raise ValueError( # <<<<<<<<<<<<<< * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % */ __pyx_t_6 = ((__pyx_v_na < (__pyx_v_n + (__pyx_v_ng * __pyx_v_b))) != 0); if (unlikely(__pyx_t_6)) { /* "PETSc/Vec.pyx":515 * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % * (toInt(ng), toInt(na), toInt(n), toInt(b))) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ng); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_b); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_7 = 0; __pyx_t_2 = 0; __pyx_t_10 = 0; /* "PETSc/Vec.pyx":514 * if na < (n+ng*b): raise ValueError( * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % # <<<<<<<<<<<<<< * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL */ __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_ghosts_size_d_array_size_d_and_v, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "PETSc/Vec.pyx":512 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * if na < (n+ng*b): raise ValueError( # <<<<<<<<<<<<<< * "ghosts size %d, array size %d, and " * "vector local size %d block size %d" % */ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(33, 512, __pyx_L1_error) } /* "PETSc/Vec.pyx":516 * "vector local size %d block size %d" % * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhostWithArray( */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":517 * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhostWithArray( * ccomm, n, N, ng, ig, sa, &newvec) ) */ __pyx_t_6 = ((__pyx_v_bs == PETSC_DECIDE) != 0); if (__pyx_t_6) { /* "PETSc/Vec.pyx":518 * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: * CHKERR( VecCreateGhostWithArray( # <<<<<<<<<<<<<< * ccomm, n, N, ng, ig, sa, &newvec) ) * else: */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhostWithArray(__pyx_v_ccomm, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 518, __pyx_L1_error) /* "PETSc/Vec.pyx":517 * (toInt(ng), toInt(na), toInt(n), toInt(b))) * cdef PetscVec newvec = NULL * if bs == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecCreateGhostWithArray( * ccomm, n, N, ng, ig, sa, &newvec) ) */ goto __pyx_L5; } /* "PETSc/Vec.pyx":521 * ccomm, n, N, ng, ig, sa, &newvec) ) * else: * CHKERR( VecCreateGhostBlockWithArray( # <<<<<<<<<<<<<< * ccomm, bs, n, N, ng, ig, sa, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec */ /*else*/ { /* "PETSc/Vec.pyx":522 * else: * CHKERR( VecCreateGhostBlockWithArray( * ccomm, bs, n, N, ng, ig, sa, &newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', array) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateGhostBlockWithArray(__pyx_v_ccomm, __pyx_v_bs, __pyx_v_n, __pyx_v_N, __pyx_v_ng, __pyx_v_ig, __pyx_v_sa, (&__pyx_v_newvec))); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 521, __pyx_L1_error) } __pyx_L5:; /* "PETSc/Vec.pyx":523 * CHKERR( VecCreateGhostBlockWithArray( * ccomm, bs, n, N, ng, ig, sa, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":524 * ccomm, bs, n, N, ng, ig, sa, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_11 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "PETSc/Vec.pyx":525 * PetscCLEAR(self.obj); self.vec = newvec * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * def createShared(self, size, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":499 * return self * * def createGhostWithArray(self, ghosts, array, # <<<<<<<<<<<<<< * size=None, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createGhostWithArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ghosts); __Pyx_XDECREF(__pyx_v_array); __Pyx_XDECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":527 * return self * * def createShared(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_73createShared(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_72createShared[] = "Vec.createShared(self, size, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_73createShared(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createShared (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createShared") < 0)) __PYX_ERR(33, 527, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createShared", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 527, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createShared", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_72createShared(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_72createShared(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_bs; PetscInt __pyx_v_n; PetscInt __pyx_v_N; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createShared", 0); /* "PETSc/Vec.pyx":528 * * def createShared(self, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 528, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Vec.pyx":529 * def createShared(self, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 # <<<<<<<<<<<<<< * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) */ __pyx_v_bs = 0; __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":530 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Vec_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_bs), (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 530, __pyx_L1_error) /* "PETSc/Vec.pyx":531 * cdef PetscInt bs=0, n=0, N=0 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 531, __pyx_L1_error) /* "PETSc/Vec.pyx":532 * Vec_Sizes(size, bsize, &bs, &n, &N) * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":533 * Sys_Layout(ccomm, bs, &n, &N) * cdef PetscVec newvec = NULL * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * if bs != PETSC_DECIDE: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateShared(__pyx_v_ccomm, __pyx_v_n, __pyx_v_N, (&__pyx_v_newvec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 533, __pyx_L1_error) /* "PETSc/Vec.pyx":534 * cdef PetscVec newvec = NULL * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":535 * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * return self */ __pyx_t_3 = ((__pyx_v_bs != PETSC_DECIDE) != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":536 * PetscCLEAR(self.obj); self.vec = newvec * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_self->vec, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 536, __pyx_L1_error) /* "PETSc/Vec.pyx":535 * CHKERR( VecCreateShared(ccomm, n, N, &newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * if bs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * return self */ } /* "PETSc/Vec.pyx":537 * if bs != PETSC_DECIDE: * CHKERR( VecSetBlockSize(self.vec, bs) ) * return self # <<<<<<<<<<<<<< * * def createNest(self, vecs, isets=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":527 * return self * * def createShared(self, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createShared", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":539 * return self * * def createNest(self, vecs, isets=None, comm=None): # <<<<<<<<<<<<<< * vecs = list(vecs) * if isets: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_75createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_74createNest[] = "Vec.createNest(self, vecs, isets=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_75createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_isets = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_isets,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isets); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createNest") < 0)) __PYX_ERR(33, 539, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_isets = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 539, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_74createNest(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_isets, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_74createNest(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_isets, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_m; PetscInt __pyx_v_n; Vec *__pyx_v_cvecs; IS *__pyx_v_cisets; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; Vec __pyx_v_newvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; MPI_Comm __pyx_t_5; PyObject *__pyx_t_6 = NULL; Vec __pyx_t_7; int __pyx_t_8; IS __pyx_t_9; int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNest", 0); __Pyx_INCREF(__pyx_v_vecs); __Pyx_INCREF(__pyx_v_isets); /* "PETSc/Vec.pyx":540 * * def createNest(self, vecs, isets=None, comm=None): * vecs = list(vecs) # <<<<<<<<<<<<<< * if isets: * isets = list(isets) */ __pyx_t_1 = PySequence_List(__pyx_v_vecs); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vecs, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":541 * def createNest(self, vecs, isets=None, comm=None): * vecs = list(vecs) * if isets: # <<<<<<<<<<<<<< * isets = list(isets) * assert len(isets) == len(vecs) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_isets); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(33, 541, __pyx_L1_error) if (__pyx_t_2) { /* "PETSc/Vec.pyx":542 * vecs = list(vecs) * if isets: * isets = list(isets) # <<<<<<<<<<<<<< * assert len(isets) == len(vecs) * else: */ __pyx_t_1 = PySequence_List(__pyx_v_isets); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_isets, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":543 * if isets: * isets = list(isets) * assert len(isets) == len(vecs) # <<<<<<<<<<<<<< * else: * isets = None */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = PyObject_Length(__pyx_v_isets); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(33, 543, __pyx_L1_error) __pyx_t_4 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(33, 543, __pyx_L1_error) if (unlikely(!((__pyx_t_3 == __pyx_t_4) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(33, 543, __pyx_L1_error) } } #endif /* "PETSc/Vec.pyx":541 * def createNest(self, vecs, isets=None, comm=None): * vecs = list(vecs) * if isets: # <<<<<<<<<<<<<< * isets = list(isets) * assert len(isets) == len(vecs) */ goto __pyx_L3; } /* "PETSc/Vec.pyx":545 * assert len(isets) == len(vecs) * else: * isets = None # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, m = len(vecs) */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_isets, Py_None); } __pyx_L3:; /* "PETSc/Vec.pyx":546 * else: * isets = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, m = len(vecs) * cdef PetscInt n = m */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 546, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_5; /* "PETSc/Vec.pyx":547 * isets = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, m = len(vecs) # <<<<<<<<<<<<<< * cdef PetscInt n = m * cdef PetscVec *cvecs = NULL */ __pyx_t_4 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(33, 547, __pyx_L1_error) __pyx_v_m = __pyx_t_4; /* "PETSc/Vec.pyx":548 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, m = len(vecs) * cdef PetscInt n = m # <<<<<<<<<<<<<< * cdef PetscVec *cvecs = NULL * cdef PetscIS *cisets = NULL */ __pyx_v_n = ((PetscInt)__pyx_v_m); /* "PETSc/Vec.pyx":549 * cdef Py_ssize_t i, m = len(vecs) * cdef PetscInt n = m * cdef PetscVec *cvecs = NULL # <<<<<<<<<<<<<< * cdef PetscIS *cisets = NULL * cdef object tmp1, tmp2 */ __pyx_v_cvecs = NULL; /* "PETSc/Vec.pyx":550 * cdef PetscInt n = m * cdef PetscVec *cvecs = NULL * cdef PetscIS *cisets = NULL # <<<<<<<<<<<<<< * cdef object tmp1, tmp2 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) */ __pyx_v_cisets = NULL; /* "PETSc/Vec.pyx":552 * cdef PetscIS *cisets = NULL * cdef object tmp1, tmp2 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) # <<<<<<<<<<<<<< * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cvecs)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp1 = __pyx_t_6; __pyx_t_6 = 0; /* "PETSc/Vec.pyx":553 * cdef object tmp1, tmp2 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec # <<<<<<<<<<<<<< * if isets is not None: * tmp2 = oarray_p(empty_p(n), NULL, &cisets) */ __pyx_t_4 = __pyx_v_m; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(33, 553, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscVecObject *)__pyx_t_6)->vec; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_cvecs[__pyx_v_i]) = __pyx_t_7; } /* "PETSc/Vec.pyx":554 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset */ __pyx_t_2 = (__pyx_v_isets != Py_None); __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "PETSc/Vec.pyx":555 * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: * tmp2 = oarray_p(empty_p(n), NULL, &cisets) # <<<<<<<<<<<<<< * for i from 0 <= i < m: cisets[i] = (isets[i]).iset * cdef PetscVec newvec = NULL */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_6, NULL, ((void **)(&__pyx_v_cisets)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_tmp2 = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":556 * if isets is not None: * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset # <<<<<<<<<<<<<< * cdef PetscVec newvec = NULL * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) */ __pyx_t_4 = __pyx_v_m; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_isets, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(33, 556, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscISObject *)__pyx_t_1)->iset; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cisets[__pyx_v_i]) = __pyx_t_9; } /* "PETSc/Vec.pyx":554 * tmp1 = oarray_p(empty_p(n), NULL, &cvecs) * for i from 0 <= i < m: cvecs[i] = (vecs[i]).vec * if isets is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset */ } /* "PETSc/Vec.pyx":557 * tmp2 = oarray_p(empty_p(n), NULL, &cisets) * for i from 0 <= i < m: cisets[i] = (isets[i]).iset * cdef PetscVec newvec = NULL # <<<<<<<<<<<<<< * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec */ __pyx_v_newvec = NULL; /* "PETSc/Vec.pyx":558 * for i from 0 <= i < m: cisets[i] = (isets[i]).iset * cdef PetscVec newvec = NULL * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.vec = newvec * return self */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateNest(__pyx_v_ccomm, __pyx_v_n, __pyx_v_cisets, __pyx_v_cvecs, (&__pyx_v_newvec))); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(33, 558, __pyx_L1_error) /* "PETSc/Vec.pyx":559 * cdef PetscVec newvec = NULL * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->vec = __pyx_v_newvec; /* "PETSc/Vec.pyx":560 * CHKERR( VecCreateNest(ccomm, n, cisets, cvecs,&newvec) ) * PetscCLEAR(self.obj); self.vec = newvec * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":539 * return self * * def createNest(self, vecs, isets=None, comm=None): # <<<<<<<<<<<<<< * vecs = list(vecs) * if isets: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Vec.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XDECREF(__pyx_v_vecs); __Pyx_XDECREF(__pyx_v_isets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":564 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_77setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_76setOptionsPrefix[] = "Vec.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_77setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(33, 564, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 564, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_76setOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_76setOptionsPrefix(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/Vec.pyx":565 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Vec.pyx":566 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":567 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetOptionsPrefix(__pyx_v_self->vec, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 567, __pyx_L1_error) /* "PETSc/Vec.pyx":564 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":569 * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_79getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_78getOptionsPrefix[] = "Vec.getOptionsPrefix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_79getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_78getOptionsPrefix(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_78getOptionsPrefix(struct PyPetscVecObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/Vec.pyx":570 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Vec.pyx":571 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOptionsPrefix(__pyx_v_self->vec, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 571, __pyx_L1_error) /* "PETSc/Vec.pyx":572 * cdef const char *cval = NULL * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":569 * CHKERR( VecSetOptionsPrefix(self.vec, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( VecGetOptionsPrefix(self.vec, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":574 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( VecSetFromOptions(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_81setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_80setFromOptions[] = "Vec.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_81setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_80setFromOptions(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_80setFromOptions(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/Vec.pyx":575 * * def setFromOptions(self): * CHKERR( VecSetFromOptions(self.vec) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetFromOptions(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 575, __pyx_L1_error) /* "PETSc/Vec.pyx":574 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( VecSetFromOptions(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":577 * CHKERR( VecSetFromOptions(self.vec) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( VecSetUp(self.vec) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_83setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_82setUp[] = "Vec.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_83setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_82setUp(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_82setUp(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/Vec.pyx":578 * * def setUp(self): * CHKERR( VecSetUp(self.vec) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetUp(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 578, __pyx_L1_error) /* "PETSc/Vec.pyx":579 * def setUp(self): * CHKERR( VecSetUp(self.vec) ) * return self # <<<<<<<<<<<<<< * * def setOption(self, option, flag): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":577 * CHKERR( VecSetFromOptions(self.vec) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( VecSetUp(self.vec) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":581 * return self * * def setOption(self, option, flag): # <<<<<<<<<<<<<< * CHKERR( VecSetOption(self.vec, option, flag) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_85setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_84setOption[] = "Vec.setOption(self, option, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_85setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_option = 0; PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOption (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_flag,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, 1); __PYX_ERR(33, 581, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOption") < 0)) __PYX_ERR(33, 581, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_option = values[0]; __pyx_v_flag = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 581, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_84setOption(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_option, __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_84setOption(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations VecOption __pyx_t_1; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOption", 0); /* "PETSc/Vec.pyx":582 * * def setOption(self, option, flag): * CHKERR( VecSetOption(self.vec, option, flag) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_1 = ((VecOption)__Pyx_PyInt_As_VecOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 582, __pyx_L1_error) __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 582, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetOption(__pyx_v_self->vec, __pyx_t_1, __pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 582, __pyx_L1_error) /* "PETSc/Vec.pyx":581 * return self * * def setOption(self, option, flag): # <<<<<<<<<<<<<< * CHKERR( VecSetOption(self.vec, option, flag) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":584 * CHKERR( VecSetOption(self.vec, option, flag) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscVecType cval = NULL * CHKERR( VecGetType(self.vec, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_87getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_86getType[] = "Vec.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_87getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_86getType(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_86getType(struct PyPetscVecObject *__pyx_v_self) { VecType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/Vec.pyx":585 * * def getType(self): * cdef PetscVecType cval = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetType(self.vec, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Vec.pyx":586 * def getType(self): * cdef PetscVecType cval = NULL * CHKERR( VecGetType(self.vec, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetType(__pyx_v_self->vec, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 586, __pyx_L1_error) /* "PETSc/Vec.pyx":587 * cdef PetscVecType cval = NULL * CHKERR( VecGetType(self.vec, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":584 * CHKERR( VecSetOption(self.vec, option, flag) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscVecType cval = NULL * CHKERR( VecGetType(self.vec, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":589 * return bytes2str(cval) * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt N = 0 * CHKERR( VecGetSize(self.vec, &N) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_89getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_88getSize[] = "Vec.getSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_89getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_88getSize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_88getSize(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 0); /* "PETSc/Vec.pyx":590 * * def getSize(self): * cdef PetscInt N = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * return toInt(N) */ __pyx_v_N = 0; /* "PETSc/Vec.pyx":591 * def getSize(self): * cdef PetscInt N = 0 * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * return toInt(N) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 591, __pyx_L1_error) /* "PETSc/Vec.pyx":592 * cdef PetscInt N = 0 * CHKERR( VecGetSize(self.vec, &N) ) * return toInt(N) # <<<<<<<<<<<<<< * * def getLocalSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":589 * return bytes2str(cval) * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt N = 0 * CHKERR( VecGetSize(self.vec, &N) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":594 * return toInt(N) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_91getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_90getLocalSize[] = "Vec.getLocalSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_91getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_90getLocalSize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_90getLocalSize(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 0); /* "PETSc/Vec.pyx":595 * * def getLocalSize(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/Vec.pyx":596 * def getLocalSize(self): * cdef PetscInt n = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 596, __pyx_L1_error) /* "PETSc/Vec.pyx":597 * cdef PetscInt n = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":594 * return toInt(N) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":599 * return toInt(n) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0, N = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_93getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_92getSizes[] = "Vec.getSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_93getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_92getSizes(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_92getSizes(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_n; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 0); /* "PETSc/Vec.pyx":600 * * def getSizes(self): * cdef PetscInt n = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &n) ) * CHKERR( VecGetSize(self.vec, &N) ) */ __pyx_v_n = 0; __pyx_v_N = 0; /* "PETSc/Vec.pyx":601 * def getSizes(self): * cdef PetscInt n = 0, N = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) # <<<<<<<<<<<<<< * CHKERR( VecGetSize(self.vec, &N) ) * return (toInt(n), toInt(N)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 601, __pyx_L1_error) /* "PETSc/Vec.pyx":602 * cdef PetscInt n = 0, N = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) * CHKERR( VecGetSize(self.vec, &N) ) # <<<<<<<<<<<<<< * return (toInt(n), toInt(N)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSize(__pyx_v_self->vec, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 602, __pyx_L1_error) /* "PETSc/Vec.pyx":603 * CHKERR( VecGetLocalSize(self.vec, &n) ) * CHKERR( VecGetSize(self.vec, &N) ) * return (toInt(n), toInt(N)) # <<<<<<<<<<<<<< * * def setBlockSize(self, bsize): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":599 * return toInt(n) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0, N = 0 * CHKERR( VecGetLocalSize(self.vec, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":605 * return (toInt(n), toInt(N)) * * def setBlockSize(self, bsize): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * CHKERR( VecSetBlockSize(self.vec, bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_95setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_94setBlockSize[] = "Vec.setBlockSize(self, bsize)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_95setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bsize = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSize") < 0)) __PYX_ERR(33, 605, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bsize = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 605, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_94setBlockSize(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_bsize); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_94setBlockSize(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSize", 0); /* "PETSc/Vec.pyx":606 * * def setBlockSize(self, bsize): * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * CHKERR( VecSetBlockSize(self.vec, bs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 606, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "PETSc/Vec.pyx":607 * def setBlockSize(self, bsize): * cdef PetscInt bs = asInt(bsize) * CHKERR( VecSetBlockSize(self.vec, bs) ) # <<<<<<<<<<<<<< * * def getBlockSize(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetBlockSize(__pyx_v_self->vec, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 607, __pyx_L1_error) /* "PETSc/Vec.pyx":605 * return (toInt(n), toInt(N)) * * def setBlockSize(self, bsize): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * CHKERR( VecSetBlockSize(self.vec, bs) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":609 * CHKERR( VecSetBlockSize(self.vec, bs) ) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs=0 * CHKERR( VecGetBlockSize(self.vec, &bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_97getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_96getBlockSize[] = "Vec.getBlockSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_97getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_96getBlockSize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_96getBlockSize(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 0); /* "PETSc/Vec.pyx":610 * * def getBlockSize(self): * cdef PetscInt bs=0 # <<<<<<<<<<<<<< * CHKERR( VecGetBlockSize(self.vec, &bs) ) * return toInt(bs) */ __pyx_v_bs = 0; /* "PETSc/Vec.pyx":611 * def getBlockSize(self): * cdef PetscInt bs=0 * CHKERR( VecGetBlockSize(self.vec, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetBlockSize(__pyx_v_self->vec, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 611, __pyx_L1_error) /* "PETSc/Vec.pyx":612 * cdef PetscInt bs=0 * CHKERR( VecGetBlockSize(self.vec, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def getOwnershipRange(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":609 * CHKERR( VecSetBlockSize(self.vec, bs) ) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs=0 * CHKERR( VecGetBlockSize(self.vec, &bs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":614 * return toInt(bs) * * def getOwnershipRange(self): # <<<<<<<<<<<<<< * cdef PetscInt low=0, high=0 * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_99getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_98getOwnershipRange[] = "Vec.getOwnershipRange(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_99getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRange (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRange", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRange", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_98getOwnershipRange(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_98getOwnershipRange(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_low; PetscInt __pyx_v_high; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRange", 0); /* "PETSc/Vec.pyx":615 * * def getOwnershipRange(self): * cdef PetscInt low=0, high=0 # <<<<<<<<<<<<<< * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) * return (toInt(low), toInt(high)) */ __pyx_v_low = 0; __pyx_v_high = 0; /* "PETSc/Vec.pyx":616 * def getOwnershipRange(self): * cdef PetscInt low=0, high=0 * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) # <<<<<<<<<<<<<< * return (toInt(low), toInt(high)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOwnershipRange(__pyx_v_self->vec, (&__pyx_v_low), (&__pyx_v_high))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 616, __pyx_L1_error) /* "PETSc/Vec.pyx":617 * cdef PetscInt low=0, high=0 * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) * return (toInt(low), toInt(high)) # <<<<<<<<<<<<<< * * def getOwnershipRanges(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_low); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_high); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":614 * return toInt(bs) * * def getOwnershipRange(self): # <<<<<<<<<<<<<< * cdef PetscInt low=0, high=0 * CHKERR( VecGetOwnershipRange(self.vec, &low, &high) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOwnershipRange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":619 * return (toInt(low), toInt(high)) * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef const PetscInt *rng = NULL * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_101getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_100getOwnershipRanges[] = "Vec.getOwnershipRanges(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_101getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_100getOwnershipRanges(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_100getOwnershipRanges(struct PyPetscVecObject *__pyx_v_self) { PetscInt const *__pyx_v_rng; MPI_Comm __pyx_v_comm; int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 0); /* "PETSc/Vec.pyx":620 * * def getOwnershipRanges(self): * cdef const PetscInt *rng = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_rng = NULL; /* "PETSc/Vec.pyx":621 * def getOwnershipRanges(self): * cdef const PetscInt *rng = NULL * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.vec, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOwnershipRanges(__pyx_v_self->vec, (&__pyx_v_rng))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 621, __pyx_L1_error) /* "PETSc/Vec.pyx":622 * cdef const PetscInt *rng = NULL * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.vec, &comm) ) * cdef int size = -1 */ __pyx_v_comm = MPI_COMM_NULL; /* "PETSc/Vec.pyx":623 * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.vec, &comm) ) # <<<<<<<<<<<<<< * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->vec), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 623, __pyx_L1_error) /* "PETSc/Vec.pyx":624 * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.vec, &comm) ) * cdef int size = -1 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rng) */ __pyx_v_size = -1; /* "PETSc/Vec.pyx":625 * CHKERR( PetscObjectGetComm(self.vec, &comm) ) * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return array_i(size+1, rng) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 625, __pyx_L1_error) /* "PETSc/Vec.pyx":626 * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rng) # <<<<<<<<<<<<<< * * def getBuffer(self, readonly=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size + 1), __pyx_v_rng)); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":619 * return (toInt(low), toInt(high)) * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef const PetscInt *rng = NULL * CHKERR( VecGetOwnershipRanges(self.vec, &rng) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":628 * return array_i(size+1, rng) * * def getBuffer(self, readonly=False): # <<<<<<<<<<<<<< * if readonly: * return vec_getbuffer_r(self) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_103getBuffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_102getBuffer[] = "Vec.getBuffer(self, readonly=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_103getBuffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_readonly = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBuffer (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getBuffer") < 0)) __PYX_ERR(33, 628, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_readonly = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getBuffer", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 628, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_102getBuffer(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_readonly); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_102getBuffer(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBuffer", 0); /* "PETSc/Vec.pyx":629 * * def getBuffer(self, readonly=False): * if readonly: # <<<<<<<<<<<<<< * return vec_getbuffer_r(self) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 629, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Vec.pyx":630 * def getBuffer(self, readonly=False): * if readonly: * return vec_getbuffer_r(self) # <<<<<<<<<<<<<< * else: * return vec_getbuffer_w(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_r(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":629 * * def getBuffer(self, readonly=False): * if readonly: # <<<<<<<<<<<<<< * return vec_getbuffer_r(self) * else: */ } /* "PETSc/Vec.pyx":632 * return vec_getbuffer_r(self) * else: * return vec_getbuffer_w(self) # <<<<<<<<<<<<<< * * def getArray(self, readonly=False): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getbuffer_w(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":628 * return array_i(size+1, rng) * * def getBuffer(self, readonly=False): # <<<<<<<<<<<<<< * if readonly: * return vec_getbuffer_r(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getBuffer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":634 * return vec_getbuffer_w(self) * * def getArray(self, readonly=False): # <<<<<<<<<<<<<< * if readonly: * return vec_getarray_r(self) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_105getArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_104getArray[] = "Vec.getArray(self, readonly=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_105getArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_readonly = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_readonly,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_readonly); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getArray") < 0)) __PYX_ERR(33, 634, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_readonly = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getArray", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 634, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_104getArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_readonly); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_104getArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_readonly) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getArray", 0); /* "PETSc/Vec.pyx":635 * * def getArray(self, readonly=False): * if readonly: # <<<<<<<<<<<<<< * return vec_getarray_r(self) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 635, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/Vec.pyx":636 * def getArray(self, readonly=False): * if readonly: * return vec_getarray_r(self) # <<<<<<<<<<<<<< * else: * return vec_getarray_w(self) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getarray_r(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":635 * * def getArray(self, readonly=False): * if readonly: # <<<<<<<<<<<<<< * return vec_getarray_r(self) * else: */ } /* "PETSc/Vec.pyx":638 * return vec_getarray_r(self) * else: * return vec_getarray_w(self) # <<<<<<<<<<<<<< * * def setArray(self, array): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_vec_getarray_w(__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":634 * return vec_getbuffer_w(self) * * def getArray(self, readonly=False): # <<<<<<<<<<<<<< * if readonly: * return vec_getarray_r(self) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":640 * return vec_getarray_w(self) * * def setArray(self, array): # <<<<<<<<<<<<<< * vec_setarray(self, array) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_107setArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_106setArray[] = "Vec.setArray(self, array)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_107setArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setArray") < 0)) __PYX_ERR(33, 640, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_array = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setArray", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 640, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_106setArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_106setArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setArray", 0); /* "PETSc/Vec.pyx":641 * * def setArray(self, array): * vec_setarray(self, array) # <<<<<<<<<<<<<< * * def placeArray(self, array): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_self, __pyx_v_array); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 641, __pyx_L1_error) /* "PETSc/Vec.pyx":640 * return vec_getarray_w(self) * * def setArray(self, array): # <<<<<<<<<<<<<< * vec_setarray(self, array) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":643 * vec_setarray(self, array) * * def placeArray(self, array): # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscInt na=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_109placeArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_108placeArray[] = "Vec.placeArray(self, array)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_109placeArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("placeArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "placeArray") < 0)) __PYX_ERR(33, 643, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_array = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("placeArray", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 643, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.placeArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_108placeArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_108placeArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array) { PetscInt __pyx_v_nv; PetscInt __pyx_v_na; PetscScalar *__pyx_v_a; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("placeArray", 0); __Pyx_INCREF(__pyx_v_array); /* "PETSc/Vec.pyx":644 * * def placeArray(self, array): * cdef PetscInt nv=0 # <<<<<<<<<<<<<< * cdef PetscInt na=0 * cdef PetscScalar *a = NULL */ __pyx_v_nv = 0; /* "PETSc/Vec.pyx":645 * def placeArray(self, array): * cdef PetscInt nv=0 * cdef PetscInt na=0 # <<<<<<<<<<<<<< * cdef PetscScalar *a = NULL * CHKERR( VecGetLocalSize(self.vec, &nv) ) */ __pyx_v_na = 0; /* "PETSc/Vec.pyx":646 * cdef PetscInt nv=0 * cdef PetscInt na=0 * cdef PetscScalar *a = NULL # <<<<<<<<<<<<<< * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) */ __pyx_v_a = NULL; /* "PETSc/Vec.pyx":647 * cdef PetscInt na=0 * cdef PetscScalar *a = NULL * CHKERR( VecGetLocalSize(self.vec, &nv) ) # <<<<<<<<<<<<<< * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalSize(__pyx_v_self->vec, (&__pyx_v_nv))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 647, __pyx_L1_error) /* "PETSc/Vec.pyx":648 * cdef PetscScalar *a = NULL * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) # <<<<<<<<<<<<<< * if (na != nv): raise ValueError( * "cannot place input array size %d, vector size %d" % */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_array, (&__pyx_v_na), (&__pyx_v_a))); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Vec.pyx":649 * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( # <<<<<<<<<<<<<< * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) */ __pyx_t_3 = ((__pyx_v_na != __pyx_v_nv) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/Vec.pyx":651 * if (na != nv): raise ValueError( * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) # <<<<<<<<<<<<<< * CHKERR( VecPlaceArray(self.vec, a) ) * self.set_attr('__placed_array__', array) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_4 = 0; /* "PETSc/Vec.pyx":650 * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( * "cannot place input array size %d, vector size %d" % # <<<<<<<<<<<<<< * (toInt(na), toInt(nv))) * CHKERR( VecPlaceArray(self.vec, a) ) */ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_cannot_place_input_array_size_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Vec.pyx":649 * CHKERR( VecGetLocalSize(self.vec, &nv) ) * array = oarray_s(array, &na, &a) * if (na != nv): raise ValueError( # <<<<<<<<<<<<<< * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) */ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(33, 649, __pyx_L1_error) } /* "PETSc/Vec.pyx":652 * "cannot place input array size %d, vector size %d" % * (toInt(na), toInt(nv))) * CHKERR( VecPlaceArray(self.vec, a) ) # <<<<<<<<<<<<<< * self.set_attr('__placed_array__', array) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPlaceArray(__pyx_v_self->vec, __pyx_v_a)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 652, __pyx_L1_error) /* "PETSc/Vec.pyx":653 * (toInt(na), toInt(nv))) * CHKERR( VecPlaceArray(self.vec, a) ) * self.set_attr('__placed_array__', array) # <<<<<<<<<<<<<< * * def resetArray(self, force=False): */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__placed_array__"), __pyx_v_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Vec.pyx":643 * vec_setarray(self, array) * * def placeArray(self, array): # <<<<<<<<<<<<<< * cdef PetscInt nv=0 * cdef PetscInt na=0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.placeArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":655 * self.set_attr('__placed_array__', array) * * def resetArray(self, force=False): # <<<<<<<<<<<<<< * cdef object array = None * array = self.get_attr('__placed_array__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_111resetArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_110resetArray[] = "Vec.resetArray(self, force=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_111resetArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_force = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resetArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_force,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_force); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resetArray") < 0)) __PYX_ERR(33, 655, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_force = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("resetArray", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 655, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.resetArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_110resetArray(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_force); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_110resetArray(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_force) { PyObject *__pyx_v_array = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("resetArray", 0); /* "PETSc/Vec.pyx":656 * * def resetArray(self, force=False): * cdef object array = None # <<<<<<<<<<<<<< * array = self.get_attr('__placed_array__') * if array is None and not force: return None */ __Pyx_INCREF(Py_None); __pyx_v_array = Py_None; /* "PETSc/Vec.pyx":657 * def resetArray(self, force=False): * cdef object array = None * array = self.get_attr('__placed_array__') # <<<<<<<<<<<<<< * if array is None and not force: return None * CHKERR( VecResetArray(self.vec) ) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__placed_array__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":658 * cdef object array = None * array = self.get_attr('__placed_array__') * if array is None and not force: return None # <<<<<<<<<<<<<< * CHKERR( VecResetArray(self.vec) ) * self.set_attr('__placed_array__', None) */ __pyx_t_3 = (__pyx_v_array == Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(33, 658, __pyx_L1_error) __pyx_t_3 = ((!__pyx_t_4) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/Vec.pyx":659 * array = self.get_attr('__placed_array__') * if array is None and not force: return None * CHKERR( VecResetArray(self.vec) ) # <<<<<<<<<<<<<< * self.set_attr('__placed_array__', None) * return array */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecResetArray(__pyx_v_self->vec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(33, 659, __pyx_L1_error) /* "PETSc/Vec.pyx":660 * if array is None and not force: return None * CHKERR( VecResetArray(self.vec) ) * self.set_attr('__placed_array__', None) # <<<<<<<<<<<<<< * return array * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__placed_array__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":661 * CHKERR( VecResetArray(self.vec) ) * self.set_attr('__placed_array__', None) * return array # <<<<<<<<<<<<<< * * def bindToCPU(self, flg): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "PETSc/Vec.pyx":655 * self.set_attr('__placed_array__', array) * * def resetArray(self, force=False): # <<<<<<<<<<<<<< * cdef object array = None * array = self.get_attr('__placed_array__') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.resetArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":663 * return array * * def bindToCPU(self, flg): # <<<<<<<<<<<<<< * """ * If *flg* is *True*, all subsequent operations of *self* would be */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_113bindToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_112bindToCPU[] = "Vec.bindToCPU(self, flg)\n\n If *flg* is *True*, all subsequent operations of *self* would be\n performed on CPU. If *flg* is *False*, all subsequent operations of\n *self* would be offloaded to the device, provided that the VecType is\n capable of offloading.\n\n :arg flg: An instance of :class:`bool`.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_113bindToCPU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bindToCPU (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flg,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flg)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "bindToCPU") < 0)) __PYX_ERR(33, 663, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flg = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 663, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.bindToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_112bindToCPU(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_flg); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_112bindToCPU(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_flg) { PetscBool __pyx_v_bindFlg; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bindToCPU", 0); /* "PETSc/Vec.pyx":672 * :arg flg: An instance of :class:`bool`. * """ * cdef PetscBool bindFlg = asBool(flg) # <<<<<<<<<<<<<< * CHKERR( VecBindToCPU(self.vec, bindFlg) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_flg); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(33, 672, __pyx_L1_error) __pyx_v_bindFlg = __pyx_t_1; /* "PETSc/Vec.pyx":673 * """ * cdef PetscBool bindFlg = asBool(flg) * CHKERR( VecBindToCPU(self.vec, bindFlg) ) # <<<<<<<<<<<<<< * * def getCUDAHandle(self, mode='rw'): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecBindToCPU(__pyx_v_self->vec, __pyx_v_bindFlg)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 673, __pyx_L1_error) /* "PETSc/Vec.pyx":663 * return array * * def bindToCPU(self, flg): # <<<<<<<<<<<<<< * """ * If *flg* is *True*, all subsequent operations of *self* would be */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.bindToCPU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":675 * CHKERR( VecBindToCPU(self.vec, bindFlg) ) * * def getCUDAHandle(self, mode='rw'): # <<<<<<<<<<<<<< * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_115getCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_114getCUDAHandle[] = "Vec.getCUDAHandle(self, mode='rw')"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_115getCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCUDAHandle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_n_s_rw); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCUDAHandle") < 0)) __PYX_ERR(33, 675, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mode = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCUDAHandle", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 675, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_114getCUDAHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_114getCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode) { PetscScalar *__pyx_v_hdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCUDAHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "PETSc/Vec.pyx":676 * * def getCUDAHandle(self, mode='rw'): * cdef PetscScalar *hdl = NULL # <<<<<<<<<<<<<< * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) */ __pyx_v_hdl = NULL; /* "PETSc/Vec.pyx":677 * def getCUDAHandle(self, mode='rw'): * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL # <<<<<<<<<<<<<< * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "PETSc/Vec.pyx":678 * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) */ __pyx_t_1 = (__pyx_v_mode != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/Vec.pyx":679 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': */ __pyx_t_1 = ((__pyx_v_m == NULL) != 0); if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = (((__pyx_v_m[0]) == 'r') != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L5_bool_binop_done; } __pyx_t_1 = (((__pyx_v_m[1]) == 'w') != 0); __pyx_t_2 = __pyx_t_1; __pyx_L5_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/Vec.pyx":680 * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDAGetArray(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 680, __pyx_L1_error) /* "PETSc/Vec.pyx":679 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': */ goto __pyx_L4; } /* "PETSc/Vec.pyx":681 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ __pyx_t_2 = (((__pyx_v_m[0]) == 'r') != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":682 * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDAGetArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_hdl)))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 682, __pyx_L1_error) /* "PETSc/Vec.pyx":681 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDAGetArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ goto __pyx_L4; } /* "PETSc/Vec.pyx":683 * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) * else: */ __pyx_t_2 = (((__pyx_v_m[0]) == 'w') != 0); if (likely(__pyx_t_2)) { /* "PETSc/Vec.pyx":684 * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDAGetArrayWrite(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 684, __pyx_L1_error) /* "PETSc/Vec.pyx":683 * elif m[0] == c'r': * CHKERR( VecCUDAGetArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) * else: */ goto __pyx_L4; } /* "PETSc/Vec.pyx":686 * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * return hdl * */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(33, 686, __pyx_L1_error) } __pyx_L4:; /* "PETSc/Vec.pyx":687 * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * return hdl # <<<<<<<<<<<<<< * * def restoreCUDAHandle(self, handle, mode='rw'): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyInt_FromSize_t(((Py_uintptr_t)__pyx_v_hdl)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":675 * CHKERR( VecBindToCPU(self.vec, bindFlg) ) * * def getCUDAHandle(self, mode='rw'): # <<<<<<<<<<<<<< * cdef PetscScalar *hdl = NULL * cdef const char *m = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":689 * return hdl * * def restoreCUDAHandle(self, handle, mode='rw'): # <<<<<<<<<<<<<< * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_117restoreCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_116restoreCUDAHandle[] = "Vec.restoreCUDAHandle(self, handle, mode='rw')"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_117restoreCUDAHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_handle = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreCUDAHandle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_handle,&__pyx_n_s_mode,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_n_s_rw); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handle)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreCUDAHandle") < 0)) __PYX_ERR(33, 689, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_handle = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreCUDAHandle", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 689, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_116restoreCUDAHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_handle, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_116restoreCUDAHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_handle, PyObject *__pyx_v_mode) { PetscScalar *__pyx_v_hdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_uintptr_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreCUDAHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "PETSc/Vec.pyx":690 * * def restoreCUDAHandle(self, handle, mode='rw'): * cdef PetscScalar *hdl = (handle) # <<<<<<<<<<<<<< * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) */ __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_handle); if (unlikely((__pyx_t_1 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(33, 690, __pyx_L1_error) __pyx_v_hdl = ((PetscScalar *)((Py_uintptr_t)__pyx_t_1)); /* "PETSc/Vec.pyx":691 * def restoreCUDAHandle(self, handle, mode='rw'): * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL # <<<<<<<<<<<<<< * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "PETSc/Vec.pyx":692 * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) */ __pyx_t_2 = (__pyx_v_mode != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/Vec.pyx":693 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': */ __pyx_t_2 = ((__pyx_v_m == NULL) != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = (((__pyx_v_m[0]) == 'r') != 0); if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = (((__pyx_v_m[1]) == 'w') != 0); __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "PETSc/Vec.pyx":694 * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDARestoreArray(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(33, 694, __pyx_L1_error) /* "PETSc/Vec.pyx":693 * cdef const char *m = NULL * if mode is not None: mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': */ goto __pyx_L4; } /* "PETSc/Vec.pyx":695 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ __pyx_t_3 = (((__pyx_v_m[0]) == 'r') != 0); if (__pyx_t_3) { /* "PETSc/Vec.pyx":696 * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDARestoreArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_hdl)))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(33, 696, __pyx_L1_error) /* "PETSc/Vec.pyx":695 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecCUDARestoreArray(self.vec, &hdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': */ goto __pyx_L4; } /* "PETSc/Vec.pyx":697 * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) * else: */ __pyx_t_3 = (((__pyx_v_m[0]) == 'w') != 0); if (likely(__pyx_t_3)) { /* "PETSc/Vec.pyx":698 * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCUDARestoreArrayWrite(__pyx_v_self->vec, (&__pyx_v_hdl))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(33, 698, __pyx_L1_error) /* "PETSc/Vec.pyx":697 * elif m[0] == c'r': * CHKERR( VecCUDARestoreArrayRead(self.vec, &hdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) * else: */ goto __pyx_L4; } /* "PETSc/Vec.pyx":700 * CHKERR( VecCUDARestoreArrayWrite(self.vec, &hdl) ) * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * * def getOffloadMask(self): */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(33, 700, __pyx_L1_error) } __pyx_L4:; /* "PETSc/Vec.pyx":689 * return hdl * * def restoreCUDAHandle(self, handle, mode='rw'): # <<<<<<<<<<<<<< * cdef PetscScalar *hdl = (handle) * cdef const char *m = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreCUDAHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":702 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * def getOffloadMask(self): # <<<<<<<<<<<<<< * """ * Returns :class:`int` of the Vec's PetscOffloadMask enum value. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_119getOffloadMask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_118getOffloadMask[] = "Vec.getOffloadMask(self)\n\n Returns :class:`int` of the Vec's PetscOffloadMask enum value.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_119getOffloadMask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOffloadMask (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOffloadMask", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOffloadMask", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_118getOffloadMask(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_118getOffloadMask(struct PyPetscVecObject *__pyx_v_self) { PetscOffloadMask __pyx_v_mask; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOffloadMask", 0); /* "PETSc/Vec.pyx":707 * """ * cdef PetscOffloadMask mask * CHKERR( VecGetOffloadMask(self.vec, &mask) ) # <<<<<<<<<<<<<< * return mask * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetOffloadMask(__pyx_v_self->vec, (&__pyx_v_mask))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 707, __pyx_L1_error) /* "PETSc/Vec.pyx":708 * cdef PetscOffloadMask mask * CHKERR( VecGetOffloadMask(self.vec, &mask) ) * return mask # <<<<<<<<<<<<<< * * def getCLContextHandle(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscOffloadMask(__pyx_v_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":702 * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") * * def getOffloadMask(self): # <<<<<<<<<<<<<< * """ * Returns :class:`int` of the Vec's PetscOffloadMask enum value. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getOffloadMask", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":710 * return mask * * def getCLContextHandle(self): # <<<<<<<<<<<<<< * """ * Returns a Vec's CL Context as :class:`int`. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_121getCLContextHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_120getCLContextHandle[] = "Vec.getCLContextHandle(self)\n\n Returns a Vec's CL Context as :class:`int`.\n\n To interface with :mod:`pyopencl` refer\n :meth:`pyopencl.Context.from_int_ptr`\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_121getCLContextHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCLContextHandle (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCLContextHandle", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCLContextHandle", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_120getCLContextHandle(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_120getCLContextHandle(struct PyPetscVecObject *__pyx_v_self) { Py_uintptr_t __pyx_v_ctxhdl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCLContextHandle", 0); /* "PETSc/Vec.pyx":717 * :meth:`pyopencl.Context.from_int_ptr` * """ * cdef Py_uintptr_t ctxhdl = 0 # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) ) * return ctxhdl */ __pyx_v_ctxhdl = 0; /* "PETSc/Vec.pyx":718 * """ * cdef Py_uintptr_t ctxhdl = 0 * CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) ) # <<<<<<<<<<<<<< * return ctxhdl * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLContext(__pyx_v_self->vec, (&__pyx_v_ctxhdl))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 718, __pyx_L1_error) /* "PETSc/Vec.pyx":719 * cdef Py_uintptr_t ctxhdl = 0 * CHKERR( VecViennaCLGetCLContext(self.vec, &ctxhdl) ) * return ctxhdl # <<<<<<<<<<<<<< * * def getCLQueueHandle(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_ctxhdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":710 * return mask * * def getCLContextHandle(self): # <<<<<<<<<<<<<< * """ * Returns a Vec's CL Context as :class:`int`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLContextHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":721 * return ctxhdl * * def getCLQueueHandle(self): # <<<<<<<<<<<<<< * """ * Returns a Vec's CL Context as :class:`int`. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_123getCLQueueHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_122getCLQueueHandle[] = "Vec.getCLQueueHandle(self)\n\n Returns a Vec's CL Context as :class:`int`.\n\n To interface with :mod:`pyopencl` refer\n :meth:`pyopencl.Context.from_int_ptr`\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_123getCLQueueHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCLQueueHandle (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCLQueueHandle", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCLQueueHandle", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_122getCLQueueHandle(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_122getCLQueueHandle(struct PyPetscVecObject *__pyx_v_self) { Py_uintptr_t __pyx_v_queuehdl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCLQueueHandle", 0); /* "PETSc/Vec.pyx":728 * :meth:`pyopencl.Context.from_int_ptr` * """ * cdef Py_uintptr_t queuehdl = 0 # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) ) * return queuehdl */ __pyx_v_queuehdl = 0; /* "PETSc/Vec.pyx":729 * """ * cdef Py_uintptr_t queuehdl = 0 * CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) ) # <<<<<<<<<<<<<< * return queuehdl * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLQueue(__pyx_v_self->vec, (&__pyx_v_queuehdl))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 729, __pyx_L1_error) /* "PETSc/Vec.pyx":730 * cdef Py_uintptr_t queuehdl = 0 * CHKERR( VecViennaCLGetCLQueue(self.vec, &queuehdl) ) * return queuehdl # <<<<<<<<<<<<<< * * def getCLMemHandle(self, mode='rw'): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_queuehdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":721 * return ctxhdl * * def getCLQueueHandle(self): # <<<<<<<<<<<<<< * """ * Returns a Vec's CL Context as :class:`int`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLQueueHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":732 * return queuehdl * * def getCLMemHandle(self, mode='rw'): # <<<<<<<<<<<<<< * """ * Returns a Vec's CL buffer as :class:`int`. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_125getCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_124getCLMemHandle[] = "Vec.getCLMemHandle(self, mode='rw')\n\n Returns a Vec's CL buffer as :class:`int`.\n\n To interface with :mod:`pyopencl` refer\n :meth:`pyopencl.MemoryObject.from_int_ptr`.\n\n :arg mode: An instance of class:`str` denoting the intended access\n usage to the CL buffer. Can be one of 'r'(read-only), 'w'\n (write-only) or 'rw' (read-write). See also\n :meth:`Vec.restoreCLMemHandle`.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_125getCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCLMemHandle (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mode,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_n_s_rw); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCLMemHandle") < 0)) __PYX_ERR(33, 732, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mode = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCLMemHandle", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 732, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_124getCLMemHandle(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_124getCLMemHandle(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_mode) { Py_uintptr_t __pyx_v_memhdl; char const *__pyx_v_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCLMemHandle", 0); __Pyx_INCREF(__pyx_v_mode); /* "PETSc/Vec.pyx":744 * :meth:`Vec.restoreCLMemHandle`. * """ * cdef Py_uintptr_t memhdl = 0 # <<<<<<<<<<<<<< * cdef const char *m = NULL * mode = str2bytes(mode, &m) */ __pyx_v_memhdl = 0; /* "PETSc/Vec.pyx":745 * """ * cdef Py_uintptr_t memhdl = 0 * cdef const char *m = NULL # <<<<<<<<<<<<<< * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): */ __pyx_v_m = NULL; /* "PETSc/Vec.pyx":746 * cdef Py_uintptr_t memhdl = 0 * cdef const char *m = NULL * mode = str2bytes(mode, &m) # <<<<<<<<<<<<<< * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mode, (&__pyx_v_m)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":747 * cdef const char *m = NULL * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': */ __pyx_t_3 = ((__pyx_v_m == NULL) != 0); if (!__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (((__pyx_v_m[0]) == 'r') != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (((__pyx_v_m[1]) == 'w') != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "PETSc/Vec.pyx":748 * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLMem(__pyx_v_self->vec, (&__pyx_v_memhdl))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 748, __pyx_L1_error) /* "PETSc/Vec.pyx":747 * cdef const char *m = NULL * mode = str2bytes(mode, &m) * if m == NULL or (m[0] == c'r' and m[1] == c'w'): # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': */ goto __pyx_L3; } /* "PETSc/Vec.pyx":749 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': */ __pyx_t_2 = (((__pyx_v_m[0]) == 'r') != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":750 * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) # <<<<<<<<<<<<<< * elif m[0] == c'w': * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLMemRead(__pyx_v_self->vec, (&__pyx_v_memhdl))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 750, __pyx_L1_error) /* "PETSc/Vec.pyx":749 * if m == NULL or (m[0] == c'r' and m[1] == c'w'): * CHKERR( VecViennaCLGetCLMem(self.vec, &memhdl) ) * elif m[0] == c'r': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': */ goto __pyx_L3; } /* "PETSc/Vec.pyx":751 * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: */ __pyx_t_2 = (((__pyx_v_m[0]) == 'w') != 0); if (likely(__pyx_t_2)) { /* "PETSc/Vec.pyx":752 * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLGetCLMemWrite(__pyx_v_self->vec, (&__pyx_v_memhdl))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 752, __pyx_L1_error) /* "PETSc/Vec.pyx":751 * elif m[0] == c'r': * CHKERR( VecViennaCLGetCLMemRead(self.vec, &memhdl) ) * elif m[0] == c'w': # <<<<<<<<<<<<<< * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: */ goto __pyx_L3; } /* "PETSc/Vec.pyx":754 * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") # <<<<<<<<<<<<<< * return memhdl * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 754, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Vec.pyx":755 * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") * return memhdl # <<<<<<<<<<<<<< * * def restoreCLMemHandle(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_memhdl); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":732 * return queuehdl * * def getCLMemHandle(self, mode='rw'): # <<<<<<<<<<<<<< * """ * Returns a Vec's CL buffer as :class:`int`. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getCLMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mode); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":757 * return memhdl * * def restoreCLMemHandle(self): # <<<<<<<<<<<<<< * """ * To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes. */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_126restoreCLMemHandle[] = "Vec.restoreCLMemHandle(self)\n\n To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes.\n See also :meth:`Vec.getCLMemHandle`.\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreCLMemHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreCLMemHandle (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("restoreCLMemHandle", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restoreCLMemHandle", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_126restoreCLMemHandle(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_126restoreCLMemHandle(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreCLMemHandle", 0); /* "PETSc/Vec.pyx":762 * See also :meth:`Vec.getCLMemHandle`. * """ * CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) # <<<<<<<<<<<<<< * * def duplicate(self, array=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecViennaCLRestoreCLMemWrite(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 762, __pyx_L1_error) /* "PETSc/Vec.pyx":757 * return memhdl * * def restoreCLMemHandle(self): # <<<<<<<<<<<<<< * """ * To be called after accessing a Vec's cl_mem in 'w' or 'rw' modes. */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreCLMemHandle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":764 * CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) * * def duplicate(self, array=None): # <<<<<<<<<<<<<< * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_129duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_128duplicate[] = "Vec.duplicate(self, array=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_129duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "duplicate") < 0)) __PYX_ERR(33, 764, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_array = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 764, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_128duplicate(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_128duplicate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_array) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_ctx0 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 0); /* "PETSc/Vec.pyx":765 * * def duplicate(self, array=None): * cdef Vec vec = type(self)() # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * # duplicate tensor context */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 765, __pyx_L1_error) __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":766 * def duplicate(self, array=None): * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) # <<<<<<<<<<<<<< * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 766, __pyx_L1_error) /* "PETSc/Vec.pyx":768 * CHKERR( VecDuplicate(self.vec, &vec.vec) ) * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') # <<<<<<<<<<<<<< * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__dltensor_ctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ctx0 = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":769 * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: # <<<<<<<<<<<<<< * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: */ __pyx_t_5 = (__pyx_v_ctx0 != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "PETSc/Vec.pyx":770 * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) # <<<<<<<<<<<<<< * if array is not None: * vec_setarray(vec, array) */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec *)__pyx_v_vec->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_vec), ((char *)"__dltensor_ctx__"), __pyx_v_ctx0); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":769 * # duplicate tensor context * cdef object ctx0 = self.get_attr('__dltensor_ctx__') * if ctx0 is not None: # <<<<<<<<<<<<<< * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: */ } /* "PETSc/Vec.pyx":771 * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: # <<<<<<<<<<<<<< * vec_setarray(vec, array) * return vec */ __pyx_t_6 = (__pyx_v_array != Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { /* "PETSc/Vec.pyx":772 * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: * vec_setarray(vec, array) # <<<<<<<<<<<<<< * return vec * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_vec, __pyx_v_array); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 772, __pyx_L1_error) /* "PETSc/Vec.pyx":771 * if ctx0 is not None: * vec.set_attr('__dltensor_ctx__', ctx0) * if array is not None: # <<<<<<<<<<<<<< * vec_setarray(vec, array) * return vec */ } /* "PETSc/Vec.pyx":773 * if array is not None: * vec_setarray(vec, array) * return vec # <<<<<<<<<<<<<< * * def copy(self, Vec result=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/Vec.pyx":764 * CHKERR( VecViennaCLRestoreCLMemWrite(self.vec) ) * * def duplicate(self, array=None): # <<<<<<<<<<<<<< * cdef Vec vec = type(self)() * CHKERR( VecDuplicate(self.vec, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_ctx0); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":775 * return vec * * def copy(self, Vec result=None): # <<<<<<<<<<<<<< * if result is None: * result = type(self)() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_131copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_130copy[] = "Vec.copy(self, Vec result=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_131copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy") < 0)) __PYX_ERR(33, 775, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 775, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(33, 775, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_130copy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_130copy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Vec.pyx":776 * * def copy(self, Vec result=None): * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.vec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":777 * def copy(self, Vec result=None): * if result is None: * result = type(self)() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( VecDuplicate(self.vec, &result.vec) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(33, 777, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Vec.pyx":776 * * def copy(self, Vec result=None): * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.vec == NULL: */ } /* "PETSc/Vec.pyx":778 * if result is None: * result = type(self)() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) */ __pyx_t_2 = ((__pyx_v_result->vec == NULL) != 0); if (__pyx_t_2) { /* "PETSc/Vec.pyx":779 * result = type(self)() * if result.vec == NULL: * CHKERR( VecDuplicate(self.vec, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecCopy(self.vec, result.vec) ) * return result */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_self->vec, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(33, 779, __pyx_L1_error) /* "PETSc/Vec.pyx":778 * if result is None: * result = type(self)() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) */ } /* "PETSc/Vec.pyx":780 * if result.vec == NULL: * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_self->vec, __pyx_v_result->vec)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(33, 780, __pyx_L1_error) /* "PETSc/Vec.pyx":781 * CHKERR( VecDuplicate(self.vec, &result.vec) ) * CHKERR( VecCopy(self.vec, result.vec) ) * return result # <<<<<<<<<<<<<< * * def chop(self, tol): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Vec.pyx":775 * return vec * * def copy(self, Vec result=None): # <<<<<<<<<<<<<< * if result is None: * result = type(self)() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":783 * return result * * def chop(self, tol): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * CHKERR( VecChop(self.vec, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_133chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_132chop[] = "Vec.chop(self, tol)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_133chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chop (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chop") < 0)) __PYX_ERR(33, 783, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tol = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 783, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_132chop(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_132chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chop", 0); /* "PETSc/Vec.pyx":784 * * def chop(self, tol): * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * CHKERR( VecChop(self.vec, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(33, 784, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/Vec.pyx":785 * def chop(self, tol): * cdef PetscReal rval = asReal(tol) * CHKERR( VecChop(self.vec, rval) ) # <<<<<<<<<<<<<< * * def load(self, Viewer viewer): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecChop(__pyx_v_self->vec, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 785, __pyx_L1_error) /* "PETSc/Vec.pyx":783 * return result * * def chop(self, tol): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * CHKERR( VecChop(self.vec, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":787 * CHKERR( VecChop(self.vec, rval) ) * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_135load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_134load[] = "Vec.load(self, Viewer viewer)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_135load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(33, 787, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 787, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(33, 787, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_134load(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_134load(struct PyPetscVecObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { MPI_Comm __pyx_v_comm; PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); /* "PETSc/Vec.pyx":788 * * def load(self, Viewer viewer): * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: */ __pyx_v_comm = MPI_COMM_NULL; /* "PETSc/Vec.pyx":789 * def load(self, Viewer viewer): * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) # <<<<<<<<<<<<<< * if self.vec == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) */ __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr); /* "PETSc/Vec.pyx":790 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) */ __pyx_t_1 = ((__pyx_v_self->vec == NULL) != 0); if (__pyx_t_1) { /* "PETSc/Vec.pyx":791 * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) # <<<<<<<<<<<<<< * CHKERR( VecCreate(comm, &self.vec) ) * CHKERR( VecLoad(self.vec, viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(__pyx_v_obj, (&__pyx_v_comm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 791, __pyx_L1_error) /* "PETSc/Vec.pyx":792 * if self.vec == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecLoad(self.vec, viewer.vwr) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_comm, (&__pyx_v_self->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 792, __pyx_L1_error) /* "PETSc/Vec.pyx":790 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) */ } /* "PETSc/Vec.pyx":793 * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( VecCreate(comm, &self.vec) ) * CHKERR( VecLoad(self.vec, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecLoad(__pyx_v_self->vec, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 793, __pyx_L1_error) /* "PETSc/Vec.pyx":794 * CHKERR( VecCreate(comm, &self.vec) ) * CHKERR( VecLoad(self.vec, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def equal(self, Vec vec): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Vec.pyx":787 * CHKERR( VecChop(self.vec, rval) ) * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":796 * return self * * def equal(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_137equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_136equal[] = "Vec.equal(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_137equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("equal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(33, 796, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 796, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 796, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_136equal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_136equal(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("equal", 0); /* "PETSc/Vec.pyx":797 * * def equal(self, Vec vec): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Vec.pyx":798 * def equal(self, Vec vec): * cdef PetscBool flag = PETSC_FALSE * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecEqual(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 798, __pyx_L1_error) /* "PETSc/Vec.pyx":799 * cdef PetscBool flag = PETSC_FALSE * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def dot(self, Vec vec): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":796 * return self * * def equal(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( VecEqual(self.vec, vec.vec, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":801 * return toBool(flag) * * def dot(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecDot(self.vec, vec.vec, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_139dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_138dot[] = "Vec.dot(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_139dot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dot (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dot") < 0)) __PYX_ERR(33, 801, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dot", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 801, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.dot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 801, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_138dot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_138dot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dot", 0); /* "PETSc/Vec.pyx":802 * * def dot(self, Vec vec): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":803 * def dot(self, Vec vec): * cdef PetscScalar sval = 0 * CHKERR( VecDot(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDot(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 803, __pyx_L1_error) /* "PETSc/Vec.pyx":804 * cdef PetscScalar sval = 0 * CHKERR( VecDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def dotBegin(self, Vec vec): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":801 * return toBool(flag) * * def dot(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecDot(self.vec, vec.vec, &sval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.dot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":806 * return toScalar(sval) * * def dotBegin(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_141dotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_140dotBegin[] = "Vec.dotBegin(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_141dotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dotBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dotBegin") < 0)) __PYX_ERR(33, 806, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dotBegin", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 806, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 806, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_140dotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_140dotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dotBegin", 0); /* "PETSc/Vec.pyx":807 * * def dotBegin(self, Vec vec): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) * */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":808 * def dotBegin(self, Vec vec): * cdef PetscScalar sval = 0 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * * def dotEnd(self, Vec vec): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDotBegin(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 808, __pyx_L1_error) /* "PETSc/Vec.pyx":806 * return toScalar(sval) * * def dotBegin(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":810 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) * * def dotEnd(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_143dotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_142dotEnd[] = "Vec.dotEnd(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_143dotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dotEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dotEnd") < 0)) __PYX_ERR(33, 810, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dotEnd", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 810, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 810, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_142dotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_142dotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dotEnd", 0); /* "PETSc/Vec.pyx":811 * * def dotEnd(self, Vec vec): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":812 * def dotEnd(self, Vec vec): * cdef PetscScalar sval = 0 * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDotEnd(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 812, __pyx_L1_error) /* "PETSc/Vec.pyx":813 * cdef PetscScalar sval = 0 * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def tDot(self, Vec vec): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":810 * CHKERR( VecDotBegin(self.vec, vec.vec, &sval) ) * * def dotEnd(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecDotEnd(self.vec, vec.vec, &sval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.dotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":815 * return toScalar(sval) * * def tDot(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_145tDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_144tDot[] = "Vec.tDot(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_145tDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tDot (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tDot") < 0)) __PYX_ERR(33, 815, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tDot", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 815, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 815, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_144tDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_144tDot(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tDot", 0); /* "PETSc/Vec.pyx":816 * * def tDot(self, Vec vec): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":817 * def tDot(self, Vec vec): * cdef PetscScalar sval = 0 * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecTDot(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 817, __pyx_L1_error) /* "PETSc/Vec.pyx":818 * cdef PetscScalar sval = 0 * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def tDotBegin(self, Vec vec): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":815 * return toScalar(sval) * * def tDot(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecTDot(self.vec, vec.vec, &sval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":820 * return toScalar(sval) * * def tDotBegin(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_147tDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_146tDotBegin[] = "Vec.tDotBegin(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_147tDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tDotBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tDotBegin") < 0)) __PYX_ERR(33, 820, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tDotBegin", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 820, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 820, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_146tDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_146tDotBegin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tDotBegin", 0); /* "PETSc/Vec.pyx":821 * * def tDotBegin(self, Vec vec): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) * */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":822 * def tDotBegin(self, Vec vec): * cdef PetscScalar sval = 0 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * * def tDotEnd(self, Vec vec): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecTDotBegin(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 822, __pyx_L1_error) /* "PETSc/Vec.pyx":820 * return toScalar(sval) * * def tDotBegin(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":824 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) * * def tDotEnd(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_149tDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_148tDotEnd[] = "Vec.tDotEnd(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_149tDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tDotEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tDotEnd") < 0)) __PYX_ERR(33, 824, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tDotEnd", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 824, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 824, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_148tDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_148tDotEnd(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tDotEnd", 0); /* "PETSc/Vec.pyx":825 * * def tDotEnd(self, Vec vec): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":826 * def tDotEnd(self, Vec vec): * cdef PetscScalar sval = 0 * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecTDotEnd(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 826, __pyx_L1_error) /* "PETSc/Vec.pyx":827 * cdef PetscScalar sval = 0 * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def mDot(self, vecs, out=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":824 * CHKERR( VecTDotBegin(self.vec, vec.vec, &sval) ) * * def tDotEnd(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecTDotEnd(self.vec, vec.vec, &sval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.tDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":829 * return toScalar(sval) * * def mDot(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_151mDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_150mDot[] = "Vec.mDot(self, vecs, out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_151mDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mDot (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mDot") < 0)) __PYX_ERR(33, 829, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mDot", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 829, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_150mDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_150mDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mDot", 0); /* "PETSc/Vec.pyx":830 * * def mDot(self, vecs, out=None): * self; vecs; out; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_vecs); ((void)__pyx_v_out); /* "PETSc/Vec.pyx":831 * def mDot(self, vecs, out=None): * self; vecs; out; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def mDotBegin(self, vecs, out=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 831, __pyx_L1_error) /* "PETSc/Vec.pyx":829 * return toScalar(sval) * * def mDot(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":833 * raise NotImplementedError * * def mDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_153mDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_152mDotBegin[] = "Vec.mDotBegin(self, vecs, out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_153mDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mDotBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mDotBegin") < 0)) __PYX_ERR(33, 833, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mDotBegin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 833, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_152mDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_152mDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mDotBegin", 0); /* "PETSc/Vec.pyx":834 * * def mDotBegin(self, vecs, out=None): * self; vecs; out; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_vecs); ((void)__pyx_v_out); /* "PETSc/Vec.pyx":835 * def mDotBegin(self, vecs, out=None): * self; vecs; out; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def mDotEnd(self, vecs, out=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 835, __pyx_L1_error) /* "PETSc/Vec.pyx":833 * raise NotImplementedError * * def mDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":837 * raise NotImplementedError * * def mDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_155mDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_154mDotEnd[] = "Vec.mDotEnd(self, vecs, out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_155mDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mDotEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mDotEnd") < 0)) __PYX_ERR(33, 837, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mDotEnd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 837, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_154mDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_154mDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mDotEnd", 0); /* "PETSc/Vec.pyx":838 * * def mDotEnd(self, vecs, out=None): * self; vecs; out; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_vecs); ((void)__pyx_v_out); /* "PETSc/Vec.pyx":839 * def mDotEnd(self, vecs, out=None): * self; vecs; out; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def mtDot(self, vecs, out=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 839, __pyx_L1_error) /* "PETSc/Vec.pyx":837 * raise NotImplementedError * * def mDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":841 * raise NotImplementedError * * def mtDot(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_157mtDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_156mtDot[] = "Vec.mtDot(self, vecs, out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_157mtDot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mtDot (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mtDot") < 0)) __PYX_ERR(33, 841, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mtDot", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 841, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_156mtDot(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_156mtDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mtDot", 0); /* "PETSc/Vec.pyx":842 * * def mtDot(self, vecs, out=None): * self; vecs; out; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_vecs); ((void)__pyx_v_out); /* "PETSc/Vec.pyx":843 * def mtDot(self, vecs, out=None): * self; vecs; out; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def mtDotBegin(self, vecs, out=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 843, __pyx_L1_error) /* "PETSc/Vec.pyx":841 * raise NotImplementedError * * def mtDot(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":845 * raise NotImplementedError * * def mtDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_159mtDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_158mtDotBegin[] = "Vec.mtDotBegin(self, vecs, out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_159mtDotBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mtDotBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mtDotBegin") < 0)) __PYX_ERR(33, 845, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mtDotBegin", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 845, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_158mtDotBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_158mtDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mtDotBegin", 0); /* "PETSc/Vec.pyx":846 * * def mtDotBegin(self, vecs, out=None): * self; vecs; out; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_vecs); ((void)__pyx_v_out); /* "PETSc/Vec.pyx":847 * def mtDotBegin(self, vecs, out=None): * self; vecs; out; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def mtDotEnd(self, vecs, out=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 847, __pyx_L1_error) /* "PETSc/Vec.pyx":845 * raise NotImplementedError * * def mtDotBegin(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":849 * raise NotImplementedError * * def mtDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_161mtDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_160mtDotEnd[] = "Vec.mtDotEnd(self, vecs, out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_161mtDotEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vecs = 0; PyObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mtDotEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vecs,&__pyx_n_s_out,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mtDotEnd") < 0)) __PYX_ERR(33, 849, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vecs = values[0]; __pyx_v_out = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mtDotEnd", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 849, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_160mtDotEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vecs, __pyx_v_out); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_160mtDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mtDotEnd", 0); /* "PETSc/Vec.pyx":850 * * def mtDotEnd(self, vecs, out=None): * self; vecs; out; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_vecs); ((void)__pyx_v_out); /* "PETSc/Vec.pyx":851 * def mtDotEnd(self, vecs, out=None): * self; vecs; out; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def norm(self, norm_type=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(33, 851, __pyx_L1_error) /* "PETSc/Vec.pyx":849 * raise NotImplementedError * * def mtDotEnd(self, vecs, out=None): # <<<<<<<<<<<<<< * self; vecs; out; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":853 * raise NotImplementedError * * def norm(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_163norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_162norm[] = "Vec.norm(self, norm_type=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_163norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_norm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("norm (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "norm") < 0)) __PYX_ERR(33, 853, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("norm", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 853, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_162norm(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_162norm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; NormType __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("norm", 0); /* "PETSc/Vec.pyx":854 * * def norm(self, norm_type=None): * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "PETSc/Vec.pyx":855 * def norm(self, norm_type=None): * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_2; /* "PETSc/Vec.pyx":856 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( VecNorm(self.vec, ntype, rval) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 856, __pyx_L1_error) __pyx_v_ntype = __pyx_t_3; } /* "PETSc/Vec.pyx":858 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( VecNorm(self.vec, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 858, __pyx_L1_error) /* "PETSc/Vec.pyx":859 * cdef PetscReal rval[2] * CHKERR( VecNorm(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_2 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":860 * CHKERR( VecNorm(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def normBegin(self, norm_type=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":853 * raise NotImplementedError * * def norm(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Vec.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":862 * else: return (toReal(rval[0]), toReal(rval[1])) * * def normBegin(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_165normBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_164normBegin[] = "Vec.normBegin(self, norm_type=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_165normBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_norm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normBegin") < 0)) __PYX_ERR(33, 862, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("normBegin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 862, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.normBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_164normBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_164normBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_ntype; PetscReal __pyx_v_dummy[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; NormType __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normBegin", 0); /* "PETSc/Vec.pyx":863 * * def normBegin(self, norm_type=None): * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal dummy[2] */ __pyx_v_ntype = NORM_2; /* "PETSc/Vec.pyx":864 * def normBegin(self, norm_type=None): * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal dummy[2] * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 864, __pyx_L1_error) __pyx_v_ntype = __pyx_t_3; } /* "PETSc/Vec.pyx":866 * if norm_type is not None: ntype = norm_type * cdef PetscReal dummy[2] * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) # <<<<<<<<<<<<<< * * def normEnd(self, norm_type=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormBegin(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_dummy)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 866, __pyx_L1_error) /* "PETSc/Vec.pyx":862 * else: return (toReal(rval[0]), toReal(rval[1])) * * def normBegin(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.normBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":868 * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) * * def normEnd(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_167normEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_166normEnd[] = "Vec.normEnd(self, norm_type=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_167normEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_norm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normEnd") < 0)) __PYX_ERR(33, 868, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("normEnd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 868, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.normEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_166normEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_norm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_166normEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; NormType __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normEnd", 0); /* "PETSc/Vec.pyx":869 * * def normEnd(self, norm_type=None): * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "PETSc/Vec.pyx":870 * def normEnd(self, norm_type=None): * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_2; /* "PETSc/Vec.pyx":871 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( VecNormEnd(self.vec, ntype, rval) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 871, __pyx_L1_error) __pyx_v_ntype = __pyx_t_3; } /* "PETSc/Vec.pyx":873 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( VecNormEnd(self.vec, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormEnd(__pyx_v_self->vec, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 873, __pyx_L1_error) /* "PETSc/Vec.pyx":874 * cdef PetscReal rval[2] * CHKERR( VecNormEnd(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_2 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":875 * CHKERR( VecNormEnd(self.vec, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def sum(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":868 * CHKERR( VecNormBegin(self.vec, ntype, dummy) ) * * def normEnd(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Vec.normEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":877 * else: return (toReal(rval[0]), toReal(rval[1])) * * def sum(self): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecSum(self.vec, &sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_169sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_168sum[] = "Vec.sum(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_169sum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sum (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("sum", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sum", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_168sum(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_168sum(struct PyPetscVecObject *__pyx_v_self) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sum", 0); /* "PETSc/Vec.pyx":878 * * def sum(self): * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecSum(self.vec, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":879 * def sum(self): * cdef PetscScalar sval = 0 * CHKERR( VecSum(self.vec, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSum(__pyx_v_self->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 879, __pyx_L1_error) /* "PETSc/Vec.pyx":880 * cdef PetscScalar sval = 0 * CHKERR( VecSum(self.vec, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def min(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":877 * else: return (toReal(rval[0]), toReal(rval[1])) * * def sum(self): # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecSum(self.vec, &sval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.sum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":882 * return toScalar(sval) * * def min(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_171min(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_170min[] = "Vec.min(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_171min(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("min (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("min", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "min", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_170min(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_170min(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("min", 0); /* "PETSc/Vec.pyx":883 * * def min(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecMin(self.vec, &ival, &rval) ) */ __pyx_v_ival = 0; /* "PETSc/Vec.pyx":884 * def min(self): * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecMin(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) */ __pyx_v_rval = 0.0; /* "PETSc/Vec.pyx":885 * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 * CHKERR( VecMin(self.vec, &ival, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival), toReal(rval)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMin(__pyx_v_self->vec, (&__pyx_v_ival), (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 885, __pyx_L1_error) /* "PETSc/Vec.pyx":886 * cdef PetscReal rval = 0 * CHKERR( VecMin(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) # <<<<<<<<<<<<<< * * def max(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":882 * return toScalar(sval) * * def min(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.min", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":888 * return (toInt(ival), toReal(rval)) * * def max(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_173max(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_172max[] = "Vec.max(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_173max(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("max (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("max", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "max", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_172max(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_172max(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("max", 0); /* "PETSc/Vec.pyx":889 * * def max(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecMax(self.vec, &ival, &rval) ) */ __pyx_v_ival = 0; /* "PETSc/Vec.pyx":890 * def max(self): * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecMax(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) */ __pyx_v_rval = 0.0; /* "PETSc/Vec.pyx":891 * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 * CHKERR( VecMax(self.vec, &ival, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival), toReal(rval)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMax(__pyx_v_self->vec, (&__pyx_v_ival), (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 891, __pyx_L1_error) /* "PETSc/Vec.pyx":892 * cdef PetscReal rval = 0 * CHKERR( VecMax(self.vec, &ival, &rval) ) * return (toInt(ival), toReal(rval)) # <<<<<<<<<<<<<< * * def normalize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":888 * return (toInt(ival), toReal(rval)) * * def max(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * cdef PetscReal rval = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Vec.max", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":894 * return (toInt(ival), toReal(rval)) * * def normalize(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecNormalize(self.vec, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_175normalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_174normalize[] = "Vec.normalize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_175normalize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("normalize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("normalize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "normalize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_174normalize(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_174normalize(struct PyPetscVecObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("normalize", 0); /* "PETSc/Vec.pyx":895 * * def normalize(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecNormalize(self.vec, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/Vec.pyx":896 * def normalize(self): * cdef PetscReal rval = 0 * CHKERR( VecNormalize(self.vec, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNormalize(__pyx_v_self->vec, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 896, __pyx_L1_error) /* "PETSc/Vec.pyx":897 * cdef PetscReal rval = 0 * CHKERR( VecNormalize(self.vec, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def reciprocal(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":894 * return (toInt(ival), toReal(rval)) * * def normalize(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecNormalize(self.vec, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.normalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":899 * return toReal(rval) * * def reciprocal(self): # <<<<<<<<<<<<<< * CHKERR( VecReciprocal(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_177reciprocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_176reciprocal[] = "Vec.reciprocal(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_177reciprocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reciprocal (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reciprocal", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reciprocal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_176reciprocal(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_176reciprocal(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reciprocal", 0); /* "PETSc/Vec.pyx":900 * * def reciprocal(self): * CHKERR( VecReciprocal(self.vec) ) # <<<<<<<<<<<<<< * * def exp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecReciprocal(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 900, __pyx_L1_error) /* "PETSc/Vec.pyx":899 * return toReal(rval) * * def reciprocal(self): # <<<<<<<<<<<<<< * CHKERR( VecReciprocal(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.reciprocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":902 * CHKERR( VecReciprocal(self.vec) ) * * def exp(self): # <<<<<<<<<<<<<< * CHKERR( VecExp(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_179exp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_178exp[] = "Vec.exp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_179exp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("exp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("exp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "exp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_178exp(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_178exp(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("exp", 0); /* "PETSc/Vec.pyx":903 * * def exp(self): * CHKERR( VecExp(self.vec) ) # <<<<<<<<<<<<<< * * def log(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecExp(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 903, __pyx_L1_error) /* "PETSc/Vec.pyx":902 * CHKERR( VecReciprocal(self.vec) ) * * def exp(self): # <<<<<<<<<<<<<< * CHKERR( VecExp(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.exp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":905 * CHKERR( VecExp(self.vec) ) * * def log(self): # <<<<<<<<<<<<<< * CHKERR( VecLog(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_181log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_180log[] = "Vec.log(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_181log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("log (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("log", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "log", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_180log(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_180log(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("log", 0); /* "PETSc/Vec.pyx":906 * * def log(self): * CHKERR( VecLog(self.vec) ) # <<<<<<<<<<<<<< * * def sqrtabs(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecLog(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 906, __pyx_L1_error) /* "PETSc/Vec.pyx":905 * CHKERR( VecExp(self.vec) ) * * def log(self): # <<<<<<<<<<<<<< * CHKERR( VecLog(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.log", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":908 * CHKERR( VecLog(self.vec) ) * * def sqrtabs(self): # <<<<<<<<<<<<<< * CHKERR( VecSqrtAbs(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_183sqrtabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_182sqrtabs[] = "Vec.sqrtabs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_183sqrtabs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sqrtabs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("sqrtabs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sqrtabs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_182sqrtabs(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_182sqrtabs(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sqrtabs", 0); /* "PETSc/Vec.pyx":909 * * def sqrtabs(self): * CHKERR( VecSqrtAbs(self.vec) ) # <<<<<<<<<<<<<< * * def abs(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSqrtAbs(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 909, __pyx_L1_error) /* "PETSc/Vec.pyx":908 * CHKERR( VecLog(self.vec) ) * * def sqrtabs(self): # <<<<<<<<<<<<<< * CHKERR( VecSqrtAbs(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.sqrtabs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":911 * CHKERR( VecSqrtAbs(self.vec) ) * * def abs(self): # <<<<<<<<<<<<<< * CHKERR( VecAbs(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_185abs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_184abs[] = "Vec.abs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_185abs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("abs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("abs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "abs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_184abs(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184abs(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("abs", 0); /* "PETSc/Vec.pyx":912 * * def abs(self): * CHKERR( VecAbs(self.vec) ) # <<<<<<<<<<<<<< * * def conjugate(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAbs(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 912, __pyx_L1_error) /* "PETSc/Vec.pyx":911 * CHKERR( VecSqrtAbs(self.vec) ) * * def abs(self): # <<<<<<<<<<<<<< * CHKERR( VecAbs(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.abs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":914 * CHKERR( VecAbs(self.vec) ) * * def conjugate(self): # <<<<<<<<<<<<<< * CHKERR( VecConjugate(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_187conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_186conjugate[] = "Vec.conjugate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_187conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("conjugate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("conjugate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "conjugate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_186conjugate(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186conjugate(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("conjugate", 0); /* "PETSc/Vec.pyx":915 * * def conjugate(self): * CHKERR( VecConjugate(self.vec) ) # <<<<<<<<<<<<<< * * def setRandom(self, Random random=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecConjugate(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 915, __pyx_L1_error) /* "PETSc/Vec.pyx":914 * CHKERR( VecAbs(self.vec) ) * * def conjugate(self): # <<<<<<<<<<<<<< * CHKERR( VecConjugate(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.conjugate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":917 * CHKERR( VecConjugate(self.vec) ) * * def setRandom(self, Random random=None): # <<<<<<<<<<<<<< * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_189setRandom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_188setRandom[] = "Vec.setRandom(self, Random random=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_189setRandom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscRandomObject *__pyx_v_random = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRandom (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_random,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscRandomObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_random); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRandom") < 0)) __PYX_ERR(33, 917, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_random = ((struct PyPetscRandomObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRandom", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 917, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_random), __pyx_ptype_8petsc4py_5PETSc_Random, 1, "random", 0))) __PYX_ERR(33, 917, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_188setRandom(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_random); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188setRandom(struct PyPetscVecObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random) { PetscRandom __pyx_v_rnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscRandom __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRandom", 0); /* "PETSc/Vec.pyx":918 * * def setRandom(self, Random random=None): * cdef PetscRandom rnd = NULL # <<<<<<<<<<<<<< * if random is not None: rnd = random.rnd * CHKERR( VecSetRandom(self.vec, rnd) ) */ __pyx_v_rnd = NULL; /* "PETSc/Vec.pyx":919 * def setRandom(self, Random random=None): * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd # <<<<<<<<<<<<<< * CHKERR( VecSetRandom(self.vec, rnd) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_random) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_random->rnd; __pyx_v_rnd = __pyx_t_3; } /* "PETSc/Vec.pyx":920 * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd * CHKERR( VecSetRandom(self.vec, rnd) ) # <<<<<<<<<<<<<< * * def permute(self, IS order, invert=False): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetRandom(__pyx_v_self->vec, __pyx_v_rnd)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 920, __pyx_L1_error) /* "PETSc/Vec.pyx":917 * CHKERR( VecConjugate(self.vec) ) * * def setRandom(self, Random random=None): # <<<<<<<<<<<<<< * cdef PetscRandom rnd = NULL * if random is not None: rnd = random.rnd */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setRandom", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":922 * CHKERR( VecSetRandom(self.vec, rnd) ) * * def permute(self, IS order, invert=False): # <<<<<<<<<<<<<< * cdef PetscBool cinvert = PETSC_FALSE * if invert: cinvert = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_191permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_190permute[] = "Vec.permute(self, IS order, invert=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_191permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_order = 0; PyObject *__pyx_v_invert = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("permute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_order,&__pyx_n_s_invert,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_invert); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "permute") < 0)) __PYX_ERR(33, 922, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_order = ((struct PyPetscISObject *)values[0]); __pyx_v_invert = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("permute", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 922, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "order", 0))) __PYX_ERR(33, 922, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_190permute(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_order, __pyx_v_invert); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190permute(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_order, PyObject *__pyx_v_invert) { PetscBool __pyx_v_cinvert; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("permute", 0); /* "PETSc/Vec.pyx":923 * * def permute(self, IS order, invert=False): * cdef PetscBool cinvert = PETSC_FALSE # <<<<<<<<<<<<<< * if invert: cinvert = PETSC_TRUE * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) */ __pyx_v_cinvert = PETSC_FALSE; /* "PETSc/Vec.pyx":924 * def permute(self, IS order, invert=False): * cdef PetscBool cinvert = PETSC_FALSE * if invert: cinvert = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_invert); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(33, 924, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_cinvert = PETSC_TRUE; } /* "PETSc/Vec.pyx":925 * cdef PetscBool cinvert = PETSC_FALSE * if invert: cinvert = PETSC_TRUE * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) # <<<<<<<<<<<<<< * * def zeroEntries(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPermute(__pyx_v_self->vec, __pyx_v_order->iset, __pyx_v_cinvert)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 925, __pyx_L1_error) /* "PETSc/Vec.pyx":922 * CHKERR( VecSetRandom(self.vec, rnd) ) * * def permute(self, IS order, invert=False): # <<<<<<<<<<<<<< * cdef PetscBool cinvert = PETSC_FALSE * if invert: cinvert = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":927 * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) * * def zeroEntries(self): # <<<<<<<<<<<<<< * CHKERR( VecZeroEntries(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_193zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_192zeroEntries[] = "Vec.zeroEntries(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_193zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroEntries (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("zeroEntries", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "zeroEntries", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_192zeroEntries(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192zeroEntries(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroEntries", 0); /* "PETSc/Vec.pyx":928 * * def zeroEntries(self): * CHKERR( VecZeroEntries(self.vec) ) # <<<<<<<<<<<<<< * * def set(self, alpha): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecZeroEntries(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 928, __pyx_L1_error) /* "PETSc/Vec.pyx":927 * CHKERR( VecPermute(self.vec, order.iset, cinvert) ) * * def zeroEntries(self): # <<<<<<<<<<<<<< * CHKERR( VecZeroEntries(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.zeroEntries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":930 * CHKERR( VecZeroEntries(self.vec) ) * * def set(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecSet(self.vec, sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_195set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_194set[] = "Vec.set(self, alpha)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_195set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(33, 930, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 930, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_194set(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_194set(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set", 0); /* "PETSc/Vec.pyx":931 * * def set(self, alpha): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecSet(self.vec, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 931, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Vec.pyx":932 * def set(self, alpha): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecSet(self.vec, sval) ) # <<<<<<<<<<<<<< * * def isset(self, IS idx, alpha): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSet(__pyx_v_self->vec, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 932, __pyx_L1_error) /* "PETSc/Vec.pyx":930 * CHKERR( VecZeroEntries(self.vec) ) * * def set(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecSet(self.vec, sval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.set", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":934 * CHKERR( VecSet(self.vec, sval) ) * * def isset(self, IS idx, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar aval = asScalar(alpha) * CHKERR( VecISSet(self.vec, idx.iset, aval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_197isset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_196isset[] = "Vec.isset(self, IS idx, alpha)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_197isset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_idx = 0; PyObject *__pyx_v_alpha = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isset (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idx,&__pyx_n_s_alpha,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("isset", 1, 2, 2, 1); __PYX_ERR(33, 934, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isset") < 0)) __PYX_ERR(33, 934, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_idx = ((struct PyPetscISObject *)values[0]); __pyx_v_alpha = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 934, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.isset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idx), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(33, 934, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_196isset(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_idx, __pyx_v_alpha); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_196isset(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_aval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isset", 0); /* "PETSc/Vec.pyx":935 * * def isset(self, IS idx, alpha): * cdef PetscScalar aval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecISSet(self.vec, idx.iset, aval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 935, __pyx_L1_error) __pyx_v_aval = __pyx_t_1; /* "PETSc/Vec.pyx":936 * def isset(self, IS idx, alpha): * cdef PetscScalar aval = asScalar(alpha) * CHKERR( VecISSet(self.vec, idx.iset, aval) ) # <<<<<<<<<<<<<< * * def scale(self, alpha): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecISSet(__pyx_v_self->vec, __pyx_v_idx->iset, __pyx_v_aval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 936, __pyx_L1_error) /* "PETSc/Vec.pyx":934 * CHKERR( VecSet(self.vec, sval) ) * * def isset(self, IS idx, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar aval = asScalar(alpha) * CHKERR( VecISSet(self.vec, idx.iset, aval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.isset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":938 * CHKERR( VecISSet(self.vec, idx.iset, aval) ) * * def scale(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecScale(self.vec, sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_199scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_198scale[] = "Vec.scale(self, alpha)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_199scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) __PYX_ERR(33, 938, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 938, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_198scale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_198scale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 0); /* "PETSc/Vec.pyx":939 * * def scale(self, alpha): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecScale(self.vec, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 939, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Vec.pyx":940 * def scale(self, alpha): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecScale(self.vec, sval) ) # <<<<<<<<<<<<<< * * def shift(self, alpha): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScale(__pyx_v_self->vec, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 940, __pyx_L1_error) /* "PETSc/Vec.pyx":938 * CHKERR( VecISSet(self.vec, idx.iset, aval) ) * * def scale(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecScale(self.vec, sval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":942 * CHKERR( VecScale(self.vec, sval) ) * * def shift(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecShift(self.vec, sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_201shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_200shift[] = "Vec.shift(self, alpha)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_201shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shift (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shift") < 0)) __PYX_ERR(33, 942, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 942, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_200shift(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_200shift(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shift", 0); /* "PETSc/Vec.pyx":943 * * def shift(self, alpha): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecShift(self.vec, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 943, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Vec.pyx":944 * def shift(self, alpha): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecShift(self.vec, sval) ) # <<<<<<<<<<<<<< * * def chop(self, tol): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecShift(__pyx_v_self->vec, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 944, __pyx_L1_error) /* "PETSc/Vec.pyx":942 * CHKERR( VecScale(self.vec, sval) ) * * def shift(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecShift(self.vec, sval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":946 * CHKERR( VecShift(self.vec, sval) ) * * def chop(self, tol): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * CHKERR( VecChop(self.vec, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_203chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_202chop[] = "Vec.chop(self, tol)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_203chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chop (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chop") < 0)) __PYX_ERR(33, 946, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tol = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 946, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_202chop(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_202chop(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chop", 0); /* "PETSc/Vec.pyx":947 * * def chop(self, tol): * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * CHKERR( VecChop(self.vec, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(33, 947, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/Vec.pyx":948 * def chop(self, tol): * cdef PetscReal rval = asReal(tol) * CHKERR( VecChop(self.vec, rval) ) # <<<<<<<<<<<<<< * * def swap(self, Vec vec): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecChop(__pyx_v_self->vec, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 948, __pyx_L1_error) /* "PETSc/Vec.pyx":946 * CHKERR( VecShift(self.vec, sval) ) * * def chop(self, tol): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * CHKERR( VecChop(self.vec, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":950 * CHKERR( VecChop(self.vec, rval) ) * * def swap(self, Vec vec): # <<<<<<<<<<<<<< * CHKERR( VecSwap(self.vec, vec.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205swap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_204swap[] = "Vec.swap(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205swap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("swap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "swap") < 0)) __PYX_ERR(33, 950, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("swap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 950, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.swap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 950, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_204swap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_204swap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("swap", 0); /* "PETSc/Vec.pyx":951 * * def swap(self, Vec vec): * CHKERR( VecSwap(self.vec, vec.vec) ) # <<<<<<<<<<<<<< * * def axpy(self, alpha, Vec x): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSwap(__pyx_v_self->vec, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 951, __pyx_L1_error) /* "PETSc/Vec.pyx":950 * CHKERR( VecChop(self.vec, rval) ) * * def swap(self, Vec vec): # <<<<<<<<<<<<<< * CHKERR( VecSwap(self.vec, vec.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.swap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":953 * CHKERR( VecSwap(self.vec, vec.vec) ) * * def axpy(self, alpha, Vec x): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAXPY(self.vec, sval, x.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_207axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_206axpy[] = "Vec.axpy(self, alpha, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_207axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("axpy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("axpy", 1, 2, 2, 1); __PYX_ERR(33, 953, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "axpy") < 0)) __PYX_ERR(33, 953, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_alpha = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("axpy", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 953, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 953, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_206axpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206axpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("axpy", 0); /* "PETSc/Vec.pyx":954 * * def axpy(self, alpha, Vec x): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecAXPY(self.vec, sval, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 954, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Vec.pyx":955 * def axpy(self, alpha, Vec x): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAXPY(self.vec, sval, x.vec) ) # <<<<<<<<<<<<<< * * def isaxpy(self, IS idx, alpha, Vec x): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPY(__pyx_v_self->vec, __pyx_v_sval, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 955, __pyx_L1_error) /* "PETSc/Vec.pyx":953 * CHKERR( VecSwap(self.vec, vec.vec) ) * * def axpy(self, alpha, Vec x): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAXPY(self.vec, sval, x.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":957 * CHKERR( VecAXPY(self.vec, sval, x.vec) ) * * def isaxpy(self, IS idx, alpha, Vec x): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_209isaxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_208isaxpy[] = "Vec.isaxpy(self, IS idx, alpha, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_209isaxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_idx = 0; PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isaxpy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_idx,&__pyx_n_s_alpha,&__pyx_n_s_x,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, 1); __PYX_ERR(33, 957, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, 2); __PYX_ERR(33, 957, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isaxpy") < 0)) __PYX_ERR(33, 957, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_idx = ((struct PyPetscISObject *)values[0]); __pyx_v_alpha = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 957, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.isaxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_idx), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(33, 957, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 957, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_208isaxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_idx, __pyx_v_alpha, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208isaxpy(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isaxpy", 0); /* "PETSc/Vec.pyx":958 * * def isaxpy(self, IS idx, alpha, Vec x): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 958, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Vec.pyx":959 * def isaxpy(self, IS idx, alpha, Vec x): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) # <<<<<<<<<<<<<< * * def aypx(self, alpha, Vec x): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecISAXPY(__pyx_v_self->vec, __pyx_v_idx->iset, __pyx_v_sval, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 959, __pyx_L1_error) /* "PETSc/Vec.pyx":957 * CHKERR( VecAXPY(self.vec, sval, x.vec) ) * * def isaxpy(self, IS idx, alpha, Vec x): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.isaxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":961 * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) * * def aypx(self, alpha, Vec x): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAYPX(self.vec, sval, x.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_211aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_210aypx[] = "Vec.aypx(self, alpha, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_211aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aypx (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aypx", 1, 2, 2, 1); __PYX_ERR(33, 961, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aypx") < 0)) __PYX_ERR(33, 961, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_alpha = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aypx", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 961, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 961, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_210aypx(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210aypx(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aypx", 0); /* "PETSc/Vec.pyx":962 * * def aypx(self, alpha, Vec x): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecAYPX(self.vec, sval, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 962, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Vec.pyx":963 * def aypx(self, alpha, Vec x): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAYPX(self.vec, sval, x.vec) ) # <<<<<<<<<<<<<< * * def axpby(self, alpha, beta, Vec y): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAYPX(__pyx_v_self->vec, __pyx_v_sval, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 963, __pyx_L1_error) /* "PETSc/Vec.pyx":961 * CHKERR( VecISAXPY(self.vec, idx.iset, sval, x.vec) ) * * def aypx(self, alpha, Vec x): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecAYPX(self.vec, sval, x.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":965 * CHKERR( VecAYPX(self.vec, sval, x.vec) ) * * def axpby(self, alpha, beta, Vec y): # <<<<<<<<<<<<<< * cdef PetscScalar sval1 = asScalar(alpha) * cdef PetscScalar sval2 = asScalar(beta) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_213axpby(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_212axpby[] = "Vec.axpby(self, alpha, beta, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_213axpby(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; PyObject *__pyx_v_beta = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("axpby (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_beta,&__pyx_n_s_y,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, 1); __PYX_ERR(33, 965, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, 2); __PYX_ERR(33, 965, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "axpby") < 0)) __PYX_ERR(33, 965, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_alpha = values[0]; __pyx_v_beta = values[1]; __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 965, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpby", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(33, 965, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_212axpby(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_beta, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212axpby(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_beta, struct PyPetscVecObject *__pyx_v_y) { PetscScalar __pyx_v_sval1; PetscScalar __pyx_v_sval2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("axpby", 0); /* "PETSc/Vec.pyx":966 * * def axpby(self, alpha, beta, Vec y): * cdef PetscScalar sval1 = asScalar(alpha) # <<<<<<<<<<<<<< * cdef PetscScalar sval2 = asScalar(beta) * CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 966, __pyx_L1_error) __pyx_v_sval1 = __pyx_t_1; /* "PETSc/Vec.pyx":967 * def axpby(self, alpha, beta, Vec y): * cdef PetscScalar sval1 = asScalar(alpha) * cdef PetscScalar sval2 = asScalar(beta) # <<<<<<<<<<<<<< * CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_beta); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 967, __pyx_L1_error) __pyx_v_sval2 = __pyx_t_1; /* "PETSc/Vec.pyx":968 * cdef PetscScalar sval1 = asScalar(alpha) * cdef PetscScalar sval2 = asScalar(beta) * CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) ) # <<<<<<<<<<<<<< * * def waxpy(self, alpha, Vec x, Vec y): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPBY(__pyx_v_self->vec, __pyx_v_sval1, __pyx_v_sval2, __pyx_v_y->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 968, __pyx_L1_error) /* "PETSc/Vec.pyx":965 * CHKERR( VecAYPX(self.vec, sval, x.vec) ) * * def axpby(self, alpha, beta, Vec y): # <<<<<<<<<<<<<< * cdef PetscScalar sval1 = asScalar(alpha) * cdef PetscScalar sval2 = asScalar(beta) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.axpby", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":970 * CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) ) * * def waxpy(self, alpha, Vec x, Vec y): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_215waxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_214waxpy[] = "Vec.waxpy(self, alpha, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_215waxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("waxpy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, 1); __PYX_ERR(33, 970, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, 2); __PYX_ERR(33, 970, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "waxpy") < 0)) __PYX_ERR(33, 970, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_alpha = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 970, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.waxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 970, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(33, 970, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_214waxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214waxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("waxpy", 0); /* "PETSc/Vec.pyx":971 * * def waxpy(self, alpha, Vec x, Vec y): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 971, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Vec.pyx":972 * def waxpy(self, alpha, Vec x, Vec y): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def maxpy(self, alphas, vecs): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecWAXPY(__pyx_v_self->vec, __pyx_v_sval, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 972, __pyx_L1_error) /* "PETSc/Vec.pyx":970 * CHKERR( VecAXPBY(self.vec, sval1, sval2, y.vec) ) * * def waxpy(self, alpha, Vec x, Vec y): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.waxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":974 * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) * * def maxpy(self, alphas, vecs): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * cdef PetscScalar *a = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_217maxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_216maxpy[] = "Vec.maxpy(self, alphas, vecs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_217maxpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alphas = 0; PyObject *__pyx_v_vecs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maxpy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alphas,&__pyx_n_s_vecs,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alphas)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("maxpy", 1, 2, 2, 1); __PYX_ERR(33, 974, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maxpy") < 0)) __PYX_ERR(33, 974, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_alphas = values[0]; __pyx_v_vecs = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("maxpy", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 974, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_216maxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alphas, __pyx_v_vecs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216maxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alphas, PyObject *__pyx_v_vecs) { PetscInt __pyx_v_n; PetscScalar *__pyx_v_a; Vec *__pyx_v_v; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PetscInt __pyx_t_4; Vec __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("maxpy", 0); /* "PETSc/Vec.pyx":975 * * def maxpy(self, alphas, vecs): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *a = NULL * cdef PetscVec *v = NULL */ __pyx_v_n = 0; /* "PETSc/Vec.pyx":976 * def maxpy(self, alphas, vecs): * cdef PetscInt n = 0 * cdef PetscScalar *a = NULL # <<<<<<<<<<<<<< * cdef PetscVec *v = NULL * cdef object tmp1 = iarray_s(alphas, &n, &a) */ __pyx_v_a = NULL; /* "PETSc/Vec.pyx":977 * cdef PetscInt n = 0 * cdef PetscScalar *a = NULL * cdef PetscVec *v = NULL # <<<<<<<<<<<<<< * cdef object tmp1 = iarray_s(alphas, &n, &a) * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) */ __pyx_v_v = NULL; /* "PETSc/Vec.pyx":978 * cdef PetscScalar *a = NULL * cdef PetscVec *v = NULL * cdef object tmp1 = iarray_s(alphas, &n, &a) # <<<<<<<<<<<<<< * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) * assert n == len(vecs) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_alphas, (&__pyx_v_n), (&__pyx_v_a))); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_tmp1 = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":979 * cdef PetscVec *v = NULL * cdef object tmp1 = iarray_s(alphas, &n, &a) * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) # <<<<<<<<<<<<<< * assert n == len(vecs) * cdef Py_ssize_t i=0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_v)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp2 = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Vec.pyx":980 * cdef object tmp1 = iarray_s(alphas, &n, &a) * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) * assert n == len(vecs) # <<<<<<<<<<<<<< * cdef Py_ssize_t i=0 * for i from 0 <= i < n: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(33, 980, __pyx_L1_error) if (unlikely(!((__pyx_v_n == __pyx_t_3) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(33, 980, __pyx_L1_error) } } #endif /* "PETSc/Vec.pyx":981 * cdef object tmp2 = oarray_p(empty_p(n),NULL, &v) * assert n == len(vecs) * cdef Py_ssize_t i=0 # <<<<<<<<<<<<<< * for i from 0 <= i < n: * v[i] = ((vecs[i])).vec */ __pyx_v_i = 0; /* "PETSc/Vec.pyx":982 * assert n == len(vecs) * cdef Py_ssize_t i=0 * for i from 0 <= i < n: # <<<<<<<<<<<<<< * v[i] = ((vecs[i])).vec * CHKERR( VecMAXPY(self.vec, n, a, v) ) */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "PETSc/Vec.pyx":983 * cdef Py_ssize_t i=0 * for i from 0 <= i < n: * v[i] = ((vecs[i])).vec # <<<<<<<<<<<<<< * CHKERR( VecMAXPY(self.vec, n, a, v) ) * */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(33, 983, __pyx_L1_error) __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_2)->vec; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_v[__pyx_v_i]) = __pyx_t_5; } /* "PETSc/Vec.pyx":984 * for i from 0 <= i < n: * v[i] = ((vecs[i])).vec * CHKERR( VecMAXPY(self.vec, n, a, v) ) # <<<<<<<<<<<<<< * * def pointwiseMult(self, Vec x, Vec y): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMAXPY(__pyx_v_self->vec, __pyx_v_n, __pyx_v_a, __pyx_v_v)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(33, 984, __pyx_L1_error) /* "PETSc/Vec.pyx":974 * CHKERR( VecWAXPY(self.vec, sval, x.vec, y.vec) ) * * def maxpy(self, alphas, vecs): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * cdef PetscScalar *a = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":986 * CHKERR( VecMAXPY(self.vec, n, a, v) ) * * def pointwiseMult(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_219pointwiseMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_218pointwiseMult[] = "Vec.pointwiseMult(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_219pointwiseMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMult (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pointwiseMult", 1, 2, 2, 1); __PYX_ERR(33, 986, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMult") < 0)) __PYX_ERR(33, 986, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMult", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 986, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 986, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(33, 986, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_218pointwiseMult(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218pointwiseMult(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMult", 0); /* "PETSc/Vec.pyx":987 * * def pointwiseMult(self, Vec x, Vec y): * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseDivide(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMult(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 987, __pyx_L1_error) /* "PETSc/Vec.pyx":986 * CHKERR( VecMAXPY(self.vec, n, a, v) ) * * def pointwiseMult(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":989 * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) * * def pointwiseDivide(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_221pointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_220pointwiseDivide[] = "Vec.pointwiseDivide(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_221pointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseDivide (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pointwiseDivide", 1, 2, 2, 1); __PYX_ERR(33, 989, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseDivide") < 0)) __PYX_ERR(33, 989, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseDivide", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 989, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 989, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(33, 989, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_220pointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220pointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseDivide", 0); /* "PETSc/Vec.pyx":990 * * def pointwiseDivide(self, Vec x, Vec y): * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseMin(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseDivide(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 990, __pyx_L1_error) /* "PETSc/Vec.pyx":989 * CHKERR( VecPointwiseMult(self.vec, x.vec, y.vec) ) * * def pointwiseDivide(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":992 * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) * * def pointwiseMin(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223pointwiseMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_222pointwiseMin[] = "Vec.pointwiseMin(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223pointwiseMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pointwiseMin", 1, 2, 2, 1); __PYX_ERR(33, 992, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMin") < 0)) __PYX_ERR(33, 992, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 992, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 992, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(33, 992, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_222pointwiseMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222pointwiseMin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMin", 0); /* "PETSc/Vec.pyx":993 * * def pointwiseMin(self, Vec x, Vec y): * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseMax(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMin(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 993, __pyx_L1_error) /* "PETSc/Vec.pyx":992 * CHKERR( VecPointwiseDivide(self.vec, x.vec, y.vec) ) * * def pointwiseMin(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":995 * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) * * def pointwiseMax(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_225pointwiseMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_224pointwiseMax[] = "Vec.pointwiseMax(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_225pointwiseMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMax (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pointwiseMax", 1, 2, 2, 1); __PYX_ERR(33, 995, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMax") < 0)) __PYX_ERR(33, 995, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMax", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 995, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 995, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(33, 995, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_224pointwiseMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224pointwiseMax(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMax", 0); /* "PETSc/Vec.pyx":996 * * def pointwiseMax(self, Vec x, Vec y): * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def pointwiseMaxAbs(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMax(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 996, __pyx_L1_error) /* "PETSc/Vec.pyx":995 * CHKERR( VecPointwiseMin(self.vec, x.vec, y.vec) ) * * def pointwiseMax(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":998 * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) * * def pointwiseMaxAbs(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_227pointwiseMaxAbs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_226pointwiseMaxAbs[] = "Vec.pointwiseMaxAbs(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_227pointwiseMaxAbs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pointwiseMaxAbs (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pointwiseMaxAbs", 1, 2, 2, 1); __PYX_ERR(33, 998, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pointwiseMaxAbs") < 0)) __PYX_ERR(33, 998, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pointwiseMaxAbs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 998, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMaxAbs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(33, 998, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(33, 998, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_226pointwiseMaxAbs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226pointwiseMaxAbs(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointwiseMaxAbs", 0); /* "PETSc/Vec.pyx":999 * * def pointwiseMaxAbs(self, Vec x, Vec y): * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def maxPointwiseDivide(self, Vec vec): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecPointwiseMaxAbs(__pyx_v_self->vec, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 999, __pyx_L1_error) /* "PETSc/Vec.pyx":998 * CHKERR( VecPointwiseMax(self.vec, x.vec, y.vec) ) * * def pointwiseMaxAbs(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.pointwiseMaxAbs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1001 * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) * * def maxPointwiseDivide(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_229maxPointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_228maxPointwiseDivide[] = "Vec.maxPointwiseDivide(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_229maxPointwiseDivide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("maxPointwiseDivide (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maxPointwiseDivide") < 0)) __PYX_ERR(33, 1001, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("maxPointwiseDivide", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1001, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxPointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 1001, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_228maxPointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228maxPointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("maxPointwiseDivide", 0); /* "PETSc/Vec.pyx":1002 * * def maxPointwiseDivide(self, Vec vec): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/Vec.pyx":1003 * def maxPointwiseDivide(self, Vec vec): * cdef PetscReal rval = 0 * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMaxPointwiseDivide(__pyx_v_self->vec, __pyx_v_vec->vec, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1003, __pyx_L1_error) /* "PETSc/Vec.pyx":1004 * cdef PetscReal rval = 0 * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getValue(self, index): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1004, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1001 * CHKERR( VecPointwiseMaxAbs(self.vec, x.vec, y.vec) ) * * def maxPointwiseDivide(self, Vec vec): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecMaxPointwiseDivide(self.vec, vec.vec, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.maxPointwiseDivide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1006 * return toReal(rval) * * def getValue(self, index): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_231getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_230getValue[] = "Vec.getValue(self, index)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_231getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValue") < 0)) __PYX_ERR(33, 1006, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValue", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1006, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_230getValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_230getValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 0); /* "PETSc/Vec.pyx":1007 * * def getValue(self, index): * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1007, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1008 * def getValue(self, index): * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":1009 * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = 0 * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetValues(__pyx_v_self->vec, 1, (&__pyx_v_ival), (&__pyx_v_sval))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 1009, __pyx_L1_error) /* "PETSc/Vec.pyx":1010 * cdef PetscScalar sval = 0 * CHKERR( VecGetValues(self.vec, 1, &ival, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def getValues(self, indices, values=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 1010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1006 * return toReal(rval) * * def getValue(self, index): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1012 * return toScalar(sval) * * def getValues(self, indices, values=None): # <<<<<<<<<<<<<< * return vecgetvalues(self.vec, indices, values) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_233getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_232getValues[] = "Vec.getValues(self, indices, values=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_233getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValues (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValues") < 0)) __PYX_ERR(33, 1012, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValues", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1012, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_232getValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232getValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValues", 0); /* "PETSc/Vec.pyx":1013 * * def getValues(self, indices, values=None): * return vecgetvalues(self.vec, indices, values) # <<<<<<<<<<<<<< * * def getValuesStagStencil(self, indices, values=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecgetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1012 * return toScalar(sval) * * def getValues(self, indices, values=None): # <<<<<<<<<<<<<< * return vecgetvalues(self.vec, indices, values) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1015 * return vecgetvalues(self.vec, indices, values) * * def getValuesStagStencil(self, indices, values=None): # <<<<<<<<<<<<<< * raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_235getValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_234getValuesStagStencil[] = "Vec.getValuesStagStencil(self, indices, values=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_235getValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_indices = 0; CYTHON_UNUSED PyObject *__pyx_v_values = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValuesStagStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValuesStagStencil") < 0)) __PYX_ERR(33, 1015, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValuesStagStencil", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1015, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_234getValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234getValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValuesStagStencil", 0); /* "PETSc/Vec.pyx":1016 * * def getValuesStagStencil(self, indices, values=None): * raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def setValue(self, index, value, addv=None): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 1016, __pyx_L1_error) /* "PETSc/Vec.pyx":1015 * return vecgetvalues(self.vec, indices, values) * * def getValuesStagStencil(self, indices, values=None): # <<<<<<<<<<<<<< * raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1018 * raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') * * def setValue(self, index, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_237setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_236setValue[] = "Vec.setValue(self, index, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_237setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValue", 0, 2, 3, 1); __PYX_ERR(33, 1018, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValue") < 0)) __PYX_ERR(33, 1018, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_index = values[0]; __pyx_v_value = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValue", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1018, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_236setValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_236setValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValue", 0); /* "PETSc/Vec.pyx":1019 * * def setValue(self, index, value, addv=None): * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1019, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1020 * def setValue(self, index, value, addv=None): * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 1020, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "PETSc/Vec.pyx":1021 * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(33, 1021, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "PETSc/Vec.pyx":1022 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) # <<<<<<<<<<<<<< * * def setValues(self, indices, values, addv=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetValues(__pyx_v_self->vec, 1, (&__pyx_v_ival), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 1022, __pyx_L1_error) /* "PETSc/Vec.pyx":1018 * raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') * * def setValue(self, index, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1024 * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) * * def setValues(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 0, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_239setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_238setValues[] = "Vec.setValues(self, indices, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_239setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValues (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValues", 0, 2, 3, 1); __PYX_ERR(33, 1024, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValues") < 0)) __PYX_ERR(33, 1024, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValues", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1024, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_238setValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238setValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValues", 0); /* "PETSc/Vec.pyx":1025 * * def setValues(self, indices, values, addv=None): * vecsetvalues(self.vec, indices, values, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesBlocked(self, indices, values, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1025, __pyx_L1_error) /* "PETSc/Vec.pyx":1024 * CHKERR( VecSetValues(self.vec, 1, &ival, &sval, caddv) ) * * def setValues(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 0, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1027 * vecsetvalues(self.vec, indices, values, addv, 0, 0) * * def setValuesBlocked(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 1, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_241setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_240setValuesBlocked[] = "Vec.setValuesBlocked(self, indices, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_241setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlocked (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 2, 3, 1); __PYX_ERR(33, 1027, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlocked") < 0)) __PYX_ERR(33, 1027, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1027, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_240setValuesBlocked(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240setValuesBlocked(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlocked", 0); /* "PETSc/Vec.pyx":1028 * * def setValuesBlocked(self, indices, values, addv=None): * vecsetvalues(self.vec, indices, values, addv, 1, 0) # <<<<<<<<<<<<<< * * def setValuesStagStencil(self, indices, values, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1028, __pyx_L1_error) /* "PETSc/Vec.pyx":1027 * vecsetvalues(self.vec, indices, values, addv, 0, 0) * * def setValuesBlocked(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 1, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1030 * vecsetvalues(self.vec, indices, values, addv, 1, 0) * * def setValuesStagStencil(self, indices, values, addv=None): # <<<<<<<<<<<<<< * raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_243setValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_242setValuesStagStencil[] = "Vec.setValuesStagStencil(self, indices, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_243setValuesStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_indices = 0; CYTHON_UNUSED PyObject *__pyx_v_values = 0; CYTHON_UNUSED PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesStagStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesStagStencil", 0, 2, 3, 1); __PYX_ERR(33, 1030, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesStagStencil") < 0)) __PYX_ERR(33, 1030, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesStagStencil", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1030, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_242setValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242setValuesStagStencil(CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_indices, CYTHON_UNUSED PyObject *__pyx_v_values, CYTHON_UNUSED PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesStagStencil", 0); /* "PETSc/Vec.pyx":1031 * * def setValuesStagStencil(self, indices, values, addv=None): * raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def setLGMap(self, LGMap lgmap): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(33, 1031, __pyx_L1_error) /* "PETSc/Vec.pyx":1030 * vecsetvalues(self.vec, indices, values, addv, 1, 0) * * def setValuesStagStencil(self, indices, values, addv=None): # <<<<<<<<<<<<<< * raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1033 * raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') * * def setLGMap(self, LGMap lgmap): # <<<<<<<<<<<<<< * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_245setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_244setLGMap[] = "Vec.setLGMap(self, LGMap lgmap)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_245setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscLGMapObject *__pyx_v_lgmap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLGMap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lgmap,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lgmap)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLGMap") < 0)) __PYX_ERR(33, 1033, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_lgmap = ((struct PyPetscLGMapObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLGMap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1033, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "lgmap", 0))) __PYX_ERR(33, 1033, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_244setLGMap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lgmap); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_244setLGMap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_lgmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLGMap", 0); /* "PETSc/Vec.pyx":1034 * * def setLGMap(self, LGMap lgmap): * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) # <<<<<<<<<<<<<< * * def getLGMap(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetLocalToGlobalMapping(__pyx_v_self->vec, __pyx_v_lgmap->lgm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1034, __pyx_L1_error) /* "PETSc/Vec.pyx":1033 * raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') * * def setLGMap(self, LGMap lgmap): # <<<<<<<<<<<<<< * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1036 * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) * * def getLGMap(self): # <<<<<<<<<<<<<< * cdef LGMap cmap = LGMap() * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_247getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_246getLGMap[] = "Vec.getLGMap(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_247getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMap (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_246getLGMap(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246getLGMap(struct PyPetscVecObject *__pyx_v_self) { struct PyPetscLGMapObject *__pyx_v_cmap = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMap", 0); /* "PETSc/Vec.pyx":1037 * * def getLGMap(self): * cdef LGMap cmap = LGMap() # <<<<<<<<<<<<<< * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) * PetscINCREF(cmap.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":1038 * def getLGMap(self): * cdef LGMap cmap = LGMap() * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) # <<<<<<<<<<<<<< * PetscINCREF(cmap.obj) * return cmap */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalToGlobalMapping(__pyx_v_self->vec, (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 1038, __pyx_L1_error) /* "PETSc/Vec.pyx":1039 * cdef LGMap cmap = LGMap() * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) * PetscINCREF(cmap.obj) # <<<<<<<<<<<<<< * return cmap * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj)); /* "PETSc/Vec.pyx":1040 * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) * PetscINCREF(cmap.obj) * return cmap # <<<<<<<<<<<<<< * * def setValueLocal(self, index, value, addv=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_cmap)); __pyx_r = ((PyObject *)__pyx_v_cmap); goto __pyx_L0; /* "PETSc/Vec.pyx":1036 * CHKERR( VecSetLocalToGlobalMapping(self.vec, lgmap.lgm) ) * * def getLGMap(self): # <<<<<<<<<<<<<< * cdef LGMap cmap = LGMap() * CHKERR( VecGetLocalToGlobalMapping(self.vec, &cmap.lgm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cmap); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1042 * return cmap * * def setValueLocal(self, index, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_249setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_248setValueLocal[] = "Vec.setValueLocal(self, index, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_249setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 2, 3, 1); __PYX_ERR(33, 1042, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueLocal") < 0)) __PYX_ERR(33, 1042, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_index = values[0]; __pyx_v_value = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1042, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_248setValueLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_248setValueLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueLocal", 0); /* "PETSc/Vec.pyx":1043 * * def setValueLocal(self, index, value, addv=None): * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1043, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1044 * def setValueLocal(self, index, value, addv=None): * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 1044, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "PETSc/Vec.pyx":1045 * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(33, 1045, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "PETSc/Vec.pyx":1046 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) # <<<<<<<<<<<<<< * * def setValuesLocal(self, indices, values, addv=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetValuesLocal(__pyx_v_self->vec, 1, (&__pyx_v_ival), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 1046, __pyx_L1_error) /* "PETSc/Vec.pyx":1042 * return cmap * * def setValueLocal(self, index, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef PetscScalar sval = asScalar(value) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1048 * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) * * def setValuesLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 0, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_251setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_250setValuesLocal[] = "Vec.setValuesLocal(self, indices, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_251setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 2, 3, 1); __PYX_ERR(33, 1048, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocal") < 0)) __PYX_ERR(33, 1048, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1048, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_250setValuesLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_250setValuesLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocal", 0); /* "PETSc/Vec.pyx":1049 * * def setValuesLocal(self, indices, values, addv=None): * vecsetvalues(self.vec, indices, values, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocal(self, indices, values, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1049, __pyx_L1_error) /* "PETSc/Vec.pyx":1048 * CHKERR( VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv) ) * * def setValuesLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 0, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1051 * vecsetvalues(self.vec, indices, values, addv, 0, 1) * * def setValuesBlockedLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 1, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_253setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_252setValuesBlockedLocal[] = "Vec.setValuesBlockedLocal(self, indices, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_253setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 2, 3, 1); __PYX_ERR(33, 1051, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocal") < 0)) __PYX_ERR(33, 1051, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_indices = values[0]; __pyx_v_values = values[1]; __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1051, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_252setValuesBlockedLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252setValuesBlockedLocal(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocal", 0); /* "PETSc/Vec.pyx":1052 * * def setValuesBlockedLocal(self, indices, values, addv=None): * vecsetvalues(self.vec, indices, values, addv, 1, 1) # <<<<<<<<<<<<<< * * def assemblyBegin(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_vecsetvalues(__pyx_v_self->vec, __pyx_v_indices, __pyx_v_values, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1052, __pyx_L1_error) /* "PETSc/Vec.pyx":1051 * vecsetvalues(self.vec, indices, values, addv, 0, 1) * * def setValuesBlockedLocal(self, indices, values, addv=None): # <<<<<<<<<<<<<< * vecsetvalues(self.vec, indices, values, addv, 1, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1054 * vecsetvalues(self.vec, indices, values, addv, 1, 1) * * def assemblyBegin(self): # <<<<<<<<<<<<<< * CHKERR( VecAssemblyBegin(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_255assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_254assemblyBegin[] = "Vec.assemblyBegin(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_255assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyBegin (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("assemblyBegin", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemblyBegin", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_254assemblyBegin(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254assemblyBegin(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyBegin", 0); /* "PETSc/Vec.pyx":1055 * * def assemblyBegin(self): * CHKERR( VecAssemblyBegin(self.vec) ) # <<<<<<<<<<<<<< * * def assemblyEnd(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyBegin(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1055, __pyx_L1_error) /* "PETSc/Vec.pyx":1054 * vecsetvalues(self.vec, indices, values, addv, 1, 1) * * def assemblyBegin(self): # <<<<<<<<<<<<<< * CHKERR( VecAssemblyBegin(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.assemblyBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1057 * CHKERR( VecAssemblyBegin(self.vec) ) * * def assemblyEnd(self): # <<<<<<<<<<<<<< * CHKERR( VecAssemblyEnd(self.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_257assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_256assemblyEnd[] = "Vec.assemblyEnd(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_257assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyEnd (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("assemblyEnd", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemblyEnd", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_256assemblyEnd(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_256assemblyEnd(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyEnd", 0); /* "PETSc/Vec.pyx":1058 * * def assemblyEnd(self): * CHKERR( VecAssemblyEnd(self.vec) ) # <<<<<<<<<<<<<< * * def assemble(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyEnd(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1058, __pyx_L1_error) /* "PETSc/Vec.pyx":1057 * CHKERR( VecAssemblyBegin(self.vec) ) * * def assemblyEnd(self): # <<<<<<<<<<<<<< * CHKERR( VecAssemblyEnd(self.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.assemblyEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1060 * CHKERR( VecAssemblyEnd(self.vec) ) * * def assemble(self): # <<<<<<<<<<<<<< * CHKERR( VecAssemblyBegin(self.vec) ) * CHKERR( VecAssemblyEnd(self.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_259assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_258assemble[] = "Vec.assemble(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_259assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemble (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("assemble", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "assemble", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_258assemble(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_258assemble(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemble", 0); /* "PETSc/Vec.pyx":1061 * * def assemble(self): * CHKERR( VecAssemblyBegin(self.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecAssemblyEnd(self.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyBegin(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1061, __pyx_L1_error) /* "PETSc/Vec.pyx":1062 * def assemble(self): * CHKERR( VecAssemblyBegin(self.vec) ) * CHKERR( VecAssemblyEnd(self.vec) ) # <<<<<<<<<<<<<< * * # --- methods for strided vectors --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAssemblyEnd(__pyx_v_self->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1062, __pyx_L1_error) /* "PETSc/Vec.pyx":1060 * CHKERR( VecAssemblyEnd(self.vec) ) * * def assemble(self): # <<<<<<<<<<<<<< * CHKERR( VecAssemblyBegin(self.vec) ) * CHKERR( VecAssemblyEnd(self.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1066 * # --- methods for strided vectors --- * * def strideScale(self, field, alpha): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = asScalar(alpha) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_261strideScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_260strideScale[] = "Vec.strideScale(self, field, alpha)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_261strideScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_alpha = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideScale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_alpha,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("strideScale", 1, 2, 2, 1); __PYX_ERR(33, 1066, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideScale") < 0)) __PYX_ERR(33, 1066, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_alpha = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideScale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1066, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_260strideScale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_260strideScale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_alpha) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideScale", 0); /* "PETSc/Vec.pyx":1067 * * def strideScale(self, field, alpha): * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecStrideScale(self.vec, ival, sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1067, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1068 * def strideScale(self, field, alpha): * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( VecStrideScale(self.vec, ival, sval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(33, 1068, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "PETSc/Vec.pyx":1069 * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = asScalar(alpha) * CHKERR( VecStrideScale(self.vec, ival, sval) ) # <<<<<<<<<<<<<< * * def strideSum(self, field): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideScale(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_sval)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 1069, __pyx_L1_error) /* "PETSc/Vec.pyx":1066 * # --- methods for strided vectors --- * * def strideScale(self, field, alpha): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = asScalar(alpha) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1071 * CHKERR( VecStrideScale(self.vec, ival, sval) ) * * def strideSum(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_263strideSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_262strideSum[] = "Vec.strideSum(self, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_263strideSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideSum (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideSum") < 0)) __PYX_ERR(33, 1071, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideSum", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1071, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_262strideSum(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_262strideSum(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideSum", 0); /* "PETSc/Vec.pyx":1072 * * def strideSum(self, field): * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( VecStrideSum(self.vec, ival, &sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1072, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1073 * def strideSum(self, field): * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( VecStrideSum(self.vec, ival, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Vec.pyx":1074 * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = 0 * CHKERR( VecStrideSum(self.vec, ival, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideSum(__pyx_v_self->vec, __pyx_v_ival, (&__pyx_v_sval))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 1074, __pyx_L1_error) /* "PETSc/Vec.pyx":1075 * cdef PetscScalar sval = 0 * CHKERR( VecStrideSum(self.vec, ival, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def strideMin(self, field): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1071 * CHKERR( VecStrideScale(self.vec, ival, sval) ) * * def strideSum(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscScalar sval = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1077 * return toScalar(sval) * * def strideMin(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_265strideMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_264strideMin[] = "Vec.strideMin(self, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_265strideMin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideMin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideMin") < 0)) __PYX_ERR(33, 1077, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideMin", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1077, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_264strideMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_264strideMin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideMin", 0); /* "PETSc/Vec.pyx":1078 * * def strideMin(self, field): * cdef PetscInt ival1 = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1078, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "PETSc/Vec.pyx":1079 * def strideMin(self, field): * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) */ __pyx_v_ival2 = 0; /* "PETSc/Vec.pyx":1080 * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) */ __pyx_v_rval = 0.0; /* "PETSc/Vec.pyx":1081 * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival2), toReal(rval)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideMin(__pyx_v_self->vec, __pyx_v_ival1, (&__pyx_v_ival2), (&__pyx_v_rval))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 1081, __pyx_L1_error) /* "PETSc/Vec.pyx":1082 * cdef PetscReal rval = 0 * CHKERR( VecStrideMin(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) # <<<<<<<<<<<<<< * * def strideMax(self, field): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1077 * return toScalar(sval) * * def strideMin(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1084 * return (toInt(ival2), toReal(rval)) * * def strideMax(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267strideMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_266strideMax[] = "Vec.strideMax(self, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267strideMax(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideMax (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideMax") < 0)) __PYX_ERR(33, 1084, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideMax", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1084, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_266strideMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266strideMax(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideMax", 0); /* "PETSc/Vec.pyx":1085 * * def strideMax(self, field): * cdef PetscInt ival1 = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1085, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "PETSc/Vec.pyx":1086 * def strideMax(self, field): * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) */ __pyx_v_ival2 = 0; /* "PETSc/Vec.pyx":1087 * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) */ __pyx_v_rval = 0.0; /* "PETSc/Vec.pyx":1088 * cdef PetscInt ival2 = 0 * cdef PetscReal rval = 0 * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) # <<<<<<<<<<<<<< * return (toInt(ival2), toReal(rval)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideMax(__pyx_v_self->vec, __pyx_v_ival1, (&__pyx_v_ival2), (&__pyx_v_rval))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 1088, __pyx_L1_error) /* "PETSc/Vec.pyx":1089 * cdef PetscReal rval = 0 * CHKERR( VecStrideMax(self.vec, ival1, &ival2, &rval) ) * return (toInt(ival2), toReal(rval)) # <<<<<<<<<<<<<< * * def strideNorm(self, field, norm_type=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1084 * return (toInt(ival2), toReal(rval)) * * def strideMax(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(field) * cdef PetscInt ival2 = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideMax", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1091 * return (toInt(ival2), toReal(rval)) * * def strideNorm(self, field, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_269strideNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_268strideNorm[] = "Vec.strideNorm(self, field, norm_type=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_269strideNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_norm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideNorm (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_norm_type,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideNorm") < 0)) __PYX_ERR(33, 1091, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; __pyx_v_norm_type = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideNorm", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1091, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_268strideNorm(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_norm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268strideNorm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_norm_type) { PetscInt __pyx_v_ival; NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; NormType __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideNorm", 0); /* "PETSc/Vec.pyx":1092 * * def strideNorm(self, field, norm_type=None): * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1092, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1093 * def strideNorm(self, field, norm_type=None): * cdef PetscInt ival = asInt(field) * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "PETSc/Vec.pyx":1094 * cdef PetscInt ival = asInt(field) * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_2; /* "PETSc/Vec.pyx":1095 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_2 * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) */ __pyx_t_2 = (__pyx_v_norm_type != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(33, 1095, __pyx_L1_error) __pyx_v_ntype = __pyx_t_4; } /* "PETSc/Vec.pyx":1097 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideNorm(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(33, 1097, __pyx_L1_error) /* "PETSc/Vec.pyx":1098 * cdef PetscReal rval[2] * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_3 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0); if (__pyx_t_3) { __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 1098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":1099 * CHKERR( VecStrideNorm(self.vec, ival, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def strideScatter(self, field, Vec vec, addv=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(33, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } /* "PETSc/Vec.pyx":1091 * return (toInt(ival2), toReal(rval)) * * def strideNorm(self, field, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1101 * else: return (toReal(rval[0]), toReal(rval[1])) * * def strideScatter(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271strideScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_270strideScatter[] = "Vec.strideScatter(self, field, Vec vec, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271strideScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideScatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_vec,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("strideScatter", 0, 2, 3, 1); __PYX_ERR(33, 1101, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideScatter") < 0)) __PYX_ERR(33, 1101, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideScatter", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1101, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 1101, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_270strideScatter(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_270strideScatter(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; InsertMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideScatter", 0); /* "PETSc/Vec.pyx":1102 * * def strideScatter(self, field, Vec vec, addv=None): * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1102, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1103 * def strideScatter(self, field, Vec vec, addv=None): * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(33, 1103, __pyx_L1_error) __pyx_v_caddv = __pyx_t_2; /* "PETSc/Vec.pyx":1104 * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) # <<<<<<<<<<<<<< * * def strideGather(self, field, Vec vec, addv=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideScatter(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_vec->vec, __pyx_v_caddv)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 1104, __pyx_L1_error) /* "PETSc/Vec.pyx":1101 * else: return (toReal(rval[0]), toReal(rval[1])) * * def strideScatter(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1106 * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) * * def strideGather(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273strideGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_272strideGather[] = "Vec.strideGather(self, field, Vec vec, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273strideGather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("strideGather (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_vec,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("strideGather", 0, 2, 3, 1); __PYX_ERR(33, 1106, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strideGather") < 0)) __PYX_ERR(33, 1106, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = values[0]; __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("strideGather", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1106, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideGather", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(33, 1106, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_272strideGather(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_272strideGather(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; InsertMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("strideGather", 0); /* "PETSc/Vec.pyx":1107 * * def strideGather(self, field, Vec vec, addv=None): * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideGather(self.vec, ival, vec.vec, caddv) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(33, 1107, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Vec.pyx":1108 * def strideGather(self, field, Vec vec, addv=None): * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( VecStrideGather(self.vec, ival, vec.vec, caddv) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(33, 1108, __pyx_L1_error) __pyx_v_caddv = __pyx_t_2; /* "PETSc/Vec.pyx":1109 * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( VecStrideGather(self.vec, ival, vec.vec, caddv) ) # <<<<<<<<<<<<<< * * # --- methods for vectors with ghost values --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecStrideGather(__pyx_v_self->vec, __pyx_v_ival, __pyx_v_vec->vec, __pyx_v_caddv)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 1109, __pyx_L1_error) /* "PETSc/Vec.pyx":1106 * CHKERR( VecStrideScatter(self.vec, ival, vec.vec, caddv) ) * * def strideGather(self, field, Vec vec, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef PetscInsertMode caddv = insertmode(addv) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.strideGather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1113 * # --- methods for vectors with ghost values --- * * def localForm(self): # <<<<<<<<<<<<<< * """ * Intended for use in context manager:: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275localForm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_274localForm[] = "Vec.localForm(self)\n\n Intended for use in context manager::\n\n with vec.localForm() as lf:\n use(lf)\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275localForm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localForm (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("localForm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "localForm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_274localForm(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_274localForm(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localForm", 0); /* "PETSc/Vec.pyx":1120 * use(lf) * """ * return _Vec_LocalForm(self) # <<<<<<<<<<<<<< * * def ghostUpdateBegin(self, addv=None, mode=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1113 * # --- methods for vectors with ghost values --- * * def localForm(self): # <<<<<<<<<<<<<< * """ * Intended for use in context manager:: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.localForm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1122 * return _Vec_LocalForm(self) * * def ghostUpdateBegin(self, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_277ghostUpdateBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_276ghostUpdateBegin[] = "Vec.ghostUpdateBegin(self, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_277ghostUpdateBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ghostUpdateBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ghostUpdateBegin") < 0)) __PYX_ERR(33, 1122, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_addv = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ghostUpdateBegin", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1122, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_276ghostUpdateBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_276ghostUpdateBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ghostUpdateBegin", 0); /* "PETSc/Vec.pyx":1123 * * def ghostUpdateBegin(self, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(33, 1123, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Vec.pyx":1124 * def ghostUpdateBegin(self, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(33, 1124, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Vec.pyx":1125 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * * def ghostUpdateEnd(self, addv=None, mode=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateBegin(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 1125, __pyx_L1_error) /* "PETSc/Vec.pyx":1122 * return _Vec_LocalForm(self) * * def ghostUpdateBegin(self, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1127 * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * * def ghostUpdateEnd(self, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279ghostUpdateEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_278ghostUpdateEnd[] = "Vec.ghostUpdateEnd(self, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279ghostUpdateEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ghostUpdateEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ghostUpdateEnd") < 0)) __PYX_ERR(33, 1127, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_addv = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ghostUpdateEnd", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1127, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_278ghostUpdateEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_278ghostUpdateEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ghostUpdateEnd", 0); /* "PETSc/Vec.pyx":1128 * * def ghostUpdateEnd(self, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(33, 1128, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Vec.pyx":1129 * def ghostUpdateEnd(self, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(33, 1129, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Vec.pyx":1130 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * * def ghostUpdate(self, addv=None, mode=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateEnd(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 1130, __pyx_L1_error) /* "PETSc/Vec.pyx":1127 * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * * def ghostUpdateEnd(self, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdateEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1132 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def ghostUpdate(self, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_281ghostUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_280ghostUpdate[] = "Vec.ghostUpdate(self, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_281ghostUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("ghostUpdate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ghostUpdate") < 0)) __PYX_ERR(33, 1132, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_addv = values[0]; __pyx_v_mode = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("ghostUpdate", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1132, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_280ghostUpdate(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280ghostUpdate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ghostUpdate", 0); /* "PETSc/Vec.pyx":1133 * * def ghostUpdate(self, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(33, 1133, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Vec.pyx":1134 * def ghostUpdate(self, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(33, 1134, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Vec.pyx":1135 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateBegin(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 1135, __pyx_L1_error) /* "PETSc/Vec.pyx":1136 * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecGhostUpdateBegin(self.vec, caddv, csctm) ) * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) # <<<<<<<<<<<<<< * * def setMPIGhost(self, ghosts): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostUpdateEnd(__pyx_v_self->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(33, 1136, __pyx_L1_error) /* "PETSc/Vec.pyx":1132 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def ghostUpdate(self, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.ghostUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1138 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def setMPIGhost(self, ghosts): # <<<<<<<<<<<<<< * "Alternative to createGhost()" * cdef PetscInt ng=0, *ig=NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283setMPIGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_282setMPIGhost[] = "Vec.setMPIGhost(self, ghosts)\nAlternative to createGhost()"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283setMPIGhost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ghosts = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMPIGhost (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ghosts,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghosts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMPIGhost") < 0)) __PYX_ERR(33, 1138, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ghosts = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMPIGhost", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1138, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setMPIGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_282setMPIGhost(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282setMPIGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts) { PetscInt __pyx_v_ng; PetscInt *__pyx_v_ig; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMPIGhost", 0); __Pyx_INCREF(__pyx_v_ghosts); /* "PETSc/Vec.pyx":1140 * def setMPIGhost(self, ghosts): * "Alternative to createGhost()" * cdef PetscInt ng=0, *ig=NULL # <<<<<<<<<<<<<< * ghosts = iarray_i(ghosts, &ng, &ig) * CHKERR( VecMPISetGhost(self.vec, ng, ig) ) */ __pyx_v_ng = 0; __pyx_v_ig = NULL; /* "PETSc/Vec.pyx":1141 * "Alternative to createGhost()" * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) # <<<<<<<<<<<<<< * CHKERR( VecMPISetGhost(self.vec, ng, ig) ) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghosts, (&__pyx_v_ng), (&__pyx_v_ig))); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ghosts, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":1142 * cdef PetscInt ng=0, *ig=NULL * ghosts = iarray_i(ghosts, &ng, &ig) * CHKERR( VecMPISetGhost(self.vec, ng, ig) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMPISetGhost(__pyx_v_self->vec, __pyx_v_ng, __pyx_v_ig)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(33, 1142, __pyx_L1_error) /* "PETSc/Vec.pyx":1138 * CHKERR( VecGhostUpdateEnd(self.vec, caddv, csctm) ) * * def setMPIGhost(self, ghosts): # <<<<<<<<<<<<<< * "Alternative to createGhost()" * cdef PetscInt ng=0, *ig=NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setMPIGhost", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ghosts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1146 * # * * def getSubVector(self, IS iset, Vec subvec=None): # <<<<<<<<<<<<<< * if subvec is None: subvec = Vec() * else: CHKERR( VecDestroy(&subvec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285getSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_284getSubVector[] = "Vec.getSubVector(self, IS iset, Vec subvec=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285getSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; struct PyPetscVecObject *__pyx_v_subvec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSubVector (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_subvec,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subvec); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSubVector") < 0)) __PYX_ERR(33, 1146, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_subvec = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSubVector", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1146, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(33, 1146, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "subvec", 0))) __PYX_ERR(33, 1146, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_284getSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_284getSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSubVector", 0); __Pyx_INCREF((PyObject *)__pyx_v_subvec); /* "PETSc/Vec.pyx":1147 * * def getSubVector(self, IS iset, Vec subvec=None): * if subvec is None: subvec = Vec() # <<<<<<<<<<<<<< * else: CHKERR( VecDestroy(&subvec.vec) ) * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_subvec) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_subvec, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; goto __pyx_L3; } /* "PETSc/Vec.pyx":1148 * def getSubVector(self, IS iset, Vec subvec=None): * if subvec is None: subvec = Vec() * else: CHKERR( VecDestroy(&subvec.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) * return subvec */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 1148, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Vec.pyx":1149 * if subvec is None: subvec = Vec() * else: CHKERR( VecDestroy(&subvec.vec) ) * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) # <<<<<<<<<<<<<< * return subvec * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSubVector(__pyx_v_self->vec, __pyx_v_iset->iset, (&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(33, 1149, __pyx_L1_error) /* "PETSc/Vec.pyx":1150 * else: CHKERR( VecDestroy(&subvec.vec) ) * CHKERR( VecGetSubVector(self.vec, iset.iset, &subvec.vec) ) * return subvec # <<<<<<<<<<<<<< * * def restoreSubVector(self, IS iset, Vec subvec): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_subvec)); __pyx_r = ((PyObject *)__pyx_v_subvec); goto __pyx_L0; /* "PETSc/Vec.pyx":1146 * # * * def getSubVector(self, IS iset, Vec subvec=None): # <<<<<<<<<<<<<< * if subvec is None: subvec = Vec() * else: CHKERR( VecDestroy(&subvec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subvec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1152 * return subvec * * def restoreSubVector(self, IS iset, Vec subvec): # <<<<<<<<<<<<<< * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287restoreSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_286restoreSubVector[] = "Vec.restoreSubVector(self, IS iset, Vec subvec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287restoreSubVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; struct PyPetscVecObject *__pyx_v_subvec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreSubVector (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_subvec,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subvec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("restoreSubVector", 1, 2, 2, 1); __PYX_ERR(33, 1152, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreSubVector") < 0)) __PYX_ERR(33, 1152, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_subvec = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreSubVector", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1152, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(33, 1152, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "subvec", 0))) __PYX_ERR(33, 1152, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_286restoreSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_286restoreSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreSubVector", 0); /* "PETSc/Vec.pyx":1153 * * def restoreSubVector(self, IS iset, Vec subvec): * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) # <<<<<<<<<<<<<< * * def getNestSubVecs(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreSubVector(__pyx_v_self->vec, __pyx_v_iset->iset, (&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1153, __pyx_L1_error) /* "PETSc/Vec.pyx":1152 * return subvec * * def restoreSubVector(self, IS iset, Vec subvec): # <<<<<<<<<<<<<< * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.restoreSubVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1155 * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) * * def getNestSubVecs(self): # <<<<<<<<<<<<<< * cdef PetscInt N=0 * cdef PetscVec* sx=NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_289getNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_288getNestSubVecs[] = "Vec.getNestSubVecs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_289getNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestSubVecs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNestSubVecs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestSubVecs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_288getNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_288getNestSubVecs(struct PyPetscVecObject *__pyx_v_self) { PetscInt __pyx_v_N; Vec *__pyx_v_sx; PyObject *__pyx_v_output = NULL; PetscInt __pyx_v_i; struct PyPetscVecObject *__pyx_v_pyvec = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestSubVecs", 0); /* "PETSc/Vec.pyx":1156 * * def getNestSubVecs(self): * cdef PetscInt N=0 # <<<<<<<<<<<<<< * cdef PetscVec* sx=NULL * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) */ __pyx_v_N = 0; /* "PETSc/Vec.pyx":1157 * def getNestSubVecs(self): * cdef PetscInt N=0 * cdef PetscVec* sx=NULL # <<<<<<<<<<<<<< * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) * output = [] */ __pyx_v_sx = NULL; /* "PETSc/Vec.pyx":1158 * cdef PetscInt N=0 * cdef PetscVec* sx=NULL * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) # <<<<<<<<<<<<<< * output = [] * for i in range(N): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNestGetSubVecs(__pyx_v_self->vec, (&__pyx_v_N), (&__pyx_v_sx))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1158, __pyx_L1_error) /* "PETSc/Vec.pyx":1159 * cdef PetscVec* sx=NULL * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) * output = [] # <<<<<<<<<<<<<< * for i in range(N): * pyvec = Vec() */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_output = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Vec.pyx":1160 * CHKERR( VecNestGetSubVecs(self.vec, &N, &sx) ) * output = [] * for i in range(N): # <<<<<<<<<<<<<< * pyvec = Vec() * pyvec.vec = sx[i] */ __pyx_t_3 = __pyx_v_N; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "PETSc/Vec.pyx":1161 * output = [] * for i in range(N): * pyvec = Vec() # <<<<<<<<<<<<<< * pyvec.vec = sx[i] * CHKERR( PetscObjectReference( pyvec.vec) ) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_pyvec, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "PETSc/Vec.pyx":1162 * for i in range(N): * pyvec = Vec() * pyvec.vec = sx[i] # <<<<<<<<<<<<<< * CHKERR( PetscObjectReference( pyvec.vec) ) * output.append(pyvec) */ __pyx_v_pyvec->vec = (__pyx_v_sx[__pyx_v_i]); /* "PETSc/Vec.pyx":1163 * pyvec = Vec() * pyvec.vec = sx[i] * CHKERR( PetscObjectReference( pyvec.vec) ) # <<<<<<<<<<<<<< * output.append(pyvec) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_pyvec->vec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(33, 1163, __pyx_L1_error) /* "PETSc/Vec.pyx":1164 * pyvec.vec = sx[i] * CHKERR( PetscObjectReference( pyvec.vec) ) * output.append(pyvec) # <<<<<<<<<<<<<< * * return output */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_output, ((PyObject *)__pyx_v_pyvec)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(33, 1164, __pyx_L1_error) } /* "PETSc/Vec.pyx":1166 * output.append(pyvec) * * return output # <<<<<<<<<<<<<< * * def setNestSubVecs(self, sx, idxm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_output); __pyx_r = __pyx_v_output; goto __pyx_L0; /* "PETSc/Vec.pyx":1155 * CHKERR( VecRestoreSubVector(self.vec, iset.iset, &subvec.vec) ) * * def getNestSubVecs(self): # <<<<<<<<<<<<<< * cdef PetscInt N=0 * cdef PetscVec* sx=NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Vec.getNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_output); __Pyx_XDECREF((PyObject *)__pyx_v_pyvec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1168 * return output * * def setNestSubVecs(self, sx, idxm=None): # <<<<<<<<<<<<<< * if idxm is None: idxm = range(len(sx)) * else: assert len(idxm) == len(sx) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291setNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Vec_290setNestSubVecs[] = "Vec.setNestSubVecs(self, sx, idxm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291setNestSubVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sx = 0; PyObject *__pyx_v_idxm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNestSubVecs (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sx,&__pyx_n_s_idxm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_idxm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNestSubVecs") < 0)) __PYX_ERR(33, 1168, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sx = values[0]; __pyx_v_idxm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNestSubVecs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(33, 1168, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.setNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_290setNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_sx, __pyx_v_idxm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290setNestSubVecs(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_sx, PyObject *__pyx_v_idxm) { PetscInt __pyx_v_N; PetscInt *__pyx_v_cidxm; Vec *__pyx_v_csx; CYTHON_UNUSED PyArrayObject *__pyx_v_tmp = NULL; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PetscInt __pyx_t_7; Vec __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNestSubVecs", 0); __Pyx_INCREF(__pyx_v_idxm); /* "PETSc/Vec.pyx":1169 * * def setNestSubVecs(self, sx, idxm=None): * if idxm is None: idxm = range(len(sx)) # <<<<<<<<<<<<<< * else: assert len(idxm) == len(sx) * cdef PetscInt N = 0 */ __pyx_t_1 = (__pyx_v_idxm == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(33, 1169, __pyx_L1_error) __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3; } /* "PETSc/Vec.pyx":1170 * def setNestSubVecs(self, sx, idxm=None): * if idxm is None: idxm = range(len(sx)) * else: assert len(idxm) == len(sx) # <<<<<<<<<<<<<< * cdef PetscInt N = 0 * cdef PetscInt* cidxm = NULL */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = PyObject_Length(__pyx_v_idxm); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(33, 1170, __pyx_L1_error) __pyx_t_6 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(33, 1170, __pyx_L1_error) if (unlikely(!((__pyx_t_3 == __pyx_t_6) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(33, 1170, __pyx_L1_error) } } #endif } __pyx_L3:; /* "PETSc/Vec.pyx":1171 * if idxm is None: idxm = range(len(sx)) * else: assert len(idxm) == len(sx) * cdef PetscInt N = 0 # <<<<<<<<<<<<<< * cdef PetscInt* cidxm = NULL * idxm = iarray_i(idxm, &N, &cidxm) */ __pyx_v_N = 0; /* "PETSc/Vec.pyx":1172 * else: assert len(idxm) == len(sx) * cdef PetscInt N = 0 * cdef PetscInt* cidxm = NULL # <<<<<<<<<<<<<< * idxm = iarray_i(idxm, &N, &cidxm) * */ __pyx_v_cidxm = NULL; /* "PETSc/Vec.pyx":1173 * cdef PetscInt N = 0 * cdef PetscInt* cidxm = NULL * idxm = iarray_i(idxm, &N, &cidxm) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_idxm, (&__pyx_v_N), (&__pyx_v_cidxm))); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 1173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Vec.pyx":1176 * * * cdef PetscVec* csx = NULL # <<<<<<<<<<<<<< * tmp = oarray_p(empty_p(N), NULL, &csx) * for i from 0 <= i < N: csx[i] = (sx[i]).vec */ __pyx_v_csx = NULL; /* "PETSc/Vec.pyx":1177 * * cdef PetscVec* csx = NULL * tmp = oarray_p(empty_p(N), NULL, &csx) # <<<<<<<<<<<<<< * for i from 0 <= i < N: csx[i] = (sx[i]).vec * */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_N)); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_5, NULL, ((void **)(&__pyx_v_csx)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tmp = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Vec.pyx":1178 * cdef PetscVec* csx = NULL * tmp = oarray_p(empty_p(N), NULL, &csx) * for i from 0 <= i < N: csx[i] = (sx[i]).vec # <<<<<<<<<<<<<< * * CHKERR( VecNestSetSubVecs(self.vec, N, cidxm, csx) ) */ __pyx_t_7 = __pyx_v_N; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sx, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 1178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(33, 1178, __pyx_L1_error) __pyx_t_8 = ((struct PyPetscVecObject *)__pyx_t_4)->vec; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_csx[__pyx_v_i]) = __pyx_t_8; } /* "PETSc/Vec.pyx":1180 * for i from 0 <= i < N: csx[i] = (sx[i]).vec * * CHKERR( VecNestSetSubVecs(self.vec, N, cidxm, csx) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNestSetSubVecs(__pyx_v_self->vec, __pyx_v_N, __pyx_v_cidxm, __pyx_v_csx)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(33, 1180, __pyx_L1_error) /* "PETSc/Vec.pyx":1168 * return output * * def setNestSubVecs(self, sx, idxm=None): # <<<<<<<<<<<<<< * if idxm is None: idxm = range(len(sx)) * else: assert len(idxm) == len(sx) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Vec.setNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_idxm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1185 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5sizes___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1186 * property sizes: * def __get__(self): * return self.getSizes() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setSizes(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1185 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1187 * def __get__(self): * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_5sizes_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Vec.pyx":1188 * return self.getSizes() * def __set__(self, value): * self.setSizes(value) # <<<<<<<<<<<<<< * * property size: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Vec.pyx":1187 * def __get__(self): * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.sizes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1191 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_4size___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1192 * property size: * def __get__(self): * return self.getSize() # <<<<<<<<<<<<<< * * property local_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1191 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1195 * * property local_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10local_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10local_size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10local_size___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1196 * property local_size: * def __get__(self): * return self.getLocalSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1195 * * property local_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1199 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_10block_size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_10block_size___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1200 * property block_size: * def __get__(self): * return self.getBlockSize() # <<<<<<<<<<<<<< * * property owner_range: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1199 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1203 * * property owner_range: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11owner_range_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_11owner_range_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_11owner_range___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1204 * property owner_range: * def __get__(self): * return self.getOwnershipRange() # <<<<<<<<<<<<<< * * property owner_ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1203 * * property owner_range: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.owner_range.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1207 * * property owner_ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_12owner_ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_12owner_ranges_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_12owner_ranges___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1208 * property owner_ranges: * def __get__(self): * return self.getOwnershipRanges() # <<<<<<<<<<<<<< * * property buffer_w: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1207 * * property owner_ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.owner_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1212 * property buffer_w: * "Vec buffer (writable)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getBuffer() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_w_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_w___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1213 * "Vec buffer (writable)" * def __get__(self): * return self.getBuffer() # <<<<<<<<<<<<<< * * property buffer_r: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1212 * property buffer_w: * "Vec buffer (writable)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getBuffer() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer_w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1217 * property buffer_r: * "Vec buffer (read-only)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getBuffer(True) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_r_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_8buffer_r___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1218 * "Vec buffer (read-only)" * def __get__(self): * return self.getBuffer(True) # <<<<<<<<<<<<<< * * property array_w: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, Py_True) : __Pyx_PyObject_CallOneArg(__pyx_t_2, Py_True); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1217 * property buffer_r: * "Vec buffer (read-only)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getBuffer(True) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer_r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1222 * property array_w: * "Vec array (writable)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getArray() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_w___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1223 * "Vec array (writable)" * def __get__(self): * return self.getArray() # <<<<<<<<<<<<<< * def __set__(self, value): * cdef buf = self.getBuffer() */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1222 * property array_w: * "Vec array (writable)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getArray() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1224 * def __get__(self): * return self.getArray() * def __set__(self, value): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * with buf as array: array[:] = value */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_7array_w_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_v_array = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Vec.pyx":1225 * return self.getArray() * def __set__(self, value): * cdef buf = self.getBuffer() # <<<<<<<<<<<<<< * with buf as array: array[:] = value * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_buf = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":1226 * def __set__(self, value): * cdef buf = self.getBuffer() * with buf as array: array[:] = value # <<<<<<<<<<<<<< * * property array_r: */ /*with:*/ { __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_buf, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_buf, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1226, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1226, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); /*try:*/ { __pyx_v_array = __pyx_t_2; __pyx_t_2 = 0; if (__Pyx_PyObject_SetSlice(__pyx_v_array, __pyx_v_value, 0, 0, NULL, NULL, &__pyx_slice__39, 0, 0, 1) < 0) __PYX_ERR(33, 1226, __pyx_L7_error) } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L12_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(33, 1226, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(33, 1226, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 1226, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_10 < 0) __PYX_ERR(33, 1226, __pyx_L9_except_error) __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; __PYX_ERR(33, 1226, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_L12_try_end:; } } /*finally:*/ { /*normal exit:*/{ if (__pyx_t_4) { __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__21, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } goto __pyx_L6; } __pyx_L6:; } goto __pyx_L16; __pyx_L3_error:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L1_error; __pyx_L16:; } /* "PETSc/Vec.pyx":1224 * def __get__(self): * return self.getArray() * def __set__(self, value): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * with buf as array: array[:] = value */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XDECREF(__pyx_v_array); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1230 * property array_r: * "Vec array (read-only)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getArray(True) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_r_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_7array_r_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_7array_r___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1231 * "Vec array (read-only)" * def __get__(self): * return self.getArray(True) # <<<<<<<<<<<<<< * * property buffer: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, Py_True) : __Pyx_PyObject_CallOneArg(__pyx_t_2, Py_True); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1230 * property array_r: * "Vec array (read-only)" * def __get__(self): # <<<<<<<<<<<<<< * return self.getArray(True) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_r.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1234 * * property buffer: * def __get__(self): # <<<<<<<<<<<<<< * return self.buffer_w * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_6buffer_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_6buffer_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_6buffer___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_6buffer___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1235 * property buffer: * def __get__(self): * return self.buffer_w # <<<<<<<<<<<<<< * * property array: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffer_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1234 * * property buffer: * def __get__(self): # <<<<<<<<<<<<<< * return self.buffer_w * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.buffer.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1238 * * property array: * def __get__(self): # <<<<<<<<<<<<<< * return self.array_w * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5array___get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_5array___get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1239 * property array: * def __get__(self): * return self.array_w # <<<<<<<<<<<<<< * def __set__(self, value): * self.array_w = value */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_array_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1238 * * property array: * def __get__(self): # <<<<<<<<<<<<<< * return self.array_w * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Vec.array.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1240 * def __get__(self): * return self.array_w * def __set__(self, value): # <<<<<<<<<<<<<< * self.array_w = value * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Vec_5array_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_5array_2__set__(((struct PyPetscVecObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Vec_5array_2__set__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Vec.pyx":1241 * return self.array_w * def __set__(self, value): * self.array_w = value # <<<<<<<<<<<<<< * * # --- NumPy array interface (legacy) --- */ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_array_w, __pyx_v_value) < 0) __PYX_ERR(33, 1241, __pyx_L1_error) /* "PETSc/Vec.pyx":1240 * def __get__(self): * return self.array_w * def __set__(self, value): # <<<<<<<<<<<<<< * self.array_w = value * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Vec.array.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Vec.pyx":1246 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * return buf.__array_interface__ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__array_interface___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_19__array_interface___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(((struct PyPetscVecObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_19__array_interface_____get__(struct PyPetscVecObject *__pyx_v_self) { PyObject *__pyx_v_buf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Vec.pyx":1247 * property __array_interface__: * def __get__(self): * cdef buf = self.getBuffer() # <<<<<<<<<<<<<< * return buf.__array_interface__ * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBuffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_buf = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Vec.pyx":1248 * def __get__(self): * cdef buf = self.getBuffer() * return buf.__array_interface__ # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_buf, __pyx_n_s_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Vec.pyx":1246 * * property __array_interface__: * def __get__(self): # <<<<<<<<<<<<<< * cdef buf = self.getBuffer() * return buf.__array_interface__ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Vec.__array_interface__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_buf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DT.pyx":5 * cdef class Quad(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.quad * self.quad = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4Quad_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4Quad_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4Quad___cinit__(struct PyPetscQuadObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/DT.pyx":6 * * def __cinit__(self): * self.obj = &self.quad # <<<<<<<<<<<<<< * self.quad = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->quad)); /* "PETSc/DT.pyx":7 * def __cinit__(self): * self.obj = &self.quad * self.quad = NULL # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __pyx_v_self->quad = NULL; /* "PETSc/DT.pyx":5 * cdef class Quad(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.quad * self.quad = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DT.pyx":9 * self.quad = NULL * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscQuadrature newquad = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_3create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Quad_2create[] = "Quad.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_3create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(34, 9, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(34, 9, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_2create(((struct PyPetscQuadObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_2create(struct PyPetscQuadObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscQuadrature __pyx_v_newquad; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DT.pyx":10 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscQuadrature newquad = NULL * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(34, 10, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DT.pyx":11 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscQuadrature newquad = NULL # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) * PetscCLEAR(self.obj); self.quad = newquad */ __pyx_v_newquad = NULL; /* "PETSc/DT.pyx":12 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscQuadrature newquad = NULL * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.quad = newquad * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureCreate(__pyx_v_ccomm, (&__pyx_v_newquad))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(34, 12, __pyx_L1_error) /* "PETSc/DT.pyx":13 * cdef PetscQuadrature newquad = NULL * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) * PetscCLEAR(self.obj); self.quad = newquad # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->quad = __pyx_v_newquad; /* "PETSc/DT.pyx":14 * CHKERR( PetscQuadratureCreate(ccomm, &newquad) ) * PetscCLEAR(self.obj); self.quad = newquad * return self # <<<<<<<<<<<<<< * * def destroy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DT.pyx":9 * self.quad = NULL * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscQuadrature newquad = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DT.pyx":16 * return self * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureDestroy(&self.quad) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4Quad_4destroy[] = "Quad.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4Quad_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4Quad_4destroy(((struct PyPetscQuadObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4Quad_4destroy(struct PyPetscQuadObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/DT.pyx":17 * * def destroy(self): * CHKERR( PetscQuadratureDestroy(&self.quad) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureDestroy((&__pyx_v_self->quad))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(34, 17, __pyx_L1_error) /* "PETSc/DT.pyx":18 * def destroy(self): * CHKERR( PetscQuadratureDestroy(&self.quad) ) * return self # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DT.pyx":16 * return self * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscQuadratureDestroy(&self.quad) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Quad.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":14 * Type = FEType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.fe * self.fe = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2FE_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2FE_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2FE___cinit__(struct PyPetscFEObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/FE.pyx":15 * * def __cinit__(self): * self.obj = &self.fe # <<<<<<<<<<<<<< * self.fe = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->fe)); /* "PETSc/FE.pyx":16 * def __cinit__(self): * self.obj = &self.fe * self.fe = NULL # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_v_self->fe = NULL; /* "PETSc/FE.pyx":14 * Type = FEType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.fe * self.fe = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":18 * self.fe = NULL * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscFEDestroy(&self.fe) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_3destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_2destroy[] = "FE.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_3destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_2destroy(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_2destroy(struct PyPetscFEObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/FE.pyx":19 * * def destroy(self): * CHKERR( PetscFEDestroy(&self.fe) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEDestroy((&__pyx_v_self->fe))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(35, 19, __pyx_L1_error) /* "PETSc/FE.pyx":20 * def destroy(self): * CHKERR( PetscFEDestroy(&self.fe) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/FE.pyx":18 * self.fe = NULL * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscFEDestroy(&self.fe) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":22 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_5create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_4create[] = "FE.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_5create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(35, 22, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(35, 22, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_4create(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_4create(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscFE __pyx_v_newfe; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/FE.pyx":23 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscFE newfe = NULL * CHKERR( PetscFECreate(ccomm, &newfe) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 23, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/FE.pyx":24 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL # <<<<<<<<<<<<<< * CHKERR( PetscFECreate(ccomm, &newfe) ) * PetscCLEAR(self.obj); self.fe = newfe */ __pyx_v_newfe = NULL; /* "PETSc/FE.pyx":25 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL * CHKERR( PetscFECreate(ccomm, &newfe) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.fe = newfe * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFECreate(__pyx_v_ccomm, (&__pyx_v_newfe))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(35, 25, __pyx_L1_error) /* "PETSc/FE.pyx":26 * cdef PetscFE newfe = NULL * CHKERR( PetscFECreate(ccomm, &newfe) ) * PetscCLEAR(self.obj); self.fe = newfe # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->fe = __pyx_v_newfe; /* "PETSc/FE.pyx":27 * CHKERR( PetscFECreate(ccomm, &newfe) ) * PetscCLEAR(self.obj); self.fe = newfe * return self # <<<<<<<<<<<<<< * * def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/FE.pyx":22 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":29 * return self * * def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_7createDefault(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_6createDefault[] = "FE.createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_7createDefault(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_nc = 0; PyObject *__pyx_v_isSimplex = 0; PyObject *__pyx_v_qorder = 0; PyObject *__pyx_v_prefix = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDefault (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_nc,&__pyx_n_s_isSimplex,&__pyx_n_s_qorder,&__pyx_n_s_prefix,&__pyx_n_s_comm,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, 1); __PYX_ERR(35, 29, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isSimplex)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, 2); __PYX_ERR(35, 29, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qorder)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, 3); __PYX_ERR(35, 29, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDefault") < 0)) __PYX_ERR(35, 29, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_nc = values[1]; __pyx_v_isSimplex = values[2]; __pyx_v_qorder = values[3]; __pyx_v_prefix = values[4]; __pyx_v_comm = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDefault", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(35, 29, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.createDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_6createDefault(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_nc, __pyx_v_isSimplex, __pyx_v_qorder, __pyx_v_prefix, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_6createDefault(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_isSimplex, PyObject *__pyx_v_qorder, PyObject *__pyx_v_prefix, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscFE __pyx_v_newfe; PetscInt __pyx_v_cdim; PetscInt __pyx_v_cnc; PetscInt __pyx_v_cqorder; PetscBool __pyx_v_cisSimplex; char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscInt __pyx_t_2; PetscBool __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDefault", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/FE.pyx":30 * * def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(35, 30, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/FE.pyx":31 * def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) */ __pyx_v_newfe = NULL; /* "PETSc/FE.pyx":32 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * cdef PetscInt cnc = asInt(nc) * cdef PetscInt cqorder = asInt(qorder) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(35, 32, __pyx_L1_error) __pyx_v_cdim = __pyx_t_2; /* "PETSc/FE.pyx":33 * cdef PetscFE newfe = NULL * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) # <<<<<<<<<<<<<< * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nc); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(35, 33, __pyx_L1_error) __pyx_v_cnc = __pyx_t_2; /* "PETSc/FE.pyx":34 * cdef PetscInt cdim = asInt(dim) * cdef PetscInt cnc = asInt(nc) * cdef PetscInt cqorder = asInt(qorder) # <<<<<<<<<<<<<< * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_qorder); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(35, 34, __pyx_L1_error) __pyx_v_cqorder = __pyx_t_2; /* "PETSc/FE.pyx":35 * cdef PetscInt cnc = asInt(nc) * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) # <<<<<<<<<<<<<< * cdef const char *cprefix = NULL * if prefix: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_isSimplex); if (unlikely(__pyx_t_3 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(35, 35, __pyx_L1_error) __pyx_v_cisSimplex = __pyx_t_3; /* "PETSc/FE.pyx":36 * cdef PetscInt cqorder = asInt(qorder) * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * if prefix: * prefix = str2bytes(prefix, &cprefix) */ __pyx_v_cprefix = NULL; /* "PETSc/FE.pyx":37 * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL * if prefix: # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(35, 37, __pyx_L1_error) if (__pyx_t_4) { /* "PETSc/FE.pyx":38 * cdef const char *cprefix = NULL * if prefix: * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) * PetscCLEAR(self.obj); self.fe = newfe */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_5)) __PYX_ERR(35, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/FE.pyx":37 * cdef PetscBool cisSimplex = asBool(isSimplex) * cdef const char *cprefix = NULL * if prefix: # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) */ } /* "PETSc/FE.pyx":39 * if prefix: * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.fe = newfe * return self */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFECreateDefault(__pyx_v_ccomm, __pyx_v_cdim, __pyx_v_cnc, __pyx_v_cisSimplex, __pyx_v_cprefix, __pyx_v_cqorder, (&__pyx_v_newfe))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(35, 39, __pyx_L1_error) /* "PETSc/FE.pyx":40 * prefix = str2bytes(prefix, &cprefix) * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) * PetscCLEAR(self.obj); self.fe = newfe # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->fe = __pyx_v_newfe; /* "PETSc/FE.pyx":41 * CHKERR( PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe)) * PetscCLEAR(self.obj); self.fe = newfe * return self # <<<<<<<<<<<<<< * * def getQuadrature(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/FE.pyx":29 * return self * * def createDefault(self, dim, nc, isSimplex, qorder, prefix=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscFE newfe = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.FE.createDefault", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":43 * return self * * def getQuadrature(self): # <<<<<<<<<<<<<< * cdef Quad quad = Quad() * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_9getQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_8getQuadrature[] = "FE.getQuadrature(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_9getQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getQuadrature (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getQuadrature", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getQuadrature", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_8getQuadrature(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_8getQuadrature(struct PyPetscFEObject *__pyx_v_self) { struct PyPetscQuadObject *__pyx_v_quad = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getQuadrature", 0); /* "PETSc/FE.pyx":44 * * def getQuadrature(self): * cdef Quad quad = Quad() # <<<<<<<<<<<<<< * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) * return quad */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/FE.pyx":45 * def getQuadrature(self): * cdef Quad quad = Quad() * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) # <<<<<<<<<<<<<< * return quad * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(35, 45, __pyx_L1_error) /* "PETSc/FE.pyx":46 * cdef Quad quad = Quad() * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) * return quad # <<<<<<<<<<<<<< * * def getFaceQuadrature(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_quad)); __pyx_r = ((PyObject *)__pyx_v_quad); goto __pyx_L0; /* "PETSc/FE.pyx":43 * return self * * def getQuadrature(self): # <<<<<<<<<<<<<< * cdef Quad quad = Quad() * CHKERR( PetscFEGetQuadrature(self.fe, &quad.quad) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.getQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_quad); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":48 * return quad * * def getFaceQuadrature(self): # <<<<<<<<<<<<<< * cdef Quad quad = Quad() * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11getFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_10getFaceQuadrature[] = "FE.getFaceQuadrature(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11getFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFaceQuadrature (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFaceQuadrature", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFaceQuadrature", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_10getFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_10getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self) { struct PyPetscQuadObject *__pyx_v_quad = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFaceQuadrature", 0); /* "PETSc/FE.pyx":49 * * def getFaceQuadrature(self): * cdef Quad quad = Quad() # <<<<<<<<<<<<<< * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) * return quad */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/FE.pyx":50 * def getFaceQuadrature(self): * cdef Quad quad = Quad() * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) # <<<<<<<<<<<<<< * return quad * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetFaceQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(35, 50, __pyx_L1_error) /* "PETSc/FE.pyx":51 * cdef Quad quad = Quad() * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) * return quad # <<<<<<<<<<<<<< * * def setQuadrature(self, Quad quad): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_quad)); __pyx_r = ((PyObject *)__pyx_v_quad); goto __pyx_L0; /* "PETSc/FE.pyx":48 * return quad * * def getFaceQuadrature(self): # <<<<<<<<<<<<<< * cdef Quad quad = Quad() * CHKERR( PetscFEGetFaceQuadrature(self.fe, &quad.quad) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.getFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_quad); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":53 * return quad * * def setQuadrature(self, Quad quad): # <<<<<<<<<<<<<< * CHKERR( PetscFESetQuadrature(self.fe, quad.quad) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13setQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_12setQuadrature[] = "FE.setQuadrature(self, Quad quad)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13setQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscQuadObject *__pyx_v_quad = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setQuadrature (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_quad,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quad)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setQuadrature") < 0)) __PYX_ERR(35, 53, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_quad = ((struct PyPetscQuadObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setQuadrature", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(35, 53, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quad), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(35, 53, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_12setQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12setQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setQuadrature", 0); /* "PETSc/FE.pyx":54 * * def setQuadrature(self, Quad quad): * CHKERR( PetscFESetQuadrature(self.fe, quad.quad) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetQuadrature(__pyx_v_self->fe, __pyx_v_quad->quad)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(35, 54, __pyx_L1_error) /* "PETSc/FE.pyx":55 * def setQuadrature(self, Quad quad): * CHKERR( PetscFESetQuadrature(self.fe, quad.quad) ) * return self # <<<<<<<<<<<<<< * * def setFaceQuadrature(self, Quad quad): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/FE.pyx":53 * return quad * * def setQuadrature(self, Quad quad): # <<<<<<<<<<<<<< * CHKERR( PetscFESetQuadrature(self.fe, quad.quad) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":57 * return self * * def setFaceQuadrature(self, Quad quad): # <<<<<<<<<<<<<< * CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15setFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_14setFaceQuadrature[] = "FE.setFaceQuadrature(self, Quad quad)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15setFaceQuadrature(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscQuadObject *__pyx_v_quad = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFaceQuadrature (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_quad,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quad)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFaceQuadrature") < 0)) __PYX_ERR(35, 57, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_quad = ((struct PyPetscQuadObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFaceQuadrature", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(35, 57, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quad), __pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(35, 57, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_14setFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_14setFaceQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFaceQuadrature", 0); /* "PETSc/FE.pyx":58 * * def setFaceQuadrature(self, Quad quad): * CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetFaceQuadrature(__pyx_v_self->fe, __pyx_v_quad->quad)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(35, 58, __pyx_L1_error) /* "PETSc/FE.pyx":59 * def setFaceQuadrature(self, Quad quad): * CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) ) * return self # <<<<<<<<<<<<<< * * def setType(self, fe_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/FE.pyx":57 * return self * * def setFaceQuadrature(self, Quad quad): # <<<<<<<<<<<<<< * CHKERR( PetscFESetFaceQuadrature(self.fe, quad.quad) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setFaceQuadrature", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/FE.pyx":61 * return self * * def setType(self, fe_type): # <<<<<<<<<<<<<< * cdef PetscFEType cval = NULL * fe_type = str2bytes(fe_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_17setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2FE_16setType[] = "FE.setType(self, fe_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_17setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fe_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fe_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fe_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(35, 61, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fe_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(35, 61, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.FE.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_16setType(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_fe_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16setType(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_fe_type) { PetscFEType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_fe_type); /* "PETSc/FE.pyx":62 * * def setType(self, fe_type): * cdef PetscFEType cval = NULL # <<<<<<<<<<<<<< * fe_type = str2bytes(fe_type, &cval) * CHKERR( PetscFESetType(self.fe, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/FE.pyx":63 * def setType(self, fe_type): * cdef PetscFEType cval = NULL * fe_type = str2bytes(fe_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscFESetType(self.fe, cval) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fe_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fe_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/FE.pyx":64 * cdef PetscFEType cval = NULL * fe_type = str2bytes(fe_type, &cval) * CHKERR( PetscFESetType(self.fe, cval) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetType(__pyx_v_self->fe, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(35, 64, __pyx_L1_error) /* "PETSc/FE.pyx":65 * fe_type = str2bytes(fe_type, &cval) * CHKERR( PetscFESetType(self.fe, cval) ) * return self # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/FE.pyx":61 * return self * * def setType(self, fe_type): # <<<<<<<<<<<<<< * cdef PetscFEType cval = NULL * fe_type = str2bytes(fe_type, &cval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.FE.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fe_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":22 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sct * self.sct = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Scatter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Scatter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Scatter___cinit__(struct PyPetscScatterObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Scatter.pyx":23 * * def __cinit__(self): * self.obj = &self.sct # <<<<<<<<<<<<<< * self.sct = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->sct)); /* "PETSc/Scatter.pyx":24 * def __cinit__(self): * self.obj = &self.sct * self.sct = NULL # <<<<<<<<<<<<<< * * def __call__(self, x, y, addv=None, mode=None): */ __pyx_v_self->sct = NULL; /* "PETSc/Scatter.pyx":22 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sct * self.sct = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":26 * self.sct = NULL * * def __call__(self, x, y, addv=None, mode=None): # <<<<<<<<<<<<<< * self.scatter(x, y, addv, mode) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__call__", 0, 2, 4, 1); __PYX_ERR(36, 26, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(36, 26, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 26, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_2__call__(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); /* "PETSc/Scatter.pyx":27 * * def __call__(self, x, y, addv=None, mode=None): * self.scatter(x, y, addv, mode) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_scatter); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 27, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 27, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(36, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_y); __Pyx_INCREF(__pyx_v_addv); __Pyx_GIVEREF(__pyx_v_addv); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_addv); __Pyx_INCREF(__pyx_v_mode); __Pyx_GIVEREF(__pyx_v_mode); PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_mode); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Scatter.pyx":26 * self.sct = NULL * * def __call__(self, x, y, addv=None, mode=None): # <<<<<<<<<<<<<< * self.scatter(x, y, addv, mode) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":31 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_4view[] = "Scatter.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(36, 31, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 31, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(36, 31, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_4view(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_4view(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Scatter.pyx":32 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( VecScatterView(self.sct, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Scatter.pyx":33 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( VecScatterView(self.sct, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Scatter.pyx":34 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( VecScatterView(self.sct, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterView(__pyx_v_self->sct, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(36, 34, __pyx_L1_error) /* "PETSc/Scatter.pyx":31 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":36 * CHKERR( VecScatterView(self.sct, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( VecScatterDestroy(&self.sct) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_6destroy[] = "Scatter.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_6destroy(struct PyPetscScatterObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Scatter.pyx":37 * * def destroy(self): * CHKERR( VecScatterDestroy(&self.sct) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterDestroy((&__pyx_v_self->sct))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(36, 37, __pyx_L1_error) /* "PETSc/Scatter.pyx":38 * def destroy(self): * CHKERR( VecScatterDestroy(&self.sct) ) * return self # <<<<<<<<<<<<<< * * def create(self, Vec vec_from, IS is_from or None, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Scatter.pyx":36 * CHKERR( VecScatterView(self.sct, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( VecScatterDestroy(&self.sct) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":40 * return self * * def create(self, Vec vec_from, IS is_from or None, # <<<<<<<<<<<<<< * Vec vec_to, IS is_to or None): * cdef PetscIS cisfrom = NULL, cisto = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_8create[] = "Scatter.create(self, Vec vec_from, IS is_from, Vec vec_to, IS is_to)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscISObject *__pyx_v_is_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; struct PyPetscISObject *__pyx_v_is_to = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_is_from,&__pyx_n_s_vec_to,&__pyx_n_s_is_to,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_from)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 1); __PYX_ERR(36, 40, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 2); __PYX_ERR(36, 40, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, 3); __PYX_ERR(36, 40, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(36, 40, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_is_from = ((struct PyPetscISObject *)values[1]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[2]); __pyx_v_is_to = ((struct PyPetscISObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 40, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(36, 40, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_from), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "is_from", 0))) __PYX_ERR(36, 40, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(36, 41, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_is_to), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "is_to", 0))) __PYX_ERR(36, 41, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_8create(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_is_from, __pyx_v_vec_to, __pyx_v_is_to); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_8create(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscISObject *__pyx_v_is_from, struct PyPetscVecObject *__pyx_v_vec_to, struct PyPetscISObject *__pyx_v_is_to) { IS __pyx_v_cisfrom; IS __pyx_v_cisto; VecScatter __pyx_v_newsct; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Scatter.pyx":42 * def create(self, Vec vec_from, IS is_from or None, * Vec vec_to, IS is_to or None): * cdef PetscIS cisfrom = NULL, cisto = NULL # <<<<<<<<<<<<<< * if is_from is not None: cisfrom = is_from.iset * if is_to is not None: cisto = is_to.iset */ __pyx_v_cisfrom = NULL; __pyx_v_cisto = NULL; /* "PETSc/Scatter.pyx":43 * Vec vec_to, IS is_to or None): * cdef PetscIS cisfrom = NULL, cisto = NULL * if is_from is not None: cisfrom = is_from.iset # <<<<<<<<<<<<<< * if is_to is not None: cisto = is_to.iset * cdef PetscScatter newsct = NULL */ __pyx_t_1 = (((PyObject *)__pyx_v_is_from) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_is_from->iset; __pyx_v_cisfrom = __pyx_t_3; } /* "PETSc/Scatter.pyx":44 * cdef PetscIS cisfrom = NULL, cisto = NULL * if is_from is not None: cisfrom = is_from.iset * if is_to is not None: cisto = is_to.iset # <<<<<<<<<<<<<< * cdef PetscScatter newsct = NULL * CHKERR( VecScatterCreate( */ __pyx_t_2 = (((PyObject *)__pyx_v_is_to) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_is_to->iset; __pyx_v_cisto = __pyx_t_3; } /* "PETSc/Scatter.pyx":45 * if is_from is not None: cisfrom = is_from.iset * if is_to is not None: cisto = is_to.iset * cdef PetscScatter newsct = NULL # <<<<<<<<<<<<<< * CHKERR( VecScatterCreate( * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) */ __pyx_v_newsct = NULL; /* "PETSc/Scatter.pyx":46 * if is_to is not None: cisto = is_to.iset * cdef PetscScatter newsct = NULL * CHKERR( VecScatterCreate( # <<<<<<<<<<<<<< * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) * PetscCLEAR(self.obj); self.sct = newsct */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreate(__pyx_v_vec_from->vec, __pyx_v_cisfrom, __pyx_v_vec_to->vec, __pyx_v_cisto, (&__pyx_v_newsct))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(36, 46, __pyx_L1_error) /* "PETSc/Scatter.pyx":48 * CHKERR( VecScatterCreate( * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) * PetscCLEAR(self.obj); self.sct = newsct # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->sct = __pyx_v_newsct; /* "PETSc/Scatter.pyx":49 * vec_from.vec, cisfrom, vec_to.vec, cisto, &newsct) ) * PetscCLEAR(self.obj); self.sct = newsct * return self # <<<<<<<<<<<<<< * * def setType(self, scatter_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Scatter.pyx":40 * return self * * def create(self, Vec vec_from, IS is_from or None, # <<<<<<<<<<<<<< * Vec vec_to, IS is_to or None): * cdef PetscIS cisfrom = NULL, cisto = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":51 * return self * * def setType(self, scatter_type): # <<<<<<<<<<<<<< * cdef PetscScatterType cval = NULL * vec_type = str2bytes(scatter_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_10setType[] = "Scatter.setType(self, scatter_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_scatter_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scatter_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(36, 51, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_scatter_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 51, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_scatter_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_10setType(struct PyPetscScatterObject *__pyx_v_self, PyObject *__pyx_v_scatter_type) { VecScatterType __pyx_v_cval; CYTHON_UNUSED PyObject *__pyx_v_vec_type = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); /* "PETSc/Scatter.pyx":52 * * def setType(self, scatter_type): * cdef PetscScatterType cval = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(scatter_type, &cval) * CHKERR( VecScatterSetType(self.sct, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Scatter.pyx":53 * def setType(self, scatter_type): * cdef PetscScatterType cval = NULL * vec_type = str2bytes(scatter_type, &cval) # <<<<<<<<<<<<<< * CHKERR( VecScatterSetType(self.sct, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_scatter_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec_type = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Scatter.pyx":54 * cdef PetscScatterType cval = NULL * vec_type = str2bytes(scatter_type, &cval) * CHKERR( VecScatterSetType(self.sct, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterSetType(__pyx_v_self->sct, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(36, 54, __pyx_L1_error) /* "PETSc/Scatter.pyx":51 * return self * * def setType(self, scatter_type): # <<<<<<<<<<<<<< * cdef PetscScatterType cval = NULL * vec_type = str2bytes(scatter_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":56 * CHKERR( VecScatterSetType(self.sct, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscScatterType cval = NULL * CHKERR( VecScatterGetType(self.sct, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_12getType[] = "Scatter.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_12getType(struct PyPetscScatterObject *__pyx_v_self) { VecScatterType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/Scatter.pyx":57 * * def getType(self): * cdef PetscScatterType cval = NULL # <<<<<<<<<<<<<< * CHKERR( VecScatterGetType(self.sct, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Scatter.pyx":58 * def getType(self): * cdef PetscScatterType cval = NULL * CHKERR( VecScatterGetType(self.sct, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterGetType(__pyx_v_self->sct, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(36, 58, __pyx_L1_error) /* "PETSc/Scatter.pyx":59 * cdef PetscScatterType cval = NULL * CHKERR( VecScatterGetType(self.sct, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Scatter.pyx":56 * CHKERR( VecScatterSetType(self.sct, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscScatterType cval = NULL * CHKERR( VecScatterGetType(self.sct, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":61 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( VecScatterSetFromOptions(self.sct) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_14setFromOptions[] = "Scatter.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_14setFromOptions(struct PyPetscScatterObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/Scatter.pyx":62 * * def setFromOptions(self): * CHKERR( VecScatterSetFromOptions(self.sct) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterSetFromOptions(__pyx_v_self->sct)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(36, 62, __pyx_L1_error) /* "PETSc/Scatter.pyx":61 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( VecScatterSetFromOptions(self.sct) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":64 * CHKERR( VecScatterSetFromOptions(self.sct) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( VecScatterSetUp(self.sct) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_16setUp[] = "Scatter.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_16setUp(struct PyPetscScatterObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/Scatter.pyx":65 * * def setUp(self): * CHKERR( VecScatterSetUp(self.sct) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterSetUp(__pyx_v_self->sct)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(36, 65, __pyx_L1_error) /* "PETSc/Scatter.pyx":66 * def setUp(self): * CHKERR( VecScatterSetUp(self.sct) ) * return self # <<<<<<<<<<<<<< * * def copy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Scatter.pyx":64 * CHKERR( VecScatterSetFromOptions(self.sct) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( VecScatterSetUp(self.sct) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":68 * return self * * def copy(self): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_18copy[] = "Scatter.copy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(((struct PyPetscScatterObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_18copy(struct PyPetscScatterObject *__pyx_v_self) { struct PyPetscScatterObject *__pyx_v_scatter = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); /* "PETSc/Scatter.pyx":69 * * def copy(self): * cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<< * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) * return scatter */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Scatter.pyx":70 * def copy(self): * cdef Scatter scatter = Scatter() * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) # <<<<<<<<<<<<<< * return scatter * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCopy(__pyx_v_self->sct, (&__pyx_v_scatter->sct))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(36, 70, __pyx_L1_error) /* "PETSc/Scatter.pyx":71 * cdef Scatter scatter = Scatter() * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) * return scatter # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_scatter)); __pyx_r = ((PyObject *)__pyx_v_scatter); goto __pyx_L0; /* "PETSc/Scatter.pyx":68 * return self * * def copy(self): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * CHKERR( VecScatterCopy(self.sct, &scatter.sct) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_scatter); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":74 * * @classmethod * def toAll(cls, Vec vec): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_20toAll[] = "Scatter.toAll(type cls, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toAll (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "toAll") < 0)) __PYX_ERR(36, 74, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("toAll", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 74, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(36, 74, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_20toAll(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec) { struct PyPetscScatterObject *__pyx_v_scatter = 0; struct PyPetscVecObject *__pyx_v_ovec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toAll", 0); /* "PETSc/Scatter.pyx":75 * @classmethod * def toAll(cls, Vec vec): * cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<< * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToAll( */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Scatter.pyx":76 * def toAll(cls, Vec vec): * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() # <<<<<<<<<<<<<< * CHKERR( VecScatterCreateToAll( * vec.vec, &scatter.sct, &ovec.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ovec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Scatter.pyx":77 * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToAll( # <<<<<<<<<<<<<< * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToAll(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(36, 77, __pyx_L1_error) /* "PETSc/Scatter.pyx":79 * CHKERR( VecScatterCreateToAll( * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) # <<<<<<<<<<<<<< * * @classmethod */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_scatter)); __Pyx_GIVEREF(((PyObject *)__pyx_v_scatter)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_scatter)); __Pyx_INCREF(((PyObject *)__pyx_v_ovec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ovec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ovec)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Scatter.pyx":74 * * @classmethod * def toAll(cls, Vec vec): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toAll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_scatter); __Pyx_XDECREF((PyObject *)__pyx_v_ovec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":82 * * @classmethod * def toZero(cls, Vec vec): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_22toZero[] = "Scatter.toZero(type cls, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("toZero (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "toZero") < 0)) __PYX_ERR(36, 82, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("toZero", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 82, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toZero", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(36, 82, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(((PyTypeObject*)__pyx_v_cls), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_22toZero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, struct PyPetscVecObject *__pyx_v_vec) { struct PyPetscScatterObject *__pyx_v_scatter = 0; struct PyPetscVecObject *__pyx_v_ovec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toZero", 0); /* "PETSc/Scatter.pyx":83 * @classmethod * def toZero(cls, Vec vec): * cdef Scatter scatter = Scatter() # <<<<<<<<<<<<<< * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToZero( */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Scatter.pyx":84 * def toZero(cls, Vec vec): * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() # <<<<<<<<<<<<<< * CHKERR( VecScatterCreateToZero( * vec.vec, &scatter.sct, &ovec.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ovec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Scatter.pyx":85 * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() * CHKERR( VecScatterCreateToZero( # <<<<<<<<<<<<<< * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToZero(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(36, 85, __pyx_L1_error) /* "PETSc/Scatter.pyx":87 * CHKERR( VecScatterCreateToZero( * vec.vec, &scatter.sct, &ovec.vec) ) * return (scatter, ovec) # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_scatter)); __Pyx_GIVEREF(((PyObject *)__pyx_v_scatter)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_scatter)); __Pyx_INCREF(((PyObject *)__pyx_v_ovec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ovec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_ovec)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Scatter.pyx":82 * * @classmethod * def toZero(cls, Vec vec): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Scatter.toZero", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_scatter); __Pyx_XDECREF((PyObject *)__pyx_v_ovec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":90 * # * * def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_24begin[] = "Scatter.begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("begin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("begin", 0, 2, 4, 1); __PYX_ERR(36, 90, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "begin") < 0)) __PYX_ERR(36, 90, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("begin", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 90, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(36, 90, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(36, 90, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_24begin(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_24begin(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("begin", 0); /* "PETSc/Scatter.pyx":91 * * def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(36, 91, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Scatter.pyx":92 * def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(36, 92, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Scatter.pyx":93 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterBegin(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(36, 93, __pyx_L1_error) /* "PETSc/Scatter.pyx":90 * # * * def begin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.begin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":96 * caddv, csctm) ) * * def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_27end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_26end[] = "Scatter.end(self, Vec vec_from, Vec vec_to, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_27end(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("end (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("end", 0, 2, 4, 1); __PYX_ERR(36, 96, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "end") < 0)) __PYX_ERR(36, 96, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("end", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 96, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.end", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(36, 96, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(36, 96, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_26end(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_26end(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("end", 0); /* "PETSc/Scatter.pyx":97 * * def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(36, 97, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Scatter.pyx":98 * def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(36, 98, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Scatter.pyx":99 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterEnd(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(36, 99, __pyx_L1_error) /* "PETSc/Scatter.pyx":96 * caddv, csctm) ) * * def end(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.end", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":104 * # * * def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_28scatterBegin[] = "Scatter.scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatterBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatterBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatterBegin", 0, 2, 4, 1); __PYX_ERR(36, 104, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterBegin") < 0)) __PYX_ERR(36, 104, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatterBegin", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 104, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(36, 104, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(36, 104, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_28scatterBegin(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_28scatterBegin(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatterBegin", 0); /* "PETSc/Scatter.pyx":105 * * def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(36, 105, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Scatter.pyx":106 * def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(36, 106, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Scatter.pyx":107 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterBegin(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(36, 107, __pyx_L1_error) /* "PETSc/Scatter.pyx":104 * # * * def scatterBegin(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":110 * caddv, csctm) ) * * def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_31scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_30scatterEnd[] = "Scatter.scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_31scatterEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatterEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatterEnd", 0, 2, 4, 1); __PYX_ERR(36, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatterEnd") < 0)) __PYX_ERR(36, 110, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatterEnd", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 110, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(36, 110, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(36, 110, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_30scatterEnd(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_30scatterEnd(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatterEnd", 0); /* "PETSc/Scatter.pyx":111 * * def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(36, 111, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Scatter.pyx":112 * def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(36, 112, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Scatter.pyx":113 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterEnd(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(36, 113, __pyx_L1_error) /* "PETSc/Scatter.pyx":110 * caddv, csctm) ) * * def scatterEnd(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatterEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Scatter.pyx":116 * caddv, csctm) ) * * def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_33scatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Scatter_32scatter[] = "Scatter.scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Scatter_33scatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec_from = 0; struct PyPetscVecObject *__pyx_v_vec_to = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_from,&__pyx_n_s_vec_to,&__pyx_n_s_addv,&__pyx_n_s_mode,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_from)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_to)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatter", 0, 2, 4, 1); __PYX_ERR(36, 116, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatter") < 0)) __PYX_ERR(36, 116, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vec_from = ((struct PyPetscVecObject *)values[0]); __pyx_v_vec_to = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatter", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(36, 116, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_from), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(36, 116, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(36, 116, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Scatter_32scatter(((struct PyPetscScatterObject *)__pyx_v_self), __pyx_v_vec_from, __pyx_v_vec_to, __pyx_v_addv, __pyx_v_mode); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Scatter_32scatter(struct PyPetscScatterObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec_from, struct PyPetscVecObject *__pyx_v_vec_to, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode) { InsertMode __pyx_v_caddv; ScatterMode __pyx_v_csctm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; ScatterMode __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatter", 0); /* "PETSc/Scatter.pyx":117 * * def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(36, 117, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Scatter.pyx":118 * def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None): * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) # <<<<<<<<<<<<<< * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_scattermode(__pyx_v_mode); if (unlikely(__pyx_t_2 == ((ScatterMode)((ScatterMode)-1L)))) __PYX_ERR(36, 118, __pyx_L1_error) __pyx_v_csctm = __pyx_t_2; /* "PETSc/Scatter.pyx":119 * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterBegin(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(36, 119, __pyx_L1_error) /* "PETSc/Scatter.pyx":121 * CHKERR( VecScatterBegin(self.sct, vec_from.vec, vec_to.vec, * caddv, csctm) ) * CHKERR( VecScatterEnd(self.sct, vec_from.vec, vec_to.vec, # <<<<<<<<<<<<<< * caddv, csctm) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterEnd(__pyx_v_self->sct, __pyx_v_vec_from->vec, __pyx_v_vec_to->vec, __pyx_v_caddv, __pyx_v_csctm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(36, 121, __pyx_L1_error) /* "PETSc/Scatter.pyx":116 * caddv, csctm) ) * * def scatter(self, Vec vec_from, Vec vec_to, addv=None, mode=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * cdef PetscScatterMode csctm = scattermode(mode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Scatter.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":5 * cdef class Section(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sec * self.sec = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7Section_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7Section_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7Section___cinit__(struct PyPetscSectionObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Section.pyx":6 * * def __cinit__(self): * self.obj = &self.sec # <<<<<<<<<<<<<< * self.sec = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->sec)); /* "PETSc/Section.pyx":7 * def __cinit__(self): * self.obj = &self.sec * self.sec = NULL # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_v_self->sec = NULL; /* "PETSc/Section.pyx":5 * cdef class Section(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.sec * self.sec = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":9 * self.sec = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionDestroy(&self.sec) ) * self.sec = NULL */ /* Python wrapper */ static void __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_8petsc4py_5PETSc_7Section_2__dealloc__(struct PyPetscSectionObject *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "PETSc/Section.pyx":10 * * def __dealloc__(self): * CHKERR( PetscSectionDestroy(&self.sec) ) # <<<<<<<<<<<<<< * self.sec = NULL * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionDestroy((&__pyx_v_self->sec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 10, __pyx_L1_error) /* "PETSc/Section.pyx":11 * def __dealloc__(self): * CHKERR( PetscSectionDestroy(&self.sec) ) * self.sec = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_v_self->sec = NULL; /* "PETSc/Section.pyx":9 * self.sec = NULL * * def __dealloc__(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionDestroy(&self.sec) ) * self.sec = NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __Pyx_WriteUnraisable("petsc4py.PETSc.Section.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "PETSc/Section.pyx":13 * self.sec = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_4view[] = "Section.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(37, 13, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 13, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(37, 13, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_4view(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4view(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Section.pyx":14 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSectionView(self.sec, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Section.pyx":15 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscSectionView(self.sec, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Section.pyx":16 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscSectionView(self.sec, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionView(__pyx_v_self->sec, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(37, 16, __pyx_L1_error) /* "PETSc/Section.pyx":13 * self.sec = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":18 * CHKERR( PetscSectionView(self.sec, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionDestroy(&self.sec) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_6destroy[] = "Section.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_6destroy(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6destroy(struct PyPetscSectionObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Section.pyx":19 * * def destroy(self): * CHKERR( PetscSectionDestroy(&self.sec) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionDestroy((&__pyx_v_self->sec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 19, __pyx_L1_error) /* "PETSc/Section.pyx":20 * def destroy(self): * CHKERR( PetscSectionDestroy(&self.sec) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Section.pyx":18 * CHKERR( PetscSectionView(self.sec, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionDestroy(&self.sec) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":22 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSection newsec = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_8create[] = "Section.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(37, 22, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 22, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_8create(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8create(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscSection __pyx_v_newsec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Section.pyx":23 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSection newsec = NULL * CHKERR( PetscSectionCreate(ccomm, &newsec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 23, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Section.pyx":24 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSection newsec = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreate(ccomm, &newsec) ) * PetscCLEAR(self.obj); self.sec = newsec */ __pyx_v_newsec = NULL; /* "PETSc/Section.pyx":25 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSection newsec = NULL * CHKERR( PetscSectionCreate(ccomm, &newsec) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.sec = newsec * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_newsec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 25, __pyx_L1_error) /* "PETSc/Section.pyx":26 * cdef PetscSection newsec = NULL * CHKERR( PetscSectionCreate(ccomm, &newsec) ) * PetscCLEAR(self.obj); self.sec = newsec # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->sec = __pyx_v_newsec; /* "PETSc/Section.pyx":27 * CHKERR( PetscSectionCreate(ccomm, &newsec) ) * PetscCLEAR(self.obj); self.sec = newsec * return self # <<<<<<<<<<<<<< * * def clone(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Section.pyx":22 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSection newsec = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":29 * return self * * def clone(self): # <<<<<<<<<<<<<< * cdef Section sec =
type(self)() * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_10clone[] = "Section.clone(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clone (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_10clone(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10clone(struct PyPetscSectionObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clone", 0); /* "PETSc/Section.pyx":30 * * def clone(self): * cdef Section sec =
type(self)() # <<<<<<<<<<<<<< * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) * return sec */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Section.pyx":31 * def clone(self): * cdef Section sec =
type(self)() * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) # <<<<<<<<<<<<<< * return sec * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionClone(__pyx_v_self->sec, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(37, 31, __pyx_L1_error) /* "PETSc/Section.pyx":32 * cdef Section sec =
type(self)() * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) * return sec # <<<<<<<<<<<<<< * * def setUp(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sec)); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "PETSc/Section.pyx":29 * return self * * def clone(self): # <<<<<<<<<<<<<< * cdef Section sec =
type(self)() * CHKERR( PetscSectionClone(self.sec, &sec.sec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":34 * return sec * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetUp(self.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_12setUp[] = "Section.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_12setUp(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12setUp(struct PyPetscSectionObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/Section.pyx":35 * * def setUp(self): * CHKERR( PetscSectionSetUp(self.sec) ) # <<<<<<<<<<<<<< * * def reset(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetUp(__pyx_v_self->sec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 35, __pyx_L1_error) /* "PETSc/Section.pyx":34 * return sec * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetUp(self.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":37 * CHKERR( PetscSectionSetUp(self.sec) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionReset(self.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_15reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_14reset[] = "Section.reset(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_15reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_14reset(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14reset(struct PyPetscSectionObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); /* "PETSc/Section.pyx":38 * * def reset(self): * CHKERR( PetscSectionReset(self.sec) ) # <<<<<<<<<<<<<< * * def getNumFields(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionReset(__pyx_v_self->sec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 38, __pyx_L1_error) /* "PETSc/Section.pyx":37 * CHKERR( PetscSectionSetUp(self.sec) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PetscSectionReset(self.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":40 * CHKERR( PetscSectionReset(self.sec) ) * * def getNumFields(self): # <<<<<<<<<<<<<< * cdef PetscInt numFields = 0 * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_16getNumFields[] = "Section.getNumFields(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumFields (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNumFields", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumFields", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16getNumFields(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_numFields; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumFields", 0); /* "PETSc/Section.pyx":41 * * def getNumFields(self): * cdef PetscInt numFields = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) * return toInt(numFields) */ __pyx_v_numFields = 0; /* "PETSc/Section.pyx":42 * def getNumFields(self): * cdef PetscInt numFields = 0 * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) # <<<<<<<<<<<<<< * return toInt(numFields) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetNumFields(__pyx_v_self->sec, (&__pyx_v_numFields))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 42, __pyx_L1_error) /* "PETSc/Section.pyx":43 * cdef PetscInt numFields = 0 * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) * return toInt(numFields) # <<<<<<<<<<<<<< * * def setNumFields(self,numFields): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numFields); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":40 * CHKERR( PetscSectionReset(self.sec) ) * * def getNumFields(self): # <<<<<<<<<<<<<< * cdef PetscInt numFields = 0 * CHKERR( PetscSectionGetNumFields(self.sec, &numFields) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":45 * return toInt(numFields) * * def setNumFields(self,numFields): # <<<<<<<<<<<<<< * cdef PetscInt cnumFields = asInt(numFields) * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_18setNumFields[] = "Section.setNumFields(self, numFields)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_numFields = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumFields (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numFields,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numFields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNumFields") < 0)) __PYX_ERR(37, 45, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_numFields = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_numFields); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18setNumFields(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_numFields) { PetscInt __pyx_v_cnumFields; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumFields", 0); /* "PETSc/Section.pyx":46 * * def setNumFields(self,numFields): * cdef PetscInt cnumFields = asInt(numFields) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numFields); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 46, __pyx_L1_error) __pyx_v_cnumFields = __pyx_t_1; /* "PETSc/Section.pyx":47 * def setNumFields(self,numFields): * cdef PetscInt cnumFields = asInt(numFields) * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) # <<<<<<<<<<<<<< * * def getFieldName(self,field): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetNumFields(__pyx_v_self->sec, __pyx_v_cnumFields)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 47, __pyx_L1_error) /* "PETSc/Section.pyx":45 * return toInt(numFields) * * def setNumFields(self,numFields): # <<<<<<<<<<<<<< * cdef PetscInt cnumFields = asInt(numFields) * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":49 * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) * * def getFieldName(self,field): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef const char *fieldName = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_20getFieldName[] = "Section.getFieldName(self, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldName") < 0)) __PYX_ERR(37, 49, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 49, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20getFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_cfield; char const *__pyx_v_fieldName; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldName", 0); /* "PETSc/Section.pyx":50 * * def getFieldName(self,field): * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef const char *fieldName = NULL * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 50, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":51 * def getFieldName(self,field): * cdef PetscInt cfield = asInt(field) * cdef const char *fieldName = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) * return bytes2str(fieldName) */ __pyx_v_fieldName = NULL; /* "PETSc/Section.pyx":52 * cdef PetscInt cfield = asInt(field) * cdef const char *fieldName = NULL * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) # <<<<<<<<<<<<<< * return bytes2str(fieldName) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldName(__pyx_v_self->sec, __pyx_v_cfield, (&__pyx_v_fieldName))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 52, __pyx_L1_error) /* "PETSc/Section.pyx":53 * cdef const char *fieldName = NULL * CHKERR( PetscSectionGetFieldName(self.sec,cfield,&fieldName) ) * return bytes2str(fieldName) # <<<<<<<<<<<<<< * * def setFieldName(self,field,fieldName): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_fieldName); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":49 * CHKERR( PetscSectionSetNumFields(self.sec, cnumFields) ) * * def getFieldName(self,field): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef const char *fieldName = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":55 * return bytes2str(fieldName) * * def setFieldName(self,field,fieldName): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_22setFieldName[] = "Section.setFieldName(self, field, fieldName)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_fieldName = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_fieldName,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldName)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, 1); __PYX_ERR(37, 55, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldName") < 0)) __PYX_ERR(37, 55, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_fieldName = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 55, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_fieldName); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22setFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_fieldName) { PetscInt __pyx_v_cfield; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldName", 0); __Pyx_INCREF(__pyx_v_fieldName); /* "PETSc/Section.pyx":56 * * def setFieldName(self,field,fieldName): * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * fieldName = str2bytes(fieldName, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 56, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":57 * def setFieldName(self,field,fieldName): * cdef PetscInt cfield = asInt(field) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * fieldName = str2bytes(fieldName, &cname) * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) */ __pyx_v_cname = NULL; /* "PETSc/Section.pyx":58 * cdef PetscInt cfield = asInt(field) * cdef const char *cname = NULL * fieldName = str2bytes(fieldName, &cname) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldName, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_fieldName, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Section.pyx":59 * cdef const char *cname = NULL * fieldName = str2bytes(fieldName, &cname) * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) # <<<<<<<<<<<<<< * * def getFieldComponents(self,field): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldName(__pyx_v_self->sec, __pyx_v_cfield, __pyx_v_cname)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(37, 59, __pyx_L1_error) /* "PETSc/Section.pyx":55 * return bytes2str(fieldName) * * def setFieldName(self,field,fieldName): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef const char *cname = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldName); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":61 * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) * * def getFieldComponents(self,field): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field), cnumComp = 0 * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_24getFieldComponents[] = "Section.getFieldComponents(self, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldComponents (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldComponents") < 0)) __PYX_ERR(37, 61, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldComponents", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 61, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24getFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumComp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldComponents", 0); /* "PETSc/Section.pyx":62 * * def getFieldComponents(self,field): * cdef PetscInt cfield = asInt(field), cnumComp = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) * return toInt(cnumComp) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 62, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; __pyx_v_cnumComp = 0; /* "PETSc/Section.pyx":63 * def getFieldComponents(self,field): * cdef PetscInt cfield = asInt(field), cnumComp = 0 * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) # <<<<<<<<<<<<<< * return toInt(cnumComp) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldComponents(__pyx_v_self->sec, __pyx_v_cfield, (&__pyx_v_cnumComp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 63, __pyx_L1_error) /* "PETSc/Section.pyx":64 * cdef PetscInt cfield = asInt(field), cnumComp = 0 * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) * return toInt(cnumComp) # <<<<<<<<<<<<<< * * def setFieldComponents(self,field,numComp): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumComp); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":61 * CHKERR( PetscSectionSetFieldName(self.sec,cfield,cname) ) * * def getFieldComponents(self,field): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field), cnumComp = 0 * CHKERR( PetscSectionGetFieldComponents(self.sec,cfield,&cnumComp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":66 * return toInt(cnumComp) * * def setFieldComponents(self,field,numComp): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumComp = asInt(numComp) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_26setFieldComponents[] = "Section.setFieldComponents(self, field, numComp)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numComp = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldComponents (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_numComp,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numComp)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldComponents", 1, 2, 2, 1); __PYX_ERR(37, 66, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldComponents") < 0)) __PYX_ERR(37, 66, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_numComp = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldComponents", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 66, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_numComp); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26setFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_numComp) { PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumComp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldComponents", 0); /* "PETSc/Section.pyx":67 * * def setFieldComponents(self,field,numComp): * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumComp = asInt(numComp) * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 67, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":68 * def setFieldComponents(self,field,numComp): * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumComp = asInt(numComp) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numComp); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 68, __pyx_L1_error) __pyx_v_cnumComp = __pyx_t_1; /* "PETSc/Section.pyx":69 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumComp = asInt(numComp) * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) # <<<<<<<<<<<<<< * * def getChart(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldComponents(__pyx_v_self->sec, __pyx_v_cfield, __pyx_v_cnumComp)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 69, __pyx_L1_error) /* "PETSc/Section.pyx":66 * return toInt(cnumComp) * * def setFieldComponents(self,field,numComp): # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumComp = asInt(numComp) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":71 * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) * * def getChart(self): # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_29getChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_28getChart[] = "Section.getChart(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_29getChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getChart (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getChart", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getChart", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_28getChart(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28getChart(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getChart", 0); /* "PETSc/Section.pyx":72 * * def getChart(self): * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) */ __pyx_v_pStart = 0; __pyx_v_pEnd = 0; /* "PETSc/Section.pyx":73 * def getChart(self): * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) # <<<<<<<<<<<<<< * return toInt(pStart), toInt(pEnd) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetChart(__pyx_v_self->sec, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 73, __pyx_L1_error) /* "PETSc/Section.pyx":74 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) # <<<<<<<<<<<<<< * * def setChart(self, pStart, pEnd): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pEnd); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":71 * CHKERR( PetscSectionSetFieldComponents(self.sec,cfield,cnumComp) ) * * def getChart(self): # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( PetscSectionGetChart(self.sec, &pStart, &pEnd) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Section.getChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":76 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart, pEnd): # <<<<<<<<<<<<<< * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_31setChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_30setChart[] = "Section.setChart(self, pStart, pEnd)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_31setChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pStart = 0; PyObject *__pyx_v_pEnd = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setChart (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pStart,&__pyx_n_s_pEnd,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pStart)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pEnd)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, 1); __PYX_ERR(37, 76, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setChart") < 0)) __PYX_ERR(37, 76, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_pStart = values[0]; __pyx_v_pEnd = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 76, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_30setChart(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30setChart(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd) { PetscInt __pyx_v_cStart; PetscInt __pyx_v_cEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setChart", 0); /* "PETSc/Section.pyx":77 * * def setChart(self, pStart, pEnd): * cdef PetscInt cStart = asInt(pStart) # <<<<<<<<<<<<<< * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pStart); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 77, __pyx_L1_error) __pyx_v_cStart = __pyx_t_1; /* "PETSc/Section.pyx":78 * def setChart(self, pStart, pEnd): * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pEnd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 78, __pyx_L1_error) __pyx_v_cEnd = __pyx_t_1; /* "PETSc/Section.pyx":79 * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) # <<<<<<<<<<<<<< * * def getDof(self,point): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetChart(__pyx_v_self->sec, __pyx_v_cStart, __pyx_v_cEnd)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 79, __pyx_L1_error) /* "PETSc/Section.pyx":76 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart, pEnd): # <<<<<<<<<<<<<< * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":81 * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) * * def getDof(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_32getDof[] = "Section.getDof(self, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getDof") < 0)) __PYX_ERR(37, 81, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDof", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 81, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_32getDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32getDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDof", 0); /* "PETSc/Section.pyx":82 * * def getDof(self,point): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 82, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "PETSc/Section.pyx":83 * def getDof(self,point): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetDof(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 83, __pyx_L1_error) /* "PETSc/Section.pyx":84 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setDof(self,point,numDof): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":81 * CHKERR( PetscSectionSetChart(self.sec, cStart, cEnd) ) * * def getDof(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetDof(self.sec,cpoint,&cnumDof) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":86 * return toInt(cnumDof) * * def setDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_35setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_34setDof[] = "Section.setDof(self, point, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_35setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setDof", 1, 2, 2, 1); __PYX_ERR(37, 86, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDof") < 0)) __PYX_ERR(37, 86, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 86, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_34setDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34setDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDof", 0); /* "PETSc/Section.pyx":87 * * def setDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 87, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":88 * def setDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 88, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":89 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def addDof(self,point,numDof): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 89, __pyx_L1_error) /* "PETSc/Section.pyx":86 * return toInt(cnumDof) * * def setDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":91 * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) * * def addDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_37addDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_36addDof[] = "Section.addDof(self, point, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_37addDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("addDof", 1, 2, 2, 1); __PYX_ERR(37, 91, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addDof") < 0)) __PYX_ERR(37, 91, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 91, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_36addDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36addDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addDof", 0); /* "PETSc/Section.pyx":92 * * def addDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 92, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":93 * def addDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 93, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":94 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def getFieldDof(self,point,field): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 94, __pyx_L1_error) /* "PETSc/Section.pyx":91 * CHKERR( PetscSectionSetDof(self.sec,cpoint,cnumDof) ) * * def addDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":96 * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) * * def getFieldDof(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_39getFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_38getFieldDof[] = "Section.getFieldDof(self, point, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_39getFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getFieldDof", 1, 2, 2, 1); __PYX_ERR(37, 96, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldDof") < 0)) __PYX_ERR(37, 96, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 96, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_38getFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38getFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldDof", 0); /* "PETSc/Section.pyx":97 * * def getFieldDof(self,point,field): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 97, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "PETSc/Section.pyx":98 * def getFieldDof(self,point,field): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 98, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":99 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 99, __pyx_L1_error) /* "PETSc/Section.pyx":100 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setFieldDof(self,point,field,numDof): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":96 * CHKERR( PetscSectionAddDof(self.sec,cpoint,cnumDof) ) * * def getFieldDof(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":102 * return toInt(cnumDof) * * def setFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_41setFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_40setFieldDof[] = "Section.setFieldDof(self, point, field, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_41setFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, 1); __PYX_ERR(37, 102, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, 2); __PYX_ERR(37, 102, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldDof") < 0)) __PYX_ERR(37, 102, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 102, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_40setFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40setFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldDof", 0); /* "PETSc/Section.pyx":103 * * def setFieldDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 103, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":104 * def setFieldDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 104, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":105 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 105, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":106 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def addFieldDof(self,point,field,numDof): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 106, __pyx_L1_error) /* "PETSc/Section.pyx":102 * return toInt(cnumDof) * * def setFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":108 * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_43addFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_42addFieldDof[] = "Section.addFieldDof(self, point, field, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_43addFieldDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addFieldDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, 1); __PYX_ERR(37, 108, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, 2); __PYX_ERR(37, 108, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addFieldDof") < 0)) __PYX_ERR(37, 108, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 108, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_42addFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42addFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addFieldDof", 0); /* "PETSc/Section.pyx":109 * * def addFieldDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 109, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":110 * def addFieldDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 110, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":111 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 111, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":112 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def getConstraintDof(self,point): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddFieldDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 112, __pyx_L1_error) /* "PETSc/Section.pyx":108 * CHKERR( PetscSectionSetFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":114 * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintDof(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_45getConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_44getConstraintDof[] = "Section.getConstraintDof(self, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_45getConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstraintDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getConstraintDof") < 0)) __PYX_ERR(37, 114, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConstraintDof", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 114, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_44getConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_44getConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstraintDof", 0); /* "PETSc/Section.pyx":115 * * def getConstraintDof(self,point): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 115, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "PETSc/Section.pyx":116 * def getConstraintDof(self,point): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 116, __pyx_L1_error) /* "PETSc/Section.pyx":117 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setConstraintDof(self,point,numDof): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":114 * CHKERR( PetscSectionAddFieldDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintDof(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * CHKERR( PetscSectionGetConstraintDof(self.sec,cpoint,&cnumDof) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":119 * return toInt(cnumDof) * * def setConstraintDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_47setConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_46setConstraintDof[] = "Section.setConstraintDof(self, point, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_47setConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraintDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setConstraintDof", 1, 2, 2, 1); __PYX_ERR(37, 119, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConstraintDof") < 0)) __PYX_ERR(37, 119, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraintDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 119, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_46setConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_46setConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraintDof", 0); /* "PETSc/Section.pyx":120 * * def setConstraintDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 120, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":121 * def setConstraintDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 121, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":122 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def addConstraintDof(self,point,numDof): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 122, __pyx_L1_error) /* "PETSc/Section.pyx":119 * return toInt(cnumDof) * * def setConstraintDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":124 * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) * * def addConstraintDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_49addConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_48addConstraintDof[] = "Section.addConstraintDof(self, point, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_49addConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addConstraintDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_numDof,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("addConstraintDof", 1, 2, 2, 1); __PYX_ERR(37, 124, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addConstraintDof") < 0)) __PYX_ERR(37, 124, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_numDof = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addConstraintDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 124, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_48addConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48addConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addConstraintDof", 0); /* "PETSc/Section.pyx":125 * * def addConstraintDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 125, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":126 * def addConstraintDof(self,point,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 126, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":127 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) # <<<<<<<<<<<<<< * * def getFieldConstraintDof(self,point,field): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 127, __pyx_L1_error) /* "PETSc/Section.pyx":124 * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,cnumDof) ) * * def addConstraintDof(self,point,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cnumDof = asInt(numDof) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":129 * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) * * def getFieldConstraintDof(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_51getFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_50getFieldConstraintDof[] = "Section.getFieldConstraintDof(self, point, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_51getFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldConstraintDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getFieldConstraintDof", 1, 2, 2, 1); __PYX_ERR(37, 129, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldConstraintDof") < 0)) __PYX_ERR(37, 129, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldConstraintDof", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 129, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_50getFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50getFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cnumDof; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldConstraintDof", 0); /* "PETSc/Section.pyx":130 * * def getFieldConstraintDof(self,point,field): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 130, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_cnumDof = 0; /* "PETSc/Section.pyx":131 * def getFieldConstraintDof(self,point,field): * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 131, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":132 * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) # <<<<<<<<<<<<<< * return toInt(cnumDof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_cnumDof))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 132, __pyx_L1_error) /* "PETSc/Section.pyx":133 * cdef PetscInt cfield = asInt(field) * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&cnumDof) ) * return toInt(cnumDof) # <<<<<<<<<<<<<< * * def setFieldConstraintDof(self,point,field,numDof): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnumDof); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":129 * CHKERR( PetscSectionAddConstraintDof(self.sec,cpoint,cnumDof) ) * * def getFieldConstraintDof(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cnumDof = 0 * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":135 * return toInt(cnumDof) * * def setFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_53setFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_52setFieldConstraintDof[] = "Section.setFieldConstraintDof(self, point, field, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_53setFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldConstraintDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, 1); __PYX_ERR(37, 135, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, 2); __PYX_ERR(37, 135, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldConstraintDof") < 0)) __PYX_ERR(37, 135, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 135, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_52setFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52setFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldConstraintDof", 0); /* "PETSc/Section.pyx":136 * * def setFieldConstraintDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 136, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":137 * def setFieldConstraintDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 137, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":138 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 138, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":139 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def addFieldConstraintDof(self,point,field,numDof): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 139, __pyx_L1_error) /* "PETSc/Section.pyx":135 * return toInt(cnumDof) * * def setFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":141 * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55addFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_54addFieldConstraintDof[] = "Section.addFieldConstraintDof(self, point, field, numDof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55addFieldConstraintDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_numDof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addFieldConstraintDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_numDof,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, 1); __PYX_ERR(37, 141, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, 2); __PYX_ERR(37, 141, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addFieldConstraintDof") < 0)) __PYX_ERR(37, 141, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_numDof = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 141, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_54addFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54addFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_numDof) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_cnumDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addFieldConstraintDof", 0); /* "PETSc/Section.pyx":142 * * def addFieldConstraintDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 142, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":143 * def addFieldConstraintDof(self,point,field,numDof): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 143, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":144 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) # <<<<<<<<<<<<<< * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numDof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 144, __pyx_L1_error) __pyx_v_cnumDof = __pyx_t_1; /* "PETSc/Section.pyx":145 * cdef PetscInt cfield = asInt(field) * cdef PetscInt cnumDof = asInt(numDof) * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) # <<<<<<<<<<<<<< * * def getConstraintIndices(self,point): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionAddFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cnumDof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 145, __pyx_L1_error) /* "PETSc/Section.pyx":141 * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def addFieldConstraintDof(self,point,field,numDof): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.addFieldConstraintDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":147 * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintIndices(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57getConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_56getConstraintIndices[] = "Section.getConstraintIndices(self, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57getConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstraintIndices (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getConstraintIndices") < 0)) __PYX_ERR(37, 147, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConstraintIndices", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 147, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_56getConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_56getConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_nindex; PetscInt const *__pyx_v_indices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstraintIndices", 0); /* "PETSc/Section.pyx":148 * * def getConstraintIndices(self,point): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 148, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":149 * def getConstraintIndices(self,point): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) */ __pyx_v_nindex = 0; /* "PETSc/Section.pyx":150 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) */ __pyx_v_indices = NULL; /* "PETSc/Section.pyx":151 * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) * return array_i(nindex, indices) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_nindex))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 151, __pyx_L1_error) /* "PETSc/Section.pyx":152 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) # <<<<<<<<<<<<<< * return array_i(nindex, indices) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 152, __pyx_L1_error) /* "PETSc/Section.pyx":153 * CHKERR( PetscSectionGetConstraintDof(self.sec, cpoint, &nindex) ) * CHKERR( PetscSectionGetConstraintIndices(self.sec, cpoint, &indices) ) * return array_i(nindex, indices) # <<<<<<<<<<<<<< * * def setConstraintIndices(self,point,indices): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nindex, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":147 * CHKERR( PetscSectionAddFieldConstraintDof(self.sec,cpoint,cfield,cnumDof) ) * * def getConstraintIndices(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":155 * return array_i(nindex, indices) * * def setConstraintIndices(self,point,indices): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_59setConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_58setConstraintIndices[] = "Section.setConstraintIndices(self, point, indices)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_59setConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_indices = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraintIndices (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_indices,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setConstraintIndices", 1, 2, 2, 1); __PYX_ERR(37, 155, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConstraintIndices") < 0)) __PYX_ERR(37, 155, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_indices = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraintIndices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 155, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_58setConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_indices); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_58setConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_indices) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_nindex; PetscInt *__pyx_v_cindices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraintIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/Section.pyx":156 * * def setConstraintIndices(self,point,indices): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 156, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":157 * def setConstraintIndices(self,point,indices): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) */ __pyx_v_nindex = 0; /* "PETSc/Section.pyx":158 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) */ __pyx_v_cindices = NULL; /* "PETSc/Section.pyx":159 * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nindex), (&__pyx_v_cindices))); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Section.pyx":160 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_nindex)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(37, 160, __pyx_L1_error) /* "PETSc/Section.pyx":161 * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetConstraintDof(self.sec,cpoint,nindex) ) * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) # <<<<<<<<<<<<<< * * def getFieldConstraintIndices(self,point,field): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cindices)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(37, 161, __pyx_L1_error) /* "PETSc/Section.pyx":155 * return array_i(nindex, indices) * * def setConstraintIndices(self,point,indices): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt nindex = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.setConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":163 * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) * * def getFieldConstraintIndices(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_61getFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_60getFieldConstraintIndices[] = "Section.getFieldConstraintIndices(self, point, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_61getFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldConstraintIndices (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getFieldConstraintIndices", 1, 2, 2, 1); __PYX_ERR(37, 163, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldConstraintIndices") < 0)) __PYX_ERR(37, 163, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldConstraintIndices", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 163, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_60getFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60getFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_nindex; PetscInt const *__pyx_v_indices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldConstraintIndices", 0); /* "PETSc/Section.pyx":164 * * def getFieldConstraintIndices(self,point,field): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 164, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":165 * def getFieldConstraintIndices(self,point,field): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 165, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":166 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) */ __pyx_v_nindex = 0; /* "PETSc/Section.pyx":167 * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) */ __pyx_v_indices = NULL; /* "PETSc/Section.pyx":168 * cdef PetscInt nindex = 0 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) * return array_i(nindex, indices) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_nindex))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 168, __pyx_L1_error) /* "PETSc/Section.pyx":169 * cdef const PetscInt *indices = NULL * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) # <<<<<<<<<<<<<< * return array_i(nindex, indices) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_indices))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 169, __pyx_L1_error) /* "PETSc/Section.pyx":170 * CHKERR( PetscSectionGetFieldConstraintDof(self.sec,cpoint,cfield,&nindex) ) * CHKERR( PetscSectionGetFieldConstraintIndices(self.sec,cpoint,cfield,&indices) ) * return array_i(nindex, indices) # <<<<<<<<<<<<<< * * def setFieldConstraintIndices(self,point,field,indices): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nindex, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":163 * CHKERR( PetscSectionSetConstraintIndices(self.sec,cpoint,cindices) ) * * def getFieldConstraintIndices(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":172 * return array_i(nindex, indices) * * def setFieldConstraintIndices(self,point,field,indices): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_63setFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_62setFieldConstraintIndices[] = "Section.setFieldConstraintIndices(self, point, field, indices)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_63setFieldConstraintIndices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_indices = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldConstraintIndices (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_indices,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, 1); __PYX_ERR(37, 172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, 2); __PYX_ERR(37, 172, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldConstraintIndices") < 0)) __PYX_ERR(37, 172, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_indices = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 172, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_62setFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_indices); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62setFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_indices) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_nindex; PetscInt *__pyx_v_cindices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldConstraintIndices", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/Section.pyx":173 * * def setFieldConstraintIndices(self,point,field,indices): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 173, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":174 * def setFieldConstraintIndices(self,point,field,indices): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 174, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":175 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 # <<<<<<<<<<<<<< * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) */ __pyx_v_nindex = 0; /* "PETSc/Section.pyx":176 * cdef PetscInt cfield = asInt(field) * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL # <<<<<<<<<<<<<< * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) */ __pyx_v_cindices = NULL; /* "PETSc/Section.pyx":177 * cdef PetscInt nindex = 0 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_indices, (&__pyx_v_nindex), (&__pyx_v_cindices))); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Section.pyx":178 * cdef PetscInt *cindices = NULL * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldConstraintDof(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_nindex)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(37, 178, __pyx_L1_error) /* "PETSc/Section.pyx":179 * indices = iarray_i(indices, &nindex, &cindices) * CHKERR( PetscSectionSetFieldConstraintDof(self.sec,cpoint,cfield,nindex) ) * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) # <<<<<<<<<<<<<< * * def getMaxDof(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldConstraintIndices(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_cindices)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(37, 179, __pyx_L1_error) /* "PETSc/Section.pyx":172 * return array_i(nindex, indices) * * def setFieldConstraintIndices(self,point,field,indices): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldConstraintIndices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":181 * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) * * def getMaxDof(self): # <<<<<<<<<<<<<< * cdef PetscInt maxDof = 0 * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65getMaxDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_64getMaxDof[] = "Section.getMaxDof(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65getMaxDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxDof (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxDof", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_64getMaxDof(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64getMaxDof(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_maxDof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxDof", 0); /* "PETSc/Section.pyx":182 * * def getMaxDof(self): * cdef PetscInt maxDof = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) * return toInt(maxDof) */ __pyx_v_maxDof = 0; /* "PETSc/Section.pyx":183 * def getMaxDof(self): * cdef PetscInt maxDof = 0 * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) # <<<<<<<<<<<<<< * return toInt(maxDof) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetMaxDof(__pyx_v_self->sec, (&__pyx_v_maxDof))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 183, __pyx_L1_error) /* "PETSc/Section.pyx":184 * cdef PetscInt maxDof = 0 * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) * return toInt(maxDof) # <<<<<<<<<<<<<< * * def getStorageSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_maxDof); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":181 * CHKERR( PetscSectionSetFieldConstraintIndices(self.sec,cpoint,cfield,cindices) ) * * def getMaxDof(self): # <<<<<<<<<<<<<< * cdef PetscInt maxDof = 0 * CHKERR( PetscSectionGetMaxDof(self.sec,&maxDof) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getMaxDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":186 * return toInt(maxDof) * * def getStorageSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_67getStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_66getStorageSize[] = "Section.getStorageSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_67getStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStorageSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStorageSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStorageSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_66getStorageSize(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_66getStorageSize(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStorageSize", 0); /* "PETSc/Section.pyx":187 * * def getStorageSize(self): * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) * return toInt(size) */ __pyx_v_size = 0; /* "PETSc/Section.pyx":188 * def getStorageSize(self): * cdef PetscInt size = 0 * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetStorageSize(__pyx_v_self->sec, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 188, __pyx_L1_error) /* "PETSc/Section.pyx":189 * cdef PetscInt size = 0 * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getConstrainedStorageSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":186 * return toInt(maxDof) * * def getStorageSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( PetscSectionGetStorageSize(self.sec,&size) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getStorageSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":191 * return toInt(size) * * def getConstrainedStorageSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_69getConstrainedStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_68getConstrainedStorageSize[] = "Section.getConstrainedStorageSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_69getConstrainedStorageSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstrainedStorageSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConstrainedStorageSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConstrainedStorageSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_68getConstrainedStorageSize(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getConstrainedStorageSize(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstrainedStorageSize", 0); /* "PETSc/Section.pyx":192 * * def getConstrainedStorageSize(self): * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) * return toInt(size) */ __pyx_v_size = 0; /* "PETSc/Section.pyx":193 * def getConstrainedStorageSize(self): * cdef PetscInt size = 0 * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetConstrainedStorageSize(__pyx_v_self->sec, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 193, __pyx_L1_error) /* "PETSc/Section.pyx":194 * cdef PetscInt size = 0 * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getOffset(self,point): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":191 * return toInt(size) * * def getConstrainedStorageSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( PetscSectionGetConstrainedStorageSize(self.sec,&size) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Section.getConstrainedStorageSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":196 * return toInt(size) * * def getOffset(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), offset = 0 * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_71getOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_70getOffset[] = "Section.getOffset(self, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_71getOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOffset (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOffset") < 0)) __PYX_ERR(37, 196, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getOffset", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 196, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_70getOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_offset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOffset", 0); /* "PETSc/Section.pyx":197 * * def getOffset(self,point): * cdef PetscInt cpoint = asInt(point), offset = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) * return toInt(offset) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 197, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_offset = 0; /* "PETSc/Section.pyx":198 * def getOffset(self,point): * cdef PetscInt cpoint = asInt(point), offset = 0 * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) # <<<<<<<<<<<<<< * return toInt(offset) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetOffset(__pyx_v_self->sec, __pyx_v_cpoint, (&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 198, __pyx_L1_error) /* "PETSc/Section.pyx":199 * cdef PetscInt cpoint = asInt(point), offset = 0 * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) * return toInt(offset) # <<<<<<<<<<<<<< * * def setOffset(self,point,offset): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":196 * return toInt(size) * * def getOffset(self,point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), offset = 0 * CHKERR( PetscSectionGetOffset(self.sec,cpoint,&offset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":201 * return toInt(offset) * * def setOffset(self,point,offset): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt coffset = asInt(offset) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_73setOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_72setOffset[] = "Section.setOffset(self, point, offset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_73setOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_offset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOffset (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_offset,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setOffset", 1, 2, 2, 1); __PYX_ERR(37, 201, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOffset") < 0)) __PYX_ERR(37, 201, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_offset = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 201, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_72setOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_offset); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72setOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_offset) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_coffset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOffset", 0); /* "PETSc/Section.pyx":202 * * def setOffset(self,point,offset): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 202, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":203 * def setOffset(self,point,offset): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt coffset = asInt(offset) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_offset); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 203, __pyx_L1_error) __pyx_v_coffset = __pyx_t_1; /* "PETSc/Section.pyx":204 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) # <<<<<<<<<<<<<< * * def getFieldOffset(self,point,field): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetOffset(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_coffset)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 204, __pyx_L1_error) /* "PETSc/Section.pyx":201 * return toInt(offset) * * def setOffset(self,point,offset): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt coffset = asInt(offset) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":206 * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) * * def getFieldOffset(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_75getFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_74getFieldOffset[] = "Section.getFieldOffset(self, point, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_75getFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldOffset (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getFieldOffset", 1, 2, 2, 1); __PYX_ERR(37, 206, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldOffset") < 0)) __PYX_ERR(37, 206, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldOffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 206, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_74getFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74getFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_offset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldOffset", 0); /* "PETSc/Section.pyx":207 * * def getFieldOffset(self,point,field): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt offset = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 207, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":208 * def getFieldOffset(self,point,field): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt offset = 0 * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 208, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":209 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt offset = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) * return toInt(offset) */ __pyx_v_offset = 0; /* "PETSc/Section.pyx":210 * cdef PetscInt cfield = asInt(field) * cdef PetscInt offset = 0 * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) # <<<<<<<<<<<<<< * return toInt(offset) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetFieldOffset(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_offset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 210, __pyx_L1_error) /* "PETSc/Section.pyx":211 * cdef PetscInt offset = 0 * CHKERR( PetscSectionGetFieldOffset(self.sec,cpoint,cfield,&offset) ) * return toInt(offset) # <<<<<<<<<<<<<< * * def setFieldOffset(self,point,field,offset): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":206 * CHKERR( PetscSectionSetOffset(self.sec,cpoint,coffset) ) * * def getFieldOffset(self,point,field): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Section.getFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":213 * return toInt(offset) * * def setFieldOffset(self,point,field,offset): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_77setFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_76setFieldOffset[] = "Section.setFieldOffset(self, point, field, offset)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_77setFieldOffset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_offset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldOffset (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,&__pyx_n_s_offset,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, 1); __PYX_ERR(37, 213, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, 2); __PYX_ERR(37, 213, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldOffset") < 0)) __PYX_ERR(37, 213, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; __pyx_v_offset = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 213, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_76setFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_offset); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76setFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field, PyObject *__pyx_v_offset) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PetscInt __pyx_v_coffset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldOffset", 0); /* "PETSc/Section.pyx":214 * * def setFieldOffset(self,point,field,offset): * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * cdef PetscInt coffset = asInt(offset) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 214, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/Section.pyx":215 * def setFieldOffset(self,point,field,offset): * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 215, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/Section.pyx":216 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * cdef PetscInt coffset = asInt(offset) # <<<<<<<<<<<<<< * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_offset); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 216, __pyx_L1_error) __pyx_v_coffset = __pyx_t_1; /* "PETSc/Section.pyx":217 * cdef PetscInt cfield = asInt(field) * cdef PetscInt coffset = asInt(offset) * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) # <<<<<<<<<<<<<< * * def getOffsetRange(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionSetFieldOffset(__pyx_v_self->sec, __pyx_v_cpoint, __pyx_v_cfield, __pyx_v_coffset)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 217, __pyx_L1_error) /* "PETSc/Section.pyx":213 * return toInt(offset) * * def setFieldOffset(self,point,field,offset): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.setFieldOffset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":219 * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) * * def getOffsetRange(self): # <<<<<<<<<<<<<< * cdef PetscInt oStart = 0, oEnd = 0 * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_79getOffsetRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_78getOffsetRange[] = "Section.getOffsetRange(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_79getOffsetRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOffsetRange (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOffsetRange", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOffsetRange", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_78getOffsetRange(((struct PyPetscSectionObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78getOffsetRange(struct PyPetscSectionObject *__pyx_v_self) { PetscInt __pyx_v_oStart; PetscInt __pyx_v_oEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOffsetRange", 0); /* "PETSc/Section.pyx":220 * * def getOffsetRange(self): * cdef PetscInt oStart = 0, oEnd = 0 # <<<<<<<<<<<<<< * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) * return toInt(oStart),toInt(oEnd) */ __pyx_v_oStart = 0; __pyx_v_oEnd = 0; /* "PETSc/Section.pyx":221 * def getOffsetRange(self): * cdef PetscInt oStart = 0, oEnd = 0 * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) # <<<<<<<<<<<<<< * return toInt(oStart),toInt(oEnd) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetOffsetRange(__pyx_v_self->sec, (&__pyx_v_oStart), (&__pyx_v_oEnd))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(37, 221, __pyx_L1_error) /* "PETSc/Section.pyx":222 * cdef PetscInt oStart = 0, oEnd = 0 * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) * return toInt(oStart),toInt(oEnd) # <<<<<<<<<<<<<< * * def createGlobalSection(self, SF sf): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_oStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_oEnd); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Section.pyx":219 * CHKERR( PetscSectionSetFieldOffset(self.sec,cpoint,cfield,coffset) ) * * def getOffsetRange(self): # <<<<<<<<<<<<<< * cdef PetscInt oStart = 0, oEnd = 0 * CHKERR( PetscSectionGetOffsetRange(self.sec,&oStart,&oEnd) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Section.getOffsetRange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Section.pyx":224 * return toInt(oStart),toInt(oEnd) * * def createGlobalSection(self, SF sf): # <<<<<<<<<<<<<< * cdef Section gsec = Section() * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_81createGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7Section_80createGlobalSection[] = "Section.createGlobalSection(self, SF sf)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_81createGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSFObject *__pyx_v_sf = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGlobalSection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGlobalSection") < 0)) __PYX_ERR(37, 224, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGlobalSection", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(37, 224, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Section.createGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(37, 224, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_80createGlobalSection(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_80createGlobalSection(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { struct PyPetscSectionObject *__pyx_v_gsec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGlobalSection", 0); /* "PETSc/Section.pyx":225 * * def createGlobalSection(self, SF sf): * cdef Section gsec = Section() # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) * return gsec */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gsec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Section.pyx":226 * def createGlobalSection(self, SF sf): * cdef Section gsec = Section() * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) # <<<<<<<<<<<<<< * return gsec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreateGlobalSection(__pyx_v_self->sec, __pyx_v_sf->sf, PETSC_FALSE, PETSC_FALSE, (&__pyx_v_gsec->sec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(37, 226, __pyx_L1_error) /* "PETSc/Section.pyx":227 * cdef Section gsec = Section() * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) * return gsec # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_gsec)); __pyx_r = ((PyObject *)__pyx_v_gsec); goto __pyx_L0; /* "PETSc/Section.pyx":224 * return toInt(oStart),toInt(oEnd) * * def createGlobalSection(self, SF sf): # <<<<<<<<<<<<<< * cdef Section gsec = Section() * CHKERR( PetscSectionCreateGlobalSection(self.sec,sf.sf,PETSC_FALSE,PETSC_FALSE,&gsec.sec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Section.createGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_gsec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":209 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.mat * self.mat = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Mat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Mat_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Mat___cinit__(struct PyPetscMatObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Mat.pyx":210 * * def __cinit__(self): * self.obj = &self.mat # <<<<<<<<<<<<<< * self.mat = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->mat)); /* "PETSc/Mat.pyx":211 * def __cinit__(self): * self.obj = &self.mat * self.mat = NULL # <<<<<<<<<<<<<< * * # unary operations */ __pyx_v_self->mat = NULL; /* "PETSc/Mat.pyx":209 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.mat * self.mat = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":215 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return mat_pos(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_3__pos__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_3__pos__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_2__pos__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_2__pos__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pos__", 0); /* "PETSc/Mat.pyx":216 * * def __pos__(self): * return mat_pos(self) # <<<<<<<<<<<<<< * * def __neg__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_pos(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":215 * # unary operations * * def __pos__(self): # <<<<<<<<<<<<<< * return mat_pos(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":218 * return mat_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return mat_neg(self) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5__neg__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5__neg__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_4__neg__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4__neg__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__neg__", 0); /* "PETSc/Mat.pyx":219 * * def __neg__(self): * return mat_neg(self) # <<<<<<<<<<<<<< * * # inplace binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_neg(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":218 * return mat_pos(self) * * def __neg__(self): # <<<<<<<<<<<<<< * return mat_neg(self) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":223 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return mat_iadd(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_7__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_7__iadd__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iadd__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_6__iadd__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_6__iadd__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iadd__", 0); /* "PETSc/Mat.pyx":224 * * def __iadd__(self, other): * return mat_iadd(self, other) # <<<<<<<<<<<<<< * * def __isub__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_iadd(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":223 * # inplace binary operations * * def __iadd__(self, other): # <<<<<<<<<<<<<< * return mat_iadd(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__iadd__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":226 * return mat_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return mat_isub(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9__isub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__isub__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_8__isub__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_8__isub__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__isub__", 0); /* "PETSc/Mat.pyx":227 * * def __isub__(self, other): * return mat_isub(self, other) # <<<<<<<<<<<<<< * * def __imul__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_isub(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":226 * return mat_iadd(self, other) * * def __isub__(self, other): # <<<<<<<<<<<<<< * return mat_isub(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__isub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":229 * return mat_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return mat_imul(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11__imul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__imul__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10__imul__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10__imul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__imul__", 0); /* "PETSc/Mat.pyx":230 * * def __imul__(self, other): * return mat_imul(self, other) # <<<<<<<<<<<<<< * * def __idiv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_imul(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":229 * return mat_isub(self, other) * * def __imul__(self, other): # <<<<<<<<<<<<<< * return mat_imul(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__imul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":232 * return mat_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__idiv__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__idiv__", 0); /* "PETSc/Mat.pyx":233 * * def __idiv__(self, other): * return mat_idiv(self, other) # <<<<<<<<<<<<<< * * def __itruediv__(self, other): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":232 * return mat_imul(self, other) * * def __idiv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "PETSc/Mat.pyx":235 * return mat_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_15__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_15__itruediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__itruediv__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_14__itruediv__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_14__itruediv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__itruediv__", 0); /* "PETSc/Mat.pyx":236 * * def __itruediv__(self, other): * return mat_idiv(self, other) # <<<<<<<<<<<<<< * * # binary operations */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_idiv(__pyx_v_self, __pyx_v_other)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":235 * return mat_idiv(self, other) * * def __itruediv__(self, other): # <<<<<<<<<<<<<< * return mat_idiv(self, other) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__itruediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":240 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_add(self, other) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_17__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_17__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_16__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 0); /* "PETSc/Mat.pyx":241 * * def __add__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_add(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":242 * def __add__(self, other): * if isinstance(self, Mat): * return mat_add(self, other) # <<<<<<<<<<<<<< * else: * return mat_radd(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 242, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_add(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":241 * * def __add__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_add(self, other) * else: */ } /* "PETSc/Mat.pyx":244 * return mat_add(self, other) * else: * return mat_radd(other, self) # <<<<<<<<<<<<<< * * def __sub__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 244, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_radd(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":240 * # binary operations * * def __add__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_add(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":246 * return mat_radd(other, self) * * def __sub__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_sub(self, other) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_19__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_19__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_18__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_18__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 0); /* "PETSc/Mat.pyx":247 * * def __sub__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_sub(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":248 * def __sub__(self, other): * if isinstance(self, Mat): * return mat_sub(self, other) # <<<<<<<<<<<<<< * else: * return mat_rsub(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 248, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_sub(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":247 * * def __sub__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_sub(self, other) * else: */ } /* "PETSc/Mat.pyx":250 * return mat_sub(self, other) * else: * return mat_rsub(other, self) # <<<<<<<<<<<<<< * * def __mul__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 250, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rsub(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":246 * return mat_radd(other, self) * * def __sub__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_sub(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":252 * return mat_rsub(other, self) * * def __mul__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * if isinstance(other, Vec): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_21__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_21__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_20__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_20__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 0); /* "PETSc/Mat.pyx":253 * * def __mul__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return mat_mul_vec(self, other) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":254 * def __mul__(self, other): * if isinstance(self, Mat): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return mat_mul_vec(self, other) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/Mat.pyx":255 * if isinstance(self, Mat): * if isinstance(other, Vec): * return mat_mul_vec(self, other) # <<<<<<<<<<<<<< * else: * return mat_mul(self, other) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 255, __pyx_L1_error) if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(38, 255, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul_vec(((struct PyPetscMatObject *)__pyx_v_self), ((struct PyPetscVecObject *)__pyx_v_other))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":254 * def __mul__(self, other): * if isinstance(self, Mat): * if isinstance(other, Vec): # <<<<<<<<<<<<<< * return mat_mul_vec(self, other) * else: */ } /* "PETSc/Mat.pyx":257 * return mat_mul_vec(self, other) * else: * return mat_mul(self, other) # <<<<<<<<<<<<<< * else: * return mat_rmul(other, self) */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 257, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_mul(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":253 * * def __mul__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * if isinstance(other, Vec): * return mat_mul_vec(self, other) */ } /* "PETSc/Mat.pyx":259 * return mat_mul(self, other) * else: * return mat_rmul(other, self) # <<<<<<<<<<<<<< * * def __div__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 259, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rmul(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":252 * return mat_rsub(other, self) * * def __mul__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * if isinstance(other, Vec): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":261 * return mat_rmul(other, self) * * def __div__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_div(self, other) */ /* Python wrapper */ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_23__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_23__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_22__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_22__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 0); /* "PETSc/Mat.pyx":262 * * def __div__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_div(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":263 * def __div__(self, other): * if isinstance(self, Mat): * return mat_div(self, other) # <<<<<<<<<<<<<< * else: * return mat_rdiv(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 263, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_div(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":262 * * def __div__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_div(self, other) * else: */ } /* "PETSc/Mat.pyx":265 * return mat_div(self, other) * else: * return mat_rdiv(other, self) # <<<<<<<<<<<<<< * * def __truediv__(self, other): */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 265, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rdiv(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":261 * return mat_rmul(other, self) * * def __div__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_div(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/ /* "PETSc/Mat.pyx":267 * return mat_rdiv(other, self) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_div(self, other) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_25__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_25__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_24__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_24__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__truediv__", 0); /* "PETSc/Mat.pyx":268 * * def __truediv__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_div(self, other) * else: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":269 * def __truediv__(self, other): * if isinstance(self, Mat): * return mat_div(self, other) # <<<<<<<<<<<<<< * else: * return mat_rdiv(other, self) */ __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 269, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_div(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":268 * * def __truediv__(self, other): * if isinstance(self, Mat): # <<<<<<<<<<<<<< * return mat_div(self, other) * else: */ } /* "PETSc/Mat.pyx":271 * return mat_div(self, other) * else: * return mat_rdiv(other, self) # <<<<<<<<<<<<<< * * # */ /*else*/ { __Pyx_XDECREF(__pyx_r); if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 271, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_mat_rdiv(((struct PyPetscMatObject *)__pyx_v_other), __pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":267 * return mat_rdiv(other, self) * * def __truediv__(self, other): # <<<<<<<<<<<<<< * if isinstance(self, Mat): * return mat_div(self, other) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":275 * # * * def __getitem__(self, ij): # <<<<<<<<<<<<<< * return mat_getitem(self, ij) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_27__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_26__getitem__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_ij)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_26__getitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "PETSc/Mat.pyx":276 * * def __getitem__(self, ij): * return mat_getitem(self, ij) # <<<<<<<<<<<<<< * * def __setitem__(self, ij, v): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_getitem(__pyx_v_self, __pyx_v_ij); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":275 * # * * def __getitem__(self, ij): # <<<<<<<<<<<<<< * return mat_getitem(self, ij) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":278 * return mat_getitem(self, ij) * * def __setitem__(self, ij, v): # <<<<<<<<<<<<<< * mat_setitem(self, ij, v) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Mat_29__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Mat_29__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_28__setitem__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_ij), ((PyObject *)__pyx_v_v)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Mat_28__setitem__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ij, PyObject *__pyx_v_v) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); /* "PETSc/Mat.pyx":279 * * def __setitem__(self, ij, v): * mat_setitem(self, ij, v) # <<<<<<<<<<<<<< * * def __call__(self, x, y=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mat_setitem(__pyx_v_self, __pyx_v_ij, __pyx_v_v); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 279, __pyx_L1_error) /* "PETSc/Mat.pyx":278 * return mat_getitem(self, ij) * * def __setitem__(self, ij, v): # <<<<<<<<<<<<<< * mat_setitem(self, ij, v) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":281 * mat_setitem(self, ij, v) * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: * y = self.createVecLeft() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_31__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_31__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(38, 281, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 281, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_30__call__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_30__call__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_y); /* "PETSc/Mat.pyx":282 * * def __call__(self, x, y=None): * if y is None: # <<<<<<<<<<<<<< * y = self.createVecLeft() * self.mult(x, y) */ __pyx_t_1 = (__pyx_v_y == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":283 * def __call__(self, x, y=None): * if y is None: * y = self.createVecLeft() # <<<<<<<<<<<<<< * self.mult(x, y) * return y */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":282 * * def __call__(self, x, y=None): * if y is None: # <<<<<<<<<<<<<< * y = self.createVecLeft() * self.mult(x, y) */ } /* "PETSc/Mat.pyx":284 * if y is None: * y = self.createVecLeft() * self.mult(x, y) # <<<<<<<<<<<<<< * return y * # */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mult); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 284, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 284, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_y); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":285 * y = self.createVecLeft() * self.mult(x, y) * return y # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_y); __pyx_r = __pyx_v_y; goto __pyx_L0; /* "PETSc/Mat.pyx":281 * mat_setitem(self, ij, v) * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: * y = self.createVecLeft() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Mat.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":288 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_33view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_32view[] = "Mat.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_33view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(38, 288, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 288, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(38, 288, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_32view(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_32view(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Mat.pyx":289 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( MatView(self.mat, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Mat.pyx":290 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( MatView(self.mat, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Mat.pyx":291 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( MatView(self.mat, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatView(__pyx_v_self->mat, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 291, __pyx_L1_error) /* "PETSc/Mat.pyx":288 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":293 * CHKERR( MatView(self.mat, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( MatDestroy(&self.mat) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_35destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_34destroy[] = "Mat.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_35destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_34destroy(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_34destroy(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Mat.pyx":294 * * def destroy(self): * CHKERR( MatDestroy(&self.mat) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroy((&__pyx_v_self->mat))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 294, __pyx_L1_error) /* "PETSc/Mat.pyx":295 * def destroy(self): * CHKERR( MatDestroy(&self.mat) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":293 * CHKERR( MatView(self.mat, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( MatDestroy(&self.mat) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":297 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_37create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_36create[] = "Mat.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_37create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(38, 297, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 297, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_36create(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_36create(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Mat.pyx":298 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 298, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Mat.pyx":299 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreate(ccomm, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":300 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_ccomm, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 300, __pyx_L1_error) /* "PETSc/Mat.pyx":301 * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":302 * CHKERR( MatCreate(ccomm, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def setType(self, mat_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":297 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":304 * return self * * def setType(self, mat_type): # <<<<<<<<<<<<<< * cdef PetscMatType cval = NULL * mat_type = str2bytes(mat_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_39setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_38setType[] = "Mat.setType(self, mat_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_39setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mat_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(38, 304, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 304, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_38setType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_38setType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type) { MatType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_mat_type); /* "PETSc/Mat.pyx":305 * * def setType(self, mat_type): * cdef PetscMatType cval = NULL # <<<<<<<<<<<<<< * mat_type = str2bytes(mat_type, &cval) * CHKERR( MatSetType(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Mat.pyx":306 * def setType(self, mat_type): * cdef PetscMatType cval = NULL * mat_type = str2bytes(mat_type, &cval) # <<<<<<<<<<<<<< * CHKERR( MatSetType(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mat_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mat_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":307 * cdef PetscMatType cval = NULL * mat_type = str2bytes(mat_type, &cval) * CHKERR( MatSetType(self.mat, cval) ) # <<<<<<<<<<<<<< * * def setSizes(self, size, bsize=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetType(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 307, __pyx_L1_error) /* "PETSc/Mat.pyx":304 * return self * * def setType(self, mat_type): # <<<<<<<<<<<<<< * cdef PetscMatType cval = NULL * mat_type = str2bytes(mat_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":309 * CHKERR( MatSetType(self.mat, cval) ) * * def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_41setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_40setSizes[] = "Mat.setSizes(self, size, bsize=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_41setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSizes") < 0)) __PYX_ERR(38, 309, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 309, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_40setSizes(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_40setSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSizes", 0); /* "PETSc/Mat.pyx":310 * * def setSizes(self, size, bsize=None): * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/Mat.pyx":311 * def setSizes(self, size, bsize=None): * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 311, __pyx_L1_error) /* "PETSc/Mat.pyx":312 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) # <<<<<<<<<<<<<< * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetSizes(__pyx_v_self->mat, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 312, __pyx_L1_error) /* "PETSc/Mat.pyx":313 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * if cbs != PETSC_DECIDE: * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) */ __pyx_t_2 = ((__pyx_v_rbs != PETSC_DECIDE) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":314 * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * else: */ __pyx_t_2 = ((__pyx_v_cbs != PETSC_DECIDE) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":315 * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatSetBlockSize(self.mat, rbs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_self->mat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 315, __pyx_L1_error) /* "PETSc/Mat.pyx":314 * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: * if cbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * else: */ goto __pyx_L4; } /* "PETSc/Mat.pyx":317 * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * else: * CHKERR( MatSetBlockSize(self.mat, rbs) ) # <<<<<<<<<<<<<< * * def setBlockSize(self, bsize): */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSize(__pyx_v_self->mat, __pyx_v_rbs)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 317, __pyx_L1_error) } __pyx_L4:; /* "PETSc/Mat.pyx":313 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * if rbs != PETSC_DECIDE: # <<<<<<<<<<<<<< * if cbs != PETSC_DECIDE: * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) */ } /* "PETSc/Mat.pyx":309 * CHKERR( MatSetType(self.mat, cval) ) * * def setSizes(self, size, bsize=None): # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":319 * CHKERR( MatSetBlockSize(self.mat, rbs) ) * * def setBlockSize(self, bsize): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * CHKERR( MatSetBlockSize(self.mat, bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_43setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_42setBlockSize[] = "Mat.setBlockSize(self, bsize)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_43setBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bsize = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSize") < 0)) __PYX_ERR(38, 319, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bsize = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 319, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_42setBlockSize(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_bsize); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_42setBlockSize(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_bsize) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSize", 0); /* "PETSc/Mat.pyx":320 * * def setBlockSize(self, bsize): * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSize(self.mat, bs) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 320, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "PETSc/Mat.pyx":321 * def setBlockSize(self, bsize): * cdef PetscInt bs = asInt(bsize) * CHKERR( MatSetBlockSize(self.mat, bs) ) # <<<<<<<<<<<<<< * * def setBlockSizes(self, row_bsize, col_bsize): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSize(__pyx_v_self->mat, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 321, __pyx_L1_error) /* "PETSc/Mat.pyx":319 * CHKERR( MatSetBlockSize(self.mat, rbs) ) * * def setBlockSize(self, bsize): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * CHKERR( MatSetBlockSize(self.mat, bs) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":323 * CHKERR( MatSetBlockSize(self.mat, bs) ) * * def setBlockSizes(self, row_bsize, col_bsize): # <<<<<<<<<<<<<< * cdef PetscInt rbs = asInt(row_bsize) * cdef PetscInt cbs = asInt(col_bsize) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_45setBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_44setBlockSizes[] = "Mat.setBlockSizes(self, row_bsize, col_bsize)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_45setBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_row_bsize = 0; PyObject *__pyx_v_col_bsize = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBlockSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row_bsize,&__pyx_n_s_col_bsize,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row_bsize)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col_bsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setBlockSizes", 1, 2, 2, 1); __PYX_ERR(38, 323, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBlockSizes") < 0)) __PYX_ERR(38, 323, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_row_bsize = values[0]; __pyx_v_col_bsize = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBlockSizes", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 323, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_44setBlockSizes(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row_bsize, __pyx_v_col_bsize); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_44setBlockSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row_bsize, PyObject *__pyx_v_col_bsize) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBlockSizes", 0); /* "PETSc/Mat.pyx":324 * * def setBlockSizes(self, row_bsize, col_bsize): * cdef PetscInt rbs = asInt(row_bsize) # <<<<<<<<<<<<<< * cdef PetscInt cbs = asInt(col_bsize) * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 324, __pyx_L1_error) __pyx_v_rbs = __pyx_t_1; /* "PETSc/Mat.pyx":325 * def setBlockSizes(self, row_bsize, col_bsize): * cdef PetscInt rbs = asInt(row_bsize) * cdef PetscInt cbs = asInt(col_bsize) # <<<<<<<<<<<<<< * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 325, __pyx_L1_error) __pyx_v_cbs = __pyx_t_1; /* "PETSc/Mat.pyx":326 * cdef PetscInt rbs = asInt(row_bsize) * cdef PetscInt cbs = asInt(col_bsize) * CHKERR( MatSetBlockSizes(self.mat, rbs, cbs) ) # <<<<<<<<<<<<<< * # * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetBlockSizes(__pyx_v_self->mat, __pyx_v_rbs, __pyx_v_cbs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 326, __pyx_L1_error) /* "PETSc/Mat.pyx":323 * CHKERR( MatSetBlockSize(self.mat, bs) ) * * def setBlockSizes(self, row_bsize, col_bsize): # <<<<<<<<<<<<<< * cdef PetscInt rbs = asInt(row_bsize) * cdef PetscInt cbs = asInt(col_bsize) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":329 * # * * def createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_47createAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_46createAIJ[] = "Mat.createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_47createAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createAIJ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createAIJ") < 0)) __PYX_ERR(38, 329, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createAIJ", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 329, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_46createAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_46createAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createAIJ", 0); /* "PETSc/Mat.pyx":331 * def createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None): * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATAIJ, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":332 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATAIJ, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 332, __pyx_L1_error) /* "PETSc/Mat.pyx":333 * cdef PetscMat newmat = NULL * Mat_Create(MATAIJ, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":335 * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 335, __pyx_L1_error) /* "PETSc/Mat.pyx":336 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":329 * # * * def createAIJ(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":338 * return self * * def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_49createBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_48createBAIJ[] = "Mat.createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_49createBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBAIJ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createBAIJ", 0, 2, 5, 1); __PYX_ERR(38, 338, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBAIJ") < 0)) __PYX_ERR(38, 338, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBAIJ", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 338, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_48createBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_48createBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBAIJ", 0); /* "PETSc/Mat.pyx":340 * def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATBAIJ, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":341 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATBAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATBAIJ, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 341, __pyx_L1_error) /* "PETSc/Mat.pyx":342 * cdef PetscMat newmat = NULL * Mat_Create(MATBAIJ, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":344 * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 344, __pyx_L1_error) /* "PETSc/Mat.pyx":345 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":338 * return self * * def createBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":347 * return self * * def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_51createSBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_50createSBAIJ[] = "Mat.createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_51createSBAIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSBAIJ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createSBAIJ", 0, 2, 5, 1); __PYX_ERR(38, 347, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSBAIJ") < 0)) __PYX_ERR(38, 347, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSBAIJ", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 347, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_50createSBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_50createSBAIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSBAIJ", 0); /* "PETSc/Mat.pyx":349 * def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":350 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATSBAIJ, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 350, __pyx_L1_error) /* "PETSc/Mat.pyx":351 * cdef PetscMat newmat = NULL * Mat_Create(MATSBAIJ, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":353 * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 353, __pyx_L1_error) /* "PETSc/Mat.pyx":354 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":347 * return self * * def createSBAIJ(self, size, bsize, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSBAIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":356 * return self * * def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_53createAIJCRL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_52createAIJCRL[] = "Mat.createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_53createAIJCRL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createAIJCRL (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_nnz,&__pyx_n_s_csr,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createAIJCRL") < 0)) __PYX_ERR(38, 356, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_nnz = values[2]; __pyx_v_csr = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createAIJCRL", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 356, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJCRL", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_52createAIJCRL(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_52createAIJCRL(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_nnz, PyObject *__pyx_v_csr, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createAIJCRL", 0); /* "PETSc/Mat.pyx":358 * def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None): * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":359 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATAIJCRL, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 359, __pyx_L1_error) /* "PETSc/Mat.pyx":360 * cdef PetscMat newmat = NULL * Mat_Create(MATAIJCRL, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":362 * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ(__pyx_v_self->mat, __pyx_v_nnz, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 362, __pyx_L1_error) /* "PETSc/Mat.pyx":363 * # preallocate matrix * Mat_AllocAIJ(self.mat, nnz, csr) * return self # <<<<<<<<<<<<<< * * def setPreallocationNNZ(self, nnz): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":356 * return self * * def createAIJCRL(self, size, bsize=None, nnz=None, csr=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJCRL", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":365 * return self * * def setPreallocationNNZ(self, nnz): # <<<<<<<<<<<<<< * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_55setPreallocationNNZ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_54setPreallocationNNZ[] = "Mat.setPreallocationNNZ(self, nnz)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_55setPreallocationNNZ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nnz = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreallocationNNZ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nnz,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPreallocationNNZ") < 0)) __PYX_ERR(38, 365, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nnz = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreallocationNNZ", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 365, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationNNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_54setPreallocationNNZ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_54setPreallocationNNZ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz) { PetscBool __pyx_v_done; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreallocationNNZ", 0); /* "PETSc/Mat.pyx":366 * * def setPreallocationNNZ(self, nnz): * cdef PetscBool done = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) */ __pyx_v_done = PETSC_FALSE; /* "PETSc/Mat.pyx":367 * def setPreallocationNNZ(self, nnz): * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) # <<<<<<<<<<<<<< * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_NNZ(self.mat, nnz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsPreallocated(__pyx_v_self->mat, (&__pyx_v_done))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 367, __pyx_L1_error) /* "PETSc/Mat.pyx":369 * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_NNZ(self.mat, nnz) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_NNZ(__pyx_v_self->mat, __pyx_v_nnz); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 369, __pyx_L1_error) /* "PETSc/Mat.pyx":370 * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_NNZ(self.mat, nnz) * return self # <<<<<<<<<<<<<< * * def setPreallocationCSR(self, csr): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":365 * return self * * def setPreallocationNNZ(self, nnz): # <<<<<<<<<<<<<< * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationNNZ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":372 * return self * * def setPreallocationCSR(self, csr): # <<<<<<<<<<<<<< * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_57setPreallocationCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_56setPreallocationCSR[] = "Mat.setPreallocationCSR(self, csr)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_57setPreallocationCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_csr = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreallocationCSR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_csr,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPreallocationCSR") < 0)) __PYX_ERR(38, 372, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_csr = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreallocationCSR", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 372, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_56setPreallocationCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_csr); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_56setPreallocationCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_csr) { PetscBool __pyx_v_done; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreallocationCSR", 0); /* "PETSc/Mat.pyx":373 * * def setPreallocationCSR(self, csr): * cdef PetscBool done = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) */ __pyx_v_done = PETSC_FALSE; /* "PETSc/Mat.pyx":374 * def setPreallocationCSR(self, csr): * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) # <<<<<<<<<<<<<< * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_CSR(self.mat, csr) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsPreallocated(__pyx_v_self->mat, (&__pyx_v_done))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 374, __pyx_L1_error) /* "PETSc/Mat.pyx":376 * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_CSR(self.mat, csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_AllocAIJ_CSR(__pyx_v_self->mat, __pyx_v_csr); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 376, __pyx_L1_error) /* "PETSc/Mat.pyx":377 * # if done: raise Error(PETSC_ERR_ORDER) * Mat_AllocAIJ_CSR(self.mat, csr) * return self # <<<<<<<<<<<<<< * * def createAIJWithArrays(self, size, csr, bsize=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":372 * return self * * def setPreallocationCSR(self, csr): # <<<<<<<<<<<<<< * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":379 * return self * * def createAIJWithArrays(self, size, csr, bsize=None, comm=None): # <<<<<<<<<<<<<< * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59createAIJWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_58createAIJWithArrays[] = "Mat.createAIJWithArrays(self, size, csr, bsize=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59createAIJWithArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_csr = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createAIJWithArrays (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_csr,&__pyx_n_s_bsize,&__pyx_n_s_comm,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csr)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createAIJWithArrays", 0, 2, 4, 1); __PYX_ERR(38, 379, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createAIJWithArrays") < 0)) __PYX_ERR(38, 379, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_csr = values[1]; __pyx_v_bsize = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createAIJWithArrays", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 379, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_58createAIJWithArrays(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_csr, __pyx_v_bsize, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_58createAIJWithArrays(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_csr, PyObject *__pyx_v_bsize, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_v_pi = 0; PyObject *__pyx_v_pj = 0; PyObject *__pyx_v_pv = 0; PyObject *__pyx_v_poi = 0; PyObject *__pyx_v_poj = 0; PyObject *__pyx_v_pov = 0; PetscInt __pyx_v_ni; PetscInt __pyx_v_noi; PetscInt *__pyx_v_i; PetscInt *__pyx_v_oi; PetscInt __pyx_v_nj; PetscInt __pyx_v_noj; PetscInt *__pyx_v_j; PetscInt *__pyx_v_oj; PetscInt __pyx_v_nv; PetscInt __pyx_v_nov; PetscScalar *__pyx_v_v; PetscScalar *__pyx_v_ov; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createAIJWithArrays", 0); __Pyx_INCREF(__pyx_v_csr); /* "PETSc/Mat.pyx":381 * def createAIJWithArrays(self, size, csr, bsize=None, comm=None): * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 381, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Mat.pyx":383 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/Mat.pyx":384 * # sizes and block sizes * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, __pyx_v_bsize, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 384, __pyx_L1_error) /* "PETSc/Mat.pyx":385 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 # <<<<<<<<<<<<<< * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_t_3 = ((__pyx_v_rbs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_rbs = 1; } /* "PETSc/Mat.pyx":386 * Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N) * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_3 = ((__pyx_v_cbs == PETSC_DECIDE) != 0); if (__pyx_t_3) { __pyx_v_cbs = __pyx_v_rbs; } /* "PETSc/Mat.pyx":387 * if rbs == PETSC_DECIDE: rbs = 1 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # unpack CSR argument */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 387, __pyx_L1_error) /* "PETSc/Mat.pyx":388 * if cbs == PETSC_DECIDE: cbs = rbs * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 388, __pyx_L1_error) /* "PETSc/Mat.pyx":391 * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov * try: # <<<<<<<<<<<<<< * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); /*try:*/ { /* "PETSc/Mat.pyx":392 * cdef object pi, pj, pv, poi, poj, pov * try: * (pi, pj, pv), (poi, poj, pov) = csr # <<<<<<<<<<<<<< * except (TypeError, ValueError): * pi, pj, pv = csr */ if ((likely(PyTuple_CheckExact(__pyx_v_csr))) || (PyList_CheckExact(__pyx_v_csr))) { PyObject* sequence = __pyx_v_csr; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(38, 392, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_csr); if (unlikely(!__pyx_t_9)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(38, 392, __pyx_L5_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L12_unpacking_done; __pyx_L11_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(38, 392, __pyx_L5_error) __pyx_L12_unpacking_done:; } if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) { PyObject* sequence = __pyx_t_7; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(38, 392, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_12 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_13)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_11 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 2; __pyx_t_12 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L13_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_13), 3) < 0) __PYX_ERR(38, 392, __pyx_L5_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L14_unpacking_done; __pyx_L13_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(38, 392, __pyx_L5_error) __pyx_L14_unpacking_done:; } __pyx_v_pi = __pyx_t_9; __pyx_t_9 = 0; __pyx_v_pj = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_pv = __pyx_t_12; __pyx_t_12 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(38, 392, __pyx_L5_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_12 = PyList_GET_ITEM(sequence, 0); __pyx_t_11 = PyList_GET_ITEM(sequence, 1); __pyx_t_9 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_9); #else __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 392, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_13)->tp_iternext; index = 0; __pyx_t_12 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 1; __pyx_t_11 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 2; __pyx_t_9 = __pyx_t_10(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_13), 3) < 0) __PYX_ERR(38, 392, __pyx_L5_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L16_unpacking_done; __pyx_L15_unpacking_failed:; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(38, 392, __pyx_L5_error) __pyx_L16_unpacking_done:; } __pyx_v_poi = __pyx_t_12; __pyx_t_12 = 0; __pyx_v_poj = __pyx_t_11; __pyx_t_11 = 0; __pyx_v_pov = __pyx_t_9; __pyx_t_9 = 0; /* "PETSc/Mat.pyx":391 * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov * try: # <<<<<<<<<<<<<< * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): */ } __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/Mat.pyx":393 * try: * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): # <<<<<<<<<<<<<< * pi, pj, pv = csr * poi = poj = pov = None */ __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_2) { __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(38, 393, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_9); /* "PETSc/Mat.pyx":394 * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): * pi, pj, pv = csr # <<<<<<<<<<<<<< * poi = poj = pov = None * # rows, cols, and values */ if ((likely(PyTuple_CheckExact(__pyx_v_csr))) || (PyList_CheckExact(__pyx_v_csr))) { PyObject* sequence = __pyx_v_csr; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(38, 394, __pyx_L7_except_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); } else { __pyx_t_11 = PyList_GET_ITEM(sequence, 0); __pyx_t_12 = PyList_GET_ITEM(sequence, 1); __pyx_t_13 = PyList_GET_ITEM(sequence, 2); } __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(__pyx_t_13); #else __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 394, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(38, 394, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 394, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_13); #endif } else { Py_ssize_t index = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_csr); if (unlikely(!__pyx_t_14)) __PYX_ERR(38, 394, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_10 = Py_TYPE(__pyx_t_14)->tp_iternext; index = 0; __pyx_t_11 = __pyx_t_10(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); index = 1; __pyx_t_12 = __pyx_t_10(__pyx_t_14); if (unlikely(!__pyx_t_12)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); index = 2; __pyx_t_13 = __pyx_t_10(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_13); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_14), 3) < 0) __PYX_ERR(38, 394, __pyx_L7_except_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(38, 394, __pyx_L7_except_error) __pyx_L20_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_pi, __pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF_SET(__pyx_v_pj, __pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_pv, __pyx_t_13); __pyx_t_13 = 0; /* "PETSc/Mat.pyx":395 * except (TypeError, ValueError): * pi, pj, pv = csr * poi = poj = pov = None # <<<<<<<<<<<<<< * # rows, cols, and values * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL */ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_poi, Py_None); __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_poj, Py_None); __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_pov, Py_None); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_exception_handled; } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "PETSc/Mat.pyx":391 * # unpack CSR argument * cdef object pi, pj, pv, poi, poj, pov * try: # <<<<<<<<<<<<<< * (pi, pj, pv), (poi, poj, pov) = csr * except (TypeError, ValueError): */ __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); goto __pyx_L1_error; __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6); __pyx_L10_try_end:; } /* "PETSc/Mat.pyx":397 * poi = poj = pov = None * # rows, cols, and values * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL # <<<<<<<<<<<<<< * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) */ __pyx_v_ni = 0; __pyx_v_noi = 0; __pyx_v_i = NULL; __pyx_v_oi = NULL; /* "PETSc/Mat.pyx":398 * # rows, cols, and values * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL # <<<<<<<<<<<<<< * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) */ __pyx_v_nj = 0; __pyx_v_noj = 0; __pyx_v_j = NULL; __pyx_v_oj = NULL; /* "PETSc/Mat.pyx":399 * cdef PetscInt ni=0, noi=0, *i=NULL, *oi=NULL * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) # <<<<<<<<<<<<<< * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_pi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_9)) __PYX_ERR(38, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_pi, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/Mat.pyx":400 * cdef PetscInt nj=0, noj=0, *j=NULL, *oj=NULL * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) # <<<<<<<<<<<<<< * if ni != m+1: raise ValueError( * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % */ __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_pj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_9)) __PYX_ERR(38, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_pj, __pyx_t_9); __pyx_t_9 = 0; /* "PETSc/Mat.pyx":401 * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( # <<<<<<<<<<<<<< * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) */ __pyx_t_3 = ((__pyx_v_ni != (__pyx_v_m + 1)) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/Mat.pyx":403 * if ni != m+1: raise ValueError( * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) # <<<<<<<<<<<<<< * if poi is not None and poj is not None: * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_9)) __PYX_ERR(38, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m + 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_8)) __PYX_ERR(38, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_8); __pyx_t_9 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; /* "PETSc/Mat.pyx":402 * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % # <<<<<<<<<<<<<< * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_A_matrix_with_d_rows_requires_a, __pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(38, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "PETSc/Mat.pyx":401 * pi = iarray_i(pi, &ni, &i) # Row pointers (diagonal) * pj = iarray_i(pj, &nj, &j) # Column indices (diagonal) * if ni != m+1: raise ValueError( # <<<<<<<<<<<<<< * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) */ __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_13, 0, 0, 0); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __PYX_ERR(38, 401, __pyx_L1_error) } /* "PETSc/Mat.pyx":404 * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: # <<<<<<<<<<<<<< * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) */ __pyx_t_15 = (__pyx_v_poi != Py_None); __pyx_t_16 = (__pyx_t_15 != 0); if (__pyx_t_16) { } else { __pyx_t_3 = __pyx_t_16; goto __pyx_L23_bool_binop_done; } __pyx_t_16 = (__pyx_v_poj != Py_None); __pyx_t_15 = (__pyx_t_16 != 0); __pyx_t_3 = __pyx_t_15; __pyx_L23_bool_binop_done:; if (__pyx_t_3) { /* "PETSc/Mat.pyx":405 * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) # <<<<<<<<<<<<<< * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) * cdef PetscInt nv=0, nov=0 */ __pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poi, (&__pyx_v_noi), (&__pyx_v_oi))); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF_SET(__pyx_v_poi, __pyx_t_13); __pyx_t_13 = 0; /* "PETSc/Mat.pyx":406 * if poi is not None and poj is not None: * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) # <<<<<<<<<<<<<< * cdef PetscInt nv=0, nov=0 * cdef PetscScalar *v=NULL, *ov=NULL */ __pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poj, (&__pyx_v_noj), (&__pyx_v_oj))); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF_SET(__pyx_v_poj, __pyx_t_13); __pyx_t_13 = 0; /* "PETSc/Mat.pyx":404 * "A matrix with %d rows requires a row pointer of length %d (given: %d)" % * (toInt(m), toInt(m+1), toInt(ni))) * if poi is not None and poj is not None: # <<<<<<<<<<<<<< * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) */ } /* "PETSc/Mat.pyx":407 * poi = iarray_i(poi, &noi, &oi) # Row pointers (off-diagonal) * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) * cdef PetscInt nv=0, nov=0 # <<<<<<<<<<<<<< * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) */ __pyx_v_nv = 0; __pyx_v_nov = 0; /* "PETSc/Mat.pyx":408 * poj = iarray_i(poj, &noj, &oj) # Column indices (off-diagonal) * cdef PetscInt nv=0, nov=0 * cdef PetscScalar *v=NULL, *ov=NULL # <<<<<<<<<<<<<< * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( */ __pyx_v_v = NULL; __pyx_v_ov = NULL; /* "PETSc/Mat.pyx":409 * cdef PetscInt nv=0, nov=0 * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) # <<<<<<<<<<<<<< * if nj != nv: raise ValueError( * "Given %d column indices but %d non-zero values" % */ __pyx_t_13 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pv, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF_SET(__pyx_v_pv, __pyx_t_13); __pyx_t_13 = 0; /* "PETSc/Mat.pyx":410 * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( # <<<<<<<<<<<<<< * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) */ __pyx_t_3 = ((__pyx_v_nj != __pyx_v_nv) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/Mat.pyx":412 * if nj != nv: raise ValueError( * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) # <<<<<<<<<<<<<< * if pov is not None: * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) */ __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_8)) __PYX_ERR(38, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8); __pyx_t_13 = 0; __pyx_t_8 = 0; /* "PETSc/Mat.pyx":411 * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( * "Given %d column indices but %d non-zero values" % # <<<<<<<<<<<<<< * (toInt(nj), toInt(nv))) * if pov is not None: */ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Given_d_column_indices_but_d_non, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(38, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":410 * cdef PetscScalar *v=NULL, *ov=NULL * pv = iarray_s(pv, &nv, &v) # Non-zero values (diagonal) * if nj != nv: raise ValueError( # <<<<<<<<<<<<<< * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) */ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __PYX_ERR(38, 410, __pyx_L1_error) } /* "PETSc/Mat.pyx":413 * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) * if pov is not None: # <<<<<<<<<<<<<< * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) * # create matrix */ __pyx_t_3 = (__pyx_v_pov != Py_None); __pyx_t_15 = (__pyx_t_3 != 0); if (__pyx_t_15) { /* "PETSc/Mat.pyx":414 * (toInt(nj), toInt(nv))) * if pov is not None: * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pov, (&__pyx_v_nov), (&__pyx_v_ov))); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_pov, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":413 * "Given %d column indices but %d non-zero values" % * (toInt(nj), toInt(nv))) * if pov is not None: # <<<<<<<<<<<<<< * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) * # create matrix */ } /* "PETSc/Mat.pyx":416 * pov = iarray_s(pov, &nov, &ov) # Non-zero values (off-diagonal) * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * if comm_size(ccomm) == 1: * CHKERR( MatCreateSeqAIJWithArrays( */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":417 * # create matrix * cdef PetscMat newmat = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( MatCreateSeqAIJWithArrays( * ccomm, m, n, i, j, v, &newmat) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(38, 417, __pyx_L1_error) __pyx_t_15 = ((__pyx_t_2 == 1) != 0); if (__pyx_t_15) { /* "PETSc/Mat.pyx":418 * cdef PetscMat newmat = NULL * if comm_size(ccomm) == 1: * CHKERR( MatCreateSeqAIJWithArrays( # <<<<<<<<<<<<<< * ccomm, m, n, i, j, v, &newmat) ) * csr = (pi, pj, pv) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSeqAIJWithArrays(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_i, __pyx_v_j, __pyx_v_v, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 418, __pyx_L1_error) /* "PETSc/Mat.pyx":420 * CHKERR( MatCreateSeqAIJWithArrays( * ccomm, m, n, i, j, v, &newmat) ) * csr = (pi, pj, pv) # <<<<<<<<<<<<<< * else: * if oi != NULL and oj != NULL and ov != NULL: */ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_pi); __Pyx_GIVEREF(__pyx_v_pi); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pi); __Pyx_INCREF(__pyx_v_pj); __Pyx_GIVEREF(__pyx_v_pj); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_pj); __Pyx_INCREF(__pyx_v_pv); __Pyx_GIVEREF(__pyx_v_pv); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_pv); __Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":417 * # create matrix * cdef PetscMat newmat = NULL * if comm_size(ccomm) == 1: # <<<<<<<<<<<<<< * CHKERR( MatCreateSeqAIJWithArrays( * ccomm, m, n, i, j, v, &newmat) ) */ goto __pyx_L27; } /* "PETSc/Mat.pyx":422 * csr = (pi, pj, pv) * else: * if oi != NULL and oj != NULL and ov != NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateMPIAIJWithSplitArrays( * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) */ /*else*/ { __pyx_t_3 = ((__pyx_v_oi != NULL) != 0); if (__pyx_t_3) { } else { __pyx_t_15 = __pyx_t_3; goto __pyx_L29_bool_binop_done; } __pyx_t_3 = ((__pyx_v_oj != NULL) != 0); if (__pyx_t_3) { } else { __pyx_t_15 = __pyx_t_3; goto __pyx_L29_bool_binop_done; } __pyx_t_3 = ((__pyx_v_ov != NULL) != 0); __pyx_t_15 = __pyx_t_3; __pyx_L29_bool_binop_done:; if (__pyx_t_15) { /* "PETSc/Mat.pyx":423 * else: * if oi != NULL and oj != NULL and ov != NULL: * CHKERR( MatCreateMPIAIJWithSplitArrays( # <<<<<<<<<<<<<< * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) * csr = ((pi, pj, pv), (poi, poj, pov)) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateMPIAIJWithSplitArrays(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_v_i, __pyx_v_j, __pyx_v_v, __pyx_v_oi, __pyx_v_oj, __pyx_v_ov, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 423, __pyx_L1_error) /* "PETSc/Mat.pyx":425 * CHKERR( MatCreateMPIAIJWithSplitArrays( * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) * csr = ((pi, pj, pv), (poi, poj, pov)) # <<<<<<<<<<<<<< * else: * CHKERR( MatCreateMPIAIJWithArrays( */ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_pi); __Pyx_GIVEREF(__pyx_v_pi); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pi); __Pyx_INCREF(__pyx_v_pj); __Pyx_GIVEREF(__pyx_v_pj); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_pj); __Pyx_INCREF(__pyx_v_pv); __Pyx_GIVEREF(__pyx_v_pv); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_pv); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(38, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_poi); __Pyx_GIVEREF(__pyx_v_poi); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_poi); __Pyx_INCREF(__pyx_v_poj); __Pyx_GIVEREF(__pyx_v_poj); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_poj); __Pyx_INCREF(__pyx_v_pov); __Pyx_GIVEREF(__pyx_v_pov); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_pov); __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_8); __pyx_t_7 = 0; __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_13); __pyx_t_13 = 0; /* "PETSc/Mat.pyx":422 * csr = (pi, pj, pv) * else: * if oi != NULL and oj != NULL and ov != NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateMPIAIJWithSplitArrays( * ccomm, m, n, M, N, i, j, v, oi, oj, ov, &newmat) ) */ goto __pyx_L28; } /* "PETSc/Mat.pyx":427 * csr = ((pi, pj, pv), (poi, poj, pov)) * else: * CHKERR( MatCreateMPIAIJWithArrays( # <<<<<<<<<<<<<< * ccomm, m, n, M, N, i, j, v, &newmat) ) * csr = None */ /*else*/ { /* "PETSc/Mat.pyx":428 * else: * CHKERR( MatCreateMPIAIJWithArrays( * ccomm, m, n, M, N, i, j, v, &newmat) ) # <<<<<<<<<<<<<< * csr = None * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateMPIAIJWithArrays(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_v_i, __pyx_v_j, __pyx_v_v, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 427, __pyx_L1_error) /* "PETSc/Mat.pyx":429 * CHKERR( MatCreateMPIAIJWithArrays( * ccomm, m, n, M, N, i, j, v, &newmat) ) * csr = None # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * self.set_attr('__csr__', csr) */ __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_csr, Py_None); } __pyx_L28:; } __pyx_L27:; /* "PETSc/Mat.pyx":430 * ccomm, m, n, M, N, i, j, v, &newmat) ) * csr = None * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * self.set_attr('__csr__', csr) * return self */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":431 * csr = None * PetscCLEAR(self.obj); self.mat = newmat * self.set_attr('__csr__', csr) # <<<<<<<<<<<<<< * return self * */ __pyx_t_13 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__csr__"), __pyx_v_csr); if (unlikely(!__pyx_t_13)) __PYX_ERR(38, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; /* "PETSc/Mat.pyx":432 * PetscCLEAR(self.obj); self.mat = newmat * self.set_attr('__csr__', csr) * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":379 * return self * * def createAIJWithArrays(self, size, csr, bsize=None, comm=None): # <<<<<<<<<<<<<< * # communicator * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_13); __Pyx_XDECREF(__pyx_t_14); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createAIJWithArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pi); __Pyx_XDECREF(__pyx_v_pj); __Pyx_XDECREF(__pyx_v_pv); __Pyx_XDECREF(__pyx_v_poi); __Pyx_XDECREF(__pyx_v_poj); __Pyx_XDECREF(__pyx_v_pov); __Pyx_XDECREF(__pyx_v_csr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":436 * # * * def createDense(self, size, bsize=None, array=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61createDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_60createDense[] = "Mat.createDense(self, size, bsize=None, array=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61createDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_array = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDense (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_bsize,&__pyx_n_s_array,&__pyx_n_s_comm,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createDense") < 0)) __PYX_ERR(38, 436, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_bsize = values[1]; __pyx_v_array = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createDense", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 436, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_60createDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_array, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60createDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, PyObject *__pyx_v_array, PyObject *__pyx_v_comm) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDense", 0); __Pyx_INCREF(__pyx_v_array); /* "PETSc/Mat.pyx":438 * def createDense(self, size, bsize=None, array=None, comm=None): * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * Mat_Create(MATDENSE, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":439 * # create matrix * cdef PetscMat newmat = NULL * Mat_Create(MATDENSE, comm, size, bsize, &newmat) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_Mat_Create(MATDENSE, __pyx_v_comm, __pyx_v_size, __pyx_v_bsize, (&__pyx_v_newmat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 439, __pyx_L1_error) /* "PETSc/Mat.pyx":440 * cdef PetscMat newmat = NULL * Mat_Create(MATDENSE, comm, size, bsize, &newmat) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * # preallocate matrix * if array is not None: */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":442 * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix * if array is not None: # <<<<<<<<<<<<<< * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) */ __pyx_t_2 = (__pyx_v_array != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":443 * # preallocate matrix * if array is not None: * array = Mat_AllocDense(self.mat, array) # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_Mat_AllocDense(__pyx_v_self->mat, __pyx_v_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Mat.pyx":444 * if array is not None: * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Mat.pyx":442 * PetscCLEAR(self.obj); self.mat = newmat * # preallocate matrix * if array is not None: # <<<<<<<<<<<<<< * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) */ } /* "PETSc/Mat.pyx":445 * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * def setPreallocationDense(self, array): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":436 * # * * def createDense(self, size, bsize=None, array=None, comm=None): # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":447 * return self * * def setPreallocationDense(self, array): # <<<<<<<<<<<<<< * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_63setPreallocationDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_62setPreallocationDense[] = "Mat.setPreallocationDense(self, array)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_63setPreallocationDense(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_array = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreallocationDense (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_array,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_array)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPreallocationDense") < 0)) __PYX_ERR(38, 447, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_array = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreallocationDense", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 447, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_62setPreallocationDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_array); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62setPreallocationDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_array) { PetscBool __pyx_v_done; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreallocationDense", 0); __Pyx_INCREF(__pyx_v_array); /* "PETSc/Mat.pyx":448 * * def setPreallocationDense(self, array): * cdef PetscBool done = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) */ __pyx_v_done = PETSC_FALSE; /* "PETSc/Mat.pyx":449 * def setPreallocationDense(self, array): * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) # <<<<<<<<<<<<<< * # if done: raise Error(PETSC_ERR_ORDER) * array = Mat_AllocDense(self.mat, array) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsPreallocated(__pyx_v_self->mat, (&__pyx_v_done))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 449, __pyx_L1_error) /* "PETSc/Mat.pyx":451 * CHKERR( MatIsPreallocated(self.mat, &done) ) * # if done: raise Error(PETSC_ERR_ORDER) * array = Mat_AllocDense(self.mat, array) # <<<<<<<<<<<<<< * self.set_attr('__array__', array) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_AllocDense(__pyx_v_self->mat, __pyx_v_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_array, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Mat.pyx":452 * # if done: raise Error(PETSC_ERR_ORDER) * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Mat.pyx":453 * array = Mat_AllocDense(self.mat, array) * self.set_attr('__array__', array) * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":447 * return self * * def setPreallocationDense(self, array): # <<<<<<<<<<<<<< * cdef PetscBool done = PETSC_FALSE * CHKERR( MatIsPreallocated(self.mat, &done) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationDense", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":457 * # * * def createScatter(self, Scatter scatter, comm=None): # <<<<<<<<<<<<<< * if comm is None: comm = scatter.getComm() * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_65createScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_64createScatter[] = "Mat.createScatter(self, Scatter scatter, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_65createScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscScatterObject *__pyx_v_scatter = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createScatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scatter)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createScatter") < 0)) __PYX_ERR(38, 457, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_scatter = ((struct PyPetscScatterObject *)values[0]); __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createScatter", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 457, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scatter), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "scatter", 0))) __PYX_ERR(38, 457, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_64createScatter(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_scatter, __pyx_v_comm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_64createScatter(struct PyPetscMatObject *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_scatter, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; MPI_Comm __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createScatter", 0); __Pyx_INCREF(__pyx_v_comm); /* "PETSc/Mat.pyx":458 * * def createScatter(self, Scatter scatter, comm=None): * if comm is None: comm = scatter.getComm() # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL */ __pyx_t_1 = (__pyx_v_comm == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_scatter), __pyx_n_s_getComm); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/Mat.pyx":459 * def createScatter(self, Scatter scatter, comm=None): * if comm is None: comm = scatter.getComm() * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 459, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_6; /* "PETSc/Mat.pyx":460 * if comm is None: comm = scatter.getComm() * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":461 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscMat newmat = NULL * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * return self */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateScatter(__pyx_v_ccomm, __pyx_v_scatter->sct, (&__pyx_v_newmat))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(38, 461, __pyx_L1_error) /* "PETSc/Mat.pyx":462 * cdef PetscMat newmat = NULL * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":463 * CHKERR( MatCreateScatter(ccomm, scatter.sct, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createNormal(self, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":457 * # * * def createScatter(self, Scatter scatter, comm=None): # <<<<<<<<<<<<<< * if comm is None: comm = scatter.getComm() * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":465 * return self * * def createNormal(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormal(mat.mat, &newmat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createNormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_66createNormal[] = "Mat.createNormal(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createNormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNormal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createNormal") < 0)) __PYX_ERR(38, 465, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createNormal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 465, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 465, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_66createNormal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_66createNormal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNormal", 0); /* "PETSc/Mat.pyx":466 * * def createNormal(self, Mat mat): * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateNormal(mat.mat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":467 * def createNormal(self, Mat mat): * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormal(mat.mat, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateNormal(__pyx_v_mat->mat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 467, __pyx_L1_error) /* "PETSc/Mat.pyx":468 * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormal(mat.mat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":469 * CHKERR( MatCreateNormal(mat.mat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createTranspose(self, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":465 * return self * * def createNormal(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateNormal(mat.mat, &newmat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNormal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":471 * return self * * def createTranspose(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69createTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_68createTranspose[] = "Mat.createTranspose(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69createTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createTranspose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createTranspose") < 0)) __PYX_ERR(38, 471, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createTranspose", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 471, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 471, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_68createTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_68createTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createTranspose", 0); /* "PETSc/Mat.pyx":472 * * def createTranspose(self, Mat mat): * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":473 * def createTranspose(self, Mat mat): * cdef PetscMat newmat = NULL * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateTranspose(__pyx_v_mat->mat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 473, __pyx_L1_error) /* "PETSc/Mat.pyx":474 * cdef PetscMat newmat = NULL * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":475 * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":471 * return self * * def createTranspose(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateTranspose(mat.mat, &newmat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":477 * return self * * def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): # <<<<<<<<<<<<<< * cdef PetscMat Amat = NULL * cdef PetscMat Umat = U.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createLRC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_70createLRC[] = "Mat.createLRC(self, Mat A, Mat U, Vec c, Mat V)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createLRC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_U = 0; struct PyPetscVecObject *__pyx_v_c = 0; struct PyPetscMatObject *__pyx_v_V = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLRC (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_U,&__pyx_n_s_c,&__pyx_n_s_V,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 1); __PYX_ERR(38, 477, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 2); __PYX_ERR(38, 477, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, 3); __PYX_ERR(38, 477, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createLRC") < 0)) __PYX_ERR(38, 477, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_U = ((struct PyPetscMatObject *)values[1]); __pyx_v_c = ((struct PyPetscVecObject *)values[2]); __pyx_v_V = ((struct PyPetscMatObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 477, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createLRC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(38, 477, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(38, 477, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "c", 0))) __PYX_ERR(38, 477, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(38, 477, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_70createLRC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_U, __pyx_v_c, __pyx_v_V); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_70createLRC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_U, struct PyPetscVecObject *__pyx_v_c, struct PyPetscMatObject *__pyx_v_V) { Mat __pyx_v_Amat; Mat __pyx_v_Umat; Vec __pyx_v_cvec; Mat __pyx_v_Vmat; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Vec __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLRC", 0); /* "PETSc/Mat.pyx":478 * * def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): * cdef PetscMat Amat = NULL # <<<<<<<<<<<<<< * cdef PetscMat Umat = U.mat * cdef PetscVec cvec = NULL */ __pyx_v_Amat = NULL; /* "PETSc/Mat.pyx":479 * def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): * cdef PetscMat Amat = NULL * cdef PetscMat Umat = U.mat # <<<<<<<<<<<<<< * cdef PetscVec cvec = NULL * cdef PetscMat Vmat = NULL */ __pyx_t_1 = __pyx_v_U->mat; __pyx_v_Umat = __pyx_t_1; /* "PETSc/Mat.pyx":480 * cdef PetscMat Amat = NULL * cdef PetscMat Umat = U.mat * cdef PetscVec cvec = NULL # <<<<<<<<<<<<<< * cdef PetscMat Vmat = NULL * cdef PetscMat newmat = NULL */ __pyx_v_cvec = NULL; /* "PETSc/Mat.pyx":481 * cdef PetscMat Umat = U.mat * cdef PetscVec cvec = NULL * cdef PetscMat Vmat = NULL # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * if A is not None: Amat = A.mat */ __pyx_v_Vmat = NULL; /* "PETSc/Mat.pyx":482 * cdef PetscVec cvec = NULL * cdef PetscMat Vmat = NULL * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * if A is not None: Amat = A.mat * if c is not None: cvec = c.vec */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":483 * cdef PetscMat Vmat = NULL * cdef PetscMat newmat = NULL * if A is not None: Amat = A.mat # <<<<<<<<<<<<<< * if c is not None: cvec = c.vec * if V is not None: Vmat = V.mat */ __pyx_t_2 = (((PyObject *)__pyx_v_A) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = __pyx_v_A->mat; __pyx_v_Amat = __pyx_t_1; } /* "PETSc/Mat.pyx":484 * cdef PetscMat newmat = NULL * if A is not None: Amat = A.mat * if c is not None: cvec = c.vec # <<<<<<<<<<<<<< * if V is not None: Vmat = V.mat * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_c) != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_c->vec; __pyx_v_cvec = __pyx_t_4; } /* "PETSc/Mat.pyx":485 * if A is not None: Amat = A.mat * if c is not None: cvec = c.vec * if V is not None: Vmat = V.mat # <<<<<<<<<<<<<< * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_t_2 = (((PyObject *)__pyx_v_V) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = __pyx_v_V->mat; __pyx_v_Vmat = __pyx_t_1; } /* "PETSc/Mat.pyx":486 * if c is not None: cvec = c.vec * if V is not None: Vmat = V.mat * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * return self */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateLRC(__pyx_v_Amat, __pyx_v_Umat, __pyx_v_cvec, __pyx_v_Vmat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 486, __pyx_L1_error) /* "PETSc/Mat.pyx":487 * if V is not None: Vmat = V.mat * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":488 * CHKERR( MatCreateLRC(Amat, Umat, cvec, Vmat, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":477 * return self * * def createLRC(self, Mat A or None, Mat U, Vec c or None, Mat V or None): # <<<<<<<<<<<<<< * cdef PetscMat Amat = NULL * cdef PetscMat Umat = U.mat */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createLRC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":490 * return self * * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): # <<<<<<<<<<<<<< * if iscol is None: iscol = isrow * cdef PetscMat newmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73createSubMatrixVirtual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_72createSubMatrixVirtual[] = "Mat.createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73createSubMatrixVirtual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSubMatrixVirtual (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_isrow,&__pyx_n_s_iscol,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct PyPetscISObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createSubMatrixVirtual", 0, 2, 3, 1); __PYX_ERR(38, 490, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSubMatrixVirtual") < 0)) __PYX_ERR(38, 490, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_isrow = ((struct PyPetscISObject *)values[1]); __pyx_v_iscol = ((struct PyPetscISObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSubMatrixVirtual", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 490, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrixVirtual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(38, 490, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 490, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(38, 490, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_72createSubMatrixVirtual(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_isrow, __pyx_v_iscol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_72createSubMatrixVirtual(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol) { Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSubMatrixVirtual", 0); __Pyx_INCREF((PyObject *)__pyx_v_iscol); /* "PETSc/Mat.pyx":491 * * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): * if iscol is None: iscol = isrow # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_iscol) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(((PyObject *)__pyx_v_isrow)); __Pyx_DECREF_SET(__pyx_v_iscol, __pyx_v_isrow); } /* "PETSc/Mat.pyx":492 * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): * if iscol is None: iscol = isrow * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":493 * if iscol is None: iscol = isrow * cdef PetscMat newmat = NULL * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSubMatrixVirtual(__pyx_v_A->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_newmat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 493, __pyx_L1_error) /* "PETSc/Mat.pyx":494 * cdef PetscMat newmat = NULL * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":495 * CHKERR( MatCreateSubMatrixVirtual(A.mat, isrow.iset, iscol.iset, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * return self # <<<<<<<<<<<<<< * * def createNest(self, mats, isrows=None, iscols=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":490 * return self * * def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None): # <<<<<<<<<<<<<< * if iscol is None: iscol = isrow * cdef PetscMat newmat = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrixVirtual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iscol); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":497 * return self * * def createNest(self, mats, isrows=None, iscols=None, comm=None): # <<<<<<<<<<<<<< * cdef object mat * mats = [list(mat) for mat in mats] */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_75createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_74createNest[] = "Mat.createNest(self, mats, isrows=None, iscols=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_75createNest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mats = 0; PyObject *__pyx_v_isrows = 0; PyObject *__pyx_v_iscols = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mats,&__pyx_n_s_isrows,&__pyx_n_s_iscols,&__pyx_n_s_comm,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mats)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrows); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscols); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createNest") < 0)) __PYX_ERR(38, 497, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mats = values[0]; __pyx_v_isrows = values[1]; __pyx_v_iscols = values[2]; __pyx_v_comm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 497, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_74createNest(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mats, __pyx_v_isrows, __pyx_v_iscols, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_74createNest(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mats, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_comm) { PyObject *__pyx_v_mat = 0; MPI_Comm __pyx_v_ccomm; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_mr; Py_ssize_t __pyx_v_j; Py_ssize_t __pyx_v_mc; PetscInt __pyx_v_nr; PetscInt __pyx_v_nc; Mat *__pyx_v_cmats; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp3 = 0; Mat __pyx_v_newmat; PyObject *__pyx_8genexpr2__pyx_v_mat = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; MPI_Comm __pyx_t_8; Mat __pyx_t_9; int __pyx_t_10; IS __pyx_t_11; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNest", 0); __Pyx_INCREF(__pyx_v_mats); __Pyx_INCREF(__pyx_v_isrows); __Pyx_INCREF(__pyx_v_iscols); /* "PETSc/Mat.pyx":499 * def createNest(self, mats, isrows=None, iscols=None, comm=None): * cdef object mat * mats = [list(mat) for mat in mats] # <<<<<<<<<<<<<< * if isrows: * isrows = list(isrows) */ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 499, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_mats)) || PyTuple_CheckExact(__pyx_v_mats)) { __pyx_t_2 = __pyx_v_mats; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_mats); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 499, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 499, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(38, 499, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 499, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(38, 499, __pyx_L5_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 499, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(38, 499, __pyx_L5_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_mat, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PySequence_List(__pyx_8genexpr2__pyx_v_mat); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 499, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(38, 499, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_mat); __pyx_8genexpr2__pyx_v_mat = 0; goto __pyx_L8_exit_scope; __pyx_L5_error:; __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_mat); __pyx_8genexpr2__pyx_v_mat = 0; goto __pyx_L1_error; __pyx_L8_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_mats, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":500 * cdef object mat * mats = [list(mat) for mat in mats] * if isrows: # <<<<<<<<<<<<<< * isrows = list(isrows) * assert len(isrows) == len(mats) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_isrows); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(38, 500, __pyx_L1_error) if (__pyx_t_6) { /* "PETSc/Mat.pyx":501 * mats = [list(mat) for mat in mats] * if isrows: * isrows = list(isrows) # <<<<<<<<<<<<<< * assert len(isrows) == len(mats) * else: */ __pyx_t_1 = PySequence_List(__pyx_v_isrows); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_isrows, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":502 * if isrows: * isrows = list(isrows) * assert len(isrows) == len(mats) # <<<<<<<<<<<<<< * else: * isrows = None */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(38, 502, __pyx_L1_error) __pyx_t_7 = PyObject_Length(__pyx_v_mats); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(38, 502, __pyx_L1_error) if (unlikely(!((__pyx_t_3 == __pyx_t_7) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(38, 502, __pyx_L1_error) } } #endif /* "PETSc/Mat.pyx":500 * cdef object mat * mats = [list(mat) for mat in mats] * if isrows: # <<<<<<<<<<<<<< * isrows = list(isrows) * assert len(isrows) == len(mats) */ goto __pyx_L9; } /* "PETSc/Mat.pyx":504 * assert len(isrows) == len(mats) * else: * isrows = None # <<<<<<<<<<<<<< * if iscols: * iscols = list(iscols) */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_isrows, Py_None); } __pyx_L9:; /* "PETSc/Mat.pyx":505 * else: * isrows = None * if iscols: # <<<<<<<<<<<<<< * iscols = list(iscols) * assert len(iscols) == len(mats[0]) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_iscols); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(38, 505, __pyx_L1_error) if (__pyx_t_6) { /* "PETSc/Mat.pyx":506 * isrows = None * if iscols: * iscols = list(iscols) # <<<<<<<<<<<<<< * assert len(iscols) == len(mats[0]) * else: */ __pyx_t_1 = PySequence_List(__pyx_v_iscols); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_iscols, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":507 * if iscols: * iscols = list(iscols) * assert len(iscols) == len(mats[0]) # <<<<<<<<<<<<<< * else: * iscols = None */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_7 = PyObject_Length(__pyx_v_iscols); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(38, 507, __pyx_L1_error) __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mats, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(38, 507, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!((__pyx_t_7 == __pyx_t_3) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(38, 507, __pyx_L1_error) } } #endif /* "PETSc/Mat.pyx":505 * else: * isrows = None * if iscols: # <<<<<<<<<<<<<< * iscols = list(iscols) * assert len(iscols) == len(mats[0]) */ goto __pyx_L10; } /* "PETSc/Mat.pyx":509 * assert len(iscols) == len(mats[0]) * else: * iscols = None # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, mr = len(mats) */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_iscols, Py_None); } __pyx_L10:; /* "PETSc/Mat.pyx":510 * else: * iscols = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, mr = len(mats) * cdef Py_ssize_t j, mc = len(mats[0]) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 510, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_8; /* "PETSc/Mat.pyx":511 * iscols = None * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, mr = len(mats) # <<<<<<<<<<<<<< * cdef Py_ssize_t j, mc = len(mats[0]) * cdef PetscInt nr = mr */ __pyx_t_3 = PyObject_Length(__pyx_v_mats); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(38, 511, __pyx_L1_error) __pyx_v_mr = __pyx_t_3; /* "PETSc/Mat.pyx":512 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Py_ssize_t i, mr = len(mats) * cdef Py_ssize_t j, mc = len(mats[0]) # <<<<<<<<<<<<<< * cdef PetscInt nr = mr * cdef PetscInt nc = mc */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mats, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(38, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_mc = __pyx_t_3; /* "PETSc/Mat.pyx":513 * cdef Py_ssize_t i, mr = len(mats) * cdef Py_ssize_t j, mc = len(mats[0]) * cdef PetscInt nr = mr # <<<<<<<<<<<<<< * cdef PetscInt nc = mc * cdef PetscMat *cmats = NULL */ __pyx_v_nr = ((PetscInt)__pyx_v_mr); /* "PETSc/Mat.pyx":514 * cdef Py_ssize_t j, mc = len(mats[0]) * cdef PetscInt nr = mr * cdef PetscInt nc = mc # <<<<<<<<<<<<<< * cdef PetscMat *cmats = NULL * cdef PetscIS *cisrows = NULL */ __pyx_v_nc = ((PetscInt)__pyx_v_mc); /* "PETSc/Mat.pyx":515 * cdef PetscInt nr = mr * cdef PetscInt nc = mc * cdef PetscMat *cmats = NULL # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_cmats = NULL; /* "PETSc/Mat.pyx":516 * cdef PetscInt nc = mc * cdef PetscMat *cmats = NULL * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * cdef object tmp1, tmp2, tmp3 */ __pyx_v_cisrows = NULL; /* "PETSc/Mat.pyx":517 * cdef PetscMat *cmats = NULL * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * cdef object tmp1, tmp2, tmp3 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) */ __pyx_v_ciscols = NULL; /* "PETSc/Mat.pyx":519 * cdef PetscIS *ciscols = NULL * cdef object tmp1, tmp2, tmp3 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) # <<<<<<<<<<<<<< * for i from 0 <= i < mr: * for j from 0 <= j < mc: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p((__pyx_v_nr * __pyx_v_nc))); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cmats)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp1 = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":520 * cdef object tmp1, tmp2, tmp3 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) * for i from 0 <= i < mr: # <<<<<<<<<<<<<< * for j from 0 <= j < mc: * mat = mats[i][j] */ __pyx_t_3 = __pyx_v_mr; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/Mat.pyx":521 * tmp1 = oarray_p(empty_p(nr*nc), NULL, &cmats) * for i from 0 <= i < mr: * for j from 0 <= j < mc: # <<<<<<<<<<<<<< * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL */ __pyx_t_7 = __pyx_v_mc; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) { /* "PETSc/Mat.pyx":522 * for i from 0 <= i < mr: * for j from 0 <= j < mc: * mat = mats[i][j] # <<<<<<<<<<<<<< * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mats, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_mat, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":523 * for j from 0 <= j < mc: * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL # <<<<<<<<<<<<<< * if isrows is not None: * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) */ __pyx_t_6 = (__pyx_v_mat != Py_None); if ((__pyx_t_6 != 0)) { if (!(likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(38, 523, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscMatObject *)__pyx_v_mat)->mat; } else { __pyx_t_9 = NULL; } (__pyx_v_cmats[((__pyx_v_i * __pyx_v_mc) + __pyx_v_j)]) = __pyx_t_9; } } /* "PETSc/Mat.pyx":524 * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset */ __pyx_t_6 = (__pyx_v_isrows != Py_None); __pyx_t_10 = (__pyx_t_6 != 0); if (__pyx_t_10) { /* "PETSc/Mat.pyx":525 * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) # <<<<<<<<<<<<<< * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp2 = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":526 * if isrows is not None: * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset # <<<<<<<<<<<<<< * if iscols is not None: * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) */ __pyx_t_3 = __pyx_v_mr; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_isrows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(38, 526, __pyx_L1_error) __pyx_t_11 = ((struct PyPetscISObject *)__pyx_t_2)->iset; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_cisrows[__pyx_v_i]) = __pyx_t_11; } /* "PETSc/Mat.pyx":524 * mat = mats[i][j] * cmats[i*mc+j] = (mat).mat if mat is not None else NULL * if isrows is not None: # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset */ } /* "PETSc/Mat.pyx":527 * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: # <<<<<<<<<<<<<< * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset */ __pyx_t_10 = (__pyx_v_iscols != Py_None); __pyx_t_6 = (__pyx_t_10 != 0); if (__pyx_t_6) { /* "PETSc/Mat.pyx":528 * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) # <<<<<<<<<<<<<< * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset * cdef PetscMat newmat = NULL */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp3 = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/Mat.pyx":529 * if iscols is not None: * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset # <<<<<<<<<<<<<< * cdef PetscMat newmat = NULL * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) */ __pyx_t_3 = __pyx_v_mc; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_iscols, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(38, 529, __pyx_L1_error) __pyx_t_11 = ((struct PyPetscISObject *)__pyx_t_1)->iset; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_ciscols[__pyx_v_j]) = __pyx_t_11; } /* "PETSc/Mat.pyx":527 * tmp2 = oarray_p(empty_p(nr), NULL, &cisrows) * for i from 0 <= i < mr: cisrows[i] = (isrows[i]).iset * if iscols is not None: # <<<<<<<<<<<<<< * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset */ } /* "PETSc/Mat.pyx":530 * tmp3 = oarray_p(empty_p(nc), NULL, &ciscols) * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":531 * for j from 0 <= j < mc: ciscols[j] = (iscols[j]).iset * cdef PetscMat newmat = NULL * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * return self */ __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateNest(__pyx_v_ccomm, __pyx_v_nr, __pyx_v_cisrows, __pyx_v_nc, __pyx_v_ciscols, __pyx_v_cmats, (&__pyx_v_newmat))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(38, 531, __pyx_L1_error) /* "PETSc/Mat.pyx":532 * cdef PetscMat newmat = NULL * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":533 * CHKERR( MatCreateNest(ccomm, nr, cisrows, nc, ciscols, cmats, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * return self # <<<<<<<<<<<<<< * * ##def createIS(self, size, LGMap lgmap, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":497 * return self * * def createNest(self, mats, isrows=None, iscols=None, comm=None): # <<<<<<<<<<<<<< * cdef object mat * mats = [list(mat) for mat in mats] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createNest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat); __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XDECREF(__pyx_v_tmp3); __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_mat); __Pyx_XDECREF(__pyx_v_mats); __Pyx_XDECREF(__pyx_v_isrows); __Pyx_XDECREF(__pyx_v_iscols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":549 * ## return self * * def createPython(self, size, context=None, comm=None): # <<<<<<<<<<<<<< * # communicator and sizes * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_76createPython[] = "Mat.createPython(self, size, context=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_size = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_context,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(38, 549, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_size = values[0]; __pyx_v_context = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 549, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_76createPython(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_context, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76createPython(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; Mat __pyx_v_newmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 0); /* "PETSc/Mat.pyx":551 * def createPython(self, size, context=None, comm=None): * # communicator and sizes * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 551, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Mat.pyx":552 * # communicator and sizes * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 # <<<<<<<<<<<<<< * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/Mat.pyx":553 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Mat_Sizes(__pyx_v_size, Py_None, (&__pyx_v_rbs), (&__pyx_v_cbs), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_M), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 553, __pyx_L1_error) /* "PETSc/Mat.pyx":554 * cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) # <<<<<<<<<<<<<< * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 554, __pyx_L1_error) /* "PETSc/Mat.pyx":555 * Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N) * Sys_Layout(ccomm, rbs, &m, &M) * Sys_Layout(ccomm, cbs, &n, &N) # <<<<<<<<<<<<<< * # create matrix * cdef PetscMat newmat = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 555, __pyx_L1_error) /* "PETSc/Mat.pyx":557 * Sys_Layout(ccomm, cbs, &n, &N) * # create matrix * cdef PetscMat newmat = NULL # <<<<<<<<<<<<<< * CHKERR( MatCreate(ccomm, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat */ __pyx_v_newmat = NULL; /* "PETSc/Mat.pyx":558 * # create matrix * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.mat = newmat * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_ccomm, (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 558, __pyx_L1_error) /* "PETSc/Mat.pyx":559 * cdef PetscMat newmat = NULL * CHKERR( MatCreate(ccomm, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat # <<<<<<<<<<<<<< * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * CHKERR( MatSetType(self.mat, MATPYTHON) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->mat = __pyx_v_newmat; /* "PETSc/Mat.pyx":560 * CHKERR( MatCreate(ccomm, &newmat) ) * PetscCLEAR(self.obj); self.mat = newmat * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) # <<<<<<<<<<<<<< * CHKERR( MatSetType(self.mat, MATPYTHON) ) * CHKERR( MatPythonSetContext(self.mat, context) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetSizes(__pyx_v_self->mat, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 560, __pyx_L1_error) /* "PETSc/Mat.pyx":561 * PetscCLEAR(self.obj); self.mat = newmat * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * CHKERR( MatSetType(self.mat, MATPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( MatPythonSetContext(self.mat, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetType(__pyx_v_self->mat, MATPYTHON)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 561, __pyx_L1_error) /* "PETSc/Mat.pyx":562 * CHKERR( MatSetSizes(self.mat, m, n, M, N) ) * CHKERR( MatSetType(self.mat, MATPYTHON) ) * CHKERR( MatPythonSetContext(self.mat, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPythonSetContext(__pyx_v_self->mat, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 562, __pyx_L1_error) /* "PETSc/Mat.pyx":563 * CHKERR( MatSetType(self.mat, MATPYTHON) ) * CHKERR( MatPythonSetContext(self.mat, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":549 * ## return self * * def createPython(self, size, context=None, comm=None): # <<<<<<<<<<<<<< * # communicator and sizes * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":565 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( MatPythonSetContext(self.mat, context) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_78setPythonContext[] = "Mat.setPythonContext(self, context)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(38, 565, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 565, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_78setPythonContext(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78setPythonContext(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 0); /* "PETSc/Mat.pyx":566 * * def setPythonContext(self, context): * CHKERR( MatPythonSetContext(self.mat, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPythonSetContext(__pyx_v_self->mat, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 566, __pyx_L1_error) /* "PETSc/Mat.pyx":565 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( MatPythonSetContext(self.mat, context) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":568 * CHKERR( MatPythonSetContext(self.mat, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( MatPythonGetContext(self.mat, &context) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_80getPythonContext[] = "Mat.getPythonContext(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_80getPythonContext(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80getPythonContext(struct PyPetscMatObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 0); /* "PETSc/Mat.pyx":569 * * def getPythonContext(self): * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( MatPythonGetContext(self.mat, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "PETSc/Mat.pyx":570 * def getPythonContext(self): * cdef void *context = NULL * CHKERR( MatPythonGetContext(self.mat, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPythonGetContext(__pyx_v_self->mat, (&__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 570, __pyx_L1_error) /* "PETSc/Mat.pyx":571 * cdef void *context = NULL * CHKERR( MatPythonGetContext(self.mat, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_2 = ((__pyx_v_context == NULL) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/Mat.pyx":572 * CHKERR( MatPythonGetContext(self.mat, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "PETSc/Mat.pyx":568 * CHKERR( MatPythonSetContext(self.mat, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( MatPythonGetContext(self.mat, &context) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":574 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_82setPythonType[] = "Mat.setPythonType(self, py_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_py_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(38, 574, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 574, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_82setPythonType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_82setPythonType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "PETSc/Mat.pyx":575 * * def setPythonType(self, py_type): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( MatPythonSetType(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Mat.pyx":576 * def setPythonType(self, py_type): * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( MatPythonSetType(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":577 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( MatPythonSetType(self.mat, cval) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPythonSetType(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 577, __pyx_L1_error) /* "PETSc/Mat.pyx":574 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":581 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_84setOptionsPrefix[] = "Mat.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(38, 581, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 581, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_84setOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_84setOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/Mat.pyx":582 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Mat.pyx":583 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":584 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetOptionsPrefix(__pyx_v_self->mat, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 584, __pyx_L1_error) /* "PETSc/Mat.pyx":581 * # * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":586 * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_86getOptionsPrefix[] = "Mat.getOptionsPrefix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_86getOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_86getOptionsPrefix(struct PyPetscMatObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/Mat.pyx":587 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Mat.pyx":588 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOptionsPrefix(__pyx_v_self->mat, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 588, __pyx_L1_error) /* "PETSc/Mat.pyx":589 * cdef const char *cval = NULL * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":586 * CHKERR( MatSetOptionsPrefix(self.mat, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( MatGetOptionsPrefix(self.mat, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":591 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( MatSetFromOptions(self.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_88setFromOptions[] = "Mat.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_88setFromOptions(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_88setFromOptions(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/Mat.pyx":592 * * def setFromOptions(self): * CHKERR( MatSetFromOptions(self.mat) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetFromOptions(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 592, __pyx_L1_error) /* "PETSc/Mat.pyx":591 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( MatSetFromOptions(self.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":594 * CHKERR( MatSetFromOptions(self.mat) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( MatSetUp(self.mat) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_91setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_90setUp[] = "Mat.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_91setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_90setUp(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_90setUp(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/Mat.pyx":595 * * def setUp(self): * CHKERR( MatSetUp(self.mat) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetUp(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 595, __pyx_L1_error) /* "PETSc/Mat.pyx":596 * def setUp(self): * CHKERR( MatSetUp(self.mat) ) * return self # <<<<<<<<<<<<<< * * def setOption(self, option, flag): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":594 * CHKERR( MatSetFromOptions(self.mat) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( MatSetUp(self.mat) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":598 * return self * * def setOption(self, option, flag): # <<<<<<<<<<<<<< * CHKERR( MatSetOption(self.mat, option, flag) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_93setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_92setOption[] = "Mat.setOption(self, option, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_93setOption(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_option = 0; PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOption (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,&__pyx_n_s_flag,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, 1); __PYX_ERR(38, 598, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOption") < 0)) __PYX_ERR(38, 598, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_option = values[0]; __pyx_v_flag = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 598, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_92setOption(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_option, __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_92setOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatOption __pyx_t_1; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOption", 0); /* "PETSc/Mat.pyx":599 * * def setOption(self, option, flag): * CHKERR( MatSetOption(self.mat, option, flag) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_1 = ((MatOption)__Pyx_PyInt_As_MatOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 599, __pyx_L1_error) __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 599, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetOption(__pyx_v_self->mat, __pyx_t_1, __pyx_t_2)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 599, __pyx_L1_error) /* "PETSc/Mat.pyx":598 * return self * * def setOption(self, option, flag): # <<<<<<<<<<<<<< * CHKERR( MatSetOption(self.mat, option, flag) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setOption", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":601 * CHKERR( MatSetOption(self.mat, option, flag) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscMatType cval = NULL * CHKERR( MatGetType(self.mat, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_94getType[] = "Mat.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_94getType(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94getType(struct PyPetscMatObject *__pyx_v_self) { MatType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/Mat.pyx":602 * * def getType(self): * cdef PetscMatType cval = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetType(self.mat, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Mat.pyx":603 * def getType(self): * cdef PetscMatType cval = NULL * CHKERR( MatGetType(self.mat, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetType(__pyx_v_self->mat, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 603, __pyx_L1_error) /* "PETSc/Mat.pyx":604 * cdef PetscMatType cval = NULL * CHKERR( MatGetType(self.mat, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":601 * CHKERR( MatSetOption(self.mat, option, flag) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscMatType cval = NULL * CHKERR( MatGetType(self.mat, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":606 * return bytes2str(cval) * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetSize(self.mat, &M, &N) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_97getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_96getSize[] = "Mat.getSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_97getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_96getSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96getSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 0); /* "PETSc/Mat.pyx":607 * * def getSize(self): * cdef PetscInt M = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, &N) ) * return (toInt(M), toInt(N)) */ __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/Mat.pyx":608 * def getSize(self): * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetSize(self.mat, &M, &N) ) # <<<<<<<<<<<<<< * return (toInt(M), toInt(N)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 608, __pyx_L1_error) /* "PETSc/Mat.pyx":609 * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetSize(self.mat, &M, &N) ) * return (toInt(M), toInt(N)) # <<<<<<<<<<<<<< * * def getLocalSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":606 * return bytes2str(cval) * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetSize(self.mat, &M, &N) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":611 * return (toInt(M), toInt(N)) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt m = 0, n = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_98getLocalSize[] = "Mat.getLocalSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_98getLocalSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98getLocalSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_m; PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 0); /* "PETSc/Mat.pyx":612 * * def getLocalSize(self): * cdef PetscInt m = 0, n = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * return (toInt(m), toInt(n)) */ __pyx_v_m = 0; __pyx_v_n = 0; /* "PETSc/Mat.pyx":613 * def getLocalSize(self): * cdef PetscInt m = 0, n = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) # <<<<<<<<<<<<<< * return (toInt(m), toInt(n)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 613, __pyx_L1_error) /* "PETSc/Mat.pyx":614 * cdef PetscInt m = 0, n = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * return (toInt(m), toInt(n)) # <<<<<<<<<<<<<< * * def getSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":611 * return (toInt(M), toInt(N)) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt m = 0, n = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":616 * return (toInt(m), toInt(n)) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt m = 0, n = 0 * cdef PetscInt M = 0, N = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_100getSizes[] = "Mat.getSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_100getSizes(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100getSizes(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 0); /* "PETSc/Mat.pyx":617 * * def getSizes(self): * cdef PetscInt m = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) */ __pyx_v_m = 0; __pyx_v_n = 0; /* "PETSc/Mat.pyx":618 * def getSizes(self): * cdef PetscInt m = 0, n = 0 * cdef PetscInt M = 0, N = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * CHKERR( MatGetSize(self.mat, &M, &N) ) */ __pyx_v_M = 0; __pyx_v_N = 0; /* "PETSc/Mat.pyx":619 * cdef PetscInt m = 0, n = 0 * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, &M, &N) ) * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 619, __pyx_L1_error) /* "PETSc/Mat.pyx":620 * cdef PetscInt M = 0, N = 0 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * CHKERR( MatGetSize(self.mat, &M, &N) ) # <<<<<<<<<<<<<< * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, (&__pyx_v_M), (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 620, __pyx_L1_error) /* "PETSc/Mat.pyx":621 * CHKERR( MatGetLocalSize(self.mat, &m, &n) ) * CHKERR( MatGetSize(self.mat, &M, &N) ) * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) # <<<<<<<<<<<<<< * * def getBlockSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":616 * return (toInt(m), toInt(n)) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt m = 0, n = 0 * cdef PetscInt M = 0, N = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":623 * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 0 * CHKERR( MatGetBlockSize(self.mat, &bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_103getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_102getBlockSize[] = "Mat.getBlockSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_103getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_102getBlockSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102getBlockSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 0); /* "PETSc/Mat.pyx":624 * * def getBlockSize(self): * cdef PetscInt bs = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(self.mat, &bs) ) * return toInt(bs) */ __pyx_v_bs = 0; /* "PETSc/Mat.pyx":625 * def getBlockSize(self): * cdef PetscInt bs = 0 * CHKERR( MatGetBlockSize(self.mat, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_self->mat, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 625, __pyx_L1_error) /* "PETSc/Mat.pyx":626 * cdef PetscInt bs = 0 * CHKERR( MatGetBlockSize(self.mat, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def getBlockSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":623 * return ((toInt(m), toInt(M)), (toInt(n), toInt(N))) * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 0 * CHKERR( MatGetBlockSize(self.mat, &bs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":628 * return toInt(bs) * * def getBlockSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0 * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105getBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_104getBlockSizes[] = "Mat.getBlockSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105getBlockSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_104getBlockSizes(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104getBlockSizes(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_rbs; PetscInt __pyx_v_cbs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSizes", 0); /* "PETSc/Mat.pyx":629 * * def getBlockSizes(self): * cdef PetscInt rbs = 0, cbs = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) * return (toInt(rbs), toInt(cbs)) */ __pyx_v_rbs = 0; __pyx_v_cbs = 0; /* "PETSc/Mat.pyx":630 * def getBlockSizes(self): * cdef PetscInt rbs = 0, cbs = 0 * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) # <<<<<<<<<<<<<< * return (toInt(rbs), toInt(cbs)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSizes(__pyx_v_self->mat, (&__pyx_v_rbs), (&__pyx_v_cbs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 630, __pyx_L1_error) /* "PETSc/Mat.pyx":631 * cdef PetscInt rbs = 0, cbs = 0 * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) * return (toInt(rbs), toInt(cbs)) # <<<<<<<<<<<<<< * * def getOwnershipRange(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rbs); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cbs); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":628 * return toInt(bs) * * def getBlockSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt rbs = 0, cbs = 0 * CHKERR( MatGetBlockSizes(self.mat, &rbs, &cbs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":633 * return (toInt(rbs), toInt(cbs)) * * def getOwnershipRange(self): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_107getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_106getOwnershipRange[] = "Mat.getOwnershipRange(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_107getOwnershipRange(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRange (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRange", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRange", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_106getOwnershipRange(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_106getOwnershipRange(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRange", 0); /* "PETSc/Mat.pyx":634 * * def getOwnershipRange(self): * cdef PetscInt ival1 = 0, ival2 = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) */ __pyx_v_ival1 = 0; __pyx_v_ival2 = 0; /* "PETSc/Mat.pyx":635 * def getOwnershipRange(self): * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) # <<<<<<<<<<<<<< * return (toInt(ival1), toInt(ival2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRange(__pyx_v_self->mat, (&__pyx_v_ival1), (&__pyx_v_ival2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 635, __pyx_L1_error) /* "PETSc/Mat.pyx":636 * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) # <<<<<<<<<<<<<< * * def getOwnershipRanges(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":633 * return (toInt(rbs), toInt(cbs)) * * def getOwnershipRange(self): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRange(self.mat, &ival1, &ival2) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRange", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":638 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef const PetscInt *rowrng = NULL * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_108getOwnershipRanges[] = "Mat.getOwnershipRanges(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_108getOwnershipRanges(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_108getOwnershipRanges(struct PyPetscMatObject *__pyx_v_self) { PetscInt const *__pyx_v_rowrng; MPI_Comm __pyx_v_comm; int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 0); /* "PETSc/Mat.pyx":639 * * def getOwnershipRanges(self): * cdef const PetscInt *rowrng = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_rowrng = NULL; /* "PETSc/Mat.pyx":640 * def getOwnershipRanges(self): * cdef const PetscInt *rowrng = NULL * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRanges(__pyx_v_self->mat, (&__pyx_v_rowrng))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 640, __pyx_L1_error) /* "PETSc/Mat.pyx":641 * cdef const PetscInt *rowrng = NULL * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 */ __pyx_v_comm = MPI_COMM_NULL; /* "PETSc/Mat.pyx":642 * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) # <<<<<<<<<<<<<< * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->mat), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 642, __pyx_L1_error) /* "PETSc/Mat.pyx":643 * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rowrng) */ __pyx_v_size = -1; /* "PETSc/Mat.pyx":644 * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return array_i(size+1, rowrng) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 644, __pyx_L1_error) /* "PETSc/Mat.pyx":645 * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, rowrng) # <<<<<<<<<<<<<< * * def getOwnershipRangeColumn(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size + 1), __pyx_v_rowrng)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":638 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef const PetscInt *rowrng = NULL * CHKERR( MatGetOwnershipRanges(self.mat, &rowrng) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":647 * return array_i(size+1, rowrng) * * def getOwnershipRangeColumn(self): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111getOwnershipRangeColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_110getOwnershipRangeColumn[] = "Mat.getOwnershipRangeColumn(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111getOwnershipRangeColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRangeColumn (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRangeColumn", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRangeColumn", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_110getOwnershipRangeColumn(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_110getOwnershipRangeColumn(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRangeColumn", 0); /* "PETSc/Mat.pyx":648 * * def getOwnershipRangeColumn(self): * cdef PetscInt ival1 = 0, ival2 = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) */ __pyx_v_ival1 = 0; __pyx_v_ival2 = 0; /* "PETSc/Mat.pyx":649 * def getOwnershipRangeColumn(self): * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) # <<<<<<<<<<<<<< * return (toInt(ival1), toInt(ival2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRangeColumn(__pyx_v_self->mat, (&__pyx_v_ival1), (&__pyx_v_ival2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 649, __pyx_L1_error) /* "PETSc/Mat.pyx":650 * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) * return (toInt(ival1), toInt(ival2)) # <<<<<<<<<<<<<< * * def getOwnershipRangesColumn(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":647 * return array_i(size+1, rowrng) * * def getOwnershipRangeColumn(self): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = 0, ival2 = 0 * CHKERR( MatGetOwnershipRangeColumn(self.mat, &ival1, &ival2) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRangeColumn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":652 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRangesColumn(self): # <<<<<<<<<<<<<< * cdef const PetscInt *colrng = NULL * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113getOwnershipRangesColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_112getOwnershipRangesColumn[] = "Mat.getOwnershipRangesColumn(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113getOwnershipRangesColumn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRangesColumn (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRangesColumn", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRangesColumn", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_112getOwnershipRangesColumn(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_112getOwnershipRangesColumn(struct PyPetscMatObject *__pyx_v_self) { PetscInt const *__pyx_v_colrng; MPI_Comm __pyx_v_comm; int __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRangesColumn", 0); /* "PETSc/Mat.pyx":653 * * def getOwnershipRangesColumn(self): * cdef const PetscInt *colrng = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_colrng = NULL; /* "PETSc/Mat.pyx":654 * def getOwnershipRangesColumn(self): * cdef const PetscInt *colrng = NULL * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRangesColumn(__pyx_v_self->mat, (&__pyx_v_colrng))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 654, __pyx_L1_error) /* "PETSc/Mat.pyx":655 * cdef const PetscInt *colrng = NULL * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 */ __pyx_v_comm = MPI_COMM_NULL; /* "PETSc/Mat.pyx":656 * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) # <<<<<<<<<<<<<< * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->mat), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 656, __pyx_L1_error) /* "PETSc/Mat.pyx":657 * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 # <<<<<<<<<<<<<< * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, colrng) */ __pyx_v_size = -1; /* "PETSc/Mat.pyx":658 * CHKERR( PetscObjectGetComm(self.mat, &comm) ) * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) # <<<<<<<<<<<<<< * return array_i(size+1, colrng) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 658, __pyx_L1_error) /* "PETSc/Mat.pyx":659 * cdef int size = -1 * CHKERR( MPI_Comm_size(comm, &size) ) * return array_i(size+1, colrng) # <<<<<<<<<<<<<< * * def getOwnershipIS(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_size + 1), __pyx_v_colrng)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":652 * return (toInt(ival1), toInt(ival2)) * * def getOwnershipRangesColumn(self): # <<<<<<<<<<<<<< * cdef const PetscInt *colrng = NULL * CHKERR( MatGetOwnershipRangesColumn(self.mat, &colrng) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipRangesColumn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":661 * return array_i(size+1, colrng) * * def getOwnershipIS(self): # <<<<<<<<<<<<<< * cdef IS rows = IS() * cdef IS cols = IS() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115getOwnershipIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_114getOwnershipIS[] = "Mat.getOwnershipIS(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115getOwnershipIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipIS (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipIS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipIS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_114getOwnershipIS(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114getOwnershipIS(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_rows = 0; struct PyPetscISObject *__pyx_v_cols = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipIS", 0); /* "PETSc/Mat.pyx":662 * * def getOwnershipIS(self): * cdef IS rows = IS() # <<<<<<<<<<<<<< * cdef IS cols = IS() * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rows = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":663 * def getOwnershipIS(self): * cdef IS rows = IS() * cdef IS cols = IS() # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) * return (rows, cols) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cols = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":664 * cdef IS rows = IS() * cdef IS cols = IS() * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) # <<<<<<<<<<<<<< * return (rows, cols) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipIS(__pyx_v_self->mat, (&__pyx_v_rows->iset), (&__pyx_v_cols->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 664, __pyx_L1_error) /* "PETSc/Mat.pyx":665 * cdef IS cols = IS() * CHKERR( MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset) ) * return (rows, cols) # <<<<<<<<<<<<<< * * def getInfo(self, info=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_rows)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rows)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rows)); __Pyx_INCREF(((PyObject *)__pyx_v_cols)); __Pyx_GIVEREF(((PyObject *)__pyx_v_cols)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cols)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":661 * return array_i(size+1, colrng) * * def getOwnershipIS(self): # <<<<<<<<<<<<<< * cdef IS rows = IS() * cdef IS cols = IS() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOwnershipIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rows); __Pyx_XDECREF((PyObject *)__pyx_v_cols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":667 * return (rows, cols) * * def getInfo(self, info=None): # <<<<<<<<<<<<<< * cdef PetscMatInfoType itype = infotype(info) * cdef PetscMatInfo cinfo */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_116getInfo[] = "Mat.getInfo(self, info=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117getInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_info = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_info,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_info); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getInfo") < 0)) __PYX_ERR(38, 667, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_info = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getInfo", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 667, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_116getInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_info); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116getInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_info) { MatInfoType __pyx_v_itype; MatInfo __pyx_v_cinfo; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatInfoType __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInfo", 0); /* "PETSc/Mat.pyx":668 * * def getInfo(self, info=None): * cdef PetscMatInfoType itype = infotype(info) # <<<<<<<<<<<<<< * cdef PetscMatInfo cinfo * CHKERR( MatGetInfo(self.mat, itype, &cinfo) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_infotype(__pyx_v_info); if (unlikely(__pyx_t_1 == ((MatInfoType)((MatInfoType)-1L)))) __PYX_ERR(38, 668, __pyx_L1_error) __pyx_v_itype = __pyx_t_1; /* "PETSc/Mat.pyx":670 * cdef PetscMatInfoType itype = infotype(info) * cdef PetscMatInfo cinfo * CHKERR( MatGetInfo(self.mat, itype, &cinfo) ) # <<<<<<<<<<<<<< * return cinfo * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetInfo(__pyx_v_self->mat, __pyx_v_itype, (&__pyx_v_cinfo))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 670, __pyx_L1_error) /* "PETSc/Mat.pyx":671 * cdef PetscMatInfo cinfo * CHKERR( MatGetInfo(self.mat, itype, &cinfo) ) * return cinfo # <<<<<<<<<<<<<< * * def duplicate(self, copy=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_convert__to_py_MatInfo(__pyx_v_cinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":667 * return (rows, cols) * * def getInfo(self, info=None): # <<<<<<<<<<<<<< * cdef PetscMatInfoType itype = infotype(info) * cdef PetscMatInfo cinfo */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":673 * return cinfo * * def duplicate(self, copy=False): # <<<<<<<<<<<<<< * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES * if copy: flag = MAT_COPY_VALUES */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_118duplicate[] = "Mat.duplicate(self, copy=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_copy = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_copy); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "duplicate") < 0)) __PYX_ERR(38, 673, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_copy = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 673, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_118duplicate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_copy); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_118duplicate(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_copy) { MatDuplicateOption __pyx_v_flag; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 0); /* "PETSc/Mat.pyx":674 * * def duplicate(self, copy=False): * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES # <<<<<<<<<<<<<< * if copy: flag = MAT_COPY_VALUES * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN */ __pyx_v_flag = MAT_DO_NOT_COPY_VALUES; /* "PETSc/Mat.pyx":675 * def duplicate(self, copy=False): * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES * if copy: flag = MAT_COPY_VALUES # <<<<<<<<<<<<<< * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN * cdef Mat mat = type(self)() */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_copy); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(38, 675, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flag = MAT_COPY_VALUES; } /* "PETSc/Mat.pyx":676 * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES * if copy: flag = MAT_COPY_VALUES * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) */ __pyx_t_2 = __Pyx_PyInt_From_MatDuplicateOption(MAT_COPY_VALUES); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_copy, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 676, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(38, 676, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { __pyx_v_flag = MAT_SHARE_NONZERO_PATTERN; } /* "PETSc/Mat.pyx":677 * if copy: flag = MAT_COPY_VALUES * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN * cdef Mat mat = type(self)() # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) * return mat */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 677, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":678 * if copy > MAT_COPY_VALUES: flag = MAT_SHARE_NONZERO_PATTERN * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, __pyx_v_flag, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 678, __pyx_L1_error) /* "PETSc/Mat.pyx":679 * cdef Mat mat = type(self)() * CHKERR( MatDuplicate(self.mat, flag, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def copy(self, Mat result=None, structure=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/Mat.pyx":673 * return cinfo * * def duplicate(self, copy=False): # <<<<<<<<<<<<<< * cdef PetscMatDuplicateOption flag = MAT_DO_NOT_COPY_VALUES * if copy: flag = MAT_COPY_VALUES */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":681 * return mat * * def copy(self, Mat result=None, structure=None): # <<<<<<<<<<<<<< * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_121copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_120copy[] = "Mat.copy(self, Mat result=None, structure=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_121copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_structure = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,&__pyx_n_s_structure,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_structure); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy") < 0)) __PYX_ERR(38, 681, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscMatObject *)values[0]); __pyx_v_structure = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 681, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(38, 681, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_120copy(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result, __pyx_v_structure); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120copy(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_structure) { MatDuplicateOption __pyx_v_copy; MatStructure __pyx_v_mstr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatStructure __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":682 * * def copy(self, Mat result=None, structure=None): * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES # <<<<<<<<<<<<<< * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: */ __pyx_v_copy = MAT_COPY_VALUES; /* "PETSc/Mat.pyx":683 * def copy(self, Mat result=None, structure=None): * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) # <<<<<<<<<<<<<< * if result is None: * result = type(self)() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matstructure(__pyx_v_structure); if (unlikely(__pyx_t_1 == ((MatStructure)((MatStructure)-1L)))) __PYX_ERR(38, 683, __pyx_L1_error) __pyx_v_mstr = __pyx_t_1; /* "PETSc/Mat.pyx":684 * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.mat == NULL: */ __pyx_t_2 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":685 * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: * result = type(self)() # <<<<<<<<<<<<<< * if result.mat == NULL: * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_5 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 685, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "PETSc/Mat.pyx":684 * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) * if result is None: # <<<<<<<<<<<<<< * result = type(self)() * if result.mat == NULL: */ } /* "PETSc/Mat.pyx":686 * if result is None: * result = type(self)() * if result.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) * else: */ __pyx_t_3 = ((__pyx_v_result->mat == NULL) != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":687 * result = type(self)() * if result.mat == NULL: * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) # <<<<<<<<<<<<<< * else: * CHKERR( MatCopy(self.mat, result.mat, mstr) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, __pyx_v_copy, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(38, 687, __pyx_L1_error) /* "PETSc/Mat.pyx":686 * if result is None: * result = type(self)() * if result.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) * else: */ goto __pyx_L4; } /* "PETSc/Mat.pyx":689 * CHKERR( MatDuplicate(self.mat, copy, &result.mat) ) * else: * CHKERR( MatCopy(self.mat, result.mat, mstr) ) # <<<<<<<<<<<<<< * return result * */ /*else*/ { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCopy(__pyx_v_self->mat, __pyx_v_result->mat, __pyx_v_mstr)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(38, 689, __pyx_L1_error) } __pyx_L4:; /* "PETSc/Mat.pyx":690 * else: * CHKERR( MatCopy(self.mat, result.mat, mstr) ) * return result # <<<<<<<<<<<<<< * * def load(self, Viewer viewer): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":681 * return mat * * def copy(self, Mat result=None, structure=None): # <<<<<<<<<<<<<< * cdef PetscMatDuplicateOption copy = MAT_COPY_VALUES * cdef PetscMatStructure mstr = matstructure(structure) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":692 * return result * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_123load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_122load[] = "Mat.load(self, Viewer viewer)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_123load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(38, 692, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 692, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(38, 692, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_122load(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_122load(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { MPI_Comm __pyx_v_comm; PetscObject __pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); /* "PETSc/Mat.pyx":693 * * def load(self, Viewer viewer): * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: */ __pyx_v_comm = MPI_COMM_NULL; /* "PETSc/Mat.pyx":694 * def load(self, Viewer viewer): * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) # <<<<<<<<<<<<<< * if self.mat == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) */ __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr); /* "PETSc/Mat.pyx":695 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) */ __pyx_t_1 = ((__pyx_v_self->mat == NULL) != 0); if (__pyx_t_1) { /* "PETSc/Mat.pyx":696 * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) # <<<<<<<<<<<<<< * CHKERR( MatCreate(comm, &self.mat) ) * CHKERR( MatLoad(self.mat, viewer.vwr) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(__pyx_v_obj, (&__pyx_v_comm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 696, __pyx_L1_error) /* "PETSc/Mat.pyx":697 * if self.mat == NULL: * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatLoad(self.mat, viewer.vwr) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreate(__pyx_v_comm, (&__pyx_v_self->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 697, __pyx_L1_error) /* "PETSc/Mat.pyx":695 * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) * if self.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) */ } /* "PETSc/Mat.pyx":698 * CHKERR( PetscObjectGetComm(obj, &comm) ) * CHKERR( MatCreate(comm, &self.mat) ) * CHKERR( MatLoad(self.mat, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLoad(__pyx_v_self->mat, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 698, __pyx_L1_error) /* "PETSc/Mat.pyx":699 * CHKERR( MatCreate(comm, &self.mat) ) * CHKERR( MatLoad(self.mat, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def convert(self, mat_type=None, Mat out=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":692 * return result * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * cdef PetscObject obj = (viewer.vwr) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":701 * return self * * def convert(self, mat_type=None, Mat out=None): # <<<<<<<<<<<<<< * cdef PetscMatType mtype = MATSAME * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_125convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_124convert[] = "Mat.convert(self, mat_type=None, Mat out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_125convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mat_type = 0; struct PyPetscMatObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,&__pyx_n_s_out,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat_type); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(38, 701, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat_type = values[0]; __pyx_v_out = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 701, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(38, 701, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_124convert(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat_type, __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124convert(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type, struct PyPetscMatObject *__pyx_v_out) { MatType __pyx_v_mtype; MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_mat_type); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "PETSc/Mat.pyx":702 * * def convert(self, mat_type=None, Mat out=None): * cdef PetscMatType mtype = MATSAME # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * mat_type = str2bytes(mat_type, &mtype) */ __pyx_v_mtype = MATSAME; /* "PETSc/Mat.pyx":703 * def convert(self, mat_type=None, Mat out=None): * cdef PetscMatType mtype = MATSAME * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * mat_type = str2bytes(mat_type, &mtype) * if mtype == NULL: mtype = MATSAME */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":704 * cdef PetscMatType mtype = MATSAME * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * mat_type = str2bytes(mat_type, &mtype) # <<<<<<<<<<<<<< * if mtype == NULL: mtype = MATSAME * if out is None: out = self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mat_type, (&__pyx_v_mtype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mat_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":705 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * mat_type = str2bytes(mat_type, &mtype) * if mtype == NULL: mtype = MATSAME # <<<<<<<<<<<<<< * if out is None: out = self * if out.mat == self.mat: */ __pyx_t_2 = ((__pyx_v_mtype == NULL) != 0); if (__pyx_t_2) { __pyx_v_mtype = MATSAME; } /* "PETSc/Mat.pyx":706 * mat_type = str2bytes(mat_type, &mtype) * if mtype == NULL: mtype = MATSAME * if out is None: out = self # <<<<<<<<<<<<<< * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX */ __pyx_t_2 = (((PyObject *)__pyx_v_out) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); } /* "PETSc/Mat.pyx":707 * if mtype == NULL: mtype = MATSAME * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ __pyx_t_3 = ((__pyx_v_out->mat == __pyx_v_self->mat) != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":708 * if out is None: out = self * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX # <<<<<<<<<<<<<< * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX */ __pyx_v_reuse = MAT_INPLACE_MATRIX; /* "PETSc/Mat.pyx":707 * if mtype == NULL: mtype = MATSAME * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ goto __pyx_L5; } /* "PETSc/Mat.pyx":709 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ __pyx_t_3 = ((__pyx_v_out->mat == NULL) != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":710 * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * else: * reuse = MAT_REUSE_MATRIX */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":709 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ goto __pyx_L5; } /* "PETSc/Mat.pyx":712 * reuse = MAT_INITIAL_MATRIX * else: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) * return out */ /*else*/ { __pyx_v_reuse = MAT_REUSE_MATRIX; } __pyx_L5:; /* "PETSc/Mat.pyx":713 * else: * reuse = MAT_REUSE_MATRIX * CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatConvert(__pyx_v_self->mat, __pyx_v_mtype, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 713, __pyx_L1_error) /* "PETSc/Mat.pyx":714 * reuse = MAT_REUSE_MATRIX * CHKERR( MatConvert(self.mat, mtype, reuse, &out.mat) ) * return out # <<<<<<<<<<<<<< * * def transpose(self, Mat out=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/Mat.pyx":701 * return self * * def convert(self, mat_type=None, Mat out=None): # <<<<<<<<<<<<<< * cdef PetscMatType mtype = MATSAME * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat_type); __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":716 * return out * * def transpose(self, Mat out=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_127transpose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_126transpose[] = "Mat.transpose(self, Mat out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_127transpose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transpose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transpose") < 0)) __PYX_ERR(38, 716, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transpose", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 716, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.transpose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(38, 716, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_126transpose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126transpose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transpose", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "PETSc/Mat.pyx":717 * * def transpose(self, Mat out=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * if out is None: out = self * if out.mat == self.mat: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":718 * def transpose(self, Mat out=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self # <<<<<<<<<<<<<< * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); } /* "PETSc/Mat.pyx":719 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ __pyx_t_2 = ((__pyx_v_out->mat == __pyx_v_self->mat) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":720 * if out is None: out = self * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX # <<<<<<<<<<<<<< * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX */ __pyx_v_reuse = MAT_INPLACE_MATRIX; /* "PETSc/Mat.pyx":719 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self * if out.mat == self.mat: # <<<<<<<<<<<<<< * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: */ goto __pyx_L4; } /* "PETSc/Mat.pyx":721 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ __pyx_t_2 = ((__pyx_v_out->mat == NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":722 * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: * reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * else: * reuse = MAT_REUSE_MATRIX */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":721 * if out.mat == self.mat: * reuse = MAT_INPLACE_MATRIX * elif out.mat == NULL: # <<<<<<<<<<<<<< * reuse = MAT_INITIAL_MATRIX * else: */ goto __pyx_L4; } /* "PETSc/Mat.pyx":724 * reuse = MAT_INITIAL_MATRIX * else: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) * return out */ /*else*/ { __pyx_v_reuse = MAT_REUSE_MATRIX; } __pyx_L4:; /* "PETSc/Mat.pyx":725 * else: * reuse = MAT_REUSE_MATRIX * CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatTranspose(__pyx_v_self->mat, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 725, __pyx_L1_error) /* "PETSc/Mat.pyx":726 * reuse = MAT_REUSE_MATRIX * CHKERR( MatTranspose(self.mat, reuse, &out.mat) ) * return out # <<<<<<<<<<<<<< * * def realPart(self, Mat out=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/Mat.pyx":716 * return out * * def transpose(self, Mat out=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.transpose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":728 * return out * * def realPart(self, Mat out=None): # <<<<<<<<<<<<<< * if out is None: * out = self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_129realPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_128realPart[] = "Mat.realPart(self, Mat out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_129realPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("realPart (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "realPart") < 0)) __PYX_ERR(38, 728, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("realPart", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 728, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.realPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(38, 728, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_128realPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128realPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("realPart", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "PETSc/Mat.pyx":729 * * def realPart(self, Mat out=None): * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":730 * def realPart(self, Mat out=None): * if out is None: * out = self # <<<<<<<<<<<<<< * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); /* "PETSc/Mat.pyx":729 * * def realPart(self, Mat out=None): * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ goto __pyx_L3; } /* "PETSc/Mat.pyx":731 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) */ __pyx_t_2 = ((__pyx_v_out->mat == NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":732 * out = self * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatRealPart(out.mat) ) * return out */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 732, __pyx_L1_error) /* "PETSc/Mat.pyx":731 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) */ } __pyx_L3:; /* "PETSc/Mat.pyx":733 * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRealPart(__pyx_v_out->mat)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 733, __pyx_L1_error) /* "PETSc/Mat.pyx":734 * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatRealPart(out.mat) ) * return out # <<<<<<<<<<<<<< * * def imagPart(self, Mat out=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/Mat.pyx":728 * return out * * def realPart(self, Mat out=None): # <<<<<<<<<<<<<< * if out is None: * out = self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.realPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":736 * return out * * def imagPart(self, Mat out=None): # <<<<<<<<<<<<<< * if out is None: * out = self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131imagPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_130imagPart[] = "Mat.imagPart(self, Mat out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131imagPart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("imagPart (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "imagPart") < 0)) __PYX_ERR(38, 736, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("imagPart", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 736, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.imagPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(38, 736, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_130imagPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130imagPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("imagPart", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "PETSc/Mat.pyx":737 * * def imagPart(self, Mat out=None): * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":738 * def imagPart(self, Mat out=None): * if out is None: * out = self # <<<<<<<<<<<<<< * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); /* "PETSc/Mat.pyx":737 * * def imagPart(self, Mat out=None): * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ goto __pyx_L3; } /* "PETSc/Mat.pyx":739 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) */ __pyx_t_2 = ((__pyx_v_out->mat == NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":740 * out = self * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatImaginaryPart(out.mat) ) * return out */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 740, __pyx_L1_error) /* "PETSc/Mat.pyx":739 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) */ } __pyx_L3:; /* "PETSc/Mat.pyx":741 * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatImaginaryPart(__pyx_v_out->mat)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 741, __pyx_L1_error) /* "PETSc/Mat.pyx":742 * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatImaginaryPart(out.mat) ) * return out # <<<<<<<<<<<<<< * * def conjugate(self, Mat out=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/Mat.pyx":736 * return out * * def imagPart(self, Mat out=None): # <<<<<<<<<<<<<< * if out is None: * out = self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.imagPart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":744 * return out * * def conjugate(self, Mat out=None): # <<<<<<<<<<<<<< * if out is None: * out = self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_133conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_132conjugate[] = "Mat.conjugate(self, Mat out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_133conjugate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("conjugate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "conjugate") < 0)) __PYX_ERR(38, 744, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_out = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("conjugate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 744, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.conjugate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(38, 744, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_132conjugate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132conjugate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("conjugate", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "PETSc/Mat.pyx":745 * * def conjugate(self, Mat out=None): * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_out) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":746 * def conjugate(self, Mat out=None): * if out is None: * out = self # <<<<<<<<<<<<<< * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_out, __pyx_v_self); /* "PETSc/Mat.pyx":745 * * def conjugate(self, Mat out=None): * if out is None: # <<<<<<<<<<<<<< * out = self * elif out.mat == NULL: */ goto __pyx_L3; } /* "PETSc/Mat.pyx":747 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) */ __pyx_t_2 = ((__pyx_v_out->mat == NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":748 * out = self * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatConjugate(out.mat) ) * return out */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDuplicate(__pyx_v_self->mat, MAT_COPY_VALUES, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 748, __pyx_L1_error) /* "PETSc/Mat.pyx":747 * if out is None: * out = self * elif out.mat == NULL: # <<<<<<<<<<<<<< * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) */ } __pyx_L3:; /* "PETSc/Mat.pyx":749 * elif out.mat == NULL: * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) # <<<<<<<<<<<<<< * return out * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatConjugate(__pyx_v_out->mat)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 749, __pyx_L1_error) /* "PETSc/Mat.pyx":750 * CHKERR( MatDuplicate(self.mat, MAT_COPY_VALUES, &out.mat) ) * CHKERR( MatConjugate(out.mat) ) * return out # <<<<<<<<<<<<<< * * def permute(self, IS row, IS col): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/Mat.pyx":744 * return out * * def conjugate(self, Mat out=None): # <<<<<<<<<<<<<< * if out is None: * out = self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.conjugate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":752 * return out * * def permute(self, IS row, IS col): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_134permute[] = "Mat.permute(self, IS row, IS col)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_row = 0; struct PyPetscISObject *__pyx_v_col = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("permute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("permute", 1, 2, 2, 1); __PYX_ERR(38, 752, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "permute") < 0)) __PYX_ERR(38, 752, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_row = ((struct PyPetscISObject *)values[0]); __pyx_v_col = ((struct PyPetscISObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("permute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 752, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_row), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "row", 0))) __PYX_ERR(38, 752, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "col", 0))) __PYX_ERR(38, 752, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_134permute(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134permute(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_row, struct PyPetscISObject *__pyx_v_col) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("permute", 0); /* "PETSc/Mat.pyx":753 * * def permute(self, IS row, IS col): * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) * return mat */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":754 * def permute(self, IS row, IS col): * cdef Mat mat = Mat() * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPermute(__pyx_v_self->mat, __pyx_v_row->iset, __pyx_v_col->iset, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 754, __pyx_L1_error) /* "PETSc/Mat.pyx":755 * cdef Mat mat = Mat() * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def equal(self, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/Mat.pyx":752 * return out * * def permute(self, IS row, IS col): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( MatPermute(self.mat, row.iset, col.iset, &mat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":757 * return mat * * def equal(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_137equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_136equal[] = "Mat.equal(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_137equal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("equal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(38, 757, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 757, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 757, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_136equal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136equal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("equal", 0); /* "PETSc/Mat.pyx":758 * * def equal(self, Mat mat): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":759 * def equal(self, Mat mat): * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatEqual(__pyx_v_self->mat, __pyx_v_mat->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 759, __pyx_L1_error) /* "PETSc/Mat.pyx":760 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isTranspose(self, Mat mat=None, tol=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":757 * return mat * * def equal(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatEqual(self.mat, mat.mat, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.equal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":762 * return toBool(flag) * * def isTranspose(self, Mat mat=None, tol=0): # <<<<<<<<<<<<<< * if mat is None: mat = self * cdef PetscReal rval = asReal(tol) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139isTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_138isTranspose[] = "Mat.isTranspose(self, Mat mat=None, tol=0)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139isTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_tol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isTranspose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_tol,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isTranspose") < 0)) __PYX_ERR(38, 762, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_tol = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isTranspose", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 762, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.isTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(38, 762, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_138isTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_tol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138isTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isTranspose", 0); __Pyx_INCREF((PyObject *)__pyx_v_mat); /* "PETSc/Mat.pyx":763 * * def isTranspose(self, Mat mat=None, tol=0): * if mat is None: mat = self # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE */ __pyx_t_1 = (((PyObject *)__pyx_v_mat) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_DECREF_SET(__pyx_v_mat, __pyx_v_self); } /* "PETSc/Mat.pyx":764 * def isTranspose(self, Mat mat=None, tol=0): * if mat is None: mat = self * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 764, __pyx_L1_error) __pyx_v_rval = __pyx_t_3; /* "PETSc/Mat.pyx":765 * if mat is None: mat = self * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":766 * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsTranspose(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_rval, (&__pyx_v_flag))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 766, __pyx_L1_error) /* "PETSc/Mat.pyx":767 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsTranspose(self.mat, mat.mat, rval, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isSymmetric(self, tol=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":762 * return toBool(flag) * * def isTranspose(self, Mat mat=None, tol=0): # <<<<<<<<<<<<<< * if mat is None: mat = self * cdef PetscReal rval = asReal(tol) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":769 * return toBool(flag) * * def isSymmetric(self, tol=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141isSymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_140isSymmetric[] = "Mat.isSymmetric(self, tol=0)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141isSymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isSymmetric (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isSymmetric") < 0)) __PYX_ERR(38, 769, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tol = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isSymmetric", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 769, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.isSymmetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_140isSymmetric(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140isSymmetric(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isSymmetric", 0); /* "PETSc/Mat.pyx":770 * * def isSymmetric(self, tol=0): * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 770, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/Mat.pyx":771 * def isSymmetric(self, tol=0): * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":772 * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsSymmetric(__pyx_v_self->mat, __pyx_v_rval, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 772, __pyx_L1_error) /* "PETSc/Mat.pyx":773 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsSymmetric(self.mat, rval, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isSymmetricKnown(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":769 * return toBool(flag) * * def isSymmetric(self, tol=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isSymmetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":775 * return toBool(flag) * * def isSymmetricKnown(self): # <<<<<<<<<<<<<< * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_143isSymmetricKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_142isSymmetricKnown[] = "Mat.isSymmetricKnown(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_143isSymmetricKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isSymmetricKnown (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isSymmetricKnown", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isSymmetricKnown", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_142isSymmetricKnown(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142isSymmetricKnown(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag1; PetscBool __pyx_v_flag2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isSymmetricKnown", 0); /* "PETSc/Mat.pyx":776 * * def isSymmetricKnown(self): * cdef PetscBool flag1 = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) */ __pyx_v_flag1 = PETSC_FALSE; /* "PETSc/Mat.pyx":777 * def isSymmetricKnown(self): * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) */ __pyx_v_flag2 = PETSC_FALSE; /* "PETSc/Mat.pyx":778 * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) # <<<<<<<<<<<<<< * return (toBool(flag1), toBool(flag2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsSymmetricKnown(__pyx_v_self->mat, (&__pyx_v_flag1), (&__pyx_v_flag2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 778, __pyx_L1_error) /* "PETSc/Mat.pyx":779 * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsSymmetricKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) # <<<<<<<<<<<<<< * * def isHermitian(self, tol=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":775 * return toBool(flag) * * def isSymmetricKnown(self): # <<<<<<<<<<<<<< * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isSymmetricKnown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":781 * return (toBool(flag1), toBool(flag2)) * * def isHermitian(self, tol=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145isHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_144isHermitian[] = "Mat.isHermitian(self, tol=0)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145isHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isHermitian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isHermitian") < 0)) __PYX_ERR(38, 781, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tol = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("isHermitian", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 781, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.isHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_144isHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144isHermitian(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isHermitian", 0); /* "PETSc/Mat.pyx":782 * * def isHermitian(self, tol=0): * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 782, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/Mat.pyx":783 * def isHermitian(self, tol=0): * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":784 * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsHermitian(__pyx_v_self->mat, __pyx_v_rval, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 784, __pyx_L1_error) /* "PETSc/Mat.pyx":785 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsHermitian(self.mat, rval, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def isHermitianKnown(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":781 * return (toBool(flag1), toBool(flag2)) * * def isHermitian(self, tol=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * cdef PetscBool flag = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":787 * return toBool(flag) * * def isHermitianKnown(self): # <<<<<<<<<<<<<< * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_147isHermitianKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_146isHermitianKnown[] = "Mat.isHermitianKnown(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_147isHermitianKnown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isHermitianKnown (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isHermitianKnown", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isHermitianKnown", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_146isHermitianKnown(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146isHermitianKnown(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag1; PetscBool __pyx_v_flag2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isHermitianKnown", 0); /* "PETSc/Mat.pyx":788 * * def isHermitianKnown(self): * cdef PetscBool flag1 = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) */ __pyx_v_flag1 = PETSC_FALSE; /* "PETSc/Mat.pyx":789 * def isHermitianKnown(self): * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) */ __pyx_v_flag2 = PETSC_FALSE; /* "PETSc/Mat.pyx":790 * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) # <<<<<<<<<<<<<< * return (toBool(flag1), toBool(flag2)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsHermitianKnown(__pyx_v_self->mat, (&__pyx_v_flag1), (&__pyx_v_flag2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 790, __pyx_L1_error) /* "PETSc/Mat.pyx":791 * cdef PetscBool flag2 = PETSC_FALSE * CHKERR( MatIsHermitianKnown(self.mat, &flag1, &flag2) ) * return (toBool(flag1), toBool(flag2)) # <<<<<<<<<<<<<< * * def isStructurallySymmetric(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":787 * return toBool(flag) * * def isHermitianKnown(self): # <<<<<<<<<<<<<< * cdef PetscBool flag1 = PETSC_FALSE * cdef PetscBool flag2 = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isHermitianKnown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":793 * return (toBool(flag1), toBool(flag2)) * * def isStructurallySymmetric(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_149isStructurallySymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_148isStructurallySymmetric[] = "Mat.isStructurallySymmetric(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_149isStructurallySymmetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isStructurallySymmetric (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isStructurallySymmetric", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isStructurallySymmetric", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_148isStructurallySymmetric(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148isStructurallySymmetric(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isStructurallySymmetric", 0); /* "PETSc/Mat.pyx":794 * * def isStructurallySymmetric(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":795 * def isStructurallySymmetric(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsStructurallySymmetric(__pyx_v_self->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 795, __pyx_L1_error) /* "PETSc/Mat.pyx":796 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def zeroEntries(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":793 * return (toBool(flag1), toBool(flag2)) * * def isStructurallySymmetric(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatIsStructurallySymmetric(self.mat, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isStructurallySymmetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":798 * return toBool(flag) * * def zeroEntries(self): # <<<<<<<<<<<<<< * CHKERR( MatZeroEntries(self.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_151zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_150zeroEntries[] = "Mat.zeroEntries(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_151zeroEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroEntries (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("zeroEntries", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "zeroEntries", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_150zeroEntries(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150zeroEntries(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroEntries", 0); /* "PETSc/Mat.pyx":799 * * def zeroEntries(self): * CHKERR( MatZeroEntries(self.mat) ) # <<<<<<<<<<<<<< * * def getValue(self, row, col): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroEntries(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 799, __pyx_L1_error) /* "PETSc/Mat.pyx":798 * return toBool(flag) * * def zeroEntries(self): # <<<<<<<<<<<<<< * CHKERR( MatZeroEntries(self.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroEntries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":801 * CHKERR( MatZeroEntries(self.mat) ) * * def getValue(self, row, col): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_153getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_152getValue[] = "Mat.getValue(self, row, col)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_153getValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getValue", 1, 2, 2, 1); __PYX_ERR(38, 801, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValue") < 0)) __PYX_ERR(38, 801, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_row = values[0]; __pyx_v_col = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 801, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_152getValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152getValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValue", 0); /* "PETSc/Mat.pyx":802 * * def getValue(self, row, col): * cdef PetscInt ival1 = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 802, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "PETSc/Mat.pyx":803 * def getValue(self, row, col): * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) # <<<<<<<<<<<<<< * cdef PetscScalar sval = 0 * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 803, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "PETSc/Mat.pyx":804 * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) * return toScalar(sval) */ __pyx_v_sval = 0.0; /* "PETSc/Mat.pyx":805 * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = 0 * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) # <<<<<<<<<<<<<< * return toScalar(sval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetValues(__pyx_v_self->mat, 1, (&__pyx_v_ival1), 1, (&__pyx_v_ival2), (&__pyx_v_sval))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 805, __pyx_L1_error) /* "PETSc/Mat.pyx":806 * cdef PetscScalar sval = 0 * CHKERR( MatGetValues(self.mat, 1, &ival1, 1, &ival2, &sval) ) * return toScalar(sval) # <<<<<<<<<<<<<< * * def getValues(self, rows, cols, values=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":801 * CHKERR( MatZeroEntries(self.mat) ) * * def getValue(self, row, col): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":808 * return toScalar(sval) * * def getValues(self, rows, cols, values=None): # <<<<<<<<<<<<<< * return matgetvalues(self.mat, rows, cols, values) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_155getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_154getValues[] = "Mat.getValues(self, rows, cols, values=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_155getValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValues (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getValues", 0, 2, 3, 1); __PYX_ERR(38, 808, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getValues") < 0)) __PYX_ERR(38, 808, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getValues", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 808, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_154getValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154getValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValues", 0); /* "PETSc/Mat.pyx":809 * * def getValues(self, rows, cols, values=None): * return matgetvalues(self.mat, rows, cols, values) # <<<<<<<<<<<<<< * * def getValuesCSR(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matgetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":808 * return toScalar(sval) * * def getValues(self, rows, cols, values=None): # <<<<<<<<<<<<<< * return matgetvalues(self.mat, rows, cols, values) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":811 * return matgetvalues(self.mat, rows, cols, values) * * def getValuesCSR(self): # <<<<<<<<<<<<<< * # row ownership * cdef PetscInt rstart=0, rend=0, nrows=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_157getValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_156getValuesCSR[] = "Mat.getValuesCSR(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_157getValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getValuesCSR (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getValuesCSR", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getValuesCSR", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_156getValuesCSR(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156getValuesCSR(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_rstart; PetscInt __pyx_v_rend; PetscInt __pyx_v_nrows; PetscInt *__pyx_v_AI; PyArrayObject *__pyx_v_ai = 0; PetscInt __pyx_v_irow; PetscInt __pyx_v_ncols; PetscInt *__pyx_v_AJ; PyArrayObject *__pyx_v_aj = 0; PetscScalar *__pyx_v_AV; PyArrayObject *__pyx_v_av = 0; PetscInt const *__pyx_v_cols; PetscScalar const *__pyx_v_vals; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getValuesCSR", 0); /* "PETSc/Mat.pyx":813 * def getValuesCSR(self): * # row ownership * cdef PetscInt rstart=0, rend=0, nrows=0 # <<<<<<<<<<<<<< * CHKERR( MatGetOwnershipRange(self.mat, &rstart, &rend) ) * nrows = rend - rstart */ __pyx_v_rstart = 0; __pyx_v_rend = 0; __pyx_v_nrows = 0; /* "PETSc/Mat.pyx":814 * # row ownership * cdef PetscInt rstart=0, rend=0, nrows=0 * CHKERR( MatGetOwnershipRange(self.mat, &rstart, &rend) ) # <<<<<<<<<<<<<< * nrows = rend - rstart * # first pass: row pointer array */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipRange(__pyx_v_self->mat, (&__pyx_v_rstart), (&__pyx_v_rend))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 814, __pyx_L1_error) /* "PETSc/Mat.pyx":815 * cdef PetscInt rstart=0, rend=0, nrows=0 * CHKERR( MatGetOwnershipRange(self.mat, &rstart, &rend) ) * nrows = rend - rstart # <<<<<<<<<<<<<< * # first pass: row pointer array * cdef PetscInt *AI = NULL */ __pyx_v_nrows = (__pyx_v_rend - __pyx_v_rstart); /* "PETSc/Mat.pyx":817 * nrows = rend - rstart * # first pass: row pointer array * cdef PetscInt *AI = NULL # <<<<<<<<<<<<<< * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) * cdef PetscInt irow=0, ncols=0 */ __pyx_v_AI = NULL; /* "PETSc/Mat.pyx":818 * # first pass: row pointer array * cdef PetscInt *AI = NULL * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) # <<<<<<<<<<<<<< * cdef PetscInt irow=0, ncols=0 * AI[0] = 0 */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i((__pyx_v_nrows + 1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_2, NULL, (&__pyx_v_AI))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_ai = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":819 * cdef PetscInt *AI = NULL * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) * cdef PetscInt irow=0, ncols=0 # <<<<<<<<<<<<<< * AI[0] = 0 * for irow from 0 <= irow < nrows: */ __pyx_v_irow = 0; __pyx_v_ncols = 0; /* "PETSc/Mat.pyx":820 * cdef ndarray ai = oarray_i(empty_i(nrows+1), NULL, &AI) * cdef PetscInt irow=0, ncols=0 * AI[0] = 0 # <<<<<<<<<<<<<< * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) */ (__pyx_v_AI[0]) = 0; /* "PETSc/Mat.pyx":821 * cdef PetscInt irow=0, ncols=0 * AI[0] = 0 * for irow from 0 <= irow < nrows: # <<<<<<<<<<<<<< * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * AI[irow+1] = AI[irow] + ncols */ __pyx_t_4 = __pyx_v_nrows; for (__pyx_v_irow = 0; __pyx_v_irow < __pyx_t_4; __pyx_v_irow++) { /* "PETSc/Mat.pyx":822 * AI[0] = 0 * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) # <<<<<<<<<<<<<< * AI[irow+1] = AI[irow] + ncols * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 822, __pyx_L1_error) /* "PETSc/Mat.pyx":823 * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * AI[irow+1] = AI[irow] + ncols # <<<<<<<<<<<<<< * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * # second pass: column indices and values */ (__pyx_v_AI[(__pyx_v_irow + 1)]) = ((__pyx_v_AI[__pyx_v_irow]) + __pyx_v_ncols); /* "PETSc/Mat.pyx":824 * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * AI[irow+1] = AI[irow] + ncols * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) # <<<<<<<<<<<<<< * # second pass: column indices and values * cdef PetscInt *AJ = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 824, __pyx_L1_error) } /* "PETSc/Mat.pyx":826 * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, NULL, NULL) ) * # second pass: column indices and values * cdef PetscInt *AJ = NULL # <<<<<<<<<<<<<< * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) * cdef PetscScalar *AV = NULL */ __pyx_v_AJ = NULL; /* "PETSc/Mat.pyx":827 * # second pass: column indices and values * cdef PetscInt *AJ = NULL * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) # <<<<<<<<<<<<<< * cdef PetscScalar *AV = NULL * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i((__pyx_v_AI[__pyx_v_nrows]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_3, NULL, (&__pyx_v_AJ))); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_aj = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Mat.pyx":828 * cdef PetscInt *AJ = NULL * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) * cdef PetscScalar *AV = NULL # <<<<<<<<<<<<<< * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) * cdef const PetscInt *cols = NULL */ __pyx_v_AV = NULL; /* "PETSc/Mat.pyx":829 * cdef ndarray aj = oarray_i(empty_i(AI[nrows]), NULL, &AJ) * cdef PetscScalar *AV = NULL * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) # <<<<<<<<<<<<<< * cdef const PetscInt *cols = NULL * cdef const PetscScalar *vals = NULL */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s((__pyx_v_AI[__pyx_v_nrows]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_t_2, NULL, (&__pyx_v_AV))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_av = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":830 * cdef PetscScalar *AV = NULL * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) * cdef const PetscInt *cols = NULL # <<<<<<<<<<<<<< * cdef const PetscScalar *vals = NULL * for irow from 0 <= irow < nrows: */ __pyx_v_cols = NULL; /* "PETSc/Mat.pyx":831 * cdef ndarray av = oarray_s(empty_s(AI[nrows]), NULL, &AV) * cdef const PetscInt *cols = NULL * cdef const PetscScalar *vals = NULL # <<<<<<<<<<<<<< * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) */ __pyx_v_vals = NULL; /* "PETSc/Mat.pyx":832 * cdef const PetscInt *cols = NULL * cdef const PetscScalar *vals = NULL * for irow from 0 <= irow < nrows: # <<<<<<<<<<<<<< * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) */ __pyx_t_4 = __pyx_v_nrows; for (__pyx_v_irow = 0; __pyx_v_irow < __pyx_t_4; __pyx_v_irow++) { /* "PETSc/Mat.pyx":833 * cdef const PetscScalar *vals = NULL * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) # <<<<<<<<<<<<<< * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), (&__pyx_v_cols), (&__pyx_v_vals))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 833, __pyx_L1_error) /* "PETSc/Mat.pyx":834 * for irow from 0 <= irow < nrows: * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) # <<<<<<<<<<<<<< * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy((__pyx_v_AJ + (__pyx_v_AI[__pyx_v_irow])), __pyx_v_cols, (((size_t)__pyx_v_ncols) * (sizeof(PetscInt))))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 834, __pyx_L1_error) /* "PETSc/Mat.pyx":835 * CHKERR( MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) # <<<<<<<<<<<<<< * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy((__pyx_v_AV + (__pyx_v_AI[__pyx_v_irow])), __pyx_v_vals, (((size_t)__pyx_v_ncols) * (sizeof(PetscScalar))))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 835, __pyx_L1_error) /* "PETSc/Mat.pyx":836 * CHKERR( PetscMemcpy(AJ+AI[irow], cols, ncols*sizeof(PetscInt)) ) * CHKERR( PetscMemcpy(AV+AI[irow], vals, ncols*sizeof(PetscScalar)) ) * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) # <<<<<<<<<<<<<< * # * return (ai, aj, av) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRow(__pyx_v_self->mat, (__pyx_v_irow + __pyx_v_rstart), (&__pyx_v_ncols), (&__pyx_v_cols), (&__pyx_v_vals))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 836, __pyx_L1_error) } /* "PETSc/Mat.pyx":838 * CHKERR( MatRestoreRow(self.mat, irow+rstart, &ncols, &cols, &vals) ) * # * return (ai, aj, av) # <<<<<<<<<<<<<< * * def getRow(self, row): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_ai)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ai)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ai)); __Pyx_INCREF(((PyObject *)__pyx_v_aj)); __Pyx_GIVEREF(((PyObject *)__pyx_v_aj)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_aj)); __Pyx_INCREF(((PyObject *)__pyx_v_av)); __Pyx_GIVEREF(((PyObject *)__pyx_v_av)); PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_av)); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":811 * return matgetvalues(self.mat, rows, cols, values) * * def getValuesCSR(self): # <<<<<<<<<<<<<< * # row ownership * cdef PetscInt rstart=0, rend=0, nrows=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getValuesCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ai); __Pyx_XDECREF((PyObject *)__pyx_v_aj); __Pyx_XDECREF((PyObject *)__pyx_v_av); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":840 * return (ai, aj, av) * * def getRow(self, row): # <<<<<<<<<<<<<< * cdef PetscInt irow = asInt(row) * cdef PetscInt ncols = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_159getRow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_158getRow[] = "Mat.getRow(self, row)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_159getRow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_row = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRow (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRow") < 0)) __PYX_ERR(38, 840, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_row = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRow", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 840, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRow", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_158getRow(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158getRow(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row) { PetscInt __pyx_v_irow; PetscInt __pyx_v_ncols; PetscInt const *__pyx_v_icols; PetscScalar const *__pyx_v_svals; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_vals = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRow", 0); /* "PETSc/Mat.pyx":841 * * def getRow(self, row): * cdef PetscInt irow = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ncols = 0 * cdef const PetscInt *icols=NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 841, __pyx_L1_error) __pyx_v_irow = __pyx_t_1; /* "PETSc/Mat.pyx":842 * def getRow(self, row): * cdef PetscInt irow = asInt(row) * cdef PetscInt ncols = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *icols=NULL * cdef const PetscScalar *svals=NULL */ __pyx_v_ncols = 0; /* "PETSc/Mat.pyx":843 * cdef PetscInt irow = asInt(row) * cdef PetscInt ncols = 0 * cdef const PetscInt *icols=NULL # <<<<<<<<<<<<<< * cdef const PetscScalar *svals=NULL * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) */ __pyx_v_icols = NULL; /* "PETSc/Mat.pyx":844 * cdef PetscInt ncols = 0 * cdef const PetscInt *icols=NULL * cdef const PetscScalar *svals=NULL # <<<<<<<<<<<<<< * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) * cdef object cols = array_i(ncols, icols) */ __pyx_v_svals = NULL; /* "PETSc/Mat.pyx":845 * cdef const PetscInt *icols=NULL * cdef const PetscScalar *svals=NULL * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) # <<<<<<<<<<<<<< * cdef object cols = array_i(ncols, icols) * cdef object vals = array_s(ncols, svals) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRow(__pyx_v_self->mat, __pyx_v_irow, (&__pyx_v_ncols), (&__pyx_v_icols), (&__pyx_v_svals))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 845, __pyx_L1_error) /* "PETSc/Mat.pyx":846 * cdef const PetscScalar *svals=NULL * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) * cdef object cols = array_i(ncols, icols) # <<<<<<<<<<<<<< * cdef object vals = array_s(ncols, svals) * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_ncols, __pyx_v_icols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_cols = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/Mat.pyx":847 * CHKERR( MatGetRow(self.mat, irow, &ncols, &icols, &svals) ) * cdef object cols = array_i(ncols, icols) * cdef object vals = array_s(ncols, svals) # <<<<<<<<<<<<<< * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) * return (cols, vals) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s(__pyx_v_ncols, __pyx_v_svals)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vals = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/Mat.pyx":848 * cdef object cols = array_i(ncols, icols) * cdef object vals = array_s(ncols, svals) * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) # <<<<<<<<<<<<<< * return (cols, vals) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRow(__pyx_v_self->mat, __pyx_v_irow, (&__pyx_v_ncols), (&__pyx_v_icols), (&__pyx_v_svals))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 848, __pyx_L1_error) /* "PETSc/Mat.pyx":849 * cdef object vals = array_s(ncols, svals) * CHKERR( MatRestoreRow(self.mat, irow, &ncols, &icols, &svals) ) * return (cols, vals) # <<<<<<<<<<<<<< * * def getRowIJ(self, symmetric=False, compressed=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_cols); __Pyx_GIVEREF(__pyx_v_cols); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cols); __Pyx_INCREF(__pyx_v_vals); __Pyx_GIVEREF(__pyx_v_vals); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vals); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":840 * return (ai, aj, av) * * def getRow(self, row): # <<<<<<<<<<<<<< * cdef PetscInt irow = asInt(row) * cdef PetscInt ncols = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRow", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cols); __Pyx_XDECREF(__pyx_v_vals); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":851 * return (cols, vals) * * def getRowIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<< * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_161getRowIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_160getRowIJ[] = "Mat.getRowIJ(self, symmetric=False, compressed=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_161getRowIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_symmetric = 0; PyObject *__pyx_v_compressed = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRowIJ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symmetric,&__pyx_n_s_compressed,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_False); values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symmetric); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compressed); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRowIJ") < 0)) __PYX_ERR(38, 851, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_symmetric = values[0]; __pyx_v_compressed = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRowIJ", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 851, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_160getRowIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160getRowIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed) { PetscInt __pyx_v_shift; PetscBool __pyx_v_symm; PetscBool __pyx_v_bcmp; PetscInt __pyx_v_n; PetscInt const *__pyx_v_ia; PetscInt const *__pyx_v_ja; PetscBool __pyx_v_done; PyObject *__pyx_v_ai = 0; PyObject *__pyx_v_aj = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRowIJ", 0); /* "PETSc/Mat.pyx":852 * * def getRowIJ(self, symmetric=False, compressed=False): * cdef PetscInt shift=0 # <<<<<<<<<<<<<< * cdef PetscBool symm=symmetric * cdef PetscBool bcmp=compressed */ __pyx_v_shift = 0; /* "PETSc/Mat.pyx":853 * def getRowIJ(self, symmetric=False, compressed=False): * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric # <<<<<<<<<<<<<< * cdef PetscBool bcmp=compressed * cdef PetscInt n=0 */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_symmetric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 853, __pyx_L1_error) __pyx_v_symm = __pyx_t_1; /* "PETSc/Mat.pyx":854 * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric * cdef PetscBool bcmp=compressed # <<<<<<<<<<<<<< * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_compressed)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 854, __pyx_L1_error) __pyx_v_bcmp = __pyx_t_1; /* "PETSc/Mat.pyx":855 * cdef PetscBool symm=symmetric * cdef PetscBool bcmp=compressed * cdef PetscInt n=0 # <<<<<<<<<<<<<< * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL */ __pyx_v_n = 0; /* "PETSc/Mat.pyx":856 * cdef PetscBool bcmp=compressed * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL # <<<<<<<<<<<<<< * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE */ __pyx_v_ia = NULL; /* "PETSc/Mat.pyx":857 * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL # <<<<<<<<<<<<<< * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_v_ja = NULL; /* "PETSc/Mat.pyx":858 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None */ __pyx_v_done = PETSC_FALSE; /* "PETSc/Mat.pyx":859 * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRowIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 859, __pyx_L1_error) /* "PETSc/Mat.pyx":860 * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None # <<<<<<<<<<<<<< * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) */ __Pyx_INCREF(Py_None); __pyx_v_ai = Py_None; __Pyx_INCREF(Py_None); __pyx_v_aj = Py_None; /* "PETSc/Mat.pyx":861 * CHKERR( MatGetRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) # <<<<<<<<<<<<<< * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_t_3 = ((__pyx_v_done != PETSC_FALSE) != 0); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_n + 1), __pyx_v_ia)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ai, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/Mat.pyx":862 * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) # <<<<<<<<<<<<<< * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) */ __pyx_t_3 = ((__pyx_v_done != PETSC_FALSE) != 0); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_ia[__pyx_v_n]), __pyx_v_ja)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_aj, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/Mat.pyx":863 * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * return (ai, aj) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreRowIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 863, __pyx_L1_error) /* "PETSc/Mat.pyx":864 * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreRowIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) # <<<<<<<<<<<<<< * * def getColumnIJ(self, symmetric=False, compressed=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_ai); __Pyx_GIVEREF(__pyx_v_ai); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ai); __Pyx_INCREF(__pyx_v_aj); __Pyx_GIVEREF(__pyx_v_aj); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_aj); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":851 * return (cols, vals) * * def getRowIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<< * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ai); __Pyx_XDECREF(__pyx_v_aj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":866 * return (ai, aj) * * def getColumnIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<< * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric, bcmp=compressed */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_163getColumnIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_162getColumnIJ[] = "Mat.getColumnIJ(self, symmetric=False, compressed=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_163getColumnIJ(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_symmetric = 0; PyObject *__pyx_v_compressed = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getColumnIJ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_symmetric,&__pyx_n_s_compressed,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_False); values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_symmetric); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compressed); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getColumnIJ") < 0)) __PYX_ERR(38, 866, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_symmetric = values[0]; __pyx_v_compressed = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getColumnIJ", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 866, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_162getColumnIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162getColumnIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed) { PetscInt __pyx_v_shift; PetscBool __pyx_v_symm; PetscBool __pyx_v_bcmp; PetscInt __pyx_v_n; PetscInt const *__pyx_v_ia; PetscInt const *__pyx_v_ja; PetscBool __pyx_v_done; PyObject *__pyx_v_ai = 0; PyObject *__pyx_v_aj = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getColumnIJ", 0); /* "PETSc/Mat.pyx":867 * * def getColumnIJ(self, symmetric=False, compressed=False): * cdef PetscInt shift=0 # <<<<<<<<<<<<<< * cdef PetscBool symm=symmetric, bcmp=compressed * cdef PetscInt n=0 */ __pyx_v_shift = 0; /* "PETSc/Mat.pyx":868 * def getColumnIJ(self, symmetric=False, compressed=False): * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric, bcmp=compressed # <<<<<<<<<<<<<< * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_symmetric)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 868, __pyx_L1_error) __pyx_v_symm = __pyx_t_1; __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_compressed)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 868, __pyx_L1_error) __pyx_v_bcmp = __pyx_t_1; /* "PETSc/Mat.pyx":869 * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric, bcmp=compressed * cdef PetscInt n=0 # <<<<<<<<<<<<<< * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL */ __pyx_v_n = 0; /* "PETSc/Mat.pyx":870 * cdef PetscBool symm=symmetric, bcmp=compressed * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL # <<<<<<<<<<<<<< * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE */ __pyx_v_ia = NULL; /* "PETSc/Mat.pyx":871 * cdef PetscInt n=0 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL # <<<<<<<<<<<<<< * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_v_ja = NULL; /* "PETSc/Mat.pyx":872 * cdef const PetscInt *ia=NULL * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None */ __pyx_v_done = PETSC_FALSE; /* "PETSc/Mat.pyx":873 * cdef const PetscInt *ja=NULL * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetColumnIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 873, __pyx_L1_error) /* "PETSc/Mat.pyx":874 * cdef PetscBool done=PETSC_FALSE * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None # <<<<<<<<<<<<<< * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) */ __Pyx_INCREF(Py_None); __pyx_v_ai = Py_None; __Pyx_INCREF(Py_None); __pyx_v_aj = Py_None; /* "PETSc/Mat.pyx":875 * CHKERR( MatGetColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) # <<<<<<<<<<<<<< * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) */ __pyx_t_3 = ((__pyx_v_done != PETSC_FALSE) != 0); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_n + 1), __pyx_v_ia)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_ai, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/Mat.pyx":876 * cdef object ai=None, aj=None * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) # <<<<<<<<<<<<<< * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) */ __pyx_t_3 = ((__pyx_v_done != PETSC_FALSE) != 0); if (__pyx_t_3) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_ia[__pyx_v_n]), __pyx_v_ja)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 876, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_aj, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/Mat.pyx":877 * if done != PETSC_FALSE: ai = array_i( n+1, ia) * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) # <<<<<<<<<<<<<< * return (ai, aj) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreColumnIJ(__pyx_v_self->mat, __pyx_v_shift, __pyx_v_symm, __pyx_v_bcmp, (&__pyx_v_n), (&__pyx_v_ia), (&__pyx_v_ja), (&__pyx_v_done))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 877, __pyx_L1_error) /* "PETSc/Mat.pyx":878 * if done != PETSC_FALSE: aj = array_i(ia[n], ja) * CHKERR( MatRestoreColumnIJ(self.mat, shift, symm, bcmp, &n, &ia, &ja, &done) ) * return (ai, aj) # <<<<<<<<<<<<<< * * def setValue(self, row, col, value, addv=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_ai); __Pyx_GIVEREF(__pyx_v_ai); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ai); __Pyx_INCREF(__pyx_v_aj); __Pyx_GIVEREF(__pyx_v_aj); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_aj); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":866 * return (ai, aj) * * def getColumnIJ(self, symmetric=False, compressed=False): # <<<<<<<<<<<<<< * cdef PetscInt shift=0 * cdef PetscBool symm=symmetric, bcmp=compressed */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnIJ", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ai); __Pyx_XDECREF(__pyx_v_aj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":880 * return (ai, aj) * * def setValue(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_165setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_164setValue[] = "Mat.setValue(self, row, col, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_165setValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, 1); __PYX_ERR(38, 880, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, 2); __PYX_ERR(38, 880, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValue") < 0)) __PYX_ERR(38, 880, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 880, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_164setValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164setValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValue", 0); /* "PETSc/Mat.pyx":881 * * def setValue(self, row, col, value, addv=None): * cdef PetscInt ival1 = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 881, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "PETSc/Mat.pyx":882 * def setValue(self, row, col, value, addv=None): * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 882, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "PETSc/Mat.pyx":883 * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 883, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "PETSc/Mat.pyx":884 * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(38, 884, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "PETSc/Mat.pyx":885 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) # <<<<<<<<<<<<<< * * def setValues(self, rows, cols, values, addv=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValues(__pyx_v_self->mat, 1, (&__pyx_v_ival1), 1, (&__pyx_v_ival2), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 885, __pyx_L1_error) /* "PETSc/Mat.pyx":880 * return (ai, aj) * * def setValue(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":887 * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValues(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_166setValues[] = "Mat.setValues(self, rows, cols, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167setValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValues (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, 1); __PYX_ERR(38, 887, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, 2); __PYX_ERR(38, 887, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValues") < 0)) __PYX_ERR(38, 887, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 887, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_166setValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166setValues(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValues", 0); /* "PETSc/Mat.pyx":888 * * def setValues(self, rows, cols, values, addv=None): * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesRCV(self, R, C, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 888, __pyx_L1_error) /* "PETSc/Mat.pyx":887 * CHKERR( MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValues(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":890 * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) * * def setValuesRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169setValuesRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_168setValuesRCV[] = "Mat.setValuesRCV(self, R, C, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169setValuesRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesRCV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, 1); __PYX_ERR(38, 890, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, 2); __PYX_ERR(38, 890, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesRCV") < 0)) __PYX_ERR(38, 890, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 890, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_168setValuesRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168setValuesRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesRCV", 0); /* "PETSc/Mat.pyx":891 * * def setValuesRCV(self, R, C, V, addv=None): * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesIJV(self, I, J, V, addv=None, rowmap=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 891, __pyx_L1_error) /* "PETSc/Mat.pyx":890 * matsetvalues(self.mat, rows, cols, values, addv, 0, 0) * * def setValuesRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":893 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) * * def setValuesIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_171setValuesIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_170setValuesIJV[] = "Mat.setValuesIJV(self, I, J, V, addv=None, rowmap=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_171setValuesIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesIJV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, 1); __PYX_ERR(38, 893, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, 2); __PYX_ERR(38, 893, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesIJV") < 0)) __PYX_ERR(38, 893, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 893, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_170setValuesIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170setValuesIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesIJV", 0); /* "PETSc/Mat.pyx":894 * * def setValuesIJV(self, I, J, V, addv=None, rowmap=None): * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) # <<<<<<<<<<<<<< * * def setValuesCSR(self, I, J, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 0, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 894, __pyx_L1_error) /* "PETSc/Mat.pyx":893 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0) * * def setValuesIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":896 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) * * def setValuesCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173setValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_172setValuesCSR[] = "Mat.setValuesCSR(self, I, J, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173setValuesCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesCSR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, 1); __PYX_ERR(38, 896, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, 2); __PYX_ERR(38, 896, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesCSR") < 0)) __PYX_ERR(38, 896, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 896, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_172setValuesCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172setValuesCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesCSR", 0); /* "PETSc/Mat.pyx":897 * * def setValuesCSR(self, I, J, V, addv=None): * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) # <<<<<<<<<<<<<< * * def setValuesBlocked(self, rows, cols, values, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 0, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 897, __pyx_L1_error) /* "PETSc/Mat.pyx":896 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0) * * def setValuesCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":899 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) * * def setValuesBlocked(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_174setValuesBlocked[] = "Mat.setValuesBlocked(self, rows, cols, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175setValuesBlocked(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlocked (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, 1); __PYX_ERR(38, 899, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, 2); __PYX_ERR(38, 899, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlocked") < 0)) __PYX_ERR(38, 899, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 899, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_174setValuesBlocked(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174setValuesBlocked(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlocked", 0); /* "PETSc/Mat.pyx":900 * * def setValuesBlocked(self, rows, cols, values, addv=None): * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) # <<<<<<<<<<<<<< * * def setValuesBlockedRCV(self, R, C, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 900, __pyx_L1_error) /* "PETSc/Mat.pyx":899 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 0) * * def setValuesBlocked(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlocked", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":902 * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) * * def setValuesBlockedRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177setValuesBlockedRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_176setValuesBlockedRCV[] = "Mat.setValuesBlockedRCV(self, R, C, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177setValuesBlockedRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedRCV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, 1); __PYX_ERR(38, 902, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, 2); __PYX_ERR(38, 902, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedRCV") < 0)) __PYX_ERR(38, 902, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 902, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_176setValuesBlockedRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176setValuesBlockedRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedRCV", 0); /* "PETSc/Mat.pyx":903 * * def setValuesBlockedRCV(self, R, C, V, addv=None): * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) # <<<<<<<<<<<<<< * * def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 903, __pyx_L1_error) /* "PETSc/Mat.pyx":902 * matsetvalues(self.mat, rows, cols, values, addv, 1, 0) * * def setValuesBlockedRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":905 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) * * def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179setValuesBlockedIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_178setValuesBlockedIJV[] = "Mat.setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179setValuesBlockedIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedIJV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, 1); __PYX_ERR(38, 905, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, 2); __PYX_ERR(38, 905, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedIJV") < 0)) __PYX_ERR(38, 905, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 905, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_178setValuesBlockedIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178setValuesBlockedIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedIJV", 0); /* "PETSc/Mat.pyx":906 * * def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None): * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) # <<<<<<<<<<<<<< * * def setValuesBlockedCSR(self, I, J, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 1, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 906, __pyx_L1_error) /* "PETSc/Mat.pyx":905 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0) * * def setValuesBlockedIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":908 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) * * def setValuesBlockedCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_181setValuesBlockedCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_180setValuesBlockedCSR[] = "Mat.setValuesBlockedCSR(self, I, J, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_181setValuesBlockedCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedCSR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, 1); __PYX_ERR(38, 908, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, 2); __PYX_ERR(38, 908, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedCSR") < 0)) __PYX_ERR(38, 908, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 908, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_180setValuesBlockedCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_180setValuesBlockedCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedCSR", 0); /* "PETSc/Mat.pyx":909 * * def setValuesBlockedCSR(self, I, J, V, addv=None): * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) # <<<<<<<<<<<<<< * * def setLGMap(self, LGMap rmap, LGMap cmap=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 1, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 909, __pyx_L1_error) /* "PETSc/Mat.pyx":908 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0) * * def setValuesBlockedCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":911 * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) * * def setLGMap(self, LGMap rmap, LGMap cmap=None): # <<<<<<<<<<<<<< * if cmap is None: cmap = rmap * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_183setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_182setLGMap[] = "Mat.setLGMap(self, LGMap rmap, LGMap cmap=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_183setLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscLGMapObject *__pyx_v_rmap = 0; struct PyPetscLGMapObject *__pyx_v_cmap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLGMap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rmap,&__pyx_n_s_cmap,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscLGMapObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rmap)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmap); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLGMap") < 0)) __PYX_ERR(38, 911, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rmap = ((struct PyPetscLGMapObject *)values[0]); __pyx_v_cmap = ((struct PyPetscLGMapObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLGMap", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 911, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "rmap", 0))) __PYX_ERR(38, 911, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmap), __pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "cmap", 0))) __PYX_ERR(38, 911, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_182setLGMap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rmap, __pyx_v_cmap); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182setLGMap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_rmap, struct PyPetscLGMapObject *__pyx_v_cmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLGMap", 0); __Pyx_INCREF((PyObject *)__pyx_v_cmap); /* "PETSc/Mat.pyx":912 * * def setLGMap(self, LGMap rmap, LGMap cmap=None): * if cmap is None: cmap = rmap # <<<<<<<<<<<<<< * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_cmap) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(((PyObject *)__pyx_v_rmap)); __Pyx_DECREF_SET(__pyx_v_cmap, __pyx_v_rmap); } /* "PETSc/Mat.pyx":913 * def setLGMap(self, LGMap rmap, LGMap cmap=None): * if cmap is None: cmap = rmap * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) # <<<<<<<<<<<<<< * * def getLGMap(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetLocalToGlobalMapping(__pyx_v_self->mat, __pyx_v_rmap->lgm, __pyx_v_cmap->lgm)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 913, __pyx_L1_error) /* "PETSc/Mat.pyx":911 * matsetvalues_csr(self.mat, I, J, V, addv, 1, 0) * * def setLGMap(self, LGMap rmap, LGMap cmap=None): # <<<<<<<<<<<<<< * if cmap is None: cmap = rmap * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cmap); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":915 * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) * * def getLGMap(self): # <<<<<<<<<<<<<< * cdef LGMap cmap = LGMap() * cdef LGMap rmap = LGMap() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_185getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_184getLGMap[] = "Mat.getLGMap(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_185getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMap (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_184getLGMap(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184getLGMap(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscLGMapObject *__pyx_v_cmap = 0; struct PyPetscLGMapObject *__pyx_v_rmap = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMap", 0); /* "PETSc/Mat.pyx":916 * * def getLGMap(self): * cdef LGMap cmap = LGMap() # <<<<<<<<<<<<<< * cdef LGMap rmap = LGMap() * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":917 * def getLGMap(self): * cdef LGMap cmap = LGMap() * cdef LGMap rmap = LGMap() # <<<<<<<<<<<<<< * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) * PetscINCREF(cmap.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rmap = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":918 * cdef LGMap cmap = LGMap() * cdef LGMap rmap = LGMap() * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) # <<<<<<<<<<<<<< * PetscINCREF(cmap.obj) * PetscINCREF(rmap.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalToGlobalMapping(__pyx_v_self->mat, (&__pyx_v_rmap->lgm), (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 918, __pyx_L1_error) /* "PETSc/Mat.pyx":919 * cdef LGMap rmap = LGMap() * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) * PetscINCREF(cmap.obj) # <<<<<<<<<<<<<< * PetscINCREF(rmap.obj) * return (rmap, cmap) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj)); /* "PETSc/Mat.pyx":920 * CHKERR( MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm) ) * PetscINCREF(cmap.obj) * PetscINCREF(rmap.obj) # <<<<<<<<<<<<<< * return (rmap, cmap) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rmap->__pyx_base.obj)); /* "PETSc/Mat.pyx":921 * PetscINCREF(cmap.obj) * PetscINCREF(rmap.obj) * return (rmap, cmap) # <<<<<<<<<<<<<< * * def setValueLocal(self, row, col, value, addv=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_rmap)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rmap)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rmap)); __Pyx_INCREF(((PyObject *)__pyx_v_cmap)); __Pyx_GIVEREF(((PyObject *)__pyx_v_cmap)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cmap)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":915 * CHKERR( MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm) ) * * def getLGMap(self): # <<<<<<<<<<<<<< * cdef LGMap cmap = LGMap() * cdef LGMap rmap = LGMap() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cmap); __Pyx_XDECREF((PyObject *)__pyx_v_rmap); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":923 * return (rmap, cmap) * * def setValueLocal(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_186setValueLocal[] = "Mat.setValueLocal(self, row, col, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187setValueLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, 1); __PYX_ERR(38, 923, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, 2); __PYX_ERR(38, 923, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueLocal") < 0)) __PYX_ERR(38, 923, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 923, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_186setValueLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186setValueLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscScalar __pyx_v_sval; InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscScalar __pyx_t_2; InsertMode __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueLocal", 0); /* "PETSc/Mat.pyx":924 * * def setValueLocal(self, row, col, value, addv=None): * cdef PetscInt ival1 = asInt(row) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_row); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 924, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "PETSc/Mat.pyx":925 * def setValueLocal(self, row, col, value, addv=None): * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_col); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 925, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "PETSc/Mat.pyx":926 * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValuesLocal( */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 926, __pyx_L1_error) __pyx_v_sval = __pyx_t_2; /* "PETSc/Mat.pyx":927 * cdef PetscInt ival2 = asInt(col) * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( MatSetValuesLocal( * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_3 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(38, 927, __pyx_L1_error) __pyx_v_caddv = __pyx_t_3; /* "PETSc/Mat.pyx":928 * cdef PetscScalar sval = asScalar(value) * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatSetValuesLocal( # <<<<<<<<<<<<<< * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValuesLocal(__pyx_v_self->mat, 1, (&__pyx_v_ival1), 1, (&__pyx_v_ival2), (&__pyx_v_sval), __pyx_v_caddv)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 928, __pyx_L1_error) /* "PETSc/Mat.pyx":923 * return (rmap, cmap) * * def setValueLocal(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(row) * cdef PetscInt ival2 = asInt(col) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":931 * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValuesLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_188setValuesLocal[] = "Mat.setValuesLocal(self, rows, cols, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189setValuesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, 1); __PYX_ERR(38, 931, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, 2); __PYX_ERR(38, 931, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocal") < 0)) __PYX_ERR(38, 931, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 931, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_188setValuesLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188setValuesLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocal", 0); /* "PETSc/Mat.pyx":932 * * def setValuesLocal(self, rows, cols, values, addv=None): * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesLocalRCV(self, R, C, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 932, __pyx_L1_error) /* "PETSc/Mat.pyx":931 * self.mat, 1, &ival1, 1, &ival2, &sval, caddv) ) * * def setValuesLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":934 * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) * * def setValuesLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191setValuesLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_190setValuesLocalRCV[] = "Mat.setValuesLocalRCV(self, R, C, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191setValuesLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocalRCV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, 1); __PYX_ERR(38, 934, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, 2); __PYX_ERR(38, 934, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocalRCV") < 0)) __PYX_ERR(38, 934, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 934, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_190setValuesLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_190setValuesLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocalRCV", 0); /* "PETSc/Mat.pyx":935 * * def setValuesLocalRCV(self, R, C, V, addv=None): * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 935, __pyx_L1_error) /* "PETSc/Mat.pyx":934 * matsetvalues(self.mat, rows, cols, values, addv, 0, 1) * * def setValuesLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":937 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) * * def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_193setValuesLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_192setValuesLocalIJV[] = "Mat.setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_193setValuesLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocalIJV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, 1); __PYX_ERR(38, 937, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, 2); __PYX_ERR(38, 937, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocalIJV") < 0)) __PYX_ERR(38, 937, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 937, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_192setValuesLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_192setValuesLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocalIJV", 0); /* "PETSc/Mat.pyx":938 * * def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None): * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) # <<<<<<<<<<<<<< * * def setValuesLocalCSR(self, I, J, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 0, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 938, __pyx_L1_error) /* "PETSc/Mat.pyx":937 * matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1) * * def setValuesLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":940 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) * * def setValuesLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_195setValuesLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_194setValuesLocalCSR[] = "Mat.setValuesLocalCSR(self, I, J, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_195setValuesLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesLocalCSR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, 1); __PYX_ERR(38, 940, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, 2); __PYX_ERR(38, 940, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesLocalCSR") < 0)) __PYX_ERR(38, 940, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 940, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_194setValuesLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_194setValuesLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesLocalCSR", 0); /* "PETSc/Mat.pyx":941 * * def setValuesLocalCSR(self, I, J, V, addv=None): * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocal(self, rows, cols, values, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 0, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 941, __pyx_L1_error) /* "PETSc/Mat.pyx":940 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1) * * def setValuesLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":943 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) * * def setValuesBlockedLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_197setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_196setValuesBlockedLocal[] = "Mat.setValuesBlockedLocal(self, rows, cols, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_197setValuesBlockedLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_cols = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_cols,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cols)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, 1); __PYX_ERR(38, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, 2); __PYX_ERR(38, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocal") < 0)) __PYX_ERR(38, 943, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_cols = values[1]; __pyx_v_values = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 943, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_196setValuesBlockedLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_196setValuesBlockedLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_cols, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocal", 0); /* "PETSc/Mat.pyx":944 * * def setValuesBlockedLocal(self, rows, cols, values, addv=None): * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocalRCV(self, R, C, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues(__pyx_v_self->mat, __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 944, __pyx_L1_error) /* "PETSc/Mat.pyx":943 * matsetvalues_csr(self.mat, I, J, V, addv, 0, 1) * * def setValuesBlockedLocal(self, rows, cols, values, addv=None): # <<<<<<<<<<<<<< * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":946 * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) * * def setValuesBlockedLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_199setValuesBlockedLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_198setValuesBlockedLocalRCV[] = "Mat.setValuesBlockedLocalRCV(self, R, C, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_199setValuesBlockedLocalRCV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_R = 0; PyObject *__pyx_v_C = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocalRCV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_C,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, 1); __PYX_ERR(38, 946, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, 2); __PYX_ERR(38, 946, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocalRCV") < 0)) __PYX_ERR(38, 946, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_R = values[0]; __pyx_v_C = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 946, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_198setValuesBlockedLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_198setValuesBlockedLocalRCV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_C, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocalRCV", 0); /* "PETSc/Mat.pyx":947 * * def setValuesBlockedLocalRCV(self, R, C, V, addv=None): * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_rcv(__pyx_v_self->mat, __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 947, __pyx_L1_error) /* "PETSc/Mat.pyx":946 * matsetvalues(self.mat, rows, cols, values, addv, 1, 1) * * def setValuesBlockedLocalRCV(self, R, C, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalRCV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":949 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) * * def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_201setValuesBlockedLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_200setValuesBlockedLocalIJV[] = "Mat.setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_201setValuesBlockedLocalIJV(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; PyObject *__pyx_v_rowmap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocalIJV (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,&__pyx_n_s_rowmap,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, 1); __PYX_ERR(38, 949, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, 2); __PYX_ERR(38, 949, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowmap); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocalIJV") < 0)) __PYX_ERR(38, 949, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; __pyx_v_rowmap = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 949, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_200setValuesBlockedLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_200setValuesBlockedLocalIJV(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv, PyObject *__pyx_v_rowmap) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocalIJV", 0); /* "PETSc/Mat.pyx":950 * * def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None): * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) # <<<<<<<<<<<<<< * * def setValuesBlockedLocalCSR(self, I, J, V, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_ijv(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 950, __pyx_L1_error) /* "PETSc/Mat.pyx":949 * matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1) * * def setValuesBlockedLocalIJV(self, I, J, V, addv=None, rowmap=None): # <<<<<<<<<<<<<< * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalIJV", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":952 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) * * def setValuesBlockedLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 1, 1) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203setValuesBlockedLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_202setValuesBlockedLocalCSR[] = "Mat.setValuesBlockedLocalCSR(self, I, J, V, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203setValuesBlockedLocalCSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_I = 0; PyObject *__pyx_v_J = 0; PyObject *__pyx_v_V = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValuesBlockedLocalCSR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_I,&__pyx_n_s_J,&__pyx_n_s_V,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, 1); __PYX_ERR(38, 952, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_V)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, 2); __PYX_ERR(38, 952, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValuesBlockedLocalCSR") < 0)) __PYX_ERR(38, 952, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_I = values[0]; __pyx_v_J = values[1]; __pyx_v_V = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 952, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_202setValuesBlockedLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_202setValuesBlockedLocalCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_I, PyObject *__pyx_v_J, PyObject *__pyx_v_V, PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValuesBlockedLocalCSR", 0); /* "PETSc/Mat.pyx":953 * * def setValuesBlockedLocalCSR(self, I, J, V, addv=None): * matsetvalues_csr(self.mat, I, J, V, addv, 1, 1) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_csr(__pyx_v_self->mat, __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, 1, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 953, __pyx_L1_error) /* "PETSc/Mat.pyx":952 * matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1) * * def setValuesBlockedLocalCSR(self, I, J, V, addv=None): # <<<<<<<<<<<<<< * matsetvalues_csr(self.mat, I, J, V, addv, 1, 1) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesBlockedLocalCSR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":959 * Stencil = _Mat_Stencil * * def setStencil(self, dims, starts=None, dof=1): # <<<<<<<<<<<<<< * cdef PetscInt ndim, ndof * cdef PetscInt cdims[3], cstarts[3] */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205setStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_204setStencil[] = "Mat.setStencil(self, dims, starts=None, dof=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205setStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dims = 0; PyObject *__pyx_v_starts = 0; PyObject *__pyx_v_dof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dims,&__pyx_n_s_starts,&__pyx_n_s_dof,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dims)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_starts); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dof); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStencil") < 0)) __PYX_ERR(38, 959, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dims = values[0]; __pyx_v_starts = values[1]; __pyx_v_dof = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencil", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 959, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_204setStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dims, __pyx_v_starts, __pyx_v_dof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_204setStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_dims, PyObject *__pyx_v_starts, PyObject *__pyx_v_dof) { PetscInt __pyx_v_ndim; PetscInt __pyx_v_ndof; PetscInt __pyx_v_cdims[3]; PetscInt __pyx_v_cstarts[3]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencil", 0); /* "PETSc/Mat.pyx":962 * cdef PetscInt ndim, ndof * cdef PetscInt cdims[3], cstarts[3] * cdims[0] = cdims[1] = cdims[2] = 1 # <<<<<<<<<<<<<< * cstarts[0] = cstarts[1] = cstarts[2] = 0 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) */ (__pyx_v_cdims[0]) = 1; (__pyx_v_cdims[1]) = 1; (__pyx_v_cdims[2]) = 1; /* "PETSc/Mat.pyx":963 * cdef PetscInt cdims[3], cstarts[3] * cdims[0] = cdims[1] = cdims[2] = 1 * cstarts[0] = cstarts[1] = cstarts[2] = 0 # <<<<<<<<<<<<<< * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) */ (__pyx_v_cstarts[0]) = 0; (__pyx_v_cstarts[1]) = 0; (__pyx_v_cstarts[2]) = 0; /* "PETSc/Mat.pyx":964 * cdims[0] = cdims[1] = cdims[2] = 1 * cstarts[0] = cstarts[1] = cstarts[2] = 0 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) # <<<<<<<<<<<<<< * ndof = asInt(dof) * if starts is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_dims, (&(__pyx_v_cdims[0])), (&(__pyx_v_cdims[1])), (&(__pyx_v_cdims[2]))); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 964, __pyx_L1_error) __pyx_v_ndim = __pyx_t_1; /* "PETSc/Mat.pyx":965 * cstarts[0] = cstarts[1] = cstarts[2] = 0 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) # <<<<<<<<<<<<<< * if starts is not None: * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 965, __pyx_L1_error) __pyx_v_ndof = __pyx_t_1; /* "PETSc/Mat.pyx":966 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) * if starts is not None: # <<<<<<<<<<<<<< * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) */ __pyx_t_2 = (__pyx_v_starts != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":967 * ndof = asInt(dof) * if starts is not None: * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) # <<<<<<<<<<<<<< * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_dims, (&(__pyx_v_cstarts[0])), (&(__pyx_v_cstarts[1])), (&(__pyx_v_cstarts[2]))); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 967, __pyx_L1_error) /* "PETSc/Mat.pyx":966 * ndim = asDims(dims, &cdims[0], &cdims[1], &cdims[2]) * ndof = asInt(dof) * if starts is not None: # <<<<<<<<<<<<<< * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) */ } /* "PETSc/Mat.pyx":968 * if starts is not None: * asDims(dims, &cstarts[0], &cstarts[1], &cstarts[2]) * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) # <<<<<<<<<<<<<< * * def setValueStencil(self, row, col, value, addv=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetStencil(__pyx_v_self->mat, __pyx_v_ndim, __pyx_v_cdims, __pyx_v_cstarts, __pyx_v_ndof)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 968, __pyx_L1_error) /* "PETSc/Mat.pyx":959 * Stencil = _Mat_Stencil * * def setStencil(self, dims, starts=None, dof=1): # <<<<<<<<<<<<<< * cdef PetscInt ndim, ndof * cdef PetscInt cdims[3], cstarts[3] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":970 * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) * * def setValueStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207setValueStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_206setValueStencil[] = "Mat.setValueStencil(self, row, col, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207setValueStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, 1); __PYX_ERR(38, 970, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, 2); __PYX_ERR(38, 970, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueStencil") < 0)) __PYX_ERR(38, 970, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 970, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_206setValueStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_206setValueStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_r = 0; struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_c = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; InsertMode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueStencil", 0); /* "PETSc/Mat.pyx":971 * * def setValueStencil(self, row, col, value, addv=None): * cdef _Mat_Stencil r = row, c = col # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 0) */ if (!(likely(((__pyx_v_row) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_row, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(38, 971, __pyx_L1_error) __pyx_t_1 = __pyx_v_row; __Pyx_INCREF(__pyx_t_1); __pyx_v_r = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_v_col) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_col, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(38, 971, __pyx_L1_error) __pyx_t_1 = __pyx_v_col; __Pyx_INCREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":972 * def setValueStencil(self, row, col, value, addv=None): * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * matsetvaluestencil(self.mat, r, c, value, im, 0) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(38, 972, __pyx_L1_error) __pyx_v_im = __pyx_t_2; /* "PETSc/Mat.pyx":973 * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 0) # <<<<<<<<<<<<<< * * def setValueStagStencil(self, row, col, value, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvaluestencil(__pyx_v_self->mat, __pyx_v_r, __pyx_v_c, __pyx_v_value, __pyx_v_im, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":970 * CHKERR( MatSetStencil(self.mat, ndim, cdims, cstarts, ndof) ) * * def setValueStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":975 * matsetvaluestencil(self.mat, r, c, value, im, 0) * * def setValueStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_209setValueStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_208setValueStagStencil[] = "Mat.setValueStagStencil(self, row, col, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_209setValueStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_row = 0; CYTHON_UNUSED PyObject *__pyx_v_col = 0; CYTHON_UNUSED PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueStagStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, 1); __PYX_ERR(38, 975, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, 2); __PYX_ERR(38, 975, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueStagStencil") < 0)) __PYX_ERR(38, 975, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 975, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_208setValueStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208setValueStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueStagStencil", 0); /* "PETSc/Mat.pyx":976 * * def setValueStagStencil(self, row, col, value, addv=None): * raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def setValueBlockedStencil(self, row, col, value, addv=None): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(38, 976, __pyx_L1_error) /* "PETSc/Mat.pyx":975 * matsetvaluestencil(self.mat, r, c, value, im, 0) * * def setValueStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":978 * raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') * * def setValueBlockedStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211setValueBlockedStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_210setValueBlockedStencil[] = "Mat.setValueBlockedStencil(self, row, col, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211setValueBlockedStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_row = 0; PyObject *__pyx_v_col = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueBlockedStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, 1); __PYX_ERR(38, 978, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, 2); __PYX_ERR(38, 978, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueBlockedStencil") < 0)) __PYX_ERR(38, 978, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 978, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_210setValueBlockedStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210setValueBlockedStencil(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col, PyObject *__pyx_v_value, PyObject *__pyx_v_addv) { struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_r = 0; struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *__pyx_v_c = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; InsertMode __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueBlockedStencil", 0); /* "PETSc/Mat.pyx":979 * * def setValueBlockedStencil(self, row, col, value, addv=None): * cdef _Mat_Stencil r = row, c = col # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 1) */ if (!(likely(((__pyx_v_row) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_row, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(38, 979, __pyx_L1_error) __pyx_t_1 = __pyx_v_row; __Pyx_INCREF(__pyx_t_1); __pyx_v_r = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_v_col) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_col, __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil))))) __PYX_ERR(38, 979, __pyx_L1_error) __pyx_t_1 = __pyx_v_col; __Pyx_INCREF(__pyx_t_1); __pyx_v_c = ((struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":980 * def setValueBlockedStencil(self, row, col, value, addv=None): * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * matsetvaluestencil(self.mat, r, c, value, im, 1) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(38, 980, __pyx_L1_error) __pyx_v_im = __pyx_t_2; /* "PETSc/Mat.pyx":981 * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) * matsetvaluestencil(self.mat, r, c, value, im, 1) # <<<<<<<<<<<<<< * * def setValueBlockedStagStencil(self, row, col, value, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvaluestencil(__pyx_v_self->mat, __pyx_v_r, __pyx_v_c, __pyx_v_value, __pyx_v_im, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":978 * raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') * * def setValueBlockedStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * cdef _Mat_Stencil r = row, c = col * cdef PetscInsertMode im = insertmode(addv) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":983 * matsetvaluestencil(self.mat, r, c, value, im, 1) * * def setValueBlockedStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_213setValueBlockedStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_212setValueBlockedStagStencil[] = "Mat.setValueBlockedStagStencil(self, row, col, value, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_213setValueBlockedStagStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_row = 0; CYTHON_UNUSED PyObject *__pyx_v_col = 0; CYTHON_UNUSED PyObject *__pyx_v_value = 0; CYTHON_UNUSED PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setValueBlockedStagStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_row,&__pyx_n_s_col,&__pyx_n_s_value,&__pyx_n_s_addv,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, 1); __PYX_ERR(38, 983, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, 2); __PYX_ERR(38, 983, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setValueBlockedStagStencil") < 0)) __PYX_ERR(38, 983, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_row = values[0]; __pyx_v_col = values[1]; __pyx_v_value = values[2]; __pyx_v_addv = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 983, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_212setValueBlockedStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_212setValueBlockedStagStencil(CYTHON_UNUSED struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_row, CYTHON_UNUSED PyObject *__pyx_v_col, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_addv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setValueBlockedStagStencil", 0); /* "PETSc/Mat.pyx":984 * * def setValueBlockedStagStencil(self, row, col, value, addv=None): * raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(38, 984, __pyx_L1_error) /* "PETSc/Mat.pyx":983 * matsetvaluestencil(self.mat, r, c, value, im, 1) * * def setValueBlockedStagStencil(self, row, col, value, addv=None): # <<<<<<<<<<<<<< * raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValueBlockedStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":986 * raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') * * def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_215zeroRows(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_214zeroRows[] = "Mat.zeroRows(self, rows, diag=1, Vec x=None, Vec b=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_215zeroRows(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRows (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_1); values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRows") < 0)) __PYX_ERR(38, 986, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRows", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 986, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRows", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(38, 986, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(38, 986, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_214zeroRows(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_214zeroRows(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Vec __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRows", 0); __Pyx_INCREF(__pyx_v_rows); /* "PETSc/Mat.pyx":987 * * def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/Mat.pyx":988 * def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 988, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":989 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "PETSc/Mat.pyx":990 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_4; } /* "PETSc/Mat.pyx":991 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_b) != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_4; } /* "PETSc/Mat.pyx":992 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":993 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 993, __pyx_L1_error) /* "PETSc/Mat.pyx":992 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "PETSc/Mat.pyx":995 * CHKERR( MatZeroRowsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/Mat.pyx":996 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRows(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 996, __pyx_L1_error) } __pyx_L5:; /* "PETSc/Mat.pyx":986 * raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') * * def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRows", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":998 * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_217zeroRowsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_216zeroRowsLocal[] = "Mat.zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_217zeroRowsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRowsLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_1); values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRowsLocal") < 0)) __PYX_ERR(38, 998, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRowsLocal", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 998, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(38, 998, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(38, 998, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_216zeroRowsLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_216zeroRowsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Vec __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRowsLocal", 0); __Pyx_INCREF(__pyx_v_rows); /* "PETSc/Mat.pyx":999 * * def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/Mat.pyx":1000 * def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 1000, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":1001 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "PETSc/Mat.pyx":1002 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_4; } /* "PETSc/Mat.pyx":1003 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_b) != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_4; } /* "PETSc/Mat.pyx":1004 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":1005 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsLocalIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1005, __pyx_L1_error) /* "PETSc/Mat.pyx":1004 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "PETSc/Mat.pyx":1007 * CHKERR( MatZeroRowsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 1007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/Mat.pyx":1008 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsLocal(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1008, __pyx_L1_error) } __pyx_L5:; /* "PETSc/Mat.pyx":998 * CHKERR( MatZeroRows(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1010 * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_219zeroRowsColumns(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_218zeroRowsColumns[] = "Mat.zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_219zeroRowsColumns(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRowsColumns (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_1); values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRowsColumns") < 0)) __PYX_ERR(38, 1010, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRowsColumns", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1010, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumns", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(38, 1010, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(38, 1010, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_218zeroRowsColumns(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_218zeroRowsColumns(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Vec __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRowsColumns", 0); __Pyx_INCREF(__pyx_v_rows); /* "PETSc/Mat.pyx":1011 * * def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/Mat.pyx":1012 * def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 1012, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":1013 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "PETSc/Mat.pyx":1014 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_4; } /* "PETSc/Mat.pyx":1015 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_b) != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_4; } /* "PETSc/Mat.pyx":1016 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":1017 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumnsIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1017, __pyx_L1_error) /* "PETSc/Mat.pyx":1016 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "PETSc/Mat.pyx":1019 * CHKERR( MatZeroRowsColumnsIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/Mat.pyx":1020 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumns(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1020, __pyx_L1_error) } __pyx_L5:; /* "PETSc/Mat.pyx":1010 * CHKERR( MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumns(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumns", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1022 * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221zeroRowsColumnsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_220zeroRowsColumnsLocal[] = "Mat.zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221zeroRowsColumnsLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rows = 0; PyObject *__pyx_v_diag = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("zeroRowsColumnsLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rows,&__pyx_n_s_diag,&__pyx_n_s_x,&__pyx_n_s_b,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)__pyx_int_1); values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[3] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zeroRowsColumnsLocal") < 0)) __PYX_ERR(38, 1022, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rows = values[0]; __pyx_v_diag = values[1]; __pyx_v_x = ((struct PyPetscVecObject *)values[2]); __pyx_v_b = ((struct PyPetscVecObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("zeroRowsColumnsLocal", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1022, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(38, 1022, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(38, 1022, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_220zeroRowsColumnsLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_diag, __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_220zeroRowsColumnsLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rows, PyObject *__pyx_v_diag, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { PetscInt __pyx_v_ni; PetscInt *__pyx_v_i; PetscScalar __pyx_v_sval; Vec __pyx_v_xvec; Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Vec __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("zeroRowsColumnsLocal", 0); __Pyx_INCREF(__pyx_v_rows); /* "PETSc/Mat.pyx":1023 * * def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL */ __pyx_v_ni = 0; __pyx_v_i = NULL; /* "PETSc/Mat.pyx":1024 * def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) # <<<<<<<<<<<<<< * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 1024, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":1025 * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL # <<<<<<<<<<<<<< * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec */ __pyx_v_xvec = NULL; __pyx_v_bvec = NULL; /* "PETSc/Mat.pyx":1026 * cdef PetscScalar sval = asScalar(diag) * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * if isinstance(rows, IS): */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_x->vec; __pyx_v_xvec = __pyx_t_4; } /* "PETSc/Mat.pyx":1027 * cdef PetscVec xvec=NULL, bvec=NULL * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_b) != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_4; } /* "PETSc/Mat.pyx":1028 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":1029 * if b is not None: bvec = b.vec * if isinstance(rows, IS): * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * else: * rows = iarray_i(rows, &ni, &i) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumnsLocalIS(__pyx_v_self->mat, ((struct PyPetscISObject *)__pyx_v_rows)->iset, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1029, __pyx_L1_error) /* "PETSc/Mat.pyx":1028 * if x is not None: xvec = x.vec * if b is not None: bvec = b.vec * if isinstance(rows, IS): # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: */ goto __pyx_L5; } /* "PETSc/Mat.pyx":1031 * CHKERR( MatZeroRowsColumnsLocalIS(self.mat, (rows).iset, sval, xvec, bvec) ) * else: * rows = iarray_i(rows, &ni, &i) # <<<<<<<<<<<<<< * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) * */ /*else*/ { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_rows, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_rows, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/Mat.pyx":1032 * else: * rows = iarray_i(rows, &ni, &i) * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) # <<<<<<<<<<<<<< * * def storeValues(self): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatZeroRowsColumnsLocal(__pyx_v_self->mat, __pyx_v_ni, __pyx_v_i, __pyx_v_sval, __pyx_v_xvec, __pyx_v_bvec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1032, __pyx_L1_error) } __pyx_L5:; /* "PETSc/Mat.pyx":1022 * CHKERR( MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec) ) * * def zeroRowsColumnsLocal(self, rows, diag=1, Vec x=None, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscInt ni=0, *i=NULL * cdef PetscScalar sval = asScalar(diag) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Mat.zeroRowsColumnsLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rows); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1034 * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def storeValues(self): # <<<<<<<<<<<<<< * CHKERR( MatStoreValues(self.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_223storeValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_222storeValues[] = "Mat.storeValues(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_223storeValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("storeValues (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("storeValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "storeValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_222storeValues(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_222storeValues(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("storeValues", 0); /* "PETSc/Mat.pyx":1035 * * def storeValues(self): * CHKERR( MatStoreValues(self.mat) ) # <<<<<<<<<<<<<< * * def retrieveValues(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatStoreValues(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1035, __pyx_L1_error) /* "PETSc/Mat.pyx":1034 * CHKERR( MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec) ) * * def storeValues(self): # <<<<<<<<<<<<<< * CHKERR( MatStoreValues(self.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.storeValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1037 * CHKERR( MatStoreValues(self.mat) ) * * def retrieveValues(self): # <<<<<<<<<<<<<< * CHKERR( MatRetrieveValues(self.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_225retrieveValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_224retrieveValues[] = "Mat.retrieveValues(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_225retrieveValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("retrieveValues (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("retrieveValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "retrieveValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_224retrieveValues(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_224retrieveValues(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("retrieveValues", 0); /* "PETSc/Mat.pyx":1038 * * def retrieveValues(self): * CHKERR( MatRetrieveValues(self.mat) ) # <<<<<<<<<<<<<< * * def assemblyBegin(self, assembly=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRetrieveValues(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1038, __pyx_L1_error) /* "PETSc/Mat.pyx":1037 * CHKERR( MatStoreValues(self.mat) ) * * def retrieveValues(self): # <<<<<<<<<<<<<< * CHKERR( MatRetrieveValues(self.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.retrieveValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1040 * CHKERR( MatRetrieveValues(self.mat) ) * * def assemblyBegin(self, assembly=None): # <<<<<<<<<<<<<< * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_227assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_226assemblyBegin[] = "Mat.assemblyBegin(self, assembly=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_227assemblyBegin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_assembly = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyBegin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assembly); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assemblyBegin") < 0)) __PYX_ERR(38, 1040, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_assembly = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assemblyBegin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1040, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_226assemblyBegin(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_226assemblyBegin(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatAssemblyType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyBegin", 0); /* "PETSc/Mat.pyx":1041 * * def assemblyBegin(self, assembly=None): * cdef PetscMatAssemblyType flag = assemblytype(assembly) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyBegin(self.mat, flag) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_assemblytype(__pyx_v_assembly); if (unlikely(__pyx_t_1 == ((MatAssemblyType)((MatAssemblyType)-1L)))) __PYX_ERR(38, 1041, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "PETSc/Mat.pyx":1042 * def assemblyBegin(self, assembly=None): * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) # <<<<<<<<<<<<<< * * def assemblyEnd(self, assembly=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyBegin(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1042, __pyx_L1_error) /* "PETSc/Mat.pyx":1040 * CHKERR( MatRetrieveValues(self.mat) ) * * def assemblyBegin(self, assembly=None): # <<<<<<<<<<<<<< * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyBegin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1044 * CHKERR( MatAssemblyBegin(self.mat, flag) ) * * def assemblyEnd(self, assembly=None): # <<<<<<<<<<<<<< * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyEnd(self.mat, flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_228assemblyEnd[] = "Mat.assemblyEnd(self, assembly=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229assemblyEnd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_assembly = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemblyEnd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assembly); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assemblyEnd") < 0)) __PYX_ERR(38, 1044, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_assembly = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assemblyEnd", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1044, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_228assemblyEnd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_228assemblyEnd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatAssemblyType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemblyEnd", 0); /* "PETSc/Mat.pyx":1045 * * def assemblyEnd(self, assembly=None): * cdef PetscMatAssemblyType flag = assemblytype(assembly) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyEnd(self.mat, flag) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_assemblytype(__pyx_v_assembly); if (unlikely(__pyx_t_1 == ((MatAssemblyType)((MatAssemblyType)-1L)))) __PYX_ERR(38, 1045, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "PETSc/Mat.pyx":1046 * def assemblyEnd(self, assembly=None): * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyEnd(self.mat, flag) ) # <<<<<<<<<<<<<< * * def assemble(self, assembly=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyEnd(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1046, __pyx_L1_error) /* "PETSc/Mat.pyx":1044 * CHKERR( MatAssemblyBegin(self.mat, flag) ) * * def assemblyEnd(self, assembly=None): # <<<<<<<<<<<<<< * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyEnd(self.mat, flag) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemblyEnd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1048 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def assemble(self, assembly=None): # <<<<<<<<<<<<<< * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_230assemble[] = "Mat.assemble(self, assembly=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231assemble(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_assembly = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assemble (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assembly,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assembly); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assemble") < 0)) __PYX_ERR(38, 1048, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_assembly = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assemble", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1048, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_230assemble(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_230assemble(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly) { MatAssemblyType __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MatAssemblyType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assemble", 0); /* "PETSc/Mat.pyx":1049 * * def assemble(self, assembly=None): * cdef PetscMatAssemblyType flag = assemblytype(assembly) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyBegin(self.mat, flag) ) * CHKERR( MatAssemblyEnd(self.mat, flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_assemblytype(__pyx_v_assembly); if (unlikely(__pyx_t_1 == ((MatAssemblyType)((MatAssemblyType)-1L)))) __PYX_ERR(38, 1049, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "PETSc/Mat.pyx":1050 * def assemble(self, assembly=None): * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) # <<<<<<<<<<<<<< * CHKERR( MatAssemblyEnd(self.mat, flag) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyBegin(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1050, __pyx_L1_error) /* "PETSc/Mat.pyx":1051 * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) * CHKERR( MatAssemblyEnd(self.mat, flag) ) # <<<<<<<<<<<<<< * * def isAssembled(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssemblyEnd(__pyx_v_self->mat, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1051, __pyx_L1_error) /* "PETSc/Mat.pyx":1048 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def assemble(self, assembly=None): # <<<<<<<<<<<<<< * cdef PetscMatAssemblyType flag = assemblytype(assembly) * CHKERR( MatAssemblyBegin(self.mat, flag) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.assemble", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1053 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def isAssembled(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatAssembled(self.mat, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_233isAssembled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_232isAssembled[] = "Mat.isAssembled(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_233isAssembled(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isAssembled (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isAssembled", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isAssembled", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_232isAssembled(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_232isAssembled(struct PyPetscMatObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isAssembled", 0); /* "PETSc/Mat.pyx":1054 * * def isAssembled(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatAssembled(self.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":1055 * def isAssembled(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatAssembled(self.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAssembled(__pyx_v_self->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1055, __pyx_L1_error) /* "PETSc/Mat.pyx":1056 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatAssembled(self.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * # * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1053 * CHKERR( MatAssemblyEnd(self.mat, flag) ) * * def isAssembled(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatAssembled(self.mat, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Mat.isAssembled", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1059 * # * * def createVecs(self, side=None): # <<<<<<<<<<<<<< * cdef Vec vecr, vecl * if side is None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_235createVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_234createVecs[] = "Mat.createVecs(self, side=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_235createVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_side = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVecs (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_side); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createVecs") < 0)) __PYX_ERR(38, 1059, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_side = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createVecs", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1059, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_234createVecs(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_side); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_234createVecs(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_side) { struct PyPetscVecObject *__pyx_v_vecr = 0; struct PyPetscVecObject *__pyx_v_vecl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVecs", 0); /* "PETSc/Mat.pyx":1061 * def createVecs(self, side=None): * cdef Vec vecr, vecl * if side is None: # <<<<<<<<<<<<<< * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) */ __pyx_t_1 = (__pyx_v_side == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1062 * cdef Vec vecr, vecl * if side is None: * vecr = Vec(); vecl = Vec(); # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1062, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1063 * if side is None: * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) # <<<<<<<<<<<<<< * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1063, __pyx_L1_error) /* "PETSc/Mat.pyx":1064 * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) # <<<<<<<<<<<<<< * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): * vecr = Vec() */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_vecr)); __Pyx_GIVEREF(((PyObject *)__pyx_v_vecr)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_vecr)); __Pyx_INCREF(((PyObject *)__pyx_v_vecl)); __Pyx_GIVEREF(((PyObject *)__pyx_v_vecl)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_vecl)); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1061 * def createVecs(self, side=None): * cdef Vec vecr, vecl * if side is None: # <<<<<<<<<<<<<< * vecr = Vec(); vecl = Vec(); * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) */ } /* "PETSc/Mat.pyx":1065 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): # <<<<<<<<<<<<<< * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) */ __Pyx_INCREF(__pyx_v_side); __pyx_t_3 = __pyx_v_side; __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(38, 1065, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_R, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(38, 1065, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_right, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(38, 1065, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Right, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(38, 1065, __pyx_L1_error) if (!__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L4_bool_binop_done; } __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_RIGHT, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(38, 1065, __pyx_L1_error) __pyx_t_2 = __pyx_t_1; __pyx_L4_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/Mat.pyx":1066 * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): * vecr = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1067 * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) # <<<<<<<<<<<<<< * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1067, __pyx_L1_error) /* "PETSc/Mat.pyx":1068 * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr # <<<<<<<<<<<<<< * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): * vecl = Vec() */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vecr)); __pyx_r = ((PyObject *)__pyx_v_vecr); goto __pyx_L0; /* "PETSc/Mat.pyx":1065 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, &vecl.vec) ) * return (vecr, vecl) * elif side in ('r', 'R', 'right', 'Right', 'RIGHT'): # <<<<<<<<<<<<<< * vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) */ } /* "PETSc/Mat.pyx":1069 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): # <<<<<<<<<<<<<< * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) */ __Pyx_INCREF(__pyx_v_side); __pyx_t_3 = __pyx_v_side; __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_l, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(38, 1069, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_L, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(38, 1069, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(38, 1069, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Left, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(38, 1069, __pyx_L1_error) if (!__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L9_bool_binop_done; } __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_LEFT, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(38, 1069, __pyx_L1_error) __pyx_t_1 = __pyx_t_2; __pyx_L9_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = (__pyx_t_1 != 0); if (likely(__pyx_t_2)) { /* "PETSc/Mat.pyx":1070 * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): * vecl = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1071 * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) # <<<<<<<<<<<<<< * return vecl * else: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1071, __pyx_L1_error) /* "PETSc/Mat.pyx":1072 * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl # <<<<<<<<<<<<<< * else: * raise ValueError("side '%r' not understood" % side) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vecl)); __pyx_r = ((PyObject *)__pyx_v_vecl); goto __pyx_L0; /* "PETSc/Mat.pyx":1069 * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr * elif side in ('l', 'L', 'left', 'Left', 'LEFT'): # <<<<<<<<<<<<<< * vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) */ } /* "PETSc/Mat.pyx":1074 * return vecl * else: * raise ValueError("side '%r' not understood" % side) # <<<<<<<<<<<<<< * * def createVecRight(self): */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_side_r_not_understood, __pyx_v_side); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(38, 1074, __pyx_L1_error) } /* "PETSc/Mat.pyx":1059 * # * * def createVecs(self, side=None): # <<<<<<<<<<<<<< * cdef Vec vecr, vecl * if side is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vecr); __Pyx_XDECREF((PyObject *)__pyx_v_vecl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1076 * raise ValueError("side '%r' not understood" % side) * * def createVecRight(self): # <<<<<<<<<<<<<< * cdef Vec vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_237createVecRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_236createVecRight[] = "Mat.createVecRight(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_237createVecRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVecRight (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createVecRight", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createVecRight", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_236createVecRight(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_236createVecRight(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vecr = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVecRight", 0); /* "PETSc/Mat.pyx":1077 * * def createVecRight(self): * cdef Vec vecr = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1078 * def createVecRight(self): * cdef Vec vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) # <<<<<<<<<<<<<< * return vecr * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1078, __pyx_L1_error) /* "PETSc/Mat.pyx":1079 * cdef Vec vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) * return vecr # <<<<<<<<<<<<<< * * def createVecLeft(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vecr)); __pyx_r = ((PyObject *)__pyx_v_vecr); goto __pyx_L0; /* "PETSc/Mat.pyx":1076 * raise ValueError("side '%r' not understood" % side) * * def createVecRight(self): # <<<<<<<<<<<<<< * cdef Vec vecr = Vec() * CHKERR( MatCreateVecs(self.mat, &vecr.vec, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecRight", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vecr); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1081 * return vecr * * def createVecLeft(self): # <<<<<<<<<<<<<< * cdef Vec vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_239createVecLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_238createVecLeft[] = "Mat.createVecLeft(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_239createVecLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createVecLeft (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createVecLeft", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createVecLeft", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_238createVecLeft(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_238createVecLeft(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vecl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createVecLeft", 0); /* "PETSc/Mat.pyx":1082 * * def createVecLeft(self): * cdef Vec vecl = Vec() # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1082, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1083 * def createVecLeft(self): * cdef Vec vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) # <<<<<<<<<<<<<< * return vecl * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1083, __pyx_L1_error) /* "PETSc/Mat.pyx":1084 * cdef Vec vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) * return vecl # <<<<<<<<<<<<<< * * getVecs = createVecs */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vecl)); __pyx_r = ((PyObject *)__pyx_v_vecl); goto __pyx_L0; /* "PETSc/Mat.pyx":1081 * return vecr * * def createVecLeft(self): # <<<<<<<<<<<<<< * cdef Vec vecl = Vec() * CHKERR( MatCreateVecs(self.mat, NULL, &vecl.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createVecLeft", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vecl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1092 * # * * def getColumnVector(self, column, Vec result=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(column) * if result is None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_241getColumnVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_240getColumnVector[] = "Mat.getColumnVector(self, column, Vec result=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_241getColumnVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_column = 0; struct PyPetscVecObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getColumnVector (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_column,&__pyx_n_s_result,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_column)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getColumnVector") < 0)) __PYX_ERR(38, 1092, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_column = values[0]; __pyx_v_result = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getColumnVector", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1092, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(38, 1092, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_240getColumnVector(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_column, __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_240getColumnVector(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_column, struct PyPetscVecObject *__pyx_v_result) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getColumnVector", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":1093 * * def getColumnVector(self, column, Vec result=None): * cdef PetscInt ival = asInt(column) # <<<<<<<<<<<<<< * if result is None: * result = Vec() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_column); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1093, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Mat.pyx":1094 * def getColumnVector(self, column, Vec result=None): * cdef PetscInt ival = asInt(column) * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ __pyx_t_2 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":1095 * cdef PetscInt ival = asInt(column) * if result is None: * result = Vec() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "PETSc/Mat.pyx":1094 * def getColumnVector(self, column, Vec result=None): * cdef PetscInt ival = asInt(column) * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ } /* "PETSc/Mat.pyx":1096 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) */ __pyx_t_3 = ((__pyx_v_result->vec == NULL) != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":1097 * result = Vec() * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) * return result */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1097, __pyx_L1_error) /* "PETSc/Mat.pyx":1096 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) */ } /* "PETSc/Mat.pyx":1098 * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetColumnVector(__pyx_v_self->mat, __pyx_v_result->vec, __pyx_v_ival)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1098, __pyx_L1_error) /* "PETSc/Mat.pyx":1099 * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetColumnVector(self.mat, result.vec, ival) ) * return result # <<<<<<<<<<<<<< * * def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":1092 * # * * def getColumnVector(self, column, Vec result=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(column) * if result is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getColumnVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1101 * return result * * def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): # <<<<<<<<<<<<<< * cdef PetscInt _nsubcomm = asInt(nsubcomm) * cdef MPI_Comm _subcomm = MPI_COMM_NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_243getRedundantMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_242getRedundantMatrix[] = "Mat.getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_243getRedundantMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nsubcomm = 0; PyObject *__pyx_v_subcomm = 0; struct PyPetscMatObject *__pyx_v_out = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRedundantMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsubcomm,&__pyx_n_s_subcomm,&__pyx_n_s_out,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsubcomm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subcomm); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_out); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRedundantMatrix") < 0)) __PYX_ERR(38, 1101, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nsubcomm = values[0]; __pyx_v_subcomm = values[1]; __pyx_v_out = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRedundantMatrix", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1101, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRedundantMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(38, 1101, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_242getRedundantMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsubcomm, __pyx_v_subcomm, __pyx_v_out); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_242getRedundantMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nsubcomm, PyObject *__pyx_v_subcomm, struct PyPetscMatObject *__pyx_v_out) { PetscInt __pyx_v__nsubcomm; MPI_Comm __pyx_v__subcomm; MatReuse __pyx_v_reuse; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; MPI_Comm __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRedundantMatrix", 0); __Pyx_INCREF((PyObject *)__pyx_v_out); /* "PETSc/Mat.pyx":1102 * * def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): * cdef PetscInt _nsubcomm = asInt(nsubcomm) # <<<<<<<<<<<<<< * cdef MPI_Comm _subcomm = MPI_COMM_NULL * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nsubcomm); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1102, __pyx_L1_error) __pyx_v__nsubcomm = __pyx_t_1; /* "PETSc/Mat.pyx":1103 * def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): * cdef PetscInt _nsubcomm = asInt(nsubcomm) * cdef MPI_Comm _subcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX */ __pyx_v__subcomm = MPI_COMM_NULL; /* "PETSc/Mat.pyx":1104 * cdef PetscInt _nsubcomm = asInt(nsubcomm) * cdef MPI_Comm _subcomm = MPI_COMM_NULL * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = Mat() */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_subcomm); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(38, 1104, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_subcomm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 1104, __pyx_L1_error) __pyx_v__subcomm = __pyx_t_3; } /* "PETSc/Mat.pyx":1105 * cdef MPI_Comm _subcomm = MPI_COMM_NULL * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * if out is None: out = Mat() * if out.mat != NULL: reuse = MAT_REUSE_MATRIX */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":1106 * if subcomm: _subcomm = def_Comm(subcomm, PETSC_COMM_DEFAULT) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = Mat() # <<<<<<<<<<<<<< * if out.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) */ __pyx_t_2 = (((PyObject *)__pyx_v_out) == Py_None); __pyx_t_4 = (__pyx_t_2 != 0); if (__pyx_t_4) { __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_out, ((struct PyPetscMatObject *)__pyx_t_5)); __pyx_t_5 = 0; } /* "PETSc/Mat.pyx":1107 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * if out is None: out = Mat() * if out.mat != NULL: reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) * return out */ __pyx_t_4 = ((__pyx_v_out->mat != NULL) != 0); if (__pyx_t_4) { __pyx_v_reuse = MAT_REUSE_MATRIX; } /* "PETSc/Mat.pyx":1108 * if out is None: out = Mat() * if out.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) # <<<<<<<<<<<<<< * return out * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateRedundantMatrix(__pyx_v_self->mat, __pyx_v__nsubcomm, __pyx_v__subcomm, __pyx_v_reuse, (&__pyx_v_out->mat))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(38, 1108, __pyx_L1_error) /* "PETSc/Mat.pyx":1109 * if out.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateRedundantMatrix(self.mat, _nsubcomm, _subcomm, reuse, &out.mat)) * return out # <<<<<<<<<<<<<< * * def getDiagonal(self, Vec result=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_out)); __pyx_r = ((PyObject *)__pyx_v_out); goto __pyx_L0; /* "PETSc/Mat.pyx":1101 * return result * * def getRedundantMatrix(self, nsubcomm, subcomm=None, Mat out=None): # <<<<<<<<<<<<<< * cdef PetscInt _nsubcomm = asInt(nsubcomm) * cdef MPI_Comm _subcomm = MPI_COMM_NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRedundantMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1111 * return out * * def getDiagonal(self, Vec result=None): # <<<<<<<<<<<<<< * if result is None: * result = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245getDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_244getDiagonal[] = "Mat.getDiagonal(self, Vec result=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245getDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDiagonal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getDiagonal") < 0)) __PYX_ERR(38, 1111, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDiagonal", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1111, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(38, 1111, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_244getDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_244getDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDiagonal", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":1112 * * def getDiagonal(self, Vec result=None): * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1113 * def getDiagonal(self, Vec result=None): * if result is None: * result = Vec() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1112 * * def getDiagonal(self, Vec result=None): * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ } /* "PETSc/Mat.pyx":1114 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) */ __pyx_t_2 = ((__pyx_v_result->vec == NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1115 * result = Vec() * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( MatGetDiagonal(self.mat, result.vec) ) * return result */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1115, __pyx_L1_error) /* "PETSc/Mat.pyx":1114 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) */ } /* "PETSc/Mat.pyx":1116 * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonal(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1116, __pyx_L1_error) /* "PETSc/Mat.pyx":1117 * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetDiagonal(self.mat, result.vec) ) * return result # <<<<<<<<<<<<<< * * def getRowSum(self, Vec result=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":1111 * return out * * def getDiagonal(self, Vec result=None): # <<<<<<<<<<<<<< * if result is None: * result = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1119 * return result * * def getRowSum(self, Vec result=None): # <<<<<<<<<<<<<< * if result is None: * result = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247getRowSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_246getRowSum[] = "Mat.getRowSum(self, Vec result=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247getRowSum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_result = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRowSum (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_result,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getRowSum") < 0)) __PYX_ERR(38, 1119, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_result = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getRowSum", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1119, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(38, 1119, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_246getRowSum(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_246getRowSum(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRowSum", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":1120 * * def getRowSum(self, Vec result=None): * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1121 * def getRowSum(self, Vec result=None): * if result is None: * result = Vec() # <<<<<<<<<<<<<< * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1120 * * def getRowSum(self, Vec result=None): * if result is None: # <<<<<<<<<<<<<< * result = Vec() * if result.vec == NULL: */ } /* "PETSc/Mat.pyx":1122 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) */ __pyx_t_2 = ((__pyx_v_result->vec == NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1123 * result = Vec() * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) # <<<<<<<<<<<<<< * CHKERR( MatGetRowSum(self.mat, result.vec) ) * return result */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1123, __pyx_L1_error) /* "PETSc/Mat.pyx":1122 * if result is None: * result = Vec() * if result.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) */ } /* "PETSc/Mat.pyx":1124 * if result.vec == NULL: * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRowSum(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1124, __pyx_L1_error) /* "PETSc/Mat.pyx":1125 * CHKERR( MatCreateVecs(self.mat, NULL, &result.vec) ) * CHKERR( MatGetRowSum(self.mat, result.vec) ) * return result # <<<<<<<<<<<<<< * * def setDiagonal(self, Vec diag, addv=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":1119 * return result * * def getRowSum(self, Vec result=None): # <<<<<<<<<<<<<< * if result is None: * result = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getRowSum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1127 * return result * * def setDiagonal(self, Vec diag, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_249setDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_248setDiagonal[] = "Mat.setDiagonal(self, Vec diag, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_249setDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_diag = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDiagonal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_diag,&__pyx_n_s_addv,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_diag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDiagonal") < 0)) __PYX_ERR(38, 1127, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_diag = ((struct PyPetscVecObject *)values[0]); __pyx_v_addv = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDiagonal", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1127, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_diag), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "diag", 0))) __PYX_ERR(38, 1127, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_248setDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_diag, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_248setDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag, PyObject *__pyx_v_addv) { InsertMode __pyx_v_caddv; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDiagonal", 0); /* "PETSc/Mat.pyx":1128 * * def setDiagonal(self, Vec diag, addv=None): * cdef PetscInsertMode caddv = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(38, 1128, __pyx_L1_error) __pyx_v_caddv = __pyx_t_1; /* "PETSc/Mat.pyx":1129 * def setDiagonal(self, Vec diag, addv=None): * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) # <<<<<<<<<<<<<< * * def diagonalScale(self, Vec L=None, Vec R=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDiagonalSet(__pyx_v_self->mat, __pyx_v_diag->vec, __pyx_v_caddv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1129, __pyx_L1_error) /* "PETSc/Mat.pyx":1127 * return result * * def setDiagonal(self, Vec diag, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode caddv = insertmode(addv) * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1131 * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) * * def diagonalScale(self, Vec L=None, Vec R=None): # <<<<<<<<<<<<<< * cdef PetscVec vecl=NULL, vecr=NULL * if L is not None: vecl = L.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_251diagonalScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_250diagonalScale[] = "Mat.diagonalScale(self, Vec L=None, Vec R=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_251diagonalScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_L = 0; struct PyPetscVecObject *__pyx_v_R = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("diagonalScale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_R,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "diagonalScale") < 0)) __PYX_ERR(38, 1131, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_L = ((struct PyPetscVecObject *)values[0]); __pyx_v_R = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("diagonalScale", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1131, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.diagonalScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "L", 0))) __PYX_ERR(38, 1131, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "R", 0))) __PYX_ERR(38, 1131, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_250diagonalScale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_L, __pyx_v_R); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_250diagonalScale(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_L, struct PyPetscVecObject *__pyx_v_R) { Vec __pyx_v_vecl; Vec __pyx_v_vecr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("diagonalScale", 0); /* "PETSc/Mat.pyx":1132 * * def diagonalScale(self, Vec L=None, Vec R=None): * cdef PetscVec vecl=NULL, vecr=NULL # <<<<<<<<<<<<<< * if L is not None: vecl = L.vec * if R is not None: vecr = R.vec */ __pyx_v_vecl = NULL; __pyx_v_vecr = NULL; /* "PETSc/Mat.pyx":1133 * def diagonalScale(self, Vec L=None, Vec R=None): * cdef PetscVec vecl=NULL, vecr=NULL * if L is not None: vecl = L.vec # <<<<<<<<<<<<<< * if R is not None: vecr = R.vec * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_L) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_L->vec; __pyx_v_vecl = __pyx_t_3; } /* "PETSc/Mat.pyx":1134 * cdef PetscVec vecl=NULL, vecr=NULL * if L is not None: vecl = L.vec * if R is not None: vecr = R.vec # <<<<<<<<<<<<<< * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_R) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_R->vec; __pyx_v_vecr = __pyx_t_3; } /* "PETSc/Mat.pyx":1135 * if L is not None: vecl = L.vec * if R is not None: vecr = R.vec * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) # <<<<<<<<<<<<<< * * def invertBlockDiagonal(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDiagonalScale(__pyx_v_self->mat, __pyx_v_vecl, __pyx_v_vecr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1135, __pyx_L1_error) /* "PETSc/Mat.pyx":1131 * CHKERR( MatDiagonalSet(self.mat, diag.vec, caddv) ) * * def diagonalScale(self, Vec L=None, Vec R=None): # <<<<<<<<<<<<<< * cdef PetscVec vecl=NULL, vecr=NULL * if L is not None: vecl = L.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.diagonalScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1137 * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) * * def invertBlockDiagonal(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 0, m = 0 * cdef const PetscScalar *cibdiag = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_253invertBlockDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_252invertBlockDiagonal[] = "Mat.invertBlockDiagonal(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_253invertBlockDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("invertBlockDiagonal (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("invertBlockDiagonal", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "invertBlockDiagonal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_252invertBlockDiagonal(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_252invertBlockDiagonal(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_bs; PetscInt __pyx_v_m; PetscScalar const *__pyx_v_cibdiag; PyArrayObject *__pyx_v_ibdiag = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("invertBlockDiagonal", 0); /* "PETSc/Mat.pyx":1138 * * def invertBlockDiagonal(self): * cdef PetscInt bs = 0, m = 0 # <<<<<<<<<<<<<< * cdef const PetscScalar *cibdiag = NULL * CHKERR( MatGetBlockSize(self.mat, &bs) ) */ __pyx_v_bs = 0; __pyx_v_m = 0; /* "PETSc/Mat.pyx":1139 * def invertBlockDiagonal(self): * cdef PetscInt bs = 0, m = 0 * cdef const PetscScalar *cibdiag = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetBlockSize(self.mat, &bs) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) */ __pyx_v_cibdiag = NULL; /* "PETSc/Mat.pyx":1140 * cdef PetscInt bs = 0, m = 0 * cdef const PetscScalar *cibdiag = NULL * CHKERR( MatGetBlockSize(self.mat, &bs) ) # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetBlockSize(__pyx_v_self->mat, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1140, __pyx_L1_error) /* "PETSc/Mat.pyx":1141 * cdef const PetscScalar *cibdiag = NULL * CHKERR( MatGetBlockSize(self.mat, &bs) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) # <<<<<<<<<<<<<< * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) * cdef ndarray ibdiag = array_s(m*bs, cibdiag) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1141, __pyx_L1_error) /* "PETSc/Mat.pyx":1142 * CHKERR( MatGetBlockSize(self.mat, &bs) ) * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) # <<<<<<<<<<<<<< * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatInvertBlockDiagonal(__pyx_v_self->mat, (&__pyx_v_cibdiag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1142, __pyx_L1_error) /* "PETSc/Mat.pyx":1143 * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) * cdef ndarray ibdiag = array_s(m*bs, cibdiag) # <<<<<<<<<<<<<< * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) * return ibdiag.transpose(0, 2, 1) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s((__pyx_v_m * __pyx_v_bs), __pyx_v_cibdiag)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ibdiag = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1144 * CHKERR( MatInvertBlockDiagonal(self.mat, &cibdiag) ) * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) # <<<<<<<<<<<<<< * return ibdiag.transpose(0, 2, 1) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ibdiag), __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(38, 1144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Mat.pyx":1145 * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) * return ibdiag.transpose(0, 2, 1) # <<<<<<<<<<<<<< * * # null space */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ibdiag), __pyx_n_s_transpose); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1137 * CHKERR( MatDiagonalScale(self.mat, vecl, vecr) ) * * def invertBlockDiagonal(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 0, m = 0 * cdef const PetscScalar *cibdiag = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.invertBlockDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ibdiag); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1149 * # null space * * def setNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<< * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_255setNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_254setNullSpace[] = "Mat.setNullSpace(self, NullSpace nsp)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_255setNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNullSpace (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNullSpace") < 0)) __PYX_ERR(38, 1149, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNullSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1149, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(38, 1149, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_254setNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_254setNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNullSpace", 0); /* "PETSc/Mat.pyx":1150 * * def setNullSpace(self, NullSpace nsp): * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<< * * def getNullSpace(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetNullSpace(__pyx_v_self->mat, __pyx_v_nsp->nsp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1150, __pyx_L1_error) /* "PETSc/Mat.pyx":1149 * # null space * * def setNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<< * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1152 * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) * * def getNullSpace(self): # <<<<<<<<<<<<<< * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_257getNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_256getNullSpace[] = "Mat.getNullSpace(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_257getNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNullSpace (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNullSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNullSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_256getNullSpace(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_256getNullSpace(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNullSpace", 0); /* "PETSc/Mat.pyx":1153 * * def getNullSpace(self): * cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<< * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1154 * def getNullSpace(self): * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<< * PetscINCREF(nsp.obj) * return nsp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1154, __pyx_L1_error) /* "PETSc/Mat.pyx":1155 * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) # <<<<<<<<<<<<<< * return nsp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); /* "PETSc/Mat.pyx":1156 * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) * return nsp # <<<<<<<<<<<<<< * * def setTransposeNullSpace(self, NullSpace nsp): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_nsp)); __pyx_r = ((PyObject *)__pyx_v_nsp); goto __pyx_L0; /* "PETSc/Mat.pyx":1152 * CHKERR( MatSetNullSpace(self.mat, nsp.nsp) ) * * def getNullSpace(self): # <<<<<<<<<<<<<< * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNullSpace(self.mat, &nsp.nsp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1158 * return nsp * * def setTransposeNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<< * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_259setTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_258setTransposeNullSpace[] = "Mat.setTransposeNullSpace(self, NullSpace nsp)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_259setTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTransposeNullSpace (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTransposeNullSpace") < 0)) __PYX_ERR(38, 1158, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTransposeNullSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1158, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(38, 1158, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_258setTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_258setTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTransposeNullSpace", 0); /* "PETSc/Mat.pyx":1159 * * def setTransposeNullSpace(self, NullSpace nsp): * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<< * * def getTransposeNullSpace(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetTransposeNullSpace(__pyx_v_self->mat, __pyx_v_nsp->nsp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1159, __pyx_L1_error) /* "PETSc/Mat.pyx":1158 * return nsp * * def setTransposeNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<< * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1161 * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) * * def getTransposeNullSpace(self): # <<<<<<<<<<<<<< * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_261getTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_260getTransposeNullSpace[] = "Mat.getTransposeNullSpace(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_261getTransposeNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTransposeNullSpace (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTransposeNullSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTransposeNullSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_260getTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_260getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTransposeNullSpace", 0); /* "PETSc/Mat.pyx":1162 * * def getTransposeNullSpace(self): * cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<< * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1163 * def getTransposeNullSpace(self): * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<< * PetscINCREF(nsp.obj) * return nsp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetTransposeNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1163, __pyx_L1_error) /* "PETSc/Mat.pyx":1164 * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) # <<<<<<<<<<<<<< * return nsp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); /* "PETSc/Mat.pyx":1165 * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) * return nsp # <<<<<<<<<<<<<< * * def setNearNullSpace(self, NullSpace nsp): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_nsp)); __pyx_r = ((PyObject *)__pyx_v_nsp); goto __pyx_L0; /* "PETSc/Mat.pyx":1161 * CHKERR( MatSetTransposeNullSpace(self.mat, nsp.nsp) ) * * def getTransposeNullSpace(self): # <<<<<<<<<<<<<< * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetTransposeNullSpace(self.mat, &nsp.nsp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getTransposeNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1167 * return nsp * * def setNearNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<< * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_263setNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_262setNearNullSpace[] = "Mat.setNearNullSpace(self, NullSpace nsp)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_263setNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNearNullSpace (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsp,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNearNullSpace") < 0)) __PYX_ERR(38, 1167, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNearNullSpace", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1167, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nsp), __pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(38, 1167, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_262setNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_262setNearNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNearNullSpace", 0); /* "PETSc/Mat.pyx":1168 * * def setNearNullSpace(self, NullSpace nsp): * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) # <<<<<<<<<<<<<< * * def getNearNullSpace(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetNearNullSpace(__pyx_v_self->mat, __pyx_v_nsp->nsp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1168, __pyx_L1_error) /* "PETSc/Mat.pyx":1167 * return nsp * * def setNearNullSpace(self, NullSpace nsp): # <<<<<<<<<<<<<< * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1170 * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) * * def getNearNullSpace(self): # <<<<<<<<<<<<<< * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265getNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_264getNearNullSpace[] = "Mat.getNearNullSpace(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265getNearNullSpace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNearNullSpace (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNearNullSpace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNearNullSpace", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_264getNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_264getNearNullSpace(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscNullSpaceObject *__pyx_v_nsp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNearNullSpace", 0); /* "PETSc/Mat.pyx":1171 * * def getNearNullSpace(self): * cdef NullSpace nsp = NullSpace() # <<<<<<<<<<<<<< * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_NullSpace)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1172 * def getNearNullSpace(self): * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) # <<<<<<<<<<<<<< * PetscINCREF(nsp.obj) * return nsp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNearNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1172, __pyx_L1_error) /* "PETSc/Mat.pyx":1173 * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) # <<<<<<<<<<<<<< * return nsp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); /* "PETSc/Mat.pyx":1174 * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) * PetscINCREF(nsp.obj) * return nsp # <<<<<<<<<<<<<< * * # matrix-vector product */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_nsp)); __pyx_r = ((PyObject *)__pyx_v_nsp); goto __pyx_L0; /* "PETSc/Mat.pyx":1170 * CHKERR( MatSetNearNullSpace(self.mat, nsp.nsp) ) * * def getNearNullSpace(self): # <<<<<<<<<<<<<< * cdef NullSpace nsp = NullSpace() * CHKERR( MatGetNearNullSpace(self.mat, &nsp.nsp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNearNullSpace", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_nsp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1178 * # matrix-vector product * * def mult(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMult(self.mat, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_267mult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_266mult[] = "Mat.mult(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_267mult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mult (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("mult", 1, 2, 2, 1); __PYX_ERR(38, 1178, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mult") < 0)) __PYX_ERR(38, 1178, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mult", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1178, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.mult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1178, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1178, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_266mult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_266mult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mult", 0); /* "PETSc/Mat.pyx":1179 * * def mult(self, Vec x, Vec y): * CHKERR( MatMult(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multAdd(self, Vec x, Vec v, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMult(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1179, __pyx_L1_error) /* "PETSc/Mat.pyx":1178 * # matrix-vector product * * def mult(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMult(self.mat, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.mult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1181 * CHKERR( MatMult(self.mat, x.vec, y.vec) ) * * def multAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269multAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_268multAdd[] = "Mat.multAdd(self, Vec x, Vec v, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269multAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_v = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multAdd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, 1); __PYX_ERR(38, 1181, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, 2); __PYX_ERR(38, 1181, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multAdd") < 0)) __PYX_ERR(38, 1181, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1181, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1181, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(38, 1181, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1181, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_268multAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_268multAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multAdd", 0); /* "PETSc/Mat.pyx":1182 * * def multAdd(self, Vec x, Vec v, Vec y): * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multTranspose(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultAdd(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_v->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1182, __pyx_L1_error) /* "PETSc/Mat.pyx":1181 * CHKERR( MatMult(self.mat, x.vec, y.vec) ) * * def multAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1184 * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_271multTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_270multTranspose[] = "Mat.multTranspose(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_271multTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multTranspose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multTranspose", 1, 2, 2, 1); __PYX_ERR(38, 1184, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multTranspose") < 0)) __PYX_ERR(38, 1184, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1184, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1184, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1184, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_270multTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_270multTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multTranspose", 0); /* "PETSc/Mat.pyx":1185 * * def multTranspose(self, Vec x, Vec y): * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multTransposeAdd(self, Vec x, Vec v, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultTranspose(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1185, __pyx_L1_error) /* "PETSc/Mat.pyx":1184 * CHKERR( MatMultAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1187 * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) * * def multTransposeAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273multTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_272multTransposeAdd[] = "Mat.multTransposeAdd(self, Vec x, Vec v, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273multTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_v = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multTransposeAdd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, 1); __PYX_ERR(38, 1187, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, 2); __PYX_ERR(38, 1187, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multTransposeAdd") < 0)) __PYX_ERR(38, 1187, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1187, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1187, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(38, 1187, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1187, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_272multTransposeAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_272multTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multTransposeAdd", 0); /* "PETSc/Mat.pyx":1188 * * def multTransposeAdd(self, Vec x, Vec v, Vec y): * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multHermitian(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultTransposeAdd(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_v->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1188, __pyx_L1_error) /* "PETSc/Mat.pyx":1187 * CHKERR( MatMultTranspose(self.mat, x.vec, y.vec) ) * * def multTransposeAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1190 * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multHermitian(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_275multHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_274multHermitian[] = "Mat.multHermitian(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_275multHermitian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multHermitian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multHermitian", 1, 2, 2, 1); __PYX_ERR(38, 1190, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multHermitian") < 0)) __PYX_ERR(38, 1190, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multHermitian", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1190, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1190, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1190, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_274multHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_274multHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multHermitian", 0); /* "PETSc/Mat.pyx":1191 * * def multHermitian(self, Vec x, Vec y): * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def multHermitianAdd(self, Vec x, Vec v, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultHermitianTranspose(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1191, __pyx_L1_error) /* "PETSc/Mat.pyx":1190 * CHKERR( MatMultTransposeAdd(self.mat, x.vec, v.vec, y.vec) ) * * def multHermitian(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1193 * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) * * def multHermitianAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultHermitianAdd(self.mat, x.vec, v.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277multHermitianAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_276multHermitianAdd[] = "Mat.multHermitianAdd(self, Vec x, Vec v, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277multHermitianAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_v = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("multHermitianAdd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_y,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, 1); __PYX_ERR(38, 1193, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, 2); __PYX_ERR(38, 1193, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multHermitianAdd") < 0)) __PYX_ERR(38, 1193, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); __pyx_v_y = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1193, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitianAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1193, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(38, 1193, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1193, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_276multHermitianAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_v, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_276multHermitianAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_v, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("multHermitianAdd", 0); /* "PETSc/Mat.pyx":1194 * * def multHermitianAdd(self, Vec x, Vec v, Vec y): * CHKERR( MatMultHermitianAdd(self.mat, x.vec, v.vec, y.vec) ) # <<<<<<<<<<<<<< * * # SOR */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMultHermitianTransposeAdd(__pyx_v_self->mat, __pyx_v_x->vec, __pyx_v_v->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1194, __pyx_L1_error) /* "PETSc/Mat.pyx":1193 * CHKERR( MatMultHermitian(self.mat, x.vec, y.vec) ) * * def multHermitianAdd(self, Vec x, Vec v, Vec y): # <<<<<<<<<<<<<< * CHKERR( MatMultHermitianAdd(self.mat, x.vec, v.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.multHermitianAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1198 * # SOR * * def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1): # <<<<<<<<<<<<<< * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_279SOR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_278SOR[] = "Mat.SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_279SOR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; PyObject *__pyx_v_omega = 0; PyObject *__pyx_v_sortype = 0; PyObject *__pyx_v_shift = 0; PyObject *__pyx_v_its = 0; PyObject *__pyx_v_lits = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("SOR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,&__pyx_n_s_omega,&__pyx_n_s_sortype,&__pyx_n_s_shift,&__pyx_n_s_its,&__pyx_n_s_lits,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; values[2] = ((PyObject *)__pyx_float_1_0); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)__pyx_float_0_0); values[5] = ((PyObject *)__pyx_int_1); values[6] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("SOR", 0, 2, 7, 1); __PYX_ERR(38, 1198, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sortype); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shift); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lits); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SOR") < 0)) __PYX_ERR(38, 1198, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_omega = values[2]; __pyx_v_sortype = values[3]; __pyx_v_shift = values[4]; __pyx_v_its = values[5]; __pyx_v_lits = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("SOR", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1198, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.SOR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(38, 1198, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1198, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_278SOR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x, __pyx_v_omega, __pyx_v_sortype, __pyx_v_shift, __pyx_v_its, __pyx_v_lits); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_278SOR(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x, PyObject *__pyx_v_omega, PyObject *__pyx_v_sortype, PyObject *__pyx_v_shift, PyObject *__pyx_v_its, PyObject *__pyx_v_lits) { PetscReal __pyx_v_comega; MatSORType __pyx_v_csortype; PetscInt __pyx_v_cshift; PetscInt __pyx_v_cits; PetscInt __pyx_v_clits; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("SOR", 0); /* "PETSc/Mat.pyx":1199 * * def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1): * cdef PetscReal comega = asReal(omega) # <<<<<<<<<<<<<< * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_omega); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1199, __pyx_L1_error) __pyx_v_comega = __pyx_t_1; /* "PETSc/Mat.pyx":1200 * def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1): * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP # <<<<<<<<<<<<<< * if sortype is not None: * csortype = asInt(sortype) */ __pyx_v_csortype = SOR_LOCAL_SYMMETRIC_SWEEP; /* "PETSc/Mat.pyx":1201 * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: # <<<<<<<<<<<<<< * csortype = asInt(sortype) * cdef PetscInt cshift = asInt(shift) */ __pyx_t_2 = (__pyx_v_sortype != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Mat.pyx":1202 * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: * csortype = asInt(sortype) # <<<<<<<<<<<<<< * cdef PetscInt cshift = asInt(shift) * cdef PetscInt cits = asInt(its) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_sortype); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1202, __pyx_L1_error) __pyx_v_csortype = ((MatSORType)__pyx_t_4); /* "PETSc/Mat.pyx":1201 * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP * if sortype is not None: # <<<<<<<<<<<<<< * csortype = asInt(sortype) * cdef PetscInt cshift = asInt(shift) */ } /* "PETSc/Mat.pyx":1203 * if sortype is not None: * csortype = asInt(sortype) * cdef PetscInt cshift = asInt(shift) # <<<<<<<<<<<<<< * cdef PetscInt cits = asInt(its) * cdef PetscInt clits = asInt(lits) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_shift); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1203, __pyx_L1_error) __pyx_v_cshift = __pyx_t_4; /* "PETSc/Mat.pyx":1204 * csortype = asInt(sortype) * cdef PetscInt cshift = asInt(shift) * cdef PetscInt cits = asInt(its) # <<<<<<<<<<<<<< * cdef PetscInt clits = asInt(lits) * CHKERR( MatSOR(self.mat, b.vec, comega, csortype, cshift, cits, clits, x.vec) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1204, __pyx_L1_error) __pyx_v_cits = __pyx_t_4; /* "PETSc/Mat.pyx":1205 * cdef PetscInt cshift = asInt(shift) * cdef PetscInt cits = asInt(its) * cdef PetscInt clits = asInt(lits) # <<<<<<<<<<<<<< * CHKERR( MatSOR(self.mat, b.vec, comega, csortype, cshift, cits, clits, x.vec) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_lits); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1205, __pyx_L1_error) __pyx_v_clits = __pyx_t_4; /* "PETSc/Mat.pyx":1206 * cdef PetscInt cits = asInt(its) * cdef PetscInt clits = asInt(lits) * CHKERR( MatSOR(self.mat, b.vec, comega, csortype, cshift, cits, clits, x.vec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSOR(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_comega, __pyx_v_csortype, __pyx_v_cshift, __pyx_v_cits, __pyx_v_clits, __pyx_v_x->vec)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1206, __pyx_L1_error) /* "PETSc/Mat.pyx":1198 * # SOR * * def SOR(self, Vec b, Vec x, omega=1.0, sortype=None, shift=0.0, its=1, lits=1): # <<<<<<<<<<<<<< * cdef PetscReal comega = asReal(omega) * cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.SOR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1210 * # * * def getDiagonalBlock(self): # <<<<<<<<<<<<<< * cdef Mat submat = Mat() * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281getDiagonalBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_280getDiagonalBlock[] = "Mat.getDiagonalBlock(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281getDiagonalBlock(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDiagonalBlock (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDiagonalBlock", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDiagonalBlock", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_280getDiagonalBlock(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_280getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_submat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDiagonalBlock", 0); /* "PETSc/Mat.pyx":1211 * * def getDiagonalBlock(self): * cdef Mat submat = Mat() # <<<<<<<<<<<<<< * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) * PetscINCREF(submat.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1212 * def getDiagonalBlock(self): * cdef Mat submat = Mat() * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(submat.obj) * return submat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonalBlock(__pyx_v_self->mat, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1212, __pyx_L1_error) /* "PETSc/Mat.pyx":1213 * cdef Mat submat = Mat() * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) * PetscINCREF(submat.obj) # <<<<<<<<<<<<<< * return submat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj)); /* "PETSc/Mat.pyx":1214 * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) * PetscINCREF(submat.obj) * return submat # <<<<<<<<<<<<<< * * def increaseOverlap(self, IS iset, overlap=1): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_submat)); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "PETSc/Mat.pyx":1210 * # * * def getDiagonalBlock(self): # <<<<<<<<<<<<<< * cdef Mat submat = Mat() * CHKERR( MatGetDiagonalBlock(self.mat, &submat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDiagonalBlock", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1216 * return submat * * def increaseOverlap(self, IS iset, overlap=1): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(overlap) * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283increaseOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_282increaseOverlap[] = "Mat.increaseOverlap(self, IS iset, overlap=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283increaseOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_v_overlap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("increaseOverlap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_overlap,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "increaseOverlap") < 0)) __PYX_ERR(38, 1216, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_overlap = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("increaseOverlap", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1216, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.increaseOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(38, 1216, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_282increaseOverlap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_overlap); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_282increaseOverlap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("increaseOverlap", 0); /* "PETSc/Mat.pyx":1217 * * def increaseOverlap(self, IS iset, overlap=1): * cdef PetscInt ival = asInt(overlap) # <<<<<<<<<<<<<< * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1217, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/Mat.pyx":1218 * def increaseOverlap(self, IS iset, overlap=1): * cdef PetscInt ival = asInt(overlap) * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) # <<<<<<<<<<<<<< * * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIncreaseOverlap(__pyx_v_self->mat, 1, (&__pyx_v_iset->iset), __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1218, __pyx_L1_error) /* "PETSc/Mat.pyx":1216 * return submat * * def increaseOverlap(self, IS iset, overlap=1): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(overlap) * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.increaseOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1220 * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) * * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS ciscol = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_285createSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_284createSubMatrix[] = "Mat.createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_285createSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; struct PyPetscMatObject *__pyx_v_submat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSubMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0}; PyObject* values[3] = {0,0,0}; values[1] = (PyObject *)((struct PyPetscISObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submat); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSubMatrix") < 0)) __PYX_ERR(38, 1220, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_submat = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSubMatrix", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1220, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1220, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(38, 1220, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(38, 1220, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_284createSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284createSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat) { MatReuse __pyx_v_reuse; IS __pyx_v_ciscol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSubMatrix", 0); __Pyx_INCREF((PyObject *)__pyx_v_submat); /* "PETSc/Mat.pyx":1221 * * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscIS ciscol = NULL * if iscol is not None: ciscol = iscol.iset */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":1222 * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS ciscol = NULL # <<<<<<<<<<<<<< * if iscol is not None: ciscol = iscol.iset * if submat is None: submat = Mat() */ __pyx_v_ciscol = NULL; /* "PETSc/Mat.pyx":1223 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS ciscol = NULL * if iscol is not None: ciscol = iscol.iset # <<<<<<<<<<<<<< * if submat is None: submat = Mat() * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX */ __pyx_t_1 = (((PyObject *)__pyx_v_iscol) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_iscol->iset; __pyx_v_ciscol = __pyx_t_3; } /* "PETSc/Mat.pyx":1224 * cdef PetscIS ciscol = NULL * if iscol is not None: ciscol = iscol.iset * if submat is None: submat = Mat() # <<<<<<<<<<<<<< * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, */ __pyx_t_2 = (((PyObject *)__pyx_v_submat) == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_submat, ((struct PyPetscMatObject *)__pyx_t_4)); __pyx_t_4 = 0; } /* "PETSc/Mat.pyx":1225 * if iscol is not None: ciscol = iscol.iset * if submat is None: submat = Mat() * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, * reuse, &submat.mat) ) */ __pyx_t_1 = ((__pyx_v_submat->mat != NULL) != 0); if (__pyx_t_1) { __pyx_v_reuse = MAT_REUSE_MATRIX; } /* "PETSc/Mat.pyx":1226 * if submat is None: submat = Mat() * if submat.mat != NULL: reuse = MAT_REUSE_MATRIX * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, # <<<<<<<<<<<<<< * reuse, &submat.mat) ) * return submat */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSubMatrix(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_ciscol, __pyx_v_reuse, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1226, __pyx_L1_error) /* "PETSc/Mat.pyx":1228 * CHKERR( MatCreateSubMatrix(self.mat, isrow.iset, ciscol, * reuse, &submat.mat) ) * return submat # <<<<<<<<<<<<<< * * def createSubMatrices(self, isrows, iscols=None, submats=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_submat)); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "PETSc/Mat.pyx":1220 * CHKERR( MatIncreaseOverlap(self.mat, 1, &iset.iset, ival) ) * * def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS ciscol = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1230 * return submat * * def createSubMatrices(self, isrows, iscols=None, submats=None): # <<<<<<<<<<<<<< * if iscols is None: iscols = isrows * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_287createSubMatrices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_286createSubMatrices[] = "Mat.createSubMatrices(self, isrows, iscols=None, submats=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_287createSubMatrices(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_isrows = 0; PyObject *__pyx_v_iscols = 0; PyObject *__pyx_v_submats = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSubMatrices (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrows,&__pyx_n_s_iscols,&__pyx_n_s_submats,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrows)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscols); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submats); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSubMatrices") < 0)) __PYX_ERR(38, 1230, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrows = values[0]; __pyx_v_iscols = values[1]; __pyx_v_submats = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSubMatrices", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1230, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrices", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_286createSubMatrices(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrows, __pyx_v_iscols, __pyx_v_submats); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286createSubMatrices(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_isrows, PyObject *__pyx_v_iscols, PyObject *__pyx_v_submats) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; MatReuse __pyx_v_reuse; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; Mat *__pyx_v_cmats; CYTHON_UNUSED PyObject *__pyx_v_tmp1 = 0; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; IS __pyx_t_7; int __pyx_t_8; Mat __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSubMatrices", 0); __Pyx_INCREF(__pyx_v_isrows); __Pyx_INCREF(__pyx_v_iscols); __Pyx_INCREF(__pyx_v_submats); /* "PETSc/Mat.pyx":1231 * * def createSubMatrices(self, isrows, iscols=None, submats=None): * if iscols is None: iscols = isrows # <<<<<<<<<<<<<< * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) */ __pyx_t_1 = (__pyx_v_iscols == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_v_isrows); __Pyx_DECREF_SET(__pyx_v_iscols, __pyx_v_isrows); } /* "PETSc/Mat.pyx":1232 * def createSubMatrices(self, isrows, iscols=None, submats=None): * if iscols is None: iscols = isrows * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) # <<<<<<<<<<<<<< * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) * assert len(isrows) == len(iscols) */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_isrows, __pyx_ptype_8petsc4py_5PETSc_IS); if ((__pyx_t_2 != 0)) { __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_isrows); __Pyx_GIVEREF(__pyx_v_isrows); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_isrows); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } else { __pyx_t_4 = PySequence_List(__pyx_v_isrows); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_isrows, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1233 * if iscols is None: iscols = isrows * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) # <<<<<<<<<<<<<< * assert len(isrows) == len(iscols) * cdef Py_ssize_t i, n = len(isrows) */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_iscols, __pyx_ptype_8petsc4py_5PETSc_IS); if ((__pyx_t_2 != 0)) { __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_iscols); __Pyx_GIVEREF(__pyx_v_iscols); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_iscols); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } else { __pyx_t_4 = PySequence_List(__pyx_v_iscols); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_iscols, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1234 * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) * assert len(isrows) == len(iscols) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = len(isrows) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(38, 1234, __pyx_L1_error) __pyx_t_6 = PyObject_Length(__pyx_v_iscols); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(38, 1234, __pyx_L1_error) if (unlikely(!((__pyx_t_5 == __pyx_t_6) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(38, 1234, __pyx_L1_error) } } #endif /* "PETSc/Mat.pyx":1235 * iscols = [iscols] if isinstance(iscols, IS) else list(iscols) * assert len(isrows) == len(iscols) * cdef Py_ssize_t i, n = len(isrows) # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS *cisrows = NULL */ __pyx_t_6 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(38, 1235, __pyx_L1_error) __pyx_v_n = __pyx_t_6; /* "PETSc/Mat.pyx":1236 * assert len(isrows) == len(iscols) * cdef Py_ssize_t i, n = len(isrows) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":1237 * cdef Py_ssize_t i, n = len(isrows) * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * cdef PetscMat *cmats = NULL */ __pyx_v_cisrows = NULL; /* "PETSc/Mat.pyx":1238 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * cdef PetscMat *cmats = NULL * cdef object tmp1, tmp2 */ __pyx_v_ciscols = NULL; /* "PETSc/Mat.pyx":1239 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL * cdef PetscMat *cmats = NULL # <<<<<<<<<<<<<< * cdef object tmp1, tmp2 * cdef Mat mat */ __pyx_v_cmats = NULL; /* "PETSc/Mat.pyx":1242 * cdef object tmp1, tmp2 * cdef Mat mat * tmp1 = oarray_p(empty_p(n), NULL, &cisrows) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmp1 = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/Mat.pyx":1243 * cdef Mat mat * tmp1 = oarray_p(empty_p(n), NULL, &cisrows) * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset */ __pyx_t_6 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_isrows, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(38, 1243, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscISObject *)__pyx_t_4)->iset; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_cisrows[__pyx_v_i]) = __pyx_t_7; } /* "PETSc/Mat.pyx":1244 * tmp1 = oarray_p(empty_p(n), NULL, &cisrows) * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) # <<<<<<<<<<<<<< * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_4, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_tmp2 = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1245 * for i from 0 <= i < n: cisrows[i] = (isrows[i]).iset * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset # <<<<<<<<<<<<<< * if submats is not None: * reuse = MAT_REUSE_MATRIX */ __pyx_t_6 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_iscols, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(38, 1245, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscISObject *)__pyx_t_3)->iset; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_ciscols[__pyx_v_i]) = __pyx_t_7; } /* "PETSc/Mat.pyx":1246 * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * submats = list(submats) */ __pyx_t_2 = (__pyx_v_submats != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/Mat.pyx":1247 * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * submats = list(submats) * assert len(submats) == len(isrows) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "PETSc/Mat.pyx":1248 * if submats is not None: * reuse = MAT_REUSE_MATRIX * submats = list(submats) # <<<<<<<<<<<<<< * assert len(submats) == len(isrows) * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) */ __pyx_t_3 = PySequence_List(__pyx_v_submats); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_submats, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1249 * reuse = MAT_REUSE_MATRIX * submats = list(submats) * assert len(submats) == len(isrows) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) * for i from 0 <= i < n: cmats[i] = (submats[i]).mat */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = PyObject_Length(__pyx_v_submats); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(38, 1249, __pyx_L1_error) __pyx_t_5 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(38, 1249, __pyx_L1_error) if (unlikely(!((__pyx_t_6 == __pyx_t_5) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(38, 1249, __pyx_L1_error) } } #endif /* "PETSc/Mat.pyx":1250 * submats = list(submats) * assert len(submats) == len(isrows) * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cmats[i] = (submats[i]).mat * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_n + 1)) * (sizeof(Mat))), (&__pyx_v_cmats))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(38, 1250, __pyx_L1_error) /* "PETSc/Mat.pyx":1251 * assert len(submats) == len(isrows) * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) * for i from 0 <= i < n: cmats[i] = (submats[i]).mat # <<<<<<<<<<<<<< * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: PetscINCREF(&cmats[i]) */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_submats, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(38, 1251, __pyx_L1_error) __pyx_t_9 = ((struct PyPetscMatObject *)__pyx_t_3)->mat; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_cmats[__pyx_v_i]) = __pyx_t_9; } /* "PETSc/Mat.pyx":1246 * tmp2 = oarray_p(empty_p(n), NULL, &ciscols) * for i from 0 <= i < n: ciscols[i] = (iscols[i]).iset * if submats is not None: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * submats = list(submats) */ } /* "PETSc/Mat.pyx":1252 * CHKERR( PetscMalloc((n+1)*sizeof(PetscMat), &cmats) ) * for i from 0 <= i < n: cmats[i] = (submats[i]).mat * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) # <<<<<<<<<<<<<< * for i from 0 <= i < n: PetscINCREF(&cmats[i]) * if reuse == MAT_INITIAL_MATRIX: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSubMatrices(__pyx_v_self->mat, ((PetscInt)__pyx_v_n), __pyx_v_cisrows, __pyx_v_ciscols, __pyx_v_reuse, (&__pyx_v_cmats))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(38, 1252, __pyx_L1_error) /* "PETSc/Mat.pyx":1253 * for i from 0 <= i < n: cmats[i] = (submats[i]).mat * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: PetscINCREF(&cmats[i]) # <<<<<<<<<<<<<< * if reuse == MAT_INITIAL_MATRIX: * submats = [None] * n */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((PetscObject *)(&(__pyx_v_cmats[__pyx_v_i]))))); } /* "PETSc/Mat.pyx":1254 * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: PetscINCREF(&cmats[i]) * if reuse == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<< * submats = [None] * n * for i from 0 <= i < n: */ __pyx_t_1 = ((__pyx_v_reuse == MAT_INITIAL_MATRIX) != 0); if (__pyx_t_1) { /* "PETSc/Mat.pyx":1255 * for i from 0 <= i < n: PetscINCREF(&cmats[i]) * if reuse == MAT_INITIAL_MATRIX: * submats = [None] * n # <<<<<<<<<<<<<< * for i from 0 <= i < n: * submats[i] = mat = Mat() */ __pyx_t_3 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) { __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyList_SET_ITEM(__pyx_t_3, __pyx_temp, Py_None); } } __Pyx_DECREF_SET(__pyx_v_submats, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1256 * if reuse == MAT_INITIAL_MATRIX: * submats = [None] * n * for i from 0 <= i < n: # <<<<<<<<<<<<<< * submats[i] = mat = Mat() * mat.mat = cmats[i] */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "PETSc/Mat.pyx":1257 * submats = [None] * n * for i from 0 <= i < n: * submats[i] = mat = Mat() # <<<<<<<<<<<<<< * mat.mat = cmats[i] * CHKERR( MatDestroyMatrices(n, &cmats) ) */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_SetItemInt(__pyx_v_submats, __pyx_v_i, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0)) __PYX_ERR(38, 1257, __pyx_L1_error) __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_mat, ((struct PyPetscMatObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1258 * for i from 0 <= i < n: * submats[i] = mat = Mat() * mat.mat = cmats[i] # <<<<<<<<<<<<<< * CHKERR( MatDestroyMatrices(n, &cmats) ) * return submats */ __pyx_v_mat->mat = (__pyx_v_cmats[__pyx_v_i]); } /* "PETSc/Mat.pyx":1254 * CHKERR( MatCreateSubMatrices(self.mat, n, cisrows, ciscols, reuse, &cmats) ) * for i from 0 <= i < n: PetscINCREF(&cmats[i]) * if reuse == MAT_INITIAL_MATRIX: # <<<<<<<<<<<<<< * submats = [None] * n * for i from 0 <= i < n: */ } /* "PETSc/Mat.pyx":1259 * submats[i] = mat = Mat() * mat.mat = cmats[i] * CHKERR( MatDestroyMatrices(n, &cmats) ) # <<<<<<<<<<<<<< * return submats * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroyMatrices(((PetscInt)__pyx_v_n), (&__pyx_v_cmats))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(38, 1259, __pyx_L1_error) /* "PETSc/Mat.pyx":1260 * mat.mat = cmats[i] * CHKERR( MatDestroyMatrices(n, &cmats) ) * return submats # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_submats); __pyx_r = __pyx_v_submats; goto __pyx_L0; /* "PETSc/Mat.pyx":1230 * return submat * * def createSubMatrices(self, isrows, iscols=None, submats=None): # <<<<<<<<<<<<<< * if iscols is None: iscols = isrows * isrows = [isrows] if isinstance(isrows, IS) else list(isrows) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSubMatrices", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp1); __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XDECREF(__pyx_v_isrows); __Pyx_XDECREF(__pyx_v_iscols); __Pyx_XDECREF(__pyx_v_submats); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1264 * # * * def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None): # <<<<<<<<<<<<<< * if submat is None: submat = Mat() * else: CHKERR( MatDestroy(&submat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_289getLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_288getLocalSubMatrix[] = "Mat.getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_289getLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; struct PyPetscMatObject *__pyx_v_submat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSubMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getLocalSubMatrix", 0, 2, 3, 1); __PYX_ERR(38, 1264, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submat); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLocalSubMatrix") < 0)) __PYX_ERR(38, 1264, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_submat = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLocalSubMatrix", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1264, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1264, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(38, 1264, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(38, 1264, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_288getLocalSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288getLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSubMatrix", 0); __Pyx_INCREF((PyObject *)__pyx_v_submat); /* "PETSc/Mat.pyx":1265 * * def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None): * if submat is None: submat = Mat() # <<<<<<<<<<<<<< * else: CHKERR( MatDestroy(&submat.mat) ) * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_submat) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_submat, ((struct PyPetscMatObject *)__pyx_t_3)); __pyx_t_3 = 0; goto __pyx_L3; } /* "PETSc/Mat.pyx":1266 * def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None): * if submat is None: submat = Mat() * else: CHKERR( MatDestroy(&submat.mat) ) # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) * return submat */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroy((&__pyx_v_submat->mat))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1266, __pyx_L1_error) } __pyx_L3:; /* "PETSc/Mat.pyx":1267 * if submat is None: submat = Mat() * else: CHKERR( MatDestroy(&submat.mat) ) * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) # <<<<<<<<<<<<<< * return submat * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSubMatrix(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1267, __pyx_L1_error) /* "PETSc/Mat.pyx":1268 * else: CHKERR( MatDestroy(&submat.mat) ) * CHKERR( MatGetLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) * return submat # <<<<<<<<<<<<<< * * def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_submat)); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "PETSc/Mat.pyx":1264 * # * * def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None): # <<<<<<<<<<<<<< * if submat is None: submat = Mat() * else: CHKERR( MatDestroy(&submat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1270 * return submat * * def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): # <<<<<<<<<<<<<< * CHKERR( MatRestoreLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_291restoreLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_290restoreLocalSubMatrix[] = "Mat.restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_291restoreLocalSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; struct PyPetscMatObject *__pyx_v_submat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreLocalSubMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_submat,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, 1); __PYX_ERR(38, 1270, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_submat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, 2); __PYX_ERR(38, 1270, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreLocalSubMatrix") < 0)) __PYX_ERR(38, 1270, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_submat = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1270, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1270, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(38, 1270, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "submat", 0))) __PYX_ERR(38, 1270, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_290restoreLocalSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_submat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290restoreLocalSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, struct PyPetscMatObject *__pyx_v_submat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreLocalSubMatrix", 0); /* "PETSc/Mat.pyx":1271 * * def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): * CHKERR( MatRestoreLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatRestoreLocalSubMatrix(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1271, __pyx_L1_error) /* "PETSc/Mat.pyx":1270 * return submat * * def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat): # <<<<<<<<<<<<<< * CHKERR( MatRestoreLocalSubMatrix(self.mat, isrow.iset, iscol.iset, &submat.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreLocalSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1275 * # * * def norm(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_293norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_292norm[] = "Mat.norm(self, norm_type=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_293norm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_norm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("norm (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "norm") < 0)) __PYX_ERR(38, 1275, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("norm", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1275, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_292norm(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_norm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292norm(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_norm_type) { NormType __pyx_v_norm_1_2; NormType __pyx_v_ntype; PetscReal __pyx_v_rval[2]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; NormType __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("norm", 0); /* "PETSc/Mat.pyx":1276 * * def norm(self, norm_type=None): * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS * if norm_type is not None: ntype = norm_type */ __pyx_v_norm_1_2 = NORM_1_AND_2; /* "PETSc/Mat.pyx":1277 * def norm(self, norm_type=None): * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS # <<<<<<<<<<<<<< * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] */ __pyx_v_ntype = NORM_FROBENIUS; /* "PETSc/Mat.pyx":1278 * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS * if norm_type is not None: ntype = norm_type # <<<<<<<<<<<<<< * cdef PetscReal rval[2] * CHKERR( MatNorm(self.mat, ntype, rval) ) */ __pyx_t_1 = (__pyx_v_norm_type != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = ((NormType)__Pyx_PyInt_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 1278, __pyx_L1_error) __pyx_v_ntype = __pyx_t_3; } /* "PETSc/Mat.pyx":1280 * if norm_type is not None: ntype = norm_type * cdef PetscReal rval[2] * CHKERR( MatNorm(self.mat, ntype, rval) ) # <<<<<<<<<<<<<< * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNorm(__pyx_v_self->mat, __pyx_v_ntype, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1280, __pyx_L1_error) /* "PETSc/Mat.pyx":1281 * cdef PetscReal rval[2] * CHKERR( MatNorm(self.mat, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) # <<<<<<<<<<<<<< * else: return (toReal(rval[0]), toReal(rval[1])) * */ __pyx_t_2 = ((__pyx_v_ntype != __pyx_v_norm_1_2) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":1282 * CHKERR( MatNorm(self.mat, ntype, rval) ) * if ntype != norm_1_2: return toReal(rval[0]) * else: return (toReal(rval[0]), toReal(rval[1])) # <<<<<<<<<<<<<< * * def scale(self, alpha): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_rval[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(38, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 1282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; } /* "PETSc/Mat.pyx":1275 * # * * def norm(self, norm_type=None): # <<<<<<<<<<<<<< * cdef PetscNormType norm_1_2 = PETSC_NORM_1_AND_2 * cdef PetscNormType ntype = PETSC_NORM_FROBENIUS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.Mat.norm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1284 * else: return (toReal(rval[0]), toReal(rval[1])) * * def scale(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatScale(self.mat, sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_294scale[] = "Mat.scale(self, alpha)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295scale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale") < 0)) __PYX_ERR(38, 1284, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1284, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_294scale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294scale(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scale", 0); /* "PETSc/Mat.pyx":1285 * * def scale(self, alpha): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( MatScale(self.mat, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 1285, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":1286 * def scale(self, alpha): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatScale(self.mat, sval) ) # <<<<<<<<<<<<<< * * def shift(self, alpha): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatScale(__pyx_v_self->mat, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1286, __pyx_L1_error) /* "PETSc/Mat.pyx":1284 * else: return (toReal(rval[0]), toReal(rval[1])) * * def scale(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatScale(self.mat, sval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.scale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1288 * CHKERR( MatScale(self.mat, sval) ) * * def shift(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatShift(self.mat, sval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_296shift[] = "Mat.shift(self, alpha)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297shift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("shift (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shift") < 0)) __PYX_ERR(38, 1288, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_alpha = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1288, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_296shift(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296shift(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha) { PetscScalar __pyx_v_sval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shift", 0); /* "PETSc/Mat.pyx":1289 * * def shift(self, alpha): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * CHKERR( MatShift(self.mat, sval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 1289, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":1290 * def shift(self, alpha): * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatShift(self.mat, sval) ) # <<<<<<<<<<<<<< * * def chop(self, tol): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatShift(__pyx_v_self->mat, __pyx_v_sval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1290, __pyx_L1_error) /* "PETSc/Mat.pyx":1288 * CHKERR( MatScale(self.mat, sval) ) * * def shift(self, alpha): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * CHKERR( MatShift(self.mat, sval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.shift", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1292 * CHKERR( MatShift(self.mat, sval) ) * * def chop(self, tol): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * CHKERR( MatChop(self.mat, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_299chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_298chop[] = "Mat.chop(self, tol)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_299chop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("chop (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chop") < 0)) __PYX_ERR(38, 1292, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tol = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1292, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_298chop(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_298chop(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("chop", 0); /* "PETSc/Mat.pyx":1293 * * def chop(self, tol): * cdef PetscReal rval = asReal(tol) # <<<<<<<<<<<<<< * CHKERR( MatChop(self.mat, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1293, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/Mat.pyx":1294 * def chop(self, tol): * cdef PetscReal rval = asReal(tol) * CHKERR( MatChop(self.mat, rval) ) # <<<<<<<<<<<<<< * * def axpy(self, alpha, Mat X, structure=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatChop(__pyx_v_self->mat, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1294, __pyx_L1_error) /* "PETSc/Mat.pyx":1292 * CHKERR( MatShift(self.mat, sval) ) * * def chop(self, tol): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(tol) * CHKERR( MatChop(self.mat, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.chop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1296 * CHKERR( MatChop(self.mat, rval) ) * * def axpy(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_301axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_300axpy[] = "Mat.axpy(self, alpha, Mat X, structure=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_301axpy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; struct PyPetscMatObject *__pyx_v_X = 0; PyObject *__pyx_v_structure = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("axpy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_X,&__pyx_n_s_structure,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("axpy", 0, 2, 3, 1); __PYX_ERR(38, 1296, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_structure); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "axpy") < 0)) __PYX_ERR(38, 1296, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_alpha = values[0]; __pyx_v_X = ((struct PyPetscMatObject *)values[1]); __pyx_v_structure = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("axpy", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1296, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(38, 1296, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_300axpy(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_X, __pyx_v_structure); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300axpy(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure) { PetscScalar __pyx_v_sval; MatStructure __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; MatStructure __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("axpy", 0); /* "PETSc/Mat.pyx":1297 * * def axpy(self, alpha, Mat X, structure=None): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 1297, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":1298 * def axpy(self, alpha, Mat X, structure=None): * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) # <<<<<<<<<<<<<< * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matstructure(__pyx_v_structure); if (unlikely(__pyx_t_2 == ((MatStructure)((MatStructure)-1L)))) __PYX_ERR(38, 1298, __pyx_L1_error) __pyx_v_flag = __pyx_t_2; /* "PETSc/Mat.pyx":1299 * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) # <<<<<<<<<<<<<< * * def aypx(self, alpha, Mat X, structure=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAXPY(__pyx_v_self->mat, __pyx_v_sval, __pyx_v_X->mat, __pyx_v_flag)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 1299, __pyx_L1_error) /* "PETSc/Mat.pyx":1296 * CHKERR( MatChop(self.mat, rval) ) * * def axpy(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.axpy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1301 * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) * * def aypx(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_303aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_302aypx[] = "Mat.aypx(self, alpha, Mat X, structure=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_303aypx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; struct PyPetscMatObject *__pyx_v_X = 0; PyObject *__pyx_v_structure = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("aypx (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,&__pyx_n_s_X,&__pyx_n_s_structure,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("aypx", 0, 2, 3, 1); __PYX_ERR(38, 1301, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_structure); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aypx") < 0)) __PYX_ERR(38, 1301, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_alpha = values[0]; __pyx_v_X = ((struct PyPetscMatObject *)values[1]); __pyx_v_structure = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("aypx", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1301, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(38, 1301, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_302aypx(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_X, __pyx_v_structure); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_302aypx(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscMatObject *__pyx_v_X, PyObject *__pyx_v_structure) { PetscScalar __pyx_v_sval; MatStructure __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscScalar __pyx_t_1; MatStructure __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("aypx", 0); /* "PETSc/Mat.pyx":1302 * * def aypx(self, alpha, Mat X, structure=None): * cdef PetscScalar sval = asScalar(alpha) # <<<<<<<<<<<<<< * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAYPX(self.mat, sval, X.mat, flag) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__pyx_t_1 == ((PetscScalar)((PetscScalar)(-1.0))) && PyErr_Occurred())) __PYX_ERR(38, 1302, __pyx_L1_error) __pyx_v_sval = __pyx_t_1; /* "PETSc/Mat.pyx":1303 * def aypx(self, alpha, Mat X, structure=None): * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) # <<<<<<<<<<<<<< * CHKERR( MatAYPX(self.mat, sval, X.mat, flag) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_matstructure(__pyx_v_structure); if (unlikely(__pyx_t_2 == ((MatStructure)((MatStructure)-1L)))) __PYX_ERR(38, 1303, __pyx_L1_error) __pyx_v_flag = __pyx_t_2; /* "PETSc/Mat.pyx":1304 * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) * CHKERR( MatAYPX(self.mat, sval, X.mat, flag) ) # <<<<<<<<<<<<<< * * # matrix-matrix product */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatAYPX(__pyx_v_self->mat, __pyx_v_sval, __pyx_v_X->mat, __pyx_v_flag)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 1304, __pyx_L1_error) /* "PETSc/Mat.pyx":1301 * CHKERR( MatAXPY(self.mat, sval, X.mat, flag) ) * * def aypx(self, alpha, Mat X, structure=None): # <<<<<<<<<<<<<< * cdef PetscScalar sval = asScalar(alpha) * cdef PetscMatStructure flag = matstructure(structure) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.aypx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1308 * # matrix-matrix product * * def matMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_305matMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_304matMult[] = "Mat.matMult(self, Mat mat, Mat result=None, fill=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_305matMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matMult (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0}; PyObject* values[3] = {0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matMult") < 0)) __PYX_ERR(38, 1308, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matMult", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1308, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.matMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 1308, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(38, 1308, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_304matMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304matMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscReal __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matMult", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":1309 * * def matMult(self, Mat mat, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal rval = 2 * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":1310 * def matMult(self, Mat mat, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_rval = 2.0; /* "PETSc/Mat.pyx":1311 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1312 * cdef PetscReal rval = 2 * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1311 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "PETSc/Mat.pyx":1313 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ __pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1314 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: rval = asReal(fill) * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "PETSc/Mat.pyx":1313 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ } __pyx_L3:; /* "PETSc/Mat.pyx":1315 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result */ __pyx_t_2 = (__pyx_v_fill != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1315, __pyx_L1_error) __pyx_v_rval = __pyx_t_4; } /* "PETSc/Mat.pyx":1316 * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMatMult(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_reuse, __pyx_v_rval, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1316, __pyx_L1_error) /* "PETSc/Mat.pyx":1317 * if fill is not None: rval = asReal(fill) * CHKERR( MatMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def matTransposeMult(self, Mat mat, Mat result=None, fill=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":1308 * # matrix-matrix product * * def matMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.matMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1319 * return result * * def matTransposeMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307matTransposeMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_306matTransposeMult[] = "Mat.matTransposeMult(self, Mat mat, Mat result=None, fill=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307matTransposeMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matTransposeMult (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0}; PyObject* values[3] = {0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matTransposeMult") < 0)) __PYX_ERR(38, 1319, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matTransposeMult", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1319, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.matTransposeMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 1319, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(38, 1319, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_306matTransposeMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_306matTransposeMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscReal __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matTransposeMult", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":1320 * * def matTransposeMult(self, Mat mat, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal rval = 2 * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":1321 * def matTransposeMult(self, Mat mat, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_rval = 2.0; /* "PETSc/Mat.pyx":1322 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1323 * cdef PetscReal rval = 2 * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1322 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "PETSc/Mat.pyx":1324 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ __pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1325 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: rval = asReal(fill) * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "PETSc/Mat.pyx":1324 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ } __pyx_L3:; /* "PETSc/Mat.pyx":1326 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result */ __pyx_t_2 = (__pyx_v_fill != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1326, __pyx_L1_error) __pyx_v_rval = __pyx_t_4; } /* "PETSc/Mat.pyx":1327 * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMatTransposeMult(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_reuse, __pyx_v_rval, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1327, __pyx_L1_error) /* "PETSc/Mat.pyx":1328 * if fill is not None: rval = asReal(fill) * CHKERR( MatMatTransposeMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def transposeMatMult(self, Mat mat, Mat result=None, fill=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":1319 * return result * * def matTransposeMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.matTransposeMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1330 * return result * * def transposeMatMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309transposeMatMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_308transposeMatMult[] = "Mat.transposeMatMult(self, Mat mat, Mat result=None, fill=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309transposeMatMult(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("transposeMatMult (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_result,&__pyx_n_s_fill,0}; PyObject* values[3] = {0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "transposeMatMult") < 0)) __PYX_ERR(38, 1330, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("transposeMatMult", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1330, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.transposeMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 1330, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(38, 1330, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_308transposeMatMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_308transposeMatMult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscReal __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("transposeMatMult", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":1331 * * def transposeMatMult(self, Mat mat, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal rval = 2 * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":1332 * def transposeMatMult(self, Mat mat, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_rval = 2.0; /* "PETSc/Mat.pyx":1333 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1334 * cdef PetscReal rval = 2 * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1333 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "PETSc/Mat.pyx":1335 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ __pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1336 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: rval = asReal(fill) * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "PETSc/Mat.pyx":1335 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) */ } __pyx_L3:; /* "PETSc/Mat.pyx":1337 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result */ __pyx_t_2 = (__pyx_v_fill != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1337, __pyx_L1_error) __pyx_v_rval = __pyx_t_4; } /* "PETSc/Mat.pyx":1338 * reuse = MAT_REUSE_MATRIX * if fill is not None: rval = asReal(fill) * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatTransposeMatMult(__pyx_v_self->mat, __pyx_v_mat->mat, __pyx_v_reuse, __pyx_v_rval, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1338, __pyx_L1_error) /* "PETSc/Mat.pyx":1339 * if fill is not None: rval = asReal(fill) * CHKERR( MatTransposeMatMult(self.mat, mat.mat, reuse, rval, &result.mat) ) * return result # <<<<<<<<<<<<<< * * def PtAP(self, Mat P, Mat result=None, fill=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":1330 * return result * * def transposeMatMult(self, Mat mat, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal rval = 2 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.transposeMatMult", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1341 * return result * * def PtAP(self, Mat P, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_311PtAP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_310PtAP[] = "Mat.PtAP(self, Mat P, Mat result=None, fill=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_311PtAP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_P = 0; struct PyPetscMatObject *__pyx_v_result = 0; PyObject *__pyx_v_fill = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("PtAP (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_P,&__pyx_n_s_result,&__pyx_n_s_fill,0}; PyObject* values[3] = {0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_result); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PtAP") < 0)) __PYX_ERR(38, 1341, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_P = ((struct PyPetscMatObject *)values[0]); __pyx_v_result = ((struct PyPetscMatObject *)values[1]); __pyx_v_fill = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("PtAP", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.PtAP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "P", 0))) __PYX_ERR(38, 1341, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(38, 1341, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_310PtAP(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_P, __pyx_v_result, __pyx_v_fill); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310PtAP(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_fill) { MatReuse __pyx_v_reuse; PetscReal __pyx_v_cfill; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscReal __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PtAP", 0); __Pyx_INCREF((PyObject *)__pyx_v_result); /* "PETSc/Mat.pyx":1342 * * def PtAP(self, Mat P, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX # <<<<<<<<<<<<<< * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: */ __pyx_v_reuse = MAT_INITIAL_MATRIX; /* "PETSc/Mat.pyx":1343 * def PtAP(self, Mat P, Mat result=None, fill=None): * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT # <<<<<<<<<<<<<< * if result is None: * result = Mat() */ __pyx_v_cfill = PETSC_DEFAULT; /* "PETSc/Mat.pyx":1344 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_result) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1345 * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: * result = Mat() # <<<<<<<<<<<<<< * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1344 * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT * if result is None: # <<<<<<<<<<<<<< * result = Mat() * elif result.mat != NULL: */ goto __pyx_L3; } /* "PETSc/Mat.pyx":1346 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ __pyx_t_2 = ((__pyx_v_result->mat != NULL) != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1347 * result = Mat() * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX # <<<<<<<<<<<<<< * if fill is not None: cfill = asReal(fill) * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) */ __pyx_v_reuse = MAT_REUSE_MATRIX; /* "PETSc/Mat.pyx":1346 * if result is None: * result = Mat() * elif result.mat != NULL: # <<<<<<<<<<<<<< * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) */ } __pyx_L3:; /* "PETSc/Mat.pyx":1348 * elif result.mat != NULL: * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) # <<<<<<<<<<<<<< * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) * return result */ __pyx_t_2 = (__pyx_v_fill != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1348, __pyx_L1_error) __pyx_v_cfill = __pyx_t_4; } /* "PETSc/Mat.pyx":1349 * reuse = MAT_REUSE_MATRIX * if fill is not None: cfill = asReal(fill) * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) # <<<<<<<<<<<<<< * return result * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPtAP(__pyx_v_self->mat, __pyx_v_P->mat, __pyx_v_reuse, __pyx_v_cfill, (&__pyx_v_result->mat))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(38, 1349, __pyx_L1_error) /* "PETSc/Mat.pyx":1350 * if fill is not None: cfill = asReal(fill) * CHKERR( MatPtAP(self.mat, P.mat, reuse, cfill, &result.mat) ) * return result # <<<<<<<<<<<<<< * * # XXX factorization */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "PETSc/Mat.pyx":1341 * return result * * def PtAP(self, Mat P, Mat result=None, fill=None): # <<<<<<<<<<<<<< * cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX * cdef PetscReal cfill = PETSC_DEFAULT */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.PtAP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1354 * # XXX factorization * * def getOrdering(self, ord_type): # <<<<<<<<<<<<<< * cdef PetscMatOrderingType cval = NULL * ord_type = str2bytes(ord_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_313getOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_312getOrdering[] = "Mat.getOrdering(self, ord_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_313getOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ord_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOrdering (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ord_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ord_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOrdering") < 0)) __PYX_ERR(38, 1354, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ord_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1354, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_312getOrdering(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_ord_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312getOrdering(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ord_type) { MatOrderingType __pyx_v_cval; struct PyPetscISObject *__pyx_v_rp = 0; struct PyPetscISObject *__pyx_v_cp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOrdering", 0); __Pyx_INCREF(__pyx_v_ord_type); /* "PETSc/Mat.pyx":1355 * * def getOrdering(self, ord_type): * cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<< * ord_type = str2bytes(ord_type, &cval) * cdef IS rp = IS(), cp = IS() */ __pyx_v_cval = NULL; /* "PETSc/Mat.pyx":1356 * def getOrdering(self, ord_type): * cdef PetscMatOrderingType cval = NULL * ord_type = str2bytes(ord_type, &cval) # <<<<<<<<<<<<<< * cdef IS rp = IS(), cp = IS() * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ord_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ord_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1357 * cdef PetscMatOrderingType cval = NULL * ord_type = str2bytes(ord_type, &cval) * cdef IS rp = IS(), cp = IS() # <<<<<<<<<<<<<< * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) * return (rp, cp) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rp = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cp = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1358 * ord_type = str2bytes(ord_type, &cval) * cdef IS rp = IS(), cp = IS() * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) # <<<<<<<<<<<<<< * return (rp, cp) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOrdering(__pyx_v_self->mat, __pyx_v_cval, (&__pyx_v_rp->iset), (&__pyx_v_cp->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1358, __pyx_L1_error) /* "PETSc/Mat.pyx":1359 * cdef IS rp = IS(), cp = IS() * CHKERR( MatGetOrdering(self.mat, cval, &rp.iset, &cp.iset) ) * return (rp, cp) # <<<<<<<<<<<<<< * * def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_rp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_rp)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_rp)); __Pyx_INCREF(((PyObject *)__pyx_v_cp)); __Pyx_GIVEREF(((PyObject *)__pyx_v_cp)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_cp)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1354 * # XXX factorization * * def getOrdering(self, ord_type): # <<<<<<<<<<<<<< * cdef PetscMatOrderingType cval = NULL * ord_type = str2bytes(ord_type, &cval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rp); __Pyx_XDECREF((PyObject *)__pyx_v_cp); __Pyx_XDECREF(__pyx_v_ord_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1361 * return (rp, cp) * * def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(atol) * cdef PetscIS rp = isrow.iset, cp = iscol.iset */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_315reorderForNonzeroDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_314reorderForNonzeroDiagonal[] = "Mat.reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_315reorderForNonzeroDiagonal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_atol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reorderForNonzeroDiagonal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_atol,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reorderForNonzeroDiagonal", 0, 2, 3, 1); __PYX_ERR(38, 1361, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reorderForNonzeroDiagonal") < 0)) __PYX_ERR(38, 1361, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_atol = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reorderForNonzeroDiagonal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1361, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.reorderForNonzeroDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1361, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(38, 1361, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_314reorderForNonzeroDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_atol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_314reorderForNonzeroDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_atol) { PetscReal __pyx_v_rval; IS __pyx_v_rp; IS __pyx_v_cp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; IS __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reorderForNonzeroDiagonal", 0); /* "PETSc/Mat.pyx":1362 * * def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): * cdef PetscReal rval = asReal(atol) # <<<<<<<<<<<<<< * cdef PetscIS rp = isrow.iset, cp = iscol.iset * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1362, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/Mat.pyx":1363 * def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): * cdef PetscReal rval = asReal(atol) * cdef PetscIS rp = isrow.iset, cp = iscol.iset # <<<<<<<<<<<<<< * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) * */ __pyx_t_2 = __pyx_v_isrow->iset; __pyx_v_rp = __pyx_t_2; __pyx_t_2 = __pyx_v_iscol->iset; __pyx_v_cp = __pyx_t_2; /* "PETSc/Mat.pyx":1364 * cdef PetscReal rval = asReal(atol) * cdef PetscIS rp = isrow.iset, cp = iscol.iset * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) # <<<<<<<<<<<<<< * * def factorLU(self, IS isrow, IS iscol, options=None): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatReorderForNonzeroDiagonal(__pyx_v_self->mat, __pyx_v_rval, __pyx_v_rp, __pyx_v_cp)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 1364, __pyx_L1_error) /* "PETSc/Mat.pyx":1361 * return (rp, cp) * * def reorderForNonzeroDiagonal(self, IS isrow, IS iscol, atol=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(atol) * cdef PetscIS rp = isrow.iset, cp = iscol.iset */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.reorderForNonzeroDiagonal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1366 * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) * * def factorLU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317factorLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_316factorLU[] = "Mat.factorLU(self, IS isrow, IS iscol, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317factorLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorLU (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("factorLU", 0, 2, 3, 1); __PYX_ERR(38, 1366, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorLU") < 0)) __PYX_ERR(38, 1366, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_options = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorLU", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1366, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1366, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(38, 1366, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_316factorLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_316factorLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorLU", 0); /* "PETSc/Mat.pyx":1368 * def factorLU(self, IS isrow, IS iscol, options=None): * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_FALSE, PETSC_FALSE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1368, __pyx_L1_error) /* "PETSc/Mat.pyx":1369 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) # <<<<<<<<<<<<<< * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None): * self; mat; isrow; iscol; options; # unused */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLUFactor(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1369, __pyx_L1_error) /* "PETSc/Mat.pyx":1366 * CHKERR( MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp) ) * * def factorLU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1370 * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * self; mat; isrow; iscol; options; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319factorSymbolicLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_318factorSymbolicLU[] = "Mat.factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319factorSymbolicLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicLU (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, 1); __PYX_ERR(38, 1370, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, 2); __PYX_ERR(38, 1370, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicLU") < 0)) __PYX_ERR(38, 1370, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_isrow = ((struct PyPetscISObject *)values[1]); __pyx_v_iscol = ((struct PyPetscISObject *)values[2]); __pyx_v_options = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1370, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 1370, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1370, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(38, 1370, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_318factorSymbolicLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_318factorSymbolicLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicLU", 0); /* "PETSc/Mat.pyx":1371 * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None): * self; mat; isrow; iscol; options; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * def factorNumericLU(self, Mat mat, options=None): */ ((void)__pyx_v_self); ((void)__pyx_v_mat); ((void)__pyx_v_isrow); ((void)__pyx_v_iscol); ((void)__pyx_v_options); /* "PETSc/Mat.pyx":1372 * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None): * self; mat; isrow; iscol; options; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * def factorNumericLU(self, Mat mat, options=None): * self; mat; options; # unused */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(38, 1372, __pyx_L1_error) /* "PETSc/Mat.pyx":1370 * matfactorinfo(PETSC_FALSE, PETSC_FALSE, options, &info) * CHKERR( MatLUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicLU(self, Mat mat, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * self; mat; isrow; iscol; options; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1373 * self; mat; isrow; iscol; options; # unused * raise NotImplementedError * def factorNumericLU(self, Mat mat, options=None): # <<<<<<<<<<<<<< * self; mat; options; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321factorNumericLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_320factorNumericLU[] = "Mat.factorNumericLU(self, Mat mat, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321factorNumericLU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorNumericLU (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_options,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorNumericLU") < 0)) __PYX_ERR(38, 1373, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorNumericLU", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1373, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 1373, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_320factorNumericLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_320factorNumericLU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorNumericLU", 0); /* "PETSc/Mat.pyx":1374 * raise NotImplementedError * def factorNumericLU(self, Mat mat, options=None): * self; mat; options; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * def factorILU(self, IS isrow, IS iscol, options=None): */ ((void)__pyx_v_self); ((void)__pyx_v_mat); ((void)__pyx_v_options); /* "PETSc/Mat.pyx":1375 * def factorNumericLU(self, Mat mat, options=None): * self; mat; options; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * def factorILU(self, IS isrow, IS iscol, options=None): * cdef PetscMatFactorInfo info */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(38, 1375, __pyx_L1_error) /* "PETSc/Mat.pyx":1373 * self; mat; isrow; iscol; options; # unused * raise NotImplementedError * def factorNumericLU(self, Mat mat, options=None): # <<<<<<<<<<<<<< * self; mat; options; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericLU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1376 * self; mat; options; # unused * raise NotImplementedError * def factorILU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323factorILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_322factorILU[] = "Mat.factorILU(self, IS isrow, IS iscol, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323factorILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorILU (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("factorILU", 0, 2, 3, 1); __PYX_ERR(38, 1376, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorILU") < 0)) __PYX_ERR(38, 1376, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_options = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorILU", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1376, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1376, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(38, 1376, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_322factorILU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322factorILU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorILU", 0); /* "PETSc/Mat.pyx":1378 * def factorILU(self, IS isrow, IS iscol, options=None): * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicILU(self, IS isrow, IS iscol, options=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_TRUE, PETSC_FALSE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1378, __pyx_L1_error) /* "PETSc/Mat.pyx":1379 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) # <<<<<<<<<<<<<< * def factorSymbolicILU(self, IS isrow, IS iscol, options=None): * self; isrow; iscol; options; # unused */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatILUFactor(__pyx_v_self->mat, __pyx_v_isrow->iset, __pyx_v_iscol->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1379, __pyx_L1_error) /* "PETSc/Mat.pyx":1376 * self; mat; options; # unused * raise NotImplementedError * def factorILU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1380 * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicILU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * self; isrow; iscol; options; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325factorSymbolicILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_324factorSymbolicILU[] = "Mat.factorSymbolicILU(self, IS isrow, IS iscol, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325factorSymbolicILU(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isrow = 0; struct PyPetscISObject *__pyx_v_iscol = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicILU (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isrow,&__pyx_n_s_iscol,&__pyx_n_s_options,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isrow)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iscol)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("factorSymbolicILU", 0, 2, 3, 1); __PYX_ERR(38, 1380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicILU") < 0)) __PYX_ERR(38, 1380, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isrow = ((struct PyPetscISObject *)values[0]); __pyx_v_iscol = ((struct PyPetscISObject *)values[1]); __pyx_v_options = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicILU", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1380, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(38, 1380, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(38, 1380, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_324factorSymbolicILU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324factorSymbolicILU(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isrow, struct PyPetscISObject *__pyx_v_iscol, PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicILU", 0); /* "PETSc/Mat.pyx":1381 * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicILU(self, IS isrow, IS iscol, options=None): * self; isrow; iscol; options; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_isrow); ((void)__pyx_v_iscol); ((void)__pyx_v_options); /* "PETSc/Mat.pyx":1382 * def factorSymbolicILU(self, IS isrow, IS iscol, options=None): * self; isrow; iscol; options; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def factorCholesky(self, IS isperm, options=None): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(38, 1382, __pyx_L1_error) /* "PETSc/Mat.pyx":1380 * matfactorinfo(PETSC_TRUE, PETSC_FALSE, options, &info) * CHKERR( MatILUFactor(self.mat, isrow.iset, iscol.iset, &info) ) * def factorSymbolicILU(self, IS isrow, IS iscol, options=None): # <<<<<<<<<<<<<< * self; isrow; iscol; options; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicILU", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1384 * raise NotImplementedError * * def factorCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327factorCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_326factorCholesky[] = "Mat.factorCholesky(self, IS isperm, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327factorCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isperm = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorCholesky (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorCholesky") < 0)) __PYX_ERR(38, 1384, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorCholesky", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1384, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(38, 1384, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_326factorCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326factorCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorCholesky", 0); /* "PETSc/Mat.pyx":1386 * def factorCholesky(self, IS isperm, options=None): * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicCholesky(self, IS isperm, options=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_FALSE, PETSC_TRUE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1386, __pyx_L1_error) /* "PETSc/Mat.pyx":1387 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) # <<<<<<<<<<<<<< * def factorSymbolicCholesky(self, IS isperm, options=None): * self; isperm; options; # unused */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCholeskyFactor(__pyx_v_self->mat, __pyx_v_isperm->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1387, __pyx_L1_error) /* "PETSc/Mat.pyx":1384 * raise NotImplementedError * * def factorCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1388 * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<< * self; isperm; options; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_329factorSymbolicCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_328factorSymbolicCholesky[] = "Mat.factorSymbolicCholesky(self, IS isperm, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_329factorSymbolicCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isperm = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicCholesky (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicCholesky") < 0)) __PYX_ERR(38, 1388, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicCholesky", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1388, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(38, 1388, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_328factorSymbolicCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328factorSymbolicCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicCholesky", 0); /* "PETSc/Mat.pyx":1389 * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicCholesky(self, IS isperm, options=None): * self; isperm; options; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * def factorNumericCholesky(self, Mat mat, options=None): */ ((void)__pyx_v_self); ((void)__pyx_v_isperm); ((void)__pyx_v_options); /* "PETSc/Mat.pyx":1390 * def factorSymbolicCholesky(self, IS isperm, options=None): * self; isperm; options; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * def factorNumericCholesky(self, Mat mat, options=None): * self; mat; options; # unused */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(38, 1390, __pyx_L1_error) /* "PETSc/Mat.pyx":1388 * matfactorinfo(PETSC_FALSE, PETSC_TRUE, options, &info) * CHKERR( MatCholeskyFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicCholesky(self, IS isperm, options=None): # <<<<<<<<<<<<<< * self; isperm; options; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1391 * self; isperm; options; # unused * raise NotImplementedError * def factorNumericCholesky(self, Mat mat, options=None): # <<<<<<<<<<<<<< * self; mat; options; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_331factorNumericCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_330factorNumericCholesky[] = "Mat.factorNumericCholesky(self, Mat mat, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_331factorNumericCholesky(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorNumericCholesky (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,&__pyx_n_s_options,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorNumericCholesky") < 0)) __PYX_ERR(38, 1391, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorNumericCholesky", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1391, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 1391, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_330factorNumericCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330factorNumericCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorNumericCholesky", 0); /* "PETSc/Mat.pyx":1392 * raise NotImplementedError * def factorNumericCholesky(self, Mat mat, options=None): * self; mat; options; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * def factorICC(self, IS isperm, options=None): */ ((void)__pyx_v_self); ((void)__pyx_v_mat); ((void)__pyx_v_options); /* "PETSc/Mat.pyx":1393 * def factorNumericCholesky(self, Mat mat, options=None): * self; mat; options; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * def factorICC(self, IS isperm, options=None): * cdef PetscMatFactorInfo info */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(38, 1393, __pyx_L1_error) /* "PETSc/Mat.pyx":1391 * self; isperm; options; # unused * raise NotImplementedError * def factorNumericCholesky(self, Mat mat, options=None): # <<<<<<<<<<<<<< * self; mat; options; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorNumericCholesky", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1394 * self; mat; options; # unused * raise NotImplementedError * def factorICC(self, IS isperm, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_333factorICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_332factorICC[] = "Mat.factorICC(self, IS isperm, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_333factorICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isperm = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorICC (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorICC") < 0)) __PYX_ERR(38, 1394, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorICC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1394, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(38, 1394, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_332factorICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_332factorICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options) { MatFactorInfo __pyx_v_info; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorICC", 0); /* "PETSc/Mat.pyx":1396 * def factorICC(self, IS isperm, options=None): * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) # <<<<<<<<<<<<<< * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicICC(self, IS isperm, options=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matfactorinfo(PETSC_TRUE, PETSC_TRUE, __pyx_v_options, (&__pyx_v_info)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1396, __pyx_L1_error) /* "PETSc/Mat.pyx":1397 * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) # <<<<<<<<<<<<<< * def factorSymbolicICC(self, IS isperm, options=None): * self; isperm; options; # unused */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatICCFactor(__pyx_v_self->mat, __pyx_v_isperm->iset, (&__pyx_v_info))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1397, __pyx_L1_error) /* "PETSc/Mat.pyx":1394 * self; mat; options; # unused * raise NotImplementedError * def factorICC(self, IS isperm, options=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorInfo info * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1398 * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicICC(self, IS isperm, options=None): # <<<<<<<<<<<<<< * self; isperm; options; # unused * raise NotImplementedError */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_335factorSymbolicICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_334factorSymbolicICC[] = "Mat.factorSymbolicICC(self, IS isperm, options=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_335factorSymbolicICC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_isperm = 0; PyObject *__pyx_v_options = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("factorSymbolicICC (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isperm,&__pyx_n_s_options,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isperm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "factorSymbolicICC") < 0)) __PYX_ERR(38, 1398, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_isperm = ((struct PyPetscISObject *)values[0]); __pyx_v_options = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("factorSymbolicICC", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1398, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isperm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(38, 1398, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_334factorSymbolicICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_334factorSymbolicICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("factorSymbolicICC", 0); /* "PETSc/Mat.pyx":1399 * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicICC(self, IS isperm, options=None): * self; isperm; options; # unused # <<<<<<<<<<<<<< * raise NotImplementedError * */ ((void)__pyx_v_self); ((void)__pyx_v_isperm); ((void)__pyx_v_options); /* "PETSc/Mat.pyx":1400 * def factorSymbolicICC(self, IS isperm, options=None): * self; isperm; options; # unused * raise NotImplementedError # <<<<<<<<<<<<<< * * def getInertia(self): */ __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); __PYX_ERR(38, 1400, __pyx_L1_error) /* "PETSc/Mat.pyx":1398 * matfactorinfo(PETSC_TRUE, PETSC_TRUE, options, &info) * CHKERR( MatICCFactor(self.mat, isperm.iset, &info) ) * def factorSymbolicICC(self, IS isperm, options=None): # <<<<<<<<<<<<<< * self; isperm; options; # unused * raise NotImplementedError */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.factorSymbolicICC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1402 * raise NotImplementedError * * def getInertia(self): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_337getInertia(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_336getInertia[] = "Mat.getInertia(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_337getInertia(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInertia (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInertia", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInertia", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_336getInertia(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_336getInertia(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PetscInt __pyx_v_ival3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInertia", 0); /* "PETSc/Mat.pyx":1403 * * def getInertia(self): * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 # <<<<<<<<<<<<<< * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) * return (toInt(ival1), toInt(ival2), toInt(ival3)) */ __pyx_v_ival1 = 0; __pyx_v_ival2 = 0; __pyx_v_ival3 = 0; /* "PETSc/Mat.pyx":1404 * def getInertia(self): * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) # <<<<<<<<<<<<<< * return (toInt(ival1), toInt(ival2), toInt(ival3)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetInertia(__pyx_v_self->mat, (&__pyx_v_ival1), (&__pyx_v_ival2), (&__pyx_v_ival3))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1404, __pyx_L1_error) /* "PETSc/Mat.pyx":1405 * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) * return (toInt(ival1), toInt(ival2), toInt(ival3)) # <<<<<<<<<<<<<< * * def setUnfactored(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival3); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1402 * raise NotImplementedError * * def getInertia(self): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = 0, ival2 = 0, ival3 = 0 * CHKERR( MatGetInertia(self.mat, &ival1, &ival2, &ival3) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getInertia", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1407 * return (toInt(ival1), toInt(ival2), toInt(ival3)) * * def setUnfactored(self): # <<<<<<<<<<<<<< * CHKERR( MatSetUnfactored(self.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_339setUnfactored(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_338setUnfactored[] = "Mat.setUnfactored(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_339setUnfactored(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUnfactored (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUnfactored", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUnfactored", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_338setUnfactored(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_338setUnfactored(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUnfactored", 0); /* "PETSc/Mat.pyx":1408 * * def setUnfactored(self): * CHKERR( MatSetUnfactored(self.mat) ) # <<<<<<<<<<<<<< * * # IS */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetUnfactored(__pyx_v_self->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1408, __pyx_L1_error) /* "PETSc/Mat.pyx":1407 * return (toInt(ival1), toInt(ival2), toInt(ival3)) * * def setUnfactored(self): # <<<<<<<<<<<<<< * CHKERR( MatSetUnfactored(self.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setUnfactored", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1412 * # IS * * def fixISLocalEmpty(self, fix): # <<<<<<<<<<<<<< * cdef PetscBool cfix = asBool(fix) * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341fixISLocalEmpty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_340fixISLocalEmpty[] = "Mat.fixISLocalEmpty(self, fix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341fixISLocalEmpty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("fixISLocalEmpty (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fixISLocalEmpty") < 0)) __PYX_ERR(38, 1412, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("fixISLocalEmpty", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1412, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.fixISLocalEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_340fixISLocalEmpty(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_fix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_340fixISLocalEmpty(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_fix) { PetscBool __pyx_v_cfix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fixISLocalEmpty", 0); /* "PETSc/Mat.pyx":1413 * * def fixISLocalEmpty(self, fix): * cdef PetscBool cfix = asBool(fix) # <<<<<<<<<<<<<< * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_fix); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(38, 1413, __pyx_L1_error) __pyx_v_cfix = __pyx_t_1; /* "PETSc/Mat.pyx":1414 * def fixISLocalEmpty(self, fix): * cdef PetscBool cfix = asBool(fix) * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) # <<<<<<<<<<<<<< * * def getISLocalMat(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISFixLocalEmpty(__pyx_v_self->mat, __pyx_v_cfix)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1414, __pyx_L1_error) /* "PETSc/Mat.pyx":1412 * # IS * * def fixISLocalEmpty(self, fix): # <<<<<<<<<<<<<< * cdef PetscBool cfix = asBool(fix) * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.fixISLocalEmpty", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1416 * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) * * def getISLocalMat(self): # <<<<<<<<<<<<<< * cdef Mat local = Mat() * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_343getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_342getISLocalMat[] = "Mat.getISLocalMat(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_343getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getISLocalMat (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getISLocalMat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getISLocalMat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_342getISLocalMat(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_342getISLocalMat(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_local = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getISLocalMat", 0); /* "PETSc/Mat.pyx":1417 * * def getISLocalMat(self): * cdef Mat local = Mat() # <<<<<<<<<<<<<< * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) * PetscINCREF(local.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_local = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1418 * def getISLocalMat(self): * cdef Mat local = Mat() * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(local.obj) * return local */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISGetLocalMat(__pyx_v_self->mat, (&__pyx_v_local->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1418, __pyx_L1_error) /* "PETSc/Mat.pyx":1419 * cdef Mat local = Mat() * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) * PetscINCREF(local.obj) # <<<<<<<<<<<<<< * return local * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_local->__pyx_base.obj)); /* "PETSc/Mat.pyx":1420 * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) * PetscINCREF(local.obj) * return local # <<<<<<<<<<<<<< * * def restoreISLocalMat(self, Mat local not None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_local)); __pyx_r = ((PyObject *)__pyx_v_local); goto __pyx_L0; /* "PETSc/Mat.pyx":1416 * CHKERR( MatISFixLocalEmpty(self.mat, cfix) ) * * def getISLocalMat(self): # <<<<<<<<<<<<<< * cdef Mat local = Mat() * CHKERR( MatISGetLocalMat(self.mat, &local.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_local); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1422 * return local * * def restoreISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<< * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_345restoreISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_344restoreISLocalMat[] = "Mat.restoreISLocalMat(self, Mat local)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_345restoreISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_local = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreISLocalMat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_local,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreISLocalMat") < 0)) __PYX_ERR(38, 1422, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_local = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreISLocalMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1422, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_local), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(38, 1422, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_344restoreISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_344restoreISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreISLocalMat", 0); /* "PETSc/Mat.pyx":1423 * * def restoreISLocalMat(self, Mat local not None): * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) # <<<<<<<<<<<<<< * * def setISLocalMat(self, Mat local not None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISRestoreLocalMat(__pyx_v_self->mat, (&__pyx_v_local->mat))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1423, __pyx_L1_error) /* "PETSc/Mat.pyx":1422 * return local * * def restoreISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<< * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1425 * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) * * def setISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<< * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_347setISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_346setISLocalMat[] = "Mat.setISLocalMat(self, Mat local)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_347setISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_local = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setISLocalMat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_local,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setISLocalMat") < 0)) __PYX_ERR(38, 1425, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_local = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setISLocalMat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1425, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_local), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(38, 1425, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_346setISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_346setISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setISLocalMat", 0); /* "PETSc/Mat.pyx":1426 * * def setISLocalMat(self, Mat local not None): * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) # <<<<<<<<<<<<<< * * def setISPreallocation(self, nnz, onnz): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISSetLocalMat(__pyx_v_self->mat, __pyx_v_local->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1426, __pyx_L1_error) /* "PETSc/Mat.pyx":1425 * CHKERR( MatISRestoreLocalMat(self.mat, &local.mat) ) * * def setISLocalMat(self, Mat local not None): # <<<<<<<<<<<<<< * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1428 * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) * * def setISPreallocation(self, nnz, onnz): # <<<<<<<<<<<<<< * cdef PetscInt *cnnz = NULL * cdef PetscInt *connz = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349setISPreallocation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_348setISPreallocation[] = "Mat.setISPreallocation(self, nnz, onnz)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349setISPreallocation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nnz = 0; PyObject *__pyx_v_onnz = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setISPreallocation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nnz,&__pyx_n_s_onnz,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_onnz)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setISPreallocation", 1, 2, 2, 1); __PYX_ERR(38, 1428, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setISPreallocation") < 0)) __PYX_ERR(38, 1428, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_nnz = values[0]; __pyx_v_onnz = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setISPreallocation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1428, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISPreallocation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_348setISPreallocation(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz, __pyx_v_onnz); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_348setISPreallocation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz, PyObject *__pyx_v_onnz) { PetscInt *__pyx_v_cnnz; PetscInt *__pyx_v_connz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setISPreallocation", 0); __Pyx_INCREF(__pyx_v_nnz); __Pyx_INCREF(__pyx_v_onnz); /* "PETSc/Mat.pyx":1429 * * def setISPreallocation(self, nnz, onnz): * cdef PetscInt *cnnz = NULL # <<<<<<<<<<<<<< * cdef PetscInt *connz = NULL * nnz = iarray_i(nnz, NULL, &cnnz) */ __pyx_v_cnnz = NULL; /* "PETSc/Mat.pyx":1430 * def setISPreallocation(self, nnz, onnz): * cdef PetscInt *cnnz = NULL * cdef PetscInt *connz = NULL # <<<<<<<<<<<<<< * nnz = iarray_i(nnz, NULL, &cnnz) * onnz = iarray_i(onnz, NULL, &connz) */ __pyx_v_connz = NULL; /* "PETSc/Mat.pyx":1431 * cdef PetscInt *cnnz = NULL * cdef PetscInt *connz = NULL * nnz = iarray_i(nnz, NULL, &cnnz) # <<<<<<<<<<<<<< * onnz = iarray_i(onnz, NULL, &connz) * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_nnz, NULL, (&__pyx_v_cnnz))); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_nnz, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1432 * cdef PetscInt *connz = NULL * nnz = iarray_i(nnz, NULL, &cnnz) * onnz = iarray_i(onnz, NULL, &connz) # <<<<<<<<<<<<<< * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) * return self */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_onnz, NULL, (&__pyx_v_connz))); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_onnz, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1433 * nnz = iarray_i(nnz, NULL, &cnnz) * onnz = iarray_i(onnz, NULL, &connz) * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISSetPreallocation(__pyx_v_self->mat, 0, __pyx_v_cnnz, 0, __pyx_v_connz)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1433, __pyx_L1_error) /* "PETSc/Mat.pyx":1434 * onnz = iarray_i(onnz, NULL, &connz) * CHKERR( MatISSetPreallocation(self.mat, 0, cnnz, 0, connz) ) * return self # <<<<<<<<<<<<<< * * # LRC */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":1428 * CHKERR( MatISSetLocalMat(self.mat, local.mat) ) * * def setISPreallocation(self, nnz, onnz): # <<<<<<<<<<<<<< * cdef PetscInt *cnnz = NULL * cdef PetscInt *connz = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISPreallocation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_nnz); __Pyx_XDECREF(__pyx_v_onnz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1438 * # LRC * * def getLRCMats(self): # <<<<<<<<<<<<<< * cdef Mat A = Mat() * cdef Mat U = Mat() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351getLRCMats(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_350getLRCMats[] = "Mat.getLRCMats(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351getLRCMats(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLRCMats (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLRCMats", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLRCMats", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_350getLRCMats(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_350getLRCMats(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_U = 0; struct PyPetscVecObject *__pyx_v_c = 0; struct PyPetscMatObject *__pyx_v_V = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLRCMats", 0); /* "PETSc/Mat.pyx":1439 * * def getLRCMats(self): * cdef Mat A = Mat() # <<<<<<<<<<<<<< * cdef Mat U = Mat() * cdef Vec c = Vec() */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1440 * def getLRCMats(self): * cdef Mat A = Mat() * cdef Mat U = Mat() # <<<<<<<<<<<<<< * cdef Vec c = Vec() * cdef Mat V = Mat() */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_U = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1441 * cdef Mat A = Mat() * cdef Mat U = Mat() * cdef Vec c = Vec() # <<<<<<<<<<<<<< * cdef Mat V = Mat() * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1442 * cdef Mat U = Mat() * cdef Vec c = Vec() * cdef Mat V = Mat() # <<<<<<<<<<<<<< * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) * PetscINCREF(A.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_V = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1443 * cdef Vec c = Vec() * cdef Mat V = Mat() * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(A.obj) * PetscINCREF(U.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLRCGetMats(__pyx_v_self->mat, (&__pyx_v_A->mat), (&__pyx_v_U->mat), (&__pyx_v_c->vec), (&__pyx_v_V->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1443, __pyx_L1_error) /* "PETSc/Mat.pyx":1444 * cdef Mat V = Mat() * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) * PetscINCREF(A.obj) # <<<<<<<<<<<<<< * PetscINCREF(U.obj) * PetscINCREF(c.obj) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); /* "PETSc/Mat.pyx":1445 * CHKERR( MatLRCGetMats(self.mat, &A.mat, &U.mat, &c.vec, &V.mat) ) * PetscINCREF(A.obj) * PetscINCREF(U.obj) # <<<<<<<<<<<<<< * PetscINCREF(c.obj) * PetscINCREF(V.obj) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_U->__pyx_base.obj)); /* "PETSc/Mat.pyx":1446 * PetscINCREF(A.obj) * PetscINCREF(U.obj) * PetscINCREF(c.obj) # <<<<<<<<<<<<<< * PetscINCREF(V.obj) * return (A, U, c, V) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); /* "PETSc/Mat.pyx":1447 * PetscINCREF(U.obj) * PetscINCREF(c.obj) * PetscINCREF(V.obj) # <<<<<<<<<<<<<< * return (A, U, c, V) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_V->__pyx_base.obj)); /* "PETSc/Mat.pyx":1448 * PetscINCREF(c.obj) * PetscINCREF(V.obj) * return (A, U, c, V) # <<<<<<<<<<<<<< * * # MUMPS */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_A)); __Pyx_GIVEREF(((PyObject *)__pyx_v_A)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A)); __Pyx_INCREF(((PyObject *)__pyx_v_U)); __Pyx_GIVEREF(((PyObject *)__pyx_v_U)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_U)); __Pyx_INCREF(((PyObject *)__pyx_v_c)); __Pyx_GIVEREF(((PyObject *)__pyx_v_c)); PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_c)); __Pyx_INCREF(((PyObject *)__pyx_v_V)); __Pyx_GIVEREF(((PyObject *)__pyx_v_V)); PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_V)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1438 * # LRC * * def getLRCMats(self): # <<<<<<<<<<<<<< * cdef Mat A = Mat() * cdef Mat U = Mat() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLRCMats", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_U); __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XDECREF((PyObject *)__pyx_v_V); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1452 * # MUMPS * * def setMumpsIcntl(self, icntl, ival): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt _ival = asInt(ival) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353setMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_352setMumpsIcntl[] = "Mat.setMumpsIcntl(self, icntl, ival)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353setMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; PyObject *__pyx_v_ival = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMumpsIcntl (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,&__pyx_n_s_ival,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ival)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMumpsIcntl", 1, 2, 2, 1); __PYX_ERR(38, 1452, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMumpsIcntl") < 0)) __PYX_ERR(38, 1452, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_icntl = values[0]; __pyx_v_ival = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMumpsIcntl", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1452, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_352setMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_ival); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352setMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_ival) { PetscInt __pyx_v__icntl; PetscInt __pyx_v__ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMumpsIcntl", 0); /* "PETSc/Mat.pyx":1453 * * def setMumpsIcntl(self, icntl, ival): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt _ival = asInt(ival) * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1453, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1454 * def setMumpsIcntl(self, icntl, ival): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt _ival = asInt(ival) # <<<<<<<<<<<<<< * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_ival); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1454, __pyx_L1_error) __pyx_v__ival = __pyx_t_1; /* "PETSc/Mat.pyx":1455 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt _ival = asInt(ival) * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); # <<<<<<<<<<<<<< * * def getMumpsIcntl(self, icntl): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsSetIcntl(__pyx_v_self->mat, __pyx_v__icntl, __pyx_v__ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1455, __pyx_L1_error) /* "PETSc/Mat.pyx":1452 * # MUMPS * * def setMumpsIcntl(self, icntl, ival): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt _ival = asInt(ival) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1457 * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); * * def getMumpsIcntl(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_355getMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_354getMumpsIcntl[] = "Mat.getMumpsIcntl(self, icntl)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_355getMumpsIcntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsIcntl (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsIcntl") < 0)) __PYX_ERR(38, 1457, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsIcntl", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1457, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_354getMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354getMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsIcntl", 0); /* "PETSc/Mat.pyx":1458 * * def getMumpsIcntl(self, icntl): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1458, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1459 * def getMumpsIcntl(self, icntl): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/Mat.pyx":1460 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetIcntl(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_ival))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1460, __pyx_L1_error) /* "PETSc/Mat.pyx":1461 * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetIcntl(self.mat, _icntl, &ival) ); * return toInt(ival) # <<<<<<<<<<<<<< * * def setMumpsCntl(self, icntl, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1457 * CHKERR( MatMumpsSetIcntl(self.mat, _icntl, _ival) ); * * def getMumpsIcntl(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsIcntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1463 * return toInt(ival) * * def setMumpsCntl(self, icntl, val): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal _val = asReal(val) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357setMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_356setMumpsCntl[] = "Mat.setMumpsCntl(self, icntl, val)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357setMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; PyObject *__pyx_v_val = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMumpsCntl (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,&__pyx_n_s_val,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMumpsCntl", 1, 2, 2, 1); __PYX_ERR(38, 1463, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMumpsCntl") < 0)) __PYX_ERR(38, 1463, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_icntl = values[0]; __pyx_v_val = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMumpsCntl", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1463, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_356setMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_val); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_356setMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_val) { PetscInt __pyx_v__icntl; PetscReal __pyx_v__val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMumpsCntl", 0); /* "PETSc/Mat.pyx":1464 * * def setMumpsCntl(self, icntl, val): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal _val = asReal(val) * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1464, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1465 * def setMumpsCntl(self, icntl, val): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal _val = asReal(val) # <<<<<<<<<<<<<< * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_val); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(38, 1465, __pyx_L1_error) __pyx_v__val = __pyx_t_2; /* "PETSc/Mat.pyx":1466 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal _val = asReal(val) * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); # <<<<<<<<<<<<<< * * def getMumpsCntl(self, icntl): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsSetCntl(__pyx_v_self->mat, __pyx_v__icntl, __pyx_v__val)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 1466, __pyx_L1_error) /* "PETSc/Mat.pyx":1463 * return toInt(ival) * * def setMumpsCntl(self, icntl, val): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal _val = asReal(val) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1468 * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); * * def getMumpsCntl(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359getMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_358getMumpsCntl[] = "Mat.getMumpsCntl(self, icntl)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359getMumpsCntl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsCntl (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsCntl") < 0)) __PYX_ERR(38, 1468, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsCntl", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1468, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_358getMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_358getMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscReal __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsCntl", 0); /* "PETSc/Mat.pyx":1469 * * def getMumpsCntl(self, icntl): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal val = 0 * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1469, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1470 * def getMumpsCntl(self, icntl): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); * return toReal(val) */ __pyx_v_val = 0.0; /* "PETSc/Mat.pyx":1471 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); # <<<<<<<<<<<<<< * return toReal(val) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetCntl(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_val))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1471, __pyx_L1_error) /* "PETSc/Mat.pyx":1472 * cdef PetscReal val = 0 * CHKERR( MatMumpsGetCntl(self.mat, _icntl, &val) ); * return toReal(val) # <<<<<<<<<<<<<< * * def getMumpsInfo(self, icntl): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1468 * CHKERR( MatMumpsSetCntl(self.mat, _icntl, _val) ); * * def getMumpsCntl(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsCntl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1474 * return toReal(val) * * def getMumpsInfo(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_361getMumpsInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_360getMumpsInfo[] = "Mat.getMumpsInfo(self, icntl)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_361getMumpsInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsInfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsInfo") < 0)) __PYX_ERR(38, 1474, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsInfo", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1474, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_360getMumpsInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360getMumpsInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsInfo", 0); /* "PETSc/Mat.pyx":1475 * * def getMumpsInfo(self, icntl): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1475, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1476 * def getMumpsInfo(self, icntl): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/Mat.pyx":1477 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetInfo(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_ival))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1477, __pyx_L1_error) /* "PETSc/Mat.pyx":1478 * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfo(self.mat, _icntl, &ival) ); * return toInt(ival) # <<<<<<<<<<<<<< * * def getMumpsInfog(self, icntl): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1474 * return toReal(val) * * def getMumpsInfo(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1480 * return toInt(ival) * * def getMumpsInfog(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363getMumpsInfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_362getMumpsInfog[] = "Mat.getMumpsInfog(self, icntl)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363getMumpsInfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsInfog (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsInfog") < 0)) __PYX_ERR(38, 1480, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsInfog", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1480, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_362getMumpsInfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362getMumpsInfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsInfog", 0); /* "PETSc/Mat.pyx":1481 * * def getMumpsInfog(self, icntl): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1481, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1482 * def getMumpsInfog(self, icntl): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/Mat.pyx":1483 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetInfog(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_ival))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1483, __pyx_L1_error) /* "PETSc/Mat.pyx":1484 * cdef PetscInt ival = 0 * CHKERR( MatMumpsGetInfog(self.mat, _icntl, &ival) ); * return toInt(ival) # <<<<<<<<<<<<<< * * def getMumpsRinfo(self, icntl): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1480 * return toInt(ival) * * def getMumpsInfog(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscInt ival = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsInfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1486 * return toInt(ival) * * def getMumpsRinfo(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_365getMumpsRinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_364getMumpsRinfo[] = "Mat.getMumpsRinfo(self, icntl)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_365getMumpsRinfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsRinfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsRinfo") < 0)) __PYX_ERR(38, 1486, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsRinfo", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1486, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_364getMumpsRinfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_364getMumpsRinfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscReal __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsRinfo", 0); /* "PETSc/Mat.pyx":1487 * * def getMumpsRinfo(self, icntl): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1487, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1488 * def getMumpsRinfo(self, icntl): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); * return toReal(val) */ __pyx_v_val = 0.0; /* "PETSc/Mat.pyx":1489 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); # <<<<<<<<<<<<<< * return toReal(val) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetRinfo(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_val))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1489, __pyx_L1_error) /* "PETSc/Mat.pyx":1490 * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfo(self.mat, _icntl, &val) ); * return toReal(val) # <<<<<<<<<<<<<< * * def getMumpsRinfog(self, icntl): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1486 * return toInt(ival) * * def getMumpsRinfo(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1492 * return toReal(val) * * def getMumpsRinfog(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_367getMumpsRinfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_366getMumpsRinfog[] = "Mat.getMumpsRinfog(self, icntl)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_367getMumpsRinfog(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_icntl = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMumpsRinfog (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_icntl,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icntl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMumpsRinfog") < 0)) __PYX_ERR(38, 1492, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_icntl = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMumpsRinfog", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1492, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_366getMumpsRinfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_366getMumpsRinfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl) { PetscInt __pyx_v__icntl; PetscReal __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMumpsRinfog", 0); /* "PETSc/Mat.pyx":1493 * * def getMumpsRinfog(self, icntl): * cdef PetscInt _icntl = asInt(icntl) # <<<<<<<<<<<<<< * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_icntl); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1493, __pyx_L1_error) __pyx_v__icntl = __pyx_t_1; /* "PETSc/Mat.pyx":1494 * def getMumpsRinfog(self, icntl): * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 # <<<<<<<<<<<<<< * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); * return toReal(val) */ __pyx_v_val = 0.0; /* "PETSc/Mat.pyx":1495 * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); # <<<<<<<<<<<<<< * return toReal(val) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMumpsGetRinfog(__pyx_v_self->mat, __pyx_v__icntl, (&__pyx_v_val))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(38, 1495, __pyx_L1_error) /* "PETSc/Mat.pyx":1496 * cdef PetscReal val = 0 * CHKERR( MatMumpsGetRinfog(self.mat, _icntl, &val) ); * return toReal(val) # <<<<<<<<<<<<<< * * # solve */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1492 * return toReal(val) * * def getMumpsRinfog(self, icntl): # <<<<<<<<<<<<<< * cdef PetscInt _icntl = asInt(icntl) * cdef PetscReal val = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getMumpsRinfog", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1500 * # solve * * def solveForward(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369solveForward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_368solveForward[] = "Mat.solveForward(self, Vec b, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369solveForward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveForward (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveForward", 1, 2, 2, 1); __PYX_ERR(38, 1500, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveForward") < 0)) __PYX_ERR(38, 1500, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveForward", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1500, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveForward", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(38, 1500, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1500, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_368solveForward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368solveForward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveForward", 0); /* "PETSc/Mat.pyx":1501 * * def solveForward(self, Vec b, Vec x): * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveBackward(self, Vec b, Vec x): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatForwardSolve(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1501, __pyx_L1_error) /* "PETSc/Mat.pyx":1500 * # solve * * def solveForward(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveForward", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1503 * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) * * def solveBackward(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371solveBackward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_370solveBackward[] = "Mat.solveBackward(self, Vec b, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371solveBackward(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveBackward (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveBackward", 1, 2, 2, 1); __PYX_ERR(38, 1503, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveBackward") < 0)) __PYX_ERR(38, 1503, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveBackward", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1503, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveBackward", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(38, 1503, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1503, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_370solveBackward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_370solveBackward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveBackward", 0); /* "PETSc/Mat.pyx":1504 * * def solveBackward(self, Vec b, Vec x): * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solve(self, Vec b, Vec x): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatBackwardSolve(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1504, __pyx_L1_error) /* "PETSc/Mat.pyx":1503 * CHKERR( MatForwardSolve(self.mat, b.vec, x.vec) ) * * def solveBackward(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveBackward", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1506 * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) * * def solve(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolve(self.mat, b.vec, x.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_372solve[] = "Mat.solve(self, Vec b, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, 1); __PYX_ERR(38, 1506, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(38, 1506, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1506, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(38, 1506, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1506, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_372solve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_372solve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 0); /* "PETSc/Mat.pyx":1507 * * def solve(self, Vec b, Vec x): * CHKERR( MatSolve(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveTranspose(self, Vec b, Vec x): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolve(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1507, __pyx_L1_error) /* "PETSc/Mat.pyx":1506 * CHKERR( MatBackwardSolve(self.mat, b.vec, x.vec) ) * * def solve(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolve(self.mat, b.vec, x.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1509 * CHKERR( MatSolve(self.mat, b.vec, x.vec) ) * * def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_374solveTranspose[] = "Mat.solveTranspose(self, Vec b, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveTranspose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, 1); __PYX_ERR(38, 1509, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveTranspose") < 0)) __PYX_ERR(38, 1509, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1509, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(38, 1509, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1509, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_374solveTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_374solveTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveTranspose", 0); /* "PETSc/Mat.pyx":1510 * * def solveTranspose(self, Vec b, Vec x): * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveAdd(self, Vec b, Vec y, Vec x): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveTranspose(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1510, __pyx_L1_error) /* "PETSc/Mat.pyx":1509 * CHKERR( MatSolve(self.mat, b.vec, x.vec) ) * * def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1512 * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) * * def solveAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377solveAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_376solveAdd[] = "Mat.solveAdd(self, Vec b, Vec y, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377solveAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_y = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveAdd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_y,&__pyx_n_s_x,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, 1); __PYX_ERR(38, 1512, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, 2); __PYX_ERR(38, 1512, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveAdd") < 0)) __PYX_ERR(38, 1512, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); __pyx_v_x = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1512, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(38, 1512, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1512, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1512, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_376solveAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_y, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_376solveAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveAdd", 0); /* "PETSc/Mat.pyx":1513 * * def solveAdd(self, Vec b, Vec y, Vec x): * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) # <<<<<<<<<<<<<< * * def solveTransposeAdd(self, Vec b, Vec y, Vec x): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveAdd(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_y->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1513, __pyx_L1_error) /* "PETSc/Mat.pyx":1512 * CHKERR( MatSolveTranspose(self.mat, b.vec, x.vec) ) * * def solveAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1515 * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) * * def solveTransposeAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379solveTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_378solveTransposeAdd[] = "Mat.solveTransposeAdd(self, Vec b, Vec y, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379solveTransposeAdd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_y = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveTransposeAdd (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_y,&__pyx_n_s_x,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, 1); __PYX_ERR(38, 1515, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, 2); __PYX_ERR(38, 1515, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveTransposeAdd") < 0)) __PYX_ERR(38, 1515, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); __pyx_v_x = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1515, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(38, 1515, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(38, 1515, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(38, 1515, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_378solveTransposeAdd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_y, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_378solveTransposeAdd(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_y, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveTransposeAdd", 0); /* "PETSc/Mat.pyx":1516 * * def solveTransposeAdd(self, Vec b, Vec y, Vec x): * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) # <<<<<<<<<<<<<< * * def matSolve(self, Mat B, Mat X): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSolveTransposeAdd(__pyx_v_self->mat, __pyx_v_b->vec, __pyx_v_y->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1516, __pyx_L1_error) /* "PETSc/Mat.pyx":1515 * CHKERR( MatSolveAdd(self.mat, b.vec, y.vec, x.vec) ) * * def solveTransposeAdd(self, Vec b, Vec y, Vec x): # <<<<<<<<<<<<<< * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.solveTransposeAdd", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1518 * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) * * def matSolve(self, Mat B, Mat X): # <<<<<<<<<<<<<< * CHKERR( MatMatSolve(self.mat, B.mat, X.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381matSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_380matSolve[] = "Mat.matSolve(self, Mat B, Mat X)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381matSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_B = 0; struct PyPetscMatObject *__pyx_v_X = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("matSolve (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_B,&__pyx_n_s_X,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, 1); __PYX_ERR(38, 1518, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "matSolve") < 0)) __PYX_ERR(38, 1518, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_B = ((struct PyPetscMatObject *)values[0]); __pyx_v_X = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1518, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(38, 1518, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(38, 1518, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_380matSolve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_380matSolve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matSolve", 0); /* "PETSc/Mat.pyx":1519 * * def matSolve(self, Mat B, Mat X): * CHKERR( MatMatSolve(self.mat, B.mat, X.mat) ) # <<<<<<<<<<<<<< * * # dense matrices */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatMatSolve(__pyx_v_self->mat, __pyx_v_B->mat, __pyx_v_X->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1519, __pyx_L1_error) /* "PETSc/Mat.pyx":1518 * CHKERR( MatSolveTransposeAdd(self.mat, b.vec, y.vec, x.vec) ) * * def matSolve(self, Mat B, Mat X): # <<<<<<<<<<<<<< * CHKERR( MatMatSolve(self.mat, B.mat, X.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.matSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1523 * # dense matrices * * def getDenseArray(self): # <<<<<<<<<<<<<< * cdef PetscInt m=0, N=0, lda=0 * cdef PetscScalar *data = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383getDenseArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_382getDenseArray[] = "Mat.getDenseArray(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383getDenseArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDenseArray (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDenseArray", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDenseArray", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_382getDenseArray(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_382getDenseArray(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_m; PetscInt __pyx_v_N; PetscInt __pyx_v_lda; PetscScalar *__pyx_v_data; int __pyx_v_typenum; int __pyx_v_itemsize; int __pyx_v_flags; npy_intp __pyx_v_dims[2]; npy_intp __pyx_v_strides[2]; PyObject *__pyx_v_array = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDenseArray", 0); /* "PETSc/Mat.pyx":1524 * * def getDenseArray(self): * cdef PetscInt m=0, N=0, lda=0 # <<<<<<<<<<<<<< * cdef PetscScalar *data = NULL * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) */ __pyx_v_m = 0; __pyx_v_N = 0; __pyx_v_lda = 0; /* "PETSc/Mat.pyx":1525 * def getDenseArray(self): * cdef PetscInt m=0, N=0, lda=0 * cdef PetscScalar *data = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatGetSize(self.mat, NULL, &N) ) */ __pyx_v_data = NULL; /* "PETSc/Mat.pyx":1526 * cdef PetscInt m=0, N=0, lda=0 * cdef PetscScalar *data = NULL * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) # <<<<<<<<<<<<<< * CHKERR( MatGetSize(self.mat, NULL, &N) ) * lda = m # CHKERR( MatDenseGetLDA(self.mat, &ld) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1526, __pyx_L1_error) /* "PETSc/Mat.pyx":1527 * cdef PetscScalar *data = NULL * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatGetSize(self.mat, NULL, &N) ) # <<<<<<<<<<<<<< * lda = m # CHKERR( MatDenseGetLDA(self.mat, &ld) ) * CHKERR( MatDenseGetArray(self.mat, &data) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_N))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1527, __pyx_L1_error) /* "PETSc/Mat.pyx":1528 * CHKERR( MatGetLocalSize(self.mat, &m, NULL) ) * CHKERR( MatGetSize(self.mat, NULL, &N) ) * lda = m # CHKERR( MatDenseGetLDA(self.mat, &ld) ) # <<<<<<<<<<<<<< * CHKERR( MatDenseGetArray(self.mat, &data) ) * cdef int typenum = NPY_PETSC_SCALAR */ __pyx_v_lda = __pyx_v_m; /* "PETSc/Mat.pyx":1529 * CHKERR( MatGetSize(self.mat, NULL, &N) ) * lda = m # CHKERR( MatDenseGetLDA(self.mat, &ld) ) * CHKERR( MatDenseGetArray(self.mat, &data) ) # <<<<<<<<<<<<<< * cdef int typenum = NPY_PETSC_SCALAR * cdef int itemsize = sizeof(PetscScalar) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArray(__pyx_v_self->mat, (&__pyx_v_data))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1529, __pyx_L1_error) /* "PETSc/Mat.pyx":1530 * lda = m # CHKERR( MatDenseGetLDA(self.mat, &ld) ) * CHKERR( MatDenseGetArray(self.mat, &data) ) * cdef int typenum = NPY_PETSC_SCALAR # <<<<<<<<<<<<<< * cdef int itemsize = sizeof(PetscScalar) * cdef int flags = NPY_ARRAY_FARRAY */ __pyx_v_typenum = NPY_PETSC_SCALAR; /* "PETSc/Mat.pyx":1531 * CHKERR( MatDenseGetArray(self.mat, &data) ) * cdef int typenum = NPY_PETSC_SCALAR * cdef int itemsize = sizeof(PetscScalar) # <<<<<<<<<<<<<< * cdef int flags = NPY_ARRAY_FARRAY * cdef npy_intp dims[2], strides[2] */ __pyx_v_itemsize = ((int)(sizeof(PetscScalar))); /* "PETSc/Mat.pyx":1532 * cdef int typenum = NPY_PETSC_SCALAR * cdef int itemsize = sizeof(PetscScalar) * cdef int flags = NPY_ARRAY_FARRAY # <<<<<<<<<<<<<< * cdef npy_intp dims[2], strides[2] * dims[0] = m; strides[0] = sizeof(PetscScalar); */ __pyx_v_flags = NPY_ARRAY_FARRAY; /* "PETSc/Mat.pyx":1534 * cdef int flags = NPY_ARRAY_FARRAY * cdef npy_intp dims[2], strides[2] * dims[0] = m; strides[0] = sizeof(PetscScalar); # <<<<<<<<<<<<<< * dims[1] = N; strides[1] = (lda*sizeof(PetscScalar)); * array = PyArray_New(ndarray, 2, dims, typenum, */ (__pyx_v_dims[0]) = ((npy_intp)__pyx_v_m); (__pyx_v_strides[0]) = ((npy_intp)(sizeof(PetscScalar))); /* "PETSc/Mat.pyx":1535 * cdef npy_intp dims[2], strides[2] * dims[0] = m; strides[0] = sizeof(PetscScalar); * dims[1] = N; strides[1] = (lda*sizeof(PetscScalar)); # <<<<<<<<<<<<<< * array = PyArray_New(ndarray, 2, dims, typenum, * strides, data, itemsize, flags, NULL) */ (__pyx_v_dims[1]) = ((npy_intp)__pyx_v_N); (__pyx_v_strides[1]) = ((npy_intp)(__pyx_v_lda * (sizeof(PetscScalar)))); /* "PETSc/Mat.pyx":1536 * dims[0] = m; strides[0] = sizeof(PetscScalar); * dims[1] = N; strides[1] = (lda*sizeof(PetscScalar)); * array = PyArray_New(ndarray, 2, dims, typenum, # <<<<<<<<<<<<<< * strides, data, itemsize, flags, NULL) * CHKERR( MatDenseRestoreArray(self.mat, &data) ) */ __pyx_t_2 = ((PyObject *)PyArray_New(((PyTypeObject *)__pyx_ptype_8petsc4py_5PETSc_ndarray), 2, __pyx_v_dims, __pyx_v_typenum, __pyx_v_strides, __pyx_v_data, __pyx_v_itemsize, __pyx_v_flags, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_array = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1538 * array = PyArray_New(ndarray, 2, dims, typenum, * strides, data, itemsize, flags, NULL) * CHKERR( MatDenseRestoreArray(self.mat, &data) ) # <<<<<<<<<<<<<< * return array * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArray(__pyx_v_self->mat, (&__pyx_v_data))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1538, __pyx_L1_error) /* "PETSc/Mat.pyx":1539 * strides, data, itemsize, flags, NULL) * CHKERR( MatDenseRestoreArray(self.mat, &data) ) * return array # <<<<<<<<<<<<<< * * def getDenseLocalMatrix(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_array); __pyx_r = __pyx_v_array; goto __pyx_L0; /* "PETSc/Mat.pyx":1523 * # dense matrices * * def getDenseArray(self): # <<<<<<<<<<<<<< * cdef PetscInt m=0, N=0, lda=0 * cdef PetscScalar *data = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_array); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1541 * return array * * def getDenseLocalMatrix(self): # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385getDenseLocalMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_384getDenseLocalMatrix[] = "Mat.getDenseLocalMatrix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385getDenseLocalMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDenseLocalMatrix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDenseLocalMatrix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDenseLocalMatrix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_384getDenseLocalMatrix(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_384getDenseLocalMatrix(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDenseLocalMatrix", 0); /* "PETSc/Mat.pyx":1542 * * def getDenseLocalMatrix(self): * cdef Mat mat = type(self)() # <<<<<<<<<<<<<< * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) * PetscINCREF(mat.obj) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 1542, __pyx_L1_error) __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1543 * def getDenseLocalMatrix(self): * cdef Mat mat = type(self)() * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * return mat */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLocalMatrix(__pyx_v_self->mat, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1543, __pyx_L1_error) /* "PETSc/Mat.pyx":1544 * cdef Mat mat = type(self)() * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * return mat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/Mat.pyx":1545 * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) * PetscINCREF(mat.obj) * return mat # <<<<<<<<<<<<<< * * # Nest */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/Mat.pyx":1541 * return array * * def getDenseLocalMatrix(self): # <<<<<<<<<<<<<< * cdef Mat mat = type(self)() * CHKERR( MatDenseGetLocalMatrix(self.mat, &mat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseLocalMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1549 * # Nest * * def getNestSize(self): # <<<<<<<<<<<<<< * cdef PetscInt nrows, ncols * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_387getNestSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_386getNestSize[] = "Mat.getNestSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_387getNestSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNestSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_386getNestSize(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386getNestSize(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_nrows; PetscInt __pyx_v_ncols; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestSize", 0); /* "PETSc/Mat.pyx":1551 * def getNestSize(self): * cdef PetscInt nrows, ncols * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<< * return toInt(nrows), toInt(ncols) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSize(__pyx_v_self->mat, (&__pyx_v_nrows), (&__pyx_v_ncols))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1551, __pyx_L1_error) /* "PETSc/Mat.pyx":1552 * cdef PetscInt nrows, ncols * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * return toInt(nrows), toInt(ncols) # <<<<<<<<<<<<<< * * def getNestISs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nrows); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ncols); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1549 * # Nest * * def getNestSize(self): # <<<<<<<<<<<<<< * cdef PetscInt nrows, ncols * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1554 * return toInt(nrows), toInt(ncols) * * def getNestISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_389getNestISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_388getNestISs[] = "Mat.getNestISs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_389getNestISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestISs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNestISs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_388getNestISs(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388getNestISs(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_nrows; PetscInt __pyx_v_ncols; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; CYTHON_UNUSED PyObject *__pyx_v_tmpr = 0; CYTHON_UNUSED PyObject *__pyx_v_tmpc = 0; PyObject *__pyx_v_isetsrows = 0; PyObject *__pyx_v_isetscols = 0; PetscInt __pyx_8genexpr3__pyx_v_i; PetscInt __pyx_8genexpr4__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestISs", 0); /* "PETSc/Mat.pyx":1555 * * def getNestISs(self): * cdef PetscInt i, nrows =0, ncols = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_nrows = 0; __pyx_v_ncols = 0; /* "PETSc/Mat.pyx":1556 * def getNestISs(self): * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) */ __pyx_v_cisrows = NULL; /* "PETSc/Mat.pyx":1557 * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) */ __pyx_v_ciscols = NULL; /* "PETSc/Mat.pyx":1558 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<< * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSize(__pyx_v_self->mat, (&__pyx_v_nrows), (&__pyx_v_ncols))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1558, __pyx_L1_error) /* "PETSc/Mat.pyx":1559 * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) # <<<<<<<<<<<<<< * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nrows)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmpr = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1560 * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) # <<<<<<<<<<<<<< * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ncols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmpc = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1561 * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) # <<<<<<<<<<<<<< * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetISs(__pyx_v_self->mat, __pyx_v_cisrows, __pyx_v_ciscols)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1561, __pyx_L1_error) /* "PETSc/Mat.pyx":1562 * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] # <<<<<<<<<<<<<< * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_nrows; for (__pyx_8genexpr3__pyx_v_i = 0; __pyx_8genexpr3__pyx_v_i < __pyx_t_4; __pyx_8genexpr3__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cisrows[__pyx_8genexpr3__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(38, 1562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetsrows = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1563 * CHKERR( MatNestGetISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] # <<<<<<<<<<<<<< * return isetsrows, isetscols * */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_ncols; for (__pyx_8genexpr4__pyx_v_i = 0; __pyx_8genexpr4__pyx_v_i < __pyx_t_4; __pyx_8genexpr4__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_ciscols[__pyx_8genexpr4__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(38, 1563, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetscols = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1564 * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols # <<<<<<<<<<<<<< * * def getNestLocalISs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_isetsrows); __Pyx_GIVEREF(__pyx_v_isetsrows); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_isetsrows); __Pyx_INCREF(__pyx_v_isetscols); __Pyx_GIVEREF(__pyx_v_isetscols); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_isetscols); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1554 * return toInt(nrows), toInt(ncols) * * def getNestISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmpr); __Pyx_XDECREF(__pyx_v_tmpc); __Pyx_XDECREF(__pyx_v_isetsrows); __Pyx_XDECREF(__pyx_v_isetscols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1566 * return isetsrows, isetscols * * def getNestLocalISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_391getNestLocalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_390getNestLocalISs[] = "Mat.getNestLocalISs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_391getNestLocalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestLocalISs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNestLocalISs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNestLocalISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_390getNestLocalISs(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390getNestLocalISs(struct PyPetscMatObject *__pyx_v_self) { PetscInt __pyx_v_nrows; PetscInt __pyx_v_ncols; IS *__pyx_v_cisrows; IS *__pyx_v_ciscols; CYTHON_UNUSED PyObject *__pyx_v_tmpr = 0; CYTHON_UNUSED PyObject *__pyx_v_tmpc = 0; PyObject *__pyx_v_isetsrows = 0; PyObject *__pyx_v_isetscols = 0; PetscInt __pyx_8genexpr5__pyx_v_i; PetscInt __pyx_8genexpr6__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestLocalISs", 0); /* "PETSc/Mat.pyx":1567 * * def getNestLocalISs(self): * cdef PetscInt i, nrows =0, ncols = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL */ __pyx_v_nrows = 0; __pyx_v_ncols = 0; /* "PETSc/Mat.pyx":1568 * def getNestLocalISs(self): * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL # <<<<<<<<<<<<<< * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) */ __pyx_v_cisrows = NULL; /* "PETSc/Mat.pyx":1569 * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL # <<<<<<<<<<<<<< * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) */ __pyx_v_ciscols = NULL; /* "PETSc/Mat.pyx":1570 * cdef PetscIS *cisrows = NULL * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) # <<<<<<<<<<<<<< * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSize(__pyx_v_self->mat, (&__pyx_v_nrows), (&__pyx_v_ncols))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1570, __pyx_L1_error) /* "PETSc/Mat.pyx":1571 * cdef PetscIS *ciscols = NULL * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) # <<<<<<<<<<<<<< * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nrows)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cisrows)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmpr = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1572 * CHKERR( MatNestGetSize(self.mat, &nrows, &ncols) ) * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) # <<<<<<<<<<<<<< * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ncols)); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_ciscols)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmpc = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1573 * cdef object tmpr = oarray_p(empty_p(nrows), NULL, &cisrows) * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) # <<<<<<<<<<<<<< * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetLocalISs(__pyx_v_self->mat, __pyx_v_cisrows, __pyx_v_ciscols)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1573, __pyx_L1_error) /* "PETSc/Mat.pyx":1574 * cdef object tmpc = oarray_p(empty_p(ncols), NULL, &ciscols) * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] # <<<<<<<<<<<<<< * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_nrows; for (__pyx_8genexpr5__pyx_v_i = 0; __pyx_8genexpr5__pyx_v_i < __pyx_t_4; __pyx_8genexpr5__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cisrows[__pyx_8genexpr5__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(38, 1574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetsrows = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1575 * CHKERR( MatNestGetLocalISs(self.mat, cisrows, ciscols) ) * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] # <<<<<<<<<<<<<< * return isetsrows, isetscols * */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_v_ncols; for (__pyx_8genexpr6__pyx_v_i = 0; __pyx_8genexpr6__pyx_v_i < __pyx_t_4; __pyx_8genexpr6__pyx_v_i++) { __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_ciscols[__pyx_8genexpr6__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(38, 1575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ __pyx_v_isetscols = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1576 * cdef object isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows] * cdef object isetscols = [ref_IS(ciscols[i]) for i from 0 <= i < ncols] * return isetsrows, isetscols # <<<<<<<<<<<<<< * * def getNestSubMatrix(self, i, j): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_isetsrows); __Pyx_GIVEREF(__pyx_v_isetsrows); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_isetsrows); __Pyx_INCREF(__pyx_v_isetscols); __Pyx_GIVEREF(__pyx_v_isetscols); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_isetscols); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1566 * return isetsrows, isetscols * * def getNestLocalISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, nrows =0, ncols = 0 * cdef PetscIS *cisrows = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestLocalISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmpr); __Pyx_XDECREF(__pyx_v_tmpc); __Pyx_XDECREF(__pyx_v_isetsrows); __Pyx_XDECREF(__pyx_v_isetscols); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1578 * return isetsrows, isetscols * * def getNestSubMatrix(self, i, j): # <<<<<<<<<<<<<< * cdef Mat submat = Mat() * cdef PetscInt idxm = asInt(i) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393getNestSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_392getNestSubMatrix[] = "Mat.getNestSubMatrix(self, i, j)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393getNestSubMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_i = 0; PyObject *__pyx_v_j = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNestSubMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,&__pyx_n_s_j,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_j)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getNestSubMatrix", 1, 2, 2, 1); __PYX_ERR(38, 1578, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getNestSubMatrix") < 0)) __PYX_ERR(38, 1578, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_i = values[0]; __pyx_v_j = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getNestSubMatrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1578, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_392getNestSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_j); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392getNestSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j) { struct PyPetscMatObject *__pyx_v_submat = 0; PetscInt __pyx_v_idxm; PetscInt __pyx_v_jdxm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNestSubMatrix", 0); /* "PETSc/Mat.pyx":1579 * * def getNestSubMatrix(self, i, j): * cdef Mat submat = Mat() # <<<<<<<<<<<<<< * cdef PetscInt idxm = asInt(i) * cdef PetscInt jdxm = asInt(j) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1580 * def getNestSubMatrix(self, i, j): * cdef Mat submat = Mat() * cdef PetscInt idxm = asInt(i) # <<<<<<<<<<<<<< * cdef PetscInt jdxm = asInt(j) * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1580, __pyx_L1_error) __pyx_v_idxm = __pyx_t_2; /* "PETSc/Mat.pyx":1581 * cdef Mat submat = Mat() * cdef PetscInt idxm = asInt(i) * cdef PetscInt jdxm = asInt(j) # <<<<<<<<<<<<<< * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) * PetscINCREF(submat.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_j); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(38, 1581, __pyx_L1_error) __pyx_v_jdxm = __pyx_t_2; /* "PETSc/Mat.pyx":1582 * cdef PetscInt idxm = asInt(i) * cdef PetscInt jdxm = asInt(j) * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(submat.obj) * return submat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSubMat(__pyx_v_self->mat, __pyx_v_idxm, __pyx_v_jdxm, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 1582, __pyx_L1_error) /* "PETSc/Mat.pyx":1583 * cdef PetscInt jdxm = asInt(j) * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) * PetscINCREF(submat.obj) # <<<<<<<<<<<<<< * return submat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj)); /* "PETSc/Mat.pyx":1584 * CHKERR( MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat) ) * PetscINCREF(submat.obj) * return submat # <<<<<<<<<<<<<< * * # MatIS */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_submat)); __pyx_r = ((PyObject *)__pyx_v_submat); goto __pyx_L0; /* "PETSc/Mat.pyx":1578 * return isetsrows, isetscols * * def getNestSubMatrix(self, i, j): # <<<<<<<<<<<<<< * cdef Mat submat = Mat() * cdef PetscInt idxm = asInt(i) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getNestSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_submat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1588 * # MatIS * * def getISLocalMat(self): # <<<<<<<<<<<<<< * cdef Mat localmat = type(self)() * CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_394getISLocalMat[] = "Mat.getISLocalMat(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395getISLocalMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getISLocalMat (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getISLocalMat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getISLocalMat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_394getISLocalMat(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_394getISLocalMat(struct PyPetscMatObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_localmat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getISLocalMat", 0); /* "PETSc/Mat.pyx":1589 * * def getISLocalMat(self): * cdef Mat localmat = type(self)() # <<<<<<<<<<<<<< * CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) * PetscINCREF(localmat.obj) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(38, 1589, __pyx_L1_error) __pyx_v_localmat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1590 * def getISLocalMat(self): * cdef Mat localmat = type(self)() * CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(localmat.obj) * return localmat */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISGetLocalMat(__pyx_v_self->mat, (&__pyx_v_localmat->mat))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1590, __pyx_L1_error) /* "PETSc/Mat.pyx":1591 * cdef Mat localmat = type(self)() * CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) * PetscINCREF(localmat.obj) # <<<<<<<<<<<<<< * return localmat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_localmat->__pyx_base.obj)); /* "PETSc/Mat.pyx":1592 * CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) * PetscINCREF(localmat.obj) * return localmat # <<<<<<<<<<<<<< * * # DM */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_localmat)); __pyx_r = ((PyObject *)__pyx_v_localmat); goto __pyx_L0; /* "PETSc/Mat.pyx":1588 * # MatIS * * def getISLocalMat(self): # <<<<<<<<<<<<<< * cdef Mat localmat = type(self)() * CHKERR( MatISGetLocalMat(self.mat, &localmat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getISLocalMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_localmat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1596 * # DM * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( MatGetDM(self.mat, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_397getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_396getDM[] = "Mat.getDM(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_397getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_396getDM(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_396getDM(struct PyPetscMatObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 0); /* "PETSc/Mat.pyx":1597 * * def getDM(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( MatGetDM(self.mat, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/Mat.pyx":1598 * def getDM(self): * cdef PetscDM newdm = NULL * CHKERR( MatGetDM(self.mat, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDM(__pyx_v_self->mat, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1598, __pyx_L1_error) /* "PETSc/Mat.pyx":1599 * cdef PetscDM newdm = NULL * CHKERR( MatGetDM(self.mat, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * PetscINCREF(dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(38, 1599, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":1600 * CHKERR( MatGetDM(self.mat, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/Mat.pyx":1601 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * return dm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/Mat.pyx":1602 * dm.dm = newdm * PetscINCREF(dm.obj) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/Mat.pyx":1596 * # DM * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( MatGetDM(self.mat, &newdm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1604 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( MatSetDM(self.mat, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3Mat_398setDM[] = "Mat.setDM(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(38, 1604, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1604, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(38, 1604, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_398setDM(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_398setDM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 0); /* "PETSc/Mat.pyx":1605 * * def setDM(self, DM dm): * CHKERR( MatSetDM(self.mat, dm.dm) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetDM(__pyx_v_self->mat, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1605, __pyx_L1_error) /* "PETSc/Mat.pyx":1604 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( MatSetDM(self.mat, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Mat.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1610 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_5sizes___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1611 * property sizes: * def __get__(self): * return self.getSizes() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setSizes(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1610 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1612 * def __get__(self): * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(((struct PyPetscMatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3Mat_5sizes_2__set__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/Mat.pyx":1613 * return self.getSizes() * def __set__(self, value): * self.setSizes(value) # <<<<<<<<<<<<<< * * property size: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1612 * def __get__(self): * return self.getSizes() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setSizes(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.sizes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1616 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_4size___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1617 * property size: * def __get__(self): * return self.getSize() # <<<<<<<<<<<<<< * * property local_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1616 * * property size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1620 * * property local_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10local_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10local_size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10local_size___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1621 * property local_size: * def __get__(self): * return self.getLocalSize() # <<<<<<<<<<<<<< * * property block_size: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1620 * * property local_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.local_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1624 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10block_size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10block_size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10block_size___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1625 * property block_size: * def __get__(self): * return self.getBlockSize() # <<<<<<<<<<<<<< * * property block_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1624 * * property block_size: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSize() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.block_size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1628 * * property block_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11block_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11block_sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11block_sizes___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1629 * property block_sizes: * def __get__(self): * return self.getBlockSizes() # <<<<<<<<<<<<<< * * property owner_range: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBlockSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1628 * * property block_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBlockSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.block_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1632 * * property owner_range: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11owner_range_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_11owner_range_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_11owner_range___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1633 * property owner_range: * def __get__(self): * return self.getOwnershipRange() # <<<<<<<<<<<<<< * * property owner_ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1632 * * property owner_range: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRange() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.owner_range.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1636 * * property owner_ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_12owner_ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_12owner_ranges_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12owner_ranges___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1637 * property owner_ranges: * def __get__(self): * return self.getOwnershipRanges() # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOwnershipRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1636 * * property owner_ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOwnershipRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.owner_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1642 * * property assembled: * def __get__(self): # <<<<<<<<<<<<<< * return self.isAssembled() * property symmetric: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9assembled_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9assembled_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9assembled___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1643 * property assembled: * def __get__(self): * return self.isAssembled() # <<<<<<<<<<<<<< * property symmetric: * def __get__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isAssembled); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1642 * * property assembled: * def __get__(self): # <<<<<<<<<<<<<< * return self.isAssembled() * property symmetric: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.assembled.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1645 * return self.isAssembled() * property symmetric: * def __get__(self): # <<<<<<<<<<<<<< * return self.isSymmetric() * property hermitian: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9symmetric_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9symmetric_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9symmetric___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1646 * property symmetric: * def __get__(self): * return self.isSymmetric() # <<<<<<<<<<<<<< * property hermitian: * def __get__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isSymmetric); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1645 * return self.isAssembled() * property symmetric: * def __get__(self): # <<<<<<<<<<<<<< * return self.isSymmetric() * property hermitian: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.symmetric.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1648 * return self.isSymmetric() * property hermitian: * def __get__(self): # <<<<<<<<<<<<<< * return self.isHermitian() * property structsymm: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9hermitian_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_9hermitian_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_9hermitian___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1649 * property hermitian: * def __get__(self): * return self.isHermitian() # <<<<<<<<<<<<<< * property structsymm: * def __get__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isHermitian); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1648 * return self.isSymmetric() * property hermitian: * def __get__(self): # <<<<<<<<<<<<<< * return self.isHermitian() * property structsymm: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.hermitian.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1651 * return self.isHermitian() * property structsymm: * def __get__(self): # <<<<<<<<<<<<<< * return self.isStructurallySymmetric() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10structsymm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_10structsymm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(((struct PyPetscMatObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_10structsymm___get__(struct PyPetscMatObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/Mat.pyx":1652 * property structsymm: * def __get__(self): * return self.isStructurallySymmetric() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isStructurallySymmetric); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1651 * return self.isHermitian() * property structsymm: * def __get__(self): # <<<<<<<<<<<<<< * return self.isStructurallySymmetric() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.Mat.structsymm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1660 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.nsp * self.nsp = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_9NullSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_9NullSpace_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_9NullSpace___cinit__(struct PyPetscNullSpaceObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Mat.pyx":1661 * * def __cinit__(self): * self.obj = &self.nsp # <<<<<<<<<<<<<< * self.nsp = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->nsp)); /* "PETSc/Mat.pyx":1662 * def __cinit__(self): * self.obj = &self.nsp * self.nsp = NULL # <<<<<<<<<<<<<< * * def __call__(self, vec): */ __pyx_v_self->nsp = NULL; /* "PETSc/Mat.pyx":1660 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.nsp * self.nsp = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1664 * self.nsp = NULL * * def __call__(self, vec): # <<<<<<<<<<<<<< * self.remove(vec) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(38, 1664, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1664, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_2__call__(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); /* "PETSc/Mat.pyx":1665 * * def __call__(self, vec): * self.remove(vec) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_vec) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_vec); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Mat.pyx":1664 * self.nsp = NULL * * def __call__(self, vec): # <<<<<<<<<<<<<< * self.remove(vec) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1669 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_4view[] = "NullSpace.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(38, 1669, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1669, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(38, 1669, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_4view(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Mat.pyx":1670 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( MatNullSpaceView(self.nsp, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Mat.pyx":1671 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceView(self.nsp, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Mat.pyx":1672 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( MatNullSpaceView(self.nsp, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceView(__pyx_v_self->nsp, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1672, __pyx_L1_error) /* "PETSc/Mat.pyx":1669 * # * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1674 * CHKERR( MatNullSpaceView(self.nsp, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceDestroy(&self.nsp) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_6destroy[] = "NullSpace.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_6destroy(struct PyPetscNullSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Mat.pyx":1675 * * def destroy(self): * CHKERR( MatNullSpaceDestroy(&self.nsp) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceDestroy((&__pyx_v_self->nsp))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1675, __pyx_L1_error) /* "PETSc/Mat.pyx":1676 * def destroy(self): * CHKERR( MatNullSpaceDestroy(&self.nsp) ) * return self # <<<<<<<<<<<<<< * * def create(self, constant=False, vectors=(), comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":1674 * CHKERR( MatNullSpaceView(self.nsp, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceDestroy(&self.nsp) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1678 * return self * * def create(self, constant=False, vectors=(), comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool has_const = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_8create[] = "NullSpace.create(self, constant=False, vectors=(), comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_constant = 0; PyObject *__pyx_v_vectors = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constant,&__pyx_n_s_vectors,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_False); values[1] = ((PyObject *)__pyx_empty_tuple); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_constant); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vectors); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(38, 1678, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_constant = values[0]; __pyx_v_vectors = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1678, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_constant, __pyx_v_vectors, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_8create(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_constant, PyObject *__pyx_v_vectors, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_has_const; PetscInt __pyx_v_i; PetscInt __pyx_v_nv; Vec *__pyx_v_v; CYTHON_UNUSED PyObject *__pyx_v_tmp2 = 0; MatNullSpace __pyx_v_newnsp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PetscInt __pyx_t_6; Vec __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Mat.pyx":1679 * * def create(self, constant=False, vectors=(), comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool has_const = PETSC_FALSE * if constant: has_const = PETSC_TRUE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(38, 1679, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Mat.pyx":1680 * def create(self, constant=False, vectors=(), comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool has_const = PETSC_FALSE # <<<<<<<<<<<<<< * if constant: has_const = PETSC_TRUE * cdef PetscInt i = 0, nv = len(vectors) */ __pyx_v_has_const = PETSC_FALSE; /* "PETSc/Mat.pyx":1681 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool has_const = PETSC_FALSE * if constant: has_const = PETSC_TRUE # <<<<<<<<<<<<<< * cdef PetscInt i = 0, nv = len(vectors) * cdef PetscVec *v = NULL */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_constant); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(38, 1681, __pyx_L1_error) if (__pyx_t_2) { __pyx_v_has_const = PETSC_TRUE; } /* "PETSc/Mat.pyx":1682 * cdef PetscBool has_const = PETSC_FALSE * if constant: has_const = PETSC_TRUE * cdef PetscInt i = 0, nv = len(vectors) # <<<<<<<<<<<<<< * cdef PetscVec *v = NULL * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) */ __pyx_v_i = 0; __pyx_t_3 = PyObject_Length(__pyx_v_vectors); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(38, 1682, __pyx_L1_error) __pyx_v_nv = ((PetscInt)__pyx_t_3); /* "PETSc/Mat.pyx":1683 * if constant: has_const = PETSC_TRUE * cdef PetscInt i = 0, nv = len(vectors) * cdef PetscVec *v = NULL # <<<<<<<<<<<<<< * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) * for i from 0 <= i < nv: */ __pyx_v_v = NULL; /* "PETSc/Mat.pyx":1684 * cdef PetscInt i = 0, nv = len(vectors) * cdef PetscVec *v = NULL * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * v[i] = ((vectors[i])).vec */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_4, NULL, ((void **)(&__pyx_v_v)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_tmp2 = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/Mat.pyx":1685 * cdef PetscVec *v = NULL * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) * for i from 0 <= i < nv: # <<<<<<<<<<<<<< * v[i] = ((vectors[i])).vec * cdef PetscNullSpace newnsp = NULL */ __pyx_t_6 = __pyx_v_nv; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "PETSc/Mat.pyx":1686 * cdef object tmp2 = oarray_p(empty_p(nv), NULL, &v) * for i from 0 <= i < nv: * v[i] = ((vectors[i])).vec # <<<<<<<<<<<<<< * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vectors, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(38, 1686, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscVecObject *)__pyx_t_5)->vec; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_v[__pyx_v_i]) = __pyx_t_7; } /* "PETSc/Mat.pyx":1687 * for i from 0 <= i < nv: * v[i] = ((vectors[i])).vec * cdef PetscNullSpace newnsp = NULL # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) * PetscCLEAR(self.obj); self.nsp = newnsp */ __pyx_v_newnsp = NULL; /* "PETSc/Mat.pyx":1688 * v[i] = ((vectors[i])).vec * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.nsp = newnsp * return self */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceCreate(__pyx_v_ccomm, __pyx_v_has_const, __pyx_v_nv, __pyx_v_v, (&__pyx_v_newnsp))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(38, 1688, __pyx_L1_error) /* "PETSc/Mat.pyx":1689 * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) * PetscCLEAR(self.obj); self.nsp = newnsp # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->nsp = __pyx_v_newnsp; /* "PETSc/Mat.pyx":1690 * CHKERR( MatNullSpaceCreate(ccomm, has_const, nv, v, &newnsp) ) * PetscCLEAR(self.obj); self.nsp = newnsp * return self # <<<<<<<<<<<<<< * * def createRigidBody(self, Vec coords): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":1678 * return self * * def create(self, constant=False, vectors=(), comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool has_const = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1692 * return self * * def createRigidBody(self, Vec coords): # <<<<<<<<<<<<<< * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_10createRigidBody[] = "NullSpace.createRigidBody(self, Vec coords)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_coords = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createRigidBody (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coords,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createRigidBody") < 0)) __PYX_ERR(38, 1692, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_coords = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createRigidBody", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1692, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.createRigidBody", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_coords), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "coords", 0))) __PYX_ERR(38, 1692, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_coords); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_10createRigidBody(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_coords) { MatNullSpace __pyx_v_newnsp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createRigidBody", 0); /* "PETSc/Mat.pyx":1693 * * def createRigidBody(self, Vec coords): * cdef PetscNullSpace newnsp = NULL # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) * PetscCLEAR(self.obj); self.nsp = newnsp */ __pyx_v_newnsp = NULL; /* "PETSc/Mat.pyx":1694 * def createRigidBody(self, Vec coords): * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.nsp = newnsp * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceCreateRigidBody(__pyx_v_coords->vec, (&__pyx_v_newnsp))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1694, __pyx_L1_error) /* "PETSc/Mat.pyx":1695 * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) * PetscCLEAR(self.obj); self.nsp = newnsp # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->nsp = __pyx_v_newnsp; /* "PETSc/Mat.pyx":1696 * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) * PetscCLEAR(self.obj); self.nsp = newnsp * return self # <<<<<<<<<<<<<< * * def setFunction(self, function, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Mat.pyx":1692 * return self * * def createRigidBody(self, Vec coords): # <<<<<<<<<<<<<< * cdef PetscNullSpace newnsp = NULL * CHKERR( MatNullSpaceCreateRigidBody(coords.vec, &newnsp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.createRigidBody", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1698 * return self * * def setFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if function is not None: * CHKERR( MatNullSpaceSetFunction( */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_12setFunction[] = "NullSpace.setFunction(self, function, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFunction") < 0)) __PYX_ERR(38, 1698, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFunction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1698, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_12setFunction(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_12setFunction(struct PyPetscNullSpaceObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/Mat.pyx":1699 * * def setFunction(self, function, args=None, kargs=None): * if function is not None: # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceSetFunction( * self.nsp, NullSpace_Function, NULL) ) */ __pyx_t_1 = (__pyx_v_function != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/Mat.pyx":1700 * def setFunction(self, function, args=None, kargs=None): * if function is not None: * CHKERR( MatNullSpaceSetFunction( # <<<<<<<<<<<<<< * self.nsp, NullSpace_Function, NULL) ) * if args is None: args = () */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceSetFunction(__pyx_v_self->nsp, __pyx_f_8petsc4py_5PETSc_NullSpace_Function, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 1700, __pyx_L1_error) /* "PETSc/Mat.pyx":1702 * CHKERR( MatNullSpaceSetFunction( * self.nsp, NullSpace_Function, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__function__', (function, args, kargs)) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/Mat.pyx":1703 * self.nsp, NullSpace_Function, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__function__', (function, args, kargs)) * else: */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/Mat.pyx":1704 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__function__', (function, args, kargs)) # <<<<<<<<<<<<<< * else: * CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 1704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Mat.pyx":1699 * * def setFunction(self, function, args=None, kargs=None): * if function is not None: # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceSetFunction( * self.nsp, NullSpace_Function, NULL) ) */ goto __pyx_L3; } /* "PETSc/Mat.pyx":1706 * self.set_attr('__function__', (function, args, kargs)) * else: * CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) # <<<<<<<<<<<<<< * self.set_attr('__function__', None) * # */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceSetFunction(__pyx_v_self->nsp, NULL, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(38, 1706, __pyx_L1_error) /* "PETSc/Mat.pyx":1707 * else: * CHKERR( MatNullSpaceSetFunction(self.nsp, NULL, NULL) ) * self.set_attr('__function__', None) # <<<<<<<<<<<<<< * # * */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(38, 1707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L3:; /* "PETSc/Mat.pyx":1698 * return self * * def setFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if function is not None: * CHKERR( MatNullSpaceSetFunction( */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1710 * # * * def hasConstant(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_14hasConstant[] = "NullSpace.hasConstant(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasConstant (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("hasConstant", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "hasConstant", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_14hasConstant(struct PyPetscNullSpaceObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasConstant", 0); /* "PETSc/Mat.pyx":1711 * * def hasConstant(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":1712 * def hasConstant(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceGetVecs(__pyx_v_self->nsp, (&__pyx_v_flag), NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1712, __pyx_L1_error) /* "PETSc/Mat.pyx":1713 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def getVecs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1710 * # * * def hasConstant(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.hasConstant", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1715 * return toBool(flag) * * def getVecs(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, nv = 0 * cdef const PetscVec *v = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_16getVecs[] = "NullSpace.getVecs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getVecs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVecs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_16getVecs(struct PyPetscNullSpaceObject *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_nv; Vec const *__pyx_v_v; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_vectors = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecs", 0); /* "PETSc/Mat.pyx":1716 * * def getVecs(self): * cdef PetscInt i = 0, nv = 0 # <<<<<<<<<<<<<< * cdef const PetscVec *v = NULL * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) */ __pyx_v_i = 0; __pyx_v_nv = 0; /* "PETSc/Mat.pyx":1717 * def getVecs(self): * cdef PetscInt i = 0, nv = 0 * cdef const PetscVec *v = NULL # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) * cdef Vec vec = None */ __pyx_v_v = NULL; /* "PETSc/Mat.pyx":1718 * cdef PetscInt i = 0, nv = 0 * cdef const PetscVec *v = NULL * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) # <<<<<<<<<<<<<< * cdef Vec vec = None * cdef list vectors = [] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceGetVecs(__pyx_v_self->nsp, NULL, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1718, __pyx_L1_error) /* "PETSc/Mat.pyx":1719 * cdef const PetscVec *v = NULL * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) * cdef Vec vec = None # <<<<<<<<<<<<<< * cdef list vectors = [] * for i from 0 <= i < nv: */ __Pyx_INCREF(Py_None); __pyx_v_vec = ((struct PyPetscVecObject *)Py_None); /* "PETSc/Mat.pyx":1720 * CHKERR( MatNullSpaceGetVecs(self.nsp, NULL, &nv, &v) ) * cdef Vec vec = None * cdef list vectors = [] # <<<<<<<<<<<<<< * for i from 0 <= i < nv: * vec = Vec() */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_vectors = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1721 * cdef Vec vec = None * cdef list vectors = [] * for i from 0 <= i < nv: # <<<<<<<<<<<<<< * vec = Vec() * vec.vec = v[i] */ __pyx_t_3 = __pyx_v_nv; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/Mat.pyx":1722 * cdef list vectors = [] * for i from 0 <= i < nv: * vec = Vec() # <<<<<<<<<<<<<< * vec.vec = v[i] * PetscINCREF(vec.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_vec, ((struct PyPetscVecObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "PETSc/Mat.pyx":1723 * for i from 0 <= i < nv: * vec = Vec() * vec.vec = v[i] # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * vectors.append(vec) */ __pyx_v_vec->vec = (__pyx_v_v[__pyx_v_i]); /* "PETSc/Mat.pyx":1724 * vec = Vec() * vec.vec = v[i] * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * vectors.append(vec) * return vectors */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/Mat.pyx":1725 * vec.vec = v[i] * PetscINCREF(vec.obj) * vectors.append(vec) # <<<<<<<<<<<<<< * return vectors * */ __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_vectors, ((PyObject *)__pyx_v_vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(38, 1725, __pyx_L1_error) } /* "PETSc/Mat.pyx":1726 * PetscINCREF(vec.obj) * vectors.append(vec) * return vectors # <<<<<<<<<<<<<< * * def getFunction(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_vectors); __pyx_r = __pyx_v_vectors; goto __pyx_L0; /* "PETSc/Mat.pyx":1715 * return toBool(flag) * * def getVecs(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, nv = 0 * cdef const PetscVec *v = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.getVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XDECREF(__pyx_v_vectors); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1728 * return vectors * * def getFunction(self): # <<<<<<<<<<<<<< * return self.get_attr('__function__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_18getFunction[] = "NullSpace.getFunction(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunction (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFunction", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(((struct PyPetscNullSpaceObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_18getFunction(struct PyPetscNullSpaceObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunction", 0); /* "PETSc/Mat.pyx":1729 * * def getFunction(self): * return self.get_attr('__function__') # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 1729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1728 * return vectors * * def getFunction(self): # <<<<<<<<<<<<<< * return self.get_attr('__function__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.getFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1733 * # * * def remove(self, Vec vec): # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_20remove[] = "NullSpace.remove(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove") < 0)) __PYX_ERR(38, 1733, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1733, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(38, 1733, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_20remove(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove", 0); /* "PETSc/Mat.pyx":1734 * * def remove(self, Vec vec): * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) # <<<<<<<<<<<<<< * * def test(self, Mat mat): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceRemove(__pyx_v_self->nsp, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1734, __pyx_L1_error) /* "PETSc/Mat.pyx":1733 * # * * def remove(self, Vec vec): # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.remove", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Mat.pyx":1736 * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) * * def test(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_9NullSpace_22test[] = "NullSpace.test(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("test (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "test") < 0)) __PYX_ERR(38, 1736, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("test", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(38, 1736, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.test", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(38, 1736, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(((struct PyPetscNullSpaceObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_9NullSpace_22test(struct PyPetscNullSpaceObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("test", 0); /* "PETSc/Mat.pyx":1737 * * def test(self, Mat mat): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/Mat.pyx":1738 * def test(self, Mat mat): * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNullSpaceTest(__pyx_v_self->nsp, __pyx_v_mat->mat, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(38, 1738, __pyx_L1_error) /* "PETSc/Mat.pyx":1739 * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 1739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Mat.pyx":1736 * CHKERR( MatNullSpaceRemove(self.nsp, vec.vec) ) * * def test(self, Mat mat): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( MatNullSpaceTest(self.nsp, mat.mat, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.NullSpace.test", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":137 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.pc * self.pc = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2PC_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2PC_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2PC___cinit__(struct PyPetscPCObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/PC.pyx":138 * * def __cinit__(self): * self.obj = &self.pc # <<<<<<<<<<<<<< * self.pc = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->pc)); /* "PETSc/PC.pyx":139 * def __cinit__(self): * self.obj = &self.pc * self.pc = NULL # <<<<<<<<<<<<<< * * def __call__(self, x, y=None): */ __pyx_v_self->pc = NULL; /* "PETSc/PC.pyx":137 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.pc * self.pc = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":141 * self.pc = NULL * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(39, 141, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = values[0]; __pyx_v_y = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 141, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_2__call__(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_2__call__(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_y); /* "PETSc/PC.pyx":142 * * def __call__(self, x, y=None): * if y is None: # XXX do this better # <<<<<<<<<<<<<< * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) */ __pyx_t_1 = (__pyx_v_y == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":143 * def __call__(self, x, y=None): * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() # <<<<<<<<<<<<<< * self.apply(x, y) * return y */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":142 * * def __call__(self, x, y=None): * if y is None: # XXX do this better # <<<<<<<<<<<<<< * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) */ } /* "PETSc/PC.pyx":144 * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) # <<<<<<<<<<<<<< * return y * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_apply); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 144, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_y); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":145 * y = self.getOperators()[0].createVecLeft() * self.apply(x, y) * return y # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_y); __pyx_r = __pyx_v_y; goto __pyx_L0; /* "PETSc/PC.pyx":141 * self.pc = NULL * * def __call__(self, x, y=None): # <<<<<<<<<<<<<< * if y is None: # XXX do this better * y = self.getOperators()[0].createVecLeft() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PC.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":149 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_4view[] = "PC.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(39, 149, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 149, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(39, 149, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_4view(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_4view(struct PyPetscPCObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/PC.pyx":150 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PCView(self.pc, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/PC.pyx":151 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PCView(self.pc, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/PC.pyx":152 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PCView(self.pc, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCView(__pyx_v_self->pc, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 152, __pyx_L1_error) /* "PETSc/PC.pyx":149 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":154 * CHKERR( PCView(self.pc, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PCDestroy(&self.pc) ) * self.pc = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_6destroy[] = "PC.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_6destroy(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_6destroy(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/PC.pyx":155 * * def destroy(self): * CHKERR( PCDestroy(&self.pc) ) # <<<<<<<<<<<<<< * self.pc = NULL * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDestroy((&__pyx_v_self->pc))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 155, __pyx_L1_error) /* "PETSc/PC.pyx":156 * def destroy(self): * CHKERR( PCDestroy(&self.pc) ) * self.pc = NULL # <<<<<<<<<<<<<< * return self * */ __pyx_v_self->pc = NULL; /* "PETSc/PC.pyx":157 * CHKERR( PCDestroy(&self.pc) ) * self.pc = NULL * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/PC.pyx":154 * CHKERR( PCView(self.pc, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PCDestroy(&self.pc) ) * self.pc = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":159 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_8create[] = "PC.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(39, 159, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 159, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_8create(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_8create(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PC __pyx_v_newpc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/PC.pyx":160 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 160, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/PC.pyx":161 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL # <<<<<<<<<<<<<< * CHKERR( PCCreate(ccomm, &newpc) ) * PetscCLEAR(self.obj); self.pc = newpc */ __pyx_v_newpc = NULL; /* "PETSc/PC.pyx":162 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.pc = newpc * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCreate(__pyx_v_ccomm, (&__pyx_v_newpc))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 162, __pyx_L1_error) /* "PETSc/PC.pyx":163 * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) * PetscCLEAR(self.obj); self.pc = newpc # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->pc = __pyx_v_newpc; /* "PETSc/PC.pyx":164 * CHKERR( PCCreate(ccomm, &newpc) ) * PetscCLEAR(self.obj); self.pc = newpc * return self # <<<<<<<<<<<<<< * * def setType(self, pc_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/PC.pyx":159 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":166 * return self * * def setType(self, pc_type): # <<<<<<<<<<<<<< * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_10setType[] = "PC.setType(self, pc_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pc_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pc_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(39, 166, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_pc_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 166, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_10setType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_pc_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_10setType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type) { PCType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_pc_type); /* "PETSc/PC.pyx":167 * * def setType(self, pc_type): * cdef PetscPCType cval = NULL # <<<<<<<<<<<<<< * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCSetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":168 * def setType(self, pc_type): * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCSetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_pc_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pc_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":169 * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 169, __pyx_L1_error) /* "PETSc/PC.pyx":166 * return self * * def setType(self, pc_type): # <<<<<<<<<<<<<< * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pc_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":171 * CHKERR( PCSetType(self.pc, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscPCType cval = NULL * CHKERR( PCGetType(self.pc, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_12getType[] = "PC.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_12getType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_12getType(struct PyPetscPCObject *__pyx_v_self) { PCType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/PC.pyx":172 * * def getType(self): * cdef PetscPCType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCGetType(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":173 * def getType(self): * cdef PetscPCType cval = NULL * CHKERR( PCGetType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 173, __pyx_L1_error) /* "PETSc/PC.pyx":174 * cdef PetscPCType cval = NULL * CHKERR( PCGetType(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/PC.pyx":171 * CHKERR( PCSetType(self.pc, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscPCType cval = NULL * CHKERR( PCGetType(self.pc, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":176 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_14setOptionsPrefix[] = "PC.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(39, 176, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 176, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_14setOptionsPrefix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_14setOptionsPrefix(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/PC.pyx":177 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":178 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":179 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetOptionsPrefix(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 179, __pyx_L1_error) /* "PETSc/PC.pyx":176 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":181 * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_16getOptionsPrefix[] = "PC.getOptionsPrefix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_16getOptionsPrefix(struct PyPetscPCObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/PC.pyx":182 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":183 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetOptionsPrefix(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 183, __pyx_L1_error) /* "PETSc/PC.pyx":184 * cdef const char *cval = NULL * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/PC.pyx":181 * CHKERR( PCSetOptionsPrefix(self.pc, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( PCGetOptionsPrefix(self.pc, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":186 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PCSetFromOptions(self.pc) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_19setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_18setFromOptions[] = "PC.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_19setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_18setFromOptions(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_18setFromOptions(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/PC.pyx":187 * * def setFromOptions(self): * CHKERR( PCSetFromOptions(self.pc) ) # <<<<<<<<<<<<<< * * def setOperators(self, Mat A=None, Mat P=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetFromOptions(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 187, __pyx_L1_error) /* "PETSc/PC.pyx":186 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PCSetFromOptions(self.pc) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":189 * CHKERR( PCSetFromOptions(self.pc) ) * * def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscMat amat=NULL * if A is not None: amat = A.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_21setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_20setOperators[] = "PC.setOperators(self, Mat A=None, Mat P=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_21setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOperators (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_P,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOperators") < 0)) __PYX_ERR(39, 189, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_P = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOperators", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 189, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(39, 189, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(39, 189, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_20setOperators(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_A, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_20setOperators(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_amat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOperators", 0); /* "PETSc/PC.pyx":190 * * def setOperators(self, Mat A=None, Mat P=None): * cdef PetscMat amat=NULL # <<<<<<<<<<<<<< * if A is not None: amat = A.mat * cdef PetscMat pmat=amat */ __pyx_v_amat = NULL; /* "PETSc/PC.pyx":191 * def setOperators(self, Mat A=None, Mat P=None): * cdef PetscMat amat=NULL * if A is not None: amat = A.mat # <<<<<<<<<<<<<< * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_A->mat; __pyx_v_amat = __pyx_t_3; } /* "PETSc/PC.pyx":192 * cdef PetscMat amat=NULL * if A is not None: amat = A.mat * cdef PetscMat pmat=amat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( PCSetOperators(self.pc, amat, pmat) ) */ __pyx_v_pmat = __pyx_v_amat; /* "PETSc/PC.pyx":193 * if A is not None: amat = A.mat * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( PCSetOperators(self.pc, amat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_3; } /* "PETSc/PC.pyx":194 * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat * CHKERR( PCSetOperators(self.pc, amat, pmat) ) # <<<<<<<<<<<<<< * * def getOperators(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetOperators(__pyx_v_self->pc, __pyx_v_amat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 194, __pyx_L1_error) /* "PETSc/PC.pyx":189 * CHKERR( PCSetFromOptions(self.pc) ) * * def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscMat amat=NULL * if A is not None: amat = A.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":196 * CHKERR( PCSetOperators(self.pc, amat, pmat) ) * * def getOperators(self): # <<<<<<<<<<<<<< * cdef Mat A = Mat(), P = Mat() * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_23getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_22getOperators[] = "PC.getOperators(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_23getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOperators (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOperators", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOperators", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_22getOperators(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_22getOperators(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOperators", 0); /* "PETSc/PC.pyx":197 * * def getOperators(self): * cdef Mat A = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) * PetscINCREF(A.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":198 * def getOperators(self): * cdef Mat A = Mat(), P = Mat() * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(A.obj) * PetscINCREF(P.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetOperators(__pyx_v_self->pc, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 198, __pyx_L1_error) /* "PETSc/PC.pyx":199 * cdef Mat A = Mat(), P = Mat() * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) * PetscINCREF(A.obj) # <<<<<<<<<<<<<< * PetscINCREF(P.obj) * return (A, P) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); /* "PETSc/PC.pyx":200 * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) * PetscINCREF(A.obj) * PetscINCREF(P.obj) # <<<<<<<<<<<<<< * return (A, P) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); /* "PETSc/PC.pyx":201 * PetscINCREF(A.obj) * PetscINCREF(P.obj) * return (A, P) # <<<<<<<<<<<<<< * * def setUseAmat(self, flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_A)); __Pyx_GIVEREF(((PyObject *)__pyx_v_A)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/PC.pyx":196 * CHKERR( PCSetOperators(self.pc, amat, pmat) ) * * def getOperators(self): # <<<<<<<<<<<<<< * cdef Mat A = Mat(), P = Mat() * CHKERR( PCGetOperators(self.pc, &A.mat, &P.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":203 * return (A, P) * * def setUseAmat(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool cflag = PETSC_FALSE * if flag: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_25setUseAmat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_24setUseAmat[] = "PC.setUseAmat(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_25setUseAmat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseAmat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseAmat") < 0)) __PYX_ERR(39, 203, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseAmat", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 203, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setUseAmat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_24setUseAmat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_24setUseAmat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_cflag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseAmat", 0); /* "PETSc/PC.pyx":204 * * def setUseAmat(self, flag): * cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: * cflag = PETSC_TRUE */ __pyx_v_cflag = PETSC_FALSE; /* "PETSc/PC.pyx":205 * def setUseAmat(self, flag): * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetUseAmat(self.pc, cflag) ) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(39, 205, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/PC.pyx":206 * cdef PetscBool cflag = PETSC_FALSE * if flag: * cflag = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PCSetUseAmat(self.pc, cflag) ) * */ __pyx_v_cflag = PETSC_TRUE; /* "PETSc/PC.pyx":205 * def setUseAmat(self, flag): * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetUseAmat(self.pc, cflag) ) */ } /* "PETSc/PC.pyx":207 * if flag: * cflag = PETSC_TRUE * CHKERR( PCSetUseAmat(self.pc, cflag) ) # <<<<<<<<<<<<<< * * def setReusePreconditioner(self, flag): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUseAmat(__pyx_v_self->pc, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 207, __pyx_L1_error) /* "PETSc/PC.pyx":203 * return (A, P) * * def setUseAmat(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool cflag = PETSC_FALSE * if flag: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setUseAmat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":209 * CHKERR( PCSetUseAmat(self.pc, cflag) ) * * def setReusePreconditioner(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool cflag = PETSC_FALSE * if flag: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_27setReusePreconditioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_26setReusePreconditioner[] = "PC.setReusePreconditioner(self, flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_27setReusePreconditioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setReusePreconditioner (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setReusePreconditioner") < 0)) __PYX_ERR(39, 209, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setReusePreconditioner", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 209, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setReusePreconditioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_26setReusePreconditioner(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_26setReusePreconditioner(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_cflag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setReusePreconditioner", 0); /* "PETSc/PC.pyx":210 * * def setReusePreconditioner(self, flag): * cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: * cflag = PETSC_TRUE */ __pyx_v_cflag = PETSC_FALSE; /* "PETSc/PC.pyx":211 * def setReusePreconditioner(self, flag): * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(39, 211, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/PC.pyx":212 * cdef PetscBool cflag = PETSC_FALSE * if flag: * cflag = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) * */ __pyx_v_cflag = PETSC_TRUE; /* "PETSc/PC.pyx":211 * def setReusePreconditioner(self, flag): * cdef PetscBool cflag = PETSC_FALSE * if flag: # <<<<<<<<<<<<<< * cflag = PETSC_TRUE * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) */ } /* "PETSc/PC.pyx":213 * if flag: * cflag = PETSC_TRUE * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetReusePreconditioner(__pyx_v_self->pc, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 213, __pyx_L1_error) /* "PETSc/PC.pyx":209 * CHKERR( PCSetUseAmat(self.pc, cflag) ) * * def setReusePreconditioner(self, flag): # <<<<<<<<<<<<<< * cdef PetscBool cflag = PETSC_FALSE * if flag: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setReusePreconditioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":215 * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PCSetUp(self.pc) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_29setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_28setUp[] = "PC.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_29setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_28setUp(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_28setUp(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/PC.pyx":216 * * def setUp(self): * CHKERR( PCSetUp(self.pc) ) # <<<<<<<<<<<<<< * * def reset(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUp(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 216, __pyx_L1_error) /* "PETSc/PC.pyx":215 * CHKERR( PCSetReusePreconditioner(self.pc, cflag) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PCSetUp(self.pc) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":218 * CHKERR( PCSetUp(self.pc) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PCReset(self.pc) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_31reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_30reset[] = "PC.reset(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_31reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_30reset(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_30reset(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); /* "PETSc/PC.pyx":219 * * def reset(self): * CHKERR( PCReset(self.pc) ) # <<<<<<<<<<<<<< * * def setUpOnBlocks(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCReset(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 219, __pyx_L1_error) /* "PETSc/PC.pyx":218 * CHKERR( PCSetUp(self.pc) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PCReset(self.pc) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":221 * CHKERR( PCReset(self.pc) ) * * def setUpOnBlocks(self): # <<<<<<<<<<<<<< * CHKERR( PCSetUpOnBlocks(self.pc) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_33setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_32setUpOnBlocks[] = "PC.setUpOnBlocks(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_33setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpOnBlocks (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUpOnBlocks", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUpOnBlocks", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_32setUpOnBlocks(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_32setUpOnBlocks(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpOnBlocks", 0); /* "PETSc/PC.pyx":222 * * def setUpOnBlocks(self): * CHKERR( PCSetUpOnBlocks(self.pc) ) # <<<<<<<<<<<<<< * * def apply(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetUpOnBlocks(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 222, __pyx_L1_error) /* "PETSc/PC.pyx":221 * CHKERR( PCReset(self.pc) ) * * def setUpOnBlocks(self): # <<<<<<<<<<<<<< * CHKERR( PCSetUpOnBlocks(self.pc) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setUpOnBlocks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":224 * CHKERR( PCSetUpOnBlocks(self.pc) ) * * def apply(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApply(self.pc, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_35apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_34apply[] = "PC.apply(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_35apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, 1); __PYX_ERR(39, 224, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply") < 0)) __PYX_ERR(39, 224, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 224, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(39, 224, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(39, 224, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_34apply(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_34apply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("apply", 0); /* "PETSc/PC.pyx":225 * * def apply(self, Vec x, Vec y): * CHKERR( PCApply(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def applyTranspose(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApply(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 225, __pyx_L1_error) /* "PETSc/PC.pyx":224 * CHKERR( PCSetUpOnBlocks(self.pc) ) * * def apply(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApply(self.pc, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":227 * CHKERR( PCApply(self.pc, x.vec, y.vec) ) * * def applyTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37applyTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_36applyTranspose[] = "PC.applyTranspose(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37applyTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applyTranspose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("applyTranspose", 1, 2, 2, 1); __PYX_ERR(39, 227, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applyTranspose") < 0)) __PYX_ERR(39, 227, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applyTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 227, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applyTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(39, 227, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(39, 227, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_36applyTranspose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_36applyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applyTranspose", 0); /* "PETSc/PC.pyx":228 * * def applyTranspose(self, Vec x, Vec y): * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def applySymmetricLeft(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApplyTranspose(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 228, __pyx_L1_error) /* "PETSc/PC.pyx":227 * CHKERR( PCApply(self.pc, x.vec, y.vec) ) * * def applyTranspose(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applyTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":230 * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) * * def applySymmetricLeft(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_39applySymmetricLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_38applySymmetricLeft[] = "PC.applySymmetricLeft(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_39applySymmetricLeft(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applySymmetricLeft (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("applySymmetricLeft", 1, 2, 2, 1); __PYX_ERR(39, 230, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applySymmetricLeft") < 0)) __PYX_ERR(39, 230, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applySymmetricLeft", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 230, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricLeft", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(39, 230, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(39, 230, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_38applySymmetricLeft(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38applySymmetricLeft(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applySymmetricLeft", 0); /* "PETSc/PC.pyx":231 * * def applySymmetricLeft(self, Vec x, Vec y): * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * def applySymmetricRight(self, Vec x, Vec y): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApplySymmetricLeft(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 231, __pyx_L1_error) /* "PETSc/PC.pyx":230 * CHKERR( PCApplyTranspose(self.pc, x.vec, y.vec) ) * * def applySymmetricLeft(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricLeft", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":233 * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) * * def applySymmetricRight(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApplySymmetricRight(self.pc, x.vec, y.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41applySymmetricRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_40applySymmetricRight[] = "PC.applySymmetricRight(self, Vec x, Vec y)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41applySymmetricRight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_y = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("applySymmetricRight (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("applySymmetricRight", 1, 2, 2, 1); __PYX_ERR(39, 233, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "applySymmetricRight") < 0)) __PYX_ERR(39, 233, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_y = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("applySymmetricRight", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 233, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricRight", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(39, 233, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(39, 233, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_40applySymmetricRight(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40applySymmetricRight(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("applySymmetricRight", 0); /* "PETSc/PC.pyx":234 * * def applySymmetricRight(self, Vec x, Vec y): * CHKERR( PCApplySymmetricRight(self.pc, x.vec, y.vec) ) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCApplySymmetricRight(__pyx_v_self->pc, __pyx_v_x->vec, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 234, __pyx_L1_error) /* "PETSc/PC.pyx":233 * CHKERR( PCApplySymmetricLeft(self.pc, x.vec, y.vec) ) * * def applySymmetricRight(self, Vec x, Vec y): # <<<<<<<<<<<<<< * CHKERR( PCApplySymmetricRight(self.pc, x.vec, y.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.applySymmetricRight", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":238 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( PCGetDM(self.pc, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_43getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_42getDM[] = "PC.getDM(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_43getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_42getDM(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42getDM(struct PyPetscPCObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 0); /* "PETSc/PC.pyx":239 * * def getDM(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( PCGetDM(self.pc, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/PC.pyx":240 * def getDM(self): * cdef PetscDM newdm = NULL * CHKERR( PCGetDM(self.pc, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetDM(__pyx_v_self->pc, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 240, __pyx_L1_error) /* "PETSc/PC.pyx":241 * cdef PetscDM newdm = NULL * CHKERR( PCGetDM(self.pc, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * PetscINCREF(dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(39, 241, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":242 * CHKERR( PCGetDM(self.pc, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/PC.pyx":243 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * return dm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/PC.pyx":244 * dm.dm = newdm * PetscINCREF(dm.obj) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/PC.pyx":238 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( PCGetDM(self.pc, &newdm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":246 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( PCSetDM(self.pc, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_45setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_44setDM[] = "PC.setDM(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_45setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(39, 246, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 246, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(39, 246, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_44setDM(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44setDM(struct PyPetscPCObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 0); /* "PETSc/PC.pyx":247 * * def setDM(self, DM dm): * CHKERR( PCSetDM(self.pc, dm.dm) ) # <<<<<<<<<<<<<< * * def setCoordinates(self, coordinates): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetDM(__pyx_v_self->pc, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 247, __pyx_L1_error) /* "PETSc/PC.pyx":246 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( PCSetDM(self.pc, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":249 * CHKERR( PCSetDM(self.pc, dm.dm) ) * * def setCoordinates(self, coordinates): # <<<<<<<<<<<<<< * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_47setCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_46setCoordinates[] = "PC.setCoordinates(self, coordinates)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_47setCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_coordinates = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinates (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coordinates)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoordinates") < 0)) __PYX_ERR(39, 249, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_coordinates = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 249, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_46setCoordinates(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_coordinates); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46setCoordinates(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_coordinates) { PyArrayObject *__pyx_v_xyz = 0; PetscInt __pyx_v_nvtx; PetscInt __pyx_v_ndim; PetscReal *__pyx_v_coords; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinates", 0); /* "PETSc/PC.pyx":250 * * def setCoordinates(self, coordinates): * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":251 * def setCoordinates(self, coordinates): * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) # <<<<<<<<<<<<<< * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " */ __pyx_t_2 = (PyArray_ISFORTRAN(__pyx_v_xyz) != 0); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; } /* "PETSc/PC.pyx":252 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_2 = ((PyArray_NDIM(__pyx_v_xyz) != 2) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/PC.pyx":254 * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) # <<<<<<<<<<<<<< * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) * cdef PetscInt ndim = PyArray_DIM(xyz, 1) */ __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":252 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(39, 252, __pyx_L1_error) } /* "PETSc/PC.pyx":255 * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) # <<<<<<<<<<<<<< * cdef PetscInt ndim = PyArray_DIM(xyz, 1) * cdef PetscReal *coords = PyArray_DATA(xyz) */ __pyx_v_nvtx = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0)); /* "PETSc/PC.pyx":256 * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) * cdef PetscInt ndim = PyArray_DIM(xyz, 1) # <<<<<<<<<<<<<< * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( PCSetCoordinates(self.pc, ndim, nvtx, coords) ) */ __pyx_v_ndim = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 1)); /* "PETSc/PC.pyx":257 * cdef PetscInt nvtx = PyArray_DIM(xyz, 0) * cdef PetscInt ndim = PyArray_DIM(xyz, 1) * cdef PetscReal *coords = PyArray_DATA(xyz) # <<<<<<<<<<<<<< * CHKERR( PCSetCoordinates(self.pc, ndim, nvtx, coords) ) * */ __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz)); /* "PETSc/PC.pyx":258 * cdef PetscInt ndim = PyArray_DIM(xyz, 1) * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( PCSetCoordinates(self.pc, ndim, nvtx, coords) ) # <<<<<<<<<<<<<< * * # --- Python --- */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetCoordinates(__pyx_v_self->pc, __pyx_v_ndim, __pyx_v_nvtx, __pyx_v_coords)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 258, __pyx_L1_error) /* "PETSc/PC.pyx":249 * CHKERR( PCSetDM(self.pc, dm.dm) ) * * def setCoordinates(self, coordinates): # <<<<<<<<<<<<<< * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xyz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":262 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_48createPython[] = "PC.createPython(self, context=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(39, 262, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 262, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_48createPython(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48createPython(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PC __pyx_v_newpc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 0); /* "PETSc/PC.pyx":263 * * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 263, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/PC.pyx":264 * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL # <<<<<<<<<<<<<< * CHKERR( PCCreate(ccomm, &newpc) ) * PetscCLEAR(self.obj); self.pc = newpc */ __pyx_v_newpc = NULL; /* "PETSc/PC.pyx":265 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.pc = newpc * CHKERR( PCSetType(self.pc, PCPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCreate(__pyx_v_ccomm, (&__pyx_v_newpc))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 265, __pyx_L1_error) /* "PETSc/PC.pyx":266 * cdef PetscPC newpc = NULL * CHKERR( PCCreate(ccomm, &newpc) ) * PetscCLEAR(self.obj); self.pc = newpc # <<<<<<<<<<<<<< * CHKERR( PCSetType(self.pc, PCPYTHON) ) * CHKERR( PCPythonSetContext(self.pc, context) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->pc = __pyx_v_newpc; /* "PETSc/PC.pyx":267 * CHKERR( PCCreate(ccomm, &newpc) ) * PetscCLEAR(self.obj); self.pc = newpc * CHKERR( PCSetType(self.pc, PCPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( PCPythonSetContext(self.pc, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetType(__pyx_v_self->pc, PCPYTHON)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 267, __pyx_L1_error) /* "PETSc/PC.pyx":268 * PetscCLEAR(self.obj); self.pc = newpc * CHKERR( PCSetType(self.pc, PCPYTHON) ) * CHKERR( PCPythonSetContext(self.pc, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPythonSetContext(__pyx_v_self->pc, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 268, __pyx_L1_error) /* "PETSc/PC.pyx":269 * CHKERR( PCSetType(self.pc, PCPYTHON) ) * CHKERR( PCPythonSetContext(self.pc, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/PC.pyx":262 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPC newpc = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":271 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( PCPythonSetContext(self.pc, context) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_51setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_50setPythonContext[] = "PC.setPythonContext(self, context)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_51setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(39, 271, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 271, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_50setPythonContext(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_50setPythonContext(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 0); /* "PETSc/PC.pyx":272 * * def setPythonContext(self, context): * CHKERR( PCPythonSetContext(self.pc, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPythonSetContext(__pyx_v_self->pc, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 272, __pyx_L1_error) /* "PETSc/PC.pyx":271 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( PCPythonSetContext(self.pc, context) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":274 * CHKERR( PCPythonSetContext(self.pc, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( PCPythonGetContext(self.pc, &context) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_53getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_52getPythonContext[] = "PC.getPythonContext(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_53getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_52getPythonContext(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_52getPythonContext(struct PyPetscPCObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 0); /* "PETSc/PC.pyx":275 * * def getPythonContext(self): * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( PCPythonGetContext(self.pc, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "PETSc/PC.pyx":276 * def getPythonContext(self): * cdef void *context = NULL * CHKERR( PCPythonGetContext(self.pc, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPythonGetContext(__pyx_v_self->pc, (&__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 276, __pyx_L1_error) /* "PETSc/PC.pyx":277 * cdef void *context = NULL * CHKERR( PCPythonGetContext(self.pc, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_2 = ((__pyx_v_context == NULL) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/PC.pyx":278 * CHKERR( PCPythonGetContext(self.pc, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "PETSc/PC.pyx":274 * CHKERR( PCPythonSetContext(self.pc, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( PCPythonGetContext(self.pc, &context) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":280 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_55setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_54setPythonType[] = "PC.setPythonType(self, py_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_55setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_py_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(39, 280, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 280, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_54setPythonType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_54setPythonType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "PETSc/PC.pyx":281 * * def setPythonType(self, py_type): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( PCPythonSetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":282 * def setPythonType(self, py_type): * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCPythonSetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":283 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( PCPythonSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * # --- ASM --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPythonSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 283, __pyx_L1_error) /* "PETSc/PC.pyx":280 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":287 * # --- ASM --- * * def setASMType(self, asmtype): # <<<<<<<<<<<<<< * cdef PetscPCASMType cval = asmtype * CHKERR( PCASMSetType(self.pc, cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_57setASMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_56setASMType[] = "PC.setASMType(self, asmtype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_57setASMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_asmtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_asmtype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMType") < 0)) __PYX_ERR(39, 287, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_asmtype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 287, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_56setASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_asmtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_56setASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_asmtype) { PCASMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCASMType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMType", 0); /* "PETSc/PC.pyx":288 * * def setASMType(self, asmtype): * cdef PetscPCASMType cval = asmtype # <<<<<<<<<<<<<< * CHKERR( PCASMSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCASMType)__Pyx_PyInt_As_PCASMType(__pyx_v_asmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 288, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/PC.pyx":289 * def setASMType(self, asmtype): * cdef PetscPCASMType cval = asmtype * CHKERR( PCASMSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setASMOverlap(self, overlap): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 289, __pyx_L1_error) /* "PETSc/PC.pyx":287 * # --- ASM --- * * def setASMType(self, asmtype): # <<<<<<<<<<<<<< * cdef PetscPCASMType cval = asmtype * CHKERR( PCASMSetType(self.pc, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":291 * CHKERR( PCASMSetType(self.pc, cval) ) * * def setASMOverlap(self, overlap): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(overlap) * CHKERR( PCASMSetOverlap(self.pc, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_59setASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_58setASMOverlap[] = "PC.setASMOverlap(self, overlap)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_59setASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_overlap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMOverlap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMOverlap") < 0)) __PYX_ERR(39, 291, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_overlap = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMOverlap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 291, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_58setASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_58setASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMOverlap", 0); /* "PETSc/PC.pyx":292 * * def setASMOverlap(self, overlap): * cdef PetscInt ival = asInt(overlap) # <<<<<<<<<<<<<< * CHKERR( PCASMSetOverlap(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 292, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/PC.pyx":293 * def setASMOverlap(self, overlap): * cdef PetscInt ival = asInt(overlap) * CHKERR( PCASMSetOverlap(self.pc, ival) ) # <<<<<<<<<<<<<< * * def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetOverlap(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 293, __pyx_L1_error) /* "PETSc/PC.pyx":291 * CHKERR( PCASMSetType(self.pc, cval) ) * * def setASMOverlap(self, overlap): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(overlap) * CHKERR( PCASMSetOverlap(self.pc, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":295 * CHKERR( PCASMSetOverlap(self.pc, ival) ) * * def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<< * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_61setASMLocalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_60setASMLocalSubdomains[] = "PC.setASMLocalSubdomains(self, nsd, is_=None, is_local=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_61setASMLocalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nsd = 0; PyObject *__pyx_v_is_ = 0; PyObject *__pyx_v_is_local = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMLocalSubdomains (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsd,&__pyx_n_s_is,&__pyx_n_s_is_local,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsd)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_local); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMLocalSubdomains") < 0)) __PYX_ERR(39, 295, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nsd = values[0]; __pyx_v_is_ = values[1]; __pyx_v_is_local = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMLocalSubdomains", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 295, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMLocalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_60setASMLocalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_, __pyx_v_is_local); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_60setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local) { PetscInt __pyx_v_n; PetscInt __pyx_v_i; IS *__pyx_v_isets; IS *__pyx_v_isets_local; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PetscInt __pyx_t_8; PetscInt __pyx_t_9; IS __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMLocalSubdomains", 0); /* "PETSc/PC.pyx":296 * * def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): * cdef PetscInt n = asInt(nsd) # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nsd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 296, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "PETSc/PC.pyx":297 * def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL */ __pyx_v_i = 0; /* "PETSc/PC.pyx":298 * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL # <<<<<<<<<<<<<< * cdef PetscIS *isets_local = NULL * if is_ is not None: */ __pyx_v_isets = NULL; /* "PETSc/PC.pyx":299 * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL # <<<<<<<<<<<<<< * if is_ is not None: * assert len(is_) == nsd */ __pyx_v_isets_local = NULL; /* "PETSc/PC.pyx":300 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ __pyx_t_2 = (__pyx_v_is_ != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/PC.pyx":301 * cdef PetscIS *isets_local = NULL * if is_ is not None: * assert len(is_) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = PyObject_Length(__pyx_v_is_); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(39, 301, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(39, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(39, 301, __pyx_L1_error) } } #endif /* "PETSc/PC.pyx":302 * if is_ is not None: * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) # <<<<<<<<<<<<<< * for i in range(n): * isets[i] = (is_[i]).iset */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 302, __pyx_L1_error) /* "PETSc/PC.pyx":303 * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): # <<<<<<<<<<<<<< * isets[i] = (is_[i]).iset * if is_local is not None: */ __pyx_t_1 = __pyx_v_n; __pyx_t_8 = __pyx_t_1; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "PETSc/PC.pyx":304 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): * isets[i] = (is_[i]).iset # <<<<<<<<<<<<<< * if is_local is not None: * assert len(is_local) == nsd */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_is_, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(39, 304, __pyx_L1_error) __pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_6)->iset; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_isets[__pyx_v_i]) = __pyx_t_10; } /* "PETSc/PC.pyx":300 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ } /* "PETSc/PC.pyx":305 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ __pyx_t_3 = (__pyx_v_is_local != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":306 * isets[i] = (is_[i]).iset * if is_local is not None: * assert len(is_local) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = PyObject_Length(__pyx_v_is_local); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(39, 306, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(39, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(39, 306, __pyx_L1_error) } } #endif /* "PETSc/PC.pyx":307 * if is_local is not None: * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) # <<<<<<<<<<<<<< * for i in range(n): * isets_local[i] = (is_local[i]).iset */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets_local))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 307, __pyx_L1_error) /* "PETSc/PC.pyx":308 * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): # <<<<<<<<<<<<<< * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) */ __pyx_t_1 = __pyx_v_n; __pyx_t_8 = __pyx_t_1; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "PETSc/PC.pyx":309 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): * isets_local[i] = (is_local[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_is_local, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(39, 309, __pyx_L1_error) __pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_5)->iset; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_isets_local[__pyx_v_i]) = __pyx_t_10; } /* "PETSc/PC.pyx":305 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ } /* "PETSc/PC.pyx":310 * for i in range(n): * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetLocalSubdomains(__pyx_v_self->pc, __pyx_v_n, __pyx_v_isets, __pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 310, __pyx_L1_error) /* "PETSc/PC.pyx":311 * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets_local) ) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 311, __pyx_L1_error) /* "PETSc/PC.pyx":312 * CHKERR( PCASMSetLocalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) # <<<<<<<<<<<<<< * * def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 312, __pyx_L1_error) /* "PETSc/PC.pyx":295 * CHKERR( PCASMSetOverlap(self.pc, ival) ) * * def setASMLocalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<< * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMLocalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":314 * CHKERR( PetscFree(isets_local) ) * * def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<< * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_63setASMTotalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_62setASMTotalSubdomains[] = "PC.setASMTotalSubdomains(self, nsd, is_=None, is_local=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_63setASMTotalSubdomains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nsd = 0; PyObject *__pyx_v_is_ = 0; PyObject *__pyx_v_is_local = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setASMTotalSubdomains (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nsd,&__pyx_n_s_is,&__pyx_n_s_is_local,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsd)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_local); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setASMTotalSubdomains") < 0)) __PYX_ERR(39, 314, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_nsd = values[0]; __pyx_v_is_ = values[1]; __pyx_v_is_local = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setASMTotalSubdomains", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 314, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMTotalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_62setASMTotalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_, __pyx_v_is_local); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_62setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_, PyObject *__pyx_v_is_local) { PetscInt __pyx_v_n; PetscInt __pyx_v_i; IS *__pyx_v_isets; IS *__pyx_v_isets_local; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PetscInt __pyx_t_8; PetscInt __pyx_t_9; IS __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setASMTotalSubdomains", 0); /* "PETSc/PC.pyx":315 * * def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): * cdef PetscInt n = asInt(nsd) # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nsd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 315, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "PETSc/PC.pyx":316 * def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL */ __pyx_v_i = 0; /* "PETSc/PC.pyx":317 * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL # <<<<<<<<<<<<<< * cdef PetscIS *isets_local = NULL * if is_ is not None: */ __pyx_v_isets = NULL; /* "PETSc/PC.pyx":318 * cdef PetscInt i = 0 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL # <<<<<<<<<<<<<< * if is_ is not None: * assert len(is_) == nsd */ __pyx_v_isets_local = NULL; /* "PETSc/PC.pyx":319 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ __pyx_t_2 = (__pyx_v_is_ != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/PC.pyx":320 * cdef PetscIS *isets_local = NULL * if is_ is not None: * assert len(is_) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = PyObject_Length(__pyx_v_is_); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(39, 320, __pyx_L1_error) __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(39, 320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(39, 320, __pyx_L1_error) } } #endif /* "PETSc/PC.pyx":321 * if is_ is not None: * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) # <<<<<<<<<<<<<< * for i in range(n): * isets[i] = (is_[i]).iset */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 321, __pyx_L1_error) /* "PETSc/PC.pyx":322 * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): # <<<<<<<<<<<<<< * isets[i] = (is_[i]).iset * if is_local is not None: */ __pyx_t_1 = __pyx_v_n; __pyx_t_8 = __pyx_t_1; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "PETSc/PC.pyx":323 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) * for i in range(n): * isets[i] = (is_[i]).iset # <<<<<<<<<<<<<< * if is_local is not None: * assert len(is_local) == nsd */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_is_, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(39, 323, __pyx_L1_error) __pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_6)->iset; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_isets[__pyx_v_i]) = __pyx_t_10; } /* "PETSc/PC.pyx":319 * cdef PetscIS *isets = NULL * cdef PetscIS *isets_local = NULL * if is_ is not None: # <<<<<<<<<<<<<< * assert len(is_) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets) ) */ } /* "PETSc/PC.pyx":324 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ __pyx_t_3 = (__pyx_v_is_local != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":325 * isets[i] = (is_[i]).iset * if is_local is not None: * assert len(is_local) == nsd # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = PyObject_Length(__pyx_v_is_local); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(39, 325, __pyx_L1_error) __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_nsd, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(39, 325, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(39, 325, __pyx_L1_error) } } #endif /* "PETSc/PC.pyx":326 * if is_local is not None: * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) # <<<<<<<<<<<<<< * for i in range(n): * isets_local[i] = (is_local[i]).iset */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_n) * (sizeof(IS))), (&__pyx_v_isets_local))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 326, __pyx_L1_error) /* "PETSc/PC.pyx":327 * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): # <<<<<<<<<<<<<< * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) */ __pyx_t_1 = __pyx_v_n; __pyx_t_8 = __pyx_t_1; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; /* "PETSc/PC.pyx":328 * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) * for i in range(n): * isets_local[i] = (is_local[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_is_local, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(39, 328, __pyx_L1_error) __pyx_t_10 = ((struct PyPetscISObject *)__pyx_t_5)->iset; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_isets_local[__pyx_v_i]) = __pyx_t_10; } /* "PETSc/PC.pyx":324 * for i in range(n): * isets[i] = (is_[i]).iset * if is_local is not None: # <<<<<<<<<<<<<< * assert len(is_local) == nsd * CHKERR( PetscMalloc(n*sizeof(PetscIS), &isets_local) ) */ } /* "PETSc/PC.pyx":329 * for i in range(n): * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMSetTotalSubdomains(__pyx_v_self->pc, __pyx_v_n, __pyx_v_isets, __pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 329, __pyx_L1_error) /* "PETSc/PC.pyx":330 * isets_local[i] = (is_local[i]).iset * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(isets_local) ) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 330, __pyx_L1_error) /* "PETSc/PC.pyx":331 * CHKERR( PCASMSetTotalSubdomains(self.pc, n, isets, isets_local) ) * CHKERR( PetscFree(isets) ) * CHKERR( PetscFree(isets_local) ) # <<<<<<<<<<<<<< * * def getASMSubKSP(self): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_isets_local)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(39, 331, __pyx_L1_error) /* "PETSc/PC.pyx":314 * CHKERR( PetscFree(isets_local) ) * * def setASMTotalSubdomains(self, nsd, is_=None, is_local=None): # <<<<<<<<<<<<<< * cdef PetscInt n = asInt(nsd) * cdef PetscInt i = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PC.setASMTotalSubdomains", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":333 * CHKERR( PetscFree(isets_local) ) * * def getASMSubKSP(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_65getASMSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_64getASMSubKSP[] = "PC.getASMSubKSP(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_65getASMSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getASMSubKSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getASMSubKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getASMSubKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_64getASMSubKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_64getASMSubKSP(struct PyPetscPCObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; KSP *__pyx_v_p; PetscInt __pyx_8genexpr7__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getASMSubKSP", 0); /* "PETSc/PC.pyx":334 * * def getASMSubKSP(self): * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscKSP *p = NULL * CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) */ __pyx_v_i = 0; __pyx_v_n = 0; /* "PETSc/PC.pyx":335 * def getASMSubKSP(self): * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL # <<<<<<<<<<<<<< * CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) * return [ref_KSP(p[i]) for i from 0 <= i pc, (&__pyx_v_n), NULL, (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 336, __pyx_L1_error) /* "PETSc/PC.pyx":337 * cdef PetscKSP *p = NULL * CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) ) * return [ref_KSP(p[i]) for i from 0 <= i 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGASMType") < 0)) __PYX_ERR(39, 341, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_gasmtype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGASMType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 341, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_66setGASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gasmtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_66setGASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gasmtype) { PCGASMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCGASMType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGASMType", 0); /* "PETSc/PC.pyx":342 * * def setGASMType(self, gasmtype): * cdef PetscPCGASMType cval = gasmtype # <<<<<<<<<<<<<< * CHKERR( PCGASMSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCGASMType)__Pyx_PyInt_As_PCGASMType(__pyx_v_gasmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 342, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/PC.pyx":343 * def setGASMType(self, gasmtype): * cdef PetscPCGASMType cval = gasmtype * CHKERR( PCGASMSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setGASMOverlap(self, overlap): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGASMSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 343, __pyx_L1_error) /* "PETSc/PC.pyx":341 * # --- GASM --- * * def setGASMType(self, gasmtype): # <<<<<<<<<<<<<< * cdef PetscPCGASMType cval = gasmtype * CHKERR( PCGASMSetType(self.pc, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":345 * CHKERR( PCGASMSetType(self.pc, cval) ) * * def setGASMOverlap(self, overlap): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(overlap) * CHKERR( PCGASMSetOverlap(self.pc, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_69setGASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_68setGASMOverlap[] = "PC.setGASMOverlap(self, overlap)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_69setGASMOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_overlap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGASMOverlap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGASMOverlap") < 0)) __PYX_ERR(39, 345, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_overlap = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGASMOverlap", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 345, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_68setGASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_68setGASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGASMOverlap", 0); /* "PETSc/PC.pyx":346 * * def setGASMOverlap(self, overlap): * cdef PetscInt ival = asInt(overlap) # <<<<<<<<<<<<<< * CHKERR( PCGASMSetOverlap(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 346, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/PC.pyx":347 * def setGASMOverlap(self, overlap): * cdef PetscInt ival = asInt(overlap) * CHKERR( PCGASMSetOverlap(self.pc, ival) ) # <<<<<<<<<<<<<< * * # --- GAMG --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGASMSetOverlap(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 347, __pyx_L1_error) /* "PETSc/PC.pyx":345 * CHKERR( PCGASMSetType(self.pc, cval) ) * * def setGASMOverlap(self, overlap): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(overlap) * CHKERR( PCGASMSetOverlap(self.pc, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGASMOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":351 * # --- GAMG --- * * def setGAMGType(self, gamgtype): # <<<<<<<<<<<<<< * cdef PetscPCGAMGType cval = NULL * gamgtype = str2bytes(gamgtype, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71setGAMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_70setGAMGType[] = "PC.setGAMGType(self, gamgtype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71setGAMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_gamgtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGAMGType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gamgtype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gamgtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGAMGType") < 0)) __PYX_ERR(39, 351, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_gamgtype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGAMGType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 351, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_70setGAMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gamgtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_70setGAMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gamgtype) { PCGAMGType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGAMGType", 0); __Pyx_INCREF(__pyx_v_gamgtype); /* "PETSc/PC.pyx":352 * * def setGAMGType(self, gamgtype): * cdef PetscPCGAMGType cval = NULL # <<<<<<<<<<<<<< * gamgtype = str2bytes(gamgtype, &cval) * CHKERR( PCGAMGSetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":353 * def setGAMGType(self, gamgtype): * cdef PetscPCGAMGType cval = NULL * gamgtype = str2bytes(gamgtype, &cval) # <<<<<<<<<<<<<< * CHKERR( PCGAMGSetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_gamgtype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_gamgtype, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":354 * cdef PetscPCGAMGType cval = NULL * gamgtype = str2bytes(gamgtype, &cval) * CHKERR( PCGAMGSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setGAMGLevels(self, levels): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGAMGSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 354, __pyx_L1_error) /* "PETSc/PC.pyx":351 * # --- GAMG --- * * def setGAMGType(self, gamgtype): # <<<<<<<<<<<<<< * cdef PetscPCGAMGType cval = NULL * gamgtype = str2bytes(gamgtype, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gamgtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":356 * CHKERR( PCGAMGSetType(self.pc, cval) ) * * def setGAMGLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(levels) * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setGAMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_72setGAMGLevels[] = "PC.setGAMGLevels(self, levels)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setGAMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_levels = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGAMGLevels (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGAMGLevels") < 0)) __PYX_ERR(39, 356, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGAMGLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 356, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_72setGAMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setGAMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGAMGLevels", 0); /* "PETSc/PC.pyx":357 * * def setGAMGLevels(self, levels): * cdef PetscInt ival = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 357, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/PC.pyx":358 * def setGAMGLevels(self, levels): * cdef PetscInt ival = asInt(levels) * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) # <<<<<<<<<<<<<< * * def setGAMGSmooths(self, smooths): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGAMGSetNlevels(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 358, __pyx_L1_error) /* "PETSc/PC.pyx":356 * CHKERR( PCGAMGSetType(self.pc, cval) ) * * def setGAMGLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(levels) * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":360 * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) * * def setGAMGSmooths(self, smooths): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(smooths) * CHKERR( PCGAMGSetNSmooths(self.pc, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_75setGAMGSmooths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_74setGAMGSmooths[] = "PC.setGAMGSmooths(self, smooths)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_75setGAMGSmooths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_smooths = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGAMGSmooths (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_smooths,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smooths)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGAMGSmooths") < 0)) __PYX_ERR(39, 360, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_smooths = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGAMGSmooths", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 360, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGSmooths", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_74setGAMGSmooths(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_smooths); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setGAMGSmooths(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_smooths) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGAMGSmooths", 0); /* "PETSc/PC.pyx":361 * * def setGAMGSmooths(self, smooths): * cdef PetscInt ival = asInt(smooths) # <<<<<<<<<<<<<< * CHKERR( PCGAMGSetNSmooths(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_smooths); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 361, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/PC.pyx":362 * def setGAMGSmooths(self, smooths): * cdef PetscInt ival = asInt(smooths) * CHKERR( PCGAMGSetNSmooths(self.pc, ival) ) # <<<<<<<<<<<<<< * * # --- Hypre --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGAMGSetNSmooths(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 362, __pyx_L1_error) /* "PETSc/PC.pyx":360 * CHKERR( PCGAMGSetNlevels(self.pc, ival) ) * * def setGAMGSmooths(self, smooths): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(smooths) * CHKERR( PCGAMGSetNSmooths(self.pc, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setGAMGSmooths", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":366 * # --- Hypre --- * * def getHYPREType(self): # <<<<<<<<<<<<<< * cdef PetscPCHYPREType cval = NULL * CHKERR( PCHYPREGetType(self.pc, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77getHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_76getHYPREType[] = "PC.getHYPREType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77getHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHYPREType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getHYPREType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getHYPREType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_76getHYPREType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76getHYPREType(struct PyPetscPCObject *__pyx_v_self) { const char* __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHYPREType", 0); /* "PETSc/PC.pyx":367 * * def getHYPREType(self): * cdef PetscPCHYPREType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCHYPREGetType(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":368 * def getHYPREType(self): * cdef PetscPCHYPREType cval = NULL * CHKERR( PCHYPREGetType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPREGetType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 368, __pyx_L1_error) /* "PETSc/PC.pyx":369 * cdef PetscPCHYPREType cval = NULL * CHKERR( PCHYPREGetType(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setHYPREType(self, hypretype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/PC.pyx":366 * # --- Hypre --- * * def getHYPREType(self): # <<<<<<<<<<<<<< * cdef PetscPCHYPREType cval = NULL * CHKERR( PCHYPREGetType(self.pc, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getHYPREType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":371 * return bytes2str(cval) * * def setHYPREType(self, hypretype): # <<<<<<<<<<<<<< * cdef PetscPCHYPREType cval = NULL * hypretype = str2bytes(hypretype, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79setHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_78setHYPREType[] = "PC.setHYPREType(self, hypretype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79setHYPREType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hypretype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPREType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hypretype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hypretype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPREType") < 0)) __PYX_ERR(39, 371, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_hypretype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPREType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 371, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_78setHYPREType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_hypretype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78setHYPREType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_hypretype) { const char* __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPREType", 0); __Pyx_INCREF(__pyx_v_hypretype); /* "PETSc/PC.pyx":372 * * def setHYPREType(self, hypretype): * cdef PetscPCHYPREType cval = NULL # <<<<<<<<<<<<<< * hypretype = str2bytes(hypretype, &cval) * CHKERR( PCHYPRESetType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":373 * def setHYPREType(self, hypretype): * cdef PetscPCHYPREType cval = NULL * hypretype = str2bytes(hypretype, &cval) # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_hypretype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_hypretype, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":374 * cdef PetscPCHYPREType cval = NULL * hypretype = str2bytes(hypretype, &cval) * CHKERR( PCHYPRESetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setHYPREDiscreteCurl(self, Mat mat): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 374, __pyx_L1_error) /* "PETSc/PC.pyx":371 * return bytes2str(cval) * * def setHYPREType(self, hypretype): # <<<<<<<<<<<<<< * cdef PetscPCHYPREType cval = NULL * hypretype = str2bytes(hypretype, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hypretype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":376 * CHKERR( PCHYPRESetType(self.pc, cval) ) * * def setHYPREDiscreteCurl(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_81setHYPREDiscreteCurl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_80setHYPREDiscreteCurl[] = "PC.setHYPREDiscreteCurl(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_81setHYPREDiscreteCurl(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPREDiscreteCurl (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPREDiscreteCurl") < 0)) __PYX_ERR(39, 376, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPREDiscreteCurl", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 376, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteCurl", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(39, 376, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_80setHYPREDiscreteCurl(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80setHYPREDiscreteCurl(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPREDiscreteCurl", 0); /* "PETSc/PC.pyx":377 * * def setHYPREDiscreteCurl(self, Mat mat): * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def setHYPREDiscreteGradient(self, Mat mat): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetDiscreteCurl(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 377, __pyx_L1_error) /* "PETSc/PC.pyx":376 * CHKERR( PCHYPRESetType(self.pc, cval) ) * * def setHYPREDiscreteCurl(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteCurl", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":379 * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) * * def setHYPREDiscreteGradient(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setHYPREDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_82setHYPREDiscreteGradient[] = "PC.setHYPREDiscreteGradient(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setHYPREDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPREDiscreteGradient (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPREDiscreteGradient") < 0)) __PYX_ERR(39, 379, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPREDiscreteGradient", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 379, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(39, 379, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_82setHYPREDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setHYPREDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPREDiscreteGradient", 0); /* "PETSc/PC.pyx":380 * * def setHYPREDiscreteGradient(self, Mat mat): * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def setHYPRESetAlphaPoissonMatrix(self, Mat mat): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetDiscreteGradient(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 380, __pyx_L1_error) /* "PETSc/PC.pyx":379 * CHKERR( PCHYPRESetDiscreteCurl(self.pc, mat.mat) ) * * def setHYPREDiscreteGradient(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPREDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":382 * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) * * def setHYPRESetAlphaPoissonMatrix(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_84setHYPRESetAlphaPoissonMatrix[] = "PC.setHYPRESetAlphaPoissonMatrix(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPRESetAlphaPoissonMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPRESetAlphaPoissonMatrix") < 0)) __PYX_ERR(39, 382, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPRESetAlphaPoissonMatrix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 382, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetAlphaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(39, 382, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_84setHYPRESetAlphaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setHYPRESetAlphaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPRESetAlphaPoissonMatrix", 0); /* "PETSc/PC.pyx":383 * * def setHYPRESetAlphaPoissonMatrix(self, Mat mat): * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) # <<<<<<<<<<<<<< * * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetAlphaPoissonMatrix(__pyx_v_self->pc, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 383, __pyx_L1_error) /* "PETSc/PC.pyx":382 * CHKERR( PCHYPRESetDiscreteGradient(self.pc, mat.mat) ) * * def setHYPRESetAlphaPoissonMatrix(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetAlphaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":385 * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) * * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None): # <<<<<<<<<<<<<< * cdef PetscMat pmat = NULL * if mat is not None: pmat = mat.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_87setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_86setHYPRESetBetaPoissonMatrix[] = "PC.setHYPRESetBetaPoissonMatrix(self, Mat mat=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_87setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPRESetBetaPoissonMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPRESetBetaPoissonMatrix") < 0)) __PYX_ERR(39, 385, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPRESetBetaPoissonMatrix", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 385, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetBetaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(39, 385, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_86setHYPRESetBetaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setHYPRESetBetaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPRESetBetaPoissonMatrix", 0); /* "PETSc/PC.pyx":386 * * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None): * cdef PetscMat pmat = NULL # <<<<<<<<<<<<<< * if mat is not None: pmat = mat.mat * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) */ __pyx_v_pmat = NULL; /* "PETSc/PC.pyx":387 * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None): * cdef PetscMat pmat = NULL * if mat is not None: pmat = mat.mat # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_mat) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_mat->mat; __pyx_v_pmat = __pyx_t_3; } /* "PETSc/PC.pyx":388 * cdef PetscMat pmat = NULL * if mat is not None: pmat = mat.mat * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) # <<<<<<<<<<<<<< * * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetBetaPoissonMatrix(__pyx_v_self->pc, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 388, __pyx_L1_error) /* "PETSc/PC.pyx":385 * CHKERR( PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat) ) * * def setHYPRESetBetaPoissonMatrix(self, Mat mat=None): # <<<<<<<<<<<<<< * cdef PetscMat pmat = NULL * if mat is not None: pmat = mat.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetBetaPoissonMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":390 * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) * * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None): # <<<<<<<<<<<<<< * cdef PetscVec zzo_vec = NULL * if zzo is not None: zzo_vec = zzo.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_88setHYPRESetEdgeConstantVectors[] = "PC.setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_ozz = 0; struct PyPetscVecObject *__pyx_v_zoz = 0; struct PyPetscVecObject *__pyx_v_zzo = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHYPRESetEdgeConstantVectors (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ozz,&__pyx_n_s_zoz,&__pyx_n_s_zzo,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ozz)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zoz)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setHYPRESetEdgeConstantVectors", 0, 2, 3, 1); __PYX_ERR(39, 390, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zzo); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHYPRESetEdgeConstantVectors") < 0)) __PYX_ERR(39, 390, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ozz = ((struct PyPetscVecObject *)values[0]); __pyx_v_zoz = ((struct PyPetscVecObject *)values[1]); __pyx_v_zzo = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHYPRESetEdgeConstantVectors", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 390, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetEdgeConstantVectors", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ozz), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ozz", 0))) __PYX_ERR(39, 390, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zoz), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "zoz", 0))) __PYX_ERR(39, 390, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zzo), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "zzo", 0))) __PYX_ERR(39, 390, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_88setHYPRESetEdgeConstantVectors(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ozz, __pyx_v_zoz, __pyx_v_zzo); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setHYPRESetEdgeConstantVectors(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_ozz, struct PyPetscVecObject *__pyx_v_zoz, struct PyPetscVecObject *__pyx_v_zzo) { Vec __pyx_v_zzo_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHYPRESetEdgeConstantVectors", 0); /* "PETSc/PC.pyx":391 * * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None): * cdef PetscVec zzo_vec = NULL # <<<<<<<<<<<<<< * if zzo is not None: zzo_vec = zzo.vec * CHKERR( PCHYPRESetEdgeConstantVectors(self.pc, ozz.vec, zoz.vec, */ __pyx_v_zzo_vec = NULL; /* "PETSc/PC.pyx":392 * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None): * cdef PetscVec zzo_vec = NULL * if zzo is not None: zzo_vec = zzo.vec # <<<<<<<<<<<<<< * CHKERR( PCHYPRESetEdgeConstantVectors(self.pc, ozz.vec, zoz.vec, * zzo_vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_zzo) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_zzo->vec; __pyx_v_zzo_vec = __pyx_t_3; } /* "PETSc/PC.pyx":393 * cdef PetscVec zzo_vec = NULL * if zzo is not None: zzo_vec = zzo.vec * CHKERR( PCHYPRESetEdgeConstantVectors(self.pc, ozz.vec, zoz.vec, # <<<<<<<<<<<<<< * zzo_vec) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHYPRESetEdgeConstantVectors(__pyx_v_self->pc, __pyx_v_ozz->vec, __pyx_v_zoz->vec, __pyx_v_zzo_vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 393, __pyx_L1_error) /* "PETSc/PC.pyx":390 * CHKERR( PCHYPRESetBetaPoissonMatrix(self.pc, pmat) ) * * def setHYPRESetEdgeConstantVectors(self, Vec ozz, Vec zoz, Vec zzo=None): # <<<<<<<<<<<<<< * cdef PetscVec zzo_vec = NULL * if zzo is not None: zzo_vec = zzo.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setHYPRESetEdgeConstantVectors", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":398 * # --- Factor --- * * def setFactorSolverType(self, solver): # <<<<<<<<<<<<<< * cdef PetscMatSolverType cval = NULL * solver = str2bytes(solver, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_91setFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_90setFactorSolverType[] = "PC.setFactorSolverType(self, solver)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_91setFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_solver = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorSolverType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_solver,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorSolverType") < 0)) __PYX_ERR(39, 398, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_solver = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorSolverType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 398, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_90setFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_solver); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setFactorSolverType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_solver) { MatSolverType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorSolverType", 0); __Pyx_INCREF(__pyx_v_solver); /* "PETSc/PC.pyx":399 * * def setFactorSolverType(self, solver): * cdef PetscMatSolverType cval = NULL # <<<<<<<<<<<<<< * solver = str2bytes(solver, &cval) * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":400 * def setFactorSolverType(self, solver): * cdef PetscMatSolverType cval = NULL * solver = str2bytes(solver, &cval) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_solver, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_solver, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":401 * cdef PetscMatSolverType cval = NULL * solver = str2bytes(solver, &cval) * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getFactorSolverType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetMatSolverType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 401, __pyx_L1_error) /* "PETSc/PC.pyx":398 * # --- Factor --- * * def setFactorSolverType(self, solver): # <<<<<<<<<<<<<< * cdef PetscMatSolverType cval = NULL * solver = str2bytes(solver, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_solver); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":403 * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) * * def getFactorSolverType(self): # <<<<<<<<<<<<<< * cdef PetscMatSolverType cval = NULL * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_93getFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_92getFactorSolverType[] = "PC.getFactorSolverType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_93getFactorSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFactorSolverType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFactorSolverType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFactorSolverType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_92getFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92getFactorSolverType(struct PyPetscPCObject *__pyx_v_self) { MatSolverType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFactorSolverType", 0); /* "PETSc/PC.pyx":404 * * def getFactorSolverType(self): * cdef PetscMatSolverType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":405 * def getFactorSolverType(self): * cdef PetscMatSolverType cval = NULL * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorGetMatSolverType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 405, __pyx_L1_error) /* "PETSc/PC.pyx":406 * cdef PetscMatSolverType cval = NULL * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFactorSetUpSolverType(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/PC.pyx":403 * CHKERR( PCFactorSetMatSolverType(self.pc, cval) ) * * def getFactorSolverType(self): # <<<<<<<<<<<<<< * cdef PetscMatSolverType cval = NULL * CHKERR( PCFactorGetMatSolverType(self.pc, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFactorSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":408 * return bytes2str(cval) * * def setFactorSetUpSolverType(self): # <<<<<<<<<<<<<< * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95setFactorSetUpSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_94setFactorSetUpSolverType[] = "PC.setFactorSetUpSolverType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95setFactorSetUpSolverType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorSetUpSolverType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFactorSetUpSolverType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFactorSetUpSolverType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_94setFactorSetUpSolverType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94setFactorSetUpSolverType(struct PyPetscPCObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorSetUpSolverType", 0); /* "PETSc/PC.pyx":409 * * def setFactorSetUpSolverType(self): * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) # <<<<<<<<<<<<<< * * def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetUpMatSolverType(__pyx_v_self->pc)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 409, __pyx_L1_error) /* "PETSc/PC.pyx":408 * return bytes2str(cval) * * def setFactorSetUpSolverType(self): # <<<<<<<<<<<<<< * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorSetUpSolverType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":411 * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) * * def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): # <<<<<<<<<<<<<< * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setFactorOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_96setFactorOrdering[] = "PC.setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setFactorOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ord_type = 0; PyObject *__pyx_v_nzdiag = 0; PyObject *__pyx_v_reuse = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorOrdering (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ord_type,&__pyx_n_s_nzdiag,&__pyx_n_s_reuse,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ord_type); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzdiag); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reuse); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorOrdering") < 0)) __PYX_ERR(39, 411, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ord_type = values[0]; __pyx_v_nzdiag = values[1]; __pyx_v_reuse = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorOrdering", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 411, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_96setFactorOrdering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ord_type, __pyx_v_nzdiag, __pyx_v_reuse); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setFactorOrdering(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ord_type, PyObject *__pyx_v_nzdiag, PyObject *__pyx_v_reuse) { MatOrderingType __pyx_v_cval; PetscReal __pyx_v_rval; PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PetscReal __pyx_t_5; PetscBool __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorOrdering", 0); __Pyx_INCREF(__pyx_v_ord_type); /* "PETSc/PC.pyx":412 * * def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): * cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<< * if ord_type is not None: * ord_type = str2bytes(ord_type, &cval) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":413 * def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: # <<<<<<<<<<<<<< * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) */ __pyx_t_1 = (__pyx_v_ord_type != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":414 * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: * ord_type = str2bytes(ord_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ord_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ord_type, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":415 * if ord_type is not None: * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * if nzdiag is not None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetMatOrderingType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 415, __pyx_L1_error) /* "PETSc/PC.pyx":413 * def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: # <<<<<<<<<<<<<< * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) */ } /* "PETSc/PC.pyx":416 * ord_type = str2bytes(ord_type, &cval) * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * if nzdiag is not None: * rval = asReal(nzdiag) */ __pyx_v_rval = 0.0; /* "PETSc/PC.pyx":417 * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 * if nzdiag is not None: # <<<<<<<<<<<<<< * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) */ __pyx_t_2 = (__pyx_v_nzdiag != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/PC.pyx":418 * cdef PetscReal rval = 0 * if nzdiag is not None: * rval = asReal(nzdiag) # <<<<<<<<<<<<<< * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_nzdiag); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(39, 418, __pyx_L1_error) __pyx_v_rval = __pyx_t_5; /* "PETSc/PC.pyx":419 * if nzdiag is not None: * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) # <<<<<<<<<<<<<< * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorReorderForNonzeroDiagonal(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 419, __pyx_L1_error) /* "PETSc/PC.pyx":417 * CHKERR( PCFactorSetMatOrderingType(self.pc, cval) ) * cdef PetscReal rval = 0 * if nzdiag is not None: # <<<<<<<<<<<<<< * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) */ } /* "PETSc/PC.pyx":420 * rval = asReal(nzdiag) * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE # <<<<<<<<<<<<<< * if reuse is not None: * bval = PETSC_TRUE if reuse else PETSC_FALSE */ __pyx_v_bval = PETSC_FALSE; /* "PETSc/PC.pyx":421 * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if reuse else PETSC_FALSE * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) */ __pyx_t_1 = (__pyx_v_reuse != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":422 * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: * bval = PETSC_TRUE if reuse else PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reuse); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(39, 422, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_6 = PETSC_TRUE; } else { __pyx_t_6 = PETSC_FALSE; } __pyx_v_bval = __pyx_t_6; /* "PETSc/PC.pyx":423 * if reuse is not None: * bval = PETSC_TRUE if reuse else PETSC_FALSE * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) # <<<<<<<<<<<<<< * * def setFactorPivot(self, zeropivot=None, inblocks=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetReuseOrdering(__pyx_v_self->pc, __pyx_v_bval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 423, __pyx_L1_error) /* "PETSc/PC.pyx":421 * CHKERR( PCFactorReorderForNonzeroDiagonal(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if reuse is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if reuse else PETSC_FALSE * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) */ } /* "PETSc/PC.pyx":411 * CHKERR( PCFactorSetUpMatSolverType(self.pc) ) * * def setFactorOrdering(self, ord_type=None, nzdiag=None, reuse=None): # <<<<<<<<<<<<<< * cdef PetscMatOrderingType cval = NULL * if ord_type is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ord_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":425 * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) * * def setFactorPivot(self, zeropivot=None, inblocks=None): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * if zeropivot is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_99setFactorPivot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_98setFactorPivot[] = "PC.setFactorPivot(self, zeropivot=None, inblocks=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_99setFactorPivot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_zeropivot = 0; PyObject *__pyx_v_inblocks = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorPivot (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_zeropivot,&__pyx_n_s_inblocks,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zeropivot); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inblocks); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorPivot") < 0)) __PYX_ERR(39, 425, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_zeropivot = values[0]; __pyx_v_inblocks = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorPivot", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 425, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorPivot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_98setFactorPivot(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_zeropivot, __pyx_v_inblocks); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setFactorPivot(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_zeropivot, PyObject *__pyx_v_inblocks) { PetscReal __pyx_v_rval; PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; int __pyx_t_4; PetscBool __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorPivot", 0); /* "PETSc/PC.pyx":426 * * def setFactorPivot(self, zeropivot=None, inblocks=None): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * if zeropivot is not None: * rval = asReal(zeropivot) */ __pyx_v_rval = 0.0; /* "PETSc/PC.pyx":427 * def setFactorPivot(self, zeropivot=None, inblocks=None): * cdef PetscReal rval = 0 * if zeropivot is not None: # <<<<<<<<<<<<<< * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) */ __pyx_t_1 = (__pyx_v_zeropivot != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":428 * cdef PetscReal rval = 0 * if zeropivot is not None: * rval = asReal(zeropivot) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zeropivot); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(39, 428, __pyx_L1_error) __pyx_v_rval = __pyx_t_3; /* "PETSc/PC.pyx":429 * if zeropivot is not None: * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) # <<<<<<<<<<<<<< * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetZeroPivot(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 429, __pyx_L1_error) /* "PETSc/PC.pyx":427 * def setFactorPivot(self, zeropivot=None, inblocks=None): * cdef PetscReal rval = 0 * if zeropivot is not None: # <<<<<<<<<<<<<< * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) */ } /* "PETSc/PC.pyx":430 * rval = asReal(zeropivot) * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE # <<<<<<<<<<<<<< * if inblocks is not None: * bval = PETSC_TRUE if inblocks else PETSC_FALSE */ __pyx_v_bval = PETSC_FALSE; /* "PETSc/PC.pyx":431 * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if inblocks else PETSC_FALSE * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) */ __pyx_t_2 = (__pyx_v_inblocks != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/PC.pyx":432 * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: * bval = PETSC_TRUE if inblocks else PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) * */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inblocks); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(39, 432, __pyx_L1_error) if (__pyx_t_1) { __pyx_t_5 = PETSC_TRUE; } else { __pyx_t_5 = PETSC_FALSE; } __pyx_v_bval = __pyx_t_5; /* "PETSc/PC.pyx":433 * if inblocks is not None: * bval = PETSC_TRUE if inblocks else PETSC_FALSE * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) # <<<<<<<<<<<<<< * * def setFactorShift(self, shift_type=None, amount=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetPivotInBlocks(__pyx_v_self->pc, __pyx_v_bval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 433, __pyx_L1_error) /* "PETSc/PC.pyx":431 * CHKERR( PCFactorSetZeroPivot(self.pc, rval) ) * cdef PetscBool bval = PETSC_FALSE * if inblocks is not None: # <<<<<<<<<<<<<< * bval = PETSC_TRUE if inblocks else PETSC_FALSE * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) */ } /* "PETSc/PC.pyx":425 * CHKERR( PCFactorSetReuseOrdering(self.pc, bval) ) * * def setFactorPivot(self, zeropivot=None, inblocks=None): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * if zeropivot is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorPivot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":435 * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) * * def setFactorShift(self, shift_type=None, amount=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_101setFactorShift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_100setFactorShift[] = "PC.setFactorShift(self, shift_type=None, amount=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_101setFactorShift(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_shift_type = 0; PyObject *__pyx_v_amount = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorShift (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shift_type,&__pyx_n_s_amount,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shift_type); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_amount); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorShift") < 0)) __PYX_ERR(39, 435, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shift_type = values[0]; __pyx_v_amount = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorShift", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 435, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorShift", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_100setFactorShift(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_shift_type, __pyx_v_amount); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setFactorShift(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_shift_type, PyObject *__pyx_v_amount) { MatFactorShiftType __pyx_v_cval; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; MatFactorShiftType __pyx_t_3; int __pyx_t_4; PetscReal __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorShift", 0); /* "PETSc/PC.pyx":436 * * def setFactorShift(self, shift_type=None, amount=None): * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE # <<<<<<<<<<<<<< * if shift_type is not None: * cval = matfactorshifttype(shift_type) */ __pyx_v_cval = MAT_SHIFT_NONE; /* "PETSc/PC.pyx":437 * def setFactorShift(self, shift_type=None, amount=None): * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: # <<<<<<<<<<<<<< * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) */ __pyx_t_1 = (__pyx_v_shift_type != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":438 * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: * cval = matfactorshifttype(shift_type) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_matfactorshifttype(__pyx_v_shift_type); if (unlikely(__pyx_t_3 == ((MatFactorShiftType)((MatFactorShiftType)-1L)))) __PYX_ERR(39, 438, __pyx_L1_error) __pyx_v_cval = __pyx_t_3; /* "PETSc/PC.pyx":439 * if shift_type is not None: * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * if amount is not None: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetShiftType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 439, __pyx_L1_error) /* "PETSc/PC.pyx":437 * def setFactorShift(self, shift_type=None, amount=None): * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: # <<<<<<<<<<<<<< * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) */ } /* "PETSc/PC.pyx":440 * cval = matfactorshifttype(shift_type) * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * if amount is not None: * rval = asReal(amount) */ __pyx_v_rval = 0.0; /* "PETSc/PC.pyx":441 * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 * if amount is not None: # <<<<<<<<<<<<<< * rval = asReal(amount) * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) */ __pyx_t_2 = (__pyx_v_amount != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/PC.pyx":442 * cdef PetscReal rval = 0 * if amount is not None: * rval = asReal(amount) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_amount); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(39, 442, __pyx_L1_error) __pyx_v_rval = __pyx_t_5; /* "PETSc/PC.pyx":443 * if amount is not None: * rval = asReal(amount) * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) # <<<<<<<<<<<<<< * * def setFactorLevels(self, levels): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetShiftAmount(__pyx_v_self->pc, __pyx_v_rval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 443, __pyx_L1_error) /* "PETSc/PC.pyx":441 * CHKERR( PCFactorSetShiftType(self.pc, cval) ) * cdef PetscReal rval = 0 * if amount is not None: # <<<<<<<<<<<<<< * rval = asReal(amount) * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) */ } /* "PETSc/PC.pyx":435 * CHKERR( PCFactorSetPivotInBlocks(self.pc, bval) ) * * def setFactorShift(self, shift_type=None, amount=None): # <<<<<<<<<<<<<< * cdef PetscMatFactorShiftType cval = MAT_SHIFT_NONE * if shift_type is not None: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorShift", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":445 * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) * * def setFactorLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(levels) * CHKERR( PCFactorSetLevels(self.pc, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_103setFactorLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_102setFactorLevels[] = "PC.setFactorLevels(self, levels)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_103setFactorLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_levels = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFactorLevels (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFactorLevels") < 0)) __PYX_ERR(39, 445, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFactorLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 445, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_102setFactorLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setFactorLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFactorLevels", 0); /* "PETSc/PC.pyx":446 * * def setFactorLevels(self, levels): * cdef PetscInt ival = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCFactorSetLevels(self.pc, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 446, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/PC.pyx":447 * def setFactorLevels(self, levels): * cdef PetscInt ival = asInt(levels) * CHKERR( PCFactorSetLevels(self.pc, ival) ) # <<<<<<<<<<<<<< * * def getFactorMatrix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorSetLevels(__pyx_v_self->pc, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 447, __pyx_L1_error) /* "PETSc/PC.pyx":445 * CHKERR( PCFactorSetShiftAmount(self.pc, rval) ) * * def setFactorLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(levels) * CHKERR( PCFactorSetLevels(self.pc, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFactorLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":449 * CHKERR( PCFactorSetLevels(self.pc, ival) ) * * def getFactorMatrix(self): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_105getFactorMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_104getFactorMatrix[] = "PC.getFactorMatrix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_105getFactorMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFactorMatrix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFactorMatrix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFactorMatrix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_104getFactorMatrix(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104getFactorMatrix(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFactorMatrix", 0); /* "PETSc/PC.pyx":450 * * def getFactorMatrix(self): * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) * PetscINCREF(mat.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":451 * def getFactorMatrix(self): * cdef Mat mat = Mat() * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * return mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorGetMatrix(__pyx_v_self->pc, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 451, __pyx_L1_error) /* "PETSc/PC.pyx":452 * cdef Mat mat = Mat() * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * return mat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/PC.pyx":453 * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) * PetscINCREF(mat.obj) * return mat # <<<<<<<<<<<<<< * * # --- FieldSplit --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/PC.pyx":449 * CHKERR( PCFactorSetLevels(self.pc, ival) ) * * def getFactorMatrix(self): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( PCFactorGetMatrix(self.pc, &mat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFactorMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":457 * # --- FieldSplit --- * * def setFieldSplitType(self, ctype): # <<<<<<<<<<<<<< * cdef PetscPCCompositeType cval = ctype * CHKERR( PCFieldSplitSetType(self.pc, cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_107setFieldSplitType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_106setFieldSplitType[] = "PC.setFieldSplitType(self, ctype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_107setFieldSplitType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ctype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldSplitType") < 0)) __PYX_ERR(39, 457, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ctype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 457, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_106setFieldSplitType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setFieldSplitType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) { PCCompositeType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCCompositeType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitType", 0); /* "PETSc/PC.pyx":458 * * def setFieldSplitType(self, ctype): * cdef PetscPCCompositeType cval = ctype # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCCompositeType)__Pyx_PyInt_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 458, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/PC.pyx":459 * def setFieldSplitType(self, ctype): * cdef PetscPCCompositeType cval = ctype * CHKERR( PCFieldSplitSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setFieldSplitIS(self, *fields): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 459, __pyx_L1_error) /* "PETSc/PC.pyx":457 * # --- FieldSplit --- * * def setFieldSplitType(self, ctype): # <<<<<<<<<<<<<< * cdef PetscPCCompositeType cval = ctype * CHKERR( PCFieldSplitSetType(self.pc, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":461 * CHKERR( PCFieldSplitSetType(self.pc, cval) ) * * def setFieldSplitIS(self, *fields): # <<<<<<<<<<<<<< * cdef object name = None * cdef IS field = None */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_109setFieldSplitIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_108setFieldSplitIS[] = "PC.setFieldSplitIS(self, *fields)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_109setFieldSplitIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fields = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitIS (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFieldSplitIS", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_fields = __pyx_args; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_108setFieldSplitIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_fields); /* function exit code */ __Pyx_XDECREF(__pyx_v_fields); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_108setFieldSplitIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fields) { PyObject *__pyx_v_name = 0; struct PyPetscISObject *__pyx_v_field = 0; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitIS", 0); /* "PETSc/PC.pyx":462 * * def setFieldSplitIS(self, *fields): * cdef object name = None # <<<<<<<<<<<<<< * cdef IS field = None * cdef const char *cname = NULL */ __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; /* "PETSc/PC.pyx":463 * def setFieldSplitIS(self, *fields): * cdef object name = None * cdef IS field = None # <<<<<<<<<<<<<< * cdef const char *cname = NULL * for name, field in fields: */ __Pyx_INCREF(Py_None); __pyx_v_field = ((struct PyPetscISObject *)Py_None); /* "PETSc/PC.pyx":464 * cdef object name = None * cdef IS field = None * cdef const char *cname = NULL # <<<<<<<<<<<<<< * for name, field in fields: * name = str2bytes(name, &cname) */ __pyx_v_cname = NULL; /* "PETSc/PC.pyx":465 * cdef IS field = None * cdef const char *cname = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) */ __pyx_t_1 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(39, 465, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(39, 465, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(39, 465, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(39, 465, __pyx_L1_error) __pyx_L6_unpacking_done:; } if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(39, 465, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_field, ((struct PyPetscISObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "PETSc/PC.pyx":466 * cdef const char *cname = NULL * for name, field in fields: * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":467 * for name, field in fields: * name = str2bytes(name, &cname) * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) # <<<<<<<<<<<<<< * * def setFieldSplitFields(self, bsize, *fields): */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetIS(__pyx_v_self->pc, __pyx_v_cname, __pyx_v_field->iset)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(39, 467, __pyx_L1_error) /* "PETSc/PC.pyx":465 * cdef IS field = None * cdef const char *cname = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":461 * CHKERR( PCFieldSplitSetType(self.pc, cval) ) * * def setFieldSplitIS(self, *fields): # <<<<<<<<<<<<<< * cdef object name = None * cdef IS field = None */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF((PyObject *)__pyx_v_field); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":469 * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) * * def setFieldSplitFields(self, bsize, *fields): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_111setFieldSplitFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_110setFieldSplitFields[] = "PC.setFieldSplitFields(self, bsize, *fields)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_111setFieldSplitFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bsize = 0; PyObject *__pyx_v_fields = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitFields (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_fields = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_fields)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_fields); } else { __pyx_v_fields = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bsize,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bsize)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "setFieldSplitFields") < 0)) __PYX_ERR(39, 469, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bsize = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitFields", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 469, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_fields); __pyx_v_fields = 0; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_110setFieldSplitFields(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_fields); /* function exit code */ __Pyx_XDECREF(__pyx_v_fields); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_110setFieldSplitFields(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_fields) { PetscInt __pyx_v_bs; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_field = 0; char const *__pyx_v_cname; PetscInt __pyx_v_nfields; PetscInt *__pyx_v_ifields; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitFields", 0); /* "PETSc/PC.pyx":470 * * def setFieldSplitFields(self, bsize, *fields): * cdef PetscInt bs = asInt(bsize) # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) * cdef object name = None */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_bsize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 470, __pyx_L1_error) __pyx_v_bs = __pyx_t_1; /* "PETSc/PC.pyx":471 * def setFieldSplitFields(self, bsize, *fields): * cdef PetscInt bs = asInt(bsize) * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) # <<<<<<<<<<<<<< * cdef object name = None * cdef object field = None */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetBlockSize(__pyx_v_self->pc, __pyx_v_bs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 471, __pyx_L1_error) /* "PETSc/PC.pyx":472 * cdef PetscInt bs = asInt(bsize) * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) * cdef object name = None # <<<<<<<<<<<<<< * cdef object field = None * cdef const char *cname = NULL */ __Pyx_INCREF(Py_None); __pyx_v_name = Py_None; /* "PETSc/PC.pyx":473 * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) * cdef object name = None * cdef object field = None # <<<<<<<<<<<<<< * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL */ __Pyx_INCREF(Py_None); __pyx_v_field = Py_None; /* "PETSc/PC.pyx":474 * cdef object name = None * cdef object field = None * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: */ __pyx_v_cname = NULL; /* "PETSc/PC.pyx":475 * cdef object field = None * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL # <<<<<<<<<<<<<< * for name, field in fields: * name = str2bytes(name, &cname) */ __pyx_v_nfields = 0; __pyx_v_ifields = NULL; /* "PETSc/PC.pyx":476 * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) */ __pyx_t_3 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(39, 476, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { PyObject* sequence = __pyx_t_5; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(39, 476, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_6 = PyList_GET_ITEM(sequence, 0); __pyx_t_7 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); #else __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(39, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { Py_ssize_t index = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(39, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(39, 476, __pyx_L1_error) __pyx_t_9 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(39, 476, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":477 * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * field = iarray_i(field, &nfields, &ifields) * CHKERR( PCFieldSplitSetFields(self.pc, cname, */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/PC.pyx":478 * for name, field in fields: * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetFields(self.pc, cname, * nfields, ifields, ifields) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_field, (&__pyx_v_nfields), (&__pyx_v_ifields))); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_field, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/PC.pyx":479 * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) * CHKERR( PCFieldSplitSetFields(self.pc, cname, # <<<<<<<<<<<<<< * nfields, ifields, ifields) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetFields(__pyx_v_self->pc, __pyx_v_cname, __pyx_v_nfields, __pyx_v_ifields, __pyx_v_ifields)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 479, __pyx_L1_error) /* "PETSc/PC.pyx":476 * cdef const char *cname = NULL * cdef PetscInt nfields = 0, *ifields = NULL * for name, field in fields: # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * field = iarray_i(field, &nfields, &ifields) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":469 * CHKERR( PCFieldSplitSetIS(self.pc, cname, field.iset) ) * * def setFieldSplitFields(self, bsize, *fields): # <<<<<<<<<<<<<< * cdef PetscInt bs = asInt(bsize) * CHKERR( PCFieldSplitSetBlockSize(self.pc, bs) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XDECREF(__pyx_v_field); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":482 * nfields, ifields, ifields) ) * * def getFieldSplitSubKSP(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_113getFieldSplitSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_112getFieldSplitSubKSP[] = "PC.getFieldSplitSubKSP(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_113getFieldSplitSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldSplitSubKSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFieldSplitSubKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFieldSplitSubKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_112getFieldSplitSubKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; KSP *__pyx_v_p; PyObject *__pyx_v_subksp = 0; PetscInt __pyx_8genexpr8__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldSplitSubKSP", 0); /* "PETSc/PC.pyx":483 * * def getFieldSplitSubKSP(self): * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscKSP *p = NULL * cdef object subksp = None */ __pyx_v_i = 0; __pyx_v_n = 0; /* "PETSc/PC.pyx":484 * def getFieldSplitSubKSP(self): * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL # <<<<<<<<<<<<<< * cdef object subksp = None * try: */ __pyx_v_p = NULL; /* "PETSc/PC.pyx":485 * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL * cdef object subksp = None # <<<<<<<<<<<<<< * try: * CHKERR( PCFieldSplitGetSubKSP(self.pc, &n, &p) ) */ __Pyx_INCREF(Py_None); __pyx_v_subksp = Py_None; /* "PETSc/PC.pyx":486 * cdef PetscKSP *p = NULL * cdef object subksp = None * try: # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i pc, (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 487, __pyx_L4_error) /* "PETSc/PC.pyx":488 * try: * CHKERR( PCFieldSplitGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i = 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_1 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(39, 490, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/PC.pyx":491 * finally: * CHKERR( PetscFree(p) ) * return subksp # <<<<<<<<<<<<<< * * def getFieldSplitSchurGetSubKSP(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_subksp); __pyx_r = __pyx_v_subksp; goto __pyx_L0; /* "PETSc/PC.pyx":482 * nfields, ifields, ifields) ) * * def getFieldSplitSubKSP(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFieldSplitSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_subksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":493 * return subksp * * def getFieldSplitSchurGetSubKSP(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_115getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_114getFieldSplitSchurGetSubKSP[] = "PC.getFieldSplitSchurGetSubKSP(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_115getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldSplitSchurGetSubKSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFieldSplitSchurGetSubKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFieldSplitSchurGetSubKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_114getFieldSplitSchurGetSubKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; KSP *__pyx_v_p; PyObject *__pyx_v_subksp = 0; PetscInt __pyx_8genexpr9__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldSplitSchurGetSubKSP", 0); /* "PETSc/PC.pyx":494 * * def getFieldSplitSchurGetSubKSP(self): * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscKSP *p = NULL * cdef object subksp = None */ __pyx_v_i = 0; __pyx_v_n = 0; /* "PETSc/PC.pyx":495 * def getFieldSplitSchurGetSubKSP(self): * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL # <<<<<<<<<<<<<< * cdef object subksp = None * try: */ __pyx_v_p = NULL; /* "PETSc/PC.pyx":496 * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL * cdef object subksp = None # <<<<<<<<<<<<<< * try: * CHKERR( PCFieldSplitSchurGetSubKSP(self.pc, &n, &p) ) */ __Pyx_INCREF(Py_None); __pyx_v_subksp = Py_None; /* "PETSc/PC.pyx":497 * cdef PetscKSP *p = NULL * cdef object subksp = None * try: # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSchurGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i pc, (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 498, __pyx_L4_error) /* "PETSc/PC.pyx":499 * try: * CHKERR( PCFieldSplitSchurGetSubKSP(self.pc, &n, &p) ) * subksp = [ref_KSP(p[i]) for i from 0 <= i = 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_1 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(39, 501, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/PC.pyx":502 * finally: * CHKERR( PetscFree(p) ) * return subksp # <<<<<<<<<<<<<< * * def setFieldSplitSchurFactType(self, ctype): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_subksp); __pyx_r = __pyx_v_subksp; goto __pyx_L0; /* "PETSc/PC.pyx":493 * return subksp * * def getFieldSplitSchurGetSubKSP(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, n = 0 * cdef PetscKSP *p = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.PC.getFieldSplitSchurGetSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_subksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":504 * return subksp * * def setFieldSplitSchurFactType(self, ctype): # <<<<<<<<<<<<<< * cdef PetscPCFieldSplitSchurFactType cval = ctype * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFieldSplitSchurFactType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_116setFieldSplitSchurFactType[] = "PC.setFieldSplitSchurFactType(self, ctype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFieldSplitSchurFactType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ctype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitSchurFactType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldSplitSchurFactType") < 0)) __PYX_ERR(39, 504, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ctype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitSchurFactType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 504, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurFactType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_116setFieldSplitSchurFactType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFieldSplitSchurFactType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) { PCFieldSplitSchurFactType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCFieldSplitSchurFactType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitSchurFactType", 0); /* "PETSc/PC.pyx":505 * * def setFieldSplitSchurFactType(self, ctype): * cdef PetscPCFieldSplitSchurFactType cval = ctype # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) * */ __pyx_t_1 = ((PCFieldSplitSchurFactType)__Pyx_PyInt_As_PCFieldSplitSchurFactType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 505, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/PC.pyx":506 * def setFieldSplitSchurFactType(self, ctype): * cdef PetscPCFieldSplitSchurFactType cval = ctype * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def setFieldSplitSchurPreType(self, ptype, Mat pre=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetSchurFactType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 506, __pyx_L1_error) /* "PETSc/PC.pyx":504 * return subksp * * def setFieldSplitSchurFactType(self, ctype): # <<<<<<<<<<<<<< * cdef PetscPCFieldSplitSchurFactType cval = ctype * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurFactType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":508 * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) * * def setFieldSplitSchurPreType(self, ptype, Mat pre=None): # <<<<<<<<<<<<<< * cdef PetscPCFieldSplitSchurPreType pval = ptype * cdef PetscMat pmat = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFieldSplitSchurPreType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_118setFieldSplitSchurPreType[] = "PC.setFieldSplitSchurPreType(self, ptype, Mat pre=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFieldSplitSchurPreType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ptype = 0; struct PyPetscMatObject *__pyx_v_pre = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldSplitSchurPreType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptype,&__pyx_n_s_pre,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pre); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldSplitSchurPreType") < 0)) __PYX_ERR(39, 508, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ptype = values[0]; __pyx_v_pre = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldSplitSchurPreType", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 508, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurPreType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pre), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "pre", 0))) __PYX_ERR(39, 508, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_118setFieldSplitSchurPreType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ptype, __pyx_v_pre); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFieldSplitSchurPreType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ptype, struct PyPetscMatObject *__pyx_v_pre) { PCFieldSplitSchurPreType __pyx_v_pval; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCFieldSplitSchurPreType __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Mat __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldSplitSchurPreType", 0); /* "PETSc/PC.pyx":509 * * def setFieldSplitSchurPreType(self, ptype, Mat pre=None): * cdef PetscPCFieldSplitSchurPreType pval = ptype # <<<<<<<<<<<<<< * cdef PetscMat pmat = NULL * if pre is not None: pmat = pre.mat */ __pyx_t_1 = ((PCFieldSplitSchurPreType)__Pyx_PyInt_As_PCFieldSplitSchurPreType(__pyx_v_ptype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 509, __pyx_L1_error) __pyx_v_pval = __pyx_t_1; /* "PETSc/PC.pyx":510 * def setFieldSplitSchurPreType(self, ptype, Mat pre=None): * cdef PetscPCFieldSplitSchurPreType pval = ptype * cdef PetscMat pmat = NULL # <<<<<<<<<<<<<< * if pre is not None: pmat = pre.mat * CHKERR( PCFieldSplitSetSchurPre(self.pc, pval, pmat) ) */ __pyx_v_pmat = NULL; /* "PETSc/PC.pyx":511 * cdef PetscPCFieldSplitSchurPreType pval = ptype * cdef PetscMat pmat = NULL * if pre is not None: pmat = pre.mat # <<<<<<<<<<<<<< * CHKERR( PCFieldSplitSetSchurPre(self.pc, pval, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_pre) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_pre->mat; __pyx_v_pmat = __pyx_t_4; } /* "PETSc/PC.pyx":512 * cdef PetscMat pmat = NULL * if pre is not None: pmat = pre.mat * CHKERR( PCFieldSplitSetSchurPre(self.pc, pval, pmat) ) # <<<<<<<<<<<<<< * * # --- COMPOSITE --- */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSetSchurPre(__pyx_v_self->pc, __pyx_v_pval, __pyx_v_pmat)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(39, 512, __pyx_L1_error) /* "PETSc/PC.pyx":508 * CHKERR( PCFieldSplitSetSchurFactType(self.pc, cval) ) * * def setFieldSplitSchurPreType(self, ptype, Mat pre=None): # <<<<<<<<<<<<<< * cdef PetscPCFieldSplitSchurPreType pval = ptype * cdef PetscMat pmat = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setFieldSplitSchurPreType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":516 * # --- COMPOSITE --- * * def setCompositeType(self, ctype): # <<<<<<<<<<<<<< * cdef PetscPCCompositeType cval = ctype * CHKERR( PCCompositeSetType(self.pc, cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setCompositeType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_120setCompositeType[] = "PC.setCompositeType(self, ctype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setCompositeType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ctype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCompositeType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCompositeType") < 0)) __PYX_ERR(39, 516, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ctype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCompositeType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 516, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setCompositeType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_120setCompositeType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_120setCompositeType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype) { PCCompositeType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCCompositeType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCompositeType", 0); /* "PETSc/PC.pyx":517 * * def setCompositeType(self, ctype): * cdef PetscPCCompositeType cval = ctype # <<<<<<<<<<<<<< * CHKERR( PCCompositeSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCCompositeType)__Pyx_PyInt_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 517, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/PC.pyx":518 * def setCompositeType(self, ctype): * cdef PetscPCCompositeType cval = ctype * CHKERR( PCCompositeSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getCompositePC(self, n): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 518, __pyx_L1_error) /* "PETSc/PC.pyx":516 * # --- COMPOSITE --- * * def setCompositeType(self, ctype): # <<<<<<<<<<<<<< * cdef PetscPCCompositeType cval = ctype * CHKERR( PCCompositeSetType(self.pc, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setCompositeType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":520 * CHKERR( PCCompositeSetType(self.pc, cval) ) * * def getCompositePC(self, n): # <<<<<<<<<<<<<< * cdef PC pc = PC() * cdef cn = asInt(n) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123getCompositePC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_122getCompositePC[] = "PC.getCompositePC(self, n)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123getCompositePC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCompositePC (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCompositePC") < 0)) __PYX_ERR(39, 520, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCompositePC", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 520, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getCompositePC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_122getCompositePC(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122getCompositePC(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n) { struct PyPetscPCObject *__pyx_v_pc = 0; PyObject *__pyx_v_cn = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCompositePC", 0); /* "PETSc/PC.pyx":521 * * def getCompositePC(self, n): * cdef PC pc = PC() # <<<<<<<<<<<<<< * cdef cn = asInt(n) * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":522 * def getCompositePC(self, n): * cdef PC pc = PC() * cdef cn = asInt(n) # <<<<<<<<<<<<<< * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) * PetscINCREF(pc.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 522, __pyx_L1_error) __pyx_t_1 = __Pyx_PyInt_From_PetscInt(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cn = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/PC.pyx":523 * cdef PC pc = PC() * cdef cn = asInt(n) * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) # <<<<<<<<<<<<<< * PetscINCREF(pc.obj) * return pc */ __pyx_t_2 = __Pyx_PyInt_As_PetscInt(__pyx_v_cn); if (unlikely((__pyx_t_2 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(39, 523, __pyx_L1_error) __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeGetPC(__pyx_v_self->pc, __pyx_t_2, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 523, __pyx_L1_error) /* "PETSc/PC.pyx":524 * cdef cn = asInt(n) * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) * PetscINCREF(pc.obj) # <<<<<<<<<<<<<< * return pc * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj)); /* "PETSc/PC.pyx":525 * CHKERR( PCCompositeGetPC(self.pc, cn, &pc.pc) ) * PetscINCREF(pc.obj) * return pc # <<<<<<<<<<<<<< * * def addCompositePCType(self, pc_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_pc)); __pyx_r = ((PyObject *)__pyx_v_pc); goto __pyx_L0; /* "PETSc/PC.pyx":520 * CHKERR( PCCompositeSetType(self.pc, cval) ) * * def getCompositePC(self, n): # <<<<<<<<<<<<<< * cdef PC pc = PC() * cdef cn = asInt(n) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getCompositePC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pc); __Pyx_XDECREF(__pyx_v_cn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":527 * return pc * * def addCompositePCType(self, pc_type): # <<<<<<<<<<<<<< * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_125addCompositePCType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_124addCompositePCType[] = "PC.addCompositePCType(self, pc_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_125addCompositePCType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pc_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addCompositePCType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pc_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addCompositePCType") < 0)) __PYX_ERR(39, 527, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_pc_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addCompositePCType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 527, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.addCompositePCType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_124addCompositePCType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_pc_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124addCompositePCType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type) { PCType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addCompositePCType", 0); __Pyx_INCREF(__pyx_v_pc_type); /* "PETSc/PC.pyx":528 * * def addCompositePCType(self, pc_type): * cdef PetscPCType cval = NULL # <<<<<<<<<<<<<< * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCCompositeAddPCType(self.pc, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/PC.pyx":529 * def addCompositePCType(self, pc_type): * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PCCompositeAddPCType(self.pc, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_pc_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_pc_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":530 * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) * CHKERR( PCCompositeAddPCType(self.pc, cval) ) # <<<<<<<<<<<<<< * * # --- KSP --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeAddPCType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 530, __pyx_L1_error) /* "PETSc/PC.pyx":527 * return pc * * def addCompositePCType(self, pc_type): # <<<<<<<<<<<<<< * cdef PetscPCType cval = NULL * pc_type = str2bytes(pc_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.addCompositePCType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pc_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":534 * # --- KSP --- * * def getKSP(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_126getKSP[] = "PC.getKSP(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_126getKSP(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126getKSP(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 0); /* "PETSc/PC.pyx":535 * * def getKSP(self): * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":536 * def getKSP(self): * cdef KSP ksp = KSP() * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCKSPGetKSP(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 536, __pyx_L1_error) /* "PETSc/PC.pyx":537 * cdef KSP ksp = KSP() * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/PC.pyx":538 * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * # --- MG --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/PC.pyx":534 * # --- KSP --- * * def getKSP(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCKSPGetKSP(self.pc, &ksp.ksp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":542 * # --- MG --- * * def getMGType(self): # <<<<<<<<<<<<<< * cdef PetscPCMGType cval = PC_MG_ADDITIVE * CHKERR( PCMGGetType(self.pc, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_129getMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_128getMGType[] = "PC.getMGType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_129getMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMGType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_128getMGType(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128getMGType(struct PyPetscPCObject *__pyx_v_self) { PCMGType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGType", 0); /* "PETSc/PC.pyx":543 * * def getMGType(self): * cdef PetscPCMGType cval = PC_MG_ADDITIVE # <<<<<<<<<<<<<< * CHKERR( PCMGGetType(self.pc, &cval) ) * return cval */ __pyx_v_cval = PC_MG_ADDITIVE; /* "PETSc/PC.pyx":544 * def getMGType(self): * cdef PetscPCMGType cval = PC_MG_ADDITIVE * CHKERR( PCMGGetType(self.pc, &cval) ) # <<<<<<<<<<<<<< * return cval * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetType(__pyx_v_self->pc, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 544, __pyx_L1_error) /* "PETSc/PC.pyx":545 * cdef PetscPCMGType cval = PC_MG_ADDITIVE * CHKERR( PCMGGetType(self.pc, &cval) ) * return cval # <<<<<<<<<<<<<< * * def setMGType(self, mgtype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCMGType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/PC.pyx":542 * # --- MG --- * * def getMGType(self): # <<<<<<<<<<<<<< * cdef PetscPCMGType cval = PC_MG_ADDITIVE * CHKERR( PCMGGetType(self.pc, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":547 * return cval * * def setMGType(self, mgtype): # <<<<<<<<<<<<<< * cdef PetscPCMGType cval = mgtype * CHKERR( PCMGSetType(self.pc, cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_131setMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_130setMGType[] = "PC.setMGType(self, mgtype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_131setMGType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mgtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mgtype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mgtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGType") < 0)) __PYX_ERR(39, 547, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mgtype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 547, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_130setMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mgtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_130setMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_mgtype) { PCMGType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCMGType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGType", 0); /* "PETSc/PC.pyx":548 * * def setMGType(self, mgtype): * cdef PetscPCMGType cval = mgtype # <<<<<<<<<<<<<< * CHKERR( PCMGSetType(self.pc, cval) ) * */ __pyx_t_1 = ((PCMGType)__Pyx_PyInt_As_PCMGType(__pyx_v_mgtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 548, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/PC.pyx":549 * def setMGType(self, mgtype): * cdef PetscPCMGType cval = mgtype * CHKERR( PCMGSetType(self.pc, cval) ) # <<<<<<<<<<<<<< * * def getMGLevels(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetType(__pyx_v_self->pc, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 549, __pyx_L1_error) /* "PETSc/PC.pyx":547 * return cval * * def setMGType(self, mgtype): # <<<<<<<<<<<<<< * cdef PetscPCMGType cval = mgtype * CHKERR( PCMGSetType(self.pc, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":551 * CHKERR( PCMGSetType(self.pc, cval) ) * * def getMGLevels(self): # <<<<<<<<<<<<<< * cdef PetscInt levels = 0 * CHKERR( PCMGGetLevels(self.pc, &levels) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_133getMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_132getMGLevels[] = "PC.getMGLevels(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_133getMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGLevels (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMGLevels", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGLevels", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_132getMGLevels(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132getMGLevels(struct PyPetscPCObject *__pyx_v_self) { PetscInt __pyx_v_levels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGLevels", 0); /* "PETSc/PC.pyx":552 * * def getMGLevels(self): * cdef PetscInt levels = 0 # <<<<<<<<<<<<<< * CHKERR( PCMGGetLevels(self.pc, &levels) ) * return toInt(levels) */ __pyx_v_levels = 0; /* "PETSc/PC.pyx":553 * def getMGLevels(self): * cdef PetscInt levels = 0 * CHKERR( PCMGGetLevels(self.pc, &levels) ) # <<<<<<<<<<<<<< * return toInt(levels) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetLevels(__pyx_v_self->pc, (&__pyx_v_levels))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 553, __pyx_L1_error) /* "PETSc/PC.pyx":554 * cdef PetscInt levels = 0 * CHKERR( PCMGGetLevels(self.pc, &levels) ) * return toInt(levels) # <<<<<<<<<<<<<< * * def setMGLevels(self, levels): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/PC.pyx":551 * CHKERR( PCMGSetType(self.pc, cval) ) * * def getMGLevels(self): # <<<<<<<<<<<<<< * cdef PetscInt levels = 0 * CHKERR( PCMGGetLevels(self.pc, &levels) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":556 * return toInt(levels) * * def setMGLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt clevels = asInt(levels) * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135setMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_134setMGLevels[] = "PC.setMGLevels(self, levels)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135setMGLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_levels = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGLevels (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGLevels") < 0)) __PYX_ERR(39, 556, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 556, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_134setMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134setMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_clevels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGLevels", 0); /* "PETSc/PC.pyx":557 * * def setMGLevels(self, levels): * cdef PetscInt clevels = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 557, __pyx_L1_error) __pyx_v_clevels = __pyx_t_1; /* "PETSc/PC.pyx":558 * def setMGLevels(self, levels): * cdef PetscInt clevels = asInt(levels) * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) # <<<<<<<<<<<<<< * * def getMGCoarseSolve(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetLevels(__pyx_v_self->pc, __pyx_v_clevels, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 558, __pyx_L1_error) /* "PETSc/PC.pyx":556 * return toInt(levels) * * def setMGLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt clevels = asInt(levels) * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":560 * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) * * def getMGCoarseSolve(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_137getMGCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_136getMGCoarseSolve[] = "PC.getMGCoarseSolve(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_137getMGCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGCoarseSolve (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMGCoarseSolve", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMGCoarseSolve", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_136getMGCoarseSolve(((struct PyPetscPCObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGCoarseSolve", 0); /* "PETSc/PC.pyx":561 * * def getMGCoarseSolve(self): * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":562 * def getMGCoarseSolve(self): * cdef KSP ksp = KSP() * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetCoarseSolve(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 562, __pyx_L1_error) /* "PETSc/PC.pyx":563 * cdef KSP ksp = KSP() * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/PC.pyx":564 * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * def setMGInterpolation(self, level, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/PC.pyx":560 * CHKERR( PCMGSetLevels(self.pc, clevels, NULL) ) * * def getMGCoarseSolve(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetCoarseSolve(self.pc, &ksp.ksp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGCoarseSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":566 * return ksp * * def setMGInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139setMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_138setMGInterpolation[] = "PC.setMGInterpolation(self, level, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139setMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGInterpolation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMGInterpolation", 1, 2, 2, 1); __PYX_ERR(39, 566, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGInterpolation") < 0)) __PYX_ERR(39, 566, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGInterpolation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 566, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(39, 566, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_138setMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138setMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGInterpolation", 0); /* "PETSc/PC.pyx":567 * * def setMGInterpolation(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 567, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":568 * def setMGInterpolation(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getMGInterpolation(self, level): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetInterpolation(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 568, __pyx_L1_error) /* "PETSc/PC.pyx":566 * return ksp * * def setMGInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":570 * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) * * def getMGInterpolation(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat interpolation = Mat() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141getMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_140getMGInterpolation[] = "PC.getMGInterpolation(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141getMGInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGInterpolation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGInterpolation") < 0)) __PYX_ERR(39, 570, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGInterpolation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 570, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_140getMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140getMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_interpolation = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGInterpolation", 0); /* "PETSc/PC.pyx":571 * * def getMGInterpolation(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat interpolation = Mat() * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 571, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":572 * def getMGInterpolation(self, level): * cdef PetscInt clevel = asInt(level) * cdef Mat interpolation = Mat() # <<<<<<<<<<<<<< * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) * PetscINCREF(interpolation.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_interpolation = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PC.pyx":573 * cdef PetscInt clevel = asInt(level) * cdef Mat interpolation = Mat() * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(interpolation.obj) * return interpolation */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetInterpolation(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_interpolation->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 573, __pyx_L1_error) /* "PETSc/PC.pyx":574 * cdef Mat interpolation = Mat() * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) * PetscINCREF(interpolation.obj) # <<<<<<<<<<<<<< * return interpolation * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_interpolation->__pyx_base.obj)); /* "PETSc/PC.pyx":575 * CHKERR( PCMGGetInterpolation(self.pc, clevel, &interpolation.mat) ) * PetscINCREF(interpolation.obj) * return interpolation # <<<<<<<<<<<<<< * * def setMGRestriction(self, level, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_interpolation)); __pyx_r = ((PyObject *)__pyx_v_interpolation); goto __pyx_L0; /* "PETSc/PC.pyx":570 * CHKERR( PCMGSetInterpolation(self.pc, clevel, mat.mat) ) * * def getMGInterpolation(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat interpolation = Mat() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_interpolation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":577 * return interpolation * * def setMGRestriction(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143setMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_142setMGRestriction[] = "PC.setMGRestriction(self, level, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143setMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGRestriction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMGRestriction", 1, 2, 2, 1); __PYX_ERR(39, 577, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGRestriction") < 0)) __PYX_ERR(39, 577, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGRestriction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 577, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(39, 577, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_142setMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142setMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGRestriction", 0); /* "PETSc/PC.pyx":578 * * def setMGRestriction(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 578, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":579 * def setMGRestriction(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getMGRestriction(self, level): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetRestriction(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 579, __pyx_L1_error) /* "PETSc/PC.pyx":577 * return interpolation * * def setMGRestriction(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":581 * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) * * def getMGRestriction(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat restriction = Mat() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145getMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_144getMGRestriction[] = "PC.getMGRestriction(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145getMGRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGRestriction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGRestriction") < 0)) __PYX_ERR(39, 581, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGRestriction", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 581, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_144getMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144getMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_restriction = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGRestriction", 0); /* "PETSc/PC.pyx":582 * * def getMGRestriction(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat restriction = Mat() * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 582, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":583 * def getMGRestriction(self, level): * cdef PetscInt clevel = asInt(level) * cdef Mat restriction = Mat() # <<<<<<<<<<<<<< * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) * PetscINCREF(restriction.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_restriction = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PC.pyx":584 * cdef PetscInt clevel = asInt(level) * cdef Mat restriction = Mat() * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(restriction.obj) * return restriction */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRestriction(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_restriction->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 584, __pyx_L1_error) /* "PETSc/PC.pyx":585 * cdef Mat restriction = Mat() * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) * PetscINCREF(restriction.obj) # <<<<<<<<<<<<<< * return restriction * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_restriction->__pyx_base.obj)); /* "PETSc/PC.pyx":586 * CHKERR( PCMGGetRestriction(self.pc, clevel, &restriction.mat) ) * PetscINCREF(restriction.obj) * return restriction # <<<<<<<<<<<<<< * * def setMGRScale(self, level, Vec rscale): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_restriction)); __pyx_r = ((PyObject *)__pyx_v_restriction); goto __pyx_L0; /* "PETSc/PC.pyx":581 * CHKERR( PCMGSetRestriction(self.pc, clevel, mat.mat) ) * * def getMGRestriction(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat restriction = Mat() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_restriction); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":588 * return restriction * * def setMGRScale(self, level, Vec rscale): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_147setMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_146setMGRScale[] = "PC.setMGRScale(self, level, Vec rscale)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_147setMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_rscale = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGRScale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_rscale,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rscale)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMGRScale", 1, 2, 2, 1); __PYX_ERR(39, 588, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGRScale") < 0)) __PYX_ERR(39, 588, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_rscale = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGRScale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 588, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rscale), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rscale", 0))) __PYX_ERR(39, 588, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_146setMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rscale); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146setMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rscale) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGRScale", 0); /* "PETSc/PC.pyx":589 * * def setMGRScale(self, level, Vec rscale): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 589, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":590 * def setMGRScale(self, level, Vec rscale): * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) # <<<<<<<<<<<<<< * * def getMGRScale(self, level): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetRScale(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_rscale->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 590, __pyx_L1_error) /* "PETSc/PC.pyx":588 * return restriction * * def setMGRScale(self, level, Vec rscale): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":592 * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) * * def getMGRScale(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Vec rscale = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_149getMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_148getMGRScale[] = "PC.getMGRScale(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_149getMGRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGRScale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGRScale") < 0)) __PYX_ERR(39, 592, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGRScale", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 592, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_148getMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148getMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscVecObject *__pyx_v_rscale = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGRScale", 0); /* "PETSc/PC.pyx":593 * * def getMGRScale(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Vec rscale = Vec() * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 593, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":594 * def getMGRScale(self, level): * cdef PetscInt clevel = asInt(level) * cdef Vec rscale = Vec() # <<<<<<<<<<<<<< * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) * PetscINCREF(rscale.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rscale = ((struct PyPetscVecObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PC.pyx":595 * cdef PetscInt clevel = asInt(level) * cdef Vec rscale = Vec() * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(rscale.obj) * return rscale */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRScale(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_rscale->vec))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 595, __pyx_L1_error) /* "PETSc/PC.pyx":596 * cdef Vec rscale = Vec() * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) * PetscINCREF(rscale.obj) # <<<<<<<<<<<<<< * return rscale * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rscale->__pyx_base.obj)); /* "PETSc/PC.pyx":597 * CHKERR( PCMGGetRScale(self.pc, clevel, &rscale.vec) ) * PetscINCREF(rscale.obj) * return rscale # <<<<<<<<<<<<<< * * def getMGSmoother(self, level): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_rscale)); __pyx_r = ((PyObject *)__pyx_v_rscale); goto __pyx_L0; /* "PETSc/PC.pyx":592 * CHKERR( PCMGSetRScale(self.pc, clevel, rscale.vec) ) * * def getMGRScale(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Vec rscale = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_rscale); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":599 * return rscale * * def getMGSmoother(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_151getMGSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_150getMGSmoother[] = "PC.getMGSmoother(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_151getMGSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGSmoother (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGSmoother") < 0)) __PYX_ERR(39, 599, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGSmoother", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 599, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_150getMGSmoother(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150getMGSmoother(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGSmoother", 0); /* "PETSc/PC.pyx":600 * * def getMGSmoother(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 600, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":601 * def getMGSmoother(self, level): * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PC.pyx":602 * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmoother(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 602, __pyx_L1_error) /* "PETSc/PC.pyx":603 * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/PC.pyx":604 * CHKERR( PCMGGetSmoother(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * def getMGSmootherDown(self, level): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/PC.pyx":599 * return rscale * * def getMGSmoother(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":606 * return ksp * * def getMGSmootherDown(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_152getMGSmootherDown[] = "PC.getMGSmootherDown(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGSmootherDown (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGSmootherDown") < 0)) __PYX_ERR(39, 606, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGSmootherDown", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 606, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_152getMGSmootherDown(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGSmootherDown(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGSmootherDown", 0); /* "PETSc/PC.pyx":607 * * def getMGSmootherDown(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 607, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":608 * def getMGSmootherDown(self, level): * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PC.pyx":609 * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherDown(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 609, __pyx_L1_error) /* "PETSc/PC.pyx":610 * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/PC.pyx":611 * CHKERR( PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * def getMGSmootherUp(self, level): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/PC.pyx":606 * return ksp * * def getMGSmootherDown(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":613 * return ksp * * def getMGSmootherUp(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155getMGSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_154getMGSmootherUp[] = "PC.getMGSmootherUp(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155getMGSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMGSmootherUp (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMGSmootherUp") < 0)) __PYX_ERR(39, 613, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMGSmootherUp", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 613, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_154getMGSmootherUp(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154getMGSmootherUp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMGSmootherUp", 0); /* "PETSc/PC.pyx":614 * * def getMGSmootherUp(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 614, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":615 * def getMGSmootherUp(self, level): * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PC.pyx":616 * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherUp(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 616, __pyx_L1_error) /* "PETSc/PC.pyx":617 * cdef KSP ksp = KSP() * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/PC.pyx":618 * CHKERR( PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * def setMGCycleType(self, cycle_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/PC.pyx":613 * return ksp * * def getMGSmootherUp(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef KSP ksp = KSP() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PC.getMGSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":620 * return ksp * * def setMGCycleType(self, cycle_type): # <<<<<<<<<<<<<< * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleType(self.pc, ctype) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157setMGCycleType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_156setMGCycleType[] = "PC.setMGCycleType(self, cycle_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157setMGCycleType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cycle_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGCycleType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cycle_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cycle_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGCycleType") < 0)) __PYX_ERR(39, 620, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_cycle_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGCycleType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 620, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_156setMGCycleType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cycle_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156setMGCycleType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cycle_type) { PCMGCycleType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCMGCycleType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGCycleType", 0); /* "PETSc/PC.pyx":621 * * def setMGCycleType(self, cycle_type): * cdef PetscPCMGCycleType ctype = cycle_type # <<<<<<<<<<<<<< * CHKERR( PCMGSetCycleType(self.pc, ctype) ) * */ __pyx_t_1 = ((PCMGCycleType)__Pyx_PyInt_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 621, __pyx_L1_error) __pyx_v_ctype = __pyx_t_1; /* "PETSc/PC.pyx":622 * def setMGCycleType(self, cycle_type): * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleType(self.pc, ctype) ) # <<<<<<<<<<<<<< * * def setMGCycleTypeOnLevel(self, level, cycle_type): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetCycleType(__pyx_v_self->pc, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 622, __pyx_L1_error) /* "PETSc/PC.pyx":620 * return ksp * * def setMGCycleType(self, cycle_type): # <<<<<<<<<<<<<< * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleType(self.pc, ctype) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":624 * CHKERR( PCMGSetCycleType(self.pc, ctype) ) * * def setMGCycleTypeOnLevel(self, level, cycle_type): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef PetscPCMGCycleType ctype = cycle_type */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGCycleTypeOnLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_158setMGCycleTypeOnLevel[] = "PC.setMGCycleTypeOnLevel(self, level, cycle_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGCycleTypeOnLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; PyObject *__pyx_v_cycle_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGCycleTypeOnLevel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_cycle_type,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cycle_type)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMGCycleTypeOnLevel", 1, 2, 2, 1); __PYX_ERR(39, 624, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGCycleTypeOnLevel") < 0)) __PYX_ERR(39, 624, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_cycle_type = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGCycleTypeOnLevel", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 624, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleTypeOnLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_158setMGCycleTypeOnLevel(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_cycle_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGCycleTypeOnLevel(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_cycle_type) { PetscInt __pyx_v_clevel; PCMGCycleType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PCMGCycleType __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGCycleTypeOnLevel", 0); /* "PETSc/PC.pyx":625 * * def setMGCycleTypeOnLevel(self, level, cycle_type): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 625, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":626 * def setMGCycleTypeOnLevel(self, level, cycle_type): * cdef PetscInt clevel = asInt(level) * cdef PetscPCMGCycleType ctype = cycle_type # <<<<<<<<<<<<<< * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) * */ __pyx_t_2 = ((PCMGCycleType)__Pyx_PyInt_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 626, __pyx_L1_error) __pyx_v_ctype = __pyx_t_2; /* "PETSc/PC.pyx":627 * cdef PetscInt clevel = asInt(level) * cdef PetscPCMGCycleType ctype = cycle_type * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) # <<<<<<<<<<<<<< * * def setMGRhs(self, level, Vec rhs): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetCycleTypeOnLevel(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_ctype)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 627, __pyx_L1_error) /* "PETSc/PC.pyx":624 * CHKERR( PCMGSetCycleType(self.pc, ctype) ) * * def setMGCycleTypeOnLevel(self, level, cycle_type): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef PetscPCMGCycleType ctype = cycle_type */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGCycleTypeOnLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":629 * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) * * def setMGRhs(self, level, Vec rhs): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_161setMGRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_160setMGRhs[] = "PC.setMGRhs(self, level, Vec rhs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_161setMGRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_rhs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGRhs (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_rhs,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMGRhs", 1, 2, 2, 1); __PYX_ERR(39, 629, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGRhs") < 0)) __PYX_ERR(39, 629, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_rhs = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGRhs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 629, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rhs", 0))) __PYX_ERR(39, 629, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_160setMGRhs(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rhs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160setMGRhs(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rhs) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGRhs", 0); /* "PETSc/PC.pyx":630 * * def setMGRhs(self, level, Vec rhs): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 630, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":631 * def setMGRhs(self, level, Vec rhs): * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) # <<<<<<<<<<<<<< * * def setMGX(self, level, Vec x): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetRhs(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_rhs->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 631, __pyx_L1_error) /* "PETSc/PC.pyx":629 * CHKERR( PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype) ) * * def setMGRhs(self, level, Vec rhs): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":633 * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) * * def setMGX(self, level, Vec x): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_163setMGX(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_162setMGX[] = "PC.setMGX(self, level, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_163setMGX(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGX (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMGX", 1, 2, 2, 1); __PYX_ERR(39, 633, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGX") < 0)) __PYX_ERR(39, 633, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGX", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 633, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGX", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(39, 633, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_162setMGX(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGX(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_x) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGX", 0); /* "PETSc/PC.pyx":634 * * def setMGX(self, level, Vec x): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 634, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":635 * def setMGX(self, level, Vec x): * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) # <<<<<<<<<<<<<< * * def setMGR(self, level, Vec r): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetX(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_x->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 635, __pyx_L1_error) /* "PETSc/PC.pyx":633 * CHKERR( PCMGSetRhs(self.pc, clevel, rhs.vec) ) * * def setMGX(self, level, Vec x): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGX", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":637 * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) * * def setMGR(self, level, Vec r): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetR(self.pc, clevel, r.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_165setMGR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_164setMGR[] = "PC.setMGR(self, level, Vec r)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_165setMGR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_r = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMGR (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_r,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMGR", 1, 2, 2, 1); __PYX_ERR(39, 637, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMGR") < 0)) __PYX_ERR(39, 637, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_r = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMGR", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 637, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGR", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "r", 0))) __PYX_ERR(39, 637, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_164setMGR(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_r); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164setMGR(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_r) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMGR", 0); /* "PETSc/PC.pyx":638 * * def setMGR(self, level, Vec r): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( PCMGSetR(self.pc, clevel, r.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 638, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/PC.pyx":639 * def setMGR(self, level, Vec r): * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetR(self.pc, clevel, r.vec) ) # <<<<<<<<<<<<<< * * # --- BDDC --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGSetR(__pyx_v_self->pc, __pyx_v_clevel, __pyx_v_r->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 639, __pyx_L1_error) /* "PETSc/PC.pyx":637 * CHKERR( PCMGSetX(self.pc, clevel, x.vec) ) * * def setMGR(self, level, Vec r): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( PCMGSetR(self.pc, clevel, r.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setMGR", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":643 * # --- BDDC --- * * def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None): # <<<<<<<<<<<<<< * cdef PetscBool ptrans = trans * cdef PetscIS pl2l = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_167setBDDCDivergenceMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_166setBDDCDivergenceMat[] = "PC.setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_167setBDDCDivergenceMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_div = 0; PyObject *__pyx_v_trans = 0; struct PyPetscISObject *__pyx_v_l2l = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDivergenceMat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_div,&__pyx_n_s_trans,&__pyx_n_s_l2l,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_False); values[2] = (PyObject *)((struct PyPetscISObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_div)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trans); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l2l); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDivergenceMat") < 0)) __PYX_ERR(39, 643, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_div = ((struct PyPetscMatObject *)values[0]); __pyx_v_trans = values[1]; __pyx_v_l2l = ((struct PyPetscISObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDivergenceMat", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 643, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDivergenceMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_div), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "div", 0))) __PYX_ERR(39, 643, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2l), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "l2l", 0))) __PYX_ERR(39, 643, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_166setBDDCDivergenceMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_div, __pyx_v_trans, __pyx_v_l2l); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setBDDCDivergenceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_div, PyObject *__pyx_v_trans, struct PyPetscISObject *__pyx_v_l2l) { PetscBool __pyx_v_ptrans; IS __pyx_v_pl2l; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_t_3; IS __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDivergenceMat", 0); /* "PETSc/PC.pyx":644 * * def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None): * cdef PetscBool ptrans = trans # <<<<<<<<<<<<<< * cdef PetscIS pl2l = NULL * if l2l is not None: pl2l = l2l.iset */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_trans)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 644, __pyx_L1_error) __pyx_v_ptrans = __pyx_t_1; /* "PETSc/PC.pyx":645 * def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None): * cdef PetscBool ptrans = trans * cdef PetscIS pl2l = NULL # <<<<<<<<<<<<<< * if l2l is not None: pl2l = l2l.iset * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) */ __pyx_v_pl2l = NULL; /* "PETSc/PC.pyx":646 * cdef PetscBool ptrans = trans * cdef PetscIS pl2l = NULL * if l2l is not None: pl2l = l2l.iset # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_l2l) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_4 = __pyx_v_l2l->iset; __pyx_v_pl2l = __pyx_t_4; } /* "PETSc/PC.pyx":647 * cdef PetscIS pl2l = NULL * if l2l is not None: pl2l = l2l.iset * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) # <<<<<<<<<<<<<< * * def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDivergenceMat(__pyx_v_self->pc, __pyx_v_div->mat, __pyx_v_ptrans, __pyx_v_pl2l)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(39, 647, __pyx_L1_error) /* "PETSc/PC.pyx":643 * # --- BDDC --- * * def setBDDCDivergenceMat(self, Mat div, trans=False, IS l2l=None): # <<<<<<<<<<<<<< * cdef PetscBool ptrans = trans * cdef PetscIS pl2l = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDivergenceMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":649 * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) * * def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True): # <<<<<<<<<<<<<< * cdef PetscInt porder = asInt(order) * cdef PetscInt pfield = asInt(field) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_169setBDDCDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_168setBDDCDiscreteGradient[] = "PC.setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_169setBDDCDiscreteGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_G = 0; PyObject *__pyx_v_order = 0; PyObject *__pyx_v_field = 0; PyObject *__pyx_v_gord = 0; PyObject *__pyx_v_conforming = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDiscreteGradient (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_G,&__pyx_n_s_order,&__pyx_n_s_field,&__pyx_n_s_gord,&__pyx_n_s_conforming,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = ((PyObject *)__pyx_int_1); values[2] = ((PyObject *)__pyx_int_1); values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_G)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_order); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gord); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conforming); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDiscreteGradient") < 0)) __PYX_ERR(39, 649, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_G = ((struct PyPetscMatObject *)values[0]); __pyx_v_order = values[1]; __pyx_v_field = values[2]; __pyx_v_gord = values[3]; __pyx_v_conforming = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDiscreteGradient", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 649, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_G), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "G", 0))) __PYX_ERR(39, 649, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_168setBDDCDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_G, __pyx_v_order, __pyx_v_field, __pyx_v_gord, __pyx_v_conforming); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168setBDDCDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_G, PyObject *__pyx_v_order, PyObject *__pyx_v_field, PyObject *__pyx_v_gord, PyObject *__pyx_v_conforming) { PetscInt __pyx_v_porder; PetscInt __pyx_v_pfield; PetscBool __pyx_v_pgord; PetscBool __pyx_v_pconforming; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDiscreteGradient", 0); /* "PETSc/PC.pyx":650 * * def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True): * cdef PetscInt porder = asInt(order) # <<<<<<<<<<<<<< * cdef PetscInt pfield = asInt(field) * cdef PetscBool pgord = gord */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_order); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 650, __pyx_L1_error) __pyx_v_porder = __pyx_t_1; /* "PETSc/PC.pyx":651 * def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True): * cdef PetscInt porder = asInt(order) * cdef PetscInt pfield = asInt(field) # <<<<<<<<<<<<<< * cdef PetscBool pgord = gord * cdef PetscBool pconforming = conforming */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 651, __pyx_L1_error) __pyx_v_pfield = __pyx_t_1; /* "PETSc/PC.pyx":652 * cdef PetscInt porder = asInt(order) * cdef PetscInt pfield = asInt(field) * cdef PetscBool pgord = gord # <<<<<<<<<<<<<< * cdef PetscBool pconforming = conforming * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_gord)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 652, __pyx_L1_error) __pyx_v_pgord = __pyx_t_2; /* "PETSc/PC.pyx":653 * cdef PetscInt pfield = asInt(field) * cdef PetscBool pgord = gord * cdef PetscBool pconforming = conforming # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) * */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_conforming)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 653, __pyx_L1_error) __pyx_v_pconforming = __pyx_t_2; /* "PETSc/PC.pyx":654 * cdef PetscBool pgord = gord * cdef PetscBool pconforming = conforming * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) # <<<<<<<<<<<<<< * * def setBDDCChangeOfBasisMat(self, Mat T, interior=False): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDiscreteGradient(__pyx_v_self->pc, __pyx_v_G->mat, __pyx_v_porder, __pyx_v_pfield, __pyx_v_pgord, __pyx_v_pconforming)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(39, 654, __pyx_L1_error) /* "PETSc/PC.pyx":649 * CHKERR( PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l) ) * * def setBDDCDiscreteGradient(self, Mat G, order=1, field=1, gord=True, conforming=True): # <<<<<<<<<<<<<< * cdef PetscInt porder = asInt(order) * cdef PetscInt pfield = asInt(field) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDiscreteGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":656 * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) * * def setBDDCChangeOfBasisMat(self, Mat T, interior=False): # <<<<<<<<<<<<<< * cdef PetscBool pinterior = interior * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_171setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_170setBDDCChangeOfBasisMat[] = "PC.setBDDCChangeOfBasisMat(self, Mat T, interior=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_171setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_T = 0; PyObject *__pyx_v_interior = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCChangeOfBasisMat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_T,&__pyx_n_s_interior,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interior); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCChangeOfBasisMat") < 0)) __PYX_ERR(39, 656, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_T = ((struct PyPetscMatObject *)values[0]); __pyx_v_interior = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCChangeOfBasisMat", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 656, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCChangeOfBasisMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_T), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "T", 0))) __PYX_ERR(39, 656, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_170setBDDCChangeOfBasisMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_T, __pyx_v_interior); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170setBDDCChangeOfBasisMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_T, PyObject *__pyx_v_interior) { PetscBool __pyx_v_pinterior; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCChangeOfBasisMat", 0); /* "PETSc/PC.pyx":657 * * def setBDDCChangeOfBasisMat(self, Mat T, interior=False): * cdef PetscBool pinterior = interior # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interior)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 657, __pyx_L1_error) __pyx_v_pinterior = __pyx_t_1; /* "PETSc/PC.pyx":658 * def setBDDCChangeOfBasisMat(self, Mat T, interior=False): * cdef PetscBool pinterior = interior * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) # <<<<<<<<<<<<<< * * def setBDDCPrimalVerticesIS(self, IS primv): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetChangeOfBasisMat(__pyx_v_self->pc, __pyx_v_T->mat, __pyx_v_pinterior)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 658, __pyx_L1_error) /* "PETSc/PC.pyx":656 * CHKERR( PCBDDCSetDiscreteGradient(self.pc, G.mat, porder, pfield, pgord, pconforming) ) * * def setBDDCChangeOfBasisMat(self, Mat T, interior=False): # <<<<<<<<<<<<<< * cdef PetscBool pinterior = interior * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCChangeOfBasisMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":660 * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) * * def setBDDCPrimalVerticesIS(self, IS primv): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_173setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_172setBDDCPrimalVerticesIS[] = "PC.setBDDCPrimalVerticesIS(self, IS primv)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_173setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_primv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCPrimalVerticesIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_primv,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_primv)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCPrimalVerticesIS") < 0)) __PYX_ERR(39, 660, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_primv = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 660, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_primv), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(39, 660, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_172setBDDCPrimalVerticesIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172setBDDCPrimalVerticesIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCPrimalVerticesIS", 0); /* "PETSc/PC.pyx":661 * * def setBDDCPrimalVerticesIS(self, IS primv): * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) # <<<<<<<<<<<<<< * * def setBDDCPrimalVerticesLocalIS(self, IS primv): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetPrimalVerticesIS(__pyx_v_self->pc, __pyx_v_primv->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 661, __pyx_L1_error) /* "PETSc/PC.pyx":660 * CHKERR( PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior) ) * * def setBDDCPrimalVerticesIS(self, IS primv): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":663 * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) * * def setBDDCPrimalVerticesLocalIS(self, IS primv): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_175setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_174setBDDCPrimalVerticesLocalIS[] = "PC.setBDDCPrimalVerticesLocalIS(self, IS primv)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_175setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_primv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCPrimalVerticesLocalIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_primv,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_primv)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCPrimalVerticesLocalIS") < 0)) __PYX_ERR(39, 663, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_primv = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesLocalIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 663, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesLocalIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_primv), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(39, 663, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_174setBDDCPrimalVerticesLocalIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174setBDDCPrimalVerticesLocalIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCPrimalVerticesLocalIS", 0); /* "PETSc/PC.pyx":664 * * def setBDDCPrimalVerticesLocalIS(self, IS primv): * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) # <<<<<<<<<<<<<< * * def setBDDCCoarseningRatio(self, cratio): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetPrimalVerticesLocalIS(__pyx_v_self->pc, __pyx_v_primv->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 664, __pyx_L1_error) /* "PETSc/PC.pyx":663 * CHKERR( PCBDDCSetPrimalVerticesIS(self.pc, primv.iset) ) * * def setBDDCPrimalVerticesLocalIS(self, IS primv): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCPrimalVerticesLocalIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":666 * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) * * def setBDDCCoarseningRatio(self, cratio): # <<<<<<<<<<<<<< * cdef PetscInt pcratio = asInt(cratio) * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_177setBDDCCoarseningRatio(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_176setBDDCCoarseningRatio[] = "PC.setBDDCCoarseningRatio(self, cratio)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_177setBDDCCoarseningRatio(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cratio = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCCoarseningRatio (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cratio,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cratio)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCCoarseningRatio") < 0)) __PYX_ERR(39, 666, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_cratio = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCCoarseningRatio", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 666, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCCoarseningRatio", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_176setBDDCCoarseningRatio(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cratio); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176setBDDCCoarseningRatio(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cratio) { PetscInt __pyx_v_pcratio; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCCoarseningRatio", 0); /* "PETSc/PC.pyx":667 * * def setBDDCCoarseningRatio(self, cratio): * cdef PetscInt pcratio = asInt(cratio) # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cratio); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 667, __pyx_L1_error) __pyx_v_pcratio = __pyx_t_1; /* "PETSc/PC.pyx":668 * def setBDDCCoarseningRatio(self, cratio): * cdef PetscInt pcratio = asInt(cratio) * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) # <<<<<<<<<<<<<< * * def setBDDCLevels(self, levels): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetCoarseningRatio(__pyx_v_self->pc, __pyx_v_pcratio)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 668, __pyx_L1_error) /* "PETSc/PC.pyx":666 * CHKERR( PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset) ) * * def setBDDCCoarseningRatio(self, cratio): # <<<<<<<<<<<<<< * cdef PetscInt pcratio = asInt(cratio) * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCCoarseningRatio", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":670 * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) * * def setBDDCLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt plevels = asInt(levels) * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_179setBDDCLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_178setBDDCLevels[] = "PC.setBDDCLevels(self, levels)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_179setBDDCLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_levels = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCLevels (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCLevels") < 0)) __PYX_ERR(39, 670, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_levels = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCLevels", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 670, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_178setBDDCLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178setBDDCLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels) { PetscInt __pyx_v_plevels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCLevels", 0); /* "PETSc/PC.pyx":671 * * def setBDDCLevels(self, levels): * cdef PetscInt plevels = asInt(levels) # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 671, __pyx_L1_error) __pyx_v_plevels = __pyx_t_1; /* "PETSc/PC.pyx":672 * def setBDDCLevels(self, levels): * cdef PetscInt plevels = asInt(levels) * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) # <<<<<<<<<<<<<< * * def setBDDCDirichletBoundaries(self, IS bndr): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetLevels(__pyx_v_self->pc, __pyx_v_plevels)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 672, __pyx_L1_error) /* "PETSc/PC.pyx":670 * CHKERR( PCBDDCSetCoarseningRatio(self.pc, pcratio) ) * * def setBDDCLevels(self, levels): # <<<<<<<<<<<<<< * cdef PetscInt plevels = asInt(levels) * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":674 * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) * * def setBDDCDirichletBoundaries(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setBDDCDirichletBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_180setBDDCDirichletBoundaries[] = "PC.setBDDCDirichletBoundaries(self, IS bndr)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setBDDCDirichletBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_bndr = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDirichletBoundaries (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDirichletBoundaries") < 0)) __PYX_ERR(39, 674, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundaries", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 674, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(39, 674, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_180setBDDCDirichletBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setBDDCDirichletBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDirichletBoundaries", 0); /* "PETSc/PC.pyx":675 * * def setBDDCDirichletBoundaries(self, IS bndr): * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCDirichletBoundariesLocal(self, IS bndr): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDirichletBoundaries(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 675, __pyx_L1_error) /* "PETSc/PC.pyx":674 * CHKERR( PCBDDCSetLevels(self.pc, plevels) ) * * def setBDDCDirichletBoundaries(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":677 * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) * * def setBDDCDirichletBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_183setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_182setBDDCDirichletBoundariesLocal[] = "PC.setBDDCDirichletBoundariesLocal(self, IS bndr)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_183setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_bndr = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDirichletBoundariesLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDirichletBoundariesLocal") < 0)) __PYX_ERR(39, 677, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundariesLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 677, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(39, 677, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_182setBDDCDirichletBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setBDDCDirichletBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDirichletBoundariesLocal", 0); /* "PETSc/PC.pyx":678 * * def setBDDCDirichletBoundariesLocal(self, IS bndr): * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCNeumannBoundaries(self, IS bndr): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDirichletBoundariesLocal(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 678, __pyx_L1_error) /* "PETSc/PC.pyx":677 * CHKERR( PCBDDCSetDirichletBoundaries(self.pc, bndr.iset) ) * * def setBDDCDirichletBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDirichletBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":680 * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundaries(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_185setBDDCNeumannBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_184setBDDCNeumannBoundaries[] = "PC.setBDDCNeumannBoundaries(self, IS bndr)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_185setBDDCNeumannBoundaries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_bndr = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCNeumannBoundaries (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCNeumannBoundaries") < 0)) __PYX_ERR(39, 680, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundaries", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 680, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(39, 680, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_184setBDDCNeumannBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setBDDCNeumannBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCNeumannBoundaries", 0); /* "PETSc/PC.pyx":681 * * def setBDDCNeumannBoundaries(self, IS bndr): * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCNeumannBoundariesLocal(self, IS bndr): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetNeumannBoundaries(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 681, __pyx_L1_error) /* "PETSc/PC.pyx":680 * CHKERR( PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundaries(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundaries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":683 * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_186setBDDCNeumannBoundariesLocal[] = "PC.setBDDCNeumannBoundariesLocal(self, IS bndr)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_bndr = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCNeumannBoundariesLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bndr,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bndr)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCNeumannBoundariesLocal") < 0)) __PYX_ERR(39, 683, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_bndr = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundariesLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 683, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bndr), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(39, 683, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCNeumannBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setBDDCNeumannBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCNeumannBoundariesLocal", 0); /* "PETSc/PC.pyx":684 * * def setBDDCNeumannBoundariesLocal(self, IS bndr): * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) # <<<<<<<<<<<<<< * * def setBDDCDofsSplitting(self, isfields): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetNeumannBoundariesLocal(__pyx_v_self->pc, __pyx_v_bndr->iset)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 684, __pyx_L1_error) /* "PETSc/PC.pyx":683 * CHKERR( PCBDDCSetNeumannBoundaries(self.pc, bndr.iset) ) * * def setBDDCNeumannBoundariesLocal(self, IS bndr): # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCNeumannBoundariesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":686 * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCDofsSplitting(self, isfields): # <<<<<<<<<<<<<< * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDofsSplitting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_188setBDDCDofsSplitting[] = "PC.setBDDCDofsSplitting(self, isfields)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDofsSplitting(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_isfields = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDofsSplitting (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isfields,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isfields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDofsSplitting") < 0)) __PYX_ERR(39, 686, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_isfields = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplitting", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 686, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplitting", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDofsSplitting(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setBDDCDofsSplitting(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; IS *__pyx_v_cisfields; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; IS __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDofsSplitting", 0); __Pyx_INCREF(__pyx_v_isfields); /* "PETSc/PC.pyx":687 * * def setBDDCDofsSplitting(self, isfields): * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_isfields, __pyx_ptype_8petsc4py_5PETSc_IS); if ((__pyx_t_2 != 0)) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_isfields); __Pyx_GIVEREF(__pyx_v_isfields); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_isfields); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PySequence_List(__pyx_v_isfields); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_isfields, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":688 * def setBDDCDofsSplitting(self, isfields): * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) # <<<<<<<<<<<<<< * cdef PetscIS *cisfields = NULL * cdef object tmp */ __pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(39, 688, __pyx_L1_error) __pyx_v_n = __pyx_t_4; /* "PETSc/PC.pyx":689 * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL # <<<<<<<<<<<<<< * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) */ __pyx_v_cisfields = NULL; /* "PETSc/PC.pyx":691 * cdef PetscIS *cisfields = NULL * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cisfields)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/PC.pyx":692 * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) * */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_isfields, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(39, 692, __pyx_L1_error) __pyx_t_5 = ((struct PyPetscISObject *)__pyx_t_3)->iset; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_cisfields[__pyx_v_i]) = __pyx_t_5; } /* "PETSc/PC.pyx":693 * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplitting(self.pc, n, cisfields) ) # <<<<<<<<<<<<<< * * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDofsSplitting(__pyx_v_self->pc, ((PetscInt)__pyx_v_n), __pyx_v_cisfields)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(39, 693, __pyx_L1_error) /* "PETSc/PC.pyx":686 * CHKERR( PCBDDCSetNeumannBoundariesLocal(self.pc, bndr.iset) ) * * def setBDDCDofsSplitting(self, isfields): # <<<<<<<<<<<<<< * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplitting", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_isfields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":696 * * * def setBDDCDofsSplittingLocal(self, isfields): # <<<<<<<<<<<<<< * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_190setBDDCDofsSplittingLocal[] = "PC.setBDDCDofsSplittingLocal(self, isfields)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_isfields = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBDDCDofsSplittingLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_isfields,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isfields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBDDCDofsSplittingLocal") < 0)) __PYX_ERR(39, 696, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_isfields = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplittingLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 696, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplittingLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCDofsSplittingLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCDofsSplittingLocal(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_n; IS *__pyx_v_cisfields; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; IS __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBDDCDofsSplittingLocal", 0); __Pyx_INCREF(__pyx_v_isfields); /* "PETSc/PC.pyx":697 * * def setBDDCDofsSplittingLocal(self, isfields): * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) # <<<<<<<<<<<<<< * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_isfields, __pyx_ptype_8petsc4py_5PETSc_IS); if ((__pyx_t_2 != 0)) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_isfields); __Pyx_GIVEREF(__pyx_v_isfields); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_isfields); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } else { __pyx_t_3 = PySequence_List(__pyx_v_isfields); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; } __Pyx_DECREF_SET(__pyx_v_isfields, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":698 * def setBDDCDofsSplittingLocal(self, isfields): * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) # <<<<<<<<<<<<<< * cdef PetscIS *cisfields = NULL * cdef object tmp */ __pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(39, 698, __pyx_L1_error) __pyx_v_n = __pyx_t_4; /* "PETSc/PC.pyx":699 * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) * cdef PetscIS *cisfields = NULL # <<<<<<<<<<<<<< * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) */ __pyx_v_cisfields = NULL; /* "PETSc/PC.pyx":701 * cdef PetscIS *cisfields = NULL * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) # <<<<<<<<<<<<<< * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplittingLocal(self.pc, n, cisfields) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cisfields)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/PC.pyx":702 * cdef object tmp * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset # <<<<<<<<<<<<<< * CHKERR( PCBDDCSetDofsSplittingLocal(self.pc, n, cisfields) ) * */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_isfields, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(39, 702, __pyx_L1_error) __pyx_t_5 = ((struct PyPetscISObject *)__pyx_t_3)->iset; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_cisfields[__pyx_v_i]) = __pyx_t_5; } /* "PETSc/PC.pyx":703 * tmp = oarray_p(empty_p(n), NULL, &cisfields) * for i from 0 <= i < n: cisfields[i] = (isfields[i]).iset * CHKERR( PCBDDCSetDofsSplittingLocal(self.pc, n, cisfields) ) # <<<<<<<<<<<<<< * * # --- Patch --- */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetDofsSplittingLocal(__pyx_v_self->pc, ((PetscInt)__pyx_v_n), __pyx_v_cisfields)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(39, 703, __pyx_L1_error) /* "PETSc/PC.pyx":696 * * * def setBDDCDofsSplittingLocal(self, isfields): # <<<<<<<<<<<<<< * isfields = [isfields] if isinstance(isfields, IS) else list(isfields) * cdef Py_ssize_t i, n = len(isfields) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCDofsSplittingLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_isfields); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":706 * * # --- Patch --- * def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<< * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_193setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_192setPatchCellNumbering[] = "PC.setPatchCellNumbering(self, Section sec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_193setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchCellNumbering (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchCellNumbering") < 0)) __PYX_ERR(39, 706, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 706, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(39, 706, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_192setPatchCellNumbering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setPatchCellNumbering(struct PyPetscPCObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchCellNumbering", 0); /* "PETSc/PC.pyx":707 * # --- Patch --- * def setPatchCellNumbering(self, Section sec not None): * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) # <<<<<<<<<<<<<< * * def setPatchDiscretisationInfo(self, dms, bs, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetCellNumbering(__pyx_v_self->pc, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(39, 707, __pyx_L1_error) /* "PETSc/PC.pyx":706 * * # --- Patch --- * def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<< * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":709 * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_194setPatchDiscretisationInfo[] = "PC.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dms = 0; PyObject *__pyx_v_bs = 0; PyObject *__pyx_v_cellNodeMaps = 0; PyObject *__pyx_v_subspaceOffsets = 0; PyObject *__pyx_v_ghostBcNodes = 0; PyObject *__pyx_v_globalBcNodes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchDiscretisationInfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dms,&__pyx_n_s_bs,&__pyx_n_s_cellNodeMaps,&__pyx_n_s_subspaceOffsets,&__pyx_n_s_ghostBcNodes,&__pyx_n_s_globalBcNodes,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dms)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 1); __PYX_ERR(39, 709, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cellNodeMaps)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 2); __PYX_ERR(39, 709, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subspaceOffsets)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 3); __PYX_ERR(39, 709, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghostBcNodes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 4); __PYX_ERR(39, 709, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_globalBcNodes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 5); __PYX_ERR(39, 709, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchDiscretisationInfo") < 0)) __PYX_ERR(39, 709, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_dms = values[0]; __pyx_v_bs = values[1]; __pyx_v_cellNodeMaps = values[2]; __pyx_v_subspaceOffsets = values[3]; __pyx_v_ghostBcNodes = values[4]; __pyx_v_globalBcNodes = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 709, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_194setPatchDiscretisationInfo(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dms, __pyx_v_bs, __pyx_v_cellNodeMaps, __pyx_v_subspaceOffsets, __pyx_v_ghostBcNodes, __pyx_v_globalBcNodes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_194setPatchDiscretisationInfo(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes) { PetscInt __pyx_v_numSubSpaces; PetscInt __pyx_v_numGhostBcs; PetscInt __pyx_v_numGlobalBcs; PetscInt *__pyx_v_nodesPerCell; PetscInt const **__pyx_v_ccellNodeMaps; DM *__pyx_v_cdms; PetscInt *__pyx_v_cbs; PetscInt *__pyx_v_csubspaceOffsets; PetscInt *__pyx_v_cghostBcNodes; PetscInt *__pyx_v_cglobalBcNodes; PetscInt __pyx_v_i; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_v_nodes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; DM __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PetscInt __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchDiscretisationInfo", 0); __Pyx_INCREF(__pyx_v_bs); __Pyx_INCREF(__pyx_v_subspaceOffsets); __Pyx_INCREF(__pyx_v_ghostBcNodes); __Pyx_INCREF(__pyx_v_globalBcNodes); /* "PETSc/PC.pyx":714 * ghostBcNodes, * globalBcNodes): * cdef PetscInt numSubSpaces = 0 # <<<<<<<<<<<<<< * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL */ __pyx_v_numSubSpaces = 0; /* "PETSc/PC.pyx":715 * globalBcNodes): * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 # <<<<<<<<<<<<<< * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL */ __pyx_v_numGhostBcs = 0; __pyx_v_numGlobalBcs = 0; /* "PETSc/PC.pyx":716 * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL # <<<<<<<<<<<<<< * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL */ __pyx_v_nodesPerCell = NULL; /* "PETSc/PC.pyx":717 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL # <<<<<<<<<<<<<< * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL */ __pyx_v_ccellNodeMaps = NULL; /* "PETSc/PC.pyx":718 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL */ __pyx_v_cdms = NULL; /* "PETSc/PC.pyx":719 * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL # <<<<<<<<<<<<<< * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL */ __pyx_v_cbs = NULL; /* "PETSc/PC.pyx":720 * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL */ __pyx_v_csubspaceOffsets = NULL; /* "PETSc/PC.pyx":721 * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 */ __pyx_v_cghostBcNodes = NULL; /* "PETSc/PC.pyx":722 * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * */ __pyx_v_cglobalBcNodes = NULL; /* "PETSc/PC.pyx":723 * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * * bs = iarray_i(bs, &numSubSpaces, &cbs) */ __pyx_v_i = 0; /* "PETSc/PC.pyx":725 * cdef PetscInt i = 0 * * bs = iarray_i(bs, &numSubSpaces, &cbs) # <<<<<<<<<<<<<< * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_bs, (&__pyx_v_numSubSpaces), (&__pyx_v_cbs))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bs, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":726 * * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) # <<<<<<<<<<<<<< * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghostBcNodes, (&__pyx_v_numGhostBcs), (&__pyx_v_cghostBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ghostBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":727 * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) # <<<<<<<<<<<<<< * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_globalBcNodes, (&__pyx_v_numGlobalBcs), (&__pyx_v_cglobalBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_globalBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":728 * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) # <<<<<<<<<<<<<< * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_subspaceOffsets, NULL, (&__pyx_v_csubspaceOffsets))); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_subspaceOffsets, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PC.pyx":730 * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt))), (&__pyx_v_nodesPerCell))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 730, __pyx_L1_error) /* "PETSc/PC.pyx":731 * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(DM))), (&__pyx_v_cdms))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 731, __pyx_L1_error) /* "PETSc/PC.pyx":732 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) # <<<<<<<<<<<<<< * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt *))), (&__pyx_v_ccellNodeMaps))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 732, __pyx_L1_error) /* "PETSc/PC.pyx":733 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): # <<<<<<<<<<<<<< * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape */ __pyx_t_3 = __pyx_v_numSubSpaces; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "PETSc/PC.pyx":734 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm # <<<<<<<<<<<<<< * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(39, 734, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscDMObject *)__pyx_t_1)->dm; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cdms[__pyx_v_i]) = __pyx_t_6; /* "PETSc/PC.pyx":735 * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape # <<<<<<<<<<<<<< * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(39, 735, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(39, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(39, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(39, 735, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(39, 735, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_nodes, __pyx_t_8); __pyx_t_8 = 0; /* "PETSc/PC.pyx":736 * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) # <<<<<<<<<<<<<< * nodesPerCell[i] = asInt(nodes) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, NULL, ((PetscInt **)(&(__pyx_v_ccellNodeMaps[__pyx_v_i]))))); if (unlikely(!__pyx_t_8)) __PYX_ERR(39, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, __pyx_t_8, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0)) __PYX_ERR(39, 736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/PC.pyx":737 * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) # <<<<<<<<<<<<<< * * # TODO: refactor on the PETSc side to take ISes? */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nodes); if (unlikely(__pyx_t_11 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 737, __pyx_L1_error) (__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11; } /* "PETSc/PC.pyx":740 * * # TODO: refactor on the PETSc side to take ISes? * CHKERR( PCPatchSetDiscretisationInfo(self.pc, numSubSpaces, # <<<<<<<<<<<<<< * cdms, cbs, nodesPerCell, * ccellNodeMaps, csubspaceOffsets, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetDiscretisationInfo(__pyx_v_self->pc, __pyx_v_numSubSpaces, __pyx_v_cdms, __pyx_v_cbs, __pyx_v_nodesPerCell, __pyx_v_ccellNodeMaps, __pyx_v_csubspaceOffsets, __pyx_v_numGhostBcs, __pyx_v_cghostBcNodes, __pyx_v_numGlobalBcs, __pyx_v_cglobalBcNodes)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 740, __pyx_L1_error) /* "PETSc/PC.pyx":745 * numGhostBcs, cghostBcNodes, * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_nodesPerCell)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 745, __pyx_L1_error) /* "PETSc/PC.pyx":746 * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(ccellNodeMaps) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cdms)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 746, __pyx_L1_error) /* "PETSc/PC.pyx":747 * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) # <<<<<<<<<<<<<< * * def setPatchComputeOperator(self, operator, args=None, kargs=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccellNodeMaps)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(39, 747, __pyx_L1_error) /* "PETSc/PC.pyx":709 * CHKERR( PCPatchSetCellNumbering(self.pc, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_XDECREF(__pyx_v_bs); __Pyx_XDECREF(__pyx_v_subspaceOffsets); __Pyx_XDECREF(__pyx_v_ghostBcNodes); __Pyx_XDECREF(__pyx_v_globalBcNodes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":749 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_197setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_196setPatchComputeOperator[] = "PC.setPatchComputeOperator(self, operator, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_197setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeOperator (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeOperator") < 0)) __PYX_ERR(39, 749, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operator = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 749, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_196setPatchComputeOperator(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_196setPatchComputeOperator(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeOperator", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/PC.pyx":750 * * def setPatchComputeOperator(self, operator, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operator, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/PC.pyx":751 * def setPatchComputeOperator(self, operator, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/PC.pyx":752 * if args is None: args = () * if kargs is None: kargs = {} * context = (operator, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_operator__", context) * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":753 * if kargs is None: kargs = {} * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":754 * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeOperator(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 754, __pyx_L1_error) /* "PETSc/PC.pyx":749 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":756 * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_199setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_198setPatchComputeOperatorInteriorFacets[] = "PC.setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_199setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeOperatorInteriorFacets (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeOperatorInteriorFacets") < 0)) __PYX_ERR(39, 756, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operator = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeOperatorInteriorFacets", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 756, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperatorInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_198setPatchComputeOperatorInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setPatchComputeOperatorInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeOperatorInteriorFacets", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/PC.pyx":757 * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operator, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/PC.pyx":758 * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator_interior_facets__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/PC.pyx":759 * if args is None: args = () * if kargs is None: kargs = {} * context = (operator, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_operator_interior_facets__", context) * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":760 * if kargs is None: kargs = {} * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator_interior_facets__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_operator_interior_facets__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":761 * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator_interior_facets__", context) * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeFunction(self, function, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeOperatorInteriorFacets(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperatorInteriorFacets, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 761, __pyx_L1_error) /* "PETSc/PC.pyx":756 * CHKERR( PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, context) ) * * def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeOperatorInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":763 * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_201setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_200setPatchComputeFunction[] = "PC.setPatchComputeFunction(self, function, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_201setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeFunction") < 0)) __PYX_ERR(39, 763, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 763, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_200setPatchComputeFunction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setPatchComputeFunction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/PC.pyx":764 * * def setPatchComputeFunction(self, function, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/PC.pyx":765 * def setPatchComputeFunction(self, function, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/PC.pyx":766 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_function__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":767 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_function__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":768 * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeFunction(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 768, __pyx_L1_error) /* "PETSc/PC.pyx":763 * CHKERR( PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":770 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_203setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_202setPatchComputeFunctionInteriorFacets[] = "PC.setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_203setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeFunctionInteriorFacets (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeFunctionInteriorFacets") < 0)) __PYX_ERR(39, 770, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeFunctionInteriorFacets", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 770, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunctionInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_202setPatchComputeFunctionInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setPatchComputeFunctionInteriorFacets(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeFunctionInteriorFacets", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/PC.pyx":771 * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/PC.pyx":772 * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr("__patch_compute_function_interior_facets__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/PC.pyx":773 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_function_interior_facets__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":774 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr("__patch_compute_function_interior_facets__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_function_interior_facets__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":775 * context = (function, args, kargs) * self.set_attr("__patch_compute_function_interior_facets__", context) * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) # <<<<<<<<<<<<<< * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetComputeFunction(__pyx_v_self->pc, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunctionInteriorFacets, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(39, 775, __pyx_L1_error) /* "PETSc/PC.pyx":770 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, context) ) * * def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchComputeFunctionInteriorFacets", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PC.pyx":777 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_205setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2PC_204setPatchConstructType[] = "PC.setPatchConstructType(self, typ, operator=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_205setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_typ = 0; PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchConstructType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchConstructType") < 0)) __PYX_ERR(39, 777, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typ = values[0]; __pyx_v_operator = values[1]; __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(39, 777, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_204setPatchConstructType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setPatchConstructType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PCPatchConstructType __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchConstructType", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/PC.pyx":778 * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/PC.pyx":779 * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/PC.pyx":781 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ __Pyx_INCREF(__pyx_v_typ); __pyx_t_3 = __pyx_v_typ; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L8_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(39, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_6; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = (__pyx_v_operator == Py_None); __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "PETSc/PC.pyx":782 * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") # <<<<<<<<<<<<<< * if operator is not None: * context = (operator, args, kargs) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(39, 782, __pyx_L1_error) /* "PETSc/PC.pyx":781 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ } /* "PETSc/PC.pyx":783 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ __pyx_t_1 = (__pyx_v_operator != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/PC.pyx":784 * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: * context = (operator, args, kargs) # <<<<<<<<<<<<<< * else: * context = None */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":783 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ goto __pyx_L10; } /* "PETSc/PC.pyx":786 * context = (operator, args, kargs) * else: * context = None # <<<<<<<<<<<<<< * self.set_attr("__patch_construction_operator__", context) * CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, context) ) */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_context = ((PyObject*)Py_None); } __pyx_L10:; /* "PETSc/PC.pyx":787 * else: * context = None * self.set_attr("__patch_construction_operator__", context) # <<<<<<<<<<<<<< * CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_PC *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_construction_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":788 * context = None * self.set_attr("__patch_construction_operator__", context) * CHKERR( PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, context) ) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = ((PCPatchConstructType)__Pyx_PyInt_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 788, __pyx_L1_error) __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetConstructType(__pyx_v_self->pc, __pyx_t_7, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(39, 788, __pyx_L1_error) /* "PETSc/PC.pyx":777 * CHKERR( PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.PC.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":101 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ksp * self.ksp = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP___cinit__(struct PyPetscKSPObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/KSP.pyx":102 * * def __cinit__(self): * self.obj = &self.ksp # <<<<<<<<<<<<<< * self.ksp = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ksp)); /* "PETSc/KSP.pyx":103 * def __cinit__(self): * self.obj = &self.ksp * self.ksp = NULL # <<<<<<<<<<<<<< * * def __call__(self, b, x=None): */ __pyx_v_self->ksp = NULL; /* "PETSc/KSP.pyx":101 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ksp * self.ksp = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":105 * self.ksp = NULL * * def __call__(self, b, x=None): # <<<<<<<<<<<<<< * if x is None: # XXX do this better * x = self.getOperators()[0].createVecLeft() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_b = 0; PyObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(40, 105, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_b = values[0]; __pyx_v_x = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 105, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2__call__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_b, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_x); /* "PETSc/KSP.pyx":106 * * def __call__(self, b, x=None): * if x is None: # XXX do this better # <<<<<<<<<<<<<< * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) */ __pyx_t_1 = (__pyx_v_x == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/KSP.pyx":107 * def __call__(self, b, x=None): * if x is None: # XXX do this better * x = self.getOperators()[0].createVecLeft() # <<<<<<<<<<<<<< * self.solve(b, x) * return x */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":106 * * def __call__(self, b, x=None): * if x is None: # XXX do this better # <<<<<<<<<<<<<< * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) */ } /* "PETSc/KSP.pyx":108 * if x is None: # XXX do this better * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) # <<<<<<<<<<<<<< * return x * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_solve); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_b, __pyx_v_x}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 108, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_b, __pyx_v_x}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 108, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_b); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_x); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":109 * x = self.getOperators()[0].createVecLeft() * self.solve(b, x) * return x # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; /* "PETSc/KSP.pyx":105 * self.ksp = NULL * * def __call__(self, b, x=None): # <<<<<<<<<<<<<< * if x is None: # XXX do this better * x = self.getOperators()[0].createVecLeft() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.KSP.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":113 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_4view[] = "KSP.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_5view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(40, 113, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 113, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(40, 113, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4view(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4view(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/KSP.pyx":114 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( KSPView(self.ksp, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/KSP.pyx":115 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( KSPView(self.ksp, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/KSP.pyx":116 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( KSPView(self.ksp, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPView(__pyx_v_self->ksp, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 116, __pyx_L1_error) /* "PETSc/KSP.pyx":113 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":118 * CHKERR( KSPView(self.ksp, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( KSPDestroy(&self.ksp) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_6destroy[] = "KSP.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6destroy(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/KSP.pyx":119 * * def destroy(self): * CHKERR( KSPDestroy(&self.ksp) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPDestroy((&__pyx_v_self->ksp))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 119, __pyx_L1_error) /* "PETSc/KSP.pyx":120 * def destroy(self): * CHKERR( KSPDestroy(&self.ksp) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/KSP.pyx":118 * CHKERR( KSPView(self.ksp, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( KSPDestroy(&self.ksp) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":122 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_8create[] = "KSP.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(40, 122, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 122, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_8create(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8create(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; KSP __pyx_v_newksp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/KSP.pyx":123 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 123, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/KSP.pyx":124 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL # <<<<<<<<<<<<<< * CHKERR( KSPCreate(ccomm, &newksp) ) * PetscCLEAR(self.obj); self.ksp = newksp */ __pyx_v_newksp = NULL; /* "PETSc/KSP.pyx":125 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ksp = newksp * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPCreate(__pyx_v_ccomm, (&__pyx_v_newksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 125, __pyx_L1_error) /* "PETSc/KSP.pyx":126 * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) * PetscCLEAR(self.obj); self.ksp = newksp # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ksp = __pyx_v_newksp; /* "PETSc/KSP.pyx":127 * CHKERR( KSPCreate(ccomm, &newksp) ) * PetscCLEAR(self.obj); self.ksp = newksp * return self # <<<<<<<<<<<<<< * * def setType(self, ksp_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/KSP.pyx":122 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":129 * return self * * def setType(self, ksp_type): # <<<<<<<<<<<<<< * cdef PetscKSPType cval = NULL * ksp_type = str2bytes(ksp_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_10setType[] = "KSP.setType(self, ksp_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ksp_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ksp_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ksp_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(40, 129, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ksp_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 129, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_10setType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_ksp_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_10setType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_ksp_type) { KSPType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_ksp_type); /* "PETSc/KSP.pyx":130 * * def setType(self, ksp_type): * cdef PetscKSPType cval = NULL # <<<<<<<<<<<<<< * ksp_type = str2bytes(ksp_type, &cval) * CHKERR( KSPSetType(self.ksp, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/KSP.pyx":131 * def setType(self, ksp_type): * cdef PetscKSPType cval = NULL * ksp_type = str2bytes(ksp_type, &cval) # <<<<<<<<<<<<<< * CHKERR( KSPSetType(self.ksp, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ksp_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ksp_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":132 * cdef PetscKSPType cval = NULL * ksp_type = str2bytes(ksp_type, &cval) * CHKERR( KSPSetType(self.ksp, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetType(__pyx_v_self->ksp, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 132, __pyx_L1_error) /* "PETSc/KSP.pyx":129 * return self * * def setType(self, ksp_type): # <<<<<<<<<<<<<< * cdef PetscKSPType cval = NULL * ksp_type = str2bytes(ksp_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ksp_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":134 * CHKERR( KSPSetType(self.ksp, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscKSPType cval = NULL * CHKERR( KSPGetType(self.ksp, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_12getType[] = "KSP.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_12getType(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_12getType(struct PyPetscKSPObject *__pyx_v_self) { KSPType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/KSP.pyx":135 * * def getType(self): * cdef PetscKSPType cval = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetType(self.ksp, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/KSP.pyx":136 * def getType(self): * cdef PetscKSPType cval = NULL * CHKERR( KSPGetType(self.ksp, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetType(__pyx_v_self->ksp, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 136, __pyx_L1_error) /* "PETSc/KSP.pyx":137 * cdef PetscKSPType cval = NULL * CHKERR( KSPGetType(self.ksp, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":134 * CHKERR( KSPSetType(self.ksp, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscKSPType cval = NULL * CHKERR( KSPGetType(self.ksp, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":139 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_14setOptionsPrefix[] = "KSP.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(40, 139, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 139, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_14setOptionsPrefix(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_14setOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/KSP.pyx":140 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/KSP.pyx":141 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":142 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetOptionsPrefix(__pyx_v_self->ksp, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 142, __pyx_L1_error) /* "PETSc/KSP.pyx":139 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":144 * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_16getOptionsPrefix[] = "KSP.getOptionsPrefix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_16getOptionsPrefix(struct PyPetscKSPObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/KSP.pyx":145 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/KSP.pyx":146 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetOptionsPrefix(__pyx_v_self->ksp, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 146, __pyx_L1_error) /* "PETSc/KSP.pyx":147 * cdef const char *cval = NULL * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":144 * CHKERR( KSPSetOptionsPrefix(self.ksp, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( KSPGetOptionsPrefix(self.ksp, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":149 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( KSPSetFromOptions(self.ksp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_19setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_18setFromOptions[] = "KSP.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_19setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_18setFromOptions(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_18setFromOptions(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/KSP.pyx":150 * * def setFromOptions(self): * CHKERR( KSPSetFromOptions(self.ksp) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetFromOptions(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 150, __pyx_L1_error) /* "PETSc/KSP.pyx":149 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( KSPSetFromOptions(self.ksp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":154 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_21setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_20setAppCtx[] = "KSP.setAppCtx(self, appctx)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_21setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_appctx = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_appctx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAppCtx") < 0)) __PYX_ERR(40, 154, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 154, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_20setAppCtx(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_20setAppCtx(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 0); /* "PETSc/KSP.pyx":155 * * def setAppCtx(self, appctx): * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":154 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":157 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_23getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_22getAppCtx[] = "KSP.getAppCtx(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_23getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_22getAppCtx(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_22getAppCtx(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 0); /* "PETSc/KSP.pyx":158 * * def getAppCtx(self): * return self.get_attr('__appctx__') # <<<<<<<<<<<<<< * * # --- discretization space --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":157 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":162 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( KSPGetDM(self.ksp, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_25getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_24getDM[] = "KSP.getDM(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_25getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_24getDM(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_24getDM(struct PyPetscKSPObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 0); /* "PETSc/KSP.pyx":163 * * def getDM(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetDM(self.ksp, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/KSP.pyx":164 * def getDM(self): * cdef PetscDM newdm = NULL * CHKERR( KSPGetDM(self.ksp, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetDM(__pyx_v_self->ksp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 164, __pyx_L1_error) /* "PETSc/KSP.pyx":165 * cdef PetscDM newdm = NULL * CHKERR( KSPGetDM(self.ksp, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * PetscINCREF(dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(40, 165, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":166 * CHKERR( KSPGetDM(self.ksp, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/KSP.pyx":167 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * return dm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/KSP.pyx":168 * dm.dm = newdm * PetscINCREF(dm.obj) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/KSP.pyx":162 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( KSPGetDM(self.ksp, &newdm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":170 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( KSPSetDM(self.ksp, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_27setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_26setDM[] = "KSP.setDM(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_27setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(40, 170, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 170, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(40, 170, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_26setDM(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_26setDM(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 0); /* "PETSc/KSP.pyx":171 * * def setDM(self, DM dm): * CHKERR( KSPSetDM(self.ksp, dm.dm) ) # <<<<<<<<<<<<<< * * def setDMActive(self, bint flag): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetDM(__pyx_v_self->ksp, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 171, __pyx_L1_error) /* "PETSc/KSP.pyx":170 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( KSPSetDM(self.ksp, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":173 * CHKERR( KSPSetDM(self.ksp, dm.dm) ) * * def setDMActive(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool cflag = PETSC_FALSE * if flag: cflag = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_29setDMActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_28setDMActive[] = "KSP.setDMActive(self, bool flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_29setDMActive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_flag; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDMActive (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDMActive") < 0)) __PYX_ERR(40, 173, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(40, 173, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDMActive", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 173, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDMActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_28setDMActive(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_28setDMActive(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) { PetscBool __pyx_v_cflag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDMActive", 0); /* "PETSc/KSP.pyx":174 * * def setDMActive(self, bint flag): * cdef PetscBool cflag = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: cflag = PETSC_TRUE * CHKERR( KSPSetDMActive(self.ksp, cflag) ) */ __pyx_v_cflag = PETSC_FALSE; /* "PETSc/KSP.pyx":175 * def setDMActive(self, bint flag): * cdef PetscBool cflag = PETSC_FALSE * if flag: cflag = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( KSPSetDMActive(self.ksp, cflag) ) * */ __pyx_t_1 = (__pyx_v_flag != 0); if (__pyx_t_1) { __pyx_v_cflag = PETSC_TRUE; } /* "PETSc/KSP.pyx":176 * cdef PetscBool cflag = PETSC_FALSE * if flag: cflag = PETSC_TRUE * CHKERR( KSPSetDMActive(self.ksp, cflag) ) # <<<<<<<<<<<<<< * * # --- operators and preconditioner --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetDMActive(__pyx_v_self->ksp, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 176, __pyx_L1_error) /* "PETSc/KSP.pyx":173 * CHKERR( KSPSetDM(self.ksp, dm.dm) ) * * def setDMActive(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool cflag = PETSC_FALSE * if flag: cflag = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setDMActive", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":180 * # --- operators and preconditioner --- * * def setComputeRHS(self, rhs, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_31setComputeRHS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_30setComputeRHS[] = "KSP.setComputeRHS(self, rhs, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_31setComputeRHS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rhs = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeRHS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rhs,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeRHS") < 0)) __PYX_ERR(40, 180, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rhs = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeRHS", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 180, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeRHS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_30setComputeRHS(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rhs, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_30setComputeRHS(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rhs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeRHS", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/KSP.pyx":181 * * def setComputeRHS(self, rhs, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (rhs, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/KSP.pyx":182 * def setComputeRHS(self, rhs, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (rhs, args, kargs) * self.set_attr('__rhs__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/KSP.pyx":183 * if args is None: args = () * if kargs is None: kargs = {} * context = (rhs, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhs__', context) * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_rhs); __Pyx_GIVEREF(__pyx_v_rhs); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rhs); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":184 * if kargs is None: kargs = {} * context = (rhs, args, kargs) * self.set_attr('__rhs__', context) # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhs__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":185 * context = (rhs, args, kargs) * self.set_attr('__rhs__', context) * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) # <<<<<<<<<<<<<< * * def setComputeOperators(self, operators, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeRHS(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_ComputeRHS, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 185, __pyx_L1_error) /* "PETSc/KSP.pyx":180 * # --- operators and preconditioner --- * * def setComputeRHS(self, rhs, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeRHS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":187 * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) * * def setComputeOperators(self, operators, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_32setComputeOperators[] = "KSP.setComputeOperators(self, operators, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_operators = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeOperators (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operators,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operators)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeOperators") < 0)) __PYX_ERR(40, 187, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operators = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeOperators", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 187, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_32setComputeOperators(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_operators, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_32setComputeOperators(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeOperators", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/KSP.pyx":188 * * def setComputeOperators(self, operators, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operators, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/KSP.pyx":189 * def setComputeOperators(self, operators, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operators, args, kargs) * self.set_attr('__operators__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/KSP.pyx":190 * if args is None: args = () * if kargs is None: kargs = {} * context = (operators, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__operators__', context) * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_operators); __Pyx_GIVEREF(__pyx_v_operators); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operators); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":191 * if kargs is None: kargs = {} * context = (operators, args, kargs) * self.set_attr('__operators__', context) # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__operators__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":192 * context = (operators, args, kargs) * self.set_attr('__operators__', context) * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) # <<<<<<<<<<<<<< * * def setOperators(self, Mat A=None, Mat P=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeOperators(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 192, __pyx_L1_error) /* "PETSc/KSP.pyx":187 * CHKERR( KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, context) ) * * def setComputeOperators(self, operators, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":194 * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) * * def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscMat amat=NULL * if A is not None: amat = A.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_35setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_34setOperators[] = "KSP.setOperators(self, Mat A=None, Mat P=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_35setOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOperators (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_P,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOperators") < 0)) __PYX_ERR(40, 194, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_A = ((struct PyPetscMatObject *)values[0]); __pyx_v_P = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOperators", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 194, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(40, 194, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(40, 194, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_34setOperators(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_A, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_34setOperators(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_amat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOperators", 0); /* "PETSc/KSP.pyx":195 * * def setOperators(self, Mat A=None, Mat P=None): * cdef PetscMat amat=NULL # <<<<<<<<<<<<<< * if A is not None: amat = A.mat * cdef PetscMat pmat=amat */ __pyx_v_amat = NULL; /* "PETSc/KSP.pyx":196 * def setOperators(self, Mat A=None, Mat P=None): * cdef PetscMat amat=NULL * if A is not None: amat = A.mat # <<<<<<<<<<<<<< * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_A->mat; __pyx_v_amat = __pyx_t_3; } /* "PETSc/KSP.pyx":197 * cdef PetscMat amat=NULL * if A is not None: amat = A.mat * cdef PetscMat pmat=amat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) */ __pyx_v_pmat = __pyx_v_amat; /* "PETSc/KSP.pyx":198 * if A is not None: amat = A.mat * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_3; } /* "PETSc/KSP.pyx":199 * cdef PetscMat pmat=amat * if P is not None: pmat = P.mat * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) # <<<<<<<<<<<<<< * * def getOperators(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetOperators(__pyx_v_self->ksp, __pyx_v_amat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 199, __pyx_L1_error) /* "PETSc/KSP.pyx":194 * CHKERR( KSPSetComputeOperators(self.ksp, KSP_ComputeOps, context) ) * * def setOperators(self, Mat A=None, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscMat amat=NULL * if A is not None: amat = A.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":201 * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) * * def getOperators(self): # <<<<<<<<<<<<<< * cdef Mat A = Mat(), P = Mat() * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_37getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_36getOperators[] = "KSP.getOperators(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_37getOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOperators (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOperators", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOperators", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_36getOperators(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_36getOperators(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOperators", 0); /* "PETSc/KSP.pyx":202 * * def getOperators(self): * cdef Mat A = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) * PetscINCREF(A.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":203 * def getOperators(self): * cdef Mat A = Mat(), P = Mat() * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(A.obj) * PetscINCREF(P.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetOperators(__pyx_v_self->ksp, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 203, __pyx_L1_error) /* "PETSc/KSP.pyx":204 * cdef Mat A = Mat(), P = Mat() * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) * PetscINCREF(A.obj) # <<<<<<<<<<<<<< * PetscINCREF(P.obj) * return (A, P) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); /* "PETSc/KSP.pyx":205 * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) * PetscINCREF(A.obj) * PetscINCREF(P.obj) # <<<<<<<<<<<<<< * return (A, P) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); /* "PETSc/KSP.pyx":206 * PetscINCREF(A.obj) * PetscINCREF(P.obj) * return (A, P) # <<<<<<<<<<<<<< * * def setPC(self, PC pc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_A)); __Pyx_GIVEREF(((PyObject *)__pyx_v_A)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":201 * CHKERR( KSPSetOperators(self.ksp, amat, pmat) ) * * def getOperators(self): # <<<<<<<<<<<<<< * cdef Mat A = Mat(), P = Mat() * CHKERR( KSPGetOperators(self.ksp, &A.mat, &P.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":208 * return (A, P) * * def setPC(self, PC pc): # <<<<<<<<<<<<<< * CHKERR( KSPSetPC(self.ksp, pc.pc) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_39setPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_38setPC[] = "KSP.setPC(self, PC pc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_39setPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscPCObject *__pyx_v_pc = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPC (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pc,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pc)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPC") < 0)) __PYX_ERR(40, 208, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_pc = ((struct PyPetscPCObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPC", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 208, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pc), __pyx_ptype_8petsc4py_5PETSc_PC, 0, "pc", 0))) __PYX_ERR(40, 208, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_38setPC(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_pc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_38setPC(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscPCObject *__pyx_v_pc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPC", 0); /* "PETSc/KSP.pyx":209 * * def setPC(self, PC pc): * CHKERR( KSPSetPC(self.ksp, pc.pc) ) # <<<<<<<<<<<<<< * * def getPC(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPC(__pyx_v_self->ksp, __pyx_v_pc->pc)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 209, __pyx_L1_error) /* "PETSc/KSP.pyx":208 * return (A, P) * * def setPC(self, PC pc): # <<<<<<<<<<<<<< * CHKERR( KSPSetPC(self.ksp, pc.pc) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":211 * CHKERR( KSPSetPC(self.ksp, pc.pc) ) * * def getPC(self): # <<<<<<<<<<<<<< * cdef PC pc = PC() * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_41getPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_40getPC[] = "KSP.getPC(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_41getPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPC (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPC", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPC", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_40getPC(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_40getPC(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscPCObject *__pyx_v_pc = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPC", 0); /* "PETSc/KSP.pyx":212 * * def getPC(self): * cdef PC pc = PC() # <<<<<<<<<<<<<< * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) * PetscINCREF(pc.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":213 * def getPC(self): * cdef PC pc = PC() * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) # <<<<<<<<<<<<<< * PetscINCREF(pc.obj) * return pc */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetPC(__pyx_v_self->ksp, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 213, __pyx_L1_error) /* "PETSc/KSP.pyx":214 * cdef PC pc = PC() * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) * PetscINCREF(pc.obj) # <<<<<<<<<<<<<< * return pc * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj)); /* "PETSc/KSP.pyx":215 * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) * PetscINCREF(pc.obj) * return pc # <<<<<<<<<<<<<< * * # --- tolerances and convergence --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_pc)); __pyx_r = ((PyObject *)__pyx_v_pc); goto __pyx_L0; /* "PETSc/KSP.pyx":211 * CHKERR( KSPSetPC(self.ksp, pc.pc) ) * * def getPC(self): # <<<<<<<<<<<<<< * cdef PC pc = PC() * CHKERR( KSPGetPC(self.ksp, &pc.pc) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_pc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":219 * # --- tolerances and convergence --- * * def setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None): # <<<<<<<<<<<<<< * cdef PetscReal crtol, catol, cdivtol * crtol = catol = cdivtol = PETSC_DEFAULT; */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_43setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_42setTolerances[] = "KSP.setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_43setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; PyObject *__pyx_v_divtol = 0; PyObject *__pyx_v_max_it = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,&__pyx_n_s_divtol,&__pyx_n_s_max_it,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_divtol); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_it); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTolerances") < 0)) __PYX_ERR(40, 219, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rtol = values[0]; __pyx_v_atol = values[1]; __pyx_v_divtol = values[2]; __pyx_v_max_it = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 219, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_42setTolerances(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol, __pyx_v_divtol, __pyx_v_max_it); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_42setTolerances(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_divtol, PyObject *__pyx_v_max_it) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cdivtol; PetscInt __pyx_v_cmaxits; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 0); /* "PETSc/KSP.pyx":221 * def setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None): * cdef PetscReal crtol, catol, cdivtol * crtol = catol = cdivtol = PETSC_DEFAULT; # <<<<<<<<<<<<<< * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) */ __pyx_v_crtol = PETSC_DEFAULT; __pyx_v_catol = PETSC_DEFAULT; __pyx_v_cdivtol = PETSC_DEFAULT; /* "PETSc/KSP.pyx":222 * cdef PetscReal crtol, catol, cdivtol * crtol = catol = cdivtol = PETSC_DEFAULT; * if rtol is not None: crtol = asReal(rtol) # <<<<<<<<<<<<<< * if atol is not None: catol = asReal(atol) * if divtol is not None: cdivtol = asReal(divtol) */ __pyx_t_1 = (__pyx_v_rtol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(40, 222, __pyx_L1_error) __pyx_v_crtol = __pyx_t_3; } /* "PETSc/KSP.pyx":223 * crtol = catol = cdivtol = PETSC_DEFAULT; * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) # <<<<<<<<<<<<<< * if divtol is not None: cdivtol = asReal(divtol) * cdef PetscInt cmaxits = PETSC_DEFAULT */ __pyx_t_2 = (__pyx_v_atol != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(40, 223, __pyx_L1_error) __pyx_v_catol = __pyx_t_3; } /* "PETSc/KSP.pyx":224 * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) * if divtol is not None: cdivtol = asReal(divtol) # <<<<<<<<<<<<<< * cdef PetscInt cmaxits = PETSC_DEFAULT * if max_it is not None: cmaxits = asInt(max_it) */ __pyx_t_1 = (__pyx_v_divtol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_divtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(40, 224, __pyx_L1_error) __pyx_v_cdivtol = __pyx_t_3; } /* "PETSc/KSP.pyx":225 * if atol is not None: catol = asReal(atol) * if divtol is not None: cdivtol = asReal(divtol) * cdef PetscInt cmaxits = PETSC_DEFAULT # <<<<<<<<<<<<<< * if max_it is not None: cmaxits = asInt(max_it) * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) */ __pyx_v_cmaxits = PETSC_DEFAULT; /* "PETSc/KSP.pyx":226 * if divtol is not None: cdivtol = asReal(divtol) * cdef PetscInt cmaxits = PETSC_DEFAULT * if max_it is not None: cmaxits = asInt(max_it) # <<<<<<<<<<<<<< * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) * */ __pyx_t_2 = (__pyx_v_max_it != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_it); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 226, __pyx_L1_error) __pyx_v_cmaxits = __pyx_t_4; } /* "PETSc/KSP.pyx":227 * cdef PetscInt cmaxits = PETSC_DEFAULT * if max_it is not None: cmaxits = asInt(max_it) * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) # <<<<<<<<<<<<<< * * def getTolerances(self): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetTolerances(__pyx_v_self->ksp, __pyx_v_crtol, __pyx_v_catol, __pyx_v_cdivtol, __pyx_v_cmaxits)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(40, 227, __pyx_L1_error) /* "PETSc/KSP.pyx":219 * # --- tolerances and convergence --- * * def setTolerances(self, rtol=None, atol=None, divtol=None, max_it=None): # <<<<<<<<<<<<<< * cdef PetscReal crtol, catol, cdivtol * crtol = catol = cdivtol = PETSC_DEFAULT; */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":229 * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * cdef PetscReal crtol=0, catol=0, cdivtol=0 * cdef PetscInt cmaxits=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_45getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_44getTolerances[] = "KSP.getTolerances(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_45getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_44getTolerances(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_44getTolerances(struct PyPetscKSPObject *__pyx_v_self) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cdivtol; PetscInt __pyx_v_cmaxits; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 0); /* "PETSc/KSP.pyx":230 * * def getTolerances(self): * cdef PetscReal crtol=0, catol=0, cdivtol=0 # <<<<<<<<<<<<<< * cdef PetscInt cmaxits=0 * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) */ __pyx_v_crtol = 0.0; __pyx_v_catol = 0.0; __pyx_v_cdivtol = 0.0; /* "PETSc/KSP.pyx":231 * def getTolerances(self): * cdef PetscReal crtol=0, catol=0, cdivtol=0 * cdef PetscInt cmaxits=0 # <<<<<<<<<<<<<< * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) */ __pyx_v_cmaxits = 0; /* "PETSc/KSP.pyx":232 * cdef PetscReal crtol=0, catol=0, cdivtol=0 * cdef PetscInt cmaxits=0 * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) # <<<<<<<<<<<<<< * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetTolerances(__pyx_v_self->ksp, (&__pyx_v_crtol), (&__pyx_v_catol), (&__pyx_v_cdivtol), (&__pyx_v_cmaxits))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 232, __pyx_L1_error) /* "PETSc/KSP.pyx":233 * cdef PetscInt cmaxits=0 * CHKERR( KSPGetTolerances(self.ksp, &crtol, &catol, &cdivtol, &cmaxits) ) * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) # <<<<<<<<<<<<<< * * def setConvergenceTest(self, converged, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_crtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_catol); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cdivtol); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cmaxits); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(40, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":229 * CHKERR( KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * cdef PetscReal crtol=0, catol=0, cdivtol=0 * cdef PetscInt cmaxits=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":235 * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) * * def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_47setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_46setConvergenceTest[] = "KSP.setConvergenceTest(self, converged, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_47setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_converged = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceTest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_converged)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceTest") < 0)) __PYX_ERR(40, 235, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_converged = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 235, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_46setConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_46setConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { KSPNormType __pyx_v_normtype; void *__pyx_v_cctx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceTest", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/KSP.pyx":236 * * def setConvergenceTest(self, converged, args=None, kargs=None): * cdef PetscKSPNormType normtype = KSP_NORM_NONE # <<<<<<<<<<<<<< * cdef void* cctx = NULL * if converged is not None: */ __pyx_v_normtype = KSP_NORM_NONE; /* "PETSc/KSP.pyx":237 * def setConvergenceTest(self, converged, args=None, kargs=None): * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL # <<<<<<<<<<<<<< * if converged is not None: * CHKERR( KSPSetConvergenceTest( */ __pyx_v_cctx = NULL; /* "PETSc/KSP.pyx":238 * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL * if converged is not None: # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergenceTest( * self.ksp, KSP_Converged, NULL, NULL) ) */ __pyx_t_1 = (__pyx_v_converged != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/KSP.pyx":239 * cdef void* cctx = NULL * if converged is not None: * CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<< * self.ksp, KSP_Converged, NULL, NULL) ) * if args is None: args = () */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_Converged, NULL, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(40, 239, __pyx_L1_error) /* "PETSc/KSP.pyx":241 * CHKERR( KSPSetConvergenceTest( * self.ksp, KSP_Converged, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/KSP.pyx":242 * self.ksp, KSP_Converged, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__converged__', (converged, args, kargs)) * else: */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/KSP.pyx":243 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) # <<<<<<<<<<<<<< * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_converged); __Pyx_GIVEREF(__pyx_v_converged); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_converged); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/KSP.pyx":238 * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL * if converged is not None: # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergenceTest( * self.ksp, KSP_Converged, NULL, NULL) ) */ goto __pyx_L3; } /* "PETSc/KSP.pyx":245 * self.set_attr('__converged__', (converged, args, kargs)) * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) # <<<<<<<<<<<<<< * if normtype != KSP_NORM_NONE: * CHKERR( KSPConvergedDefaultCreate(&cctx) ) */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetNormType(__pyx_v_self->ksp, (&__pyx_v_normtype))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(40, 245, __pyx_L1_error) /* "PETSc/KSP.pyx":246 * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * if normtype != KSP_NORM_NONE: # <<<<<<<<<<<<<< * CHKERR( KSPConvergedDefaultCreate(&cctx) ) * CHKERR( KSPSetConvergenceTest( */ __pyx_t_2 = ((__pyx_v_normtype != KSP_NORM_NONE) != 0); if (__pyx_t_2) { /* "PETSc/KSP.pyx":247 * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * if normtype != KSP_NORM_NONE: * CHKERR( KSPConvergedDefaultCreate(&cctx) ) # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergenceTest( * self.ksp, KSPConvergedDefault, */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPConvergedDefaultCreate((&__pyx_v_cctx))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(40, 247, __pyx_L1_error) /* "PETSc/KSP.pyx":248 * if normtype != KSP_NORM_NONE: * CHKERR( KSPConvergedDefaultCreate(&cctx) ) * CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<< * self.ksp, KSPConvergedDefault, * cctx, KSPConvergedDefaultDestroy) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, KSPConvergedDefault, __pyx_v_cctx, KSPConvergedDefaultDestroy)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(40, 248, __pyx_L1_error) /* "PETSc/KSP.pyx":246 * else: * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * if normtype != KSP_NORM_NONE: # <<<<<<<<<<<<<< * CHKERR( KSPConvergedDefaultCreate(&cctx) ) * CHKERR( KSPSetConvergenceTest( */ goto __pyx_L6; } /* "PETSc/KSP.pyx":252 * cctx, KSPConvergedDefaultDestroy) ) * else: * CHKERR( KSPSetConvergenceTest( # <<<<<<<<<<<<<< * self.ksp, KSPConvergedSkip, * NULL, NULL) ) */ /*else*/ { /* "PETSc/KSP.pyx":254 * CHKERR( KSPSetConvergenceTest( * self.ksp, KSPConvergedSkip, * NULL, NULL) ) # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, KSPConvergedSkip, NULL, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(40, 252, __pyx_L1_error) } __pyx_L6:; /* "PETSc/KSP.pyx":255 * self.ksp, KSPConvergedSkip, * NULL, NULL) ) * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * * def getConvergenceTest(self): */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_L3:; /* "PETSc/KSP.pyx":235 * return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits)) * * def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscKSPNormType normtype = KSP_NORM_NONE * cdef void* cctx = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":257 * self.set_attr('__converged__', None) * * def getConvergenceTest(self): # <<<<<<<<<<<<<< * return self.get_attr('__converged__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_49getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_48getConvergenceTest[] = "KSP.getConvergenceTest(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_49getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_48getConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_48getConvergenceTest(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceTest", 0); /* "PETSc/KSP.pyx":258 * * def getConvergenceTest(self): * return self.get_attr('__converged__') # <<<<<<<<<<<<<< * * def callConvergenceTest(self, its, rnorm): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":257 * self.set_attr('__converged__', None) * * def getConvergenceTest(self): # <<<<<<<<<<<<<< * return self.get_attr('__converged__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":260 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its, rnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_50callConvergenceTest[] = "KSP.callConvergenceTest(self, its, rnorm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_rnorm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("callConvergenceTest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 2, 2, 1); __PYX_ERR(40, 260, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "callConvergenceTest") < 0)) __PYX_ERR(40, 260, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_its = values[0]; __pyx_v_rnorm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 260, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_50callConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_50callConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; KSPConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("callConvergenceTest", 0); /* "PETSc/KSP.pyx":261 * * def callConvergenceTest(self, its, rnorm): * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 261, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/KSP.pyx":262 * def callConvergenceTest(self, its, rnorm): * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(40, 262, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "PETSc/KSP.pyx":263 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) * return reason */ __pyx_v_reason = KSP_CONVERGED_ITERATING; /* "PETSc/KSP.pyx":264 * cdef PetscReal rval = asReal(rnorm) * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPConvergenceTestCall(__pyx_v_self->ksp, __pyx_v_ival, __pyx_v_rval, (&__pyx_v_reason))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(40, 264, __pyx_L1_error) /* "PETSc/KSP.pyx":265 * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPConvergenceTestCall(self.ksp, ival, rval, &reason) ) * return reason # <<<<<<<<<<<<<< * * def setConvergenceHistory(self, length=None, reset=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":260 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its, rnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":267 * return reason * * def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<< * cdef PetscReal *data = NULL * cdef PetscInt size = 10000 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_52setConvergenceHistory[] = "KSP.setConvergenceHistory(self, length=None, reset=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_length = 0; PyObject *__pyx_v_reset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceHistory (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_reset,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reset); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceHistory") < 0)) __PYX_ERR(40, 267, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_length = values[0]; __pyx_v_reset = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceHistory", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 267, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_52setConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52setConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset) { PetscReal *__pyx_v_data; PetscInt __pyx_v_size; PetscBool __pyx_v_flag; PyObject *__pyx_v_hist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceHistory", 0); /* "PETSc/KSP.pyx":268 * * def setConvergenceHistory(self, length=None, reset=False): * cdef PetscReal *data = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 10000 * cdef PetscBool flag = PETSC_FALSE */ __pyx_v_data = NULL; /* "PETSc/KSP.pyx":269 * def setConvergenceHistory(self, length=None, reset=False): * cdef PetscReal *data = NULL * cdef PetscInt size = 10000 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * if length is True: pass */ __pyx_v_size = 0x2710; /* "PETSc/KSP.pyx":270 * cdef PetscReal *data = NULL * cdef PetscInt size = 10000 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * if length is True: pass * elif length is not None: size = asInt(length) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/KSP.pyx":271 * cdef PetscInt size = 10000 * cdef PetscBool flag = PETSC_FALSE * if length is True: pass # <<<<<<<<<<<<<< * elif length is not None: size = asInt(length) * if size < 0: size = 10000 */ __pyx_t_1 = (__pyx_v_length == Py_True); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { goto __pyx_L3; } /* "PETSc/KSP.pyx":272 * cdef PetscBool flag = PETSC_FALSE * if length is True: pass * elif length is not None: size = asInt(length) # <<<<<<<<<<<<<< * if size < 0: size = 10000 * if reset: flag = PETSC_TRUE */ __pyx_t_2 = (__pyx_v_length != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_length); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 272, __pyx_L1_error) __pyx_v_size = __pyx_t_3; } __pyx_L3:; /* "PETSc/KSP.pyx":273 * if length is True: pass * elif length is not None: size = asInt(length) * if size < 0: size = 10000 # <<<<<<<<<<<<<< * if reset: flag = PETSC_TRUE * cdef object hist = oarray_r(empty_r(size), NULL, &data) */ __pyx_t_1 = ((__pyx_v_size < 0) != 0); if (__pyx_t_1) { __pyx_v_size = 0x2710; } /* "PETSc/KSP.pyx":274 * elif length is not None: size = asInt(length) * if size < 0: size = 10000 * if reset: flag = PETSC_TRUE # <<<<<<<<<<<<<< * cdef object hist = oarray_r(empty_r(size), NULL, &data) * self.set_attr('__history__', hist) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reset); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(40, 274, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flag = PETSC_TRUE; } /* "PETSc/KSP.pyx":275 * if size < 0: size = 10000 * if reset: flag = PETSC_TRUE * cdef object hist = oarray_r(empty_r(size), NULL, &data) # <<<<<<<<<<<<<< * self.set_attr('__history__', hist) * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_4, NULL, (&__pyx_v_data))); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_hist = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/KSP.pyx":276 * if reset: flag = PETSC_TRUE * cdef object hist = oarray_r(empty_r(size), NULL, &data) * self.set_attr('__history__', hist) # <<<<<<<<<<<<<< * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) * */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__history__"), __pyx_v_hist); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/KSP.pyx":277 * cdef object hist = oarray_r(empty_r(size), NULL, &data) * self.set_attr('__history__', hist) * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) # <<<<<<<<<<<<<< * * def getConvergenceHistory(self): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetResidualHistory(__pyx_v_self->ksp, __pyx_v_data, __pyx_v_size, __pyx_v_flag)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(40, 277, __pyx_L1_error) /* "PETSc/KSP.pyx":267 * return reason * * def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<< * cdef PetscReal *data = NULL * cdef PetscInt size = 10000 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_hist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":279 * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) * * def getConvergenceHistory(self): # <<<<<<<<<<<<<< * cdef const PetscReal *data = NULL * cdef PetscInt size = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_55getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_54getConvergenceHistory[] = "KSP.getConvergenceHistory(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_55getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceHistory (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceHistory", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceHistory", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_54getConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54getConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self) { PetscReal const *__pyx_v_data; PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceHistory", 0); /* "PETSc/KSP.pyx":280 * * def getConvergenceHistory(self): * cdef const PetscReal *data = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) */ __pyx_v_data = NULL; /* "PETSc/KSP.pyx":281 * def getConvergenceHistory(self): * cdef const PetscReal *data = NULL * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) * return array_r(size, data) */ __pyx_v_size = 0; /* "PETSc/KSP.pyx":282 * cdef const PetscReal *data = NULL * cdef PetscInt size = 0 * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) # <<<<<<<<<<<<<< * return array_r(size, data) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetResidualHistory(__pyx_v_self->ksp, (&__pyx_v_data), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 282, __pyx_L1_error) /* "PETSc/KSP.pyx":283 * cdef PetscInt size = 0 * CHKERR( KSPGetResidualHistory(self.ksp, &data, &size) ) * return array_r(size, data) # <<<<<<<<<<<<<< * * def logConvergenceHistory(self, rnorm): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_size, __pyx_v_data)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":279 * CHKERR( KSPSetResidualHistory(self.ksp, data, size, flag) ) * * def getConvergenceHistory(self): # <<<<<<<<<<<<<< * cdef const PetscReal *data = NULL * cdef PetscInt size = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":285 * return array_r(size, data) * * def logConvergenceHistory(self, rnorm): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPLogResidualHistory(self.ksp, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_56logConvergenceHistory[] = "KSP.logConvergenceHistory(self, rnorm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rnorm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("logConvergenceHistory (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnorm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logConvergenceHistory") < 0)) __PYX_ERR(40, 285, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_rnorm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 285, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_56logConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56logConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("logConvergenceHistory", 0); /* "PETSc/KSP.pyx":286 * * def logConvergenceHistory(self, rnorm): * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( KSPLogResidualHistory(self.ksp, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(40, 286, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/KSP.pyx":287 * def logConvergenceHistory(self, rnorm): * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPLogResidualHistory(self.ksp, rval) ) # <<<<<<<<<<<<<< * * # --- monitoring --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPLogResidualHistory(__pyx_v_self->ksp, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 287, __pyx_L1_error) /* "PETSc/KSP.pyx":285 * return array_r(size, data) * * def logConvergenceHistory(self, rnorm): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPLogResidualHistory(self.ksp, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":291 * # --- monitoring --- * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_59setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_58setMonitor[] = "KSP.setMonitor(self, monitor, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_59setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_monitor)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMonitor") < 0)) __PYX_ERR(40, 291, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 291, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_58setMonitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58setMonitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/KSP.pyx":292 * * def setMonitor(self, monitor, args=None, kargs=None): * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_monitor == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/KSP.pyx":293 * def setMonitor(self, monitor, args=None, kargs=None): * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: * monitorlist = [] */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_monitorlist = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/KSP.pyx":294 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/KSP.pyx":295 * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: * monitorlist = [] # <<<<<<<<<<<<<< * self.set_attr('__monitor__', monitorlist) * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":296 * if monitorlist is None: * monitorlist = [] * self.set_attr('__monitor__', monitorlist) # <<<<<<<<<<<<<< * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) * if args is None: args = () */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_v_monitorlist); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":297 * monitorlist = [] * self.set_attr('__monitor__', monitorlist) * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitorSet(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_Monitor, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 297, __pyx_L1_error) /* "PETSc/KSP.pyx":294 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ } /* "PETSc/KSP.pyx":298 * self.set_attr('__monitor__', monitorlist) * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * monitorlist.append((monitor, args, kargs)) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/KSP.pyx":299 * CHKERR( KSPMonitorSet(self.ksp, KSP_Monitor, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * monitorlist.append((monitor, args, kargs)) * */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/KSP.pyx":300 * if args is None: args = () * if kargs is None: kargs = {} * monitorlist.append((monitor, args, kargs)) # <<<<<<<<<<<<<< * * def getMonitor(self): */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_monitor); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_t_3); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(40, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":291 * # --- monitoring --- * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":302 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self): # <<<<<<<<<<<<<< * return self.get_attr('__monitor__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_61getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_60getMonitor[] = "KSP.getMonitor(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_61getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_60getMonitor(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60getMonitor(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 0); /* "PETSc/KSP.pyx":303 * * def getMonitor(self): * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def cancelMonitor(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":302 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self): # <<<<<<<<<<<<<< * return self.get_attr('__monitor__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":305 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * CHKERR( KSPMonitorCancel(self.ksp) ) * self.set_attr('__monitor__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_62cancelMonitor[] = "KSP.cancelMonitor(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cancelMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("cancelMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "cancelMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_62cancelMonitor(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62cancelMonitor(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cancelMonitor", 0); /* "PETSc/KSP.pyx":306 * * def cancelMonitor(self): * CHKERR( KSPMonitorCancel(self.ksp) ) # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitorCancel(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 306, __pyx_L1_error) /* "PETSc/KSP.pyx":307 * def cancelMonitor(self): * CHKERR( KSPMonitorCancel(self.ksp) ) * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * * def monitor(self, its, rnorm): */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/KSP.pyx":305 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * CHKERR( KSPMonitorCancel(self.ksp) ) * self.set_attr('__monitor__', None) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.cancelMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":309 * self.set_attr('__monitor__', None) * * def monitor(self, its, rnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_65monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_64monitor[] = "KSP.monitor(self, its, rnorm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_65monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_rnorm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, 1); __PYX_ERR(40, 309, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitor") < 0)) __PYX_ERR(40, 309, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_its = values[0]; __pyx_v_rnorm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 309, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_64monitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_64monitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor", 0); /* "PETSc/KSP.pyx":310 * * def monitor(self, its, rnorm): * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPMonitor(self.ksp, ival, rval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 310, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/KSP.pyx":311 * def monitor(self, its, rnorm): * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( KSPMonitor(self.ksp, ival, rval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(40, 311, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "PETSc/KSP.pyx":312 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPMonitor(self.ksp, ival, rval) ) # <<<<<<<<<<<<<< * * # --- customization --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPMonitor(__pyx_v_self->ksp, __pyx_v_ival, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(40, 312, __pyx_L1_error) /* "PETSc/KSP.pyx":309 * self.set_attr('__monitor__', None) * * def monitor(self, its, rnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":316 * # --- customization --- * * def setPCSide(self, side): # <<<<<<<<<<<<<< * CHKERR( KSPSetPCSide(self.ksp, side) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_67setPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_66setPCSide[] = "KSP.setPCSide(self, side)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_67setPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_side = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPCSide (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_side,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_side)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPCSide") < 0)) __PYX_ERR(40, 316, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_side = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPCSide", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 316, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_66setPCSide(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_side); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66setPCSide(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_side) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PCSide __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPCSide", 0); /* "PETSc/KSP.pyx":317 * * def setPCSide(self, side): * CHKERR( KSPSetPCSide(self.ksp, side) ) # <<<<<<<<<<<<<< * * def getPCSide(self): */ __pyx_t_1 = ((PCSide)__Pyx_PyInt_As_PCSide(__pyx_v_side)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 317, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPCSide(__pyx_v_self->ksp, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 317, __pyx_L1_error) /* "PETSc/KSP.pyx":316 * # --- customization --- * * def setPCSide(self, side): # <<<<<<<<<<<<<< * CHKERR( KSPSetPCSide(self.ksp, side) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":319 * CHKERR( KSPSetPCSide(self.ksp, side) ) * * def getPCSide(self): # <<<<<<<<<<<<<< * cdef PetscPCSide side = PC_LEFT * CHKERR( KSPGetPCSide(self.ksp, &side) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_69getPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_68getPCSide[] = "KSP.getPCSide(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_69getPCSide(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPCSide (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPCSide", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPCSide", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_68getPCSide(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68getPCSide(struct PyPetscKSPObject *__pyx_v_self) { PCSide __pyx_v_side; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPCSide", 0); /* "PETSc/KSP.pyx":320 * * def getPCSide(self): * cdef PetscPCSide side = PC_LEFT # <<<<<<<<<<<<<< * CHKERR( KSPGetPCSide(self.ksp, &side) ) * return side */ __pyx_v_side = PC_LEFT; /* "PETSc/KSP.pyx":321 * def getPCSide(self): * cdef PetscPCSide side = PC_LEFT * CHKERR( KSPGetPCSide(self.ksp, &side) ) # <<<<<<<<<<<<<< * return side * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetPCSide(__pyx_v_self->ksp, (&__pyx_v_side))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 321, __pyx_L1_error) /* "PETSc/KSP.pyx":322 * cdef PetscPCSide side = PC_LEFT * CHKERR( KSPGetPCSide(self.ksp, &side) ) * return side # <<<<<<<<<<<<<< * * def setNormType(self, normtype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PCSide(__pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":319 * CHKERR( KSPSetPCSide(self.ksp, side) ) * * def getPCSide(self): # <<<<<<<<<<<<<< * cdef PetscPCSide side = PC_LEFT * CHKERR( KSPGetPCSide(self.ksp, &side) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getPCSide", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":324 * return side * * def setNormType(self, normtype): # <<<<<<<<<<<<<< * CHKERR( KSPSetNormType(self.ksp, normtype) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71setNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_70setNormType[] = "KSP.setNormType(self, normtype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71setNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_normtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNormType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_normtype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_normtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNormType") < 0)) __PYX_ERR(40, 324, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_normtype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNormType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 324, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setNormType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_70setNormType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_normtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70setNormType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_normtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations KSPNormType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNormType", 0); /* "PETSc/KSP.pyx":325 * * def setNormType(self, normtype): * CHKERR( KSPSetNormType(self.ksp, normtype) ) # <<<<<<<<<<<<<< * * def getNormType(self): */ __pyx_t_1 = ((KSPNormType)__Pyx_PyInt_As_KSPNormType(__pyx_v_normtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 325, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetNormType(__pyx_v_self->ksp, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 325, __pyx_L1_error) /* "PETSc/KSP.pyx":324 * return side * * def setNormType(self, normtype): # <<<<<<<<<<<<<< * CHKERR( KSPSetNormType(self.ksp, normtype) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setNormType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":327 * CHKERR( KSPSetNormType(self.ksp, normtype) ) * * def getNormType(self): # <<<<<<<<<<<<<< * cdef PetscKSPNormType normtype = KSP_NORM_NONE * CHKERR( KSPGetNormType(self.ksp, &normtype) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73getNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_72getNormType[] = "KSP.getNormType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73getNormType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNormType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNormType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNormType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_72getNormType(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72getNormType(struct PyPetscKSPObject *__pyx_v_self) { KSPNormType __pyx_v_normtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNormType", 0); /* "PETSc/KSP.pyx":328 * * def getNormType(self): * cdef PetscKSPNormType normtype = KSP_NORM_NONE # <<<<<<<<<<<<<< * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * return normtype */ __pyx_v_normtype = KSP_NORM_NONE; /* "PETSc/KSP.pyx":329 * def getNormType(self): * cdef PetscKSPNormType normtype = KSP_NORM_NONE * CHKERR( KSPGetNormType(self.ksp, &normtype) ) # <<<<<<<<<<<<<< * return normtype * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetNormType(__pyx_v_self->ksp, (&__pyx_v_normtype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 329, __pyx_L1_error) /* "PETSc/KSP.pyx":330 * cdef PetscKSPNormType normtype = KSP_NORM_NONE * CHKERR( KSPGetNormType(self.ksp, &normtype) ) * return normtype # <<<<<<<<<<<<<< * * def setComputeEigenvalues(self, bint flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_KSPNormType(__pyx_v_normtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":327 * CHKERR( KSPSetNormType(self.ksp, normtype) ) * * def getNormType(self): # <<<<<<<<<<<<<< * cdef PetscKSPNormType normtype = KSP_NORM_NONE * CHKERR( KSPGetNormType(self.ksp, &normtype) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getNormType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":332 * return normtype * * def setComputeEigenvalues(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_75setComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_74setComputeEigenvalues[] = "KSP.setComputeEigenvalues(self, bool flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_75setComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_flag; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeEigenvalues (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeEigenvalues") < 0)) __PYX_ERR(40, 332, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(40, 332, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeEigenvalues", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 332, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_74setComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74setComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) { PetscBool __pyx_v_compute; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeEigenvalues", 0); /* "PETSc/KSP.pyx":333 * * def setComputeEigenvalues(self, bint flag): * cdef PetscBool compute = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: compute = PETSC_TRUE * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) */ __pyx_v_compute = PETSC_FALSE; /* "PETSc/KSP.pyx":334 * def setComputeEigenvalues(self, bint flag): * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) * */ __pyx_t_1 = (__pyx_v_flag != 0); if (__pyx_t_1) { __pyx_v_compute = PETSC_TRUE; } /* "PETSc/KSP.pyx":335 * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) # <<<<<<<<<<<<<< * * def getComputeEigenvalues(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeEigenvalues(__pyx_v_self->ksp, __pyx_v_compute)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 335, __pyx_L1_error) /* "PETSc/KSP.pyx":332 * return normtype * * def setComputeEigenvalues(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":337 * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) * * def getComputeEigenvalues(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_77getComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_76getComputeEigenvalues[] = "KSP.getComputeEigenvalues(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_77getComputeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComputeEigenvalues (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getComputeEigenvalues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComputeEigenvalues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_76getComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76getComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComputeEigenvalues", 0); /* "PETSc/KSP.pyx":338 * * def getComputeEigenvalues(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/KSP.pyx":339 * def getComputeEigenvalues(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetComputeEigenvalues(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 339, __pyx_L1_error) /* "PETSc/KSP.pyx":340 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setComputeSingularValues(self, bint flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":337 * CHKERR( KSPSetComputeEigenvalues(self.ksp, compute) ) * * def getComputeEigenvalues(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeEigenvalues(self.ksp, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getComputeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":342 * return toBool(flag) * * def setComputeSingularValues(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79setComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_78setComputeSingularValues[] = "KSP.setComputeSingularValues(self, bool flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79setComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_flag; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setComputeSingularValues (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setComputeSingularValues") < 0)) __PYX_ERR(40, 342, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(40, 342, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setComputeSingularValues", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 342, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_78setComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78setComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) { PetscBool __pyx_v_compute; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setComputeSingularValues", 0); /* "PETSc/KSP.pyx":343 * * def setComputeSingularValues(self, bint flag): * cdef PetscBool compute = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: compute = PETSC_TRUE * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) */ __pyx_v_compute = PETSC_FALSE; /* "PETSc/KSP.pyx":344 * def setComputeSingularValues(self, bint flag): * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) * */ __pyx_t_1 = (__pyx_v_flag != 0); if (__pyx_t_1) { __pyx_v_compute = PETSC_TRUE; } /* "PETSc/KSP.pyx":345 * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) # <<<<<<<<<<<<<< * * def getComputeSingularValues(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetComputeSingularValues(__pyx_v_self->ksp, __pyx_v_compute)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 345, __pyx_L1_error) /* "PETSc/KSP.pyx":342 * return toBool(flag) * * def setComputeSingularValues(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool compute = PETSC_FALSE * if flag: compute = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setComputeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":347 * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) * * def getComputeSingularValues(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_81getComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_80getComputeSingularValues[] = "KSP.getComputeSingularValues(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_81getComputeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComputeSingularValues (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getComputeSingularValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComputeSingularValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_80getComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80getComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComputeSingularValues", 0); /* "PETSc/KSP.pyx":348 * * def getComputeSingularValues(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/KSP.pyx":349 * def getComputeSingularValues(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetComputeSingularValues(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 349, __pyx_L1_error) /* "PETSc/KSP.pyx":350 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # --- initial guess --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":347 * CHKERR( KSPSetComputeSingularValues(self.ksp, compute) ) * * def getComputeSingularValues(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetComputeSingularValues(self.ksp, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getComputeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":354 * # --- initial guess --- * * def setInitialGuessNonzero(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool guess_nonzero = PETSC_FALSE * if flag: guess_nonzero = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83setInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_82setInitialGuessNonzero[] = "KSP.setInitialGuessNonzero(self, bool flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83setInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_flag; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialGuessNonzero (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitialGuessNonzero") < 0)) __PYX_ERR(40, 354, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(40, 354, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialGuessNonzero", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 354, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessNonzero", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_82setInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82setInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) { PetscBool __pyx_v_guess_nonzero; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialGuessNonzero", 0); /* "PETSc/KSP.pyx":355 * * def setInitialGuessNonzero(self, bint flag): * cdef PetscBool guess_nonzero = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: guess_nonzero = PETSC_TRUE * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) */ __pyx_v_guess_nonzero = PETSC_FALSE; /* "PETSc/KSP.pyx":356 * def setInitialGuessNonzero(self, bint flag): * cdef PetscBool guess_nonzero = PETSC_FALSE * if flag: guess_nonzero = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) * */ __pyx_t_1 = (__pyx_v_flag != 0); if (__pyx_t_1) { __pyx_v_guess_nonzero = PETSC_TRUE; } /* "PETSc/KSP.pyx":357 * cdef PetscBool guess_nonzero = PETSC_FALSE * if flag: guess_nonzero = PETSC_TRUE * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) # <<<<<<<<<<<<<< * * def getInitialGuessNonzero(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetInitialGuessNonzero(__pyx_v_self->ksp, __pyx_v_guess_nonzero)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 357, __pyx_L1_error) /* "PETSc/KSP.pyx":354 * # --- initial guess --- * * def setInitialGuessNonzero(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool guess_nonzero = PETSC_FALSE * if flag: guess_nonzero = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessNonzero", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":359 * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) * * def getInitialGuessNonzero(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_85getInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_84getInitialGuessNonzero[] = "KSP.getInitialGuessNonzero(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_85getInitialGuessNonzero(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInitialGuessNonzero (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInitialGuessNonzero", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuessNonzero", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_84getInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84getInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInitialGuessNonzero", 0); /* "PETSc/KSP.pyx":360 * * def getInitialGuessNonzero(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/KSP.pyx":361 * def getInitialGuessNonzero(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetInitialGuessNonzero(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 361, __pyx_L1_error) /* "PETSc/KSP.pyx":362 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setInitialGuessKnoll(self, bint flag): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":359 * CHKERR( KSPSetInitialGuessNonzero(self.ksp, guess_nonzero) ) * * def getInitialGuessNonzero(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessNonzero(self.ksp, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getInitialGuessNonzero", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":364 * return toBool(flag) * * def setInitialGuessKnoll(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool guess_knoll = PETSC_FALSE * if flag: guess_knoll = PETSC_TRUE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_87setInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_86setInitialGuessKnoll[] = "KSP.setInitialGuessKnoll(self, bool flag)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_87setInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_flag; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialGuessKnoll (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitialGuessKnoll") < 0)) __PYX_ERR(40, 364, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_flag = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_flag == (int)-1) && PyErr_Occurred())) __PYX_ERR(40, 364, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialGuessKnoll", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 364, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessKnoll", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_86setInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86setInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self, int __pyx_v_flag) { PetscBool __pyx_v_guess_knoll; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialGuessKnoll", 0); /* "PETSc/KSP.pyx":365 * * def setInitialGuessKnoll(self, bint flag): * cdef PetscBool guess_knoll = PETSC_FALSE # <<<<<<<<<<<<<< * if flag: guess_knoll = PETSC_TRUE * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) */ __pyx_v_guess_knoll = PETSC_FALSE; /* "PETSc/KSP.pyx":366 * def setInitialGuessKnoll(self, bint flag): * cdef PetscBool guess_knoll = PETSC_FALSE * if flag: guess_knoll = PETSC_TRUE # <<<<<<<<<<<<<< * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) * */ __pyx_t_1 = (__pyx_v_flag != 0); if (__pyx_t_1) { __pyx_v_guess_knoll = PETSC_TRUE; } /* "PETSc/KSP.pyx":367 * cdef PetscBool guess_knoll = PETSC_FALSE * if flag: guess_knoll = PETSC_TRUE * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) # <<<<<<<<<<<<<< * * def getInitialGuessKnoll(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetInitialGuessKnoll(__pyx_v_self->ksp, __pyx_v_guess_knoll)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 367, __pyx_L1_error) /* "PETSc/KSP.pyx":364 * return toBool(flag) * * def setInitialGuessKnoll(self, bint flag): # <<<<<<<<<<<<<< * cdef PetscBool guess_knoll = PETSC_FALSE * if flag: guess_knoll = PETSC_TRUE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setInitialGuessKnoll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":369 * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) * * def getInitialGuessKnoll(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_89getInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_88getInitialGuessKnoll[] = "KSP.getInitialGuessKnoll(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_89getInitialGuessKnoll(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInitialGuessKnoll (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInitialGuessKnoll", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuessKnoll", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_88getInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88getInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInitialGuessKnoll", 0); /* "PETSc/KSP.pyx":370 * * def getInitialGuessKnoll(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/KSP.pyx":371 * def getInitialGuessKnoll(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetInitialGuessKnoll(__pyx_v_self->ksp, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 371, __pyx_L1_error) /* "PETSc/KSP.pyx":372 * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setUseFischerGuess(self, model, size): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":369 * CHKERR( KSPSetInitialGuessKnoll(self.ksp, guess_knoll) ) * * def getInitialGuessKnoll(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( KSPGetInitialGuessKnoll(self.ksp, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getInitialGuessKnoll", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":374 * return toBool(flag) * * def setUseFischerGuess(self, model, size): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(model) * cdef PetscInt ival2 = asInt(size) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_91setUseFischerGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_90setUseFischerGuess[] = "KSP.setUseFischerGuess(self, model, size)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_91setUseFischerGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_model = 0; PyObject *__pyx_v_size = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseFischerGuess (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_model,&__pyx_n_s_size,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setUseFischerGuess", 1, 2, 2, 1); __PYX_ERR(40, 374, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseFischerGuess") < 0)) __PYX_ERR(40, 374, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_model = values[0]; __pyx_v_size = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseFischerGuess", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 374, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUseFischerGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_90setUseFischerGuess(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_model, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90setUseFischerGuess(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_model, PyObject *__pyx_v_size) { PetscInt __pyx_v_ival1; PetscInt __pyx_v_ival2; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseFischerGuess", 0); /* "PETSc/KSP.pyx":375 * * def setUseFischerGuess(self, model, size): * cdef PetscInt ival1 = asInt(model) # <<<<<<<<<<<<<< * cdef PetscInt ival2 = asInt(size) * CHKERR( KSPSetUseFischerGuess(self.ksp, ival1, ival2) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_model); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 375, __pyx_L1_error) __pyx_v_ival1 = __pyx_t_1; /* "PETSc/KSP.pyx":376 * def setUseFischerGuess(self, model, size): * cdef PetscInt ival1 = asInt(model) * cdef PetscInt ival2 = asInt(size) # <<<<<<<<<<<<<< * CHKERR( KSPSetUseFischerGuess(self.ksp, ival1, ival2) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 376, __pyx_L1_error) __pyx_v_ival2 = __pyx_t_1; /* "PETSc/KSP.pyx":377 * cdef PetscInt ival1 = asInt(model) * cdef PetscInt ival2 = asInt(size) * CHKERR( KSPSetUseFischerGuess(self.ksp, ival1, ival2) ) # <<<<<<<<<<<<<< * * # --- solving --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUseFischerGuess(__pyx_v_self->ksp, __pyx_v_ival1, __pyx_v_ival2)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 377, __pyx_L1_error) /* "PETSc/KSP.pyx":374 * return toBool(flag) * * def setUseFischerGuess(self, model, size): # <<<<<<<<<<<<<< * cdef PetscInt ival1 = asInt(model) * cdef PetscInt ival2 = asInt(size) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUseFischerGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":381 * # --- solving --- * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( KSPSetUp(self.ksp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_93setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_92setUp[] = "KSP.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_93setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_92setUp(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92setUp(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/KSP.pyx":382 * * def setUp(self): * CHKERR( KSPSetUp(self.ksp) ) # <<<<<<<<<<<<<< * * def reset(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUp(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 382, __pyx_L1_error) /* "PETSc/KSP.pyx":381 * # --- solving --- * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( KSPSetUp(self.ksp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":384 * CHKERR( KSPSetUp(self.ksp) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( KSPReset(self.ksp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_95reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_94reset[] = "KSP.reset(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_95reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_94reset(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94reset(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); /* "PETSc/KSP.pyx":385 * * def reset(self): * CHKERR( KSPReset(self.ksp) ) # <<<<<<<<<<<<<< * * def setUpOnBlocks(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPReset(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 385, __pyx_L1_error) /* "PETSc/KSP.pyx":384 * CHKERR( KSPSetUp(self.ksp) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( KSPReset(self.ksp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":387 * CHKERR( KSPReset(self.ksp) ) * * def setUpOnBlocks(self): # <<<<<<<<<<<<<< * CHKERR( KSPSetUpOnBlocks(self.ksp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_96setUpOnBlocks[] = "KSP.setUpOnBlocks(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97setUpOnBlocks(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpOnBlocks (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUpOnBlocks", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUpOnBlocks", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_96setUpOnBlocks(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96setUpOnBlocks(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpOnBlocks", 0); /* "PETSc/KSP.pyx":388 * * def setUpOnBlocks(self): * CHKERR( KSPSetUpOnBlocks(self.ksp) ) # <<<<<<<<<<<<<< * * def solve(self, Vec b or None, Vec x or None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetUpOnBlocks(__pyx_v_self->ksp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 388, __pyx_L1_error) /* "PETSc/KSP.pyx":387 * CHKERR( KSPReset(self.ksp) ) * * def setUpOnBlocks(self): # <<<<<<<<<<<<<< * CHKERR( KSPSetUpOnBlocks(self.ksp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setUpOnBlocks", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":390 * CHKERR( KSPSetUpOnBlocks(self.ksp) ) * * def solve(self, Vec b or None, Vec x or None): # <<<<<<<<<<<<<< * cdef PetscVec b_vec = NULL * cdef PetscVec x_vec = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_98solve[] = "KSP.solve(self, Vec b, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, 1); __PYX_ERR(40, 390, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(40, 390, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 390, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(40, 390, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(40, 390, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_98solve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98solve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { Vec __pyx_v_b_vec; Vec __pyx_v_x_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 0); /* "PETSc/KSP.pyx":391 * * def solve(self, Vec b or None, Vec x or None): * cdef PetscVec b_vec = NULL # <<<<<<<<<<<<<< * cdef PetscVec x_vec = NULL * if b is not None: b_vec = b.vec */ __pyx_v_b_vec = NULL; /* "PETSc/KSP.pyx":392 * def solve(self, Vec b or None, Vec x or None): * cdef PetscVec b_vec = NULL * cdef PetscVec x_vec = NULL # <<<<<<<<<<<<<< * if b is not None: b_vec = b.vec * if x is not None: x_vec = x.vec */ __pyx_v_x_vec = NULL; /* "PETSc/KSP.pyx":393 * cdef PetscVec b_vec = NULL * cdef PetscVec x_vec = NULL * if b is not None: b_vec = b.vec # <<<<<<<<<<<<<< * if x is not None: x_vec = x.vec * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_b) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_b->vec; __pyx_v_b_vec = __pyx_t_3; } /* "PETSc/KSP.pyx":394 * cdef PetscVec x_vec = NULL * if b is not None: b_vec = b.vec * if x is not None: x_vec = x.vec # <<<<<<<<<<<<<< * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_x) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_x->vec; __pyx_v_x_vec = __pyx_t_3; } /* "PETSc/KSP.pyx":395 * if b is not None: b_vec = b.vec * if x is not None: x_vec = x.vec * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) # <<<<<<<<<<<<<< * * def solveTranspose(self, Vec b, Vec x): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSolve(__pyx_v_self->ksp, __pyx_v_b_vec, __pyx_v_x_vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 395, __pyx_L1_error) /* "PETSc/KSP.pyx":390 * CHKERR( KSPSetUpOnBlocks(self.ksp) ) * * def solve(self, Vec b or None, Vec x or None): # <<<<<<<<<<<<<< * cdef PetscVec b_vec = NULL * cdef PetscVec x_vec = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":397 * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) * * def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_101solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_100solveTranspose[] = "KSP.solveTranspose(self, Vec b, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_101solveTranspose(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solveTranspose (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, 1); __PYX_ERR(40, 397, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solveTranspose") < 0)) __PYX_ERR(40, 397, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 397, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(40, 397, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(40, 397, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_100solveTranspose(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100solveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solveTranspose", 0); /* "PETSc/KSP.pyx":398 * * def solveTranspose(self, Vec b, Vec x): * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) # <<<<<<<<<<<<<< * * def setIterationNumber(self, its): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSolveTranspose(__pyx_v_self->ksp, __pyx_v_b->vec, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 398, __pyx_L1_error) /* "PETSc/KSP.pyx":397 * CHKERR( KSPSolve(self.ksp, b_vec, x_vec) ) * * def solveTranspose(self, Vec b, Vec x): # <<<<<<<<<<<<<< * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.solveTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":400 * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) * * def setIterationNumber(self, its): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_102setIterationNumber[] = "KSP.setIterationNumber(self, its)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_its = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIterationNumber (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIterationNumber") < 0)) __PYX_ERR(40, 400, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_its = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 400, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_102setIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102setIterationNumber(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIterationNumber", 0); /* "PETSc/KSP.pyx":401 * * def setIterationNumber(self, its): * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 401, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/KSP.pyx":402 * def setIterationNumber(self, its): * cdef PetscInt ival = asInt(its) * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) # <<<<<<<<<<<<<< * * def getIterationNumber(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetIterationNumber(__pyx_v_self->ksp, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 402, __pyx_L1_error) /* "PETSc/KSP.pyx":400 * CHKERR( KSPSolveTranspose(self.ksp, b.vec, x.vec) ) * * def setIterationNumber(self, its): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":404 * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) * * def getIterationNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_104getIterationNumber[] = "KSP.getIterationNumber(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_104getIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104getIterationNumber(struct PyPetscKSPObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIterationNumber", 0); /* "PETSc/KSP.pyx":405 * * def getIterationNumber(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/KSP.pyx":406 * def getIterationNumber(self): * cdef PetscInt ival = 0 * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetIterationNumber(__pyx_v_self->ksp, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 406, __pyx_L1_error) /* "PETSc/KSP.pyx":407 * cdef PetscInt ival = 0 * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setResidualNorm(self, rnorm): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":404 * CHKERR( KSPSetIterationNumber(self.ksp, ival) ) * * def getIterationNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( KSPGetIterationNumber(self.ksp, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":409 * return toInt(ival) * * def setResidualNorm(self, rnorm): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107setResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_106setResidualNorm[] = "KSP.setResidualNorm(self, rnorm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107setResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rnorm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setResidualNorm (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnorm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setResidualNorm") < 0)) __PYX_ERR(40, 409, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_rnorm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setResidualNorm", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 409, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setResidualNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_106setResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106setResidualNorm(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setResidualNorm", 0); /* "PETSc/KSP.pyx":410 * * def setResidualNorm(self, rnorm): * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(40, 410, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/KSP.pyx":411 * def setResidualNorm(self, rnorm): * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) # <<<<<<<<<<<<<< * * def getResidualNorm(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetResidualNorm(__pyx_v_self->ksp, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 411, __pyx_L1_error) /* "PETSc/KSP.pyx":409 * return toInt(ival) * * def setResidualNorm(self, rnorm): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setResidualNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":413 * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) * * def getResidualNorm(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_109getResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_108getResidualNorm[] = "KSP.getResidualNorm(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_109getResidualNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getResidualNorm (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getResidualNorm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getResidualNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_108getResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108getResidualNorm(struct PyPetscKSPObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getResidualNorm", 0); /* "PETSc/KSP.pyx":414 * * def getResidualNorm(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/KSP.pyx":415 * def getResidualNorm(self): * cdef PetscReal rval = 0 * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetResidualNorm(__pyx_v_self->ksp, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 415, __pyx_L1_error) /* "PETSc/KSP.pyx":416 * cdef PetscReal rval = 0 * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":413 * CHKERR( KSPSetResidualNorm(self.ksp, rval) ) * * def getResidualNorm(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( KSPGetResidualNorm(self.ksp, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getResidualNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":418 * return toReal(rval) * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * cdef PetscKSPConvergedReason val = reason * CHKERR( KSPSetConvergedReason(self.ksp, val) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_111setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_110setConvergedReason[] = "KSP.setConvergedReason(self, reason)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_111setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_reason = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergedReason") < 0)) __PYX_ERR(40, 418, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 418, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_110setConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110setConvergedReason(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_reason) { KSPConvergedReason __pyx_v_val; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations KSPConvergedReason __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 0); /* "PETSc/KSP.pyx":419 * * def setConvergedReason(self, reason): * cdef PetscKSPConvergedReason val = reason # <<<<<<<<<<<<<< * CHKERR( KSPSetConvergedReason(self.ksp, val) ) * */ __pyx_t_1 = ((KSPConvergedReason)__Pyx_PyInt_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 419, __pyx_L1_error) __pyx_v_val = __pyx_t_1; /* "PETSc/KSP.pyx":420 * def setConvergedReason(self, reason): * cdef PetscKSPConvergedReason val = reason * CHKERR( KSPSetConvergedReason(self.ksp, val) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergedReason(__pyx_v_self->ksp, __pyx_v_val)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 420, __pyx_L1_error) /* "PETSc/KSP.pyx":418 * return toReal(rval) * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * cdef PetscKSPConvergedReason val = reason * CHKERR( KSPSetConvergedReason(self.ksp, val) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":422 * CHKERR( KSPSetConvergedReason(self.ksp, val) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_113getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_112getConvergedReason[] = "KSP.getConvergedReason(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_113getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_112getConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112getConvergedReason(struct PyPetscKSPObject *__pyx_v_self) { KSPConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 0); /* "PETSc/KSP.pyx":423 * * def getConvergedReason(self): * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) * return reason */ __pyx_v_reason = KSP_CONVERGED_ITERATING; /* "PETSc/KSP.pyx":424 * def getConvergedReason(self): * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetConvergedReason(__pyx_v_self->ksp, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 424, __pyx_L1_error) /* "PETSc/KSP.pyx":425 * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) * return reason # <<<<<<<<<<<<<< * * def getRhs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":422 * CHKERR( KSPSetConvergedReason(self.ksp, val) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING * CHKERR( KSPGetConvergedReason(self.ksp, &reason) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":427 * return reason * * def getRhs(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_115getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_114getRhs[] = "KSP.getRhs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_115getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRhs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRhs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRhs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_114getRhs(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114getRhs(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRhs", 0); /* "PETSc/KSP.pyx":428 * * def getRhs(self): * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) * PetscINCREF(vec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":429 * def getRhs(self): * cdef Vec vec = Vec() * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 429, __pyx_L1_error) /* "PETSc/KSP.pyx":430 * cdef Vec vec = Vec() * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * return vec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/KSP.pyx":431 * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) * PetscINCREF(vec.obj) * return vec # <<<<<<<<<<<<<< * * def getSolution(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/KSP.pyx":427 * return reason * * def getRhs(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( KSPGetRhs(self.ksp, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":433 * return vec * * def getSolution(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_117getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_116getSolution[] = "KSP.getSolution(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_117getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_116getSolution(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116getSolution(struct PyPetscKSPObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 0); /* "PETSc/KSP.pyx":434 * * def getSolution(self): * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) * PetscINCREF(vec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":435 * def getSolution(self): * cdef Vec vec = Vec() * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 435, __pyx_L1_error) /* "PETSc/KSP.pyx":436 * cdef Vec vec = Vec() * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * return vec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/KSP.pyx":437 * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) * PetscINCREF(vec.obj) * return vec # <<<<<<<<<<<<<< * * def getWorkVecs(self, right=None, left=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/KSP.pyx":433 * return vec * * def getSolution(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( KSPGetSolution(self.ksp, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":439 * return vec * * def getWorkVecs(self, right=None, left=None): # <<<<<<<<<<<<<< * cdef bint R = right is not None * cdef bint L = left is not None */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_119getWorkVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_118getWorkVecs[] = "KSP.getWorkVecs(self, right=None, left=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_119getWorkVecs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_right = 0; PyObject *__pyx_v_left = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getWorkVecs (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_right,&__pyx_n_s_left,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getWorkVecs") < 0)) __PYX_ERR(40, 439, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_right = values[0]; __pyx_v_left = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getWorkVecs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 439, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.getWorkVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_118getWorkVecs(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_right, __pyx_v_left); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118getWorkVecs(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_right, PyObject *__pyx_v_left) { int __pyx_v_R; int __pyx_v_L; PetscInt __pyx_v_i; PetscInt __pyx_v_nr; PetscInt __pyx_v_nl; Vec *__pyx_v_vr; Vec *__pyx_v_vl; PyObject *__pyx_v_vecsr = 0; PyObject *__pyx_v_vecsl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getWorkVecs", 0); /* "PETSc/KSP.pyx":440 * * def getWorkVecs(self, right=None, left=None): * cdef bint R = right is not None # <<<<<<<<<<<<<< * cdef bint L = left is not None * cdef PetscInt i=0, nr=0, nl=0 */ __pyx_t_1 = (__pyx_v_right != Py_None); __pyx_v_R = __pyx_t_1; /* "PETSc/KSP.pyx":441 * def getWorkVecs(self, right=None, left=None): * cdef bint R = right is not None * cdef bint L = left is not None # <<<<<<<<<<<<<< * cdef PetscInt i=0, nr=0, nl=0 * cdef PetscVec *vr=NULL, *vl=NULL */ __pyx_t_1 = (__pyx_v_left != Py_None); __pyx_v_L = __pyx_t_1; /* "PETSc/KSP.pyx":442 * cdef bint R = right is not None * cdef bint L = left is not None * cdef PetscInt i=0, nr=0, nl=0 # <<<<<<<<<<<<<< * cdef PetscVec *vr=NULL, *vl=NULL * if R: nr = asInt(right) */ __pyx_v_i = 0; __pyx_v_nr = 0; __pyx_v_nl = 0; /* "PETSc/KSP.pyx":443 * cdef bint L = left is not None * cdef PetscInt i=0, nr=0, nl=0 * cdef PetscVec *vr=NULL, *vl=NULL # <<<<<<<<<<<<<< * if R: nr = asInt(right) * if L: nl = asInt(left) */ __pyx_v_vr = NULL; __pyx_v_vl = NULL; /* "PETSc/KSP.pyx":444 * cdef PetscInt i=0, nr=0, nl=0 * cdef PetscVec *vr=NULL, *vl=NULL * if R: nr = asInt(right) # <<<<<<<<<<<<<< * if L: nl = asInt(left) * cdef object vecsr = [] if R else None */ __pyx_t_1 = (__pyx_v_R != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_right); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 444, __pyx_L1_error) __pyx_v_nr = __pyx_t_2; } /* "PETSc/KSP.pyx":445 * cdef PetscVec *vr=NULL, *vl=NULL * if R: nr = asInt(right) * if L: nl = asInt(left) # <<<<<<<<<<<<<< * cdef object vecsr = [] if R else None * cdef object vecsl = [] if L else None */ __pyx_t_1 = (__pyx_v_L != 0); if (__pyx_t_1) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_left); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 445, __pyx_L1_error) __pyx_v_nl = __pyx_t_2; } /* "PETSc/KSP.pyx":446 * if R: nr = asInt(right) * if L: nl = asInt(left) * cdef object vecsr = [] if R else None # <<<<<<<<<<<<<< * cdef object vecsl = [] if L else None * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) */ if ((__pyx_v_R != 0)) { __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_vecsr = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/KSP.pyx":447 * if L: nl = asInt(left) * cdef object vecsr = [] if R else None * cdef object vecsl = [] if L else None # <<<<<<<<<<<<<< * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) * try: */ if ((__pyx_v_L != 0)) { __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; } __pyx_v_vecsl = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/KSP.pyx":448 * cdef object vecsr = [] if R else None * cdef object vecsl = [] if L else None * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) # <<<<<<<<<<<<<< * try: * for i from 0 <= i < nr: */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPCreateVecs(__pyx_v_self->ksp, __pyx_v_nr, (&__pyx_v_vr), __pyx_v_nl, (&__pyx_v_vr))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(40, 448, __pyx_L1_error) /* "PETSc/KSP.pyx":449 * cdef object vecsl = [] if L else None * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) * try: # <<<<<<<<<<<<<< * for i from 0 <= i < nr: * vecsr.append(ref_Vec(vr[i])) */ /*try:*/ { /* "PETSc/KSP.pyx":450 * CHKERR( KSPCreateVecs(self.ksp, nr, &vr, nl, &vr) ) * try: * for i from 0 <= i < nr: # <<<<<<<<<<<<<< * vecsr.append(ref_Vec(vr[i])) * for i from 0 <= i < nl: */ __pyx_t_2 = __pyx_v_nr; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "PETSc/KSP.pyx":451 * try: * for i from 0 <= i < nr: * vecsr.append(ref_Vec(vr[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < nl: * vecsl.append(ref_Vec(vl[i])) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vr[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 451, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_vecsr, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(40, 451, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/KSP.pyx":452 * for i from 0 <= i < nr: * vecsr.append(ref_Vec(vr[i])) * for i from 0 <= i < nl: # <<<<<<<<<<<<<< * vecsl.append(ref_Vec(vl[i])) * finally: */ __pyx_t_2 = __pyx_v_nl; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "PETSc/KSP.pyx":453 * vecsr.append(ref_Vec(vr[i])) * for i from 0 <= i < nl: * vecsl.append(ref_Vec(vl[i])) # <<<<<<<<<<<<<< * finally: * if nr > 0 and vr != NULL: */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vl[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 453, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_vecsl, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(40, 453, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* "PETSc/KSP.pyx":455 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ /*finally:*/ { /*normal exit:*/{ __pyx_t_7 = ((__pyx_v_nr > 0) != 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L13_bool_binop_done; } __pyx_t_7 = ((__pyx_v_vr != NULL) != 0); __pyx_t_1 = __pyx_t_7; __pyx_L13_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/KSP.pyx":456 * finally: * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? # <<<<<<<<<<<<<< * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? */ (void)(VecDestroyVecs(__pyx_v_nr, (&__pyx_v_vr))); /* "PETSc/KSP.pyx":455 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ } /* "PETSc/KSP.pyx":457 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ __pyx_t_7 = ((__pyx_v_nl > 0) != 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L16_bool_binop_done; } __pyx_t_7 = ((__pyx_v_vl != NULL) != 0); __pyx_t_1 = __pyx_t_7; __pyx_L16_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/KSP.pyx":458 * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? # <<<<<<<<<<<<<< * # * if R and L: return (vecsr, vecsl) */ (void)(VecDestroyVecs(__pyx_v_nl, (&__pyx_v_vl))); /* "PETSc/KSP.pyx":457 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ } goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_5 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { /* "PETSc/KSP.pyx":455 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ __pyx_t_7 = ((__pyx_v_nr > 0) != 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L21_bool_binop_done; } __pyx_t_7 = ((__pyx_v_vr != NULL) != 0); __pyx_t_1 = __pyx_t_7; __pyx_L21_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/KSP.pyx":456 * finally: * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? # <<<<<<<<<<<<<< * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? */ (void)(VecDestroyVecs(__pyx_v_nr, (&__pyx_v_vr))); /* "PETSc/KSP.pyx":455 * vecsl.append(ref_Vec(vl[i])) * finally: * if nr > 0 and vr != NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: */ } /* "PETSc/KSP.pyx":457 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ __pyx_t_7 = ((__pyx_v_nl > 0) != 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L24_bool_binop_done; } __pyx_t_7 = ((__pyx_v_vl != NULL) != 0); __pyx_t_1 = __pyx_t_7; __pyx_L24_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/KSP.pyx":458 * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: * VecDestroyVecs(nl, &vl) # XXX errors? # <<<<<<<<<<<<<< * # * if R and L: return (vecsr, vecsl) */ (void)(VecDestroyVecs(__pyx_v_nl, (&__pyx_v_vl))); /* "PETSc/KSP.pyx":457 * if nr > 0 and vr != NULL: * VecDestroyVecs(nr, &vr) # XXX errors? * if nl > 0 and vl !=NULL: # <<<<<<<<<<<<<< * VecDestroyVecs(nl, &vl) # XXX errors? * # */ } } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; } __pyx_L7:; } /* "PETSc/KSP.pyx":460 * VecDestroyVecs(nl, &vl) # XXX errors? * # * if R and L: return (vecsr, vecsl) # <<<<<<<<<<<<<< * elif R: return vecsr * elif L: return vecsl */ __pyx_t_7 = (__pyx_v_R != 0); if (__pyx_t_7) { } else { __pyx_t_1 = __pyx_t_7; goto __pyx_L27_bool_binop_done; } __pyx_t_7 = (__pyx_v_L != 0); __pyx_t_1 = __pyx_t_7; __pyx_L27_bool_binop_done:; if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_vecsr); __Pyx_GIVEREF(__pyx_v_vecsr); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vecsr); __Pyx_INCREF(__pyx_v_vecsl); __Pyx_GIVEREF(__pyx_v_vecsl); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vecsl); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "PETSc/KSP.pyx":461 * # * if R and L: return (vecsr, vecsl) * elif R: return vecsr # <<<<<<<<<<<<<< * elif L: return vecsl * else: return None */ __pyx_t_1 = (__pyx_v_R != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_vecsr); __pyx_r = __pyx_v_vecsr; goto __pyx_L0; } /* "PETSc/KSP.pyx":462 * if R and L: return (vecsr, vecsl) * elif R: return vecsr * elif L: return vecsl # <<<<<<<<<<<<<< * else: return None * */ __pyx_t_1 = (__pyx_v_L != 0); if (__pyx_t_1) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_vecsl); __pyx_r = __pyx_v_vecsl; goto __pyx_L0; } /* "PETSc/KSP.pyx":463 * elif R: return vecsr * elif L: return vecsl * else: return None # <<<<<<<<<<<<<< * * def buildSolution(self, Vec x=None): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/KSP.pyx":439 * return vec * * def getWorkVecs(self, right=None, left=None): # <<<<<<<<<<<<<< * cdef bint R = right is not None * cdef bint L = left is not None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.getWorkVecs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vecsr); __Pyx_XDECREF(__pyx_v_vecsl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":465 * else: return None * * def buildSolution(self, Vec x=None): # <<<<<<<<<<<<<< * if x is None: x = Vec() * if x.vec == NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_121buildSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_120buildSolution[] = "KSP.buildSolution(self, Vec x=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_121buildSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buildSolution (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildSolution") < 0)) __PYX_ERR(40, 465, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buildSolution", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 465, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(40, 465, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_120buildSolution(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120buildSolution(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("buildSolution", 0); __Pyx_INCREF((PyObject *)__pyx_v_x); /* "PETSc/KSP.pyx":466 * * def buildSolution(self, Vec x=None): * if x is None: x = Vec() # <<<<<<<<<<<<<< * if x.vec == NULL: * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_x) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_x, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; } /* "PETSc/KSP.pyx":467 * def buildSolution(self, Vec x=None): * if x is None: x = Vec() * if x.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) */ __pyx_t_2 = ((__pyx_v_x->vec == NULL) != 0); if (__pyx_t_2) { /* "PETSc/KSP.pyx":468 * if x is None: x = Vec() * if x.vec == NULL: * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(x.vec, &x.vec) ) * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 468, __pyx_L1_error) /* "PETSc/KSP.pyx":469 * if x.vec == NULL: * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) # <<<<<<<<<<<<<< * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) * return x */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_x->vec, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 469, __pyx_L1_error) /* "PETSc/KSP.pyx":467 * def buildSolution(self, Vec x=None): * if x is None: x = Vec() * if x.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) */ } /* "PETSc/KSP.pyx":470 * CHKERR( KSPGetSolution(self.ksp, &x.vec) ) * CHKERR( VecDuplicate(x.vec, &x.vec) ) * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) # <<<<<<<<<<<<<< * return x * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildSolution(__pyx_v_self->ksp, __pyx_v_x->vec, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 470, __pyx_L1_error) /* "PETSc/KSP.pyx":471 * CHKERR( VecDuplicate(x.vec, &x.vec) ) * CHKERR( KSPBuildSolution(self.ksp, x.vec, NULL) ) * return x # <<<<<<<<<<<<<< * * def buildResidual(self, Vec r=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_x)); __pyx_r = ((PyObject *)__pyx_v_x); goto __pyx_L0; /* "PETSc/KSP.pyx":465 * else: return None * * def buildSolution(self, Vec x=None): # <<<<<<<<<<<<<< * if x is None: x = Vec() * if x.vec == NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":473 * return x * * def buildResidual(self, Vec r=None): # <<<<<<<<<<<<<< * if r is None: r = Vec() * if r.vec == NULL: */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_123buildResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_122buildResidual[] = "KSP.buildResidual(self, Vec r=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_123buildResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_r = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("buildResidual (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildResidual") < 0)) __PYX_ERR(40, 473, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_r = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("buildResidual", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 473, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "r", 0))) __PYX_ERR(40, 473, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_122buildResidual(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_r); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122buildResidual(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_r) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("buildResidual", 0); __Pyx_INCREF((PyObject *)__pyx_v_r); /* "PETSc/KSP.pyx":474 * * def buildResidual(self, Vec r=None): * if r is None: r = Vec() # <<<<<<<<<<<<<< * if r.vec == NULL: * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_r) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_r, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; } /* "PETSc/KSP.pyx":475 * def buildResidual(self, Vec r=None): * if r is None: r = Vec() * if r.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) */ __pyx_t_2 = ((__pyx_v_r->vec == NULL) != 0); if (__pyx_t_2) { /* "PETSc/KSP.pyx":476 * if r is None: r = Vec() * if r.vec == NULL: * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) # <<<<<<<<<<<<<< * CHKERR( VecDuplicate(r.vec, &r.vec) ) * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 476, __pyx_L1_error) /* "PETSc/KSP.pyx":477 * if r.vec == NULL: * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) # <<<<<<<<<<<<<< * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) * return r */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 477, __pyx_L1_error) /* "PETSc/KSP.pyx":475 * def buildResidual(self, Vec r=None): * if r is None: r = Vec() * if r.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) */ } /* "PETSc/KSP.pyx":478 * CHKERR( KSPGetRhs(self.ksp, &r.vec) ) * CHKERR( VecDuplicate(r.vec, &r.vec) ) * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) # <<<<<<<<<<<<<< * return r * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildResidual(__pyx_v_self->ksp, NULL, __pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(40, 478, __pyx_L1_error) /* "PETSc/KSP.pyx":479 * CHKERR( VecDuplicate(r.vec, &r.vec) ) * CHKERR( KSPBuildResidual(self.ksp , NULL, r.vec, &r.vec) ) * return r # <<<<<<<<<<<<<< * * def computeEigenvalues(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_r)); __pyx_r = ((PyObject *)__pyx_v_r); goto __pyx_L0; /* "PETSc/KSP.pyx":473 * return x * * def buildResidual(self, Vec r=None): # <<<<<<<<<<<<<< * if r is None: r = Vec() * if r.vec == NULL: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.buildResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":481 * return r * * def computeEigenvalues(self): # <<<<<<<<<<<<<< * cdef PetscInt its = 0 * cdef PetscInt neig = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_125computeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_124computeEigenvalues[] = "KSP.computeEigenvalues(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_125computeEigenvalues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeEigenvalues (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("computeEigenvalues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeEigenvalues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_124computeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124computeEigenvalues(struct PyPetscKSPObject *__pyx_v_self) { PetscInt __pyx_v_its; PetscInt __pyx_v_neig; PetscReal *__pyx_v_rdata; PetscReal *__pyx_v_idata; PyArrayObject *__pyx_v_r = 0; PyArrayObject *__pyx_v_i = 0; PyArrayObject *__pyx_v_eigen = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeEigenvalues", 0); /* "PETSc/KSP.pyx":482 * * def computeEigenvalues(self): * cdef PetscInt its = 0 # <<<<<<<<<<<<<< * cdef PetscInt neig = 0 * cdef PetscReal *rdata = NULL */ __pyx_v_its = 0; /* "PETSc/KSP.pyx":483 * def computeEigenvalues(self): * cdef PetscInt its = 0 * cdef PetscInt neig = 0 # <<<<<<<<<<<<<< * cdef PetscReal *rdata = NULL * cdef PetscReal *idata = NULL */ __pyx_v_neig = 0; /* "PETSc/KSP.pyx":484 * cdef PetscInt its = 0 * cdef PetscInt neig = 0 * cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<< * cdef PetscReal *idata = NULL * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) */ __pyx_v_rdata = NULL; /* "PETSc/KSP.pyx":485 * cdef PetscInt neig = 0 * cdef PetscReal *rdata = NULL * cdef PetscReal *idata = NULL # <<<<<<<<<<<<<< * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) */ __pyx_v_idata = NULL; /* "PETSc/KSP.pyx":486 * cdef PetscReal *rdata = NULL * cdef PetscReal *idata = NULL * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) # <<<<<<<<<<<<<< * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetIterationNumber(__pyx_v_self->ksp, (&__pyx_v_its))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 486, __pyx_L1_error) /* "PETSc/KSP.pyx":487 * cdef PetscReal *idata = NULL * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) # <<<<<<<<<<<<<< * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_its)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_2, NULL, (&__pyx_v_rdata))); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_r = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":488 * CHKERR( KSPGetIterationNumber(self.ksp, &its) ) * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) # <<<<<<<<<<<<<< * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) * eigen = empty_c(neig) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_its)); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_3, NULL, (&__pyx_v_idata))); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_i = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/KSP.pyx":489 * cdef ndarray r = oarray_r(empty_r(its), NULL, &rdata) * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) # <<<<<<<<<<<<<< * eigen = empty_c(neig) * eigen.real = r[:neig] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPComputeEigenvalues(__pyx_v_self->ksp, __pyx_v_its, __pyx_v_rdata, __pyx_v_idata, (&__pyx_v_neig))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 489, __pyx_L1_error) /* "PETSc/KSP.pyx":490 * cdef ndarray i = oarray_r(empty_r(its), NULL, &idata) * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) * eigen = empty_c(neig) # <<<<<<<<<<<<<< * eigen.real = r[:neig] * eigen.imag = i[:neig] */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_c(__pyx_v_neig)); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_eigen = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/KSP.pyx":491 * CHKERR( KSPComputeEigenvalues(self.ksp, its, rdata, idata, &neig) ) * eigen = empty_c(neig) * eigen.real = r[:neig] # <<<<<<<<<<<<<< * eigen.imag = i[:neig] * return eigen */ __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_r), 0, __pyx_v_neig, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_n_s_real, __pyx_t_2) < 0) __PYX_ERR(40, 491, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/KSP.pyx":492 * eigen = empty_c(neig) * eigen.real = r[:neig] * eigen.imag = i[:neig] # <<<<<<<<<<<<<< * return eigen * */ __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_i), 0, __pyx_v_neig, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_n_s_imag, __pyx_t_2) < 0) __PYX_ERR(40, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/KSP.pyx":493 * eigen.real = r[:neig] * eigen.imag = i[:neig] * return eigen # <<<<<<<<<<<<<< * * def computeExtremeSingularValues(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_eigen)); __pyx_r = ((PyObject *)__pyx_v_eigen); goto __pyx_L0; /* "PETSc/KSP.pyx":481 * return r * * def computeEigenvalues(self): # <<<<<<<<<<<<<< * cdef PetscInt its = 0 * cdef PetscInt neig = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.computeEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_r); __Pyx_XDECREF((PyObject *)__pyx_v_i); __Pyx_XDECREF((PyObject *)__pyx_v_eigen); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":495 * return eigen * * def computeExtremeSingularValues(self): # <<<<<<<<<<<<<< * cdef PetscReal smax = 0 * cdef PetscReal smin = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127computeExtremeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_126computeExtremeSingularValues[] = "KSP.computeExtremeSingularValues(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127computeExtremeSingularValues(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeExtremeSingularValues (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("computeExtremeSingularValues", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "computeExtremeSingularValues", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_126computeExtremeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126computeExtremeSingularValues(struct PyPetscKSPObject *__pyx_v_self) { PetscReal __pyx_v_smax; PetscReal __pyx_v_smin; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeExtremeSingularValues", 0); /* "PETSc/KSP.pyx":496 * * def computeExtremeSingularValues(self): * cdef PetscReal smax = 0 # <<<<<<<<<<<<<< * cdef PetscReal smin = 0 * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) */ __pyx_v_smax = 0.0; /* "PETSc/KSP.pyx":497 * def computeExtremeSingularValues(self): * cdef PetscReal smax = 0 * cdef PetscReal smin = 0 # <<<<<<<<<<<<<< * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) * return smax, smin */ __pyx_v_smin = 0.0; /* "PETSc/KSP.pyx":498 * cdef PetscReal smax = 0 * cdef PetscReal smin = 0 * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) # <<<<<<<<<<<<<< * return smax, smin * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPComputeExtremeSingularValues(__pyx_v_self->ksp, (&__pyx_v_smax), (&__pyx_v_smin))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 498, __pyx_L1_error) /* "PETSc/KSP.pyx":499 * cdef PetscReal smin = 0 * CHKERR( KSPComputeExtremeSingularValues(self.ksp, &smax, &smin) ) * return smax, smin # <<<<<<<<<<<<<< * * # --- GMRES --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_smax); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyFloat_FromDouble(__pyx_v_smin); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":495 * return eigen * * def computeExtremeSingularValues(self): # <<<<<<<<<<<<<< * cdef PetscReal smax = 0 * cdef PetscReal smin = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.KSP.computeExtremeSingularValues", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":503 * # --- GMRES --- * * def setGMRESRestart(self, restart): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(restart) * CHKERR( KSPGMRESSetRestart(self.ksp, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129setGMRESRestart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_128setGMRESRestart[] = "KSP.setGMRESRestart(self, restart)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129setGMRESRestart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_restart = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGMRESRestart (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restart,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_restart)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGMRESRestart") < 0)) __PYX_ERR(40, 503, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_restart = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGMRESRestart", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 503, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setGMRESRestart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_128setGMRESRestart(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_restart); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128setGMRESRestart(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_restart) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGMRESRestart", 0); /* "PETSc/KSP.pyx":504 * * def setGMRESRestart(self, restart): * cdef PetscInt ival = asInt(restart) # <<<<<<<<<<<<<< * CHKERR( KSPGMRESSetRestart(self.ksp, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_restart); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(40, 504, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/KSP.pyx":505 * def setGMRESRestart(self, restart): * cdef PetscInt ival = asInt(restart) * CHKERR( KSPGMRESSetRestart(self.ksp, ival) ) # <<<<<<<<<<<<<< * * # --- Python --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGMRESSetRestart(__pyx_v_self->ksp, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 505, __pyx_L1_error) /* "PETSc/KSP.pyx":503 * # --- GMRES --- * * def setGMRESRestart(self, restart): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(restart) * CHKERR( KSPGMRESSetRestart(self.ksp, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setGMRESRestart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":509 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_130createPython[] = "KSP.createPython(self, context=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(40, 509, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 509, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_130createPython(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130createPython(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; KSP __pyx_v_newksp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 0); /* "PETSc/KSP.pyx":510 * * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(40, 510, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/KSP.pyx":511 * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL # <<<<<<<<<<<<<< * CHKERR( KSPCreate(ccomm, &newksp) ) * PetscCLEAR(self.obj); self.ksp = newksp */ __pyx_v_newksp = NULL; /* "PETSc/KSP.pyx":512 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ksp = newksp * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPCreate(__pyx_v_ccomm, (&__pyx_v_newksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 512, __pyx_L1_error) /* "PETSc/KSP.pyx":513 * cdef PetscKSP newksp = NULL * CHKERR( KSPCreate(ccomm, &newksp) ) * PetscCLEAR(self.obj); self.ksp = newksp # <<<<<<<<<<<<<< * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) * CHKERR( KSPPythonSetContext(self.ksp, context) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ksp = __pyx_v_newksp; /* "PETSc/KSP.pyx":514 * CHKERR( KSPCreate(ccomm, &newksp) ) * PetscCLEAR(self.obj); self.ksp = newksp * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetContext(self.ksp, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetType(__pyx_v_self->ksp, KSPPYTHON)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 514, __pyx_L1_error) /* "PETSc/KSP.pyx":515 * PetscCLEAR(self.obj); self.ksp = newksp * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) * CHKERR( KSPPythonSetContext(self.ksp, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPPythonSetContext(__pyx_v_self->ksp, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 515, __pyx_L1_error) /* "PETSc/KSP.pyx":516 * CHKERR( KSPSetType(self.ksp, KSPPYTHON) ) * CHKERR( KSPPythonSetContext(self.ksp, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/KSP.pyx":509 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscKSP newksp = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":518 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetContext(self.ksp, context) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_133setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_132setPythonContext[] = "KSP.setPythonContext(self, context)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_133setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(40, 518, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 518, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_132setPythonContext(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132setPythonContext(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 0); /* "PETSc/KSP.pyx":519 * * def setPythonContext(self, context): * CHKERR( KSPPythonSetContext(self.ksp, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPPythonSetContext(__pyx_v_self->ksp, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 519, __pyx_L1_error) /* "PETSc/KSP.pyx":518 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetContext(self.ksp, context) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":521 * CHKERR( KSPPythonSetContext(self.ksp, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( KSPPythonGetContext(self.ksp, &context) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_135getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_134getPythonContext[] = "KSP.getPythonContext(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_135getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_134getPythonContext(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134getPythonContext(struct PyPetscKSPObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 0); /* "PETSc/KSP.pyx":522 * * def getPythonContext(self): * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( KSPPythonGetContext(self.ksp, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "PETSc/KSP.pyx":523 * def getPythonContext(self): * cdef void *context = NULL * CHKERR( KSPPythonGetContext(self.ksp, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPPythonGetContext(__pyx_v_self->ksp, (&__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(40, 523, __pyx_L1_error) /* "PETSc/KSP.pyx":524 * cdef void *context = NULL * CHKERR( KSPPythonGetContext(self.ksp, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_2 = ((__pyx_v_context == NULL) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/KSP.pyx":525 * CHKERR( KSPPythonGetContext(self.ksp, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "PETSc/KSP.pyx":521 * CHKERR( KSPPythonSetContext(self.ksp, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( KSPPythonGetContext(self.ksp, &context) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":527 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_137setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3KSP_136setPythonType[] = "KSP.setPythonType(self, py_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_137setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_py_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(40, 527, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(40, 527, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_136setPythonType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136setPythonType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "PETSc/KSP.pyx":528 * * def setPythonType(self, py_type): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( KSPPythonSetType(self.ksp, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/KSP.pyx":529 * def setPythonType(self, py_type): * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( KSPPythonSetType(self.ksp, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":530 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( KSPPythonSetType(self.ksp, cval) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPPythonSetType(__pyx_v_self->ksp, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(40, 530, __pyx_L1_error) /* "PETSc/KSP.pyx":527 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":535 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6appctx___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":536 * property appctx: * def __get__(self): * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":535 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":537 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6appctx_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":538 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":537 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":543 * * property dm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2dm___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":544 * property dm: * def __get__(self): * return self.getDM() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setDM(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":543 * * property dm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":545 * def __get__(self): * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_2dm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":546 * return self.getDM() * def __set__(self, value): * self.setDM(value) # <<<<<<<<<<<<<< * * # --- vectors --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":545 * def __get__(self): * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":551 * * property vec_sol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_sol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_sol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_sol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":552 * property vec_sol: * def __get__(self): * return self.getSolution() # <<<<<<<<<<<<<< * * property vec_rhs: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":551 * * property vec_sol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":555 * * property vec_rhs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRhs() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_rhs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7vec_rhs_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7vec_rhs___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":556 * property vec_rhs: * def __get__(self): * return self.getRhs() # <<<<<<<<<<<<<< * * # --- operators --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRhs); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":555 * * property vec_rhs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRhs() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.vec_rhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":561 * * property mat_op: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOperators()[0] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_op_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_op_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_op___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":562 * property mat_op: * def __get__(self): * return self.getOperators()[0] # <<<<<<<<<<<<<< * * property mat_pc: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":561 * * property mat_op: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOperators()[0] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.mat_op.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":565 * * property mat_pc: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOperators()[1] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_pc_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6mat_pc_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6mat_pc___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":566 * property mat_pc: * def __get__(self): * return self.getOperators()[1] # <<<<<<<<<<<<<< * * # --- initial guess --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getOperators); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":565 * * property mat_pc: * def __get__(self): # <<<<<<<<<<<<<< * return self.getOperators()[1] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.mat_pc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":571 * * property guess_nonzero: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInitialGuessNonzero() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":572 * property guess_nonzero: * def __get__(self): * return self.getInitialGuessNonzero() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setInitialGuessNonzero(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInitialGuessNonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":571 * * property guess_nonzero: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInitialGuessNonzero() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_nonzero.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":573 * def __get__(self): * return self.getInitialGuessNonzero() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessNonzero(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_13guess_nonzero_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":574 * return self.getInitialGuessNonzero() * def __set__(self, value): * self.setInitialGuessNonzero(value) # <<<<<<<<<<<<<< * * property guess_knoll: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInitialGuessNonzero); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":573 * def __get__(self): * return self.getInitialGuessNonzero() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessNonzero(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_nonzero.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":577 * * property guess_knoll: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInitialGuessKnoll() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":578 * property guess_knoll: * def __get__(self): * return self.getInitialGuessKnoll() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setInitialGuessKnoll(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getInitialGuessKnoll); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":577 * * property guess_knoll: * def __get__(self): # <<<<<<<<<<<<<< * return self.getInitialGuessKnoll() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_knoll.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":579 * def __get__(self): * return self.getInitialGuessKnoll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessKnoll(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_11guess_knoll_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":580 * return self.getInitialGuessKnoll() * def __set__(self, value): * self.setInitialGuessKnoll(value) # <<<<<<<<<<<<<< * * # --- preconditioner --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setInitialGuessKnoll); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":579 * def __get__(self): * return self.getInitialGuessKnoll() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setInitialGuessKnoll(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.guess_knoll.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":585 * * property pc: * def __get__(self): # <<<<<<<<<<<<<< * return self.getPC() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2pc_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_2pc_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_2pc___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":586 * property pc: * def __get__(self): * return self.getPC() # <<<<<<<<<<<<<< * * property pc_side: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":585 * * property pc: * def __get__(self): # <<<<<<<<<<<<<< * return self.getPC() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.pc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":589 * * property pc_side: * def __get__(self): # <<<<<<<<<<<<<< * return self.getPCSide() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":590 * property pc_side: * def __get__(self): * return self.getPCSide() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setPCSide(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getPCSide); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":589 * * property pc_side: * def __get__(self): # <<<<<<<<<<<<<< * return self.getPCSide() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.pc_side.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":591 * def __get__(self): * return self.getPCSide() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setPCSide(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_7pc_side_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":592 * return self.getPCSide() * def __set__(self, value): * self.setPCSide(value) # <<<<<<<<<<<<<< * * property norm_type: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setPCSide); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":591 * def __get__(self): * return self.getPCSide() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setPCSide(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.pc_side.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":595 * * property norm_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getNormType() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":596 * property norm_type: * def __get__(self): * return self.getNormType() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setNormType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getNormType); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":595 * * property norm_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getNormType() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":597 * def __get__(self): * return self.getNormType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNormType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_9norm_type_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":598 * return self.getNormType() * def __set__(self, value): * self.setNormType(value) # <<<<<<<<<<<<<< * * # --- tolerances --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setNormType); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":597 * def __get__(self): * return self.getNormType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNormType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":603 * * property rtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4rtol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":604 * property rtol: * def __get__(self): * return self.getTolerances()[0] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(rtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":603 * * property rtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":605 * def __get__(self): * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_4rtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":606 * return self.getTolerances()[0] * def __set__(self, value): * self.setTolerances(rtol=value) # <<<<<<<<<<<<<< * * property atol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(40, 606, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":605 * def __get__(self): * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":609 * * property atol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4atol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":610 * property atol: * def __get__(self): * return self.getTolerances()[1] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(atol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":609 * * property atol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":611 * def __get__(self): * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_4atol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":612 * return self.getTolerances()[1] * def __set__(self, value): * self.setTolerances(atol=value) # <<<<<<<<<<<<<< * * property divtol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(40, 612, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":611 * def __get__(self): * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":615 * * property divtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6divtol___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":616 * property divtol: * def __get__(self): * return self.getTolerances()[2] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(divtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":615 * * property divtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.divtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":617 * def __get__(self): * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(divtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6divtol_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":618 * return self.getTolerances()[2] * def __set__(self, value): * self.setTolerances(divtol=value) # <<<<<<<<<<<<<< * * property max_it: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_divtol, __pyx_v_value) < 0) __PYX_ERR(40, 618, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":617 * def __get__(self): * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(divtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.divtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":621 * * property max_it: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6max_it___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":622 * property max_it: * def __get__(self): * return self.getTolerances()[3] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(max_it=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":621 * * property max_it: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.max_it.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":623 * def __get__(self): * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6max_it_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":624 * return self.getTolerances()[3] * def __set__(self, value): * self.setTolerances(max_it=value) # <<<<<<<<<<<<<< * * # --- iteration --- */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_it, __pyx_v_value) < 0) __PYX_ERR(40, 624, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":623 * def __get__(self): * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.max_it.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":629 * * property its: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_3its___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":630 * property its: * def __get__(self): * return self.getIterationNumber() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setIterationNumber(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":629 * * property its: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":631 * def __get__(self): * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_3its_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":632 * return self.getIterationNumber() * def __set__(self, value): * self.setIterationNumber(value) # <<<<<<<<<<<<<< * * property norm: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":631 * def __get__(self): * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.its.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":635 * * property norm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getResidualNorm() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_4norm___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":636 * property norm: * def __get__(self): * return self.getResidualNorm() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setResidualNorm(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getResidualNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":635 * * property norm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getResidualNorm() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":637 * def __get__(self): * return self.getResidualNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setResidualNorm(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_4norm_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":638 * return self.getResidualNorm() * def __set__(self, value): * self.setResidualNorm(value) # <<<<<<<<<<<<<< * * property history: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setResidualNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":637 * def __get__(self): * return self.getResidualNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setResidualNorm(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.norm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":641 * * property history: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7history_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_7history_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_7history___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":642 * property history: * def __get__(self): * return self.getConvergenceHistory() # <<<<<<<<<<<<<< * * # --- convergence --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergenceHistory); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":641 * * property history: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.history.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":647 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_6reason___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":648 * property reason: * def __get__(self): * return self.getConvergedReason() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setConvergedReason(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":647 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":649 * def __get__(self): * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(((struct PyPetscKSPObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3KSP_6reason_2__set__(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/KSP.pyx":650 * return self.getConvergedReason() * def __set__(self, value): * self.setConvergedReason(value) # <<<<<<<<<<<<<< * * property iterating: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/KSP.pyx":649 * def __get__(self): * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.KSP.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":653 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9iterating_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9iterating___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9iterating___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":654 * property iterating: * def __get__(self): * return self.reason == 0 # <<<<<<<<<<<<<< * * property converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":653 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":657 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_9converged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_9converged___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_9converged___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":658 * property converged: * def __get__(self): * return self.reason > 0 # <<<<<<<<<<<<<< * * property diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":657 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/KSP.pyx":661 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_8diverged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_8diverged___get__(((struct PyPetscKSPObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_8diverged___get__(struct PyPetscKSPObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/KSP.pyx":662 * property diverged: * def __get__(self): * return self.reason < 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/KSP.pyx":661 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.KSP.diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":73 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.snes * self.snes = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES___cinit__(struct PyPetscSNESObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/SNES.pyx":74 * * def __cinit__(self): * self.obj = &self.snes # <<<<<<<<<<<<<< * self.snes = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->snes)); /* "PETSc/SNES.pyx":75 * def __cinit__(self): * self.obj = &self.snes * self.snes = NULL # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_v_self->snes = NULL; /* "PETSc/SNES.pyx":73 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.snes * self.snes = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":79 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_2view[] = "SNES.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(41, 79, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 79, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(41, 79, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2view(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2view(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/SNES.pyx":80 * * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( SNESView(self.snes, cviewer) ) */ __pyx_v_cviewer = NULL; /* "PETSc/SNES.pyx":81 * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( SNESView(self.snes, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_3; } /* "PETSc/SNES.pyx":82 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( SNESView(self.snes, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESView(__pyx_v_self->snes, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 82, __pyx_L1_error) /* "PETSc/SNES.pyx":79 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":84 * CHKERR( SNESView(self.snes, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( SNESDestroy(&self.snes) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_4destroy[] = "SNES.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4destroy(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/SNES.pyx":85 * * def destroy(self): * CHKERR( SNESDestroy(&self.snes) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESDestroy((&__pyx_v_self->snes))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 85, __pyx_L1_error) /* "PETSc/SNES.pyx":86 * def destroy(self): * CHKERR( SNESDestroy(&self.snes) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/SNES.pyx":84 * CHKERR( SNESView(self.snes, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( SNESDestroy(&self.snes) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":88 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_6create[] = "SNES.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(41, 88, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 88, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6create(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6create(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; SNES __pyx_v_newsnes; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/SNES.pyx":89 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 89, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/SNES.pyx":90 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL # <<<<<<<<<<<<<< * CHKERR( SNESCreate(ccomm, &newsnes) ) * PetscCLEAR(self.obj); self.snes = newsnes */ __pyx_v_newsnes = NULL; /* "PETSc/SNES.pyx":91 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.snes = newsnes * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCreate(__pyx_v_ccomm, (&__pyx_v_newsnes))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 91, __pyx_L1_error) /* "PETSc/SNES.pyx":92 * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) * PetscCLEAR(self.obj); self.snes = newsnes # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->snes = __pyx_v_newsnes; /* "PETSc/SNES.pyx":93 * CHKERR( SNESCreate(ccomm, &newsnes) ) * PetscCLEAR(self.obj); self.snes = newsnes * return self # <<<<<<<<<<<<<< * * def setType(self, snes_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/SNES.pyx":88 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":95 * return self * * def setType(self, snes_type): # <<<<<<<<<<<<<< * cdef PetscSNESType cval = NULL * snes_type = str2bytes(snes_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_8setType[] = "SNES.setType(self, snes_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_snes_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_snes_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_snes_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(41, 95, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_snes_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 95, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_8setType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_snes_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8setType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_snes_type) { SNESType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_snes_type); /* "PETSc/SNES.pyx":96 * * def setType(self, snes_type): * cdef PetscSNESType cval = NULL # <<<<<<<<<<<<<< * snes_type = str2bytes(snes_type, &cval) * CHKERR( SNESSetType(self.snes, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/SNES.pyx":97 * def setType(self, snes_type): * cdef PetscSNESType cval = NULL * snes_type = str2bytes(snes_type, &cval) # <<<<<<<<<<<<<< * CHKERR( SNESSetType(self.snes, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_snes_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_snes_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":98 * cdef PetscSNESType cval = NULL * snes_type = str2bytes(snes_type, &cval) * CHKERR( SNESSetType(self.snes, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetType(__pyx_v_self->snes, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 98, __pyx_L1_error) /* "PETSc/SNES.pyx":95 * return self * * def setType(self, snes_type): # <<<<<<<<<<<<<< * cdef PetscSNESType cval = NULL * snes_type = str2bytes(snes_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_snes_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":100 * CHKERR( SNESSetType(self.snes, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscSNESType cval = NULL * CHKERR( SNESGetType(self.snes, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_10getType[] = "SNES.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_10getType(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10getType(struct PyPetscSNESObject *__pyx_v_self) { SNESType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/SNES.pyx":101 * * def getType(self): * cdef PetscSNESType cval = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetType(self.snes, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/SNES.pyx":102 * def getType(self): * cdef PetscSNESType cval = NULL * CHKERR( SNESGetType(self.snes, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetType(__pyx_v_self->snes, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 102, __pyx_L1_error) /* "PETSc/SNES.pyx":103 * cdef PetscSNESType cval = NULL * CHKERR( SNESGetType(self.snes, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":100 * CHKERR( SNESSetType(self.snes, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscSNESType cval = NULL * CHKERR( SNESGetType(self.snes, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":105 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_12setOptionsPrefix[] = "SNES.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(41, 105, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 105, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_12setOptionsPrefix(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_12setOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/SNES.pyx":106 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/SNES.pyx":107 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":108 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetOptionsPrefix(__pyx_v_self->snes, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 108, __pyx_L1_error) /* "PETSc/SNES.pyx":105 * return bytes2str(cval) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":110 * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_14getOptionsPrefix[] = "SNES.getOptionsPrefix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_14getOptionsPrefix(struct PyPetscSNESObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/SNES.pyx":111 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/SNES.pyx":112 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetOptionsPrefix(__pyx_v_self->snes, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 112, __pyx_L1_error) /* "PETSc/SNES.pyx":113 * cdef const char *cval = NULL * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":110 * CHKERR( SNESSetOptionsPrefix(self.snes, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( SNESGetOptionsPrefix(self.snes, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":115 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( SNESSetFromOptions(self.snes) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_17setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_16setFromOptions[] = "SNES.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_17setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_16setFromOptions(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_16setFromOptions(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/SNES.pyx":116 * * def setFromOptions(self): * CHKERR( SNESSetFromOptions(self.snes) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFromOptions(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 116, __pyx_L1_error) /* "PETSc/SNES.pyx":115 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( SNESSetFromOptions(self.snes) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":120 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_19setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_18setAppCtx[] = "SNES.setAppCtx(self, appctx)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_19setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_appctx = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_appctx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAppCtx") < 0)) __PYX_ERR(41, 120, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 120, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_18setAppCtx(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_18setAppCtx(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 0); /* "PETSc/SNES.pyx":121 * * def setAppCtx(self, appctx): * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":120 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":123 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_21getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_20getAppCtx[] = "SNES.getAppCtx(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_21getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_20getAppCtx(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_20getAppCtx(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 0); /* "PETSc/SNES.pyx":124 * * def getAppCtx(self): * return self.get_attr('__appctx__') # <<<<<<<<<<<<<< * * # --- discretization space --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":123 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":128 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( SNESGetDM(self.snes, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_23getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_22getDM[] = "SNES.getDM(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_23getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_22getDM(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_22getDM(struct PyPetscSNESObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 0); /* "PETSc/SNES.pyx":129 * * def getDM(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( SNESGetDM(self.snes, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/SNES.pyx":130 * def getDM(self): * cdef PetscDM newdm = NULL * CHKERR( SNESGetDM(self.snes, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetDM(__pyx_v_self->snes, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 130, __pyx_L1_error) /* "PETSc/SNES.pyx":131 * cdef PetscDM newdm = NULL * CHKERR( SNESGetDM(self.snes, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * PetscINCREF(dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(41, 131, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":132 * CHKERR( SNESGetDM(self.snes, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/SNES.pyx":133 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * return dm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/SNES.pyx":134 * dm.dm = newdm * PetscINCREF(dm.obj) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/SNES.pyx":128 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( SNESGetDM(self.snes, &newdm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":136 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( SNESSetDM(self.snes, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_25setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_24setDM[] = "SNES.setDM(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_25setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(41, 136, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 136, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(41, 136, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_24setDM(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_24setDM(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 0); /* "PETSc/SNES.pyx":137 * * def setDM(self, DM dm): * CHKERR( SNESSetDM(self.snes, dm.dm) ) # <<<<<<<<<<<<<< * * # --- FAS --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetDM(__pyx_v_self->snes, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 137, __pyx_L1_error) /* "PETSc/SNES.pyx":136 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( SNESSetDM(self.snes, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":140 * * # --- FAS --- * def setFASInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_27setFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_26setFASInterpolation[] = "SNES.setFASInterpolation(self, level, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_27setFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASInterpolation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFASInterpolation", 1, 2, 2, 1); __PYX_ERR(41, 140, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASInterpolation") < 0)) __PYX_ERR(41, 140, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASInterpolation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 140, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(41, 140, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_26setFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_26setFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASInterpolation", 0); /* "PETSc/SNES.pyx":141 * # --- FAS --- * def setFASInterpolation(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 141, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":142 * def setFASInterpolation(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getFASInterpolation(self, level): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetInterpolation(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 142, __pyx_L1_error) /* "PETSc/SNES.pyx":140 * * # --- FAS --- * def setFASInterpolation(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":144 * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) * * def getFASInterpolation(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29getFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_28getFASInterpolation[] = "SNES.getFASInterpolation(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29getFASInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASInterpolation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASInterpolation") < 0)) __PYX_ERR(41, 144, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASInterpolation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 144, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_28getFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_28getFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASInterpolation", 0); /* "PETSc/SNES.pyx":145 * * def getFASInterpolation(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 145, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":146 * def getFASInterpolation(self, level): * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":147 * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * return mat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInterpolation(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 147, __pyx_L1_error) /* "PETSc/SNES.pyx":148 * cdef Mat mat = Mat() * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * return mat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/SNES.pyx":149 * CHKERR( SNESFASGetInterpolation(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) * return mat # <<<<<<<<<<<<<< * * def setFASRestriction(self, level, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/SNES.pyx":144 * CHKERR( SNESFASSetInterpolation(self.snes, clevel, mat.mat) ) * * def getFASInterpolation(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":151 * return mat * * def setFASRestriction(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31setFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_30setFASRestriction[] = "SNES.setFASRestriction(self, level, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31setFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASRestriction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFASRestriction", 1, 2, 2, 1); __PYX_ERR(41, 151, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASRestriction") < 0)) __PYX_ERR(41, 151, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASRestriction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 151, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(41, 151, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_30setFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30setFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASRestriction", 0); /* "PETSc/SNES.pyx":152 * * def setFASRestriction(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 152, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":153 * def setFASRestriction(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getFASRestriction(self, level): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetRestriction(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 153, __pyx_L1_error) /* "PETSc/SNES.pyx":151 * return mat * * def setFASRestriction(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":155 * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) * * def getFASRestriction(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33getFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_32getFASRestriction[] = "SNES.getFASRestriction(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33getFASRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASRestriction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASRestriction") < 0)) __PYX_ERR(41, 155, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASRestriction", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 155, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_32getFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32getFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASRestriction", 0); /* "PETSc/SNES.pyx":156 * * def getFASRestriction(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 156, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":157 * def getFASRestriction(self, level): * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":158 * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * return mat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetRestriction(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 158, __pyx_L1_error) /* "PETSc/SNES.pyx":159 * cdef Mat mat = Mat() * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * return mat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/SNES.pyx":160 * CHKERR( SNESFASGetRestriction(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) * return mat # <<<<<<<<<<<<<< * * def setFASInjection(self, level, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/SNES.pyx":155 * CHKERR( SNESFASSetRestriction(self.snes, clevel, mat.mat) ) * * def getFASRestriction(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":162 * return mat * * def setFASInjection(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35setFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_34setFASInjection[] = "SNES.setFASInjection(self, level, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35setFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASInjection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_mat,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFASInjection", 1, 2, 2, 1); __PYX_ERR(41, 162, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASInjection") < 0)) __PYX_ERR(41, 162, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_mat = ((struct PyPetscMatObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASInjection", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 162, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(41, 162, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_34setFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34setFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASInjection", 0); /* "PETSc/SNES.pyx":163 * * def setFASInjection(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 163, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":164 * def setFASInjection(self, level, Mat mat): * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) # <<<<<<<<<<<<<< * * def getFASInjection(self, level): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetInjection(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_mat->mat)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 164, __pyx_L1_error) /* "PETSc/SNES.pyx":162 * return mat * * def setFASInjection(self, level, Mat mat): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":166 * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) * * def getFASInjection(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_37getFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_36getFASInjection[] = "SNES.getFASInjection(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_37getFASInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASInjection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASInjection") < 0)) __PYX_ERR(41, 166, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASInjection", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 166, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_36getFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36getFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASInjection", 0); /* "PETSc/SNES.pyx":167 * * def getFASInjection(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 167, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":168 * def getFASInjection(self, level): * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":169 * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * return mat */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInjection(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 169, __pyx_L1_error) /* "PETSc/SNES.pyx":170 * cdef Mat mat = Mat() * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * return mat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/SNES.pyx":171 * CHKERR( SNESFASGetInjection(self.snes, clevel, &mat.mat) ) * PetscINCREF(mat.obj) * return mat # <<<<<<<<<<<<<< * * def setFASRScale(self, level, Vec vec): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/SNES.pyx":166 * CHKERR( SNESFASSetInjection(self.snes, clevel, mat.mat) ) * * def getFASInjection(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef Mat mat = Mat() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":173 * return mat * * def setFASRScale(self, level, Vec vec): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_39setFASRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_38setFASRScale[] = "SNES.setFASRScale(self, level, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_39setFASRScale(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASRScale (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,&__pyx_n_s_vec,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFASRScale", 1, 2, 2, 1); __PYX_ERR(41, 173, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASRScale") < 0)) __PYX_ERR(41, 173, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_level = values[0]; __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASRScale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 173, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 173, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_38setFASRScale(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38setFASRScale(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_vec) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASRScale", 0); /* "PETSc/SNES.pyx":174 * * def setFASRScale(self, level, Vec vec): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 174, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":175 * def setFASRScale(self, level, Vec vec): * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) # <<<<<<<<<<<<<< * * def setFASLevels(self, levels, comms=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetRScale(__pyx_v_self->snes, __pyx_v_clevel, __pyx_v_vec->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 175, __pyx_L1_error) /* "PETSc/SNES.pyx":173 * return mat * * def setFASRScale(self, level, Vec vec): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASRScale", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":177 * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) * * def setFASLevels(self, levels, comms=None): # <<<<<<<<<<<<<< * cdef PetscInt clevels = asInt(levels) * cdef MPI_Comm *ccomms = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_40setFASLevels[] = "SNES.setFASLevels(self, levels, comms=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_levels = 0; PyObject *__pyx_v_comms = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFASLevels (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_levels,&__pyx_n_s_comms,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comms); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFASLevels") < 0)) __PYX_ERR(41, 177, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_levels = values[0]; __pyx_v_comms = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFASLevels", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 177, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_40setFASLevels(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_levels, __pyx_v_comms); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASLevels(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_levels, PyObject *__pyx_v_comms) { PetscInt __pyx_v_clevels; MPI_Comm *__pyx_v_ccomms; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_comm = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; MPI_Comm __pyx_t_10; int __pyx_t_11; char const *__pyx_t_12; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; PyObject *__pyx_t_18 = NULL; int __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFASLevels", 0); /* "PETSc/SNES.pyx":178 * * def setFASLevels(self, levels, comms=None): * cdef PetscInt clevels = asInt(levels) # <<<<<<<<<<<<<< * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 178, __pyx_L1_error) __pyx_v_clevels = __pyx_t_1; /* "PETSc/SNES.pyx":179 * def setFASLevels(self, levels, comms=None): * cdef PetscInt clevels = asInt(levels) * cdef MPI_Comm *ccomms = NULL # <<<<<<<<<<<<<< * cdef Py_ssize_t i = 0 * if comms is not None: */ __pyx_v_ccomms = NULL; /* "PETSc/SNES.pyx":180 * cdef PetscInt clevels = asInt(levels) * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< * if comms is not None: * if clevels != len(comms): */ __pyx_v_i = 0; /* "PETSc/SNES.pyx":181 * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 * if comms is not None: # <<<<<<<<<<<<<< * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") */ __pyx_t_2 = (__pyx_v_comms != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/SNES.pyx":182 * cdef Py_ssize_t i = 0 * if comms is not None: * if clevels != len(comms): # <<<<<<<<<<<<<< * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) */ __pyx_t_4 = PyObject_Length(__pyx_v_comms); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(41, 182, __pyx_L1_error) __pyx_t_3 = ((__pyx_v_clevels != ((PetscInt)__pyx_t_4)) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/SNES.pyx":183 * if comms is not None: * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(41, 183, __pyx_L1_error) /* "PETSc/SNES.pyx":182 * cdef Py_ssize_t i = 0 * if comms is not None: * if clevels != len(comms): # <<<<<<<<<<<<<< * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) */ } /* "PETSc/SNES.pyx":184 * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) # <<<<<<<<<<<<<< * try: * for i, comm in enumerate(comms): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc(((sizeof(MPI_Comm)) * ((size_t)__pyx_v_clevels)), (&__pyx_v_ccomms))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 184, __pyx_L1_error) /* "PETSc/SNES.pyx":185 * raise ValueError("Must provide as many communicators as levels") * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: # <<<<<<<<<<<<<< * for i, comm in enumerate(comms): * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) */ /*try:*/ { /* "PETSc/SNES.pyx":186 * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: * for i, comm in enumerate(comms): # <<<<<<<<<<<<<< * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) */ __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_v_comms)) || PyTuple_CheckExact(__pyx_v_comms)) { __pyx_t_5 = __pyx_v_comms; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_comms); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 186, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 186, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(41, 186, __pyx_L6_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 186, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(41, 186, __pyx_L6_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 186, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_8(__pyx_t_5); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(41, 186, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_v_comm, __pyx_t_9); __pyx_t_9 = 0; __pyx_v_i = __pyx_t_4; __pyx_t_4 = (__pyx_t_4 + 1); /* "PETSc/SNES.pyx":187 * try: * for i, comm in enumerate(comms): * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) # <<<<<<<<<<<<<< * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * finally: */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 187, __pyx_L6_error) (__pyx_v_ccomms[__pyx_v_i]) = __pyx_t_10; /* "PETSc/SNES.pyx":186 * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: * for i, comm in enumerate(comms): # <<<<<<<<<<<<<< * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/SNES.pyx":188 * for i, comm in enumerate(comms): * ccomms[i] = def_Comm(comm, MPI_COMM_NULL) * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) # <<<<<<<<<<<<<< * finally: * CHKERR( PetscFree(ccomms) ) */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 188, __pyx_L6_error) } /* "PETSc/SNES.pyx":190 * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * finally: * CHKERR( PetscFree(ccomms) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) */ /*finally:*/ { /*normal exit:*/{ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 190, __pyx_L1_error) goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __pyx_t_6 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename; { __pyx_t_19 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_19 == ((int)-1))) __PYX_ERR(41, 190, __pyx_L11_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12; goto __pyx_L1_error; __pyx_L11_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_XGIVEREF(__pyx_t_18); __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18); } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; goto __pyx_L1_error; } __pyx_L7:; } /* "PETSc/SNES.pyx":181 * cdef MPI_Comm *ccomms = NULL * cdef Py_ssize_t i = 0 * if comms is not None: # <<<<<<<<<<<<<< * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") */ goto __pyx_L3; } /* "PETSc/SNES.pyx":192 * CHKERR( PetscFree(ccomms) ) * else: * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) # <<<<<<<<<<<<<< * * def getFASLevels(self): */ /*else*/ { __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(41, 192, __pyx_L1_error) } __pyx_L3:; /* "PETSc/SNES.pyx":177 * CHKERR( SNESFASSetRScale(self.snes, clevel, vec.vec) ) * * def setFASLevels(self, levels, comms=None): # <<<<<<<<<<<<<< * cdef PetscInt clevels = asInt(levels) * cdef MPI_Comm *ccomms = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFASLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_comm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":194 * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * * def getFASLevels(self): # <<<<<<<<<<<<<< * cdef PetscInt levels = 0 * CHKERR( SNESFASGetLevels(self.snes, &levels) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_43getFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_42getFASLevels[] = "SNES.getFASLevels(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_43getFASLevels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASLevels (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFASLevels", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFASLevels", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_42getFASLevels(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42getFASLevels(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_levels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASLevels", 0); /* "PETSc/SNES.pyx":195 * * def getFASLevels(self): * cdef PetscInt levels = 0 # <<<<<<<<<<<<<< * CHKERR( SNESFASGetLevels(self.snes, &levels) ) * return toInt(levels) */ __pyx_v_levels = 0; /* "PETSc/SNES.pyx":196 * def getFASLevels(self): * cdef PetscInt levels = 0 * CHKERR( SNESFASGetLevels(self.snes, &levels) ) # <<<<<<<<<<<<<< * return toInt(levels) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetLevels(__pyx_v_self->snes, (&__pyx_v_levels))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 196, __pyx_L1_error) /* "PETSc/SNES.pyx":197 * cdef PetscInt levels = 0 * CHKERR( SNESFASGetLevels(self.snes, &levels) ) * return toInt(levels) # <<<<<<<<<<<<<< * * def getFASCycleSNES(self, level): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_levels); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":194 * CHKERR( SNESFASSetLevels(self.snes, clevels, ccomms) ) * * def getFASLevels(self): # <<<<<<<<<<<<<< * cdef PetscInt levels = 0 * CHKERR( SNESFASGetLevels(self.snes, &levels) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASLevels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":199 * return toInt(levels) * * def getFASCycleSNES(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES lsnes = SNES() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASCycleSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_44getFASCycleSNES[] = "SNES.getFASCycleSNES(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASCycleSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASCycleSNES (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASCycleSNES") < 0)) __PYX_ERR(41, 199, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASCycleSNES", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 199, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCycleSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_44getFASCycleSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44getFASCycleSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_lsnes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASCycleSNES", 0); /* "PETSc/SNES.pyx":200 * * def getFASCycleSNES(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES lsnes = SNES() * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 200, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":201 * def getFASCycleSNES(self, level): * cdef PetscInt clevel = asInt(level) * cdef SNES lsnes = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) * PetscINCREF(lsnes.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_lsnes = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":202 * cdef PetscInt clevel = asInt(level) * cdef SNES lsnes = SNES() * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(lsnes.obj) * return lsnes */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCycleSNES(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_lsnes->snes))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 202, __pyx_L1_error) /* "PETSc/SNES.pyx":203 * cdef SNES lsnes = SNES() * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) * PetscINCREF(lsnes.obj) # <<<<<<<<<<<<<< * return lsnes * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_lsnes->__pyx_base.obj)); /* "PETSc/SNES.pyx":204 * CHKERR( SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes) ) * PetscINCREF(lsnes.obj) * return lsnes # <<<<<<<<<<<<<< * * def getFASCoarseSolve(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_lsnes)); __pyx_r = ((PyObject *)__pyx_v_lsnes); goto __pyx_L0; /* "PETSc/SNES.pyx":199 * return toInt(levels) * * def getFASCycleSNES(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES lsnes = SNES() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCycleSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_lsnes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":206 * return lsnes * * def getFASCoarseSolve(self): # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_46getFASCoarseSolve[] = "SNES.getFASCoarseSolve(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCoarseSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASCoarseSolve (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFASCoarseSolve", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFASCoarseSolve", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCoarseSolve(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASCoarseSolve", 0); /* "PETSc/SNES.pyx":207 * * def getFASCoarseSolve(self): * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) * PetscINCREF(smooth.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":208 * def getFASCoarseSolve(self): * cdef SNES smooth = SNES() * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(smooth.obj) * return smooth */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCoarseSolve(__pyx_v_self->snes, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 208, __pyx_L1_error) /* "PETSc/SNES.pyx":209 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) * PetscINCREF(smooth.obj) # <<<<<<<<<<<<<< * return smooth * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); /* "PETSc/SNES.pyx":210 * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) * PetscINCREF(smooth.obj) * return smooth # <<<<<<<<<<<<<< * * def getFASSmoother(self, level): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_smooth)); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "PETSc/SNES.pyx":206 * return lsnes * * def getFASCoarseSolve(self): # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetCoarseSolve(self.snes, &smooth.snes) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASCoarseSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":212 * return smooth * * def getFASSmoother(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_48getFASSmoother[] = "SNES.getFASSmoother(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASSmoother(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASSmoother (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASSmoother") < 0)) __PYX_ERR(41, 212, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASSmoother", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 212, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_48getFASSmoother(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48getFASSmoother(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASSmoother", 0); /* "PETSc/SNES.pyx":213 * * def getFASSmoother(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 213, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":214 * def getFASSmoother(self, level): * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":215 * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(smooth.obj) * return smooth */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmoother(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 215, __pyx_L1_error) /* "PETSc/SNES.pyx":216 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) # <<<<<<<<<<<<<< * return smooth * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); /* "PETSc/SNES.pyx":217 * CHKERR( SNESFASGetSmoother(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) * return smooth # <<<<<<<<<<<<<< * * def getFASSmootherDown(self, level): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_smooth)); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "PETSc/SNES.pyx":212 * return smooth * * def getFASSmoother(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmoother", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":219 * return smooth * * def getFASSmootherDown(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_50getFASSmootherDown[] = "SNES.getFASSmootherDown(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmootherDown(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASSmootherDown (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASSmootherDown") < 0)) __PYX_ERR(41, 219, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASSmootherDown", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 219, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmootherDown(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50getFASSmootherDown(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASSmootherDown", 0); /* "PETSc/SNES.pyx":220 * * def getFASSmootherDown(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 220, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":221 * def getFASSmootherDown(self, level): * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":222 * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(smooth.obj) * return smooth */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherDown(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 222, __pyx_L1_error) /* "PETSc/SNES.pyx":223 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) # <<<<<<<<<<<<<< * return smooth * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); /* "PETSc/SNES.pyx":224 * CHKERR( SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) * return smooth # <<<<<<<<<<<<<< * * def getFASSmootherUp(self, level): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_smooth)); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "PETSc/SNES.pyx":219 * return smooth * * def getFASSmootherDown(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherDown", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":226 * return smooth * * def getFASSmootherUp(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_52getFASSmootherUp[] = "SNES.getFASSmootherUp(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFASSmootherUp (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFASSmootherUp") < 0)) __PYX_ERR(41, 226, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFASSmootherUp", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 226, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherUp(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASSmootherUp(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; struct PyPetscSNESObject *__pyx_v_smooth = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFASSmootherUp", 0); /* "PETSc/SNES.pyx":227 * * def getFASSmootherUp(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 227, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/SNES.pyx":228 * def getFASSmootherUp(self, level): * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":229 * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(smooth.obj) * return smooth */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherUp(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 229, __pyx_L1_error) /* "PETSc/SNES.pyx":230 * cdef SNES smooth = SNES() * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) # <<<<<<<<<<<<<< * return smooth * # --- nonlinear preconditioner --- */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); /* "PETSc/SNES.pyx":231 * CHKERR( SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes) ) * PetscINCREF(smooth.obj) * return smooth # <<<<<<<<<<<<<< * # --- nonlinear preconditioner --- * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_smooth)); __pyx_r = ((PyObject *)__pyx_v_smooth); goto __pyx_L0; /* "PETSc/SNES.pyx":226 * return smooth * * def getFASSmootherUp(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * cdef SNES smooth = SNES() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFASSmootherUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_smooth); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":234 * # --- nonlinear preconditioner --- * * def getNPC(self): # <<<<<<<<<<<<<< * cdef SNES snes = SNES() * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_55getNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_54getNPC[] = "SNES.getNPC(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_55getNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNPC (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNPC", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNPC", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_54getNPC(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getNPC(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNPC", 0); /* "PETSc/SNES.pyx":235 * * def getNPC(self): * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) * PetscINCREF(snes.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":236 * def getNPC(self): * cdef SNES snes = SNES() * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(snes.obj) * return snes */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNPC(__pyx_v_self->snes, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 236, __pyx_L1_error) /* "PETSc/SNES.pyx":237 * cdef SNES snes = SNES() * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) * PetscINCREF(snes.obj) # <<<<<<<<<<<<<< * return snes * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); /* "PETSc/SNES.pyx":238 * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) * PetscINCREF(snes.obj) * return snes # <<<<<<<<<<<<<< * * def hasNPC(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_snes)); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "PETSc/SNES.pyx":234 * # --- nonlinear preconditioner --- * * def getNPC(self): # <<<<<<<<<<<<<< * cdef SNES snes = SNES() * CHKERR( SNESGetNPC(self.snes, &snes.snes) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":240 * return snes * * def hasNPC(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESHasNPC(self.snes, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_57hasNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_56hasNPC[] = "SNES.hasNPC(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_57hasNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasNPC (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("hasNPC", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "hasNPC", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_56hasNPC(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56hasNPC(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasNPC", 0); /* "PETSc/SNES.pyx":241 * * def hasNPC(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESHasNPC(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/SNES.pyx":242 * def hasNPC(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESHasNPC(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESHasNPC(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 242, __pyx_L1_error) /* "PETSc/SNES.pyx":243 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESHasNPC(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setNPC(self, SNES snes): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":240 * return snes * * def hasNPC(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESHasNPC(self.snes, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.hasNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":245 * return toBool(flag) * * def setNPC(self, SNES snes): # <<<<<<<<<<<<<< * CHKERR( SNESSetNPC(self.snes, snes.snes) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_59setNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_58setNPC[] = "SNES.setNPC(self, SNES snes)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_59setNPC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSNESObject *__pyx_v_snes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNPC (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_snes,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_snes)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNPC") < 0)) __PYX_ERR(41, 245, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_snes = ((struct PyPetscSNESObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNPC", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 245, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_snes), __pyx_ptype_8petsc4py_5PETSc_SNES, 0, "snes", 0))) __PYX_ERR(41, 245, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_58setNPC(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_snes); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58setNPC(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESObject *__pyx_v_snes) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNPC", 0); /* "PETSc/SNES.pyx":246 * * def setNPC(self, SNES snes): * CHKERR( SNESSetNPC(self.snes, snes.snes) ) # <<<<<<<<<<<<<< * * # --- user Function/Jacobian routines --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNPC(__pyx_v_self->snes, __pyx_v_snes->snes)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 246, __pyx_L1_error) /* "PETSc/SNES.pyx":245 * return toBool(flag) * * def setNPC(self, SNES snes): # <<<<<<<<<<<<<< * CHKERR( SNESSetNPC(self.snes, snes.snes) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNPC", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":250 * # --- user Function/Jacobian routines --- * * def setLineSearchPreCheck(self, precheck, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscSNESLineSearch snesls = NULL * SNESGetLineSearch(self.snes, &snesls) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_61setLineSearchPreCheck(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_60setLineSearchPreCheck[] = "SNES.setLineSearchPreCheck(self, precheck, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_61setLineSearchPreCheck(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_precheck = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLineSearchPreCheck (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_precheck,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_precheck)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLineSearchPreCheck") < 0)) __PYX_ERR(41, 250, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_precheck = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLineSearchPreCheck", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 250, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setLineSearchPreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_60setLineSearchPreCheck(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_precheck, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60setLineSearchPreCheck(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_precheck, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { SNESLineSearch __pyx_v_snesls; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLineSearchPreCheck", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":251 * * def setLineSearchPreCheck(self, precheck, args=None, kargs=None): * cdef PetscSNESLineSearch snesls = NULL # <<<<<<<<<<<<<< * SNESGetLineSearch(self.snes, &snesls) * if precheck is not None: */ __pyx_v_snesls = NULL; /* "PETSc/SNES.pyx":252 * def setLineSearchPreCheck(self, precheck, args=None, kargs=None): * cdef PetscSNESLineSearch snesls = NULL * SNESGetLineSearch(self.snes, &snesls) # <<<<<<<<<<<<<< * if precheck is not None: * if args is None: args = () */ (void)(SNESGetLineSearch(__pyx_v_self->snes, (&__pyx_v_snesls))); /* "PETSc/SNES.pyx":253 * cdef PetscSNESLineSearch snesls = NULL * SNESGetLineSearch(self.snes, &snesls) * if precheck is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_precheck != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/SNES.pyx":254 * SNESGetLineSearch(self.snes, &snesls) * if precheck is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (precheck, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":255 * if precheck is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (precheck, args, kargs) * self.set_attr('__precheck__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":256 * if args is None: args = () * if kargs is None: kargs = {} * context = (precheck, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__precheck__', context) * CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_precheck); __Pyx_GIVEREF(__pyx_v_precheck); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_precheck); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":257 * if kargs is None: kargs = {} * context = (precheck, args, kargs) * self.set_attr('__precheck__', context) # <<<<<<<<<<<<<< * CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__precheck__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":258 * context = (precheck, args, kargs) * self.set_attr('__precheck__', context) * CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__precheck__', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetPreCheck(__pyx_v_snesls, __pyx_f_8petsc4py_5PETSc_SNES_PreCheck, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 258, __pyx_L1_error) /* "PETSc/SNES.pyx":253 * cdef PetscSNESLineSearch snesls = NULL * SNESGetLineSearch(self.snes, &snesls) * if precheck is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/SNES.pyx":260 * CHKERR( SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, context) ) * else: * self.set_attr('__precheck__', None) # <<<<<<<<<<<<<< * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__precheck__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":261 * else: * self.set_attr('__precheck__', None) * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setInitialGuess(self, initialguess, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetPreCheck(__pyx_v_snesls, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 261, __pyx_L1_error) } __pyx_L3:; /* "PETSc/SNES.pyx":250 * # --- user Function/Jacobian routines --- * * def setLineSearchPreCheck(self, precheck, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscSNESLineSearch snesls = NULL * SNESGetLineSearch(self.snes, &snesls) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setLineSearchPreCheck", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":263 * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) * * def setInitialGuess(self, initialguess, args=None, kargs=None): # <<<<<<<<<<<<<< * if initialguess is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_63setInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_62setInitialGuess[] = "SNES.setInitialGuess(self, initialguess, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_63setInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_initialguess = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialGuess (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_initialguess,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initialguess)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitialGuess") < 0)) __PYX_ERR(41, 263, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_initialguess = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialGuess", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 263, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_62setInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_initialguess, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62setInitialGuess(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_initialguess, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialGuess", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":264 * * def setInitialGuess(self, initialguess, args=None, kargs=None): * if initialguess is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_initialguess != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/SNES.pyx":265 * def setInitialGuess(self, initialguess, args=None, kargs=None): * if initialguess is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (initialguess, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":266 * if initialguess is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (initialguess, args, kargs) * self.set_attr('__initialguess__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":267 * if args is None: args = () * if kargs is None: kargs = {} * context = (initialguess, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__initialguess__', context) * CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_initialguess); __Pyx_GIVEREF(__pyx_v_initialguess); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_initialguess); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":268 * if kargs is None: kargs = {} * context = (initialguess, args, kargs) * self.set_attr('__initialguess__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__initialguess__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":269 * context = (initialguess, args, kargs) * self.set_attr('__initialguess__', context) * CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, context) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__initialguess__', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetComputeInitialGuess(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_InitialGuess, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 269, __pyx_L1_error) /* "PETSc/SNES.pyx":264 * * def setInitialGuess(self, initialguess, args=None, kargs=None): * if initialguess is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/SNES.pyx":271 * CHKERR( SNESSetInitialGuess(self.snes, SNES_InitialGuess, context) ) * else: * self.set_attr('__initialguess__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) ) * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__initialguess__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":272 * else: * self.set_attr('__initialguess__', None) * CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getInitialGuess(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetComputeInitialGuess(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 272, __pyx_L1_error) } __pyx_L3:; /* "PETSc/SNES.pyx":263 * CHKERR( SNESLineSearchSetPreCheck(snesls, NULL, NULL) ) * * def setInitialGuess(self, initialguess, args=None, kargs=None): # <<<<<<<<<<<<<< * if initialguess is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":274 * CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) ) * * def getInitialGuess(self): # <<<<<<<<<<<<<< * return self.get_attr('__initialguess__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_64getInitialGuess[] = "SNES.getInitialGuess(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getInitialGuess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInitialGuess (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInitialGuess", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInitialGuess", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_64getInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getInitialGuess(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInitialGuess", 0); /* "PETSc/SNES.pyx":275 * * def getInitialGuess(self): * return self.get_attr('__initialguess__') # <<<<<<<<<<<<<< * * def setFunction(self, function, Vec f, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__initialguess__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":274 * CHKERR( SNESSetInitialGuess(self.snes, NULL, NULL) ) * * def getInitialGuess(self): # <<<<<<<<<<<<<< * return self.get_attr('__initialguess__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getInitialGuess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":277 * return self.get_attr('__initialguess__') * * def setFunction(self, function, Vec f, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_67setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_66setFunction[] = "SNES.setFunction(self, function, Vec f, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_67setFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFunction", 0, 2, 4, 1); __PYX_ERR(41, 277, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFunction") < 0)) __PYX_ERR(41, 277, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFunction", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(41, 277, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_66setFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66setFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":278 * * def setFunction(self, function, Vec f, args=None, kargs=None): * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "PETSc/SNES.pyx":279 * def setFunction(self, function, Vec f, args=None, kargs=None): * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_3; } /* "PETSc/SNES.pyx":280 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_function != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/SNES.pyx":281 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":282 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__function__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/SNES.pyx":283 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__function__', context) * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/SNES.pyx":284 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__function__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/SNES.pyx":285 * context = (function, args, kargs) * self.set_attr('__function__', context) * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFunction(__pyx_v_self->snes, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_SNES_Function, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(41, 285, __pyx_L1_error) /* "PETSc/SNES.pyx":280 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "PETSc/SNES.pyx":287 * CHKERR( SNESSetFunction(self.snes, fvec, SNES_Function, context) ) * else: * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getFunction(self): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFunction(__pyx_v_self->snes, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(41, 287, __pyx_L1_error) } __pyx_L4:; /* "PETSc/SNES.pyx":277 * return self.get_attr('__initialguess__') * * def setFunction(self, function, Vec f, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":289 * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) * * def getFunction(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * cdef void* ctx */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_68getFunction[] = "SNES.getFunction(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69getFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunction (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFunction", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_68getFunction(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68getFunction(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; void *__pyx_v_ctx; int (*__pyx_v_fun)(SNES, Vec, Vec, void *); PyObject *__pyx_v_function = 0; PyObject *__pyx_v_context = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunction", 0); /* "PETSc/SNES.pyx":290 * * def getFunction(self): * cdef Vec f = Vec() # <<<<<<<<<<<<<< * cdef void* ctx * cdef int (*fun)(PetscSNES,PetscVec,PetscVec,void*) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":293 * cdef void* ctx * cdef int (*fun)(PetscSNES,PetscVec,PetscVec,void*) * CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) # <<<<<<<<<<<<<< * PetscINCREF(f.obj) * cdef object function = self.get_attr('__function__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetFunction(__pyx_v_self->snes, (&__pyx_v_f->vec), (&__pyx_v_fun), (&__pyx_v_ctx))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 293, __pyx_L1_error) /* "PETSc/SNES.pyx":294 * cdef int (*fun)(PetscSNES,PetscVec,PetscVec,void*) * CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) * PetscINCREF(f.obj) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__function__') * cdef object context */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); /* "PETSc/SNES.pyx":295 * CHKERR( SNESGetFunction(self.snes, &f.vec, &fun, &ctx) ) * PetscINCREF(f.obj) * cdef object function = self.get_attr('__function__') # <<<<<<<<<<<<<< * cdef object context * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/SNES.pyx":298 * cdef object context * * if function is not None: # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_3 = (__pyx_v_function != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/SNES.pyx":299 * * if function is not None: * return (f, function) # <<<<<<<<<<<<<< * * if ctx != NULL and SNES_Function == fun: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":298 * cdef object context * * if function is not None: # <<<<<<<<<<<<<< * return (f, function) * */ } /* "PETSc/SNES.pyx":301 * return (f, function) * * if ctx != NULL and SNES_Function == fun: # <<<<<<<<<<<<<< * context = ctx * if context is not None: */ __pyx_t_3 = ((__pyx_v_ctx != NULL) != 0); if (__pyx_t_3) { } else { __pyx_t_4 = __pyx_t_3; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = ((((void *)__pyx_f_8petsc4py_5PETSc_SNES_Function) == ((void *)__pyx_v_fun)) != 0); __pyx_t_4 = __pyx_t_3; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { /* "PETSc/SNES.pyx":302 * * if ctx != NULL and SNES_Function == fun: * context = ctx # <<<<<<<<<<<<<< * if context is not None: * assert type(context) is tuple */ __pyx_t_1 = ((PyObject *)__pyx_v_ctx); __Pyx_INCREF(__pyx_t_1); __pyx_v_context = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/SNES.pyx":303 * if ctx != NULL and SNES_Function == fun: * context = ctx * if context is not None: # <<<<<<<<<<<<<< * assert type(context) is tuple * return (f, context) */ __pyx_t_4 = (__pyx_v_context != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "PETSc/SNES.pyx":304 * context = ctx * if context is not None: * assert type(context) is tuple # <<<<<<<<<<<<<< * return (f, context) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type))); if (unlikely(!(__pyx_t_3 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(41, 304, __pyx_L1_error) } } #endif /* "PETSc/SNES.pyx":305 * if context is not None: * assert type(context) is tuple * return (f, context) # <<<<<<<<<<<<<< * * return (f, None) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); __Pyx_INCREF(__pyx_v_context); __Pyx_GIVEREF(__pyx_v_context); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_context); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":303 * if ctx != NULL and SNES_Function == fun: * context = ctx * if context is not None: # <<<<<<<<<<<<<< * assert type(context) is tuple * return (f, context) */ } /* "PETSc/SNES.pyx":301 * return (f, function) * * if ctx != NULL and SNES_Function == fun: # <<<<<<<<<<<<<< * context = ctx * if context is not None: */ } /* "PETSc/SNES.pyx":307 * return (f, context) * * return (f, None) # <<<<<<<<<<<<<< * * def setUpdate(self, update, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":289 * CHKERR( SNESSetFunction(self.snes, fvec, NULL, NULL) ) * * def getFunction(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * cdef void* ctx */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XDECREF(__pyx_v_context); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":309 * return (f, None) * * def setUpdate(self, update, args=None, kargs=None): # <<<<<<<<<<<<<< * if update is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_71setUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_70setUpdate[] = "SNES.setUpdate(self, update, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_71setUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_update = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUpdate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_update,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_update)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUpdate") < 0)) __PYX_ERR(41, 309, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_update = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUpdate", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 309, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_70setUpdate(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_update, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70setUpdate(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_update, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUpdate", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":310 * * def setUpdate(self, update, args=None, kargs=None): * if update is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_update != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/SNES.pyx":311 * def setUpdate(self, update, args=None, kargs=None): * if update is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (update, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":312 * if update is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (update, args, kargs) * self.set_attr('__update__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":313 * if args is None: args = () * if kargs is None: kargs = {} * context = (update, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__update__', context) * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_update); __Pyx_GIVEREF(__pyx_v_update); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_update); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":314 * if kargs is None: kargs = {} * context = (update, args, kargs) * self.set_attr('__update__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":315 * context = (update, args, kargs) * self.set_attr('__update__', context) * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__update__', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUpdate(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Update)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 315, __pyx_L1_error) /* "PETSc/SNES.pyx":310 * * def setUpdate(self, update, args=None, kargs=None): * if update is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/SNES.pyx":317 * CHKERR( SNESSetUpdate(self.snes, SNES_Update) ) * else: * self.set_attr('__update__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetUpdate(self.snes, NULL) ) * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":318 * else: * self.set_attr('__update__', None) * CHKERR( SNESSetUpdate(self.snes, NULL) ) # <<<<<<<<<<<<<< * * def getUpdate(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUpdate(__pyx_v_self->snes, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 318, __pyx_L1_error) } __pyx_L3:; /* "PETSc/SNES.pyx":309 * return (f, None) * * def setUpdate(self, update, args=None, kargs=None): # <<<<<<<<<<<<<< * if update is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":320 * CHKERR( SNESSetUpdate(self.snes, NULL) ) * * def getUpdate(self): # <<<<<<<<<<<<<< * return self.get_attr('__update__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73getUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_72getUpdate[] = "SNES.getUpdate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73getUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUpdate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getUpdate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUpdate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_72getUpdate(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72getUpdate(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUpdate", 0); /* "PETSc/SNES.pyx":321 * * def getUpdate(self): * return self.get_attr('__update__') # <<<<<<<<<<<<<< * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__update__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":320 * CHKERR( SNESSetUpdate(self.snes, NULL) ) * * def getUpdate(self): # <<<<<<<<<<<<<< * return self.get_attr('__update__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":323 * return self.get_attr('__update__') * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75setJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_74setJacobian[] = "SNES.setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75setJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setJacobian") < 0)) __PYX_ERR(41, 323, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobian", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 323, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(41, 323, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(41, 323, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_74setJacobian(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74setJacobian(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":324 * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "PETSc/SNES.pyx":325 * def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/SNES.pyx":326 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "PETSc/SNES.pyx":327 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/SNES.pyx":328 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/SNES.pyx":329 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":330 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/SNES.pyx":331 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__jacobian__', context) * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/SNES.pyx":332 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/SNES.pyx":333 * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetJacobian(__pyx_v_self->snes, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_SNES_Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(41, 333, __pyx_L1_error) /* "PETSc/SNES.pyx":328 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "PETSc/SNES.pyx":335 * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, context) ) * else: * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getJacobian(self): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetJacobian(__pyx_v_self->snes, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(41, 335, __pyx_L1_error) } __pyx_L5:; /* "PETSc/SNES.pyx":323 * return self.get_attr('__update__') * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":337 * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) * * def getJacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat() * cdef Mat P = Mat() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77getJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_76getJacobian[] = "SNES.getJacobian(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77getJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getJacobian (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getJacobian", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getJacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_76getJacobian(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_76getJacobian(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getJacobian", 0); /* "PETSc/SNES.pyx":338 * * def getJacobian(self): * cdef Mat J = Mat() # <<<<<<<<<<<<<< * cdef Mat P = Mat() * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":339 * def getJacobian(self): * cdef Mat J = Mat() * cdef Mat P = Mat() # <<<<<<<<<<<<<< * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":340 * cdef Mat J = Mat() * cdef Mat P = Mat() * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * PetscINCREF(J.obj) * PetscINCREF(P.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetJacobian(__pyx_v_self->snes, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 340, __pyx_L1_error) /* "PETSc/SNES.pyx":341 * cdef Mat P = Mat() * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj) # <<<<<<<<<<<<<< * PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__jacobian__') */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); /* "PETSc/SNES.pyx":342 * CHKERR( SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj) * PetscINCREF(P.obj) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__jacobian__') * return (J, P, jacobian) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); /* "PETSc/SNES.pyx":343 * PetscINCREF(J.obj) * PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__jacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/SNES.pyx":344 * PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__jacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * def setObjective(self, objective, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P)); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":337 * CHKERR( SNESSetJacobian(self.snes, Jmat, Pmat, NULL, NULL) ) * * def getJacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat() * cdef Mat P = Mat() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":346 * return (J, P, jacobian) * * def setObjective(self, objective, args=None, kargs=None): # <<<<<<<<<<<<<< * if objective is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_79setObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_78setObjective[] = "SNES.setObjective(self, objective, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_79setObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objective = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjective (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objective,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objective)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setObjective") < 0)) __PYX_ERR(41, 346, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objective = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 346, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_78setObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_objective, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_78setObjective(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjective", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":347 * * def setObjective(self, objective, args=None, kargs=None): * if objective is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_objective != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/SNES.pyx":348 * def setObjective(self, objective, args=None, kargs=None): * if objective is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objective, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":349 * if objective is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objective, args, kargs) * self.set_attr('__objective__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":350 * if args is None: args = () * if kargs is None: kargs = {} * context = (objective, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__objective__', context) * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_objective); __Pyx_GIVEREF(__pyx_v_objective); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objective); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":351 * if kargs is None: kargs = {} * context = (objective, args, kargs) * self.set_attr('__objective__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objective__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":352 * context = (objective, args, kargs) * self.set_attr('__objective__', context) * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetObjective(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Objective, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 352, __pyx_L1_error) /* "PETSc/SNES.pyx":347 * * def setObjective(self, objective, args=None, kargs=None): * if objective is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/SNES.pyx":354 * CHKERR( SNESSetObjective(self.snes, SNES_Objective, context) ) * else: * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * * def getObjective(self): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetObjective(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 354, __pyx_L1_error) } __pyx_L3:; /* "PETSc/SNES.pyx":346 * return (J, P, jacobian) * * def setObjective(self, objective, args=None, kargs=None): # <<<<<<<<<<<<<< * if objective is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":356 * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) * * def getObjective(self): # <<<<<<<<<<<<<< * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) * cdef object objective = self.get_attr('__objective__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81getObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_80getObjective[] = "SNES.getObjective(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81getObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getObjective (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getObjective", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getObjective", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_80getObjective(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80getObjective(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_v_objective = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getObjective", 0); /* "PETSc/SNES.pyx":357 * * def getObjective(self): * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * cdef object objective = self.get_attr('__objective__') * return objective */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetObjective(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 357, __pyx_L1_error) /* "PETSc/SNES.pyx":358 * def getObjective(self): * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) * cdef object objective = self.get_attr('__objective__') # <<<<<<<<<<<<<< * return objective * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objective__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_objective = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/SNES.pyx":359 * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) * cdef object objective = self.get_attr('__objective__') * return objective # <<<<<<<<<<<<<< * * def computeFunction(self, Vec x, Vec f): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_objective); __pyx_r = __pyx_v_objective; goto __pyx_L0; /* "PETSc/SNES.pyx":356 * CHKERR( SNESSetObjective(self.snes, NULL, NULL) ) * * def getObjective(self): # <<<<<<<<<<<<<< * CHKERR( SNESGetObjective(self.snes, NULL, NULL) ) * cdef object objective = self.get_attr('__objective__') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_objective); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":361 * return objective * * def computeFunction(self, Vec x, Vec f): # <<<<<<<<<<<<<< * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_83computeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_82computeFunction[] = "SNES.computeFunction(self, Vec x, Vec f)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_83computeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_f,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeFunction", 1, 2, 2, 1); __PYX_ERR(41, 361, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeFunction") < 0)) __PYX_ERR(41, 361, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_f = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeFunction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 361, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 361, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(41, 361, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_82computeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_82computeFunction(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeFunction", 0); /* "PETSc/SNES.pyx":362 * * def computeFunction(self, Vec x, Vec f): * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) # <<<<<<<<<<<<<< * * def computeJacobian(self, Vec x, Mat J, Mat P=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeFunction(__pyx_v_self->snes, __pyx_v_x->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 362, __pyx_L1_error) /* "PETSc/SNES.pyx":361 * return objective * * def computeFunction(self, Vec x, Vec f): # <<<<<<<<<<<<<< * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":364 * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85computeJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_84computeJacobian[] = "SNES.computeJacobian(self, Vec x, Mat J, Mat P=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85computeJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, 1); __PYX_ERR(41, 364, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeJacobian") < 0)) __PYX_ERR(41, 364, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 364, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 364, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(41, 364, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(41, 364, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_84computeJacobian(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84computeJacobian(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeJacobian", 0); /* "PETSc/SNES.pyx":365 * * def computeJacobian(self, Vec x, Mat J, Mat P=None): * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) */ __pyx_t_1 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_1; __pyx_t_1 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_1; /* "PETSc/SNES.pyx":366 * def computeJacobian(self, Vec x, Mat J, Mat P=None): * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_1; } /* "PETSc/SNES.pyx":367 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) # <<<<<<<<<<<<<< * * def computeObjective(self, Vec x): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeJacobian(__pyx_v_self->snes, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 367, __pyx_L1_error) /* "PETSc/SNES.pyx":364 * CHKERR( SNESComputeFunction(self.snes, x.vec, f.vec) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":369 * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) * * def computeObjective(self, Vec x): # <<<<<<<<<<<<<< * cdef PetscReal o = 0 * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_87computeObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_86computeObjective[] = "SNES.computeObjective(self, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_87computeObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeObjective (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeObjective") < 0)) __PYX_ERR(41, 369, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeObjective", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 369, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 369, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_86computeObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_86computeObjective(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PetscReal __pyx_v_o; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeObjective", 0); /* "PETSc/SNES.pyx":370 * * def computeObjective(self, Vec x): * cdef PetscReal o = 0 # <<<<<<<<<<<<<< * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) * return toReal(o) */ __pyx_v_o = 0.0; /* "PETSc/SNES.pyx":371 * def computeObjective(self, Vec x): * cdef PetscReal o = 0 * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) # <<<<<<<<<<<<<< * return toReal(o) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeObjective(__pyx_v_self->snes, __pyx_v_x->vec, (&__pyx_v_o))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 371, __pyx_L1_error) /* "PETSc/SNES.pyx":372 * cdef PetscReal o = 0 * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) * return toReal(o) # <<<<<<<<<<<<<< * * def setNGS(self, ngs, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_o); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":369 * CHKERR( SNESComputeJacobian(self.snes, x.vec, jmat, pmat) ) * * def computeObjective(self, Vec x): # <<<<<<<<<<<<<< * cdef PetscReal o = 0 * CHKERR( SNESComputeObjective(self.snes, x.vec, &o) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":374 * return toReal(o) * * def setNGS(self, ngs, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89setNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_88setNGS[] = "SNES.setNGS(self, ngs, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89setNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ngs = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNGS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ngs,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ngs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNGS") < 0)) __PYX_ERR(41, 374, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_ngs = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNGS", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 374, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_88setNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ngs, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88setNGS(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_ngs, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNGS", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":375 * * def setNGS(self, ngs, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (ngs, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":376 * def setNGS(self, ngs, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (ngs, args, kargs) * self.set_attr('__ngs__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":377 * if args is None: args = () * if kargs is None: kargs = {} * context = (ngs, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ngs__', context) * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_ngs); __Pyx_GIVEREF(__pyx_v_ngs); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ngs); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":378 * if kargs is None: kargs = {} * context = (ngs, args, kargs) * self.set_attr('__ngs__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ngs__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":379 * context = (ngs, args, kargs) * self.set_attr('__ngs__', context) * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) # <<<<<<<<<<<<<< * * def getNGS(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNGS(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_NGS, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 379, __pyx_L1_error) /* "PETSc/SNES.pyx":374 * return toReal(o) * * def setNGS(self, ngs, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":381 * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) * * def getNGS(self): # <<<<<<<<<<<<<< * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) * cdef object ngs = self.get_attr('__ngs__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_91getNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_90getNGS[] = "SNES.getNGS(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_91getNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNGS (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNGS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNGS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_90getNGS(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_90getNGS(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_v_ngs = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNGS", 0); /* "PETSc/SNES.pyx":382 * * def getNGS(self): * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) # <<<<<<<<<<<<<< * cdef object ngs = self.get_attr('__ngs__') * return ngs */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNGS(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 382, __pyx_L1_error) /* "PETSc/SNES.pyx":383 * def getNGS(self): * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) * cdef object ngs = self.get_attr('__ngs__') # <<<<<<<<<<<<<< * return ngs * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ngs__")); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ngs = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/SNES.pyx":384 * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) * cdef object ngs = self.get_attr('__ngs__') * return ngs # <<<<<<<<<<<<<< * * def computeNGS(self, Vec x, Vec b=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ngs); __pyx_r = __pyx_v_ngs; goto __pyx_L0; /* "PETSc/SNES.pyx":381 * CHKERR( SNESSetNGS(self.snes, SNES_NGS, context) ) * * def getNGS(self): # <<<<<<<<<<<<<< * CHKERR( SNESGetNGS(self.snes, NULL, NULL) ) * cdef object ngs = self.get_attr('__ngs__') */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ngs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":386 * return ngs * * def computeNGS(self, Vec x, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscVec bvec = NULL * if b is not None: bvec = b.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93computeNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_92computeNGS[] = "SNES.computeNGS(self, Vec x, Vec b=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93computeNGS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_b = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeNGS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_b,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeNGS") < 0)) __PYX_ERR(41, 386, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_b = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeNGS", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 386, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 386, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(41, 386, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_92computeNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_b); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92computeNGS(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b) { Vec __pyx_v_bvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeNGS", 0); /* "PETSc/SNES.pyx":387 * * def computeNGS(self, Vec x, Vec b=None): * cdef PetscVec bvec = NULL # <<<<<<<<<<<<<< * if b is not None: bvec = b.vec * CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) */ __pyx_v_bvec = NULL; /* "PETSc/SNES.pyx":388 * def computeNGS(self, Vec x, Vec b=None): * cdef PetscVec bvec = NULL * if b is not None: bvec = b.vec # <<<<<<<<<<<<<< * CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_b) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_b->vec; __pyx_v_bvec = __pyx_t_3; } /* "PETSc/SNES.pyx":389 * cdef PetscVec bvec = NULL * if b is not None: bvec = b.vec * CHKERR( SNESComputeNGS(self.snes, bvec, x.vec) ) # <<<<<<<<<<<<<< * * # --- tolerances and convergence --- */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESComputeNGS(__pyx_v_self->snes, __pyx_v_bvec, __pyx_v_x->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 389, __pyx_L1_error) /* "PETSc/SNES.pyx":386 * return ngs * * def computeNGS(self, Vec x, Vec b=None): # <<<<<<<<<<<<<< * cdef PetscVec bvec = NULL * if b is not None: bvec = b.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.computeNGS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":393 * # --- tolerances and convergence --- * * def setTolerances(self, rtol=None, atol=None, stol=None, max_it=None): # <<<<<<<<<<<<<< * cdef PetscReal crtol, catol, cstol * crtol = catol = cstol = PETSC_DEFAULT */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_94setTolerances[] = "SNES.setTolerances(self, rtol=None, atol=None, stol=None, max_it=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; PyObject *__pyx_v_stol = 0; PyObject *__pyx_v_max_it = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,&__pyx_n_s_stol,&__pyx_n_s_max_it,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stol); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_it); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTolerances") < 0)) __PYX_ERR(41, 393, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rtol = values[0]; __pyx_v_atol = values[1]; __pyx_v_stol = values[2]; __pyx_v_max_it = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 393, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_94setTolerances(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol, __pyx_v_stol, __pyx_v_max_it); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_94setTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_stol, PyObject *__pyx_v_max_it) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cstol; PetscInt __pyx_v_cmaxit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 0); /* "PETSc/SNES.pyx":395 * def setTolerances(self, rtol=None, atol=None, stol=None, max_it=None): * cdef PetscReal crtol, catol, cstol * crtol = catol = cstol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt cmaxit = PETSC_DEFAULT * if rtol is not None: crtol = asReal(rtol) */ __pyx_v_crtol = PETSC_DEFAULT; __pyx_v_catol = PETSC_DEFAULT; __pyx_v_cstol = PETSC_DEFAULT; /* "PETSc/SNES.pyx":396 * cdef PetscReal crtol, catol, cstol * crtol = catol = cstol = PETSC_DEFAULT * cdef PetscInt cmaxit = PETSC_DEFAULT # <<<<<<<<<<<<<< * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) */ __pyx_v_cmaxit = PETSC_DEFAULT; /* "PETSc/SNES.pyx":397 * crtol = catol = cstol = PETSC_DEFAULT * cdef PetscInt cmaxit = PETSC_DEFAULT * if rtol is not None: crtol = asReal(rtol) # <<<<<<<<<<<<<< * if atol is not None: catol = asReal(atol) * if stol is not None: cstol = asReal(stol) */ __pyx_t_1 = (__pyx_v_rtol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 397, __pyx_L1_error) __pyx_v_crtol = __pyx_t_3; } /* "PETSc/SNES.pyx":398 * cdef PetscInt cmaxit = PETSC_DEFAULT * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) # <<<<<<<<<<<<<< * if stol is not None: cstol = asReal(stol) * if max_it is not None: cmaxit = asInt(max_it) */ __pyx_t_2 = (__pyx_v_atol != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 398, __pyx_L1_error) __pyx_v_catol = __pyx_t_3; } /* "PETSc/SNES.pyx":399 * if rtol is not None: crtol = asReal(rtol) * if atol is not None: catol = asReal(atol) * if stol is not None: cstol = asReal(stol) # <<<<<<<<<<<<<< * if max_it is not None: cmaxit = asInt(max_it) * CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, */ __pyx_t_1 = (__pyx_v_stol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_stol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 399, __pyx_L1_error) __pyx_v_cstol = __pyx_t_3; } /* "PETSc/SNES.pyx":400 * if atol is not None: catol = asReal(atol) * if stol is not None: cstol = asReal(stol) * if max_it is not None: cmaxit = asInt(max_it) # <<<<<<<<<<<<<< * CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, * cmaxit, PETSC_DEFAULT) ) */ __pyx_t_2 = (__pyx_v_max_it != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_it); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 400, __pyx_L1_error) __pyx_v_cmaxit = __pyx_t_4; } /* "PETSc/SNES.pyx":401 * if stol is not None: cstol = asReal(stol) * if max_it is not None: cmaxit = asInt(max_it) * CHKERR( SNESSetTolerances(self.snes, catol, crtol, cstol, # <<<<<<<<<<<<<< * cmaxit, PETSC_DEFAULT) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetTolerances(__pyx_v_self->snes, __pyx_v_catol, __pyx_v_crtol, __pyx_v_cstol, __pyx_v_cmaxit, PETSC_DEFAULT)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(41, 401, __pyx_L1_error) /* "PETSc/SNES.pyx":393 * # --- tolerances and convergence --- * * def setTolerances(self, rtol=None, atol=None, stol=None, max_it=None): # <<<<<<<<<<<<<< * cdef PetscReal crtol, catol, cstol * crtol = catol = cstol = PETSC_DEFAULT */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":404 * cmaxit, PETSC_DEFAULT) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * cdef PetscReal crtol=0, catol=0, cstol=0 * cdef PetscInt cmaxit=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_96getTolerances[] = "SNES.getTolerances(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_96getTolerances(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96getTolerances(struct PyPetscSNESObject *__pyx_v_self) { PetscReal __pyx_v_crtol; PetscReal __pyx_v_catol; PetscReal __pyx_v_cstol; PetscInt __pyx_v_cmaxit; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 0); /* "PETSc/SNES.pyx":405 * * def getTolerances(self): * cdef PetscReal crtol=0, catol=0, cstol=0 # <<<<<<<<<<<<<< * cdef PetscInt cmaxit=0 * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, */ __pyx_v_crtol = 0.0; __pyx_v_catol = 0.0; __pyx_v_cstol = 0.0; /* "PETSc/SNES.pyx":406 * def getTolerances(self): * cdef PetscReal crtol=0, catol=0, cstol=0 * cdef PetscInt cmaxit=0 # <<<<<<<<<<<<<< * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, * &cmaxit, NULL) ) */ __pyx_v_cmaxit = 0; /* "PETSc/SNES.pyx":407 * cdef PetscReal crtol=0, catol=0, cstol=0 * cdef PetscInt cmaxit=0 * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, # <<<<<<<<<<<<<< * &cmaxit, NULL) ) * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetTolerances(__pyx_v_self->snes, (&__pyx_v_catol), (&__pyx_v_crtol), (&__pyx_v_cstol), (&__pyx_v_cmaxit), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 407, __pyx_L1_error) /* "PETSc/SNES.pyx":409 * CHKERR( SNESGetTolerances(self.snes, &catol, &crtol, &cstol, * &cmaxit, NULL) ) * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) # <<<<<<<<<<<<<< * * def setNormSchedule(self, normsched): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_crtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_catol); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cstol); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cmaxit); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":404 * cmaxit, PETSC_DEFAULT) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * cdef PetscReal crtol=0, catol=0, cstol=0 * cdef PetscInt cmaxit=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":411 * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) * * def setNormSchedule(self, normsched): # <<<<<<<<<<<<<< * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_99setNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_98setNormSchedule[] = "SNES.setNormSchedule(self, normsched)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_99setNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_normsched = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNormSchedule (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_normsched,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_normsched)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNormSchedule") < 0)) __PYX_ERR(41, 411, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_normsched = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNormSchedule", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 411, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNormSchedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_98setNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_normsched); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98setNormSchedule(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_normsched) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SNESNormSchedule __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNormSchedule", 0); /* "PETSc/SNES.pyx":412 * * def setNormSchedule(self, normsched): * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) # <<<<<<<<<<<<<< * * def getNormSchedule(self): */ __pyx_t_1 = ((SNESNormSchedule)__Pyx_PyInt_As_SNESNormSchedule(__pyx_v_normsched)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 412, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNormSchedule(__pyx_v_self->snes, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 412, __pyx_L1_error) /* "PETSc/SNES.pyx":411 * return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit)) * * def setNormSchedule(self, normsched): # <<<<<<<<<<<<<< * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNormSchedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":414 * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) * * def getNormSchedule(self): # <<<<<<<<<<<<<< * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_101getNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_100getNormSchedule[] = "SNES.getNormSchedule(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_101getNormSchedule(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNormSchedule (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNormSchedule", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNormSchedule", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_100getNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_100getNormSchedule(struct PyPetscSNESObject *__pyx_v_self) { SNESNormSchedule __pyx_v_normsched; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNormSchedule", 0); /* "PETSc/SNES.pyx":415 * * def getNormSchedule(self): * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE # <<<<<<<<<<<<<< * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) * return normsched */ __pyx_v_normsched = SNES_NORM_NONE; /* "PETSc/SNES.pyx":416 * def getNormSchedule(self): * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) # <<<<<<<<<<<<<< * return normsched * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNormSchedule(__pyx_v_self->snes, (&__pyx_v_normsched))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 416, __pyx_L1_error) /* "PETSc/SNES.pyx":417 * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) * return normsched # <<<<<<<<<<<<<< * * def setConvergenceTest(self, converged, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_SNESNormSchedule(__pyx_v_normsched); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":414 * CHKERR( SNESSetNormSchedule(self.snes, normsched) ) * * def getNormSchedule(self): # <<<<<<<<<<<<<< * cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE * CHKERR( SNESGetNormSchedule(self.snes, &normsched) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNormSchedule", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":419 * return normsched * * def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<< * if converged == "skip": * self.set_attr('__converged__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_102setConvergenceTest[] = "SNES.setConvergenceTest(self, converged, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_converged = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceTest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_converged)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceTest") < 0)) __PYX_ERR(41, 419, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_converged = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 419, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_102setConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102setConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceTest", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":420 * * def setConvergenceTest(self, converged, args=None, kargs=None): * if converged == "skip": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) */ __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_converged, __pyx_n_s_skip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(41, 420, __pyx_L1_error) if (__pyx_t_1) { /* "PETSc/SNES.pyx":421 * def setConvergenceTest(self, converged, args=None, kargs=None): * if converged == "skip": * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":422 * if converged == "skip": * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) # <<<<<<<<<<<<<< * elif converged is None or converged == "default": * self.set_attr('__converged__', None) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceTest(__pyx_v_self->snes, SNESConvergedSkip, NULL, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 422, __pyx_L1_error) /* "PETSc/SNES.pyx":420 * * def setConvergenceTest(self, converged, args=None, kargs=None): * if converged == "skip": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) */ goto __pyx_L3; } /* "PETSc/SNES.pyx":423 * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) */ __pyx_t_4 = (__pyx_v_converged == Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (!__pyx_t_5) { } else { __pyx_t_1 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_converged, __pyx_n_s_default, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(41, 423, __pyx_L1_error) __pyx_t_1 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/SNES.pyx":424 * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) * else: */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":425 * elif converged is None or converged == "default": * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) # <<<<<<<<<<<<<< * else: * assert callable(converged) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceTest(__pyx_v_self->snes, SNESConvergedDefault, NULL, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 425, __pyx_L1_error) /* "PETSc/SNES.pyx":423 * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL) ) * elif converged is None or converged == "default": # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) */ goto __pyx_L3; } /* "PETSc/SNES.pyx":427 * CHKERR( SNESSetConvergenceTest(self.snes, SNESConvergedDefault, NULL, NULL) ) * else: * assert callable(converged) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_converged); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 427, __pyx_L1_error) if (unlikely(!(__pyx_t_1 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(41, 427, __pyx_L1_error) } } #endif /* "PETSc/SNES.pyx":428 * else: * assert callable(converged) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (converged, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":429 * assert callable(converged) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (converged, args, kargs) * self.set_attr('__converged__', context) */ __pyx_t_5 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_5 != 0); if (__pyx_t_1) { __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/SNES.pyx":430 * if args is None: args = () * if kargs is None: kargs = {} * context = (converged, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__converged__', context) * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) */ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_converged); __Pyx_GIVEREF(__pyx_v_converged); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_converged); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":431 * if kargs is None: kargs = {} * context = (converged, args, kargs) * self.set_attr('__converged__', context) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) * */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":432 * context = (converged, args, kargs) * self.set_attr('__converged__', context) * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) # <<<<<<<<<<<<<< * * def getConvergenceTest(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceTest(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Converged, ((void *)__pyx_v_context), NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 432, __pyx_L1_error) } __pyx_L3:; /* "PETSc/SNES.pyx":419 * return normsched * * def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<< * if converged == "skip": * self.set_attr('__converged__', None) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":434 * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) * * def getConvergenceTest(self): # <<<<<<<<<<<<<< * return self.get_attr('__converged__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_104getConvergenceTest[] = "SNES.getConvergenceTest(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_104getConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_104getConvergenceTest(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceTest", 0); /* "PETSc/SNES.pyx":435 * * def getConvergenceTest(self): * return self.get_attr('__converged__') # <<<<<<<<<<<<<< * * def callConvergenceTest(self, its, xnorm, ynorm, fnorm): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":434 * CHKERR( SNESSetConvergenceTest(self.snes, SNES_Converged, context, NULL) ) * * def getConvergenceTest(self): # <<<<<<<<<<<<<< * return self.get_attr('__converged__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":437 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its, xnorm, ynorm, fnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_107callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_106callConvergenceTest[] = "SNES.callConvergenceTest(self, its, xnorm, ynorm, fnorm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_107callConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_xnorm = 0; PyObject *__pyx_v_ynorm = 0; PyObject *__pyx_v_fnorm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("callConvergenceTest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_xnorm,&__pyx_n_s_ynorm,&__pyx_n_s_fnorm,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xnorm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 1); __PYX_ERR(41, 437, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ynorm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 2); __PYX_ERR(41, 437, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fnorm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, 3); __PYX_ERR(41, 437, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "callConvergenceTest") < 0)) __PYX_ERR(41, 437, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_its = values[0]; __pyx_v_xnorm = values[1]; __pyx_v_ynorm = values[2]; __pyx_v_fnorm = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 437, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_106callConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106callConvergenceTest(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_xnorm, PyObject *__pyx_v_ynorm, PyObject *__pyx_v_fnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; SNESConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("callConvergenceTest", 0); /* "PETSc/SNES.pyx":438 * * def callConvergenceTest(self, its, xnorm, ynorm, fnorm): * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 438, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/SNES.pyx":439 * def callConvergenceTest(self, its, xnorm, ynorm, fnorm): * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 439, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_2; /* "PETSc/SNES.pyx":440 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) # <<<<<<<<<<<<<< * cdef PetscReal rval3 = asReal(fnorm) * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ynorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 440, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_2; /* "PETSc/SNES.pyx":441 * cdef PetscReal rval1 = asReal(xnorm) * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) # <<<<<<<<<<<<<< * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESConvergenceTestCall(self.snes, ival, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 441, __pyx_L1_error) __pyx_v_rval3 = __pyx_t_2; /* "PETSc/SNES.pyx":442 * cdef PetscReal rval2 = asReal(ynorm) * cdef PetscReal rval3 = asReal(fnorm) * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( SNESConvergenceTestCall(self.snes, ival, * rval1, rval2, rval3, &reason) ) */ __pyx_v_reason = SNES_CONVERGED_ITERATING; /* "PETSc/SNES.pyx":443 * cdef PetscReal rval3 = asReal(fnorm) * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESConvergenceTestCall(self.snes, ival, # <<<<<<<<<<<<<< * rval1, rval2, rval3, &reason) ) * return reason */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESConvergenceTestCall(__pyx_v_self->snes, __pyx_v_ival, __pyx_v_rval1, __pyx_v_rval2, __pyx_v_rval3, (&__pyx_v_reason))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 443, __pyx_L1_error) /* "PETSc/SNES.pyx":445 * CHKERR( SNESConvergenceTestCall(self.snes, ival, * rval1, rval2, rval3, &reason) ) * return reason # <<<<<<<<<<<<<< * * def setConvergenceHistory(self, length=None, reset=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyInt_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":437 * return self.get_attr('__converged__') * * def callConvergenceTest(self, its, xnorm, ynorm, fnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval1 = asReal(xnorm) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.SNES.callConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":447 * return reason * * def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<< * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_108setConvergenceHistory[] = "SNES.setConvergenceHistory(self, length=None, reset=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_length = 0; PyObject *__pyx_v_reset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceHistory (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_length,&__pyx_n_s_reset,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_length); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reset); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceHistory") < 0)) __PYX_ERR(41, 447, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_length = values[0]; __pyx_v_reset = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceHistory", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 447, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset) { PetscReal *__pyx_v_rdata; PetscInt *__pyx_v_idata; PetscInt __pyx_v_size; PetscBool __pyx_v_flag; PyObject *__pyx_v_rhist = 0; PyObject *__pyx_v_ihist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceHistory", 0); /* "PETSc/SNES.pyx":448 * * def setConvergenceHistory(self, length=None, reset=False): * cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<< * cdef PetscInt *idata = NULL * cdef PetscInt size = 1000 */ __pyx_v_rdata = NULL; /* "PETSc/SNES.pyx":449 * def setConvergenceHistory(self, length=None, reset=False): * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 1000 * cdef PetscBool flag = PETSC_FALSE */ __pyx_v_idata = NULL; /* "PETSc/SNES.pyx":450 * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL * cdef PetscInt size = 1000 # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * if length is True: pass */ __pyx_v_size = 0x3E8; /* "PETSc/SNES.pyx":451 * cdef PetscInt *idata = NULL * cdef PetscInt size = 1000 * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * if length is True: pass * elif length is not None: size = asInt(length) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/SNES.pyx":452 * cdef PetscInt size = 1000 * cdef PetscBool flag = PETSC_FALSE * if length is True: pass # <<<<<<<<<<<<<< * elif length is not None: size = asInt(length) * if size < 0: size = 1000 */ __pyx_t_1 = (__pyx_v_length == Py_True); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { goto __pyx_L3; } /* "PETSc/SNES.pyx":453 * cdef PetscBool flag = PETSC_FALSE * if length is True: pass * elif length is not None: size = asInt(length) # <<<<<<<<<<<<<< * if size < 0: size = 1000 * if reset: flag = PETSC_TRUE */ __pyx_t_2 = (__pyx_v_length != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_length); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 453, __pyx_L1_error) __pyx_v_size = __pyx_t_3; } __pyx_L3:; /* "PETSc/SNES.pyx":454 * if length is True: pass * elif length is not None: size = asInt(length) * if size < 0: size = 1000 # <<<<<<<<<<<<<< * if reset: flag = PETSC_TRUE * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) */ __pyx_t_1 = ((__pyx_v_size < 0) != 0); if (__pyx_t_1) { __pyx_v_size = 0x3E8; } /* "PETSc/SNES.pyx":455 * elif length is not None: size = asInt(length) * if size < 0: size = 1000 * if reset: flag = PETSC_TRUE # <<<<<<<<<<<<<< * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reset); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(41, 455, __pyx_L1_error) if (__pyx_t_1) { __pyx_v_flag = PETSC_TRUE; } /* "PETSc/SNES.pyx":456 * if size < 0: size = 1000 * if reset: flag = PETSC_TRUE * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) # <<<<<<<<<<<<<< * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) * self.set_attr('__history__', (rhist, ihist)) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_4, NULL, (&__pyx_v_rdata))); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_rhist = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/SNES.pyx":457 * if reset: flag = PETSC_TRUE * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) # <<<<<<<<<<<<<< * self.set_attr('__history__', (rhist, ihist)) * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_size)); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_5, NULL, (&__pyx_v_idata))); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_ihist = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/SNES.pyx":458 * cdef object rhist = oarray_r(empty_r(size), NULL, &rdata) * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) * self.set_attr('__history__', (rhist, ihist)) # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) * */ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_rhist); __Pyx_GIVEREF(__pyx_v_rhist); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rhist); __Pyx_INCREF(__pyx_v_ihist); __Pyx_GIVEREF(__pyx_v_ihist); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ihist); __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__history__"), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/SNES.pyx":459 * cdef object ihist = oarray_i(empty_i(size), NULL, &idata) * self.set_attr('__history__', (rhist, ihist)) * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) # <<<<<<<<<<<<<< * * def getConvergenceHistory(self): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergenceHistory(__pyx_v_self->snes, __pyx_v_rdata, __pyx_v_idata, __pyx_v_size, __pyx_v_flag)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(41, 459, __pyx_L1_error) /* "PETSc/SNES.pyx":447 * return reason * * def setConvergenceHistory(self, length=None, reset=False): # <<<<<<<<<<<<<< * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rhist); __Pyx_XDECREF(__pyx_v_ihist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":461 * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) * * def getConvergenceHistory(self): # <<<<<<<<<<<<<< * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_110getConvergenceHistory[] = "SNES.getConvergenceHistory(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceHistory (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceHistory", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceHistory", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_110getConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self) { PetscReal *__pyx_v_rdata; PetscInt *__pyx_v_idata; PetscInt __pyx_v_size; PyObject *__pyx_v_rhist = 0; PyObject *__pyx_v_ihist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceHistory", 0); /* "PETSc/SNES.pyx":462 * * def getConvergenceHistory(self): * cdef PetscReal *rdata = NULL # <<<<<<<<<<<<<< * cdef PetscInt *idata = NULL * cdef PetscInt size = 0 */ __pyx_v_rdata = NULL; /* "PETSc/SNES.pyx":463 * def getConvergenceHistory(self): * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) */ __pyx_v_idata = NULL; /* "PETSc/SNES.pyx":464 * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) * cdef object rhist = array_r(size, rdata) */ __pyx_v_size = 0; /* "PETSc/SNES.pyx":465 * cdef PetscInt *idata = NULL * cdef PetscInt size = 0 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) # <<<<<<<<<<<<<< * cdef object rhist = array_r(size, rdata) * cdef object ihist = array_i(size, idata) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetConvergenceHistory(__pyx_v_self->snes, (&__pyx_v_rdata), (&__pyx_v_idata), (&__pyx_v_size))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 465, __pyx_L1_error) /* "PETSc/SNES.pyx":466 * cdef PetscInt size = 0 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) * cdef object rhist = array_r(size, rdata) # <<<<<<<<<<<<<< * cdef object ihist = array_i(size, idata) * return (rhist, ihist) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_size, __pyx_v_rdata)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_rhist = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/SNES.pyx":467 * CHKERR( SNESGetConvergenceHistory(self.snes, &rdata, &idata, &size) ) * cdef object rhist = array_r(size, rdata) * cdef object ihist = array_i(size, idata) # <<<<<<<<<<<<<< * return (rhist, ihist) * */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_size, __pyx_v_idata)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ihist = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/SNES.pyx":468 * cdef object rhist = array_r(size, rdata) * cdef object ihist = array_i(size, idata) * return (rhist, ihist) # <<<<<<<<<<<<<< * * def logConvergenceHistory(self, norm, linear_its=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_rhist); __Pyx_GIVEREF(__pyx_v_rhist); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_rhist); __Pyx_INCREF(__pyx_v_ihist); __Pyx_GIVEREF(__pyx_v_ihist); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ihist); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":461 * CHKERR( SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag) ) * * def getConvergenceHistory(self): # <<<<<<<<<<<<<< * cdef PetscReal *rdata = NULL * cdef PetscInt *idata = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rhist); __Pyx_XDECREF(__pyx_v_ihist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":470 * return (rhist, ihist) * * def logConvergenceHistory(self, norm, linear_its=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(norm) * cdef PetscInt ival = asInt(linear_its) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_112logConvergenceHistory[] = "SNES.logConvergenceHistory(self, norm, linear_its=0)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113logConvergenceHistory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_norm = 0; PyObject *__pyx_v_linear_its = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("logConvergenceHistory (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm,&__pyx_n_s_linear_its,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_linear_its); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logConvergenceHistory") < 0)) __PYX_ERR(41, 470, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_norm = values[0]; __pyx_v_linear_its = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 470, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_112logConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm, __pyx_v_linear_its); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112logConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm, PyObject *__pyx_v_linear_its) { PetscReal __pyx_v_rval; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("logConvergenceHistory", 0); /* "PETSc/SNES.pyx":471 * * def logConvergenceHistory(self, norm, linear_its=0): * cdef PetscReal rval = asReal(norm) # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(linear_its) * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_norm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 471, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/SNES.pyx":472 * def logConvergenceHistory(self, norm, linear_its=0): * cdef PetscReal rval = asReal(norm) * cdef PetscInt ival = asInt(linear_its) # <<<<<<<<<<<<<< * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_linear_its); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 472, __pyx_L1_error) __pyx_v_ival = __pyx_t_2; /* "PETSc/SNES.pyx":473 * cdef PetscReal rval = asReal(norm) * cdef PetscInt ival = asInt(linear_its) * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) # <<<<<<<<<<<<<< * * def setResetCounters(self, reset=True): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLogConvergenceHistory(__pyx_v_self->snes, __pyx_v_rval, __pyx_v_ival)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 473, __pyx_L1_error) /* "PETSc/SNES.pyx":470 * return (rhist, ihist) * * def logConvergenceHistory(self, norm, linear_its=0): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(norm) * cdef PetscInt ival = asInt(linear_its) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.logConvergenceHistory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":475 * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) * * def setResetCounters(self, reset=True): # <<<<<<<<<<<<<< * cdef PetscBool flag = reset * CHKERR( SNESSetCountersReset(self.snes, flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115setResetCounters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_114setResetCounters[] = "SNES.setResetCounters(self, reset=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115setResetCounters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_reset = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setResetCounters (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reset,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reset); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setResetCounters") < 0)) __PYX_ERR(41, 475, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_reset = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setResetCounters", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 475, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setResetCounters", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_114setResetCounters(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reset); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114setResetCounters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reset) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setResetCounters", 0); /* "PETSc/SNES.pyx":476 * * def setResetCounters(self, reset=True): * cdef PetscBool flag = reset # <<<<<<<<<<<<<< * CHKERR( SNESSetCountersReset(self.snes, flag) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_reset)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 476, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "PETSc/SNES.pyx":477 * def setResetCounters(self, reset=True): * cdef PetscBool flag = reset * CHKERR( SNESSetCountersReset(self.snes, flag) ) # <<<<<<<<<<<<<< * * # --- monitoring --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetCountersReset(__pyx_v_self->snes, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 477, __pyx_L1_error) /* "PETSc/SNES.pyx":475 * CHKERR( SNESLogConvergenceHistory(self.snes, rval, ival) ) * * def setResetCounters(self, reset=True): # <<<<<<<<<<<<<< * cdef PetscBool flag = reset * CHKERR( SNESSetCountersReset(self.snes, flag) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setResetCounters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":481 * # --- monitoring --- * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_116setMonitor[] = "SNES.setMonitor(self, monitor, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_monitor)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMonitor") < 0)) __PYX_ERR(41, 481, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 481, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_116setMonitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116setMonitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":482 * * def setMonitor(self, monitor, args=None, kargs=None): * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_monitor == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/SNES.pyx":483 * def setMonitor(self, monitor, args=None, kargs=None): * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: * monitorlist = [] */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_monitorlist = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/SNES.pyx":484 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/SNES.pyx":485 * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: * monitorlist = [] # <<<<<<<<<<<<<< * self.set_attr('__monitor__', monitorlist) * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":486 * if monitorlist is None: * monitorlist = [] * self.set_attr('__monitor__', monitorlist) # <<<<<<<<<<<<<< * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) * if args is None: args = () */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_v_monitorlist); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":487 * monitorlist = [] * self.set_attr('__monitor__', monitorlist) * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitorSet(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_Monitor, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 487, __pyx_L1_error) /* "PETSc/SNES.pyx":484 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ } /* "PETSc/SNES.pyx":488 * self.set_attr('__monitor__', monitorlist) * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (monitor, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":489 * CHKERR( SNESMonitorSet(self.snes, SNES_Monitor, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (monitor, args, kargs) * monitorlist.append(context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":490 * if args is None: args = () * if kargs is None: kargs = {} * context = (monitor, args, kargs) # <<<<<<<<<<<<<< * monitorlist.append(context) * */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_monitor); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":491 * if kargs is None: kargs = {} * context = (monitor, args, kargs) * monitorlist.append(context) # <<<<<<<<<<<<<< * * def getMonitor(self): */ __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_v_context); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(41, 491, __pyx_L1_error) /* "PETSc/SNES.pyx":481 * # --- monitoring --- * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":493 * monitorlist.append(context) * * def getMonitor(self): # <<<<<<<<<<<<<< * return self.get_attr('__monitor__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_118getMonitor[] = "SNES.getMonitor(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_118getMonitor(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118getMonitor(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 0); /* "PETSc/SNES.pyx":494 * * def getMonitor(self): * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def cancelMonitor(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":493 * monitorlist.append(context) * * def getMonitor(self): # <<<<<<<<<<<<<< * return self.get_attr('__monitor__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":496 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * CHKERR( SNESMonitorCancel(self.snes) ) * self.set_attr('__monitor__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_121cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_120cancelMonitor[] = "SNES.cancelMonitor(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_121cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cancelMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("cancelMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "cancelMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_120cancelMonitor(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120cancelMonitor(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cancelMonitor", 0); /* "PETSc/SNES.pyx":497 * * def cancelMonitor(self): * CHKERR( SNESMonitorCancel(self.snes) ) # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitorCancel(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 497, __pyx_L1_error) /* "PETSc/SNES.pyx":498 * def cancelMonitor(self): * CHKERR( SNESMonitorCancel(self.snes) ) * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * * def monitor(self, its, rnorm): */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":496 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * CHKERR( SNESMonitorCancel(self.snes) ) * self.set_attr('__monitor__', None) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.cancelMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":500 * self.set_attr('__monitor__', None) * * def monitor(self, its, rnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_122monitor[] = "SNES.monitor(self, its, rnorm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_its = 0; PyObject *__pyx_v_rnorm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,&__pyx_n_s_rnorm,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rnorm)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, 1); __PYX_ERR(41, 500, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitor") < 0)) __PYX_ERR(41, 500, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_its = values[0]; __pyx_v_rnorm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 500, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_122monitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_122monitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor", 0); /* "PETSc/SNES.pyx":501 * * def monitor(self, its, rnorm): * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(rnorm) * CHKERR( SNESMonitor(self.snes, ival, rval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 501, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/SNES.pyx":502 * def monitor(self, its, rnorm): * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) # <<<<<<<<<<<<<< * CHKERR( SNESMonitor(self.snes, ival, rval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rnorm); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 502, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "PETSc/SNES.pyx":503 * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) * CHKERR( SNESMonitor(self.snes, ival, rval) ) # <<<<<<<<<<<<<< * * # --- more tolerances --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESMonitor(__pyx_v_self->snes, __pyx_v_ival, __pyx_v_rval)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 503, __pyx_L1_error) /* "PETSc/SNES.pyx":500 * self.set_attr('__monitor__', None) * * def monitor(self, its, rnorm): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * cdef PetscReal rval = asReal(rnorm) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":507 * # --- more tolerances --- * * def setMaxFunctionEvaluations(self, max_funcs): # <<<<<<<<<<<<<< * cdef PetscReal r = PETSC_DEFAULT * cdef PetscInt i = PETSC_DEFAULT */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_125setMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_124setMaxFunctionEvaluations[] = "SNES.setMaxFunctionEvaluations(self, max_funcs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_125setMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_max_funcs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxFunctionEvaluations (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_funcs,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_funcs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxFunctionEvaluations") < 0)) __PYX_ERR(41, 507, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_max_funcs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxFunctionEvaluations", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 507, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_124setMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_funcs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_124setMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_funcs) { PetscReal __pyx_v_r; PetscInt __pyx_v_i; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxFunctionEvaluations", 0); /* "PETSc/SNES.pyx":508 * * def setMaxFunctionEvaluations(self, max_funcs): * cdef PetscReal r = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt i = PETSC_DEFAULT * cdef PetscInt ival = asInt(max_funcs) */ __pyx_v_r = PETSC_DEFAULT; /* "PETSc/SNES.pyx":509 * def setMaxFunctionEvaluations(self, max_funcs): * cdef PetscReal r = PETSC_DEFAULT * cdef PetscInt i = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_funcs) * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) */ __pyx_v_i = PETSC_DEFAULT; /* "PETSc/SNES.pyx":510 * cdef PetscReal r = PETSC_DEFAULT * cdef PetscInt i = PETSC_DEFAULT * cdef PetscInt ival = asInt(max_funcs) # <<<<<<<<<<<<<< * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_funcs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 510, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/SNES.pyx":511 * cdef PetscInt i = PETSC_DEFAULT * cdef PetscInt ival = asInt(max_funcs) * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) # <<<<<<<<<<<<<< * * def getMaxFunctionEvaluations(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetTolerances(__pyx_v_self->snes, __pyx_v_r, __pyx_v_r, __pyx_v_r, __pyx_v_i, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 511, __pyx_L1_error) /* "PETSc/SNES.pyx":507 * # --- more tolerances --- * * def setMaxFunctionEvaluations(self, max_funcs): # <<<<<<<<<<<<<< * cdef PetscReal r = PETSC_DEFAULT * cdef PetscInt i = PETSC_DEFAULT */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":513 * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) * * def getMaxFunctionEvaluations(self): # <<<<<<<<<<<<<< * cdef PetscReal *r = NULL * cdef PetscInt *i = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_127getMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_126getMaxFunctionEvaluations[] = "SNES.getMaxFunctionEvaluations(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_127getMaxFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxFunctionEvaluations (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxFunctionEvaluations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxFunctionEvaluations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_126getMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_126getMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self) { PetscReal *__pyx_v_r; PetscInt *__pyx_v_i; PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxFunctionEvaluations", 0); /* "PETSc/SNES.pyx":514 * * def getMaxFunctionEvaluations(self): * cdef PetscReal *r = NULL # <<<<<<<<<<<<<< * cdef PetscInt *i = NULL * cdef PetscInt ival = 0 */ __pyx_v_r = NULL; /* "PETSc/SNES.pyx":515 * def getMaxFunctionEvaluations(self): * cdef PetscReal *r = NULL * cdef PetscInt *i = NULL # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) */ __pyx_v_i = NULL; /* "PETSc/SNES.pyx":516 * cdef PetscReal *r = NULL * cdef PetscInt *i = NULL * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":517 * cdef PetscInt *i = NULL * cdef PetscInt ival = 0 * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetTolerances(__pyx_v_self->snes, __pyx_v_r, __pyx_v_r, __pyx_v_r, __pyx_v_i, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 517, __pyx_L1_error) /* "PETSc/SNES.pyx":518 * cdef PetscInt ival = 0 * CHKERR( SNESGetTolerances(self.snes, r, r, r, i, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getFunctionEvaluations(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":513 * CHKERR( SNESSetTolerances(self.snes, r, r, r, i, ival) ) * * def getMaxFunctionEvaluations(self): # <<<<<<<<<<<<<< * cdef PetscReal *r = NULL * cdef PetscInt *i = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMaxFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":520 * return toInt(ival) * * def getFunctionEvaluations(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129getFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_128getFunctionEvaluations[] = "SNES.getFunctionEvaluations(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129getFunctionEvaluations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunctionEvaluations (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFunctionEvaluations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunctionEvaluations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_128getFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_128getFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunctionEvaluations", 0); /* "PETSc/SNES.pyx":521 * * def getFunctionEvaluations(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":522 * def getFunctionEvaluations(self): * cdef PetscInt ival = 0 * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNumberFunctionEvals(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 522, __pyx_L1_error) /* "PETSc/SNES.pyx":523 * cdef PetscInt ival = 0 * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setMaxStepFailures(self, max_fails): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":520 * return toInt(ival) * * def getFunctionEvaluations(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetNumberFunctionEvals(self.snes, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFunctionEvaluations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":525 * return toInt(ival) * * def setMaxStepFailures(self, max_fails): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_131setMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_130setMaxStepFailures[] = "SNES.setMaxStepFailures(self, max_fails)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_131setMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_max_fails = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxStepFailures (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_fails,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_fails)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxStepFailures") < 0)) __PYX_ERR(41, 525, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_max_fails = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxStepFailures", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 525, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_130setMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130setMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxStepFailures", 0); /* "PETSc/SNES.pyx":526 * * def setMaxStepFailures(self, max_fails): * cdef PetscInt ival = asInt(max_fails) # <<<<<<<<<<<<<< * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_fails); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 526, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/SNES.pyx":527 * def setMaxStepFailures(self, max_fails): * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) # <<<<<<<<<<<<<< * * def getMaxStepFailures(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetMaxNonlinearStepFailures(__pyx_v_self->snes, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 527, __pyx_L1_error) /* "PETSc/SNES.pyx":525 * return toInt(ival) * * def setMaxStepFailures(self, max_fails): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":529 * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) * * def getMaxStepFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_133getMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_132getMaxStepFailures[] = "SNES.getMaxStepFailures(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_133getMaxStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxStepFailures (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxStepFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxStepFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_132getMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132getMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxStepFailures", 0); /* "PETSc/SNES.pyx":530 * * def getMaxStepFailures(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":531 * def getMaxStepFailures(self): * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetMaxNonlinearStepFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 531, __pyx_L1_error) /* "PETSc/SNES.pyx":532 * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getStepFailures(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":529 * CHKERR( SNESSetMaxNonlinearStepFailures(self.snes, ival) ) * * def getMaxStepFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxNonlinearStepFailures(self.snes, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMaxStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":534 * return toInt(ival) * * def getStepFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_135getStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_134getStepFailures[] = "SNES.getStepFailures(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_135getStepFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStepFailures (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStepFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_134getStepFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134getStepFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStepFailures", 0); /* "PETSc/SNES.pyx":535 * * def getStepFailures(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":536 * def getStepFailures(self): * cdef PetscInt ival = 0 * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNonlinearStepFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 536, __pyx_L1_error) /* "PETSc/SNES.pyx":537 * cdef PetscInt ival = 0 * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setMaxKSPFailures(self, max_fails): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":534 * return toInt(ival) * * def getStepFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetNonlinearStepFailures(self.snes, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getStepFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":539 * return toInt(ival) * * def setMaxKSPFailures(self, max_fails): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137setMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_136setMaxKSPFailures[] = "SNES.setMaxKSPFailures(self, max_fails)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137setMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_max_fails = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxKSPFailures (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_fails,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_fails)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxKSPFailures") < 0)) __PYX_ERR(41, 539, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_max_fails = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxKSPFailures", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 539, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_136setMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136setMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxKSPFailures", 0); /* "PETSc/SNES.pyx":540 * * def setMaxKSPFailures(self, max_fails): * cdef PetscInt ival = asInt(max_fails) # <<<<<<<<<<<<<< * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_fails); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 540, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/SNES.pyx":541 * def setMaxKSPFailures(self, max_fails): * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) # <<<<<<<<<<<<<< * * def getMaxKSPFailures(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetMaxLinearSolveFailures(__pyx_v_self->snes, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 541, __pyx_L1_error) /* "PETSc/SNES.pyx":539 * return toInt(ival) * * def setMaxKSPFailures(self, max_fails): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_fails) * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setMaxKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":543 * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) * * def getMaxKSPFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_139getMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_138getMaxKSPFailures[] = "SNES.getMaxKSPFailures(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_139getMaxKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxKSPFailures (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxKSPFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxKSPFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_138getMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_138getMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxKSPFailures", 0); /* "PETSc/SNES.pyx":544 * * def getMaxKSPFailures(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":545 * def getMaxKSPFailures(self): * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetMaxLinearSolveFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 545, __pyx_L1_error) /* "PETSc/SNES.pyx":546 * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getKSPFailures(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":543 * CHKERR( SNESSetMaxLinearSolveFailures(self.snes, ival) ) * * def getMaxKSPFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetMaxLinearSolveFailures(self.snes, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getMaxKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":548 * return toInt(ival) * * def getKSPFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_141getKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_140getKSPFailures[] = "SNES.getKSPFailures(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_141getKSPFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSPFailures (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getKSPFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSPFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_140getKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140getKSPFailures(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSPFailures", 0); /* "PETSc/SNES.pyx":549 * * def getKSPFailures(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":550 * def getKSPFailures(self): * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLinearSolveFailures(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 550, __pyx_L1_error) /* "PETSc/SNES.pyx":551 * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * setMaxNonlinearStepFailures = setMaxStepFailures */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":548 * return toInt(ival) * * def getKSPFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveFailures(self.snes, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getKSPFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":562 * # --- solving --- * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( SNESSetUp(self.snes) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_142setUp[] = "SNES.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_142setUp(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142setUp(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/SNES.pyx":563 * * def setUp(self): * CHKERR( SNESSetUp(self.snes) ) # <<<<<<<<<<<<<< * * def reset(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUp(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 563, __pyx_L1_error) /* "PETSc/SNES.pyx":562 * # --- solving --- * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( SNESSetUp(self.snes) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":565 * CHKERR( SNESSetUp(self.snes) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( SNESReset(self.snes) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_145reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_144reset[] = "SNES.reset(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_145reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_144reset(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144reset(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); /* "PETSc/SNES.pyx":566 * * def reset(self): * CHKERR( SNESReset(self.snes) ) # <<<<<<<<<<<<<< * * def solve(self, Vec b or None, Vec x): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESReset(__pyx_v_self->snes)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 566, __pyx_L1_error) /* "PETSc/SNES.pyx":565 * CHKERR( SNESSetUp(self.snes) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( SNESReset(self.snes) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":568 * CHKERR( SNESReset(self.snes) ) * * def solve(self, Vec b or None, Vec x): # <<<<<<<<<<<<<< * cdef PetscVec rhs = NULL * if b is not None: rhs = b.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_147solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_146solve[] = "SNES.solve(self, Vec b, Vec x)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_147solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_b = 0; struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_x,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, 1); __PYX_ERR(41, 568, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(41, 568, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_b = ((struct PyPetscVecObject *)values[0]); __pyx_v_x = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 568, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(41, 568, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 568, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_146solve(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146solve(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x) { Vec __pyx_v_rhs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 0); /* "PETSc/SNES.pyx":569 * * def solve(self, Vec b or None, Vec x): * cdef PetscVec rhs = NULL # <<<<<<<<<<<<<< * if b is not None: rhs = b.vec * CHKERR( SNESSolve(self.snes, rhs, x.vec) ) */ __pyx_v_rhs = NULL; /* "PETSc/SNES.pyx":570 * def solve(self, Vec b or None, Vec x): * cdef PetscVec rhs = NULL * if b is not None: rhs = b.vec # <<<<<<<<<<<<<< * CHKERR( SNESSolve(self.snes, rhs, x.vec) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_b) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_b->vec; __pyx_v_rhs = __pyx_t_3; } /* "PETSc/SNES.pyx":571 * cdef PetscVec rhs = NULL * if b is not None: rhs = b.vec * CHKERR( SNESSolve(self.snes, rhs, x.vec) ) # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSolve(__pyx_v_self->snes, __pyx_v_rhs, __pyx_v_x->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 571, __pyx_L1_error) /* "PETSc/SNES.pyx":568 * CHKERR( SNESReset(self.snes) ) * * def solve(self, Vec b or None, Vec x): # <<<<<<<<<<<<<< * cdef PetscVec rhs = NULL * if b is not None: rhs = b.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":573 * CHKERR( SNESSolve(self.snes, rhs, x.vec) ) * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * cdef PetscSNESConvergedReason eval = reason * CHKERR( SNESSetConvergedReason(self.snes, eval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_148setConvergedReason[] = "SNES.setConvergedReason(self, reason)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_reason = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergedReason") < 0)) __PYX_ERR(41, 573, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 573, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_148setConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148setConvergedReason(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reason) { SNESConvergedReason __pyx_v_eval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations SNESConvergedReason __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 0); /* "PETSc/SNES.pyx":574 * * def setConvergedReason(self, reason): * cdef PetscSNESConvergedReason eval = reason # <<<<<<<<<<<<<< * CHKERR( SNESSetConvergedReason(self.snes, eval) ) * */ __pyx_t_1 = ((SNESConvergedReason)__Pyx_PyInt_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 574, __pyx_L1_error) __pyx_v_eval = __pyx_t_1; /* "PETSc/SNES.pyx":575 * def setConvergedReason(self, reason): * cdef PetscSNESConvergedReason eval = reason * CHKERR( SNESSetConvergedReason(self.snes, eval) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetConvergedReason(__pyx_v_self->snes, __pyx_v_eval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 575, __pyx_L1_error) /* "PETSc/SNES.pyx":573 * CHKERR( SNESSolve(self.snes, rhs, x.vec) ) * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * cdef PetscSNESConvergedReason eval = reason * CHKERR( SNESSetConvergedReason(self.snes, eval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":577 * CHKERR( SNESSetConvergedReason(self.snes, eval) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_151getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_150getConvergedReason[] = "SNES.getConvergedReason(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_151getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_150getConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150getConvergedReason(struct PyPetscSNESObject *__pyx_v_self) { SNESConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 0); /* "PETSc/SNES.pyx":578 * * def getConvergedReason(self): * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) * return reason */ __pyx_v_reason = SNES_CONVERGED_ITERATING; /* "PETSc/SNES.pyx":579 * def getConvergedReason(self): * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetConvergedReason(__pyx_v_self->snes, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 579, __pyx_L1_error) /* "PETSc/SNES.pyx":580 * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) * return reason # <<<<<<<<<<<<<< * * def setIterationNumber(self, its): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":577 * CHKERR( SNESSetConvergedReason(self.snes, eval) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING * CHKERR( SNESGetConvergedReason(self.snes, &reason) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":582 * return reason * * def setIterationNumber(self, its): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * CHKERR( SNESSetIterationNumber(self.snes, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_153setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_152setIterationNumber[] = "SNES.setIterationNumber(self, its)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_153setIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_its = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIterationNumber (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_its,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_its)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIterationNumber") < 0)) __PYX_ERR(41, 582, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_its = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 582, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_152setIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152setIterationNumber(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIterationNumber", 0); /* "PETSc/SNES.pyx":583 * * def setIterationNumber(self, its): * cdef PetscInt ival = asInt(its) # <<<<<<<<<<<<<< * CHKERR( SNESSetIterationNumber(self.snes, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_its); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 583, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/SNES.pyx":584 * def setIterationNumber(self, its): * cdef PetscInt ival = asInt(its) * CHKERR( SNESSetIterationNumber(self.snes, ival) ) # <<<<<<<<<<<<<< * * def getIterationNumber(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetIterationNumber(__pyx_v_self->snes, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 584, __pyx_L1_error) /* "PETSc/SNES.pyx":582 * return reason * * def setIterationNumber(self, its): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(its) * CHKERR( SNESSetIterationNumber(self.snes, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":586 * CHKERR( SNESSetIterationNumber(self.snes, ival) ) * * def getIterationNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_154getIterationNumber[] = "SNES.getIterationNumber(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_154getIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154getIterationNumber(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIterationNumber", 0); /* "PETSc/SNES.pyx":587 * * def getIterationNumber(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":588 * def getIterationNumber(self): * cdef PetscInt ival = 0 * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetIterationNumber(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 588, __pyx_L1_error) /* "PETSc/SNES.pyx":589 * cdef PetscInt ival = 0 * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setFunctionNorm(self, norm): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":586 * CHKERR( SNESSetIterationNumber(self.snes, ival) ) * * def getIterationNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetIterationNumber(self.snes, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":591 * return toInt(ival) * * def setFunctionNorm(self, norm): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(norm) * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_157setFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_156setFunctionNorm[] = "SNES.setFunctionNorm(self, norm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_157setFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_norm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFunctionNorm (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_norm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_norm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFunctionNorm") < 0)) __PYX_ERR(41, 591, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_norm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFunctionNorm", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 591, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunctionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_156setFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156setFunctionNorm(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFunctionNorm", 0); /* "PETSc/SNES.pyx":592 * * def setFunctionNorm(self, norm): * cdef PetscReal rval = asReal(norm) # <<<<<<<<<<<<<< * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_norm); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 592, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/SNES.pyx":593 * def setFunctionNorm(self, norm): * cdef PetscReal rval = asReal(norm) * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) # <<<<<<<<<<<<<< * * def getFunctionNorm(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetFunctionNorm(__pyx_v_self->snes, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 593, __pyx_L1_error) /* "PETSc/SNES.pyx":591 * return toInt(ival) * * def setFunctionNorm(self, norm): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(norm) * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setFunctionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":595 * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) * * def getFunctionNorm(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_159getFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_158getFunctionNorm[] = "SNES.getFunctionNorm(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_159getFunctionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFunctionNorm (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getFunctionNorm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getFunctionNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_158getFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158getFunctionNorm(struct PyPetscSNESObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFunctionNorm", 0); /* "PETSc/SNES.pyx":596 * * def getFunctionNorm(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/SNES.pyx":597 * def getFunctionNorm(self): * cdef PetscReal rval = 0 * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetFunctionNorm(__pyx_v_self->snes, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 597, __pyx_L1_error) /* "PETSc/SNES.pyx":598 * cdef PetscReal rval = 0 * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getLinearSolveIterations(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":595 * CHKERR( SNESSetFunctionNorm(self.snes, rval) ) * * def getFunctionNorm(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( SNESGetFunctionNorm(self.snes, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getFunctionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":600 * return toReal(rval) * * def getLinearSolveIterations(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getLinearSolveIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_160getLinearSolveIterations[] = "SNES.getLinearSolveIterations(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getLinearSolveIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLinearSolveIterations (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLinearSolveIterations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLinearSolveIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_160getLinearSolveIterations(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getLinearSolveIterations(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLinearSolveIterations", 0); /* "PETSc/SNES.pyx":601 * * def getLinearSolveIterations(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/SNES.pyx":602 * def getLinearSolveIterations(self): * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLinearSolveIterations(__pyx_v_self->snes, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 602, __pyx_L1_error) /* "PETSc/SNES.pyx":603 * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getRhs(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":600 * return toReal(rval) * * def getLinearSolveIterations(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( SNESGetLinearSolveIterations(self.snes, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getLinearSolveIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":605 * return toInt(ival) * * def getRhs(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_162getRhs[] = "SNES.getRhs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163getRhs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRhs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRhs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRhs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_162getRhs(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162getRhs(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRhs", 0); /* "PETSc/SNES.pyx":606 * * def getRhs(self): * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":607 * def getRhs(self): * cdef Vec vec = Vec() * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetRhs(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 607, __pyx_L1_error) /* "PETSc/SNES.pyx":608 * cdef Vec vec = Vec() * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * return vec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/SNES.pyx":609 * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) * return vec # <<<<<<<<<<<<<< * * def getSolution(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/SNES.pyx":605 * return toInt(ival) * * def getRhs(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( SNESGetRhs(self.snes, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getRhs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":611 * return vec * * def getSolution(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_165getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_164getSolution[] = "SNES.getSolution(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_165getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_164getSolution(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164getSolution(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 0); /* "PETSc/SNES.pyx":612 * * def getSolution(self): * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":613 * def getSolution(self): * cdef Vec vec = Vec() * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolution(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 613, __pyx_L1_error) /* "PETSc/SNES.pyx":614 * cdef Vec vec = Vec() * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * return vec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/SNES.pyx":615 * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) * return vec # <<<<<<<<<<<<<< * * def setSolution(self, Vec vec): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/SNES.pyx":611 * return vec * * def getSolution(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( SNESGetSolution(self.snes, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":617 * return vec * * def setSolution(self, Vec vec): # <<<<<<<<<<<<<< * CHKERR( SNESSetSolution(self.snes, vec.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167setSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_166setSolution[] = "SNES.setSolution(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167setSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolution (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSolution") < 0)) __PYX_ERR(41, 617, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 617, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 617, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_166setSolution(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166setSolution(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolution", 0); /* "PETSc/SNES.pyx":618 * * def setSolution(self, Vec vec): * CHKERR( SNESSetSolution(self.snes, vec.vec) ) # <<<<<<<<<<<<<< * * def getSolutionUpdate(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetSolution(__pyx_v_self->snes, __pyx_v_vec->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 618, __pyx_L1_error) /* "PETSc/SNES.pyx":617 * return vec * * def setSolution(self, Vec vec): # <<<<<<<<<<<<<< * CHKERR( SNESSetSolution(self.snes, vec.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":620 * CHKERR( SNESSetSolution(self.snes, vec.vec) ) * * def getSolutionUpdate(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_169getSolutionUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_168getSolutionUpdate[] = "SNES.getSolutionUpdate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_169getSolutionUpdate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionUpdate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolutionUpdate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolutionUpdate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_168getSolutionUpdate(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionUpdate", 0); /* "PETSc/SNES.pyx":621 * * def getSolutionUpdate(self): * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":622 * def getSolutionUpdate(self): * cdef Vec vec = Vec() * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolutionUpdate(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 622, __pyx_L1_error) /* "PETSc/SNES.pyx":623 * cdef Vec vec = Vec() * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * return vec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/SNES.pyx":624 * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) * PetscINCREF(vec.obj) * return vec # <<<<<<<<<<<<<< * * # --- linear solver --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/SNES.pyx":620 * CHKERR( SNESSetSolution(self.snes, vec.vec) ) * * def getSolutionUpdate(self): # <<<<<<<<<<<<<< * cdef Vec vec = Vec() * CHKERR( SNESGetSolutionUpdate(self.snes, &vec.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getSolutionUpdate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":628 * # --- linear solver --- * * def setKSP(self, KSP ksp): # <<<<<<<<<<<<<< * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_171setKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_170setKSP[] = "SNES.setKSP(self, KSP ksp)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_171setKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscKSPObject *__pyx_v_ksp = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setKSP (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ksp,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ksp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setKSP") < 0)) __PYX_ERR(41, 628, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ksp = ((struct PyPetscKSPObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setKSP", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 628, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ksp), __pyx_ptype_8petsc4py_5PETSc_KSP, 0, "ksp", 0))) __PYX_ERR(41, 628, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_170setKSP(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ksp); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170setKSP(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setKSP", 0); /* "PETSc/SNES.pyx":629 * * def setKSP(self, KSP ksp): * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) # <<<<<<<<<<<<<< * * def getKSP(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetKSP(__pyx_v_self->snes, __pyx_v_ksp->ksp)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 629, __pyx_L1_error) /* "PETSc/SNES.pyx":628 * # --- linear solver --- * * def setKSP(self, KSP ksp): # <<<<<<<<<<<<<< * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":631 * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) * * def getKSP(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_172getKSP[] = "SNES.getKSP(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_172getKSP(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172getKSP(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 0); /* "PETSc/SNES.pyx":632 * * def getKSP(self): * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":633 * def getKSP(self): * cdef KSP ksp = KSP() * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetKSP(__pyx_v_self->snes, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 633, __pyx_L1_error) /* "PETSc/SNES.pyx":634 * cdef KSP ksp = KSP() * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/SNES.pyx":635 * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * def setUseEW(self, flag=True, *targs, **kargs): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/SNES.pyx":631 * CHKERR( SNESSetKSP(self.snes, ksp.ksp) ) * * def getKSP(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( SNESGetKSP(self.snes, &ksp.ksp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":637 * return ksp * * def setUseEW(self, flag=True, *targs, **kargs): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_175setUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_174setUseEW[] = "SNES.setUseEW(self, flag=True, *targs, **kargs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_175setUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; PyObject *__pyx_v_targs = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseEW (wrapper)", 0); __pyx_v_kargs = PyDict_New(); if (unlikely(!__pyx_v_kargs)) return NULL; __Pyx_GOTREF(__pyx_v_kargs); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_targs = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_targs)) { __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_targs); } else { __pyx_v_targs = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kargs, values, used_pos_args, "setUseEW") < 0)) __PYX_ERR(41, 637, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_DECREF(__pyx_v_targs); __pyx_v_targs = 0; __Pyx_DECREF(__pyx_v_kargs); __pyx_v_kargs = 0; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_174setUseEW(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag, __pyx_v_targs, __pyx_v_kargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_targs); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174setUseEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_targs, PyObject *__pyx_v_kargs) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseEW", 0); /* "PETSc/SNES.pyx":638 * * def setUseEW(self, flag=True, *targs, **kargs): * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) * if targs or kargs: self.setParamsEW(*targs, **kargs) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 638, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "PETSc/SNES.pyx":639 * def setUseEW(self, flag=True, *targs, **kargs): * cdef PetscBool bval = flag * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) # <<<<<<<<<<<<<< * if targs or kargs: self.setParamsEW(*targs, **kargs) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPSetUseEW(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 639, __pyx_L1_error) /* "PETSc/SNES.pyx":640 * cdef PetscBool bval = flag * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) * if targs or kargs: self.setParamsEW(*targs, **kargs) # <<<<<<<<<<<<<< * * def getUseEW(self): */ __pyx_t_4 = (PyTuple_GET_SIZE(__pyx_v_targs) != 0); if (!__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_kargs); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(41, 640, __pyx_L1_error) __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setParamsEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_v_targs, __pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } /* "PETSc/SNES.pyx":637 * return ksp * * def setUseEW(self, flag=True, *targs, **kargs): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( SNESKSPSetUseEW(self.snes, bval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":642 * if targs or kargs: self.setParamsEW(*targs, **kargs) * * def getUseEW(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_177getUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_176getUseEW[] = "SNES.getUseEW(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_177getUseEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUseEW (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getUseEW", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseEW", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_176getUseEW(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getUseEW(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUseEW", 0); /* "PETSc/SNES.pyx":643 * * def getUseEW(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/SNES.pyx":644 * def getUseEW(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPGetUseEW(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 644, __pyx_L1_error) /* "PETSc/SNES.pyx":645 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setParamsEW(self, version=None, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":642 * if targs or kargs: self.setParamsEW(*targs, **kargs) * * def getUseEW(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESKSPGetUseEW(self.snes, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUseEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":647 * return toBool(flag) * * def setParamsEW(self, version=None, # <<<<<<<<<<<<<< * rtol_0=None, rtol_max=None, * gamma=None, alpha=None, alpha2=None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179setParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_178setParamsEW[] = "SNES.setParamsEW(self, version=None, rtol_0=None, rtol_max=None, gamma=None, alpha=None, alpha2=None, threshold=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179setParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_version = 0; PyObject *__pyx_v_rtol_0 = 0; PyObject *__pyx_v_rtol_max = 0; PyObject *__pyx_v_gamma = 0; PyObject *__pyx_v_alpha = 0; PyObject *__pyx_v_alpha2 = 0; PyObject *__pyx_v_threshold = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setParamsEW (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version,&__pyx_n_s_rtol_0,&__pyx_n_s_rtol_max,&__pyx_n_s_gamma,&__pyx_n_s_alpha,&__pyx_n_s_alpha2,&__pyx_n_s_threshold,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; values[0] = ((PyObject *)Py_None); /* "PETSc/SNES.pyx":648 * * def setParamsEW(self, version=None, * rtol_0=None, rtol_max=None, # <<<<<<<<<<<<<< * gamma=None, alpha=None, alpha2=None, * threshold=None): */ values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); /* "PETSc/SNES.pyx":649 * def setParamsEW(self, version=None, * rtol_0=None, rtol_max=None, * gamma=None, alpha=None, alpha2=None, # <<<<<<<<<<<<<< * threshold=None): * cdef PetscInt cversion = PETSC_DEFAULT */ values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); /* "PETSc/SNES.pyx":650 * rtol_0=None, rtol_max=None, * gamma=None, alpha=None, alpha2=None, * threshold=None): # <<<<<<<<<<<<<< * cdef PetscInt cversion = PETSC_DEFAULT * cdef PetscReal crtol_0 = PETSC_DEFAULT */ values[6] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_version); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol_0); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol_max); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gamma); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha2); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_threshold); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setParamsEW") < 0)) __PYX_ERR(41, 647, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_version = values[0]; __pyx_v_rtol_0 = values[1]; __pyx_v_rtol_max = values[2]; __pyx_v_gamma = values[3]; __pyx_v_alpha = values[4]; __pyx_v_alpha2 = values[5]; __pyx_v_threshold = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setParamsEW", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 647, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setParamsEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_178setParamsEW(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_version, __pyx_v_rtol_0, __pyx_v_rtol_max, __pyx_v_gamma, __pyx_v_alpha, __pyx_v_alpha2, __pyx_v_threshold); /* "PETSc/SNES.pyx":647 * return toBool(flag) * * def setParamsEW(self, version=None, # <<<<<<<<<<<<<< * rtol_0=None, rtol_max=None, * gamma=None, alpha=None, alpha2=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178setParamsEW(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_version, PyObject *__pyx_v_rtol_0, PyObject *__pyx_v_rtol_max, PyObject *__pyx_v_gamma, PyObject *__pyx_v_alpha, PyObject *__pyx_v_alpha2, PyObject *__pyx_v_threshold) { PetscInt __pyx_v_cversion; PetscReal __pyx_v_crtol_0; PetscReal __pyx_v_crtol_max; PetscReal __pyx_v_cgamma; PetscReal __pyx_v_calpha; PetscReal __pyx_v_calpha2; PetscReal __pyx_v_cthreshold; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PetscReal __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setParamsEW", 0); /* "PETSc/SNES.pyx":651 * gamma=None, alpha=None, alpha2=None, * threshold=None): * cdef PetscInt cversion = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal crtol_0 = PETSC_DEFAULT * cdef PetscReal crtol_max = PETSC_DEFAULT */ __pyx_v_cversion = PETSC_DEFAULT; /* "PETSc/SNES.pyx":652 * threshold=None): * cdef PetscInt cversion = PETSC_DEFAULT * cdef PetscReal crtol_0 = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal crtol_max = PETSC_DEFAULT * cdef PetscReal cgamma = PETSC_DEFAULT */ __pyx_v_crtol_0 = PETSC_DEFAULT; /* "PETSc/SNES.pyx":653 * cdef PetscInt cversion = PETSC_DEFAULT * cdef PetscReal crtol_0 = PETSC_DEFAULT * cdef PetscReal crtol_max = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal cgamma = PETSC_DEFAULT * cdef PetscReal calpha = PETSC_DEFAULT */ __pyx_v_crtol_max = PETSC_DEFAULT; /* "PETSc/SNES.pyx":654 * cdef PetscReal crtol_0 = PETSC_DEFAULT * cdef PetscReal crtol_max = PETSC_DEFAULT * cdef PetscReal cgamma = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal calpha = PETSC_DEFAULT * cdef PetscReal calpha2 = PETSC_DEFAULT */ __pyx_v_cgamma = PETSC_DEFAULT; /* "PETSc/SNES.pyx":655 * cdef PetscReal crtol_max = PETSC_DEFAULT * cdef PetscReal cgamma = PETSC_DEFAULT * cdef PetscReal calpha = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal calpha2 = PETSC_DEFAULT * cdef PetscReal cthreshold = PETSC_DEFAULT */ __pyx_v_calpha = PETSC_DEFAULT; /* "PETSc/SNES.pyx":656 * cdef PetscReal cgamma = PETSC_DEFAULT * cdef PetscReal calpha = PETSC_DEFAULT * cdef PetscReal calpha2 = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal cthreshold = PETSC_DEFAULT * if version is not None: cversion = asInt(version) */ __pyx_v_calpha2 = PETSC_DEFAULT; /* "PETSc/SNES.pyx":657 * cdef PetscReal calpha = PETSC_DEFAULT * cdef PetscReal calpha2 = PETSC_DEFAULT * cdef PetscReal cthreshold = PETSC_DEFAULT # <<<<<<<<<<<<<< * if version is not None: cversion = asInt(version) * if rtol_0 is not None: crtol_0 = asReal(rtol_0) */ __pyx_v_cthreshold = PETSC_DEFAULT; /* "PETSc/SNES.pyx":658 * cdef PetscReal calpha2 = PETSC_DEFAULT * cdef PetscReal cthreshold = PETSC_DEFAULT * if version is not None: cversion = asInt(version) # <<<<<<<<<<<<<< * if rtol_0 is not None: crtol_0 = asReal(rtol_0) * if rtol_max is not None: crtol_max = asReal(rtol_max) */ __pyx_t_1 = (__pyx_v_version != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_version); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 658, __pyx_L1_error) __pyx_v_cversion = __pyx_t_3; } /* "PETSc/SNES.pyx":659 * cdef PetscReal cthreshold = PETSC_DEFAULT * if version is not None: cversion = asInt(version) * if rtol_0 is not None: crtol_0 = asReal(rtol_0) # <<<<<<<<<<<<<< * if rtol_max is not None: crtol_max = asReal(rtol_max) * if gamma is not None: cgamma = asReal(gamma) */ __pyx_t_2 = (__pyx_v_rtol_0 != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol_0); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 659, __pyx_L1_error) __pyx_v_crtol_0 = __pyx_t_4; } /* "PETSc/SNES.pyx":660 * if version is not None: cversion = asInt(version) * if rtol_0 is not None: crtol_0 = asReal(rtol_0) * if rtol_max is not None: crtol_max = asReal(rtol_max) # <<<<<<<<<<<<<< * if gamma is not None: cgamma = asReal(gamma) * if alpha is not None: calpha = asReal(alpha) */ __pyx_t_1 = (__pyx_v_rtol_max != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol_max); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 660, __pyx_L1_error) __pyx_v_crtol_max = __pyx_t_4; } /* "PETSc/SNES.pyx":661 * if rtol_0 is not None: crtol_0 = asReal(rtol_0) * if rtol_max is not None: crtol_max = asReal(rtol_max) * if gamma is not None: cgamma = asReal(gamma) # <<<<<<<<<<<<<< * if alpha is not None: calpha = asReal(alpha) * if alpha2 is not None: calpha2 = asReal(alpha2) */ __pyx_t_2 = (__pyx_v_gamma != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gamma); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 661, __pyx_L1_error) __pyx_v_cgamma = __pyx_t_4; } /* "PETSc/SNES.pyx":662 * if rtol_max is not None: crtol_max = asReal(rtol_max) * if gamma is not None: cgamma = asReal(gamma) * if alpha is not None: calpha = asReal(alpha) # <<<<<<<<<<<<<< * if alpha2 is not None: calpha2 = asReal(alpha2) * if threshold is not None: cthreshold = asReal(threshold) */ __pyx_t_1 = (__pyx_v_alpha != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 662, __pyx_L1_error) __pyx_v_calpha = __pyx_t_4; } /* "PETSc/SNES.pyx":663 * if gamma is not None: cgamma = asReal(gamma) * if alpha is not None: calpha = asReal(alpha) * if alpha2 is not None: calpha2 = asReal(alpha2) # <<<<<<<<<<<<<< * if threshold is not None: cthreshold = asReal(threshold) * CHKERR( SNESKSPSetParametersEW( */ __pyx_t_2 = (__pyx_v_alpha2 != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha2); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 663, __pyx_L1_error) __pyx_v_calpha2 = __pyx_t_4; } /* "PETSc/SNES.pyx":664 * if alpha is not None: calpha = asReal(alpha) * if alpha2 is not None: calpha2 = asReal(alpha2) * if threshold is not None: cthreshold = asReal(threshold) # <<<<<<<<<<<<<< * CHKERR( SNESKSPSetParametersEW( * self.snes, cversion, crtol_0, crtol_max, */ __pyx_t_1 = (__pyx_v_threshold != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_threshold); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(41, 664, __pyx_L1_error) __pyx_v_cthreshold = __pyx_t_4; } /* "PETSc/SNES.pyx":665 * if alpha2 is not None: calpha2 = asReal(alpha2) * if threshold is not None: cthreshold = asReal(threshold) * CHKERR( SNESKSPSetParametersEW( # <<<<<<<<<<<<<< * self.snes, cversion, crtol_0, crtol_max, * cgamma, calpha, calpha2, cthreshold) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPSetParametersEW(__pyx_v_self->snes, __pyx_v_cversion, __pyx_v_crtol_0, __pyx_v_crtol_max, __pyx_v_cgamma, __pyx_v_calpha, __pyx_v_calpha2, __pyx_v_cthreshold)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(41, 665, __pyx_L1_error) /* "PETSc/SNES.pyx":647 * return toBool(flag) * * def setParamsEW(self, version=None, # <<<<<<<<<<<<<< * rtol_0=None, rtol_max=None, * gamma=None, alpha=None, alpha2=None, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setParamsEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":669 * cgamma, calpha, calpha2, cthreshold) ) * * def getParamsEW(self): # <<<<<<<<<<<<<< * cdef PetscInt version=0 * cdef PetscReal rtol_0=0, rtol_max=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_180getParamsEW[] = "SNES.getParamsEW(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getParamsEW(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getParamsEW (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getParamsEW", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getParamsEW", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_180getParamsEW(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getParamsEW(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_version; PetscReal __pyx_v_rtol_0; PetscReal __pyx_v_rtol_max; PetscReal __pyx_v_gamma; PetscReal __pyx_v_alpha; PetscReal __pyx_v_alpha2; PetscReal __pyx_v_threshold; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getParamsEW", 0); /* "PETSc/SNES.pyx":670 * * def getParamsEW(self): * cdef PetscInt version=0 # <<<<<<<<<<<<<< * cdef PetscReal rtol_0=0, rtol_max=0 * cdef PetscReal gamma=0, alpha=0, alpha2=0 */ __pyx_v_version = 0; /* "PETSc/SNES.pyx":671 * def getParamsEW(self): * cdef PetscInt version=0 * cdef PetscReal rtol_0=0, rtol_max=0 # <<<<<<<<<<<<<< * cdef PetscReal gamma=0, alpha=0, alpha2=0 * cdef PetscReal threshold=0 */ __pyx_v_rtol_0 = 0.0; __pyx_v_rtol_max = 0.0; /* "PETSc/SNES.pyx":672 * cdef PetscInt version=0 * cdef PetscReal rtol_0=0, rtol_max=0 * cdef PetscReal gamma=0, alpha=0, alpha2=0 # <<<<<<<<<<<<<< * cdef PetscReal threshold=0 * CHKERR( SNESKSPGetParametersEW( */ __pyx_v_gamma = 0.0; __pyx_v_alpha = 0.0; __pyx_v_alpha2 = 0.0; /* "PETSc/SNES.pyx":673 * cdef PetscReal rtol_0=0, rtol_max=0 * cdef PetscReal gamma=0, alpha=0, alpha2=0 * cdef PetscReal threshold=0 # <<<<<<<<<<<<<< * CHKERR( SNESKSPGetParametersEW( * self.snes, &version, &rtol_0, &rtol_max, */ __pyx_v_threshold = 0.0; /* "PETSc/SNES.pyx":674 * cdef PetscReal gamma=0, alpha=0, alpha2=0 * cdef PetscReal threshold=0 * CHKERR( SNESKSPGetParametersEW( # <<<<<<<<<<<<<< * self.snes, &version, &rtol_0, &rtol_max, * &gamma, &alpha, &alpha2, &threshold) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESKSPGetParametersEW(__pyx_v_self->snes, (&__pyx_v_version), (&__pyx_v_rtol_0), (&__pyx_v_rtol_max), (&__pyx_v_gamma), (&__pyx_v_alpha), (&__pyx_v_alpha2), (&__pyx_v_threshold))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 674, __pyx_L1_error) /* "PETSc/SNES.pyx":677 * self.snes, &version, &rtol_0, &rtol_max, * &gamma, &alpha, &alpha2, &threshold) ) * return {'version' : toInt(version), # <<<<<<<<<<<<<< * 'rtol_0' : toReal(rtol_0), * 'rtol_max' : toReal(rtol_max), */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_version, __pyx_t_3) < 0) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":678 * &gamma, &alpha, &alpha2, &threshold) ) * return {'version' : toInt(version), * 'rtol_0' : toReal(rtol_0), # <<<<<<<<<<<<<< * 'rtol_max' : toReal(rtol_max), * 'gamma' : toReal(gamma), */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rtol_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol_0, __pyx_t_3) < 0) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":679 * return {'version' : toInt(version), * 'rtol_0' : toReal(rtol_0), * 'rtol_max' : toReal(rtol_max), # <<<<<<<<<<<<<< * 'gamma' : toReal(gamma), * 'alpha' : toReal(alpha), */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rtol_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol_max, __pyx_t_3) < 0) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":680 * 'rtol_0' : toReal(rtol_0), * 'rtol_max' : toReal(rtol_max), * 'gamma' : toReal(gamma), # <<<<<<<<<<<<<< * 'alpha' : toReal(alpha), * 'alpha2' : toReal(alpha2), */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gamma, __pyx_t_3) < 0) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":681 * 'rtol_max' : toReal(rtol_max), * 'gamma' : toReal(gamma), * 'alpha' : toReal(alpha), # <<<<<<<<<<<<<< * 'alpha2' : toReal(alpha2), * 'threshold' : toReal(threshold),} */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alpha, __pyx_t_3) < 0) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":682 * 'gamma' : toReal(gamma), * 'alpha' : toReal(alpha), * 'alpha2' : toReal(alpha2), # <<<<<<<<<<<<<< * 'threshold' : toReal(threshold),} * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_alpha2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alpha2, __pyx_t_3) < 0) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":683 * 'alpha' : toReal(alpha), * 'alpha2' : toReal(alpha2), * 'threshold' : toReal(threshold),} # <<<<<<<<<<<<<< * * # --- matrix free / finite diferences --- */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_threshold); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_threshold, __pyx_t_3) < 0) __PYX_ERR(41, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":669 * cgamma, calpha, calpha2, cthreshold) ) * * def getParamsEW(self): # <<<<<<<<<<<<<< * cdef PetscInt version=0 * cdef PetscReal rtol_0=0, rtol_max=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getParamsEW", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":687 * # --- matrix free / finite diferences --- * * def setUseMF(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( SNESSetUseMFFD(self.snes, bval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_183setUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_182setUseMF[] = "SNES.setUseMF(self, flag=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_183setUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseMF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseMF") < 0)) __PYX_ERR(41, 687, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseMF", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 687, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_182setUseMF(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setUseMF(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseMF", 0); /* "PETSc/SNES.pyx":688 * * def setUseMF(self, flag=True): * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( SNESSetUseMFFD(self.snes, bval) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 688, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "PETSc/SNES.pyx":689 * def setUseMF(self, flag=True): * cdef PetscBool bval = flag * CHKERR( SNESSetUseMFFD(self.snes, bval) ) # <<<<<<<<<<<<<< * * def getUseMF(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUseMFFD(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 689, __pyx_L1_error) /* "PETSc/SNES.pyx":687 * # --- matrix free / finite diferences --- * * def setUseMF(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( SNESSetUseMFFD(self.snes, bval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":691 * CHKERR( SNESSetUseMFFD(self.snes, bval) ) * * def getUseMF(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_185getUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_184getUseMF[] = "SNES.getUseMF(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_185getUseMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUseMF (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getUseMF", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseMF", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_184getUseMF(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184getUseMF(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUseMF", 0); /* "PETSc/SNES.pyx":692 * * def getUseMF(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/SNES.pyx":693 * def getUseMF(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetUseMFFD(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 693, __pyx_L1_error) /* "PETSc/SNES.pyx":694 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setUseFD(self, flag=True): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":691 * CHKERR( SNESSetUseMFFD(self.snes, bval) ) * * def getUseMF(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseMFFD(self.snes, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUseMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":696 * return toBool(flag) * * def setUseFD(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187setUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_186setUseFD[] = "SNES.setUseFD(self, flag=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187setUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUseFD (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUseFD") < 0)) __PYX_ERR(41, 696, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUseFD", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 696, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseFD", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_186setUseFD(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186setUseFD(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUseFD", 0); /* "PETSc/SNES.pyx":697 * * def setUseFD(self, flag=True): * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 697, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "PETSc/SNES.pyx":698 * def setUseFD(self, flag=True): * cdef PetscBool bval = flag * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) # <<<<<<<<<<<<<< * * def getUseFD(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUseFDColoring(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 698, __pyx_L1_error) /* "PETSc/SNES.pyx":696 * return toBool(flag) * * def setUseFD(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseFD", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":700 * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) * * def getUseFD(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_188getUseFD[] = "SNES.getUseFD(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getUseFD(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getUseFD (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getUseFD", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getUseFD", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_188getUseFD(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_188getUseFD(struct PyPetscSNESObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getUseFD", 0); /* "PETSc/SNES.pyx":701 * * def getUseFD(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/SNES.pyx":702 * def getUseFD(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetUseFDColoring(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 702, __pyx_L1_error) /* "PETSc/SNES.pyx":703 * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # --- VI --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":700 * CHKERR( SNESSetUseFDColoring(self.snes, bval) ) * * def getUseFD(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( SNESGetUseFDColoring(self.snes, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUseFD", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":707 * # --- VI --- * * def setVariableBounds(self, Vec xl, Vec xu): # <<<<<<<<<<<<<< * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191setVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_190setVariableBounds[] = "SNES.setVariableBounds(self, Vec xl, Vec xu)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191setVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVariableBounds (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xl,&__pyx_n_s_xu,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xu)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setVariableBounds", 1, 2, 2, 1); __PYX_ERR(41, 707, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVariableBounds") < 0)) __PYX_ERR(41, 707, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_xl = ((struct PyPetscVecObject *)values[0]); __pyx_v_xu = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVariableBounds", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 707, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(41, 707, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(41, 707, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_190setVariableBounds(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190setVariableBounds(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVariableBounds", 0); /* "PETSc/SNES.pyx":708 * * def setVariableBounds(self, Vec xl, Vec xu): * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * * def getVIInactiveSet(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESVISetVariableBounds(__pyx_v_self->snes, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 708, __pyx_L1_error) /* "PETSc/SNES.pyx":707 * # --- VI --- * * def setVariableBounds(self, Vec xl, Vec xu): # <<<<<<<<<<<<<< * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":710 * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) * * def getVIInactiveSet(self): # <<<<<<<<<<<<<< * cdef IS inact = IS() * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getVIInactiveSet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_192getVIInactiveSet[] = "SNES.getVIInactiveSet(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getVIInactiveSet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVIInactiveSet (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getVIInactiveSet", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVIInactiveSet", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_192getVIInactiveSet(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_192getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self) { struct PyPetscISObject *__pyx_v_inact = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVIInactiveSet", 0); /* "PETSc/SNES.pyx":711 * * def getVIInactiveSet(self): * cdef IS inact = IS() # <<<<<<<<<<<<<< * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) * PetscINCREF(inact.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_inact = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":712 * def getVIInactiveSet(self): * cdef IS inact = IS() * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) # <<<<<<<<<<<<<< * PetscINCREF(inact.obj) * return inact */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESVIGetInactiveSet(__pyx_v_self->snes, (&__pyx_v_inact->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 712, __pyx_L1_error) /* "PETSc/SNES.pyx":713 * cdef IS inact = IS() * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) * PetscINCREF(inact.obj) # <<<<<<<<<<<<<< * return inact * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_inact->__pyx_base.obj)); /* "PETSc/SNES.pyx":714 * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) * PetscINCREF(inact.obj) * return inact # <<<<<<<<<<<<<< * * # --- Python --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_inact)); __pyx_r = ((PyObject *)__pyx_v_inact); goto __pyx_L0; /* "PETSc/SNES.pyx":710 * CHKERR( SNESVISetVariableBounds(self.snes, xl.vec, xu.vec) ) * * def getVIInactiveSet(self): # <<<<<<<<<<<<<< * cdef IS inact = IS() * CHKERR( SNESVIGetInactiveSet(self.snes, &inact.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getVIInactiveSet", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_inact); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":718 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_195createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_194createPython[] = "SNES.createPython(self, context=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_195createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(41, 718, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 718, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_194createPython(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194createPython(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; SNES __pyx_v_newsnes; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 0); /* "PETSc/SNES.pyx":719 * * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 719, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/SNES.pyx":720 * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL # <<<<<<<<<<<<<< * CHKERR( SNESCreate(ccomm, &newsnes) ) * PetscCLEAR(self.obj); self.snes = newsnes */ __pyx_v_newsnes = NULL; /* "PETSc/SNES.pyx":721 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.snes = newsnes * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCreate(__pyx_v_ccomm, (&__pyx_v_newsnes))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 721, __pyx_L1_error) /* "PETSc/SNES.pyx":722 * cdef PetscSNES newsnes = NULL * CHKERR( SNESCreate(ccomm, &newsnes) ) * PetscCLEAR(self.obj); self.snes = newsnes # <<<<<<<<<<<<<< * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) * CHKERR( SNESPythonSetContext(self.snes, context) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->snes = __pyx_v_newsnes; /* "PETSc/SNES.pyx":723 * CHKERR( SNESCreate(ccomm, &newsnes) ) * PetscCLEAR(self.obj); self.snes = newsnes * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetContext(self.snes, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetType(__pyx_v_self->snes, SNESPYTHON)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 723, __pyx_L1_error) /* "PETSc/SNES.pyx":724 * PetscCLEAR(self.obj); self.snes = newsnes * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) * CHKERR( SNESPythonSetContext(self.snes, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPythonSetContext(__pyx_v_self->snes, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 724, __pyx_L1_error) /* "PETSc/SNES.pyx":725 * CHKERR( SNESSetType(self.snes, SNESPYTHON) ) * CHKERR( SNESPythonSetContext(self.snes, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/SNES.pyx":718 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscSNES newsnes = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":727 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetContext(self.snes, context) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_197setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_196setPythonContext[] = "SNES.setPythonContext(self, context)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_197setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(41, 727, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 727, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_196setPythonContext(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196setPythonContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 0); /* "PETSc/SNES.pyx":728 * * def setPythonContext(self, context): * CHKERR( SNESPythonSetContext(self.snes, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPythonSetContext(__pyx_v_self->snes, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 728, __pyx_L1_error) /* "PETSc/SNES.pyx":727 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetContext(self.snes, context) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":730 * CHKERR( SNESPythonSetContext(self.snes, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( SNESPythonGetContext(self.snes, &context) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_199getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_198getPythonContext[] = "SNES.getPythonContext(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_199getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_198getPythonContext(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198getPythonContext(struct PyPetscSNESObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 0); /* "PETSc/SNES.pyx":731 * * def getPythonContext(self): * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( SNESPythonGetContext(self.snes, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "PETSc/SNES.pyx":732 * def getPythonContext(self): * cdef void *context = NULL * CHKERR( SNESPythonGetContext(self.snes, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPythonGetContext(__pyx_v_self->snes, (&__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 732, __pyx_L1_error) /* "PETSc/SNES.pyx":733 * cdef void *context = NULL * CHKERR( SNESPythonGetContext(self.snes, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_2 = ((__pyx_v_context == NULL) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/SNES.pyx":734 * CHKERR( SNESPythonGetContext(self.snes, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "PETSc/SNES.pyx":730 * CHKERR( SNESPythonSetContext(self.snes, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( SNESPythonGetContext(self.snes, &context) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":736 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_201setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_200setPythonType[] = "SNES.setPythonType(self, py_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_201setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_py_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(41, 736, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 736, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_200setPythonType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200setPythonType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "PETSc/SNES.pyx":737 * * def setPythonType(self, py_type): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( SNESPythonSetType(self.snes, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/SNES.pyx":738 * def setPythonType(self, py_type): * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( SNESPythonSetType(self.snes, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":739 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( SNESPythonSetType(self.snes, cval) ) # <<<<<<<<<<<<<< * * # --- Composite --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPythonSetType(__pyx_v_self->snes, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 739, __pyx_L1_error) /* "PETSc/SNES.pyx":736 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":743 * # --- Composite --- * * def getCompositeSNES(self, n): # <<<<<<<<<<<<<< * cdef PetscInt cn * cdef SNES snes = SNES() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_203getCompositeSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_202getCompositeSNES[] = "SNES.getCompositeSNES(self, n)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_203getCompositeSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCompositeSNES (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCompositeSNES") < 0)) __PYX_ERR(41, 743, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCompositeSNES", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 743, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getCompositeSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_202getCompositeSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202getCompositeSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_cn; struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCompositeSNES", 0); /* "PETSc/SNES.pyx":745 * def getCompositeSNES(self, n): * cdef PetscInt cn * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * cn = asInt(n) * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":746 * cdef PetscInt cn * cdef SNES snes = SNES() * cn = asInt(n) # <<<<<<<<<<<<<< * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) * PetscINCREF(snes.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 746, __pyx_L1_error) __pyx_v_cn = __pyx_t_2; /* "PETSc/SNES.pyx":747 * cdef SNES snes = SNES() * cn = asInt(n) * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(snes.obj) * return snes */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCompositeGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 747, __pyx_L1_error) /* "PETSc/SNES.pyx":748 * cn = asInt(n) * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) * PetscINCREF(snes.obj) # <<<<<<<<<<<<<< * return snes * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); /* "PETSc/SNES.pyx":749 * CHKERR( SNESCompositeGetSNES(self.snes, cn, &snes.snes) ) * PetscINCREF(snes.obj) * return snes # <<<<<<<<<<<<<< * * def getCompositeNumber(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_snes)); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "PETSc/SNES.pyx":743 * # --- Composite --- * * def getCompositeSNES(self, n): # <<<<<<<<<<<<<< * cdef PetscInt cn * cdef SNES snes = SNES() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getCompositeSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":751 * return snes * * def getCompositeNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt cn = 0 * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_205getCompositeNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_204getCompositeNumber[] = "SNES.getCompositeNumber(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_205getCompositeNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCompositeNumber (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCompositeNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCompositeNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_204getCompositeNumber(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_204getCompositeNumber(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_cn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCompositeNumber", 0); /* "PETSc/SNES.pyx":752 * * def getCompositeNumber(self): * cdef PetscInt cn = 0 # <<<<<<<<<<<<<< * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) * return toInt(cn) */ __pyx_v_cn = 0; /* "PETSc/SNES.pyx":753 * def getCompositeNumber(self): * cdef PetscInt cn = 0 * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) # <<<<<<<<<<<<<< * return toInt(cn) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCompositeGetNumber(__pyx_v_self->snes, (&__pyx_v_cn))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 753, __pyx_L1_error) /* "PETSc/SNES.pyx":754 * cdef PetscInt cn = 0 * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) * return toInt(cn) # <<<<<<<<<<<<<< * * # --- NASM --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cn); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":751 * return snes * * def getCompositeNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt cn = 0 * CHKERR( SNESCompositeGetNumber(self.snes, &cn) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getCompositeNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":758 * # --- NASM --- * * def getNASMSNES(self, n): # <<<<<<<<<<<<<< * cdef PetscInt cn = asInt(n) * cdef SNES snes = SNES() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207getNASMSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_206getNASMSNES[] = "SNES.getNASMSNES(self, n)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207getNASMSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNASMSNES (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getNASMSNES") < 0)) __PYX_ERR(41, 758, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getNASMSNES", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 758, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNASMSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_206getNASMSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206getNASMSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_cn; struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNASMSNES", 0); /* "PETSc/SNES.pyx":759 * * def getNASMSNES(self, n): * cdef PetscInt cn = asInt(n) # <<<<<<<<<<<<<< * cdef SNES snes = SNES() * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 759, __pyx_L1_error) __pyx_v_cn = __pyx_t_1; /* "PETSc/SNES.pyx":760 * def getNASMSNES(self, n): * cdef PetscInt cn = asInt(n) * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) * PetscINCREF(snes.obj) */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/SNES.pyx":761 * cdef PetscInt cn = asInt(n) * cdef SNES snes = SNES() * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(snes.obj) * return snes */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNASMGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(41, 761, __pyx_L1_error) /* "PETSc/SNES.pyx":762 * cdef SNES snes = SNES() * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) * PetscINCREF(snes.obj) # <<<<<<<<<<<<<< * return snes * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); /* "PETSc/SNES.pyx":763 * CHKERR( SNESNASMGetSNES(self.snes, cn, &snes.snes) ) * PetscINCREF(snes.obj) * return snes # <<<<<<<<<<<<<< * * def getNASMNumber(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_snes)); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "PETSc/SNES.pyx":758 * # --- NASM --- * * def getNASMSNES(self, n): # <<<<<<<<<<<<<< * cdef PetscInt cn = asInt(n) * cdef SNES snes = SNES() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNASMSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":765 * return snes * * def getNASMNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt cn = 0 * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_209getNASMNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_208getNASMNumber[] = "SNES.getNASMNumber(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_209getNASMNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNASMNumber (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNASMNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNASMNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_208getNASMNumber(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_208getNASMNumber(struct PyPetscSNESObject *__pyx_v_self) { PetscInt __pyx_v_cn; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNASMNumber", 0); /* "PETSc/SNES.pyx":766 * * def getNASMNumber(self): * cdef PetscInt cn = 0 # <<<<<<<<<<<<<< * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) * return toInt(cn) */ __pyx_v_cn = 0; /* "PETSc/SNES.pyx":767 * def getNASMNumber(self): * cdef PetscInt cn = 0 * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) # <<<<<<<<<<<<<< * return toInt(cn) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNASMGetNumber(__pyx_v_self->snes, (&__pyx_v_cn))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 767, __pyx_L1_error) /* "PETSc/SNES.pyx":768 * cdef PetscInt cn = 0 * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) * return toInt(cn) # <<<<<<<<<<<<<< * * # --- Patch --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cn); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":765 * return snes * * def getNASMNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt cn = 0 * CHKERR( SNESNASMGetNumber(self.snes, &cn) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNASMNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":772 * # --- Patch --- * * def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_210setPatchCellNumbering[] = "SNES.setPatchCellNumbering(self, Section sec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211setPatchCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchCellNumbering (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchCellNumbering") < 0)) __PYX_ERR(41, 772, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 772, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(41, 772, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_210setPatchCellNumbering(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210setPatchCellNumbering(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchCellNumbering", 0); /* "PETSc/SNES.pyx":773 * * def setPatchCellNumbering(self, Section sec not None): * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) # <<<<<<<<<<<<<< * * def setPatchDiscretisationInfo(self, dms, bs, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetCellNumbering(__pyx_v_self->snes, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(41, 773, __pyx_L1_error) /* "PETSc/SNES.pyx":772 * # --- Patch --- * * def setPatchCellNumbering(self, Section sec not None): # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":775 * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_212setPatchDiscretisationInfo[] = "SNES.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213setPatchDiscretisationInfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dms = 0; PyObject *__pyx_v_bs = 0; PyObject *__pyx_v_cellNodeMaps = 0; PyObject *__pyx_v_subspaceOffsets = 0; PyObject *__pyx_v_ghostBcNodes = 0; PyObject *__pyx_v_globalBcNodes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchDiscretisationInfo (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dms,&__pyx_n_s_bs,&__pyx_n_s_cellNodeMaps,&__pyx_n_s_subspaceOffsets,&__pyx_n_s_ghostBcNodes,&__pyx_n_s_globalBcNodes,0}; PyObject* values[6] = {0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dms)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 1); __PYX_ERR(41, 775, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cellNodeMaps)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 2); __PYX_ERR(41, 775, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subspaceOffsets)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 3); __PYX_ERR(41, 775, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ghostBcNodes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 4); __PYX_ERR(41, 775, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_globalBcNodes)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, 5); __PYX_ERR(41, 775, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchDiscretisationInfo") < 0)) __PYX_ERR(41, 775, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); } __pyx_v_dms = values[0]; __pyx_v_bs = values[1]; __pyx_v_cellNodeMaps = values[2]; __pyx_v_subspaceOffsets = values[3]; __pyx_v_ghostBcNodes = values[4]; __pyx_v_globalBcNodes = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 775, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_212setPatchDiscretisationInfo(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_dms, __pyx_v_bs, __pyx_v_cellNodeMaps, __pyx_v_subspaceOffsets, __pyx_v_ghostBcNodes, __pyx_v_globalBcNodes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212setPatchDiscretisationInfo(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_dms, PyObject *__pyx_v_bs, PyObject *__pyx_v_cellNodeMaps, PyObject *__pyx_v_subspaceOffsets, PyObject *__pyx_v_ghostBcNodes, PyObject *__pyx_v_globalBcNodes) { PetscInt __pyx_v_numSubSpaces; PetscInt __pyx_v_numGhostBcs; PetscInt __pyx_v_numGlobalBcs; PetscInt *__pyx_v_nodesPerCell; PetscInt const **__pyx_v_ccellNodeMaps; DM *__pyx_v_cdms; PetscInt *__pyx_v_cbs; PetscInt *__pyx_v_csubspaceOffsets; PetscInt *__pyx_v_cghostBcNodes; PetscInt *__pyx_v_cglobalBcNodes; PetscInt __pyx_v_i; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_v_nodes = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PetscInt __pyx_t_3; PetscInt __pyx_t_4; PetscInt __pyx_t_5; DM __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PetscInt __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchDiscretisationInfo", 0); __Pyx_INCREF(__pyx_v_bs); __Pyx_INCREF(__pyx_v_subspaceOffsets); __Pyx_INCREF(__pyx_v_ghostBcNodes); __Pyx_INCREF(__pyx_v_globalBcNodes); /* "PETSc/SNES.pyx":780 * ghostBcNodes, * globalBcNodes): * cdef PetscInt numSubSpaces = 0 # <<<<<<<<<<<<<< * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL */ __pyx_v_numSubSpaces = 0; /* "PETSc/SNES.pyx":781 * globalBcNodes): * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 # <<<<<<<<<<<<<< * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL */ __pyx_v_numGhostBcs = 0; __pyx_v_numGlobalBcs = 0; /* "PETSc/SNES.pyx":782 * cdef PetscInt numSubSpaces = 0 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL # <<<<<<<<<<<<<< * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL */ __pyx_v_nodesPerCell = NULL; /* "PETSc/SNES.pyx":783 * cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL # <<<<<<<<<<<<<< * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL */ __pyx_v_ccellNodeMaps = NULL; /* "PETSc/SNES.pyx":784 * cdef PetscInt *nodesPerCell = NULL * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL */ __pyx_v_cdms = NULL; /* "PETSc/SNES.pyx":785 * cdef const PetscInt **ccellNodeMaps = NULL * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL # <<<<<<<<<<<<<< * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL */ __pyx_v_cbs = NULL; /* "PETSc/SNES.pyx":786 * cdef PetscDM *cdms = NULL * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL */ __pyx_v_csubspaceOffsets = NULL; /* "PETSc/SNES.pyx":787 * cdef PetscInt *cbs = NULL * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 */ __pyx_v_cghostBcNodes = NULL; /* "PETSc/SNES.pyx":788 * cdef PetscInt *csubspaceOffsets = NULL * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL # <<<<<<<<<<<<<< * cdef PetscInt i = 0 * */ __pyx_v_cglobalBcNodes = NULL; /* "PETSc/SNES.pyx":789 * cdef PetscInt *cghostBcNodes = NULL * cdef PetscInt *cglobalBcNodes = NULL * cdef PetscInt i = 0 # <<<<<<<<<<<<<< * * bs = iarray_i(bs, &numSubSpaces, &cbs) */ __pyx_v_i = 0; /* "PETSc/SNES.pyx":791 * cdef PetscInt i = 0 * * bs = iarray_i(bs, &numSubSpaces, &cbs) # <<<<<<<<<<<<<< * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_bs, (&__pyx_v_numSubSpaces), (&__pyx_v_cbs))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_bs, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":792 * * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) # <<<<<<<<<<<<<< * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_ghostBcNodes, (&__pyx_v_numGhostBcs), (&__pyx_v_cghostBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ghostBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":793 * bs = iarray_i(bs, &numSubSpaces, &cbs) * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) # <<<<<<<<<<<<<< * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_globalBcNodes, (&__pyx_v_numGlobalBcs), (&__pyx_v_cglobalBcNodes))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_globalBcNodes, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":794 * ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes) * globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes) * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) # <<<<<<<<<<<<<< * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_subspaceOffsets, NULL, (&__pyx_v_csubspaceOffsets))); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_subspaceOffsets, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":796 * subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets) * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt))), (&__pyx_v_nodesPerCell))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 796, __pyx_L1_error) /* "PETSc/SNES.pyx":797 * * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(DM))), (&__pyx_v_cdms))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 797, __pyx_L1_error) /* "PETSc/SNES.pyx":798 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt), &nodesPerCell) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) # <<<<<<<<<<<<<< * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_numSubSpaces) * (sizeof(PetscInt *))), (&__pyx_v_ccellNodeMaps))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 798, __pyx_L1_error) /* "PETSc/SNES.pyx":799 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscDM), &cdms) ) * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): # <<<<<<<<<<<<<< * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape */ __pyx_t_3 = __pyx_v_numSubSpaces; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "PETSc/SNES.pyx":800 * CHKERR( PetscMalloc(numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps) ) * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm # <<<<<<<<<<<<<< * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(41, 800, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscDMObject *)__pyx_t_1)->dm; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cdms[__pyx_v_i]) = __pyx_t_6; /* "PETSc/SNES.pyx":801 * for i in range(numSubSpaces): * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape # <<<<<<<<<<<<<< * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_asarray(__pyx_t_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(41, 801, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_7 = PyList_GET_ITEM(sequence, 0); __pyx_t_8 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); #else __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(41, 801, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(41, 801, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_nodes, __pyx_t_8); __pyx_t_8 = 0; /* "PETSc/SNES.pyx":802 * cdms[i] = (dms[i]).dm * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) # <<<<<<<<<<<<<< * nodesPerCell[i] = asInt(nodes) * */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, NULL, ((PetscInt **)(&(__pyx_v_ccellNodeMaps[__pyx_v_i]))))); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, __pyx_t_8, PetscInt, 1, __Pyx_PyInt_From_PetscInt, 0, 1, 1) < 0)) __PYX_ERR(41, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "PETSc/SNES.pyx":803 * _, nodes = asarray(cellNodeMaps[i]).shape * cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, &(ccellNodeMaps[i])) * nodesPerCell[i] = asInt(nodes) # <<<<<<<<<<<<<< * * # TODO: refactor on the PETSc side to take ISes? */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nodes); if (unlikely(__pyx_t_11 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(41, 803, __pyx_L1_error) (__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11; } /* "PETSc/SNES.pyx":806 * * # TODO: refactor on the PETSc side to take ISes? * CHKERR( SNESPatchSetDiscretisationInfo(self.snes, numSubSpaces, # <<<<<<<<<<<<<< * cdms, cbs, nodesPerCell, * ccellNodeMaps, csubspaceOffsets, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetDiscretisationInfo(__pyx_v_self->snes, __pyx_v_numSubSpaces, __pyx_v_cdms, __pyx_v_cbs, __pyx_v_nodesPerCell, __pyx_v_ccellNodeMaps, __pyx_v_csubspaceOffsets, __pyx_v_numGhostBcs, __pyx_v_cghostBcNodes, __pyx_v_numGlobalBcs, __pyx_v_cglobalBcNodes)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 806, __pyx_L1_error) /* "PETSc/SNES.pyx":811 * numGhostBcs, cghostBcNodes, * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_nodesPerCell)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 811, __pyx_L1_error) /* "PETSc/SNES.pyx":812 * numGlobalBcs, cglobalBcNodes) ) * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(ccellNodeMaps) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cdms)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 812, __pyx_L1_error) /* "PETSc/SNES.pyx":813 * CHKERR( PetscFree(nodesPerCell) ) * CHKERR( PetscFree(cdms) ) * CHKERR( PetscFree(ccellNodeMaps) ) # <<<<<<<<<<<<<< * * def setPatchComputeOperator(self, operator, args=None, kargs=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccellNodeMaps)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(41, 813, __pyx_L1_error) /* "PETSc/SNES.pyx":775 * CHKERR( SNESPatchSetCellNumbering(self.snes, sec.sec) ) * * def setPatchDiscretisationInfo(self, dms, bs, # <<<<<<<<<<<<<< * cellNodeMaps, * subspaceOffsets, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchDiscretisationInfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XDECREF(__pyx_v_nodes); __Pyx_XDECREF(__pyx_v_bs); __Pyx_XDECREF(__pyx_v_subspaceOffsets); __Pyx_XDECREF(__pyx_v_ghostBcNodes); __Pyx_XDECREF(__pyx_v_globalBcNodes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":815 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_215setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_214setPatchComputeOperator[] = "SNES.setPatchComputeOperator(self, operator, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_215setPatchComputeOperator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeOperator (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeOperator") < 0)) __PYX_ERR(41, 815, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operator = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 815, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_214setPatchComputeOperator(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214setPatchComputeOperator(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeOperator", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":816 * * def setPatchComputeOperator(self, operator, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operator, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":817 * def setPatchComputeOperator(self, operator, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":818 * if args is None: args = () * if kargs is None: kargs = {} * context = (operator, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_operator__", context) * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":819 * if kargs is None: kargs = {} * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":820 * context = (operator, args, kargs) * self.set_attr("__patch_compute_operator__", context) * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) # <<<<<<<<<<<<<< * * def setPatchComputeFunction(self, function, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetComputeOperator(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 820, __pyx_L1_error) /* "PETSc/SNES.pyx":815 * CHKERR( PetscFree(ccellNodeMaps) ) * * def setPatchComputeOperator(self, operator, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeOperator", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":822 * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_217setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_216setPatchComputeFunction[] = "SNES.setPatchComputeFunction(self, function, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_217setPatchComputeFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchComputeFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchComputeFunction") < 0)) __PYX_ERR(41, 822, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 822, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_216setPatchComputeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216setPatchComputeFunction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchComputeFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":823 * * def setPatchComputeFunction(self, function, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":824 * def setPatchComputeFunction(self, function, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":825 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__patch_compute_function__", context) * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":826 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_compute_function__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":827 * context = (function, args, kargs) * self.set_attr("__patch_compute_function__", context) * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) # <<<<<<<<<<<<<< * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetComputeFunction(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_PCPatch_ComputeFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(41, 827, __pyx_L1_error) /* "PETSc/SNES.pyx":822 * CHKERR( SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, context) ) * * def setPatchComputeFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchComputeFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":829 * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_219setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4SNES_218setPatchConstructType[] = "SNES.setPatchConstructType(self, typ, operator=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_219setPatchConstructType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_typ = 0; PyObject *__pyx_v_operator = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPatchConstructType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typ,&__pyx_n_s_operator,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_typ)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operator); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPatchConstructType") < 0)) __PYX_ERR(41, 829, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_typ = values[0]; __pyx_v_operator = values[1]; __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(41, 829, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_218setPatchConstructType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218setPatchConstructType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_typ, PyObject *__pyx_v_operator, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PCPatchConstructType __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPatchConstructType", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/SNES.pyx":830 * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/SNES.pyx":831 * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/SNES.pyx":833 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ __Pyx_INCREF(__pyx_v_typ); __pyx_t_3 = __pyx_v_typ; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L8_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_n_s_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(41, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_6; __pyx_L8_bool_binop_done:; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (__pyx_t_2 != 0); if (__pyx_t_6) { } else { __pyx_t_1 = __pyx_t_6; goto __pyx_L6_bool_binop_done; } __pyx_t_6 = (__pyx_v_operator == Py_None); __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L6_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "PETSc/SNES.pyx":834 * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") # <<<<<<<<<<<<<< * if operator is not None: * context = (operator, args, kargs) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(41, 834, __pyx_L1_error) /* "PETSc/SNES.pyx":833 * if kargs is None: kargs = {} * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: */ } /* "PETSc/SNES.pyx":835 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ __pyx_t_1 = (__pyx_v_operator != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/SNES.pyx":836 * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: * context = (operator, args, kargs) # <<<<<<<<<<<<<< * else: * context = None */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_operator); __Pyx_GIVEREF(__pyx_v_operator); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operator); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":835 * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") * if operator is not None: # <<<<<<<<<<<<<< * context = (operator, args, kargs) * else: */ goto __pyx_L10; } /* "PETSc/SNES.pyx":838 * context = (operator, args, kargs) * else: * context = None # <<<<<<<<<<<<<< * self.set_attr("__patch_construction_operator__", context) * CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, context) ) */ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_context = ((PyObject*)Py_None); } __pyx_L10:; /* "PETSc/SNES.pyx":839 * else: * context = None * self.set_attr("__patch_construction_operator__", context) # <<<<<<<<<<<<<< * CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__patch_construction_operator__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":840 * context = None * self.set_attr("__patch_construction_operator__", context) * CHKERR( SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, context) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_7 = ((PCPatchConstructType)__Pyx_PyInt_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 840, __pyx_L1_error) __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetConstructType(__pyx_v_self->snes, __pyx_t_7, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(41, 840, __pyx_L1_error) /* "PETSc/SNES.pyx":829 * CHKERR( SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, context) ) * * def setPatchConstructType(self, typ, operator=None, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.SNES.setPatchConstructType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":845 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6appctx___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":846 * property appctx: * def __get__(self): * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":845 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":847 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6appctx_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":848 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":847 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":853 * * property dm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_2dm___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":854 * property dm: * def __get__(self): * return self.getDM() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setDM(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":853 * * property dm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":855 * def __get__(self): * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_2dm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":856 * return self.getDM() * def __set__(self, value): * self.setDM(value) # <<<<<<<<<<<<<< * * # --- nonlinear preconditioner --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":855 * def __get__(self): * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":861 * * property npc: * def __get__(self): # <<<<<<<<<<<<<< * return self.getNPC() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3npc___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":862 * property npc: * def __get__(self): * return self.getNPC() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setNPC(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getNPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":861 * * property npc: * def __get__(self): # <<<<<<<<<<<<<< * return self.getNPC() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.npc.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":863 * def __get__(self): * return self.getNPC() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNPC(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_3npc_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":864 * return self.getNPC() * def __set__(self, value): * self.setNPC(value) # <<<<<<<<<<<<<< * * # --- vectors --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setNPC); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":863 * def __get__(self): * return self.getNPC() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setNPC(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.npc.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":869 * * property vec_sol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_sol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_sol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_sol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":870 * property vec_sol: * def __get__(self): * return self.getSolution() # <<<<<<<<<<<<<< * * property vec_upd: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":869 * * property vec_sol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":873 * * property vec_upd: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolutionUpdate() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_upd_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_upd_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_upd___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":874 * property vec_upd: * def __get__(self): * return self.getSolutionUpdate() # <<<<<<<<<<<<<< * * property vec_rhs: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolutionUpdate); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":873 * * property vec_upd: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolutionUpdate() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_upd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":877 * * property vec_rhs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRhs() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_rhs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7vec_rhs_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7vec_rhs___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":878 * property vec_rhs: * def __get__(self): * return self.getRhs() # <<<<<<<<<<<<<< * * # --- linear solver --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRhs); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":877 * * property vec_rhs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRhs() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.vec_rhs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":883 * * property ksp: * def __get__(self): # <<<<<<<<<<<<<< * return self.getKSP() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3ksp___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":884 * property ksp: * def __get__(self): * return self.getKSP() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setKSP(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":883 * * property ksp: * def __get__(self): # <<<<<<<<<<<<<< * return self.getKSP() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.ksp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":885 * def __get__(self): * return self.getKSP() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setKSP(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_3ksp_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":886 * return self.getKSP() * def __set__(self, value): * self.setKSP(value) # <<<<<<<<<<<<<< * * property use_ew: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":885 * def __get__(self): * return self.getKSP() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setKSP(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.ksp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":889 * * property use_ew: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseEW() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":890 * property use_ew: * def __get__(self): * return self.getUseEW() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setUseEW(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseEW); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":889 * * property use_ew: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseEW() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_ew.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":891 * def __get__(self): * return self.getUseEW() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseEW(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_ew_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":892 * return self.getUseEW() * def __set__(self, value): * self.setUseEW(value) # <<<<<<<<<<<<<< * * # --- tolerances --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseEW); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":891 * def __get__(self): * return self.getUseEW() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseEW(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_ew.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":897 * * property rtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4rtol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":898 * property rtol: * def __get__(self): * return self.getTolerances()[0] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(rtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":897 * * property rtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":899 * def __get__(self): * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4rtol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":900 * return self.getTolerances()[0] * def __set__(self, value): * self.setTolerances(rtol=value) # <<<<<<<<<<<<<< * * property atol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(41, 900, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":899 * def __get__(self): * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":903 * * property atol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4atol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":904 * property atol: * def __get__(self): * return self.getTolerances()[1] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(atol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":903 * * property atol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":905 * def __get__(self): * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4atol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":906 * return self.getTolerances()[1] * def __set__(self, value): * self.setTolerances(atol=value) # <<<<<<<<<<<<<< * * property stol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(41, 906, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 906, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":905 * def __get__(self): * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":909 * * property stol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4stol___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":910 * property stol: * def __get__(self): * return self.getTolerances()[2] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(stol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":909 * * property stol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[2] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.stol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":911 * def __get__(self): * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(stol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4stol_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":912 * return self.getTolerances()[2] * def __set__(self, value): * self.setTolerances(stol=value) # <<<<<<<<<<<<<< * * property max_it: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_stol, __pyx_v_value) < 0) __PYX_ERR(41, 912, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":911 * def __get__(self): * return self.getTolerances()[2] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(stol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.stol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":915 * * property max_it: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6max_it___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":916 * property max_it: * def __get__(self): * return self.getTolerances()[3] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(max_it=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":915 * * property max_it: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[3] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_it.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":917 * def __get__(self): * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6max_it_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":918 * return self.getTolerances()[3] * def __set__(self, value): * self.setTolerances(max_it=value) # <<<<<<<<<<<<<< * * # --- more tolerances --- */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_it, __pyx_v_value) < 0) __PYX_ERR(41, 918, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":917 * def __get__(self): * return self.getTolerances()[3] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(max_it=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_it.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":923 * * property max_funcs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getMaxFunctionEvaluations() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":924 * property max_funcs: * def __get__(self): * return self.getMaxFunctionEvaluations() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setMaxFunctionEvaluations(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getMaxFunctionEvaluations); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":923 * * property max_funcs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getMaxFunctionEvaluations() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_funcs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":925 * def __get__(self): * return self.getMaxFunctionEvaluations() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxFunctionEvaluations(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_9max_funcs_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":926 * return self.getMaxFunctionEvaluations() * def __set__(self, value): * self.setMaxFunctionEvaluations(value) # <<<<<<<<<<<<<< * * # --- iteration --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setMaxFunctionEvaluations); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":925 * def __get__(self): * return self.getMaxFunctionEvaluations() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxFunctionEvaluations(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.max_funcs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":931 * * property its: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_3its___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":932 * property its: * def __get__(self): * return self.getIterationNumber() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setIterationNumber(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":931 * * property its: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIterationNumber() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":933 * def __get__(self): * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_3its_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_3its_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":934 * return self.getIterationNumber() * def __set__(self, value): * self.setIterationNumber(value) # <<<<<<<<<<<<<< * * property norm: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":933 * def __get__(self): * return self.getIterationNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setIterationNumber(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.its.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":937 * * property norm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getFunctionNorm() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_4norm___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":938 * property norm: * def __get__(self): * return self.getFunctionNorm() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setFunctionNorm(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFunctionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":937 * * property norm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getFunctionNorm() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.norm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":939 * def __get__(self): * return self.getFunctionNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setFunctionNorm(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_4norm_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":940 * return self.getFunctionNorm() * def __set__(self, value): * self.setFunctionNorm(value) # <<<<<<<<<<<<<< * * property history: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setFunctionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":939 * def __get__(self): * return self.getFunctionNorm() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setFunctionNorm(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.norm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":943 * * property history: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7history_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7history_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7history___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":944 * property history: * def __get__(self): * return self.getConvergenceHistory() # <<<<<<<<<<<<<< * * # --- convergence --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergenceHistory); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":943 * * property history: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergenceHistory() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.history.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":949 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6reason___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":950 * property reason: * def __get__(self): * return self.getConvergedReason() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setConvergedReason(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":949 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":951 * def __get__(self): * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6reason_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":952 * return self.getConvergedReason() * def __set__(self, value): * self.setConvergedReason(value) # <<<<<<<<<<<<<< * * property iterating: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":951 * def __get__(self): * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":955 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9iterating_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9iterating___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9iterating___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":956 * property iterating: * def __get__(self): * return self.reason == 0 # <<<<<<<<<<<<<< * * property converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":955 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":959 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_9converged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_9converged___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_9converged___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":960 * property converged: * def __get__(self): * return self.reason > 0 # <<<<<<<<<<<<<< * * property diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 960, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":959 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":963 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_8diverged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_8diverged___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_8diverged___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":964 * property diverged: * def __get__(self): * return self.reason < 0 # <<<<<<<<<<<<<< * * # --- matrix free / finite diferences --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 964, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":963 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.SNES.diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":969 * * property use_mf: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseMF() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":970 * property use_mf: * def __get__(self): * return self.getUseMF() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setUseMF(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseMF); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":969 * * property use_mf: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseMF() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_mf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":971 * def __get__(self): * return self.getUseMF() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseMF(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_mf_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":972 * return self.getUseMF() * def __set__(self, value): * self.setUseMF(value) # <<<<<<<<<<<<<< * * property use_fd: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseMF); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":971 * def __get__(self): * return self.getUseMF() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseMF(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_mf.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":975 * * property use_fd: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseFD() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(((struct PyPetscSNESObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd___get__(struct PyPetscSNESObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/SNES.pyx":976 * property use_fd: * def __get__(self): * return self.getUseFD() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setUseFD(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUseFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/SNES.pyx":975 * * property use_fd: * def __get__(self): # <<<<<<<<<<<<<< * return self.getUseFD() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/SNES.pyx":977 * def __get__(self): * return self.getUseFD() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseFD(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(((struct PyPetscSNESObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_4SNES_6use_fd_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/SNES.pyx":978 * return self.getUseFD() * def __set__(self, value): * self.setUseFD(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setUseFD); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/SNES.pyx":977 * def __get__(self): * return self.getUseFD() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setUseFD(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":115 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ts * self.ts = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS___cinit__(struct PyPetscTSObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/TS.pyx":116 * * def __cinit__(self): * self.obj = &self.ts # <<<<<<<<<<<<<< * self.ts = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ts)); /* "PETSc/TS.pyx":117 * def __cinit__(self): * self.obj = &self.ts * self.ts = NULL # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_v_self->ts = NULL; /* "PETSc/TS.pyx":115 * # --- xxx --- * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ts * self.ts = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":121 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_2view[] = "TS.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(42, 121, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 121, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(42, 121, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_2view(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2view(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/TS.pyx":122 * * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( TSView(self.ts, cviewer) ) */ __pyx_v_cviewer = NULL; /* "PETSc/TS.pyx":123 * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( TSView(self.ts, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_3; } /* "PETSc/TS.pyx":124 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( TSView(self.ts, cviewer) ) # <<<<<<<<<<<<<< * * def load(self, Viewer viewer): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSView(__pyx_v_self->ts, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 124, __pyx_L1_error) /* "PETSc/TS.pyx":121 * # --- xxx --- * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":126 * CHKERR( TSView(self.ts, cviewer) ) * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * CHKERR( TSLoad(self.ts, viewer.vwr) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_5load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_4load[] = "TS.load(self, Viewer viewer)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_5load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(42, 126, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 126, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(42, 126, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4load(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4load(struct PyPetscTSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); /* "PETSc/TS.pyx":127 * * def load(self, Viewer viewer): * CHKERR( TSLoad(self.ts, viewer.vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSLoad(__pyx_v_self->ts, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 127, __pyx_L1_error) /* "PETSc/TS.pyx":126 * CHKERR( TSView(self.ts, cviewer) ) * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * CHKERR( TSLoad(self.ts, viewer.vwr) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":129 * CHKERR( TSLoad(self.ts, viewer.vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( TSDestroy(&self.ts) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_6destroy[] = "TS.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6destroy(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6destroy(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/TS.pyx":130 * * def destroy(self): * CHKERR( TSDestroy(&self.ts) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSDestroy((&__pyx_v_self->ts))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 130, __pyx_L1_error) /* "PETSc/TS.pyx":131 * def destroy(self): * CHKERR( TSDestroy(&self.ts) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/TS.pyx":129 * CHKERR( TSLoad(self.ts, viewer.vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( TSDestroy(&self.ts) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":133 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_8create[] = "TS.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(42, 133, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 133, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8create(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8create(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; TS __pyx_v_newts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/TS.pyx":134 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 134, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/TS.pyx":135 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL # <<<<<<<<<<<<<< * CHKERR( TSCreate(ccomm, &newts) ) * PetscCLEAR(self.obj); self.ts = newts */ __pyx_v_newts = NULL; /* "PETSc/TS.pyx":136 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ts = newts * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSCreate(__pyx_v_ccomm, (&__pyx_v_newts))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 136, __pyx_L1_error) /* "PETSc/TS.pyx":137 * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) * PetscCLEAR(self.obj); self.ts = newts # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ts = __pyx_v_newts; /* "PETSc/TS.pyx":138 * CHKERR( TSCreate(ccomm, &newts) ) * PetscCLEAR(self.obj); self.ts = newts * return self # <<<<<<<<<<<<<< * * def clone(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/TS.pyx":133 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":140 * return self * * def clone(self): # <<<<<<<<<<<<<< * cdef TS ts = TS() * CHKERR( TSClone(self.ts, &ts.ts) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_10clone[] = "TS.clone(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clone (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_10clone(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_10clone(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscTSObject *__pyx_v_ts = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clone", 0); /* "PETSc/TS.pyx":141 * * def clone(self): * cdef TS ts = TS() # <<<<<<<<<<<<<< * CHKERR( TSClone(self.ts, &ts.ts) ) * return ts */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":142 * def clone(self): * cdef TS ts = TS() * CHKERR( TSClone(self.ts, &ts.ts) ) # <<<<<<<<<<<<<< * return ts * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSClone(__pyx_v_self->ts, (&__pyx_v_ts->ts))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 142, __pyx_L1_error) /* "PETSc/TS.pyx":143 * cdef TS ts = TS() * CHKERR( TSClone(self.ts, &ts.ts) ) * return ts # <<<<<<<<<<<<<< * * def setType(self, ts_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ts)); __pyx_r = ((PyObject *)__pyx_v_ts); goto __pyx_L0; /* "PETSc/TS.pyx":140 * return self * * def clone(self): # <<<<<<<<<<<<<< * cdef TS ts = TS() * CHKERR( TSClone(self.ts, &ts.ts) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":145 * return ts * * def setType(self, ts_type): # <<<<<<<<<<<<<< * cdef PetscTSType cval = NULL * ts_type = str2bytes(ts_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_12setType[] = "TS.setType(self, ts_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ts_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(42, 145, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ts_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 145, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_12setType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12setType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type) { TSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_ts_type); /* "PETSc/TS.pyx":146 * * def setType(self, ts_type): * cdef PetscTSType cval = NULL # <<<<<<<<<<<<<< * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":147 * def setType(self, ts_type): * cdef PetscTSType cval = NULL * ts_type = str2bytes(ts_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ts_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ts_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":148 * cdef PetscTSType cval = NULL * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def setRKType(self, ts_type): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 148, __pyx_L1_error) /* "PETSc/TS.pyx":145 * return ts * * def setType(self, ts_type): # <<<<<<<<<<<<<< * cdef PetscTSType cval = NULL * ts_type = str2bytes(ts_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":150 * CHKERR( TSSetType(self.ts, cval) ) * * def setRKType(self, ts_type): # <<<<<<<<<<<<<< * cdef PetscTSRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_14setRKType[] = "TS.setRKType(self, ts_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ts_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRKType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRKType") < 0)) __PYX_ERR(42, 150, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ts_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRKType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 150, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_14setRKType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_14setRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type) { TSRKType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRKType", 0); __Pyx_INCREF(__pyx_v_ts_type); /* "PETSc/TS.pyx":151 * * def setRKType(self, ts_type): * cdef PetscTSRKType cval = NULL # <<<<<<<<<<<<<< * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSRKSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":152 * def setRKType(self, ts_type): * cdef PetscTSRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSRKSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ts_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ts_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":153 * cdef PetscTSRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSRKSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def setARKIMEXType(self, ts_type): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRKSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 153, __pyx_L1_error) /* "PETSc/TS.pyx":150 * CHKERR( TSSetType(self.ts, cval) ) * * def setRKType(self, ts_type): # <<<<<<<<<<<<<< * cdef PetscTSRKType cval = NULL * ts_type = str2bytes(ts_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":155 * CHKERR( TSRKSetType(self.ts, cval) ) * * def setARKIMEXType(self, ts_type): # <<<<<<<<<<<<<< * cdef PetscTSARKIMEXType cval = NULL * ts_type = str2bytes(ts_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_16setARKIMEXType[] = "TS.setARKIMEXType(self, ts_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ts_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setARKIMEXType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ts_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ts_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setARKIMEXType") < 0)) __PYX_ERR(42, 155, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ts_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setARKIMEXType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 155, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_16setARKIMEXType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_16setARKIMEXType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type) { TSARKIMEXType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setARKIMEXType", 0); __Pyx_INCREF(__pyx_v_ts_type); /* "PETSc/TS.pyx":156 * * def setARKIMEXType(self, ts_type): * cdef PetscTSARKIMEXType cval = NULL # <<<<<<<<<<<<<< * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSARKIMEXSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":157 * def setARKIMEXType(self, ts_type): * cdef PetscTSARKIMEXType cval = NULL * ts_type = str2bytes(ts_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSARKIMEXSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ts_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ts_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":158 * cdef PetscTSARKIMEXType cval = NULL * ts_type = str2bytes(ts_type, &cval) * CHKERR( TSARKIMEXSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSARKIMEXSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 158, __pyx_L1_error) /* "PETSc/TS.pyx":155 * CHKERR( TSRKSetType(self.ts, cval) ) * * def setARKIMEXType(self, ts_type): # <<<<<<<<<<<<<< * cdef PetscTSARKIMEXType cval = NULL * ts_type = str2bytes(ts_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ts_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":160 * CHKERR( TSARKIMEXSetType(self.ts, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscTSType cval = NULL * CHKERR( TSGetType(self.ts, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_19getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_18getType[] = "TS.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_19getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_18getType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_18getType(struct PyPetscTSObject *__pyx_v_self) { TSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/TS.pyx":161 * * def getType(self): * cdef PetscTSType cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":162 * def getType(self): * cdef PetscTSType cval = NULL * CHKERR( TSGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 162, __pyx_L1_error) /* "PETSc/TS.pyx":163 * cdef PetscTSType cval = NULL * CHKERR( TSGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getRKType(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":160 * CHKERR( TSARKIMEXSetType(self.ts, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscTSType cval = NULL * CHKERR( TSGetType(self.ts, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":165 * return bytes2str(cval) * * def getRKType(self): # <<<<<<<<<<<<<< * cdef PetscTSRKType cval = NULL * CHKERR( TSRKGetType(self.ts, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_21getRKType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_20getRKType[] = "TS.getRKType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_21getRKType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRKType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRKType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRKType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_20getRKType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_20getRKType(struct PyPetscTSObject *__pyx_v_self) { TSRKType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRKType", 0); /* "PETSc/TS.pyx":166 * * def getRKType(self): * cdef PetscTSRKType cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSRKGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":167 * def getRKType(self): * cdef PetscTSRKType cval = NULL * CHKERR( TSRKGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRKGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 167, __pyx_L1_error) /* "PETSc/TS.pyx":168 * cdef PetscTSRKType cval = NULL * CHKERR( TSRKGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getARKIMEXType(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":165 * return bytes2str(cval) * * def getRKType(self): # <<<<<<<<<<<<<< * cdef PetscTSRKType cval = NULL * CHKERR( TSRKGetType(self.ts, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getRKType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":170 * return bytes2str(cval) * * def getARKIMEXType(self): # <<<<<<<<<<<<<< * cdef PetscTSARKIMEXType cval = NULL * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_23getARKIMEXType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_22getARKIMEXType[] = "TS.getARKIMEXType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_23getARKIMEXType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getARKIMEXType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getARKIMEXType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getARKIMEXType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_22getARKIMEXType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_22getARKIMEXType(struct PyPetscTSObject *__pyx_v_self) { TSARKIMEXType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getARKIMEXType", 0); /* "PETSc/TS.pyx":171 * * def getARKIMEXType(self): * cdef PetscTSARKIMEXType cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":172 * def getARKIMEXType(self): * cdef PetscTSARKIMEXType cval = NULL * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSARKIMEXGetType(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 172, __pyx_L1_error) /* "PETSc/TS.pyx":173 * cdef PetscTSARKIMEXType cval = NULL * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setProblemType(self, ptype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":170 * return bytes2str(cval) * * def getARKIMEXType(self): # <<<<<<<<<<<<<< * cdef PetscTSARKIMEXType cval = NULL * CHKERR( TSARKIMEXGetType(self.ts, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getARKIMEXType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":175 * return bytes2str(cval) * * def setProblemType(self, ptype): # <<<<<<<<<<<<<< * CHKERR( TSSetProblemType(self.ts, ptype) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_25setProblemType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_24setProblemType[] = "TS.setProblemType(self, ptype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_25setProblemType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ptype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setProblemType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ptype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ptype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setProblemType") < 0)) __PYX_ERR(42, 175, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ptype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setProblemType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 175, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setProblemType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_24setProblemType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ptype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_24setProblemType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ptype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSProblemType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setProblemType", 0); /* "PETSc/TS.pyx":176 * * def setProblemType(self, ptype): * CHKERR( TSSetProblemType(self.ts, ptype) ) # <<<<<<<<<<<<<< * * def getProblemType(self): */ __pyx_t_1 = ((TSProblemType)__Pyx_PyInt_As_TSProblemType(__pyx_v_ptype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 176, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetProblemType(__pyx_v_self->ts, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 176, __pyx_L1_error) /* "PETSc/TS.pyx":175 * return bytes2str(cval) * * def setProblemType(self, ptype): # <<<<<<<<<<<<<< * CHKERR( TSSetProblemType(self.ts, ptype) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setProblemType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":178 * CHKERR( TSSetProblemType(self.ts, ptype) ) * * def getProblemType(self): # <<<<<<<<<<<<<< * cdef PetscTSProblemType ptype = TS_NONLINEAR * CHKERR( TSGetProblemType(self.ts, &ptype) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_27getProblemType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_26getProblemType[] = "TS.getProblemType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_27getProblemType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProblemType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getProblemType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getProblemType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_26getProblemType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_26getProblemType(struct PyPetscTSObject *__pyx_v_self) { TSProblemType __pyx_v_ptype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProblemType", 0); /* "PETSc/TS.pyx":179 * * def getProblemType(self): * cdef PetscTSProblemType ptype = TS_NONLINEAR # <<<<<<<<<<<<<< * CHKERR( TSGetProblemType(self.ts, &ptype) ) * return ptype */ __pyx_v_ptype = TS_NONLINEAR; /* "PETSc/TS.pyx":180 * def getProblemType(self): * cdef PetscTSProblemType ptype = TS_NONLINEAR * CHKERR( TSGetProblemType(self.ts, &ptype) ) # <<<<<<<<<<<<<< * return ptype * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetProblemType(__pyx_v_self->ts, (&__pyx_v_ptype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 180, __pyx_L1_error) /* "PETSc/TS.pyx":181 * cdef PetscTSProblemType ptype = TS_NONLINEAR * CHKERR( TSGetProblemType(self.ts, &ptype) ) * return ptype # <<<<<<<<<<<<<< * * def setEquationType(self, eqtype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TSProblemType(__pyx_v_ptype); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":178 * CHKERR( TSSetProblemType(self.ts, ptype) ) * * def getProblemType(self): # <<<<<<<<<<<<<< * cdef PetscTSProblemType ptype = TS_NONLINEAR * CHKERR( TSGetProblemType(self.ts, &ptype) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getProblemType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":183 * return ptype * * def setEquationType(self, eqtype): # <<<<<<<<<<<<<< * CHKERR( TSSetEquationType(self.ts, eqtype) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_29setEquationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_28setEquationType[] = "TS.setEquationType(self, eqtype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_29setEquationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_eqtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setEquationType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_eqtype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eqtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setEquationType") < 0)) __PYX_ERR(42, 183, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_eqtype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setEquationType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 183, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setEquationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_28setEquationType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_eqtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_28setEquationType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_eqtype) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSEquationType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setEquationType", 0); /* "PETSc/TS.pyx":184 * * def setEquationType(self, eqtype): * CHKERR( TSSetEquationType(self.ts, eqtype) ) # <<<<<<<<<<<<<< * * def getEquationType(self): */ __pyx_t_1 = ((TSEquationType)__Pyx_PyInt_As_TSEquationType(__pyx_v_eqtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 184, __pyx_L1_error) __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEquationType(__pyx_v_self->ts, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 184, __pyx_L1_error) /* "PETSc/TS.pyx":183 * return ptype * * def setEquationType(self, eqtype): # <<<<<<<<<<<<<< * CHKERR( TSSetEquationType(self.ts, eqtype) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setEquationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":186 * CHKERR( TSSetEquationType(self.ts, eqtype) ) * * def getEquationType(self): # <<<<<<<<<<<<<< * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED * CHKERR( TSGetEquationType(self.ts, &eqtype) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_31getEquationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_30getEquationType[] = "TS.getEquationType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_31getEquationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getEquationType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getEquationType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getEquationType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_30getEquationType(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_30getEquationType(struct PyPetscTSObject *__pyx_v_self) { TSEquationType __pyx_v_eqtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getEquationType", 0); /* "PETSc/TS.pyx":187 * * def getEquationType(self): * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED # <<<<<<<<<<<<<< * CHKERR( TSGetEquationType(self.ts, &eqtype) ) * return eqtype */ __pyx_v_eqtype = TS_EQ_UNSPECIFIED; /* "PETSc/TS.pyx":188 * def getEquationType(self): * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED * CHKERR( TSGetEquationType(self.ts, &eqtype) ) # <<<<<<<<<<<<<< * return eqtype * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetEquationType(__pyx_v_self->ts, (&__pyx_v_eqtype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 188, __pyx_L1_error) /* "PETSc/TS.pyx":189 * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED * CHKERR( TSGetEquationType(self.ts, &eqtype) ) * return eqtype # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TSEquationType(__pyx_v_eqtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":186 * CHKERR( TSSetEquationType(self.ts, eqtype) ) * * def getEquationType(self): # <<<<<<<<<<<<<< * cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED * CHKERR( TSGetEquationType(self.ts, &eqtype) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getEquationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":191 * return eqtype * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_33setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_32setOptionsPrefix[] = "TS.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_33setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(42, 191, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 191, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_32setOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_32setOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/TS.pyx":192 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":193 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":194 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetOptionsPrefix(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 194, __pyx_L1_error) /* "PETSc/TS.pyx":191 * return eqtype * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":196 * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_35getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_34getOptionsPrefix[] = "TS.getOptionsPrefix(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_35getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_34getOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_34getOptionsPrefix(struct PyPetscTSObject *__pyx_v_self) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/TS.pyx":197 * * def getOptionsPrefix(self): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":198 * def getOptionsPrefix(self): * cdef const char *cval = NULL * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetOptionsPrefix(__pyx_v_self->ts, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 198, __pyx_L1_error) /* "PETSc/TS.pyx":199 * cdef const char *cval = NULL * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":196 * CHKERR( TSSetOptionsPrefix(self.ts, cval) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( TSGetOptionsPrefix(self.ts, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":201 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( TSSetFromOptions(self.ts) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_37setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_36setFromOptions[] = "TS.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_37setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_36setFromOptions(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_36setFromOptions(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/TS.pyx":202 * * def setFromOptions(self): * CHKERR( TSSetFromOptions(self.ts) ) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetFromOptions(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 202, __pyx_L1_error) /* "PETSc/TS.pyx":201 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( TSSetFromOptions(self.ts) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":206 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_39setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_38setAppCtx[] = "TS.setAppCtx(self, appctx)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_39setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_appctx = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_appctx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAppCtx") < 0)) __PYX_ERR(42, 206, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 206, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_38setAppCtx(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_38setAppCtx(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 0); /* "PETSc/TS.pyx":207 * * def setAppCtx(self, appctx): * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":206 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":209 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_41getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_40getAppCtx[] = "TS.getAppCtx(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_41getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_40getAppCtx(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_40getAppCtx(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 0); /* "PETSc/TS.pyx":210 * * def getAppCtx(self): * return self.get_attr('__appctx__') # <<<<<<<<<<<<<< * * # --- user RHS Function/Jacobian routines --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":209 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":214 * # --- user RHS Function/Jacobian routines --- * * def setRHSFunction(self, function, Vec f=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_43setRHSFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_42setRHSFunction[] = "TS.setRHSFunction(self, function, Vec f=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_43setRHSFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRHSFunction") < 0)) __PYX_ERR(42, 214, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSFunction", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 214, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(42, 214, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_42setRHSFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_42setRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":215 * * def setRHSFunction(self, function, Vec f=None, args=None, kargs=None): * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "PETSc/TS.pyx":216 * def setRHSFunction(self, function, Vec f=None, args=None, kargs=None): * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_3; } /* "PETSc/TS.pyx":217 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_function != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":218 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":219 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__rhsfunction__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":220 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsfunction__', context) * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":221 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__rhsfunction__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsfunction__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":222 * context = (function, args, kargs) * self.set_attr('__rhsfunction__', context) * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSFunction(__pyx_v_self->ts, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_TS_RHSFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 222, __pyx_L1_error) /* "PETSc/TS.pyx":217 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "PETSc/TS.pyx":224 * CHKERR( TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, context) ) * else: * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSFunction(__pyx_v_self->ts, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 224, __pyx_L1_error) } __pyx_L4:; /* "PETSc/TS.pyx":214 * # --- user RHS Function/Jacobian routines --- * * def setRHSFunction(self, function, Vec f=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":226 * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) * * def setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_45setRHSJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_44setRHSJacobian[] = "TS.setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_45setRHSJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRHSJacobian") < 0)) __PYX_ERR(42, 226, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSJacobian", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 226, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(42, 226, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(42, 226, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_44setRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_44setRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":227 * * def setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "PETSc/TS.pyx":228 * def setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TS.pyx":229 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "PETSc/TS.pyx":230 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/TS.pyx":231 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":232 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":233 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__rhsjacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":234 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsjacobian__', context) * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":235 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__rhsjacobian__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":236 * context = (jacobian, args, kargs) * self.set_attr('__rhsjacobian__', context) * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TS_RHSJacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 236, __pyx_L1_error) /* "PETSc/TS.pyx":231 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "PETSc/TS.pyx":238 * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, context) ) * else: * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeRHSFunction(self, t, Vec x, Vec f): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 238, __pyx_L1_error) } __pyx_L5:; /* "PETSc/TS.pyx":226 * CHKERR( TSSetRHSFunction(self.ts, fvec, NULL, NULL) ) * * def setRHSJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":240 * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeRHSFunction(self, t, Vec x, Vec f): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_47computeRHSFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_46computeRHSFunction[] = "TS.computeRHSFunction(self, t, Vec x, Vec f)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_47computeRHSFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_f,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSFunction", 1, 3, 3, 1); __PYX_ERR(42, 240, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSFunction", 1, 3, 3, 2); __PYX_ERR(42, 240, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeRHSFunction") < 0)) __PYX_ERR(42, 240, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_f = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSFunction", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 240, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 240, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(42, 240, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_46computeRHSFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_46computeRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PetscReal __pyx_v_time; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSFunction", 0); /* "PETSc/TS.pyx":241 * * def computeRHSFunction(self, t, Vec x, Vec f): * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 241, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "PETSc/TS.pyx":242 * def computeRHSFunction(self, t, Vec x, Vec f): * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) # <<<<<<<<<<<<<< * * def computeRHSFunctionLinear(self, t, Vec x, Vec f): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSFunction(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 242, __pyx_L1_error) /* "PETSc/TS.pyx":240 * CHKERR( TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeRHSFunction(self, t, Vec x, Vec f): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":244 * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) * * def computeRHSFunctionLinear(self, t, Vec x, Vec f): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_49computeRHSFunctionLinear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_48computeRHSFunctionLinear[] = "TS.computeRHSFunctionLinear(self, t, Vec x, Vec f)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_49computeRHSFunctionLinear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSFunctionLinear (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_f,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSFunctionLinear", 1, 3, 3, 1); __PYX_ERR(42, 244, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSFunctionLinear", 1, 3, 3, 2); __PYX_ERR(42, 244, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeRHSFunctionLinear") < 0)) __PYX_ERR(42, 244, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_f = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSFunctionLinear", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 244, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunctionLinear", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 244, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(42, 244, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_48computeRHSFunctionLinear(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_48computeRHSFunctionLinear(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PetscReal __pyx_v_time; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSFunctionLinear", 0); /* "PETSc/TS.pyx":245 * * def computeRHSFunctionLinear(self, t, Vec x, Vec f): * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 245, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "PETSc/TS.pyx":246 * def computeRHSFunctionLinear(self, t, Vec x, Vec f): * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) # <<<<<<<<<<<<<< * * def computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSFunctionLinear(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_f->vec, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 246, __pyx_L1_error) /* "PETSc/TS.pyx":244 * CHKERR( TSComputeRHSFunction(self.ts, time, x.vec, f.vec) ) * * def computeRHSFunctionLinear(self, t, Vec x, Vec f): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSFunctionLinear", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":248 * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) * * def computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_51computeRHSJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_50computeRHSJacobian[] = "TS.computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_51computeRHSJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; PyObject* values[4] = {0,0,0,0}; values[3] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobian", 0, 3, 4, 1); __PYX_ERR(42, 248, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobian", 0, 3, 4, 2); __PYX_ERR(42, 248, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeRHSJacobian") < 0)) __PYX_ERR(42, 248, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_J = ((struct PyPetscMatObject *)values[2]); __pyx_v_P = ((struct PyPetscMatObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSJacobian", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 248, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 248, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(42, 248, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(42, 248, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_50computeRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_50computeRHSJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { PetscReal __pyx_v_time; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; Mat __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSJacobian", 0); /* "PETSc/TS.pyx":249 * * def computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None): * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 249, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "PETSc/TS.pyx":250 * def computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None): * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) */ __pyx_t_2 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_2; __pyx_t_2 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_2; /* "PETSc/TS.pyx":251 * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) * */ __pyx_t_3 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "PETSc/TS.pyx":252 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) # <<<<<<<<<<<<<< * * def computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSJacobian(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 252, __pyx_L1_error) /* "PETSc/TS.pyx":248 * CHKERR( TSComputeRHSFunctionLinear(self.ts, time, x.vec, f.vec, NULL) ) * * def computeRHSJacobian(self, t, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":254 * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) * * def computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_53computeRHSJacobianConstant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_52computeRHSJacobianConstant[] = "TS.computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_53computeRHSJacobianConstant(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSJacobianConstant (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; PyObject* values[4] = {0,0,0,0}; values[3] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianConstant", 0, 3, 4, 1); __PYX_ERR(42, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianConstant", 0, 3, 4, 2); __PYX_ERR(42, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeRHSJacobianConstant") < 0)) __PYX_ERR(42, 254, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_J = ((struct PyPetscMatObject *)values[2]); __pyx_v_P = ((struct PyPetscMatObject *)values[3]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSJacobianConstant", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 254, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianConstant", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 254, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(42, 254, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(42, 254, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_52computeRHSJacobianConstant(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_52computeRHSJacobianConstant(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { PetscReal __pyx_v_time; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; Mat __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSJacobianConstant", 0); /* "PETSc/TS.pyx":255 * * def computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None): * cdef PetscReal time = asReal(t) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 255, __pyx_L1_error) __pyx_v_time = __pyx_t_1; /* "PETSc/TS.pyx":256 * def computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None): * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) */ __pyx_t_2 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_2; __pyx_t_2 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_2; /* "PETSc/TS.pyx":257 * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) * */ __pyx_t_3 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "PETSc/TS.pyx":258 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) # <<<<<<<<<<<<<< * * def getRHSFunction(self): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSJacobianConstant(__pyx_v_self->ts, __pyx_v_time, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 258, __pyx_L1_error) /* "PETSc/TS.pyx":254 * CHKERR( TSComputeRHSJacobian(self.ts, time, x.vec, jmat, pmat) ) * * def computeRHSJacobianConstant(self, t, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscReal time = asReal(t) * cdef PetscMat jmat = J.mat, pmat = J.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianConstant", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":260 * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) * * def getRHSFunction(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_55getRHSFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_54getRHSFunction[] = "TS.getRHSFunction(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_55getRHSFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRHSFunction (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRHSFunction", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRHSFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_54getRHSFunction(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_54getRHSFunction(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRHSFunction", 0); /* "PETSc/TS.pyx":261 * * def getRHSFunction(self): * cdef Vec f = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":262 * def getRHSFunction(self): * cdef Vec f = Vec() * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * PetscINCREF(f.obj) * cdef object function = self.get_attr('__rhsfunction__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetRHSFunction(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 262, __pyx_L1_error) /* "PETSc/TS.pyx":263 * cdef Vec f = Vec() * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__rhsfunction__') * return (f, function) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); /* "PETSc/TS.pyx":264 * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) * cdef object function = self.get_attr('__rhsfunction__') # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsfunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/TS.pyx":265 * PetscINCREF(f.obj) * cdef object function = self.get_attr('__rhsfunction__') * return (f, function) # <<<<<<<<<<<<<< * * def getRHSJacobian(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":260 * CHKERR( TSComputeRHSJacobianConstant(self.ts, time, x.vec, jmat, pmat, NULL) ) * * def getRHSFunction(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * CHKERR( TSGetRHSFunction(self.ts, &f.vec, NULL, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":267 * return (f, function) * * def getRHSJacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_57getRHSJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_56getRHSJacobian[] = "TS.getRHSJacobian(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_57getRHSJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRHSJacobian (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRHSJacobian", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRHSJacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_56getRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_56getRHSJacobian(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRHSJacobian", 0); /* "PETSc/TS.pyx":268 * * def getRHSJacobian(self): * cdef Mat J = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":269 * def getRHSJacobian(self): * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__rhsjacobian__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetRHSJacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 269, __pyx_L1_error) /* "PETSc/TS.pyx":270 * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__rhsjacobian__') * return (J, P, jacobian) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); /* "PETSc/TS.pyx":271 * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__rhsjacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/TS.pyx":272 * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__rhsjacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * # --- user Implicit Function/Jacobian routines --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P)); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":267 * return (f, function) * * def getRHSJacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetRHSJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getRHSJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":276 * # --- user Implicit Function/Jacobian routines --- * * def setIFunction(self, function, Vec f=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_59setIFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_58setIFunction[] = "TS.setIFunction(self, function, Vec f=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_59setIFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIFunction") < 0)) __PYX_ERR(42, 276, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIFunction", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 276, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(42, 276, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_58setIFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_58setIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":277 * * def setIFunction(self, function, Vec f=None, args=None, kargs=None): * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "PETSc/TS.pyx":278 * def setIFunction(self, function, Vec f=None, args=None, kargs=None): * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_3; } /* "PETSc/TS.pyx":279 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_function != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":280 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":281 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__ifunction__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":282 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ifunction__', context) * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":283 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__ifunction__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ifunction__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":284 * context = (function, args, kargs) * self.set_attr('__ifunction__', context) * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIFunction(__pyx_v_self->ts, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_TS_IFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 284, __pyx_L1_error) /* "PETSc/TS.pyx":279 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "PETSc/TS.pyx":286 * CHKERR( TSSetIFunction(self.ts, fvec, TS_IFunction, context) ) * else: * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIFunction(__pyx_v_self->ts, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 286, __pyx_L1_error) } __pyx_L4:; /* "PETSc/TS.pyx":276 * # --- user Implicit Function/Jacobian routines --- * * def setIFunction(self, function, Vec f=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":288 * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) * * def setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_61setIJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_60setIJacobian[] = "TS.setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_61setIJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIJacobian") < 0)) __PYX_ERR(42, 288, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIJacobian", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 288, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(42, 288, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(42, 288, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_60setIJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_60setIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":289 * * def setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "PETSc/TS.pyx":290 * def setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TS.pyx":291 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "PETSc/TS.pyx":292 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/TS.pyx":293 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":294 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":295 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__ijacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":296 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ijacobian__', context) * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":297 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__ijacobian__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ijacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":298 * context = (jacobian, args, kargs) * self.set_attr('__ijacobian__', context) * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TS_IJacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 298, __pyx_L1_error) /* "PETSc/TS.pyx":293 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "PETSc/TS.pyx":300 * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, context) ) * else: * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 300, __pyx_L1_error) } __pyx_L5:; /* "PETSc/TS.pyx":288 * CHKERR( TSSetIFunction(self.ts, fvec, NULL, NULL) ) * * def setIJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":302 * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_63setIJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_62setIJacobianP[] = "TS.setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_63setIJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setIJacobianP (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setIJacobianP") < 0)) __PYX_ERR(42, 302, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setIJacobianP", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 302, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(42, 302, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_62setIJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_62setIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setIJacobianP", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":303 * * def setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * if jacobian is not None: */ __pyx_v_Jmat = NULL; /* "PETSc/TS.pyx":304 * def setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TS.pyx":305 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_jacobian != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":306 * if J is not None: Jmat = J.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":307 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__ijacobianp__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":308 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__ijacobianp__', context) * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":309 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__ijacobianp__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ijacobianp__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":310 * context = (jacobian, args, kargs) * self.set_attr('__ijacobianp__', context) * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobianP(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_f_8petsc4py_5PETSc_TS_IJacobianP, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 310, __pyx_L1_error) /* "PETSc/TS.pyx":305 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "PETSc/TS.pyx":312 * CHKERR( TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, context) ) * else: * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeIFunction(self, */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetIJacobianP(__pyx_v_self->ts, __pyx_v_Jmat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 312, __pyx_L1_error) } __pyx_L4:; /* "PETSc/TS.pyx":302 * CHKERR( TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def setIJacobianP(self, jacobian, Mat J=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":314 * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) * * def computeIFunction(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, * Vec f, imex=False): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_65computeIFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_64computeIFunction[] = "TS.computeIFunction(self, t, Vec x, Vec xdot, Vec f, imex=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_65computeIFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_imex = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeIFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_f,&__pyx_n_s_imex,0}; PyObject* values[5] = {0,0,0,0,0}; /* "PETSc/TS.pyx":316 * def computeIFunction(self, * t, Vec x, Vec xdot, * Vec f, imex=False): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * cdef PetscBool bval = imex */ values[4] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, 1); __PYX_ERR(42, 314, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xdot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, 2); __PYX_ERR(42, 314, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, 3); __PYX_ERR(42, 314, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_imex); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeIFunction") < 0)) __PYX_ERR(42, 314, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_f = ((struct PyPetscVecObject *)values[3]); __pyx_v_imex = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 314, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 315, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(42, 315, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(42, 316, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_64computeIFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_f, __pyx_v_imex); /* "PETSc/TS.pyx":314 * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) * * def computeIFunction(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, * Vec f, imex=False): */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_64computeIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_imex) { PetscReal __pyx_v_rval; PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeIFunction", 0); /* "PETSc/TS.pyx":317 * t, Vec x, Vec xdot, * Vec f, imex=False): * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * cdef PetscBool bval = imex * CHKERR( TSComputeIFunction(self.ts, rval, x.vec, xdot.vec, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 317, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":318 * Vec f, imex=False): * cdef PetscReal rval = asReal(t) * cdef PetscBool bval = imex # <<<<<<<<<<<<<< * CHKERR( TSComputeIFunction(self.ts, rval, x.vec, xdot.vec, * f.vec, bval) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_imex)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 318, __pyx_L1_error) __pyx_v_bval = __pyx_t_2; /* "PETSc/TS.pyx":319 * cdef PetscReal rval = asReal(t) * cdef PetscBool bval = imex * CHKERR( TSComputeIFunction(self.ts, rval, x.vec, xdot.vec, # <<<<<<<<<<<<<< * f.vec, bval) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIFunction(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_f->vec, __pyx_v_bval)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(42, 319, __pyx_L1_error) /* "PETSc/TS.pyx":314 * CHKERR( TSSetIJacobianP(self.ts, Jmat, NULL, NULL) ) * * def computeIFunction(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, * Vec f, imex=False): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":322 * f.vec, bval) ) * * def computeIJacobian(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, a, * Mat J, Mat P=None, imex=False): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_67computeIJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_66computeIJacobian[] = "TS.computeIJacobian(self, t, Vec x, Vec xdot, a, Mat J, Mat P=None, imex=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_67computeIJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; PyObject *__pyx_v_a = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_imex = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeIJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_a,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_imex,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; /* "PETSc/TS.pyx":324 * def computeIJacobian(self, * t, Vec x, Vec xdot, a, * Mat J, Mat P=None, imex=False): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) */ values[5] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[6] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 1); __PYX_ERR(42, 322, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xdot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 2); __PYX_ERR(42, 322, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 3); __PYX_ERR(42, 322, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, 4); __PYX_ERR(42, 322, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_imex); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeIJacobian") < 0)) __PYX_ERR(42, 322, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_a = values[3]; __pyx_v_J = ((struct PyPetscMatObject *)values[4]); __pyx_v_P = ((struct PyPetscMatObject *)values[5]); __pyx_v_imex = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 322, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 323, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(42, 323, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(42, 324, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(42, 324, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_66computeIJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_a, __pyx_v_J, __pyx_v_P, __pyx_v_imex); /* "PETSc/TS.pyx":322 * f.vec, bval) ) * * def computeIJacobian(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, a, * Mat J, Mat P=None, imex=False): */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_66computeIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_imex) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscBool __pyx_v_bval; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscBool __pyx_t_2; Mat __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeIJacobian", 0); /* "PETSc/TS.pyx":325 * t, Vec x, Vec xdot, a, * Mat J, Mat P=None, imex=False): * cdef PetscReal rval1 = asReal(t) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = imex */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 325, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_1; /* "PETSc/TS.pyx":326 * Mat J, Mat P=None, imex=False): * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) # <<<<<<<<<<<<<< * cdef PetscBool bval = imex * cdef PetscMat jmat = J.mat, pmat = J.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_a); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 326, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_1; /* "PETSc/TS.pyx":327 * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = imex # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_imex)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 327, __pyx_L1_error) __pyx_v_bval = __pyx_t_2; /* "PETSc/TS.pyx":328 * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = imex * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeIJacobian(self.ts, rval1, x.vec, xdot.vec, rval2, */ __pyx_t_3 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_3; __pyx_t_3 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_3; /* "PETSc/TS.pyx":329 * cdef PetscBool bval = imex * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeIJacobian(self.ts, rval1, x.vec, xdot.vec, rval2, * jmat, pmat, bval) ) */ __pyx_t_4 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_5 = (__pyx_t_4 != 0); if (__pyx_t_5) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_3; } /* "PETSc/TS.pyx":330 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeIJacobian(self.ts, rval1, x.vec, xdot.vec, rval2, # <<<<<<<<<<<<<< * jmat, pmat, bval) ) * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIJacobian(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_rval2, __pyx_v_jmat, __pyx_v_pmat, __pyx_v_bval)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(42, 330, __pyx_L1_error) /* "PETSc/TS.pyx":322 * f.vec, bval) ) * * def computeIJacobian(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, a, * Mat J, Mat P=None, imex=False): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":333 * jmat, pmat, bval) ) * * def computeIJacobianP(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, a, * Mat J, imex=False): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_69computeIJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_68computeIJacobianP[] = "TS.computeIJacobianP(self, t, Vec x, Vec xdot, a, Mat J, imex=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_69computeIJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; PyObject *__pyx_v_a = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_imex = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeIJacobianP (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_a,&__pyx_n_s_J,&__pyx_n_s_imex,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "PETSc/TS.pyx":335 * def computeIJacobianP(self, * t, Vec x, Vec xdot, a, * Mat J, imex=False): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) */ values[5] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 1); __PYX_ERR(42, 333, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xdot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 2); __PYX_ERR(42, 333, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 3); __PYX_ERR(42, 333, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, 4); __PYX_ERR(42, 333, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_imex); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeIJacobianP") < 0)) __PYX_ERR(42, 333, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_a = values[3]; __pyx_v_J = ((struct PyPetscMatObject *)values[4]); __pyx_v_imex = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 333, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 334, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(42, 334, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(42, 335, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_68computeIJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_a, __pyx_v_J, __pyx_v_imex); /* "PETSc/TS.pyx":333 * jmat, pmat, bval) ) * * def computeIJacobianP(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, a, * Mat J, imex=False): */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_68computeIJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_imex) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscBool __pyx_v_bval; Mat __pyx_v_jmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; PetscBool __pyx_t_2; Mat __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeIJacobianP", 0); /* "PETSc/TS.pyx":336 * t, Vec x, Vec xdot, a, * Mat J, imex=False): * cdef PetscReal rval1 = asReal(t) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = asBool(imex) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 336, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_1; /* "PETSc/TS.pyx":337 * Mat J, imex=False): * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) # <<<<<<<<<<<<<< * cdef PetscBool bval = asBool(imex) * cdef PetscMat jmat = J.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_a); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 337, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_1; /* "PETSc/TS.pyx":338 * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = asBool(imex) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat * CHKERR( TSComputeIJacobianP(self.ts, rval1, x.vec, xdot.vec, rval2, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_imex); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(42, 338, __pyx_L1_error) __pyx_v_bval = __pyx_t_2; /* "PETSc/TS.pyx":339 * cdef PetscReal rval2 = asReal(a) * cdef PetscBool bval = asBool(imex) * cdef PetscMat jmat = J.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeIJacobianP(self.ts, rval1, x.vec, xdot.vec, rval2, * jmat, bval) ) */ __pyx_t_3 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_3; /* "PETSc/TS.pyx":340 * cdef PetscBool bval = asBool(imex) * cdef PetscMat jmat = J.mat * CHKERR( TSComputeIJacobianP(self.ts, rval1, x.vec, xdot.vec, rval2, # <<<<<<<<<<<<<< * jmat, bval) ) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeIJacobianP(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_rval2, __pyx_v_jmat, __pyx_v_bval)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 340, __pyx_L1_error) /* "PETSc/TS.pyx":333 * jmat, pmat, bval) ) * * def computeIJacobianP(self, # <<<<<<<<<<<<<< * t, Vec x, Vec xdot, a, * Mat J, imex=False): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeIJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":343 * jmat, bval) ) * * def getIFunction(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_71getIFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_70getIFunction[] = "TS.getIFunction(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_71getIFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIFunction (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIFunction", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIFunction", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_70getIFunction(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_70getIFunction(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIFunction", 0); /* "PETSc/TS.pyx":344 * * def getIFunction(self): * cdef Vec f = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":345 * def getIFunction(self): * cdef Vec f = Vec() * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * PetscINCREF(f.obj) * cdef object function = self.get_attr('__ifunction__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetIFunction(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 345, __pyx_L1_error) /* "PETSc/TS.pyx":346 * cdef Vec f = Vec() * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__ifunction__') * return (f, function) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); /* "PETSc/TS.pyx":347 * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) * cdef object function = self.get_attr('__ifunction__') # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ifunction__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/TS.pyx":348 * PetscINCREF(f.obj) * cdef object function = self.get_attr('__ifunction__') * return (f, function) # <<<<<<<<<<<<<< * * def getIJacobian(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":343 * jmat, bval) ) * * def getIFunction(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * CHKERR( TSGetIFunction(self.ts, &f.vec, NULL, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":350 * return (f, function) * * def getIJacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_73getIJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_72getIJacobian[] = "TS.getIJacobian(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_73getIJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIJacobian (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIJacobian", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIJacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_72getIJacobian(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_72getIJacobian(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIJacobian", 0); /* "PETSc/TS.pyx":351 * * def getIJacobian(self): * cdef Mat J = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":352 * def getIJacobian(self): * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__ijacobian__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetIJacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 352, __pyx_L1_error) /* "PETSc/TS.pyx":353 * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__ijacobian__') * return (J, P, jacobian) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); /* "PETSc/TS.pyx":354 * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__ijacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__ijacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/TS.pyx":355 * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__ijacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * def setI2Function(self, function, Vec f=None, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P)); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":350 * return (f, function) * * def getIJacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetIJacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":357 * return (J, P, jacobian) * * def setI2Function(self, function, Vec f=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_75setI2Function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_74setI2Function[] = "TS.setI2Function(self, function, Vec f=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_75setI2Function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setI2Function (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_f,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setI2Function") < 0)) __PYX_ERR(42, 357, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_f = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setI2Function", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 357, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(42, 357, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_74setI2Function(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_74setI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_f, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_fvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setI2Function", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":358 * * def setI2Function(self, function, Vec f=None, args=None, kargs=None): * cdef PetscVec fvec=NULL # <<<<<<<<<<<<<< * if f is not None: fvec = f.vec * if function is not None: */ __pyx_v_fvec = NULL; /* "PETSc/TS.pyx":359 * def setI2Function(self, function, Vec f=None, args=None, kargs=None): * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_f) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_f->vec; __pyx_v_fvec = __pyx_t_3; } /* "PETSc/TS.pyx":360 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_function != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":361 * if f is not None: fvec = f.vec * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":362 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__i2function__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":363 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__i2function__', context) * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":364 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__i2function__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2function__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":365 * context = (function, args, kargs) * self.set_attr('__i2function__', context) * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Function(__pyx_v_self->ts, __pyx_v_fvec, __pyx_f_8petsc4py_5PETSc_TS_I2Function, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 365, __pyx_L1_error) /* "PETSc/TS.pyx":360 * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "PETSc/TS.pyx":367 * CHKERR( TSSetI2Function(self.ts, fvec, TS_I2Function, context) ) * else: * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Function(__pyx_v_self->ts, __pyx_v_fvec, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 367, __pyx_L1_error) } __pyx_L4:; /* "PETSc/TS.pyx":357 * return (J, P, jacobian) * * def setI2Function(self, function, Vec f=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscVec fvec=NULL * if f is not None: fvec = f.vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":369 * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) * * def setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_77setI2Jacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_76setI2Jacobian[] = "TS.setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_77setI2Jacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setI2Jacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setI2Jacobian") < 0)) __PYX_ERR(42, 369, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setI2Jacobian", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 369, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(42, 369, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(42, 369, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_76setI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_76setI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setI2Jacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":370 * * def setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat */ __pyx_v_Jmat = NULL; /* "PETSc/TS.pyx":371 * def setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TS.pyx":372 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if jacobian is not None: */ __pyx_v_Pmat = __pyx_v_Jmat; /* "PETSc/TS.pyx":373 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/TS.pyx":374 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":375 * if P is not None: Pmat = P.mat * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":376 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__i2jacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":377 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__i2jacobian__', context) * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":378 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__i2jacobian__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":379 * context = (jacobian, args, kargs) * self.set_attr('__i2jacobian__', context) * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Jacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TS_I2Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 379, __pyx_L1_error) /* "PETSc/TS.pyx":374 * cdef PetscMat Pmat=Jmat * if P is not None: Pmat = P.mat * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L5; } /* "PETSc/TS.pyx":381 * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, context) ) * else: * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetI2Jacobian(__pyx_v_self->ts, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 381, __pyx_L1_error) } __pyx_L5:; /* "PETSc/TS.pyx":369 * CHKERR( TSSetI2Function(self.ts, fvec, NULL, NULL) ) * * def setI2Jacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":383 * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeI2Function(self.ts, rval, x.vec, xdot.vec, xdotdot.vec, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_79computeI2Function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_78computeI2Function[] = "TS.computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_79computeI2Function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; struct PyPetscVecObject *__pyx_v_xdotdot = 0; struct PyPetscVecObject *__pyx_v_f = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeI2Function (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_xdotdot,&__pyx_n_s_f,0}; PyObject* values[5] = {0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 1); __PYX_ERR(42, 383, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xdot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 2); __PYX_ERR(42, 383, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xdotdot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 3); __PYX_ERR(42, 383, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, 4); __PYX_ERR(42, 383, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeI2Function") < 0)) __PYX_ERR(42, 383, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_xdotdot = ((struct PyPetscVecObject *)values[3]); __pyx_v_f = ((struct PyPetscVecObject *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 383, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 383, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(42, 383, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdotdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdotdot", 0))) __PYX_ERR(42, 383, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(42, 383, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_78computeI2Function(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_xdotdot, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_78computeI2Function(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, struct PyPetscVecObject *__pyx_v_f) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeI2Function", 0); /* "PETSc/TS.pyx":384 * * def computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f): * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeI2Function(self.ts, rval, x.vec, xdot.vec, xdotdot.vec, * f.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 384, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":385 * def computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f): * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeI2Function(self.ts, rval, x.vec, xdot.vec, xdotdot.vec, # <<<<<<<<<<<<<< * f.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeI2Function(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_xdotdot->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 385, __pyx_L1_error) /* "PETSc/TS.pyx":383 * CHKERR( TSSetI2Jacobian(self.ts, Jmat, Pmat, NULL, NULL) ) * * def computeI2Function(self, t, Vec x, Vec xdot, Vec xdotdot, Vec f): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeI2Function(self.ts, rval, x.vec, xdot.vec, xdotdot.vec, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":388 * f.vec) ) * * def computeI2Jacobian(self, t, Vec x, Vec xdot, Vec xdotdot, v, a, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(v) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_81computeI2Jacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_80computeI2Jacobian[] = "TS.computeI2Jacobian(self, t, Vec x, Vec xdot, Vec xdotdot, v, a, Mat J, Mat P=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_81computeI2Jacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_xdot = 0; struct PyPetscVecObject *__pyx_v_xdotdot = 0; PyObject *__pyx_v_v = 0; PyObject *__pyx_v_a = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeI2Jacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_xdot,&__pyx_n_s_xdotdot,&__pyx_n_s_v,&__pyx_n_s_a,&__pyx_n_s_J,&__pyx_n_s_P,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; values[7] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 1); __PYX_ERR(42, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xdot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 2); __PYX_ERR(42, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xdotdot)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 3); __PYX_ERR(42, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 4); __PYX_ERR(42, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 5); __PYX_ERR(42, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, 6); __PYX_ERR(42, 388, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[7] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeI2Jacobian") < 0)) __PYX_ERR(42, 388, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_xdot = ((struct PyPetscVecObject *)values[2]); __pyx_v_xdotdot = ((struct PyPetscVecObject *)values[3]); __pyx_v_v = values[4]; __pyx_v_a = values[5]; __pyx_v_J = ((struct PyPetscMatObject *)values[6]); __pyx_v_P = ((struct PyPetscMatObject *)values[7]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 388, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 388, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(42, 388, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdotdot), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdotdot", 0))) __PYX_ERR(42, 388, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(42, 388, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(42, 388, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_80computeI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_xdotdot, __pyx_v_v, __pyx_v_a, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_80computeI2Jacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_xdot, struct PyPetscVecObject *__pyx_v_xdotdot, PyObject *__pyx_v_v, PyObject *__pyx_v_a, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; Mat __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeI2Jacobian", 0); /* "PETSc/TS.pyx":389 * * def computeI2Jacobian(self, t, Vec x, Vec xdot, Vec xdotdot, v, a, Mat J, Mat P=None): * cdef PetscReal rval1 = asReal(t) # <<<<<<<<<<<<<< * cdef PetscReal rval2 = asReal(v) * cdef PetscReal rval3 = asReal(a) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 389, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_1; /* "PETSc/TS.pyx":390 * def computeI2Jacobian(self, t, Vec x, Vec xdot, Vec xdotdot, v, a, Mat J, Mat P=None): * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(v) # <<<<<<<<<<<<<< * cdef PetscReal rval3 = asReal(a) * cdef PetscMat jmat = J.mat, pmat = J.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_v); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 390, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_1; /* "PETSc/TS.pyx":391 * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(v) * cdef PetscReal rval3 = asReal(a) # <<<<<<<<<<<<<< * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_a); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 391, __pyx_L1_error) __pyx_v_rval3 = __pyx_t_1; /* "PETSc/TS.pyx":392 * cdef PetscReal rval2 = asReal(v) * cdef PetscReal rval3 = asReal(a) * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TSComputeI2Jacobian(self.ts, rval1, x.vec, xdot.vec, xdotdot.vec, rval2, rval3, */ __pyx_t_2 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_2; __pyx_t_2 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_2; /* "PETSc/TS.pyx":393 * cdef PetscReal rval3 = asReal(a) * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TSComputeI2Jacobian(self.ts, rval1, x.vec, xdot.vec, xdotdot.vec, rval2, rval3, * jmat, pmat) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_t_2 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_2; } /* "PETSc/TS.pyx":394 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TSComputeI2Jacobian(self.ts, rval1, x.vec, xdot.vec, xdotdot.vec, rval2, rval3, # <<<<<<<<<<<<<< * jmat, pmat) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeI2Jacobian(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_x->vec, __pyx_v_xdot->vec, __pyx_v_xdotdot->vec, __pyx_v_rval2, __pyx_v_rval3, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 394, __pyx_L1_error) /* "PETSc/TS.pyx":388 * f.vec) ) * * def computeI2Jacobian(self, t, Vec x, Vec xdot, Vec xdotdot, v, a, Mat J, Mat P=None): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = asReal(t) * cdef PetscReal rval2 = asReal(v) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":397 * jmat, pmat) ) * * def getI2Function(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_83getI2Function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_82getI2Function[] = "TS.getI2Function(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_83getI2Function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getI2Function (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getI2Function", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getI2Function", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_82getI2Function(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_82getI2Function(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_f = 0; PyObject *__pyx_v_function = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getI2Function", 0); /* "PETSc/TS.pyx":398 * * def getI2Function(self): * cdef Vec f = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":399 * def getI2Function(self): * cdef Vec f = Vec() * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) # <<<<<<<<<<<<<< * PetscINCREF(f.obj) * cdef object function = self.get_attr('__i2function__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetI2Function(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 399, __pyx_L1_error) /* "PETSc/TS.pyx":400 * cdef Vec f = Vec() * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) # <<<<<<<<<<<<<< * cdef object function = self.get_attr('__i2function__') * return (f, function) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); /* "PETSc/TS.pyx":401 * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) * PetscINCREF(f.obj) * cdef object function = self.get_attr('__i2function__') # <<<<<<<<<<<<<< * return (f, function) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_function = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/TS.pyx":402 * PetscINCREF(f.obj) * cdef object function = self.get_attr('__i2function__') * return (f, function) # <<<<<<<<<<<<<< * * def getI2Jacobian(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_f)); __Pyx_GIVEREF(((PyObject *)__pyx_v_f)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f)); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_function); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":397 * jmat, pmat) ) * * def getI2Function(self): # <<<<<<<<<<<<<< * cdef Vec f = Vec() * CHKERR( TSGetI2Function(self.ts, &f.vec, NULL, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getI2Function", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_f); __Pyx_XDECREF(__pyx_v_function); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":404 * return (f, function) * * def getI2Jacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_85getI2Jacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_84getI2Jacobian[] = "TS.getI2Jacobian(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_85getI2Jacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getI2Jacobian (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getI2Jacobian", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getI2Jacobian", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_84getI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_84getI2Jacobian(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getI2Jacobian", 0); /* "PETSc/TS.pyx":405 * * def getI2Jacobian(self): * cdef Mat J = Mat(), P = Mat() # <<<<<<<<<<<<<< * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":406 * def getI2Jacobian(self): * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) # <<<<<<<<<<<<<< * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__i2jacobian__') */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetI2Jacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 406, __pyx_L1_error) /* "PETSc/TS.pyx":407 * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) # <<<<<<<<<<<<<< * cdef object jacobian = self.get_attr('__i2jacobian__') * return (J, P, jacobian) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); /* "PETSc/TS.pyx":408 * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__i2jacobian__') # <<<<<<<<<<<<<< * return (J, P, jacobian) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__i2jacobian__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_jacobian = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/TS.pyx":409 * PetscINCREF(J.obj); PetscINCREF(P.obj) * cdef object jacobian = self.get_attr('__i2jacobian__') * return (J, P, jacobian) # <<<<<<<<<<<<<< * * # --- solution vector --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_J)); __Pyx_GIVEREF(((PyObject *)__pyx_v_J)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_J)); __Pyx_INCREF(((PyObject *)__pyx_v_P)); __Pyx_GIVEREF(((PyObject *)__pyx_v_P)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_P)); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":404 * return (f, function) * * def getI2Jacobian(self): # <<<<<<<<<<<<<< * cdef Mat J = Mat(), P = Mat() * CHKERR( TSGetI2Jacobian(self.ts, &J.mat, &P.mat, NULL, NULL) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getI2Jacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_J); __Pyx_XDECREF((PyObject *)__pyx_v_P); __Pyx_XDECREF(__pyx_v_jacobian); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":413 * # --- solution vector --- * * def setSolution(self, Vec u): # <<<<<<<<<<<<<< * CHKERR( TSSetSolution(self.ts, u.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_87setSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_86setSolution[] = "TS.setSolution(self, Vec u)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_87setSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_u = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolution (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSolution") < 0)) __PYX_ERR(42, 413, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_u = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 413, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(42, 413, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_86setSolution(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_86setSolution(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolution", 0); /* "PETSc/TS.pyx":414 * * def setSolution(self, Vec u): * CHKERR( TSSetSolution(self.ts, u.vec) ) # <<<<<<<<<<<<<< * * def getSolution(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetSolution(__pyx_v_self->ts, __pyx_v_u->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 414, __pyx_L1_error) /* "PETSc/TS.pyx":413 * # --- solution vector --- * * def setSolution(self, Vec u): # <<<<<<<<<<<<<< * CHKERR( TSSetSolution(self.ts, u.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":416 * CHKERR( TSSetSolution(self.ts, u.vec) ) * * def getSolution(self): # <<<<<<<<<<<<<< * cdef Vec u = Vec() * CHKERR( TSGetSolution(self.ts, &u.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_89getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_88getSolution[] = "TS.getSolution(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_89getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_88getSolution(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_88getSolution(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_u = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 0); /* "PETSc/TS.pyx":417 * * def getSolution(self): * cdef Vec u = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetSolution(self.ts, &u.vec) ) * PetscINCREF(u.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":418 * def getSolution(self): * cdef Vec u = Vec() * CHKERR( TSGetSolution(self.ts, &u.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(u.obj) * return u */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSolution(__pyx_v_self->ts, (&__pyx_v_u->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 418, __pyx_L1_error) /* "PETSc/TS.pyx":419 * cdef Vec u = Vec() * CHKERR( TSGetSolution(self.ts, &u.vec) ) * PetscINCREF(u.obj) # <<<<<<<<<<<<<< * return u * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_u->__pyx_base.obj)); /* "PETSc/TS.pyx":420 * CHKERR( TSGetSolution(self.ts, &u.vec) ) * PetscINCREF(u.obj) * return u # <<<<<<<<<<<<<< * * def setSolution2(self, Vec u, Vec v): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_u)); __pyx_r = ((PyObject *)__pyx_v_u); goto __pyx_L0; /* "PETSc/TS.pyx":416 * CHKERR( TSSetSolution(self.ts, u.vec) ) * * def getSolution(self): # <<<<<<<<<<<<<< * cdef Vec u = Vec() * CHKERR( TSGetSolution(self.ts, &u.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_u); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":422 * return u * * def setSolution2(self, Vec u, Vec v): # <<<<<<<<<<<<<< * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_91setSolution2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_90setSolution2[] = "TS.setSolution2(self, Vec u, Vec v)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_91setSolution2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_u = 0; struct PyPetscVecObject *__pyx_v_v = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolution2 (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_v,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setSolution2", 1, 2, 2, 1); __PYX_ERR(42, 422, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSolution2") < 0)) __PYX_ERR(42, 422, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_u = ((struct PyPetscVecObject *)values[0]); __pyx_v_v = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSolution2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 422, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution2", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(42, 422, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(42, 422, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_90setSolution2(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u, __pyx_v_v); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_90setSolution2(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u, struct PyPetscVecObject *__pyx_v_v) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSolution2", 0); /* "PETSc/TS.pyx":423 * * def setSolution2(self, Vec u, Vec v): * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) # <<<<<<<<<<<<<< * * def getSolution2(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TS2SetSolution(__pyx_v_self->ts, __pyx_v_u->vec, __pyx_v_v->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 423, __pyx_L1_error) /* "PETSc/TS.pyx":422 * return u * * def setSolution2(self, Vec u, Vec v): # <<<<<<<<<<<<<< * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSolution2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":425 * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) * * def getSolution2(self): # <<<<<<<<<<<<<< * cdef Vec u = Vec() * cdef Vec v = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_93getSolution2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_92getSolution2[] = "TS.getSolution2(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_93getSolution2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution2 (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution2", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution2", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_92getSolution2(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_92getSolution2(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_u = 0; struct PyPetscVecObject *__pyx_v_v = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution2", 0); /* "PETSc/TS.pyx":426 * * def getSolution2(self): * cdef Vec u = Vec() # <<<<<<<<<<<<<< * cdef Vec v = Vec() * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":427 * def getSolution2(self): * cdef Vec u = Vec() * cdef Vec v = Vec() # <<<<<<<<<<<<<< * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) * PetscINCREF(u.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":428 * cdef Vec u = Vec() * cdef Vec v = Vec() * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(u.obj) * PetscINCREF(v.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TS2GetSolution(__pyx_v_self->ts, (&__pyx_v_u->vec), (&__pyx_v_v->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 428, __pyx_L1_error) /* "PETSc/TS.pyx":429 * cdef Vec v = Vec() * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) * PetscINCREF(u.obj) # <<<<<<<<<<<<<< * PetscINCREF(v.obj) * return (u, v) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_u->__pyx_base.obj)); /* "PETSc/TS.pyx":430 * CHKERR( TS2GetSolution(self.ts, &u.vec, &v.vec) ) * PetscINCREF(u.obj) * PetscINCREF(v.obj) # <<<<<<<<<<<<<< * return (u, v) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_v->__pyx_base.obj)); /* "PETSc/TS.pyx":431 * PetscINCREF(u.obj) * PetscINCREF(v.obj) * return (u, v) # <<<<<<<<<<<<<< * * # --- inner solver --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_u)); __Pyx_GIVEREF(((PyObject *)__pyx_v_u)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_u)); __Pyx_INCREF(((PyObject *)__pyx_v_v)); __Pyx_GIVEREF(((PyObject *)__pyx_v_v)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_v)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":425 * CHKERR( TS2SetSolution(self.ts, u.vec, v.vec) ) * * def getSolution2(self): # <<<<<<<<<<<<<< * cdef Vec u = Vec() * cdef Vec v = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSolution2", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_u); __Pyx_XDECREF((PyObject *)__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":435 * # --- inner solver --- * * def getSNES(self): # <<<<<<<<<<<<<< * cdef SNES snes = SNES() * CHKERR( TSGetSNES(self.ts, &snes.snes) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_95getSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_94getSNES[] = "TS.getSNES(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_95getSNES(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSNES (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSNES", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSNES", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_94getSNES(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_94getSNES(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscSNESObject *__pyx_v_snes = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSNES", 0); /* "PETSc/TS.pyx":436 * * def getSNES(self): * cdef SNES snes = SNES() # <<<<<<<<<<<<<< * CHKERR( TSGetSNES(self.ts, &snes.snes) ) * PetscINCREF(snes.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":437 * def getSNES(self): * cdef SNES snes = SNES() * CHKERR( TSGetSNES(self.ts, &snes.snes) ) # <<<<<<<<<<<<<< * PetscINCREF(snes.obj) * return snes */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSNES(__pyx_v_self->ts, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 437, __pyx_L1_error) /* "PETSc/TS.pyx":438 * cdef SNES snes = SNES() * CHKERR( TSGetSNES(self.ts, &snes.snes) ) * PetscINCREF(snes.obj) # <<<<<<<<<<<<<< * return snes * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); /* "PETSc/TS.pyx":439 * CHKERR( TSGetSNES(self.ts, &snes.snes) ) * PetscINCREF(snes.obj) * return snes # <<<<<<<<<<<<<< * * def getKSP(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_snes)); __pyx_r = ((PyObject *)__pyx_v_snes); goto __pyx_L0; /* "PETSc/TS.pyx":435 * # --- inner solver --- * * def getSNES(self): # <<<<<<<<<<<<<< * cdef SNES snes = SNES() * CHKERR( TSGetSNES(self.ts, &snes.snes) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSNES", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_snes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":441 * return snes * * def getKSP(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_97getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_96getKSP[] = "TS.getKSP(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_97getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_96getKSP(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_96getKSP(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 0); /* "PETSc/TS.pyx":442 * * def getKSP(self): * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":443 * def getKSP(self): * cdef KSP ksp = KSP() * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetKSP(__pyx_v_self->ts, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 443, __pyx_L1_error) /* "PETSc/TS.pyx":444 * cdef KSP ksp = KSP() * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/TS.pyx":445 * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * # --- discretization space --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/TS.pyx":441 * return snes * * def getKSP(self): # <<<<<<<<<<<<<< * cdef KSP ksp = KSP() * CHKERR( TSGetKSP(self.ts, &ksp.ksp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":449 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( TSGetDM(self.ts, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_99getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_98getDM[] = "TS.getDM(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_99getDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDM (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_98getDM(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_98getDM(struct PyPetscTSObject *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDM", 0); /* "PETSc/TS.pyx":450 * * def getDM(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetDM(self.ts, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/TS.pyx":451 * def getDM(self): * cdef PetscDM newdm = NULL * CHKERR( TSGetDM(self.ts, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetDM(__pyx_v_self->ts, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 451, __pyx_L1_error) /* "PETSc/TS.pyx":452 * cdef PetscDM newdm = NULL * CHKERR( TSGetDM(self.ts, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * PetscINCREF(dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(42, 452, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":453 * CHKERR( TSGetDM(self.ts, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/TS.pyx":454 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * return dm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/TS.pyx":455 * dm.dm = newdm * PetscINCREF(dm.obj) * return dm # <<<<<<<<<<<<<< * * def setDM(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/TS.pyx":449 * # --- discretization space --- * * def getDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( TSGetDM(self.ts, &newdm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.getDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":457 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( TSSetDM(self.ts, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_101setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_100setDM[] = "TS.setDM(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_101setDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDM") < 0)) __PYX_ERR(42, 457, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 457, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(42, 457, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_100setDM(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_100setDM(struct PyPetscTSObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDM", 0); /* "PETSc/TS.pyx":458 * * def setDM(self, DM dm): * CHKERR( TSSetDM(self.ts, dm.dm) ) # <<<<<<<<<<<<<< * * # --- customization --- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetDM(__pyx_v_self->ts, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 458, __pyx_L1_error) /* "PETSc/TS.pyx":457 * return dm * * def setDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( TSSetDM(self.ts, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":462 * # --- customization --- * * def setTime(self, t): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSSetTime(self.ts, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_103setTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_102setTime[] = "TS.setTime(self, t)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_103setTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTime (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTime") < 0)) __PYX_ERR(42, 462, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_t = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTime", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 462, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_102setTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_102setTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTime", 0); /* "PETSc/TS.pyx":463 * * def setTime(self, t): * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSSetTime(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 463, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":464 * def setTime(self, t): * cdef PetscReal rval = asReal(t) * CHKERR( TSSetTime(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getTime(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetTime(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 464, __pyx_L1_error) /* "PETSc/TS.pyx":462 * # --- customization --- * * def setTime(self, t): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSSetTime(self.ts, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":466 * CHKERR( TSSetTime(self.ts, rval) ) * * def getTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetTime(self.ts, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_105getTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_104getTime[] = "TS.getTime(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_105getTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTime (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_104getTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_104getTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTime", 0); /* "PETSc/TS.pyx":467 * * def getTime(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/TS.pyx":468 * def getTime(self): * cdef PetscReal rval = 0 * CHKERR( TSGetTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 468, __pyx_L1_error) /* "PETSc/TS.pyx":469 * cdef PetscReal rval = 0 * CHKERR( TSGetTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getPrevTime(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":466 * CHKERR( TSSetTime(self.ts, rval) ) * * def getTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetTime(self.ts, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":471 * return toReal(rval) * * def getPrevTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetPrevTime(self.ts, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_107getPrevTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_106getPrevTime[] = "TS.getPrevTime(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_107getPrevTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPrevTime (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPrevTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPrevTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_106getPrevTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_106getPrevTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPrevTime", 0); /* "PETSc/TS.pyx":472 * * def getPrevTime(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetPrevTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/TS.pyx":473 * def getPrevTime(self): * cdef PetscReal rval = 0 * CHKERR( TSGetPrevTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetPrevTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 473, __pyx_L1_error) /* "PETSc/TS.pyx":474 * cdef PetscReal rval = 0 * CHKERR( TSGetPrevTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getSolveTime(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":471 * return toReal(rval) * * def getPrevTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetPrevTime(self.ts, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getPrevTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":476 * return toReal(rval) * * def getSolveTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetSolveTime(self.ts, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_109getSolveTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_108getSolveTime[] = "TS.getSolveTime(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_109getSolveTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolveTime (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolveTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolveTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_108getSolveTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_108getSolveTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolveTime", 0); /* "PETSc/TS.pyx":477 * * def getSolveTime(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetSolveTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/TS.pyx":478 * def getSolveTime(self): * cdef PetscReal rval = 0 * CHKERR( TSGetSolveTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSolveTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 478, __pyx_L1_error) /* "PETSc/TS.pyx":479 * cdef PetscReal rval = 0 * CHKERR( TSGetSolveTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setTimeStep(self, time_step): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":476 * return toReal(rval) * * def getSolveTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetSolveTime(self.ts, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSolveTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":481 * return toReal(rval) * * def setTimeStep(self, time_step): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(time_step) * CHKERR( TSSetTimeStep(self.ts, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_111setTimeStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_110setTimeStep[] = "TS.setTimeStep(self, time_step)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_111setTimeStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_time_step = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTimeStep (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time_step,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time_step)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTimeStep") < 0)) __PYX_ERR(42, 481, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_time_step = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTimeStep", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 481, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTimeStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_110setTimeStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_time_step); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_110setTimeStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_time_step) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTimeStep", 0); /* "PETSc/TS.pyx":482 * * def setTimeStep(self, time_step): * cdef PetscReal rval = asReal(time_step) # <<<<<<<<<<<<<< * CHKERR( TSSetTimeStep(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_time_step); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 482, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":483 * def setTimeStep(self, time_step): * cdef PetscReal rval = asReal(time_step) * CHKERR( TSSetTimeStep(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getTimeStep(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetTimeStep(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 483, __pyx_L1_error) /* "PETSc/TS.pyx":481 * return toReal(rval) * * def setTimeStep(self, time_step): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(time_step) * CHKERR( TSSetTimeStep(self.ts, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTimeStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":485 * CHKERR( TSSetTimeStep(self.ts, rval) ) * * def getTimeStep(self): # <<<<<<<<<<<<<< * cdef PetscReal tstep = 0 * CHKERR( TSGetTimeStep(self.ts, &tstep) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_113getTimeStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_112getTimeStep[] = "TS.getTimeStep(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_113getTimeStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTimeStep (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTimeStep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTimeStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_112getTimeStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_112getTimeStep(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_tstep; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTimeStep", 0); /* "PETSc/TS.pyx":486 * * def getTimeStep(self): * cdef PetscReal tstep = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetTimeStep(self.ts, &tstep) ) * return toReal(tstep) */ __pyx_v_tstep = 0.0; /* "PETSc/TS.pyx":487 * def getTimeStep(self): * cdef PetscReal tstep = 0 * CHKERR( TSGetTimeStep(self.ts, &tstep) ) # <<<<<<<<<<<<<< * return toReal(tstep) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTimeStep(__pyx_v_self->ts, (&__pyx_v_tstep))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 487, __pyx_L1_error) /* "PETSc/TS.pyx":488 * cdef PetscReal tstep = 0 * CHKERR( TSGetTimeStep(self.ts, &tstep) ) * return toReal(tstep) # <<<<<<<<<<<<<< * * def setStepNumber(self, step_number): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_tstep); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":485 * CHKERR( TSSetTimeStep(self.ts, rval) ) * * def getTimeStep(self): # <<<<<<<<<<<<<< * cdef PetscReal tstep = 0 * CHKERR( TSGetTimeStep(self.ts, &tstep) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTimeStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":490 * return toReal(tstep) * * def setStepNumber(self, step_number): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(step_number) * CHKERR( TSSetStepNumber(self.ts, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_115setStepNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_114setStepNumber[] = "TS.setStepNumber(self, step_number)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_115setStepNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_step_number = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStepNumber (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step_number,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step_number)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStepNumber") < 0)) __PYX_ERR(42, 490, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_step_number = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStepNumber", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 490, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setStepNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_114setStepNumber(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_step_number); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_114setStepNumber(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step_number) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStepNumber", 0); /* "PETSc/TS.pyx":491 * * def setStepNumber(self, step_number): * cdef PetscInt ival = asInt(step_number) # <<<<<<<<<<<<<< * CHKERR( TSSetStepNumber(self.ts, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step_number); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 491, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/TS.pyx":492 * def setStepNumber(self, step_number): * cdef PetscInt ival = asInt(step_number) * CHKERR( TSSetStepNumber(self.ts, ival) ) # <<<<<<<<<<<<<< * * def getStepNumber(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetStepNumber(__pyx_v_self->ts, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 492, __pyx_L1_error) /* "PETSc/TS.pyx":490 * return toReal(tstep) * * def setStepNumber(self, step_number): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(step_number) * CHKERR( TSSetStepNumber(self.ts, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setStepNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":494 * CHKERR( TSSetStepNumber(self.ts, ival) ) * * def getStepNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( TSGetStepNumber(self.ts, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_117getStepNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_116getStepNumber[] = "TS.getStepNumber(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_117getStepNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStepNumber (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStepNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_116getStepNumber(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_116getStepNumber(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStepNumber", 0); /* "PETSc/TS.pyx":495 * * def getStepNumber(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetStepNumber(self.ts, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/TS.pyx":496 * def getStepNumber(self): * cdef PetscInt ival = 0 * CHKERR( TSGetStepNumber(self.ts, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetStepNumber(__pyx_v_self->ts, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 496, __pyx_L1_error) /* "PETSc/TS.pyx":497 * cdef PetscInt ival = 0 * CHKERR( TSGetStepNumber(self.ts, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def setMaxTime(self, max_time): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":494 * CHKERR( TSSetStepNumber(self.ts, ival) ) * * def getStepNumber(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( TSGetStepNumber(self.ts, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getStepNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":499 * return toInt(ival) * * def setMaxTime(self, max_time): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(max_time) * CHKERR( TSSetMaxTime(self.ts, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_119setMaxTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_118setMaxTime[] = "TS.setMaxTime(self, max_time)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_119setMaxTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_max_time = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxTime (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_time,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_time)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxTime") < 0)) __PYX_ERR(42, 499, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_max_time = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxTime", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 499, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_118setMaxTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_max_time); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_118setMaxTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_time) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxTime", 0); /* "PETSc/TS.pyx":500 * * def setMaxTime(self, max_time): * cdef PetscReal rval = asReal(max_time) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxTime(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_max_time); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 500, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":501 * def setMaxTime(self, max_time): * cdef PetscReal rval = asReal(max_time) * CHKERR( TSSetMaxTime(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getMaxTime(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxTime(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 501, __pyx_L1_error) /* "PETSc/TS.pyx":499 * return toInt(ival) * * def setMaxTime(self, max_time): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(max_time) * CHKERR( TSSetMaxTime(self.ts, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":503 * CHKERR( TSSetMaxTime(self.ts, rval) ) * * def getMaxTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetMaxTime(self.ts, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_121getMaxTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_120getMaxTime[] = "TS.getMaxTime(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_121getMaxTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxTime (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxTime", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxTime", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_120getMaxTime(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_120getMaxTime(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxTime", 0); /* "PETSc/TS.pyx":504 * * def getMaxTime(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetMaxTime(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/TS.pyx":505 * def getMaxTime(self): * cdef PetscReal rval = 0 * CHKERR( TSGetMaxTime(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetMaxTime(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 505, __pyx_L1_error) /* "PETSc/TS.pyx":506 * cdef PetscReal rval = 0 * CHKERR( TSGetMaxTime(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setMaxSteps(self, max_steps): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":503 * CHKERR( TSSetMaxTime(self.ts, rval) ) * * def getMaxTime(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSGetMaxTime(self.ts, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getMaxTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":508 * return toReal(rval) * * def setMaxSteps(self, max_steps): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_steps) * CHKERR( TSSetMaxSteps(self.ts, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_123setMaxSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_122setMaxSteps[] = "TS.setMaxSteps(self, max_steps)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_123setMaxSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_max_steps = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxSteps (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_max_steps,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_steps)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxSteps") < 0)) __PYX_ERR(42, 508, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_max_steps = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxSteps", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 508, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_122setMaxSteps(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_max_steps); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_122setMaxSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_steps) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxSteps", 0); /* "PETSc/TS.pyx":509 * * def setMaxSteps(self, max_steps): * cdef PetscInt ival = asInt(max_steps) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxSteps(self.ts, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_steps); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 509, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/TS.pyx":510 * def setMaxSteps(self, max_steps): * cdef PetscInt ival = asInt(max_steps) * CHKERR( TSSetMaxSteps(self.ts, ival) ) # <<<<<<<<<<<<<< * * def getMaxSteps(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxSteps(__pyx_v_self->ts, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 510, __pyx_L1_error) /* "PETSc/TS.pyx":508 * return toReal(rval) * * def setMaxSteps(self, max_steps): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(max_steps) * CHKERR( TSSetMaxSteps(self.ts, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":512 * CHKERR( TSSetMaxSteps(self.ts, ival) ) * * def getMaxSteps(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( TSGetMaxSteps(self.ts, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_125getMaxSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_124getMaxSteps[] = "TS.getMaxSteps(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_125getMaxSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxSteps (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxSteps", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxSteps", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_124getMaxSteps(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_124getMaxSteps(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxSteps", 0); /* "PETSc/TS.pyx":513 * * def getMaxSteps(self): * cdef PetscInt ival = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetMaxSteps(self.ts, &ival) ) * return toInt(ival) */ __pyx_v_ival = 0; /* "PETSc/TS.pyx":514 * def getMaxSteps(self): * cdef PetscInt ival = 0 * CHKERR( TSGetMaxSteps(self.ts, &ival) ) # <<<<<<<<<<<<<< * return toInt(ival) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetMaxSteps(__pyx_v_self->ts, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 514, __pyx_L1_error) /* "PETSc/TS.pyx":515 * cdef PetscInt ival = 0 * CHKERR( TSGetMaxSteps(self.ts, &ival) ) * return toInt(ival) # <<<<<<<<<<<<<< * * def getSNESIterations(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":512 * CHKERR( TSSetMaxSteps(self.ts, ival) ) * * def getMaxSteps(self): # <<<<<<<<<<<<<< * cdef PetscInt ival = 0 * CHKERR( TSGetMaxSteps(self.ts, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getMaxSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":517 * return toInt(ival) * * def getSNESIterations(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetSNESIterations(self.ts, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_127getSNESIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_126getSNESIterations[] = "TS.getSNESIterations(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_127getSNESIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSNESIterations (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSNESIterations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSNESIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_126getSNESIterations(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_126getSNESIterations(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSNESIterations", 0); /* "PETSc/TS.pyx":518 * * def getSNESIterations(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetSNESIterations(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/TS.pyx":519 * def getSNESIterations(self): * cdef PetscInt n = 0 * CHKERR( TSGetSNESIterations(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSNESIterations(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 519, __pyx_L1_error) /* "PETSc/TS.pyx":520 * cdef PetscInt n = 0 * CHKERR( TSGetSNESIterations(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def getKSPIterations(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":517 * return toInt(ival) * * def getSNESIterations(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetSNESIterations(self.ts, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSNESIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":522 * return toInt(n) * * def getKSPIterations(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetKSPIterations(self.ts, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_129getKSPIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_128getKSPIterations[] = "TS.getKSPIterations(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_129getKSPIterations(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSPIterations (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getKSPIterations", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSPIterations", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_128getKSPIterations(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_128getKSPIterations(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSPIterations", 0); /* "PETSc/TS.pyx":523 * * def getKSPIterations(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetKSPIterations(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/TS.pyx":524 * def getKSPIterations(self): * cdef PetscInt n = 0 * CHKERR( TSGetKSPIterations(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetKSPIterations(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 524, __pyx_L1_error) /* "PETSc/TS.pyx":525 * cdef PetscInt n = 0 * CHKERR( TSGetKSPIterations(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setMaxStepRejections(self, n): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":522 * return toInt(n) * * def getKSPIterations(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetKSPIterations(self.ts, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getKSPIterations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":527 * return toInt(n) * * def setMaxStepRejections(self, n): # <<<<<<<<<<<<<< * cdef PetscInt rej = asInt(n) * CHKERR( TSSetMaxStepRejections(self.ts, rej)) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_131setMaxStepRejections(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_130setMaxStepRejections[] = "TS.setMaxStepRejections(self, n)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_131setMaxStepRejections(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxStepRejections (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxStepRejections") < 0)) __PYX_ERR(42, 527, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxStepRejections", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 527, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxStepRejections", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_130setMaxStepRejections(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_130setMaxStepRejections(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_rej; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxStepRejections", 0); /* "PETSc/TS.pyx":528 * * def setMaxStepRejections(self, n): * cdef PetscInt rej = asInt(n) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxStepRejections(self.ts, rej)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 528, __pyx_L1_error) __pyx_v_rej = __pyx_t_1; /* "PETSc/TS.pyx":529 * def setMaxStepRejections(self, n): * cdef PetscInt rej = asInt(n) * CHKERR( TSSetMaxStepRejections(self.ts, rej)) # <<<<<<<<<<<<<< * * #def getMaxStepRejections(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxStepRejections(__pyx_v_self->ts, __pyx_v_rej)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 529, __pyx_L1_error) /* "PETSc/TS.pyx":527 * return toInt(n) * * def setMaxStepRejections(self, n): # <<<<<<<<<<<<<< * cdef PetscInt rej = asInt(n) * CHKERR( TSSetMaxStepRejections(self.ts, rej)) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxStepRejections", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":536 * # return toInt(n) * * def getStepRejections(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetStepRejections(self.ts, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_133getStepRejections(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_132getStepRejections[] = "TS.getStepRejections(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_133getStepRejections(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStepRejections (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStepRejections", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStepRejections", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_132getStepRejections(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_132getStepRejections(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStepRejections", 0); /* "PETSc/TS.pyx":537 * * def getStepRejections(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetStepRejections(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/TS.pyx":538 * def getStepRejections(self): * cdef PetscInt n = 0 * CHKERR( TSGetStepRejections(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetStepRejections(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 538, __pyx_L1_error) /* "PETSc/TS.pyx":539 * cdef PetscInt n = 0 * CHKERR( TSGetStepRejections(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setMaxSNESFailures(self, n): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":536 * # return toInt(n) * * def getStepRejections(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetStepRejections(self.ts, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getStepRejections", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":541 * return toInt(n) * * def setMaxSNESFailures(self, n): # <<<<<<<<<<<<<< * cdef PetscInt fails = asInt(n) * CHKERR( TSSetMaxSNESFailures(self.ts, fails)) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_135setMaxSNESFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_134setMaxSNESFailures[] = "TS.setMaxSNESFailures(self, n)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_135setMaxSNESFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_n = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMaxSNESFailures (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMaxSNESFailures") < 0)) __PYX_ERR(42, 541, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_n = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMaxSNESFailures", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 541, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSNESFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_134setMaxSNESFailures(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_n); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_134setMaxSNESFailures(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n) { PetscInt __pyx_v_fails; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMaxSNESFailures", 0); /* "PETSc/TS.pyx":542 * * def setMaxSNESFailures(self, n): * cdef PetscInt fails = asInt(n) # <<<<<<<<<<<<<< * CHKERR( TSSetMaxSNESFailures(self.ts, fails)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 542, __pyx_L1_error) __pyx_v_fails = __pyx_t_1; /* "PETSc/TS.pyx":543 * def setMaxSNESFailures(self, n): * cdef PetscInt fails = asInt(n) * CHKERR( TSSetMaxSNESFailures(self.ts, fails)) # <<<<<<<<<<<<<< * * #def getMaxSNESFailures(self, n): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetMaxSNESFailures(__pyx_v_self->ts, __pyx_v_fails)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 543, __pyx_L1_error) /* "PETSc/TS.pyx":541 * return toInt(n) * * def setMaxSNESFailures(self, n): # <<<<<<<<<<<<<< * cdef PetscInt fails = asInt(n) * CHKERR( TSSetMaxSNESFailures(self.ts, fails)) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMaxSNESFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":550 * # return toInt(n) * * def getSNESFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetSNESFailures(self.ts, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_137getSNESFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_136getSNESFailures[] = "TS.getSNESFailures(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_137getSNESFailures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSNESFailures (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSNESFailures", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSNESFailures", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_136getSNESFailures(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_136getSNESFailures(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSNESFailures", 0); /* "PETSc/TS.pyx":551 * * def getSNESFailures(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetSNESFailures(self.ts, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/TS.pyx":552 * def getSNESFailures(self): * cdef PetscInt n = 0 * CHKERR( TSGetSNESFailures(self.ts, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSNESFailures(__pyx_v_self->ts, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 552, __pyx_L1_error) /* "PETSc/TS.pyx":553 * cdef PetscInt n = 0 * CHKERR( TSGetSNESFailures(self.ts, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setErrorIfStepFails(self, flag=True): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":550 * # return toInt(n) * * def getSNESFailures(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( TSGetSNESFailures(self.ts, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getSNESFailures", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":555 * return toInt(n) * * def setErrorIfStepFails(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_139setErrorIfStepFails(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_138setErrorIfStepFails[] = "TS.setErrorIfStepFails(self, flag=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_139setErrorIfStepFails(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setErrorIfStepFails (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setErrorIfStepFails") < 0)) __PYX_ERR(42, 555, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setErrorIfStepFails", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 555, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setErrorIfStepFails", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_138setErrorIfStepFails(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_138setErrorIfStepFails(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setErrorIfStepFails", 0); /* "PETSc/TS.pyx":556 * * def setErrorIfStepFails(self, flag=True): * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 556, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "PETSc/TS.pyx":557 * def setErrorIfStepFails(self, flag=True): * cdef PetscBool bval = flag * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) # <<<<<<<<<<<<<< * * def setTolerances(self, rtol=None, atol=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetErrorIfStepFails(__pyx_v_self->ts, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 557, __pyx_L1_error) /* "PETSc/TS.pyx":555 * return toInt(n) * * def setErrorIfStepFails(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setErrorIfStepFails", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":559 * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) * * def setTolerances(self, rtol=None, atol=None): # <<<<<<<<<<<<<< * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_141setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_140setTolerances[] = "TS.setTolerances(self, rtol=None, atol=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_141setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rtol,&__pyx_n_s_atol,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rtol); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_atol); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTolerances") < 0)) __PYX_ERR(42, 559, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rtol = values[0]; __pyx_v_atol = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 559, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_140setTolerances(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_140setTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol) { PetscReal __pyx_v_rrtol; PetscReal __pyx_v_ratol; Vec __pyx_v_vrtol; Vec __pyx_v_vatol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PetscReal __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 0); /* "PETSc/TS.pyx":560 * * def setTolerances(self, rtol=None, atol=None): * cdef PetscReal rrtol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL */ __pyx_v_rrtol = PETSC_DEFAULT; /* "PETSc/TS.pyx":561 * def setTolerances(self, rtol=None, atol=None): * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL */ __pyx_v_ratol = PETSC_DEFAULT; /* "PETSc/TS.pyx":562 * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL # <<<<<<<<<<<<<< * cdef PetscVec vatol = NULL * if rtol is None: */ __pyx_v_vrtol = NULL; /* "PETSc/TS.pyx":563 * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL # <<<<<<<<<<<<<< * if rtol is None: * pass */ __pyx_v_vatol = NULL; /* "PETSc/TS.pyx":564 * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL * if rtol is None: # <<<<<<<<<<<<<< * pass * elif isinstance(rtol, Vec): */ __pyx_t_1 = (__pyx_v_rtol == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { goto __pyx_L3; } /* "PETSc/TS.pyx":566 * if rtol is None: * pass * elif isinstance(rtol, Vec): # <<<<<<<<<<<<<< * vrtol = (rtol).vec * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rtol, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":567 * pass * elif isinstance(rtol, Vec): * vrtol = (rtol).vec # <<<<<<<<<<<<<< * else: * rrtol = asReal(rtol) */ __pyx_t_3 = ((struct PyPetscVecObject *)__pyx_v_rtol)->vec; __pyx_v_vrtol = __pyx_t_3; /* "PETSc/TS.pyx":566 * if rtol is None: * pass * elif isinstance(rtol, Vec): # <<<<<<<<<<<<<< * vrtol = (rtol).vec * else: */ goto __pyx_L3; } /* "PETSc/TS.pyx":569 * vrtol = (rtol).vec * else: * rrtol = asReal(rtol) # <<<<<<<<<<<<<< * if atol is None: * pass */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_rtol); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 569, __pyx_L1_error) __pyx_v_rrtol = __pyx_t_4; } __pyx_L3:; /* "PETSc/TS.pyx":570 * else: * rrtol = asReal(rtol) * if atol is None: # <<<<<<<<<<<<<< * pass * elif isinstance(atol, Vec): */ __pyx_t_1 = (__pyx_v_atol == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { goto __pyx_L4; } /* "PETSc/TS.pyx":572 * if atol is None: * pass * elif isinstance(atol, Vec): # <<<<<<<<<<<<<< * vatol = (atol).vec * else: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_atol, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":573 * pass * elif isinstance(atol, Vec): * vatol = (atol).vec # <<<<<<<<<<<<<< * else: * ratol = asReal(atol) */ __pyx_t_3 = ((struct PyPetscVecObject *)__pyx_v_atol)->vec; __pyx_v_vatol = __pyx_t_3; /* "PETSc/TS.pyx":572 * if atol is None: * pass * elif isinstance(atol, Vec): # <<<<<<<<<<<<<< * vatol = (atol).vec * else: */ goto __pyx_L4; } /* "PETSc/TS.pyx":575 * vatol = (atol).vec * else: * ratol = asReal(atol) # <<<<<<<<<<<<<< * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) * */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_atol); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 575, __pyx_L1_error) __pyx_v_ratol = __pyx_t_4; } __pyx_L4:; /* "PETSc/TS.pyx":576 * else: * ratol = asReal(atol) * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) # <<<<<<<<<<<<<< * * def getTolerances(self): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetTolerances(__pyx_v_self->ts, __pyx_v_ratol, __pyx_v_vatol, __pyx_v_rrtol, __pyx_v_vrtol)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 576, __pyx_L1_error) /* "PETSc/TS.pyx":559 * CHKERR( TSSetErrorIfStepFails(self.ts, bval)) * * def setTolerances(self, rtol=None, atol=None): # <<<<<<<<<<<<<< * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":578 * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_143getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_142getTolerances[] = "TS.getTolerances(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_143getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_142getTolerances(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_142getTolerances(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rrtol; PetscReal __pyx_v_ratol; Vec __pyx_v_vrtol; Vec __pyx_v_vatol; PyObject *__pyx_v_rtol = 0; PyObject *__pyx_v_atol = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 0); /* "PETSc/TS.pyx":579 * * def getTolerances(self): * cdef PetscReal rrtol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL */ __pyx_v_rrtol = PETSC_DEFAULT; /* "PETSc/TS.pyx":580 * def getTolerances(self): * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL */ __pyx_v_ratol = PETSC_DEFAULT; /* "PETSc/TS.pyx":581 * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL # <<<<<<<<<<<<<< * cdef PetscVec vatol = NULL * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) */ __pyx_v_vrtol = NULL; /* "PETSc/TS.pyx":582 * cdef PetscReal ratol = PETSC_DEFAULT * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None */ __pyx_v_vatol = NULL; /* "PETSc/TS.pyx":583 * cdef PetscVec vrtol = NULL * cdef PetscVec vatol = NULL * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) # <<<<<<<<<<<<<< * cdef object rtol = None * if vrtol != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetTolerances(__pyx_v_self->ts, (&__pyx_v_ratol), (&__pyx_v_vatol), (&__pyx_v_rrtol), (&__pyx_v_vrtol))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 583, __pyx_L1_error) /* "PETSc/TS.pyx":584 * cdef PetscVec vatol = NULL * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None # <<<<<<<<<<<<<< * if vrtol != NULL: * rtol = ref_Vec(vrtol) */ __Pyx_INCREF(Py_None); __pyx_v_rtol = Py_None; /* "PETSc/TS.pyx":585 * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None * if vrtol != NULL: # <<<<<<<<<<<<<< * rtol = ref_Vec(vrtol) * else: */ __pyx_t_2 = ((__pyx_v_vrtol != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":586 * cdef object rtol = None * if vrtol != NULL: * rtol = ref_Vec(vrtol) # <<<<<<<<<<<<<< * else: * rtol = toReal(rrtol) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vrtol)); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_rtol, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":585 * CHKERR( TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol) ) * cdef object rtol = None * if vrtol != NULL: # <<<<<<<<<<<<<< * rtol = ref_Vec(vrtol) * else: */ goto __pyx_L3; } /* "PETSc/TS.pyx":588 * rtol = ref_Vec(vrtol) * else: * rtol = toReal(rrtol) # <<<<<<<<<<<<<< * cdef object atol = None * if vatol != NULL: */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rrtol); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_rtol, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "PETSc/TS.pyx":589 * else: * rtol = toReal(rrtol) * cdef object atol = None # <<<<<<<<<<<<<< * if vatol != NULL: * atol = ref_Vec(vatol) */ __Pyx_INCREF(Py_None); __pyx_v_atol = Py_None; /* "PETSc/TS.pyx":590 * rtol = toReal(rrtol) * cdef object atol = None * if vatol != NULL: # <<<<<<<<<<<<<< * atol = ref_Vec(vatol) * else: */ __pyx_t_2 = ((__pyx_v_vatol != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":591 * cdef object atol = None * if vatol != NULL: * atol = ref_Vec(vatol) # <<<<<<<<<<<<<< * else: * atol = toReal(ratol) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_vatol)); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_atol, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":590 * rtol = toReal(rrtol) * cdef object atol = None * if vatol != NULL: # <<<<<<<<<<<<<< * atol = ref_Vec(vatol) * else: */ goto __pyx_L4; } /* "PETSc/TS.pyx":593 * atol = ref_Vec(vatol) * else: * atol = toReal(ratol) # <<<<<<<<<<<<<< * return (rtol, atol) * */ /*else*/ { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ratol); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_atol, __pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; /* "PETSc/TS.pyx":594 * else: * atol = toReal(ratol) * return (rtol, atol) # <<<<<<<<<<<<<< * * def setExactFinalTime(self, option): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_rtol); __Pyx_GIVEREF(__pyx_v_rtol); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rtol); __Pyx_INCREF(__pyx_v_atol); __Pyx_GIVEREF(__pyx_v_atol); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_atol); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":578 * CHKERR( TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * cdef PetscReal rrtol = PETSC_DEFAULT * cdef PetscReal ratol = PETSC_DEFAULT */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rtol); __Pyx_XDECREF(__pyx_v_atol); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":596 * return (rtol, atol) * * def setExactFinalTime(self, option): # <<<<<<<<<<<<<< * cdef PetscTSExactFinalTimeOption oval = option * CHKERR( TSSetExactFinalTime(self.ts, oval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_145setExactFinalTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_144setExactFinalTime[] = "TS.setExactFinalTime(self, option)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_145setExactFinalTime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_option = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setExactFinalTime (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_option,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setExactFinalTime") < 0)) __PYX_ERR(42, 596, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_option = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setExactFinalTime", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 596, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setExactFinalTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_144setExactFinalTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_option); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_144setExactFinalTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_option) { TSExactFinalTimeOption __pyx_v_oval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSExactFinalTimeOption __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setExactFinalTime", 0); /* "PETSc/TS.pyx":597 * * def setExactFinalTime(self, option): * cdef PetscTSExactFinalTimeOption oval = option # <<<<<<<<<<<<<< * CHKERR( TSSetExactFinalTime(self.ts, oval) ) * */ __pyx_t_1 = ((TSExactFinalTimeOption)__Pyx_PyInt_As_TSExactFinalTimeOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 597, __pyx_L1_error) __pyx_v_oval = __pyx_t_1; /* "PETSc/TS.pyx":598 * def setExactFinalTime(self, option): * cdef PetscTSExactFinalTimeOption oval = option * CHKERR( TSSetExactFinalTime(self.ts, oval) ) # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetExactFinalTime(__pyx_v_self->ts, __pyx_v_oval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 598, __pyx_L1_error) /* "PETSc/TS.pyx":596 * return (rtol, atol) * * def setExactFinalTime(self, option): # <<<<<<<<<<<<<< * cdef PetscTSExactFinalTimeOption oval = option * CHKERR( TSSetExactFinalTime(self.ts, oval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setExactFinalTime", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":600 * CHKERR( TSSetExactFinalTime(self.ts, oval) ) * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * cdef PetscTSConvergedReason cval = reason * CHKERR( TSSetConvergedReason(self.ts, cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_147setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_146setConvergedReason[] = "TS.setConvergedReason(self, reason)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_147setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_reason = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergedReason") < 0)) __PYX_ERR(42, 600, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 600, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_146setConvergedReason(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_146setConvergedReason(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_reason) { TSConvergedReason __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TSConvergedReason __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 0); /* "PETSc/TS.pyx":601 * * def setConvergedReason(self, reason): * cdef PetscTSConvergedReason cval = reason # <<<<<<<<<<<<<< * CHKERR( TSSetConvergedReason(self.ts, cval) ) * */ __pyx_t_1 = ((TSConvergedReason)__Pyx_PyInt_As_TSConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 601, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/TS.pyx":602 * def setConvergedReason(self, reason): * cdef PetscTSConvergedReason cval = reason * CHKERR( TSSetConvergedReason(self.ts, cval) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetConvergedReason(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 602, __pyx_L1_error) /* "PETSc/TS.pyx":600 * CHKERR( TSSetExactFinalTime(self.ts, oval) ) * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * cdef PetscTSConvergedReason cval = reason * CHKERR( TSSetConvergedReason(self.ts, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":604 * CHKERR( TSSetConvergedReason(self.ts, cval) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING * CHKERR( TSGetConvergedReason(self.ts, &reason) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_149getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_148getConvergedReason[] = "TS.getConvergedReason(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_149getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_148getConvergedReason(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_148getConvergedReason(struct PyPetscTSObject *__pyx_v_self) { TSConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 0); /* "PETSc/TS.pyx":605 * * def getConvergedReason(self): * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING # <<<<<<<<<<<<<< * CHKERR( TSGetConvergedReason(self.ts, &reason) ) * return reason */ __pyx_v_reason = TS_CONVERGED_ITERATING; /* "PETSc/TS.pyx":606 * def getConvergedReason(self): * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING * CHKERR( TSGetConvergedReason(self.ts, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetConvergedReason(__pyx_v_self->ts, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 606, __pyx_L1_error) /* "PETSc/TS.pyx":607 * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING * CHKERR( TSGetConvergedReason(self.ts, &reason) ) * return reason # <<<<<<<<<<<<<< * * # --- monitoring --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TSConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":604 * CHKERR( TSSetConvergedReason(self.ts, cval) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING * CHKERR( TSGetConvergedReason(self.ts, &reason) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":611 * # --- monitoring --- * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_151setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_150setMonitor[] = "TS.setMonitor(self, monitor, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_151setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_monitor)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMonitor") < 0)) __PYX_ERR(42, 611, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 611, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_150setMonitor(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_150setMonitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":612 * * def setMonitor(self, monitor, args=None, kargs=None): * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_monitor == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/TS.pyx":613 * def setMonitor(self, monitor, args=None, kargs=None): * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: * monitorlist = [] */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_monitorlist = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/TS.pyx":614 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":615 * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: * monitorlist = [] # <<<<<<<<<<<<<< * self.set_attr('__monitor__', monitorlist) * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_monitorlist, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":616 * if monitorlist is None: * monitorlist = [] * self.set_attr('__monitor__', monitorlist) # <<<<<<<<<<<<<< * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) * if args is None: args = () */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_v_monitorlist); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":617 * monitorlist = [] * self.set_attr('__monitor__', monitorlist) * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSMonitorSet(__pyx_v_self->ts, __pyx_f_8petsc4py_5PETSc_TS_Monitor, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 617, __pyx_L1_error) /* "PETSc/TS.pyx":614 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * monitorlist = [] * self.set_attr('__monitor__', monitorlist) */ } /* "PETSc/TS.pyx":618 * self.set_attr('__monitor__', monitorlist) * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (monitor, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":619 * CHKERR( TSMonitorSet(self.ts, TS_Monitor, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (monitor, args, kargs) * monitorlist.append(context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TS.pyx":620 * if args is None: args = () * if kargs is None: kargs = {} * context = (monitor, args, kargs) # <<<<<<<<<<<<<< * monitorlist.append(context) * */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_monitor); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":621 * if kargs is None: kargs = {} * context = (monitor, args, kargs) * monitorlist.append(context) # <<<<<<<<<<<<<< * * def getMonitor(self): */ __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_v_context); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 621, __pyx_L1_error) /* "PETSc/TS.pyx":611 * # --- monitoring --- * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":623 * monitorlist.append(context) * * def getMonitor(self): # <<<<<<<<<<<<<< * return self.get_attr('__monitor__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_153getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_152getMonitor[] = "TS.getMonitor(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_153getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_152getMonitor(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_152getMonitor(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 0); /* "PETSc/TS.pyx":624 * * def getMonitor(self): * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def cancelMonitor(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":623 * monitorlist.append(context) * * def getMonitor(self): # <<<<<<<<<<<<<< * return self.get_attr('__monitor__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":626 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * CHKERR( TSMonitorCancel(self.ts) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_155cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_154cancelMonitor[] = "TS.cancelMonitor(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_155cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cancelMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("cancelMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "cancelMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_154cancelMonitor(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_154cancelMonitor(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cancelMonitor", 0); /* "PETSc/TS.pyx":627 * * def cancelMonitor(self): * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * CHKERR( TSMonitorCancel(self.ts) ) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":628 * def cancelMonitor(self): * self.set_attr('__monitor__', None) * CHKERR( TSMonitorCancel(self.ts) ) # <<<<<<<<<<<<<< * * def monitor(self, step, time, Vec u=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSMonitorCancel(__pyx_v_self->ts)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 628, __pyx_L1_error) /* "PETSc/TS.pyx":626 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * CHKERR( TSMonitorCancel(self.ts) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.cancelMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":630 * CHKERR( TSMonitorCancel(self.ts) ) * * def monitor(self, step, time, Vec u=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(step) * cdef PetscReal rval = asReal(time) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_157monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_156monitor[] = "TS.monitor(self, step, time, Vec u=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_157monitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_step = 0; PyObject *__pyx_v_time = 0; struct PyPetscVecObject *__pyx_v_u = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("monitor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_step,&__pyx_n_s_time,&__pyx_n_s_u,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("monitor", 0, 2, 3, 1); __PYX_ERR(42, 630, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "monitor") < 0)) __PYX_ERR(42, 630, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_step = values[0]; __pyx_v_time = values[1]; __pyx_v_u = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("monitor", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 630, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "u", 0))) __PYX_ERR(42, 630, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_156monitor(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_step, __pyx_v_time, __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_156monitor(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step, PyObject *__pyx_v_time, struct PyPetscVecObject *__pyx_v_u) { PetscInt __pyx_v_ival; PetscReal __pyx_v_rval; Vec __pyx_v_uvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscReal __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Vec __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("monitor", 0); /* "PETSc/TS.pyx":631 * * def monitor(self, step, time, Vec u=None): * cdef PetscInt ival = asInt(step) # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(time) * cdef PetscVec uvec = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_step); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 631, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/TS.pyx":632 * def monitor(self, step, time, Vec u=None): * cdef PetscInt ival = asInt(step) * cdef PetscReal rval = asReal(time) # <<<<<<<<<<<<<< * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_time); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 632, __pyx_L1_error) __pyx_v_rval = __pyx_t_2; /* "PETSc/TS.pyx":633 * cdef PetscInt ival = asInt(step) * cdef PetscReal rval = asReal(time) * cdef PetscVec uvec = NULL # <<<<<<<<<<<<<< * if u is not None: uvec = u.vec * if uvec == NULL: */ __pyx_v_uvec = NULL; /* "PETSc/TS.pyx":634 * cdef PetscReal rval = asReal(time) * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec # <<<<<<<<<<<<<< * if uvec == NULL: * CHKERR( TSGetSolution(self.ts, &uvec) ) */ __pyx_t_3 = (((PyObject *)__pyx_v_u) != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { __pyx_t_5 = __pyx_v_u->vec; __pyx_v_uvec = __pyx_t_5; } /* "PETSc/TS.pyx":635 * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec * if uvec == NULL: # <<<<<<<<<<<<<< * CHKERR( TSGetSolution(self.ts, &uvec) ) * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) */ __pyx_t_4 = ((__pyx_v_uvec == NULL) != 0); if (__pyx_t_4) { /* "PETSc/TS.pyx":636 * if u is not None: uvec = u.vec * if uvec == NULL: * CHKERR( TSGetSolution(self.ts, &uvec) ) # <<<<<<<<<<<<<< * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSolution(__pyx_v_self->ts, (&__pyx_v_uvec))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(42, 636, __pyx_L1_error) /* "PETSc/TS.pyx":635 * cdef PetscVec uvec = NULL * if u is not None: uvec = u.vec * if uvec == NULL: # <<<<<<<<<<<<<< * CHKERR( TSGetSolution(self.ts, &uvec) ) * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) */ } /* "PETSc/TS.pyx":637 * if uvec == NULL: * CHKERR( TSGetSolution(self.ts, &uvec) ) * CHKERR( TSMonitor(self.ts, ival, rval, uvec) ) # <<<<<<<<<<<<<< * * # --- event handling --- */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSMonitor(__pyx_v_self->ts, __pyx_v_ival, __pyx_v_rval, __pyx_v_uvec)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(42, 637, __pyx_L1_error) /* "PETSc/TS.pyx":630 * CHKERR( TSMonitorCancel(self.ts) ) * * def monitor(self, step, time, Vec u=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(step) * cdef PetscReal rval = asReal(time) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.monitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":641 * # --- event handling --- * * def setEventHandler(self, direction, terminate, eventhandler, postevent=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscInt ndirs = 0 * cdef PetscInt *idirs = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_159setEventHandler(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_158setEventHandler[] = "TS.setEventHandler(self, direction, terminate, eventhandler, postevent=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_159setEventHandler(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_direction = 0; PyObject *__pyx_v_terminate = 0; PyObject *__pyx_v_eventhandler = 0; PyObject *__pyx_v_postevent = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setEventHandler (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_direction,&__pyx_n_s_terminate,&__pyx_n_s_eventhandler,&__pyx_n_s_postevent,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_direction)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_terminate)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setEventHandler", 0, 3, 6, 1); __PYX_ERR(42, 641, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eventhandler)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setEventHandler", 0, 3, 6, 2); __PYX_ERR(42, 641, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_postevent); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setEventHandler") < 0)) __PYX_ERR(42, 641, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_direction = values[0]; __pyx_v_terminate = values[1]; __pyx_v_eventhandler = values[2]; __pyx_v_postevent = values[3]; __pyx_v_args = values[4]; __pyx_v_kargs = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setEventHandler", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 641, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_158setEventHandler(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_direction, __pyx_v_terminate, __pyx_v_eventhandler, __pyx_v_postevent, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_158setEventHandler(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_direction, PyObject *__pyx_v_terminate, PyObject *__pyx_v_eventhandler, PyObject *__pyx_v_postevent, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PetscInt __pyx_v_ndirs; PetscInt *__pyx_v_idirs; PetscInt __pyx_v_nterm; PetscBool *__pyx_v_iterm; PetscInt __pyx_v_nevents; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setEventHandler", 0); __Pyx_INCREF(__pyx_v_direction); __Pyx_INCREF(__pyx_v_terminate); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":642 * * def setEventHandler(self, direction, terminate, eventhandler, postevent=None, args=None, kargs=None): * cdef PetscInt ndirs = 0 # <<<<<<<<<<<<<< * cdef PetscInt *idirs = NULL * direction = iarray_i(direction, &ndirs, &idirs) */ __pyx_v_ndirs = 0; /* "PETSc/TS.pyx":643 * def setEventHandler(self, direction, terminate, eventhandler, postevent=None, args=None, kargs=None): * cdef PetscInt ndirs = 0 * cdef PetscInt *idirs = NULL # <<<<<<<<<<<<<< * direction = iarray_i(direction, &ndirs, &idirs) * */ __pyx_v_idirs = NULL; /* "PETSc/TS.pyx":644 * cdef PetscInt ndirs = 0 * cdef PetscInt *idirs = NULL * direction = iarray_i(direction, &ndirs, &idirs) # <<<<<<<<<<<<<< * * cdef PetscInt nterm = 0 */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_direction, (&__pyx_v_ndirs), (&__pyx_v_idirs))); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_direction, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":646 * direction = iarray_i(direction, &ndirs, &idirs) * * cdef PetscInt nterm = 0 # <<<<<<<<<<<<<< * cdef PetscBool *iterm = NULL * terminate = iarray_b(terminate, &nterm, &iterm) */ __pyx_v_nterm = 0; /* "PETSc/TS.pyx":647 * * cdef PetscInt nterm = 0 * cdef PetscBool *iterm = NULL # <<<<<<<<<<<<<< * terminate = iarray_b(terminate, &nterm, &iterm) * assert nterm == ndirs */ __pyx_v_iterm = NULL; /* "PETSc/TS.pyx":648 * cdef PetscInt nterm = 0 * cdef PetscBool *iterm = NULL * terminate = iarray_b(terminate, &nterm, &iterm) # <<<<<<<<<<<<<< * assert nterm == ndirs * */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_b(__pyx_v_terminate, (&__pyx_v_nterm), (&__pyx_v_iterm))); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_terminate, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":649 * cdef PetscBool *iterm = NULL * terminate = iarray_b(terminate, &nterm, &iterm) * assert nterm == ndirs # <<<<<<<<<<<<<< * * cdef PetscInt nevents = ndirs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_nterm == __pyx_v_ndirs) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(42, 649, __pyx_L1_error) } } #endif /* "PETSc/TS.pyx":651 * assert nterm == ndirs * * cdef PetscInt nevents = ndirs # <<<<<<<<<<<<<< * if eventhandler is not None: * if args is None: args = () */ __pyx_v_nevents = __pyx_v_ndirs; /* "PETSc/TS.pyx":652 * * cdef PetscInt nevents = ndirs * if eventhandler is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_eventhandler != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/TS.pyx":653 * cdef PetscInt nevents = ndirs * if eventhandler is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) */ __pyx_t_3 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":654 * if eventhandler is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_1); __pyx_t_1 = 0; } /* "PETSc/TS.pyx":655 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) # <<<<<<<<<<<<<< * if postevent is not None: * self.set_attr('__postevent__', (postevent, args, kargs)) */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_eventhandler); __Pyx_GIVEREF(__pyx_v_eventhandler); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_eventhandler); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_kargs); __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__eventhandler__"), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":656 * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: # <<<<<<<<<<<<<< * self.set_attr('__postevent__', (postevent, args, kargs)) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) */ __pyx_t_3 = (__pyx_v_postevent != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":657 * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: * self.set_attr('__postevent__', (postevent, args, kargs)) # <<<<<<<<<<<<<< * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) * else: */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_postevent); __Pyx_GIVEREF(__pyx_v_postevent); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_postevent); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__postevent__"), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":658 * if postevent is not None: * self.set_attr('__postevent__', (postevent, args, kargs)) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__postevent__', None) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventHandler(__pyx_v_self->ts, __pyx_v_nevents, __pyx_v_idirs, __pyx_v_iterm, __pyx_f_8petsc4py_5PETSc_TS_EventHandler, __pyx_f_8petsc4py_5PETSc_TS_PostEvent, ((void *)NULL))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 658, __pyx_L1_error) /* "PETSc/TS.pyx":656 * if kargs is None: kargs = {} * self.set_attr('__eventhandler__', (eventhandler, args, kargs)) * if postevent is not None: # <<<<<<<<<<<<<< * self.set_attr('__postevent__', (postevent, args, kargs)) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) */ goto __pyx_L6; } /* "PETSc/TS.pyx":660 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, TS_PostEvent, NULL) ) * else: * self.set_attr('__postevent__', None) # <<<<<<<<<<<<<< * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, NULL, NULL) ) * else: */ /*else*/ { __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__postevent__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":661 * else: * self.set_attr('__postevent__', None) * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, NULL, NULL) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventHandler(__pyx_v_self->ts, __pyx_v_nevents, __pyx_v_idirs, __pyx_v_iterm, __pyx_f_8petsc4py_5PETSc_TS_EventHandler, NULL, ((void *)NULL))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 661, __pyx_L1_error) } __pyx_L6:; /* "PETSc/TS.pyx":652 * * cdef PetscInt nevents = ndirs * if eventhandler is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/TS.pyx":663 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_EventHandler, NULL, NULL) ) * else: * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setEventTolerances(self, tol=None, vtol=None): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventHandler(__pyx_v_self->ts, __pyx_v_nevents, __pyx_v_idirs, __pyx_v_iterm, NULL, NULL, ((void *)NULL))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 663, __pyx_L1_error) } __pyx_L3:; /* "PETSc/TS.pyx":641 * # --- event handling --- * * def setEventHandler(self, direction, terminate, eventhandler, postevent=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscInt ndirs = 0 * cdef PetscInt *idirs = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventHandler", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_direction); __Pyx_XDECREF(__pyx_v_terminate); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":665 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) * * def setEventTolerances(self, tol=None, vtol=None): # <<<<<<<<<<<<<< * cdef PetscInt nevents = 0 * cdef PetscReal tolr = PETSC_DEFAULT */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_161setEventTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_160setEventTolerances[] = "TS.setEventTolerances(self, tol=None, vtol=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_161setEventTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tol = 0; PyObject *__pyx_v_vtol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setEventTolerances (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tol,&__pyx_n_s_vtol,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vtol); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setEventTolerances") < 0)) __PYX_ERR(42, 665, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_tol = values[0]; __pyx_v_vtol = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setEventTolerances", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 665, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_160setEventTolerances(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_tol, __pyx_v_vtol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_160setEventTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tol, PyObject *__pyx_v_vtol) { PetscInt __pyx_v_nevents; PetscReal __pyx_v_tolr; PetscInt __pyx_v_ntolr; PetscReal *__pyx_v_vtolr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setEventTolerances", 0); __Pyx_INCREF(__pyx_v_vtol); /* "PETSc/TS.pyx":666 * * def setEventTolerances(self, tol=None, vtol=None): * cdef PetscInt nevents = 0 # <<<<<<<<<<<<<< * cdef PetscReal tolr = PETSC_DEFAULT * cdef PetscInt ntolr = 0 */ __pyx_v_nevents = 0; /* "PETSc/TS.pyx":667 * def setEventTolerances(self, tol=None, vtol=None): * cdef PetscInt nevents = 0 * cdef PetscReal tolr = PETSC_DEFAULT # <<<<<<<<<<<<<< * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL */ __pyx_v_tolr = PETSC_DEFAULT; /* "PETSc/TS.pyx":668 * cdef PetscInt nevents = 0 * cdef PetscReal tolr = PETSC_DEFAULT * cdef PetscInt ntolr = 0 # <<<<<<<<<<<<<< * cdef PetscReal *vtolr = NULL * if tol is not None: */ __pyx_v_ntolr = 0; /* "PETSc/TS.pyx":669 * cdef PetscReal tolr = PETSC_DEFAULT * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL # <<<<<<<<<<<<<< * if tol is not None: * tolr = asReal(tol) */ __pyx_v_vtolr = NULL; /* "PETSc/TS.pyx":670 * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL * if tol is not None: # <<<<<<<<<<<<<< * tolr = asReal(tol) * if vtol is not None: */ __pyx_t_1 = (__pyx_v_tol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":671 * cdef PetscReal *vtolr = NULL * if tol is not None: * tolr = asReal(tol) # <<<<<<<<<<<<<< * if vtol is not None: * CHKERR( TSGetNumEvents(self.ts, &nevents) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_tol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 671, __pyx_L1_error) __pyx_v_tolr = __pyx_t_3; /* "PETSc/TS.pyx":670 * cdef PetscInt ntolr = 0 * cdef PetscReal *vtolr = NULL * if tol is not None: # <<<<<<<<<<<<<< * tolr = asReal(tol) * if vtol is not None: */ } /* "PETSc/TS.pyx":672 * if tol is not None: * tolr = asReal(tol) * if vtol is not None: # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) */ __pyx_t_2 = (__pyx_v_vtol != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":673 * tolr = asReal(tol) * if vtol is not None: * CHKERR( TSGetNumEvents(self.ts, &nevents) ) # <<<<<<<<<<<<<< * vtol = iarray_r(vtol, &ntolr, &vtolr) * assert ntolr == nevents */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetNumEvents(__pyx_v_self->ts, (&__pyx_v_nevents))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 673, __pyx_L1_error) /* "PETSc/TS.pyx":674 * if vtol is not None: * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) # <<<<<<<<<<<<<< * assert ntolr == nevents * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_r(__pyx_v_vtol, (&__pyx_v_ntolr), (&__pyx_v_vtolr))); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_vtol, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/TS.pyx":675 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) * assert ntolr == nevents # <<<<<<<<<<<<<< * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_ntolr == __pyx_v_nevents) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(42, 675, __pyx_L1_error) } } #endif /* "PETSc/TS.pyx":672 * if tol is not None: * tolr = asReal(tol) * if vtol is not None: # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * vtol = iarray_r(vtol, &ntolr, &vtolr) */ } /* "PETSc/TS.pyx":676 * vtol = iarray_r(vtol, &ntolr, &vtolr) * assert ntolr == nevents * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) # <<<<<<<<<<<<<< * * def getNumEvents(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEventTolerances(__pyx_v_self->ts, __pyx_v_tolr, __pyx_v_vtolr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 676, __pyx_L1_error) /* "PETSc/TS.pyx":665 * CHKERR( TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, NULL) ) * * def setEventTolerances(self, tol=None, vtol=None): # <<<<<<<<<<<<<< * cdef PetscInt nevents = 0 * cdef PetscReal tolr = PETSC_DEFAULT */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.setEventTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vtol); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":678 * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) * * def getNumEvents(self): # <<<<<<<<<<<<<< * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_163getNumEvents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_162getNumEvents[] = "TS.getNumEvents(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_163getNumEvents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumEvents (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNumEvents", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumEvents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_162getNumEvents(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_162getNumEvents(struct PyPetscTSObject *__pyx_v_self) { PetscInt __pyx_v_nevents; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumEvents", 0); /* "PETSc/TS.pyx":679 * * def getNumEvents(self): * cdef PetscInt nevents = 0 # <<<<<<<<<<<<<< * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * return toInt(nevents) */ __pyx_v_nevents = 0; /* "PETSc/TS.pyx":680 * def getNumEvents(self): * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) # <<<<<<<<<<<<<< * return toInt(nevents) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetNumEvents(__pyx_v_self->ts, (&__pyx_v_nevents))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 680, __pyx_L1_error) /* "PETSc/TS.pyx":681 * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) * return toInt(nevents) # <<<<<<<<<<<<<< * * # --- solving --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nevents); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":678 * CHKERR( TSSetEventTolerances(self.ts, tolr, vtolr) ) * * def getNumEvents(self): # <<<<<<<<<<<<<< * cdef PetscInt nevents = 0 * CHKERR( TSGetNumEvents(self.ts, &nevents) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getNumEvents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":685 * # --- solving --- * * def setPreStep(self, prestep, args=None, kargs=None): # <<<<<<<<<<<<<< * if prestep is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_165setPreStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_164setPreStep[] = "TS.setPreStep(self, prestep, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_165setPreStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prestep = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPreStep (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prestep,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prestep)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPreStep") < 0)) __PYX_ERR(42, 685, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_prestep = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPreStep", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 685, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_164setPreStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prestep, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_164setPreStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prestep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPreStep", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":686 * * def setPreStep(self, prestep, args=None, kargs=None): * if prestep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_prestep != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":687 * def setPreStep(self, prestep, args=None, kargs=None): * if prestep is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (prestep, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":688 * if prestep is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (prestep, args, kargs) * self.set_attr('__prestep__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TS.pyx":689 * if args is None: args = () * if kargs is None: kargs = {} * context = (prestep, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__prestep__', context) * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_prestep); __Pyx_GIVEREF(__pyx_v_prestep); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_prestep); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":690 * if kargs is None: kargs = {} * context = (prestep, args, kargs) * self.set_attr('__prestep__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__prestep__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":691 * context = (prestep, args, kargs) * self.set_attr('__prestep__', context) * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__prestep__', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPreStep(__pyx_v_self->ts, __pyx_f_8petsc4py_5PETSc_TS_PreStep)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 691, __pyx_L1_error) /* "PETSc/TS.pyx":686 * * def setPreStep(self, prestep, args=None, kargs=None): * if prestep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/TS.pyx":693 * CHKERR( TSSetPreStep(self.ts, TS_PreStep) ) * else: * self.set_attr('__prestep__', None) # <<<<<<<<<<<<<< * CHKERR( TSSetPreStep(self.ts, NULL) ) * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__prestep__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":694 * else: * self.set_attr('__prestep__', None) * CHKERR( TSSetPreStep(self.ts, NULL) ) # <<<<<<<<<<<<<< * * def getPreStep(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPreStep(__pyx_v_self->ts, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 694, __pyx_L1_error) } __pyx_L3:; /* "PETSc/TS.pyx":685 * # --- solving --- * * def setPreStep(self, prestep, args=None, kargs=None): # <<<<<<<<<<<<<< * if prestep is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":696 * CHKERR( TSSetPreStep(self.ts, NULL) ) * * def getPreStep(self): # <<<<<<<<<<<<<< * return self.get_attr('__prestep__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_167getPreStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_166getPreStep[] = "TS.getPreStep(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_167getPreStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPreStep (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPreStep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPreStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_166getPreStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_166getPreStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPreStep", 0); /* "PETSc/TS.pyx":697 * * def getPreStep(self): * return self.get_attr('__prestep__') # <<<<<<<<<<<<<< * * def setPostStep(self, poststep, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__prestep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":696 * CHKERR( TSSetPreStep(self.ts, NULL) ) * * def getPreStep(self): # <<<<<<<<<<<<<< * return self.get_attr('__prestep__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getPreStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":699 * return self.get_attr('__prestep__') * * def setPostStep(self, poststep, args=None, kargs=None): # <<<<<<<<<<<<<< * if poststep is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_169setPostStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_168setPostStep[] = "TS.setPostStep(self, poststep, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_169setPostStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_poststep = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPostStep (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_poststep,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_poststep)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPostStep") < 0)) __PYX_ERR(42, 699, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_poststep = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPostStep", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 699, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_168setPostStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_poststep, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_168setPostStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_poststep, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPostStep", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":700 * * def setPostStep(self, poststep, args=None, kargs=None): * if poststep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_poststep != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":701 * def setPostStep(self, poststep, args=None, kargs=None): * if poststep is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (poststep, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":702 * if poststep is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (poststep, args, kargs) * self.set_attr('__poststep__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TS.pyx":703 * if args is None: args = () * if kargs is None: kargs = {} * context = (poststep, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__poststep__', context) * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_poststep); __Pyx_GIVEREF(__pyx_v_poststep); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_poststep); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":704 * if kargs is None: kargs = {} * context = (poststep, args, kargs) * self.set_attr('__poststep__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__poststep__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":705 * context = (poststep, args, kargs) * self.set_attr('__poststep__', context) * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) # <<<<<<<<<<<<<< * else: * self.set_attr('__poststep__', None) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPostStep(__pyx_v_self->ts, __pyx_f_8petsc4py_5PETSc_TS_PostStep)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 705, __pyx_L1_error) /* "PETSc/TS.pyx":700 * * def setPostStep(self, poststep, args=None, kargs=None): * if poststep is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/TS.pyx":707 * CHKERR( TSSetPostStep(self.ts, TS_PostStep) ) * else: * self.set_attr('__poststep__', None) # <<<<<<<<<<<<<< * CHKERR( TSSetPostStep(self.ts, NULL) ) * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__poststep__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":708 * else: * self.set_attr('__poststep__', None) * CHKERR( TSSetPostStep(self.ts, NULL) ) # <<<<<<<<<<<<<< * * def getPostStep(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetPostStep(__pyx_v_self->ts, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 708, __pyx_L1_error) } __pyx_L3:; /* "PETSc/TS.pyx":699 * return self.get_attr('__prestep__') * * def setPostStep(self, poststep, args=None, kargs=None): # <<<<<<<<<<<<<< * if poststep is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.setPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":710 * CHKERR( TSSetPostStep(self.ts, NULL) ) * * def getPostStep(self): # <<<<<<<<<<<<<< * return self.get_attr('__poststep__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_171getPostStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_170getPostStep[] = "TS.getPostStep(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_171getPostStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPostStep (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPostStep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPostStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_170getPostStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_170getPostStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPostStep", 0); /* "PETSc/TS.pyx":711 * * def getPostStep(self): * return self.get_attr('__poststep__') # <<<<<<<<<<<<<< * * def setUp(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__poststep__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":710 * CHKERR( TSSetPostStep(self.ts, NULL) ) * * def getPostStep(self): # <<<<<<<<<<<<<< * return self.get_attr('__poststep__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getPostStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":713 * return self.get_attr('__poststep__') * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( TSSetUp(self.ts) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_173setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_172setUp[] = "TS.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_173setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_172setUp(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_172setUp(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/TS.pyx":714 * * def setUp(self): * CHKERR( TSSetUp(self.ts) ) # <<<<<<<<<<<<<< * * def reset(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetUp(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 714, __pyx_L1_error) /* "PETSc/TS.pyx":713 * return self.get_attr('__poststep__') * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( TSSetUp(self.ts) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":716 * CHKERR( TSSetUp(self.ts) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( TSReset(self.ts) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_175reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_174reset[] = "TS.reset(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_175reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_174reset(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_174reset(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); /* "PETSc/TS.pyx":717 * * def reset(self): * CHKERR( TSReset(self.ts) ) # <<<<<<<<<<<<<< * * def step(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSReset(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 717, __pyx_L1_error) /* "PETSc/TS.pyx":716 * CHKERR( TSSetUp(self.ts) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( TSReset(self.ts) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":719 * CHKERR( TSReset(self.ts) ) * * def step(self): # <<<<<<<<<<<<<< * CHKERR( TSStep(self.ts) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_177step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_176step[] = "TS.step(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_177step(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("step (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("step", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "step", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_176step(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_176step(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("step", 0); /* "PETSc/TS.pyx":720 * * def step(self): * CHKERR( TSStep(self.ts) ) # <<<<<<<<<<<<<< * * def restartStep(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSStep(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 720, __pyx_L1_error) /* "PETSc/TS.pyx":719 * CHKERR( TSReset(self.ts) ) * * def step(self): # <<<<<<<<<<<<<< * CHKERR( TSStep(self.ts) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.step", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":722 * CHKERR( TSStep(self.ts) ) * * def restartStep(self): # <<<<<<<<<<<<<< * CHKERR( TSRestartStep(self.ts) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_179restartStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_178restartStep[] = "TS.restartStep(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_179restartStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restartStep (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("restartStep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "restartStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_178restartStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_178restartStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restartStep", 0); /* "PETSc/TS.pyx":723 * * def restartStep(self): * CHKERR( TSRestartStep(self.ts) ) # <<<<<<<<<<<<<< * * def rollBack(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRestartStep(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 723, __pyx_L1_error) /* "PETSc/TS.pyx":722 * CHKERR( TSStep(self.ts) ) * * def restartStep(self): # <<<<<<<<<<<<<< * CHKERR( TSRestartStep(self.ts) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.restartStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":725 * CHKERR( TSRestartStep(self.ts) ) * * def rollBack(self): # <<<<<<<<<<<<<< * CHKERR( TSRollBack(self.ts) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_181rollBack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_180rollBack[] = "TS.rollBack(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_181rollBack(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rollBack (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("rollBack", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rollBack", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_180rollBack(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_180rollBack(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rollBack", 0); /* "PETSc/TS.pyx":726 * * def rollBack(self): * CHKERR( TSRollBack(self.ts) ) # <<<<<<<<<<<<<< * * def solve(self, Vec u): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRollBack(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 726, __pyx_L1_error) /* "PETSc/TS.pyx":725 * CHKERR( TSRestartStep(self.ts) ) * * def rollBack(self): # <<<<<<<<<<<<<< * CHKERR( TSRollBack(self.ts) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.rollBack", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":728 * CHKERR( TSRollBack(self.ts) ) * * def solve(self, Vec u): # <<<<<<<<<<<<<< * CHKERR( TSSolve(self.ts, u.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_183solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_182solve[] = "TS.solve(self, Vec u)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_183solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_u = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(42, 728, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_u = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 728, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(42, 728, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_182solve(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_182solve(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 0); /* "PETSc/TS.pyx":729 * * def solve(self, Vec u): * CHKERR( TSSolve(self.ts, u.vec) ) # <<<<<<<<<<<<<< * * def interpolate(self, t, Vec u): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSolve(__pyx_v_self->ts, __pyx_v_u->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 729, __pyx_L1_error) /* "PETSc/TS.pyx":728 * CHKERR( TSRollBack(self.ts) ) * * def solve(self, Vec u): # <<<<<<<<<<<<<< * CHKERR( TSSolve(self.ts, u.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":731 * CHKERR( TSSolve(self.ts, u.vec) ) * * def interpolate(self, t, Vec u): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_185interpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_184interpolate[] = "TS.interpolate(self, t, Vec u)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_185interpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_u = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("interpolate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_u,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_u)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("interpolate", 1, 2, 2, 1); __PYX_ERR(42, 731, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "interpolate") < 0)) __PYX_ERR(42, 731, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_t = values[0]; __pyx_v_u = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("interpolate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 731, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(42, 731, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_184interpolate(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_u); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_184interpolate(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_u) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interpolate", 0); /* "PETSc/TS.pyx":732 * * def interpolate(self, t, Vec u): * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 732, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":733 * def interpolate(self, t, Vec u): * cdef PetscReal rval = asReal(t) * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) # <<<<<<<<<<<<<< * * # --- Adjoint methods --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSInterpolate(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_u->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 733, __pyx_L1_error) /* "PETSc/TS.pyx":731 * CHKERR( TSSolve(self.ts, u.vec) ) * * def interpolate(self, t, Vec u): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSInterpolate(self.ts, rval, u.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":737 * # --- Adjoint methods --- * * def setSaveTrajectory(self): # <<<<<<<<<<<<<< * CHKERR(TSSetSaveTrajectory(self.ts)) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_187setSaveTrajectory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_186setSaveTrajectory[] = "TS.setSaveTrajectory(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_187setSaveTrajectory(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSaveTrajectory (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setSaveTrajectory", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setSaveTrajectory", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_186setSaveTrajectory(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_186setSaveTrajectory(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSaveTrajectory", 0); /* "PETSc/TS.pyx":738 * * def setSaveTrajectory(self): * CHKERR(TSSetSaveTrajectory(self.ts)) # <<<<<<<<<<<<<< * * def getCostIntegral(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetSaveTrajectory(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 738, __pyx_L1_error) /* "PETSc/TS.pyx":737 * # --- Adjoint methods --- * * def setSaveTrajectory(self): # <<<<<<<<<<<<<< * CHKERR(TSSetSaveTrajectory(self.ts)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setSaveTrajectory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":740 * CHKERR(TSSetSaveTrajectory(self.ts)) * * def getCostIntegral(self): # <<<<<<<<<<<<<< * cdef Vec cost = Vec() * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_189getCostIntegral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_188getCostIntegral[] = "TS.getCostIntegral(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_189getCostIntegral(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCostIntegral (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCostIntegral", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCostIntegral", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_188getCostIntegral(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_188getCostIntegral(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_cost = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCostIntegral", 0); /* "PETSc/TS.pyx":741 * * def getCostIntegral(self): * cdef Vec cost = Vec() # <<<<<<<<<<<<<< * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) * PetscINCREF(cost.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_cost = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":742 * def getCostIntegral(self): * cdef Vec cost = Vec() * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(cost.obj) * return cost */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetCostIntegral(__pyx_v_self->ts, (&__pyx_v_cost->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 742, __pyx_L1_error) /* "PETSc/TS.pyx":743 * cdef Vec cost = Vec() * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) * PetscINCREF(cost.obj) # <<<<<<<<<<<<<< * return cost * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cost->__pyx_base.obj)); /* "PETSc/TS.pyx":744 * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) * PetscINCREF(cost.obj) * return cost # <<<<<<<<<<<<<< * * def setCostGradients(self, vl, vm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_cost)); __pyx_r = ((PyObject *)__pyx_v_cost); goto __pyx_L0; /* "PETSc/TS.pyx":740 * CHKERR(TSSetSaveTrajectory(self.ts)) * * def getCostIntegral(self): # <<<<<<<<<<<<<< * cdef Vec cost = Vec() * CHKERR( TSGetCostIntegral(self.ts, &cost.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.getCostIntegral", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cost); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":746 * return cost * * def setCostGradients(self, vl, vm=None): # <<<<<<<<<<<<<< * cdef PetscInt n = 0; * cdef PetscVec *vecl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_191setCostGradients(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_190setCostGradients[] = "TS.setCostGradients(self, vl, vm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_191setCostGradients(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vl = 0; PyObject *__pyx_v_vm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCostGradients (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,&__pyx_n_s_vm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCostGradients") < 0)) __PYX_ERR(42, 746, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vl = values[0]; __pyx_v_vm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCostGradients", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 746, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setCostGradients", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_190setCostGradients(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_vm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_190setCostGradients(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_vl, PyObject *__pyx_v_vm) { PetscInt __pyx_v_n; Vec *__pyx_v_vecl; Vec *__pyx_v_vecm; PyObject *__pyx_v_mem1 = 0; PyObject *__pyx_v_mem2 = 0; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *__pyx_t_5 = NULL; PetscInt __pyx_t_6; Vec __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCostGradients", 0); __Pyx_INCREF(__pyx_v_vl); __Pyx_INCREF(__pyx_v_vm); /* "PETSc/TS.pyx":747 * * def setCostGradients(self, vl, vm=None): * cdef PetscInt n = 0; # <<<<<<<<<<<<<< * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL */ __pyx_v_n = 0; /* "PETSc/TS.pyx":748 * def setCostGradients(self, vl, vm=None): * cdef PetscInt n = 0; * cdef PetscVec *vecl = NULL # <<<<<<<<<<<<<< * cdef PetscVec *vecm = NULL * cdef mem1 = None, mem2 = None */ __pyx_v_vecl = NULL; /* "PETSc/TS.pyx":749 * cdef PetscInt n = 0; * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL # <<<<<<<<<<<<<< * cdef mem1 = None, mem2 = None * if isinstance(vl, Vec): vl = [vl] */ __pyx_v_vecm = NULL; /* "PETSc/TS.pyx":750 * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL * cdef mem1 = None, mem2 = None # <<<<<<<<<<<<<< * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] */ __Pyx_INCREF(Py_None); __pyx_v_mem1 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_mem2 = Py_None; /* "PETSc/TS.pyx":751 * cdef PetscVec *vecm = NULL * cdef mem1 = None, mem2 = None * if isinstance(vl, Vec): vl = [vl] # <<<<<<<<<<<<<< * if isinstance(vm, Vec): vm = [vm] * if vl is not None: */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_vl, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_vl); __Pyx_GIVEREF(__pyx_v_vl); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_vl); __Pyx_DECREF_SET(__pyx_v_vl, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TS.pyx":752 * cdef mem1 = None, mem2 = None * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] # <<<<<<<<<<<<<< * if vl is not None: * n = len(vl) */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_vm, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_vm); __Pyx_GIVEREF(__pyx_v_vm); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_vm); __Pyx_DECREF_SET(__pyx_v_vm, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TS.pyx":753 * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] * if vl is not None: # <<<<<<<<<<<<<< * n = len(vl) * elif vm is not None: */ __pyx_t_1 = (__pyx_v_vl != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":754 * if isinstance(vm, Vec): vm = [vm] * if vl is not None: * n = len(vl) # <<<<<<<<<<<<<< * elif vm is not None: * n = len(vm) */ __pyx_t_4 = PyObject_Length(__pyx_v_vl); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(42, 754, __pyx_L1_error) __pyx_v_n = ((PetscInt)__pyx_t_4); /* "PETSc/TS.pyx":753 * if isinstance(vl, Vec): vl = [vl] * if isinstance(vm, Vec): vm = [vm] * if vl is not None: # <<<<<<<<<<<<<< * n = len(vl) * elif vm is not None: */ goto __pyx_L5; } /* "PETSc/TS.pyx":755 * if vl is not None: * n = len(vl) * elif vm is not None: # <<<<<<<<<<<<<< * n = len(vm) * if vl is not None: */ __pyx_t_2 = (__pyx_v_vm != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":756 * n = len(vl) * elif vm is not None: * n = len(vm) # <<<<<<<<<<<<<< * if vl is not None: * assert len(vl) == n */ __pyx_t_4 = PyObject_Length(__pyx_v_vm); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(42, 756, __pyx_L1_error) __pyx_v_n = ((PetscInt)__pyx_t_4); /* "PETSc/TS.pyx":755 * if vl is not None: * n = len(vl) * elif vm is not None: # <<<<<<<<<<<<<< * n = len(vm) * if vl is not None: */ } __pyx_L5:; /* "PETSc/TS.pyx":757 * elif vm is not None: * n = len(vm) * if vl is not None: # <<<<<<<<<<<<<< * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) */ __pyx_t_1 = (__pyx_v_vl != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":758 * n = len(vm) * if vl is not None: * assert len(vl) == n # <<<<<<<<<<<<<< * mem1 = oarray_p(empty_p(n), NULL, &vecl) * for i from 0 <= i < n: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = PyObject_Length(__pyx_v_vl); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(42, 758, __pyx_L1_error) if (unlikely(!((__pyx_t_4 == ((Py_ssize_t)__pyx_v_n)) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(42, 758, __pyx_L1_error) } } #endif /* "PETSc/TS.pyx":759 * if vl is not None: * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_vecl)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_mem1, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/TS.pyx":760 * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * vecl[i] = (vl[i]).vec * if vm is not None: */ __pyx_t_6 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "PETSc/TS.pyx":761 * mem1 = oarray_p(empty_p(n), NULL, &vecl) * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec # <<<<<<<<<<<<<< * if vm is not None: * assert len(vm) == n */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vl, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(42, 761, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscVecObject *)__pyx_t_5)->vec; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; (__pyx_v_vecl[__pyx_v_i]) = __pyx_t_7; } /* "PETSc/TS.pyx":757 * elif vm is not None: * n = len(vm) * if vl is not None: # <<<<<<<<<<<<<< * assert len(vl) == n * mem1 = oarray_p(empty_p(n), NULL, &vecl) */ } /* "PETSc/TS.pyx":762 * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec * if vm is not None: # <<<<<<<<<<<<<< * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) */ __pyx_t_2 = (__pyx_v_vm != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":763 * vecl[i] = (vl[i]).vec * if vm is not None: * assert len(vm) == n # <<<<<<<<<<<<<< * mem2 = oarray_p(empty_p(n), NULL, &vecm) * for i from 0 <= i < n: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = PyObject_Length(__pyx_v_vm); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(42, 763, __pyx_L1_error) if (unlikely(!((__pyx_t_4 == ((Py_ssize_t)__pyx_v_n)) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(42, 763, __pyx_L1_error) } } #endif /* "PETSc/TS.pyx":764 * if vm is not None: * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * vecm[i] = (vm[i]).vec */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_5, NULL, ((void **)(&__pyx_v_vecm)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_mem2, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":765 * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * vecm[i] = (vm[i]).vec * self.set_attr('__costgradients_memory', (mem1, mem2)) */ __pyx_t_6 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "PETSc/TS.pyx":766 * mem2 = oarray_p(empty_p(n), NULL, &vecm) * for i from 0 <= i < n: * vecm[i] = (vm[i]).vec # <<<<<<<<<<<<<< * self.set_attr('__costgradients_memory', (mem1, mem2)) * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vm, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(42, 766, __pyx_L1_error) __pyx_t_7 = ((struct PyPetscVecObject *)__pyx_t_3)->vec; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_vecm[__pyx_v_i]) = __pyx_t_7; } /* "PETSc/TS.pyx":762 * for i from 0 <= i < n: * vecl[i] = (vl[i]).vec * if vm is not None: # <<<<<<<<<<<<<< * assert len(vm) == n * mem2 = oarray_p(empty_p(n), NULL, &vecm) */ } /* "PETSc/TS.pyx":767 * for i from 0 <= i < n: * vecm[i] = (vm[i]).vec * self.set_attr('__costgradients_memory', (mem1, mem2)) # <<<<<<<<<<<<<< * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_mem1); __Pyx_GIVEREF(__pyx_v_mem1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mem1); __Pyx_INCREF(__pyx_v_mem2); __Pyx_GIVEREF(__pyx_v_mem2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_mem2); __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__costgradients_memory"), __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/TS.pyx":768 * vecm[i] = (vm[i]).vec * self.set_attr('__costgradients_memory', (mem1, mem2)) * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) # <<<<<<<<<<<<<< * * def getCostGradients(self): */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetCostGradients(__pyx_v_self->ts, __pyx_v_n, __pyx_v_vecl, __pyx_v_vecm)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(42, 768, __pyx_L1_error) /* "PETSc/TS.pyx":746 * return cost * * def setCostGradients(self, vl, vm=None): # <<<<<<<<<<<<<< * cdef PetscInt n = 0; * cdef PetscVec *vecl = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.setCostGradients", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mem1); __Pyx_XDECREF(__pyx_v_mem2); __Pyx_XDECREF(__pyx_v_vl); __Pyx_XDECREF(__pyx_v_vm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":770 * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) * * def getCostGradients(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, n = 0 * cdef PetscVec *vecl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_193getCostGradients(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_192getCostGradients[] = "TS.getCostGradients(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_193getCostGradients(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCostGradients (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCostGradients", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCostGradients", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_192getCostGradients(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_192getCostGradients(struct PyPetscTSObject *__pyx_v_self) { CYTHON_UNUSED PetscInt __pyx_v_i; PetscInt __pyx_v_n; Vec *__pyx_v_vecl; Vec *__pyx_v_vecm; PyObject *__pyx_v_vl = 0; PyObject *__pyx_v_vm = 0; PetscInt __pyx_9genexpr10__pyx_v_i; PetscInt __pyx_9genexpr11__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCostGradients", 0); /* "PETSc/TS.pyx":771 * * def getCostGradients(self): * cdef PetscInt i = 0, n = 0 # <<<<<<<<<<<<<< * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL */ __pyx_v_i = 0; __pyx_v_n = 0; /* "PETSc/TS.pyx":772 * def getCostGradients(self): * cdef PetscInt i = 0, n = 0 * cdef PetscVec *vecl = NULL # <<<<<<<<<<<<<< * cdef PetscVec *vecm = NULL * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) */ __pyx_v_vecl = NULL; /* "PETSc/TS.pyx":773 * cdef PetscInt i = 0, n = 0 * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL # <<<<<<<<<<<<<< * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None */ __pyx_v_vecm = NULL; /* "PETSc/TS.pyx":774 * cdef PetscVec *vecl = NULL * cdef PetscVec *vecm = NULL * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) # <<<<<<<<<<<<<< * cdef object vl = None, vm = None * if vecl != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetCostGradients(__pyx_v_self->ts, (&__pyx_v_n), (&__pyx_v_vecl), (&__pyx_v_vecm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 774, __pyx_L1_error) /* "PETSc/TS.pyx":775 * cdef PetscVec *vecm = NULL * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None # <<<<<<<<<<<<<< * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] */ __Pyx_INCREF(Py_None); __pyx_v_vl = Py_None; __Pyx_INCREF(Py_None); __pyx_v_vm = Py_None; /* "PETSc/TS.pyx":776 * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None * if vecl != NULL: # <<<<<<<<<<<<<< * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: */ __pyx_t_2 = ((__pyx_v_vecl != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":777 * cdef object vl = None, vm = None * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * if vecm != NULL: * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_n; for (__pyx_9genexpr10__pyx_v_i = 0; __pyx_9genexpr10__pyx_v_i < __pyx_t_4; __pyx_9genexpr10__pyx_v_i++) { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vecl[__pyx_9genexpr10__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(42, 777, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_vl, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":776 * CHKERR( TSGetCostGradients(self.ts, &n, &vecl, &vecm) ) * cdef object vl = None, vm = None * if vecl != NULL: # <<<<<<<<<<<<<< * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: */ } /* "PETSc/TS.pyx":778 * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: # <<<<<<<<<<<<<< * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] * return (vl, vm) */ __pyx_t_2 = ((__pyx_v_vecm != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TS.pyx":779 * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * return (vl, vm) * */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_n; for (__pyx_9genexpr11__pyx_v_i = 0; __pyx_9genexpr11__pyx_v_i < __pyx_t_4; __pyx_9genexpr11__pyx_v_i++) { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vecm[__pyx_9genexpr11__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(42, 779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_vm, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":778 * if vecl != NULL: * vl = [ref_Vec(vecl[i]) for i from 0 <= i < n] * if vecm != NULL: # <<<<<<<<<<<<<< * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] * return (vl, vm) */ } /* "PETSc/TS.pyx":780 * if vecm != NULL: * vm = [ref_Vec(vecm[i]) for i from 0 <= i < n] * return (vl, vm) # <<<<<<<<<<<<<< * * def setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_vl); __Pyx_GIVEREF(__pyx_v_vl); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vl); __Pyx_INCREF(__pyx_v_vm); __Pyx_GIVEREF(__pyx_v_vm); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vm); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":770 * CHKERR( TSSetCostGradients(self.ts, n, vecl, vecm) ) * * def getCostGradients(self): # <<<<<<<<<<<<<< * cdef PetscInt i = 0, n = 0 * cdef PetscVec *vecl = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.getCostGradients", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vl); __Pyx_XDECREF(__pyx_v_vm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":782 * return (vl, vm) * * def setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_195setRHSJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_194setRHSJacobianP[] = "TS.setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_195setRHSJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobianp = 0; struct PyPetscMatObject *__pyx_v_A = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSJacobianP (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobianp,&__pyx_n_s_A,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobianp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRHSJacobianP") < 0)) __PYX_ERR(42, 782, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobianp = values[0]; __pyx_v_A = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSJacobianP", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 782, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(42, 782, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_194setRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobianp, __pyx_v_A, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_194setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_jacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Amat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSJacobianP", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":783 * * def setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None): * cdef PetscMat Amat=NULL # <<<<<<<<<<<<<< * if A is not None: Amat = A.mat * if jacobianp is not None: */ __pyx_v_Amat = NULL; /* "PETSc/TS.pyx":784 * def setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None): * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat # <<<<<<<<<<<<<< * if jacobianp is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_A->mat; __pyx_v_Amat = __pyx_t_3; } /* "PETSc/TS.pyx":785 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if jacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_jacobianp != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":786 * if A is not None: Amat = A.mat * if jacobianp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobianp, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":787 * if jacobianp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":788 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobianp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobianp); __Pyx_GIVEREF(__pyx_v_jacobianp); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobianp); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":789 * if kargs is None: kargs = {} * context = (jacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobianp__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":790 * context = (jacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 790, __pyx_L1_error) /* "PETSc/TS.pyx":785 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if jacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "PETSc/TS.pyx":792 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def createQuadratureTS(self, forward=True): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 792, __pyx_L1_error) } __pyx_L4:; /* "PETSc/TS.pyx":782 * return (vl, vm) * * def setRHSJacobianP(self, jacobianp, Mat A=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":794 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def createQuadratureTS(self, forward=True): # <<<<<<<<<<<<<< * cdef TS qts = TS() * cdef PetscBool fwd = forward */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_197createQuadratureTS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_196createQuadratureTS[] = "TS.createQuadratureTS(self, forward=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_197createQuadratureTS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_forward = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createQuadratureTS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_forward,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_forward); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createQuadratureTS") < 0)) __PYX_ERR(42, 794, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_forward = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createQuadratureTS", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 794, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.createQuadratureTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_196createQuadratureTS(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_forward); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_196createQuadratureTS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_forward) { struct PyPetscTSObject *__pyx_v_qts = 0; PetscBool __pyx_v_fwd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createQuadratureTS", 0); /* "PETSc/TS.pyx":795 * * def createQuadratureTS(self, forward=True): * cdef TS qts = TS() # <<<<<<<<<<<<<< * cdef PetscBool fwd = forward * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_qts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":796 * def createQuadratureTS(self, forward=True): * cdef TS qts = TS() * cdef PetscBool fwd = forward # <<<<<<<<<<<<<< * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) * PetscINCREF(qts.obj) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_forward)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 796, __pyx_L1_error) __pyx_v_fwd = __pyx_t_2; /* "PETSc/TS.pyx":797 * cdef TS qts = TS() * cdef PetscBool fwd = forward * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) # <<<<<<<<<<<<<< * PetscINCREF(qts.obj) * return qts */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSCreateQuadratureTS(__pyx_v_self->ts, __pyx_v_fwd, (&__pyx_v_qts->ts))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(42, 797, __pyx_L1_error) /* "PETSc/TS.pyx":798 * cdef PetscBool fwd = forward * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) * PetscINCREF(qts.obj) # <<<<<<<<<<<<<< * return qts * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_qts->__pyx_base.obj)); /* "PETSc/TS.pyx":799 * CHKERR( TSCreateQuadratureTS(self.ts, fwd, &qts.ts) ) * PetscINCREF(qts.obj) * return qts # <<<<<<<<<<<<<< * * def getQuadratureTS(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_qts)); __pyx_r = ((PyObject *)__pyx_v_qts); goto __pyx_L0; /* "PETSc/TS.pyx":794 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def createQuadratureTS(self, forward=True): # <<<<<<<<<<<<<< * cdef TS qts = TS() * cdef PetscBool fwd = forward */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.createQuadratureTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_qts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":801 * return qts * * def getQuadratureTS(self): # <<<<<<<<<<<<<< * cdef TS qts = TS() * cdef PetscBool fwd = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_199getQuadratureTS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_198getQuadratureTS[] = "TS.getQuadratureTS(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_199getQuadratureTS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getQuadratureTS (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getQuadratureTS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getQuadratureTS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_198getQuadratureTS(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_198getQuadratureTS(struct PyPetscTSObject *__pyx_v_self) { struct PyPetscTSObject *__pyx_v_qts = 0; PetscBool __pyx_v_fwd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getQuadratureTS", 0); /* "PETSc/TS.pyx":802 * * def getQuadratureTS(self): * cdef TS qts = TS() # <<<<<<<<<<<<<< * cdef PetscBool fwd = PETSC_FALSE * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_qts = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":803 * def getQuadratureTS(self): * cdef TS qts = TS() * cdef PetscBool fwd = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) * PetscINCREF(qts.obj) */ __pyx_v_fwd = PETSC_FALSE; /* "PETSc/TS.pyx":804 * cdef TS qts = TS() * cdef PetscBool fwd = PETSC_FALSE * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) # <<<<<<<<<<<<<< * PetscINCREF(qts.obj) * return (toBool(fwd), qts) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetQuadratureTS(__pyx_v_self->ts, (&__pyx_v_fwd), (&__pyx_v_qts->ts))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 804, __pyx_L1_error) /* "PETSc/TS.pyx":805 * cdef PetscBool fwd = PETSC_FALSE * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) * PetscINCREF(qts.obj) # <<<<<<<<<<<<<< * return (toBool(fwd), qts) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_qts->__pyx_base.obj)); /* "PETSc/TS.pyx":806 * CHKERR( TSGetQuadratureTS(self.ts, &fwd, &qts.ts) ) * PetscINCREF(qts.obj) * return (toBool(fwd), qts) # <<<<<<<<<<<<<< * * def setRHSJacobianP(self, rhsjacobianp, Mat A=None, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_fwd); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_qts)); __Pyx_GIVEREF(((PyObject *)__pyx_v_qts)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_qts)); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":801 * return qts * * def getQuadratureTS(self): # <<<<<<<<<<<<<< * cdef TS qts = TS() * cdef PetscBool fwd = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.getQuadratureTS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_qts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":808 * return (toBool(fwd), qts) * * def setRHSJacobianP(self, rhsjacobianp, Mat A=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_201setRHSJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_200setRHSJacobianP[] = "TS.setRHSJacobianP(self, rhsjacobianp, Mat A=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_201setRHSJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_rhsjacobianp = 0; struct PyPetscMatObject *__pyx_v_A = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRHSJacobianP (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rhsjacobianp,&__pyx_n_s_A,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rhsjacobianp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRHSJacobianP") < 0)) __PYX_ERR(42, 808, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_rhsjacobianp = values[0]; __pyx_v_A = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRHSJacobianP", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 808, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(42, 808, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_200setRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_rhsjacobianp, __pyx_v_A, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_200setRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rhsjacobianp, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Amat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRHSJacobianP", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TS.pyx":809 * * def setRHSJacobianP(self, rhsjacobianp, Mat A=None, args=None, kargs=None): * cdef PetscMat Amat=NULL # <<<<<<<<<<<<<< * if A is not None: Amat = A.mat * if rhsjacobianp is not None: */ __pyx_v_Amat = NULL; /* "PETSc/TS.pyx":810 * def setRHSJacobianP(self, rhsjacobianp, Mat A=None, args=None, kargs=None): * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat # <<<<<<<<<<<<<< * if rhsjacobianp is not None: * if args is None: args = () */ __pyx_t_1 = (((PyObject *)__pyx_v_A) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_A->mat; __pyx_v_Amat = __pyx_t_3; } /* "PETSc/TS.pyx":811 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if rhsjacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (__pyx_v_rhsjacobianp != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TS.pyx":812 * if A is not None: Amat = A.mat * if rhsjacobianp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (rhsjacobianp, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TS.pyx":813 * if rhsjacobianp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (rhsjacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TS.pyx":814 * if args is None: args = () * if kargs is None: kargs = {} * context = (rhsjacobianp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_rhsjacobianp); __Pyx_GIVEREF(__pyx_v_rhsjacobianp); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_rhsjacobianp); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":815 * if kargs is None: kargs = {} * context = (rhsjacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) # <<<<<<<<<<<<<< * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TS *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__rhsjacobianp__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TS.pyx":816 * context = (rhsjacobianp, args, kargs) * self.set_attr('__rhsjacobianp__', context) * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, __pyx_f_8petsc4py_5PETSc_TS_RHSJacobianP, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 816, __pyx_L1_error) /* "PETSc/TS.pyx":811 * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat * if rhsjacobianp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L4; } /* "PETSc/TS.pyx":818 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, context) ) * else: * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) # <<<<<<<<<<<<<< * * def computeRHSJacobianP(self, t, Vec x, Mat J): */ /*else*/ { __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetRHSJacobianP(__pyx_v_self->ts, __pyx_v_Amat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(42, 818, __pyx_L1_error) } __pyx_L4:; /* "PETSc/TS.pyx":808 * return (toBool(fwd), qts) * * def setRHSJacobianP(self, rhsjacobianp, Mat A=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Amat=NULL * if A is not None: Amat = A.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":820 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def computeRHSJacobianP(self, t, Vec x, Mat J): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_203computeRHSJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_202computeRHSJacobianP[] = "TS.computeRHSJacobianP(self, t, Vec x, Mat J)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_203computeRHSJacobianP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_t = 0; struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeRHSJacobianP (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_J,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianP", 1, 3, 3, 1); __PYX_ERR(42, 820, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianP", 1, 3, 3, 2); __PYX_ERR(42, 820, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeRHSJacobianP") < 0)) __PYX_ERR(42, 820, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_t = values[0]; __pyx_v_x = ((struct PyPetscVecObject *)values[1]); __pyx_v_J = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeRHSJacobianP", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 820, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(42, 820, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(42, 820, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_202computeRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_J); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_202computeRHSJacobianP(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeRHSJacobianP", 0); /* "PETSc/TS.pyx":821 * * def computeRHSJacobianP(self, t, Vec x, Mat J): * cdef PetscReal rval = asReal(t) # <<<<<<<<<<<<<< * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 821, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":822 * def computeRHSJacobianP(self, t, Vec x, Mat J): * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) # <<<<<<<<<<<<<< * * def adjointSetSteps(self, adjoint_steps): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSComputeRHSJacobianP(__pyx_v_self->ts, __pyx_v_rval, __pyx_v_x->vec, __pyx_v_J->mat)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 822, __pyx_L1_error) /* "PETSc/TS.pyx":820 * CHKERR( TSSetRHSJacobianP(self.ts, Amat, NULL, NULL) ) * * def computeRHSJacobianP(self, t, Vec x, Mat J): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(t) * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.computeRHSJacobianP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":824 * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) * * def adjointSetSteps(self, adjoint_steps): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(adjoint_steps) * CHKERR( TSAdjointSetSteps(self.ts, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_205adjointSetSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_204adjointSetSteps[] = "TS.adjointSetSteps(self, adjoint_steps)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_205adjointSetSteps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_adjoint_steps = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointSetSteps (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_adjoint_steps,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adjoint_steps)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adjointSetSteps") < 0)) __PYX_ERR(42, 824, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_adjoint_steps = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("adjointSetSteps", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 824, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSetSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_204adjointSetSteps(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_adjoint_steps); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_204adjointSetSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_adjoint_steps) { PetscInt __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointSetSteps", 0); /* "PETSc/TS.pyx":825 * * def adjointSetSteps(self, adjoint_steps): * cdef PetscInt ival = asInt(adjoint_steps) # <<<<<<<<<<<<<< * CHKERR( TSAdjointSetSteps(self.ts, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_adjoint_steps); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(42, 825, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/TS.pyx":826 * def adjointSetSteps(self, adjoint_steps): * cdef PetscInt ival = asInt(adjoint_steps) * CHKERR( TSAdjointSetSteps(self.ts, ival) ) # <<<<<<<<<<<<<< * * def adjointSetUp(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointSetSteps(__pyx_v_self->ts, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 826, __pyx_L1_error) /* "PETSc/TS.pyx":824 * CHKERR( TSComputeRHSJacobianP(self.ts, rval, x.vec, J.mat) ) * * def adjointSetSteps(self, adjoint_steps): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(adjoint_steps) * CHKERR( TSAdjointSetSteps(self.ts, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSetSteps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":828 * CHKERR( TSAdjointSetSteps(self.ts, ival) ) * * def adjointSetUp(self): # <<<<<<<<<<<<<< * CHKERR(TSAdjointSetUp(self.ts)) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_207adjointSetUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_206adjointSetUp[] = "TS.adjointSetUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_207adjointSetUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointSetUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("adjointSetUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "adjointSetUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_206adjointSetUp(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_206adjointSetUp(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointSetUp", 0); /* "PETSc/TS.pyx":829 * * def adjointSetUp(self): * CHKERR(TSAdjointSetUp(self.ts)) # <<<<<<<<<<<<<< * * def adjointSolve(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointSetUp(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 829, __pyx_L1_error) /* "PETSc/TS.pyx":828 * CHKERR( TSAdjointSetSteps(self.ts, ival) ) * * def adjointSetUp(self): # <<<<<<<<<<<<<< * CHKERR(TSAdjointSetUp(self.ts)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSetUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":831 * CHKERR(TSAdjointSetUp(self.ts)) * * def adjointSolve(self): # <<<<<<<<<<<<<< * CHKERR( TSAdjointSolve(self.ts) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_209adjointSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_208adjointSolve[] = "TS.adjointSolve(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_209adjointSolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointSolve (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("adjointSolve", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "adjointSolve", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_208adjointSolve(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_208adjointSolve(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointSolve", 0); /* "PETSc/TS.pyx":832 * * def adjointSolve(self): * CHKERR( TSAdjointSolve(self.ts) ) # <<<<<<<<<<<<<< * * def adjointStep(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointSolve(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 832, __pyx_L1_error) /* "PETSc/TS.pyx":831 * CHKERR(TSAdjointSetUp(self.ts)) * * def adjointSolve(self): # <<<<<<<<<<<<<< * CHKERR( TSAdjointSolve(self.ts) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointSolve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":834 * CHKERR( TSAdjointSolve(self.ts) ) * * def adjointStep(self): # <<<<<<<<<<<<<< * CHKERR(TSAdjointStep(self.ts)) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_211adjointStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_210adjointStep[] = "TS.adjointStep(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_211adjointStep(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adjointStep (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("adjointStep", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "adjointStep", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_210adjointStep(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_210adjointStep(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adjointStep", 0); /* "PETSc/TS.pyx":835 * * def adjointStep(self): * CHKERR(TSAdjointStep(self.ts)) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAdjointStep(__pyx_v_self->ts)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 835, __pyx_L1_error) /* "PETSc/TS.pyx":834 * CHKERR( TSAdjointSolve(self.ts) ) * * def adjointStep(self): # <<<<<<<<<<<<<< * CHKERR(TSAdjointStep(self.ts)) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.adjointStep", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":840 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_213createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_212createPython[] = "TS.createPython(self, context=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_213createPython(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPython (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createPython") < 0)) __PYX_ERR(42, 840, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_context = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createPython", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 840, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_212createPython(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_212createPython(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; TS __pyx_v_newts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPython", 0); /* "PETSc/TS.pyx":841 * * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 841, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/TS.pyx":842 * def createPython(self, context=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL # <<<<<<<<<<<<<< * CHKERR( TSCreate(ccomm, &newts) ) * PetscCLEAR(self.obj); self.ts = newts */ __pyx_v_newts = NULL; /* "PETSc/TS.pyx":843 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ts = newts * CHKERR( TSSetType(self.ts, TSPYTHON) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSCreate(__pyx_v_ccomm, (&__pyx_v_newts))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 843, __pyx_L1_error) /* "PETSc/TS.pyx":844 * cdef PetscTS newts = NULL * CHKERR( TSCreate(ccomm, &newts) ) * PetscCLEAR(self.obj); self.ts = newts # <<<<<<<<<<<<<< * CHKERR( TSSetType(self.ts, TSPYTHON) ) * CHKERR( TSPythonSetContext(self.ts, context) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ts = __pyx_v_newts; /* "PETSc/TS.pyx":845 * CHKERR( TSCreate(ccomm, &newts) ) * PetscCLEAR(self.obj); self.ts = newts * CHKERR( TSSetType(self.ts, TSPYTHON) ) # <<<<<<<<<<<<<< * CHKERR( TSPythonSetContext(self.ts, context) ) * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetType(__pyx_v_self->ts, TSPYTHON)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 845, __pyx_L1_error) /* "PETSc/TS.pyx":846 * PetscCLEAR(self.obj); self.ts = newts * CHKERR( TSSetType(self.ts, TSPYTHON) ) * CHKERR( TSPythonSetContext(self.ts, context) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPythonSetContext(__pyx_v_self->ts, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 846, __pyx_L1_error) /* "PETSc/TS.pyx":847 * CHKERR( TSSetType(self.ts, TSPYTHON) ) * CHKERR( TSPythonSetContext(self.ts, context) ) * return self # <<<<<<<<<<<<<< * * def setPythonContext(self, context): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/TS.pyx":840 * # --- Python --- * * def createPython(self, context=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTS newts = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":849 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( TSPythonSetContext(self.ts, context) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_215setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_214setPythonContext[] = "TS.setPythonContext(self, context)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_215setPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_context = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonContext (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonContext") < 0)) __PYX_ERR(42, 849, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_context = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 849, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_214setPythonContext(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_context); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_214setPythonContext(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonContext", 0); /* "PETSc/TS.pyx":850 * * def setPythonContext(self, context): * CHKERR( TSPythonSetContext(self.ts, context) ) # <<<<<<<<<<<<<< * * def getPythonContext(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPythonSetContext(__pyx_v_self->ts, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 850, __pyx_L1_error) /* "PETSc/TS.pyx":849 * return self * * def setPythonContext(self, context): # <<<<<<<<<<<<<< * CHKERR( TSPythonSetContext(self.ts, context) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":852 * CHKERR( TSPythonSetContext(self.ts, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( TSPythonGetContext(self.ts, &context) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_217getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_216getPythonContext[] = "TS.getPythonContext(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_217getPythonContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPythonContext (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPythonContext", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPythonContext", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_216getPythonContext(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_216getPythonContext(struct PyPetscTSObject *__pyx_v_self) { void *__pyx_v_context; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPythonContext", 0); /* "PETSc/TS.pyx":853 * * def getPythonContext(self): * cdef void *context = NULL # <<<<<<<<<<<<<< * CHKERR( TSPythonGetContext(self.ts, &context) ) * if context == NULL: return None */ __pyx_v_context = NULL; /* "PETSc/TS.pyx":854 * def getPythonContext(self): * cdef void *context = NULL * CHKERR( TSPythonGetContext(self.ts, &context) ) # <<<<<<<<<<<<<< * if context == NULL: return None * else: return context */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPythonGetContext(__pyx_v_self->ts, (&__pyx_v_context))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 854, __pyx_L1_error) /* "PETSc/TS.pyx":855 * cdef void *context = NULL * CHKERR( TSPythonGetContext(self.ts, &context) ) * if context == NULL: return None # <<<<<<<<<<<<<< * else: return context * */ __pyx_t_2 = ((__pyx_v_context == NULL) != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/TS.pyx":856 * CHKERR( TSPythonGetContext(self.ts, &context) ) * if context == NULL: return None * else: return context # <<<<<<<<<<<<<< * * def setPythonType(self, py_type): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_context)); __pyx_r = ((PyObject *)__pyx_v_context); goto __pyx_L0; } /* "PETSc/TS.pyx":852 * CHKERR( TSPythonSetContext(self.ts, context) ) * * def getPythonContext(self): # <<<<<<<<<<<<<< * cdef void *context = NULL * CHKERR( TSPythonGetContext(self.ts, &context) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":858 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_219setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_218setPythonType[] = "TS.setPythonType(self, py_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_219setPythonType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_py_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPythonType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_py_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_py_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPythonType") < 0)) __PYX_ERR(42, 858, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_py_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 858, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_218setPythonType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_py_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_218setPythonType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_py_type) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPythonType", 0); __Pyx_INCREF(__pyx_v_py_type); /* "PETSc/TS.pyx":859 * * def setPythonType(self, py_type): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * py_type = str2bytes(py_type, &cval) * CHKERR( TSPythonSetType(self.ts, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/TS.pyx":860 * def setPythonType(self, py_type): * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) # <<<<<<<<<<<<<< * CHKERR( TSPythonSetType(self.ts, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":861 * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) * CHKERR( TSPythonSetType(self.ts, cval) ) # <<<<<<<<<<<<<< * * # --- Theta --- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSPythonSetType(__pyx_v_self->ts, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 861, __pyx_L1_error) /* "PETSc/TS.pyx":858 * else: return context * * def setPythonType(self, py_type): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * py_type = str2bytes(py_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TS.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_py_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":865 * # --- Theta --- * * def setTheta(self, theta): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(theta) * CHKERR( TSThetaSetTheta(self.ts, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_221setTheta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_220setTheta[] = "TS.setTheta(self, theta)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_221setTheta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_theta = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTheta (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_theta,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTheta") < 0)) __PYX_ERR(42, 865, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_theta = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTheta", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 865, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTheta", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_220setTheta(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_theta); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_220setTheta(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_theta) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTheta", 0); /* "PETSc/TS.pyx":866 * * def setTheta(self, theta): * cdef PetscReal rval = asReal(theta) # <<<<<<<<<<<<<< * CHKERR( TSThetaSetTheta(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_theta); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 866, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":867 * def setTheta(self, theta): * cdef PetscReal rval = asReal(theta) * CHKERR( TSThetaSetTheta(self.ts, rval) ) # <<<<<<<<<<<<<< * * def getTheta(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaSetTheta(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 867, __pyx_L1_error) /* "PETSc/TS.pyx":865 * # --- Theta --- * * def setTheta(self, theta): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(theta) * CHKERR( TSThetaSetTheta(self.ts, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setTheta", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":869 * CHKERR( TSThetaSetTheta(self.ts, rval) ) * * def getTheta(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSThetaGetTheta(self.ts, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_223getTheta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_222getTheta[] = "TS.getTheta(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_223getTheta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTheta (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTheta", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTheta", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_222getTheta(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_222getTheta(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTheta", 0); /* "PETSc/TS.pyx":870 * * def getTheta(self): * cdef PetscReal rval = 0 # <<<<<<<<<<<<<< * CHKERR( TSThetaGetTheta(self.ts, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/TS.pyx":871 * def getTheta(self): * cdef PetscReal rval = 0 * CHKERR( TSThetaGetTheta(self.ts, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaGetTheta(__pyx_v_self->ts, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 871, __pyx_L1_error) /* "PETSc/TS.pyx":872 * cdef PetscReal rval = 0 * CHKERR( TSThetaGetTheta(self.ts, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def setThetaEndpoint(self, flag=True): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":869 * CHKERR( TSThetaSetTheta(self.ts, rval) ) * * def getTheta(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0 * CHKERR( TSThetaGetTheta(self.ts, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getTheta", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":874 * return toReal(rval) * * def setThetaEndpoint(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_225setThetaEndpoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_224setThetaEndpoint[] = "TS.setThetaEndpoint(self, flag=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_225setThetaEndpoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_flag = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setThetaEndpoint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setThetaEndpoint") < 0)) __PYX_ERR(42, 874, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_flag = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setThetaEndpoint", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 874, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setThetaEndpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_224setThetaEndpoint(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_224setThetaEndpoint(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag) { PetscBool __pyx_v_bval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setThetaEndpoint", 0); /* "PETSc/TS.pyx":875 * * def setThetaEndpoint(self, flag=True): * cdef PetscBool bval = flag # <<<<<<<<<<<<<< * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(42, 875, __pyx_L1_error) __pyx_v_bval = __pyx_t_1; /* "PETSc/TS.pyx":876 * def setThetaEndpoint(self, flag=True): * cdef PetscBool bval = flag * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) # <<<<<<<<<<<<<< * * def getThetaEndpoint(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaSetEndpoint(__pyx_v_self->ts, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 876, __pyx_L1_error) /* "PETSc/TS.pyx":874 * return toReal(rval) * * def setThetaEndpoint(self, flag=True): # <<<<<<<<<<<<<< * cdef PetscBool bval = flag * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setThetaEndpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":878 * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) * * def getThetaEndpoint(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_227getThetaEndpoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_226getThetaEndpoint[] = "TS.getThetaEndpoint(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_227getThetaEndpoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getThetaEndpoint (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getThetaEndpoint", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getThetaEndpoint", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_226getThetaEndpoint(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_226getThetaEndpoint(struct PyPetscTSObject *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getThetaEndpoint", 0); /* "PETSc/TS.pyx":879 * * def getThetaEndpoint(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/TS.pyx":880 * def getThetaEndpoint(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSThetaGetEndpoint(__pyx_v_self->ts, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 880, __pyx_L1_error) /* "PETSc/TS.pyx":881 * cdef PetscBool flag = PETSC_FALSE * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * # --- Alpha --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":878 * CHKERR( TSThetaSetEndpoint(self.ts, bval) ) * * def getThetaEndpoint(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( TSThetaGetEndpoint(self.ts, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.getThetaEndpoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":885 * # --- Alpha --- * * def setAlphaRadius(self, radius): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(radius) * CHKERR( TSAlphaSetRadius(self.ts, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_229setAlphaRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_228setAlphaRadius[] = "TS.setAlphaRadius(self, radius)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_229setAlphaRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_radius = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAlphaRadius (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAlphaRadius") < 0)) __PYX_ERR(42, 885, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_radius = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAlphaRadius", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 885, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_228setAlphaRadius(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_radius); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_228setAlphaRadius(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_radius) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAlphaRadius", 0); /* "PETSc/TS.pyx":886 * * def setAlphaRadius(self, radius): * cdef PetscReal rval = asReal(radius) # <<<<<<<<<<<<<< * CHKERR( TSAlphaSetRadius(self.ts, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_radius); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 886, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/TS.pyx":887 * def setAlphaRadius(self, radius): * cdef PetscReal rval = asReal(radius) * CHKERR( TSAlphaSetRadius(self.ts, rval) ) # <<<<<<<<<<<<<< * * def setAlphaParams(self, alpha_m=None,alpha_f=None, gamma=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaSetRadius(__pyx_v_self->ts, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(42, 887, __pyx_L1_error) /* "PETSc/TS.pyx":885 * # --- Alpha --- * * def setAlphaRadius(self, radius): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(radius) * CHKERR( TSAlphaSetRadius(self.ts, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":889 * CHKERR( TSAlphaSetRadius(self.ts, rval) ) * * def setAlphaParams(self, alpha_m=None,alpha_f=None, gamma=None): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_231setAlphaParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_230setAlphaParams[] = "TS.setAlphaParams(self, alpha_m=None, alpha_f=None, gamma=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_231setAlphaParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha_m = 0; PyObject *__pyx_v_alpha_f = 0; PyObject *__pyx_v_gamma = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAlphaParams (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha_m,&__pyx_n_s_alpha_f,&__pyx_n_s_gamma,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha_m); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha_f); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gamma); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAlphaParams") < 0)) __PYX_ERR(42, 889, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_alpha_m = values[0]; __pyx_v_alpha_f = values[1]; __pyx_v_gamma = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAlphaParams", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(42, 889, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaParams", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_230setAlphaParams(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_alpha_m, __pyx_v_alpha_f, __pyx_v_gamma); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_230setAlphaParams(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_alpha_m, PyObject *__pyx_v_alpha_f, PyObject *__pyx_v_gamma) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PetscReal __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAlphaParams", 0); /* "PETSc/TS.pyx":890 * * def setAlphaParams(self, alpha_m=None,alpha_f=None, gamma=None): * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 # <<<<<<<<<<<<<< * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * except PetscError: pass */ __pyx_v_rval1 = 0.0; __pyx_v_rval2 = 0.0; __pyx_v_rval3 = 0.0; /* "PETSc/TS.pyx":891 * def setAlphaParams(self, alpha_m=None,alpha_f=None, gamma=None): * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) # <<<<<<<<<<<<<< * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaGetParams(__pyx_v_self->ts, (&__pyx_v_rval1), (&__pyx_v_rval2), (&__pyx_v_rval3))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 891, __pyx_L3_error) } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; /* "PETSc/TS.pyx":892 * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * except PetscError: pass # <<<<<<<<<<<<<< * if alpha_m is not None: rval1 = asReal(alpha_m) * if alpha_f is not None: rval2 = asReal(alpha_f) */ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_v_8petsc4py_5PETSc_PetscError); if (__pyx_t_4) { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "PETSc/TS.pyx":891 * def setAlphaParams(self, alpha_m=None,alpha_f=None, gamma=None): * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) # <<<<<<<<<<<<<< * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "PETSc/TS.pyx":893 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) # <<<<<<<<<<<<<< * if alpha_f is not None: rval2 = asReal(alpha_f) * if gamma is not None: rval3 = asReal(gamma) */ __pyx_t_5 = (__pyx_v_alpha_m != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha_m); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 893, __pyx_L1_error) __pyx_v_rval1 = __pyx_t_7; } /* "PETSc/TS.pyx":894 * except PetscError: pass * if alpha_m is not None: rval1 = asReal(alpha_m) * if alpha_f is not None: rval2 = asReal(alpha_f) # <<<<<<<<<<<<<< * if gamma is not None: rval3 = asReal(gamma) * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) */ __pyx_t_6 = (__pyx_v_alpha_f != Py_None); __pyx_t_5 = (__pyx_t_6 != 0); if (__pyx_t_5) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_alpha_f); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 894, __pyx_L1_error) __pyx_v_rval2 = __pyx_t_7; } /* "PETSc/TS.pyx":895 * if alpha_m is not None: rval1 = asReal(alpha_m) * if alpha_f is not None: rval2 = asReal(alpha_f) * if gamma is not None: rval3 = asReal(gamma) # <<<<<<<<<<<<<< * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) * */ __pyx_t_5 = (__pyx_v_gamma != Py_None); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gamma); if (unlikely(__pyx_t_7 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(42, 895, __pyx_L1_error) __pyx_v_rval3 = __pyx_t_7; } /* "PETSc/TS.pyx":896 * if alpha_f is not None: rval2 = asReal(alpha_f) * if gamma is not None: rval3 = asReal(gamma) * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) # <<<<<<<<<<<<<< * * def getAlphaParams(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaSetParams(__pyx_v_self->ts, __pyx_v_rval1, __pyx_v_rval2, __pyx_v_rval3)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(42, 896, __pyx_L1_error) /* "PETSc/TS.pyx":889 * CHKERR( TSAlphaSetRadius(self.ts, rval) ) * * def setAlphaParams(self, alpha_m=None,alpha_f=None, gamma=None): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * try: CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TS.setAlphaParams", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":898 * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) * * def getAlphaParams(self): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_233getAlphaParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2TS_232getAlphaParams[] = "TS.getAlphaParams(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_233getAlphaParams(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAlphaParams (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAlphaParams", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAlphaParams", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_232getAlphaParams(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_232getAlphaParams(struct PyPetscTSObject *__pyx_v_self) { PetscReal __pyx_v_rval1; PetscReal __pyx_v_rval2; PetscReal __pyx_v_rval3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAlphaParams", 0); /* "PETSc/TS.pyx":899 * * def getAlphaParams(self): * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 # <<<<<<<<<<<<<< * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * return (toReal(rval1), toReal(rval2), toReal(rval3)) */ __pyx_v_rval1 = 0.0; __pyx_v_rval2 = 0.0; __pyx_v_rval3 = 0.0; /* "PETSc/TS.pyx":900 * def getAlphaParams(self): * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) # <<<<<<<<<<<<<< * return (toReal(rval1), toReal(rval2), toReal(rval3)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSAlphaGetParams(__pyx_v_self->ts, (&__pyx_v_rval1), (&__pyx_v_rval2), (&__pyx_v_rval3))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(42, 900, __pyx_L1_error) /* "PETSc/TS.pyx":901 * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) * return (toReal(rval1), toReal(rval2), toReal(rval3)) # <<<<<<<<<<<<<< * * # --- application context --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval1); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval3); if (unlikely(!__pyx_t_4)) __PYX_ERR(42, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(42, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":898 * CHKERR( TSAlphaSetParams(self.ts, rval1, rval2, rval3) ) * * def getAlphaParams(self): # <<<<<<<<<<<<<< * cdef PetscReal rval1 = 0, rval2 = 0, rval3 = 0 * CHKERR( TSAlphaGetParams(self.ts, &rval1, &rval2, &rval3) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TS.getAlphaParams", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":906 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6appctx_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6appctx___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6appctx___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":907 * property appctx: * def __get__(self): * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":906 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":908 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6appctx_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_6appctx_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":909 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":908 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":914 * * property dm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_2dm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_2dm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_2dm___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_2dm___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":915 * property dm: * def __get__(self): * return self.getDM() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setDM(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":914 * * property dm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDM() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.dm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":916 * def __get__(self): * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_2dm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_2dm_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_2dm_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":917 * return self.getDM() * def __set__(self, value): * self.setDM(value) # <<<<<<<<<<<<<< * * # --- xxx --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDM); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":916 * def __get__(self): * return self.getDM() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDM(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.dm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":922 * * property problem_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getProblemType() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_12problem_type___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":923 * property problem_type: * def __get__(self): * return self.getProblemType() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setProblemType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getProblemType); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":922 * * property problem_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getProblemType() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.problem_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":924 * def __get__(self): * return self.getProblemType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setProblemType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_12problem_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":925 * return self.getProblemType() * def __set__(self, value): * self.setProblemType(value) # <<<<<<<<<<<<<< * * property equation_type: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setProblemType); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":924 * def __get__(self): * return self.getProblemType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setProblemType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.problem_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":928 * * property equation_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getEquationType() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_13equation_type___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":929 * property equation_type: * def __get__(self): * return self.getEquationType() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setEquationType(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getEquationType); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":928 * * property equation_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getEquationType() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.equation_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":930 * def __get__(self): * return self.getEquationType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setEquationType(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_13equation_type_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":931 * return self.getEquationType() * def __set__(self, value): * self.setEquationType(value) # <<<<<<<<<<<<<< * * property snes: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setEquationType); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":930 * def __get__(self): * return self.getEquationType() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setEquationType(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.equation_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":934 * * property snes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSNES() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4snes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4snes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4snes___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4snes___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":935 * property snes: * def __get__(self): * return self.getSNES() # <<<<<<<<<<<<<< * * property ksp: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSNES); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":934 * * property snes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSNES() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.snes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":938 * * property ksp: * def __get__(self): # <<<<<<<<<<<<<< * return self.getKSP() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3ksp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_3ksp_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_3ksp___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_3ksp___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":939 * property ksp: * def __get__(self): * return self.getKSP() # <<<<<<<<<<<<<< * * property vec_sol: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":938 * * property ksp: * def __get__(self): # <<<<<<<<<<<<<< * return self.getKSP() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.ksp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":942 * * property vec_sol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7vec_sol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_7vec_sol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_7vec_sol___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_7vec_sol___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":943 * property vec_sol: * def __get__(self): * return self.getSolution() # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":942 * * property vec_sol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.vec_sol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":948 * * property time: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTime() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4time_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4time_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4time___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4time___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":949 * property time: * def __get__(self): * return self.getTime() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTime(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":948 * * property time: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTime() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":950 * def __get__(self): * return self.getTime() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTime(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_4time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_4time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4time_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_4time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":951 * return self.getTime() * def __set__(self, value): * self.setTime(value) # <<<<<<<<<<<<<< * * property time_step: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":950 * def __get__(self): * return self.getTime() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTime(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":954 * * property time_step: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTimeStep() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9time_step_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9time_step_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9time_step___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9time_step___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":955 * property time_step: * def __get__(self): * return self.getTimeStep() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTimeStep(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTimeStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":954 * * property time_step: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTimeStep() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time_step.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":956 * def __get__(self): * return self.getTimeStep() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTimeStep(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9time_step_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_9time_step_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":957 * return self.getTimeStep() * def __set__(self, value): * self.setTimeStep(value) # <<<<<<<<<<<<<< * * property step_number: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTimeStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":956 * def __get__(self): * return self.getTimeStep() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTimeStep(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.time_step.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":960 * * property step_number: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStepNumber() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11step_number_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_11step_number_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_11step_number___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_11step_number___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":961 * property step_number: * def __get__(self): * return self.getStepNumber() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setStepNumber(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStepNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 961, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":960 * * property step_number: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStepNumber() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.step_number.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":962 * def __get__(self): * return self.getStepNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setStepNumber(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_11step_number_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_11step_number_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":963 * return self.getStepNumber() * def __set__(self, value): * self.setStepNumber(value) # <<<<<<<<<<<<<< * * property max_time: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setStepNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 963, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":962 * def __get__(self): * return self.getStepNumber() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setStepNumber(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.step_number.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":966 * * property max_time: * def __get__(self): # <<<<<<<<<<<<<< * return self.getMaxTime() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8max_time_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8max_time_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8max_time___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8max_time___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":967 * property max_time: * def __get__(self): * return self.getMaxTime() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setMaxTime(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getMaxTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":966 * * property max_time: * def __get__(self): # <<<<<<<<<<<<<< * return self.getMaxTime() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":968 * def __get__(self): * return self.getMaxTime() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxTime(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8max_time_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_8max_time_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":969 * return self.getMaxTime() * def __set__(self, value): * self.setMaxTime(value) # <<<<<<<<<<<<<< * * property max_steps: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setMaxTime); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":968 * def __get__(self): * return self.getMaxTime() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxTime(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_time.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":972 * * property max_steps: * def __get__(self): # <<<<<<<<<<<<<< * return self.getMaxSteps() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9max_steps___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":973 * property max_steps: * def __get__(self): * return self.getMaxSteps() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setMaxSteps(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getMaxSteps); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":972 * * property max_steps: * def __get__(self): # <<<<<<<<<<<<<< * return self.getMaxSteps() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_steps.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":974 * def __get__(self): * return self.getMaxSteps() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxSteps(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_9max_steps_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":975 * return self.getMaxSteps() * def __set__(self, value): * self.setMaxSteps(value) # <<<<<<<<<<<<<< * * # --- convergence --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setMaxSteps); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":974 * def __get__(self): * return self.getMaxSteps() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setMaxSteps(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.max_steps.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":980 * * property rtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4rtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4rtol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4rtol___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4rtol___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":981 * property rtol: * def __get__(self): * return self.getTolerances()[0] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(rtol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":980 * * property rtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[0] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.rtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":982 * def __get__(self): * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4rtol_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_4rtol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":983 * return self.getTolerances()[0] * def __set__(self, value): * self.setTolerances(rtol=value) # <<<<<<<<<<<<<< * * property atol: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rtol, __pyx_v_value) < 0) __PYX_ERR(42, 983, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":982 * def __get__(self): * return self.getTolerances()[0] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(rtol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.rtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":986 * * property atol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4atol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_4atol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4atol___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_4atol___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":987 * property atol: * def __get__(self): * return self.getTolerances()[1] # <<<<<<<<<<<<<< * def __set__(self, value): * self.setTolerances(atol=value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":986 * * property atol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getTolerances()[1] * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.atol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":988 * def __get__(self): * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_4atol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_4atol_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_4atol_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":989 * return self.getTolerances()[1] * def __set__(self, value): * self.setTolerances(atol=value) # <<<<<<<<<<<<<< * * property reason: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTolerances); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_atol, __pyx_v_value) < 0) __PYX_ERR(42, 989, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":988 * def __get__(self): * return self.getTolerances()[1] * def __set__(self, value): # <<<<<<<<<<<<<< * self.setTolerances(atol=value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.atol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":992 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_6reason_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6reason___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_6reason___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":993 * property reason: * def __get__(self): * return self.getConvergedReason() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setConvergedReason(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":992 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":994 * def __get__(self): * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2TS_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2TS_6reason_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_6reason_2__set__(((struct PyPetscTSObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2TS_6reason_2__set__(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TS.pyx":995 * return self.getConvergedReason() * def __set__(self, value): * self.setConvergedReason(value) # <<<<<<<<<<<<<< * * property iterating: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TS.pyx":994 * def __get__(self): * return self.getConvergedReason() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setConvergedReason(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TS.reason.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":998 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9iterating_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9iterating___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9iterating___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":999 * property iterating: * def __get__(self): * return self.reason == 0 # <<<<<<<<<<<<<< * * property converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":998 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":1002 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_9converged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_9converged___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_9converged___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":1003 * property converged: * def __get__(self): * return self.reason > 0 # <<<<<<<<<<<<<< * * property diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 1003, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":1002 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TS.pyx":1006 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_8diverged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_8diverged___get__(((struct PyPetscTSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_8diverged___get__(struct PyPetscTSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TS.pyx":1007 * property diverged: * def __get__(self): * return self.reason < 0 # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 1007, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(42, 1007, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TS.pyx":1006 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TS.diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":74 * Reason = TAOConvergedReason * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.tao * self.tao = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO___cinit__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO___cinit__(struct PyPetscTAOObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/TAO.pyx":75 * * def __cinit__(self): * self.obj = &self.tao # <<<<<<<<<<<<<< * self.tao = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->tao)); /* "PETSc/TAO.pyx":76 * def __cinit__(self): * self.obj = &self.tao * self.tao = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_v_self->tao = NULL; /* "PETSc/TAO.pyx":74 * Reason = TAOConvergedReason * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.tao * self.tao = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":78 * self.tao = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_2view[] = "TAO.view(self, Viewer viewer=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(43, 78, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 78, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(43, 78, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_2view(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_2view(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/TAO.pyx":81 * """ * """ * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( TaoView(self.tao, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/TAO.pyx":82 * """ * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( TaoView(self.tao, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/TAO.pyx":83 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( TaoView(self.tao, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoView(__pyx_v_self->tao, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 83, __pyx_L1_error) /* "PETSc/TAO.pyx":78 * self.tao = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":85 * CHKERR( TaoView(self.tao, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_4destroy[] = "TAO.destroy(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4destroy(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4destroy(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/TAO.pyx":88 * """ * """ * CHKERR( TaoDestroy(&self.tao) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoDestroy((&__pyx_v_self->tao))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 88, __pyx_L1_error) /* "PETSc/TAO.pyx":89 * """ * CHKERR( TaoDestroy(&self.tao) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/TAO.pyx":85 * CHKERR( TaoView(self.tao, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":91 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_6create[] = "TAO.create(self, comm=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(43, 91, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 91, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6create(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6create(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; Tao __pyx_v_newtao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/TAO.pyx":94 * """ * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscTAO newtao = NULL * CHKERR( TaoCreate(ccomm, &newtao) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 94, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/TAO.pyx":95 * """ * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAO newtao = NULL # <<<<<<<<<<<<<< * CHKERR( TaoCreate(ccomm, &newtao) ) * PetscCLEAR(self.obj); self.tao = newtao */ __pyx_v_newtao = NULL; /* "PETSc/TAO.pyx":96 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscTAO newtao = NULL * CHKERR( TaoCreate(ccomm, &newtao) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.tao = newtao * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCreate(__pyx_v_ccomm, (&__pyx_v_newtao))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 96, __pyx_L1_error) /* "PETSc/TAO.pyx":97 * cdef PetscTAO newtao = NULL * CHKERR( TaoCreate(ccomm, &newtao) ) * PetscCLEAR(self.obj); self.tao = newtao # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->tao = __pyx_v_newtao; /* "PETSc/TAO.pyx":98 * CHKERR( TaoCreate(ccomm, &newtao) ) * PetscCLEAR(self.obj); self.tao = newtao * return self # <<<<<<<<<<<<<< * * def setType(self, tao_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/TAO.pyx":91 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":100 * return self * * def setType(self, tao_type): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_8setType[] = "TAO.setType(self, tao_type)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_tao_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tao_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tao_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(43, 100, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_tao_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 100, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8setType(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_tao_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8setType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_tao_type) { TaoType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_tao_type); /* "PETSc/TAO.pyx":103 * """ * """ * cdef PetscTAOType ctype = NULL # <<<<<<<<<<<<<< * tao_type = str2bytes(tao_type, &ctype) * CHKERR( TaoSetType(self.tao, ctype) ) */ __pyx_v_ctype = NULL; /* "PETSc/TAO.pyx":104 * """ * cdef PetscTAOType ctype = NULL * tao_type = str2bytes(tao_type, &ctype) # <<<<<<<<<<<<<< * CHKERR( TaoSetType(self.tao, ctype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_tao_type, (&__pyx_v_ctype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_tao_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":105 * cdef PetscTAOType ctype = NULL * tao_type = str2bytes(tao_type, &ctype) * CHKERR( TaoSetType(self.tao, ctype) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetType(__pyx_v_self->tao, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 105, __pyx_L1_error) /* "PETSc/TAO.pyx":100 * return self * * def setType(self, tao_type): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tao_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":107 * CHKERR( TaoSetType(self.tao, ctype) ) * * def getType(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_10getType[] = "TAO.getType(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_10getType(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_10getType(struct PyPetscTAOObject *__pyx_v_self) { TaoType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/TAO.pyx":110 * """ * """ * cdef PetscTAOType ctype = NULL # <<<<<<<<<<<<<< * CHKERR( TaoGetType(self.tao, &ctype) ) * return bytes2str(ctype) */ __pyx_v_ctype = NULL; /* "PETSc/TAO.pyx":111 * """ * cdef PetscTAOType ctype = NULL * CHKERR( TaoGetType(self.tao, &ctype) ) # <<<<<<<<<<<<<< * return bytes2str(ctype) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetType(__pyx_v_self->tao, (&__pyx_v_ctype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 111, __pyx_L1_error) /* "PETSc/TAO.pyx":112 * cdef PetscTAOType ctype = NULL * CHKERR( TaoGetType(self.tao, &ctype) ) * return bytes2str(ctype) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_ctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":107 * CHKERR( TaoSetType(self.tao, ctype) ) * * def getType(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":114 * return bytes2str(ctype) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_12setOptionsPrefix[] = "TAO.setOptionsPrefix(self, prefix)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(43, 114, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 114, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_12setOptionsPrefix(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_12setOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cprefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/TAO.pyx":117 * """ * """ * cdef const char *cprefix = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) */ __pyx_v_cprefix = NULL; /* "PETSc/TAO.pyx":118 * """ * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) # <<<<<<<<<<<<<< * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":119 * cdef const char *cprefix = NULL * prefix = str2bytes(prefix, &cprefix) * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) # <<<<<<<<<<<<<< * * def getOptionsPrefix(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetOptionsPrefix(__pyx_v_self->tao, __pyx_v_cprefix)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 119, __pyx_L1_error) /* "PETSc/TAO.pyx":114 * return bytes2str(ctype) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":121 * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_15getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_14getOptionsPrefix[] = "TAO.getOptionsPrefix(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_15getOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOptionsPrefix (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOptionsPrefix", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOptionsPrefix", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_14getOptionsPrefix(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_14getOptionsPrefix(struct PyPetscTAOObject *__pyx_v_self) { char const *__pyx_v_prefix; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOptionsPrefix", 0); /* "PETSc/TAO.pyx":124 * """ * """ * cdef const char *prefix = NULL # <<<<<<<<<<<<<< * CHKERR( TaoGetOptionsPrefix(self.tao, &prefix) ) * return bytes2str(prefix) */ __pyx_v_prefix = NULL; /* "PETSc/TAO.pyx":125 * """ * cdef const char *prefix = NULL * CHKERR( TaoGetOptionsPrefix(self.tao, &prefix) ) # <<<<<<<<<<<<<< * return bytes2str(prefix) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetOptionsPrefix(__pyx_v_self->tao, (&__pyx_v_prefix))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 125, __pyx_L1_error) /* "PETSc/TAO.pyx":126 * cdef const char *prefix = NULL * CHKERR( TaoGetOptionsPrefix(self.tao, &prefix) ) * return bytes2str(prefix) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":121 * CHKERR( TaoSetOptionsPrefix(self.tao, cprefix) ) * * def getOptionsPrefix(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":128 * return bytes2str(prefix) * * def setFromOptions(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_17setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_16setFromOptions[] = "TAO.setFromOptions(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_17setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_16setFromOptions(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_16setFromOptions(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/TAO.pyx":131 * """ * """ * CHKERR( TaoSetFromOptions(self.tao) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetFromOptions(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 131, __pyx_L1_error) /* "PETSc/TAO.pyx":128 * return bytes2str(prefix) * * def setFromOptions(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":133 * CHKERR( TaoSetFromOptions(self.tao) ) * * def setUp(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_19setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_18setUp[] = "TAO.setUp(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_19setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_18setUp(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_18setUp(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/TAO.pyx":136 * """ * """ * CHKERR( TaoSetUp(self.tao) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetUp(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 136, __pyx_L1_error) /* "PETSc/TAO.pyx":133 * CHKERR( TaoSetFromOptions(self.tao) ) * * def setUp(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":140 * # * * def setInitialTrustRegionRadius(self, radius): # <<<<<<<<<<<<<< * cdef PetscReal cradius = asReal(radius) * CHKERR( TaoSetInitialTrustRegionRadius(self.tao, cradius) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_21setInitialTrustRegionRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_20setInitialTrustRegionRadius[] = "TAO.setInitialTrustRegionRadius(self, radius)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_21setInitialTrustRegionRadius(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_radius = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitialTrustRegionRadius (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitialTrustRegionRadius") < 0)) __PYX_ERR(43, 140, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_radius = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitialTrustRegionRadius", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 140, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setInitialTrustRegionRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_20setInitialTrustRegionRadius(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_radius); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_20setInitialTrustRegionRadius(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_radius) { PetscReal __pyx_v_cradius; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitialTrustRegionRadius", 0); /* "PETSc/TAO.pyx":141 * * def setInitialTrustRegionRadius(self, radius): * cdef PetscReal cradius = asReal(radius) # <<<<<<<<<<<<<< * CHKERR( TaoSetInitialTrustRegionRadius(self.tao, cradius) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_radius); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 141, __pyx_L1_error) __pyx_v_cradius = __pyx_t_1; /* "PETSc/TAO.pyx":142 * def setInitialTrustRegionRadius(self, radius): * cdef PetscReal cradius = asReal(radius) * CHKERR( TaoSetInitialTrustRegionRadius(self.tao, cradius) ) # <<<<<<<<<<<<<< * * # -------------- */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetInitialTrustRegionRadius(__pyx_v_self->tao, __pyx_v_cradius)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 142, __pyx_L1_error) /* "PETSc/TAO.pyx":140 * # * * def setInitialTrustRegionRadius(self, radius): # <<<<<<<<<<<<<< * cdef PetscReal cradius = asReal(radius) * CHKERR( TaoSetInitialTrustRegionRadius(self.tao, cradius) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setInitialTrustRegionRadius", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":146 * # -------------- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr("__appctx__", appctx) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_23setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_22setAppCtx[] = "TAO.setAppCtx(self, appctx)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_23setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_appctx = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_appctx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAppCtx") < 0)) __PYX_ERR(43, 146, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 146, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_22setAppCtx(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_22setAppCtx(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 0); /* "PETSc/TAO.pyx":147 * * def setAppCtx(self, appctx): * self.set_attr("__appctx__", appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":146 * # -------------- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr("__appctx__", appctx) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":149 * self.set_attr("__appctx__", appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr("__appctx__") * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_25getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_24getAppCtx[] = "TAO.getAppCtx(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_25getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_24getAppCtx(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_24getAppCtx(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 0); /* "PETSc/TAO.pyx":150 * * def getAppCtx(self): * return self.get_attr("__appctx__") # <<<<<<<<<<<<<< * * def setInitial(self, Vec x): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":149 * self.set_attr("__appctx__", appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr("__appctx__") * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":152 * return self.get_attr("__appctx__") * * def setInitial(self, Vec x): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_27setInitial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_26setInitial[] = "TAO.setInitial(self, Vec x)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_27setInitial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInitial (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInitial") < 0)) __PYX_ERR(43, 152, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInitial", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 152, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setInitial", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 152, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_26setInitial(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_26setInitial(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInitial", 0); /* "PETSc/TAO.pyx":155 * """ * """ * CHKERR( TaoSetInitialVector(self.tao, x.vec) ) # <<<<<<<<<<<<<< * * def setObjective(self, objective, args=None, kargs=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetInitialVector(__pyx_v_self->tao, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 155, __pyx_L1_error) /* "PETSc/TAO.pyx":152 * return self.get_attr("__appctx__") * * def setInitial(self, Vec x): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setInitial", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":157 * CHKERR( TaoSetInitialVector(self.tao, x.vec) ) * * def setObjective(self, objective, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_29setObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_28setObjective[] = "TAO.setObjective(self, objective, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_29setObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objective = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjective (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objective,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objective)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setObjective") < 0)) __PYX_ERR(43, 157, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objective = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 157, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_28setObjective(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_objective, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_28setObjective(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objective, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjective", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":160 * """ * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objective, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":161 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objective, args, kargs) * self.set_attr("__objective__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TAO.pyx":162 * if args is None: args = () * if kargs is None: kargs = {} * context = (objective, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__objective__", context) * CHKERR( TaoSetObjectiveRoutine(self.tao, TAO_Objective, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_objective); __Pyx_GIVEREF(__pyx_v_objective); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objective); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":163 * if kargs is None: kargs = {} * context = (objective, args, kargs) * self.set_attr("__objective__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetObjectiveRoutine(self.tao, TAO_Objective, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objective__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":164 * context = (objective, args, kargs) * self.set_attr("__objective__", context) * CHKERR( TaoSetObjectiveRoutine(self.tao, TAO_Objective, context) ) # <<<<<<<<<<<<<< * * def setResidual(self, residual, Vec R=None, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetObjectiveRoutine(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Objective, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 164, __pyx_L1_error) /* "PETSc/TAO.pyx":157 * CHKERR( TaoSetInitialVector(self.tao, x.vec) ) * * def setObjective(self, objective, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":166 * CHKERR( TaoSetObjectiveRoutine(self.tao, TAO_Objective, context) ) * * def setResidual(self, residual, Vec R=None, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_31setResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_30setResidual[] = "TAO.setResidual(self, residual, Vec R=None, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_31setResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_residual = 0; struct PyPetscVecObject *__pyx_v_R = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setResidual (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_residual,&__pyx_n_s_R,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_residual)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setResidual") < 0)) __PYX_ERR(43, 166, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_residual = values[0]; __pyx_v_R = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setResidual", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 166, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "R", 0))) __PYX_ERR(43, 166, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_30setResidual(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_residual, __pyx_v_R, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_30setResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_residual, struct PyPetscVecObject *__pyx_v_R, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_Rvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setResidual", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":169 * """ * """ * cdef PetscVec Rvec = NULL # <<<<<<<<<<<<<< * if R is not None: Rvec = R.vec * if args is None: args = () */ __pyx_v_Rvec = NULL; /* "PETSc/TAO.pyx":170 * """ * cdef PetscVec Rvec = NULL * if R is not None: Rvec = R.vec # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_R) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_R->vec; __pyx_v_Rvec = __pyx_t_3; } /* "PETSc/TAO.pyx":171 * cdef PetscVec Rvec = NULL * if R is not None: Rvec = R.vec * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (residual, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":172 * if R is not None: Rvec = R.vec * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (residual, args, kargs) * self.set_attr("__residual__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":173 * if args is None: args = () * if kargs is None: kargs = {} * context = (residual, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__residual__", context) * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_residual); __Pyx_GIVEREF(__pyx_v_residual); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_residual); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":174 * if kargs is None: kargs = {} * context = (residual, args, kargs) * self.set_attr("__residual__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__residual__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":175 * context = (residual, args, kargs) * self.set_attr("__residual__", context) * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) # <<<<<<<<<<<<<< * * def setJacobianResidual(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetResidualRoutine(__pyx_v_self->tao, __pyx_v_Rvec, __pyx_f_8petsc4py_5PETSc_TAO_Residual, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 175, __pyx_L1_error) /* "PETSc/TAO.pyx":166 * CHKERR( TaoSetObjectiveRoutine(self.tao, TAO_Objective, context) ) * * def setResidual(self, residual, Vec R=None, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":177 * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) * * def setJacobianResidual(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_33setJacobianResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_32setJacobianResidual[] = "TAO.setJacobianResidual(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_33setJacobianResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobianResidual (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setJacobianResidual") < 0)) __PYX_ERR(43, 177, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobianResidual", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 177, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(43, 177, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(43, 177, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_32setJacobianResidual(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_32setJacobianResidual(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobianResidual", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":180 * """ * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat */ __pyx_v_Jmat = NULL; /* "PETSc/TAO.pyx":181 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TAO.pyx":182 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if args is None: args = () */ __pyx_v_Pmat = __pyx_v_Jmat; /* "PETSc/TAO.pyx":183 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/TAO.pyx":184 * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":185 * if P is not None: Pmat = P.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr("__jacobian_residual__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":186 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian_residual__", context) * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":187 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr("__jacobian_residual__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian_residual__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":188 * context = (jacobian, args, kargs) * self.set_attr("__jacobian_residual__", context) * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) # <<<<<<<<<<<<<< * * def setGradient(self, gradient, args=None, kargs=None): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianResidualRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianResidual, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 188, __pyx_L1_error) /* "PETSc/TAO.pyx":177 * CHKERR( TaoSetResidualRoutine(self.tao, Rvec, TAO_Residual, context) ) * * def setJacobianResidual(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":190 * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) * * def setGradient(self, gradient, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_35setGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_34setGradient[] = "TAO.setGradient(self, gradient, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_35setGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_gradient = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGradient (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gradient,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gradient)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGradient") < 0)) __PYX_ERR(43, 190, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gradient = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGradient", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 190, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_34setGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_gradient, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_34setGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gradient, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":193 * """ * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (gradient, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":194 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (gradient, args, kargs) * self.set_attr("__gradient__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TAO.pyx":195 * if args is None: args = () * if kargs is None: kargs = {} * context = (gradient, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__gradient__", context) * CHKERR( TaoSetGradientRoutine(self.tao, TAO_Gradient, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_gradient); __Pyx_GIVEREF(__pyx_v_gradient); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_gradient); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":196 * if kargs is None: kargs = {} * context = (gradient, args, kargs) * self.set_attr("__gradient__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetGradientRoutine(self.tao, TAO_Gradient, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__gradient__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":197 * context = (gradient, args, kargs) * self.set_attr("__gradient__", context) * CHKERR( TaoSetGradientRoutine(self.tao, TAO_Gradient, context) ) # <<<<<<<<<<<<<< * * def setObjectiveGradient(self, objgrad, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetGradientRoutine(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Gradient, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 197, __pyx_L1_error) /* "PETSc/TAO.pyx":190 * CHKERR( TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, context) ) * * def setGradient(self, gradient, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":199 * CHKERR( TaoSetGradientRoutine(self.tao, TAO_Gradient, context) ) * * def setObjectiveGradient(self, objgrad, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_37setObjectiveGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_36setObjectiveGradient[] = "TAO.setObjectiveGradient(self, objgrad, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_37setObjectiveGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objgrad = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setObjectiveGradient (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objgrad,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objgrad)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setObjectiveGradient") < 0)) __PYX_ERR(43, 199, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objgrad = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setObjectiveGradient", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 199, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_36setObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_objgrad, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_36setObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setObjectiveGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":202 * """ * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objgrad, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":203 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objgrad, args, kargs) * self.set_attr("__objgrad__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TAO.pyx":204 * if args is None: args = () * if kargs is None: kargs = {} * context = (objgrad, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__objgrad__", context) * CHKERR( TaoSetObjectiveAndGradientRoutine(self.tao, TAO_ObjGrad, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_objgrad); __Pyx_GIVEREF(__pyx_v_objgrad); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objgrad); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":205 * if kargs is None: kargs = {} * context = (objgrad, args, kargs) * self.set_attr("__objgrad__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetObjectiveAndGradientRoutine(self.tao, TAO_ObjGrad, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__objgrad__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":206 * context = (objgrad, args, kargs) * self.set_attr("__objgrad__", context) * CHKERR( TaoSetObjectiveAndGradientRoutine(self.tao, TAO_ObjGrad, context) ) # <<<<<<<<<<<<<< * * def setVariableBounds(self, varbounds, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetObjectiveAndGradientRoutine(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_ObjGrad, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 206, __pyx_L1_error) /* "PETSc/TAO.pyx":199 * CHKERR( TaoSetGradientRoutine(self.tao, TAO_Gradient, context) ) * * def setObjectiveGradient(self, objgrad, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":208 * CHKERR( TaoSetObjectiveAndGradientRoutine(self.tao, TAO_ObjGrad, context) ) * * def setVariableBounds(self, varbounds, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_39setVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_38setVariableBounds[] = "TAO.setVariableBounds(self, varbounds, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_39setVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_varbounds = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVariableBounds (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_varbounds,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_varbounds)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVariableBounds") < 0)) __PYX_ERR(43, 208, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_varbounds = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVariableBounds", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 208, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_38setVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_varbounds, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_38setVariableBounds(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_varbounds, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; PyObject *__pyx_v_ol = NULL; PyObject *__pyx_v_ou = NULL; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVariableBounds", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":211 * """ * """ * cdef Vec xl=None, xu=None # <<<<<<<<<<<<<< * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): * ol, ou = varbounds */ __Pyx_INCREF(Py_None); __pyx_v_xl = ((struct PyPetscVecObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_xu = ((struct PyPetscVecObject *)Py_None); /* "PETSc/TAO.pyx":212 * """ * cdef Vec xl=None, xu=None * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): # <<<<<<<<<<<<<< * ol, ou = varbounds * xl = ol; xu = ou */ __pyx_t_2 = PyList_Check(__pyx_v_varbounds); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyTuple_Check(__pyx_v_varbounds); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/TAO.pyx":213 * cdef Vec xl=None, xu=None * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): * ol, ou = varbounds # <<<<<<<<<<<<<< * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) */ if ((likely(PyTuple_CheckExact(__pyx_v_varbounds))) || (PyList_CheckExact(__pyx_v_varbounds))) { PyObject* sequence = __pyx_v_varbounds; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(43, 213, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_4 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { Py_ssize_t index = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_varbounds); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(43, 213, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; __pyx_L6_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(43, 213, __pyx_L1_error) __pyx_L7_unpacking_done:; } __pyx_v_ol = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_ou = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/TAO.pyx":214 * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): * ol, ou = varbounds * xl = ol; xu = ou # <<<<<<<<<<<<<< * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return */ if (!(likely(__Pyx_TypeTest(__pyx_v_ol, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(43, 214, __pyx_L1_error) __pyx_t_5 = __pyx_v_ol; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_xl, ((struct PyPetscVecObject *)__pyx_t_5)); __pyx_t_5 = 0; if (!(likely(__Pyx_TypeTest(__pyx_v_ou, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(43, 214, __pyx_L1_error) __pyx_t_5 = __pyx_v_ou; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_xu, ((struct PyPetscVecObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "PETSc/TAO.pyx":215 * ol, ou = varbounds * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * return * if isinstance(varbounds, Vec): */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetVariableBounds(__pyx_v_self->tao, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(43, 215, __pyx_L1_error) /* "PETSc/TAO.pyx":216 * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return # <<<<<<<<<<<<<< * if isinstance(varbounds, Vec): * ol = varbounds; ou = args */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/TAO.pyx":212 * """ * cdef Vec xl=None, xu=None * if (isinstance(varbounds, list) or isinstance(varbounds, tuple)): # <<<<<<<<<<<<<< * ol, ou = varbounds * xl = ol; xu = ou */ } /* "PETSc/TAO.pyx":217 * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return * if isinstance(varbounds, Vec): # <<<<<<<<<<<<<< * ol = varbounds; ou = args * xl = ol; xu = ou */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_varbounds, __pyx_ptype_8petsc4py_5PETSc_Vec); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":218 * return * if isinstance(varbounds, Vec): * ol = varbounds; ou = args # <<<<<<<<<<<<<< * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) */ __Pyx_INCREF(__pyx_v_varbounds); __pyx_v_ol = __pyx_v_varbounds; __Pyx_INCREF(__pyx_v_args); __pyx_v_ou = __pyx_v_args; /* "PETSc/TAO.pyx":219 * if isinstance(varbounds, Vec): * ol = varbounds; ou = args * xl = ol; xu = ou # <<<<<<<<<<<<<< * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return */ if (!(likely(__Pyx_TypeTest(__pyx_v_ol, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(43, 219, __pyx_L1_error) __pyx_t_5 = __pyx_v_ol; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_xl, ((struct PyPetscVecObject *)__pyx_t_5)); __pyx_t_5 = 0; if (!(likely(__Pyx_TypeTest(__pyx_v_ou, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(43, 219, __pyx_L1_error) __pyx_t_5 = __pyx_v_ou; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_xu, ((struct PyPetscVecObject *)__pyx_t_5)); __pyx_t_5 = 0; /* "PETSc/TAO.pyx":220 * ol = varbounds; ou = args * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * return * if args is None: args = () */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetVariableBounds(__pyx_v_self->tao, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(43, 220, __pyx_L1_error) /* "PETSc/TAO.pyx":221 * xl = ol; xu = ou * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "PETSc/TAO.pyx":217 * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return * if isinstance(varbounds, Vec): # <<<<<<<<<<<<<< * ol = varbounds; ou = args * xl = ol; xu = ou */ } /* "PETSc/TAO.pyx":222 * CHKERR( TaoSetVariableBounds(self.tao, xl.vec, xu.vec) ) * return * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (varbounds, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":223 * return * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (varbounds, args, kargs) * self.set_attr("__varbounds__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_5); __pyx_t_5 = 0; } /* "PETSc/TAO.pyx":224 * if args is None: args = () * if kargs is None: kargs = {} * context = (varbounds, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__varbounds__", context) * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) */ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_varbounds); __Pyx_GIVEREF(__pyx_v_varbounds); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_varbounds); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/TAO.pyx":225 * if kargs is None: kargs = {} * context = (varbounds, args, kargs) * self.set_attr("__varbounds__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) * */ __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__varbounds__"), __pyx_v_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/TAO.pyx":226 * context = (varbounds, args, kargs) * self.set_attr("__varbounds__", context) * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) # <<<<<<<<<<<<<< * * def setConstraints(self, constraints, Vec C=None, args=None, kargs=None): */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetVariableBoundsRoutine(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_VarBounds, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(43, 226, __pyx_L1_error) /* "PETSc/TAO.pyx":208 * CHKERR( TaoSetObjectiveAndGradientRoutine(self.tao, TAO_ObjGrad, context) ) * * def setVariableBounds(self, varbounds, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xl); __Pyx_XDECREF((PyObject *)__pyx_v_xu); __Pyx_XDECREF(__pyx_v_ol); __Pyx_XDECREF(__pyx_v_ou); __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":228 * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) * * def setConstraints(self, constraints, Vec C=None, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_41setConstraints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_40setConstraints[] = "TAO.setConstraints(self, constraints, Vec C=None, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_41setConstraints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_constraints = 0; struct PyPetscVecObject *__pyx_v_C = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraints (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constraints,&__pyx_n_s_C,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscVecObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_constraints)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConstraints") < 0)) __PYX_ERR(43, 228, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_constraints = values[0]; __pyx_v_C = ((struct PyPetscVecObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraints", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 228, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "C", 0))) __PYX_ERR(43, 228, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_40setConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_constraints, __pyx_v_C, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_40setConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_constraints, struct PyPetscVecObject *__pyx_v_C, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Vec __pyx_v_Cvec; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Vec __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraints", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":231 * """ * """ * cdef PetscVec Cvec=NULL # <<<<<<<<<<<<<< * if C is not None: Cvec = C.vec * if args is None: args = () */ __pyx_v_Cvec = NULL; /* "PETSc/TAO.pyx":232 * """ * cdef PetscVec Cvec=NULL * if C is not None: Cvec = C.vec # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_C) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_C->vec; __pyx_v_Cvec = __pyx_t_3; } /* "PETSc/TAO.pyx":233 * cdef PetscVec Cvec=NULL * if C is not None: Cvec = C.vec * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (constraints, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":234 * if C is not None: Cvec = C.vec * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (constraints, args, kargs) * self.set_attr("__constraints__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":235 * if args is None: args = () * if kargs is None: kargs = {} * context = (constraints, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__constraints__", context) * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_constraints); __Pyx_GIVEREF(__pyx_v_constraints); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_constraints); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":236 * if kargs is None: kargs = {} * context = (constraints, args, kargs) * self.set_attr("__constraints__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__constraints__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":237 * context = (constraints, args, kargs) * self.set_attr("__constraints__", context) * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) # <<<<<<<<<<<<<< * * def setHessian(self, hessian, Mat H=None, Mat P=None, */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConstraintsRoutine(__pyx_v_self->tao, __pyx_v_Cvec, __pyx_f_8petsc4py_5PETSc_TAO_Constraints, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 237, __pyx_L1_error) /* "PETSc/TAO.pyx":228 * CHKERR( TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, context) ) * * def setConstraints(self, constraints, Vec C=None, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":239 * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * * def setHessian(self, hessian, Mat H=None, Mat P=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * cdef PetscMat Hmat=NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_43setHessian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_42setHessian[] = "TAO.setHessian(self, hessian, Mat H=None, Mat P=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_43setHessian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hessian = 0; struct PyPetscMatObject *__pyx_v_H = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setHessian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hessian,&__pyx_n_s_H,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); /* "PETSc/TAO.pyx":240 * * def setHessian(self, hessian, Mat H=None, Mat P=None, * args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Hmat=NULL * if H is not None: Hmat = H.mat */ values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hessian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setHessian") < 0)) __PYX_ERR(43, 239, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_hessian = values[0]; __pyx_v_H = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setHessian", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 239, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "H", 0))) __PYX_ERR(43, 239, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(43, 239, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_42setHessian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_hessian, __pyx_v_H, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "PETSc/TAO.pyx":239 * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * * def setHessian(self, hessian, Mat H=None, Mat P=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * cdef PetscMat Hmat=NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_42setHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Hmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setHessian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":241 * def setHessian(self, hessian, Mat H=None, Mat P=None, * args=None, kargs=None): * cdef PetscMat Hmat=NULL # <<<<<<<<<<<<<< * if H is not None: Hmat = H.mat * cdef PetscMat Pmat = Hmat */ __pyx_v_Hmat = NULL; /* "PETSc/TAO.pyx":242 * args=None, kargs=None): * cdef PetscMat Hmat=NULL * if H is not None: Hmat = H.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Hmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_H) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_H->mat; __pyx_v_Hmat = __pyx_t_3; } /* "PETSc/TAO.pyx":243 * cdef PetscMat Hmat=NULL * if H is not None: Hmat = H.mat * cdef PetscMat Pmat = Hmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if args is None: args = () */ __pyx_v_Pmat = __pyx_v_Hmat; /* "PETSc/TAO.pyx":244 * if H is not None: Hmat = H.mat * cdef PetscMat Pmat = Hmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/TAO.pyx":245 * cdef PetscMat Pmat = Hmat * if P is not None: Pmat = P.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (hessian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":246 * if P is not None: Pmat = P.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (hessian, args, kargs) * self.set_attr("__hessian__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":247 * if args is None: args = () * if kargs is None: kargs = {} * context = (hessian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__hessian__", context) * CHKERR( TaoSetHessianRoutine(self.tao, Hmat, Pmat, TAO_Hessian, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_hessian); __Pyx_GIVEREF(__pyx_v_hessian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_hessian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":248 * if kargs is None: kargs = {} * context = (hessian, args, kargs) * self.set_attr("__hessian__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetHessianRoutine(self.tao, Hmat, Pmat, TAO_Hessian, context) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__hessian__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":249 * context = (hessian, args, kargs) * self.set_attr("__hessian__", context) * CHKERR( TaoSetHessianRoutine(self.tao, Hmat, Pmat, TAO_Hessian, context) ) # <<<<<<<<<<<<<< * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetHessianRoutine(__pyx_v_self->tao, __pyx_v_Hmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_Hessian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 249, __pyx_L1_error) /* "PETSc/TAO.pyx":239 * CHKERR( TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, context) ) * * def setHessian(self, hessian, Mat H=None, Mat P=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * cdef PetscMat Hmat=NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":251 * CHKERR( TaoSetHessianRoutine(self.tao, Hmat, Pmat, TAO_Hessian, context) ) * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_45setJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_44setJacobian[] = "TAO.setJacobian(self, jacobian, Mat J=None, Mat P=None, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_45setJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[5] = {0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); /* "PETSc/TAO.pyx":252 * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, * args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setJacobian") < 0)) __PYX_ERR(43, 251, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_args = values[3]; __pyx_v_kargs = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobian", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 251, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(43, 251, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(43, 251, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_44setJacobian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs); /* "PETSc/TAO.pyx":251 * CHKERR( TaoSetHessianRoutine(self.tao, Hmat, Pmat, TAO_Hessian, context) ) * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_44setJacobian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":255 * """ * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat */ __pyx_v_Jmat = NULL; /* "PETSc/TAO.pyx":256 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TAO.pyx":257 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * if args is None: args = () */ __pyx_v_Pmat = __pyx_v_Jmat; /* "PETSc/TAO.pyx":258 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/TAO.pyx":259 * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":260 * if P is not None: Pmat = P.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr("__jacobian__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":261 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian__", context) * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":262 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr("__jacobian__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":263 * context = (jacobian, args, kargs) * self.set_attr("__jacobian__", context) * CHKERR( TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, context) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 263, __pyx_L1_error) /* "PETSc/TAO.pyx":251 * CHKERR( TaoSetHessianRoutine(self.tao, Hmat, Pmat, TAO_Hessian, context) ) * * def setJacobian(self, jacobian, Mat J=None, Mat P=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":267 * # * * def setStateDesignIS(self, IS state=None, IS design=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_47setStateDesignIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_46setStateDesignIS[] = "TAO.setStateDesignIS(self, IS state=None, IS design=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_47setStateDesignIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_state = 0; struct PyPetscISObject *__pyx_v_design = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStateDesignIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state,&__pyx_n_s_design,0}; PyObject* values[2] = {0,0}; values[0] = (PyObject *)((struct PyPetscISObject *)Py_None); values[1] = (PyObject *)((struct PyPetscISObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_design); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStateDesignIS") < 0)) __PYX_ERR(43, 267, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_state = ((struct PyPetscISObject *)values[0]); __pyx_v_design = ((struct PyPetscISObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStateDesignIS", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 267, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setStateDesignIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "state", 0))) __PYX_ERR(43, 267, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_design), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "design", 0))) __PYX_ERR(43, 267, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_46setStateDesignIS(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_state, __pyx_v_design); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_46setStateDesignIS(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_state, struct PyPetscISObject *__pyx_v_design) { IS __pyx_v_s_is; IS __pyx_v_d_is; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStateDesignIS", 0); /* "PETSc/TAO.pyx":270 * """ * """ * cdef PetscIS s_is = NULL, d_is = NULL # <<<<<<<<<<<<<< * if state is not None: s_is = state.iset * if design is not None: d_is = design.iset */ __pyx_v_s_is = NULL; __pyx_v_d_is = NULL; /* "PETSc/TAO.pyx":271 * """ * cdef PetscIS s_is = NULL, d_is = NULL * if state is not None: s_is = state.iset # <<<<<<<<<<<<<< * if design is not None: d_is = design.iset * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_state) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_state->iset; __pyx_v_s_is = __pyx_t_3; } /* "PETSc/TAO.pyx":272 * cdef PetscIS s_is = NULL, d_is = NULL * if state is not None: s_is = state.iset * if design is not None: d_is = design.iset # <<<<<<<<<<<<<< * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_design) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_design->iset; __pyx_v_d_is = __pyx_t_3; } /* "PETSc/TAO.pyx":273 * if state is not None: s_is = state.iset * if design is not None: d_is = design.iset * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) # <<<<<<<<<<<<<< * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetStateDesignIS(__pyx_v_self->tao, __pyx_v_s_is, __pyx_v_d_is)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 273, __pyx_L1_error) /* "PETSc/TAO.pyx":267 * # * * def setStateDesignIS(self, IS state=None, IS design=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setStateDesignIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":275 * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_49setJacobianState(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_48setJacobianState[] = "TAO.setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_49setJacobianState(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian_state = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; struct PyPetscMatObject *__pyx_v_I = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobianState (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian_state,&__pyx_n_s_J,&__pyx_n_s_P,&__pyx_n_s_I,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[3] = (PyObject *)((struct PyPetscMatObject *)Py_None); /* "PETSc/TAO.pyx":276 * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, * args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian_state)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_I); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setJacobianState") < 0)) __PYX_ERR(43, 275, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian_state = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); __pyx_v_I = ((struct PyPetscMatObject *)values[3]); __pyx_v_args = values[4]; __pyx_v_kargs = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobianState", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 275, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianState", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(43, 275, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(43, 275, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_I), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "I", 0))) __PYX_ERR(43, 275, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_48setJacobianState(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian_state, __pyx_v_J, __pyx_v_P, __pyx_v_I, __pyx_v_args, __pyx_v_kargs); /* "PETSc/TAO.pyx":275 * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_48setJacobianState(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_state, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, struct PyPetscMatObject *__pyx_v_I, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; Mat __pyx_v_Pmat; Mat __pyx_v_Imat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobianState", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":279 * """ * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat */ __pyx_v_Jmat = NULL; /* "PETSc/TAO.pyx":280 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TAO.pyx":281 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat # <<<<<<<<<<<<<< * if P is not None: Pmat = P.mat * cdef PetscMat Imat = NULL */ __pyx_v_Pmat = __pyx_v_Jmat; /* "PETSc/TAO.pyx":282 * if J is not None: Jmat = J.mat * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat # <<<<<<<<<<<<<< * cdef PetscMat Imat = NULL * if I is not None: Imat = I.mat */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_v_P->mat; __pyx_v_Pmat = __pyx_t_3; } /* "PETSc/TAO.pyx":283 * cdef PetscMat Pmat = Jmat * if P is not None: Pmat = P.mat * cdef PetscMat Imat = NULL # <<<<<<<<<<<<<< * if I is not None: Imat = I.mat * if args is None: args = () */ __pyx_v_Imat = NULL; /* "PETSc/TAO.pyx":284 * if P is not None: Pmat = P.mat * cdef PetscMat Imat = NULL * if I is not None: Imat = I.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_I) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_I->mat; __pyx_v_Imat = __pyx_t_3; } /* "PETSc/TAO.pyx":285 * cdef PetscMat Imat = NULL * if I is not None: Imat = I.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian_state, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":286 * if I is not None: Imat = I.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian_state, args, kargs) * self.set_attr("__jacobian_state__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":287 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian_state, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian_state__", context) * CHKERR( TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat, */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian_state); __Pyx_GIVEREF(__pyx_v_jacobian_state); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian_state); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":288 * if kargs is None: kargs = {} * context = (jacobian_state, args, kargs) * self.set_attr("__jacobian_state__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat, * TAO_JacobianState, context) ) */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian_state__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":289 * context = (jacobian_state, args, kargs) * self.set_attr("__jacobian_state__", context) * CHKERR( TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat, # <<<<<<<<<<<<<< * TAO_JacobianState, context) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianStateRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_v_Imat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianState, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 289, __pyx_L1_error) /* "PETSc/TAO.pyx":275 * CHKERR( TaoSetStateDesignIS(self.tao, s_is, d_is) ) * * def setJacobianState(self, jacobian_state, Mat J=None, Mat P=None, Mat I=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianState", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":292 * TAO_JacobianState, context) ) * * def setJacobianDesign(self, jacobian_design, Mat J=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_51setJacobianDesign(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_50setJacobianDesign[] = "TAO.setJacobianDesign(self, jacobian_design, Mat J=None, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_51setJacobianDesign(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian_design = 0; struct PyPetscMatObject *__pyx_v_J = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setJacobianDesign (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian_design,&__pyx_n_s_J,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); /* "PETSc/TAO.pyx":293 * * def setJacobianDesign(self, jacobian_design, Mat J=None, * args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian_design)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setJacobianDesign") < 0)) __PYX_ERR(43, 292, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian_design = values[0]; __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setJacobianDesign", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 292, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianDesign", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(43, 292, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_50setJacobianDesign(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian_design, __pyx_v_J, __pyx_v_args, __pyx_v_kargs); /* "PETSc/TAO.pyx":292 * TAO_JacobianState, context) ) * * def setJacobianDesign(self, jacobian_design, Mat J=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_50setJacobianDesign(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_design, struct PyPetscMatObject *__pyx_v_J, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Jmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setJacobianDesign", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":296 * """ * """ * cdef PetscMat Jmat=NULL # <<<<<<<<<<<<<< * if J is not None: Jmat = J.mat * if args is None: args = () */ __pyx_v_Jmat = NULL; /* "PETSc/TAO.pyx":297 * """ * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_J) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_J->mat; __pyx_v_Jmat = __pyx_t_3; } /* "PETSc/TAO.pyx":298 * cdef PetscMat Jmat=NULL * if J is not None: Jmat = J.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian_design, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":299 * if J is not None: Jmat = J.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian_design, args, kargs) * self.set_attr("__jacobian_design__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":300 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian_design, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__jacobian_design__", context) * CHKERR( TaoSetJacobianDesignRoutine(self.tao, Jmat, */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_jacobian_design); __Pyx_GIVEREF(__pyx_v_jacobian_design); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_jacobian_design); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":301 * if kargs is None: kargs = {} * context = (jacobian_design, args, kargs) * self.set_attr("__jacobian_design__", context) # <<<<<<<<<<<<<< * CHKERR( TaoSetJacobianDesignRoutine(self.tao, Jmat, * TAO_JacobianDesign, context) ) */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian_design__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":302 * context = (jacobian_design, args, kargs) * self.set_attr("__jacobian_design__", context) * CHKERR( TaoSetJacobianDesignRoutine(self.tao, Jmat, # <<<<<<<<<<<<<< * TAO_JacobianDesign, context) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianDesignRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianDesign, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 302, __pyx_L1_error) /* "PETSc/TAO.pyx":292 * TAO_JacobianState, context) ) * * def setJacobianDesign(self, jacobian_design, Mat J=None, # <<<<<<<<<<<<<< * args=None, kargs=None): * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianDesign", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":307 * # -------------- * * def computeObjective(self, Vec x): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_53computeObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_52computeObjective[] = "TAO.computeObjective(self, Vec x)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_53computeObjective(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeObjective (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeObjective") < 0)) __PYX_ERR(43, 307, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeObjective", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 307, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 307, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_52computeObjective(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_52computeObjective(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PetscReal __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeObjective", 0); /* "PETSc/TAO.pyx":310 * """ * """ * cdef PetscReal f = 0 # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjective(self.tao, x.vec, &f) ) * return toReal(f) */ __pyx_v_f = 0.0; /* "PETSc/TAO.pyx":311 * """ * cdef PetscReal f = 0 * CHKERR( TaoComputeObjective(self.tao, x.vec, &f) ) # <<<<<<<<<<<<<< * return toReal(f) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjective(__pyx_v_self->tao, __pyx_v_x->vec, (&__pyx_v_f))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 311, __pyx_L1_error) /* "PETSc/TAO.pyx":312 * cdef PetscReal f = 0 * CHKERR( TaoComputeObjective(self.tao, x.vec, &f) ) * return toReal(f) # <<<<<<<<<<<<<< * * def computeResidual(self, Vec x, Vec f): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":307 * # -------------- * * def computeObjective(self, Vec x): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjective", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":314 * return toReal(f) * * def computeResidual(self, Vec x, Vec f): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_55computeResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_54computeResidual[] = "TAO.computeResidual(self, Vec x, Vec f)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_55computeResidual(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_f = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeResidual (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_f,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeResidual", 1, 2, 2, 1); __PYX_ERR(43, 314, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeResidual") < 0)) __PYX_ERR(43, 314, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_f = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeResidual", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 314, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 314, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(43, 314, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_54computeResidual(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_54computeResidual(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeResidual", 0); /* "PETSc/TAO.pyx":317 * """ * """ * CHKERR( TaoComputeResidual(self.tao, x.vec, f.vec) ) # <<<<<<<<<<<<<< * * def computeGradient(self, Vec x, Vec g): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeResidual(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_f->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 317, __pyx_L1_error) /* "PETSc/TAO.pyx":314 * return toReal(f) * * def computeResidual(self, Vec x, Vec f): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeResidual", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":319 * CHKERR( TaoComputeResidual(self.tao, x.vec, f.vec) ) * * def computeGradient(self, Vec x, Vec g): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_57computeGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_56computeGradient[] = "TAO.computeGradient(self, Vec x, Vec g)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_57computeGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeGradient (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_g,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeGradient", 1, 2, 2, 1); __PYX_ERR(43, 319, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeGradient") < 0)) __PYX_ERR(43, 319, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_g = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeGradient", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 319, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 319, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(43, 319, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_56computeGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_g); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_56computeGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeGradient", 0); /* "PETSc/TAO.pyx":322 * """ * """ * CHKERR( TaoComputeGradient(self.tao, x.vec, g.vec) ) # <<<<<<<<<<<<<< * * def computeObjectiveGradient(self, Vec x, Vec g): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeGradient(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_g->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 322, __pyx_L1_error) /* "PETSc/TAO.pyx":319 * CHKERR( TaoComputeResidual(self.tao, x.vec, f.vec) ) * * def computeGradient(self, Vec x, Vec g): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":324 * CHKERR( TaoComputeGradient(self.tao, x.vec, g.vec) ) * * def computeObjectiveGradient(self, Vec x, Vec g): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_59computeObjectiveGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_58computeObjectiveGradient[] = "TAO.computeObjectiveGradient(self, Vec x, Vec g)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_59computeObjectiveGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_g = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeObjectiveGradient (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_g,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeObjectiveGradient", 1, 2, 2, 1); __PYX_ERR(43, 324, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeObjectiveGradient") < 0)) __PYX_ERR(43, 324, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_g = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeObjectiveGradient", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 324, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 324, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(43, 324, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_58computeObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_g); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_58computeObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g) { PetscReal __pyx_v_f; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeObjectiveGradient", 0); /* "PETSc/TAO.pyx":327 * """ * """ * cdef PetscReal f = 0 # <<<<<<<<<<<<<< * CHKERR( TaoComputeObjectiveAndGradient(self.tao, x.vec, &f, g.vec) ) * return toReal(f) */ __pyx_v_f = 0.0; /* "PETSc/TAO.pyx":328 * """ * cdef PetscReal f = 0 * CHKERR( TaoComputeObjectiveAndGradient(self.tao, x.vec, &f, g.vec) ) # <<<<<<<<<<<<<< * return toReal(f) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeObjectiveAndGradient(__pyx_v_self->tao, __pyx_v_x->vec, (&__pyx_v_f), __pyx_v_g->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 328, __pyx_L1_error) /* "PETSc/TAO.pyx":329 * cdef PetscReal f = 0 * CHKERR( TaoComputeObjectiveAndGradient(self.tao, x.vec, &f, g.vec) ) * return toReal(f) # <<<<<<<<<<<<<< * * def computeDualVariables(self, Vec xl, Vec xu): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":324 * CHKERR( TaoComputeGradient(self.tao, x.vec, g.vec) ) * * def computeObjectiveGradient(self, Vec x, Vec g): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":331 * return toReal(f) * * def computeDualVariables(self, Vec xl, Vec xu): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_61computeDualVariables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_60computeDualVariables[] = "TAO.computeDualVariables(self, Vec xl, Vec xu)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_61computeDualVariables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeDualVariables (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xl,&__pyx_n_s_xu,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xu)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeDualVariables", 1, 2, 2, 1); __PYX_ERR(43, 331, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeDualVariables") < 0)) __PYX_ERR(43, 331, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_xl = ((struct PyPetscVecObject *)values[0]); __pyx_v_xu = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeDualVariables", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 331, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeDualVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(43, 331, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(43, 331, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_60computeDualVariables(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_60computeDualVariables(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeDualVariables", 0); /* "PETSc/TAO.pyx":334 * """ * """ * CHKERR( TaoComputeDualVariables(self.tao, xl.vec, xu.vec) ) # <<<<<<<<<<<<<< * * def computeVariableBounds(self, Vec xl, Vec xu): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeDualVariables(__pyx_v_self->tao, __pyx_v_xl->vec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 334, __pyx_L1_error) /* "PETSc/TAO.pyx":331 * return toReal(f) * * def computeDualVariables(self, Vec xl, Vec xu): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeDualVariables", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":336 * CHKERR( TaoComputeDualVariables(self.tao, xl.vec, xu.vec) ) * * def computeVariableBounds(self, Vec xl, Vec xu): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_63computeVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_62computeVariableBounds[] = "TAO.computeVariableBounds(self, Vec xl, Vec xu)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_63computeVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeVariableBounds (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xl,&__pyx_n_s_xu,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xu)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeVariableBounds", 1, 2, 2, 1); __PYX_ERR(43, 336, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeVariableBounds") < 0)) __PYX_ERR(43, 336, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_xl = ((struct PyPetscVecObject *)values[0]); __pyx_v_xu = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeVariableBounds", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 336, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(43, 336, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(43, 336, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_62computeVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_62computeVariableBounds(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu) { Vec __pyx_v_Lvec; Vec __pyx_v_Uvec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeVariableBounds", 0); /* "PETSc/TAO.pyx":339 * """ * """ * CHKERR( TaoComputeVariableBounds(self.tao) ) # <<<<<<<<<<<<<< * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeVariableBounds(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 339, __pyx_L1_error) /* "PETSc/TAO.pyx":340 * """ * CHKERR( TaoComputeVariableBounds(self.tao) ) * cdef PetscVec Lvec = NULL, Uvec = NULL # <<<<<<<<<<<<<< * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: */ __pyx_v_Lvec = NULL; __pyx_v_Uvec = NULL; /* "PETSc/TAO.pyx":341 * CHKERR( TaoComputeVariableBounds(self.tao) ) * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) # <<<<<<<<<<<<<< * if xl.vec != NULL: * if Lvec != NULL: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetVariableBounds(__pyx_v_self->tao, (&__pyx_v_Lvec), (&__pyx_v_Uvec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 341, __pyx_L1_error) /* "PETSc/TAO.pyx":342 * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: # <<<<<<<<<<<<<< * if Lvec != NULL: * CHKERR( VecCopy(Lvec, xl.vec) ) */ __pyx_t_2 = ((__pyx_v_xl->vec != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":343 * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: * if Lvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Lvec, xl.vec) ) * else: */ __pyx_t_2 = ((__pyx_v_Lvec != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":344 * if xl.vec != NULL: * if Lvec != NULL: * CHKERR( VecCopy(Lvec, xl.vec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_Lvec, __pyx_v_xl->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 344, __pyx_L1_error) /* "PETSc/TAO.pyx":343 * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: * if Lvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Lvec, xl.vec) ) * else: */ goto __pyx_L4; } /* "PETSc/TAO.pyx":346 * CHKERR( VecCopy(Lvec, xl.vec) ) * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) # <<<<<<<<<<<<<< * if xu.vec != NULL: * if Uvec != NULL: */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSet(__pyx_v_xl->vec, ((PetscScalar)PETSC_NINFINITY))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 346, __pyx_L1_error) } __pyx_L4:; /* "PETSc/TAO.pyx":342 * cdef PetscVec Lvec = NULL, Uvec = NULL * CHKERR( TaoGetVariableBounds(self.tao, &Lvec, &Uvec) ) * if xl.vec != NULL: # <<<<<<<<<<<<<< * if Lvec != NULL: * CHKERR( VecCopy(Lvec, xl.vec) ) */ } /* "PETSc/TAO.pyx":347 * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: # <<<<<<<<<<<<<< * if Uvec != NULL: * CHKERR( VecCopy(Uvec, xu.vec) ) */ __pyx_t_2 = ((__pyx_v_xu->vec != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":348 * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: * if Uvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Uvec, xu.vec) ) * else: */ __pyx_t_2 = ((__pyx_v_Uvec != NULL) != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":349 * if xu.vec != NULL: * if Uvec != NULL: * CHKERR( VecCopy(Uvec, xu.vec) ) # <<<<<<<<<<<<<< * else: * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCopy(__pyx_v_Uvec, __pyx_v_xu->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 349, __pyx_L1_error) /* "PETSc/TAO.pyx":348 * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: * if Uvec != NULL: # <<<<<<<<<<<<<< * CHKERR( VecCopy(Uvec, xu.vec) ) * else: */ goto __pyx_L6; } /* "PETSc/TAO.pyx":351 * CHKERR( VecCopy(Uvec, xu.vec) ) * else: * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) # <<<<<<<<<<<<<< * * def computeConstraints(self, Vec x, Vec c): */ /*else*/ { __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSet(__pyx_v_xu->vec, ((PetscScalar)PETSC_INFINITY))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 351, __pyx_L1_error) } __pyx_L6:; /* "PETSc/TAO.pyx":347 * else: * CHKERR( VecSet(xl.vec, PETSC_NINFINITY) ) * if xu.vec != NULL: # <<<<<<<<<<<<<< * if Uvec != NULL: * CHKERR( VecCopy(Uvec, xu.vec) ) */ } /* "PETSc/TAO.pyx":336 * CHKERR( TaoComputeDualVariables(self.tao, xl.vec, xu.vec) ) * * def computeVariableBounds(self, Vec xl, Vec xu): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":353 * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) * * def computeConstraints(self, Vec x, Vec c): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_65computeConstraints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_64computeConstraints[] = "TAO.computeConstraints(self, Vec x, Vec c)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_65computeConstraints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscVecObject *__pyx_v_c = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeConstraints (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_c,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeConstraints", 1, 2, 2, 1); __PYX_ERR(43, 353, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeConstraints") < 0)) __PYX_ERR(43, 353, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_c = ((struct PyPetscVecObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeConstraints", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 353, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 353, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(43, 353, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_64computeConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_64computeConstraints(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_c) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeConstraints", 0); /* "PETSc/TAO.pyx":356 * """ * """ * CHKERR( TaoComputeConstraints(self.tao, x.vec, c.vec) ) # <<<<<<<<<<<<<< * * def computeHessian(self, Vec x, Mat H, Mat P=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeConstraints(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 356, __pyx_L1_error) /* "PETSc/TAO.pyx":353 * CHKERR( VecSet(xu.vec, PETSC_INFINITY) ) * * def computeConstraints(self, Vec x, Vec c): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":358 * CHKERR( TaoComputeConstraints(self.tao, x.vec, c.vec) ) * * def computeHessian(self, Vec x, Mat H, Mat P=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_67computeHessian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_66computeHessian[] = "TAO.computeHessian(self, Vec x, Mat H, Mat P=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_67computeHessian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_H = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeHessian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_H,&__pyx_n_s_P,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeHessian", 0, 2, 3, 1); __PYX_ERR(43, 358, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeHessian") < 0)) __PYX_ERR(43, 358, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_H = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeHessian", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 358, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 358, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "H", 0))) __PYX_ERR(43, 358, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(43, 358, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_66computeHessian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_H, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_66computeHessian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_H, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_hmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeHessian", 0); /* "PETSc/TAO.pyx":361 * """ * """ * cdef PetscMat hmat = H.mat, pmat = H.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) */ __pyx_t_1 = __pyx_v_H->mat; __pyx_v_hmat = __pyx_t_1; __pyx_t_1 = __pyx_v_H->mat; __pyx_v_pmat = __pyx_t_1; /* "PETSc/TAO.pyx":362 * """ * cdef PetscMat hmat = H.mat, pmat = H.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_1; } /* "PETSc/TAO.pyx":363 * cdef PetscMat hmat = H.mat, pmat = H.mat * if P is not None: pmat = P.mat * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) # <<<<<<<<<<<<<< * * def computeJacobian(self, Vec x, Mat J, Mat P=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeHessian(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_hmat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 363, __pyx_L1_error) /* "PETSc/TAO.pyx":358 * CHKERR( TaoComputeConstraints(self.tao, x.vec, c.vec) ) * * def computeHessian(self, Vec x, Mat H, Mat P=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":365 * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_69computeJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_68computeJacobian[] = "TAO.computeJacobian(self, Vec x, Mat J, Mat P=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_69computeJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; struct PyPetscMatObject *__pyx_v_J = 0; struct PyPetscMatObject *__pyx_v_P = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_J,&__pyx_n_s_P,0}; PyObject* values[3] = {0,0,0}; values[2] = (PyObject *)((struct PyPetscMatObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_J)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, 1); __PYX_ERR(43, 365, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeJacobian") < 0)) __PYX_ERR(43, 365, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); __pyx_v_J = ((struct PyPetscMatObject *)values[1]); __pyx_v_P = ((struct PyPetscMatObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 365, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(43, 365, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(43, 365, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(43, 365, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_68computeJacobian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_J, __pyx_v_P); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_68computeJacobian(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P) { Mat __pyx_v_jmat; Mat __pyx_v_pmat; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Mat __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeJacobian", 0); /* "PETSc/TAO.pyx":368 * """ * """ * cdef PetscMat jmat = J.mat, pmat = J.mat # <<<<<<<<<<<<<< * if P is not None: pmat = P.mat * CHKERR( TaoComputeJacobian(self.tao, x.vec, jmat, pmat) ) */ __pyx_t_1 = __pyx_v_J->mat; __pyx_v_jmat = __pyx_t_1; __pyx_t_1 = __pyx_v_J->mat; __pyx_v_pmat = __pyx_t_1; /* "PETSc/TAO.pyx":369 * """ * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat # <<<<<<<<<<<<<< * CHKERR( TaoComputeJacobian(self.tao, x.vec, jmat, pmat) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_P) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_t_1 = __pyx_v_P->mat; __pyx_v_pmat = __pyx_t_1; } /* "PETSc/TAO.pyx":370 * cdef PetscMat jmat = J.mat, pmat = J.mat * if P is not None: pmat = P.mat * CHKERR( TaoComputeJacobian(self.tao, x.vec, jmat, pmat) ) # <<<<<<<<<<<<<< * * # -------------- */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeJacobian(__pyx_v_self->tao, __pyx_v_x->vec, __pyx_v_jmat, __pyx_v_pmat)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 370, __pyx_L1_error) /* "PETSc/TAO.pyx":365 * CHKERR( TaoComputeHessian(self.tao, x.vec, hmat, pmat) ) * * def computeJacobian(self, Vec x, Mat J, Mat P=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.computeJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":376 * # * * def setTolerances(self, gatol=None, grtol=None, gttol=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_71setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_70setTolerances[] = "TAO.setTolerances(self, gatol=None, grtol=None, gttol=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_71setTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_gatol = 0; PyObject *__pyx_v_grtol = 0; PyObject *__pyx_v_gttol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTolerances (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gatol,&__pyx_n_s_grtol,&__pyx_n_s_gttol,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gatol); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grtol); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gttol); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTolerances") < 0)) __PYX_ERR(43, 376, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gatol = values[0]; __pyx_v_grtol = values[1]; __pyx_v_gttol = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 376, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_70setTolerances(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_gatol, __pyx_v_grtol, __pyx_v_gttol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_70setTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_gatol, PyObject *__pyx_v_grtol, PyObject *__pyx_v_gttol) { PetscReal __pyx_v__gatol; PetscReal __pyx_v__grtol; PetscReal __pyx_v__gttol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTolerances", 0); /* "PETSc/TAO.pyx":379 * """ * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT # <<<<<<<<<<<<<< * if gatol is not None: _gatol = asReal(gatol) * if grtol is not None: _grtol = asReal(grtol) */ __pyx_v__gatol = PETSC_DEFAULT; __pyx_v__grtol = PETSC_DEFAULT; __pyx_v__gttol = PETSC_DEFAULT; /* "PETSc/TAO.pyx":380 * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * if gatol is not None: _gatol = asReal(gatol) # <<<<<<<<<<<<<< * if grtol is not None: _grtol = asReal(grtol) * if gttol is not None: _gttol = asReal(gttol) */ __pyx_t_1 = (__pyx_v_gatol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gatol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 380, __pyx_L1_error) __pyx_v__gatol = __pyx_t_3; } /* "PETSc/TAO.pyx":381 * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * if gatol is not None: _gatol = asReal(gatol) * if grtol is not None: _grtol = asReal(grtol) # <<<<<<<<<<<<<< * if gttol is not None: _gttol = asReal(gttol) * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) */ __pyx_t_2 = (__pyx_v_grtol != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_grtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 381, __pyx_L1_error) __pyx_v__grtol = __pyx_t_3; } /* "PETSc/TAO.pyx":382 * if gatol is not None: _gatol = asReal(gatol) * if grtol is not None: _grtol = asReal(grtol) * if gttol is not None: _gttol = asReal(gttol) # <<<<<<<<<<<<<< * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) * */ __pyx_t_1 = (__pyx_v_gttol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_gttol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 382, __pyx_L1_error) __pyx_v__gttol = __pyx_t_3; } /* "PETSc/TAO.pyx":383 * if grtol is not None: _grtol = asReal(grtol) * if gttol is not None: _gttol = asReal(gttol) * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) # <<<<<<<<<<<<<< * * def getTolerances(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetTolerances(__pyx_v_self->tao, __pyx_v__gatol, __pyx_v__grtol, __pyx_v__gttol)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 383, __pyx_L1_error) /* "PETSc/TAO.pyx":376 * # * * def setTolerances(self, gatol=None, grtol=None, gttol=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":385 * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_73getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_72getTolerances[] = "TAO.getTolerances(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_73getTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTolerances (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTolerances", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_72getTolerances(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_72getTolerances(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v__gatol; PetscReal __pyx_v__grtol; PetscReal __pyx_v__gttol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTolerances", 0); /* "PETSc/TAO.pyx":388 * """ * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT # <<<<<<<<<<<<<< * CHKERR( TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol) ) * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) */ __pyx_v__gatol = PETSC_DEFAULT; __pyx_v__grtol = PETSC_DEFAULT; __pyx_v__gttol = PETSC_DEFAULT; /* "PETSc/TAO.pyx":389 * """ * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * CHKERR( TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol) ) # <<<<<<<<<<<<<< * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetTolerances(__pyx_v_self->tao, (&__pyx_v__gatol), (&__pyx_v__grtol), (&__pyx_v__gttol))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 389, __pyx_L1_error) /* "PETSc/TAO.pyx":390 * cdef PetscReal _gatol=PETSC_DEFAULT, _grtol=PETSC_DEFAULT, _gttol=PETSC_DEFAULT * CHKERR( TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol) ) * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) # <<<<<<<<<<<<<< * * def setConstraintTolerances(self, catol=None, crtol=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__gatol); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__grtol); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__gttol); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":385 * CHKERR( TaoSetTolerances(self.tao, _gatol, _grtol, _gttol) ) * * def getTolerances(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":392 * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) * * def setConstraintTolerances(self, catol=None, crtol=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_75setConstraintTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_74setConstraintTolerances[] = "TAO.setConstraintTolerances(self, catol=None, crtol=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_75setConstraintTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_catol = 0; PyObject *__pyx_v_crtol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConstraintTolerances (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_catol,&__pyx_n_s_crtol,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_catol); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_crtol); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConstraintTolerances") < 0)) __PYX_ERR(43, 392, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_catol = values[0]; __pyx_v_crtol = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConstraintTolerances", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 392, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraintTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_74setConstraintTolerances(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_catol, __pyx_v_crtol); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_74setConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_catol, PyObject *__pyx_v_crtol) { PetscReal __pyx_v__catol; PetscReal __pyx_v__crtol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConstraintTolerances", 0); /* "PETSc/TAO.pyx":395 * """ * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT # <<<<<<<<<<<<<< * if catol is not None: _catol = asReal(catol) * if crtol is not None: _crtol = asReal(crtol) */ __pyx_v__catol = PETSC_DEFAULT; __pyx_v__crtol = PETSC_DEFAULT; /* "PETSc/TAO.pyx":396 * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * if catol is not None: _catol = asReal(catol) # <<<<<<<<<<<<<< * if crtol is not None: _crtol = asReal(crtol) * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) */ __pyx_t_1 = (__pyx_v_catol != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_catol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 396, __pyx_L1_error) __pyx_v__catol = __pyx_t_3; } /* "PETSc/TAO.pyx":397 * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * if catol is not None: _catol = asReal(catol) * if crtol is not None: _crtol = asReal(crtol) # <<<<<<<<<<<<<< * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) * */ __pyx_t_2 = (__pyx_v_crtol != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_crtol); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 397, __pyx_L1_error) __pyx_v__crtol = __pyx_t_3; } /* "PETSc/TAO.pyx":398 * if catol is not None: _catol = asReal(catol) * if crtol is not None: _crtol = asReal(crtol) * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) # <<<<<<<<<<<<<< * * def getConstraintTolerances(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConstraintTolerances(__pyx_v_self->tao, __pyx_v__catol, __pyx_v__crtol)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 398, __pyx_L1_error) /* "PETSc/TAO.pyx":392 * return (toReal(_gatol), toReal(_grtol), toReal(_gttol)) * * def setConstraintTolerances(self, catol=None, crtol=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConstraintTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":400 * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) * * def getConstraintTolerances(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_77getConstraintTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_76getConstraintTolerances[] = "TAO.getConstraintTolerances(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_77getConstraintTolerances(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConstraintTolerances (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConstraintTolerances", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConstraintTolerances", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_76getConstraintTolerances(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_76getConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v__catol; PetscReal __pyx_v__crtol; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConstraintTolerances", 0); /* "PETSc/TAO.pyx":403 * """ * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT # <<<<<<<<<<<<<< * CHKERR( TaoGetConstraintTolerances(self.tao, &_catol, &_crtol) ) * return (toReal(_catol), toReal(_crtol)) */ __pyx_v__catol = PETSC_DEFAULT; __pyx_v__crtol = PETSC_DEFAULT; /* "PETSc/TAO.pyx":404 * """ * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * CHKERR( TaoGetConstraintTolerances(self.tao, &_catol, &_crtol) ) # <<<<<<<<<<<<<< * return (toReal(_catol), toReal(_crtol)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetConstraintTolerances(__pyx_v_self->tao, (&__pyx_v__catol), (&__pyx_v__crtol))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 404, __pyx_L1_error) /* "PETSc/TAO.pyx":405 * cdef PetscReal _catol=PETSC_DEFAULT, _crtol=PETSC_DEFAULT * CHKERR( TaoGetConstraintTolerances(self.tao, &_catol, &_crtol) ) * return (toReal(_catol), toReal(_crtol)) # <<<<<<<<<<<<<< * * def setConvergenceTest(self, converged, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__catol); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__crtol); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":400 * CHKERR( TaoSetConstraintTolerances(self.tao, _catol, _crtol) ) * * def getConstraintTolerances(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConstraintTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":407 * return (toReal(_catol), toReal(_crtol)) * * def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_79setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_78setConvergenceTest[] = "TAO.setConvergenceTest(self, converged, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_79setConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_converged = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergenceTest (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_converged,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_converged)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergenceTest") < 0)) __PYX_ERR(43, 407, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_converged = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 407, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_78setConvergenceTest(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_78setConvergenceTest(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergenceTest", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":410 * """ * """ * if converged is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) * self.set_attr('__converged__', None) */ __pyx_t_1 = (__pyx_v_converged == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":411 * """ * if converged is None: * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) # <<<<<<<<<<<<<< * self.set_attr('__converged__', None) * else: */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergenceTest(__pyx_v_self->tao, TaoDefaultConvergenceTest, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(43, 411, __pyx_L1_error) /* "PETSc/TAO.pyx":412 * if converged is None: * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) * self.set_attr('__converged__', None) # <<<<<<<<<<<<<< * else: * if args is None: args = () */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":410 * """ * """ * if converged is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL) ) * self.set_attr('__converged__', None) */ goto __pyx_L3; } /* "PETSc/TAO.pyx":414 * self.set_attr('__converged__', None) * else: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) */ /*else*/ { __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":415 * else: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__converged__', (converged, args, kargs)) * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":416 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) * */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_converged); __Pyx_GIVEREF(__pyx_v_converged); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_converged); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_t_5 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__"), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/TAO.pyx":417 * if kargs is None: kargs = {} * self.set_attr('__converged__', (converged, args, kargs)) * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) # <<<<<<<<<<<<<< * * def getConvergenceTest(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergenceTest(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Converged, NULL)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(43, 417, __pyx_L1_error) } __pyx_L3:; /* "PETSc/TAO.pyx":407 * return (toReal(_catol), toReal(_crtol)) * * def setConvergenceTest(self, converged, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":419 * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) * * def getConvergenceTest(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_81getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_80getConvergenceTest[] = "TAO.getConvergenceTest(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_81getConvergenceTest(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergenceTest (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergenceTest", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergenceTest", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_80getConvergenceTest(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_80getConvergenceTest(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergenceTest", 0); /* "PETSc/TAO.pyx":422 * """ * """ * return self.get_attr('__converged__') # <<<<<<<<<<<<<< * * def setConvergedReason(self, reason): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__converged__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":419 * CHKERR( TaoSetConvergenceTest(self.tao, TAO_Converged, NULL) ) * * def getConvergenceTest(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":424 * return self.get_attr('__converged__') * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_83setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_82setConvergedReason[] = "TAO.setConvergedReason(self, reason)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_83setConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_reason = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConvergedReason (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reason,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConvergedReason") < 0)) __PYX_ERR(43, 424, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_reason = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 424, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_82setConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_reason); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_82setConvergedReason(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_reason) { TaoConvergedReason __pyx_v_creason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations TaoConvergedReason __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConvergedReason", 0); /* "PETSc/TAO.pyx":427 * """ * """ * cdef PetscTAOConvergedReason creason = reason # <<<<<<<<<<<<<< * CHKERR( TaoSetConvergedReason(self.tao, creason) ) * */ __pyx_t_1 = ((TaoConvergedReason)__Pyx_PyInt_As_TaoConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 427, __pyx_L1_error) __pyx_v_creason = __pyx_t_1; /* "PETSc/TAO.pyx":428 * """ * cdef PetscTAOConvergedReason creason = reason * CHKERR( TaoSetConvergedReason(self.tao, creason) ) # <<<<<<<<<<<<<< * * def getConvergedReason(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetConvergedReason(__pyx_v_self->tao, __pyx_v_creason)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 428, __pyx_L1_error) /* "PETSc/TAO.pyx":424 * return self.get_attr('__converged__') * * def setConvergedReason(self, reason): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":430 * CHKERR( TaoSetConvergedReason(self.tao, creason) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_85getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_84getConvergedReason[] = "TAO.getConvergedReason(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_85getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_84getConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_84getConvergedReason(struct PyPetscTAOObject *__pyx_v_self) { TaoConvergedReason __pyx_v_creason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 0); /* "PETSc/TAO.pyx":433 * """ * """ * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * CHKERR( TaoGetConvergedReason(self.tao, &creason) ) * return creason */ __pyx_v_creason = TAO_CONTINUE_ITERATING; /* "PETSc/TAO.pyx":434 * """ * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &creason) ) # <<<<<<<<<<<<<< * return creason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetConvergedReason(__pyx_v_self->tao, (&__pyx_v_creason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 434, __pyx_L1_error) /* "PETSc/TAO.pyx":435 * cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &creason) ) * return creason # <<<<<<<<<<<<<< * * def setMonitor(self, monitor, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TaoConvergedReason(__pyx_v_creason); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":430 * CHKERR( TaoSetConvergedReason(self.tao, creason) ) * * def getConvergedReason(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":437 * return creason * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_87setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_86setMonitor[] = "TAO.setMonitor(self, monitor, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_87setMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_monitor = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMonitor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_monitor,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_monitor)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMonitor") < 0)) __PYX_ERR(43, 437, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_monitor = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 437, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_86setMonitor(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_86setMonitor(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_monitor, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_monitorlist = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMonitor", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":440 * """ * """ * if monitor is None: return # <<<<<<<<<<<<<< * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: */ __pyx_t_1 = (__pyx_v_monitor == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } /* "PETSc/TAO.pyx":441 * """ * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') # <<<<<<<<<<<<<< * if monitorlist is None: * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_monitorlist = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/TAO.pyx":442 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) * if args is None: args = () */ __pyx_t_2 = (__pyx_v_monitorlist == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/TAO.pyx":443 * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetMonitor(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Monitor, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 443, __pyx_L1_error) /* "PETSc/TAO.pyx":444 * if monitorlist is None: * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * self.set_attr('__monitor__', [(monitor, args, kargs)]) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":445 * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * self.set_attr('__monitor__', [(monitor, args, kargs)]) * else: */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TAO.pyx":446 * if args is None: args = () * if kargs is None: kargs = {} * self.set_attr('__monitor__', [(monitor, args, kargs)]) # <<<<<<<<<<<<<< * else: * monitorlist.append((monitor, args, kargs)) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_monitor); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":442 * if monitor is None: return * cdef object monitorlist = self.get_attr('__monitor__') * if monitorlist is None: # <<<<<<<<<<<<<< * CHKERR( TaoSetMonitor(self.tao, TAO_Monitor, NULL, NULL) ) * if args is None: args = () */ goto __pyx_L4; } /* "PETSc/TAO.pyx":448 * self.set_attr('__monitor__', [(monitor, args, kargs)]) * else: * monitorlist.append((monitor, args, kargs)) # <<<<<<<<<<<<<< * * def getMonitor(self): */ /*else*/ { __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_monitor); __Pyx_GIVEREF(__pyx_v_monitor); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_monitor); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_monitorlist, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(43, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; /* "PETSc/TAO.pyx":437 * return creason * * def setMonitor(self, monitor, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_monitorlist); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":450 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_89getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_88getMonitor[] = "TAO.getMonitor(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_89getMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_88getMonitor(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_88getMonitor(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMonitor", 0); /* "PETSc/TAO.pyx":453 * """ * """ * return self.get_attr('__monitor__') # <<<<<<<<<<<<<< * * def cancelMonitor(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":450 * monitorlist.append((monitor, args, kargs)) * * def getMonitor(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":455 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_91cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_90cancelMonitor[] = "TAO.cancelMonitor(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_91cancelMonitor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cancelMonitor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("cancelMonitor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "cancelMonitor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_90cancelMonitor(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_90cancelMonitor(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("cancelMonitor", 0); /* "PETSc/TAO.pyx":458 * """ * """ * CHKERR( TaoCancelMonitors(self.tao) ) # <<<<<<<<<<<<<< * self.set_attr('__monitor__', None) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoCancelMonitors(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 458, __pyx_L1_error) /* "PETSc/TAO.pyx":459 * """ * CHKERR( TaoCancelMonitors(self.tao) ) * self.set_attr('__monitor__', None) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__monitor__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/TAO.pyx":455 * return self.get_attr('__monitor__') * * def cancelMonitor(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.cancelMonitor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":463 * # * * def solve(self, Vec x=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_93solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_92solve[] = "TAO.solve(self, Vec x=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_93solve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_x = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("solve (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solve") < 0)) __PYX_ERR(43, 463, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_x = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("solve", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 463, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(43, 463, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_92solve(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_92solve(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("solve", 0); /* "PETSc/TAO.pyx":466 * """ * """ * if x is not None: # <<<<<<<<<<<<<< * CHKERR( TaoSetInitialVector(self.tao, x.vec) ) * CHKERR( TaoSolve(self.tao) ) */ __pyx_t_1 = (((PyObject *)__pyx_v_x) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":467 * """ * if x is not None: * CHKERR( TaoSetInitialVector(self.tao, x.vec) ) # <<<<<<<<<<<<<< * CHKERR( TaoSolve(self.tao) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetInitialVector(__pyx_v_self->tao, __pyx_v_x->vec)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(43, 467, __pyx_L1_error) /* "PETSc/TAO.pyx":466 * """ * """ * if x is not None: # <<<<<<<<<<<<<< * CHKERR( TaoSetInitialVector(self.tao, x.vec) ) * CHKERR( TaoSolve(self.tao) ) */ } /* "PETSc/TAO.pyx":468 * if x is not None: * CHKERR( TaoSetInitialVector(self.tao, x.vec) ) * CHKERR( TaoSolve(self.tao) ) # <<<<<<<<<<<<<< * * def getSolution(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSolve(__pyx_v_self->tao)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(43, 468, __pyx_L1_error) /* "PETSc/TAO.pyx":463 * # * * def solve(self, Vec x=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.solve", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":470 * CHKERR( TaoSolve(self.tao) ) * * def getSolution(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_95getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_94getSolution[] = "TAO.getSolution(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_95getSolution(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolution", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolution", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_94getSolution(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_94getSolution(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolution", 0); /* "PETSc/TAO.pyx":473 * """ * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionVector(self.tao, &vec.vec) ) * PetscINCREF(vec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":474 * """ * cdef Vec vec = Vec() * CHKERR( TaoGetSolutionVector(self.tao, &vec.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionVector(__pyx_v_self->tao, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 474, __pyx_L1_error) /* "PETSc/TAO.pyx":475 * cdef Vec vec = Vec() * CHKERR( TaoGetSolutionVector(self.tao, &vec.vec) ) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * return vec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/TAO.pyx":476 * CHKERR( TaoGetSolutionVector(self.tao, &vec.vec) ) * PetscINCREF(vec.obj) * return vec # <<<<<<<<<<<<<< * * def getGradient(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/TAO.pyx":470 * CHKERR( TaoSolve(self.tao) ) * * def getSolution(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":478 * return vec * * def getGradient(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_97getGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_96getGradient[] = "TAO.getGradient(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_97getGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGradient (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGradient", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGradient", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_96getGradient(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_96getGradient(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGradient", 0); /* "PETSc/TAO.pyx":481 * """ * """ * cdef Vec vec = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoGetGradientVector(self.tao, &vec.vec) ) * PetscINCREF(vec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":482 * """ * cdef Vec vec = Vec() * CHKERR( TaoGetGradientVector(self.tao, &vec.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vec.obj) * return vec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetGradientVector(__pyx_v_self->tao, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 482, __pyx_L1_error) /* "PETSc/TAO.pyx":483 * cdef Vec vec = Vec() * CHKERR( TaoGetGradientVector(self.tao, &vec.vec) ) * PetscINCREF(vec.obj) # <<<<<<<<<<<<<< * return vec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); /* "PETSc/TAO.pyx":484 * CHKERR( TaoGetGradientVector(self.tao, &vec.vec) ) * PetscINCREF(vec.obj) * return vec # <<<<<<<<<<<<<< * * def setGradientNorm(self, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __pyx_r = ((PyObject *)__pyx_v_vec); goto __pyx_L0; /* "PETSc/TAO.pyx":478 * return vec * * def getGradient(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":486 * return vec * * def setGradientNorm(self, Mat mat): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_99setGradientNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_98setGradientNorm[] = "TAO.setGradientNorm(self, Mat mat)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_99setGradientNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGradientNorm (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGradientNorm") < 0)) __PYX_ERR(43, 486, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGradientNorm", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 486, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradientNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(43, 486, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_98setGradientNorm(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_98setGradientNorm(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGradientNorm", 0); /* "PETSc/TAO.pyx":489 * """ * """ * CHKERR( TaoSetGradientNorm(self.tao, mat.mat) ) # <<<<<<<<<<<<<< * * def getGradientNorm(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetGradientNorm(__pyx_v_self->tao, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 489, __pyx_L1_error) /* "PETSc/TAO.pyx":486 * return vec * * def setGradientNorm(self, Mat mat): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setGradientNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":491 * CHKERR( TaoSetGradientNorm(self.tao, mat.mat) ) * * def getGradientNorm(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_101getGradientNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_100getGradientNorm[] = "TAO.getGradientNorm(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_101getGradientNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGradientNorm (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGradientNorm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGradientNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_100getGradientNorm(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_100getGradientNorm(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGradientNorm", 0); /* "PETSc/TAO.pyx":494 * """ * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) * PetscINCREF(mat.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 494, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":495 * """ * cdef Mat mat = Mat() * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * return mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetGradientNorm(__pyx_v_self->tao, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 495, __pyx_L1_error) /* "PETSc/TAO.pyx":496 * cdef Mat mat = Mat() * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * return mat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/TAO.pyx":497 * CHKERR( TaoGetGradientNorm(self.tao, &mat.mat) ) * PetscINCREF(mat.obj) * return mat # <<<<<<<<<<<<<< * * def setLMVMH0(self, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/TAO.pyx":491 * CHKERR( TaoSetGradientNorm(self.tao, mat.mat) ) * * def getGradientNorm(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getGradientNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":499 * return mat * * def setLMVMH0(self, Mat mat): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_103setLMVMH0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_102setLMVMH0[] = "TAO.setLMVMH0(self, Mat mat)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_103setLMVMH0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLMVMH0 (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLMVMH0") < 0)) __PYX_ERR(43, 499, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLMVMH0", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 499, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setLMVMH0", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(43, 499, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_102setLMVMH0(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_102setLMVMH0(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLMVMH0", 0); /* "PETSc/TAO.pyx":502 * """ * """ * CHKERR( TaoLMVMSetH0(self.tao, mat.mat) ) # <<<<<<<<<<<<<< * * def getLMVMH0(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMSetH0(__pyx_v_self->tao, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 502, __pyx_L1_error) /* "PETSc/TAO.pyx":499 * return mat * * def setLMVMH0(self, Mat mat): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setLMVMH0", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":504 * CHKERR( TaoLMVMSetH0(self.tao, mat.mat) ) * * def getLMVMH0(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_105getLMVMH0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_104getLMVMH0[] = "TAO.getLMVMH0(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_105getLMVMH0(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLMVMH0 (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLMVMH0", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLMVMH0", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_104getLMVMH0(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_104getLMVMH0(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLMVMH0", 0); /* "PETSc/TAO.pyx":507 * """ * """ * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) * PetscINCREF(mat.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":508 * """ * cdef Mat mat = Mat() * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) # <<<<<<<<<<<<<< * PetscINCREF(mat.obj) * return mat */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMGetH0(__pyx_v_self->tao, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 508, __pyx_L1_error) /* "PETSc/TAO.pyx":509 * cdef Mat mat = Mat() * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) * PetscINCREF(mat.obj) # <<<<<<<<<<<<<< * return mat * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); /* "PETSc/TAO.pyx":510 * CHKERR( TaoLMVMGetH0(self.tao, &mat.mat) ) * PetscINCREF(mat.obj) * return mat # <<<<<<<<<<<<<< * * def getLMVMH0KSP(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/TAO.pyx":504 * CHKERR( TaoLMVMSetH0(self.tao, mat.mat) ) * * def getLMVMH0(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getLMVMH0", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":512 * return mat * * def getLMVMH0KSP(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_107getLMVMH0KSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_106getLMVMH0KSP[] = "TAO.getLMVMH0KSP(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_107getLMVMH0KSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLMVMH0KSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLMVMH0KSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLMVMH0KSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_106getLMVMH0KSP(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_106getLMVMH0KSP(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLMVMH0KSP", 0); /* "PETSc/TAO.pyx":515 * """ * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":516 * """ * cdef KSP ksp = KSP() * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMGetH0KSP(__pyx_v_self->tao, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 516, __pyx_L1_error) /* "PETSc/TAO.pyx":517 * cdef KSP ksp = KSP() * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/TAO.pyx":518 * CHKERR( TaoLMVMGetH0KSP(self.tao, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * def getVariableBounds(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/TAO.pyx":512 * return mat * * def getLMVMH0KSP(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getLMVMH0KSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":520 * return ksp * * def getVariableBounds(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_109getVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_108getVariableBounds[] = "TAO.getVariableBounds(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_109getVariableBounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVariableBounds (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getVariableBounds", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVariableBounds", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_108getVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_108getVariableBounds(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_xl = 0; struct PyPetscVecObject *__pyx_v_xu = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVariableBounds", 0); /* "PETSc/TAO.pyx":523 * """ * """ * cdef Vec xl = Vec(), xu = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) * PetscINCREF(xl.obj); PetscINCREF(xu.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":524 * """ * cdef Vec xl = Vec(), xu = Vec() * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(xl.obj); PetscINCREF(xu.obj) * return (xl, xu) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetVariableBounds(__pyx_v_self->tao, (&__pyx_v_xl->vec), (&__pyx_v_xu->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 524, __pyx_L1_error) /* "PETSc/TAO.pyx":525 * cdef Vec xl = Vec(), xu = Vec() * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) * PetscINCREF(xl.obj); PetscINCREF(xu.obj) # <<<<<<<<<<<<<< * return (xl, xu) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xl->__pyx_base.obj)); (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xu->__pyx_base.obj)); /* "PETSc/TAO.pyx":526 * CHKERR( TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec) ) * PetscINCREF(xl.obj); PetscINCREF(xu.obj) * return (xl, xu) # <<<<<<<<<<<<<< * * def getIterationNumber(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_xl)); __Pyx_GIVEREF(((PyObject *)__pyx_v_xl)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_xl)); __Pyx_INCREF(((PyObject *)__pyx_v_xu)); __Pyx_GIVEREF(((PyObject *)__pyx_v_xu)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_xu)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":520 * return ksp * * def getVariableBounds(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getVariableBounds", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xl); __Pyx_XDECREF((PyObject *)__pyx_v_xu); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":528 * return (xl, xu) * * def getIterationNumber(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_111getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_110getIterationNumber[] = "TAO.getIterationNumber(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_111getIterationNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIterationNumber (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIterationNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIterationNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_110getIterationNumber(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_110getIterationNumber(struct PyPetscTAOObject *__pyx_v_self) { PetscInt __pyx_v_its; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIterationNumber", 0); /* "PETSc/TAO.pyx":531 * """ * """ * cdef PetscInt its=0 # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, &its, NULL, NULL, NULL, NULL, NULL) ) * return toInt(its) */ __pyx_v_its = 0; /* "PETSc/TAO.pyx":532 * """ * cdef PetscInt its=0 * CHKERR( TaoGetSolutionStatus(self.tao, &its, NULL, NULL, NULL, NULL, NULL) ) # <<<<<<<<<<<<<< * return toInt(its) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, (&__pyx_v_its), NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 532, __pyx_L1_error) /* "PETSc/TAO.pyx":533 * cdef PetscInt its=0 * CHKERR( TaoGetSolutionStatus(self.tao, &its, NULL, NULL, NULL, NULL, NULL) ) * return toInt(its) # <<<<<<<<<<<<<< * * def getObjectiveValue(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":528 * return (xl, xu) * * def getIterationNumber(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getIterationNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":535 * return toInt(its) * * def getObjectiveValue(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_113getObjectiveValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_112getObjectiveValue[] = "TAO.getObjectiveValue(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_113getObjectiveValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getObjectiveValue (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getObjectiveValue", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getObjectiveValue", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_112getObjectiveValue(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_112getObjectiveValue(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v_fval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getObjectiveValue", 0); /* "PETSc/TAO.pyx":538 * """ * """ * cdef PetscReal fval=0 # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, NULL, NULL, NULL, NULL) ) * return toReal(fval) */ __pyx_v_fval = 0.0; /* "PETSc/TAO.pyx":539 * """ * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, NULL, NULL, NULL, NULL) ) # <<<<<<<<<<<<<< * return toReal(fval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, NULL, (&__pyx_v_fval), NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 539, __pyx_L1_error) /* "PETSc/TAO.pyx":540 * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, NULL, NULL, NULL, NULL) ) * return toReal(fval) # <<<<<<<<<<<<<< * * getFunctionValue = getObjectiveValue */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fval); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":535 * return toInt(its) * * def getObjectiveValue(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getObjectiveValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":544 * getFunctionValue = getObjectiveValue * * def getConvergedReason(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_115getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_114getConvergedReason[] = "TAO.getConvergedReason(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_115getConvergedReason(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConvergedReason (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getConvergedReason", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getConvergedReason", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_114getConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_114getConvergedReason(struct PyPetscTAOObject *__pyx_v_self) { TaoConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConvergedReason", 0); /* "PETSc/TAO.pyx":547 * """ * """ * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * CHKERR( TaoGetConvergedReason(self.tao, &reason) ) * return reason */ __pyx_v_reason = TAO_CONTINUE_ITERATING; /* "PETSc/TAO.pyx":548 * """ * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &reason) ) # <<<<<<<<<<<<<< * return reason * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetConvergedReason(__pyx_v_self->tao, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 548, __pyx_L1_error) /* "PETSc/TAO.pyx":549 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetConvergedReason(self.tao, &reason) ) * return reason # <<<<<<<<<<<<<< * * def getSolutionNorm(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_TaoConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":544 * getFunctionValue = getObjectiveValue * * def getConvergedReason(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getConvergedReason", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":551 * return reason * * def getSolutionNorm(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_117getSolutionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_116getSolutionNorm[] = "TAO.getSolutionNorm(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_117getSolutionNorm(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionNorm (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolutionNorm", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolutionNorm", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_116getSolutionNorm(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_116getSolutionNorm(struct PyPetscTAOObject *__pyx_v_self) { PetscReal __pyx_v_gnorm; PetscReal __pyx_v_cnorm; PetscReal __pyx_v_fval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionNorm", 0); /* "PETSc/TAO.pyx":554 * """ * """ * cdef PetscReal gnorm=0 # <<<<<<<<<<<<<< * cdef PetscReal cnorm=0 * cdef PetscReal fval=0 */ __pyx_v_gnorm = 0.0; /* "PETSc/TAO.pyx":555 * """ * cdef PetscReal gnorm=0 * cdef PetscReal cnorm=0 # <<<<<<<<<<<<<< * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) */ __pyx_v_cnorm = 0.0; /* "PETSc/TAO.pyx":556 * cdef PetscReal gnorm=0 * cdef PetscReal cnorm=0 * cdef PetscReal fval=0 # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) * return (toReal(fval), toReal(gnorm), toReal(cnorm)) */ __pyx_v_fval = 0.0; /* "PETSc/TAO.pyx":557 * cdef PetscReal cnorm=0 * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) # <<<<<<<<<<<<<< * return (toReal(fval), toReal(gnorm), toReal(cnorm)) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, NULL, (&__pyx_v_fval), (&__pyx_v_gnorm), (&__pyx_v_cnorm), NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 557, __pyx_L1_error) /* "PETSc/TAO.pyx":558 * cdef PetscReal fval=0 * CHKERR( TaoGetSolutionStatus(self.tao, NULL, &fval, &gnorm, &cnorm, NULL, NULL) ) * return (toReal(fval), toReal(gnorm), toReal(cnorm)) # <<<<<<<<<<<<<< * * def getSolutionStatus(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fval); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gnorm); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cnorm); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":551 * return reason * * def getSolutionNorm(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getSolutionNorm", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":560 * return (toReal(fval), toReal(gnorm), toReal(cnorm)) * * def getSolutionStatus(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_119getSolutionStatus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_118getSolutionStatus[] = "TAO.getSolutionStatus(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_119getSolutionStatus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionStatus (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSolutionStatus", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSolutionStatus", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_118getSolutionStatus(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_118getSolutionStatus(struct PyPetscTAOObject *__pyx_v_self) { PetscInt __pyx_v_its; PetscReal __pyx_v_fval; PetscReal __pyx_v_gnorm; PetscReal __pyx_v_cnorm; PetscReal __pyx_v_xdiff; TaoConvergedReason __pyx_v_reason; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionStatus", 0); /* "PETSc/TAO.pyx":563 * """ * """ * cdef PetscInt its=0 # <<<<<<<<<<<<<< * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING */ __pyx_v_its = 0; /* "PETSc/TAO.pyx":564 * """ * cdef PetscInt its=0 * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 # <<<<<<<<<<<<<< * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetSolutionStatus(self.tao, &its, */ __pyx_v_fval = 0.0; __pyx_v_gnorm = 0.0; __pyx_v_cnorm = 0.0; __pyx_v_xdiff = 0.0; /* "PETSc/TAO.pyx":565 * cdef PetscInt its=0 * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING # <<<<<<<<<<<<<< * CHKERR( TaoGetSolutionStatus(self.tao, &its, * &fval, &gnorm, &cnorm, &xdiff, */ __pyx_v_reason = TAO_CONTINUE_ITERATING; /* "PETSc/TAO.pyx":566 * cdef PetscReal fval=0, gnorm=0, cnorm=0, xdiff=0 * cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING * CHKERR( TaoGetSolutionStatus(self.tao, &its, # <<<<<<<<<<<<<< * &fval, &gnorm, &cnorm, &xdiff, * &reason) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolutionStatus(__pyx_v_self->tao, (&__pyx_v_its), (&__pyx_v_fval), (&__pyx_v_gnorm), (&__pyx_v_cnorm), (&__pyx_v_xdiff), (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 566, __pyx_L1_error) /* "PETSc/TAO.pyx":569 * &fval, &gnorm, &cnorm, &xdiff, * &reason) ) * return (toInt(its), toReal(fval), # <<<<<<<<<<<<<< * toReal(gnorm), toReal(cnorm), * toReal(xdiff), reason) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_its); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fval); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/TAO.pyx":570 * &reason) ) * return (toInt(its), toReal(fval), * toReal(gnorm), toReal(cnorm), # <<<<<<<<<<<<<< * toReal(xdiff), reason) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gnorm); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cnorm); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "PETSc/TAO.pyx":571 * return (toInt(its), toReal(fval), * toReal(gnorm), toReal(cnorm), * toReal(xdiff), reason) # <<<<<<<<<<<<<< * * def getKSP(self): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_xdiff); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_From_TaoConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_7)) __PYX_ERR(43, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "PETSc/TAO.pyx":569 * &fval, &gnorm, &cnorm, &xdiff, * &reason) ) * return (toInt(its), toReal(fval), # <<<<<<<<<<<<<< * toReal(gnorm), toReal(cnorm), * toReal(xdiff), reason) */ __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(43, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":560 * return (toReal(fval), toReal(gnorm), toReal(cnorm)) * * def getSolutionStatus(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getSolutionStatus", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":573 * toReal(xdiff), reason) * * def getKSP(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_121getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_120getKSP[] = "TAO.getKSP(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_121getKSP(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getKSP (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getKSP", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getKSP", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_120getKSP(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_120getKSP(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscKSPObject *__pyx_v_ksp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getKSP", 0); /* "PETSc/TAO.pyx":576 * """ * """ * cdef KSP ksp = KSP() # <<<<<<<<<<<<<< * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) * PetscINCREF(ksp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":577 * """ * cdef KSP ksp = KSP() * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) # <<<<<<<<<<<<<< * PetscINCREF(ksp.obj) * return ksp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetKSP(__pyx_v_self->tao, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 577, __pyx_L1_error) /* "PETSc/TAO.pyx":578 * cdef KSP ksp = KSP() * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) * PetscINCREF(ksp.obj) # <<<<<<<<<<<<<< * return ksp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); /* "PETSc/TAO.pyx":579 * CHKERR( TaoGetKSP(self.tao, &ksp.ksp) ) * PetscINCREF(ksp.obj) * return ksp # <<<<<<<<<<<<<< * * # BRGN routines */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ksp)); __pyx_r = ((PyObject *)__pyx_v_ksp); goto __pyx_L0; /* "PETSc/TAO.pyx":573 * toReal(xdiff), reason) * * def getKSP(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getKSP", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ksp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":583 * # BRGN routines * * def getBRGNSubsolver(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_123getBRGNSubsolver(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_122getBRGNSubsolver[] = "TAO.getBRGNSubsolver(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_123getBRGNSubsolver(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBRGNSubsolver (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBRGNSubsolver", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBRGNSubsolver", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_122getBRGNSubsolver(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_122getBRGNSubsolver(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscTAOObject *__pyx_v_subsolver = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBRGNSubsolver", 0); /* "PETSc/TAO.pyx":586 * """ * """ * cdef TAO subsolver = TAO() # <<<<<<<<<<<<<< * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) * PetscINCREF(subsolver.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_subsolver = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":587 * """ * cdef TAO subsolver = TAO() * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) # <<<<<<<<<<<<<< * PetscINCREF(subsolver.obj) * return subsolver */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNGetSubsolver(__pyx_v_self->tao, (&__pyx_v_subsolver->tao))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 587, __pyx_L1_error) /* "PETSc/TAO.pyx":588 * cdef TAO subsolver = TAO() * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) * PetscINCREF(subsolver.obj) # <<<<<<<<<<<<<< * return subsolver * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subsolver->__pyx_base.obj)); /* "PETSc/TAO.pyx":589 * CHKERR( TaoBRGNGetSubsolver(self.tao, &subsolver.tao) ) * PetscINCREF(subsolver.obj) * return subsolver # <<<<<<<<<<<<<< * * def setBRGNRegularizerObjectiveGradient(self, objgrad, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_subsolver)); __pyx_r = ((PyObject *)__pyx_v_subsolver); goto __pyx_L0; /* "PETSc/TAO.pyx":583 * # BRGN routines * * def getBRGNSubsolver(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getBRGNSubsolver", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subsolver); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":591 * return subsolver * * def setBRGNRegularizerObjectiveGradient(self, objgrad, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_125setBRGNRegularizerObjectiveGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_124setBRGNRegularizerObjectiveGradient[] = "TAO.setBRGNRegularizerObjectiveGradient(self, objgrad, args=None, kargs=None)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_125setBRGNRegularizerObjectiveGradient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_objgrad = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNRegularizerObjectiveGradient (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_objgrad,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_objgrad)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBRGNRegularizerObjectiveGradient") < 0)) __PYX_ERR(43, 591, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_objgrad = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerObjectiveGradient", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 591, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_124setBRGNRegularizerObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_objgrad, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_124setBRGNRegularizerObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_objgrad, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNRegularizerObjectiveGradient", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":594 * """ * """ * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (objgrad, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":595 * """ * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (objgrad, args, kargs) * self.set_attr("__brgnregobjgrad__", context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/TAO.pyx":596 * if args is None: args = () * if kargs is None: kargs = {} * context = (objgrad, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__brgnregobjgrad__", context) * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_objgrad); __Pyx_GIVEREF(__pyx_v_objgrad); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_objgrad); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":597 * if kargs is None: kargs = {} * context = (objgrad, args, kargs) * self.set_attr("__brgnregobjgrad__", context) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__brgnregobjgrad__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 597, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":598 * context = (objgrad, args, kargs) * self.set_attr("__brgnregobjgrad__", context) * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) # <<<<<<<<<<<<<< * * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetRegularizerObjectiveAndGradientRoutine(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegObjGrad, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(43, 598, __pyx_L1_error) /* "PETSc/TAO.pyx":591 * return subsolver * * def setBRGNRegularizerObjectiveGradient(self, objgrad, args=None, kargs=None): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerObjectiveGradient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":600 * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) * * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Hmat=NULL * if H is not None: Hmat = H.mat */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_127setBRGNRegularizerHessian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_126setBRGNRegularizerHessian[] = "TAO.setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_127setBRGNRegularizerHessian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hessian = 0; struct PyPetscMatObject *__pyx_v_H = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNRegularizerHessian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hessian,&__pyx_n_s_H,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[1] = (PyObject *)((struct PyPetscMatObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hessian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBRGNRegularizerHessian") < 0)) __PYX_ERR(43, 600, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_hessian = values[0]; __pyx_v_H = ((struct PyPetscMatObject *)values[1]); __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerHessian", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 600, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_8petsc4py_5PETSc_Mat, 1, "H", 0))) __PYX_ERR(43, 600, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_126setBRGNRegularizerHessian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_hessian, __pyx_v_H, __pyx_v_args, __pyx_v_kargs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_126setBRGNRegularizerHessian(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_hessian, struct PyPetscMatObject *__pyx_v_H, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { Mat __pyx_v_Hmat; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Mat __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNRegularizerHessian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/TAO.pyx":601 * * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None): * cdef PetscMat Hmat=NULL # <<<<<<<<<<<<<< * if H is not None: Hmat = H.mat * if args is None: args = () */ __pyx_v_Hmat = NULL; /* "PETSc/TAO.pyx":602 * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None): * cdef PetscMat Hmat=NULL * if H is not None: Hmat = H.mat # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (((PyObject *)__pyx_v_H) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_H->mat; __pyx_v_Hmat = __pyx_t_3; } /* "PETSc/TAO.pyx":603 * cdef PetscMat Hmat=NULL * if H is not None: Hmat = H.mat * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (hessian, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/TAO.pyx":604 * if H is not None: Hmat = H.mat * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (hessian, args, kargs) * self.set_attr("__brgnreghessian__", context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/TAO.pyx":605 * if args is None: args = () * if kargs is None: kargs = {} * context = (hessian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr("__brgnreghessian__", context) * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_hessian); __Pyx_GIVEREF(__pyx_v_hessian); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_hessian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":606 * if kargs is None: kargs = {} * context = (hessian, args, kargs) * self.set_attr("__brgnreghessian__", context) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) * */ __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__brgnreghessian__"), __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":607 * context = (hessian, args, kargs) * self.set_attr("__brgnreghessian__", context) * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) # <<<<<<<<<<<<<< * * def setBRGNRegularizerWeight(self, weight): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetRegularizerHessianRoutine(__pyx_v_self->tao, __pyx_v_Hmat, __pyx_f_8petsc4py_5PETSc_TAO_BRGNRegHessian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(43, 607, __pyx_L1_error) /* "PETSc/TAO.pyx":600 * CHKERR( TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, context) ) * * def setBRGNRegularizerHessian(self, hessian, Mat H=None, args=None, kargs=None): # <<<<<<<<<<<<<< * cdef PetscMat Hmat=NULL * if H is not None: Hmat = H.mat */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerHessian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":609 * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) * * def setBRGNRegularizerWeight(self, weight): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_129setBRGNRegularizerWeight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_128setBRGNRegularizerWeight[] = "TAO.setBRGNRegularizerWeight(self, weight)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_129setBRGNRegularizerWeight(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_weight = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNRegularizerWeight (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_weight,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBRGNRegularizerWeight") < 0)) __PYX_ERR(43, 609, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_weight = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerWeight", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 609, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerWeight", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_128setBRGNRegularizerWeight(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_weight); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_128setBRGNRegularizerWeight(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_weight) { PetscReal __pyx_v_cweight; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNRegularizerWeight", 0); /* "PETSc/TAO.pyx":612 * """ * """ * cdef PetscReal cweight = asReal(weight) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_weight); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 612, __pyx_L1_error) __pyx_v_cweight = __pyx_t_1; /* "PETSc/TAO.pyx":613 * """ * cdef PetscReal cweight = asReal(weight) * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) # <<<<<<<<<<<<<< * * def setBRGNSmoothL1Epsilon(self, epsilon): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetRegularizerWeight(__pyx_v_self->tao, __pyx_v_cweight)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 613, __pyx_L1_error) /* "PETSc/TAO.pyx":609 * CHKERR( TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, context) ) * * def setBRGNRegularizerWeight(self, weight): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNRegularizerWeight", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":615 * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) * * def setBRGNSmoothL1Epsilon(self, epsilon): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_131setBRGNSmoothL1Epsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_130setBRGNSmoothL1Epsilon[] = "TAO.setBRGNSmoothL1Epsilon(self, epsilon)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_131setBRGNSmoothL1Epsilon(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_epsilon = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNSmoothL1Epsilon (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_epsilon,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_epsilon)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBRGNSmoothL1Epsilon") < 0)) __PYX_ERR(43, 615, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_epsilon = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNSmoothL1Epsilon", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 615, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNSmoothL1Epsilon", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_130setBRGNSmoothL1Epsilon(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_epsilon); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_130setBRGNSmoothL1Epsilon(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_epsilon) { PetscReal __pyx_v_ceps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNSmoothL1Epsilon", 0); /* "PETSc/TAO.pyx":618 * """ * """ * cdef PetscReal ceps = asReal(epsilon) # <<<<<<<<<<<<<< * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_epsilon); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(43, 618, __pyx_L1_error) __pyx_v_ceps = __pyx_t_1; /* "PETSc/TAO.pyx":619 * """ * cdef PetscReal ceps = asReal(epsilon) * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) # <<<<<<<<<<<<<< * * def setBRGNDictionaryMatrix(self, Mat D): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetL1SmoothEpsilon(__pyx_v_self->tao, __pyx_v_ceps)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 619, __pyx_L1_error) /* "PETSc/TAO.pyx":615 * CHKERR( TaoBRGNSetRegularizerWeight(self.tao, cweight) ) * * def setBRGNSmoothL1Epsilon(self, epsilon): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNSmoothL1Epsilon", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":621 * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) * * def setBRGNDictionaryMatrix(self, Mat D): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_133setBRGNDictionaryMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_132setBRGNDictionaryMatrix[] = "TAO.setBRGNDictionaryMatrix(self, Mat D)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_133setBRGNDictionaryMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_D = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBRGNDictionaryMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_D,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_D)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBRGNDictionaryMatrix") < 0)) __PYX_ERR(43, 621, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_D = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBRGNDictionaryMatrix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(43, 621, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNDictionaryMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_D), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "D", 0))) __PYX_ERR(43, 621, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_132setBRGNDictionaryMatrix(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_D); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_132setBRGNDictionaryMatrix(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_D) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBRGNDictionaryMatrix", 0); /* "PETSc/TAO.pyx":624 * """ * """ * CHKERR( TaoBRGNSetDictionaryMatrix(self.tao, D.mat) ) # <<<<<<<<<<<<<< * * def getBRGNDampingVector(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNSetDictionaryMatrix(__pyx_v_self->tao, __pyx_v_D->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(43, 624, __pyx_L1_error) /* "PETSc/TAO.pyx":621 * CHKERR( TaoBRGNSetL1SmoothEpsilon(self.tao, ceps) ) * * def setBRGNDictionaryMatrix(self, Mat D): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.TAO.setBRGNDictionaryMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":626 * CHKERR( TaoBRGNSetDictionaryMatrix(self.tao, D.mat) ) * * def getBRGNDampingVector(self): # <<<<<<<<<<<<<< * """ * """ */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_135getBRGNDampingVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_3TAO_134getBRGNDampingVector[] = "TAO.getBRGNDampingVector(self)\n\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_135getBRGNDampingVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBRGNDampingVector (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBRGNDampingVector", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBRGNDampingVector", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_134getBRGNDampingVector(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_134getBRGNDampingVector(struct PyPetscTAOObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_damp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBRGNDampingVector", 0); /* "PETSc/TAO.pyx":629 * """ * """ * cdef Vec damp = Vec() # <<<<<<<<<<<<<< * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) * PetscINCREF(damp.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_damp = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":630 * """ * cdef Vec damp = Vec() * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(damp.obj) * return damp */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNGetDampingVector(__pyx_v_self->tao, (&__pyx_v_damp->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(43, 630, __pyx_L1_error) /* "PETSc/TAO.pyx":631 * cdef Vec damp = Vec() * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) * PetscINCREF(damp.obj) # <<<<<<<<<<<<<< * return damp * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_damp->__pyx_base.obj)); /* "PETSc/TAO.pyx":632 * CHKERR( TaoBRGNGetDampingVector(self.tao, &damp.vec) ) * PetscINCREF(damp.obj) * return damp # <<<<<<<<<<<<<< * * # --- application context --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_damp)); __pyx_r = ((PyObject *)__pyx_v_damp); goto __pyx_L0; /* "PETSc/TAO.pyx":626 * CHKERR( TaoBRGNSetDictionaryMatrix(self.tao, D.mat) ) * * def getBRGNDampingVector(self): # <<<<<<<<<<<<<< * """ * """ */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.TAO.getBRGNDampingVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_damp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":637 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6appctx___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":638 * property appctx: * def __get__(self): * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":637 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":639 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_6appctx_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TAO.pyx":640 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- linear solver --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":639 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":645 * * property ksp: * def __get__(self): # <<<<<<<<<<<<<< * return self.getKSP() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3ksp_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3ksp_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_3ksp___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3ksp___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":646 * property ksp: * def __get__(self): * return self.getKSP() # <<<<<<<<<<<<<< * * # --- tolerances --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getKSP); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":645 * * property ksp: * def __get__(self): # <<<<<<<<<<<<<< * return self.getKSP() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ksp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":651 * * property ftol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getFunctionTolerances() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ftol___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":652 * property ftol: * def __get__(self): * return self.getFunctionTolerances() # <<<<<<<<<<<<<< * def __set__(self, value): * if isinstance(value, (tuple, list)): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFunctionTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":651 * * property ftol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getFunctionTolerances() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ftol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":653 * def __get__(self): * return self.getFunctionTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ftol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TAO.pyx":654 * return self.getFunctionTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.setFunctionTolerances(*value) * elif isinstance(value, dict): */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_value); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":655 * def __set__(self, value): * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) # <<<<<<<<<<<<<< * elif isinstance(value, dict): * self.setFunctionTolerances(**value) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setFunctionTolerances); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/TAO.pyx":654 * return self.getFunctionTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.setFunctionTolerances(*value) * elif isinstance(value, dict): */ goto __pyx_L3; } /* "PETSc/TAO.pyx":656 * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.setFunctionTolerances(**value) * else: */ __pyx_t_2 = PyDict_Check(__pyx_v_value); __pyx_t_1 = (__pyx_t_2 != 0); if (likely(__pyx_t_1)) { /* "PETSc/TAO.pyx":657 * self.setFunctionTolerances(*value) * elif isinstance(value, dict): * self.setFunctionTolerances(**value) # <<<<<<<<<<<<<< * else: * raise TypeError("expecting tuple/list or dict") */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setFunctionTolerances); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_value == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(43, 657, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_value))) { __pyx_t_5 = PyDict_Copy(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_value, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":656 * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.setFunctionTolerances(**value) * else: */ goto __pyx_L3; } /* "PETSc/TAO.pyx":659 * self.setFunctionTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * property gtol: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(43, 659, __pyx_L1_error) } __pyx_L3:; /* "PETSc/TAO.pyx":653 * def __get__(self): * return self.getFunctionTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.setFunctionTolerances(*value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ftol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":662 * * property gtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGradientTolerances() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4gtol___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":663 * property gtol: * def __get__(self): * return self.getGradientTolerances() # <<<<<<<<<<<<<< * def __set__(self, value): * if isinstance(value, (tuple, list)): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradientTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":662 * * property gtol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGradientTolerances() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gtol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":664 * def __get__(self): * return self.getGradientTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_4gtol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TAO.pyx":665 * return self.getGradientTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getGradientTolerances(*value) * elif isinstance(value, dict): */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_value); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":666 * def __set__(self, value): * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) # <<<<<<<<<<<<<< * elif isinstance(value, dict): * self.getGradientTolerances(**value) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradientTolerances); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/TAO.pyx":665 * return self.getGradientTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getGradientTolerances(*value) * elif isinstance(value, dict): */ goto __pyx_L3; } /* "PETSc/TAO.pyx":667 * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getGradientTolerances(**value) * else: */ __pyx_t_2 = PyDict_Check(__pyx_v_value); __pyx_t_1 = (__pyx_t_2 != 0); if (likely(__pyx_t_1)) { /* "PETSc/TAO.pyx":668 * self.getGradientTolerances(*value) * elif isinstance(value, dict): * self.getGradientTolerances(**value) # <<<<<<<<<<<<<< * else: * raise TypeError("expecting tuple/list or dict") */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradientTolerances); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_value == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(43, 668, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_value))) { __pyx_t_5 = PyDict_Copy(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_value, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":667 * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getGradientTolerances(**value) * else: */ goto __pyx_L3; } /* "PETSc/TAO.pyx":670 * self.getGradientTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * property ctol: */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(43, 670, __pyx_L1_error) } __pyx_L3:; /* "PETSc/TAO.pyx":664 * def __get__(self): * return self.getGradientTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getGradientTolerances(*value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gtol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":673 * * property ctol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConstraintTolerances() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_4ctol___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":674 * property ctol: * def __get__(self): * return self.getConstraintTolerances() # <<<<<<<<<<<<<< * def __set__(self, value): * if isinstance(value, (tuple, list)): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConstraintTolerances); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":673 * * property ctol: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConstraintTolerances() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ctol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":675 * def __get__(self): * return self.getConstraintTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol_2__set__(((struct PyPetscTAOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_3TAO_4ctol_2__set__(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/TAO.pyx":676 * return self.getConstraintTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getConstraintTolerances(*value) * elif isinstance(value, dict): */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = PyList_Check(__pyx_v_value); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/TAO.pyx":677 * def __set__(self, value): * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) # <<<<<<<<<<<<<< * elif isinstance(value, dict): * self.getConstraintTolerances(**value) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConstraintTolerances); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/TAO.pyx":676 * return self.getConstraintTolerances() * def __set__(self, value): * if isinstance(value, (tuple, list)): # <<<<<<<<<<<<<< * self.getConstraintTolerances(*value) * elif isinstance(value, dict): */ goto __pyx_L3; } /* "PETSc/TAO.pyx":678 * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getConstraintTolerances(**value) * else: */ __pyx_t_2 = PyDict_Check(__pyx_v_value); __pyx_t_1 = (__pyx_t_2 != 0); if (likely(__pyx_t_1)) { /* "PETSc/TAO.pyx":679 * self.getConstraintTolerances(*value) * elif isinstance(value, dict): * self.getConstraintTolerances(**value) # <<<<<<<<<<<<<< * else: * raise TypeError("expecting tuple/list or dict") */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConstraintTolerances); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__pyx_v_value == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(43, 679, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_v_value))) { __pyx_t_5 = PyDict_Copy(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } else { __pyx_t_5 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_value, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/TAO.pyx":678 * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) * elif isinstance(value, dict): # <<<<<<<<<<<<<< * self.getConstraintTolerances(**value) * else: */ goto __pyx_L3; } /* "PETSc/TAO.pyx":681 * self.getConstraintTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * # --- iteration --- */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(43, 681, __pyx_L1_error) } __pyx_L3:; /* "PETSc/TAO.pyx":675 * def __get__(self): * return self.getConstraintTolerances() * def __set__(self, value): # <<<<<<<<<<<<<< * if isinstance(value, (tuple, list)): * self.getConstraintTolerances(*value) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.TAO.ctol.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":686 * * property its: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIterationNumber() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3its_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_3its_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_3its___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_3its___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":687 * property its: * def __get__(self): * return self.getIterationNumber() # <<<<<<<<<<<<<< * * property gnorm: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getIterationNumber); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":686 * * property its: * def __get__(self): # <<<<<<<<<<<<<< * return self.getIterationNumber() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.its.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":690 * * property gnorm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolutionNorm()[1] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5gnorm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5gnorm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_5gnorm___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5gnorm___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":691 * property gnorm: * def __get__(self): * return self.getSolutionNorm()[1] # <<<<<<<<<<<<<< * * property cnorm: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolutionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":690 * * property gnorm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolutionNorm()[1] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gnorm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":694 * * property cnorm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolutionNorm()[2] * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5cnorm_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_5cnorm_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_5cnorm___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_5cnorm___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":695 * property cnorm: * def __get__(self): * return self.getSolutionNorm()[2] # <<<<<<<<<<<<<< * * property solution: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolutionNorm); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":694 * * property cnorm: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolutionNorm()[2] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.cnorm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":698 * * property solution: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8solution_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8solution_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8solution___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8solution___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":699 * property solution: * def __get__(self): * return self.getSolution() # <<<<<<<<<<<<<< * * property objective: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":698 * * property solution: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSolution() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.solution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":702 * * property objective: * def __get__(self): # <<<<<<<<<<<<<< * return self.getObjectiveValue() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9objective_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9objective_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_9objective___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9objective___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":703 * property objective: * def __get__(self): * return self.getObjectiveValue() # <<<<<<<<<<<<<< * * property function: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getObjectiveValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":702 * * property objective: * def __get__(self): # <<<<<<<<<<<<<< * return self.getObjectiveValue() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.objective.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":706 * * property function: * def __get__(self): # <<<<<<<<<<<<<< * return self.getFunctionValue() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8function_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8function_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8function___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8function___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":707 * property function: * def __get__(self): * return self.getFunctionValue() # <<<<<<<<<<<<<< * * property gradient: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getFunctionValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":706 * * property function: * def __get__(self): # <<<<<<<<<<<<<< * return self.getFunctionValue() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.function.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":710 * * property gradient: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGradient() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8gradient_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8gradient_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8gradient___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8gradient___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":711 * property gradient: * def __get__(self): * return self.getGradient() # <<<<<<<<<<<<<< * * # --- convergence --- */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGradient); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":710 * * property gradient: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGradient() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.gradient.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":716 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_6reason_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_6reason___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_6reason___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":717 * property reason: * def __get__(self): * return self.getConvergedReason() # <<<<<<<<<<<<<< * * property iterating: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getConvergedReason); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":716 * * property reason: * def __get__(self): # <<<<<<<<<<<<<< * return self.getConvergedReason() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.TAO.reason.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":720 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9iterating_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9iterating_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_9iterating___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9iterating___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":721 * property iterating: * def __get__(self): * return self.reason == 0 # <<<<<<<<<<<<<< * * property converged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":720 * * property iterating: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason == 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.iterating.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":724 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9converged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_9converged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_9converged___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_9converged___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":725 * property converged: * def __get__(self): * return self.reason > 0 # <<<<<<<<<<<<<< * * property diverged: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":724 * * property converged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason > 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.converged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/TAO.pyx":728 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8diverged_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_8diverged_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_8diverged___get__(((struct PyPetscTAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_8diverged___get__(struct PyPetscTAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/TAO.pyx":729 * property diverged: * def __get__(self): * return self.reason < 0 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(43, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/TAO.pyx":728 * * property diverged: * def __get__(self): # <<<<<<<<<<<<<< * return self.reason < 0 * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.TAO.diverged.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":15 * Type = AOType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ao * self.ao = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2AO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2AO_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO___cinit__(((struct PyPetscAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2AO___cinit__(struct PyPetscAOObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/AO.pyx":16 * * def __cinit__(self): * self.obj = &self.ao # <<<<<<<<<<<<<< * self.ao = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ao)); /* "PETSc/AO.pyx":17 * def __cinit__(self): * self.obj = &self.ao * self.ao = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_v_self->ao = NULL; /* "PETSc/AO.pyx":15 * Type = AOType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ao * self.ao = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":19 * self.ao = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_2view[] = "AO.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(44, 19, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 19, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(44, 19, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_2view(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_2view(struct PyPetscAOObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_cviewer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/AO.pyx":20 * * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL # <<<<<<<<<<<<<< * if viewer is not None: cviewer = viewer.vwr * CHKERR( AOView(self.ao, cviewer) ) */ __pyx_v_cviewer = NULL; /* "PETSc/AO.pyx":21 * def view(self, Viewer viewer=None): * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( AOView(self.ao, cviewer) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_cviewer = __pyx_t_3; } /* "PETSc/AO.pyx":22 * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr * CHKERR( AOView(self.ao, cviewer) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOView(__pyx_v_self->ao, __pyx_v_cviewer)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(44, 22, __pyx_L1_error) /* "PETSc/AO.pyx":19 * self.ao = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer cviewer = NULL * if viewer is not None: cviewer = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":24 * CHKERR( AOView(self.ao, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( AODestroy(&self.ao) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_4destroy[] = "AO.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_4destroy(((struct PyPetscAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_4destroy(struct PyPetscAOObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/AO.pyx":25 * * def destroy(self): * CHKERR( AODestroy(&self.ao) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(AODestroy((&__pyx_v_self->ao))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(44, 25, __pyx_L1_error) /* "PETSc/AO.pyx":26 * def destroy(self): * CHKERR( AODestroy(&self.ao) ) * return self # <<<<<<<<<<<<<< * * def createBasic(self, app, petsc=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/AO.pyx":24 * CHKERR( AOView(self.ao, cviewer) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( AODestroy(&self.ao) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":28 * return self * * def createBasic(self, app, petsc=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_6createBasic[] = "AO.createBasic(self, app, petsc=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_app = 0; PyObject *__pyx_v_petsc = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBasic (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_app,&__pyx_n_s_petsc,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_app)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_petsc); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBasic") < 0)) __PYX_ERR(44, 28, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_app = values[0]; __pyx_v_petsc = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBasic", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 28, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.createBasic", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_6createBasic(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_app, __pyx_v_petsc, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_6createBasic(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm) { IS __pyx_v_isapp; IS __pyx_v_ispetsc; PetscInt __pyx_v_napp; PetscInt *__pyx_v_idxapp; PetscInt __pyx_v_npetsc; PetscInt *__pyx_v_idxpetsc; MPI_Comm __pyx_v_ccomm; AO __pyx_v_newao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; IS __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBasic", 0); __Pyx_INCREF(__pyx_v_app); __Pyx_INCREF(__pyx_v_petsc); /* "PETSc/AO.pyx":29 * * def createBasic(self, app, petsc=None, comm=None): * cdef PetscIS isapp = NULL, ispetsc = NULL # <<<<<<<<<<<<<< * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL */ __pyx_v_isapp = NULL; __pyx_v_ispetsc = NULL; /* "PETSc/AO.pyx":30 * def createBasic(self, app, petsc=None, comm=None): * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, # <<<<<<<<<<<<<< * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_napp = 0; __pyx_v_idxapp = NULL; /* "PETSc/AO.pyx":31 * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL */ __pyx_v_npetsc = 0; __pyx_v_idxpetsc = NULL; /* "PETSc/AO.pyx":32 * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscAO newao = NULL * if isinstance(app, IS): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 32, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/AO.pyx":33 * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL # <<<<<<<<<<<<<< * if isinstance(app, IS): * isapp = (app).iset */ __pyx_v_newao = NULL; /* "PETSc/AO.pyx":34 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/AO.pyx":35 * cdef PetscAO newao = NULL * if isinstance(app, IS): * isapp = (app).iset # <<<<<<<<<<<<<< * if petsc is not None: * ispetsc = (petsc).iset */ __pyx_t_4 = ((struct PyPetscISObject *)__pyx_v_app)->iset; __pyx_v_isapp = __pyx_t_4; /* "PETSc/AO.pyx":36 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) */ __pyx_t_3 = (__pyx_v_petsc != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/AO.pyx":37 * isapp = (app).iset * if petsc is not None: * ispetsc = (petsc).iset # <<<<<<<<<<<<<< * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) * else: */ if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(44, 37, __pyx_L1_error) __pyx_t_4 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset; __pyx_v_ispetsc = __pyx_t_4; /* "PETSc/AO.pyx":36 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) */ } /* "PETSc/AO.pyx":38 * if petsc is not None: * ispetsc = (petsc).iset * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) # <<<<<<<<<<<<<< * else: * app = iarray_i(app, &napp, &idxapp) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateBasicIS(__pyx_v_isapp, __pyx_v_ispetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(44, 38, __pyx_L1_error) /* "PETSc/AO.pyx":34 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ goto __pyx_L3; } /* "PETSc/AO.pyx":40 * CHKERR( AOCreateBasicIS(isapp, ispetsc, &newao) ) * else: * app = iarray_i(app, &napp, &idxapp) # <<<<<<<<<<<<<< * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) */ /*else*/ { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_app, (&__pyx_v_napp), (&__pyx_v_idxapp))); if (unlikely(!__pyx_t_6)) __PYX_ERR(44, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_app, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/AO.pyx":41 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_petsc != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/AO.pyx":42 * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) # <<<<<<<<<<<<<< * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_petsc, (&__pyx_v_npetsc), (&__pyx_v_idxpetsc))); if (unlikely(!__pyx_t_6)) __PYX_ERR(44, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_petsc, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/AO.pyx":43 * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_napp == __pyx_v_npetsc) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_incompatible_array_sizes); __PYX_ERR(44, 43, __pyx_L1_error) } } #endif /* "PETSc/AO.pyx":41 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ } /* "PETSc/AO.pyx":44 * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ao = newao * return self */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateBasic(__pyx_v_ccomm, __pyx_v_napp, __pyx_v_idxapp, __pyx_v_idxpetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(44, 44, __pyx_L1_error) } __pyx_L3:; /* "PETSc/AO.pyx":45 * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ao = __pyx_v_newao; /* "PETSc/AO.pyx":46 * CHKERR( AOCreateBasic(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao * return self # <<<<<<<<<<<<<< * * def createMemoryScalable(self, app, petsc=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/AO.pyx":28 * return self * * def createBasic(self, app, petsc=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.AO.createBasic", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_app); __Pyx_XDECREF(__pyx_v_petsc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":48 * return self * * def createMemoryScalable(self, app, petsc=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_8createMemoryScalable[] = "AO.createMemoryScalable(self, app, petsc=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_app = 0; PyObject *__pyx_v_petsc = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMemoryScalable (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_app,&__pyx_n_s_petsc,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_app)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_petsc); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createMemoryScalable") < 0)) __PYX_ERR(44, 48, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_app = values[0]; __pyx_v_petsc = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMemoryScalable", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 48, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.createMemoryScalable", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_8createMemoryScalable(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_app, __pyx_v_petsc, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_8createMemoryScalable(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm) { IS __pyx_v_isapp; IS __pyx_v_ispetsc; PetscInt __pyx_v_napp; PetscInt *__pyx_v_idxapp; PetscInt __pyx_v_npetsc; PetscInt *__pyx_v_idxpetsc; MPI_Comm __pyx_v_ccomm; AO __pyx_v_newao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; IS __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMemoryScalable", 0); __Pyx_INCREF(__pyx_v_app); __Pyx_INCREF(__pyx_v_petsc); /* "PETSc/AO.pyx":49 * * def createMemoryScalable(self, app, petsc=None, comm=None): * cdef PetscIS isapp = NULL, ispetsc = NULL # <<<<<<<<<<<<<< * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL */ __pyx_v_isapp = NULL; __pyx_v_ispetsc = NULL; /* "PETSc/AO.pyx":50 * def createMemoryScalable(self, app, petsc=None, comm=None): * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, # <<<<<<<<<<<<<< * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_napp = 0; __pyx_v_idxapp = NULL; /* "PETSc/AO.pyx":51 * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL */ __pyx_v_npetsc = 0; __pyx_v_idxpetsc = NULL; /* "PETSc/AO.pyx":52 * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscAO newao = NULL * if isinstance(app, IS): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 52, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/AO.pyx":53 * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL # <<<<<<<<<<<<<< * if isinstance(app, IS): * isapp = (app).iset */ __pyx_v_newao = NULL; /* "PETSc/AO.pyx":54 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/AO.pyx":55 * cdef PetscAO newao = NULL * if isinstance(app, IS): * isapp = (app).iset # <<<<<<<<<<<<<< * if petsc is not None: * ispetsc = (petsc).iset */ __pyx_t_4 = ((struct PyPetscISObject *)__pyx_v_app)->iset; __pyx_v_isapp = __pyx_t_4; /* "PETSc/AO.pyx":56 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) */ __pyx_t_3 = (__pyx_v_petsc != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/AO.pyx":57 * isapp = (app).iset * if petsc is not None: * ispetsc = (petsc).iset # <<<<<<<<<<<<<< * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) * else: */ if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(44, 57, __pyx_L1_error) __pyx_t_4 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset; __pyx_v_ispetsc = __pyx_t_4; /* "PETSc/AO.pyx":56 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) */ } /* "PETSc/AO.pyx":58 * if petsc is not None: * ispetsc = (petsc).iset * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) # <<<<<<<<<<<<<< * else: * app = iarray_i(app, &napp, &idxapp) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMemoryScalableIS(__pyx_v_isapp, __pyx_v_ispetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(44, 58, __pyx_L1_error) /* "PETSc/AO.pyx":54 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ goto __pyx_L3; } /* "PETSc/AO.pyx":60 * CHKERR( AOCreateMemoryScalableIS(isapp, ispetsc, &newao) ) * else: * app = iarray_i(app, &napp, &idxapp) # <<<<<<<<<<<<<< * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) */ /*else*/ { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_app, (&__pyx_v_napp), (&__pyx_v_idxapp))); if (unlikely(!__pyx_t_6)) __PYX_ERR(44, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_app, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/AO.pyx":61 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_petsc != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/AO.pyx":62 * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) # <<<<<<<<<<<<<< * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_petsc, (&__pyx_v_npetsc), (&__pyx_v_idxpetsc))); if (unlikely(!__pyx_t_6)) __PYX_ERR(44, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_petsc, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/AO.pyx":63 * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_napp == __pyx_v_npetsc) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_incompatible_array_sizes); __PYX_ERR(44, 63, __pyx_L1_error) } } #endif /* "PETSc/AO.pyx":61 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ } /* "PETSc/AO.pyx":64 * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ao = newao * return self */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMemoryScalable(__pyx_v_ccomm, __pyx_v_napp, __pyx_v_idxapp, __pyx_v_idxpetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(44, 64, __pyx_L1_error) } __pyx_L3:; /* "PETSc/AO.pyx":65 * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ao = __pyx_v_newao; /* "PETSc/AO.pyx":66 * CHKERR( AOCreateMemoryScalable(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao * return self # <<<<<<<<<<<<<< * * def createMapping(self, app, petsc=None, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/AO.pyx":48 * return self * * def createMemoryScalable(self, app, petsc=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.AO.createMemoryScalable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_app); __Pyx_XDECREF(__pyx_v_petsc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":68 * return self * * def createMapping(self, app, petsc=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_10createMapping[] = "AO.createMapping(self, app, petsc=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_app = 0; PyObject *__pyx_v_petsc = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMapping (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_app,&__pyx_n_s_petsc,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_app)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_petsc); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createMapping") < 0)) __PYX_ERR(44, 68, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_app = values[0]; __pyx_v_petsc = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createMapping", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 68, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.createMapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_10createMapping(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_app, __pyx_v_petsc, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_10createMapping(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_app, PyObject *__pyx_v_petsc, PyObject *__pyx_v_comm) { IS __pyx_v_isapp; IS __pyx_v_ispetsc; PetscInt __pyx_v_napp; PetscInt *__pyx_v_idxapp; PetscInt __pyx_v_npetsc; PetscInt *__pyx_v_idxpetsc; MPI_Comm __pyx_v_ccomm; AO __pyx_v_newao; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_t_3; IS __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMapping", 0); __Pyx_INCREF(__pyx_v_app); __Pyx_INCREF(__pyx_v_petsc); /* "PETSc/AO.pyx":69 * * def createMapping(self, app, petsc=None, comm=None): * cdef PetscIS isapp = NULL, ispetsc = NULL # <<<<<<<<<<<<<< * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL */ __pyx_v_isapp = NULL; __pyx_v_ispetsc = NULL; /* "PETSc/AO.pyx":70 * def createMapping(self, app, petsc=None, comm=None): * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, # <<<<<<<<<<<<<< * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_v_napp = 0; __pyx_v_idxapp = NULL; /* "PETSc/AO.pyx":71 * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL */ __pyx_v_npetsc = 0; __pyx_v_idxpetsc = NULL; /* "PETSc/AO.pyx":72 * cdef PetscInt napp = 0, *idxapp = NULL, * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscAO newao = NULL * if isinstance(app, IS): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(44, 72, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/AO.pyx":73 * cdef PetscInt npetsc = 0, *idxpetsc = NULL * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL # <<<<<<<<<<<<<< * if isinstance(app, IS): * isapp = (app).iset */ __pyx_v_newao = NULL; /* "PETSc/AO.pyx":74 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/AO.pyx":75 * cdef PetscAO newao = NULL * if isinstance(app, IS): * isapp = (app).iset # <<<<<<<<<<<<<< * if petsc is not None: * ispetsc = (petsc).iset */ __pyx_t_4 = ((struct PyPetscISObject *)__pyx_v_app)->iset; __pyx_v_isapp = __pyx_t_4; /* "PETSc/AO.pyx":76 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) */ __pyx_t_3 = (__pyx_v_petsc != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/AO.pyx":77 * isapp = (app).iset * if petsc is not None: * ispetsc = (petsc).iset # <<<<<<<<<<<<<< * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) * else: */ if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(44, 77, __pyx_L1_error) __pyx_t_4 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset; __pyx_v_ispetsc = __pyx_t_4; /* "PETSc/AO.pyx":76 * if isinstance(app, IS): * isapp = (app).iset * if petsc is not None: # <<<<<<<<<<<<<< * ispetsc = (petsc).iset * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) */ } /* "PETSc/AO.pyx":78 * if petsc is not None: * ispetsc = (petsc).iset * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) # <<<<<<<<<<<<<< * else: * app = iarray_i(app, &napp, &idxapp) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMappingIS(__pyx_v_isapp, __pyx_v_ispetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(44, 78, __pyx_L1_error) /* "PETSc/AO.pyx":74 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscAO newao = NULL * if isinstance(app, IS): # <<<<<<<<<<<<<< * isapp = (app).iset * if petsc is not None: */ goto __pyx_L3; } /* "PETSc/AO.pyx":80 * CHKERR( AOCreateMappingIS(isapp, ispetsc, &newao) ) * else: * app = iarray_i(app, &napp, &idxapp) # <<<<<<<<<<<<<< * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) */ /*else*/ { __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_app, (&__pyx_v_napp), (&__pyx_v_idxapp))); if (unlikely(!__pyx_t_6)) __PYX_ERR(44, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_app, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/AO.pyx":81 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ __pyx_t_2 = (__pyx_v_petsc != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/AO.pyx":82 * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) # <<<<<<<<<<<<<< * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_petsc, (&__pyx_v_npetsc), (&__pyx_v_idxpetsc))); if (unlikely(!__pyx_t_6)) __PYX_ERR(44, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_petsc, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/AO.pyx":83 * if petsc is not None: * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" # <<<<<<<<<<<<<< * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_napp == __pyx_v_npetsc) != 0))) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_incompatible_array_sizes); __PYX_ERR(44, 83, __pyx_L1_error) } } #endif /* "PETSc/AO.pyx":81 * else: * app = iarray_i(app, &napp, &idxapp) * if petsc is not None: # <<<<<<<<<<<<<< * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" */ } /* "PETSc/AO.pyx":84 * petsc = iarray_i(petsc, &npetsc, &idxpetsc) * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ao = newao * return self */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOCreateMapping(__pyx_v_ccomm, __pyx_v_napp, __pyx_v_idxapp, __pyx_v_idxpetsc, (&__pyx_v_newao))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(44, 84, __pyx_L1_error) } __pyx_L3:; /* "PETSc/AO.pyx":85 * assert napp == npetsc, "incompatible array sizes" * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ao = __pyx_v_newao; /* "PETSc/AO.pyx":86 * CHKERR( AOCreateMapping(ccomm, napp, idxapp, idxpetsc, &newao) ) * PetscCLEAR(self.obj); self.ao = newao * return self # <<<<<<<<<<<<<< * * def getType(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/AO.pyx":68 * return self * * def createMapping(self, app, petsc=None, comm=None): # <<<<<<<<<<<<<< * cdef PetscIS isapp = NULL, ispetsc = NULL * cdef PetscInt napp = 0, *idxapp = NULL, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.AO.createMapping", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_app); __Pyx_XDECREF(__pyx_v_petsc); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":88 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscAOType cval = NULL * CHKERR( AOGetType(self.ao, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_12getType[] = "AO.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_13getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_12getType(((struct PyPetscAOObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_12getType(struct PyPetscAOObject *__pyx_v_self) { AOType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/AO.pyx":89 * * def getType(self): * cdef PetscAOType cval = NULL # <<<<<<<<<<<<<< * CHKERR( AOGetType(self.ao, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/AO.pyx":90 * def getType(self): * cdef PetscAOType cval = NULL * CHKERR( AOGetType(self.ao, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOGetType(__pyx_v_self->ao, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(44, 90, __pyx_L1_error) /* "PETSc/AO.pyx":91 * cdef PetscAOType cval = NULL * CHKERR( AOGetType(self.ao, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def app2petsc(self, indices): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(44, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/AO.pyx":88 * return self * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscAOType cval = NULL * CHKERR( AOGetType(self.ao, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.AO.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":93 * return bytes2str(cval) * * def app2petsc(self, indices): # <<<<<<<<<<<<<< * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_14app2petsc[] = "AO.app2petsc(self, indices)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("app2petsc (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "app2petsc") < 0)) __PYX_ERR(44, 93, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_indices = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("app2petsc", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 93, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.app2petsc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_14app2petsc(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_indices); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_14app2petsc(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices) { IS __pyx_v_iset; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("app2petsc", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/AO.pyx":94 * * def app2petsc(self, indices): * cdef PetscIS iset = NULL # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): */ __pyx_v_iset = NULL; /* "PETSc/AO.pyx":95 * def app2petsc(self, indices): * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * if isinstance(indices, IS): * iset = (indices).iset */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "PETSc/AO.pyx":96 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/AO.pyx":97 * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): * iset = (indices).iset # <<<<<<<<<<<<<< * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) * else: */ __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_indices)->iset; __pyx_v_iset = __pyx_t_3; /* "PETSc/AO.pyx":98 * if isinstance(indices, IS): * iset = (indices).iset * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) # <<<<<<<<<<<<<< * else: * indices = oarray_i(indices, &nidx, &idx) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOApplicationToPetscIS(__pyx_v_self->ao, __pyx_v_iset)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(44, 98, __pyx_L1_error) /* "PETSc/AO.pyx":96 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) */ goto __pyx_L3; } /* "PETSc/AO.pyx":100 * CHKERR( AOApplicationToPetscIS(self.ao, iset) ) * else: * indices = oarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( AOApplicationToPetsc(self.ao, nidx, idx) ) * return indices */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_5)) __PYX_ERR(44, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/AO.pyx":101 * else: * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOApplicationToPetsc(self.ao, nidx, idx) ) # <<<<<<<<<<<<<< * return indices * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOApplicationToPetsc(__pyx_v_self->ao, __pyx_v_nidx, __pyx_v_idx)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(44, 101, __pyx_L1_error) } __pyx_L3:; /* "PETSc/AO.pyx":102 * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOApplicationToPetsc(self.ao, nidx, idx) ) * return indices # <<<<<<<<<<<<<< * * def petsc2app(self, indices): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_indices); __pyx_r = __pyx_v_indices; goto __pyx_L0; /* "PETSc/AO.pyx":93 * return bytes2str(cval) * * def app2petsc(self, indices): # <<<<<<<<<<<<<< * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.AO.app2petsc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/AO.pyx":104 * return indices * * def petsc2app(self, indices): # <<<<<<<<<<<<<< * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_17petsc2app(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2AO_16petsc2app[] = "AO.petsc2app(self, indices)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2AO_17petsc2app(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_indices = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("petsc2app (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_indices,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "petsc2app") < 0)) __PYX_ERR(44, 104, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_indices = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("petsc2app", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(44, 104, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.AO.petsc2app", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2AO_16petsc2app(((struct PyPetscAOObject *)__pyx_v_self), __pyx_v_indices); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2AO_16petsc2app(struct PyPetscAOObject *__pyx_v_self, PyObject *__pyx_v_indices) { IS __pyx_v_iset; PetscInt __pyx_v_nidx; PetscInt *__pyx_v_idx; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; IS __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("petsc2app", 0); __Pyx_INCREF(__pyx_v_indices); /* "PETSc/AO.pyx":105 * * def petsc2app(self, indices): * cdef PetscIS iset = NULL # <<<<<<<<<<<<<< * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): */ __pyx_v_iset = NULL; /* "PETSc/AO.pyx":106 * def petsc2app(self, indices): * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL # <<<<<<<<<<<<<< * if isinstance(indices, IS): * iset = (indices).iset */ __pyx_v_nidx = 0; __pyx_v_idx = NULL; /* "PETSc/AO.pyx":107 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_ptype_8petsc4py_5PETSc_IS); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/AO.pyx":108 * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): * iset = (indices).iset # <<<<<<<<<<<<<< * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) * else: */ __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_indices)->iset; __pyx_v_iset = __pyx_t_3; /* "PETSc/AO.pyx":109 * if isinstance(indices, IS): * iset = (indices).iset * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) # <<<<<<<<<<<<<< * else: * indices = oarray_i(indices, &nidx, &idx) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOPetscToApplicationIS(__pyx_v_self->ao, __pyx_v_iset)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(44, 109, __pyx_L1_error) /* "PETSc/AO.pyx":107 * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL * if isinstance(indices, IS): # <<<<<<<<<<<<<< * iset = (indices).iset * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) */ goto __pyx_L3; } /* "PETSc/AO.pyx":111 * CHKERR( AOPetscToApplicationIS(self.ao, iset) ) * else: * indices = oarray_i(indices, &nidx, &idx) # <<<<<<<<<<<<<< * CHKERR( AOPetscToApplication(self.ao, nidx, idx) ) * return indices */ /*else*/ { __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_v_indices, (&__pyx_v_nidx), (&__pyx_v_idx))); if (unlikely(!__pyx_t_5)) __PYX_ERR(44, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_indices, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/AO.pyx":112 * else: * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOPetscToApplication(self.ao, nidx, idx) ) # <<<<<<<<<<<<<< * return indices * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(AOPetscToApplication(__pyx_v_self->ao, __pyx_v_nidx, __pyx_v_idx)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(44, 112, __pyx_L1_error) } __pyx_L3:; /* "PETSc/AO.pyx":113 * indices = oarray_i(indices, &nidx, &idx) * CHKERR( AOPetscToApplication(self.ao, nidx, idx) ) * return indices # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_indices); __pyx_r = __pyx_v_indices; goto __pyx_L0; /* "PETSc/AO.pyx":104 * return indices * * def petsc2app(self, indices): # <<<<<<<<<<<<<< * cdef PetscIS iset = NULL * cdef PetscInt nidx = 0, *idx = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.AO.petsc2app", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":36 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dm * self.dm = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DM_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DM_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM___cinit__(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DM___cinit__(struct PyPetscDMObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/DM.pyx":37 * * def __cinit__(self): * self.obj = &self.dm # <<<<<<<<<<<<<< * self.dm = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dm)); /* "PETSc/DM.pyx":38 * def __cinit__(self): * self.obj = &self.dm * self.dm = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_v_self->dm = NULL; /* "PETSc/DM.pyx":36 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dm * self.dm = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":40 * self.dm = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_2view[] = "DM.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(45, 40, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 40, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(45, 40, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_2view(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2view(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/DM.pyx":41 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( DMView(self.dm, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/DM.pyx":42 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( DMView(self.dm, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/DM.pyx":43 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( DMView(self.dm, vwr) ) # <<<<<<<<<<<<<< * * def load(self, Viewer viewer): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMView(__pyx_v_self->dm, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 43, __pyx_L1_error) /* "PETSc/DM.pyx":40 * self.dm = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":45 * CHKERR( DMView(self.dm, vwr) ) * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * CHKERR( DMLoad(self.dm, viewer.vwr) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_5load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_4load[] = "DM.load(self, Viewer viewer)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_5load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load") < 0)) __PYX_ERR(45, 45, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(45, 45, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_4load(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_4load(struct PyPetscDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); /* "PETSc/DM.pyx":46 * * def load(self, Viewer viewer): * CHKERR( DMLoad(self.dm, viewer.vwr) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLoad(__pyx_v_self->dm, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 46, __pyx_L1_error) /* "PETSc/DM.pyx":47 * def load(self, Viewer viewer): * CHKERR( DMLoad(self.dm, viewer.vwr) ) * return self # <<<<<<<<<<<<<< * * def destroy(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DM.pyx":45 * CHKERR( DMView(self.dm, vwr) ) * * def load(self, Viewer viewer): # <<<<<<<<<<<<<< * CHKERR( DMLoad(self.dm, viewer.vwr) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.load", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":49 * return self * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&self.dm) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_6destroy[] = "DM.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_7destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_6destroy(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6destroy(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/DM.pyx":50 * * def destroy(self): * CHKERR( DMDestroy(&self.dm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDestroy((&__pyx_v_self->dm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 50, __pyx_L1_error) /* "PETSc/DM.pyx":51 * def destroy(self): * CHKERR( DMDestroy(&self.dm) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DM.pyx":49 * return self * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&self.dm) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":53 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_8create[] = "DM.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_9create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(45, 53, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 53, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_8create(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_8create(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DM.pyx":54 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 54, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DM.pyx":55 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DM.pyx":56 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 56, __pyx_L1_error) /* "PETSc/DM.pyx":57 * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->dm = __pyx_v_newdm; /* "PETSc/DM.pyx":58 * CHKERR( DMCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def clone(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DM.pyx":53 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":60 * return self * * def clone(self): # <<<<<<<<<<<<<< * cdef DM dm = type(self)() * CHKERR( DMClone(self.dm, &dm.dm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_10clone[] = "DM.clone(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_11clone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clone (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("clone", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clone", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_10clone(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_10clone(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clone", 0); /* "PETSc/DM.pyx":61 * * def clone(self): * cdef DM dm = type(self)() # <<<<<<<<<<<<<< * CHKERR( DMClone(self.dm, &dm.dm) ) * return dm */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 61, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":62 * def clone(self): * cdef DM dm = type(self)() * CHKERR( DMClone(self.dm, &dm.dm) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClone(__pyx_v_self->dm, (&__pyx_v_dm->dm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 62, __pyx_L1_error) /* "PETSc/DM.pyx":63 * cdef DM dm = type(self)() * CHKERR( DMClone(self.dm, &dm.dm) ) * return dm # <<<<<<<<<<<<<< * * def setType(self, dm_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/DM.pyx":60 * return self * * def clone(self): # <<<<<<<<<<<<<< * cdef DM dm = type(self)() * CHKERR( DMClone(self.dm, &dm.dm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.clone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":65 * return dm * * def setType(self, dm_type): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_13setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_12setType[] = "DM.setType(self, dm_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_13setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(45, 65, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 65, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_12setType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_12setType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type) { DMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_dm_type); /* "PETSc/DM.pyx":66 * * def setType(self, dm_type): * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * dm_type = str2bytes(dm_type, &cval) * CHKERR( DMSetType(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DM.pyx":67 * def setType(self, dm_type): * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSetType(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_dm_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dm_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":68 * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) * CHKERR( DMSetType(self.dm, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetType(__pyx_v_self->dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 68, __pyx_L1_error) /* "PETSc/DM.pyx":65 * return dm * * def setType(self, dm_type): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dm_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":70 * CHKERR( DMSetType(self.dm, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * CHKERR( DMGetType(self.dm, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_15getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_14getType[] = "DM.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_15getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_14getType(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_14getType(struct PyPetscDMObject *__pyx_v_self) { DMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/DM.pyx":71 * * def getType(self): * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetType(self.dm, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/DM.pyx":72 * def getType(self): * cdef PetscDMType cval = NULL * CHKERR( DMGetType(self.dm, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetType(__pyx_v_self->dm, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 72, __pyx_L1_error) /* "PETSc/DM.pyx":73 * cdef PetscDMType cval = NULL * CHKERR( DMGetType(self.dm, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def getDimension(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":70 * CHKERR( DMSetType(self.dm, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * CHKERR( DMGetType(self.dm, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":75 * return bytes2str(cval) * * def getDimension(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_16getDimension[] = "DM.getDimension(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDimension (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDimension", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_16getDimension(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_16getDimension(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDimension", 0); /* "PETSc/DM.pyx":76 * * def getDimension(self): * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "PETSc/DM.pyx":77 * def getDimension(self): * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 77, __pyx_L1_error) /* "PETSc/DM.pyx":78 * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def setDimension(self, dim): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":75 * return bytes2str(cval) * * def getDimension(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":80 * return toInt(dim) * * def setDimension(self, dim): # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetDimension(self.dm, cdim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_18setDimension[] = "DM.setDimension(self, dim)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dim = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDimension (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDimension") < 0)) __PYX_ERR(45, 80, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDimension", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 80, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_18setDimension(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dim); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_18setDimension(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDimension", 0); /* "PETSc/DM.pyx":81 * * def setDimension(self, dim): * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, cdim) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 81, __pyx_L1_error) __pyx_v_cdim = __pyx_t_1; /* "PETSc/DM.pyx":82 * def setDimension(self, dim): * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetDimension(self.dm, cdim) ) # <<<<<<<<<<<<<< * * def getCoordinateDim(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetDimension(__pyx_v_self->dm, __pyx_v_cdim)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 82, __pyx_L1_error) /* "PETSc/DM.pyx":80 * return toInt(dim) * * def setDimension(self, dim): # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetDimension(self.dm, cdim) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":84 * CHKERR( DMSetDimension(self.dm, cdim) ) * * def getCoordinateDim(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_20getCoordinateDim[] = "DM.getCoordinateDim(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateDim (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateDim", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateDim", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_20getCoordinateDim(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_20getCoordinateDim(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateDim", 0); /* "PETSc/DM.pyx":85 * * def getCoordinateDim(self): * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "PETSc/DM.pyx":86 * def getCoordinateDim(self): * cdef PetscInt dim = 0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 86, __pyx_L1_error) /* "PETSc/DM.pyx":87 * cdef PetscInt dim = 0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def setCoordinateDim(self, dim): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":84 * CHKERR( DMSetDimension(self.dm, cdim) ) * * def getCoordinateDim(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinateDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":89 * return toInt(dim) * * def setCoordinateDim(self, dim): # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_22setCoordinateDim[] = "DM.setCoordinateDim(self, dim)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dim = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinateDim (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoordinateDim") < 0)) __PYX_ERR(45, 89, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinateDim", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 89, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinateDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_22setCoordinateDim(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dim); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_22setCoordinateDim(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim) { PetscInt __pyx_v_cdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinateDim", 0); /* "PETSc/DM.pyx":90 * * def setCoordinateDim(self, dim): * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 90, __pyx_L1_error) __pyx_v_cdim = __pyx_t_1; /* "PETSc/DM.pyx":91 * def setCoordinateDim(self, dim): * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) # <<<<<<<<<<<<<< * * def setOptionsPrefix(self, prefix): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoordinateDim(__pyx_v_self->dm, __pyx_v_cdim)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 91, __pyx_L1_error) /* "PETSc/DM.pyx":89 * return toInt(dim) * * def setCoordinateDim(self, dim): # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinateDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":93 * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_24setOptionsPrefix[] = "DM.setOptionsPrefix(self, prefix)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOptionsPrefix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOptionsPrefix") < 0)) __PYX_ERR(45, 93, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_prefix = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 93, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_24setOptionsPrefix(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_prefix); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_24setOptionsPrefix(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_prefix) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOptionsPrefix", 0); __Pyx_INCREF(__pyx_v_prefix); /* "PETSc/DM.pyx":94 * * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * prefix = str2bytes(prefix, &cval) * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DM.pyx":95 * def setOptionsPrefix(self, prefix): * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":96 * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetOptionsPrefix(__pyx_v_self->dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 96, __pyx_L1_error) /* "PETSc/DM.pyx":93 * CHKERR( DMSetCoordinateDim(self.dm, cdim) ) * * def setOptionsPrefix(self, prefix): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * prefix = str2bytes(prefix, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setOptionsPrefix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prefix); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":98 * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( DMSetFromOptions(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_27setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_26setFromOptions[] = "DM.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_27setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_26setFromOptions(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_26setFromOptions(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/DM.pyx":99 * * def setFromOptions(self): * CHKERR( DMSetFromOptions(self.dm) ) # <<<<<<<<<<<<<< * * def viewFromOptions(self, name, Object obj=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetFromOptions(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 99, __pyx_L1_error) /* "PETSc/DM.pyx":98 * CHKERR( DMSetOptionsPrefix(self.dm, cval) ) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( DMSetFromOptions(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":101 * CHKERR( DMSetFromOptions(self.dm) ) * * def viewFromOptions(self, name, Object obj=None): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * _ = str2bytes(name, &cname) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_29viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_28viewFromOptions[] = "DM.viewFromOptions(self, name, Object obj=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_29viewFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; struct PyPetscObjectObject *__pyx_v_obj = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFromOptions (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_obj,0}; PyObject* values[2] = {0,0}; values[1] = (PyObject *)((struct PyPetscObjectObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "viewFromOptions") < 0)) __PYX_ERR(45, 101, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_obj = ((struct PyPetscObjectObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 101, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(45, 101, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_28viewFromOptions(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_28viewFromOptions(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj) { char const *__pyx_v_cname; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PetscObject __pyx_v_cobj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFromOptions", 0); /* "PETSc/DM.pyx":102 * * def viewFromOptions(self, name, Object obj=None): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":103 * def viewFromOptions(self, name, Object obj=None): * cdef const char *cname = NULL * _ = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__ = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/DM.pyx":104 * cdef const char *cname = NULL * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * if obj is not None: cobj = obj.obj[0] * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) */ __pyx_v_cobj = NULL; /* "PETSc/DM.pyx":105 * _ = str2bytes(name, &cname) * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] # <<<<<<<<<<<<<< * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_obj) != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { __pyx_v_cobj = (__pyx_v_obj->obj[0]); } /* "PETSc/DM.pyx":106 * cdef PetscObject cobj = NULL * if obj is not None: cobj = obj.obj[0] * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMViewFromOptions(__pyx_v_self->dm, __pyx_v_cobj, __pyx_v_cname)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 106, __pyx_L1_error) /* "PETSc/DM.pyx":101 * CHKERR( DMSetFromOptions(self.dm) ) * * def viewFromOptions(self, name, Object obj=None): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * _ = str2bytes(name, &cname) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.viewFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":108 * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( DMSetUp(self.dm) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_31setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_30setUp[] = "DM.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_31setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_30setUp(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_30setUp(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/DM.pyx":109 * * def setUp(self): * CHKERR( DMSetUp(self.dm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 109, __pyx_L1_error) /* "PETSc/DM.pyx":110 * def setUp(self): * CHKERR( DMSetUp(self.dm) ) * return self # <<<<<<<<<<<<<< * * # --- application context --- */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DM.pyx":108 * CHKERR( DMViewFromOptions(self.dm, cobj, cname) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( DMSetUp(self.dm) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":114 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_33setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_32setAppCtx[] = "DM.setAppCtx(self, appctx)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_33setAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_appctx = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAppCtx (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_appctx,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_appctx)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAppCtx") < 0)) __PYX_ERR(45, 114, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_appctx = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 114, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_32setAppCtx(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_appctx); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_32setAppCtx(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_appctx) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAppCtx", 0); /* "PETSc/DM.pyx":115 * * def setAppCtx(self, appctx): * self.set_attr('__appctx__', appctx) # <<<<<<<<<<<<<< * * def getAppCtx(self): */ __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__"), __pyx_v_appctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":114 * # --- application context --- * * def setAppCtx(self, appctx): # <<<<<<<<<<<<<< * self.set_attr('__appctx__', appctx) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":117 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_35getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_34getAppCtx[] = "DM.getAppCtx(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_35getAppCtx(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAppCtx (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAppCtx", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAppCtx", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_34getAppCtx(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_34getAppCtx(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAppCtx", 0); /* "PETSc/DM.pyx":118 * * def getAppCtx(self): * return self.get_attr('__appctx__') # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__appctx__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":117 * self.set_attr('__appctx__', appctx) * * def getAppCtx(self): # <<<<<<<<<<<<<< * return self.get_attr('__appctx__') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getAppCtx", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":122 * # * * def setBasicAdjacency(self, useCone, useClosure): # <<<<<<<<<<<<<< * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_37setBasicAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_36setBasicAdjacency[] = "DM.setBasicAdjacency(self, useCone, useClosure)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_37setBasicAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_useCone = 0; PyObject *__pyx_v_useClosure = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBasicAdjacency (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_useCone,&__pyx_n_s_useClosure,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_useCone)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_useClosure)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setBasicAdjacency", 1, 2, 2, 1); __PYX_ERR(45, 122, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBasicAdjacency") < 0)) __PYX_ERR(45, 122, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_useCone = values[0]; __pyx_v_useClosure = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBasicAdjacency", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 122, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setBasicAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_36setBasicAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_useCone, __pyx_v_useClosure); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_36setBasicAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure) { PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBasicAdjacency", 0); /* "PETSc/DM.pyx":123 * * def setBasicAdjacency(self, useCone, useClosure): * cdef PetscBool uC = useCone # <<<<<<<<<<<<<< * cdef PetscBool uCl = useClosure * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useCone)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 123, __pyx_L1_error) __pyx_v_uC = __pyx_t_1; /* "PETSc/DM.pyx":124 * def setBasicAdjacency(self, useCone, useClosure): * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure # <<<<<<<<<<<<<< * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useClosure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 124, __pyx_L1_error) __pyx_v_uCl = __pyx_t_1; /* "PETSc/DM.pyx":125 * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) # <<<<<<<<<<<<<< * * def getBasicAdjacency(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetBasicAdjacency(__pyx_v_self->dm, __pyx_v_uC, __pyx_v_uCl)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 125, __pyx_L1_error) /* "PETSc/DM.pyx":122 * # * * def setBasicAdjacency(self, useCone, useClosure): # <<<<<<<<<<<<<< * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setBasicAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":127 * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) * * def getBasicAdjacency(self): # <<<<<<<<<<<<<< * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_39getBasicAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_38getBasicAdjacency[] = "DM.getBasicAdjacency(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_39getBasicAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBasicAdjacency (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBasicAdjacency", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBasicAdjacency", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_38getBasicAdjacency(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_38getBasicAdjacency(struct PyPetscDMObject *__pyx_v_self) { PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBasicAdjacency", 0); /* "PETSc/DM.pyx":128 * * def getBasicAdjacency(self): * cdef PetscBool uC = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) */ __pyx_v_uC = PETSC_FALSE; /* "PETSc/DM.pyx":129 * def getBasicAdjacency(self): * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) * return toBool(uC), toBool(uCl) */ __pyx_v_uCl = PETSC_FALSE; /* "PETSc/DM.pyx":130 * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) # <<<<<<<<<<<<<< * return toBool(uC), toBool(uCl) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetBasicAdjacency(__pyx_v_self->dm, (&__pyx_v_uC), (&__pyx_v_uCl))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 130, __pyx_L1_error) /* "PETSc/DM.pyx":131 * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetBasicAdjacency(self.dm, &uC, &uCl) ) * return toBool(uC), toBool(uCl) # <<<<<<<<<<<<<< * * def setFieldAdjacency(self, field, useCone, useClosure): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uC); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uCl); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":127 * CHKERR( DMSetBasicAdjacency(self.dm, uC, uCl) ) * * def getBasicAdjacency(self): # <<<<<<<<<<<<<< * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.getBasicAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":133 * return toBool(uC), toBool(uCl) * * def setFieldAdjacency(self, field, useCone, useClosure): # <<<<<<<<<<<<<< * cdef PetscInt f = asInt(field) * cdef PetscBool uC = useCone */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_41setFieldAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_40setFieldAdjacency[] = "DM.setFieldAdjacency(self, field, useCone, useClosure)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_41setFieldAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_useCone = 0; PyObject *__pyx_v_useClosure = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldAdjacency (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_useCone,&__pyx_n_s_useClosure,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_useCone)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldAdjacency", 1, 3, 3, 1); __PYX_ERR(45, 133, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_useClosure)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldAdjacency", 1, 3, 3, 2); __PYX_ERR(45, 133, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldAdjacency") < 0)) __PYX_ERR(45, 133, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_field = values[0]; __pyx_v_useCone = values[1]; __pyx_v_useClosure = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldAdjacency", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 133, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_40setFieldAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field, __pyx_v_useCone, __pyx_v_useClosure); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_40setFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure) { PetscInt __pyx_v_f; PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldAdjacency", 0); /* "PETSc/DM.pyx":134 * * def setFieldAdjacency(self, field, useCone, useClosure): * cdef PetscInt f = asInt(field) # <<<<<<<<<<<<<< * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 134, __pyx_L1_error) __pyx_v_f = __pyx_t_1; /* "PETSc/DM.pyx":135 * def setFieldAdjacency(self, field, useCone, useClosure): * cdef PetscInt f = asInt(field) * cdef PetscBool uC = useCone # <<<<<<<<<<<<<< * cdef PetscBool uCl = useClosure * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useCone)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 135, __pyx_L1_error) __pyx_v_uC = __pyx_t_2; /* "PETSc/DM.pyx":136 * cdef PetscInt f = asInt(field) * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure # <<<<<<<<<<<<<< * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) * */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useClosure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 136, __pyx_L1_error) __pyx_v_uCl = __pyx_t_2; /* "PETSc/DM.pyx":137 * cdef PetscBool uC = useCone * cdef PetscBool uCl = useClosure * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) # <<<<<<<<<<<<<< * * def getFieldAdjacency(self, field): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetAdjacency(__pyx_v_self->dm, __pyx_v_f, __pyx_v_uC, __pyx_v_uCl)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 137, __pyx_L1_error) /* "PETSc/DM.pyx":133 * return toBool(uC), toBool(uCl) * * def setFieldAdjacency(self, field, useCone, useClosure): # <<<<<<<<<<<<<< * cdef PetscInt f = asInt(field) * cdef PetscBool uC = useCone */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":139 * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) * * def getFieldAdjacency(self, field): # <<<<<<<<<<<<<< * cdef PetscInt f = asInt(field) * cdef PetscBool uC = PETSC_FALSE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_43getFieldAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_42getFieldAdjacency[] = "DM.getFieldAdjacency(self, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_43getFieldAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldAdjacency (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldAdjacency") < 0)) __PYX_ERR(45, 139, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldAdjacency", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 139, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_42getFieldAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_42getFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_f; PetscBool __pyx_v_uC; PetscBool __pyx_v_uCl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldAdjacency", 0); /* "PETSc/DM.pyx":140 * * def getFieldAdjacency(self, field): * cdef PetscInt f = asInt(field) # <<<<<<<<<<<<<< * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 140, __pyx_L1_error) __pyx_v_f = __pyx_t_1; /* "PETSc/DM.pyx":141 * def getFieldAdjacency(self, field): * cdef PetscInt f = asInt(field) * cdef PetscBool uC = PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) */ __pyx_v_uC = PETSC_FALSE; /* "PETSc/DM.pyx":142 * cdef PetscInt f = asInt(field) * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) * return toBool(uC), toBool(uCl) */ __pyx_v_uCl = PETSC_FALSE; /* "PETSc/DM.pyx":143 * cdef PetscBool uC = PETSC_FALSE * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) # <<<<<<<<<<<<<< * return toBool(uC), toBool(uCl) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetAdjacency(__pyx_v_self->dm, __pyx_v_f, (&__pyx_v_uC), (&__pyx_v_uCl))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 143, __pyx_L1_error) /* "PETSc/DM.pyx":144 * cdef PetscBool uCl = PETSC_FALSE * CHKERR( DMGetAdjacency(self.dm, f, &uC, &uCl) ) * return toBool(uC), toBool(uCl) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uC); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uCl); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":139 * CHKERR( DMSetAdjacency(self.dm, f, uC, uCl) ) * * def getFieldAdjacency(self, field): # <<<<<<<<<<<<<< * cdef PetscInt f = asInt(field) * cdef PetscBool uC = PETSC_FALSE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DM.getFieldAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":148 * # * * def setNumFields(self, numFields): # <<<<<<<<<<<<<< * cdef PetscInt cnum = asInt(numFields) * CHKERR( DMSetNumFields(self.dm, cnum) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_45setNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_44setNumFields[] = "DM.setNumFields(self, numFields)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_45setNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_numFields = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setNumFields (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numFields,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numFields)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setNumFields") < 0)) __PYX_ERR(45, 148, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_numFields = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 148, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_44setNumFields(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_numFields); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_44setNumFields(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_numFields) { PetscInt __pyx_v_cnum; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setNumFields", 0); /* "PETSc/DM.pyx":149 * * def setNumFields(self, numFields): * cdef PetscInt cnum = asInt(numFields) # <<<<<<<<<<<<<< * CHKERR( DMSetNumFields(self.dm, cnum) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numFields); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 149, __pyx_L1_error) __pyx_v_cnum = __pyx_t_1; /* "PETSc/DM.pyx":150 * def setNumFields(self, numFields): * cdef PetscInt cnum = asInt(numFields) * CHKERR( DMSetNumFields(self.dm, cnum) ) # <<<<<<<<<<<<<< * * def getNumFields(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetNumFields(__pyx_v_self->dm, __pyx_v_cnum)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 150, __pyx_L1_error) /* "PETSc/DM.pyx":148 * # * * def setNumFields(self, numFields): # <<<<<<<<<<<<<< * cdef PetscInt cnum = asInt(numFields) * CHKERR( DMSetNumFields(self.dm, cnum) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":152 * CHKERR( DMSetNumFields(self.dm, cnum) ) * * def getNumFields(self): # <<<<<<<<<<<<<< * cdef PetscInt cnum = 0 * CHKERR( DMGetNumFields(self.dm, &cnum) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_47getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_46getNumFields[] = "DM.getNumFields(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_47getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumFields (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNumFields", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumFields", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_46getNumFields(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_46getNumFields(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_cnum; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumFields", 0); /* "PETSc/DM.pyx":153 * * def getNumFields(self): * cdef PetscInt cnum = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetNumFields(self.dm, &cnum) ) * return toInt(cnum) */ __pyx_v_cnum = 0; /* "PETSc/DM.pyx":154 * def getNumFields(self): * cdef PetscInt cnum = 0 * CHKERR( DMGetNumFields(self.dm, &cnum) ) # <<<<<<<<<<<<<< * return toInt(cnum) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetNumFields(__pyx_v_self->dm, (&__pyx_v_cnum))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 154, __pyx_L1_error) /* "PETSc/DM.pyx":155 * cdef PetscInt cnum = 0 * CHKERR( DMGetNumFields(self.dm, &cnum) ) * return toInt(cnum) # <<<<<<<<<<<<<< * * def setField(self, index, Object field, label=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":152 * CHKERR( DMSetNumFields(self.dm, cnum) ) * * def getNumFields(self): # <<<<<<<<<<<<<< * cdef PetscInt cnum = 0 * CHKERR( DMGetNumFields(self.dm, &cnum) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":157 * return toInt(cnum) * * def setField(self, index, Object field, label=None): # <<<<<<<<<<<<<< * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = field.obj[0] */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_49setField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_48setField[] = "DM.setField(self, index, Object field, label=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_49setField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; struct PyPetscObjectObject *__pyx_v_field = 0; PyObject *__pyx_v_label = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_field,&__pyx_n_s_label,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setField", 0, 2, 3, 1); __PYX_ERR(45, 157, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_label); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setField") < 0)) __PYX_ERR(45, 157, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_index = values[0]; __pyx_v_field = ((struct PyPetscObjectObject *)values[1]); __pyx_v_label = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setField", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 157, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "field", 0))) __PYX_ERR(45, 157, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_48setField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index, __pyx_v_field, __pyx_v_label); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_48setField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label) { PetscInt __pyx_v_cidx; PetscObject __pyx_v_cobj; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setField", 0); /* "PETSc/DM.pyx":158 * * def setField(self, index, Object field, label=None): * cdef PetscInt cidx = asInt(index) # <<<<<<<<<<<<<< * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 158, __pyx_L1_error) __pyx_v_cidx = __pyx_t_1; /* "PETSc/DM.pyx":159 * def setField(self, index, Object field, label=None): * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = field.obj[0] # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * assert label is None */ __pyx_v_cobj = (__pyx_v_field->obj[0]); /* "PETSc/DM.pyx":160 * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * assert label is None * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) */ __pyx_v_clbl = NULL; /* "PETSc/DM.pyx":161 * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL * assert label is None # <<<<<<<<<<<<<< * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_2 = (__pyx_v_label == Py_None); if (unlikely(!(__pyx_t_2 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(45, 161, __pyx_L1_error) } } #endif /* "PETSc/DM.pyx":162 * cdef PetscDMLabel clbl = NULL * assert label is None * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) # <<<<<<<<<<<<<< * * def getField(self, index): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetField(__pyx_v_self->dm, __pyx_v_cidx, __pyx_v_clbl, __pyx_v_cobj)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 162, __pyx_L1_error) /* "PETSc/DM.pyx":157 * return toInt(cnum) * * def setField(self, index, Object field, label=None): # <<<<<<<<<<<<<< * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = field.obj[0] */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":164 * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) * * def getField(self, index): # <<<<<<<<<<<<<< * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_51getField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_50getField[] = "DM.getField(self, index)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_51getField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getField") < 0)) __PYX_ERR(45, 164, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 164, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_50getField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_50getField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_cidx; PetscObject __pyx_v_cobj; DMLabel __pyx_v_clbl; struct PyPetscObjectObject *__pyx_v_field = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getField", 0); /* "PETSc/DM.pyx":165 * * def getField(self, index): * cdef PetscInt cidx = asInt(index) # <<<<<<<<<<<<<< * cdef PetscObject cobj = NULL * cdef PetscDMLabel clbl = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 165, __pyx_L1_error) __pyx_v_cidx = __pyx_t_1; /* "PETSc/DM.pyx":166 * def getField(self, index): * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) */ __pyx_v_cobj = NULL; /* "PETSc/DM.pyx":167 * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) * assert clbl == NULL */ __pyx_v_clbl = NULL; /* "PETSc/DM.pyx":168 * cdef PetscObject cobj = NULL * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) # <<<<<<<<<<<<<< * assert clbl == NULL * cdef Object field = subtype_Object(cobj)() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetField(__pyx_v_self->dm, __pyx_v_cidx, (&__pyx_v_clbl), (&__pyx_v_cobj))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 168, __pyx_L1_error) /* "PETSc/DM.pyx":169 * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) * assert clbl == NULL # <<<<<<<<<<<<<< * cdef Object field = subtype_Object(cobj)() * field.obj[0] = cobj */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_clbl == NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(45, 169, __pyx_L1_error) } } #endif /* "PETSc/DM.pyx":170 * CHKERR( DMGetField(self.dm, cidx, &clbl, &cobj) ) * assert clbl == NULL * cdef Object field = subtype_Object(cobj)() # <<<<<<<<<<<<<< * field.obj[0] = cobj * PetscINCREF(field.obj) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_cobj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(45, 170, __pyx_L1_error) __pyx_v_field = ((struct PyPetscObjectObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DM.pyx":171 * assert clbl == NULL * cdef Object field = subtype_Object(cobj)() * field.obj[0] = cobj # <<<<<<<<<<<<<< * PetscINCREF(field.obj) * return (field, None) */ (__pyx_v_field->obj[0]) = __pyx_v_cobj; /* "PETSc/DM.pyx":172 * cdef Object field = subtype_Object(cobj)() * field.obj[0] = cobj * PetscINCREF(field.obj) # <<<<<<<<<<<<<< * return (field, None) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_field->obj)); /* "PETSc/DM.pyx":173 * field.obj[0] = cobj * PetscINCREF(field.obj) * return (field, None) # <<<<<<<<<<<<<< * * def addField(self, Object field, label=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_field)); __Pyx_GIVEREF(((PyObject *)__pyx_v_field)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_field)); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_4, 1, Py_None); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":164 * CHKERR( DMSetField(self.dm, cidx, clbl, cobj) ) * * def getField(self, index): # <<<<<<<<<<<<<< * cdef PetscInt cidx = asInt(index) * cdef PetscObject cobj = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_field); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":175 * return (field, None) * * def addField(self, Object field, label=None): # <<<<<<<<<<<<<< * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_53addField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_52addField[] = "DM.addField(self, Object field, label=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_53addField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscObjectObject *__pyx_v_field = 0; PyObject *__pyx_v_label = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_label,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_label); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addField") < 0)) __PYX_ERR(45, 175, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_field = ((struct PyPetscObjectObject *)values[0]); __pyx_v_label = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addField", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 175, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.addField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_field), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "field", 0))) __PYX_ERR(45, 175, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_52addField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field, __pyx_v_label); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_52addField(struct PyPetscDMObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label) { PetscObject __pyx_v_cobj; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addField", 0); /* "PETSc/DM.pyx":176 * * def addField(self, Object field, label=None): * cdef PetscObject cobj = field.obj[0] # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * assert label is None */ __pyx_v_cobj = (__pyx_v_field->obj[0]); /* "PETSc/DM.pyx":177 * def addField(self, Object field, label=None): * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * assert label is None * CHKERR( DMAddField(self.dm, clbl, cobj) ) */ __pyx_v_clbl = NULL; /* "PETSc/DM.pyx":178 * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL * assert label is None # <<<<<<<<<<<<<< * CHKERR( DMAddField(self.dm, clbl, cobj) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = (__pyx_v_label == Py_None); if (unlikely(!(__pyx_t_1 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(45, 178, __pyx_L1_error) } } #endif /* "PETSc/DM.pyx":179 * cdef PetscDMLabel clbl = NULL * assert label is None * CHKERR( DMAddField(self.dm, clbl, cobj) ) # <<<<<<<<<<<<<< * * def copyFields(self, DM dm): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMAddField(__pyx_v_self->dm, __pyx_v_clbl, __pyx_v_cobj)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 179, __pyx_L1_error) /* "PETSc/DM.pyx":175 * return (field, None) * * def addField(self, Object field, label=None): # <<<<<<<<<<<<<< * cdef PetscObject cobj = field.obj[0] * cdef PetscDMLabel clbl = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.addField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":181 * CHKERR( DMAddField(self.dm, clbl, cobj) ) * * def copyFields(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMCopyFields(self.dm, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_55copyFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_54copyFields[] = "DM.copyFields(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_55copyFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyFields (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copyFields") < 0)) __PYX_ERR(45, 181, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyFields", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 181, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(45, 181, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_54copyFields(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_54copyFields(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyFields", 0); /* "PETSc/DM.pyx":182 * * def copyFields(self, DM dm): * CHKERR( DMCopyFields(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def createDS(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyFields(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 182, __pyx_L1_error) /* "PETSc/DM.pyx":181 * CHKERR( DMAddField(self.dm, clbl, cobj) ) * * def copyFields(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMCopyFields(self.dm, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":184 * CHKERR( DMCopyFields(self.dm, dm.dm) ) * * def createDS(self): # <<<<<<<<<<<<<< * CHKERR( DMCreateDS(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_57createDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_56createDS[] = "DM.createDS(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_57createDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createDS (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createDS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createDS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_56createDS(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_56createDS(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createDS", 0); /* "PETSc/DM.pyx":185 * * def createDS(self): * CHKERR( DMCreateDS(self.dm) ) # <<<<<<<<<<<<<< * * def clearDS(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateDS(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 185, __pyx_L1_error) /* "PETSc/DM.pyx":184 * CHKERR( DMCopyFields(self.dm, dm.dm) ) * * def createDS(self): # <<<<<<<<<<<<<< * CHKERR( DMCreateDS(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":187 * CHKERR( DMCreateDS(self.dm) ) * * def clearDS(self): # <<<<<<<<<<<<<< * CHKERR( DMClearDS(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_59clearDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_58clearDS[] = "DM.clearDS(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_59clearDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearDS (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("clearDS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clearDS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_58clearDS(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_58clearDS(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearDS", 0); /* "PETSc/DM.pyx":188 * * def clearDS(self): * CHKERR( DMClearDS(self.dm) ) # <<<<<<<<<<<<<< * * def getDS(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClearDS(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 188, __pyx_L1_error) /* "PETSc/DM.pyx":187 * CHKERR( DMCreateDS(self.dm) ) * * def clearDS(self): # <<<<<<<<<<<<<< * CHKERR( DMClearDS(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.clearDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":190 * CHKERR( DMClearDS(self.dm) ) * * def getDS(self): # <<<<<<<<<<<<<< * cdef DS ds = DS() * CHKERR( DMGetDS(self.dm, &ds.ds) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_61getDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_60getDS[] = "DM.getDS(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_61getDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDS (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_60getDS(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_60getDS(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscDSObject *__pyx_v_ds = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDS", 0); /* "PETSc/DM.pyx":191 * * def getDS(self): * cdef DS ds = DS() # <<<<<<<<<<<<<< * CHKERR( DMGetDS(self.dm, &ds.ds) ) * PetscINCREF(ds.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ds = ((struct PyPetscDSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":192 * def getDS(self): * cdef DS ds = DS() * CHKERR( DMGetDS(self.dm, &ds.ds) ) # <<<<<<<<<<<<<< * PetscINCREF(ds.obj) * return ds */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDS(__pyx_v_self->dm, (&__pyx_v_ds->ds))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 192, __pyx_L1_error) /* "PETSc/DM.pyx":193 * cdef DS ds = DS() * CHKERR( DMGetDS(self.dm, &ds.ds) ) * PetscINCREF(ds.obj) # <<<<<<<<<<<<<< * return ds * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ds->__pyx_base.obj)); /* "PETSc/DM.pyx":194 * CHKERR( DMGetDS(self.dm, &ds.ds) ) * PetscINCREF(ds.obj) * return ds # <<<<<<<<<<<<<< * * def copyDS(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ds)); __pyx_r = ((PyObject *)__pyx_v_ds); goto __pyx_L0; /* "PETSc/DM.pyx":190 * CHKERR( DMClearDS(self.dm) ) * * def getDS(self): # <<<<<<<<<<<<<< * cdef DS ds = DS() * CHKERR( DMGetDS(self.dm, &ds.ds) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ds); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":196 * return ds * * def copyDS(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMCopyDS(self.dm, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_63copyDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_62copyDS[] = "DM.copyDS(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_63copyDS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyDS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copyDS") < 0)) __PYX_ERR(45, 196, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyDS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 196, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(45, 196, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_62copyDS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_62copyDS(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyDS", 0); /* "PETSc/DM.pyx":197 * * def copyDS(self, DM dm): * CHKERR( DMCopyDS(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def copyDisc(self, DM dm): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyDS(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 197, __pyx_L1_error) /* "PETSc/DM.pyx":196 * return ds * * def copyDS(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMCopyDS(self.dm, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":199 * CHKERR( DMCopyDS(self.dm, dm.dm) ) * * def copyDisc(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMCopyDisc(self.dm, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_65copyDisc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_64copyDisc[] = "DM.copyDisc(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_65copyDisc(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyDisc (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copyDisc") < 0)) __PYX_ERR(45, 199, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyDisc", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 199, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDisc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(45, 199, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_64copyDisc(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_64copyDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyDisc", 0); /* "PETSc/DM.pyx":200 * * def copyDisc(self, DM dm): * CHKERR( DMCopyDisc(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyDisc(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 200, __pyx_L1_error) /* "PETSc/DM.pyx":199 * CHKERR( DMCopyDS(self.dm, dm.dm) ) * * def copyDisc(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMCopyDisc(self.dm, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.copyDisc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":204 * # * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 1 * CHKERR( DMGetBlockSize(self.dm, &bs) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_67getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_66getBlockSize[] = "DM.getBlockSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_67getBlockSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBlockSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_66getBlockSize(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_66getBlockSize(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_bs; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBlockSize", 0); /* "PETSc/DM.pyx":205 * * def getBlockSize(self): * cdef PetscInt bs = 1 # <<<<<<<<<<<<<< * CHKERR( DMGetBlockSize(self.dm, &bs) ) * return toInt(bs) */ __pyx_v_bs = 1; /* "PETSc/DM.pyx":206 * def getBlockSize(self): * cdef PetscInt bs = 1 * CHKERR( DMGetBlockSize(self.dm, &bs) ) # <<<<<<<<<<<<<< * return toInt(bs) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetBlockSize(__pyx_v_self->dm, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 206, __pyx_L1_error) /* "PETSc/DM.pyx":207 * cdef PetscInt bs = 1 * CHKERR( DMGetBlockSize(self.dm, &bs) ) * return toInt(bs) # <<<<<<<<<<<<<< * * def setVecType(self, vec_type): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":204 * # * * def getBlockSize(self): # <<<<<<<<<<<<<< * cdef PetscInt bs = 1 * CHKERR( DMGetBlockSize(self.dm, &bs) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":209 * return toInt(bs) * * def setVecType(self, vec_type): # <<<<<<<<<<<<<< * cdef PetscVecType vtype = NULL * vec_type = str2bytes(vec_type, &vtype) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_69setVecType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_68setVecType[] = "DM.setVecType(self, vec_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_69setVecType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_vec_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVecType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVecType") < 0)) __PYX_ERR(45, 209, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVecType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 209, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_68setVecType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vec_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_68setVecType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_vec_type) { VecType __pyx_v_vtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVecType", 0); __Pyx_INCREF(__pyx_v_vec_type); /* "PETSc/DM.pyx":210 * * def setVecType(self, vec_type): * cdef PetscVecType vtype = NULL # <<<<<<<<<<<<<< * vec_type = str2bytes(vec_type, &vtype) * CHKERR( DMSetVecType(self.dm, vtype) ) */ __pyx_v_vtype = NULL; /* "PETSc/DM.pyx":211 * def setVecType(self, vec_type): * cdef PetscVecType vtype = NULL * vec_type = str2bytes(vec_type, &vtype) # <<<<<<<<<<<<<< * CHKERR( DMSetVecType(self.dm, vtype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_vec_type, (&__pyx_v_vtype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_vec_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":212 * cdef PetscVecType vtype = NULL * vec_type = str2bytes(vec_type, &vtype) * CHKERR( DMSetVecType(self.dm, vtype) ) # <<<<<<<<<<<<<< * * def createGlobalVec(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetVecType(__pyx_v_self->dm, __pyx_v_vtype)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 212, __pyx_L1_error) /* "PETSc/DM.pyx":209 * return toInt(bs) * * def setVecType(self, vec_type): # <<<<<<<<<<<<<< * cdef PetscVecType vtype = NULL * vec_type = str2bytes(vec_type, &vtype) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setVecType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_vec_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":214 * CHKERR( DMSetVecType(self.dm, vtype) ) * * def createGlobalVec(self): # <<<<<<<<<<<<<< * cdef Vec vg = Vec() * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_71createGlobalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_70createGlobalVec[] = "DM.createGlobalVec(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_71createGlobalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGlobalVec (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createGlobalVec", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createGlobalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_70createGlobalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_70createGlobalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGlobalVec", 0); /* "PETSc/DM.pyx":215 * * def createGlobalVec(self): * cdef Vec vg = Vec() # <<<<<<<<<<<<<< * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) * return vg */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":216 * def createGlobalVec(self): * cdef Vec vg = Vec() * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) # <<<<<<<<<<<<<< * return vg * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 216, __pyx_L1_error) /* "PETSc/DM.pyx":217 * cdef Vec vg = Vec() * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) * return vg # <<<<<<<<<<<<<< * * def createLocalVec(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vg)); __pyx_r = ((PyObject *)__pyx_v_vg); goto __pyx_L0; /* "PETSc/DM.pyx":214 * CHKERR( DMSetVecType(self.dm, vtype) ) * * def createGlobalVec(self): # <<<<<<<<<<<<<< * cdef Vec vg = Vec() * CHKERR( DMCreateGlobalVector(self.dm, &vg.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":219 * return vg * * def createLocalVec(self): # <<<<<<<<<<<<<< * cdef Vec vl = Vec() * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_73createLocalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_72createLocalVec[] = "DM.createLocalVec(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_73createLocalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLocalVec (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createLocalVec", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createLocalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_72createLocalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_72createLocalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLocalVec", 0); /* "PETSc/DM.pyx":220 * * def createLocalVec(self): * cdef Vec vl = Vec() # <<<<<<<<<<<<<< * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) * return vl */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":221 * def createLocalVec(self): * cdef Vec vl = Vec() * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) # <<<<<<<<<<<<<< * return vl * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 221, __pyx_L1_error) /* "PETSc/DM.pyx":222 * cdef Vec vl = Vec() * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) * return vl # <<<<<<<<<<<<<< * * def getGlobalVec(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vl)); __pyx_r = ((PyObject *)__pyx_v_vl); goto __pyx_L0; /* "PETSc/DM.pyx":219 * return vg * * def createLocalVec(self): # <<<<<<<<<<<<<< * cdef Vec vl = Vec() * CHKERR( DMCreateLocalVector(self.dm, &vl.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":224 * return vl * * def getGlobalVec(self): # <<<<<<<<<<<<<< * cdef Vec vg = Vec() * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_75getGlobalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_74getGlobalVec[] = "DM.getGlobalVec(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_75getGlobalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalVec (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalVec", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_74getGlobalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_74getGlobalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalVec", 0); /* "PETSc/DM.pyx":225 * * def getGlobalVec(self): * cdef Vec vg = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) * PetscINCREF(vg.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":226 * def getGlobalVec(self): * cdef Vec vg = Vec() * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vg.obj) * return vg */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 226, __pyx_L1_error) /* "PETSc/DM.pyx":227 * cdef Vec vg = Vec() * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) * PetscINCREF(vg.obj) # <<<<<<<<<<<<<< * return vg * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vg->__pyx_base.obj)); /* "PETSc/DM.pyx":228 * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) * PetscINCREF(vg.obj) * return vg # <<<<<<<<<<<<<< * * def restoreGlobalVec(self, Vec vg): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vg)); __pyx_r = ((PyObject *)__pyx_v_vg); goto __pyx_L0; /* "PETSc/DM.pyx":224 * return vl * * def getGlobalVec(self): # <<<<<<<<<<<<<< * cdef Vec vg = Vec() * CHKERR( DMGetGlobalVector(self.dm, &vg.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":230 * return vg * * def restoreGlobalVec(self, Vec vg): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDereference(vg.vec) ) * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_77restoreGlobalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_76restoreGlobalVec[] = "DM.restoreGlobalVec(self, Vec vg)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_77restoreGlobalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vg = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreGlobalVec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vg)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreGlobalVec") < 0)) __PYX_ERR(45, 230, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vg = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreGlobalVec", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 230, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(45, 230, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_76restoreGlobalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vg); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_76restoreGlobalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreGlobalVec", 0); /* "PETSc/DM.pyx":231 * * def restoreGlobalVec(self, Vec vg): * CHKERR( PetscObjectDereference(vg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDereference(((PetscObject)__pyx_v_vg->vec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 231, __pyx_L1_error) /* "PETSc/DM.pyx":232 * def restoreGlobalVec(self, Vec vg): * CHKERR( PetscObjectDereference(vg.vec) ) * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) # <<<<<<<<<<<<<< * * def getLocalVec(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 232, __pyx_L1_error) /* "PETSc/DM.pyx":230 * return vg * * def restoreGlobalVec(self, Vec vg): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDereference(vg.vec) ) * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":234 * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) * * def getLocalVec(self): # <<<<<<<<<<<<<< * cdef Vec vl = Vec() * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_79getLocalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_78getLocalVec[] = "DM.getLocalVec(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_79getLocalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalVec (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalVec", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_78getLocalVec(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_78getLocalVec(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalVec", 0); /* "PETSc/DM.pyx":235 * * def getLocalVec(self): * cdef Vec vl = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) * PetscINCREF(vl.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":236 * def getLocalVec(self): * cdef Vec vl = Vec() * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(vl.obj) * return vl */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 236, __pyx_L1_error) /* "PETSc/DM.pyx":237 * cdef Vec vl = Vec() * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) * PetscINCREF(vl.obj) # <<<<<<<<<<<<<< * return vl * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vl->__pyx_base.obj)); /* "PETSc/DM.pyx":238 * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) * PetscINCREF(vl.obj) * return vl # <<<<<<<<<<<<<< * * def restoreLocalVec(self, Vec vl): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vl)); __pyx_r = ((PyObject *)__pyx_v_vl); goto __pyx_L0; /* "PETSc/DM.pyx":234 * CHKERR( DMRestoreGlobalVector(self.dm, &vg.vec) ) * * def getLocalVec(self): # <<<<<<<<<<<<<< * cdef Vec vl = Vec() * CHKERR( DMGetLocalVector(self.dm, &vl.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vl); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":240 * return vl * * def restoreLocalVec(self, Vec vl): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDereference(vl.vec) ) * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_81restoreLocalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_80restoreLocalVec[] = "DM.restoreLocalVec(self, Vec vl)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_81restoreLocalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vl = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreLocalVec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreLocalVec") < 0)) __PYX_ERR(45, 240, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vl = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreLocalVec", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 240, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(45, 240, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_80restoreLocalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vl); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_80restoreLocalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreLocalVec", 0); /* "PETSc/DM.pyx":241 * * def restoreLocalVec(self, Vec vl): * CHKERR( PetscObjectDereference(vl.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDereference(((PetscObject)__pyx_v_vl->vec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 241, __pyx_L1_error) /* "PETSc/DM.pyx":242 * def restoreLocalVec(self, Vec vl): * CHKERR( PetscObjectDereference(vl.vec) ) * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) # <<<<<<<<<<<<<< * * def globalToLocal(self, Vec vg, Vec vl, addv=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 242, __pyx_L1_error) /* "PETSc/DM.pyx":240 * return vl * * def restoreLocalVec(self, Vec vl): # <<<<<<<<<<<<<< * CHKERR( PetscObjectDereference(vl.vec) ) * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.restoreLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":244 * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) * * def globalToLocal(self, Vec vg, Vec vl, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_83globalToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_82globalToLocal[] = "DM.globalToLocal(self, Vec vg, Vec vl, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_83globalToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vg = 0; struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("globalToLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg,&__pyx_n_s_vl,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vg)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vl)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("globalToLocal", 0, 2, 3, 1); __PYX_ERR(45, 244, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "globalToLocal") < 0)) __PYX_ERR(45, 244, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vg = ((struct PyPetscVecObject *)values[0]); __pyx_v_vl = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("globalToLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 244, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.globalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(45, 244, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(45, 244, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_82globalToLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vg, __pyx_v_vl, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_82globalToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vl, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("globalToLocal", 0); /* "PETSc/DM.pyx":245 * * def globalToLocal(self, Vec vg, Vec vl, addv=None): * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(45, 245, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "PETSc/DM.pyx":246 * def globalToLocal(self, Vec vg, Vec vl, addv=None): * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGlobalToLocalBegin(__pyx_v_self->dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vl->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 246, __pyx_L1_error) /* "PETSc/DM.pyx":247 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) # <<<<<<<<<<<<<< * * def localToGlobal(self, Vec vl, Vec vg, addv=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGlobalToLocalEnd(__pyx_v_self->dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vl->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 247, __pyx_L1_error) /* "PETSc/DM.pyx":244 * CHKERR( DMRestoreLocalVector(self.dm, &vl.vec) ) * * def globalToLocal(self, Vec vg, Vec vl, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMGlobalToLocalBegin(self.dm, vg.vec, im, vl.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.globalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":249 * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) * * def localToGlobal(self, Vec vl, Vec vg, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_85localToGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_84localToGlobal[] = "DM.localToGlobal(self, Vec vl, Vec vg, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_85localToGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vl = 0; struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localToGlobal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,&__pyx_n_s_vg,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("localToGlobal", 0, 2, 3, 1); __PYX_ERR(45, 249, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "localToGlobal") < 0)) __PYX_ERR(45, 249, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vl = ((struct PyPetscVecObject *)values[0]); __pyx_v_vg = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("localToGlobal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 249, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(45, 249, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(45, 249, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_84localToGlobal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_vg, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_84localToGlobal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localToGlobal", 0); /* "PETSc/DM.pyx":250 * * def localToGlobal(self, Vec vl, Vec vg, addv=None): * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(45, 250, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "PETSc/DM.pyx":251 * def localToGlobal(self, Vec vl, Vec vg, addv=None): * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToGlobalBegin(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 251, __pyx_L1_error) /* "PETSc/DM.pyx":252 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * * def localToLocal(self, Vec vl, Vec vlg, addv=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToGlobalEnd(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 252, __pyx_L1_error) /* "PETSc/DM.pyx":249 * CHKERR( DMGlobalToLocalEnd (self.dm, vg.vec, im, vl.vec) ) * * def localToGlobal(self, Vec vl, Vec vg, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToGlobalBegin(self.dm, vl.vec, im, vg.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":254 * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) * * def localToLocal(self, Vec vl, Vec vlg, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_87localToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_86localToLocal[] = "DM.localToLocal(self, Vec vl, Vec vlg, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_87localToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vl = 0; struct PyPetscVecObject *__pyx_v_vlg = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localToLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vl,&__pyx_n_s_vlg,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vl)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vlg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("localToLocal", 0, 2, 3, 1); __PYX_ERR(45, 254, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "localToLocal") < 0)) __PYX_ERR(45, 254, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vl = ((struct PyPetscVecObject *)values[0]); __pyx_v_vlg = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("localToLocal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 254, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(45, 254, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vlg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vlg", 0))) __PYX_ERR(45, 254, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_86localToLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_vlg, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_86localToLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, struct PyPetscVecObject *__pyx_v_vlg, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localToLocal", 0); /* "PETSc/DM.pyx":255 * * def localToLocal(self, Vec vl, Vec vlg, addv=None): * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(45, 255, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "PETSc/DM.pyx":256 * def localToLocal(self, Vec vl, Vec vlg, addv=None): * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToLocalBegin(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vlg->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 256, __pyx_L1_error) /* "PETSc/DM.pyx":257 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) # <<<<<<<<<<<<<< * * def getLGMap(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalToLocalEnd(__pyx_v_self->dm, __pyx_v_vl->vec, __pyx_v_im, __pyx_v_vlg->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 257, __pyx_L1_error) /* "PETSc/DM.pyx":254 * CHKERR( DMLocalToGlobalEnd(self.dm, vl.vec, im, vg.vec) ) * * def localToLocal(self, Vec vl, Vec vlg, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMLocalToLocalBegin(self.dm, vl.vec, im, vlg.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":259 * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) * * def getLGMap(self): # <<<<<<<<<<<<<< * cdef LGMap lgm = LGMap() * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_89getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_88getLGMap[] = "DM.getLGMap(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_89getLGMap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMap (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMap", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMap", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_88getLGMap(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_88getLGMap(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscLGMapObject *__pyx_v_lgm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMap", 0); /* "PETSc/DM.pyx":260 * * def getLGMap(self): * cdef LGMap lgm = LGMap() # <<<<<<<<<<<<<< * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) * PetscINCREF(lgm.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_lgm = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":261 * def getLGMap(self): * cdef LGMap lgm = LGMap() * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) # <<<<<<<<<<<<<< * PetscINCREF(lgm.obj) * return lgm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalToGlobalMapping(__pyx_v_self->dm, (&__pyx_v_lgm->lgm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 261, __pyx_L1_error) /* "PETSc/DM.pyx":262 * cdef LGMap lgm = LGMap() * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) * PetscINCREF(lgm.obj) # <<<<<<<<<<<<<< * return lgm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_lgm->__pyx_base.obj)); /* "PETSc/DM.pyx":263 * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) * PetscINCREF(lgm.obj) * return lgm # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_lgm)); __pyx_r = ((PyObject *)__pyx_v_lgm); goto __pyx_L0; /* "PETSc/DM.pyx":259 * CHKERR( DMLocalToLocalEnd (self.dm, vl.vec, im, vlg.vec) ) * * def getLGMap(self): # <<<<<<<<<<<<<< * cdef LGMap lgm = LGMap() * CHKERR( DMGetLocalToGlobalMapping(self.dm, &lgm.lgm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLGMap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_lgm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":267 * # * * def getCoordinateDM(self): # <<<<<<<<<<<<<< * cdef DM cdm = type(self)() * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_91getCoordinateDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_90getCoordinateDM[] = "DM.getCoordinateDM(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_91getCoordinateDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateDM (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_90getCoordinateDM(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_90getCoordinateDM(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscDMObject *__pyx_v_cdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateDM", 0); /* "PETSc/DM.pyx":268 * * def getCoordinateDM(self): * cdef DM cdm = type(self)() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) * PetscINCREF(cdm.obj) */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 268, __pyx_L1_error) __pyx_v_cdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":269 * def getCoordinateDM(self): * cdef DM cdm = type(self)() * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) # <<<<<<<<<<<<<< * PetscINCREF(cdm.obj) * return cdm */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDM(__pyx_v_self->dm, (&__pyx_v_cdm->dm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 269, __pyx_L1_error) /* "PETSc/DM.pyx":270 * cdef DM cdm = type(self)() * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) * PetscINCREF(cdm.obj) # <<<<<<<<<<<<<< * return cdm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cdm->__pyx_base.obj)); /* "PETSc/DM.pyx":271 * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) * PetscINCREF(cdm.obj) * return cdm # <<<<<<<<<<<<<< * * def getCoordinateSection(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_cdm)); __pyx_r = ((PyObject *)__pyx_v_cdm); goto __pyx_L0; /* "PETSc/DM.pyx":267 * # * * def getCoordinateDM(self): # <<<<<<<<<<<<<< * cdef DM cdm = type(self)() * CHKERR( DMGetCoordinateDM(self.dm, &cdm.dm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinateDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_cdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":273 * return cdm * * def getCoordinateSection(self): # <<<<<<<<<<<<<< * cdef Section sec = Section() * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_93getCoordinateSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_92getCoordinateSection[] = "DM.getCoordinateSection(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_93getCoordinateSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateSection (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateSection", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateSection", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_92getCoordinateSection(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_92getCoordinateSection(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateSection", 0); /* "PETSc/DM.pyx":274 * * def getCoordinateSection(self): * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":275 * def getCoordinateSection(self): * cdef Section sec = Section() * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) # <<<<<<<<<<<<<< * PetscINCREF(sec.obj) * return sec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 275, __pyx_L1_error) /* "PETSc/DM.pyx":276 * cdef Section sec = Section() * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) # <<<<<<<<<<<<<< * return sec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); /* "PETSc/DM.pyx":277 * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) * return sec # <<<<<<<<<<<<<< * * def setCoordinates(self, Vec c): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sec)); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "PETSc/DM.pyx":273 * return cdm * * def getCoordinateSection(self): # <<<<<<<<<<<<<< * cdef Section sec = Section() * CHKERR( DMGetCoordinateSection(self.dm, &sec.sec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinateSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":279 * return sec * * def setCoordinates(self, Vec c): # <<<<<<<<<<<<<< * CHKERR( DMSetCoordinates(self.dm, c.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_95setCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_94setCoordinates[] = "DM.setCoordinates(self, Vec c)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_95setCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_c = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinates (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoordinates") < 0)) __PYX_ERR(45, 279, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_c = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 279, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(45, 279, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_94setCoordinates(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_94setCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinates", 0); /* "PETSc/DM.pyx":280 * * def setCoordinates(self, Vec c): * CHKERR( DMSetCoordinates(self.dm, c.vec) ) # <<<<<<<<<<<<<< * * def getCoordinates(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoordinates(__pyx_v_self->dm, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 280, __pyx_L1_error) /* "PETSc/DM.pyx":279 * return sec * * def setCoordinates(self, Vec c): # <<<<<<<<<<<<<< * CHKERR( DMSetCoordinates(self.dm, c.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":282 * CHKERR( DMSetCoordinates(self.dm, c.vec) ) * * def getCoordinates(self): # <<<<<<<<<<<<<< * cdef Vec c = Vec() * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_97getCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_96getCoordinates[] = "DM.getCoordinates(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_97getCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinates (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinates", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinates", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_96getCoordinates(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_96getCoordinates(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinates", 0); /* "PETSc/DM.pyx":283 * * def getCoordinates(self): * cdef Vec c = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) * PetscINCREF(c.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":284 * def getCoordinates(self): * cdef Vec c = Vec() * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(c.obj) * return c */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinates(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 284, __pyx_L1_error) /* "PETSc/DM.pyx":285 * cdef Vec c = Vec() * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) * PetscINCREF(c.obj) # <<<<<<<<<<<<<< * return c * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); /* "PETSc/DM.pyx":286 * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) * PetscINCREF(c.obj) * return c # <<<<<<<<<<<<<< * * def setCoordinatesLocal(self, Vec c): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_c)); __pyx_r = ((PyObject *)__pyx_v_c); goto __pyx_L0; /* "PETSc/DM.pyx":282 * CHKERR( DMSetCoordinates(self.dm, c.vec) ) * * def getCoordinates(self): # <<<<<<<<<<<<<< * cdef Vec c = Vec() * CHKERR( DMGetCoordinates(self.dm, &c.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":288 * return c * * def setCoordinatesLocal(self, Vec c): # <<<<<<<<<<<<<< * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_99setCoordinatesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_98setCoordinatesLocal[] = "DM.setCoordinatesLocal(self, Vec c)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_99setCoordinatesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_c = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinatesLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_c,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoordinatesLocal") < 0)) __PYX_ERR(45, 288, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_c = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinatesLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 288, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(45, 288, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_98setCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_98setCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinatesLocal", 0); /* "PETSc/DM.pyx":289 * * def setCoordinatesLocal(self, Vec c): * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) # <<<<<<<<<<<<<< * * def getCoordinatesLocal(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoordinatesLocal(__pyx_v_self->dm, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 289, __pyx_L1_error) /* "PETSc/DM.pyx":288 * return c * * def setCoordinatesLocal(self, Vec c): # <<<<<<<<<<<<<< * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":291 * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) * * def getCoordinatesLocal(self): # <<<<<<<<<<<<<< * cdef Vec c = Vec() * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_101getCoordinatesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_100getCoordinatesLocal[] = "DM.getCoordinatesLocal(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_101getCoordinatesLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinatesLocal (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinatesLocal", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinatesLocal", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_100getCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_100getCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_c = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinatesLocal", 0); /* "PETSc/DM.pyx":292 * * def getCoordinatesLocal(self): * cdef Vec c = Vec() # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) * PetscINCREF(c.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":293 * def getCoordinatesLocal(self): * cdef Vec c = Vec() * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) # <<<<<<<<<<<<<< * PetscINCREF(c.obj) * return c */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinatesLocal(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 293, __pyx_L1_error) /* "PETSc/DM.pyx":294 * cdef Vec c = Vec() * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) * PetscINCREF(c.obj) # <<<<<<<<<<<<<< * return c * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); /* "PETSc/DM.pyx":295 * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) * PetscINCREF(c.obj) * return c # <<<<<<<<<<<<<< * * def getBoundingBox(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_c)); __pyx_r = ((PyObject *)__pyx_v_c); goto __pyx_L0; /* "PETSc/DM.pyx":291 * CHKERR( DMSetCoordinatesLocal(self.dm, c.vec) ) * * def getCoordinatesLocal(self): # <<<<<<<<<<<<<< * cdef Vec c = Vec() * CHKERR( DMGetCoordinatesLocal(self.dm, &c.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":297 * return c * * def getBoundingBox(self): # <<<<<<<<<<<<<< * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_103getBoundingBox(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_102getBoundingBox[] = "DM.getBoundingBox(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_103getBoundingBox(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBoundingBox (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBoundingBox", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBoundingBox", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_102getBoundingBox(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_102getBoundingBox(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PetscReal __pyx_v_gmin[3]; PetscReal __pyx_v_gmax[3]; PetscInt __pyx_9genexpr12__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBoundingBox", 0); /* "PETSc/DM.pyx":298 * * def getBoundingBox(self): * cdef PetscInt i,dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal gmin[3], gmax[3] */ __pyx_v_dim = 0; /* "PETSc/DM.pyx":299 * def getBoundingBox(self): * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 299, __pyx_L1_error) /* "PETSc/DM.pyx":301 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) # <<<<<<<<<<<<<< * return tuple([(toReal(gmin[i]), toReal(gmax[i])) * for i from 0 <= i < dim]) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetBoundingBox(__pyx_v_self->dm, __pyx_v_gmin, __pyx_v_gmax)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 301, __pyx_L1_error) /* "PETSc/DM.pyx":302 * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) * return tuple([(toReal(gmin[i]), toReal(gmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "PETSc/DM.pyx":303 * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) * return tuple([(toReal(gmin[i]), toReal(gmax[i])) * for i from 0 <= i < dim]) # <<<<<<<<<<<<<< * * def getLocalBoundingBox(self): */ __pyx_t_3 = __pyx_v_dim; for (__pyx_9genexpr12__pyx_v_i = 0; __pyx_9genexpr12__pyx_v_i < __pyx_t_3; __pyx_9genexpr12__pyx_v_i++) { /* "PETSc/DM.pyx":302 * cdef PetscReal gmin[3], gmax[3] * CHKERR( DMGetBoundingBox(self.dm, gmin, gmax) ) * return tuple([(toReal(gmin[i]), toReal(gmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_gmin[__pyx_9genexpr12__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_gmax[__pyx_9genexpr12__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(45, 302, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":297 * return c * * def getBoundingBox(self): # <<<<<<<<<<<<<< * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DM.getBoundingBox", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":305 * for i from 0 <= i < dim]) * * def getLocalBoundingBox(self): # <<<<<<<<<<<<<< * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_105getLocalBoundingBox(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_104getLocalBoundingBox[] = "DM.getLocalBoundingBox(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_105getLocalBoundingBox(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalBoundingBox (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalBoundingBox", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalBoundingBox", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_104getLocalBoundingBox(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_104getLocalBoundingBox(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_dim; PetscReal __pyx_v_lmin[3]; PetscReal __pyx_v_lmax[3]; PetscInt __pyx_9genexpr13__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalBoundingBox", 0); /* "PETSc/DM.pyx":306 * * def getLocalBoundingBox(self): * cdef PetscInt i,dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal lmin[3], lmax[3] */ __pyx_v_dim = 0; /* "PETSc/DM.pyx":307 * def getLocalBoundingBox(self): * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 307, __pyx_L1_error) /* "PETSc/DM.pyx":309 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) # <<<<<<<<<<<<<< * return tuple([(toReal(lmin[i]), toReal(lmax[i])) * for i from 0 <= i < dim]) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalBoundingBox(__pyx_v_self->dm, __pyx_v_lmin, __pyx_v_lmax)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 309, __pyx_L1_error) /* "PETSc/DM.pyx":310 * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) * return tuple([(toReal(lmin[i]), toReal(lmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "PETSc/DM.pyx":311 * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) * return tuple([(toReal(lmin[i]), toReal(lmax[i])) * for i from 0 <= i < dim]) # <<<<<<<<<<<<<< * * def localizeCoordinates(self): */ __pyx_t_3 = __pyx_v_dim; for (__pyx_9genexpr13__pyx_v_i = 0; __pyx_9genexpr13__pyx_v_i < __pyx_t_3; __pyx_9genexpr13__pyx_v_i++) { /* "PETSc/DM.pyx":310 * cdef PetscReal lmin[3], lmax[3] * CHKERR( DMGetLocalBoundingBox(self.dm, lmin, lmax) ) * return tuple([(toReal(lmin[i]), toReal(lmax[i])) # <<<<<<<<<<<<<< * for i from 0 <= i < dim]) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_lmin[__pyx_9genexpr13__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_lmax[__pyx_9genexpr13__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(45, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(45, 310, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } } /* exit inner scope */ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(45, 310, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":305 * for i from 0 <= i < dim]) * * def getLocalBoundingBox(self): # <<<<<<<<<<<<<< * cdef PetscInt i,dim=0 * CHKERR( DMGetCoordinateDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLocalBoundingBox", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":313 * for i from 0 <= i < dim]) * * def localizeCoordinates(self): # <<<<<<<<<<<<<< * CHKERR( DMLocalizeCoordinates(self.dm) ) * # */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_107localizeCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_106localizeCoordinates[] = "DM.localizeCoordinates(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_107localizeCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("localizeCoordinates (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("localizeCoordinates", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "localizeCoordinates", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_106localizeCoordinates(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_106localizeCoordinates(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("localizeCoordinates", 0); /* "PETSc/DM.pyx":314 * * def localizeCoordinates(self): * CHKERR( DMLocalizeCoordinates(self.dm) ) # <<<<<<<<<<<<<< * # * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLocalizeCoordinates(__pyx_v_self->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 314, __pyx_L1_error) /* "PETSc/DM.pyx":313 * for i from 0 <= i < dim]) * * def localizeCoordinates(self): # <<<<<<<<<<<<<< * CHKERR( DMLocalizeCoordinates(self.dm) ) * # */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.localizeCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":317 * # * * def setMatType(self, mat_type): # <<<<<<<<<<<<<< * """Set matrix type to be used by DM.createMat""" * cdef PetscMatType mtype = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_109setMatType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_108setMatType[] = "DM.setMatType(self, mat_type)\nSet matrix type to be used by DM.createMat"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_109setMatType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mat_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMatType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMatType") < 0)) __PYX_ERR(45, 317, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMatType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 317, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_108setMatType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_mat_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_108setMatType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_mat_type) { MatType __pyx_v_mtype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMatType", 0); __Pyx_INCREF(__pyx_v_mat_type); /* "PETSc/DM.pyx":319 * def setMatType(self, mat_type): * """Set matrix type to be used by DM.createMat""" * cdef PetscMatType mtype = NULL # <<<<<<<<<<<<<< * mat_type = str2bytes(mat_type, &mtype) * CHKERR( DMSetMatType(self.dm, mtype) ) */ __pyx_v_mtype = NULL; /* "PETSc/DM.pyx":320 * """Set matrix type to be used by DM.createMat""" * cdef PetscMatType mtype = NULL * mat_type = str2bytes(mat_type, &mtype) # <<<<<<<<<<<<<< * CHKERR( DMSetMatType(self.dm, mtype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_mat_type, (&__pyx_v_mtype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_mat_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":321 * cdef PetscMatType mtype = NULL * mat_type = str2bytes(mat_type, &mtype) * CHKERR( DMSetMatType(self.dm, mtype) ) # <<<<<<<<<<<<<< * * def createMat(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetMatType(__pyx_v_self->dm, __pyx_v_mtype)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 321, __pyx_L1_error) /* "PETSc/DM.pyx":317 * # * * def setMatType(self, mat_type): # <<<<<<<<<<<<<< * """Set matrix type to be used by DM.createMat""" * cdef PetscMatType mtype = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setMatType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_mat_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":323 * CHKERR( DMSetMatType(self.dm, mtype) ) * * def createMat(self): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_111createMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_110createMat[] = "DM.createMat(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_111createMat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createMat (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createMat", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createMat", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_110createMat(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_110createMat(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createMat", 0); /* "PETSc/DM.pyx":324 * * def createMat(self): * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) * return mat */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":325 * def createMat(self): * cdef Mat mat = Mat() * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateMatrix(__pyx_v_self->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 325, __pyx_L1_error) /* "PETSc/DM.pyx":326 * cdef Mat mat = Mat() * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def createInterpolation(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/DM.pyx":323 * CHKERR( DMSetMatType(self.dm, mtype) ) * * def createMat(self): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( DMCreateMatrix(self.dm, &mat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createMat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":328 * return mat * * def createInterpolation(self, DM dm): # <<<<<<<<<<<<<< * cdef Mat A = Mat() * cdef Vec scale = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_113createInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_112createInterpolation[] = "DM.createInterpolation(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_113createInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createInterpolation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createInterpolation") < 0)) __PYX_ERR(45, 328, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createInterpolation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 328, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(45, 328, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_112createInterpolation(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_112createInterpolation(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { struct PyPetscMatObject *__pyx_v_A = 0; struct PyPetscVecObject *__pyx_v_scale = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createInterpolation", 0); /* "PETSc/DM.pyx":329 * * def createInterpolation(self, DM dm): * cdef Mat A = Mat() # <<<<<<<<<<<<<< * cdef Vec scale = Vec() * CHKERR( DMCreateInterpolation(self.dm, dm.dm, */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":330 * def createInterpolation(self, DM dm): * cdef Mat A = Mat() * cdef Vec scale = Vec() # <<<<<<<<<<<<<< * CHKERR( DMCreateInterpolation(self.dm, dm.dm, * &A.mat, &scale.vec)) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_scale = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":331 * cdef Mat A = Mat() * cdef Vec scale = Vec() * CHKERR( DMCreateInterpolation(self.dm, dm.dm, # <<<<<<<<<<<<<< * &A.mat, &scale.vec)) * return(A, scale) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateInterpolation(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_A->mat), (&__pyx_v_scale->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 331, __pyx_L1_error) /* "PETSc/DM.pyx":333 * CHKERR( DMCreateInterpolation(self.dm, dm.dm, * &A.mat, &scale.vec)) * return(A, scale) # <<<<<<<<<<<<<< * * def createInjection(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_A)); __Pyx_GIVEREF(((PyObject *)__pyx_v_A)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A)); __Pyx_INCREF(((PyObject *)__pyx_v_scale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_scale)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_scale)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":328 * return mat * * def createInterpolation(self, DM dm): # <<<<<<<<<<<<<< * cdef Mat A = Mat() * cdef Vec scale = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_A); __Pyx_XDECREF((PyObject *)__pyx_v_scale); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":335 * return(A, scale) * * def createInjection(self, DM dm): # <<<<<<<<<<<<<< * cdef Mat inject = Mat() * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_115createInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_114createInjection[] = "DM.createInjection(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_115createInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createInjection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createInjection") < 0)) __PYX_ERR(45, 335, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createInjection", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 335, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(45, 335, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_114createInjection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_114createInjection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { struct PyPetscMatObject *__pyx_v_inject = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createInjection", 0); /* "PETSc/DM.pyx":336 * * def createInjection(self, DM dm): * cdef Mat inject = Mat() # <<<<<<<<<<<<<< * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) * return inject */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_inject = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":337 * def createInjection(self, DM dm): * cdef Mat inject = Mat() * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) # <<<<<<<<<<<<<< * return inject * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateInjection(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_inject->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 337, __pyx_L1_error) /* "PETSc/DM.pyx":338 * cdef Mat inject = Mat() * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) * return inject # <<<<<<<<<<<<<< * * def createRestriction(self, DM dm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_inject)); __pyx_r = ((PyObject *)__pyx_v_inject); goto __pyx_L0; /* "PETSc/DM.pyx":335 * return(A, scale) * * def createInjection(self, DM dm): # <<<<<<<<<<<<<< * cdef Mat inject = Mat() * CHKERR( DMCreateInjection(self.dm, dm.dm, &inject.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_inject); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":340 * return inject * * def createRestriction(self, DM dm): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_117createRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_116createRestriction[] = "DM.createRestriction(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_117createRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createRestriction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createRestriction") < 0)) __PYX_ERR(45, 340, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createRestriction", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 340, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(45, 340, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_116createRestriction(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_116createRestriction(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createRestriction", 0); /* "PETSc/DM.pyx":341 * * def createRestriction(self, DM dm): * cdef Mat mat = Mat() # <<<<<<<<<<<<<< * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) * return mat */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":342 * def createRestriction(self, DM dm): * cdef Mat mat = Mat() * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) # <<<<<<<<<<<<<< * return mat * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateRestriction(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 342, __pyx_L1_error) /* "PETSc/DM.pyx":343 * cdef Mat mat = Mat() * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) * return mat # <<<<<<<<<<<<<< * * def convert(self, dm_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_mat)); __pyx_r = ((PyObject *)__pyx_v_mat); goto __pyx_L0; /* "PETSc/DM.pyx":340 * return inject * * def createRestriction(self, DM dm): # <<<<<<<<<<<<<< * cdef Mat mat = Mat() * CHKERR( DMCreateRestriction(self.dm, dm.dm, &mat.mat) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_mat); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":345 * return mat * * def convert(self, dm_type): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_119convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_118convert[] = "DM.convert(self, dm_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_119convert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("convert (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(45, 345, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("convert", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 345, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_118convert(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_118convert(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type) { DMType __pyx_v_cval; DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert", 0); __Pyx_INCREF(__pyx_v_dm_type); /* "PETSc/DM.pyx":346 * * def convert(self, dm_type): * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * dm_type = str2bytes(dm_type, &cval) * cdef PetscDM newdm = NULL */ __pyx_v_cval = NULL; /* "PETSc/DM.pyx":347 * def convert(self, dm_type): * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMConvert(self.dm, cval, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_dm_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dm_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":348 * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMConvert(self.dm, cval, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/DM.pyx":349 * dm_type = str2bytes(dm_type, &cval) * cdef PetscDM newdm = NULL * CHKERR( DMConvert(self.dm, cval, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMConvert(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 349, __pyx_L1_error) /* "PETSc/DM.pyx":350 * cdef PetscDM newdm = NULL * CHKERR( DMConvert(self.dm, cval, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * return dm */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":351 * CHKERR( DMConvert(self.dm, cval, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * return dm * */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/DM.pyx":352 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * return dm # <<<<<<<<<<<<<< * * def refine(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/DM.pyx":345 * return mat * * def convert(self, dm_type): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * dm_type = str2bytes(dm_type, &cval) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.convert", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XDECREF(__pyx_v_dm_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":354 * return dm * * def refine(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_121refine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_120refine[] = "DM.refine(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_121refine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("refine (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "refine") < 0)) __PYX_ERR(45, 354, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("refine", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 354, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.refine", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_120refine(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_120refine(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_dmcomm; DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; MPI_Comm __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("refine", 0); /* "PETSc/DM.pyx":355 * * def refine(self, comm=None): * cdef MPI_Comm dmcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) */ __pyx_v_dmcomm = MPI_COMM_NULL; /* "PETSc/DM.pyx":356 * def refine(self, comm=None): * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) # <<<<<<<<<<<<<< * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->dm), (&__pyx_v_dmcomm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 356, __pyx_L1_error) /* "PETSc/DM.pyx":357 * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_dmcomm); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 357, __pyx_L1_error) __pyx_v_dmcomm = __pyx_t_2; /* "PETSc/DM.pyx":358 * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/DM.pyx":359 * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRefine(__pyx_v_self->dm, __pyx_v_dmcomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 359, __pyx_L1_error) /* "PETSc/DM.pyx":360 * cdef PetscDM newdm = NULL * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * return dm */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 360, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DM.pyx":361 * CHKERR( DMRefine(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * return dm * */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/DM.pyx":362 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * return dm # <<<<<<<<<<<<<< * * def coarsen(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/DM.pyx":354 * return dm * * def refine(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.refine", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":364 * return dm * * def coarsen(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_123coarsen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_122coarsen[] = "DM.coarsen(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_123coarsen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coarsen (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coarsen") < 0)) __PYX_ERR(45, 364, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("coarsen", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 364, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_122coarsen(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_122coarsen(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_dmcomm; DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; MPI_Comm __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coarsen", 0); /* "PETSc/DM.pyx":365 * * def coarsen(self, comm=None): * cdef MPI_Comm dmcomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) */ __pyx_v_dmcomm = MPI_COMM_NULL; /* "PETSc/DM.pyx":366 * def coarsen(self, comm=None): * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) # <<<<<<<<<<<<<< * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->dm), (&__pyx_v_dmcomm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 366, __pyx_L1_error) /* "PETSc/DM.pyx":367 * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_dmcomm); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 367, __pyx_L1_error) __pyx_v_dmcomm = __pyx_t_2; /* "PETSc/DM.pyx":368 * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/DM.pyx":369 * dmcomm = def_Comm(comm, dmcomm) * cdef PetscDM newdm = NULL * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsen(__pyx_v_self->dm, __pyx_v_dmcomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 369, __pyx_L1_error) /* "PETSc/DM.pyx":370 * cdef PetscDM newdm = NULL * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * return dm */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 370, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DM.pyx":371 * CHKERR( DMCoarsen(self.dm, dmcomm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * return dm * */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/DM.pyx":372 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * return dm # <<<<<<<<<<<<<< * * def refineHierarchy(self, nlevels): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/DM.pyx":364 * return dm * * def coarsen(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm dmcomm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &dmcomm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":374 * return dm * * def refineHierarchy(self, nlevels): # <<<<<<<<<<<<<< * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmf = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_125refineHierarchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_124refineHierarchy[] = "DM.refineHierarchy(self, nlevels)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_125refineHierarchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nlevels = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("refineHierarchy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlevels,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nlevels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "refineHierarchy") < 0)) __PYX_ERR(45, 374, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nlevels = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("refineHierarchy", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 374, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.refineHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_124refineHierarchy(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_nlevels); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_124refineHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; DM *__pyx_v_newdmf; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; struct PyPetscDMObject *__pyx_v_dmf = 0; PyObject *__pyx_v_hierarchy = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("refineHierarchy", 0); /* "PETSc/DM.pyx":375 * * def refineHierarchy(self, nlevels): * cdef PetscInt i, n = asInt(nlevels) # <<<<<<<<<<<<<< * cdef PetscDM *newdmf = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlevels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 375, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "PETSc/DM.pyx":376 * def refineHierarchy(self, nlevels): * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmf = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) */ __pyx_v_newdmf = NULL; /* "PETSc/DM.pyx":377 * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmf = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) # <<<<<<<<<<<<<< * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) * cdef DM dmf = None */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_newdmf)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/DM.pyx":378 * cdef PetscDM *newdmf = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) # <<<<<<<<<<<<<< * cdef DM dmf = None * cdef list hierarchy = [] */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRefineHierarchy(__pyx_v_self->dm, __pyx_v_n, __pyx_v_newdmf)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 378, __pyx_L1_error) /* "PETSc/DM.pyx":379 * cdef object tmp = oarray_p(empty_p(n), NULL, &newdmf) * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) * cdef DM dmf = None # <<<<<<<<<<<<<< * cdef list hierarchy = [] * for i from 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_dmf = ((struct PyPetscDMObject *)Py_None); /* "PETSc/DM.pyx":380 * CHKERR( DMRefineHierarchy(self.dm, n, newdmf) ) * cdef DM dmf = None * cdef list hierarchy = [] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * dmf = subtype_DM(newdmf[i])() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_hierarchy = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":381 * cdef DM dmf = None * cdef list hierarchy = [] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * dmf = subtype_DM(newdmf[i])() * dmf.dm = newdmf[i] */ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { /* "PETSc/DM.pyx":382 * cdef list hierarchy = [] * for i from 0 <= i < n: * dmf = subtype_DM(newdmf[i])() # <<<<<<<<<<<<<< * dmf.dm = newdmf[i] * hierarchy.append(dmf) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_newdmf[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 382, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dmf, ((struct PyPetscDMObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "PETSc/DM.pyx":383 * for i from 0 <= i < n: * dmf = subtype_DM(newdmf[i])() * dmf.dm = newdmf[i] # <<<<<<<<<<<<<< * hierarchy.append(dmf) * return hierarchy */ __pyx_v_dmf->dm = (__pyx_v_newdmf[__pyx_v_i]); /* "PETSc/DM.pyx":384 * dmf = subtype_DM(newdmf[i])() * dmf.dm = newdmf[i] * hierarchy.append(dmf) # <<<<<<<<<<<<<< * return hierarchy * */ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_hierarchy, ((PyObject *)__pyx_v_dmf)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(45, 384, __pyx_L1_error) } /* "PETSc/DM.pyx":385 * dmf.dm = newdmf[i] * hierarchy.append(dmf) * return hierarchy # <<<<<<<<<<<<<< * * def coarsenHierarchy(self, nlevels): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_hierarchy); __pyx_r = __pyx_v_hierarchy; goto __pyx_L0; /* "PETSc/DM.pyx":374 * return dm * * def refineHierarchy(self, nlevels): # <<<<<<<<<<<<<< * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmf = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.refineHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF((PyObject *)__pyx_v_dmf); __Pyx_XDECREF(__pyx_v_hierarchy); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":387 * return hierarchy * * def coarsenHierarchy(self, nlevels): # <<<<<<<<<<<<<< * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmc = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_127coarsenHierarchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_126coarsenHierarchy[] = "DM.coarsenHierarchy(self, nlevels)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_127coarsenHierarchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nlevels = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("coarsenHierarchy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlevels,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nlevels)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coarsenHierarchy") < 0)) __PYX_ERR(45, 387, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_nlevels = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("coarsenHierarchy", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 387, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsenHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_126coarsenHierarchy(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_nlevels); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_126coarsenHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; DM *__pyx_v_newdmc; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; struct PyPetscDMObject *__pyx_v_dmc = 0; PyObject *__pyx_v_hierarchy = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("coarsenHierarchy", 0); /* "PETSc/DM.pyx":388 * * def coarsenHierarchy(self, nlevels): * cdef PetscInt i, n = asInt(nlevels) # <<<<<<<<<<<<<< * cdef PetscDM *newdmc = NULL * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlevels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 388, __pyx_L1_error) __pyx_v_n = __pyx_t_1; /* "PETSc/DM.pyx":389 * def coarsenHierarchy(self, nlevels): * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmc = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) */ __pyx_v_newdmc = NULL; /* "PETSc/DM.pyx":390 * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmc = NULL * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) # <<<<<<<<<<<<<< * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) * cdef DM dmc = None */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_newdmc)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/DM.pyx":391 * cdef PetscDM *newdmc = NULL * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) # <<<<<<<<<<<<<< * cdef DM dmc = None * cdef list hierarchy = [] */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsenHierarchy(__pyx_v_self->dm, __pyx_v_n, __pyx_v_newdmc)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 391, __pyx_L1_error) /* "PETSc/DM.pyx":392 * cdef object tmp = oarray_p(empty_p(n),NULL, &newdmc) * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) * cdef DM dmc = None # <<<<<<<<<<<<<< * cdef list hierarchy = [] * for i from 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_dmc = ((struct PyPetscDMObject *)Py_None); /* "PETSc/DM.pyx":393 * CHKERR( DMCoarsenHierarchy(self.dm, n, newdmc) ) * cdef DM dmc = None * cdef list hierarchy = [] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * dmc = subtype_DM(newdmc[i])() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_hierarchy = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":394 * cdef DM dmc = None * cdef list hierarchy = [] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * dmc = subtype_DM(newdmc[i])() * dmc.dm = newdmc[i] */ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { /* "PETSc/DM.pyx":395 * cdef list hierarchy = [] * for i from 0 <= i < n: * dmc = subtype_DM(newdmc[i])() # <<<<<<<<<<<<<< * dmc.dm = newdmc[i] * hierarchy.append(dmc) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_newdmc[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 395, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dmc, ((struct PyPetscDMObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "PETSc/DM.pyx":396 * for i from 0 <= i < n: * dmc = subtype_DM(newdmc[i])() * dmc.dm = newdmc[i] # <<<<<<<<<<<<<< * hierarchy.append(dmc) * return hierarchy */ __pyx_v_dmc->dm = (__pyx_v_newdmc[__pyx_v_i]); /* "PETSc/DM.pyx":397 * dmc = subtype_DM(newdmc[i])() * dmc.dm = newdmc[i] * hierarchy.append(dmc) # <<<<<<<<<<<<<< * return hierarchy * */ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_hierarchy, ((PyObject *)__pyx_v_dmc)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(45, 397, __pyx_L1_error) } /* "PETSc/DM.pyx":398 * dmc.dm = newdmc[i] * hierarchy.append(dmc) * return hierarchy # <<<<<<<<<<<<<< * * def getRefineLevel(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_hierarchy); __pyx_r = __pyx_v_hierarchy; goto __pyx_L0; /* "PETSc/DM.pyx":387 * return hierarchy * * def coarsenHierarchy(self, nlevels): # <<<<<<<<<<<<<< * cdef PetscInt i, n = asInt(nlevels) * cdef PetscDM *newdmc = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsenHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF((PyObject *)__pyx_v_dmc); __Pyx_XDECREF(__pyx_v_hierarchy); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":400 * return hierarchy * * def getRefineLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( DMGetRefineLevel(self.dm, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_129getRefineLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_128getRefineLevel[] = "DM.getRefineLevel(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_129getRefineLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefineLevel (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRefineLevel", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefineLevel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_128getRefineLevel(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_128getRefineLevel(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefineLevel", 0); /* "PETSc/DM.pyx":401 * * def getRefineLevel(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetRefineLevel(self.dm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/DM.pyx":402 * def getRefineLevel(self): * cdef PetscInt n = 0 * CHKERR( DMGetRefineLevel(self.dm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetRefineLevel(__pyx_v_self->dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 402, __pyx_L1_error) /* "PETSc/DM.pyx":403 * cdef PetscInt n = 0 * CHKERR( DMGetRefineLevel(self.dm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * def setRefineLevel(self, level): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":400 * return hierarchy * * def getRefineLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( DMGetRefineLevel(self.dm, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getRefineLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":405 * return toInt(n) * * def setRefineLevel(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( DMSetRefineLevel(self.dm, clevel) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_131setRefineLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_130setRefineLevel[] = "DM.setRefineLevel(self, level)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_131setRefineLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_level = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefineLevel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_level,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRefineLevel") < 0)) __PYX_ERR(45, 405, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_level = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefineLevel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 405, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setRefineLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_130setRefineLevel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_level); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_130setRefineLevel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_level) { PetscInt __pyx_v_clevel; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefineLevel", 0); /* "PETSc/DM.pyx":406 * * def setRefineLevel(self, level): * cdef PetscInt clevel = asInt(level) # <<<<<<<<<<<<<< * CHKERR( DMSetRefineLevel(self.dm, clevel) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_level); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 406, __pyx_L1_error) __pyx_v_clevel = __pyx_t_1; /* "PETSc/DM.pyx":407 * def setRefineLevel(self, level): * cdef PetscInt clevel = asInt(level) * CHKERR( DMSetRefineLevel(self.dm, clevel) ) # <<<<<<<<<<<<<< * * def getCoarsenLevel(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetRefineLevel(__pyx_v_self->dm, __pyx_v_clevel)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 407, __pyx_L1_error) /* "PETSc/DM.pyx":405 * return toInt(n) * * def setRefineLevel(self, level): # <<<<<<<<<<<<<< * cdef PetscInt clevel = asInt(level) * CHKERR( DMSetRefineLevel(self.dm, clevel) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setRefineLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":409 * CHKERR( DMSetRefineLevel(self.dm, clevel) ) * * def getCoarsenLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_133getCoarsenLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_132getCoarsenLevel[] = "DM.getCoarsenLevel(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_133getCoarsenLevel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoarsenLevel (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCoarsenLevel", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoarsenLevel", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_132getCoarsenLevel(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_132getCoarsenLevel(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoarsenLevel", 0); /* "PETSc/DM.pyx":410 * * def getCoarsenLevel(self): * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/DM.pyx":411 * def getCoarsenLevel(self): * cdef PetscInt n = 0 * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoarsenLevel(__pyx_v_self->dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 411, __pyx_L1_error) /* "PETSc/DM.pyx":412 * cdef PetscInt n = 0 * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":409 * CHKERR( DMSetRefineLevel(self.dm, clevel) ) * * def getCoarsenLevel(self): # <<<<<<<<<<<<<< * cdef PetscInt n = 0 * CHKERR( DMGetCoarsenLevel(self.dm, &n) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoarsenLevel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":416 * # * * def adaptLabel(self, label): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_135adaptLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_134adaptLabel[] = "DM.adaptLabel(self, label)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_135adaptLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_label = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adaptLabel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_label)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adaptLabel") < 0)) __PYX_ERR(45, 416, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_label = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("adaptLabel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 416, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_134adaptLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_label); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_134adaptLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label) { char const *__pyx_v_cval; DMLabel __pyx_v_clbl; struct PyPetscDMObject *__pyx_v_newdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adaptLabel", 0); __Pyx_INCREF(__pyx_v_label); /* "PETSc/DM.pyx":417 * * def adaptLabel(self, label): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) */ __pyx_v_cval = NULL; /* "PETSc/DM.pyx":418 * def adaptLabel(self, label): * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * label = str2bytes(label, &cval) * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) */ __pyx_v_clbl = NULL; /* "PETSc/DM.pyx":419 * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_label, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_label, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":420 * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) # <<<<<<<<<<<<<< * cdef DM newdm = DMPlex() * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 420, __pyx_L1_error) /* "PETSc/DM.pyx":421 * label = str2bytes(label, &cval) * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() # <<<<<<<<<<<<<< * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) * return newdm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":422 * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) # <<<<<<<<<<<<<< * return newdm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMAdaptLabel(__pyx_v_self->dm, __pyx_v_clbl, (&__pyx_v_newdm->dm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 422, __pyx_L1_error) /* "PETSc/DM.pyx":423 * cdef DM newdm = DMPlex() * CHKERR( DMAdaptLabel(self.dm, clbl, &newdm.dm) ) * return newdm # <<<<<<<<<<<<<< * * def adaptMetric(self, Vec metric, label=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_newdm)); __pyx_r = ((PyObject *)__pyx_v_newdm); goto __pyx_L0; /* "PETSc/DM.pyx":416 * # * * def adaptLabel(self, label): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newdm); __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":425 * return newdm * * def adaptMetric(self, Vec metric, label=None): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_137adaptMetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_136adaptMetric[] = "DM.adaptMetric(self, Vec metric, label=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_137adaptMetric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_metric = 0; PyObject *__pyx_v_label = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("adaptMetric (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_metric,&__pyx_n_s_label,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_metric)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_label); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adaptMetric") < 0)) __PYX_ERR(45, 425, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_metric = ((struct PyPetscVecObject *)values[0]); __pyx_v_label = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("adaptMetric", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 425, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptMetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric", 0))) __PYX_ERR(45, 425, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_136adaptMetric(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_metric, __pyx_v_label); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_136adaptMetric(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_metric, PyObject *__pyx_v_label) { char const *__pyx_v_cval; DMLabel __pyx_v_clbl; struct PyPetscDMObject *__pyx_v_newdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("adaptMetric", 0); __Pyx_INCREF(__pyx_v_label); /* "PETSc/DM.pyx":426 * * def adaptMetric(self, Vec metric, label=None): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) */ __pyx_v_cval = NULL; /* "PETSc/DM.pyx":427 * def adaptMetric(self, Vec metric, label=None): * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream */ __pyx_v_clbl = NULL; /* "PETSc/DM.pyx":428 * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) # <<<<<<<<<<<<<< * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_label, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_label, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":429 * cdef PetscDMLabel clbl = NULL * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() */ __pyx_t_2 = ((__pyx_v_cval == NULL) != 0); if (__pyx_t_2) { __pyx_v_cval = ((char const *)""); } /* "PETSc/DM.pyx":430 * label = str2bytes(label, &cval) * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) # <<<<<<<<<<<<<< * cdef DM newdm = DMPlex() * CHKERR( DMAdaptMetric(self.dm, metric.vec, clbl, &newdm.dm) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 430, __pyx_L1_error) /* "PETSc/DM.pyx":431 * if cval == NULL: cval = b"" # XXX Should be fixed upstream * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() # <<<<<<<<<<<<<< * CHKERR( DMAdaptMetric(self.dm, metric.vec, clbl, &newdm.dm) ) * return newdm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":432 * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * cdef DM newdm = DMPlex() * CHKERR( DMAdaptMetric(self.dm, metric.vec, clbl, &newdm.dm) ) # <<<<<<<<<<<<<< * return newdm * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMAdaptMetric(__pyx_v_self->dm, __pyx_v_metric->vec, __pyx_v_clbl, (&__pyx_v_newdm->dm))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 432, __pyx_L1_error) /* "PETSc/DM.pyx":433 * cdef DM newdm = DMPlex() * CHKERR( DMAdaptMetric(self.dm, metric.vec, clbl, &newdm.dm) ) * return newdm # <<<<<<<<<<<<<< * * def getLabel(self, name): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_newdm)); __pyx_r = ((PyObject *)__pyx_v_newdm); goto __pyx_L0; /* "PETSc/DM.pyx":425 * return newdm * * def adaptMetric(self, Vec metric, label=None): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscDMLabel clbl = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.adaptMetric", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newdm); __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":435 * return newdm * * def getLabel(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * cdef DMLabel dmlabel = DMLabel() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_139getLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_138getLabel[] = "DM.getLabel(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_139getLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLabel") < 0)) __PYX_ERR(45, 435, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 435, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_138getLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_138getLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; struct PyPetscDMLabelObject *__pyx_v_dmlabel = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":436 * * def getLabel(self, name): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef DMLabel dmlabel = DMLabel() * name = str2bytes(name, &cname) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":437 * def getLabel(self, name): * cdef const char *cname = NULL * cdef DMLabel dmlabel = DMLabel() # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_dmlabel = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":438 * cdef const char *cname = NULL * cdef DMLabel dmlabel = DMLabel() * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) * PetscINCREF(dmlabel.obj) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":439 * cdef DMLabel dmlabel = DMLabel() * name = str2bytes(name, &cname) * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) # <<<<<<<<<<<<<< * PetscINCREF(dmlabel.obj) * return dmlabel */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_dmlabel->dmlabel))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 439, __pyx_L1_error) /* "PETSc/DM.pyx":440 * name = str2bytes(name, &cname) * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) * PetscINCREF(dmlabel.obj) # <<<<<<<<<<<<<< * return dmlabel * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dmlabel->__pyx_base.obj)); /* "PETSc/DM.pyx":441 * CHKERR( DMGetLabel(self.dm, cname, &dmlabel.dmlabel) ) * PetscINCREF(dmlabel.obj) * return dmlabel # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dmlabel)); __pyx_r = ((PyObject *)__pyx_v_dmlabel); goto __pyx_L0; /* "PETSc/DM.pyx":435 * return newdm * * def getLabel(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * cdef DMLabel dmlabel = DMLabel() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dmlabel); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":445 * # * * def setSection(self, Section sec): # <<<<<<<<<<<<<< * CHKERR( DMSetSection(self.dm, sec.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_141setSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_140setSection[] = "DM.setSection(self, Section sec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_141setSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSection") < 0)) __PYX_ERR(45, 445, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSection", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 445, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(45, 445, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_140setSection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_140setSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSection", 0); /* "PETSc/DM.pyx":446 * * def setSection(self, Section sec): * CHKERR( DMSetSection(self.dm, sec.sec) ) # <<<<<<<<<<<<<< * * def getSection(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetSection(__pyx_v_self->dm, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 446, __pyx_L1_error) /* "PETSc/DM.pyx":445 * # * * def setSection(self, Section sec): # <<<<<<<<<<<<<< * CHKERR( DMSetSection(self.dm, sec.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":448 * CHKERR( DMSetSection(self.dm, sec.sec) ) * * def getSection(self): # <<<<<<<<<<<<<< * cdef Section sec = Section() * CHKERR( DMGetSection(self.dm, &sec.sec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_143getSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_142getSection[] = "DM.getSection(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_143getSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSection (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSection", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSection", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_142getSection(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_142getSection(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSection", 0); /* "PETSc/DM.pyx":449 * * def getSection(self): * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMGetSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":450 * def getSection(self): * cdef Section sec = Section() * CHKERR( DMGetSection(self.dm, &sec.sec) ) # <<<<<<<<<<<<<< * PetscINCREF(sec.obj) * return sec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 450, __pyx_L1_error) /* "PETSc/DM.pyx":451 * cdef Section sec = Section() * CHKERR( DMGetSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) # <<<<<<<<<<<<<< * return sec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); /* "PETSc/DM.pyx":452 * CHKERR( DMGetSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) * return sec # <<<<<<<<<<<<<< * * def setGlobalSection(self, Section sec): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sec)); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "PETSc/DM.pyx":448 * CHKERR( DMSetSection(self.dm, sec.sec) ) * * def getSection(self): # <<<<<<<<<<<<<< * cdef Section sec = Section() * CHKERR( DMGetSection(self.dm, &sec.sec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":454 * return sec * * def setGlobalSection(self, Section sec): # <<<<<<<<<<<<<< * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_145setGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_144setGlobalSection[] = "DM.setGlobalSection(self, Section sec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_145setGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalSection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGlobalSection") < 0)) __PYX_ERR(45, 454, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalSection", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 454, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(45, 454, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_144setGlobalSection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_144setGlobalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalSection", 0); /* "PETSc/DM.pyx":455 * * def setGlobalSection(self, Section sec): * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) # <<<<<<<<<<<<<< * * def getGlobalSection(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetGlobalSection(__pyx_v_self->dm, __pyx_v_sec->sec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 455, __pyx_L1_error) /* "PETSc/DM.pyx":454 * return sec * * def setGlobalSection(self, Section sec): # <<<<<<<<<<<<<< * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":457 * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) * * def getGlobalSection(self): # <<<<<<<<<<<<<< * cdef Section sec = Section() * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_147getGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_146getGlobalSection[] = "DM.getGlobalSection(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_147getGlobalSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalSection (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalSection", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalSection", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_146getGlobalSection(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_146getGlobalSection(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalSection", 0); /* "PETSc/DM.pyx":458 * * def getGlobalSection(self): * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":459 * def getGlobalSection(self): * cdef Section sec = Section() * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) # <<<<<<<<<<<<<< * PetscINCREF(sec.obj) * return sec */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetGlobalSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 459, __pyx_L1_error) /* "PETSc/DM.pyx":460 * cdef Section sec = Section() * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) # <<<<<<<<<<<<<< * return sec * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); /* "PETSc/DM.pyx":461 * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) * PetscINCREF(sec.obj) * return sec # <<<<<<<<<<<<<< * * setDefaultSection = setSection */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sec)); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "PETSc/DM.pyx":457 * CHKERR( DMSetGlobalSection(self.dm, sec.sec) ) * * def getGlobalSection(self): # <<<<<<<<<<<<<< * cdef Section sec = Section() * CHKERR( DMGetGlobalSection(self.dm, &sec.sec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getGlobalSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":468 * getDefaultGlobalSection = getGlobalSection * * def createSectionSF(self, Section localsec, Section globalsec): # <<<<<<<<<<<<<< * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_149createSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_148createSectionSF[] = "DM.createSectionSF(self, Section localsec, Section globalsec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_149createSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_localsec = 0; struct PyPetscSectionObject *__pyx_v_globalsec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSectionSF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_localsec,&__pyx_n_s_globalsec,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_localsec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_globalsec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 2, 2, 1); __PYX_ERR(45, 468, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSectionSF") < 0)) __PYX_ERR(45, 468, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_localsec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_globalsec = ((struct PyPetscSectionObject *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 468, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_localsec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "localsec", 0))) __PYX_ERR(45, 468, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_globalsec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "globalsec", 0))) __PYX_ERR(45, 468, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_148createSectionSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_localsec, __pyx_v_globalsec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_148createSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_localsec, struct PyPetscSectionObject *__pyx_v_globalsec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSectionSF", 0); /* "PETSc/DM.pyx":469 * * def createSectionSF(self, Section localsec, Section globalsec): * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) # <<<<<<<<<<<<<< * * def getSectionSF(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateSectionSF(__pyx_v_self->dm, __pyx_v_localsec->sec, __pyx_v_globalsec->sec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 469, __pyx_L1_error) /* "PETSc/DM.pyx":468 * getDefaultGlobalSection = getGlobalSection * * def createSectionSF(self, Section localsec, Section globalsec): # <<<<<<<<<<<<<< * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":471 * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) * * def getSectionSF(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_151getSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_150getSectionSF[] = "DM.getSectionSF(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_151getSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSectionSF (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSectionSF", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSectionSF", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_150getSectionSF(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_150getSectionSF(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSectionSF", 0); /* "PETSc/DM.pyx":472 * * def getSectionSF(self): * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) * PetscINCREF(sf.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":473 * def getSectionSF(self): * cdef SF sf = SF() * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) # <<<<<<<<<<<<<< * PetscINCREF(sf.obj) * return sf */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetSectionSF(__pyx_v_self->dm, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 473, __pyx_L1_error) /* "PETSc/DM.pyx":474 * cdef SF sf = SF() * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) * PetscINCREF(sf.obj) # <<<<<<<<<<<<<< * return sf * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); /* "PETSc/DM.pyx":475 * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) * PetscINCREF(sf.obj) * return sf # <<<<<<<<<<<<<< * * def setSectionSF(self, SF sf): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/DM.pyx":471 * CHKERR( DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec) ) * * def getSectionSF(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( DMGetSectionSF(self.dm, &sf.sf) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":477 * return sf * * def setSectionSF(self, SF sf): # <<<<<<<<<<<<<< * CHKERR( DMSetSectionSF(self.dm, sf.sf) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_153setSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_152setSectionSF[] = "DM.setSectionSF(self, SF sf)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_153setSectionSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSFObject *__pyx_v_sf = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSectionSF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSectionSF") < 0)) __PYX_ERR(45, 477, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSectionSF", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 477, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(45, 477, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_152setSectionSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_152setSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSectionSF", 0); /* "PETSc/DM.pyx":478 * * def setSectionSF(self, SF sf): * CHKERR( DMSetSectionSF(self.dm, sf.sf) ) # <<<<<<<<<<<<<< * * createDefaultSF = createSectionSF */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetSectionSF(__pyx_v_self->dm, __pyx_v_sf->sf)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 478, __pyx_L1_error) /* "PETSc/DM.pyx":477 * return sf * * def setSectionSF(self, SF sf): # <<<<<<<<<<<<<< * CHKERR( DMSetSectionSF(self.dm, sf.sf) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setSectionSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":484 * setDefaultSF = setSectionSF * * def getPointSF(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_155getPointSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_154getPointSF[] = "DM.getPointSF(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_155getPointSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointSF (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPointSF", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPointSF", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_154getPointSF(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_154getPointSF(struct PyPetscDMObject *__pyx_v_self) { struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointSF", 0); /* "PETSc/DM.pyx":485 * * def getPointSF(self): * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) * PetscINCREF(sf.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":486 * def getPointSF(self): * cdef SF sf = SF() * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) # <<<<<<<<<<<<<< * PetscINCREF(sf.obj) * return sf */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetPointSF(__pyx_v_self->dm, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 486, __pyx_L1_error) /* "PETSc/DM.pyx":487 * cdef SF sf = SF() * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) * PetscINCREF(sf.obj) # <<<<<<<<<<<<<< * return sf * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); /* "PETSc/DM.pyx":488 * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) * PetscINCREF(sf.obj) * return sf # <<<<<<<<<<<<<< * * def setPointSF(self, SF sf): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/DM.pyx":484 * setDefaultSF = setSectionSF * * def getPointSF(self): # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( DMGetPointSF(self.dm, &sf.sf) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getPointSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":490 * return sf * * def setPointSF(self, SF sf): # <<<<<<<<<<<<<< * CHKERR( DMSetPointSF(self.dm, sf.sf) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_157setPointSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_156setPointSF[] = "DM.setPointSF(self, SF sf)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_157setPointSF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSFObject *__pyx_v_sf = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointSF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPointSF") < 0)) __PYX_ERR(45, 490, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointSF", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 490, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setPointSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(45, 490, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_156setPointSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sf); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_156setPointSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointSF", 0); /* "PETSc/DM.pyx":491 * * def setPointSF(self, SF sf): * CHKERR( DMSetPointSF(self.dm, sf.sf) ) # <<<<<<<<<<<<<< * * def getNumLabels(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetPointSF(__pyx_v_self->dm, __pyx_v_sf->sf)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 491, __pyx_L1_error) /* "PETSc/DM.pyx":490 * return sf * * def setPointSF(self, SF sf): # <<<<<<<<<<<<<< * CHKERR( DMSetPointSF(self.dm, sf.sf) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setPointSF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":493 * CHKERR( DMSetPointSF(self.dm, sf.sf) ) * * def getNumLabels(self): # <<<<<<<<<<<<<< * cdef PetscInt nLabels = 0 * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_159getNumLabels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_158getNumLabels[] = "DM.getNumLabels(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_159getNumLabels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumLabels (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNumLabels", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumLabels", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_158getNumLabels(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_158getNumLabels(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_nLabels; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumLabels", 0); /* "PETSc/DM.pyx":494 * * def getNumLabels(self): * cdef PetscInt nLabels = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) * return toInt(nLabels) */ __pyx_v_nLabels = 0; /* "PETSc/DM.pyx":495 * def getNumLabels(self): * cdef PetscInt nLabels = 0 * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) # <<<<<<<<<<<<<< * return toInt(nLabels) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetNumLabels(__pyx_v_self->dm, (&__pyx_v_nLabels))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 495, __pyx_L1_error) /* "PETSc/DM.pyx":496 * cdef PetscInt nLabels = 0 * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) * return toInt(nLabels) # <<<<<<<<<<<<<< * * def getLabelName(self, index): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nLabels); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":493 * CHKERR( DMSetPointSF(self.dm, sf.sf) ) * * def getNumLabels(self): # <<<<<<<<<<<<<< * cdef PetscInt nLabels = 0 * CHKERR( DMGetNumLabels(self.dm, &nLabels) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getNumLabels", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":498 * return toInt(nLabels) * * def getLabelName(self, index): # <<<<<<<<<<<<<< * cdef PetscInt cindex = asInt(index) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_161getLabelName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_160getLabelName[] = "DM.getLabelName(self, index)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_161getLabelName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLabelName") < 0)) __PYX_ERR(45, 498, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 498, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_160getLabelName(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_160getLabelName(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_cindex; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelName", 0); /* "PETSc/DM.pyx":499 * * def getLabelName(self, index): * cdef PetscInt cindex = asInt(index) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 499, __pyx_L1_error) __pyx_v_cindex = __pyx_t_1; /* "PETSc/DM.pyx":500 * def getLabelName(self, index): * cdef PetscInt cindex = asInt(index) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) * return bytes2str(cname) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":501 * cdef PetscInt cindex = asInt(index) * cdef const char *cname = NULL * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) # <<<<<<<<<<<<<< * return bytes2str(cname) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelName(__pyx_v_self->dm, __pyx_v_cindex, (&__pyx_v_cname))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 501, __pyx_L1_error) /* "PETSc/DM.pyx":502 * cdef const char *cname = NULL * CHKERR( DMGetLabelName(self.dm, cindex, &cname) ) * return bytes2str(cname) # <<<<<<<<<<<<<< * * def hasLabel(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cname); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":498 * return toInt(nLabels) * * def getLabelName(self, index): # <<<<<<<<<<<<<< * cdef PetscInt cindex = asInt(index) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":504 * return bytes2str(cname) * * def hasLabel(self, name): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_163hasLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_162hasLabel[] = "DM.hasLabel(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_163hasLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hasLabel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hasLabel") < 0)) __PYX_ERR(45, 504, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("hasLabel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 504, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.hasLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_162hasLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_162hasLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { PetscBool __pyx_v_flag; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hasLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":505 * * def hasLabel(self, name): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/DM.pyx":506 * def hasLabel(self, name): * cdef PetscBool flag = PETSC_FALSE * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMHasLabel(self.dm, cname, &flag) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":507 * cdef PetscBool flag = PETSC_FALSE * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMHasLabel(self.dm, cname, &flag) ) * return toBool(flag) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":508 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMHasLabel(self.dm, cname, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMHasLabel(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 508, __pyx_L1_error) /* "PETSc/DM.pyx":509 * name = str2bytes(name, &cname) * CHKERR( DMHasLabel(self.dm, cname, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def createLabel(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":504 * return bytes2str(cname) * * def hasLabel(self, name): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.hasLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":511 * return toBool(flag) * * def createLabel(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_165createLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_164createLabel[] = "DM.createLabel(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_165createLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLabel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createLabel") < 0)) __PYX_ERR(45, 511, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createLabel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 511, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.createLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_164createLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_164createLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":512 * * def createLabel(self, name): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMCreateLabel(self.dm, cname) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":513 * def createLabel(self, name): * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMCreateLabel(self.dm, cname) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":514 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMCreateLabel(self.dm, cname) ) # <<<<<<<<<<<<<< * * def removeLabel(self, name): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateLabel(__pyx_v_self->dm, __pyx_v_cname)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 514, __pyx_L1_error) /* "PETSc/DM.pyx":511 * return toBool(flag) * * def createLabel(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.createLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":516 * CHKERR( DMCreateLabel(self.dm, cname) ) * * def removeLabel(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * cdef PetscDMLabel clbl = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_167removeLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_166removeLabel[] = "DM.removeLabel(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_167removeLabel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("removeLabel (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "removeLabel") < 0)) __PYX_ERR(45, 516, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("removeLabel", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 516, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.removeLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_166removeLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_166removeLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("removeLabel", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":517 * * def removeLabel(self, name): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * name = str2bytes(name, &cname) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":518 * def removeLabel(self, name): * cdef const char *cname = NULL * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) */ __pyx_v_clbl = NULL; /* "PETSc/DM.pyx":519 * cdef const char *cname = NULL * cdef PetscDMLabel clbl = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) * # TODO: Once DMLabel is wrapped, this should return the label, like the C function. */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":520 * cdef PetscDMLabel clbl = NULL * name = str2bytes(name, &cname) * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) # <<<<<<<<<<<<<< * # TODO: Once DMLabel is wrapped, this should return the label, like the C function. * CHKERR( DMLabelDestroy(&clbl) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRemoveLabel(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_clbl))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 520, __pyx_L1_error) /* "PETSc/DM.pyx":522 * CHKERR( DMRemoveLabel(self.dm, cname, &clbl) ) * # TODO: Once DMLabel is wrapped, this should return the label, like the C function. * CHKERR( DMLabelDestroy(&clbl) ) # <<<<<<<<<<<<<< * * def getLabelValue(self, name, point): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDestroy((&__pyx_v_clbl))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 522, __pyx_L1_error) /* "PETSc/DM.pyx":516 * CHKERR( DMCreateLabel(self.dm, cname) ) * * def removeLabel(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * cdef PetscDMLabel clbl = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.removeLabel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":524 * CHKERR( DMLabelDestroy(&clbl) ) * * def getLabelValue(self, name, point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), value = 0 * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_169getLabelValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_168getLabelValue[] = "DM.getLabelValue(self, name, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_169getLabelValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_point,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getLabelValue", 1, 2, 2, 1); __PYX_ERR(45, 524, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLabelValue") < 0)) __PYX_ERR(45, 524, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_point = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelValue", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 524, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_168getLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_168getLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_value; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelValue", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":525 * * def getLabelValue(self, name, point): * cdef PetscInt cpoint = asInt(point), value = 0 # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 525, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_v_value = 0; /* "PETSc/DM.pyx":526 * def getLabelValue(self, name, point): * cdef PetscInt cpoint = asInt(point), value = 0 * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":527 * cdef PetscInt cpoint = asInt(point), value = 0 * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) * return toInt(value) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":528 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) # <<<<<<<<<<<<<< * return toInt(value) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelValue(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cpoint, (&__pyx_v_value))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 528, __pyx_L1_error) /* "PETSc/DM.pyx":529 * name = str2bytes(name, &cname) * CHKERR( DMGetLabelValue(self.dm, cname, cpoint, &value) ) * return toInt(value) # <<<<<<<<<<<<<< * * def setLabelValue(self, name, point, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":524 * CHKERR( DMLabelDestroy(&clbl) ) * * def getLabelValue(self, name, point): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), value = 0 * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":531 * return toInt(value) * * def setLabelValue(self, name, point, value): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_171setLabelValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_170setLabelValue[] = "DM.setLabelValue(self, name, point, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_171setLabelValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLabelValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_point,&__pyx_n_s_value,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setLabelValue", 1, 3, 3, 1); __PYX_ERR(45, 531, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setLabelValue", 1, 3, 3, 2); __PYX_ERR(45, 531, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLabelValue") < 0)) __PYX_ERR(45, 531, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_name = values[0]; __pyx_v_point = values[1]; __pyx_v_value = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLabelValue", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 531, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_170setLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_170setLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLabelValue", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":532 * * def setLabelValue(self, name, point, value): * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 532, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 532, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "PETSc/DM.pyx":533 * def setLabelValue(self, name, point, value): * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":534 * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":535 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) # <<<<<<<<<<<<<< * * def clearLabelValue(self, name, point, value): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetLabelValue(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cpoint, __pyx_v_cvalue)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 535, __pyx_L1_error) /* "PETSc/DM.pyx":531 * return toInt(value) * * def setLabelValue(self, name, point, value): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":537 * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) * * def clearLabelValue(self, name, point, value): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_173clearLabelValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_172clearLabelValue[] = "DM.clearLabelValue(self, name, point, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_173clearLabelValue(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearLabelValue (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_point,&__pyx_n_s_value,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("clearLabelValue", 1, 3, 3, 1); __PYX_ERR(45, 537, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("clearLabelValue", 1, 3, 3, 2); __PYX_ERR(45, 537, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clearLabelValue") < 0)) __PYX_ERR(45, 537, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_name = values[0]; __pyx_v_point = values[1]; __pyx_v_value = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clearLabelValue", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 537, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_172clearLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_172clearLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point, PyObject *__pyx_v_value) { PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearLabelValue", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":538 * * def clearLabelValue(self, name, point, value): * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 538, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 538, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "PETSc/DM.pyx":539 * def clearLabelValue(self, name, point, value): * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":540 * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":541 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) # <<<<<<<<<<<<<< * * def getLabelSize(self, name): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClearLabelValue(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cpoint, __pyx_v_cvalue)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 541, __pyx_L1_error) /* "PETSc/DM.pyx":537 * CHKERR( DMSetLabelValue(self.dm, cname, cpoint, cvalue) ) * * def clearLabelValue(self, name, point, value): # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point), cvalue = asInt(value) * cdef const char *cname = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelValue", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":543 * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) * * def getLabelSize(self, name): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_175getLabelSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_174getLabelSize[] = "DM.getLabelSize(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_175getLabelSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLabelSize") < 0)) __PYX_ERR(45, 543, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 543, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_174getLabelSize(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_174getLabelSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { PetscInt __pyx_v_size; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelSize", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":544 * * def getLabelSize(self, name): * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_v_size = 0; /* "PETSc/DM.pyx":545 * def getLabelSize(self, name): * cdef PetscInt size = 0 * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":546 * cdef PetscInt size = 0 * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) * return toInt(size) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":547 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelSize(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 547, __pyx_L1_error) /* "PETSc/DM.pyx":548 * name = str2bytes(name, &cname) * CHKERR( DMGetLabelSize(self.dm, cname, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getLabelIdIS(self, name): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":543 * CHKERR( DMClearLabelValue(self.dm, cname, cpoint, cvalue) ) * * def getLabelSize(self, name): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":550 * return toInt(size) * * def getLabelIdIS(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_177getLabelIdIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_176getLabelIdIS[] = "DM.getLabelIdIS(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_177getLabelIdIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelIdIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLabelIdIS") < 0)) __PYX_ERR(45, 550, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelIdIS", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 550, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelIdIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_176getLabelIdIS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_176getLabelIdIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; struct PyPetscISObject *__pyx_v_lis = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelIdIS", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":551 * * def getLabelIdIS(self, name): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef IS lis = IS() */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":552 * def getLabelIdIS(self, name): * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef IS lis = IS() * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":553 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef IS lis = IS() # <<<<<<<<<<<<<< * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) * return lis */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_lis = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":554 * name = str2bytes(name, &cname) * cdef IS lis = IS() * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) # <<<<<<<<<<<<<< * return lis * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelIdIS(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_lis->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 554, __pyx_L1_error) /* "PETSc/DM.pyx":555 * cdef IS lis = IS() * CHKERR( DMGetLabelIdIS(self.dm, cname, &lis.iset) ) * return lis # <<<<<<<<<<<<<< * * def getStratumSize(self, name, value): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_lis)); __pyx_r = ((PyObject *)__pyx_v_lis); goto __pyx_L0; /* "PETSc/DM.pyx":550 * return toInt(size) * * def getLabelIdIS(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelIdIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_lis); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":557 * return lis * * def getStratumSize(self, name, value): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef PetscInt cvalue = asInt(value) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_179getStratumSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_178getStratumSize[] = "DM.getStratumSize(self, name, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_179getStratumSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStratumSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 2, 2, 1); __PYX_ERR(45, 557, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getStratumSize") < 0)) __PYX_ERR(45, 557, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 557, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_178getStratumSize(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_178getStratumSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PetscInt __pyx_v_size; PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStratumSize", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":558 * * def getStratumSize(self, name, value): * cdef PetscInt size = 0 # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL */ __pyx_v_size = 0; /* "PETSc/DM.pyx":559 * def getStratumSize(self, name, value): * cdef PetscInt size = 0 * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 559, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "PETSc/DM.pyx":560 * cdef PetscInt size = 0 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":561 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) * return toInt(size) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":562 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetStratumSize(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cvalue, (&__pyx_v_size))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 562, __pyx_L1_error) /* "PETSc/DM.pyx":563 * name = str2bytes(name, &cname) * CHKERR( DMGetStratumSize(self.dm, cname, cvalue, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getStratumIS(self, name, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":557 * return lis * * def getStratumSize(self, name, value): # <<<<<<<<<<<<<< * cdef PetscInt size = 0 * cdef PetscInt cvalue = asInt(value) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":565 * return toInt(size) * * def getStratumIS(self, name, value): # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_181getStratumIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_180getStratumIS[] = "DM.getStratumIS(self, name, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_181getStratumIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStratumIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 2, 2, 1); __PYX_ERR(45, 565, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getStratumIS") < 0)) __PYX_ERR(45, 565, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 565, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_180getStratumIS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_180getStratumIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; struct PyPetscISObject *__pyx_v_sis = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStratumIS", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":566 * * def getStratumIS(self, name, value): * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 566, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "PETSc/DM.pyx":567 * def getStratumIS(self, name, value): * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef IS sis = IS() */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":568 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef IS sis = IS() * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":569 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef IS sis = IS() # <<<<<<<<<<<<<< * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) * return sis */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sis = ((struct PyPetscISObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":570 * name = str2bytes(name, &cname) * cdef IS sis = IS() * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) # <<<<<<<<<<<<<< * return sis * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetStratumIS(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cvalue, (&__pyx_v_sis->iset))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 570, __pyx_L1_error) /* "PETSc/DM.pyx":571 * cdef IS sis = IS() * CHKERR( DMGetStratumIS(self.dm, cname, cvalue, &sis.iset) ) * return sis # <<<<<<<<<<<<<< * * def clearLabelStratum(self, name, value): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sis)); __pyx_r = ((PyObject *)__pyx_v_sis); goto __pyx_L0; /* "PETSc/DM.pyx":565 * return toInt(size) * * def getStratumIS(self, name, value): # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.getStratumIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sis); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":573 * return sis * * def clearLabelStratum(self, name, value): # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_183clearLabelStratum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_182clearLabelStratum[] = "DM.clearLabelStratum(self, name, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_183clearLabelStratum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clearLabelStratum (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("clearLabelStratum", 1, 2, 2, 1); __PYX_ERR(45, 573, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clearLabelStratum") < 0)) __PYX_ERR(45, 573, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("clearLabelStratum", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 573, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_182clearLabelStratum(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_182clearLabelStratum(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clearLabelStratum", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":574 * * def clearLabelStratum(self, name, value): * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(45, 574, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "PETSc/DM.pyx":575 * def clearLabelStratum(self, name, value): * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":576 * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":577 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) # <<<<<<<<<<<<<< * * def setLabelOutput(self, name, output): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMClearLabelStratum(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cvalue)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 577, __pyx_L1_error) /* "PETSc/DM.pyx":573 * return sis * * def clearLabelStratum(self, name, value): # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef const char *cname = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DM.clearLabelStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":579 * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) * * def setLabelOutput(self, name, output): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_185setLabelOutput(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_184setLabelOutput[] = "DM.setLabelOutput(self, name, output)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_185setLabelOutput(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_output = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLabelOutput (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_output,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_output)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setLabelOutput", 1, 2, 2, 1); __PYX_ERR(45, 579, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLabelOutput") < 0)) __PYX_ERR(45, 579, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_name = values[0]; __pyx_v_output = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLabelOutput", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 579, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_184setLabelOutput(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_output); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_184setLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_output) { char const *__pyx_v_cname; PetscBool __pyx_v_coutput; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLabelOutput", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":580 * * def setLabelOutput(self, name, output): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscBool coutput = output */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":581 * def setLabelOutput(self, name, output): * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscBool coutput = output * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":582 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscBool coutput = output # <<<<<<<<<<<<<< * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) * */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_output)); if (unlikely(PyErr_Occurred())) __PYX_ERR(45, 582, __pyx_L1_error) __pyx_v_coutput = __pyx_t_2; /* "PETSc/DM.pyx":583 * name = str2bytes(name, &cname) * cdef PetscBool coutput = output * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) # <<<<<<<<<<<<<< * * def getLabelOutput(self, name): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetLabelOutput(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_coutput)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(45, 583, __pyx_L1_error) /* "PETSc/DM.pyx":579 * CHKERR( DMClearLabelStratum(self.dm, cname, cvalue) ) * * def setLabelOutput(self, name, output): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.setLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":585 * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) * * def getLabelOutput(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_187getLabelOutput(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_186getLabelOutput[] = "DM.getLabelOutput(self, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_187getLabelOutput(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLabelOutput (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLabelOutput") < 0)) __PYX_ERR(45, 585, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLabelOutput", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 585, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_186getLabelOutput(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_186getLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) { char const *__pyx_v_cname; PetscBool __pyx_v_coutput; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLabelOutput", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DM.pyx":586 * * def getLabelOutput(self, name): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * cdef PetscBool coutput = PETSC_FALSE */ __pyx_v_cname = NULL; /* "PETSc/DM.pyx":587 * def getLabelOutput(self, name): * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscBool coutput = PETSC_FALSE * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":588 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * cdef PetscBool coutput = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) * return coutput */ __pyx_v_coutput = PETSC_FALSE; /* "PETSc/DM.pyx":589 * name = str2bytes(name, &cname) * cdef PetscBool coutput = PETSC_FALSE * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) # <<<<<<<<<<<<<< * return coutput * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelOutput(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_coutput))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(45, 589, __pyx_L1_error) /* "PETSc/DM.pyx":590 * cdef PetscBool coutput = PETSC_FALSE * CHKERR( DMGetLabelOutput(self.dm, cname, &coutput) ) * return coutput # <<<<<<<<<<<<<< * * # backward compatibility */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_PetscBool(__pyx_v_coutput); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":585 * CHKERR( DMSetLabelOutput(self.dm, cname, coutput) ) * * def getLabelOutput(self, name): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DM.getLabelOutput", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":597 * getMatrix = createMatrix = createMat * * def setKSPComputeOperators(self, operators, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_189setKSPComputeOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_188setKSPComputeOperators[] = "DM.setKSPComputeOperators(self, operators, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_189setKSPComputeOperators(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_operators = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setKSPComputeOperators (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_operators,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_operators)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setKSPComputeOperators") < 0)) __PYX_ERR(45, 597, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_operators = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setKSPComputeOperators", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 597, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setKSPComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_188setKSPComputeOperators(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_operators, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_188setKSPComputeOperators(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_operators, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setKSPComputeOperators", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DM.pyx":598 * * def setKSPComputeOperators(self, operators, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (operators, args, kargs) */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DM.pyx":599 * def setKSPComputeOperators(self, operators, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (operators, args, kargs) * self.set_attr('__operators__', context) */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DM.pyx":600 * if args is None: args = () * if kargs is None: kargs = {} * context = (operators, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__operators__', context) * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_operators); __Pyx_GIVEREF(__pyx_v_operators); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_operators); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":601 * if kargs is None: kargs = {} * context = (operators, args, kargs) * self.set_attr('__operators__', context) # <<<<<<<<<<<<<< * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) * */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__operators__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":602 * context = (operators, args, kargs) * self.set_attr('__operators__', context) * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) # <<<<<<<<<<<<<< * * def createFieldDecomposition(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMKSPSetComputeOperators(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_KSP_ComputeOps, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 602, __pyx_L1_error) /* "PETSc/DM.pyx":597 * getMatrix = createMatrix = createMat * * def setKSPComputeOperators(self, operators, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.setKSPComputeOperators", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":604 * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) * * def createFieldDecomposition(self): # <<<<<<<<<<<<<< * cdef PetscInt clen = 0 * cdef PetscIS *cis = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_191createFieldDecomposition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_190createFieldDecomposition[] = "DM.createFieldDecomposition(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_191createFieldDecomposition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createFieldDecomposition (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createFieldDecomposition", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createFieldDecomposition", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_190createFieldDecomposition(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_190createFieldDecomposition(struct PyPetscDMObject *__pyx_v_self) { PetscInt __pyx_v_clen; IS *__pyx_v_cis; DM *__pyx_v_cdm; char **__pyx_v_cnamelist; PyObject *__pyx_v_isets = 0; PyObject *__pyx_v_dms = 0; PyObject *__pyx_v_names = 0; struct PyPetscDMObject *__pyx_v_dm = 0; long __pyx_v_i; PyObject *__pyx_v_name = NULL; long __pyx_9genexpr14__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createFieldDecomposition", 0); /* "PETSc/DM.pyx":605 * * def createFieldDecomposition(self): * cdef PetscInt clen = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cis = NULL * cdef PetscDM *cdm = NULL */ __pyx_v_clen = 0; /* "PETSc/DM.pyx":606 * def createFieldDecomposition(self): * cdef PetscInt clen = 0 * cdef PetscIS *cis = NULL # <<<<<<<<<<<<<< * cdef PetscDM *cdm = NULL * cdef char** cnamelist = NULL */ __pyx_v_cis = NULL; /* "PETSc/DM.pyx":607 * cdef PetscInt clen = 0 * cdef PetscIS *cis = NULL * cdef PetscDM *cdm = NULL # <<<<<<<<<<<<<< * cdef char** cnamelist = NULL * */ __pyx_v_cdm = NULL; /* "PETSc/DM.pyx":608 * cdef PetscIS *cis = NULL * cdef PetscDM *cdm = NULL * cdef char** cnamelist = NULL # <<<<<<<<<<<<<< * * CHKERR( DMCreateFieldDecomposition(self.dm, &clen, &cnamelist, &cis, &cdm) ) */ __pyx_v_cnamelist = NULL; /* "PETSc/DM.pyx":610 * cdef char** cnamelist = NULL * * CHKERR( DMCreateFieldDecomposition(self.dm, &clen, &cnamelist, &cis, &cdm) ) # <<<<<<<<<<<<<< * * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateFieldDecomposition(__pyx_v_self->dm, (&__pyx_v_clen), (&__pyx_v_cnamelist), (&__pyx_v_cis), (&__pyx_v_cdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 610, __pyx_L1_error) /* "PETSc/DM.pyx":612 * CHKERR( DMCreateFieldDecomposition(self.dm, &clen, &cnamelist, &cis, &cdm) ) * * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] # <<<<<<<<<<<<<< * cdef list dms = [] * cdef list names = [] */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_clen; for (__pyx_9genexpr14__pyx_v_i = 0; __pyx_9genexpr14__pyx_v_i < __pyx_t_3; __pyx_9genexpr14__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr14__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(45, 612, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_isets = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":613 * * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] * cdef list dms = [] # <<<<<<<<<<<<<< * cdef list names = [] * cdef DM dm = None */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_dms = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":614 * cdef list isets = [ref_IS(cis[i]) for i from 0 <= i < clen] * cdef list dms = [] * cdef list names = [] # <<<<<<<<<<<<<< * cdef DM dm = None * */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_names = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DM.pyx":615 * cdef list dms = [] * cdef list names = [] * cdef DM dm = None # <<<<<<<<<<<<<< * * for i from 0 <= i < clen: */ __Pyx_INCREF(Py_None); __pyx_v_dm = ((struct PyPetscDMObject *)Py_None); /* "PETSc/DM.pyx":617 * cdef DM dm = None * * for i from 0 <= i < clen: # <<<<<<<<<<<<<< * if cdm != NULL: * dm = subtype_DM(cdm[i])() */ __pyx_t_3 = __pyx_v_clen; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/DM.pyx":618 * * for i from 0 <= i < clen: * if cdm != NULL: # <<<<<<<<<<<<<< * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] */ __pyx_t_5 = ((__pyx_v_cdm != NULL) != 0); if (__pyx_t_5) { /* "PETSc/DM.pyx":619 * for i from 0 <= i < clen: * if cdm != NULL: * dm = subtype_DM(cdm[i])() # <<<<<<<<<<<<<< * dm.dm = cdm[i] * PetscINCREF(dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_cdm[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(45, 619, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_dm, ((struct PyPetscDMObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "PETSc/DM.pyx":620 * if cdm != NULL: * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * dms.append(dm) */ __pyx_v_dm->dm = (__pyx_v_cdm[__pyx_v_i]); /* "PETSc/DM.pyx":621 * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * dms.append(dm) * else: */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/DM.pyx":622 * dm.dm = cdm[i] * PetscINCREF(dm.obj) * dms.append(dm) # <<<<<<<<<<<<<< * else: * dms.append(None) */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dms, ((PyObject *)__pyx_v_dm)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(45, 622, __pyx_L1_error) /* "PETSc/DM.pyx":618 * * for i from 0 <= i < clen: * if cdm != NULL: # <<<<<<<<<<<<<< * dm = subtype_DM(cdm[i])() * dm.dm = cdm[i] */ goto __pyx_L7; } /* "PETSc/DM.pyx":624 * dms.append(dm) * else: * dms.append(None) # <<<<<<<<<<<<<< * * name = bytes2str(cnamelist[i]) */ /*else*/ { __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_dms, Py_None); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(45, 624, __pyx_L1_error) } __pyx_L7:; /* "PETSc/DM.pyx":626 * dms.append(None) * * name = bytes2str(cnamelist[i]) # <<<<<<<<<<<<<< * names.append(name) * CHKERR( PetscFree(cnamelist[i]) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_bytes2str((__pyx_v_cnamelist[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DM.pyx":627 * * name = bytes2str(cnamelist[i]) * names.append(name) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cnamelist[i]) ) * */ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_names, __pyx_v_name); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(45, 627, __pyx_L1_error) /* "PETSc/DM.pyx":628 * name = bytes2str(cnamelist[i]) * names.append(name) * CHKERR( PetscFree(cnamelist[i]) ) # <<<<<<<<<<<<<< * * CHKERR( ISDestroy(&cis[i]) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree((__pyx_v_cnamelist[__pyx_v_i]))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 628, __pyx_L1_error) /* "PETSc/DM.pyx":630 * CHKERR( PetscFree(cnamelist[i]) ) * * CHKERR( ISDestroy(&cis[i]) ) # <<<<<<<<<<<<<< * CHKERR( DMDestroy(&cdm[i]) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&(__pyx_v_cis[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 630, __pyx_L1_error) /* "PETSc/DM.pyx":631 * * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( DMDestroy(&cdm[i]) ) # <<<<<<<<<<<<<< * * CHKERR( PetscFree(cis) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDestroy((&(__pyx_v_cdm[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 631, __pyx_L1_error) } /* "PETSc/DM.pyx":633 * CHKERR( DMDestroy(&cdm[i]) ) * * CHKERR( PetscFree(cis) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cdm) ) * CHKERR( PetscFree(cnamelist) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cis)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 633, __pyx_L1_error) /* "PETSc/DM.pyx":634 * * CHKERR( PetscFree(cis) ) * CHKERR( PetscFree(cdm) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cnamelist) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cdm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 634, __pyx_L1_error) /* "PETSc/DM.pyx":635 * CHKERR( PetscFree(cis) ) * CHKERR( PetscFree(cdm) ) * CHKERR( PetscFree(cnamelist) ) # <<<<<<<<<<<<<< * * return (names, isets, dms) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cnamelist)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 635, __pyx_L1_error) /* "PETSc/DM.pyx":637 * CHKERR( PetscFree(cnamelist) ) * * return (names, isets, dms) # <<<<<<<<<<<<<< * * def setSNESFunction(self, function, args=None, kargs=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_names); __Pyx_GIVEREF(__pyx_v_names); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_names); __Pyx_INCREF(__pyx_v_isets); __Pyx_GIVEREF(__pyx_v_isets); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_isets); __Pyx_INCREF(__pyx_v_dms); __Pyx_GIVEREF(__pyx_v_dms); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_dms); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":604 * CHKERR( DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, context) ) * * def createFieldDecomposition(self): # <<<<<<<<<<<<<< * cdef PetscInt clen = 0 * cdef PetscIS *cis = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DM.createFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_isets); __Pyx_XDECREF(__pyx_v_dms); __Pyx_XDECREF(__pyx_v_names); __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":639 * return (names, isets, dms) * * def setSNESFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_193setSNESFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_192setSNESFunction[] = "DM.setSNESFunction(self, function, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_193setSNESFunction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_function = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSNESFunction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_function,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_function)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSNESFunction") < 0)) __PYX_ERR(45, 639, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_function = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSNESFunction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 639, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_192setSNESFunction(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_192setSNESFunction(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSNESFunction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DM.pyx":640 * * def setSNESFunction(self, function, args=None, kargs=None): * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_function != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DM.pyx":641 * def setSNESFunction(self, function, args=None, kargs=None): * if function is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (function, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DM.pyx":642 * if function is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (function, args, kargs) * self.set_attr('__function__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DM.pyx":643 * if args is None: args = () * if kargs is None: kargs = {} * context = (function, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__function__', context) * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_function); __Pyx_GIVEREF(__pyx_v_function); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_function); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":644 * if kargs is None: kargs = {} * context = (function, args, kargs) * self.set_attr('__function__', context) # <<<<<<<<<<<<<< * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__function__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":645 * context = (function, args, kargs) * self.set_attr('__function__', context) * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetFunction(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_SNES_Function, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 645, __pyx_L1_error) /* "PETSc/DM.pyx":640 * * def setSNESFunction(self, function, args=None, kargs=None): * if function is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DM.pyx":647 * CHKERR( DMSNESSetFunction(self.dm, SNES_Function, context) ) * else: * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) # <<<<<<<<<<<<<< * * def setSNESJacobian(self, jacobian, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetFunction(__pyx_v_self->dm, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 647, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DM.pyx":639 * return (names, isets, dms) * * def setSNESFunction(self, function, args=None, kargs=None): # <<<<<<<<<<<<<< * if function is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESFunction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":649 * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) * * def setSNESJacobian(self, jacobian, args=None, kargs=None): # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_195setSNESJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_194setSNESJacobian[] = "DM.setSNESJacobian(self, jacobian, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_195setSNESJacobian(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_jacobian = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSNESJacobian (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jacobian,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jacobian)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSNESJacobian") < 0)) __PYX_ERR(45, 649, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_jacobian = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSNESJacobian", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 649, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_194setSNESJacobian(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_194setSNESJacobian(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_jacobian, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSNESJacobian", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DM.pyx":650 * * def setSNESJacobian(self, jacobian, args=None, kargs=None): * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_jacobian != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DM.pyx":651 * def setSNESJacobian(self, jacobian, args=None, kargs=None): * if jacobian is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (jacobian, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DM.pyx":652 * if jacobian is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DM.pyx":653 * if args is None: args = () * if kargs is None: kargs = {} * context = (jacobian, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__jacobian__', context) * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_jacobian); __Pyx_GIVEREF(__pyx_v_jacobian); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":654 * if kargs is None: kargs = {} * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) # <<<<<<<<<<<<<< * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__jacobian__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":655 * context = (jacobian, args, kargs) * self.set_attr('__jacobian__', context) * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetJacobian(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_SNES_Jacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 655, __pyx_L1_error) /* "PETSc/DM.pyx":650 * * def setSNESJacobian(self, jacobian, args=None, kargs=None): * if jacobian is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DM.pyx":657 * CHKERR( DMSNESSetJacobian(self.dm, SNES_Jacobian, context) ) * else: * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) # <<<<<<<<<<<<<< * * def addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSNESSetJacobian(__pyx_v_self->dm, NULL, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 657, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DM.pyx":649 * CHKERR( DMSNESSetFunction(self.dm, NULL, NULL) ) * * def setSNESJacobian(self, jacobian, args=None, kargs=None): # <<<<<<<<<<<<<< * if jacobian is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.setSNESJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":659 * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) * * def addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_197addCoarsenHook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DM_196addCoarsenHook[] = "DM.addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_197addCoarsenHook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_coarsenhook = 0; PyObject *__pyx_v_restricthook = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addCoarsenHook (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coarsenhook,&__pyx_n_s_restricthook,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coarsenhook)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_restricthook)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("addCoarsenHook", 0, 2, 4, 1); __PYX_ERR(45, 659, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addCoarsenHook") < 0)) __PYX_ERR(45, 659, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_coarsenhook = values[0]; __pyx_v_restricthook = values[1]; __pyx_v_args = values[2]; __pyx_v_kargs = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addCoarsenHook", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(45, 659, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DM.addCoarsenHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_196addCoarsenHook(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_coarsenhook, __pyx_v_restricthook, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_196addCoarsenHook(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_coarsenhook, PyObject *__pyx_v_restricthook, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_coarsencontext = NULL; PyObject *__pyx_v_coarsenhooks = NULL; PyObject *__pyx_v_restrictcontext = NULL; PyObject *__pyx_v_restricthooks = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addCoarsenHook", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DM.pyx":660 * * def addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None): * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DM.pyx":661 * def addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None): * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * * if coarsenhook is not None: */ __pyx_t_2 = (__pyx_v_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DM.pyx":663 * if kargs is None: kargs = {} * * if coarsenhook is not None: # <<<<<<<<<<<<<< * coarsencontext = (coarsenhook, args, kargs) * */ __pyx_t_1 = (__pyx_v_coarsenhook != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DM.pyx":664 * * if coarsenhook is not None: * coarsencontext = (coarsenhook, args, kargs) # <<<<<<<<<<<<<< * * coarsenhooks = self.get_attr('__coarsenhooks__') */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_coarsenhook); __Pyx_GIVEREF(__pyx_v_coarsenhook); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_coarsenhook); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_coarsencontext = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":666 * coarsencontext = (coarsenhook, args, kargs) * * coarsenhooks = self.get_attr('__coarsenhooks__') # <<<<<<<<<<<<<< * if coarsenhooks is None: * coarsenhooks = [coarsencontext] */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__coarsenhooks__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_coarsenhooks = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/DM.pyx":667 * * coarsenhooks = self.get_attr('__coarsenhooks__') * if coarsenhooks is None: # <<<<<<<<<<<<<< * coarsenhooks = [coarsencontext] * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) */ __pyx_t_2 = (__pyx_v_coarsenhooks == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/DM.pyx":668 * coarsenhooks = self.get_attr('__coarsenhooks__') * if coarsenhooks is None: * coarsenhooks = [coarsencontext] # <<<<<<<<<<<<<< * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) * else: */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_coarsencontext); __Pyx_GIVEREF(__pyx_v_coarsencontext); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_coarsencontext); __Pyx_DECREF_SET(__pyx_v_coarsenhooks, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":669 * if coarsenhooks is None: * coarsenhooks = [coarsencontext] * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) # <<<<<<<<<<<<<< * else: * coarsenhooks.append(coarsencontext) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsenHookAdd(__pyx_v_self->dm, __pyx_f_8petsc4py_5PETSc_DM_PyCoarsenHook, NULL, ((void *)NULL))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 669, __pyx_L1_error) /* "PETSc/DM.pyx":667 * * coarsenhooks = self.get_attr('__coarsenhooks__') * if coarsenhooks is None: # <<<<<<<<<<<<<< * coarsenhooks = [coarsencontext] * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) */ goto __pyx_L6; } /* "PETSc/DM.pyx":671 * CHKERR( DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, NULL) ) * else: * coarsenhooks.append(coarsencontext) # <<<<<<<<<<<<<< * self.set_attr('__coarsenhooks__', coarsenhooks) * */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_coarsenhooks, __pyx_v_coarsencontext); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(45, 671, __pyx_L1_error) } __pyx_L6:; /* "PETSc/DM.pyx":672 * else: * coarsenhooks.append(coarsencontext) * self.set_attr('__coarsenhooks__', coarsenhooks) # <<<<<<<<<<<<<< * * if restricthook is not None: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__coarsenhooks__"), __pyx_v_coarsenhooks); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":663 * if kargs is None: kargs = {} * * if coarsenhook is not None: # <<<<<<<<<<<<<< * coarsencontext = (coarsenhook, args, kargs) * */ } /* "PETSc/DM.pyx":674 * self.set_attr('__coarsenhooks__', coarsenhooks) * * if restricthook is not None: # <<<<<<<<<<<<<< * restrictcontext = (restricthook, args, kargs) * */ __pyx_t_1 = (__pyx_v_restricthook != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DM.pyx":675 * * if restricthook is not None: * restrictcontext = (restricthook, args, kargs) # <<<<<<<<<<<<<< * * restricthooks = self.get_attr('__restricthooks__') */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_restricthook); __Pyx_GIVEREF(__pyx_v_restricthook); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_restricthook); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_restrictcontext = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":677 * restrictcontext = (restricthook, args, kargs) * * restricthooks = self.get_attr('__restricthooks__') # <<<<<<<<<<<<<< * if restricthooks is None: * restricthooks = [restrictcontext] */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__restricthooks__")); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_restricthooks = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/DM.pyx":678 * * restricthooks = self.get_attr('__restricthooks__') * if restricthooks is None: # <<<<<<<<<<<<<< * restricthooks = [restrictcontext] * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) */ __pyx_t_2 = (__pyx_v_restricthooks == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/DM.pyx":679 * restricthooks = self.get_attr('__restricthooks__') * if restricthooks is None: * restricthooks = [restrictcontext] # <<<<<<<<<<<<<< * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) * else: */ __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_restrictcontext); __Pyx_GIVEREF(__pyx_v_restrictcontext); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_restrictcontext); __Pyx_DECREF_SET(__pyx_v_restricthooks, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":680 * if restricthooks is None: * restricthooks = [restrictcontext] * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) # <<<<<<<<<<<<<< * else: * restricthooks.append(restrictcontext) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCoarsenHookAdd(__pyx_v_self->dm, NULL, __pyx_f_8petsc4py_5PETSc_DM_PyRestrictHook, ((void *)NULL))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(45, 680, __pyx_L1_error) /* "PETSc/DM.pyx":678 * * restricthooks = self.get_attr('__restricthooks__') * if restricthooks is None: # <<<<<<<<<<<<<< * restricthooks = [restrictcontext] * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) */ goto __pyx_L8; } /* "PETSc/DM.pyx":682 * CHKERR( DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, NULL) ) * else: * restricthooks.append(restrictcontext) # <<<<<<<<<<<<<< * self.set_attr('__restricthooks__', restricthooks) * */ /*else*/ { __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_restricthooks, __pyx_v_restrictcontext); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(45, 682, __pyx_L1_error) } __pyx_L8:; /* "PETSc/DM.pyx":683 * else: * restricthooks.append(restrictcontext) * self.set_attr('__restricthooks__', restricthooks) # <<<<<<<<<<<<<< * * # --- application context --- */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DM *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__restricthooks__"), __pyx_v_restricthooks); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":674 * self.set_attr('__coarsenhooks__', coarsenhooks) * * if restricthook is not None: # <<<<<<<<<<<<<< * restrictcontext = (restricthook, args, kargs) * */ } /* "PETSc/DM.pyx":659 * CHKERR( DMSNESSetJacobian(self.dm, NULL, NULL) ) * * def addCoarsenHook(self, coarsenhook, restricthook, args=None, kargs=None): # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.addCoarsenHook", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_coarsencontext); __Pyx_XDECREF(__pyx_v_coarsenhooks); __Pyx_XDECREF(__pyx_v_restrictcontext); __Pyx_XDECREF(__pyx_v_restricthooks); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":688 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_6appctx_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_6appctx_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_6appctx___get__(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_6appctx___get__(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DM.pyx":689 * property appctx: * def __get__(self): * return self.getAppCtx() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setAppCtx(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":688 * * property appctx: * def __get__(self): # <<<<<<<<<<<<<< * return self.getAppCtx() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.appctx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":690 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_6appctx_2__set__(((struct PyPetscDMObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DM_6appctx_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/DM.pyx":691 * return self.getAppCtx() * def __set__(self, value): * self.setAppCtx(value) # <<<<<<<<<<<<<< * * # --- discretization space --- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAppCtx); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":690 * def __get__(self): * return self.getAppCtx() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setAppCtx(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.appctx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":696 * * property ds: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDS() * def __set__(self, value): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_2ds_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_2ds_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_2ds___get__(((struct PyPetscDMObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_2ds___get__(struct PyPetscDMObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DM.pyx":697 * property ds: * def __get__(self): * return self.getDS() # <<<<<<<<<<<<<< * def __set__(self, value): * self.setDS(value) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDS); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DM.pyx":696 * * property ds: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDS() * def __set__(self, value): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.ds.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DM.pyx":698 * def __get__(self): * return self.getDS() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDS(value) * */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DM_2ds_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DM_2ds_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_2ds_2__set__(((struct PyPetscDMObject *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DM_2ds_2__set__(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); /* "PETSc/DM.pyx":699 * return self.getDS() * def __set__(self, value): * self.setDS(value) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDS); if (unlikely(!__pyx_t_2)) __PYX_ERR(45, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_value); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DM.pyx":698 * def __get__(self): * return self.getDS() * def __set__(self, value): # <<<<<<<<<<<<<< * self.setDS(value) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DM.ds.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":14 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ds * self.ds = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_2DS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_2DS_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS___cinit__(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_2DS___cinit__(struct PyPetscDSObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/DS.pyx":15 * * def __cinit__(self): * self.obj = &self.ds # <<<<<<<<<<<<<< * self.ds = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ds)); /* "PETSc/DS.pyx":16 * def __cinit__(self): * self.obj = &self.ds * self.ds = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_v_self->ds = NULL; /* "PETSc/DS.pyx":14 * # * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.ds * self.ds = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":18 * self.ds = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_2view[] = "DS.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(46, 18, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 18, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(46, 18, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_2view(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_2view(struct PyPetscDSObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/DS.pyx":19 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscDSView(self.ds, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/DS.pyx":20 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscDSView(self.ds, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/DS.pyx":21 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscDSView(self.ds, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSView(__pyx_v_self->ds, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(46, 21, __pyx_L1_error) /* "PETSc/DS.pyx":18 * self.ds = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":23 * CHKERR( PetscDSView(self.ds, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscDSDestroy(&self.ds) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_4destroy[] = "DS.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_4destroy(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_4destroy(struct PyPetscDSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/DS.pyx":24 * * def destroy(self): * CHKERR( PetscDSDestroy(&self.ds) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSDestroy((&__pyx_v_self->ds))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 24, __pyx_L1_error) /* "PETSc/DS.pyx":25 * def destroy(self): * CHKERR( PetscDSDestroy(&self.ds) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DS.pyx":23 * CHKERR( PetscDSView(self.ds, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscDSDestroy(&self.ds) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":27 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDS newds = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_6create[] = "DS.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(46, 27, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 27, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_6create(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_6create(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscDS __pyx_v_newds; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DS.pyx":28 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDS newds = NULL * CHKERR( PetscDSCreate(ccomm, &newds) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 28, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DS.pyx":29 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDS newds = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSCreate(ccomm, &newds) ) * PetscCLEAR(self.obj); self.ds = newds */ __pyx_v_newds = NULL; /* "PETSc/DS.pyx":30 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDS newds = NULL * CHKERR( PetscDSCreate(ccomm, &newds) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.ds = newds * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSCreate(__pyx_v_ccomm, (&__pyx_v_newds))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(46, 30, __pyx_L1_error) /* "PETSc/DS.pyx":31 * cdef PetscDS newds = NULL * CHKERR( PetscDSCreate(ccomm, &newds) ) * PetscCLEAR(self.obj); self.ds = newds # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->ds = __pyx_v_newds; /* "PETSc/DS.pyx":32 * CHKERR( PetscDSCreate(ccomm, &newds) ) * PetscCLEAR(self.obj); self.ds = newds * return self # <<<<<<<<<<<<<< * * def setType(self, ds_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DS.pyx":27 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDS newds = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":34 * return self * * def setType(self, ds_type): # <<<<<<<<<<<<<< * cdef PetscDSType cval = NULL * ds_type = str2bytes(ds_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_8setType[] = "DS.setType(self, ds_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ds_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ds_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ds_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(46, 34, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ds_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 34, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_8setType(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_ds_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_8setType(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_ds_type) { PetscDSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_ds_type); /* "PETSc/DS.pyx":35 * * def setType(self, ds_type): * cdef PetscDSType cval = NULL # <<<<<<<<<<<<<< * ds_type = str2bytes(ds_type, &cval) * CHKERR( PetscDSSetType(self.ds, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DS.pyx":36 * def setType(self, ds_type): * cdef PetscDSType cval = NULL * ds_type = str2bytes(ds_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscDSSetType(self.ds, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ds_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_ds_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DS.pyx":37 * cdef PetscDSType cval = NULL * ds_type = str2bytes(ds_type, &cval) * CHKERR( PetscDSSetType(self.ds, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetType(__pyx_v_self->ds, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(46, 37, __pyx_L1_error) /* "PETSc/DS.pyx":34 * return self * * def setType(self, ds_type): # <<<<<<<<<<<<<< * cdef PetscDSType cval = NULL * ds_type = str2bytes(ds_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DS.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ds_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":39 * CHKERR( PetscDSSetType(self.ds, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscDSType cval = NULL * CHKERR( PetscDSGetType(self.ds, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_10getType[] = "DS.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_10getType(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_10getType(struct PyPetscDSObject *__pyx_v_self) { PetscDSType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/DS.pyx":40 * * def getType(self): * cdef PetscDSType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSGetType(self.ds, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/DS.pyx":41 * def getType(self): * cdef PetscDSType cval = NULL * CHKERR( PetscDSGetType(self.ds, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetType(__pyx_v_self->ds, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 41, __pyx_L1_error) /* "PETSc/DS.pyx":42 * cdef PetscDSType cval = NULL * CHKERR( PetscDSGetType(self.ds, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":39 * CHKERR( PetscDSSetType(self.ds, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscDSType cval = NULL * CHKERR( PetscDSGetType(self.ds, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":44 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscDSSetFromOptions(self.ds) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_12setFromOptions[] = "DS.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_12setFromOptions(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_12setFromOptions(struct PyPetscDSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/DS.pyx":45 * * def setFromOptions(self): * CHKERR( PetscDSSetFromOptions(self.ds) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetFromOptions(__pyx_v_self->ds)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 45, __pyx_L1_error) /* "PETSc/DS.pyx":44 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscDSSetFromOptions(self.ds) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":47 * CHKERR( PetscDSSetFromOptions(self.ds) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscDSSetUp(self.ds) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_15setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_14setUp[] = "DS.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_15setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_14setUp(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_14setUp(struct PyPetscDSObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/DS.pyx":48 * * def setUp(self): * CHKERR( PetscDSSetUp(self.ds) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetUp(__pyx_v_self->ds)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 48, __pyx_L1_error) /* "PETSc/DS.pyx":49 * def setUp(self): * CHKERR( PetscDSSetUp(self.ds) ) * return self # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DS.pyx":47 * CHKERR( PetscDSSetFromOptions(self.ds) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscDSSetUp(self.ds) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":53 * # * * def getSpatialDimension(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_16getSpatialDimension[] = "DS.getSpatialDimension(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSpatialDimension (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSpatialDimension", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSpatialDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_16getSpatialDimension(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_16getSpatialDimension(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSpatialDimension", 0); /* "PETSc/DS.pyx":54 * * def getSpatialDimension(self): * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "PETSc/DS.pyx":55 * def getSpatialDimension(self): * cdef PetscInt dim = 0 * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetSpatialDimension(__pyx_v_self->ds, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 55, __pyx_L1_error) /* "PETSc/DS.pyx":56 * cdef PetscInt dim = 0 * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def getCoordinateDimension(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":53 * # * * def getSpatialDimension(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( PetscDSGetSpatialDimension(self.ds, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getSpatialDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":58 * return toInt(dim) * * def getCoordinateDimension(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_18getCoordinateDimension[] = "DS.getCoordinateDimension(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateDimension (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateDimension", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCoordinateDimension", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_18getCoordinateDimension(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_18getCoordinateDimension(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateDimension", 0); /* "PETSc/DS.pyx":59 * * def getCoordinateDimension(self): * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) * return toInt(dim) */ __pyx_v_dim = 0; /* "PETSc/DS.pyx":60 * def getCoordinateDimension(self): * cdef PetscInt dim = 0 * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) # <<<<<<<<<<<<<< * return toInt(dim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetCoordinateDimension(__pyx_v_self->ds, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 60, __pyx_L1_error) /* "PETSc/DS.pyx":61 * cdef PetscInt dim = 0 * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) * return toInt(dim) # <<<<<<<<<<<<<< * * def getNumFields(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":58 * return toInt(dim) * * def getCoordinateDimension(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * CHKERR( PetscDSGetCoordinateDimension(self.ds, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getCoordinateDimension", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":63 * return toInt(dim) * * def getNumFields(self): # <<<<<<<<<<<<<< * cdef PetscInt nf = 0 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_20getNumFields[] = "DS.getNumFields(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumFields (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNumFields", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumFields", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_20getNumFields(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_20getNumFields(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_nf; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumFields", 0); /* "PETSc/DS.pyx":64 * * def getNumFields(self): * cdef PetscInt nf = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * return toInt(nf) */ __pyx_v_nf = 0; /* "PETSc/DS.pyx":65 * def getNumFields(self): * cdef PetscInt nf = 0 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) # <<<<<<<<<<<<<< * return toInt(nf) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetNumFields(__pyx_v_self->ds, (&__pyx_v_nf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 65, __pyx_L1_error) /* "PETSc/DS.pyx":66 * cdef PetscInt nf = 0 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * return toInt(nf) # <<<<<<<<<<<<<< * * def getFieldIndex(self, Object disc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nf); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":63 * return toInt(dim) * * def getNumFields(self): # <<<<<<<<<<<<<< * cdef PetscInt nf = 0 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getNumFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":68 * return toInt(nf) * * def getFieldIndex(self, Object disc): # <<<<<<<<<<<<<< * cdef PetscInt field = 0 * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_22getFieldIndex[] = "DS.getFieldIndex(self, Object disc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscObjectObject *__pyx_v_disc = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldIndex (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_disc,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_disc)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldIndex") < 0)) __PYX_ERR(46, 68, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_disc = ((struct PyPetscObjectObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldIndex", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 68, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.getFieldIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_disc), __pyx_ptype_8petsc4py_5PETSc_Object, 0, "disc", 0))) __PYX_ERR(46, 68, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_22getFieldIndex(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_disc); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_22getFieldIndex(struct PyPetscDSObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_disc) { PetscInt __pyx_v_field; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldIndex", 0); /* "PETSc/DS.pyx":69 * * def getFieldIndex(self, Object disc): * cdef PetscInt field = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) * return toInt(field) */ __pyx_v_field = 0; /* "PETSc/DS.pyx":70 * def getFieldIndex(self, Object disc): * cdef PetscInt field = 0 * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) # <<<<<<<<<<<<<< * return toInt(field) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetFieldIndex(__pyx_v_self->ds, (__pyx_v_disc->obj[0]), (&__pyx_v_field))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 70, __pyx_L1_error) /* "PETSc/DS.pyx":71 * cdef PetscInt field = 0 * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) * return toInt(field) # <<<<<<<<<<<<<< * * def getTotalDimensions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_field); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":68 * return toInt(nf) * * def getFieldIndex(self, Object disc): # <<<<<<<<<<<<<< * cdef PetscInt field = 0 * CHKERR( PetscDSGetFieldIndex(self.ds, disc.obj[0], &field) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getFieldIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":73 * return toInt(field) * * def getTotalDimensions(self): # <<<<<<<<<<<<<< * cdef PetscInt tdim = 0 * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_24getTotalDimensions[] = "DS.getTotalDimensions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTotalDimensions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTotalDimensions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTotalDimensions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_24getTotalDimensions(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_24getTotalDimensions(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_tdim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTotalDimensions", 0); /* "PETSc/DS.pyx":74 * * def getTotalDimensions(self): * cdef PetscInt tdim = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) * return toInt(tdim) */ __pyx_v_tdim = 0; /* "PETSc/DS.pyx":75 * def getTotalDimensions(self): * cdef PetscInt tdim = 0 * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) # <<<<<<<<<<<<<< * return toInt(tdim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetTotalDimension(__pyx_v_self->ds, (&__pyx_v_tdim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 75, __pyx_L1_error) /* "PETSc/DS.pyx":76 * cdef PetscInt tdim = 0 * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) * return toInt(tdim) # <<<<<<<<<<<<<< * * def getTotalComponents(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tdim); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":73 * return toInt(field) * * def getTotalDimensions(self): # <<<<<<<<<<<<<< * cdef PetscInt tdim = 0 * CHKERR( PetscDSGetTotalDimension(self.ds, &tdim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getTotalDimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":78 * return toInt(tdim) * * def getTotalComponents(self): # <<<<<<<<<<<<<< * cdef PetscInt tcmp = 0 * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_26getTotalComponents[] = "DS.getTotalComponents(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTotalComponents (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getTotalComponents", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getTotalComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_26getTotalComponents(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_26getTotalComponents(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_tcmp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTotalComponents", 0); /* "PETSc/DS.pyx":79 * * def getTotalComponents(self): * cdef PetscInt tcmp = 0 # <<<<<<<<<<<<<< * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) * return toInt(tcmp) */ __pyx_v_tcmp = 0; /* "PETSc/DS.pyx":80 * def getTotalComponents(self): * cdef PetscInt tcmp = 0 * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) # <<<<<<<<<<<<<< * return toInt(tcmp) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetTotalComponents(__pyx_v_self->ds, (&__pyx_v_tcmp))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 80, __pyx_L1_error) /* "PETSc/DS.pyx":81 * cdef PetscInt tcmp = 0 * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) * return toInt(tcmp) # <<<<<<<<<<<<<< * * def getDimensions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tcmp); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":78 * return toInt(tdim) * * def getTotalComponents(self): # <<<<<<<<<<<<<< * cdef PetscInt tcmp = 0 * CHKERR( PetscDSGetTotalComponents(self.ds, &tcmp) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getTotalComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":83 * return toInt(tcmp) * * def getDimensions(self): # <<<<<<<<<<<<<< * cdef PetscInt nf = 0, *dims = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_28getDimensions[] = "DS.getDimensions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDimensions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDimensions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDimensions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_28getDimensions(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_28getDimensions(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_nf; PetscInt *__pyx_v_dims; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDimensions", 0); /* "PETSc/DS.pyx":84 * * def getDimensions(self): * cdef PetscInt nf = 0, *dims = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) */ __pyx_v_nf = 0; __pyx_v_dims = NULL; /* "PETSc/DS.pyx":85 * def getDimensions(self): * cdef PetscInt nf = 0, *dims = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) # <<<<<<<<<<<<<< * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) * return array_i(nf, dims) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetNumFields(__pyx_v_self->ds, (&__pyx_v_nf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 85, __pyx_L1_error) /* "PETSc/DS.pyx":86 * cdef PetscInt nf = 0, *dims = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) # <<<<<<<<<<<<<< * return array_i(nf, dims) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetDimensions(__pyx_v_self->ds, (&__pyx_v_dims))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 86, __pyx_L1_error) /* "PETSc/DS.pyx":87 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetDimensions(self.ds, &dims) ) * return array_i(nf, dims) # <<<<<<<<<<<<<< * * def getComponents(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nf, __pyx_v_dims)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":83 * return toInt(tcmp) * * def getDimensions(self): # <<<<<<<<<<<<<< * cdef PetscInt nf = 0, *dims = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getDimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":89 * return array_i(nf, dims) * * def getComponents(self): # <<<<<<<<<<<<<< * cdef PetscInt nf = 0, *cmps = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_30getComponents[] = "DS.getComponents(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getComponents (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getComponents", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getComponents", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_30getComponents(((struct PyPetscDSObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_30getComponents(struct PyPetscDSObject *__pyx_v_self) { PetscInt __pyx_v_nf; PetscInt *__pyx_v_cmps; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getComponents", 0); /* "PETSc/DS.pyx":90 * * def getComponents(self): * cdef PetscInt nf = 0, *cmps = NULL # <<<<<<<<<<<<<< * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) */ __pyx_v_nf = 0; __pyx_v_cmps = NULL; /* "PETSc/DS.pyx":91 * def getComponents(self): * cdef PetscInt nf = 0, *cmps = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) # <<<<<<<<<<<<<< * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) * return array_i(nf, cmps) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetNumFields(__pyx_v_self->ds, (&__pyx_v_nf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 91, __pyx_L1_error) /* "PETSc/DS.pyx":92 * cdef PetscInt nf = 0, *cmps = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) # <<<<<<<<<<<<<< * return array_i(nf, cmps) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSGetComponents(__pyx_v_self->ds, (&__pyx_v_cmps))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(46, 92, __pyx_L1_error) /* "PETSc/DS.pyx":93 * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) * CHKERR( PetscDSGetComponents(self.ds, &cmps) ) * return array_i(nf, cmps) # <<<<<<<<<<<<<< * * def setDiscretisation(self, f, disc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nf, __pyx_v_cmps)); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DS.pyx":89 * return array_i(nf, dims) * * def getComponents(self): # <<<<<<<<<<<<<< * cdef PetscInt nf = 0, *cmps = NULL * CHKERR( PetscDSGetNumFields(self.ds, &nf) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.getComponents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DS.pyx":95 * return array_i(nf, cmps) * * def setDiscretisation(self, f, disc): # <<<<<<<<<<<<<< * cdef PetscInt cf = asInt(f) * cdef FE fe = disc */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_33setDiscretisation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2DS_32setDiscretisation[] = "DS.setDiscretisation(self, f, disc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_2DS_33setDiscretisation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_f = 0; PyObject *__pyx_v_disc = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDiscretisation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_disc,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_disc)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setDiscretisation", 1, 2, 2, 1); __PYX_ERR(46, 95, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDiscretisation") < 0)) __PYX_ERR(46, 95, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_f = values[0]; __pyx_v_disc = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDiscretisation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(46, 95, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DS.setDiscretisation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DS_32setDiscretisation(((struct PyPetscDSObject *)__pyx_v_self), __pyx_v_f, __pyx_v_disc); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2DS_32setDiscretisation(struct PyPetscDSObject *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_disc) { PetscInt __pyx_v_cf; struct PyPetscFEObject *__pyx_v_fe = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDiscretisation", 0); /* "PETSc/DS.pyx":96 * * def setDiscretisation(self, f, disc): * cdef PetscInt cf = asInt(f) # <<<<<<<<<<<<<< * cdef FE fe = disc * CHKERR( PetscDSSetDiscretization(self.ds, cf, fe.fe) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_f); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 96, __pyx_L1_error) __pyx_v_cf = __pyx_t_1; /* "PETSc/DS.pyx":97 * def setDiscretisation(self, f, disc): * cdef PetscInt cf = asInt(f) * cdef FE fe = disc # <<<<<<<<<<<<<< * CHKERR( PetscDSSetDiscretization(self.ds, cf, fe.fe) ) * */ if (!(likely(((__pyx_v_disc) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_disc, __pyx_ptype_8petsc4py_5PETSc_FE))))) __PYX_ERR(46, 97, __pyx_L1_error) __pyx_t_2 = __pyx_v_disc; __Pyx_INCREF(__pyx_t_2); __pyx_v_fe = ((struct PyPetscFEObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DS.pyx":98 * cdef PetscInt cf = asInt(f) * cdef FE fe = disc * CHKERR( PetscDSSetDiscretization(self.ds, cf, fe.fe) ) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDSSetDiscretization(__pyx_v_self->ds, __pyx_v_cf, ((PetscObject)__pyx_v_fe->fe))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(46, 98, __pyx_L1_error) /* "PETSc/DS.pyx":95 * return array_i(nf, cmps) * * def setDiscretisation(self, f, disc): # <<<<<<<<<<<<<< * cdef PetscInt cf = asInt(f) * cdef FE fe = disc */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DS.setDiscretisation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_fe); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":25 * # * * def create(self, dim=None, dof=None, # <<<<<<<<<<<<<< * sizes=None, proc_sizes=None, boundary_type=None, * stencil_type=None, stencil_width=None, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_create[] = "DMDA.create(self, dim=None, dof=None, sizes=None, proc_sizes=None, boundary_type=None, stencil_type=None, stencil_width=None, bool setup=True, ownership_ranges=None, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_dof = 0; PyObject *__pyx_v_sizes = 0; PyObject *__pyx_v_proc_sizes = 0; PyObject *__pyx_v_boundary_type = 0; PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; int __pyx_v_setup; PyObject *__pyx_v_ownership_ranges = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_dof,&__pyx_n_s_sizes,&__pyx_n_s_proc_sizes,&__pyx_n_s_boundary_type,&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,&__pyx_n_s_setup,&__pyx_n_s_ownership_ranges,&__pyx_n_s_comm,0}; PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); /* "PETSc/DMDA.pyx":26 * * def create(self, dim=None, dof=None, * sizes=None, proc_sizes=None, boundary_type=None, # <<<<<<<<<<<<<< * stencil_type=None, stencil_width=None, * bint setup=True, ownership_ranges=None, comm=None): */ values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); /* "PETSc/DMDA.pyx":27 * def create(self, dim=None, dof=None, * sizes=None, proc_sizes=None, boundary_type=None, * stencil_type=None, stencil_width=None, # <<<<<<<<<<<<<< * bint setup=True, ownership_ranges=None, comm=None): * # */ values[5] = ((PyObject *)Py_None); values[6] = ((PyObject *)Py_None); /* "PETSc/DMDA.pyx":28 * sizes=None, proc_sizes=None, boundary_type=None, * stencil_type=None, stencil_width=None, * bint setup=True, ownership_ranges=None, comm=None): # <<<<<<<<<<<<<< * # * cdef object arg = None */ values[8] = ((PyObject *)Py_None); values[9] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dof); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sizes); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_proc_sizes); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boundary_type); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_type); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_width); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_setup); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ownership_ranges); if (value) { values[8] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[9] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(47, 25, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_dof = values[1]; __pyx_v_sizes = values[2]; __pyx_v_proc_sizes = values[3]; __pyx_v_boundary_type = values[4]; __pyx_v_stencil_type = values[5]; __pyx_v_stencil_width = values[6]; if (values[7]) { __pyx_v_setup = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_setup == (int)-1) && PyErr_Occurred())) __PYX_ERR(47, 28, __pyx_L3_error) } else { __pyx_v_setup = ((int)1); } __pyx_v_ownership_ranges = values[8]; __pyx_v_comm = values[9]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 25, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_create(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dim, __pyx_v_dof, __pyx_v_sizes, __pyx_v_proc_sizes, __pyx_v_boundary_type, __pyx_v_stencil_type, __pyx_v_stencil_width, __pyx_v_setup, __pyx_v_ownership_ranges, __pyx_v_comm); /* "PETSc/DMDA.pyx":25 * # * * def create(self, dim=None, dof=None, # <<<<<<<<<<<<<< * sizes=None, proc_sizes=None, boundary_type=None, * stencil_type=None, stencil_width=None, */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_create(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dof, PyObject *__pyx_v_sizes, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, int __pyx_v_setup, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm) { PyObject *__pyx_v_arg = 0; PetscInt __pyx_v_ndim; PetscInt __pyx_v_ndof; PetscInt __pyx_v_M; PetscInt __pyx_v_m; PetscInt *__pyx_v_lx; PetscInt __pyx_v_N; PetscInt __pyx_v_n; PetscInt *__pyx_v_ly; PetscInt __pyx_v_P; PetscInt __pyx_v_p; PetscInt *__pyx_v_lz; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PyObject *__pyx_v_gsizes = 0; PyObject *__pyx_v_psizes = 0; PetscInt __pyx_v_gdim; PetscInt __pyx_v_pdim; MPI_Comm __pyx_v_ccomm; DM __pyx_v_newda; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; PetscInt __pyx_t_9; DMDAStencilType __pyx_t_10; MPI_Comm __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_dim); __Pyx_INCREF(__pyx_v_sizes); __Pyx_INCREF(__pyx_v_ownership_ranges); /* "PETSc/DMDA.pyx":30 * bint setup=True, ownership_ranges=None, comm=None): * # * cdef object arg = None # <<<<<<<<<<<<<< * try: arg = tuple(dim) * except TypeError: pass */ __Pyx_INCREF(Py_None); __pyx_v_arg = Py_None; /* "PETSc/DMDA.pyx":31 * # * cdef object arg = None * try: arg = tuple(dim) # <<<<<<<<<<<<<< * except TypeError: pass * else: dim, sizes = None, arg */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 31, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_4); __pyx_t_4 = 0; } /* "PETSc/DMDA.pyx":33 * try: arg = tuple(dim) * except TypeError: pass * else: dim, sizes = None, arg # <<<<<<<<<<<<<< * # * cdef PetscInt ndim = PETSC_DECIDE */ /*else:*/ { __pyx_t_4 = Py_None; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_dim, __pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_sizes, __pyx_t_5); __pyx_t_5 = 0; } __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMDA.pyx":32 * cdef object arg = None * try: arg = tuple(dim) * except TypeError: pass # <<<<<<<<<<<<<< * else: dim, sizes = None, arg * # */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_6) { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "PETSc/DMDA.pyx":31 * # * cdef object arg = None * try: arg = tuple(dim) # <<<<<<<<<<<<<< * except TypeError: pass * else: dim, sizes = None, arg */ __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); goto __pyx_L1_error; __pyx_L4_exception_handled:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); __pyx_L8_try_end:; } /* "PETSc/DMDA.pyx":35 * else: dim, sizes = None, arg * # * cdef PetscInt ndim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt ndof = PETSC_DECIDE * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL */ __pyx_v_ndim = PETSC_DECIDE; /* "PETSc/DMDA.pyx":36 * # * cdef PetscInt ndim = PETSC_DECIDE * cdef PetscInt ndof = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL */ __pyx_v_ndof = PETSC_DECIDE; /* "PETSc/DMDA.pyx":37 * cdef PetscInt ndim = PETSC_DECIDE * cdef PetscInt ndof = PETSC_DECIDE * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL # <<<<<<<<<<<<<< * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL */ __pyx_v_M = 1; __pyx_v_m = PETSC_DECIDE; __pyx_v_lx = NULL; /* "PETSc/DMDA.pyx":38 * cdef PetscInt ndof = PETSC_DECIDE * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL # <<<<<<<<<<<<<< * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ __pyx_v_N = 1; __pyx_v_n = PETSC_DECIDE; __pyx_v_ly = NULL; /* "PETSc/DMDA.pyx":39 * cdef PetscInt M = 1, m = PETSC_DECIDE, *lx = NULL * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_P = 1; __pyx_v_p = PETSC_DECIDE; __pyx_v_lz = NULL; /* "PETSc/DMDA.pyx":40 * cdef PetscInt N = 1, n = PETSC_DECIDE, *ly = NULL * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":41 * cdef PetscInt P = 1, p = PETSC_DECIDE, *lz = NULL * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":42 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":43 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * cdef PetscInt swidth = PETSC_DECIDE * # grid and proc sizes */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "PETSc/DMDA.pyx":44 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE # <<<<<<<<<<<<<< * # grid and proc sizes * cdef object gsizes = sizes */ __pyx_v_swidth = PETSC_DECIDE; /* "PETSc/DMDA.pyx":46 * cdef PetscInt swidth = PETSC_DECIDE * # grid and proc sizes * cdef object gsizes = sizes # <<<<<<<<<<<<<< * cdef object psizes = proc_sizes * cdef PetscInt gdim = PETSC_DECIDE */ __Pyx_INCREF(__pyx_v_sizes); __pyx_v_gsizes = __pyx_v_sizes; /* "PETSc/DMDA.pyx":47 * # grid and proc sizes * cdef object gsizes = sizes * cdef object psizes = proc_sizes # <<<<<<<<<<<<<< * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE */ __Pyx_INCREF(__pyx_v_proc_sizes); __pyx_v_psizes = __pyx_v_proc_sizes; /* "PETSc/DMDA.pyx":48 * cdef object gsizes = sizes * cdef object psizes = proc_sizes * cdef PetscInt gdim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: */ __pyx_v_gdim = PETSC_DECIDE; /* "PETSc/DMDA.pyx":49 * cdef object psizes = proc_sizes * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE # <<<<<<<<<<<<<< * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) */ __pyx_v_pdim = PETSC_DECIDE; /* "PETSc/DMDA.pyx":50 * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: # <<<<<<<<<<<<<< * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: */ __pyx_t_7 = (__pyx_v_sizes != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "PETSc/DMDA.pyx":51 * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 51, __pyx_L1_error) __pyx_v_gdim = __pyx_t_9; /* "PETSc/DMDA.pyx":50 * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt pdim = PETSC_DECIDE * if sizes is not None: # <<<<<<<<<<<<<< * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: */ } /* "PETSc/DMDA.pyx":52 * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: # <<<<<<<<<<<<<< * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: */ __pyx_t_8 = (__pyx_v_psizes != Py_None); __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { /* "PETSc/DMDA.pyx":53 * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * if gdim>=0 and pdim>=0: * assert gdim == pdim */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 53, __pyx_L1_error) __pyx_v_pdim = __pyx_t_9; /* "PETSc/DMDA.pyx":52 * if sizes is not None: * gdim = asDims(gsizes, &M, &N, &P) * if psizes is not None: # <<<<<<<<<<<<<< * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: */ } /* "PETSc/DMDA.pyx":54 * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: # <<<<<<<<<<<<<< * assert gdim == pdim * # dim and dof */ __pyx_t_8 = ((__pyx_v_gdim >= 0) != 0); if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L12_bool_binop_done; } __pyx_t_8 = ((__pyx_v_pdim >= 0) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L12_bool_binop_done:; if (__pyx_t_7) { /* "PETSc/DMDA.pyx":55 * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: * assert gdim == pdim # <<<<<<<<<<<<<< * # dim and dof * if dim is not None: ndim = asInt(dim) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_gdim == __pyx_v_pdim) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(47, 55, __pyx_L1_error) } } #endif /* "PETSc/DMDA.pyx":54 * if psizes is not None: * pdim = asDims(psizes, &m, &n, &p) * if gdim>=0 and pdim>=0: # <<<<<<<<<<<<<< * assert gdim == pdim * # dim and dof */ } /* "PETSc/DMDA.pyx":57 * assert gdim == pdim * # dim and dof * if dim is not None: ndim = asInt(dim) # <<<<<<<<<<<<<< * if dof is not None: ndof = asInt(dof) * if ndim==PETSC_DECIDE: ndim = gdim */ __pyx_t_7 = (__pyx_v_dim != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 57, __pyx_L1_error) __pyx_v_ndim = __pyx_t_9; } /* "PETSc/DMDA.pyx":58 * # dim and dof * if dim is not None: ndim = asInt(dim) * if dof is not None: ndof = asInt(dof) # <<<<<<<<<<<<<< * if ndim==PETSC_DECIDE: ndim = gdim * if ndof==PETSC_DECIDE: ndof = 1 */ __pyx_t_8 = (__pyx_v_dof != Py_None); __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 58, __pyx_L1_error) __pyx_v_ndof = __pyx_t_9; } /* "PETSc/DMDA.pyx":59 * if dim is not None: ndim = asInt(dim) * if dof is not None: ndof = asInt(dof) * if ndim==PETSC_DECIDE: ndim = gdim # <<<<<<<<<<<<<< * if ndof==PETSC_DECIDE: ndof = 1 * # vertex distribution */ __pyx_t_7 = ((__pyx_v_ndim == PETSC_DECIDE) != 0); if (__pyx_t_7) { __pyx_v_ndim = __pyx_v_gdim; } /* "PETSc/DMDA.pyx":60 * if dof is not None: ndof = asInt(dof) * if ndim==PETSC_DECIDE: ndim = gdim * if ndof==PETSC_DECIDE: ndof = 1 # <<<<<<<<<<<<<< * # vertex distribution * if ownership_ranges is not None: */ __pyx_t_7 = ((__pyx_v_ndof == PETSC_DECIDE) != 0); if (__pyx_t_7) { __pyx_v_ndof = 1; } /* "PETSc/DMDA.pyx":62 * if ndof==PETSC_DECIDE: ndof = 1 * # vertex distribution * if ownership_ranges is not None: # <<<<<<<<<<<<<< * ownership_ranges = asOwnershipRanges(ownership_ranges, * ndim, &m, &n, &p, */ __pyx_t_7 = (__pyx_v_ownership_ranges != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "PETSc/DMDA.pyx":63 * # vertex distribution * if ownership_ranges is not None: * ownership_ranges = asOwnershipRanges(ownership_ranges, # <<<<<<<<<<<<<< * ndim, &m, &n, &p, * &lx, &ly, &lz) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asOwnershipRanges(__pyx_v_ownership_ranges, __pyx_v_ndim, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz)); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_ownership_ranges, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/DMDA.pyx":62 * if ndof==PETSC_DECIDE: ndof = 1 * # vertex distribution * if ownership_ranges is not None: # <<<<<<<<<<<<<< * ownership_ranges = asOwnershipRanges(ownership_ranges, * ndim, &m, &n, &p, */ } /* "PETSc/DMDA.pyx":67 * &lx, &ly, &lz) * # periodicity, stencil type & width * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ __pyx_t_8 = (__pyx_v_boundary_type != Py_None); __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { /* "PETSc/DMDA.pyx":68 * # periodicity, stencil type & width * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) # <<<<<<<<<<<<<< * if stencil_type is not None: * stype = asStencil(stencil_type) */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_type, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_9 == ((PetscInt)-1L))) __PYX_ERR(47, 68, __pyx_L1_error) /* "PETSc/DMDA.pyx":67 * &lx, &ly, &lz) * # periodicity, stencil type & width * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ } /* "PETSc/DMDA.pyx":69 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ __pyx_t_7 = (__pyx_v_stencil_type != Py_None); __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "PETSc/DMDA.pyx":70 * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: * stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * if stencil_width is not None: * swidth = asInt(stencil_width) */ __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_10 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(47, 70, __pyx_L1_error) __pyx_v_stype = __pyx_t_10; /* "PETSc/DMDA.pyx":69 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ } /* "PETSc/DMDA.pyx":71 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * if setup and swidth == PETSC_DECIDE: swidth = 0 */ __pyx_t_8 = (__pyx_v_stencil_width != Py_None); __pyx_t_7 = (__pyx_t_8 != 0); if (__pyx_t_7) { /* "PETSc/DMDA.pyx":72 * stype = asStencil(stencil_type) * if stencil_width is not None: * swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * if setup and swidth == PETSC_DECIDE: swidth = 0 * # create the DMDA object */ __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_9 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 72, __pyx_L1_error) __pyx_v_swidth = __pyx_t_9; /* "PETSc/DMDA.pyx":71 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * if setup and swidth == PETSC_DECIDE: swidth = 0 */ } /* "PETSc/DMDA.pyx":73 * if stencil_width is not None: * swidth = asInt(stencil_width) * if setup and swidth == PETSC_DECIDE: swidth = 0 # <<<<<<<<<<<<<< * # create the DMDA object * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_8 = (__pyx_v_setup != 0); if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L23_bool_binop_done; } __pyx_t_8 = ((__pyx_v_swidth == PETSC_DECIDE) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L23_bool_binop_done:; if (__pyx_t_7) { __pyx_v_swidth = 0; } /* "PETSc/DMDA.pyx":75 * if setup and swidth == PETSC_DECIDE: swidth = 0 * # create the DMDA object * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newda = NULL * CHKERR( DMDACreateND(ccomm, ndim, ndof, */ __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(47, 75, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_11; /* "PETSc/DMDA.pyx":76 * # create the DMDA object * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newda = NULL # <<<<<<<<<<<<<< * CHKERR( DMDACreateND(ccomm, ndim, ndof, * M, N, P, m, n, p, lx, ly, lz, */ __pyx_v_newda = NULL; /* "PETSc/DMDA.pyx":77 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newda = NULL * CHKERR( DMDACreateND(ccomm, ndim, ndof, # <<<<<<<<<<<<<< * M, N, P, m, n, p, lx, ly, lz, * btx, bty, btz, stype, swidth, */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDACreateND(__pyx_v_ccomm, __pyx_v_ndim, __pyx_v_ndof, __pyx_v_M, __pyx_v_N, __pyx_v_P, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz, __pyx_v_stype, __pyx_v_swidth, (&__pyx_v_newda))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(47, 77, __pyx_L1_error) /* "PETSc/DMDA.pyx":81 * btx, bty, btz, stype, swidth, * &newda) ) * if setup and ndim > 0: CHKERR( DMSetUp(newda) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newda * return self */ __pyx_t_8 = (__pyx_v_setup != 0); if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L26_bool_binop_done; } __pyx_t_8 = ((__pyx_v_ndim > 0) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L26_bool_binop_done:; if (__pyx_t_7) { __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_newda)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(47, 81, __pyx_L1_error) } /* "PETSc/DMDA.pyx":82 * &newda) ) * if setup and ndim > 0: CHKERR( DMSetUp(newda) ) * PetscCLEAR(self.obj); self.dm = newda # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newda; /* "PETSc/DMDA.pyx":83 * if setup and ndim > 0: CHKERR( DMSetUp(newda) ) * PetscCLEAR(self.obj); self.dm = newda * return self # <<<<<<<<<<<<<< * * def duplicate(self, dof=None, boundary_type=None, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMDA.pyx":25 * # * * def create(self, dim=None, dof=None, # <<<<<<<<<<<<<< * sizes=None, proc_sizes=None, boundary_type=None, * stencil_type=None, stencil_width=None, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_arg); __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XDECREF(__pyx_v_dim); __Pyx_XDECREF(__pyx_v_sizes); __Pyx_XDECREF(__pyx_v_ownership_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":85 * return self * * def duplicate(self, dof=None, boundary_type=None, # <<<<<<<<<<<<<< * stencil_type=None, stencil_width=None): * cdef PetscInt ndim = 0, ndof = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_2duplicate[] = "DMDA.duplicate(self, dof=None, boundary_type=None, stencil_type=None, stencil_width=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dof = 0; PyObject *__pyx_v_boundary_type = 0; PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("duplicate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dof,&__pyx_n_s_boundary_type,&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,0}; PyObject* values[4] = {0,0,0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); /* "PETSc/DMDA.pyx":86 * * def duplicate(self, dof=None, boundary_type=None, * stencil_type=None, stencil_width=None): # <<<<<<<<<<<<<< * cdef PetscInt ndim = 0, ndof = 0 * cdef PetscInt M = 1, N = 1, P = 1 */ values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dof); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boundary_type); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_type); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_width); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "duplicate") < 0)) __PYX_ERR(47, 85, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dof = values[0]; __pyx_v_boundary_type = values[1]; __pyx_v_stencil_type = values[2]; __pyx_v_stencil_width = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 85, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_2duplicate(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dof, __pyx_v_boundary_type, __pyx_v_stencil_type, __pyx_v_stencil_width); /* "PETSc/DMDA.pyx":85 * return self * * def duplicate(self, dof=None, boundary_type=None, # <<<<<<<<<<<<<< * stencil_type=None, stencil_width=None): * cdef PetscInt ndim = 0, ndof = 0 */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_2duplicate(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof, PyObject *__pyx_v_boundary_type, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width) { PetscInt __pyx_v_ndim; PetscInt __pyx_v_ndof; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PetscInt const *__pyx_v_lx; PetscInt const *__pyx_v_ly; PetscInt const *__pyx_v_lz; MPI_Comm __pyx_v_comm; struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_da = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PetscInt __pyx_t_4; DMDAStencilType __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("duplicate", 0); /* "PETSc/DMDA.pyx":87 * def duplicate(self, dof=None, boundary_type=None, * stencil_type=None, stencil_width=None): * cdef PetscInt ndim = 0, ndof = 0 # <<<<<<<<<<<<<< * cdef PetscInt M = 1, N = 1, P = 1 * cdef PetscInt m = 1, n = 1, p = 1 */ __pyx_v_ndim = 0; __pyx_v_ndof = 0; /* "PETSc/DMDA.pyx":88 * stencil_type=None, stencil_width=None): * cdef PetscInt ndim = 0, ndof = 0 * cdef PetscInt M = 1, N = 1, P = 1 # <<<<<<<<<<<<<< * cdef PetscInt m = 1, n = 1, p = 1 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ __pyx_v_M = 1; __pyx_v_N = 1; __pyx_v_P = 1; /* "PETSc/DMDA.pyx":89 * cdef PetscInt ndim = 0, ndof = 0 * cdef PetscInt M = 1, N = 1, P = 1 * cdef PetscInt m = 1, n = 1, p = 1 # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_m = 1; __pyx_v_n = 1; __pyx_v_p = 1; /* "PETSc/DMDA.pyx":90 * cdef PetscInt M = 1, N = 1, P = 1 * cdef PetscInt m = 1, n = 1, p = 1 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":91 * cdef PetscInt m = 1, n = 1, p = 1 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":92 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":93 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * cdef PetscInt swidth = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "PETSc/DMDA.pyx":94 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &ndim, */ __pyx_v_swidth = PETSC_DECIDE; /* "PETSc/DMDA.pyx":95 * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &ndim, * &M, &N, &P, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ndim), (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_ndof), (&__pyx_v_swidth), (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz), (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 95, __pyx_L1_error) /* "PETSc/DMDA.pyx":102 * &btx, &bty, &btz, * &stype) ) * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * cdef MPI_Comm comm = MPI_COMM_NULL */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "PETSc/DMDA.pyx":103 * &stype) ) * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) # <<<<<<<<<<<<<< * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &comm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetOwnershipRanges(__pyx_v_self->__pyx_base.dm, (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 103, __pyx_L1_error) /* "PETSc/DMDA.pyx":104 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * cdef MPI_Comm comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(self.dm, &comm) ) * # */ __pyx_v_comm = MPI_COMM_NULL; /* "PETSc/DMDA.pyx":105 * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * cdef MPI_Comm comm = MPI_COMM_NULL * CHKERR( PetscObjectGetComm(self.dm, &comm) ) # <<<<<<<<<<<<<< * # * if dof is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->__pyx_base.dm), (&__pyx_v_comm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 105, __pyx_L1_error) /* "PETSc/DMDA.pyx":107 * CHKERR( PetscObjectGetComm(self.dm, &comm) ) * # * if dof is not None: # <<<<<<<<<<<<<< * ndof = asInt(dof) * if boundary_type is not None: */ __pyx_t_2 = (__pyx_v_dof != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/DMDA.pyx":108 * # * if dof is not None: * ndof = asInt(dof) # <<<<<<<<<<<<<< * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 108, __pyx_L1_error) __pyx_v_ndof = __pyx_t_4; /* "PETSc/DMDA.pyx":107 * CHKERR( PetscObjectGetComm(self.dm, &comm) ) * # * if dof is not None: # <<<<<<<<<<<<<< * ndof = asInt(dof) * if boundary_type is not None: */ } /* "PETSc/DMDA.pyx":109 * if dof is not None: * ndof = asInt(dof) * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ __pyx_t_3 = (__pyx_v_boundary_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/DMDA.pyx":110 * ndof = asInt(dof) * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) # <<<<<<<<<<<<<< * if stencil_type is not None: * stype = asStencil(stencil_type) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_type, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_4 == ((PetscInt)-1L))) __PYX_ERR(47, 110, __pyx_L1_error) /* "PETSc/DMDA.pyx":109 * if dof is not None: * ndof = asInt(dof) * if boundary_type is not None: # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: */ } /* "PETSc/DMDA.pyx":111 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ __pyx_t_2 = (__pyx_v_stencil_type != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/DMDA.pyx":112 * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: * stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * if stencil_width is not None: * swidth = asInt(stencil_width) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_5 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(47, 112, __pyx_L1_error) __pyx_v_stype = __pyx_t_5; /* "PETSc/DMDA.pyx":111 * if boundary_type is not None: * asBoundary(boundary_type, &btx, &bty, &btz) * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStencil(stencil_type) * if stencil_width is not None: */ } /* "PETSc/DMDA.pyx":113 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * # */ __pyx_t_3 = (__pyx_v_stencil_width != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/DMDA.pyx":114 * stype = asStencil(stencil_type) * if stencil_width is not None: * swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * # * cdef DMDA da = DMDA() */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 114, __pyx_L1_error) __pyx_v_swidth = __pyx_t_4; /* "PETSc/DMDA.pyx":113 * if stencil_type is not None: * stype = asStencil(stencil_type) * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * # */ } /* "PETSc/DMDA.pyx":116 * swidth = asInt(stencil_width) * # * cdef DMDA da = DMDA() # <<<<<<<<<<<<<< * CHKERR( DMDACreateND(comm, ndim, ndof, * M, N, P, m, n, p, lx, ly, lz, */ __pyx_t_6 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA)); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_da = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/DMDA.pyx":117 * # * cdef DMDA da = DMDA() * CHKERR( DMDACreateND(comm, ndim, ndof, # <<<<<<<<<<<<<< * M, N, P, m, n, p, lx, ly, lz, * btx, bty, btz, stype, swidth, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDACreateND(__pyx_v_comm, __pyx_v_ndim, __pyx_v_ndof, __pyx_v_M, __pyx_v_N, __pyx_v_P, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz, __pyx_v_stype, __pyx_v_swidth, (&__pyx_v_da->__pyx_base.dm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 117, __pyx_L1_error) /* "PETSc/DMDA.pyx":121 * btx, bty, btz, stype, swidth, * &da.dm) ) * CHKERR( DMSetUp(da.dm) ) # <<<<<<<<<<<<<< * return da * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_da->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 121, __pyx_L1_error) /* "PETSc/DMDA.pyx":122 * &da.dm) ) * CHKERR( DMSetUp(da.dm) ) * return da # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_da)); __pyx_r = ((PyObject *)__pyx_v_da); goto __pyx_L0; /* "PETSc/DMDA.pyx":85 * return self * * def duplicate(self, dof=None, boundary_type=None, # <<<<<<<<<<<<<< * stencil_type=None, stencil_width=None): * cdef PetscInt ndim = 0, ndof = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_da); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":126 * # * * def setDim(self, dim): # <<<<<<<<<<<<<< * return self.setDimension(dim) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_4setDim[] = "DMDA.setDim(self, dim)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dim = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDim (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDim") < 0)) __PYX_ERR(47, 126, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dim = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDim", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 126, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_4setDim(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dim); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_4setDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dim) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDim", 0); /* "PETSc/DMDA.pyx":127 * * def setDim(self, dim): * return self.setDimension(dim) # <<<<<<<<<<<<<< * * def getDim(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setDimension); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dim) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dim); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":126 * # * * def setDim(self, dim): # <<<<<<<<<<<<<< * return self.setDimension(dim) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":129 * return self.setDimension(dim) * * def getDim(self): # <<<<<<<<<<<<<< * return self.getDimension() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_6getDim[] = "DMDA.getDim(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDim (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDim", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDim", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_6getDim(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6getDim(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDim", 0); /* "PETSc/DMDA.pyx":130 * * def getDim(self): * return self.getDimension() # <<<<<<<<<<<<<< * * def setDof(self, dof): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDimension); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":129 * return self.setDimension(dim) * * def getDim(self): # <<<<<<<<<<<<<< * return self.getDimension() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":132 * return self.getDimension() * * def setDof(self, dof): # <<<<<<<<<<<<<< * cdef PetscInt ndof = asInt(dof) * CHKERR( DMDASetDof(self.dm, ndof) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_8setDof[] = "DMDA.setDof(self, dof)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dof = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dof,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dof)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDof") < 0)) __PYX_ERR(47, 132, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dof = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 132, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_8setDof(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_dof); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_dof) { PetscInt __pyx_v_ndof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDof", 0); /* "PETSc/DMDA.pyx":133 * * def setDof(self, dof): * cdef PetscInt ndof = asInt(dof) # <<<<<<<<<<<<<< * CHKERR( DMDASetDof(self.dm, ndof) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dof); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 133, __pyx_L1_error) __pyx_v_ndof = __pyx_t_1; /* "PETSc/DMDA.pyx":134 * def setDof(self, dof): * cdef PetscInt ndof = asInt(dof) * CHKERR( DMDASetDof(self.dm, ndof) ) # <<<<<<<<<<<<<< * * def getDof(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetDof(__pyx_v_self->__pyx_base.dm, __pyx_v_ndof)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 134, __pyx_L1_error) /* "PETSc/DMDA.pyx":132 * return self.getDimension() * * def setDof(self, dof): # <<<<<<<<<<<<<< * cdef PetscInt ndof = asInt(dof) * CHKERR( DMDASetDof(self.dm, ndof) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":136 * CHKERR( DMDASetDof(self.dm, ndof) ) * * def getDof(self): # <<<<<<<<<<<<<< * cdef PetscInt dof = 0 * CHKERR( DMDAGetInfo(self.dm, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_10getDof[] = "DMDA.getDof(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDof (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDof", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_10getDof(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10getDof(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dof; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDof", 0); /* "PETSc/DMDA.pyx":137 * * def getDof(self): * cdef PetscInt dof = 0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_dof = 0; /* "PETSc/DMDA.pyx":138 * def getDof(self): * cdef PetscInt dof = 0 * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_dof), NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 138, __pyx_L1_error) /* "PETSc/DMDA.pyx":145 * NULL, NULL, NULL, * NULL) ) * return toInt(dof) # <<<<<<<<<<<<<< * * def setSizes(self, sizes): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":136 * CHKERR( DMDASetDof(self.dm, ndof) ) * * def getDof(self): # <<<<<<<<<<<<<< * cdef PetscInt dof = 0 * CHKERR( DMDAGetInfo(self.dm, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":147 * return toInt(dof) * * def setSizes(self, sizes): # <<<<<<<<<<<<<< * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim = PETSC_DECIDE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_12setSizes[] = "DMDA.setSizes(self, sizes)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sizes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sizes,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSizes") < 0)) __PYX_ERR(47, 147, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sizes = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSizes", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 147, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_12setSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_sizes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12setSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_sizes) { PyObject *__pyx_v_gsizes = 0; PetscInt __pyx_v_gdim; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSizes", 0); /* "PETSc/DMDA.pyx":148 * * def setSizes(self, sizes): * cdef tuple gsizes = tuple(sizes) # <<<<<<<<<<<<<< * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt M = 1 */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gsizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMDA.pyx":149 * def setSizes(self, sizes): * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt M = 1 * cdef PetscInt N = 1 */ __pyx_v_gdim = PETSC_DECIDE; /* "PETSc/DMDA.pyx":150 * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt M = 1 # <<<<<<<<<<<<<< * cdef PetscInt N = 1 * cdef PetscInt P = 1 */ __pyx_v_M = 1; /* "PETSc/DMDA.pyx":151 * cdef PetscInt gdim = PETSC_DECIDE * cdef PetscInt M = 1 * cdef PetscInt N = 1 # <<<<<<<<<<<<<< * cdef PetscInt P = 1 * gdim = asDims(gsizes, &M, &N, &P) */ __pyx_v_N = 1; /* "PETSc/DMDA.pyx":152 * cdef PetscInt M = 1 * cdef PetscInt N = 1 * cdef PetscInt P = 1 # <<<<<<<<<<<<<< * gdim = asDims(gsizes, &M, &N, &P) * cdef PetscInt dim = PETSC_DECIDE */ __pyx_v_P = 1; /* "PETSc/DMDA.pyx":153 * cdef PetscInt N = 1 * cdef PetscInt P = 1 * gdim = asDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 153, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "PETSc/DMDA.pyx":154 * cdef PetscInt P = 1 * gdim = asDims(gsizes, &M, &N, &P) * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: */ __pyx_v_dim = PETSC_DECIDE; /* "PETSc/DMDA.pyx":155 * gdim = asDims(gsizes, &M, &N, &P) * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, gdim) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 155, __pyx_L1_error) /* "PETSc/DMDA.pyx":156 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, gdim) ) * CHKERR( DMDASetSizes(self.dm, M, N, P) ) */ __pyx_t_4 = ((__pyx_v_dim == PETSC_DECIDE) != 0); if (__pyx_t_4) { /* "PETSc/DMDA.pyx":157 * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, gdim) ) # <<<<<<<<<<<<<< * CHKERR( DMDASetSizes(self.dm, M, N, P) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetDimension(__pyx_v_self->__pyx_base.dm, __pyx_v_gdim)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 157, __pyx_L1_error) /* "PETSc/DMDA.pyx":156 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, gdim) ) * CHKERR( DMDASetSizes(self.dm, M, N, P) ) */ } /* "PETSc/DMDA.pyx":158 * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, gdim) ) * CHKERR( DMDASetSizes(self.dm, M, N, P) ) # <<<<<<<<<<<<<< * * def getSizes(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetSizes(__pyx_v_self->__pyx_base.dm, __pyx_v_M, __pyx_v_N, __pyx_v_P)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 158, __pyx_L1_error) /* "PETSc/DMDA.pyx":147 * return toInt(dof) * * def setSizes(self, sizes): # <<<<<<<<<<<<<< * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim = PETSC_DECIDE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":160 * CHKERR( DMDASetSizes(self.dm, M, N, P) ) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * cdef PetscInt M = PETSC_DECIDE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_14getSizes[] = "DMDA.getSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_14getSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_14getSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSizes", 0); /* "PETSc/DMDA.pyx":161 * * def getSizes(self): * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef PetscInt M = PETSC_DECIDE * cdef PetscInt N = PETSC_DECIDE */ __pyx_v_dim = 0; /* "PETSc/DMDA.pyx":162 * def getSizes(self): * cdef PetscInt dim = 0 * cdef PetscInt M = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt N = PETSC_DECIDE * cdef PetscInt P = PETSC_DECIDE */ __pyx_v_M = PETSC_DECIDE; /* "PETSc/DMDA.pyx":163 * cdef PetscInt dim = 0 * cdef PetscInt M = PETSC_DECIDE * cdef PetscInt N = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt P = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_N = PETSC_DECIDE; /* "PETSc/DMDA.pyx":164 * cdef PetscInt M = PETSC_DECIDE * cdef PetscInt N = PETSC_DECIDE * cdef PetscInt P = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_P = PETSC_DECIDE; /* "PETSc/DMDA.pyx":165 * cdef PetscInt N = PETSC_DECIDE * cdef PetscInt P = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * &M, &N, &P, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 165, __pyx_L1_error) /* "PETSc/DMDA.pyx":172 * NULL, NULL, NULL, * NULL) ) * return toDims(dim, M, N, P) # <<<<<<<<<<<<<< * * def setProcSizes(self, proc_sizes): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_M, __pyx_v_N, __pyx_v_P); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":160 * CHKERR( DMDASetSizes(self.dm, M, N, P) ) * * def getSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * cdef PetscInt M = PETSC_DECIDE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":174 * return toDims(dim, M, N, P) * * def setProcSizes(self, proc_sizes): # <<<<<<<<<<<<<< * cdef tuple psizes = tuple(proc_sizes) * cdef PetscInt pdim = PETSC_DECIDE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_16setProcSizes[] = "DMDA.setProcSizes(self, proc_sizes)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_proc_sizes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setProcSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_proc_sizes,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_proc_sizes)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setProcSizes") < 0)) __PYX_ERR(47, 174, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_proc_sizes = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setProcSizes", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 174, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_16setProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_proc_sizes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_16setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_proc_sizes) { PyObject *__pyx_v_psizes = 0; PetscInt __pyx_v_pdim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setProcSizes", 0); /* "PETSc/DMDA.pyx":175 * * def setProcSizes(self, proc_sizes): * cdef tuple psizes = tuple(proc_sizes) # <<<<<<<<<<<<<< * cdef PetscInt pdim = PETSC_DECIDE * cdef PetscInt m = PETSC_DECIDE */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_proc_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_psizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMDA.pyx":176 * def setProcSizes(self, proc_sizes): * cdef tuple psizes = tuple(proc_sizes) * cdef PetscInt pdim = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE */ __pyx_v_pdim = PETSC_DECIDE; /* "PETSc/DMDA.pyx":177 * cdef tuple psizes = tuple(proc_sizes) * cdef PetscInt pdim = PETSC_DECIDE * cdef PetscInt m = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE */ __pyx_v_m = PETSC_DECIDE; /* "PETSc/DMDA.pyx":178 * cdef PetscInt pdim = PETSC_DECIDE * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt p = PETSC_DECIDE * pdim = asDims(psizes, &m, &n, &p) */ __pyx_v_n = PETSC_DECIDE; /* "PETSc/DMDA.pyx":179 * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE # <<<<<<<<<<<<<< * pdim = asDims(psizes, &m, &n, &p) * cdef PetscInt dim = PETSC_DECIDE */ __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMDA.pyx":180 * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE * pdim = asDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 180, __pyx_L1_error) __pyx_v_pdim = __pyx_t_2; /* "PETSc/DMDA.pyx":181 * cdef PetscInt p = PETSC_DECIDE * pdim = asDims(psizes, &m, &n, &p) * cdef PetscInt dim = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: */ __pyx_v_dim = PETSC_DECIDE; /* "PETSc/DMDA.pyx":182 * pdim = asDims(psizes, &m, &n, &p) * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, pdim) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 182, __pyx_L1_error) /* "PETSc/DMDA.pyx":183 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, pdim) ) * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) */ __pyx_t_4 = ((__pyx_v_dim == PETSC_DECIDE) != 0); if (__pyx_t_4) { /* "PETSc/DMDA.pyx":184 * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, pdim) ) # <<<<<<<<<<<<<< * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetDimension(__pyx_v_self->__pyx_base.dm, __pyx_v_pdim)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 184, __pyx_L1_error) /* "PETSc/DMDA.pyx":183 * cdef PetscInt dim = PETSC_DECIDE * CHKERR( DMDAGetDim(self.dm, &dim) ) * if dim == PETSC_DECIDE: # <<<<<<<<<<<<<< * CHKERR( DMSetDimension(self.dm, pdim) ) * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) */ } /* "PETSc/DMDA.pyx":185 * if dim == PETSC_DECIDE: * CHKERR( DMSetDimension(self.dm, pdim) ) * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) # <<<<<<<<<<<<<< * * def getProcSizes(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetNumProcs(__pyx_v_self->__pyx_base.dm, __pyx_v_m, __pyx_v_n, __pyx_v_p)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 185, __pyx_L1_error) /* "PETSc/DMDA.pyx":174 * return toDims(dim, M, N, P) * * def setProcSizes(self, proc_sizes): # <<<<<<<<<<<<<< * cdef tuple psizes = tuple(proc_sizes) * cdef PetscInt pdim = PETSC_DECIDE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":187 * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) * * def getProcSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * cdef PetscInt m = PETSC_DECIDE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_18getProcSizes[] = "DMDA.getProcSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProcSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getProcSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getProcSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_18getProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_18getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProcSizes", 0); /* "PETSc/DMDA.pyx":188 * * def getProcSizes(self): * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE */ __pyx_v_dim = 0; /* "PETSc/DMDA.pyx":189 * def getProcSizes(self): * cdef PetscInt dim = 0 * cdef PetscInt m = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE */ __pyx_v_m = PETSC_DECIDE; /* "PETSc/DMDA.pyx":190 * cdef PetscInt dim = 0 * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt p = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_n = PETSC_DECIDE; /* "PETSc/DMDA.pyx":191 * cdef PetscInt m = PETSC_DECIDE * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMDA.pyx":192 * cdef PetscInt n = PETSC_DECIDE * cdef PetscInt p = PETSC_DECIDE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), NULL, NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 192, __pyx_L1_error) /* "PETSc/DMDA.pyx":199 * NULL, NULL, NULL, * NULL) ) * return toDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def setBoundaryType(self, boundary_type): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":187 * CHKERR( DMDASetNumProcs(self.dm, m, n, p) ) * * def getProcSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * cdef PetscInt m = PETSC_DECIDE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":201 * return toDims(dim, m, n, p) * * def setBoundaryType(self, boundary_type): # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_20setBoundaryType[] = "DMDA.setBoundaryType(self, boundary_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_boundary_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBoundaryType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boundary_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boundary_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBoundaryType") < 0)) __PYX_ERR(47, 201, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_boundary_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBoundaryType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 201, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_20setBoundaryType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_boundary_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_20setBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_boundary_type) { DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBoundaryType", 0); /* "PETSc/DMDA.pyx":202 * * def setBoundaryType(self, boundary_type): * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":203 * def setBoundaryType(self, boundary_type): * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_type, &btx, &bty, &btz) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":204 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * asBoundary(boundary_type, &btx, &bty, &btz) * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":205 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_type, &btx, &bty, &btz) # <<<<<<<<<<<<<< * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_type, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L))) __PYX_ERR(47, 205, __pyx_L1_error) /* "PETSc/DMDA.pyx":206 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_type, &btx, &bty, &btz) * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) # <<<<<<<<<<<<<< * * def getBoundaryType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetBoundaryType(__pyx_v_self->__pyx_base.dm, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 206, __pyx_L1_error) /* "PETSc/DMDA.pyx":201 * return toDims(dim, m, n, p) * * def setBoundaryType(self, boundary_type): # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":208 * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) * * def getBoundaryType(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_22getBoundaryType[] = "DMDA.getBoundaryType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBoundaryType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBoundaryType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBoundaryType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_22getBoundaryType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_22getBoundaryType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBoundaryType", 0); /* "PETSc/DMDA.pyx":209 * * def getBoundaryType(self): * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_dim = 0; /* "PETSc/DMDA.pyx":210 * def getBoundaryType(self): * cdef PetscInt dim = 0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":211 * cdef PetscInt dim = 0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":212 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "PETSc/DMDA.pyx":213 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz), NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 213, __pyx_L1_error) /* "PETSc/DMDA.pyx":220 * &btx, &bty, &btz, * NULL) ) * return toDims(dim, btx, bty, btz) # <<<<<<<<<<<<<< * * def setStencilType(self, stencil_type): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":208 * CHKERR( DMDASetBoundaryType(self.dm, btx, bty, btz) ) * * def getBoundaryType(self): # <<<<<<<<<<<<<< * cdef PetscInt dim = 0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":222 * return toDims(dim, btx, bty, btz) * * def setStencilType(self, stencil_type): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * CHKERR( DMDASetStencilType(self.dm, stype) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_24setStencilType[] = "DMDA.setStencilType(self, stencil_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stencil_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stencil_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStencilType") < 0)) __PYX_ERR(47, 222, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_stencil_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 222, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_24setStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_stencil_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_24setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type) { DMDAStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAStencilType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilType", 0); /* "PETSc/DMDA.pyx":223 * * def setStencilType(self, stencil_type): * cdef PetscDMDAStencilType stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilType(self.dm, stype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_1 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(47, 223, __pyx_L1_error) __pyx_v_stype = __pyx_t_1; /* "PETSc/DMDA.pyx":224 * def setStencilType(self, stencil_type): * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * CHKERR( DMDASetStencilType(self.dm, stype) ) # <<<<<<<<<<<<<< * * def getStencilType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilType(__pyx_v_self->__pyx_base.dm, __pyx_v_stype)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 224, __pyx_L1_error) /* "PETSc/DMDA.pyx":222 * return toDims(dim, btx, bty, btz) * * def setStencilType(self, stencil_type): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * CHKERR( DMDASetStencilType(self.dm, stype) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":226 * CHKERR( DMDASetStencilType(self.dm, stype) ) * * def getStencilType(self): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * CHKERR( DMDAGetInfo(self.dm, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_26getStencilType[] = "DMDA.getStencilType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_26getStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_26getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilType", 0); /* "PETSc/DMDA.pyx":227 * * def getStencilType(self): * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "PETSc/DMDA.pyx":228 * def getStencilType(self): * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 228, __pyx_L1_error) /* "PETSc/DMDA.pyx":235 * NULL, NULL, NULL, * &stype) ) * return stype # <<<<<<<<<<<<<< * * def setStencilWidth(self, stencil_width): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_DMDAStencilType(__pyx_v_stype); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":226 * CHKERR( DMDASetStencilType(self.dm, stype) ) * * def getStencilType(self): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * CHKERR( DMDAGetInfo(self.dm, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":237 * return stype * * def setStencilWidth(self, stencil_width): # <<<<<<<<<<<<<< * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_28setStencilWidth[] = "DMDA.setStencilWidth(self, stencil_width)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stencil_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilWidth (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stencil_width,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_width)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStencilWidth") < 0)) __PYX_ERR(47, 237, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_stencil_width = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilWidth", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 237, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_28setStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_stencil_width); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_28setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_width) { PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilWidth", 0); /* "PETSc/DMDA.pyx":238 * * def setStencilWidth(self, stencil_width): * cdef PetscInt swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 238, __pyx_L1_error) __pyx_v_swidth = __pyx_t_1; /* "PETSc/DMDA.pyx":239 * def setStencilWidth(self, stencil_width): * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) # <<<<<<<<<<<<<< * * def getStencilWidth(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilWidth(__pyx_v_self->__pyx_base.dm, __pyx_v_swidth)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 239, __pyx_L1_error) /* "PETSc/DMDA.pyx":237 * return stype * * def setStencilWidth(self, stencil_width): # <<<<<<<<<<<<<< * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":241 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencilWidth(self): # <<<<<<<<<<<<<< * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_30getStencilWidth[] = "DMDA.getStencilWidth(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilWidth (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilWidth", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilWidth", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_30getStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_30getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilWidth", 0); /* "PETSc/DMDA.pyx":242 * * def getStencilWidth(self): * cdef PetscInt swidth = 0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_swidth = 0; /* "PETSc/DMDA.pyx":243 * def getStencilWidth(self): * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_swidth), NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 243, __pyx_L1_error) /* "PETSc/DMDA.pyx":250 * NULL, NULL, NULL, * NULL) ) * return toInt(swidth) # <<<<<<<<<<<<<< * * def setStencil(self, stencil_type, stencil_width): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_swidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":241 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencilWidth(self): # <<<<<<<<<<<<<< * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":252 * return toInt(swidth) * * def setStencil(self, stencil_type, stencil_width): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * cdef PetscInt swidth = asInt(stencil_width) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_32setStencil[] = "DMDA.setStencil(self, stencil_type, stencil_width)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencil (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_width)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setStencil", 1, 2, 2, 1); __PYX_ERR(47, 252, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStencil") < 0)) __PYX_ERR(47, 252, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_stencil_type = values[0]; __pyx_v_stencil_width = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencil", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 252, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_32setStencil(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_stencil_type, __pyx_v_stencil_width); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_32setStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width) { DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAStencilType __pyx_t_1; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencil", 0); /* "PETSc/DMDA.pyx":253 * * def setStencil(self, stencil_type, stencil_width): * cdef PetscDMDAStencilType stype = asStencil(stencil_type) # <<<<<<<<<<<<<< * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilType(self.dm, stype) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_1 == ((DMDAStencilType)((DMDAStencilType)-1L)))) __PYX_ERR(47, 253, __pyx_L1_error) __pyx_v_stype = __pyx_t_1; /* "PETSc/DMDA.pyx":254 * def setStencil(self, stencil_type, stencil_width): * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * cdef PetscInt swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilType(self.dm, stype) ) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 254, __pyx_L1_error) __pyx_v_swidth = __pyx_t_2; /* "PETSc/DMDA.pyx":255 * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilType(self.dm, stype) ) # <<<<<<<<<<<<<< * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilType(__pyx_v_self->__pyx_base.dm, __pyx_v_stype)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 255, __pyx_L1_error) /* "PETSc/DMDA.pyx":256 * cdef PetscInt swidth = asInt(stencil_width) * CHKERR( DMDASetStencilType(self.dm, stype) ) * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) # <<<<<<<<<<<<<< * * def getStencil(self): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetStencilWidth(__pyx_v_self->__pyx_base.dm, __pyx_v_swidth)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 256, __pyx_L1_error) /* "PETSc/DMDA.pyx":252 * return toInt(swidth) * * def setStencil(self, stencil_type, stencil_width): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = asStencil(stencil_type) * cdef PetscInt swidth = asInt(stencil_width) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":258 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencil(self): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_34getStencil[] = "DMDA.getStencil(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencil (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStencil", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencil", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_34getStencil(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_34getStencil(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAStencilType __pyx_v_stype; PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencil", 0); /* "PETSc/DMDA.pyx":259 * * def getStencil(self): * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_stype = DMDA_STENCIL_BOX; /* "PETSc/DMDA.pyx":260 * def getStencil(self): * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = 0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * NULL, */ __pyx_v_swidth = 0; /* "PETSc/DMDA.pyx":261 * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = 0 * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * NULL, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (&__pyx_v_swidth), NULL, NULL, NULL, (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 261, __pyx_L1_error) /* "PETSc/DMDA.pyx":268 * NULL, NULL, NULL, * &stype) ) * return (toStencil(stype), toInt(swidth)) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStencil(__pyx_v_stype); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_swidth); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":258 * CHKERR( DMDASetStencilWidth(self.dm, swidth) ) * * def getStencil(self): # <<<<<<<<<<<<<< * cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX * cdef PetscInt swidth = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getStencil", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":272 * # * * def getRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_36getRanges[] = "DMDA.getRanges(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRanges (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_36getRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_36getRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRanges", 0); /* "PETSc/DMDA.pyx":273 * * def getRanges(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "PETSc/DMDA.pyx":274 * def getRanges(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 274, __pyx_L1_error) /* "PETSc/DMDA.pyx":275 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 275, __pyx_L1_error) /* "PETSc/DMDA.pyx":278 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_x + __pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "PETSc/DMDA.pyx":279 * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), # <<<<<<<<<<<<<< * (toInt(z), toInt(z+p)))[:dim] * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_y + __pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; /* "PETSc/DMDA.pyx":280 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getGhostRanges(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_z + __pyx_v_p)); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "PETSc/DMDA.pyx":278 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; /* "PETSc/DMDA.pyx":280 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getGhostRanges(self): */ __pyx_t_6 = __Pyx_PyTuple_GetSlice(__pyx_t_3, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":272 * # * * def getRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":282 * (toInt(z), toInt(z+p)))[:dim] * * def getGhostRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_38getGhostRanges[] = "DMDA.getGhostRanges(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGhostRanges (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGhostRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGhostRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_38getGhostRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_38getGhostRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGhostRanges", 0); /* "PETSc/DMDA.pyx":283 * * def getGhostRanges(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "PETSc/DMDA.pyx":284 * def getGhostRanges(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetGhostCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 284, __pyx_L1_error) /* "PETSc/DMDA.pyx":285 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetGhostCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 285, __pyx_L1_error) /* "PETSc/DMDA.pyx":288 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_x + __pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "PETSc/DMDA.pyx":289 * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), # <<<<<<<<<<<<<< * (toInt(z), toInt(z+p)))[:dim] * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_y + __pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_3 = 0; __pyx_t_2 = 0; /* "PETSc/DMDA.pyx":290 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getOwnershipRanges(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_z + __pyx_v_p)); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; /* "PETSc/DMDA.pyx":288 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(x+m)), # <<<<<<<<<<<<<< * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; /* "PETSc/DMDA.pyx":290 * return ((toInt(x), toInt(x+m)), * (toInt(y), toInt(y+n)), * (toInt(z), toInt(z+p)))[:dim] # <<<<<<<<<<<<<< * * def getOwnershipRanges(self): */ __pyx_t_6 = __Pyx_PyTuple_GetSlice(__pyx_t_3, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":282 * (toInt(z), toInt(z+p)))[:dim] * * def getGhostRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getGhostRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":292 * (toInt(z), toInt(z+p)))[:dim] * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges[] = "DMDA.getOwnershipRanges(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt const *__pyx_v_lx; PetscInt const *__pyx_v_ly; PetscInt const *__pyx_v_lz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 0); /* "PETSc/DMDA.pyx":293 * * def getOwnershipRanges(self): * cdef PetscInt dim=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetInfo(self.dm, */ __pyx_v_dim = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "PETSc/DMDA.pyx":294 * def getOwnershipRanges(self): * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetInfo(self.dm, * &dim, */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "PETSc/DMDA.pyx":295 * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMDAGetInfo(self.dm, # <<<<<<<<<<<<<< * &dim, * NULL, NULL, NULL, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInfo(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim), NULL, NULL, NULL, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), NULL, NULL, NULL, NULL, NULL, NULL)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 295, __pyx_L1_error) /* "PETSc/DMDA.pyx":302 * NULL, NULL, NULL, * NULL) ) * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) # <<<<<<<<<<<<<< * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetOwnershipRanges(__pyx_v_self->__pyx_base.dm, (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 302, __pyx_L1_error) /* "PETSc/DMDA.pyx":303 * NULL) ) * CHKERR( DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) # <<<<<<<<<<<<<< * * def getCorners(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toOwnershipRanges(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":292 * (toInt(z), toInt(z+p)))[:dim] * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":305 * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_42getCorners[] = "DMDA.getCorners(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCorners (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCorners", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_42getCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_42getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCorners", 0); /* "PETSc/DMDA.pyx":306 * * def getCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "PETSc/DMDA.pyx":307 * def getCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 307, __pyx_L1_error) /* "PETSc/DMDA.pyx":308 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 308, __pyx_L1_error) /* "PETSc/DMDA.pyx":311 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_t_5, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/DMDA.pyx":312 * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], * (toInt(m), toInt(n), toInt(p))[:dim]) # <<<<<<<<<<<<<< * * def getGhostCorners(self): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/DMDA.pyx":311 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":305 * return toOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":314 * (toInt(m), toInt(n), toInt(p))[:dim]) * * def getGhostCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_44getGhostCorners[] = "DMDA.getGhostCorners(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGhostCorners (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGhostCorners", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGhostCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_44getGhostCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_44getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGhostCorners", 0); /* "PETSc/DMDA.pyx":315 * * def getGhostCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "PETSc/DMDA.pyx":316 * def getGhostCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetGhostCorners(self.dm, * &x, &y, &z, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 316, __pyx_L1_error) /* "PETSc/DMDA.pyx":317 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetGhostCorners(self.dm, # <<<<<<<<<<<<<< * &x, &y, &z, * &m, &n, &p) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetGhostCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 317, __pyx_L1_error) /* "PETSc/DMDA.pyx":320 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_t_5, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "PETSc/DMDA.pyx":321 * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], * (toInt(m), toInt(n), toInt(p))[:dim]) # <<<<<<<<<<<<<< * * # */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyTuple_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/DMDA.pyx":320 * &x, &y, &z, * &m, &n, &p) ) * return ((toInt(x), toInt(y), toInt(z))[:dim], # <<<<<<<<<<<<<< * (toInt(m), toInt(n), toInt(p))[:dim]) * */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":314 * (toInt(m), toInt(n), toInt(p))[:dim]) * * def getGhostCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getGhostCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":325 * # * * def setFieldName(self, field, name): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_46setFieldName[] = "DMDA.setFieldName(self, field, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFieldName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,&__pyx_n_s_name,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, 1); __PYX_ERR(47, 325, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setFieldName") < 0)) __PYX_ERR(47, 325, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_field = values[0]; __pyx_v_name = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 325, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_46setFieldName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_field, __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_46setFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_name) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFieldName", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DMDA.pyx":326 * * def setFieldName(self, field, name): * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 326, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/DMDA.pyx":327 * def setFieldName(self, field, name): * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DMDA.pyx":328 * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMDA.pyx":329 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) # <<<<<<<<<<<<<< * * def getFieldName(self, field): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetFieldName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_cval)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 329, __pyx_L1_error) /* "PETSc/DMDA.pyx":325 * # * * def setFieldName(self, field, name): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":331 * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) * * def getFieldName(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_48getFieldName[] = "DMDA.getFieldName(self, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getFieldName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getFieldName") < 0)) __PYX_ERR(47, 331, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_field = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 331, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_48getFieldName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_48getFieldName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_field) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getFieldName", 0); /* "PETSc/DMDA.pyx":332 * * def getFieldName(self, field): * cdef PetscInt ival = asInt(field) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 332, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/DMDA.pyx":333 * def getFieldName(self, field): * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/DMDA.pyx":334 * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetFieldName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, (&__pyx_v_cval))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 334, __pyx_L1_error) /* "PETSc/DMDA.pyx":335 * cdef const char *cval = NULL * CHKERR( DMDAGetFieldName(self.dm, ival, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":331 * CHKERR( DMDASetFieldName(self.dm, ival, cval) ) * * def getFieldName(self, field): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(field) * cdef const char *cval = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getFieldName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":339 * # * * def getVecArray(self, Vec vec): # <<<<<<<<<<<<<< * return _DMDA_Vec_array(self, vec) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_50getVecArray[] = "DMDA.getVecArray(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getVecArray") < 0)) __PYX_ERR(47, 339, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVecArray", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 339, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(47, 339, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecArray", 0); /* "PETSc/DMDA.pyx":340 * * def getVecArray(self, Vec vec): * return _DMDA_Vec_array(self, vec) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_v_vec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_vec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_vec)); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":339 * # * * def getVecArray(self, Vec vec): # <<<<<<<<<<<<<< * return _DMDA_Vec_array(self, vec) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":344 * # * * def setUniformCoordinates(self, # <<<<<<<<<<<<<< * xmin=0, xmax=1, * ymin=0, ymax=1, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates[] = "DMDA.setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinates (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_1); values[2] = ((PyObject *)__pyx_int_0); values[3] = ((PyObject *)__pyx_int_1); values[4] = ((PyObject *)__pyx_int_0); values[5] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmin); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmax); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymin); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymax); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmin); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmax); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUniformCoordinates") < 0)) __PYX_ERR(47, 344, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinates", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 344, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinates", 0); /* "PETSc/DMDA.pyx":348 * ymin=0, ymax=1, * zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 348, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 348, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "PETSc/DMDA.pyx":349 * zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMDASetUniformCoordinates(self.dm, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 349, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 349, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "PETSc/DMDA.pyx":350 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMDASetUniformCoordinates(self.dm, * _xmin, _xmax, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 350, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(47, 350, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "PETSc/DMDA.pyx":351 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMDASetUniformCoordinates(self.dm, # <<<<<<<<<<<<<< * _xmin, _xmax, * _ymin, _ymax, */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetUniformCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 351, __pyx_L1_error) /* "PETSc/DMDA.pyx":344 * # * * def setUniformCoordinates(self, # <<<<<<<<<<<<<< * xmin=0, xmax=1, * ymin=0, ymax=1, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":356 * _zmin, _zmax) ) * * def setCoordinateName(self, index, name): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_54setCoordinateName[] = "DMDA.setCoordinateName(self, index, name)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinateName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_name,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setCoordinateName", 1, 2, 2, 1); __PYX_ERR(47, 356, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoordinateName") < 0)) __PYX_ERR(47, 356, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_index = values[0]; __pyx_v_name = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinateName", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 356, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_54setCoordinateName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_index, __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_54setCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_name) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinateName", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DMDA.pyx":357 * * def setCoordinateName(self, index, name): * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * name = str2bytes(name, &cval) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 357, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/DMDA.pyx":358 * def setCoordinateName(self, index, name): * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cval) * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DMDA.pyx":359 * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL * name = str2bytes(name, &cval) # <<<<<<<<<<<<<< * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMDA.pyx":360 * cdef const char *cval = NULL * name = str2bytes(name, &cval) * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) # <<<<<<<<<<<<<< * * def getCoordinateName(self, index): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetCoordinateName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_cval)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(47, 360, __pyx_L1_error) /* "PETSc/DMDA.pyx":356 * _zmin, _zmax) ) * * def setCoordinateName(self, index, name): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":362 * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) * * def getCoordinateName(self, index): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_56getCoordinateName[] = "DMDA.getCoordinateName(self, index)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCoordinateName (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCoordinateName") < 0)) __PYX_ERR(47, 362, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCoordinateName", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 362, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_56getCoordinateName(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_56getCoordinateName(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCoordinateName", 0); /* "PETSc/DMDA.pyx":363 * * def getCoordinateName(self, index): * cdef PetscInt ival = asInt(index) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 363, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/DMDA.pyx":364 * def getCoordinateName(self, index): * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/DMDA.pyx":365 * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetCoordinateName(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, (&__pyx_v_cval))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 365, __pyx_L1_error) /* "PETSc/DMDA.pyx":366 * cdef const char *cval = NULL * CHKERR( DMDAGetCoordinateName(self.dm, ival, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":362 * CHKERR( DMDASetCoordinateName(self.dm, ival, cval) ) * * def getCoordinateName(self, index): # <<<<<<<<<<<<<< * cdef PetscInt ival = asInt(index) * cdef const char *cval = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getCoordinateName", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":370 * # * * def createNaturalVec(self): # <<<<<<<<<<<<<< * cdef Vec vn = Vec() * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_58createNaturalVec[] = "DMDA.createNaturalVec(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createNaturalVec (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createNaturalVec", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createNaturalVec", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_58createNaturalVec(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_58createNaturalVec(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { struct PyPetscVecObject *__pyx_v_vn = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createNaturalVec", 0); /* "PETSc/DMDA.pyx":371 * * def createNaturalVec(self): * cdef Vec vn = Vec() # <<<<<<<<<<<<<< * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) * return vn */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vn = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMDA.pyx":372 * def createNaturalVec(self): * cdef Vec vn = Vec() * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) # <<<<<<<<<<<<<< * return vn * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDACreateNaturalVector(__pyx_v_self->__pyx_base.dm, (&__pyx_v_vn->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 372, __pyx_L1_error) /* "PETSc/DMDA.pyx":373 * cdef Vec vn = Vec() * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) * return vn # <<<<<<<<<<<<<< * * def globalToNatural(self, Vec vg, Vec vn, addv=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vn)); __pyx_r = ((PyObject *)__pyx_v_vn); goto __pyx_L0; /* "PETSc/DMDA.pyx":370 * # * * def createNaturalVec(self): # <<<<<<<<<<<<<< * cdef Vec vn = Vec() * CHKERR( DMDACreateNaturalVector(self.dm, &vn.vec) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.createNaturalVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vn); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":375 * return vn * * def globalToNatural(self, Vec vg, Vec vn, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_60globalToNatural[] = "DMDA.globalToNatural(self, Vec vg, Vec vn, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vg = 0; struct PyPetscVecObject *__pyx_v_vn = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("globalToNatural (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vg,&__pyx_n_s_vn,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vg)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vn)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("globalToNatural", 0, 2, 3, 1); __PYX_ERR(47, 375, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "globalToNatural") < 0)) __PYX_ERR(47, 375, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vg = ((struct PyPetscVecObject *)values[0]); __pyx_v_vn = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("globalToNatural", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 375, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.globalToNatural", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(47, 375, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vn), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vn", 0))) __PYX_ERR(47, 375, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_60globalToNatural(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_vg, __pyx_v_vn, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_60globalToNatural(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, struct PyPetscVecObject *__pyx_v_vn, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("globalToNatural", 0); /* "PETSc/DMDA.pyx":376 * * def globalToNatural(self, Vec vg, Vec vn, addv=None): * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(47, 376, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "PETSc/DMDA.pyx":377 * def globalToNatural(self, Vec vg, Vec vn, addv=None): * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGlobalToNaturalBegin(__pyx_v_self->__pyx_base.dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vn->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 377, __pyx_L1_error) /* "PETSc/DMDA.pyx":378 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) # <<<<<<<<<<<<<< * * def naturalToGlobal(self, Vec vn, Vec vg, addv=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGlobalToNaturalEnd(__pyx_v_self->__pyx_base.dm, __pyx_v_vg->vec, __pyx_v_im, __pyx_v_vn->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 378, __pyx_L1_error) /* "PETSc/DMDA.pyx":375 * return vn * * def globalToNatural(self, Vec vg, Vec vn, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDAGlobalToNaturalBegin(self.dm, vg.vec, im, vn.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.globalToNatural", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":380 * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) * * def naturalToGlobal(self, Vec vn, Vec vg, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_62naturalToGlobal[] = "DMDA.naturalToGlobal(self, Vec vn, Vec vg, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vn = 0; struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("naturalToGlobal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vn,&__pyx_n_s_vg,&__pyx_n_s_addv,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vn)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vg)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("naturalToGlobal", 0, 2, 3, 1); __PYX_ERR(47, 380, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "naturalToGlobal") < 0)) __PYX_ERR(47, 380, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_vn = ((struct PyPetscVecObject *)values[0]); __pyx_v_vg = ((struct PyPetscVecObject *)values[1]); __pyx_v_addv = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("naturalToGlobal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 380, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.naturalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vn), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vn", 0))) __PYX_ERR(47, 380, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(47, 380, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_62naturalToGlobal(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_vn, __pyx_v_vg, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_62naturalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vn, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_addv) { InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("naturalToGlobal", 0); /* "PETSc/DMDA.pyx":381 * * def naturalToGlobal(self, Vec vn, Vec vg, addv=None): * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) * CHKERR( DMDANaturalToGlobalEnd (self.dm, vn.vec, im, vg.vec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(47, 381, __pyx_L1_error) __pyx_v_im = __pyx_t_1; /* "PETSc/DMDA.pyx":382 * def naturalToGlobal(self, Vec vn, Vec vg, addv=None): * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMDANaturalToGlobalEnd (self.dm, vn.vec, im, vg.vec) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDANaturalToGlobalBegin(__pyx_v_self->__pyx_base.dm, __pyx_v_vn->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 382, __pyx_L1_error) /* "PETSc/DMDA.pyx":383 * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) * CHKERR( DMDANaturalToGlobalEnd (self.dm, vn.vec, im, vg.vec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDANaturalToGlobalEnd(__pyx_v_self->__pyx_base.dm, __pyx_v_vn->vec, __pyx_v_im, __pyx_v_vg->vec)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 383, __pyx_L1_error) /* "PETSc/DMDA.pyx":380 * CHKERR( DMDAGlobalToNaturalEnd (self.dm, vg.vec, im, vn.vec) ) * * def naturalToGlobal(self, Vec vn, Vec vg, addv=None): # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMDANaturalToGlobalBegin(self.dm, vn.vec, im, vg.vec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.naturalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":387 * # * * def getAO(self): # <<<<<<<<<<<<<< * cdef AO ao = AO() * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_64getAO[] = "DMDA.getAO(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAO (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAO", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAO", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_64getAO(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_64getAO(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { struct PyPetscAOObject *__pyx_v_ao = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAO", 0); /* "PETSc/DMDA.pyx":388 * * def getAO(self): * cdef AO ao = AO() # <<<<<<<<<<<<<< * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) * PetscINCREF(ao.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_AO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ao = ((struct PyPetscAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMDA.pyx":389 * def getAO(self): * cdef AO ao = AO() * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) # <<<<<<<<<<<<<< * PetscINCREF(ao.obj) * return ao */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetAO(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ao->ao))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 389, __pyx_L1_error) /* "PETSc/DMDA.pyx":390 * cdef AO ao = AO() * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) * PetscINCREF(ao.obj) # <<<<<<<<<<<<<< * return ao * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ao->__pyx_base.obj)); /* "PETSc/DMDA.pyx":391 * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) * PetscINCREF(ao.obj) * return ao # <<<<<<<<<<<<<< * * def getScatter(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ao)); __pyx_r = ((PyObject *)__pyx_v_ao); goto __pyx_L0; /* "PETSc/DMDA.pyx":387 * # * * def getAO(self): # <<<<<<<<<<<<<< * cdef AO ao = AO() * CHKERR( DMDAGetAO(self.dm, &ao.ao) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getAO", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ao); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":393 * return ao * * def getScatter(self): # <<<<<<<<<<<<<< * cdef Scatter l2g = Scatter() * cdef Scatter g2l = Scatter() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_66getScatter[] = "DMDA.getScatter(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getScatter (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getScatter", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getScatter", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_66getScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_66getScatter(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { struct PyPetscScatterObject *__pyx_v_l2g = 0; struct PyPetscScatterObject *__pyx_v_g2l = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getScatter", 0); /* "PETSc/DMDA.pyx":394 * * def getScatter(self): * cdef Scatter l2g = Scatter() # <<<<<<<<<<<<<< * cdef Scatter g2l = Scatter() * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_l2g = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMDA.pyx":395 * def getScatter(self): * cdef Scatter l2g = Scatter() * cdef Scatter g2l = Scatter() # <<<<<<<<<<<<<< * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) * PetscINCREF(l2g.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_g2l = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMDA.pyx":396 * cdef Scatter l2g = Scatter() * cdef Scatter g2l = Scatter() * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) # <<<<<<<<<<<<<< * PetscINCREF(l2g.obj) * PetscINCREF(g2l.obj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetScatter(__pyx_v_self->__pyx_base.dm, (&__pyx_v_l2g->sct), (&__pyx_v_g2l->sct))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 396, __pyx_L1_error) /* "PETSc/DMDA.pyx":397 * cdef Scatter g2l = Scatter() * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) * PetscINCREF(l2g.obj) # <<<<<<<<<<<<<< * PetscINCREF(g2l.obj) * return (l2g, g2l) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_l2g->__pyx_base.obj)); /* "PETSc/DMDA.pyx":398 * CHKERR( DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct) ) * PetscINCREF(l2g.obj) * PetscINCREF(g2l.obj) # <<<<<<<<<<<<<< * return (l2g, g2l) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_g2l->__pyx_base.obj)); /* "PETSc/DMDA.pyx":399 * PetscINCREF(l2g.obj) * PetscINCREF(g2l.obj) * return (l2g, g2l) # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_l2g)); __Pyx_GIVEREF(((PyObject *)__pyx_v_l2g)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_l2g)); __Pyx_INCREF(((PyObject *)__pyx_v_g2l)); __Pyx_GIVEREF(((PyObject *)__pyx_v_g2l)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_g2l)); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":393 * return ao * * def getScatter(self): # <<<<<<<<<<<<<< * cdef Scatter l2g = Scatter() * cdef Scatter g2l = Scatter() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_l2g); __Pyx_XDECREF((PyObject *)__pyx_v_g2l); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":403 * # * * def setRefinementFactor(self, # <<<<<<<<<<<<<< * refine_x=2, * refine_y=2, */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_68setRefinementFactor[] = "DMDA.setRefinementFactor(self, refine_x=2, refine_y=2, refine_z=2)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_refine_x = 0; PyObject *__pyx_v_refine_y = 0; PyObject *__pyx_v_refine_z = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefinementFactor (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refine_x,&__pyx_n_s_refine_y,&__pyx_n_s_refine_z,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)__pyx_int_2); values[1] = ((PyObject *)__pyx_int_2); values[2] = ((PyObject *)__pyx_int_2); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_refine_x); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_refine_y); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_refine_z); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRefinementFactor") < 0)) __PYX_ERR(47, 403, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_refine_x = values[0]; __pyx_v_refine_y = values[1]; __pyx_v_refine_z = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefinementFactor", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 403, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setRefinementFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_68setRefinementFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_refine_x, __pyx_v_refine_y, __pyx_v_refine_z); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_68setRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_refine_x, PyObject *__pyx_v_refine_y, PyObject *__pyx_v_refine_z) { PetscInt __pyx_v_refine[3]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefinementFactor", 0); /* "PETSc/DMDA.pyx":408 * refine_z=2): * cdef PetscInt refine[3] * refine[0] = asInt(refine_x) # <<<<<<<<<<<<<< * refine[1] = asInt(refine_y) * refine[2] = asInt(refine_z) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_refine_x); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 408, __pyx_L1_error) (__pyx_v_refine[0]) = __pyx_t_1; /* "PETSc/DMDA.pyx":409 * cdef PetscInt refine[3] * refine[0] = asInt(refine_x) * refine[1] = asInt(refine_y) # <<<<<<<<<<<<<< * refine[2] = asInt(refine_z) * CHKERR( DMDASetRefinementFactor(self.dm, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_refine_y); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 409, __pyx_L1_error) (__pyx_v_refine[1]) = __pyx_t_1; /* "PETSc/DMDA.pyx":410 * refine[0] = asInt(refine_x) * refine[1] = asInt(refine_y) * refine[2] = asInt(refine_z) # <<<<<<<<<<<<<< * CHKERR( DMDASetRefinementFactor(self.dm, * refine[0], */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_refine_z); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(47, 410, __pyx_L1_error) (__pyx_v_refine[2]) = __pyx_t_1; /* "PETSc/DMDA.pyx":411 * refine[1] = asInt(refine_y) * refine[2] = asInt(refine_z) * CHKERR( DMDASetRefinementFactor(self.dm, # <<<<<<<<<<<<<< * refine[0], * refine[1], */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetRefinementFactor(__pyx_v_self->__pyx_base.dm, (__pyx_v_refine[0]), (__pyx_v_refine[1]), (__pyx_v_refine[2]))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 411, __pyx_L1_error) /* "PETSc/DMDA.pyx":403 * # * * def setRefinementFactor(self, # <<<<<<<<<<<<<< * refine_x=2, * refine_y=2, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setRefinementFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":416 * refine[2]) ) * * def getRefinementFactor(self): # <<<<<<<<<<<<<< * cdef PetscInt i, dim = 0, refine[3] * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_70getRefinementFactor[] = "DMDA.getRefinementFactor(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefinementFactor (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRefinementFactor", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefinementFactor", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_70getRefinementFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_70getRefinementFactor(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_refine[3]; PetscInt __pyx_9genexpr15__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefinementFactor", 0); /* "PETSc/DMDA.pyx":417 * * def getRefinementFactor(self): * cdef PetscInt i, dim = 0, refine[3] # <<<<<<<<<<<<<< * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetRefinementFactor(self.dm, */ __pyx_v_dim = 0; /* "PETSc/DMDA.pyx":418 * def getRefinementFactor(self): * cdef PetscInt i, dim = 0, refine[3] * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMDAGetRefinementFactor(self.dm, * &refine[0], */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 418, __pyx_L1_error) /* "PETSc/DMDA.pyx":419 * cdef PetscInt i, dim = 0, refine[3] * CHKERR( DMDAGetDim(self.dm, &dim) ) * CHKERR( DMDAGetRefinementFactor(self.dm, # <<<<<<<<<<<<<< * &refine[0], * &refine[1], */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetRefinementFactor(__pyx_v_self->__pyx_base.dm, (&(__pyx_v_refine[0])), (&(__pyx_v_refine[1])), (&(__pyx_v_refine[2])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 419, __pyx_L1_error) /* "PETSc/DMDA.pyx":423 * &refine[1], * &refine[2]) ) * return tuple([toInt(refine[i]) for 0 <= i < dim]) # <<<<<<<<<<<<<< * * def setInterpolationType(self, interp_type): */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_dim; for (__pyx_9genexpr15__pyx_v_i = 0; __pyx_9genexpr15__pyx_v_i < __pyx_t_3; __pyx_9genexpr15__pyx_v_i++) { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_refine[__pyx_9genexpr15__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(47, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":416 * refine[2]) ) * * def getRefinementFactor(self): # <<<<<<<<<<<<<< * cdef PetscInt i, dim = 0, refine[3] * CHKERR( DMDAGetDim(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getRefinementFactor", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":425 * return tuple([toInt(refine[i]) for 0 <= i < dim]) * * def setInterpolationType(self, interp_type): # <<<<<<<<<<<<<< * cdef PetscDMDAInterpolationType ival = dainterpolationtype(interp_type) * CHKERR( DMDASetInterpolationType(self.dm, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_72setInterpolationType[] = "DMDA.setInterpolationType(self, interp_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_interp_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setInterpolationType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_interp_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interp_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setInterpolationType") < 0)) __PYX_ERR(47, 425, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_interp_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setInterpolationType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 425, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setInterpolationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_72setInterpolationType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_interp_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_72setInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_interp_type) { DMDAInterpolationType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAInterpolationType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInterpolationType", 0); /* "PETSc/DMDA.pyx":426 * * def setInterpolationType(self, interp_type): * cdef PetscDMDAInterpolationType ival = dainterpolationtype(interp_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetInterpolationType(self.dm, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_dainterpolationtype(__pyx_v_interp_type); if (unlikely(__pyx_t_1 == ((DMDAInterpolationType)((DMDAInterpolationType)-1L)))) __PYX_ERR(47, 426, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/DMDA.pyx":427 * def setInterpolationType(self, interp_type): * cdef PetscDMDAInterpolationType ival = dainterpolationtype(interp_type) * CHKERR( DMDASetInterpolationType(self.dm, ival) ) # <<<<<<<<<<<<<< * * def getInterpolationType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetInterpolationType(__pyx_v_self->__pyx_base.dm, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 427, __pyx_L1_error) /* "PETSc/DMDA.pyx":425 * return tuple([toInt(refine[i]) for 0 <= i < dim]) * * def setInterpolationType(self, interp_type): # <<<<<<<<<<<<<< * cdef PetscDMDAInterpolationType ival = dainterpolationtype(interp_type) * CHKERR( DMDASetInterpolationType(self.dm, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setInterpolationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":429 * CHKERR( DMDASetInterpolationType(self.dm, ival) ) * * def getInterpolationType(self): # <<<<<<<<<<<<<< * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_74getInterpolationType[] = "DMDA.getInterpolationType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getInterpolationType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getInterpolationType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getInterpolationType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_74getInterpolationType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_74getInterpolationType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAInterpolationType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getInterpolationType", 0); /* "PETSc/DMDA.pyx":430 * * def getInterpolationType(self): * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 # <<<<<<<<<<<<<< * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) * return ival */ __pyx_v_ival = DMDA_Q0; /* "PETSc/DMDA.pyx":431 * def getInterpolationType(self): * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) # <<<<<<<<<<<<<< * return ival * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetInterpolationType(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 431, __pyx_L1_error) /* "PETSc/DMDA.pyx":432 * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) * return ival # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ival)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":429 * CHKERR( DMDASetInterpolationType(self.dm, ival) ) * * def getInterpolationType(self): # <<<<<<<<<<<<<< * cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0 * CHKERR( DMDAGetInterpolationType(self.dm, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getInterpolationType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":436 * # * * def setElementType(self, elem_type): # <<<<<<<<<<<<<< * cdef PetscDMDAElementType ival = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_76setElementType[] = "DMDA.setElementType(self, elem_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_elem_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setElementType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elem_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elem_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setElementType") < 0)) __PYX_ERR(47, 436, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_elem_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setElementType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 436, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setElementType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_76setElementType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_elem_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_76setElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type) { DMDAElementType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMDAElementType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setElementType", 0); /* "PETSc/DMDA.pyx":437 * * def setElementType(self, elem_type): * cdef PetscDMDAElementType ival = daelementtype(elem_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetElementType(self.dm, ival) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_daelementtype(__pyx_v_elem_type); if (unlikely(__pyx_t_1 == ((DMDAElementType)((DMDAElementType)-1L)))) __PYX_ERR(47, 437, __pyx_L1_error) __pyx_v_ival = __pyx_t_1; /* "PETSc/DMDA.pyx":438 * def setElementType(self, elem_type): * cdef PetscDMDAElementType ival = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, ival) ) # <<<<<<<<<<<<<< * * def getElementType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetElementType(__pyx_v_self->__pyx_base.dm, __pyx_v_ival)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(47, 438, __pyx_L1_error) /* "PETSc/DMDA.pyx":436 * # * * def setElementType(self, elem_type): # <<<<<<<<<<<<<< * cdef PetscDMDAElementType ival = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, ival) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.setElementType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":440 * CHKERR( DMDASetElementType(self.dm, ival) ) * * def getElementType(self): # <<<<<<<<<<<<<< * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 * CHKERR( DMDAGetElementType(self.dm, &ival) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_78getElementType[] = "DMDA.getElementType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getElementType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getElementType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getElementType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_78getElementType(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_78getElementType(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { DMDAElementType __pyx_v_ival; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getElementType", 0); /* "PETSc/DMDA.pyx":441 * * def getElementType(self): * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 # <<<<<<<<<<<<<< * CHKERR( DMDAGetElementType(self.dm, &ival) ) * return ival */ __pyx_v_ival = DMDA_ELEMENT_Q1; /* "PETSc/DMDA.pyx":442 * def getElementType(self): * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 * CHKERR( DMDAGetElementType(self.dm, &ival) ) # <<<<<<<<<<<<<< * return ival * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetElementType(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ival))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 442, __pyx_L1_error) /* "PETSc/DMDA.pyx":443 * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 * CHKERR( DMDAGetElementType(self.dm, &ival) ) * return ival # <<<<<<<<<<<<<< * * def getElements(self, elem_type=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_ival)); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":440 * CHKERR( DMDASetElementType(self.dm, ival) ) * * def getElementType(self): # <<<<<<<<<<<<<< * cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1 * CHKERR( DMDAGetElementType(self.dm, &ival) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getElementType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":445 * return ival * * def getElements(self, elem_type=None): # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * cdef PetscDMDAElementType etype */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_81getElements(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_4DMDA_80getElements[] = "DMDA.getElements(self, elem_type=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_81getElements(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_elem_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getElements (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elem_type,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elem_type); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getElements") < 0)) __PYX_ERR(47, 445, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_elem_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getElements", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(47, 445, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getElements", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_80getElements(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_elem_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_80getElements(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self, PyObject *__pyx_v_elem_type) { PetscInt __pyx_v_dim; DMDAElementType __pyx_v_etype; PetscInt __pyx_v_nel; PetscInt __pyx_v_nen; PetscInt const *__pyx_v_elems; PyObject *__pyx_v_elements = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; DMDAElementType __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; char const *__pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; int __pyx_t_16; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getElements", 0); /* "PETSc/DMDA.pyx":446 * * def getElements(self, elem_type=None): * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * cdef PetscDMDAElementType etype * cdef PetscInt nel=0, nen=0 */ __pyx_v_dim = 0; /* "PETSc/DMDA.pyx":448 * cdef PetscInt dim=0 * cdef PetscDMDAElementType etype * cdef PetscInt nel=0, nen=0 # <<<<<<<<<<<<<< * cdef const PetscInt *elems=NULL * cdef object elements */ __pyx_v_nel = 0; __pyx_v_nen = 0; /* "PETSc/DMDA.pyx":449 * cdef PetscDMDAElementType etype * cdef PetscInt nel=0, nen=0 * cdef const PetscInt *elems=NULL # <<<<<<<<<<<<<< * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) */ __pyx_v_elems = NULL; /* "PETSc/DMDA.pyx":451 * cdef const PetscInt *elems=NULL * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) # <<<<<<<<<<<<<< * if elem_type is not None: * etype = daelementtype(elem_type) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_DMDAGetDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 451, __pyx_L1_error) /* "PETSc/DMDA.pyx":452 * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) * if elem_type is not None: # <<<<<<<<<<<<<< * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) */ __pyx_t_2 = (__pyx_v_elem_type != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/DMDA.pyx":453 * CHKERR( DMDAGetDim(self.dm, &dim) ) * if elem_type is not None: * etype = daelementtype(elem_type) # <<<<<<<<<<<<<< * CHKERR( DMDASetElementType(self.dm, etype) ) * try: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_daelementtype(__pyx_v_elem_type); if (unlikely(__pyx_t_4 == ((DMDAElementType)((DMDAElementType)-1L)))) __PYX_ERR(47, 453, __pyx_L1_error) __pyx_v_etype = __pyx_t_4; /* "PETSc/DMDA.pyx":454 * if elem_type is not None: * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) # <<<<<<<<<<<<<< * try: * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDASetElementType(__pyx_v_self->__pyx_base.dm, __pyx_v_etype)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 454, __pyx_L1_error) /* "PETSc/DMDA.pyx":452 * cdef object elements * CHKERR( DMDAGetDim(self.dm, &dim) ) * if elem_type is not None: # <<<<<<<<<<<<<< * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) */ } /* "PETSc/DMDA.pyx":455 * etype = daelementtype(elem_type) * CHKERR( DMDASetElementType(self.dm, etype) ) * try: # <<<<<<<<<<<<<< * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) * elements = array_i(nel*nen, elems) */ /*try:*/ { /* "PETSc/DMDA.pyx":456 * CHKERR( DMDASetElementType(self.dm, etype) ) * try: * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) # <<<<<<<<<<<<<< * elements = array_i(nel*nen, elems) * elements.shape = (toInt(nel), toInt(nen)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetElements(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nel), (&__pyx_v_nen), (&__pyx_v_elems))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 456, __pyx_L5_error) /* "PETSc/DMDA.pyx":457 * try: * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) * elements = array_i(nel*nen, elems) # <<<<<<<<<<<<<< * elements.shape = (toInt(nel), toInt(nen)) * finally: */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((__pyx_v_nel * __pyx_v_nen), __pyx_v_elems)); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 457, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_elements = __pyx_t_5; __pyx_t_5 = 0; /* "PETSc/DMDA.pyx":458 * CHKERR( DMDAGetElements(self.dm, &nel, &nen, &elems) ) * elements = array_i(nel*nen, elems) * elements.shape = (toInt(nel), toInt(nen)) # <<<<<<<<<<<<<< * finally: * CHKERR( DMDARestoreElements(self.dm, &nel, &nen, &elems) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nel); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 458, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nen); if (unlikely(!__pyx_t_6)) __PYX_ERR(47, 458, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 458, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_elements, __pyx_n_s_shape, __pyx_t_7) < 0) __PYX_ERR(47, 458, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } /* "PETSc/DMDA.pyx":460 * elements.shape = (toInt(nel), toInt(nen)) * finally: * CHKERR( DMDARestoreElements(self.dm, &nel, &nen, &elems) ) # <<<<<<<<<<<<<< * return elements * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDARestoreElements(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nel), (&__pyx_v_nen), (&__pyx_v_elems))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(47, 460, __pyx_L1_error) goto __pyx_L6; } __pyx_L5_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); __pyx_t_1 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; { __pyx_t_16 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDARestoreElements(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nel), (&__pyx_v_nen), (&__pyx_v_elems))); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(47, 460, __pyx_L8_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; goto __pyx_L1_error; __pyx_L8_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; goto __pyx_L1_error; } __pyx_L6:; } /* "PETSc/DMDA.pyx":461 * finally: * CHKERR( DMDARestoreElements(self.dm, &nel, &nen, &elems) ) * return elements # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_elements); __pyx_r = __pyx_v_elements; goto __pyx_L0; /* "PETSc/DMDA.pyx":445 * return ival * * def getElements(self, elem_type=None): # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * cdef PetscDMDAElementType etype */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.getElements", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_elements); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":466 * * property dim: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDim() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dim_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_3dim___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":467 * property dim: * def __get__(self): * return self.getDim() # <<<<<<<<<<<<<< * * property dof: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDim); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":466 * * property dim: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDim() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":470 * * property dof: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDof() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dof_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_3dof_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_3dof___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_3dof___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":471 * property dof: * def __get__(self): * return self.getDof() # <<<<<<<<<<<<<< * * property sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDof); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":470 * * property dof: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDof() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.dof.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":474 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_5sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_5sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_5sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":475 * property sizes: * def __get__(self): * return self.getSizes() # <<<<<<<<<<<<<< * * property proc_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":474 * * property sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":478 * * property proc_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_10proc_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_10proc_sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_10proc_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":479 * property proc_sizes: * def __get__(self): * return self.getProcSizes() # <<<<<<<<<<<<<< * * property boundary_type: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getProcSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":478 * * property proc_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.proc_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":482 * * property boundary_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBoundaryType() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13boundary_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13boundary_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_13boundary_type___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13boundary_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":483 * property boundary_type: * def __get__(self): * return self.getBoundaryType() # <<<<<<<<<<<<<< * * property stencil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBoundaryType); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":482 * * property boundary_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBoundaryType() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.boundary_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":486 * * property stencil: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencil() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7stencil_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7stencil_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_7stencil___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7stencil___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":487 * property stencil: * def __get__(self): * return self.getStencil() # <<<<<<<<<<<<<< * * property stencil_type: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencil); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":486 * * property stencil: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencil() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.stencil.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":490 * * property stencil_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12stencil_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12stencil_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_12stencil_type___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":491 * property stencil_type: * def __get__(self): * return self.getStencilType() # <<<<<<<<<<<<<< * * property stencil_width: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilType); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":490 * * property stencil_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.stencil_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":494 * * property stencil_width: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13stencil_width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13stencil_width_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_13stencil_width___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":495 * property stencil_width: * def __get__(self): * return self.getStencilWidth() # <<<<<<<<<<<<<< * * property ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilWidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":494 * * property stencil_width: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.stencil_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":498 * * property ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_6ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_6ranges_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_6ranges___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_6ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":499 * property ranges: * def __get__(self): * return self.getRanges() # <<<<<<<<<<<<<< * * property ghost_ranges: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":498 * * property ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":502 * * property ghost_ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGhostRanges() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12ghost_ranges_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_12ghost_ranges_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_12ghost_ranges___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_12ghost_ranges___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":503 * property ghost_ranges: * def __get__(self): * return self.getGhostRanges() # <<<<<<<<<<<<<< * * property corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGhostRanges); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":502 * * property ghost_ranges: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGhostRanges() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.ghost_ranges.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":506 * * property corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_7corners_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_7corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":507 * property corners: * def __get__(self): * return self.getCorners() # <<<<<<<<<<<<<< * * property ghost_corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":506 * * property corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMDA.pyx":510 * * property ghost_corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13ghost_corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_4DMDA_13ghost_corners_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_13ghost_corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_4DMDA_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMDA *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMDA.pyx":511 * property ghost_corners: * def __get__(self): * return self.getGhostCorners() # <<<<<<<<<<<<<< * * # backward compatibility */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGhostCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(47, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMDA.pyx":510 * * property ghost_corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMDA.ghost_corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":5 * cdef class DMPlex(DM): * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_create[] = "DMPlex.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(48, 5, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 5, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_create(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_create(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DMPlex.pyx":6 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 6, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":7 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":8 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 8, __pyx_L1_error) /* "PETSc/DMPlex.pyx":9 * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":10 * CHKERR( DMPlexCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createFromCellList(self, dim, cells, coords, interpolate=True, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":5 * cdef class DMPlex(DM): * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":12 * return self * * def createFromCellList(self, dim, cells, coords, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_2createFromCellList[] = "DMPlex.createFromCellList(self, dim, cells, coords, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_cells = 0; PyObject *__pyx_v_coords = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createFromCellList (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_cells,&__pyx_n_s_coords,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cells)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createFromCellList", 0, 3, 5, 1); __PYX_ERR(48, 12, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coords)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createFromCellList", 0, 3, 5, 2); __PYX_ERR(48, 12, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createFromCellList") < 0)) __PYX_ERR(48, 12, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_cells = values[1]; __pyx_v_coords = values[2]; __pyx_v_interpolate = values[3]; __pyx_v_comm = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createFromCellList", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 12, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromCellList", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_2createFromCellList(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_dim, __pyx_v_cells, __pyx_v_coords, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_2createFromCellList(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_cells, PyObject *__pyx_v_coords, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PetscInt __pyx_v_cdim; PetscInt __pyx_v_numCells; PetscInt __pyx_v_numCorners; PetscInt *__pyx_v_cellVertices; PetscInt __pyx_v_numVertices; PetscInt __pyx_v_spaceDim; PetscReal *__pyx_v_vertexCoords; int __pyx_v_npy_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createFromCellList", 0); __Pyx_INCREF(__pyx_v_cells); __Pyx_INCREF(__pyx_v_coords); /* "PETSc/DMPlex.pyx":13 * * def createFromCellList(self, dim, cells, coords, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 13, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":14 * def createFromCellList(self, dim, cells, coords, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef PetscInt cdim = asInt(dim) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 14, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "PETSc/DMPlex.pyx":15 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef PetscInt cdim = asInt(dim) * cdef PetscInt numCells = 0 */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":16 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef PetscInt cdim = asInt(dim) # <<<<<<<<<<<<<< * cdef PetscInt numCells = 0 * cdef PetscInt numCorners = 0 */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 16, __pyx_L1_error) __pyx_v_cdim = __pyx_t_3; /* "PETSc/DMPlex.pyx":17 * cdef PetscDM newdm = NULL * cdef PetscInt cdim = asInt(dim) * cdef PetscInt numCells = 0 # <<<<<<<<<<<<<< * cdef PetscInt numCorners = 0 * cdef PetscInt *cellVertices = NULL */ __pyx_v_numCells = 0; /* "PETSc/DMPlex.pyx":18 * cdef PetscInt cdim = asInt(dim) * cdef PetscInt numCells = 0 * cdef PetscInt numCorners = 0 # <<<<<<<<<<<<<< * cdef PetscInt *cellVertices = NULL * cdef PetscInt numVertices = 0 */ __pyx_v_numCorners = 0; /* "PETSc/DMPlex.pyx":19 * cdef PetscInt numCells = 0 * cdef PetscInt numCorners = 0 * cdef PetscInt *cellVertices = NULL # <<<<<<<<<<<<<< * cdef PetscInt numVertices = 0 * cdef PetscInt spaceDim= 0 */ __pyx_v_cellVertices = NULL; /* "PETSc/DMPlex.pyx":20 * cdef PetscInt numCorners = 0 * cdef PetscInt *cellVertices = NULL * cdef PetscInt numVertices = 0 # <<<<<<<<<<<<<< * cdef PetscInt spaceDim= 0 * cdef PetscReal *vertexCoords = NULL */ __pyx_v_numVertices = 0; /* "PETSc/DMPlex.pyx":21 * cdef PetscInt *cellVertices = NULL * cdef PetscInt numVertices = 0 * cdef PetscInt spaceDim= 0 # <<<<<<<<<<<<<< * cdef PetscReal *vertexCoords = NULL * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY */ __pyx_v_spaceDim = 0; /* "PETSc/DMPlex.pyx":22 * cdef PetscInt numVertices = 0 * cdef PetscInt spaceDim= 0 * cdef PetscReal *vertexCoords = NULL # <<<<<<<<<<<<<< * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) */ __pyx_v_vertexCoords = NULL; /* "PETSc/DMPlex.pyx":23 * cdef PetscInt spaceDim= 0 * cdef PetscReal *vertexCoords = NULL * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY # <<<<<<<<<<<<<< * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) */ __pyx_v_npy_flags = ((NPY_ARRAY_ALIGNED | NPY_ARRAY_NOTSWAPPED) | NPY_ARRAY_CARRAY); /* "PETSc/DMPlex.pyx":24 * cdef PetscReal *vertexCoords = NULL * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) # <<<<<<<<<<<<<< * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) * if PyArray_NDIM(cells) != 2: raise ValueError( */ __pyx_t_4 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_cells, NPY_PETSC_INT, __pyx_v_npy_flags)); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_cells, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":25 * cdef int npy_flags = NPY_ARRAY_ALIGNED|NPY_ARRAY_NOTSWAPPED|NPY_ARRAY_CARRAY * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) # <<<<<<<<<<<<<< * if PyArray_NDIM(cells) != 2: raise ValueError( * ("cell indices must have two dimensions: " */ __pyx_t_4 = ((PyObject *)PyArray_FROM_OTF(__pyx_v_coords, NPY_PETSC_REAL, __pyx_v_npy_flags)); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_coords, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":26 * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) * if PyArray_NDIM(cells) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 26, __pyx_L1_error) __pyx_t_5 = ((PyArray_NDIM(((PyArrayObject *)__pyx_v_cells)) != 2) != 0); if (unlikely(__pyx_t_5)) { /* "PETSc/DMPlex.pyx":28 * if PyArray_NDIM(cells) != 2: raise ValueError( * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) # <<<<<<<<<<<<<< * if PyArray_NDIM(coords) != 2: raise ValueError( * ("coords vertices must have two dimensions: " */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 28, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_From_int(PyArray_NDIM(((PyArrayObject *)__pyx_v_cells))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_cell_indices_must_have_two_dimen, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":26 * cells = PyArray_FROM_OTF(cells, NPY_PETSC_INT, npy_flags) * coords = PyArray_FROM_OTF(coords, NPY_PETSC_REAL, npy_flags) * if PyArray_NDIM(cells) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(48, 26, __pyx_L1_error) } /* "PETSc/DMPlex.pyx":29 * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) * if PyArray_NDIM(coords) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 29, __pyx_L1_error) __pyx_t_5 = ((PyArray_NDIM(((PyArrayObject *)__pyx_v_coords)) != 2) != 0); if (unlikely(__pyx_t_5)) { /* "PETSc/DMPlex.pyx":31 * if PyArray_NDIM(coords) != 2: raise ValueError( * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) # <<<<<<<<<<<<<< * numCells = PyArray_DIM(cells, 0) * numCorners = PyArray_DIM(cells, 1) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 31, __pyx_L1_error) __pyx_t_4 = __Pyx_PyInt_From_int(PyArray_NDIM(((PyArrayObject *)__pyx_v_coords))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_coords_vertices_must_have_two_di, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":29 * ("cell indices must have two dimensions: " * "cells.ndim=%d") % (PyArray_NDIM(cells)) ) * if PyArray_NDIM(coords) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) */ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(48, 29, __pyx_L1_error) } /* "PETSc/DMPlex.pyx":32 * ("coords vertices must have two dimensions: " * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) * numCells = PyArray_DIM(cells, 0) # <<<<<<<<<<<<<< * numCorners = PyArray_DIM(cells, 1) * numVertices = PyArray_DIM(coords, 0) */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 32, __pyx_L1_error) __pyx_v_numCells = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_cells), 0)); /* "PETSc/DMPlex.pyx":33 * "coords.ndim=%d") % (PyArray_NDIM(coords)) ) * numCells = PyArray_DIM(cells, 0) * numCorners = PyArray_DIM(cells, 1) # <<<<<<<<<<<<<< * numVertices = PyArray_DIM(coords, 0) * spaceDim = PyArray_DIM(coords, 1) */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 33, __pyx_L1_error) __pyx_v_numCorners = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_cells), 1)); /* "PETSc/DMPlex.pyx":34 * numCells = PyArray_DIM(cells, 0) * numCorners = PyArray_DIM(cells, 1) * numVertices = PyArray_DIM(coords, 0) # <<<<<<<<<<<<<< * spaceDim = PyArray_DIM(coords, 1) * cellVertices = PyArray_DATA(cells) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 34, __pyx_L1_error) __pyx_v_numVertices = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_coords), 0)); /* "PETSc/DMPlex.pyx":35 * numCorners = PyArray_DIM(cells, 1) * numVertices = PyArray_DIM(coords, 0) * spaceDim = PyArray_DIM(coords, 1) # <<<<<<<<<<<<<< * cellVertices = PyArray_DATA(cells) * vertexCoords = PyArray_DATA(coords) */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 35, __pyx_L1_error) __pyx_v_spaceDim = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_coords), 1)); /* "PETSc/DMPlex.pyx":36 * numVertices = PyArray_DIM(coords, 0) * spaceDim = PyArray_DIM(coords, 1) * cellVertices = PyArray_DATA(cells) # <<<<<<<<<<<<<< * vertexCoords = PyArray_DATA(coords) * CHKERR( DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices, */ if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 36, __pyx_L1_error) __pyx_v_cellVertices = ((PetscInt *)PyArray_DATA(((PyArrayObject *)__pyx_v_cells))); /* "PETSc/DMPlex.pyx":37 * spaceDim = PyArray_DIM(coords, 1) * cellVertices = PyArray_DATA(cells) * vertexCoords = PyArray_DATA(coords) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices, * numCorners, interp, cellVertices, */ if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(48, 37, __pyx_L1_error) __pyx_v_vertexCoords = ((PetscReal *)PyArray_DATA(((PyArrayObject *)__pyx_v_coords))); /* "PETSc/DMPlex.pyx":38 * cellVertices = PyArray_DATA(cells) * vertexCoords = PyArray_DATA(coords) * CHKERR( DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices, # <<<<<<<<<<<<<< * numCorners, interp, cellVertices, * spaceDim, vertexCoords, &newdm) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateFromCellListPetsc(__pyx_v_ccomm, __pyx_v_cdim, __pyx_v_numCells, __pyx_v_numVertices, __pyx_v_numCorners, __pyx_v_interp, __pyx_v_cellVertices, __pyx_v_spaceDim, __pyx_v_vertexCoords, (&__pyx_v_newdm))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(48, 38, __pyx_L1_error) /* "PETSc/DMPlex.pyx":41 * numCorners, interp, cellVertices, * spaceDim, vertexCoords, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":42 * spaceDim, vertexCoords, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":12 * return self * * def createFromCellList(self, dim, cells, coords, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromCellList", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cells); __Pyx_XDECREF(__pyx_v_coords); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":44 * return self * * def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), # <<<<<<<<<<<<<< * simplex=True, periodic=False, interpolate=True, comm=None): * cdef Py_ssize_t i = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_4createBoxMesh[] = "DMPlex.createBoxMesh(self, faces, lower=(0, 0, 0), upper=(1, 1, 1), simplex=True, periodic=False, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_faces = 0; PyObject *__pyx_v_lower = 0; PyObject *__pyx_v_upper = 0; PyObject *__pyx_v_simplex = 0; PyObject *__pyx_v_periodic = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createBoxMesh (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_faces,&__pyx_n_s_lower,&__pyx_n_s_upper,&__pyx_n_s_simplex,&__pyx_n_s_periodic,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[7] = {0,0,0,0,0,0,0}; values[1] = ((PyObject *)__pyx_tuple__46); values[2] = ((PyObject *)__pyx_tuple__47); /* "PETSc/DMPlex.pyx":45 * * def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), * simplex=True, periodic=False, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef Py_ssize_t i = 0 * cdef PetscInt dim = 0, *cfaces = NULL */ values[3] = ((PyObject *)Py_True); values[4] = ((PyObject *)Py_False); values[5] = ((PyObject *)Py_True); values[6] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_faces)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lower); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_upper); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_simplex); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_periodic); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[6] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createBoxMesh") < 0)) __PYX_ERR(48, 44, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_faces = values[0]; __pyx_v_lower = values[1]; __pyx_v_upper = values[2]; __pyx_v_simplex = values[3]; __pyx_v_periodic = values[4]; __pyx_v_interpolate = values[5]; __pyx_v_comm = values[6]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createBoxMesh", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 44, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createBoxMesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_4createBoxMesh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_faces, __pyx_v_lower, __pyx_v_upper, __pyx_v_simplex, __pyx_v_periodic, __pyx_v_interpolate, __pyx_v_comm); /* "PETSc/DMPlex.pyx":44 * return self * * def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), # <<<<<<<<<<<<<< * simplex=True, periodic=False, interpolate=True, comm=None): * cdef Py_ssize_t i = 0 */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_4createBoxMesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_faces, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_simplex, PyObject *__pyx_v_periodic, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { Py_ssize_t __pyx_v_i; PetscInt __pyx_v_dim; PetscInt *__pyx_v_cfaces; PetscReal __pyx_v_clower[3]; PetscReal __pyx_v_cupper[3]; DMBoundaryType __pyx_v_btype[3]; PetscBool __pyx_v_csimplex; PetscBool __pyx_v_cinterp; MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PetscInt __pyx_t_4; PetscReal __pyx_t_5; PetscBool __pyx_t_6; MPI_Comm __pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createBoxMesh", 0); __Pyx_INCREF(__pyx_v_faces); /* "PETSc/DMPlex.pyx":46 * def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), * simplex=True, periodic=False, interpolate=True, comm=None): * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) */ __pyx_v_i = 0; /* "PETSc/DMPlex.pyx":47 * simplex=True, periodic=False, interpolate=True, comm=None): * cdef Py_ssize_t i = 0 * cdef PetscInt dim = 0, *cfaces = NULL # <<<<<<<<<<<<<< * faces = iarray_i(faces, &dim, &cfaces) * assert dim >= 1 and dim <= 3 */ __pyx_v_dim = 0; __pyx_v_cfaces = NULL; /* "PETSc/DMPlex.pyx":48 * cdef Py_ssize_t i = 0 * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) # <<<<<<<<<<<<<< * assert dim >= 1 and dim <= 3 * cdef PetscReal clower[3] */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_faces, (&__pyx_v_dim), (&__pyx_v_cfaces))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_faces, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":49 * cdef PetscInt dim = 0, *cfaces = NULL * faces = iarray_i(faces, &dim, &cfaces) * assert dim >= 1 and dim <= 3 # <<<<<<<<<<<<<< * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_3 = ((__pyx_v_dim >= 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = ((__pyx_v_dim <= 3) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 49, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":51 * assert dim >= 1 and dim <= 3 * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 # <<<<<<<<<<<<<< * for i from 0 <= i < dim: clower[i] = lower[i] * cdef PetscReal cupper[3] */ (__pyx_v_clower[0]) = 0.0; (__pyx_v_clower[1]) = 0.0; (__pyx_v_clower[2]) = 0.0; /* "PETSc/DMPlex.pyx":52 * cdef PetscReal clower[3] * clower[0] = clower[1] = clower[2] = 0 * for i from 0 <= i < dim: clower[i] = lower[i] # <<<<<<<<<<<<<< * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 */ __pyx_t_4 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lower, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(48, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_clower[__pyx_v_i]) = __pyx_t_5; } /* "PETSc/DMPlex.pyx":54 * for i from 0 <= i < dim: clower[i] = lower[i] * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cupper[i] = upper[i] * cdef PetscDMBoundaryType btype[3]; */ (__pyx_v_cupper[0]) = 1.0; (__pyx_v_cupper[1]) = 1.0; (__pyx_v_cupper[2]) = 1.0; /* "PETSc/DMPlex.pyx":55 * cdef PetscReal cupper[3] * cupper[0] = cupper[1] = cupper[2] = 1 * for i from 0 <= i < dim: cupper[i] = upper[i] # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btype[3]; * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) */ __pyx_t_4 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_upper, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(48, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_cupper[__pyx_v_i]) = __pyx_t_5; } /* "PETSc/DMPlex.pyx":57 * for i from 0 <= i < dim: cupper[i] = upper[i] * cdef PetscDMBoundaryType btype[3]; * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) # <<<<<<<<<<<<<< * cdef PetscBool csimplex = simplex * cdef PetscBool cinterp = interpolate */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_periodic, (&(__pyx_v_btype[0])), (&(__pyx_v_btype[1])), (&(__pyx_v_btype[2]))); if (unlikely(__pyx_t_4 == ((PetscInt)-1L))) __PYX_ERR(48, 57, __pyx_L1_error) /* "PETSc/DMPlex.pyx":58 * cdef PetscDMBoundaryType btype[3]; * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) * cdef PetscBool csimplex = simplex # <<<<<<<<<<<<<< * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_6 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_simplex)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 58, __pyx_L1_error) __pyx_v_csimplex = __pyx_t_6; /* "PETSc/DMPlex.pyx":59 * asBoundary(periodic, &btype[0], &btype[1], &btype[2]) * cdef PetscBool csimplex = simplex * cdef PetscBool cinterp = interpolate # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ __pyx_t_6 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 59, __pyx_L1_error) __pyx_v_cinterp = __pyx_t_6; /* "PETSc/DMPlex.pyx":60 * cdef PetscBool csimplex = simplex * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 60, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_7; /* "PETSc/DMPlex.pyx":61 * cdef PetscBool cinterp = interpolate * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, * clower, cupper, btype, cinterp, &newdm) ) */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":62 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, # <<<<<<<<<<<<<< * clower, cupper, btype, cinterp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateBoxMesh(__pyx_v_ccomm, __pyx_v_dim, __pyx_v_csimplex, __pyx_v_cfaces, __pyx_v_clower, __pyx_v_cupper, __pyx_v_btype, __pyx_v_cinterp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(48, 62, __pyx_L1_error) /* "PETSc/DMPlex.pyx":64 * CHKERR( DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces, * clower, cupper, btype, cinterp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":65 * clower, cupper, btype, cinterp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createFromFile(self, filename, interpolate=True, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":44 * return self * * def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), # <<<<<<<<<<<<<< * simplex=True, periodic=False, interpolate=True, comm=None): * cdef Py_ssize_t i = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createBoxMesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_faces); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":67 * return self * * def createFromFile(self, filename, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createFromFile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_6createFromFile[] = "DMPlex.createFromFile(self, filename, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createFromFile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createFromFile (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createFromFile") < 0)) __PYX_ERR(48, 67, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filename = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createFromFile", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 67, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_6createFromFile(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_filename, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_6createFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; char const *__pyx_v_cfile; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createFromFile", 0); __Pyx_INCREF(__pyx_v_filename); /* "PETSc/DMPlex.pyx":68 * * def createFromFile(self, filename, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 68, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":69 * def createFromFile(self, filename, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 69, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "PETSc/DMPlex.pyx":70 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":71 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateFromFile(ccomm, cfile, interp, &newdm) ) */ __pyx_v_cfile = NULL; /* "PETSc/DMPlex.pyx":72 * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMPlex.pyx":73 * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateFromFile(ccomm, cfile, interp, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateFromFile(__pyx_v_ccomm, __pyx_v_cfile, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 73, __pyx_L1_error) /* "PETSc/DMPlex.pyx":74 * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":75 * CHKERR( DMPlexCreateFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createCGNS(self, cgid, interpolate=True, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":67 * return self * * def createFromFile(self, filename, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":77 * return self * * def createCGNS(self, cgid, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createCGNS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_8createCGNS[] = "DMPlex.createCGNS(self, cgid, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createCGNS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cgid = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCGNS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cgid,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cgid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCGNS") < 0)) __PYX_ERR(48, 77, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_cgid = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCGNS", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 77, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_8createCGNS(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_cgid, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_8createCGNS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cgid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PetscInt __pyx_v_ccgid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCGNS", 0); /* "PETSc/DMPlex.pyx":78 * * def createCGNS(self, cgid, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 78, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":79 * def createCGNS(self, cgid, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef PetscInt ccgid = asInt(cgid) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 79, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "PETSc/DMPlex.pyx":80 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef PetscInt ccgid = asInt(cgid) * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":81 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef PetscInt ccgid = asInt(cgid) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cgid); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 81, __pyx_L1_error) __pyx_v_ccgid = __pyx_t_3; /* "PETSc/DMPlex.pyx":82 * cdef PetscDM newdm = NULL * cdef PetscInt ccgid = asInt(cgid) * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCGNS(__pyx_v_ccomm, __pyx_v_ccgid, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 82, __pyx_L1_error) /* "PETSc/DMPlex.pyx":83 * cdef PetscInt ccgid = asInt(cgid) * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":84 * CHKERR( DMPlexCreateCGNS(ccomm, ccgid, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createCGNSFromFile(self, filename, interpolate=True, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":77 * return self * * def createCGNS(self, cgid, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":86 * return self * * def createCGNSFromFile(self, filename, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNSFromFile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_10createCGNSFromFile[] = "DMPlex.createCGNSFromFile(self, filename, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNSFromFile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCGNSFromFile (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCGNSFromFile") < 0)) __PYX_ERR(48, 86, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filename = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCGNSFromFile", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 86, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNSFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_10createCGNSFromFile(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_filename, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_10createCGNSFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; char const *__pyx_v_cfile; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCGNSFromFile", 0); __Pyx_INCREF(__pyx_v_filename); /* "PETSc/DMPlex.pyx":87 * * def createCGNSFromFile(self, filename, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 87, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":88 * def createCGNSFromFile(self, filename, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 88, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "PETSc/DMPlex.pyx":89 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":90 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) */ __pyx_v_cfile = NULL; /* "PETSc/DMPlex.pyx":91 * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMPlex.pyx":92 * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCGNSFromFile(__pyx_v_ccomm, __pyx_v_cfile, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 92, __pyx_L1_error) /* "PETSc/DMPlex.pyx":93 * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":94 * CHKERR( DMPlexCreateCGNSFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createExodusFromFile(self, filename, interpolate=True, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":86 * return self * * def createCGNSFromFile(self, filename, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCGNSFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":96 * return self * * def createExodusFromFile(self, filename, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createExodusFromFile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_12createExodusFromFile[] = "DMPlex.createExodusFromFile(self, filename, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createExodusFromFile(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createExodusFromFile (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createExodusFromFile") < 0)) __PYX_ERR(48, 96, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_filename = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createExodusFromFile", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 96, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodusFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_12createExodusFromFile(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_filename, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_12createExodusFromFile(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; char const *__pyx_v_cfile; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createExodusFromFile", 0); __Pyx_INCREF(__pyx_v_filename); /* "PETSc/DMPlex.pyx":97 * * def createExodusFromFile(self, filename, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 97, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":98 * def createExodusFromFile(self, filename, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 98, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "PETSc/DMPlex.pyx":99 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":100 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) */ __pyx_v_cfile = NULL; /* "PETSc/DMPlex.pyx":101 * cdef PetscDM newdm = NULL * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfile)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMPlex.pyx":102 * cdef const char *cfile = NULL * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateExodusFromFile(__pyx_v_ccomm, __pyx_v_cfile, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 102, __pyx_L1_error) /* "PETSc/DMPlex.pyx":103 * filename = str2bytes(filename, &cfile) * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":104 * CHKERR( DMPlexCreateExodusFromFile(ccomm, cfile, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createExodus(self, exoid, interpolate=True, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":96 * return self * * def createExodusFromFile(self, filename, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodusFromFile", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":106 * return self * * def createExodus(self, exoid, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_14createExodus[] = "DMPlex.createExodus(self, exoid, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_exoid = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createExodus (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exoid,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exoid)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createExodus") < 0)) __PYX_ERR(48, 106, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_exoid = values[0]; __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createExodus", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 106, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodus", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_14createExodus(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_exoid, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_14createExodus(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_exoid, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PetscInt __pyx_v_cexoid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; PetscInt __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createExodus", 0); /* "PETSc/DMPlex.pyx":107 * * def createExodus(self, exoid, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 107, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":108 * def createExodus(self, exoid, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * cdef PetscInt cexoid = asInt(exoid) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 108, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "PETSc/DMPlex.pyx":109 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * cdef PetscInt cexoid = asInt(exoid) * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":110 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * cdef PetscInt cexoid = asInt(exoid) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_exoid); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 110, __pyx_L1_error) __pyx_v_cexoid = __pyx_t_3; /* "PETSc/DMPlex.pyx":111 * cdef PetscDM newdm = NULL * cdef PetscInt cexoid = asInt(exoid) * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateExodus(__pyx_v_ccomm, __pyx_v_cexoid, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 111, __pyx_L1_error) /* "PETSc/DMPlex.pyx":112 * cdef PetscInt cexoid = asInt(exoid) * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":113 * CHKERR( DMPlexCreateExodus(ccomm, cexoid, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createGmsh(self, Viewer viewer, interpolate=True, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":106 * return self * * def createExodus(self, exoid, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createExodus", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":115 * return self * * def createGmsh(self, Viewer viewer, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createGmsh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_16createGmsh[] = "DMPlex.createGmsh(self, Viewer viewer, interpolate=True, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createGmsh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; PyObject *__pyx_v_interpolate = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGmsh (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,&__pyx_n_s_interpolate,&__pyx_n_s_comm,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGmsh") < 0)) __PYX_ERR(48, 115, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); __pyx_v_interpolate = values[1]; __pyx_v_comm = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGmsh", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 115, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createGmsh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(48, 115, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_16createGmsh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer, __pyx_v_interpolate, __pyx_v_comm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_16createGmsh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscBool __pyx_v_interp; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PetscBool __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGmsh", 0); /* "PETSc/DMPlex.pyx":116 * * def createGmsh(self, Viewer viewer, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 116, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMPlex.pyx":117 * def createGmsh(self, Viewer viewer, interpolate=True, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) */ __pyx_t_2 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 117, __pyx_L1_error) __pyx_v_interp = __pyx_t_2; /* "PETSc/DMPlex.pyx":118 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":119 * cdef PetscBool interp = interpolate * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateGmsh(__pyx_v_ccomm, __pyx_v_viewer->vwr, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(48, 119, __pyx_L1_error) /* "PETSc/DMPlex.pyx":120 * cdef PetscDM newdm = NULL * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":121 * CHKERR( DMPlexCreateGmsh(ccomm, viewer.vwr, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def createCohesiveSubmesh(self, hasLagrange, value): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":115 * return self * * def createGmsh(self, Viewer viewer, interpolate=True, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscBool interp = interpolate */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createGmsh", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":123 * return self * * def createCohesiveSubmesh(self, hasLagrange, value): # <<<<<<<<<<<<<< * cdef PetscBool flag = hasLagrange * cdef PetscInt cvalue = asInt(value) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createCohesiveSubmesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_18createCohesiveSubmesh[] = "DMPlex.createCohesiveSubmesh(self, hasLagrange, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createCohesiveSubmesh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_hasLagrange = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCohesiveSubmesh (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hasLagrange,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasLagrange)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createCohesiveSubmesh", 1, 2, 2, 1); __PYX_ERR(48, 123, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCohesiveSubmesh") < 0)) __PYX_ERR(48, 123, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_hasLagrange = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCohesiveSubmesh", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 123, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCohesiveSubmesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_18createCohesiveSubmesh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_hasLagrange, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_18createCohesiveSubmesh(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hasLagrange, PyObject *__pyx_v_value) { PetscBool __pyx_v_flag; PetscInt __pyx_v_cvalue; struct PyPetscDMObject *__pyx_v_subdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; PetscInt __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCohesiveSubmesh", 0); /* "PETSc/DMPlex.pyx":124 * * def createCohesiveSubmesh(self, hasLagrange, value): * cdef PetscBool flag = hasLagrange # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * cdef DM subdm = DMPlex() */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_hasLagrange)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 124, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "PETSc/DMPlex.pyx":125 * def createCohesiveSubmesh(self, hasLagrange, value): * cdef PetscBool flag = hasLagrange * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * cdef DM subdm = DMPlex() * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 125, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_2; /* "PETSc/DMPlex.pyx":126 * cdef PetscBool flag = hasLagrange * cdef PetscInt cvalue = asInt(value) * cdef DM subdm = DMPlex() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) * return subdm */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMPlex)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMPlex.pyx":127 * cdef PetscInt cvalue = asInt(value) * cdef DM subdm = DMPlex() * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) # <<<<<<<<<<<<<< * return subdm * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCohesiveSubmesh(__pyx_v_self->__pyx_base.dm, __pyx_v_flag, NULL, __pyx_v_cvalue, (&__pyx_v_subdm->dm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 127, __pyx_L1_error) /* "PETSc/DMPlex.pyx":128 * cdef DM subdm = DMPlex() * CHKERR( DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm) ) * return subdm # <<<<<<<<<<<<<< * * def getChart(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_subdm)); __pyx_r = ((PyObject *)__pyx_v_subdm); goto __pyx_L0; /* "PETSc/DMPlex.pyx":123 * return self * * def createCohesiveSubmesh(self, hasLagrange, value): # <<<<<<<<<<<<<< * cdef PetscBool flag = hasLagrange * cdef PetscInt cvalue = asInt(value) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCohesiveSubmesh", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_subdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":130 * return subdm * * def getChart(self): # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_21getChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_20getChart[] = "DMPlex.getChart(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_21getChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getChart (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getChart", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getChart", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_20getChart(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_20getChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getChart", 0); /* "PETSc/DMPlex.pyx":131 * * def getChart(self): * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) */ __pyx_v_pStart = 0; __pyx_v_pEnd = 0; /* "PETSc/DMPlex.pyx":132 * def getChart(self): * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) # <<<<<<<<<<<<<< * return toInt(pStart), toInt(pEnd) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 132, __pyx_L1_error) /* "PETSc/DMPlex.pyx":133 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * return toInt(pStart), toInt(pEnd) # <<<<<<<<<<<<<< * * def setChart(self, pStart, pEnd): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pStart); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_pEnd); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":130 * return subdm * * def getChart(self): # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":135 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart, pEnd): # <<<<<<<<<<<<<< * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_23setChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_22setChart[] = "DMPlex.setChart(self, pStart, pEnd)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_23setChart(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pStart = 0; PyObject *__pyx_v_pEnd = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setChart (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pStart,&__pyx_n_s_pEnd,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pStart)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pEnd)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, 1); __PYX_ERR(48, 135, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setChart") < 0)) __PYX_ERR(48, 135, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_pStart = values[0]; __pyx_v_pEnd = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 135, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_22setChart(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_22setChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd) { PetscInt __pyx_v_cStart; PetscInt __pyx_v_cEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setChart", 0); /* "PETSc/DMPlex.pyx":136 * * def setChart(self, pStart, pEnd): * cdef PetscInt cStart = asInt(pStart) # <<<<<<<<<<<<<< * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pStart); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 136, __pyx_L1_error) __pyx_v_cStart = __pyx_t_1; /* "PETSc/DMPlex.pyx":137 * def setChart(self, pStart, pEnd): * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) # <<<<<<<<<<<<<< * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pEnd); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 137, __pyx_L1_error) __pyx_v_cEnd = __pyx_t_1; /* "PETSc/DMPlex.pyx":138 * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) # <<<<<<<<<<<<<< * * def getConeSize(self, p): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetChart(__pyx_v_self->__pyx_base.dm, __pyx_v_cStart, __pyx_v_cEnd)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 138, __pyx_L1_error) /* "PETSc/DMPlex.pyx":135 * return toInt(pStart), toInt(pEnd) * * def setChart(self, pStart, pEnd): # <<<<<<<<<<<<<< * cdef PetscInt cStart = asInt(pStart) * cdef PetscInt cEnd = asInt(pEnd) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setChart", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":140 * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) * * def getConeSize(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_25getConeSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_24getConeSize[] = "DMPlex.getConeSize(self, p)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_25getConeSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConeSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getConeSize") < 0)) __PYX_ERR(48, 140, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConeSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 140, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_24getConeSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_24getConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_csize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConeSize", 0); /* "PETSc/DMPlex.pyx":141 * * def getConeSize(self, p): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 141, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":142 * def getConeSize(self, p): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 143, __pyx_L1_error) /* "PETSc/DMPlex.pyx":144 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 144, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":145 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_csize))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 146, __pyx_L1_error) /* "PETSc/DMPlex.pyx":147 * cdef PetscInt csize = 0 * CHKERR( DMPlexGetConeSize(self.dm, cp, &csize) ) * return toInt(csize) # <<<<<<<<<<<<<< * * def setConeSize(self, p, size): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_csize); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":140 * CHKERR( DMPlexSetChart(self.dm, cStart, cEnd) ) * * def getConeSize(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":149 * return toInt(csize) * * def setConeSize(self, p, size): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_27setConeSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_26setConeSize[] = "DMPlex.setConeSize(self, p, size)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_27setConeSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_size = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConeSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_size,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setConeSize", 1, 2, 2, 1); __PYX_ERR(48, 149, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConeSize") < 0)) __PYX_ERR(48, 149, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_size = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConeSize", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 149, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_26setConeSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_26setConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_csize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConeSize", 0); /* "PETSc/DMPlex.pyx":150 * * def setConeSize(self, p, size): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 150, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":151 * def setConeSize(self, p, size): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 152, __pyx_L1_error) /* "PETSc/DMPlex.pyx":153 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 153, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":154 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_csize)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 155, __pyx_L1_error) /* "PETSc/DMPlex.pyx":149 * return toInt(csize) * * def setConeSize(self, p, size): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":157 * CHKERR( DMPlexSetConeSize(self.dm, cp, csize) ) * * def getCone(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_29getCone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_28getCone[] = "DMPlex.getCone(self, p)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_29getCone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCone (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getCone") < 0)) __PYX_ERR(48, 157, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getCone", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 157, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_28getCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_28getCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ncone; PetscInt const *__pyx_v_icone; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCone", 0); /* "PETSc/DMPlex.pyx":158 * * def getCone(self, p): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 158, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":159 * def getCone(self, p): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 160, __pyx_L1_error) /* "PETSc/DMPlex.pyx":161 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 161, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":162 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ncone))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 164, __pyx_L1_error) /* "PETSc/DMPlex.pyx":165 * cdef const PetscInt *icone = NULL * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * CHKERR( DMPlexGetCone(self.dm, cp, &icone) ) # <<<<<<<<<<<<<< * return array_i(ncone, icone) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCone(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_icone))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 165, __pyx_L1_error) /* "PETSc/DMPlex.pyx":166 * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * CHKERR( DMPlexGetCone(self.dm, cp, &icone) ) * return array_i(ncone, icone) # <<<<<<<<<<<<<< * * def setCone(self, p, cone, orientation=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_ncone, __pyx_v_icone)); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":157 * CHKERR( DMPlexSetConeSize(self.dm, cp, csize) ) * * def getCone(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":168 * return array_i(ncone, icone) * * def setCone(self, p, cone, orientation=None): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_31setCone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_30setCone[] = "DMPlex.setCone(self, p, cone, orientation=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_31setCone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_cone = 0; PyObject *__pyx_v_orientation = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCone (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_cone,&__pyx_n_s_orientation,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cone)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setCone", 0, 2, 3, 1); __PYX_ERR(48, 168, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orientation); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCone") < 0)) __PYX_ERR(48, 168, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_p = values[0]; __pyx_v_cone = values[1]; __pyx_v_orientation = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCone", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 168, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_30setCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_cone, __pyx_v_orientation); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_30setCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_cone, PyObject *__pyx_v_orientation) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ncone; PetscInt *__pyx_v_icone; PetscInt __pyx_v_norie; PetscInt *__pyx_v_iorie; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCone", 0); __Pyx_INCREF(__pyx_v_cone); __Pyx_INCREF(__pyx_v_orientation); /* "PETSc/DMPlex.pyx":169 * * def setCone(self, p, cone, orientation=None): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 169, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":170 * def setCone(self, p, cone, orientation=None): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 171, __pyx_L1_error) /* "PETSc/DMPlex.pyx":172 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 172, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":174 * assert cp>=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_ncone)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 177, __pyx_L1_error) /* "PETSc/DMPlex.pyx":178 * cone = iarray_i(cone, &ncone, &icone) * CHKERR( DMPlexSetConeSize(self.dm, cp, ncone) ) * CHKERR( DMPlexSetCone(self.dm, cp, icone) ) # <<<<<<<<<<<<<< * # * cdef PetscInt norie = 0 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetCone(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_icone)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 178, __pyx_L1_error) /* "PETSc/DMPlex.pyx":180 * CHKERR( DMPlexSetCone(self.dm, cp, icone) ) * # * cdef PetscInt norie = 0 # <<<<<<<<<<<<<< * cdef PetscInt *iorie = NULL * if orientation is not None: */ __pyx_v_norie = 0; /* "PETSc/DMPlex.pyx":181 * # * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL # <<<<<<<<<<<<<< * if orientation is not None: * orientation = iarray_i(orientation, &norie, &iorie) */ __pyx_v_iorie = NULL; /* "PETSc/DMPlex.pyx":182 * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL * if orientation is not None: # <<<<<<<<<<<<<< * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone */ __pyx_t_3 = (__pyx_v_orientation != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/DMPlex.pyx":183 * cdef PetscInt *iorie = NULL * if orientation is not None: * orientation = iarray_i(orientation, &norie, &iorie) # <<<<<<<<<<<<<< * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_orientation, (&__pyx_v_norie), (&__pyx_v_iorie))); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_orientation, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/DMPlex.pyx":184 * if orientation is not None: * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone # <<<<<<<<<<<<<< * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_norie == __pyx_v_ncone) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 184, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":185 * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) # <<<<<<<<<<<<<< * * def insertCone(self, p, conePos, conePoint): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_iorie)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 185, __pyx_L1_error) /* "PETSc/DMPlex.pyx":182 * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL * if orientation is not None: # <<<<<<<<<<<<<< * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone */ } /* "PETSc/DMPlex.pyx":168 * return array_i(ncone, icone) * * def setCone(self, p, cone, orientation=None): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_cone); __Pyx_XDECREF(__pyx_v_orientation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":187 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def insertCone(self, p, conePos, conePoint): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_33insertCone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_32insertCone[] = "DMPlex.insertCone(self, p, conePos, conePoint)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_33insertCone(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_conePos = 0; PyObject *__pyx_v_conePoint = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertCone (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_conePos,&__pyx_n_s_conePoint,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conePos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("insertCone", 1, 3, 3, 1); __PYX_ERR(48, 187, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conePoint)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("insertCone", 1, 3, 3, 2); __PYX_ERR(48, 187, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertCone") < 0)) __PYX_ERR(48, 187, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_p = values[0]; __pyx_v_conePos = values[1]; __pyx_v_conePoint = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertCone", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 187, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_32insertCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_conePos, __pyx_v_conePoint); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_32insertCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_conePoint) { PetscInt __pyx_v_cp; PetscInt __pyx_v_cconePos; PetscInt __pyx_v_cconePoint; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertCone", 0); /* "PETSc/DMPlex.pyx":188 * * def insertCone(self, p, conePos, conePoint): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconePoint = asInt(conePoint) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 188, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":189 * def insertCone(self, p, conePos, conePoint): * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) # <<<<<<<<<<<<<< * cdef PetscInt cconePoint = asInt(conePoint) * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_conePos); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 189, __pyx_L1_error) __pyx_v_cconePos = __pyx_t_1; /* "PETSc/DMPlex.pyx":190 * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconePoint = asInt(conePoint) # <<<<<<<<<<<<<< * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_conePoint); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 190, __pyx_L1_error) __pyx_v_cconePoint = __pyx_t_1; /* "PETSc/DMPlex.pyx":191 * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconePoint = asInt(conePoint) * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) # <<<<<<<<<<<<<< * * def insertConeOrientation(self, p, conePos, coneOrientation): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexInsertCone(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cconePos, __pyx_v_cconePoint)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 191, __pyx_L1_error) /* "PETSc/DMPlex.pyx":187 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def insertCone(self, p, conePos, conePoint): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertCone", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":193 * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) * * def insertConeOrientation(self, p, conePos, coneOrientation): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_35insertConeOrientation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_34insertConeOrientation[] = "DMPlex.insertConeOrientation(self, p, conePos, coneOrientation)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_35insertConeOrientation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_conePos = 0; PyObject *__pyx_v_coneOrientation = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertConeOrientation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_conePos,&__pyx_n_s_coneOrientation,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conePos)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("insertConeOrientation", 1, 3, 3, 1); __PYX_ERR(48, 193, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coneOrientation)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("insertConeOrientation", 1, 3, 3, 2); __PYX_ERR(48, 193, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertConeOrientation") < 0)) __PYX_ERR(48, 193, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_p = values[0]; __pyx_v_conePos = values[1]; __pyx_v_coneOrientation = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertConeOrientation", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 193, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_34insertConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_conePos, __pyx_v_coneOrientation); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_34insertConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_conePos, PyObject *__pyx_v_coneOrientation) { PetscInt __pyx_v_cp; PetscInt __pyx_v_cconePos; PetscInt __pyx_v_cconeOrientation; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertConeOrientation", 0); /* "PETSc/DMPlex.pyx":194 * * def insertConeOrientation(self, p, conePos, coneOrientation): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconeOrientation = asInt(coneOrientation) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 194, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":195 * def insertConeOrientation(self, p, conePos, coneOrientation): * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) # <<<<<<<<<<<<<< * cdef PetscInt cconeOrientation = asInt(coneOrientation) * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_conePos); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 195, __pyx_L1_error) __pyx_v_cconePos = __pyx_t_1; /* "PETSc/DMPlex.pyx":196 * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconeOrientation = asInt(coneOrientation) # <<<<<<<<<<<<<< * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_coneOrientation); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 196, __pyx_L1_error) __pyx_v_cconeOrientation = __pyx_t_1; /* "PETSc/DMPlex.pyx":197 * cdef PetscInt cconePos = asInt(conePos) * cdef PetscInt cconeOrientation = asInt(coneOrientation) * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) # <<<<<<<<<<<<<< * * def getConeOrientation(self, p): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexInsertConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cconePos, __pyx_v_cconeOrientation)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 197, __pyx_L1_error) /* "PETSc/DMPlex.pyx":193 * CHKERR( DMPlexInsertCone(self.dm,cp,cconePos,cconePoint) ) * * def insertConeOrientation(self, p, conePos, coneOrientation): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt cconePos = asInt(conePos) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.insertConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":199 * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) * * def getConeOrientation(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_37getConeOrientation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_36getConeOrientation[] = "DMPlex.getConeOrientation(self, p)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_37getConeOrientation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getConeOrientation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getConeOrientation") < 0)) __PYX_ERR(48, 199, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getConeOrientation", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 199, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_36getConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_36getConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_norie; PetscInt const *__pyx_v_iorie; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getConeOrientation", 0); /* "PETSc/DMPlex.pyx":200 * * def getConeOrientation(self, p): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 200, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":201 * def getConeOrientation(self, p): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 202, __pyx_L1_error) /* "PETSc/DMPlex.pyx":203 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 203, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":204 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_norie))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 206, __pyx_L1_error) /* "PETSc/DMPlex.pyx":207 * cdef const PetscInt *iorie = NULL * CHKERR( DMPlexGetConeSize(self.dm, cp, &norie) ) * CHKERR( DMPlexGetConeOrientation(self.dm, cp, &iorie) ) # <<<<<<<<<<<<<< * return array_i(norie, iorie) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_iorie))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 207, __pyx_L1_error) /* "PETSc/DMPlex.pyx":208 * CHKERR( DMPlexGetConeSize(self.dm, cp, &norie) ) * CHKERR( DMPlexGetConeOrientation(self.dm, cp, &iorie) ) * return array_i(norie, iorie) # <<<<<<<<<<<<<< * * def setConeOrientation(self, p, orientation): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_norie, __pyx_v_iorie)); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":199 * CHKERR( DMPlexInsertConeOrientation(self.dm, cp, cconePos, cconeOrientation) ) * * def getConeOrientation(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":210 * return array_i(norie, iorie) * * def setConeOrientation(self, p, orientation): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_39setConeOrientation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_38setConeOrientation[] = "DMPlex.setConeOrientation(self, p, orientation)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_39setConeOrientation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_orientation = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setConeOrientation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_orientation,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orientation)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setConeOrientation", 1, 2, 2, 1); __PYX_ERR(48, 210, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setConeOrientation") < 0)) __PYX_ERR(48, 210, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_orientation = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setConeOrientation", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 210, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_38setConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_orientation); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_38setConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_orientation) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ncone; PetscInt __pyx_v_norie; PetscInt *__pyx_v_iorie; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setConeOrientation", 0); __Pyx_INCREF(__pyx_v_orientation); /* "PETSc/DMPlex.pyx":211 * * def setConeOrientation(self, p, orientation): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 211, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":212 * def setConeOrientation(self, p, orientation): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 213, __pyx_L1_error) /* "PETSc/DMPlex.pyx":214 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 214, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":215 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ncone))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 216, __pyx_L1_error) /* "PETSc/DMPlex.pyx":217 * cdef PetscInt ncone = 0 * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * cdef PetscInt norie = 0 # <<<<<<<<<<<<<< * cdef PetscInt *iorie = NULL * orientation = iarray_i(orientation, &norie, &iorie) */ __pyx_v_norie = 0; /* "PETSc/DMPlex.pyx":218 * CHKERR( DMPlexGetConeSize(self.dm, cp, &ncone) ) * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL # <<<<<<<<<<<<<< * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone */ __pyx_v_iorie = NULL; /* "PETSc/DMPlex.pyx":219 * cdef PetscInt norie = 0 * cdef PetscInt *iorie = NULL * orientation = iarray_i(orientation, &norie, &iorie) # <<<<<<<<<<<<<< * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_orientation, (&__pyx_v_norie), (&__pyx_v_iorie))); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_orientation, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/DMPlex.pyx":220 * cdef PetscInt *iorie = NULL * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone # <<<<<<<<<<<<<< * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_norie == __pyx_v_ncone) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 220, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":221 * orientation = iarray_i(orientation, &norie, &iorie) * assert norie == ncone * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) # <<<<<<<<<<<<<< * * def getSupportSize(self, p): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetConeOrientation(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_iorie)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 221, __pyx_L1_error) /* "PETSc/DMPlex.pyx":210 * return array_i(norie, iorie) * * def setConeOrientation(self, p, orientation): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setConeOrientation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_orientation); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":223 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def getSupportSize(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_41getSupportSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_40getSupportSize[] = "DMPlex.getSupportSize(self, p)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_41getSupportSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSupportSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSupportSize") < 0)) __PYX_ERR(48, 223, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSupportSize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 223, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_40getSupportSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_40getSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ssize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSupportSize", 0); /* "PETSc/DMPlex.pyx":224 * * def getSupportSize(self, p): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 224, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":225 * def getSupportSize(self, p): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 226, __pyx_L1_error) /* "PETSc/DMPlex.pyx":227 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 227, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":228 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ssize))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 229, __pyx_L1_error) /* "PETSc/DMPlex.pyx":230 * cdef PetscInt ssize = 0 * CHKERR( DMPlexGetSupportSize(self.dm, cp, &ssize) ) * return toInt(ssize) # <<<<<<<<<<<<<< * * def setSupportSize(self, p, size): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ssize); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":223 * CHKERR( DMPlexSetConeOrientation(self.dm, cp, iorie) ) * * def getSupportSize(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":232 * return toInt(ssize) * * def setSupportSize(self, p, size): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_43setSupportSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_42setSupportSize[] = "DMPlex.setSupportSize(self, p, size)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_43setSupportSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_size = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSupportSize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_size,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setSupportSize", 1, 2, 2, 1); __PYX_ERR(48, 232, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSupportSize") < 0)) __PYX_ERR(48, 232, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_size = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSupportSize", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 232, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_42setSupportSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_size); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_42setSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_ssize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSupportSize", 0); /* "PETSc/DMPlex.pyx":233 * * def setSupportSize(self, p, size): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 233, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":234 * def setSupportSize(self, p, size): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 235, __pyx_L1_error) /* "PETSc/DMPlex.pyx":236 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 236, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":237 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_ssize)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 238, __pyx_L1_error) /* "PETSc/DMPlex.pyx":232 * return toInt(ssize) * * def setSupportSize(self, p, size): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupportSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":240 * CHKERR( DMPlexSetSupportSize(self.dm, cp, ssize) ) * * def getSupport(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getSupport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_44getSupport[] = "DMPlex.getSupport(self, p)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getSupport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSupport (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getSupport") < 0)) __PYX_ERR(48, 240, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getSupport", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 240, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_44getSupport(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_44getSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_nsupp; PetscInt const *__pyx_v_isupp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSupport", 0); /* "PETSc/DMPlex.pyx":241 * * def getSupport(self, p): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 241, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":242 * def getSupport(self, p): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 243, __pyx_L1_error) /* "PETSc/DMPlex.pyx":244 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 244, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":245 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, (&__pyx_v_nsupp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 247, __pyx_L1_error) /* "PETSc/DMPlex.pyx":248 * cdef const PetscInt *isupp = NULL * CHKERR( DMPlexGetSupportSize(self.dm, cp, &nsupp) ) * CHKERR( DMPlexGetSupport(self.dm, cp, &isupp) ) # <<<<<<<<<<<<<< * return array_i(nsupp, isupp) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetSupport(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_isupp))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 248, __pyx_L1_error) /* "PETSc/DMPlex.pyx":249 * CHKERR( DMPlexGetSupportSize(self.dm, cp, &nsupp) ) * CHKERR( DMPlexGetSupport(self.dm, cp, &isupp) ) * return array_i(nsupp, isupp) # <<<<<<<<<<<<<< * * def setSupport(self, p, supp): */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nsupp, __pyx_v_isupp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":240 * CHKERR( DMPlexSetSupportSize(self.dm, cp, ssize) ) * * def getSupport(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":251 * return array_i(nsupp, isupp) * * def setSupport(self, p, supp): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_47setSupport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_46setSupport[] = "DMPlex.setSupport(self, p, supp)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_47setSupport(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_supp = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSupport (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_supp,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_supp)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setSupport", 1, 2, 2, 1); __PYX_ERR(48, 251, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setSupport") < 0)) __PYX_ERR(48, 251, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_p = values[0]; __pyx_v_supp = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setSupport", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 251, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_46setSupport(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_supp); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_46setSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_supp) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscInt __pyx_v_nsupp; PetscInt *__pyx_v_isupp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setSupport", 0); __Pyx_INCREF(__pyx_v_supp); /* "PETSc/DMPlex.pyx":252 * * def setSupport(self, p, supp): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 252, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":253 * def setSupport(self, p, supp): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 254, __pyx_L1_error) /* "PETSc/DMPlex.pyx":255 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 255, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":256 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_nsupp)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 259, __pyx_L1_error) /* "PETSc/DMPlex.pyx":260 * supp = iarray_i(supp, &nsupp, &isupp) * CHKERR( DMPlexSetSupportSize(self.dm, cp, nsupp) ) * CHKERR( DMPlexSetSupport(self.dm, cp, isupp) ) # <<<<<<<<<<<<<< * * def getMaxSizes(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetSupport(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_isupp)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 260, __pyx_L1_error) /* "PETSc/DMPlex.pyx":251 * return array_i(nsupp, isupp) * * def setSupport(self, p, supp): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setSupport", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_supp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":262 * CHKERR( DMPlexSetSupport(self.dm, cp, isupp) ) * * def getMaxSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_49getMaxSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_48getMaxSizes[] = "DMPlex.getMaxSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_49getMaxSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMaxSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getMaxSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getMaxSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_48getMaxSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_48getMaxSizes(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_maxConeSize; PetscInt __pyx_v_maxSupportSize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMaxSizes", 0); /* "PETSc/DMPlex.pyx":263 * * def getMaxSizes(self): * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) * return toInt(maxConeSize), toInt(maxSupportSize) */ __pyx_v_maxConeSize = 0; __pyx_v_maxSupportSize = 0; /* "PETSc/DMPlex.pyx":264 * def getMaxSizes(self): * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) # <<<<<<<<<<<<<< * return toInt(maxConeSize), toInt(maxSupportSize) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetMaxSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_maxConeSize), (&__pyx_v_maxSupportSize))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 264, __pyx_L1_error) /* "PETSc/DMPlex.pyx":265 * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) * return toInt(maxConeSize), toInt(maxSupportSize) # <<<<<<<<<<<<<< * * def symmetrize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_maxConeSize); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_maxSupportSize); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":262 * CHKERR( DMPlexSetSupport(self.dm, cp, isupp) ) * * def getMaxSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt maxConeSize = 0, maxSupportSize = 0 * CHKERR( DMPlexGetMaxSizes(self.dm, &maxConeSize, &maxSupportSize) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMaxSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":267 * return toInt(maxConeSize), toInt(maxSupportSize) * * def symmetrize(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexSymmetrize(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_51symmetrize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_50symmetrize[] = "DMPlex.symmetrize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_51symmetrize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("symmetrize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("symmetrize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "symmetrize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_50symmetrize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_50symmetrize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("symmetrize", 0); /* "PETSc/DMPlex.pyx":268 * * def symmetrize(self): * CHKERR( DMPlexSymmetrize(self.dm) ) # <<<<<<<<<<<<<< * * def stratify(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSymmetrize(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 268, __pyx_L1_error) /* "PETSc/DMPlex.pyx":267 * return toInt(maxConeSize), toInt(maxSupportSize) * * def symmetrize(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexSymmetrize(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.symmetrize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":270 * CHKERR( DMPlexSymmetrize(self.dm) ) * * def stratify(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexStratify(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_53stratify(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_52stratify[] = "DMPlex.stratify(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_53stratify(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stratify (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("stratify", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "stratify", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_52stratify(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_52stratify(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("stratify", 0); /* "PETSc/DMPlex.pyx":271 * * def stratify(self): * CHKERR( DMPlexStratify(self.dm) ) # <<<<<<<<<<<<<< * * def orient(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexStratify(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 271, __pyx_L1_error) /* "PETSc/DMPlex.pyx":270 * CHKERR( DMPlexSymmetrize(self.dm) ) * * def stratify(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexStratify(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.stratify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":273 * CHKERR( DMPlexStratify(self.dm) ) * * def orient(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexOrient(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_55orient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_54orient[] = "DMPlex.orient(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_55orient(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("orient (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("orient", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "orient", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_54orient(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_54orient(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("orient", 0); /* "PETSc/DMPlex.pyx":274 * * def orient(self): * CHKERR( DMPlexOrient(self.dm) ) # <<<<<<<<<<<<<< * * def getCellNumbering(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexOrient(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 274, __pyx_L1_error) /* "PETSc/DMPlex.pyx":273 * CHKERR( DMPlexStratify(self.dm) ) * * def orient(self): # <<<<<<<<<<<<<< * CHKERR( DMPlexOrient(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.orient", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":276 * CHKERR( DMPlexOrient(self.dm) ) * * def getCellNumbering(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_57getCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_56getCellNumbering[] = "DMPlex.getCellNumbering(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_57getCellNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCellNumbering (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCellNumbering", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCellNumbering", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_56getCellNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_56getCellNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCellNumbering", 0); /* "PETSc/DMPlex.pyx":277 * * def getCellNumbering(self): * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) * PetscINCREF(iset.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":278 * def getCellNumbering(self): * cdef IS iset = IS() * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) # <<<<<<<<<<<<<< * PetscINCREF(iset.obj) * return iset */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCellNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 278, __pyx_L1_error) /* "PETSc/DMPlex.pyx":279 * cdef IS iset = IS() * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) * PetscINCREF(iset.obj) # <<<<<<<<<<<<<< * return iset * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); /* "PETSc/DMPlex.pyx":280 * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) * PetscINCREF(iset.obj) * return iset # <<<<<<<<<<<<<< * * def getVertexNumbering(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_iset)); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "PETSc/DMPlex.pyx":276 * CHKERR( DMPlexOrient(self.dm) ) * * def getCellNumbering(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMPlexGetCellNumbering(self.dm, &iset.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getCellNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":282 * return iset * * def getVertexNumbering(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_59getVertexNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_58getVertexNumbering[] = "DMPlex.getVertexNumbering(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_59getVertexNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVertexNumbering (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getVertexNumbering", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getVertexNumbering", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_58getVertexNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_58getVertexNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVertexNumbering", 0); /* "PETSc/DMPlex.pyx":283 * * def getVertexNumbering(self): * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) * PetscINCREF(iset.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":284 * def getVertexNumbering(self): * cdef IS iset = IS() * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) # <<<<<<<<<<<<<< * PetscINCREF(iset.obj) * return iset */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetVertexNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 284, __pyx_L1_error) /* "PETSc/DMPlex.pyx":285 * cdef IS iset = IS() * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) * PetscINCREF(iset.obj) # <<<<<<<<<<<<<< * return iset * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); /* "PETSc/DMPlex.pyx":286 * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) * PetscINCREF(iset.obj) * return iset # <<<<<<<<<<<<<< * * def createPointNumbering(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_iset)); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "PETSc/DMPlex.pyx":282 * return iset * * def getVertexNumbering(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMPlexGetVertexNumbering(self.dm, &iset.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getVertexNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":288 * return iset * * def createPointNumbering(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_61createPointNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_60createPointNumbering[] = "DMPlex.createPointNumbering(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_61createPointNumbering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createPointNumbering (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createPointNumbering", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createPointNumbering", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_60createPointNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_60createPointNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createPointNumbering", 0); /* "PETSc/DMPlex.pyx":289 * * def createPointNumbering(self): * cdef IS iset = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) * return iset */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":290 * def createPointNumbering(self): * cdef IS iset = IS() * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) # <<<<<<<<<<<<<< * return iset * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreatePointNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 290, __pyx_L1_error) /* "PETSc/DMPlex.pyx":291 * cdef IS iset = IS() * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) * return iset # <<<<<<<<<<<<<< * * def getDepth(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_iset)); __pyx_r = ((PyObject *)__pyx_v_iset); goto __pyx_L0; /* "PETSc/DMPlex.pyx":288 * return iset * * def createPointNumbering(self): # <<<<<<<<<<<<<< * cdef IS iset = IS() * CHKERR( DMPlexCreatePointNumbering(self.dm, &iset.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createPointNumbering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_iset); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":293 * return iset * * def getDepth(self): # <<<<<<<<<<<<<< * cdef PetscInt depth = 0 * CHKERR( DMPlexGetDepth(self.dm,&depth) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_63getDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_62getDepth[] = "DMPlex.getDepth(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_63getDepth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDepth (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDepth", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDepth", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_62getDepth(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_62getDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscInt __pyx_v_depth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDepth", 0); /* "PETSc/DMPlex.pyx":294 * * def getDepth(self): * cdef PetscInt depth = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetDepth(self.dm,&depth) ) * return toInt(depth) */ __pyx_v_depth = 0; /* "PETSc/DMPlex.pyx":295 * def getDepth(self): * cdef PetscInt depth = 0 * CHKERR( DMPlexGetDepth(self.dm,&depth) ) # <<<<<<<<<<<<<< * return toInt(depth) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetDepth(__pyx_v_self->__pyx_base.dm, (&__pyx_v_depth))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 295, __pyx_L1_error) /* "PETSc/DMPlex.pyx":296 * cdef PetscInt depth = 0 * CHKERR( DMPlexGetDepth(self.dm,&depth) ) * return toInt(depth) # <<<<<<<<<<<<<< * * def getDepthStratum(self, svalue): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_depth); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 296, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":293 * return iset * * def getDepth(self): # <<<<<<<<<<<<<< * cdef PetscInt depth = 0 * CHKERR( DMPlexGetDepth(self.dm,&depth) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getDepth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":298 * return toInt(depth) * * def getDepthStratum(self, svalue): # <<<<<<<<<<<<<< * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_65getDepthStratum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_64getDepthStratum[] = "DMPlex.getDepthStratum(self, svalue)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_65getDepthStratum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_svalue = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDepthStratum (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_svalue,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_svalue)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getDepthStratum") < 0)) __PYX_ERR(48, 298, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_svalue = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getDepthStratum", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 298, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getDepthStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_64getDepthStratum(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_svalue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_64getDepthStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue) { PetscInt __pyx_v_csvalue; PetscInt __pyx_v_sStart; PetscInt __pyx_v_sEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDepthStratum", 0); /* "PETSc/DMPlex.pyx":299 * * def getDepthStratum(self, svalue): * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_svalue); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 299, __pyx_L1_error) __pyx_v_csvalue = __pyx_t_1; __pyx_v_sStart = 0; __pyx_v_sEnd = 0; /* "PETSc/DMPlex.pyx":300 * def getDepthStratum(self, svalue): * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) # <<<<<<<<<<<<<< * return (toInt(sStart), toInt(sEnd)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetDepthStratum(__pyx_v_self->__pyx_base.dm, __pyx_v_csvalue, (&__pyx_v_sStart), (&__pyx_v_sEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 300, __pyx_L1_error) /* "PETSc/DMPlex.pyx":301 * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) # <<<<<<<<<<<<<< * * def getHeightStratum(self, svalue): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sStart); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sEnd); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":298 * return toInt(depth) * * def getDepthStratum(self, svalue): # <<<<<<<<<<<<<< * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetDepthStratum(self.dm, csvalue, &sStart, &sEnd) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getDepthStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":303 * return (toInt(sStart), toInt(sEnd)) * * def getHeightStratum(self, svalue): # <<<<<<<<<<<<<< * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_67getHeightStratum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_66getHeightStratum[] = "DMPlex.getHeightStratum(self, svalue)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_67getHeightStratum(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_svalue = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getHeightStratum (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_svalue,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_svalue)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getHeightStratum") < 0)) __PYX_ERR(48, 303, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_svalue = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getHeightStratum", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 303, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getHeightStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_66getHeightStratum(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_svalue); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_66getHeightStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue) { PetscInt __pyx_v_csvalue; PetscInt __pyx_v_sStart; PetscInt __pyx_v_sEnd; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getHeightStratum", 0); /* "PETSc/DMPlex.pyx":304 * * def getHeightStratum(self, svalue): * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_svalue); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 304, __pyx_L1_error) __pyx_v_csvalue = __pyx_t_1; __pyx_v_sStart = 0; __pyx_v_sEnd = 0; /* "PETSc/DMPlex.pyx":305 * def getHeightStratum(self, svalue): * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) # <<<<<<<<<<<<<< * return (toInt(sStart), toInt(sEnd)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetHeightStratum(__pyx_v_self->__pyx_base.dm, __pyx_v_csvalue, (&__pyx_v_sStart), (&__pyx_v_sEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 305, __pyx_L1_error) /* "PETSc/DMPlex.pyx":306 * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) * return (toInt(sStart), toInt(sEnd)) # <<<<<<<<<<<<<< * * def getMeet(self, points): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sStart); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_sEnd); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":303 * return (toInt(sStart), toInt(sEnd)) * * def getHeightStratum(self, svalue): # <<<<<<<<<<<<<< * cdef PetscInt csvalue = asInt(svalue), sStart = 0, sEnd = 0 * CHKERR( DMPlexGetHeightStratum(self.dm, csvalue, &sStart, &sEnd) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getHeightStratum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":308 * return (toInt(sStart), toInt(sEnd)) * * def getMeet(self, points): # <<<<<<<<<<<<<< * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_69getMeet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_68getMeet[] = "DMPlex.getMeet(self, points)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_69getMeet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_points = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getMeet (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_points,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getMeet") < 0)) __PYX_ERR(48, 308, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_points = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getMeet", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 308, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMeet", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_68getMeet(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_68getMeet(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points) { PetscInt __pyx_v_numPoints; PetscInt *__pyx_v_ipoints; PetscInt __pyx_v_numCoveringPoints; PetscInt const *__pyx_v_coveringPoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getMeet", 0); __Pyx_INCREF(__pyx_v_points); /* "PETSc/DMPlex.pyx":309 * * def getMeet(self, points): * cdef PetscInt numPoints = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 */ __pyx_v_numPoints = 0; /* "PETSc/DMPlex.pyx":310 * def getMeet(self, points): * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL # <<<<<<<<<<<<<< * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL */ __pyx_v_ipoints = NULL; /* "PETSc/DMPlex.pyx":311 * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) */ __pyx_v_numCoveringPoints = 0; /* "PETSc/DMPlex.pyx":312 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL # <<<<<<<<<<<<<< * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __pyx_v_coveringPoints = NULL; /* "PETSc/DMPlex.pyx":313 * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, (&__pyx_v_numPoints), (&__pyx_v_ipoints))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":314 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * try: * return array_i(numCoveringPoints, coveringPoints) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetMeet(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 314, __pyx_L1_error) /* "PETSc/DMPlex.pyx":315 * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: # <<<<<<<<<<<<<< * return array_i(numCoveringPoints, coveringPoints) * finally: */ /*try:*/ { /* "PETSc/DMPlex.pyx":316 * CHKERR( DMPlexGetMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: * return array_i(numCoveringPoints, coveringPoints) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numCoveringPoints, __pyx_v_coveringPoints)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 316, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L3_return; } /* "PETSc/DMPlex.pyx":318 * return array_i(numCoveringPoints, coveringPoints) * finally: * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * * def getJoin(self, points): */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreMeet(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(48, 318, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_10 = __pyx_r; __pyx_r = 0; __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreMeet(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(48, 318, __pyx_L1_error) __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; } } /* "PETSc/DMPlex.pyx":308 * return (toInt(sStart), toInt(sEnd)) * * def getMeet(self, points): # <<<<<<<<<<<<<< * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMeet", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":320 * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getJoin(self, points): # <<<<<<<<<<<<<< * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getJoin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_70getJoin[] = "DMPlex.getJoin(self, points)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getJoin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_points = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getJoin (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_points,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getJoin") < 0)) __PYX_ERR(48, 320, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_points = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getJoin", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 320, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getJoin", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_70getJoin(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_70getJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points) { PetscInt __pyx_v_numPoints; PetscInt *__pyx_v_ipoints; PetscInt __pyx_v_numCoveringPoints; PetscInt const *__pyx_v_coveringPoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; char const *__pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getJoin", 0); __Pyx_INCREF(__pyx_v_points); /* "PETSc/DMPlex.pyx":321 * * def getJoin(self, points): * cdef PetscInt numPoints = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 */ __pyx_v_numPoints = 0; /* "PETSc/DMPlex.pyx":322 * def getJoin(self, points): * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL # <<<<<<<<<<<<<< * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL */ __pyx_v_ipoints = NULL; /* "PETSc/DMPlex.pyx":323 * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 # <<<<<<<<<<<<<< * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) */ __pyx_v_numCoveringPoints = 0; /* "PETSc/DMPlex.pyx":324 * cdef PetscInt *ipoints = NULL * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL # <<<<<<<<<<<<<< * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __pyx_v_coveringPoints = NULL; /* "PETSc/DMPlex.pyx":325 * cdef PetscInt numCoveringPoints = 0 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, (&__pyx_v_numPoints), (&__pyx_v_ipoints))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":326 * cdef const PetscInt *coveringPoints = NULL * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * try: * return array_i(numCoveringPoints, coveringPoints) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 326, __pyx_L1_error) /* "PETSc/DMPlex.pyx":327 * points = iarray_i(points, &numPoints, &ipoints) * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: # <<<<<<<<<<<<<< * return array_i(numCoveringPoints, coveringPoints) * finally: */ /*try:*/ { /* "PETSc/DMPlex.pyx":328 * CHKERR( DMPlexGetJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * try: * return array_i(numCoveringPoints, coveringPoints) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numCoveringPoints, __pyx_v_coveringPoints)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 328, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L3_return; } /* "PETSc/DMPlex.pyx":330 * return array_i(numCoveringPoints, coveringPoints) * finally: * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) # <<<<<<<<<<<<<< * * def getTransitiveClosure(self, p, useCone=True): */ /*finally:*/ { __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0)) __Pyx_ErrFetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __pyx_t_2 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_4 = __pyx_filename; { __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(48, 330, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_4; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10); } __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; goto __pyx_L1_error; } __pyx_L3_return: { __pyx_t_10 = __pyx_r; __pyx_r = 0; __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreJoin(__pyx_v_self->__pyx_base.dm, __pyx_v_numPoints, __pyx_v_ipoints, (&__pyx_v_numCoveringPoints), (&__pyx_v_coveringPoints))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(48, 330, __pyx_L1_error) __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; } } /* "PETSc/DMPlex.pyx":320 * CHKERR( DMPlexRestoreMeet(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getJoin(self, points): # <<<<<<<<<<<<<< * cdef PetscInt numPoints = 0 * cdef PetscInt *ipoints = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getJoin", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":332 * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getTransitiveClosure(self, p, useCone=True): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getTransitiveClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_72getTransitiveClosure[] = "DMPlex.getTransitiveClosure(self, p, useCone=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getTransitiveClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; PyObject *__pyx_v_useCone = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getTransitiveClosure (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_useCone,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_useCone); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getTransitiveClosure") < 0)) __PYX_ERR(48, 332, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_p = values[0]; __pyx_v_useCone = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getTransitiveClosure", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 332, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getTransitiveClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_72getTransitiveClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_useCone); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_72getTransitiveClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_useCone) { PetscInt __pyx_v_cp; PetscInt __pyx_v_pStart; PetscInt __pyx_v_pEnd; PetscBool __pyx_v_cuseCone; PetscInt __pyx_v_numPoints; PetscInt *__pyx_v_points; PyArrayObject *__pyx_v_out = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PetscBool __pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; char const *__pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; int __pyx_t_15; PyObject *__pyx_t_16 = NULL; PyObject *__pyx_t_17 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getTransitiveClosure", 0); /* "PETSc/DMPlex.pyx":333 * * def getTransitiveClosure(self, p, useCone=True): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 333, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":334 * def getTransitiveClosure(self, p, useCone=True): * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 335, __pyx_L1_error) /* "PETSc/DMPlex.pyx":336 * cdef PetscInt pStart = 0, pEnd = 0 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp= __pyx_v_pStart) != 0); if (__pyx_t_4) { } else { __pyx_t_3 = __pyx_t_4; goto __pyx_L3_bool_binop_done; } __pyx_t_4 = ((__pyx_v_cp < __pyx_v_pEnd) != 0); __pyx_t_3 = __pyx_t_4; __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_3)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 336, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":337 * CHKERR( DMPlexGetChart(self.dm, &pStart, &pEnd) ) * assert cp>=pStart and cp=pStart and cp__pyx_base.dm, __pyx_v_cp, __pyx_v_cuseCone, (&__pyx_v_numPoints), (&__pyx_v_points))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 340, __pyx_L1_error) /* "PETSc/DMPlex.pyx":341 * cdef PetscInt *points = NULL * CHKERR( DMPlexGetTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * try: # <<<<<<<<<<<<<< * out = array_i(2*numPoints,points) * finally: */ /*try:*/ { /* "PETSc/DMPlex.pyx":342 * CHKERR( DMPlexGetTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * try: * out = array_i(2*numPoints,points) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i((2 * __pyx_v_numPoints), __pyx_v_points)); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 342, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_out = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; } /* "PETSc/DMPlex.pyx":344 * out = array_i(2*numPoints,points) * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) # <<<<<<<<<<<<<< * return out[::2],out[1::2] * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreTransitiveClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cuseCone, (&__pyx_v_numPoints), (&__pyx_v_points))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 344, __pyx_L1_error) goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __pyx_t_2 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; { __pyx_t_15 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRestoreTransitiveClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_cuseCone, (&__pyx_v_numPoints), (&__pyx_v_points))); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(48, 344, __pyx_L9_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); } __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; goto __pyx_L1_error; __pyx_L9_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); } __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; goto __pyx_L1_error; } __pyx_L7:; } /* "PETSc/DMPlex.pyx":345 * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * return out[::2],out[1::2] # <<<<<<<<<<<<<< * * def vecGetClosure(self, Section sec, Vec vec, p): */ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_out), __pyx_slice__48); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_out), __pyx_slice__49); if (unlikely(!__pyx_t_16)) __PYX_ERR(48, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(48, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16); __pyx_t_6 = 0; __pyx_t_16 = 0; __pyx_r = __pyx_t_17; __pyx_t_17 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":332 * CHKERR( DMPlexRestoreJoin(self.dm, numPoints, ipoints, &numCoveringPoints, &coveringPoints) ) * * def getTransitiveClosure(self, p, useCone=True): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt pStart = 0, pEnd = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_17); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getTransitiveClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_out); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":347 * return out[::2],out[1::2] * * def vecGetClosure(self, Section sec, Vec vec, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p), csize = 0 * cdef PetscScalar *cvals = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_75vecGetClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_74vecGetClosure[] = "DMPlex.vecGetClosure(self, Section sec, Vec vec, p)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_75vecGetClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_p = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vecGetClosure (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_p,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vecGetClosure", 1, 3, 3, 1); __PYX_ERR(48, 347, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vecGetClosure", 1, 3, 3, 2); __PYX_ERR(48, 347, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vecGetClosure") < 0)) __PYX_ERR(48, 347, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_p = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vecGetClosure", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 347, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.vecGetClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(48, 347, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(48, 347, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_74vecGetClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_vec, __pyx_v_p); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_74vecGetClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; PyArrayObject *__pyx_v_closure = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vecGetClosure", 0); /* "PETSc/DMPlex.pyx":348 * * def vecGetClosure(self, Section sec, Vec vec, p): * cdef PetscInt cp = asInt(p), csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 348, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; __pyx_v_csize = 0; /* "PETSc/DMPlex.pyx":349 * def vecGetClosure(self, Section sec, Vec vec, p): * cdef PetscInt cp = asInt(p), csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * try: */ __pyx_v_cvals = NULL; /* "PETSc/DMPlex.pyx":350 * cdef PetscInt cp = asInt(p), csize = 0 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * try: * closure = array_s(csize, cvals) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecGetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 350, __pyx_L1_error) /* "PETSc/DMPlex.pyx":351 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * try: # <<<<<<<<<<<<<< * closure = array_s(csize, cvals) * finally: */ /*try:*/ { /* "PETSc/DMPlex.pyx":352 * CHKERR( DMPlexVecGetClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * try: * closure = array_s(csize, cvals) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s(__pyx_v_csize, __pyx_v_cvals)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 352, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_closure = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMPlex.pyx":354 * closure = array_s(csize, cvals) * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * return closure * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 354, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_2 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(48, 354, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/DMPlex.pyx":355 * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, sec.sec, vec.vec, cp, &csize, &cvals) ) * return closure # <<<<<<<<<<<<<< * * def getVecClosure(self, Section sec or None, Vec vec, point): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_closure)); __pyx_r = ((PyObject *)__pyx_v_closure); goto __pyx_L0; /* "PETSc/DMPlex.pyx":347 * return out[::2],out[1::2] * * def vecGetClosure(self, Section sec, Vec vec, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p), csize = 0 * cdef PetscScalar *cvals = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.vecGetClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_closure); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":357 * return closure * * def getVecClosure(self, Section sec or None, Vec vec, point): # <<<<<<<<<<<<<< * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point), csize = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getVecClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_76getVecClosure[] = "DMPlex.getVecClosure(self, Section sec, Vec vec, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getVecClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecClosure (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_point,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getVecClosure", 1, 3, 3, 1); __PYX_ERR(48, 357, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getVecClosure", 1, 3, 3, 2); __PYX_ERR(48, 357, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getVecClosure") < 0)) __PYX_ERR(48, 357, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_point = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVecClosure", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 357, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(48, 357, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(48, 357, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_76getVecClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_vec, __pyx_v_point); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_76getVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point) { PetscSection __pyx_v_csec; PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; PyArrayObject *__pyx_v_closure = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; char const *__pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; int __pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecClosure", 0); /* "PETSc/DMPlex.pyx":358 * * def getVecClosure(self, Section sec or None, Vec vec, point): * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(point), csize = 0 * cdef PetscScalar *cvals = NULL */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "PETSc/DMPlex.pyx":359 * def getVecClosure(self, Section sec or None, Vec vec, point): * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point), csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 359, __pyx_L1_error) __pyx_v_cp = __pyx_t_3; __pyx_v_csize = 0; /* "PETSc/DMPlex.pyx":360 * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point), csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * try: */ __pyx_v_cvals = NULL; /* "PETSc/DMPlex.pyx":361 * cdef PetscInt cp = asInt(point), csize = 0 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * try: * closure = array_s(csize, cvals) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecGetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 361, __pyx_L1_error) /* "PETSc/DMPlex.pyx":362 * cdef PetscScalar *cvals = NULL * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * try: # <<<<<<<<<<<<<< * closure = array_s(csize, cvals) * finally: */ /*try:*/ { /* "PETSc/DMPlex.pyx":363 * CHKERR( DMPlexVecGetClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * try: * closure = array_s(csize, cvals) # <<<<<<<<<<<<<< * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s(__pyx_v_csize, __pyx_v_cvals)); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 363, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_closure = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0; } /* "PETSc/DMPlex.pyx":365 * closure = array_s(csize, cvals) * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) # <<<<<<<<<<<<<< * return closure * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 365, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); __pyx_t_4 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; { __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecRestoreClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(48, 365, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); } __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/DMPlex.pyx":366 * finally: * CHKERR( DMPlexVecRestoreClosure(self.dm, csec, vec.vec, cp, &csize, &cvals) ) * return closure # <<<<<<<<<<<<<< * * def setVecClosure(self, Section sec or None, Vec vec, point, values, addv=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_closure)); __pyx_r = ((PyObject *)__pyx_v_closure); goto __pyx_L0; /* "PETSc/DMPlex.pyx":357 * return closure * * def getVecClosure(self, Section sec or None, Vec vec, point): # <<<<<<<<<<<<<< * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point), csize = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_closure); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":368 * return closure * * def setVecClosure(self, Section sec or None, Vec vec, point, values, addv=None): # <<<<<<<<<<<<<< * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_79setVecClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_78setVecClosure[] = "DMPlex.setVecClosure(self, Section sec, Vec vec, point, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_79setVecClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setVecClosure (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_point,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[5] = {0,0,0,0,0}; values[4] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, 1); __PYX_ERR(48, 368, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, 2); __PYX_ERR(48, 368, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, 3); __PYX_ERR(48, 368, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setVecClosure") < 0)) __PYX_ERR(48, 368, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_vec = ((struct PyPetscVecObject *)values[1]); __pyx_v_point = values[2]; __pyx_v_values = values[3]; __pyx_v_addv = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 368, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(48, 368, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(48, 368, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_78setVecClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_vec, __pyx_v_point, __pyx_v_values, __pyx_v_addv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_78setVecClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PetscSection __pyx_v_csec; PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; InsertMode __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setVecClosure", 0); /* "PETSc/DMPlex.pyx":369 * * def setVecClosure(self, Section sec or None, Vec vec, point, values, addv=None): * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "PETSc/DMPlex.pyx":370 * def setVecClosure(self, Section sec or None, Vec vec, point, values, addv=None): * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 370, __pyx_L1_error) __pyx_v_cp = __pyx_t_3; /* "PETSc/DMPlex.pyx":371 * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) */ __pyx_v_csize = 0; /* "PETSc/DMPlex.pyx":372 * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) */ __pyx_v_cvals = NULL; /* "PETSc/DMPlex.pyx":373 * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_values, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":374 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_5 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(48, 374, __pyx_L1_error) __pyx_v_im = __pyx_t_5; /* "PETSc/DMPlex.pyx":375 * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) # <<<<<<<<<<<<<< * * def setMatClosure(self, Section sec or None, Section gsec or None, */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexVecSetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_vec->vec, __pyx_v_cp, __pyx_v_cvals, __pyx_v_im)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(48, 375, __pyx_L1_error) /* "PETSc/DMPlex.pyx":368 * return closure * * def setVecClosure(self, Section sec or None, Vec vec, point, values, addv=None): # <<<<<<<<<<<<<< * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscInt cp = asInt(point) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setVecClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":377 * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * * def setMatClosure(self, Section sec or None, Section gsec or None, # <<<<<<<<<<<<<< * Mat mat, point, values, addv=None): * cdef PetscSection csec = sec.sec if sec is not None else NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_81setMatClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_80setMatClosure[] = "DMPlex.setMatClosure(self, Section sec, Section gsec, Mat mat, point, values, addv=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_81setMatClosure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscSectionObject *__pyx_v_gsec = 0; struct PyPetscMatObject *__pyx_v_mat = 0; PyObject *__pyx_v_point = 0; PyObject *__pyx_v_values = 0; PyObject *__pyx_v_addv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMatClosure (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,&__pyx_n_s_gsec,&__pyx_n_s_mat,&__pyx_n_s_point,&__pyx_n_s_values,&__pyx_n_s_addv,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "PETSc/DMPlex.pyx":378 * * def setMatClosure(self, Section sec or None, Section gsec or None, * Mat mat, point, values, addv=None): # <<<<<<<<<<<<<< * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL */ values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gsec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 1); __PYX_ERR(48, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 2); __PYX_ERR(48, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 3); __PYX_ERR(48, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, 4); __PYX_ERR(48, 377, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_addv); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMatClosure") < 0)) __PYX_ERR(48, 377, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); __pyx_v_gsec = ((struct PyPetscSectionObject *)values[1]); __pyx_v_mat = ((struct PyPetscMatObject *)values[2]); __pyx_v_point = values[3]; __pyx_v_values = values[4]; __pyx_v_addv = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 377, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setMatClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(48, 377, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gsec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "gsec", 0))) __PYX_ERR(48, 377, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 378, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_80setMatClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec, __pyx_v_gsec, __pyx_v_mat, __pyx_v_point, __pyx_v_values, __pyx_v_addv); /* "PETSc/DMPlex.pyx":377 * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * * def setMatClosure(self, Section sec or None, Section gsec or None, # <<<<<<<<<<<<<< * Mat mat, point, values, addv=None): * cdef PetscSection csec = sec.sec if sec is not None else NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_80setMatClosure(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscSectionObject *__pyx_v_gsec, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_point, PyObject *__pyx_v_values, PyObject *__pyx_v_addv) { PetscSection __pyx_v_csec; PetscSection __pyx_v_cgsec; PetscInt __pyx_v_cp; PetscInt __pyx_v_csize; PetscScalar *__pyx_v_cvals; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; InsertMode __pyx_v_im; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; InsertMode __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMatClosure", 0); /* "PETSc/DMPlex.pyx":379 * def setMatClosure(self, Section sec or None, Section gsec or None, * Mat mat, point, values, addv=None): * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL * cdef PetscInt cp = asInt(point) */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "PETSc/DMPlex.pyx":380 * Mat mat, point, values, addv=None): * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 */ __pyx_t_2 = (((PyObject *)__pyx_v_gsec) != Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_1 = __pyx_v_gsec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_cgsec = __pyx_t_1; /* "PETSc/DMPlex.pyx":381 * cdef PetscSection csec = sec.sec if sec is not None else NULL * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL * cdef PetscInt cp = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 381, __pyx_L1_error) __pyx_v_cp = __pyx_t_3; /* "PETSc/DMPlex.pyx":382 * cdef PetscSection cgsec = gsec.sec if gsec is not None else NULL * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 # <<<<<<<<<<<<<< * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) */ __pyx_v_csize = 0; /* "PETSc/DMPlex.pyx":383 * cdef PetscInt cp = asInt(point) * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL # <<<<<<<<<<<<<< * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) */ __pyx_v_cvals = NULL; /* "PETSc/DMPlex.pyx":384 * cdef PetscInt csize = 0 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) # <<<<<<<<<<<<<< * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_values, (&__pyx_v_csize), (&__pyx_v_cvals))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":385 * cdef PetscScalar *cvals = NULL * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) # <<<<<<<<<<<<<< * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) * */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_addv); if (unlikely(__pyx_t_5 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(48, 385, __pyx_L1_error) __pyx_v_im = __pyx_t_5; /* "PETSc/DMPlex.pyx":386 * cdef object tmp = iarray_s(values, &csize, &cvals) * cdef PetscInsertMode im = insertmode(addv) * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) # <<<<<<<<<<<<<< * * def generate(self, DMPlex boundary, name=None, interpolate=True): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMatSetClosure(__pyx_v_self->__pyx_base.dm, __pyx_v_csec, __pyx_v_cgsec, __pyx_v_mat->mat, __pyx_v_cp, __pyx_v_cvals, __pyx_v_im)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(48, 386, __pyx_L1_error) /* "PETSc/DMPlex.pyx":377 * CHKERR( DMPlexVecSetClosure(self.dm, csec, vec.vec, cp, cvals, im) ) * * def setMatClosure(self, Section sec or None, Section gsec or None, # <<<<<<<<<<<<<< * Mat mat, point, values, addv=None): * cdef PetscSection csec = sec.sec if sec is not None else NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setMatClosure", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":388 * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) * * def generate(self, DMPlex boundary, name=None, interpolate=True): # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef const char *cname = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_83generate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_82generate[] = "DMPlex.generate(self, DMPlex boundary, name=None, interpolate=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_83generate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_boundary = 0; PyObject *__pyx_v_name = 0; PyObject *__pyx_v_interpolate = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("generate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boundary,&__pyx_n_s_name,&__pyx_n_s_interpolate,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boundary)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generate") < 0)) __PYX_ERR(48, 388, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_boundary = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)values[0]); __pyx_v_name = values[1]; __pyx_v_interpolate = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("generate", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 388, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.generate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_boundary), __pyx_ptype_8petsc4py_5PETSc_DMPlex, 0, "boundary", 0))) __PYX_ERR(48, 388, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_82generate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_boundary, __pyx_v_name, __pyx_v_interpolate); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_82generate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_boundary, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate) { PetscBool __pyx_v_interp; char const *__pyx_v_cname; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("generate", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DMPlex.pyx":389 * * def generate(self, DMPlex boundary, name=None, interpolate=True): * cdef PetscBool interp = interpolate # <<<<<<<<<<<<<< * cdef const char *cname = NULL * if name: name = str2bytes(name, &cname) */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_interpolate)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 389, __pyx_L1_error) __pyx_v_interp = __pyx_t_1; /* "PETSc/DMPlex.pyx":390 * def generate(self, DMPlex boundary, name=None, interpolate=True): * cdef PetscBool interp = interpolate * cdef const char *cname = NULL # <<<<<<<<<<<<<< * if name: name = str2bytes(name, &cname) * cdef PetscDM newdm = NULL */ __pyx_v_cname = NULL; /* "PETSc/DMPlex.pyx":391 * cdef PetscBool interp = interpolate * cdef const char *cname = NULL * if name: name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(48, 391, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMPlex.pyx":392 * cdef const char *cname = NULL * if name: name = str2bytes(name, &cname) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":393 * if name: name = str2bytes(name, &cname) * cdef PetscDM newdm = NULL * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGenerate(__pyx_v_boundary->__pyx_base.dm, __pyx_v_cname, __pyx_v_interp, (&__pyx_v_newdm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 393, __pyx_L1_error) /* "PETSc/DMPlex.pyx":394 * cdef PetscDM newdm = NULL * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":395 * CHKERR( DMPlexGenerate(boundary.dm, cname, interp, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def setTriangleOptions(self, opts): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":388 * CHKERR( DMPlexMatSetClosure(self.dm, csec, cgsec, mat.mat, cp, cvals, im) ) * * def generate(self, DMPlex boundary, name=None, interpolate=True): # <<<<<<<<<<<<<< * cdef PetscBool interp = interpolate * cdef const char *cname = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.generate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":397 * return self * * def setTriangleOptions(self, opts): # <<<<<<<<<<<<<< * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_85setTriangleOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_84setTriangleOptions[] = "DMPlex.setTriangleOptions(self, opts)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_85setTriangleOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_opts = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTriangleOptions (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_opts,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTriangleOptions") < 0)) __PYX_ERR(48, 397, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_opts = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTriangleOptions", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 397, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTriangleOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_84setTriangleOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_opts); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_84setTriangleOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts) { char const *__pyx_v_copts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTriangleOptions", 0); __Pyx_INCREF(__pyx_v_opts); /* "PETSc/DMPlex.pyx":398 * * def setTriangleOptions(self, opts): * cdef const char *copts = NULL # <<<<<<<<<<<<<< * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) */ __pyx_v_copts = NULL; /* "PETSc/DMPlex.pyx":399 * def setTriangleOptions(self, opts): * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) # <<<<<<<<<<<<<< * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_opts, (&__pyx_v_copts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_opts, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":400 * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) # <<<<<<<<<<<<<< * * def setTetGenOptions(self, opts): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTriangleSetOptions(__pyx_v_self->__pyx_base.dm, __pyx_v_copts)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 400, __pyx_L1_error) /* "PETSc/DMPlex.pyx":397 * return self * * def setTriangleOptions(self, opts): # <<<<<<<<<<<<<< * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTriangleOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_opts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":402 * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) * * def setTetGenOptions(self, opts): # <<<<<<<<<<<<<< * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_87setTetGenOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_86setTetGenOptions[] = "DMPlex.setTetGenOptions(self, opts)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_87setTetGenOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_opts = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setTetGenOptions (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_opts,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opts)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTetGenOptions") < 0)) __PYX_ERR(48, 402, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_opts = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setTetGenOptions", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 402, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTetGenOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_86setTetGenOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_opts); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_86setTetGenOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts) { char const *__pyx_v_copts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setTetGenOptions", 0); __Pyx_INCREF(__pyx_v_opts); /* "PETSc/DMPlex.pyx":403 * * def setTetGenOptions(self, opts): * cdef const char *copts = NULL # <<<<<<<<<<<<<< * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) */ __pyx_v_copts = NULL; /* "PETSc/DMPlex.pyx":404 * def setTetGenOptions(self, opts): * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) # <<<<<<<<<<<<<< * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_opts, (&__pyx_v_copts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_opts, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":405 * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) # <<<<<<<<<<<<<< * * def createSquareBoundary(self, lower, upper, edges): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTetgenSetOptions(__pyx_v_self->__pyx_base.dm, __pyx_v_copts)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 405, __pyx_L1_error) /* "PETSc/DMPlex.pyx":402 * CHKERR( DMPlexTriangleSetOptions(self.dm, copts) ) * * def setTetGenOptions(self, opts): # <<<<<<<<<<<<<< * cdef const char *copts = NULL * opts = str2bytes(opts, &copts) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setTetGenOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_opts); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":407 * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) * * def createSquareBoundary(self, lower, upper, edges): # <<<<<<<<<<<<<< * cdef PetscInt nlow = 0, nup = 0, nedg = 0 * cdef PetscInt *iedg = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_89createSquareBoundary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_88createSquareBoundary[] = "DMPlex.createSquareBoundary(self, lower, upper, edges)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_89createSquareBoundary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lower = 0; PyObject *__pyx_v_upper = 0; PyObject *__pyx_v_edges = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSquareBoundary (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lower,&__pyx_n_s_upper,&__pyx_n_s_edges,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lower)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_upper)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createSquareBoundary", 1, 3, 3, 1); __PYX_ERR(48, 407, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edges)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createSquareBoundary", 1, 3, 3, 2); __PYX_ERR(48, 407, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSquareBoundary") < 0)) __PYX_ERR(48, 407, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_lower = values[0]; __pyx_v_upper = values[1]; __pyx_v_edges = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSquareBoundary", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 407, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createSquareBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_88createSquareBoundary(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_lower, __pyx_v_upper, __pyx_v_edges); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_88createSquareBoundary(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_edges) { PetscInt __pyx_v_nlow; PetscInt __pyx_v_nup; PetscInt __pyx_v_nedg; PetscInt *__pyx_v_iedg; PetscReal *__pyx_v_ilow; PetscReal *__pyx_v_iup; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSquareBoundary", 0); __Pyx_INCREF(__pyx_v_lower); __Pyx_INCREF(__pyx_v_upper); __Pyx_INCREF(__pyx_v_edges); /* "PETSc/DMPlex.pyx":408 * * def createSquareBoundary(self, lower, upper, edges): * cdef PetscInt nlow = 0, nup = 0, nedg = 0 # <<<<<<<<<<<<<< * cdef PetscInt *iedg = NULL * cdef PetscReal *ilow = NULL, *iup = NULL */ __pyx_v_nlow = 0; __pyx_v_nup = 0; __pyx_v_nedg = 0; /* "PETSc/DMPlex.pyx":409 * def createSquareBoundary(self, lower, upper, edges): * cdef PetscInt nlow = 0, nup = 0, nedg = 0 * cdef PetscInt *iedg = NULL # <<<<<<<<<<<<<< * cdef PetscReal *ilow = NULL, *iup = NULL * lower = iarray_r(lower, &nlow, &ilow) */ __pyx_v_iedg = NULL; /* "PETSc/DMPlex.pyx":410 * cdef PetscInt nlow = 0, nup = 0, nedg = 0 * cdef PetscInt *iedg = NULL * cdef PetscReal *ilow = NULL, *iup = NULL # <<<<<<<<<<<<<< * lower = iarray_r(lower, &nlow, &ilow) * upper = iarray_r(upper, &nup, &iup) */ __pyx_v_ilow = NULL; __pyx_v_iup = NULL; /* "PETSc/DMPlex.pyx":411 * cdef PetscInt *iedg = NULL * cdef PetscReal *ilow = NULL, *iup = NULL * lower = iarray_r(lower, &nlow, &ilow) # <<<<<<<<<<<<<< * upper = iarray_r(upper, &nup, &iup) * edges = iarray_i(edges, &nedg, &iedg) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_r(__pyx_v_lower, (&__pyx_v_nlow), (&__pyx_v_ilow))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":412 * cdef PetscReal *ilow = NULL, *iup = NULL * lower = iarray_r(lower, &nlow, &ilow) * upper = iarray_r(upper, &nup, &iup) # <<<<<<<<<<<<<< * edges = iarray_i(edges, &nedg, &iedg) * CHKERR( DMPlexCreateSquareBoundary(self.dm, ilow, iup, iedg) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_r(__pyx_v_upper, (&__pyx_v_nup), (&__pyx_v_iup))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":413 * lower = iarray_r(lower, &nlow, &ilow) * upper = iarray_r(upper, &nup, &iup) * edges = iarray_i(edges, &nedg, &iedg) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateSquareBoundary(self.dm, ilow, iup, iedg) ) * return self */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_edges, (&__pyx_v_nedg), (&__pyx_v_iedg))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_edges, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":414 * upper = iarray_r(upper, &nup, &iup) * edges = iarray_i(edges, &nedg, &iedg) * CHKERR( DMPlexCreateSquareBoundary(self.dm, ilow, iup, iedg) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateSquareBoundary(__pyx_v_self->__pyx_base.dm, __pyx_v_ilow, __pyx_v_iup, __pyx_v_iedg)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 414, __pyx_L1_error) /* "PETSc/DMPlex.pyx":415 * edges = iarray_i(edges, &nedg, &iedg) * CHKERR( DMPlexCreateSquareBoundary(self.dm, ilow, iup, iedg) ) * return self # <<<<<<<<<<<<<< * * def createCubeBoundary(self, lower, upper, faces): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":407 * CHKERR( DMPlexTetgenSetOptions(self.dm, copts) ) * * def createSquareBoundary(self, lower, upper, edges): # <<<<<<<<<<<<<< * cdef PetscInt nlow = 0, nup = 0, nedg = 0 * cdef PetscInt *iedg = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createSquareBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lower); __Pyx_XDECREF(__pyx_v_upper); __Pyx_XDECREF(__pyx_v_edges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":417 * return self * * def createCubeBoundary(self, lower, upper, faces): # <<<<<<<<<<<<<< * cdef PetscInt nlow = 0, nup = 0, nfac = 0 * cdef PetscInt *ifac = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_91createCubeBoundary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_90createCubeBoundary[] = "DMPlex.createCubeBoundary(self, lower, upper, faces)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_91createCubeBoundary(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lower = 0; PyObject *__pyx_v_upper = 0; PyObject *__pyx_v_faces = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCubeBoundary (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lower,&__pyx_n_s_upper,&__pyx_n_s_faces,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lower)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_upper)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createCubeBoundary", 1, 3, 3, 1); __PYX_ERR(48, 417, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_faces)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createCubeBoundary", 1, 3, 3, 2); __PYX_ERR(48, 417, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCubeBoundary") < 0)) __PYX_ERR(48, 417, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_lower = values[0]; __pyx_v_upper = values[1]; __pyx_v_faces = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCubeBoundary", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 417, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCubeBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_90createCubeBoundary(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_lower, __pyx_v_upper, __pyx_v_faces); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_90createCubeBoundary(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_lower, PyObject *__pyx_v_upper, PyObject *__pyx_v_faces) { PetscInt __pyx_v_nlow; PetscInt __pyx_v_nup; PetscInt __pyx_v_nfac; PetscInt *__pyx_v_ifac; PetscReal *__pyx_v_ilow; PetscReal *__pyx_v_iup; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCubeBoundary", 0); __Pyx_INCREF(__pyx_v_lower); __Pyx_INCREF(__pyx_v_upper); __Pyx_INCREF(__pyx_v_faces); /* "PETSc/DMPlex.pyx":418 * * def createCubeBoundary(self, lower, upper, faces): * cdef PetscInt nlow = 0, nup = 0, nfac = 0 # <<<<<<<<<<<<<< * cdef PetscInt *ifac = NULL * cdef PetscReal *ilow = NULL, *iup = NULL */ __pyx_v_nlow = 0; __pyx_v_nup = 0; __pyx_v_nfac = 0; /* "PETSc/DMPlex.pyx":419 * def createCubeBoundary(self, lower, upper, faces): * cdef PetscInt nlow = 0, nup = 0, nfac = 0 * cdef PetscInt *ifac = NULL # <<<<<<<<<<<<<< * cdef PetscReal *ilow = NULL, *iup = NULL * lower = iarray_r(lower, &nlow, &ilow) */ __pyx_v_ifac = NULL; /* "PETSc/DMPlex.pyx":420 * cdef PetscInt nlow = 0, nup = 0, nfac = 0 * cdef PetscInt *ifac = NULL * cdef PetscReal *ilow = NULL, *iup = NULL # <<<<<<<<<<<<<< * lower = iarray_r(lower, &nlow, &ilow) * upper = iarray_r(upper, &nup, &iup) */ __pyx_v_ilow = NULL; __pyx_v_iup = NULL; /* "PETSc/DMPlex.pyx":421 * cdef PetscInt *ifac = NULL * cdef PetscReal *ilow = NULL, *iup = NULL * lower = iarray_r(lower, &nlow, &ilow) # <<<<<<<<<<<<<< * upper = iarray_r(upper, &nup, &iup) * faces = iarray_i(faces, &nfac, &ifac) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_r(__pyx_v_lower, (&__pyx_v_nlow), (&__pyx_v_ilow))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":422 * cdef PetscReal *ilow = NULL, *iup = NULL * lower = iarray_r(lower, &nlow, &ilow) * upper = iarray_r(upper, &nup, &iup) # <<<<<<<<<<<<<< * faces = iarray_i(faces, &nfac, &ifac) * CHKERR( DMPlexCreateCubeBoundary(self.dm, ilow, iup, ifac) ) */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_r(__pyx_v_upper, (&__pyx_v_nup), (&__pyx_v_iup))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":423 * lower = iarray_r(lower, &nlow, &ilow) * upper = iarray_r(upper, &nup, &iup) * faces = iarray_i(faces, &nfac, &ifac) # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCubeBoundary(self.dm, ilow, iup, ifac) ) * return self */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_faces, (&__pyx_v_nfac), (&__pyx_v_ifac))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_faces, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":424 * upper = iarray_r(upper, &nup, &iup) * faces = iarray_i(faces, &nfac, &ifac) * CHKERR( DMPlexCreateCubeBoundary(self.dm, ilow, iup, ifac) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCubeBoundary(__pyx_v_self->__pyx_base.dm, __pyx_v_ilow, __pyx_v_iup, __pyx_v_ifac)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 424, __pyx_L1_error) /* "PETSc/DMPlex.pyx":425 * faces = iarray_i(faces, &nfac, &ifac) * CHKERR( DMPlexCreateCubeBoundary(self.dm, ilow, iup, ifac) ) * return self # <<<<<<<<<<<<<< * * def markBoundaryFaces(self, label, value=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMPlex.pyx":417 * return self * * def createCubeBoundary(self, lower, upper, faces): # <<<<<<<<<<<<<< * cdef PetscInt nlow = 0, nup = 0, nfac = 0 * cdef PetscInt *ifac = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCubeBoundary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lower); __Pyx_XDECREF(__pyx_v_upper); __Pyx_XDECREF(__pyx_v_faces); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":427 * return self * * def markBoundaryFaces(self, label, value=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_93markBoundaryFaces(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_92markBoundaryFaces[] = "DMPlex.markBoundaryFaces(self, label, value=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_93markBoundaryFaces(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_label = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("markBoundaryFaces (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_label,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_label)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "markBoundaryFaces") < 0)) __PYX_ERR(48, 427, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_label = values[0]; __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("markBoundaryFaces", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 427, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.markBoundaryFaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_92markBoundaryFaces(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label, __pyx_v_value); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_92markBoundaryFaces(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value) { PetscInt __pyx_v_ival; char const *__pyx_v_cval; DMLabel __pyx_v_clbl; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("markBoundaryFaces", 0); __Pyx_INCREF(__pyx_v_label); /* "PETSc/DMPlex.pyx":428 * * def markBoundaryFaces(self, label, value=None): * cdef PetscInt ival = PETSC_DETERMINE # <<<<<<<<<<<<<< * if value is not None: ival = asInt(value) * if not self.hasLabel(label): */ __pyx_v_ival = PETSC_DETERMINE; /* "PETSc/DMPlex.pyx":429 * def markBoundaryFaces(self, label, value=None): * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) # <<<<<<<<<<<<<< * if not self.hasLabel(label): * self.createLabel(label) */ __pyx_t_1 = (__pyx_v_value != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 429, __pyx_L1_error) __pyx_v_ival = __pyx_t_3; } /* "PETSc/DMPlex.pyx":430 * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) * if not self.hasLabel(label): # <<<<<<<<<<<<<< * self.createLabel(label) * cdef const char *cval = NULL */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hasLabel); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_label) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_label); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(48, 430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = ((!__pyx_t_2) != 0); if (__pyx_t_1) { /* "PETSc/DMPlex.pyx":431 * if value is not None: ival = asInt(value) * if not self.hasLabel(label): * self.createLabel(label) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * label = str2bytes(label, &cval) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_createLabel); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_label) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_label); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":430 * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) * if not self.hasLabel(label): # <<<<<<<<<<<<<< * self.createLabel(label) * cdef const char *cval = NULL */ } /* "PETSc/DMPlex.pyx":432 * if not self.hasLabel(label): * self.createLabel(label) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * label = str2bytes(label, &cval) * cdef PetscDMLabel clbl = NULL */ __pyx_v_cval = NULL; /* "PETSc/DMPlex.pyx":433 * self.createLabel(label) * cdef const char *cval = NULL * label = str2bytes(label, &cval) # <<<<<<<<<<<<<< * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_label, (&__pyx_v_cval)); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_label, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMPlex.pyx":434 * cdef const char *cval = NULL * label = str2bytes(label, &cval) * cdef PetscDMLabel clbl = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) */ __pyx_v_clbl = NULL; /* "PETSc/DMPlex.pyx":435 * label = str2bytes(label, &cval) * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) # <<<<<<<<<<<<<< * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->__pyx_base.dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(48, 435, __pyx_L1_error) /* "PETSc/DMPlex.pyx":436 * cdef PetscDMLabel clbl = NULL * CHKERR( DMGetLabel(self.dm, cval, &clbl) ) * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) # <<<<<<<<<<<<<< * * def setAdjacencyUseAnchors(self, useAnchors=True): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMarkBoundaryFaces(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_clbl)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(48, 436, __pyx_L1_error) /* "PETSc/DMPlex.pyx":427 * return self * * def markBoundaryFaces(self, label, value=None): # <<<<<<<<<<<<<< * cdef PetscInt ival = PETSC_DETERMINE * if value is not None: ival = asInt(value) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.markBoundaryFaces", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_label); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":438 * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) * * def setAdjacencyUseAnchors(self, useAnchors=True): # <<<<<<<<<<<<<< * cdef PetscBool flag = useAnchors * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_95setAdjacencyUseAnchors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_94setAdjacencyUseAnchors[] = "DMPlex.setAdjacencyUseAnchors(self, useAnchors=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_95setAdjacencyUseAnchors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_useAnchors = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setAdjacencyUseAnchors (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_useAnchors,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_useAnchors); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAdjacencyUseAnchors") < 0)) __PYX_ERR(48, 438, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_useAnchors = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setAdjacencyUseAnchors", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 438, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setAdjacencyUseAnchors", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_94setAdjacencyUseAnchors(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_useAnchors); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_94setAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_useAnchors) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setAdjacencyUseAnchors", 0); /* "PETSc/DMPlex.pyx":439 * * def setAdjacencyUseAnchors(self, useAnchors=True): * cdef PetscBool flag = useAnchors # <<<<<<<<<<<<<< * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_useAnchors)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 439, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "PETSc/DMPlex.pyx":440 * def setAdjacencyUseAnchors(self, useAnchors=True): * cdef PetscBool flag = useAnchors * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) # <<<<<<<<<<<<<< * * def getAdjacencyUseAnchors(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetAdjacencyUseAnchors(__pyx_v_self->__pyx_base.dm, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 440, __pyx_L1_error) /* "PETSc/DMPlex.pyx":438 * CHKERR( DMPlexMarkBoundaryFaces(self.dm, ival, clbl) ) * * def setAdjacencyUseAnchors(self, useAnchors=True): # <<<<<<<<<<<<<< * cdef PetscBool flag = useAnchors * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setAdjacencyUseAnchors", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":442 * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) * * def getAdjacencyUseAnchors(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_97getAdjacencyUseAnchors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_96getAdjacencyUseAnchors[] = "DMPlex.getAdjacencyUseAnchors(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_97getAdjacencyUseAnchors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAdjacencyUseAnchors (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getAdjacencyUseAnchors", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getAdjacencyUseAnchors", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_96getAdjacencyUseAnchors(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_96getAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAdjacencyUseAnchors", 0); /* "PETSc/DMPlex.pyx":443 * * def getAdjacencyUseAnchors(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/DMPlex.pyx":444 * def getAdjacencyUseAnchors(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetAdjacencyUseAnchors(__pyx_v_self->__pyx_base.dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 444, __pyx_L1_error) /* "PETSc/DMPlex.pyx":445 * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def getAdjacency(self, p): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":442 * CHKERR( DMPlexSetAdjacencyUseAnchors(self.dm, flag) ) * * def getAdjacencyUseAnchors(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetAdjacencyUseAnchors(self.dm, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getAdjacencyUseAnchors", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":447 * return toBool(flag) * * def getAdjacency(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt nadj = PETSC_DETERMINE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_99getAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_98getAdjacency[] = "DMPlex.getAdjacency(self, p)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_99getAdjacency(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_p = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAdjacency (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getAdjacency") < 0)) __PYX_ERR(48, 447, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_p = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getAdjacency", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 447, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_98getAdjacency(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_98getAdjacency(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p) { PetscInt __pyx_v_cp; PetscInt __pyx_v_nadj; PetscInt *__pyx_v_iadj; PyArrayObject *__pyx_v_adjacency = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; char const *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAdjacency", 0); /* "PETSc/DMPlex.pyx":448 * * def getAdjacency(self, p): * cdef PetscInt cp = asInt(p) # <<<<<<<<<<<<<< * cdef PetscInt nadj = PETSC_DETERMINE * cdef PetscInt *iadj = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_p); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 448, __pyx_L1_error) __pyx_v_cp = __pyx_t_1; /* "PETSc/DMPlex.pyx":449 * def getAdjacency(self, p): * cdef PetscInt cp = asInt(p) * cdef PetscInt nadj = PETSC_DETERMINE # <<<<<<<<<<<<<< * cdef PetscInt *iadj = NULL * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) */ __pyx_v_nadj = PETSC_DETERMINE; /* "PETSc/DMPlex.pyx":450 * cdef PetscInt cp = asInt(p) * cdef PetscInt nadj = PETSC_DETERMINE * cdef PetscInt *iadj = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) * try: */ __pyx_v_iadj = NULL; /* "PETSc/DMPlex.pyx":451 * cdef PetscInt nadj = PETSC_DETERMINE * cdef PetscInt *iadj = NULL * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) # <<<<<<<<<<<<<< * try: * adjacency = array_i(nadj, iadj) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetAdjacency(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_nadj), (&__pyx_v_iadj))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 451, __pyx_L1_error) /* "PETSc/DMPlex.pyx":452 * cdef PetscInt *iadj = NULL * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) * try: # <<<<<<<<<<<<<< * adjacency = array_i(nadj, iadj) * finally: */ /*try:*/ { /* "PETSc/DMPlex.pyx":453 * CHKERR( DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj) ) * try: * adjacency = array_i(nadj, iadj) # <<<<<<<<<<<<<< * finally: * CHKERR( PetscFree(iadj) ) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nadj, __pyx_v_iadj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 453, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_adjacency = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMPlex.pyx":455 * adjacency = array_i(nadj, iadj) * finally: * CHKERR( PetscFree(iadj) ) # <<<<<<<<<<<<<< * return adjacency * */ /*finally:*/ { /*normal exit:*/{ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_iadj)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 455, __pyx_L1_error) goto __pyx_L5; } __pyx_L4_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __pyx_t_2 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename; { __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_iadj)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(48, 455, __pyx_L7_error) } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XGIVEREF(__pyx_t_6); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_lineno = __pyx_t_2; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5; goto __pyx_L1_error; __pyx_L7_error:; if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_9); __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11); } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; goto __pyx_L1_error; } __pyx_L5:; } /* "PETSc/DMPlex.pyx":456 * finally: * CHKERR( PetscFree(iadj) ) * return adjacency # <<<<<<<<<<<<<< * * def setPartitioner(self, Partitioner part): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_adjacency)); __pyx_r = ((PyObject *)__pyx_v_adjacency); goto __pyx_L0; /* "PETSc/DMPlex.pyx":447 * return toBool(flag) * * def getAdjacency(self, p): # <<<<<<<<<<<<<< * cdef PetscInt cp = asInt(p) * cdef PetscInt nadj = PETSC_DETERMINE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_adjacency); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":458 * return adjacency * * def setPartitioner(self, Partitioner part): # <<<<<<<<<<<<<< * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setPartitioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_100setPartitioner[] = "DMPlex.setPartitioner(self, Partitioner part)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setPartitioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscPartitionerObject *__pyx_v_part = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPartitioner (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_part,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_part)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPartitioner") < 0)) __PYX_ERR(48, 458, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_part = ((struct PyPetscPartitionerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPartitioner", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 458, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setPartitioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_part), __pyx_ptype_8petsc4py_5PETSc_Partitioner, 0, "part", 0))) __PYX_ERR(48, 458, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_100setPartitioner(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_part); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_100setPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscPartitionerObject *__pyx_v_part) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPartitioner", 0); /* "PETSc/DMPlex.pyx":459 * * def setPartitioner(self, Partitioner part): * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) # <<<<<<<<<<<<<< * * def getPartitioner(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetPartitioner(__pyx_v_self->__pyx_base.dm, __pyx_v_part->part)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 459, __pyx_L1_error) /* "PETSc/DMPlex.pyx":458 * return adjacency * * def setPartitioner(self, Partitioner part): # <<<<<<<<<<<<<< * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setPartitioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":461 * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) * * def getPartitioner(self): # <<<<<<<<<<<<<< * cdef Partitioner part = Partitioner() * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_103getPartitioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_102getPartitioner[] = "DMPlex.getPartitioner(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_103getPartitioner(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPartitioner (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getPartitioner", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getPartitioner", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_102getPartitioner(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_102getPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscPartitionerObject *__pyx_v_part = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPartitioner", 0); /* "PETSc/DMPlex.pyx":462 * * def getPartitioner(self): * cdef Partitioner part = Partitioner() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) * PetscINCREF(part.obj) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Partitioner)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_part = ((struct PyPetscPartitionerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":463 * def getPartitioner(self): * cdef Partitioner part = Partitioner() * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) # <<<<<<<<<<<<<< * PetscINCREF(part.obj) * return part */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPartitioner(__pyx_v_self->__pyx_base.dm, (&__pyx_v_part->part))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 463, __pyx_L1_error) /* "PETSc/DMPlex.pyx":464 * cdef Partitioner part = Partitioner() * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) * PetscINCREF(part.obj) # <<<<<<<<<<<<<< * return part * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_part->__pyx_base.obj)); /* "PETSc/DMPlex.pyx":465 * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) * PetscINCREF(part.obj) * return part # <<<<<<<<<<<<<< * * def rebalanceSharedPoints(self, entityDepth=0, useInitialGuess=True, parallel=True): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_part)); __pyx_r = ((PyObject *)__pyx_v_part); goto __pyx_L0; /* "PETSc/DMPlex.pyx":461 * CHKERR( DMPlexSetPartitioner(self.dm, part.part) ) * * def getPartitioner(self): # <<<<<<<<<<<<<< * cdef Partitioner part = Partitioner() * CHKERR( DMPlexGetPartitioner(self.dm, &part.part) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPartitioner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_part); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":467 * return part * * def rebalanceSharedPoints(self, entityDepth=0, useInitialGuess=True, parallel=True): # <<<<<<<<<<<<<< * cdef PetscInt centityDepth = asInt(entityDepth) * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_105rebalanceSharedPoints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_104rebalanceSharedPoints[] = "DMPlex.rebalanceSharedPoints(self, entityDepth=0, useInitialGuess=True, parallel=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_105rebalanceSharedPoints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_entityDepth = 0; PyObject *__pyx_v_useInitialGuess = 0; PyObject *__pyx_v_parallel = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rebalanceSharedPoints (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_entityDepth,&__pyx_n_s_useInitialGuess,&__pyx_n_s_parallel,0}; PyObject* values[3] = {0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)Py_True); values[2] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_entityDepth); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_useInitialGuess); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parallel); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rebalanceSharedPoints") < 0)) __PYX_ERR(48, 467, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_entityDepth = values[0]; __pyx_v_useInitialGuess = values[1]; __pyx_v_parallel = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("rebalanceSharedPoints", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 467, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.rebalanceSharedPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_104rebalanceSharedPoints(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_entityDepth, __pyx_v_useInitialGuess, __pyx_v_parallel); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_104rebalanceSharedPoints(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_entityDepth, PyObject *__pyx_v_useInitialGuess, PyObject *__pyx_v_parallel) { PetscInt __pyx_v_centityDepth; PetscBool __pyx_v_cuseInitialGuess; PetscBool __pyx_v_cparallel; PetscBool __pyx_v_csuccess; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PetscBool __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rebalanceSharedPoints", 0); /* "PETSc/DMPlex.pyx":468 * * def rebalanceSharedPoints(self, entityDepth=0, useInitialGuess=True, parallel=True): * cdef PetscInt centityDepth = asInt(entityDepth) # <<<<<<<<<<<<<< * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) * cdef PetscBool cparallel = asBool(parallel) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_entityDepth); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 468, __pyx_L1_error) __pyx_v_centityDepth = __pyx_t_1; /* "PETSc/DMPlex.pyx":469 * def rebalanceSharedPoints(self, entityDepth=0, useInitialGuess=True, parallel=True): * cdef PetscInt centityDepth = asInt(entityDepth) * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) # <<<<<<<<<<<<<< * cdef PetscBool cparallel = asBool(parallel) * cdef PetscBool csuccess = PETSC_FALSE */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_useInitialGuess); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(48, 469, __pyx_L1_error) __pyx_v_cuseInitialGuess = __pyx_t_2; /* "PETSc/DMPlex.pyx":470 * cdef PetscInt centityDepth = asInt(entityDepth) * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) * cdef PetscBool cparallel = asBool(parallel) # <<<<<<<<<<<<<< * cdef PetscBool csuccess = PETSC_FALSE * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_parallel); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(48, 470, __pyx_L1_error) __pyx_v_cparallel = __pyx_t_2; /* "PETSc/DMPlex.pyx":471 * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) * cdef PetscBool cparallel = asBool(parallel) * cdef PetscBool csuccess = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) * return toBool(csuccess) */ __pyx_v_csuccess = PETSC_FALSE; /* "PETSc/DMPlex.pyx":472 * cdef PetscBool cparallel = asBool(parallel) * cdef PetscBool csuccess = PETSC_FALSE * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) # <<<<<<<<<<<<<< * return toBool(csuccess) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexRebalanceSharedPoints(__pyx_v_self->__pyx_base.dm, __pyx_v_centityDepth, __pyx_v_cuseInitialGuess, __pyx_v_cparallel, (&__pyx_v_csuccess))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(48, 472, __pyx_L1_error) /* "PETSc/DMPlex.pyx":473 * cdef PetscBool csuccess = PETSC_FALSE * CHKERR( DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess) ) * return toBool(csuccess) # <<<<<<<<<<<<<< * * def distribute(self, overlap=0): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_csuccess); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":467 * return part * * def rebalanceSharedPoints(self, entityDepth=0, useInitialGuess=True, parallel=True): # <<<<<<<<<<<<<< * cdef PetscInt centityDepth = asInt(entityDepth) * cdef PetscBool cuseInitialGuess = asBool(useInitialGuess) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.rebalanceSharedPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":475 * return toBool(csuccess) * * def distribute(self, overlap=0): # <<<<<<<<<<<<<< * cdef PetscDM dmParallel = NULL * cdef PetscInt coverlap = asInt(overlap) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_107distribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_106distribute[] = "DMPlex.distribute(self, overlap=0)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_107distribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_overlap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distribute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distribute") < 0)) __PYX_ERR(48, 475, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_overlap = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distribute", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 475, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_106distribute(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_106distribute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap) { DM __pyx_v_dmParallel; PetscInt __pyx_v_coverlap; struct PyPetscSFObject *__pyx_v_sf = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distribute", 0); /* "PETSc/DMPlex.pyx":476 * * def distribute(self, overlap=0): * cdef PetscDM dmParallel = NULL # <<<<<<<<<<<<<< * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() */ __pyx_v_dmParallel = NULL; /* "PETSc/DMPlex.pyx":477 * def distribute(self, overlap=0): * cdef PetscDM dmParallel = NULL * cdef PetscInt coverlap = asInt(overlap) # <<<<<<<<<<<<<< * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 477, __pyx_L1_error) __pyx_v_coverlap = __pyx_t_1; /* "PETSc/DMPlex.pyx":478 * cdef PetscDM dmParallel = NULL * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() # <<<<<<<<<<<<<< * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":479 * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) # <<<<<<<<<<<<<< * if dmParallel != NULL: * PetscCLEAR(self.obj); self.dm = dmParallel */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistribute(__pyx_v_self->__pyx_base.dm, __pyx_v_coverlap, (&__pyx_v_sf->sf), (&__pyx_v_dmParallel))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(48, 479, __pyx_L1_error) /* "PETSc/DMPlex.pyx":480 * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = dmParallel * return sf */ __pyx_t_4 = ((__pyx_v_dmParallel != NULL) != 0); if (__pyx_t_4) { /* "PETSc/DMPlex.pyx":481 * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: * PetscCLEAR(self.obj); self.dm = dmParallel # <<<<<<<<<<<<<< * return sf * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_dmParallel; /* "PETSc/DMPlex.pyx":482 * if dmParallel != NULL: * PetscCLEAR(self.obj); self.dm = dmParallel * return sf # <<<<<<<<<<<<<< * * def distributeOverlap(self, overlap=0): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/DMPlex.pyx":480 * cdef SF sf = SF() * CHKERR( DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel) ) * if dmParallel != NULL: # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = dmParallel * return sf */ } /* "PETSc/DMPlex.pyx":475 * return toBool(csuccess) * * def distribute(self, overlap=0): # <<<<<<<<<<<<<< * cdef PetscDM dmParallel = NULL * cdef PetscInt coverlap = asInt(overlap) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distribute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":484 * return sf * * def distributeOverlap(self, overlap=0): # <<<<<<<<<<<<<< * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_109distributeOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_108distributeOverlap[] = "DMPlex.distributeOverlap(self, overlap=0)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_109distributeOverlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_overlap = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributeOverlap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_overlap,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)__pyx_int_0); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_overlap); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distributeOverlap") < 0)) __PYX_ERR(48, 484, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_overlap = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distributeOverlap", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 484, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_108distributeOverlap(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_overlap); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_108distributeOverlap(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap) { PetscInt __pyx_v_coverlap; struct PyPetscSFObject *__pyx_v_sf = 0; DM __pyx_v_dmOverlap; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributeOverlap", 0); /* "PETSc/DMPlex.pyx":485 * * def distributeOverlap(self, overlap=0): * cdef PetscInt coverlap = asInt(overlap) # <<<<<<<<<<<<<< * cdef SF sf = SF() * cdef PetscDM dmOverlap = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_overlap); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 485, __pyx_L1_error) __pyx_v_coverlap = __pyx_t_1; /* "PETSc/DMPlex.pyx":486 * def distributeOverlap(self, overlap=0): * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() # <<<<<<<<<<<<<< * cdef PetscDM dmOverlap = NULL * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":487 * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() * cdef PetscDM dmOverlap = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, * &sf.sf, &dmOverlap) ) */ __pyx_v_dmOverlap = NULL; /* "PETSc/DMPlex.pyx":488 * cdef SF sf = SF() * cdef PetscDM dmOverlap = NULL * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, # <<<<<<<<<<<<<< * &sf.sf, &dmOverlap) ) * PetscCLEAR(self.obj); self.dm = dmOverlap */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributeOverlap(__pyx_v_self->__pyx_base.dm, __pyx_v_coverlap, (&__pyx_v_sf->sf), (&__pyx_v_dmOverlap))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(48, 488, __pyx_L1_error) /* "PETSc/DMPlex.pyx":490 * CHKERR( DMPlexDistributeOverlap(self.dm, coverlap, * &sf.sf, &dmOverlap) ) * PetscCLEAR(self.obj); self.dm = dmOverlap # <<<<<<<<<<<<<< * return sf * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_dmOverlap; /* "PETSc/DMPlex.pyx":491 * &sf.sf, &dmOverlap) ) * PetscCLEAR(self.obj); self.dm = dmOverlap * return sf # <<<<<<<<<<<<<< * * def isDistributed(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sf)); __pyx_r = ((PyObject *)__pyx_v_sf); goto __pyx_L0; /* "PETSc/DMPlex.pyx":484 * return sf * * def distributeOverlap(self, overlap=0): # <<<<<<<<<<<<<< * cdef PetscInt coverlap = asInt(overlap) * cdef SF sf = SF() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeOverlap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_sf); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":493 * return sf * * def isDistributed(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_111isDistributed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_110isDistributed[] = "DMPlex.isDistributed(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_111isDistributed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isDistributed (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("isDistributed", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "isDistributed", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_110isDistributed(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_110isDistributed(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isDistributed", 0); /* "PETSc/DMPlex.pyx":494 * * def isDistributed(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/DMPlex.pyx":495 * def isDistributed(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexIsDistributed(__pyx_v_self->__pyx_base.dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 495, __pyx_L1_error) /* "PETSc/DMPlex.pyx":496 * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def interpolate(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":493 * return sf * * def isDistributed(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexIsDistributed(self.dm, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.isDistributed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":498 * return toBool(flag) * * def interpolate(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_113interpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_112interpolate[] = "DMPlex.interpolate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_113interpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("interpolate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("interpolate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "interpolate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_112interpolate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_112interpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("interpolate", 0); /* "PETSc/DMPlex.pyx":499 * * def interpolate(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":500 * def interpolate(self): * cdef PetscDM newdm = NULL * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexInterpolate(__pyx_v_self->__pyx_base.dm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 500, __pyx_L1_error) /* "PETSc/DMPlex.pyx":501 * cdef PetscDM newdm = NULL * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * * def uninterpolate(self): */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":498 * return toBool(flag) * * def interpolate(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexInterpolate(self.dm, &newdm) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.interpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":503 * PetscCLEAR(self.obj); self.dm = newdm * * def uninterpolate(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_115uninterpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_114uninterpolate[] = "DMPlex.uninterpolate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_115uninterpolate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("uninterpolate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("uninterpolate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "uninterpolate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_114uninterpolate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_114uninterpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("uninterpolate", 0); /* "PETSc/DMPlex.pyx":504 * * def uninterpolate(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMPlex.pyx":505 * def uninterpolate(self): * cdef PetscDM newdm = NULL * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexUninterpolate(__pyx_v_self->__pyx_base.dm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 505, __pyx_L1_error) /* "PETSc/DMPlex.pyx":506 * cdef PetscDM newdm = NULL * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * * def distributeField(self, SF sf, Section sec, Vec vec, */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMPlex.pyx":503 * PetscCLEAR(self.obj); self.dm = newdm * * def uninterpolate(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMPlexUninterpolate(self.dm, &newdm) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.uninterpolate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":508 * PetscCLEAR(self.obj); self.dm = newdm * * def distributeField(self, SF sf, Section sec, Vec vec, # <<<<<<<<<<<<<< * Section newsec=None, Vec newvec=None): * cdef MPI_Comm ccomm = MPI_COMM_NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_117distributeField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_116distributeField[] = "DMPlex.distributeField(self, SF sf, Section sec, Vec vec, Section newsec=None, Vec newvec=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_117distributeField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSFObject *__pyx_v_sf = 0; struct PyPetscSectionObject *__pyx_v_sec = 0; struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscSectionObject *__pyx_v_newsec = 0; struct PyPetscVecObject *__pyx_v_newvec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("distributeField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sf,&__pyx_n_s_sec,&__pyx_n_s_vec,&__pyx_n_s_newsec,&__pyx_n_s_newvec,0}; PyObject* values[5] = {0,0,0,0,0}; /* "PETSc/DMPlex.pyx":509 * * def distributeField(self, SF sf, Section sec, Vec vec, * Section newsec=None, Vec newvec=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = MPI_COMM_NULL * if newsec is None: newsec = Section() */ values[3] = (PyObject *)((struct PyPetscSectionObject *)Py_None); values[4] = (PyObject *)((struct PyPetscVecObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sf)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("distributeField", 0, 3, 5, 1); __PYX_ERR(48, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("distributeField", 0, 3, 5, 2); __PYX_ERR(48, 508, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_newsec); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_newvec); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distributeField") < 0)) __PYX_ERR(48, 508, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_sf = ((struct PyPetscSFObject *)values[0]); __pyx_v_sec = ((struct PyPetscSectionObject *)values[1]); __pyx_v_vec = ((struct PyPetscVecObject *)values[2]); __pyx_v_newsec = ((struct PyPetscSectionObject *)values[3]); __pyx_v_newvec = ((struct PyPetscVecObject *)values[4]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("distributeField", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 508, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(48, 508, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(48, 508, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(48, 508, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newsec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "newsec", 0))) __PYX_ERR(48, 509, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 1, "newvec", 0))) __PYX_ERR(48, 509, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_116distributeField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sf, __pyx_v_sec, __pyx_v_vec, __pyx_v_newsec, __pyx_v_newvec); /* "PETSc/DMPlex.pyx":508 * PetscCLEAR(self.obj); self.dm = newdm * * def distributeField(self, SF sf, Section sec, Vec vec, # <<<<<<<<<<<<<< * Section newsec=None, Vec newvec=None): * cdef MPI_Comm ccomm = MPI_COMM_NULL */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_116distributeField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, struct PyPetscSectionObject *__pyx_v_sec, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscSectionObject *__pyx_v_newsec, struct PyPetscVecObject *__pyx_v_newvec) { MPI_Comm __pyx_v_ccomm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distributeField", 0); __Pyx_INCREF((PyObject *)__pyx_v_newsec); __Pyx_INCREF((PyObject *)__pyx_v_newvec); /* "PETSc/DMPlex.pyx":510 * def distributeField(self, SF sf, Section sec, Vec vec, * Section newsec=None, Vec newvec=None): * cdef MPI_Comm ccomm = MPI_COMM_NULL # <<<<<<<<<<<<<< * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() */ __pyx_v_ccomm = MPI_COMM_NULL; /* "PETSc/DMPlex.pyx":511 * Section newsec=None, Vec newvec=None): * cdef MPI_Comm ccomm = MPI_COMM_NULL * if newsec is None: newsec = Section() # <<<<<<<<<<<<<< * if newvec is None: newvec = Vec() * if newsec.sec == NULL: */ __pyx_t_1 = (((PyObject *)__pyx_v_newsec) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_newsec, ((struct PyPetscSectionObject *)__pyx_t_3)); __pyx_t_3 = 0; } /* "PETSc/DMPlex.pyx":512 * cdef MPI_Comm ccomm = MPI_COMM_NULL * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() # <<<<<<<<<<<<<< * if newsec.sec == NULL: * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) */ __pyx_t_2 = (((PyObject *)__pyx_v_newvec) == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_newvec, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; } /* "PETSc/DMPlex.pyx":513 * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() * if newsec.sec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) */ __pyx_t_1 = ((__pyx_v_newsec->sec == NULL) != 0); if (__pyx_t_1) { /* "PETSc/DMPlex.pyx":514 * if newvec is None: newvec = Vec() * if newsec.sec == NULL: * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) # <<<<<<<<<<<<<< * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_sec->sec), (&__pyx_v_ccomm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 514, __pyx_L1_error) /* "PETSc/DMPlex.pyx":515 * if newsec.sec == NULL: * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) # <<<<<<<<<<<<<< * if newvec.vec == NULL: * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_newsec->sec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 515, __pyx_L1_error) /* "PETSc/DMPlex.pyx":513 * if newsec is None: newsec = Section() * if newvec is None: newvec = Vec() * if newsec.sec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) */ } /* "PETSc/DMPlex.pyx":516 * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) */ __pyx_t_1 = ((__pyx_v_newvec->vec == NULL) != 0); if (__pyx_t_1) { /* "PETSc/DMPlex.pyx":517 * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) # <<<<<<<<<<<<<< * CHKERR( VecCreate(ccomm, &newvec.vec) ) * CHKERR( DMPlexDistributeField(self.dm, sf.sf, */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_vec->vec), (&__pyx_v_ccomm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 517, __pyx_L1_error) /* "PETSc/DMPlex.pyx":518 * if newvec.vec == NULL: * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) # <<<<<<<<<<<<<< * CHKERR( DMPlexDistributeField(self.dm, sf.sf, * sec.sec, vec.vec, */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec->vec))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 518, __pyx_L1_error) /* "PETSc/DMPlex.pyx":516 * CHKERR( PetscObjectGetComm(sec.sec, &ccomm) ) * CHKERR( PetscSectionCreate(ccomm, &newsec.sec) ) * if newvec.vec == NULL: # <<<<<<<<<<<<<< * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) */ } /* "PETSc/DMPlex.pyx":519 * CHKERR( PetscObjectGetComm(vec.vec, &ccomm) ) * CHKERR( VecCreate(ccomm, &newvec.vec) ) * CHKERR( DMPlexDistributeField(self.dm, sf.sf, # <<<<<<<<<<<<<< * sec.sec, vec.vec, * newsec.sec, newvec.vec)) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexDistributeField(__pyx_v_self->__pyx_base.dm, __pyx_v_sf->sf, __pyx_v_sec->sec, __pyx_v_vec->vec, __pyx_v_newsec->sec, __pyx_v_newvec->vec)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 519, __pyx_L1_error) /* "PETSc/DMPlex.pyx":522 * sec.sec, vec.vec, * newsec.sec, newvec.vec)) * return (newsec, newvec) # <<<<<<<<<<<<<< * * def createCoarsePointIS(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_newsec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_newsec)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_newsec)); __Pyx_INCREF(((PyObject *)__pyx_v_newvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_newvec)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_newvec)); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":508 * PetscCLEAR(self.obj); self.dm = newdm * * def distributeField(self, SF sf, Section sec, Vec vec, # <<<<<<<<<<<<<< * Section newsec=None, Vec newvec=None): * cdef MPI_Comm ccomm = MPI_COMM_NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.distributeField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_newsec); __Pyx_XDECREF((PyObject *)__pyx_v_newvec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":524 * return (newsec, newvec) * * def createCoarsePointIS(self): # <<<<<<<<<<<<<< * cdef IS fpoint = IS() * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_119createCoarsePointIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_118createCoarsePointIS[] = "DMPlex.createCoarsePointIS(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_119createCoarsePointIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCoarsePointIS (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("createCoarsePointIS", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "createCoarsePointIS", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_118createCoarsePointIS(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_118createCoarsePointIS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { struct PyPetscISObject *__pyx_v_fpoint = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCoarsePointIS", 0); /* "PETSc/DMPlex.pyx":525 * * def createCoarsePointIS(self): * cdef IS fpoint = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) * return fpoint */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fpoint = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":526 * def createCoarsePointIS(self): * cdef IS fpoint = IS() * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) # <<<<<<<<<<<<<< * return fpoint * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCoarsePointIS(__pyx_v_self->__pyx_base.dm, (&__pyx_v_fpoint->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 526, __pyx_L1_error) /* "PETSc/DMPlex.pyx":527 * cdef IS fpoint = IS() * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) * return fpoint # <<<<<<<<<<<<<< * * def createSection(self, numComp, numDof, */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_fpoint)); __pyx_r = ((PyObject *)__pyx_v_fpoint); goto __pyx_L0; /* "PETSc/DMPlex.pyx":524 * return (newsec, newvec) * * def createCoarsePointIS(self): # <<<<<<<<<<<<<< * cdef IS fpoint = IS() * CHKERR( DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCoarsePointIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_fpoint); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":529 * return fpoint * * def createSection(self, numComp, numDof, # <<<<<<<<<<<<<< * bcField=None, bcComps=None, bcPoints=None, * IS perm=None): */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_121createSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_120createSection[] = "DMPlex.createSection(self, numComp, numDof, bcField=None, bcComps=None, bcPoints=None, IS perm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_121createSection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_numComp = 0; PyObject *__pyx_v_numDof = 0; PyObject *__pyx_v_bcField = 0; PyObject *__pyx_v_bcComps = 0; PyObject *__pyx_v_bcPoints = 0; struct PyPetscISObject *__pyx_v_perm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createSection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numComp,&__pyx_n_s_numDof,&__pyx_n_s_bcField,&__pyx_n_s_bcComps,&__pyx_n_s_bcPoints,&__pyx_n_s_perm,0}; PyObject* values[6] = {0,0,0,0,0,0}; /* "PETSc/DMPlex.pyx":530 * * def createSection(self, numComp, numDof, * bcField=None, bcComps=None, bcPoints=None, # <<<<<<<<<<<<<< * IS perm=None): * # topological dimension */ values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); /* "PETSc/DMPlex.pyx":531 * def createSection(self, numComp, numDof, * bcField=None, bcComps=None, bcPoints=None, * IS perm=None): # <<<<<<<<<<<<<< * # topological dimension * cdef PetscInt dim = 0 */ values[5] = (PyObject *)((struct PyPetscISObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numComp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numDof)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("createSection", 0, 2, 6, 1); __PYX_ERR(48, 529, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bcField); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bcComps); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bcPoints); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createSection") < 0)) __PYX_ERR(48, 529, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_numComp = values[0]; __pyx_v_numDof = values[1]; __pyx_v_bcField = values[2]; __pyx_v_bcComps = values[3]; __pyx_v_bcPoints = values[4]; __pyx_v_perm = ((struct PyPetscISObject *)values[5]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createSection", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 529, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perm), __pyx_ptype_8petsc4py_5PETSc_IS, 1, "perm", 0))) __PYX_ERR(48, 531, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_120createSection(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_numComp, __pyx_v_numDof, __pyx_v_bcField, __pyx_v_bcComps, __pyx_v_bcPoints, __pyx_v_perm); /* "PETSc/DMPlex.pyx":529 * return fpoint * * def createSection(self, numComp, numDof, # <<<<<<<<<<<<<< * bcField=None, bcComps=None, bcPoints=None, * IS perm=None): */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_120createSection(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_numComp, PyObject *__pyx_v_numDof, PyObject *__pyx_v_bcField, PyObject *__pyx_v_bcComps, PyObject *__pyx_v_bcPoints, struct PyPetscISObject *__pyx_v_perm) { PetscInt __pyx_v_dim; PetscInt __pyx_v_ncomp; PetscInt __pyx_v_ndof; PetscInt *__pyx_v_icomp; PetscInt *__pyx_v_idof; PetscInt __pyx_v_nbc; PetscInt __pyx_v_i; PetscInt *__pyx_v_bcfield; IS *__pyx_v_bccomps; IS *__pyx_v_bcpoints; CYTHON_UNUSED PyArrayObject *__pyx_v_tmp1 = NULL; CYTHON_UNUSED PyArrayObject *__pyx_v_tmp2 = NULL; IS __pyx_v_cperm; struct PyPetscSectionObject *__pyx_v_sec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *__pyx_t_6 = NULL; PetscInt __pyx_t_7; IS __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createSection", 0); __Pyx_INCREF(__pyx_v_numComp); __Pyx_INCREF(__pyx_v_numDof); __Pyx_INCREF(__pyx_v_bcField); __Pyx_INCREF(__pyx_v_bcComps); __Pyx_INCREF(__pyx_v_bcPoints); /* "PETSc/DMPlex.pyx":533 * IS perm=None): * # topological dimension * cdef PetscInt dim = 0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * # components and DOFs */ __pyx_v_dim = 0; /* "PETSc/DMPlex.pyx":534 * # topological dimension * cdef PetscInt dim = 0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * # components and DOFs * cdef PetscInt ncomp = 0, ndof = 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 534, __pyx_L1_error) /* "PETSc/DMPlex.pyx":536 * CHKERR( DMGetDimension(self.dm, &dim) ) * # components and DOFs * cdef PetscInt ncomp = 0, ndof = 0 # <<<<<<<<<<<<<< * cdef PetscInt *icomp = NULL, *idof = NULL * numComp = iarray_i(numComp, &ncomp, &icomp) */ __pyx_v_ncomp = 0; __pyx_v_ndof = 0; /* "PETSc/DMPlex.pyx":537 * # components and DOFs * cdef PetscInt ncomp = 0, ndof = 0 * cdef PetscInt *icomp = NULL, *idof = NULL # <<<<<<<<<<<<<< * numComp = iarray_i(numComp, &ncomp, &icomp) * numDof = iarray_i(numDof, &ndof, &idof) */ __pyx_v_icomp = NULL; __pyx_v_idof = NULL; /* "PETSc/DMPlex.pyx":538 * cdef PetscInt ncomp = 0, ndof = 0 * cdef PetscInt *icomp = NULL, *idof = NULL * numComp = iarray_i(numComp, &ncomp, &icomp) # <<<<<<<<<<<<<< * numDof = iarray_i(numDof, &ndof, &idof) * assert ndof == ncomp*(dim+1) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_numComp, (&__pyx_v_ncomp), (&__pyx_v_icomp))); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_numComp, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":539 * cdef PetscInt *icomp = NULL, *idof = NULL * numComp = iarray_i(numComp, &ncomp, &icomp) * numDof = iarray_i(numDof, &ndof, &idof) # <<<<<<<<<<<<<< * assert ndof == ncomp*(dim+1) * # boundary conditions */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_numDof, (&__pyx_v_ndof), (&__pyx_v_idof))); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_numDof, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":540 * numComp = iarray_i(numComp, &ncomp, &icomp) * numDof = iarray_i(numDof, &ndof, &idof) * assert ndof == ncomp*(dim+1) # <<<<<<<<<<<<<< * # boundary conditions * cdef PetscInt nbc = 0, i = 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_ndof == (__pyx_v_ncomp * (__pyx_v_dim + 1))) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 540, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":542 * assert ndof == ncomp*(dim+1) * # boundary conditions * cdef PetscInt nbc = 0, i = 0 # <<<<<<<<<<<<<< * cdef PetscInt *bcfield = NULL * cdef PetscIS *bccomps = NULL */ __pyx_v_nbc = 0; __pyx_v_i = 0; /* "PETSc/DMPlex.pyx":543 * # boundary conditions * cdef PetscInt nbc = 0, i = 0 * cdef PetscInt *bcfield = NULL # <<<<<<<<<<<<<< * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL */ __pyx_v_bcfield = NULL; /* "PETSc/DMPlex.pyx":544 * cdef PetscInt nbc = 0, i = 0 * cdef PetscInt *bcfield = NULL * cdef PetscIS *bccomps = NULL # <<<<<<<<<<<<<< * cdef PetscIS *bcpoints = NULL * if bcField is not None: */ __pyx_v_bccomps = NULL; /* "PETSc/DMPlex.pyx":545 * cdef PetscInt *bcfield = NULL * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL # <<<<<<<<<<<<<< * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) */ __pyx_v_bcpoints = NULL; /* "PETSc/DMPlex.pyx":546 * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL * if bcField is not None: # <<<<<<<<<<<<<< * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: */ __pyx_t_3 = (__pyx_v_bcField != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "PETSc/DMPlex.pyx":547 * cdef PetscIS *bcpoints = NULL * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) # <<<<<<<<<<<<<< * if bcComps is not None: * bcComps = list(bcComps) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_bcField, (&__pyx_v_nbc), (&__pyx_v_bcfield))); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_bcField, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":548 * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: # <<<<<<<<<<<<<< * bcComps = list(bcComps) * assert len(bcComps) == nbc */ __pyx_t_4 = (__pyx_v_bcComps != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "PETSc/DMPlex.pyx":549 * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: * bcComps = list(bcComps) # <<<<<<<<<<<<<< * assert len(bcComps) == nbc * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) */ __pyx_t_2 = PySequence_List(__pyx_v_bcComps); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_bcComps, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":550 * if bcComps is not None: * bcComps = list(bcComps) * assert len(bcComps) == nbc # <<<<<<<<<<<<<< * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) * for i from 0 <= i < nbc: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = PyObject_Length(__pyx_v_bcComps); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(48, 550, __pyx_L1_error) if (unlikely(!((__pyx_t_5 == __pyx_v_nbc) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 550, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":551 * bcComps = list(bcComps) * assert len(bcComps) == nbc * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) # <<<<<<<<<<<<<< * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nbc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_bccomps)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp1 = ((PyArrayObject *)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/DMPlex.pyx":552 * assert len(bcComps) == nbc * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) * for i from 0 <= i < nbc: # <<<<<<<<<<<<<< * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: */ __pyx_t_7 = __pyx_v_nbc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { /* "PETSc/DMPlex.pyx":553 * tmp1 = oarray_p(empty_p(nbc), NULL, &bccomps) * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset # <<<<<<<<<<<<<< * if bcPoints is not None: * bcPoints = list(bcPoints) */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_bcComps, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 553, __pyx_L1_error) __pyx_t_8 = ((struct PyPetscISObject *)__pyx_t_6)->iset; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; (__pyx_v_bccomps[__pyx_v_i]) = __pyx_t_8; } /* "PETSc/DMPlex.pyx":548 * if bcField is not None: * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: # <<<<<<<<<<<<<< * bcComps = list(bcComps) * assert len(bcComps) == nbc */ } /* "PETSc/DMPlex.pyx":554 * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: # <<<<<<<<<<<<<< * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc */ __pyx_t_3 = (__pyx_v_bcPoints != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (likely(__pyx_t_4)) { /* "PETSc/DMPlex.pyx":555 * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: * bcPoints = list(bcPoints) # <<<<<<<<<<<<<< * assert len(bcPoints) == nbc * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) */ __pyx_t_6 = PySequence_List(__pyx_v_bcPoints); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_bcPoints, __pyx_t_6); __pyx_t_6 = 0; /* "PETSc/DMPlex.pyx":556 * if bcPoints is not None: * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc # <<<<<<<<<<<<<< * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) * for i from 0 <= i < nbc: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_5 = PyObject_Length(__pyx_v_bcPoints); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(48, 556, __pyx_L1_error) if (unlikely(!((__pyx_t_5 == __pyx_v_nbc) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 556, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":557 * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) # <<<<<<<<<<<<<< * for i from 0 <= i < nbc: * bcpoints[i] = (bcPoints[i]).iset */ __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nbc)); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_6, NULL, ((void **)(&__pyx_v_bcpoints)))); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_tmp2 = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":558 * assert len(bcPoints) == nbc * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) * for i from 0 <= i < nbc: # <<<<<<<<<<<<<< * bcpoints[i] = (bcPoints[i]).iset * else: */ __pyx_t_7 = __pyx_v_nbc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { /* "PETSc/DMPlex.pyx":559 * tmp2 = oarray_p(empty_p(nbc), NULL, &bcpoints) * for i from 0 <= i < nbc: * bcpoints[i] = (bcPoints[i]).iset # <<<<<<<<<<<<<< * else: * raise ValueError("bcPoints is a required argument") */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bcPoints, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 559, __pyx_L1_error) __pyx_t_8 = ((struct PyPetscISObject *)__pyx_t_2)->iset; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; (__pyx_v_bcpoints[__pyx_v_i]) = __pyx_t_8; } /* "PETSc/DMPlex.pyx":554 * for i from 0 <= i < nbc: * bccomps[i] = (bcComps[i]).iset * if bcPoints is not None: # <<<<<<<<<<<<<< * bcPoints = list(bcPoints) * assert len(bcPoints) == nbc */ goto __pyx_L7; } /* "PETSc/DMPlex.pyx":561 * bcpoints[i] = (bcPoints[i]).iset * else: * raise ValueError("bcPoints is a required argument") # <<<<<<<<<<<<<< * else: * assert bcComps is None */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(48, 561, __pyx_L1_error) } __pyx_L7:; /* "PETSc/DMPlex.pyx":546 * cdef PetscIS *bccomps = NULL * cdef PetscIS *bcpoints = NULL * if bcField is not None: # <<<<<<<<<<<<<< * bcField = iarray_i(bcField, &nbc, &bcfield) * if bcComps is not None: */ goto __pyx_L3; } /* "PETSc/DMPlex.pyx":563 * raise ValueError("bcPoints is a required argument") * else: * assert bcComps is None # <<<<<<<<<<<<<< * assert bcPoints is None * # optional chart permutations */ /*else*/ { #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_bcComps == Py_None); if (unlikely(!(__pyx_t_4 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 563, __pyx_L1_error) } } #endif /* "PETSc/DMPlex.pyx":564 * else: * assert bcComps is None * assert bcPoints is None # <<<<<<<<<<<<<< * # optional chart permutations * cdef PetscIS cperm = NULL */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_4 = (__pyx_v_bcPoints == Py_None); if (unlikely(!(__pyx_t_4 != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(48, 564, __pyx_L1_error) } } #endif } __pyx_L3:; /* "PETSc/DMPlex.pyx":566 * assert bcPoints is None * # optional chart permutations * cdef PetscIS cperm = NULL # <<<<<<<<<<<<<< * if perm is not None: cperm = perm.iset * # create section */ __pyx_v_cperm = NULL; /* "PETSc/DMPlex.pyx":567 * # optional chart permutations * cdef PetscIS cperm = NULL * if perm is not None: cperm = perm.iset # <<<<<<<<<<<<<< * # create section * cdef Section sec = Section() */ __pyx_t_4 = (((PyObject *)__pyx_v_perm) != Py_None); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { __pyx_t_8 = __pyx_v_perm->iset; __pyx_v_cperm = __pyx_t_8; } /* "PETSc/DMPlex.pyx":569 * if perm is not None: cperm = perm.iset * # create section * cdef Section sec = Section() # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateSection(self.dm, NULL, icomp, idof, * nbc, bcfield, bccomps, bcpoints, */ __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":570 * # create section * cdef Section sec = Section() * CHKERR( DMPlexCreateSection(self.dm, NULL, icomp, idof, # <<<<<<<<<<<<<< * nbc, bcfield, bccomps, bcpoints, * cperm, &sec.sec) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateSection(__pyx_v_self->__pyx_base.dm, NULL, __pyx_v_icomp, __pyx_v_idof, __pyx_v_nbc, __pyx_v_bcfield, __pyx_v_bccomps, __pyx_v_bcpoints, __pyx_v_cperm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 570, __pyx_L1_error) /* "PETSc/DMPlex.pyx":573 * nbc, bcfield, bccomps, bcpoints, * cperm, &sec.sec) ) * return sec # <<<<<<<<<<<<<< * * def getPointLocal(self, point): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_sec)); __pyx_r = ((PyObject *)__pyx_v_sec); goto __pyx_L0; /* "PETSc/DMPlex.pyx":529 * return fpoint * * def createSection(self, numComp, numDof, # <<<<<<<<<<<<<< * bcField=None, bcComps=None, bcPoints=None, * IS perm=None): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createSection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_tmp1); __Pyx_XDECREF((PyObject *)__pyx_v_tmp2); __Pyx_XDECREF((PyObject *)__pyx_v_sec); __Pyx_XDECREF(__pyx_v_numComp); __Pyx_XDECREF(__pyx_v_numDof); __Pyx_XDECREF(__pyx_v_bcField); __Pyx_XDECREF(__pyx_v_bcComps); __Pyx_XDECREF(__pyx_v_bcPoints); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":575 * return sec * * def getPointLocal(self, point): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_123getPointLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_122getPointLocal[] = "DMPlex.getPointLocal(self, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_123getPointLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getPointLocal") < 0)) __PYX_ERR(48, 575, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointLocal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 575, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_122getPointLocal(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_122getPointLocal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointLocal", 0); /* "PETSc/DMPlex.pyx":576 * * def getPointLocal(self, point): * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "PETSc/DMPlex.pyx":577 * def getPointLocal(self, point): * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 577, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/DMPlex.pyx":578 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointLocal(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 578, __pyx_L1_error) /* "PETSc/DMPlex.pyx":579 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointLocal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def getPointLocalField(self, point, field): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":575 * return sec * * def getPointLocal(self, point): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":581 * return toInt(start), toInt(end) * * def getPointLocalField(self, point, field): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_125getPointLocalField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_124getPointLocalField[] = "DMPlex.getPointLocalField(self, point, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_125getPointLocalField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointLocalField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getPointLocalField", 1, 2, 2, 1); __PYX_ERR(48, 581, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getPointLocalField") < 0)) __PYX_ERR(48, 581, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointLocalField", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 581, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_124getPointLocalField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_124getPointLocalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointLocalField", 0); /* "PETSc/DMPlex.pyx":582 * * def getPointLocalField(self, point, field): * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "PETSc/DMPlex.pyx":583 * def getPointLocalField(self, point, field): * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 583, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/DMPlex.pyx":584 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 584, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/DMPlex.pyx":585 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointLocalField(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 585, __pyx_L1_error) /* "PETSc/DMPlex.pyx":586 * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointLocalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def getPointGlobal(self, point): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":581 * return toInt(start), toInt(end) * * def getPointLocalField(self, point, field): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointLocalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":588 * return toInt(start), toInt(end) * * def getPointGlobal(self, point): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_127getPointGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_126getPointGlobal[] = "DMPlex.getPointGlobal(self, point)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_127getPointGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointGlobal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getPointGlobal") < 0)) __PYX_ERR(48, 588, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_point = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointGlobal", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 588, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_126getPointGlobal(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_126getPointGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointGlobal", 0); /* "PETSc/DMPlex.pyx":589 * * def getPointGlobal(self, point): * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "PETSc/DMPlex.pyx":590 * def getPointGlobal(self, point): * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 590, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/DMPlex.pyx":591 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointGlobal(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 591, __pyx_L1_error) /* "PETSc/DMPlex.pyx":592 * cdef PetscInt cpoint = asInt(point) * CHKERR( DMPlexGetPointGlobal(self.dm, cpoint, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def getPointGlobalField(self, point, field): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":588 * return toInt(start), toInt(end) * * def getPointGlobal(self, point): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":594 * return toInt(start), toInt(end) * * def getPointGlobalField(self, point, field): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_129getPointGlobalField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_128getPointGlobalField[] = "DMPlex.getPointGlobalField(self, point, field)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_129getPointGlobalField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_point = 0; PyObject *__pyx_v_field = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getPointGlobalField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_field,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getPointGlobalField", 1, 2, 2, 1); __PYX_ERR(48, 594, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getPointGlobalField") < 0)) __PYX_ERR(48, 594, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_point = values[0]; __pyx_v_field = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getPointGlobalField", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 594, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_128getPointGlobalField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point, __pyx_v_field); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_128getPointGlobalField(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field) { PetscInt __pyx_v_start; PetscInt __pyx_v_end; PetscInt __pyx_v_cpoint; PetscInt __pyx_v_cfield; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getPointGlobalField", 0); /* "PETSc/DMPlex.pyx":595 * * def getPointGlobalField(self, point, field): * cdef PetscInt start = 0, end = 0 # <<<<<<<<<<<<<< * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) */ __pyx_v_start = 0; __pyx_v_end = 0; /* "PETSc/DMPlex.pyx":596 * def getPointGlobalField(self, point, field): * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) # <<<<<<<<<<<<<< * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_point); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 596, __pyx_L1_error) __pyx_v_cpoint = __pyx_t_1; /* "PETSc/DMPlex.pyx":597 * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) # <<<<<<<<<<<<<< * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_field); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 597, __pyx_L1_error) __pyx_v_cfield = __pyx_t_1; /* "PETSc/DMPlex.pyx":598 * cdef PetscInt cpoint = asInt(point) * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) # <<<<<<<<<<<<<< * return toInt(start), toInt(end) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPointGlobalField(__pyx_v_self->__pyx_base.dm, __pyx_v_cpoint, __pyx_v_cfield, (&__pyx_v_start), (&__pyx_v_end))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 598, __pyx_L1_error) /* "PETSc/DMPlex.pyx":599 * cdef PetscInt cfield = asInt(field) * CHKERR( DMPlexGetPointGlobalField(self.dm, cpoint, cfield, &start, &end) ) * return toInt(start), toInt(end) # <<<<<<<<<<<<<< * * def createClosureIndex(self, Section sec or None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_end); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":594 * return toInt(start), toInt(end) * * def getPointGlobalField(self, point, field): # <<<<<<<<<<<<<< * cdef PetscInt start = 0, end = 0 * cdef PetscInt cpoint = asInt(point) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getPointGlobalField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":601 * return toInt(start), toInt(end) * * def createClosureIndex(self, Section sec or None): # <<<<<<<<<<<<<< * cdef PetscSection csec = sec.sec if sec is not None else NULL * CHKERR( DMPlexCreateClosureIndex(self.dm, csec) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_131createClosureIndex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_130createClosureIndex[] = "DMPlex.createClosureIndex(self, Section sec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_131createClosureIndex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscSectionObject *__pyx_v_sec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createClosureIndex (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createClosureIndex") < 0)) __PYX_ERR(48, 601, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sec = ((struct PyPetscSectionObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createClosureIndex", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 601, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createClosureIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(48, 601, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_130createClosureIndex(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_130createClosureIndex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec) { PetscSection __pyx_v_csec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscSection __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createClosureIndex", 0); /* "PETSc/DMPlex.pyx":602 * * def createClosureIndex(self, Section sec or None): * cdef PetscSection csec = sec.sec if sec is not None else NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexCreateClosureIndex(self.dm, csec) ) * */ __pyx_t_2 = (((PyObject *)__pyx_v_sec) != Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_1 = __pyx_v_sec->sec; } else { __pyx_t_1 = NULL; } __pyx_v_csec = __pyx_t_1; /* "PETSc/DMPlex.pyx":603 * def createClosureIndex(self, Section sec or None): * cdef PetscSection csec = sec.sec if sec is not None else NULL * CHKERR( DMPlexCreateClosureIndex(self.dm, csec) ) # <<<<<<<<<<<<<< * * # */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateClosureIndex(__pyx_v_self->__pyx_base.dm, __pyx_v_csec)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(48, 603, __pyx_L1_error) /* "PETSc/DMPlex.pyx":601 * return toInt(start), toInt(end) * * def createClosureIndex(self, Section sec or None): # <<<<<<<<<<<<<< * cdef PetscSection csec = sec.sec if sec is not None else NULL * CHKERR( DMPlexCreateClosureIndex(self.dm, csec) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createClosureIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":607 * # * * def setRefinementUniform(self, refinementUniform=True): # <<<<<<<<<<<<<< * cdef PetscBool flag = refinementUniform * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_133setRefinementUniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_132setRefinementUniform[] = "DMPlex.setRefinementUniform(self, refinementUniform=True)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_133setRefinementUniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_refinementUniform = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefinementUniform (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refinementUniform,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_True); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_refinementUniform); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRefinementUniform") < 0)) __PYX_ERR(48, 607, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_refinementUniform = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefinementUniform", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 607, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_132setRefinementUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_refinementUniform); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_132setRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementUniform) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefinementUniform", 0); /* "PETSc/DMPlex.pyx":608 * * def setRefinementUniform(self, refinementUniform=True): * cdef PetscBool flag = refinementUniform # <<<<<<<<<<<<<< * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) * */ __pyx_t_1 = ((PetscBool)__Pyx_PyInt_As_PetscBool(__pyx_v_refinementUniform)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 608, __pyx_L1_error) __pyx_v_flag = __pyx_t_1; /* "PETSc/DMPlex.pyx":609 * def setRefinementUniform(self, refinementUniform=True): * cdef PetscBool flag = refinementUniform * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) # <<<<<<<<<<<<<< * * def getRefinementUniform(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetRefinementUniform(__pyx_v_self->__pyx_base.dm, __pyx_v_flag)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 609, __pyx_L1_error) /* "PETSc/DMPlex.pyx":607 * # * * def setRefinementUniform(self, refinementUniform=True): # <<<<<<<<<<<<<< * cdef PetscBool flag = refinementUniform * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":611 * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) * * def getRefinementUniform(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_135getRefinementUniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_134getRefinementUniform[] = "DMPlex.getRefinementUniform(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_135getRefinementUniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefinementUniform (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRefinementUniform", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefinementUniform", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_134getRefinementUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_134getRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscBool __pyx_v_flag; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefinementUniform", 0); /* "PETSc/DMPlex.pyx":612 * * def getRefinementUniform(self): * cdef PetscBool flag = PETSC_FALSE # <<<<<<<<<<<<<< * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) * return toBool(flag) */ __pyx_v_flag = PETSC_FALSE; /* "PETSc/DMPlex.pyx":613 * def getRefinementUniform(self): * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) # <<<<<<<<<<<<<< * return toBool(flag) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetRefinementUniform(__pyx_v_self->__pyx_base.dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 613, __pyx_L1_error) /* "PETSc/DMPlex.pyx":614 * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) * return toBool(flag) # <<<<<<<<<<<<<< * * def setRefinementLimit(self, refinementLimit): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":611 * CHKERR( DMPlexSetRefinementUniform(self.dm, flag) ) * * def getRefinementUniform(self): # <<<<<<<<<<<<<< * cdef PetscBool flag = PETSC_FALSE * CHKERR( DMPlexGetRefinementUniform(self.dm, &flag) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getRefinementUniform", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":616 * return toBool(flag) * * def setRefinementLimit(self, refinementLimit): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(refinementLimit) * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_137setRefinementLimit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_136setRefinementLimit[] = "DMPlex.setRefinementLimit(self, refinementLimit)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_137setRefinementLimit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_refinementLimit = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefinementLimit (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refinementLimit,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_refinementLimit)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRefinementLimit") < 0)) __PYX_ERR(48, 616, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_refinementLimit = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefinementLimit", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 616, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementLimit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_136setRefinementLimit(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_refinementLimit); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_136setRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementLimit) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefinementLimit", 0); /* "PETSc/DMPlex.pyx":617 * * def setRefinementLimit(self, refinementLimit): * cdef PetscReal rval = asReal(refinementLimit) # <<<<<<<<<<<<<< * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_refinementLimit); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(48, 617, __pyx_L1_error) __pyx_v_rval = __pyx_t_1; /* "PETSc/DMPlex.pyx":618 * def setRefinementLimit(self, refinementLimit): * cdef PetscReal rval = asReal(refinementLimit) * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) # <<<<<<<<<<<<<< * * def getRefinementLimit(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetRefinementLimit(__pyx_v_self->__pyx_base.dm, __pyx_v_rval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 618, __pyx_L1_error) /* "PETSc/DMPlex.pyx":616 * return toBool(flag) * * def setRefinementLimit(self, refinementLimit): # <<<<<<<<<<<<<< * cdef PetscReal rval = asReal(refinementLimit) * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setRefinementLimit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":620 * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) * * def getRefinementLimit(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0.0 * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_139getRefinementLimit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_138getRefinementLimit[] = "DMPlex.getRefinementLimit(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_139getRefinementLimit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getRefinementLimit (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getRefinementLimit", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getRefinementLimit", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_138getRefinementLimit(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_138getRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) { PetscReal __pyx_v_rval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getRefinementLimit", 0); /* "PETSc/DMPlex.pyx":621 * * def getRefinementLimit(self): * cdef PetscReal rval = 0.0 # <<<<<<<<<<<<<< * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) * return toReal(rval) */ __pyx_v_rval = 0.0; /* "PETSc/DMPlex.pyx":622 * def getRefinementLimit(self): * cdef PetscReal rval = 0.0 * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) # <<<<<<<<<<<<<< * return toReal(rval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetRefinementLimit(__pyx_v_self->__pyx_base.dm, (&__pyx_v_rval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(48, 622, __pyx_L1_error) /* "PETSc/DMPlex.pyx":623 * cdef PetscReal rval = 0.0 * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) * return toReal(rval) # <<<<<<<<<<<<<< * * def getOrdering(self, otype): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":620 * CHKERR( DMPlexSetRefinementLimit(self.dm, rval) ) * * def getRefinementLimit(self): # <<<<<<<<<<<<<< * cdef PetscReal rval = 0.0 * CHKERR( DMPlexGetRefinementLimit(self.dm, &rval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getRefinementLimit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":625 * return toReal(rval) * * def getOrdering(self, otype): # <<<<<<<<<<<<<< * cdef PetscMatOrderingType cval = NULL * cdef PetscDMLabel label = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_141getOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_140getOrdering[] = "DMPlex.getOrdering(self, otype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_141getOrdering(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_otype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOrdering (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_otype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_otype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOrdering") < 0)) __PYX_ERR(48, 625, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_otype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 625, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_140getOrdering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_otype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_140getOrdering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_otype) { MatOrderingType __pyx_v_cval; DMLabel __pyx_v_label; struct PyPetscISObject *__pyx_v_perm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOrdering", 0); __Pyx_INCREF(__pyx_v_otype); /* "PETSc/DMPlex.pyx":626 * * def getOrdering(self, otype): * cdef PetscMatOrderingType cval = NULL # <<<<<<<<<<<<<< * cdef PetscDMLabel label = NULL * otype = str2bytes(otype, &cval) */ __pyx_v_cval = NULL; /* "PETSc/DMPlex.pyx":627 * def getOrdering(self, otype): * cdef PetscMatOrderingType cval = NULL * cdef PetscDMLabel label = NULL # <<<<<<<<<<<<<< * otype = str2bytes(otype, &cval) * cdef IS perm = IS() */ __pyx_v_label = NULL; /* "PETSc/DMPlex.pyx":628 * cdef PetscMatOrderingType cval = NULL * cdef PetscDMLabel label = NULL * otype = str2bytes(otype, &cval) # <<<<<<<<<<<<<< * cdef IS perm = IS() * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_otype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_otype, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":629 * cdef PetscDMLabel label = NULL * otype = str2bytes(otype, &cval) * cdef IS perm = IS() # <<<<<<<<<<<<<< * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) * return perm */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_perm = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":630 * otype = str2bytes(otype, &cval) * cdef IS perm = IS() * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) # <<<<<<<<<<<<<< * return perm * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetOrdering(__pyx_v_self->__pyx_base.dm, __pyx_v_cval, __pyx_v_label, (&__pyx_v_perm->iset))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 630, __pyx_L1_error) /* "PETSc/DMPlex.pyx":631 * cdef IS perm = IS() * CHKERR( DMPlexGetOrdering(self.dm, cval, label, &perm.iset) ) * return perm # <<<<<<<<<<<<<< * * def permute(self, IS perm): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_perm)); __pyx_r = ((PyObject *)__pyx_v_perm); goto __pyx_L0; /* "PETSc/DMPlex.pyx":625 * return toReal(rval) * * def getOrdering(self, otype): # <<<<<<<<<<<<<< * cdef PetscMatOrderingType cval = NULL * cdef PetscDMLabel label = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getOrdering", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_perm); __Pyx_XDECREF(__pyx_v_otype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":633 * return perm * * def permute(self, IS perm): # <<<<<<<<<<<<<< * cdef DMPlex dm = type(self)() * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_143permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_142permute[] = "DMPlex.permute(self, IS perm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_143permute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_perm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("permute (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_perm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_perm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "permute") < 0)) __PYX_ERR(48, 633, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_perm = ((struct PyPetscISObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("permute", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 633, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_perm), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "perm", 0))) __PYX_ERR(48, 633, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_142permute(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_perm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_142permute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm) { struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("permute", 0); /* "PETSc/DMPlex.pyx":634 * * def permute(self, IS perm): * cdef DMPlex dm = type(self)() # <<<<<<<<<<<<<< * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) * return dm */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_2 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dm = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMPlex.pyx":635 * def permute(self, IS perm): * cdef DMPlex dm = type(self)() * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) # <<<<<<<<<<<<<< * return dm * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexPermute(__pyx_v_self->__pyx_base.dm, __pyx_v_perm->iset, (&__pyx_v_dm->__pyx_base.dm))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(48, 635, __pyx_L1_error) /* "PETSc/DMPlex.pyx":636 * cdef DMPlex dm = type(self)() * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) * return dm # <<<<<<<<<<<<<< * * # */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/DMPlex.pyx":633 * return perm * * def permute(self, IS perm): # <<<<<<<<<<<<<< * cdef DMPlex dm = type(self)() * CHKERR( DMPlexPermute(self.dm, perm.iset, &dm.dm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.permute", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":640 * # * * def computeCellGeometryFVM(self, cell): # <<<<<<<<<<<<<< * cdef PetscInt cdim = 0 * cdef PetscInt ccell = asInt(cell) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_145computeCellGeometryFVM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_144computeCellGeometryFVM[] = "DMPlex.computeCellGeometryFVM(self, cell)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_145computeCellGeometryFVM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cell = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("computeCellGeometryFVM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cell,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cell)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "computeCellGeometryFVM") < 0)) __PYX_ERR(48, 640, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_cell = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("computeCellGeometryFVM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 640, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.computeCellGeometryFVM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_144computeCellGeometryFVM(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_cell); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_144computeCellGeometryFVM(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cell) { PetscInt __pyx_v_cdim; PetscInt __pyx_v_ccell; PetscReal __pyx_v_vol; PetscReal __pyx_v_centroid[3]; PetscReal __pyx_v_normal[3]; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("computeCellGeometryFVM", 0); /* "PETSc/DMPlex.pyx":641 * * def computeCellGeometryFVM(self, cell): * cdef PetscInt cdim = 0 # <<<<<<<<<<<<<< * cdef PetscInt ccell = asInt(cell) * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) */ __pyx_v_cdim = 0; /* "PETSc/DMPlex.pyx":642 * def computeCellGeometryFVM(self, cell): * cdef PetscInt cdim = 0 * cdef PetscInt ccell = asInt(cell) # <<<<<<<<<<<<<< * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) * cdef PetscReal vol = 0, centroid[3], normal[3] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cell); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 642, __pyx_L1_error) __pyx_v_ccell = __pyx_t_1; /* "PETSc/DMPlex.pyx":643 * cdef PetscInt cdim = 0 * cdef PetscInt ccell = asInt(cell) * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) # <<<<<<<<<<<<<< * cdef PetscReal vol = 0, centroid[3], normal[3] * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateDim(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cdim))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 643, __pyx_L1_error) /* "PETSc/DMPlex.pyx":644 * cdef PetscInt ccell = asInt(cell) * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) * cdef PetscReal vol = 0, centroid[3], normal[3] # <<<<<<<<<<<<<< * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) */ __pyx_v_vol = 0.0; /* "PETSc/DMPlex.pyx":645 * CHKERR( DMGetCoordinateDim(self.dm, &cdim) ) * cdef PetscReal vol = 0, centroid[3], normal[3] * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) # <<<<<<<<<<<<<< * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexComputeCellGeometryFVM(__pyx_v_self->__pyx_base.dm, __pyx_v_ccell, (&__pyx_v_vol), __pyx_v_centroid, __pyx_v_normal)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 645, __pyx_L1_error) /* "PETSc/DMPlex.pyx":646 * cdef PetscReal vol = 0, centroid[3], normal[3] * CHKERR( DMPlexComputeCellGeometryFVM(self.dm, ccell, &vol, centroid, normal) ) * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) # <<<<<<<<<<<<<< * * def constructGhostCells(self, labelName=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_vol); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_cdim, __pyx_v_centroid)); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_cdim, __pyx_v_normal)); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":640 * # * * def computeCellGeometryFVM(self, cell): # <<<<<<<<<<<<<< * cdef PetscInt cdim = 0 * cdef PetscInt ccell = asInt(cell) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.computeCellGeometryFVM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMPlex.pyx":648 * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) * * def constructGhostCells(self, labelName=None): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * labelName = str2bytes(labelName, &cname) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_147constructGhostCells(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMPlex_146constructGhostCells[] = "DMPlex.constructGhostCells(self, labelName=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_147constructGhostCells(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_labelName = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("constructGhostCells (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_labelName,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_labelName); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "constructGhostCells") < 0)) __PYX_ERR(48, 648, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_labelName = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("constructGhostCells", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(48, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.constructGhostCells", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_146constructGhostCells(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_labelName); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_146constructGhostCells(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_labelName) { char const *__pyx_v_cname; PetscInt __pyx_v_numGhostCells; DM __pyx_v_dmGhosted; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("constructGhostCells", 0); __Pyx_INCREF(__pyx_v_labelName); /* "PETSc/DMPlex.pyx":649 * * def constructGhostCells(self, labelName=None): * cdef const char *cname = NULL # <<<<<<<<<<<<<< * labelName = str2bytes(labelName, &cname) * cdef PetscInt numGhostCells = 0 */ __pyx_v_cname = NULL; /* "PETSc/DMPlex.pyx":650 * def constructGhostCells(self, labelName=None): * cdef const char *cname = NULL * labelName = str2bytes(labelName, &cname) # <<<<<<<<<<<<<< * cdef PetscInt numGhostCells = 0 * cdef PetscDM dmGhosted = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_labelName, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_labelName, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMPlex.pyx":651 * cdef const char *cname = NULL * labelName = str2bytes(labelName, &cname) * cdef PetscInt numGhostCells = 0 # <<<<<<<<<<<<<< * cdef PetscDM dmGhosted = NULL * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) */ __pyx_v_numGhostCells = 0; /* "PETSc/DMPlex.pyx":652 * labelName = str2bytes(labelName, &cname) * cdef PetscInt numGhostCells = 0 * cdef PetscDM dmGhosted = NULL # <<<<<<<<<<<<<< * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) * PetscCLEAR(self.obj); self.dm = dmGhosted */ __pyx_v_dmGhosted = NULL; /* "PETSc/DMPlex.pyx":653 * cdef PetscInt numGhostCells = 0 * cdef PetscDM dmGhosted = NULL * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = dmGhosted * return toInt(numGhostCells) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexConstructGhostCells(__pyx_v_self->__pyx_base.dm, __pyx_v_cname, (&__pyx_v_numGhostCells), (&__pyx_v_dmGhosted))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(48, 653, __pyx_L1_error) /* "PETSc/DMPlex.pyx":654 * cdef PetscDM dmGhosted = NULL * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) * PetscCLEAR(self.obj); self.dm = dmGhosted # <<<<<<<<<<<<<< * return toInt(numGhostCells) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_dmGhosted; /* "PETSc/DMPlex.pyx":655 * CHKERR( DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted)) * PetscCLEAR(self.obj); self.dm = dmGhosted * return toInt(numGhostCells) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numGhostCells); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMPlex.pyx":648 * return (toReal(vol), array_r(cdim, centroid), array_r(cdim, normal)) * * def constructGhostCells(self, labelName=None): # <<<<<<<<<<<<<< * cdef const char *cname = NULL * labelName = str2bytes(labelName, &cname) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.constructGhostCells", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_labelName); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":45 * StencilLocation = DMStagStencilLocation * * def create(self, dim, dofs=None, sizes=None, boundary_types=None, stencil_type=None, stencil_width=None, proc_sizes=None, ownership_ranges=None, comm=None, setUp=False): # <<<<<<<<<<<<<< * * # ndim */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_create[] = "DMStag.create(self, dim, dofs=None, sizes=None, boundary_types=None, stencil_type=None, stencil_width=None, proc_sizes=None, ownership_ranges=None, comm=None, setUp=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dim = 0; PyObject *__pyx_v_dofs = 0; PyObject *__pyx_v_sizes = 0; PyObject *__pyx_v_boundary_types = 0; PyObject *__pyx_v_stencil_type = 0; PyObject *__pyx_v_stencil_width = 0; PyObject *__pyx_v_proc_sizes = 0; PyObject *__pyx_v_ownership_ranges = 0; PyObject *__pyx_v_comm = 0; PyObject *__pyx_v_setUp = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,&__pyx_n_s_dofs,&__pyx_n_s_sizes,&__pyx_n_s_boundary_types,&__pyx_n_s_stencil_type,&__pyx_n_s_stencil_width,&__pyx_n_s_proc_sizes,&__pyx_n_s_ownership_ranges,&__pyx_n_s_comm,&__pyx_n_s_setUp,0}; PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); values[6] = ((PyObject *)Py_None); values[7] = ((PyObject *)Py_None); values[8] = ((PyObject *)Py_None); values[9] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dofs); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sizes); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boundary_types); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_type); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stencil_width); if (value) { values[5] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_proc_sizes); if (value) { values[6] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ownership_ranges); if (value) { values[7] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 8: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[8] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 9: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_setUp); if (value) { values[9] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(49, 45, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9); CYTHON_FALLTHROUGH; case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_dim = values[0]; __pyx_v_dofs = values[1]; __pyx_v_sizes = values[2]; __pyx_v_boundary_types = values[3]; __pyx_v_stencil_type = values[4]; __pyx_v_stencil_width = values[5]; __pyx_v_proc_sizes = values[6]; __pyx_v_ownership_ranges = values[7]; __pyx_v_comm = values[8]; __pyx_v_setUp = values[9]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 45, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_create(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dim, __pyx_v_dofs, __pyx_v_sizes, __pyx_v_boundary_types, __pyx_v_stencil_type, __pyx_v_stencil_width, __pyx_v_proc_sizes, __pyx_v_ownership_ranges, __pyx_v_comm, __pyx_v_setUp); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_create(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_dofs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_boundary_types, PyObject *__pyx_v_stencil_type, PyObject *__pyx_v_stencil_width, PyObject *__pyx_v_proc_sizes, PyObject *__pyx_v_ownership_ranges, PyObject *__pyx_v_comm, PyObject *__pyx_v_setUp) { PetscInt __pyx_v_ndim; PyObject *__pyx_v_gsizes = 0; PetscInt __pyx_v_nsizes; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PyObject *__pyx_v_cdofs = 0; PetscInt __pyx_v_ndofs; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PetscInt __pyx_v_swidth; DMStagStencilType __pyx_v_stype; MPI_Comm __pyx_v_ccomm; PyObject *__pyx_v_psizes = 0; PetscInt __pyx_v_nprocs; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt *__pyx_v_lx; PetscInt *__pyx_v_ly; PetscInt *__pyx_v_lz; PyObject *__pyx_v_nranges = NULL; DM __pyx_v_newda; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; DMStagStencilType __pyx_t_4; MPI_Comm __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DMStag.pyx":48 * * # ndim * cdef PetscInt ndim = asInt(dim) # <<<<<<<<<<<<<< * * # sizes */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 48, __pyx_L1_error) __pyx_v_ndim = __pyx_t_1; /* "PETSc/DMStag.pyx":51 * * # sizes * cdef object gsizes = sizes # <<<<<<<<<<<<<< * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: */ __Pyx_INCREF(__pyx_v_sizes); __pyx_v_gsizes = __pyx_v_sizes; /* "PETSc/DMStag.pyx":52 * # sizes * cdef object gsizes = sizes * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 # <<<<<<<<<<<<<< * if sizes is not None: * nsizes = asStagDims(gsizes, &M, &N, &P) */ __pyx_v_nsizes = PETSC_DECIDE; __pyx_v_M = 1; __pyx_v_N = 1; __pyx_v_P = 1; /* "PETSc/DMStag.pyx":53 * cdef object gsizes = sizes * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: # <<<<<<<<<<<<<< * nsizes = asStagDims(gsizes, &M, &N, &P) * assert(nsizes==ndim) */ __pyx_t_2 = (__pyx_v_sizes != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/DMStag.pyx":54 * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: * nsizes = asStagDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * assert(nsizes==ndim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 54, __pyx_L1_error) __pyx_v_nsizes = __pyx_t_1; /* "PETSc/DMStag.pyx":55 * if sizes is not None: * nsizes = asStagDims(gsizes, &M, &N, &P) * assert(nsizes==ndim) # <<<<<<<<<<<<<< * * # dofs */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_nsizes == __pyx_v_ndim) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(49, 55, __pyx_L1_error) } } #endif /* "PETSc/DMStag.pyx":53 * cdef object gsizes = sizes * cdef PetscInt nsizes=PETSC_DECIDE, M=1, N=1, P=1 * if sizes is not None: # <<<<<<<<<<<<<< * nsizes = asStagDims(gsizes, &M, &N, &P) * assert(nsizes==ndim) */ } /* "PETSc/DMStag.pyx":58 * * # dofs * cdef object cdofs = dofs # <<<<<<<<<<<<<< * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: */ __Pyx_INCREF(__pyx_v_dofs); __pyx_v_cdofs = __pyx_v_dofs; /* "PETSc/DMStag.pyx":59 * # dofs * cdef object cdofs = dofs * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * if dofs is not None: * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) */ __pyx_v_ndofs = PETSC_DECIDE; __pyx_v_dof0 = 1; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "PETSc/DMStag.pyx":60 * cdef object cdofs = dofs * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: # <<<<<<<<<<<<<< * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) * assert(ndofs==ndim+1) */ __pyx_t_3 = (__pyx_v_dofs != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/DMStag.pyx":61 * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) # <<<<<<<<<<<<<< * assert(ndofs==ndim+1) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asDofs(__pyx_v_cdofs, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 61, __pyx_L1_error) __pyx_v_ndofs = __pyx_t_1; /* "PETSc/DMStag.pyx":62 * if dofs is not None: * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) * assert(ndofs==ndim+1) # <<<<<<<<<<<<<< * * # boundary types */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_ndofs == (__pyx_v_ndim + 1)) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(49, 62, __pyx_L1_error) } } #endif /* "PETSc/DMStag.pyx":60 * cdef object cdofs = dofs * cdef PetscInt ndofs=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * if dofs is not None: # <<<<<<<<<<<<<< * ndofs = asDofs(cdofs, &dof0, &dof1, &dof2, &dof3) * assert(ndofs==ndim+1) */ } /* "PETSc/DMStag.pyx":65 * * # boundary types * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":66 * # boundary types * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":67 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * asBoundary(boundary_types, &btx, &bty, &btz) * */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":68 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) # <<<<<<<<<<<<<< * * # stencil */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_types, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L))) __PYX_ERR(49, 68, __pyx_L1_error) /* "PETSc/DMStag.pyx":71 * * # stencil * cdef PetscInt swidth = 0 # <<<<<<<<<<<<<< * if stencil_width is not None: * swidth = asInt(stencil_width) */ __pyx_v_swidth = 0; /* "PETSc/DMStag.pyx":72 * # stencil * cdef PetscInt swidth = 0 * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE */ __pyx_t_2 = (__pyx_v_stencil_width != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/DMStag.pyx":73 * cdef PetscInt swidth = 0 * if stencil_width is not None: * swidth = asInt(stencil_width) # <<<<<<<<<<<<<< * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_stencil_width); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 73, __pyx_L1_error) __pyx_v_swidth = __pyx_t_1; /* "PETSc/DMStag.pyx":72 * # stencil * cdef PetscInt swidth = 0 * if stencil_width is not None: # <<<<<<<<<<<<<< * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE */ } /* "PETSc/DMStag.pyx":74 * if stencil_width is not None: * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE # <<<<<<<<<<<<<< * if stencil_type is not None: * stype = asStagStencil(stencil_type) */ __pyx_v_stype = DMSTAG_STENCIL_NONE; /* "PETSc/DMStag.pyx":75 * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStagStencil(stencil_type) * */ __pyx_t_3 = (__pyx_v_stencil_type != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/DMStag.pyx":76 * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: * stype = asStagStencil(stencil_type) # <<<<<<<<<<<<<< * * # comm */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asStagStencil(__pyx_v_stencil_type); if (unlikely(__pyx_t_4 == ((DMStagStencilType)((DMStagStencilType)-1L)))) __PYX_ERR(49, 76, __pyx_L1_error) __pyx_v_stype = __pyx_t_4; /* "PETSc/DMStag.pyx":75 * swidth = asInt(stencil_width) * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE * if stencil_type is not None: # <<<<<<<<<<<<<< * stype = asStagStencil(stencil_type) * */ } /* "PETSc/DMStag.pyx":79 * * # comm * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * * # proc sizes */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 79, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_5; /* "PETSc/DMStag.pyx":82 * * # proc sizes * cdef object psizes = proc_sizes # <<<<<<<<<<<<<< * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: */ __Pyx_INCREF(__pyx_v_proc_sizes); __pyx_v_psizes = __pyx_v_proc_sizes; /* "PETSc/DMStag.pyx":83 * # proc sizes * cdef object psizes = proc_sizes * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * if proc_sizes is not None: * nprocs = asStagDims(psizes, &m, &n, &p) */ __pyx_v_nprocs = PETSC_DECIDE; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMStag.pyx":84 * cdef object psizes = proc_sizes * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: # <<<<<<<<<<<<<< * nprocs = asStagDims(psizes, &m, &n, &p) * assert(nprocs==ndim) */ __pyx_t_2 = (__pyx_v_proc_sizes != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/DMStag.pyx":85 * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: * nprocs = asStagDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * assert(nprocs==ndim) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 85, __pyx_L1_error) __pyx_v_nprocs = __pyx_t_1; /* "PETSc/DMStag.pyx":86 * if proc_sizes is not None: * nprocs = asStagDims(psizes, &m, &n, &p) * assert(nprocs==ndim) # <<<<<<<<<<<<<< * * # ownership ranges */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_nprocs == __pyx_v_ndim) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(49, 86, __pyx_L1_error) } } #endif /* "PETSc/DMStag.pyx":84 * cdef object psizes = proc_sizes * cdef PetscInt nprocs=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * if proc_sizes is not None: # <<<<<<<<<<<<<< * nprocs = asStagDims(psizes, &m, &n, &p) * assert(nprocs==ndim) */ } /* "PETSc/DMStag.pyx":89 * * # ownership ranges * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * if ownership_ranges is not None: * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "PETSc/DMStag.pyx":90 * # ownership ranges * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * if ownership_ranges is not None: # <<<<<<<<<<<<<< * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) * assert(nranges==ndim) */ __pyx_t_3 = (__pyx_v_ownership_ranges != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "PETSc/DMStag.pyx":91 * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * if ownership_ranges is not None: * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) # <<<<<<<<<<<<<< * assert(nranges==ndim) * */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(__pyx_v_ownership_ranges, __pyx_v_ndim, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz)); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_nranges = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "PETSc/DMStag.pyx":92 * if ownership_ranges is not None: * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) * assert(nranges==ndim) # <<<<<<<<<<<<<< * * # create */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_v_nranges, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(49, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(49, 92, __pyx_L1_error) } } #endif /* "PETSc/DMStag.pyx":90 * # ownership ranges * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * if ownership_ranges is not None: # <<<<<<<<<<<<<< * nranges = asStagOwnershipRanges(ownership_ranges, ndim, &m, &n, &p, &lx, &ly, &lz) * assert(nranges==ndim) */ } /* "PETSc/DMStag.pyx":95 * * # create * cdef PetscDM newda = NULL # <<<<<<<<<<<<<< * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) */ __pyx_v_newda = NULL; /* "PETSc/DMStag.pyx":96 * # create * cdef PetscDM newda = NULL * if dim == 1: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: */ __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_dim, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(49, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { /* "PETSc/DMStag.pyx":97 * cdef PetscDM newda = NULL * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) # <<<<<<<<<<<<<< * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreate1d(__pyx_v_ccomm, __pyx_v_btx, __pyx_v_M, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_stype, __pyx_v_swidth, __pyx_v_lx, (&__pyx_v_newda))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(49, 97, __pyx_L1_error) /* "PETSc/DMStag.pyx":96 * # create * cdef PetscDM newda = NULL * if dim == 1: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: */ } /* "PETSc/DMStag.pyx":98 * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: */ __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_dim, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(49, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { /* "PETSc/DMStag.pyx":99 * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) # <<<<<<<<<<<<<< * if dim == 3: * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreate2d(__pyx_v_ccomm, __pyx_v_btx, __pyx_v_bty, __pyx_v_M, __pyx_v_N, __pyx_v_m, __pyx_v_n, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_stype, __pyx_v_swidth, __pyx_v_lx, __pyx_v_ly, (&__pyx_v_newda))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(49, 99, __pyx_L1_error) /* "PETSc/DMStag.pyx":98 * if dim == 1: * CHKERR( DMStagCreate1d(ccomm, btx, M, dof0, dof1, stype, swidth, lx, &newda) ) * if dim == 2: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: */ } /* "PETSc/DMStag.pyx":100 * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * PetscCLEAR(self.obj); self.dm = newda */ __pyx_t_7 = __Pyx_PyInt_EqObjC(__pyx_v_dim, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(49, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_2) { /* "PETSc/DMStag.pyx":101 * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newda * if setUp: */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreate3d(__pyx_v_ccomm, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz, __pyx_v_M, __pyx_v_N, __pyx_v_P, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3, __pyx_v_stype, __pyx_v_swidth, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz, (&__pyx_v_newda))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(49, 101, __pyx_L1_error) /* "PETSc/DMStag.pyx":100 * if dim == 2: * CHKERR( DMStagCreate2d(ccomm, btx, bty, M, N, m, n, dof0, dof1, dof2, stype, swidth, lx, ly, &newda) ) * if dim == 3: # <<<<<<<<<<<<<< * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * PetscCLEAR(self.obj); self.dm = newda */ } /* "PETSc/DMStag.pyx":102 * if dim == 3: * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * PetscCLEAR(self.obj); self.dm = newda # <<<<<<<<<<<<<< * if setUp: * CHKERR( DMSetUp(self.dm) ) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newda; /* "PETSc/DMStag.pyx":103 * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * PetscCLEAR(self.obj); self.dm = newda * if setUp: # <<<<<<<<<<<<<< * CHKERR( DMSetUp(self.dm) ) * return self */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_setUp); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(49, 103, __pyx_L1_error) if (__pyx_t_2) { /* "PETSc/DMStag.pyx":104 * PetscCLEAR(self.obj); self.dm = newda * if setUp: * CHKERR( DMSetUp(self.dm) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUp(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(49, 104, __pyx_L1_error) /* "PETSc/DMStag.pyx":103 * CHKERR( DMStagCreate3d(ccomm, btx, bty, btz, M, N, P, m, n, p, dof0, dof1, dof2, dof3, stype, swidth, lx, ly, lz, &newda) ) * PetscCLEAR(self.obj); self.dm = newda * if setUp: # <<<<<<<<<<<<<< * CHKERR( DMSetUp(self.dm) ) * return self */ } /* "PETSc/DMStag.pyx":105 * if setUp: * CHKERR( DMSetUp(self.dm) ) * return self # <<<<<<<<<<<<<< * * # Setters */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMStag.pyx":45 * StencilLocation = DMStagStencilLocation * * def create(self, dim, dofs=None, sizes=None, boundary_types=None, stencil_type=None, stencil_width=None, proc_sizes=None, ownership_ranges=None, comm=None, setUp=False): # <<<<<<<<<<<<<< * * # ndim */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XDECREF(__pyx_v_cdofs); __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XDECREF(__pyx_v_nranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":109 * # Setters * * def setStencilWidth(self,swidth): # <<<<<<<<<<<<<< * cdef PetscInt sw = asInt(swidth) * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_2setStencilWidth[] = "DMStag.setStencilWidth(self, swidth)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_swidth = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilWidth (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_swidth,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_swidth)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStencilWidth") < 0)) __PYX_ERR(49, 109, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_swidth = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilWidth", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 109, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_2setStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_swidth); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_2setStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_swidth) { PetscInt __pyx_v_sw; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilWidth", 0); /* "PETSc/DMStag.pyx":110 * * def setStencilWidth(self,swidth): * cdef PetscInt sw = asInt(swidth) # <<<<<<<<<<<<<< * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_swidth); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 110, __pyx_L1_error) __pyx_v_sw = __pyx_t_1; /* "PETSc/DMStag.pyx":111 * def setStencilWidth(self,swidth): * cdef PetscInt sw = asInt(swidth) * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) # <<<<<<<<<<<<<< * * def setStencilType(self, stenciltype): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetStencilWidth(__pyx_v_self->__pyx_base.dm, __pyx_v_sw)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 111, __pyx_L1_error) /* "PETSc/DMStag.pyx":109 * # Setters * * def setStencilWidth(self,swidth): # <<<<<<<<<<<<<< * cdef PetscInt sw = asInt(swidth) * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":113 * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) * * def setStencilType(self, stenciltype): # <<<<<<<<<<<<<< * cdef PetscDMStagStencilType stype = asStagStencil(stenciltype) * CHKERR( DMStagSetStencilType(self.dm, stype) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_4setStencilType[] = "DMStag.setStencilType(self, stenciltype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_stenciltype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setStencilType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stenciltype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stenciltype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setStencilType") < 0)) __PYX_ERR(49, 113, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_stenciltype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setStencilType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 113, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_4setStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_stenciltype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4setStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_stenciltype) { DMStagStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMStagStencilType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setStencilType", 0); /* "PETSc/DMStag.pyx":114 * * def setStencilType(self, stenciltype): * cdef PetscDMStagStencilType stype = asStagStencil(stenciltype) # <<<<<<<<<<<<<< * CHKERR( DMStagSetStencilType(self.dm, stype) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagStencil(__pyx_v_stenciltype); if (unlikely(__pyx_t_1 == ((DMStagStencilType)((DMStagStencilType)-1L)))) __PYX_ERR(49, 114, __pyx_L1_error) __pyx_v_stype = __pyx_t_1; /* "PETSc/DMStag.pyx":115 * def setStencilType(self, stenciltype): * cdef PetscDMStagStencilType stype = asStagStencil(stenciltype) * CHKERR( DMStagSetStencilType(self.dm, stype) ) # <<<<<<<<<<<<<< * * def setBoundaryTypes(self, boundary_types): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetStencilType(__pyx_v_self->__pyx_base.dm, __pyx_v_stype)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 115, __pyx_L1_error) /* "PETSc/DMStag.pyx":113 * CHKERR( DMStagSetStencilWidth(self.dm, sw) ) * * def setStencilType(self, stenciltype): # <<<<<<<<<<<<<< * cdef PetscDMStagStencilType stype = asStagStencil(stenciltype) * CHKERR( DMStagSetStencilType(self.dm, stype) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":117 * CHKERR( DMStagSetStencilType(self.dm, stype) ) * * def setBoundaryTypes(self, boundary_types): # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes[] = "DMStag.setBoundaryTypes(self, boundary_types)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_boundary_types = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setBoundaryTypes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_boundary_types,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_boundary_types)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setBoundaryTypes") < 0)) __PYX_ERR(49, 117, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_boundary_types = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setBoundaryTypes", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 117, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_boundary_types); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_boundary_types) { DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setBoundaryTypes", 0); /* "PETSc/DMStag.pyx":118 * * def setBoundaryTypes(self, boundary_types): * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":119 * def setBoundaryTypes(self, boundary_types): * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":120 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * asBoundary(boundary_types, &btx, &bty, &btz) * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":121 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) # <<<<<<<<<<<<<< * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBoundary(__pyx_v_boundary_types, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz)); if (unlikely(__pyx_t_1 == ((PetscInt)-1L))) __PYX_ERR(49, 121, __pyx_L1_error) /* "PETSc/DMStag.pyx":122 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * asBoundary(boundary_types, &btx, &bty, &btz) * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) # <<<<<<<<<<<<<< * * def setDof(self, dofs): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetBoundaryTypes(__pyx_v_self->__pyx_base.dm, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 122, __pyx_L1_error) /* "PETSc/DMStag.pyx":117 * CHKERR( DMStagSetStencilType(self.dm, stype) ) * * def setBoundaryTypes(self, boundary_types): # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":124 * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) * * def setDof(self, dofs): # <<<<<<<<<<<<<< * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_8setDof[] = "DMStag.setDof(self, dofs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dofs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dofs,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dofs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setDof") < 0)) __PYX_ERR(49, 124, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dofs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 124, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_8setDof(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dofs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_8setDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs) { PyObject *__pyx_v_gdofs = 0; CYTHON_UNUSED PetscInt __pyx_v_gdim; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setDof", 0); /* "PETSc/DMStag.pyx":125 * * def setDof(self, dofs): * cdef tuple gdofs = tuple(dofs) # <<<<<<<<<<<<<< * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gdofs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMStag.pyx":126 * def setDof(self, dofs): * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) */ __pyx_v_gdim = PETSC_DECIDE; __pyx_v_dof0 = 1; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "PETSc/DMStag.pyx":127 * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) # <<<<<<<<<<<<<< * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDofs(__pyx_v_gdofs, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 127, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "PETSc/DMStag.pyx":128 * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) # <<<<<<<<<<<<<< * * def setGlobalSizes(self, sizes): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetDOF(__pyx_v_self->__pyx_base.dm, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(49, 128, __pyx_L1_error) /* "PETSc/DMStag.pyx":124 * CHKERR( DMStagSetBoundaryTypes(self.dm, btx, bty, btz) ) * * def setDof(self, dofs): # <<<<<<<<<<<<<< * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gdofs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":130 * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) * * def setGlobalSizes(self, sizes): # <<<<<<<<<<<<<< * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_10setGlobalSizes[] = "DMStag.setGlobalSizes(self, sizes)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sizes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sizes,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGlobalSizes") < 0)) __PYX_ERR(49, 130, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sizes = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalSizes", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 130, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setGlobalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_10setGlobalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_sizes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10setGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes) { PyObject *__pyx_v_gsizes = 0; CYTHON_UNUSED PetscInt __pyx_v_gdim; PetscInt __pyx_v_M; PetscInt __pyx_v_N; PetscInt __pyx_v_P; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalSizes", 0); /* "PETSc/DMStag.pyx":131 * * def setGlobalSizes(self, sizes): * cdef tuple gsizes = tuple(sizes) # <<<<<<<<<<<<<< * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 * gdim = asStagDims(gsizes, &M, &N, &P) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gsizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMStag.pyx":132 * def setGlobalSizes(self, sizes): * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 # <<<<<<<<<<<<<< * gdim = asStagDims(gsizes, &M, &N, &P) * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) */ __pyx_v_gdim = PETSC_DECIDE; __pyx_v_M = 1; __pyx_v_N = 1; __pyx_v_P = 1; /* "PETSc/DMStag.pyx":133 * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 * gdim = asStagDims(gsizes, &M, &N, &P) # <<<<<<<<<<<<<< * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_gsizes, (&__pyx_v_M), (&__pyx_v_N), (&__pyx_v_P)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 133, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "PETSc/DMStag.pyx":134 * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 * gdim = asStagDims(gsizes, &M, &N, &P) * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) # <<<<<<<<<<<<<< * * def setProcSizes(self, sizes): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetGlobalSizes(__pyx_v_self->__pyx_base.dm, __pyx_v_M, __pyx_v_N, __pyx_v_P)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(49, 134, __pyx_L1_error) /* "PETSc/DMStag.pyx":130 * CHKERR( DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3) ) * * def setGlobalSizes(self, sizes): # <<<<<<<<<<<<<< * cdef tuple gsizes = tuple(sizes) * cdef PetscInt gdim=PETSC_DECIDE, M=1, N=1, P=1 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setGlobalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gsizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":136 * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) * * def setProcSizes(self, sizes): # <<<<<<<<<<<<<< * cdef tuple psizes = tuple(sizes) * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_12setProcSizes[] = "DMStag.setProcSizes(self, sizes)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_sizes = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setProcSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sizes,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sizes)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setProcSizes") < 0)) __PYX_ERR(49, 136, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_sizes = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setProcSizes", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 136, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_12setProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_sizes); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12setProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_sizes) { PyObject *__pyx_v_psizes = 0; CYTHON_UNUSED PetscInt __pyx_v_pdim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setProcSizes", 0); /* "PETSc/DMStag.pyx":137 * * def setProcSizes(self, sizes): * cdef tuple psizes = tuple(sizes) # <<<<<<<<<<<<<< * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * pdim = asStagDims(psizes, &m, &n, &p) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_psizes = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMStag.pyx":138 * def setProcSizes(self, sizes): * cdef tuple psizes = tuple(sizes) * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * pdim = asStagDims(psizes, &m, &n, &p) * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) */ __pyx_v_pdim = PETSC_DECIDE; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMStag.pyx":139 * cdef tuple psizes = tuple(sizes) * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * pdim = asStagDims(psizes, &m, &n, &p) # <<<<<<<<<<<<<< * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagDims(__pyx_v_psizes, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 139, __pyx_L1_error) __pyx_v_pdim = __pyx_t_2; /* "PETSc/DMStag.pyx":140 * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * pdim = asStagDims(psizes, &m, &n, &p) * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) # <<<<<<<<<<<<<< * * def setOwnershipRanges(self, ranges): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetNumRanks(__pyx_v_self->__pyx_base.dm, __pyx_v_m, __pyx_v_n, __pyx_v_p)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(49, 140, __pyx_L1_error) /* "PETSc/DMStag.pyx":136 * CHKERR( DMStagSetGlobalSizes(self.dm, M, N, P) ) * * def setProcSizes(self, sizes): # <<<<<<<<<<<<<< * cdef tuple psizes = tuple(sizes) * cdef PetscInt pdim=PETSC_DECIDE, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_psizes); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":142 * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) * * def setOwnershipRanges(self, ranges): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges[] = "DMStag.setOwnershipRanges(self, ranges)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ranges = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setOwnershipRanges (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ranges,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ranges)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setOwnershipRanges") < 0)) __PYX_ERR(49, 142, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ranges = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setOwnershipRanges", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 142, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_ranges); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_ranges) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt *__pyx_v_lx; PetscInt *__pyx_v_ly; PetscInt *__pyx_v_lz; CYTHON_UNUSED PyObject *__pyx_v_ownership_ranges = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setOwnershipRanges", 0); /* "PETSc/DMStag.pyx":143 * * def setOwnershipRanges(self, ranges): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMStag.pyx":144 * def setOwnershipRanges(self, ranges): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "PETSc/DMStag.pyx":145 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 145, __pyx_L1_error) /* "PETSc/DMStag.pyx":146 * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) * CHKERR( DMStagSetOwnershipRanges(self.dm, lx, ly, lz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetNumRanks(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 146, __pyx_L1_error) /* "PETSc/DMStag.pyx":147 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) # <<<<<<<<<<<<<< * CHKERR( DMStagSetOwnershipRanges(self.dm, lx, ly, lz) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagOwnershipRanges(__pyx_v_ranges, __pyx_v_dim, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz)); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_ownership_ranges = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMStag.pyx":148 * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * ownership_ranges = asStagOwnershipRanges(ranges, dim, &m, &n, &p, &lx, &ly, &lz) * CHKERR( DMStagSetOwnershipRanges(self.dm, lx, ly, lz) ) # <<<<<<<<<<<<<< * * # Getters */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetOwnershipRanges(__pyx_v_self->__pyx_base.dm, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 148, __pyx_L1_error) /* "PETSc/DMStag.pyx":142 * CHKERR( DMStagSetNumRanks(self.dm, m, n, p) ) * * def setOwnershipRanges(self, ranges): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_ownership_ranges); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":152 * # Getters * * def getDim(self): # <<<<<<<<<<<<<< * return self.getDimension() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_16getDim[] = "DMStag.getDim(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDim (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDim", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDim", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_16getDim(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_16getDim(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDim", 0); /* "PETSc/DMStag.pyx":153 * * def getDim(self): * return self.getDimension() # <<<<<<<<<<<<<< * * def getEntriesPerElement(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDimension); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":152 * # Getters * * def getDim(self): # <<<<<<<<<<<<<< * return self.getDimension() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getDim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":155 * return self.getDimension() * * def getEntriesPerElement(self): # <<<<<<<<<<<<<< * cdef PetscInt epe=0 * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement[] = "DMStag.getEntriesPerElement(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getEntriesPerElement (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getEntriesPerElement", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getEntriesPerElement", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_epe; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getEntriesPerElement", 0); /* "PETSc/DMStag.pyx":156 * * def getEntriesPerElement(self): * cdef PetscInt epe=0 # <<<<<<<<<<<<<< * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) * return toInt(epe) */ __pyx_v_epe = 0; /* "PETSc/DMStag.pyx":157 * def getEntriesPerElement(self): * cdef PetscInt epe=0 * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) # <<<<<<<<<<<<<< * return toInt(epe) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetEntriesPerElement(__pyx_v_self->__pyx_base.dm, (&__pyx_v_epe))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 157, __pyx_L1_error) /* "PETSc/DMStag.pyx":158 * cdef PetscInt epe=0 * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) * return toInt(epe) # <<<<<<<<<<<<<< * * def getStencilWidth(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_epe); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":155 * return self.getDimension() * * def getEntriesPerElement(self): # <<<<<<<<<<<<<< * cdef PetscInt epe=0 * CHKERR( DMStagGetEntriesPerElement(self.dm, &epe) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getEntriesPerElement", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":160 * return toInt(epe) * * def getStencilWidth(self): # <<<<<<<<<<<<<< * cdef PetscInt swidth=0 * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_20getStencilWidth[] = "DMStag.getStencilWidth(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilWidth (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilWidth", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilWidth", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_20getStencilWidth(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_20getStencilWidth(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_swidth; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilWidth", 0); /* "PETSc/DMStag.pyx":161 * * def getStencilWidth(self): * cdef PetscInt swidth=0 # <<<<<<<<<<<<<< * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) * return toInt(swidth) */ __pyx_v_swidth = 0; /* "PETSc/DMStag.pyx":162 * def getStencilWidth(self): * cdef PetscInt swidth=0 * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) # <<<<<<<<<<<<<< * return toInt(swidth) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetStencilWidth(__pyx_v_self->__pyx_base.dm, (&__pyx_v_swidth))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 162, __pyx_L1_error) /* "PETSc/DMStag.pyx":163 * cdef PetscInt swidth=0 * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) * return toInt(swidth) # <<<<<<<<<<<<<< * * def getDof(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_swidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":160 * return toInt(epe) * * def getStencilWidth(self): # <<<<<<<<<<<<<< * cdef PetscInt swidth=0 * CHKERR( DMStagGetStencilWidth(self.dm, &swidth) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getStencilWidth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":165 * return toInt(swidth) * * def getDof(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_22getDof[] = "DMStag.getDof(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getDof (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getDof", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getDof", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_22getDof(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_22getDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getDof", 0); /* "PETSc/DMStag.pyx":166 * * def getDof(self): * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_dim = 0; __pyx_v_dof0 = 0; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "PETSc/DMStag.pyx":167 * def getDof(self): * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * return toDofs(dim+1,dof0,dof1,dof2,dof3) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetDOF(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 167, __pyx_L1_error) /* "PETSc/DMStag.pyx":168 * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * return toDofs(dim+1,dof0,dof1,dof2,dof3) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 168, __pyx_L1_error) /* "PETSc/DMStag.pyx":169 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) * CHKERR( DMGetDimension(self.dm, &dim) ) * return toDofs(dim+1,dof0,dof1,dof2,dof3) # <<<<<<<<<<<<<< * * def getCorners(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toDofs((__pyx_v_dim + 1), __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":165 * return toInt(swidth) * * def getDof(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, dof0=0, dof1=0, dof2=0, dof3=0 * CHKERR( DMStagGetDOF(self.dm, &dof0, &dof1, &dof2, &dof3) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":171 * return toDofs(dim+1,dof0,dof1,dof2,dof3) * * def getCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_24getCorners[] = "DMStag.getCorners(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCorners (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCorners", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_24getCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_24getCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt __pyx_v_nExtrax; PetscInt __pyx_v_nExtray; PetscInt __pyx_v_nExtraz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCorners", 0); /* "PETSc/DMStag.pyx":172 * * def getCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; __pyx_v_nExtrax = 0; __pyx_v_nExtray = 0; __pyx_v_nExtraz = 0; /* "PETSc/DMStag.pyx":173 * def getCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 173, __pyx_L1_error) /* "PETSc/DMStag.pyx":174 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) # <<<<<<<<<<<<<< * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p), (&__pyx_v_nExtrax), (&__pyx_v_nExtray), (&__pyx_v_nExtraz))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 174, __pyx_L1_error) /* "PETSc/DMStag.pyx":175 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetCorners(self.dm, &x, &y, &z, &m, &n, &p, &nExtrax, &nExtray, &nExtraz) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] # <<<<<<<<<<<<<< * * def getGhostCorners(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_5); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_6); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_PetscInt(__pyx_v_nExtrax); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_7); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_nExtray); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_nExtraz); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_6); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); __pyx_t_7 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(49, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":171 * return toDofs(dim+1,dof0,dof1,dof2,dof3) * * def getCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0, nExtrax=0, nExtray=0, nExtraz=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":177 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] * * def getGhostCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_26getGhostCorners[] = "DMStag.getGhostCorners(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGhostCorners (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGhostCorners", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGhostCorners", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_26getGhostCorners(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_26getGhostCorners(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_x; PetscInt __pyx_v_y; PetscInt __pyx_v_z; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGhostCorners", 0); /* "PETSc/DMStag.pyx":178 * * def getGhostCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_x = 0; __pyx_v_y = 0; __pyx_v_z = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "PETSc/DMStag.pyx":179 * def getGhostCorners(self): * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 179, __pyx_L1_error) /* "PETSc/DMStag.pyx":180 * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) # <<<<<<<<<<<<<< * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetGhostCorners(__pyx_v_self->__pyx_base.dm, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z), (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 180, __pyx_L1_error) /* "PETSc/DMStag.pyx":181 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p) ) * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] # <<<<<<<<<<<<<< * * def getLocalSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_v_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_5); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_6); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_4); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2); __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, ((Py_ssize_t)__pyx_v_dim), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":177 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:dim] * * def getGhostCorners(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, x=0, y=0, z=0, m=0, n=0, p=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getGhostCorners", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":183 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] * * def getLocalSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_28getLocalSizes[] = "DMStag.getLocalSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_28getLocalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_28getLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSizes", 0); /* "PETSc/DMStag.pyx":184 * * def getLocalSizes(self): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMStag.pyx":185 * def getLocalSizes(self): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 185, __pyx_L1_error) /* "PETSc/DMStag.pyx":186 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * return toStagDims(dim, m, n, p) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetLocalSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 186, __pyx_L1_error) /* "PETSc/DMStag.pyx":187 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetLocalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def getGlobalSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":183 * return (asInt(x), asInt(y), asInt(z))[:dim], (asInt(m), asInt(n), asInt(p))[:dim] * * def getLocalSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":189 * return toStagDims(dim, m, n, p) * * def getGlobalSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_30getGlobalSizes[] = "DMStag.getGlobalSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_30getGlobalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_30getGlobalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalSizes", 0); /* "PETSc/DMStag.pyx":190 * * def getGlobalSizes(self): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMStag.pyx":191 * def getGlobalSizes(self): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 191, __pyx_L1_error) /* "PETSc/DMStag.pyx":192 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * return toStagDims(dim, m, n, p) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetGlobalSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 192, __pyx_L1_error) /* "PETSc/DMStag.pyx":193 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetGlobalSizes(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def getProcSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":189 * return toStagDims(dim, m, n, p) * * def getGlobalSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getGlobalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":195 * return toStagDims(dim, m, n, p) * * def getProcSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_32getProcSizes[] = "DMStag.getProcSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProcSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getProcSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getProcSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_32getProcSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_32getProcSizes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProcSizes", 0); /* "PETSc/DMStag.pyx":196 * * def getProcSizes(self): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) */ __pyx_v_dim = 0; __pyx_v_m = PETSC_DECIDE; __pyx_v_n = PETSC_DECIDE; __pyx_v_p = PETSC_DECIDE; /* "PETSc/DMStag.pyx":197 * def getProcSizes(self): * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 197, __pyx_L1_error) /* "PETSc/DMStag.pyx":198 * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * return toStagDims(dim, m, n, p) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetNumRanks(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 198, __pyx_L1_error) /* "PETSc/DMStag.pyx":199 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * return toStagDims(dim, m, n, p) # <<<<<<<<<<<<<< * * def getStencilType(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":195 * return toStagDims(dim, m, n, p) * * def getProcSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getProcSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":201 * return toStagDims(dim, m, n, p) * * def getStencilType(self): # <<<<<<<<<<<<<< * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX * CHKERR( DMStagGetStencilType(self.dm, &stype) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_34getStencilType[] = "DMStag.getStencilType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getStencilType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getStencilType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getStencilType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_34getStencilType(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_34getStencilType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { DMStagStencilType __pyx_v_stype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getStencilType", 0); /* "PETSc/DMStag.pyx":202 * * def getStencilType(self): * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX # <<<<<<<<<<<<<< * CHKERR( DMStagGetStencilType(self.dm, &stype) ) * return toStagStencil(stype) */ __pyx_v_stype = DMSTAG_STENCIL_BOX; /* "PETSc/DMStag.pyx":203 * def getStencilType(self): * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX * CHKERR( DMStagGetStencilType(self.dm, &stype) ) # <<<<<<<<<<<<<< * return toStagStencil(stype) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetStencilType(__pyx_v_self->__pyx_base.dm, (&__pyx_v_stype))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 203, __pyx_L1_error) /* "PETSc/DMStag.pyx":204 * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX * CHKERR( DMStagGetStencilType(self.dm, &stype) ) * return toStagStencil(stype) # <<<<<<<<<<<<<< * * def getOwnershipRanges(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagStencil(__pyx_v_stype); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":201 * return toStagDims(dim, m, n, p) * * def getStencilType(self): # <<<<<<<<<<<<<< * cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX * CHKERR( DMStagGetStencilType(self.dm, &stype) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getStencilType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":206 * return toStagStencil(stype) * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges[] = "DMStag.getOwnershipRanges(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getOwnershipRanges (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getOwnershipRanges", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getOwnershipRanges", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; PetscInt __pyx_v_m; PetscInt __pyx_v_n; PetscInt __pyx_v_p; PetscInt const *__pyx_v_lx; PetscInt const *__pyx_v_ly; PetscInt const *__pyx_v_lz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getOwnershipRanges", 0); /* "PETSc/DMStag.pyx":207 * * def getOwnershipRanges(self): * cdef PetscInt dim=0, m=0, n=0, p=0 # <<<<<<<<<<<<<< * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_dim = 0; __pyx_v_m = 0; __pyx_v_n = 0; __pyx_v_p = 0; /* "PETSc/DMStag.pyx":208 * def getOwnershipRanges(self): * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) */ __pyx_v_lx = NULL; __pyx_v_ly = NULL; __pyx_v_lz = NULL; /* "PETSc/DMStag.pyx":209 * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 209, __pyx_L1_error) /* "PETSc/DMStag.pyx":210 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetNumRanks(__pyx_v_self->__pyx_base.dm, (&__pyx_v_m), (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 210, __pyx_L1_error) /* "PETSc/DMStag.pyx":211 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) # <<<<<<<<<<<<<< * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetOwnershipRanges(__pyx_v_self->__pyx_base.dm, (&__pyx_v_lx), (&__pyx_v_ly), (&__pyx_v_lz))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 211, __pyx_L1_error) /* "PETSc/DMStag.pyx":212 * CHKERR( DMStagGetNumRanks(self.dm, &m, &n, &p) ) * CHKERR( DMStagGetOwnershipRanges(self.dm, &lx, &ly, &lz) ) * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) # <<<<<<<<<<<<<< * * def getBoundaryTypes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagOwnershipRanges(__pyx_v_dim, __pyx_v_m, __pyx_v_n, __pyx_v_p, __pyx_v_lx, __pyx_v_ly, __pyx_v_lz); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":206 * return toStagStencil(stype) * * def getOwnershipRanges(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0, m=0, n=0, p=0 * cdef const PetscInt *lx = NULL, *ly = NULL, *lz = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getOwnershipRanges", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":214 * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getBoundaryTypes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes[] = "DMStag.getBoundaryTypes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getBoundaryTypes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getBoundaryTypes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getBoundaryTypes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscInt __pyx_v_dim; DMBoundaryType __pyx_v_btx; DMBoundaryType __pyx_v_bty; DMBoundaryType __pyx_v_btz; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getBoundaryTypes", 0); /* "PETSc/DMStag.pyx":215 * * def getBoundaryTypes(self): * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE */ __pyx_v_dim = 0; /* "PETSc/DMStag.pyx":216 * def getBoundaryTypes(self): * cdef PetscInt dim=0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE */ __pyx_v_btx = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":217 * cdef PetscInt dim=0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_bty = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":218 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) */ __pyx_v_btz = DM_BOUNDARY_NONE; /* "PETSc/DMStag.pyx":219 * cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) * return toStagBoundaryTypes(dim, btx, bty, btz) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 219, __pyx_L1_error) /* "PETSc/DMStag.pyx":220 * cdef PetscDMBoundaryType btz = DM_BOUNDARY_NONE * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) # <<<<<<<<<<<<<< * return toStagBoundaryTypes(dim, btx, bty, btz) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetBoundaryTypes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_btx), (&__pyx_v_bty), (&__pyx_v_btz))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 220, __pyx_L1_error) /* "PETSc/DMStag.pyx":221 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetBoundaryTypes(self.dm, &btx, &bty, &btz) ) * return toStagBoundaryTypes(dim, btx, bty, btz) # <<<<<<<<<<<<<< * * def getIsFirstRank(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagBoundaryTypes(__pyx_v_dim, __pyx_v_btx, __pyx_v_bty, __pyx_v_btz); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":214 * return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz) * * def getBoundaryTypes(self): # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":223 * return toStagBoundaryTypes(dim, btx, bty, btz) * * def getIsFirstRank(self): # <<<<<<<<<<<<<< * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_40getIsFirstRank[] = "DMStag.getIsFirstRank(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIsFirstRank (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIsFirstRank", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIsFirstRank", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_40getIsFirstRank(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_40getIsFirstRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscBool __pyx_v_rank0; PetscBool __pyx_v_rank1; PetscBool __pyx_v_rank2; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIsFirstRank", 0); /* "PETSc/DMStag.pyx":224 * * def getIsFirstRank(self): * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_rank0 = PETSC_FALSE; __pyx_v_rank1 = PETSC_FALSE; __pyx_v_rank2 = PETSC_FALSE; /* "PETSc/DMStag.pyx":225 * def getIsFirstRank(self): * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) */ __pyx_v_dim = 0; /* "PETSc/DMStag.pyx":226 * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 226, __pyx_L1_error) /* "PETSc/DMStag.pyx":227 * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) # <<<<<<<<<<<<<< * return toStagDims(dim, rank0, rank1, rank2) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetIsFirstRank(__pyx_v_self->__pyx_base.dm, (&__pyx_v_rank0), (&__pyx_v_rank1), (&__pyx_v_rank2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 227, __pyx_L1_error) /* "PETSc/DMStag.pyx":228 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsFirstRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) # <<<<<<<<<<<<<< * * def getIsLastRank(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_rank0, __pyx_v_rank1, __pyx_v_rank2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":223 * return toStagBoundaryTypes(dim, btx, bty, btz) * * def getIsFirstRank(self): # <<<<<<<<<<<<<< * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getIsFirstRank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":230 * return toStagDims(dim, rank0, rank1, rank2) * * def getIsLastRank(self): # <<<<<<<<<<<<<< * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_42getIsLastRank[] = "DMStag.getIsLastRank(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getIsLastRank (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getIsLastRank", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getIsLastRank", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_42getIsLastRank(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_42getIsLastRank(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PetscBool __pyx_v_rank0; PetscBool __pyx_v_rank1; PetscBool __pyx_v_rank2; PetscInt __pyx_v_dim; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getIsLastRank", 0); /* "PETSc/DMStag.pyx":231 * * def getIsLastRank(self): * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE # <<<<<<<<<<<<<< * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) */ __pyx_v_rank0 = PETSC_FALSE; __pyx_v_rank1 = PETSC_FALSE; __pyx_v_rank2 = PETSC_FALSE; /* "PETSc/DMStag.pyx":232 * def getIsLastRank(self): * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) */ __pyx_v_dim = 0; /* "PETSc/DMStag.pyx":233 * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 233, __pyx_L1_error) /* "PETSc/DMStag.pyx":234 * cdef PetscInt dim=0 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) # <<<<<<<<<<<<<< * return toStagDims(dim, rank0, rank1, rank2) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetIsLastRank(__pyx_v_self->__pyx_base.dm, (&__pyx_v_rank0), (&__pyx_v_rank1), (&__pyx_v_rank2))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 234, __pyx_L1_error) /* "PETSc/DMStag.pyx":235 * CHKERR( DMGetDimension(self.dm, &dim) ) * CHKERR( DMStagGetIsLastRank(self.dm, &rank0, &rank1, &rank2) ) * return toStagDims(dim, rank0, rank1, rank2) # <<<<<<<<<<<<<< * * # Coordinate-related functions */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toStagDims(__pyx_v_dim, __pyx_v_rank0, __pyx_v_rank1, __pyx_v_rank2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":230 * return toStagDims(dim, rank0, rank1, rank2) * * def getIsLastRank(self): # <<<<<<<<<<<<<< * cdef PetscBool rank0=PETSC_FALSE, rank1=PETSC_FALSE, rank2=PETSC_FALSE * cdef PetscInt dim=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getIsLastRank", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":239 * # Coordinate-related functions * * def setUniformCoordinatesExplicit(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): # <<<<<<<<<<<<<< * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit[] = "DMStag.setUniformCoordinatesExplicit(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinatesExplicit (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_1); values[2] = ((PyObject *)__pyx_int_0); values[3] = ((PyObject *)__pyx_int_1); values[4] = ((PyObject *)__pyx_int_0); values[5] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmin); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmax); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymin); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymax); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmin); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmax); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUniformCoordinatesExplicit") < 0)) __PYX_ERR(49, 239, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinatesExplicit", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 239, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesExplicit", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinatesExplicit", 0); /* "PETSc/DMStag.pyx":240 * * def setUniformCoordinatesExplicit(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 240, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 240, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "PETSc/DMStag.pyx":241 * def setUniformCoordinatesExplicit(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 241, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 241, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "PETSc/DMStag.pyx":242 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 242, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 242, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "PETSc/DMStag.pyx":243 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) # <<<<<<<<<<<<<< * * def setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetUniformCoordinatesExplicit(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 243, __pyx_L1_error) /* "PETSc/DMStag.pyx":239 * # Coordinate-related functions * * def setUniformCoordinatesExplicit(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): # <<<<<<<<<<<<<< * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesExplicit", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":245 * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): # <<<<<<<<<<<<<< * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct[] = "DMStag.setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinatesProduct (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_1); values[2] = ((PyObject *)__pyx_int_0); values[3] = ((PyObject *)__pyx_int_1); values[4] = ((PyObject *)__pyx_int_0); values[5] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmin); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmax); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymin); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymax); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmin); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmax); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUniformCoordinatesProduct") < 0)) __PYX_ERR(49, 245, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinatesProduct", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 245, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesProduct", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinatesProduct", 0); /* "PETSc/DMStag.pyx":246 * * def setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 246, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 246, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "PETSc/DMStag.pyx":247 * def setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 247, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 247, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "PETSc/DMStag.pyx":248 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 248, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 248, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "PETSc/DMStag.pyx":249 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) # <<<<<<<<<<<<<< * * def setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetUniformCoordinatesProduct(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 249, __pyx_L1_error) /* "PETSc/DMStag.pyx":245 * CHKERR( DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinatesProduct(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): # <<<<<<<<<<<<<< * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinatesProduct", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":251 * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): # <<<<<<<<<<<<<< * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates[] = "DMStag.setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_xmin = 0; PyObject *__pyx_v_xmax = 0; PyObject *__pyx_v_ymin = 0; PyObject *__pyx_v_ymax = 0; PyObject *__pyx_v_zmin = 0; PyObject *__pyx_v_zmax = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUniformCoordinates (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xmin,&__pyx_n_s_xmax,&__pyx_n_s_ymin,&__pyx_n_s_ymax,&__pyx_n_s_zmin,&__pyx_n_s_zmax,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[0] = ((PyObject *)__pyx_int_0); values[1] = ((PyObject *)__pyx_int_1); values[2] = ((PyObject *)__pyx_int_0); values[3] = ((PyObject *)__pyx_int_1); values[4] = ((PyObject *)__pyx_int_0); values[5] = ((PyObject *)__pyx_int_1); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmin); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xmax); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymin); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ymax); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmin); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_zmax); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setUniformCoordinates") < 0)) __PYX_ERR(49, 251, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_xmin = values[0]; __pyx_v_xmax = values[1]; __pyx_v_ymin = values[2]; __pyx_v_ymax = values[3]; __pyx_v_zmin = values[4]; __pyx_v_zmax = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setUniformCoordinates", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 251, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_xmin, __pyx_v_xmax, __pyx_v_ymin, __pyx_v_ymax, __pyx_v_zmin, __pyx_v_zmax); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_xmin, PyObject *__pyx_v_xmax, PyObject *__pyx_v_ymin, PyObject *__pyx_v_ymax, PyObject *__pyx_v_zmin, PyObject *__pyx_v_zmax) { PetscReal __pyx_v__xmin; PetscReal __pyx_v__xmax; PetscReal __pyx_v__ymin; PetscReal __pyx_v__ymax; PetscReal __pyx_v__zmin; PetscReal __pyx_v__zmax; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscReal __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUniformCoordinates", 0); /* "PETSc/DMStag.pyx":252 * * def setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) # <<<<<<<<<<<<<< * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 252, __pyx_L1_error) __pyx_v__xmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 252, __pyx_L1_error) __pyx_v__xmax = __pyx_t_1; /* "PETSc/DMStag.pyx":253 * def setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) # <<<<<<<<<<<<<< * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 253, __pyx_L1_error) __pyx_v__ymin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ymax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 253, __pyx_L1_error) __pyx_v__ymax = __pyx_t_1; /* "PETSc/DMStag.pyx":254 * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) # <<<<<<<<<<<<<< * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 254, __pyx_L1_error) __pyx_v__zmin = __pyx_t_1; __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zmax); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(49, 254, __pyx_L1_error) __pyx_v__zmax = __pyx_t_1; /* "PETSc/DMStag.pyx":255 * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) * cdef PetscReal _zmin = asReal(zmin), _zmax = asReal(zmax) * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) # <<<<<<<<<<<<<< * * def setCoordinateDMType(self, dmtype): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetUniformCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v__xmin, __pyx_v__xmax, __pyx_v__ymin, __pyx_v__ymax, __pyx_v__zmin, __pyx_v__zmax)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 255, __pyx_L1_error) /* "PETSc/DMStag.pyx":251 * CHKERR( DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setUniformCoordinates(self, xmin=0, xmax=1, ymin=0, ymax=1, zmin=0, zmax=1): # <<<<<<<<<<<<<< * cdef PetscReal _xmin = asReal(xmin), _xmax = asReal(xmax) * cdef PetscReal _ymin = asReal(ymin), _ymax = asReal(ymax) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":257 * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setCoordinateDMType(self, dmtype): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * dmtype = str2bytes(dmtype, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType[] = "DMStag.setCoordinateDMType(self, dmtype)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dmtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoordinateDMType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmtype,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmtype)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoordinateDMType") < 0)) __PYX_ERR(49, 257, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dmtype = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoordinateDMType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 257, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setCoordinateDMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dmtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dmtype) { DMType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoordinateDMType", 0); __Pyx_INCREF(__pyx_v_dmtype); /* "PETSc/DMStag.pyx":258 * * def setCoordinateDMType(self, dmtype): * cdef PetscDMType cval = NULL # <<<<<<<<<<<<<< * dmtype = str2bytes(dmtype, &cval) * CHKERR( DMStagSetCoordinateDMType(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DMStag.pyx":259 * def setCoordinateDMType(self, dmtype): * cdef PetscDMType cval = NULL * dmtype = str2bytes(dmtype, &cval) # <<<<<<<<<<<<<< * CHKERR( DMStagSetCoordinateDMType(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_dmtype, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_dmtype, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMStag.pyx":260 * cdef PetscDMType cval = NULL * dmtype = str2bytes(dmtype, &cval) * CHKERR( DMStagSetCoordinateDMType(self.dm, cval) ) # <<<<<<<<<<<<<< * * # Location slot related functions */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagSetCoordinateDMType(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 260, __pyx_L1_error) /* "PETSc/DMStag.pyx":257 * CHKERR( DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax) ) * * def setCoordinateDMType(self, dmtype): # <<<<<<<<<<<<<< * cdef PetscDMType cval = NULL * dmtype = str2bytes(dmtype, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.setCoordinateDMType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dmtype); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":264 * # Location slot related functions * * def getLocationSlot(self, loc, c): # <<<<<<<<<<<<<< * cdef PetscInt slot=0 * cdef PetscInt comp=asInt(c) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_52getLocationSlot[] = "DMStag.getLocationSlot(self, loc, c)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loc = 0; PyObject *__pyx_v_c = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocationSlot (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,&__pyx_n_s_c,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("getLocationSlot", 1, 2, 2, 1); __PYX_ERR(49, 264, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLocationSlot") < 0)) __PYX_ERR(49, 264, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_loc = values[0]; __pyx_v_c = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLocationSlot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 264, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_52getLocationSlot(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_loc, __pyx_v_c); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_52getLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_c) { PetscInt __pyx_v_slot; PetscInt __pyx_v_comp; DMStagStencilLocation __pyx_v_sloc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; DMStagStencilLocation __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocationSlot", 0); /* "PETSc/DMStag.pyx":265 * * def getLocationSlot(self, loc, c): * cdef PetscInt slot=0 # <<<<<<<<<<<<<< * cdef PetscInt comp=asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ __pyx_v_slot = 0; /* "PETSc/DMStag.pyx":266 * def getLocationSlot(self, loc, c): * cdef PetscInt slot=0 * cdef PetscInt comp=asInt(c) # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_c); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 266, __pyx_L1_error) __pyx_v_comp = __pyx_t_1; /* "PETSc/DMStag.pyx":267 * cdef PetscInt slot=0 * cdef PetscInt comp=asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) * return toInt(slot) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_2 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(49, 267, __pyx_L1_error) __pyx_v_sloc = __pyx_t_2; /* "PETSc/DMStag.pyx":268 * cdef PetscInt comp=asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) # <<<<<<<<<<<<<< * return toInt(slot) * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetLocationSlot(__pyx_v_self->__pyx_base.dm, __pyx_v_sloc, __pyx_v_comp, (&__pyx_v_slot))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(49, 268, __pyx_L1_error) /* "PETSc/DMStag.pyx":269 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationSlot(self.dm, sloc, comp, &slot) ) * return toInt(slot) # <<<<<<<<<<<<<< * * def getProductCoordinateLocationSlot(self, loc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_slot); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":264 * # Location slot related functions * * def getLocationSlot(self, loc, c): # <<<<<<<<<<<<<< * cdef PetscInt slot=0 * cdef PetscInt comp=asInt(c) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":271 * return toInt(slot) * * def getProductCoordinateLocationSlot(self, loc): # <<<<<<<<<<<<<< * cdef PetscInt slot=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot[] = "DMStag.getProductCoordinateLocationSlot(self, loc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loc = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getProductCoordinateLocationSlot (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getProductCoordinateLocationSlot") < 0)) __PYX_ERR(49, 271, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_loc = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getProductCoordinateLocationSlot", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 271, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getProductCoordinateLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_loc); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc) { PetscInt __pyx_v_slot; DMStagStencilLocation __pyx_v_sloc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMStagStencilLocation __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getProductCoordinateLocationSlot", 0); /* "PETSc/DMStag.pyx":272 * * def getProductCoordinateLocationSlot(self, loc): * cdef PetscInt slot=0 # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) */ __pyx_v_slot = 0; /* "PETSc/DMStag.pyx":273 * def getProductCoordinateLocationSlot(self, loc): * cdef PetscInt slot=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) * return toInt(slot) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_1 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(49, 273, __pyx_L1_error) __pyx_v_sloc = __pyx_t_1; /* "PETSc/DMStag.pyx":274 * cdef PetscInt slot=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) # <<<<<<<<<<<<<< * return toInt(slot) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetProductCoordinateLocationSlot(__pyx_v_self->__pyx_base.dm, __pyx_v_sloc, (&__pyx_v_slot))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 274, __pyx_L1_error) /* "PETSc/DMStag.pyx":275 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot) ) * return toInt(slot) # <<<<<<<<<<<<<< * * def getLocationDof(self, loc): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_slot); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":271 * return toInt(slot) * * def getProductCoordinateLocationSlot(self, loc): # <<<<<<<<<<<<<< * cdef PetscInt slot=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getProductCoordinateLocationSlot", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":277 * return toInt(slot) * * def getLocationDof(self, loc): # <<<<<<<<<<<<<< * cdef PetscInt dof=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_56getLocationDof[] = "DMStag.getLocationDof(self, loc)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loc = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocationDof (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loc,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getLocationDof") < 0)) __PYX_ERR(49, 277, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_loc = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getLocationDof", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 277, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_56getLocationDof(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_loc); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_56getLocationDof(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_loc) { PetscInt __pyx_v_dof; DMStagStencilLocation __pyx_v_sloc; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMStagStencilLocation __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocationDof", 0); /* "PETSc/DMStag.pyx":278 * * def getLocationDof(self, loc): * cdef PetscInt dof=0 # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) */ __pyx_v_dof = 0; /* "PETSc/DMStag.pyx":279 * def getLocationDof(self, loc): * cdef PetscInt dof=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) * return toInt(dof) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_1 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(49, 279, __pyx_L1_error) __pyx_v_sloc = __pyx_t_1; /* "PETSc/DMStag.pyx":280 * cdef PetscInt dof=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) # <<<<<<<<<<<<<< * return toInt(dof) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagGetLocationDOF(__pyx_v_self->__pyx_base.dm, __pyx_v_sloc, (&__pyx_v_dof))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(49, 280, __pyx_L1_error) /* "PETSc/DMStag.pyx":281 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * CHKERR( DMStagGetLocationDOF(self.dm, sloc, &dof) ) * return toInt(dof) # <<<<<<<<<<<<<< * * # Random other functions */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dof); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":277 * return toInt(slot) * * def getLocationDof(self, loc): # <<<<<<<<<<<<<< * cdef PetscInt dof=0 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getLocationDof", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":285 * # Random other functions * * def migrateVec(self, Vec vec, DM dmTo, Vec vecTo): # <<<<<<<<<<<<<< * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_58migrateVec[] = "DMStag.migrateVec(self, Vec vec, DM dmTo, Vec vecTo)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; struct PyPetscDMObject *__pyx_v_dmTo = 0; struct PyPetscVecObject *__pyx_v_vecTo = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("migrateVec (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_dmTo,&__pyx_n_s_vecTo,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmTo)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("migrateVec", 1, 3, 3, 1); __PYX_ERR(49, 285, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vecTo)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("migrateVec", 1, 3, 3, 2); __PYX_ERR(49, 285, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "migrateVec") < 0)) __PYX_ERR(49, 285, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); __pyx_v_dmTo = ((struct PyPetscDMObject *)values[1]); __pyx_v_vecTo = ((struct PyPetscVecObject *)values[2]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("migrateVec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 285, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.migrateVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(49, 285, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmTo), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dmTo", 0))) __PYX_ERR(49, 285, __pyx_L1_error) if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vecTo), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vecTo", 0))) __PYX_ERR(49, 285, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_58migrateVec(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_vec, __pyx_v_dmTo, __pyx_v_vecTo); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_58migrateVec(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, struct PyPetscDMObject *__pyx_v_dmTo, struct PyPetscVecObject *__pyx_v_vecTo) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("migrateVec", 0); /* "PETSc/DMStag.pyx":286 * * def migrateVec(self, Vec vec, DM dmTo, Vec vecTo): * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) # <<<<<<<<<<<<<< * * def createCompatibleDMStag(self, dofs): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagMigrateVec(__pyx_v_self->__pyx_base.dm, __pyx_v_vec->vec, __pyx_v_dmTo->dm, __pyx_v_vecTo->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(49, 286, __pyx_L1_error) /* "PETSc/DMStag.pyx":285 * # Random other functions * * def migrateVec(self, Vec vec, DM dmTo, Vec vecTo): # <<<<<<<<<<<<<< * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.migrateVec", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":288 * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) * * def createCompatibleDMStag(self, dofs): # <<<<<<<<<<<<<< * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag[] = "DMStag.createCompatibleDMStag(self, dofs)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dofs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createCompatibleDMStag (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dofs,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dofs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createCompatibleDMStag") < 0)) __PYX_ERR(49, 288, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dofs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createCompatibleDMStag", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 288, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.createCompatibleDMStag", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_dofs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, PyObject *__pyx_v_dofs) { PyObject *__pyx_v_gdofs = 0; CYTHON_UNUSED PetscInt __pyx_v_gdim; PetscInt __pyx_v_dof0; PetscInt __pyx_v_dof1; PetscInt __pyx_v_dof2; PetscInt __pyx_v_dof3; DM __pyx_v_newda; struct PyPetscDMObject *__pyx_v_newdm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscInt __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createCompatibleDMStag", 0); /* "PETSc/DMStag.pyx":289 * * def createCompatibleDMStag(self, dofs): * cdef tuple gdofs = tuple(dofs) # <<<<<<<<<<<<<< * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_gdofs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMStag.pyx":290 * def createCompatibleDMStag(self, dofs): * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 # <<<<<<<<<<<<<< * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * cdef PetscDM newda = NULL */ __pyx_v_gdim = PETSC_DECIDE; __pyx_v_dof0 = 1; __pyx_v_dof1 = 0; __pyx_v_dof2 = 0; __pyx_v_dof3 = 0; /* "PETSc/DMStag.pyx":291 * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) # <<<<<<<<<<<<<< * cdef PetscDM newda = NULL * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asDofs(__pyx_v_gdofs, (&__pyx_v_dof0), (&__pyx_v_dof1), (&__pyx_v_dof2), (&__pyx_v_dof3)); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 291, __pyx_L1_error) __pyx_v_gdim = __pyx_t_2; /* "PETSc/DMStag.pyx":292 * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * cdef PetscDM newda = NULL # <<<<<<<<<<<<<< * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) * cdef DM newdm = type(self)() */ __pyx_v_newda = NULL; /* "PETSc/DMStag.pyx":293 * gdim = asDofs(gdofs, &dof0, &dof1, &dof2, &dof3) * cdef PetscDM newda = NULL * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) # <<<<<<<<<<<<<< * cdef DM newdm = type(self)() * PetscCLEAR(newdm.obj); newdm.dm = newda */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagCreateCompatibleDMStag(__pyx_v_self->__pyx_base.dm, __pyx_v_dof0, __pyx_v_dof1, __pyx_v_dof2, __pyx_v_dof3, (&__pyx_v_newda))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(49, 293, __pyx_L1_error) /* "PETSc/DMStag.pyx":294 * cdef PetscDM newda = NULL * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) * cdef DM newdm = type(self)() # <<<<<<<<<<<<<< * PetscCLEAR(newdm.obj); newdm.dm = newda * return newdm */ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(49, 294, __pyx_L1_error) __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMStag.pyx":295 * CHKERR( DMStagCreateCompatibleDMStag(self.dm, dof0, dof1, dof2, dof3, &newda) ) * cdef DM newdm = type(self)() * PetscCLEAR(newdm.obj); newdm.dm = newda # <<<<<<<<<<<<<< * return newdm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_newdm->__pyx_base.obj)); __pyx_v_newdm->dm = __pyx_v_newda; /* "PETSc/DMStag.pyx":296 * cdef DM newdm = type(self)() * PetscCLEAR(newdm.obj); newdm.dm = newda * return newdm # <<<<<<<<<<<<<< * * def VecSplitToDMDA(self, Vec vec, loc, c): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_newdm)); __pyx_r = ((PyObject *)__pyx_v_newdm); goto __pyx_L0; /* "PETSc/DMStag.pyx":288 * CHKERR( DMStagMigrateVec(self.dm, vec.vec, dmTo.dm, vecTo.vec ) ) * * def createCompatibleDMStag(self, dofs): # <<<<<<<<<<<<<< * cdef tuple gdofs = tuple(dofs) * cdef PetscInt gdim=PETSC_DECIDE, dof0=1, dof1=0, dof2=0, dof3=0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.createCompatibleDMStag", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_gdofs); __Pyx_XDECREF((PyObject *)__pyx_v_newdm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":298 * return newdm * * def VecSplitToDMDA(self, Vec vec, loc, c): # <<<<<<<<<<<<<< * cdef PetscInt pc = asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA[] = "DMStag.VecSplitToDMDA(self, Vec vec, loc, c)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_vec = 0; PyObject *__pyx_v_loc = 0; PyObject *__pyx_v_c = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("VecSplitToDMDA (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,&__pyx_n_s_loc,&__pyx_n_s_c,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loc)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("VecSplitToDMDA", 1, 3, 3, 1); __PYX_ERR(49, 298, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("VecSplitToDMDA", 1, 3, 3, 2); __PYX_ERR(49, 298, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "VecSplitToDMDA") < 0)) __PYX_ERR(49, 298, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); __pyx_v_loc = values[1]; __pyx_v_c = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("VecSplitToDMDA", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 298, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.VecSplitToDMDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(49, 298, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_vec, __pyx_v_loc, __pyx_v_c); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec, PyObject *__pyx_v_loc, PyObject *__pyx_v_c) { PetscInt __pyx_v_pc; DMStagStencilLocation __pyx_v_sloc; DM __pyx_v_pda; Vec __pyx_v_pdavec; struct PyPetscDMObject *__pyx_v_da = 0; struct PyPetscVecObject *__pyx_v_davec = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; DMStagStencilLocation __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("VecSplitToDMDA", 0); /* "PETSc/DMStag.pyx":299 * * def VecSplitToDMDA(self, Vec vec, loc, c): * cdef PetscInt pc = asInt(c) # <<<<<<<<<<<<<< * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * cdef PetscDM pda = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_c); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(49, 299, __pyx_L1_error) __pyx_v_pc = __pyx_t_1; /* "PETSc/DMStag.pyx":300 * def VecSplitToDMDA(self, Vec vec, loc, c): * cdef PetscInt pc = asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) # <<<<<<<<<<<<<< * cdef PetscDM pda = NULL * cdef PetscVec pdavec = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asStagStencilLocation(__pyx_v_loc); if (unlikely(__pyx_t_2 == ((DMStagStencilLocation)((DMStagStencilLocation)-1L)))) __PYX_ERR(49, 300, __pyx_L1_error) __pyx_v_sloc = __pyx_t_2; /* "PETSc/DMStag.pyx":301 * cdef PetscInt pc = asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * cdef PetscDM pda = NULL # <<<<<<<<<<<<<< * cdef PetscVec pdavec = NULL * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) */ __pyx_v_pda = NULL; /* "PETSc/DMStag.pyx":302 * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) * cdef PetscDM pda = NULL * cdef PetscVec pdavec = NULL # <<<<<<<<<<<<<< * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) * cdef DM da = DMDA() */ __pyx_v_pdavec = NULL; /* "PETSc/DMStag.pyx":303 * cdef PetscDM pda = NULL * cdef PetscVec pdavec = NULL * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) # <<<<<<<<<<<<<< * cdef DM da = DMDA() * PetscCLEAR(da.obj); da.dm = pda */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMStagVecSplitToDMDA(__pyx_v_self->__pyx_base.dm, __pyx_v_vec->vec, __pyx_v_sloc, __pyx_v_pc, (&__pyx_v_pda), (&__pyx_v_pdavec))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(49, 303, __pyx_L1_error) /* "PETSc/DMStag.pyx":304 * cdef PetscVec pdavec = NULL * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) * cdef DM da = DMDA() # <<<<<<<<<<<<<< * PetscCLEAR(da.obj); da.dm = pda * cdef Vec davec = Vec() */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA)); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_da = ((struct PyPetscDMObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMStag.pyx":305 * CHKERR( DMStagVecSplitToDMDA(self.dm, vec.vec, sloc, pc, &pda, &pdavec) ) * cdef DM da = DMDA() * PetscCLEAR(da.obj); da.dm = pda # <<<<<<<<<<<<<< * cdef Vec davec = Vec() * PetscCLEAR(davec.obj); davec.vec = pdavec */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_da->__pyx_base.obj)); __pyx_v_da->dm = __pyx_v_pda; /* "PETSc/DMStag.pyx":306 * cdef DM da = DMDA() * PetscCLEAR(da.obj); da.dm = pda * cdef Vec davec = Vec() # <<<<<<<<<<<<<< * PetscCLEAR(davec.obj); davec.vec = pdavec * return (da,davec) */ __pyx_t_4 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_davec = ((struct PyPetscVecObject *)__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMStag.pyx":307 * PetscCLEAR(da.obj); da.dm = pda * cdef Vec davec = Vec() * PetscCLEAR(davec.obj); davec.vec = pdavec # <<<<<<<<<<<<<< * return (da,davec) * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_davec->__pyx_base.obj)); __pyx_v_davec->vec = __pyx_v_pdavec; /* "PETSc/DMStag.pyx":308 * cdef Vec davec = Vec() * PetscCLEAR(davec.obj); davec.vec = pdavec * return (da,davec) # <<<<<<<<<<<<<< * * def getVecArray(self, Vec vec): */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_da)); __Pyx_GIVEREF(((PyObject *)__pyx_v_da)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_da)); __Pyx_INCREF(((PyObject *)__pyx_v_davec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_davec)); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_davec)); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":298 * return newdm * * def VecSplitToDMDA(self, Vec vec, loc, c): # <<<<<<<<<<<<<< * cdef PetscInt pc = asInt(c) * cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.VecSplitToDMDA", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_da); __Pyx_XDECREF((PyObject *)__pyx_v_davec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":310 * return (da,davec) * * def getVecArray(self, Vec vec): # <<<<<<<<<<<<<< * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_64getVecArray[] = "DMStag.getVecArray(self, Vec vec)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_vec = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getVecArray (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vec,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getVecArray") < 0)) __PYX_ERR(49, 310, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_vec = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getVecArray", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(49, 310, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(49, 310, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_64getVecArray(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self), __pyx_v_vec); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_64getVecArray(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self, CYTHON_UNUSED struct PyPetscVecObject *__pyx_v_vec) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getVecArray", 0); /* "PETSc/DMStag.pyx":311 * * def getVecArray(self, Vec vec): * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def get1dCoordinatecArrays(self): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(49, 311, __pyx_L1_error) /* "PETSc/DMStag.pyx":310 * return (da,davec) * * def getVecArray(self, Vec vec): # <<<<<<<<<<<<<< * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.getVecArray", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":313 * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') * * def get1dCoordinatecArrays(self): # <<<<<<<<<<<<<< * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays[] = "DMStag.get1dCoordinatecArrays(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get1dCoordinatecArrays (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("get1dCoordinatecArrays", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get1dCoordinatecArrays", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays(CYTHON_UNUSED struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get1dCoordinatecArrays", 0); /* "PETSc/DMStag.pyx":314 * * def get1dCoordinatecArrays(self): * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * property dim: */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(49, 314, __pyx_L1_error) /* "PETSc/DMStag.pyx":313 * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') * * def get1dCoordinatecArrays(self): # <<<<<<<<<<<<<< * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.get1dCoordinatecArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":317 * * property dim: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDim() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_3dim_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_3dim___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_3dim___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":318 * property dim: * def __get__(self): * return self.getDim() # <<<<<<<<<<<<<< * * property dofs: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDim); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":317 * * property dim: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDim() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":321 * * property dofs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDof() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_4dofs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_4dofs_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_4dofs___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_4dofs___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":322 * property dofs: * def __get__(self): * return self.getDof() # <<<<<<<<<<<<<< * * property entries_per_element: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getDof); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":321 * * property dofs: * def __get__(self): # <<<<<<<<<<<<<< * return self.getDof() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.dofs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":325 * * property entries_per_element: * def __get__(self): # <<<<<<<<<<<<<< * return self.getEntriesPerElement() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19entries_per_element_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_19entries_per_element_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_19entries_per_element___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_19entries_per_element___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":326 * property entries_per_element: * def __get__(self): * return self.getEntriesPerElement() # <<<<<<<<<<<<<< * * property global_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getEntriesPerElement); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":325 * * property entries_per_element: * def __get__(self): # <<<<<<<<<<<<<< * return self.getEntriesPerElement() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.entries_per_element.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":329 * * property global_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGlobalSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12global_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12global_sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_12global_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12global_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":330 * property global_sizes: * def __get__(self): * return self.getGlobalSizes() # <<<<<<<<<<<<<< * * property local_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGlobalSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":329 * * property global_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGlobalSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.global_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":333 * * property local_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11local_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_11local_sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_11local_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_11local_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":334 * property local_sizes: * def __get__(self): * return self.getLocalSizes() # <<<<<<<<<<<<<< * * property proc_sizes: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getLocalSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":333 * * property local_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getLocalSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.local_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":337 * * property proc_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_10proc_sizes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_10proc_sizes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_10proc_sizes___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_10proc_sizes___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":338 * property proc_sizes: * def __get__(self): * return self.getProcSizes() # <<<<<<<<<<<<<< * * property boundary_types: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getProcSizes); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":337 * * property proc_sizes: * def __get__(self): # <<<<<<<<<<<<<< * return self.getProcSizes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.proc_sizes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":341 * * property boundary_types: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBoundaryTypes() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_14boundary_types_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_14boundary_types_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_14boundary_types___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_14boundary_types___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":342 * property boundary_types: * def __get__(self): * return self.getBoundaryTypes() # <<<<<<<<<<<<<< * * property stencil_type: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getBoundaryTypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":341 * * property boundary_types: * def __get__(self): # <<<<<<<<<<<<<< * return self.getBoundaryTypes() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.boundary_types.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":345 * * property stencil_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12stencil_type_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_12stencil_type_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_12stencil_type___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_12stencil_type___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":346 * property stencil_type: * def __get__(self): * return self.getStencilType() # <<<<<<<<<<<<<< * * property stencil_width: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilType); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":345 * * property stencil_type: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilType() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.stencil_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":349 * * property stencil_width: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13stencil_width_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13stencil_width_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_13stencil_width___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13stencil_width___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":350 * property stencil_width: * def __get__(self): * return self.getStencilWidth() # <<<<<<<<<<<<<< * * property corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getStencilWidth); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":349 * * property stencil_width: * def __get__(self): # <<<<<<<<<<<<<< * return self.getStencilWidth() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.stencil_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":353 * * property corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_7corners_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_7corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_7corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":354 * property corners: * def __get__(self): * return self.getCorners() # <<<<<<<<<<<<<< * * property ghost_corners: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":353 * * property corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMStag.pyx":357 * * property ghost_corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13ghost_corners_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMStag_13ghost_corners_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMStag_13ghost_corners___get__(((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMStag_13ghost_corners___get__(struct __pyx_obj_8petsc4py_5PETSc_DMStag *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "PETSc/DMStag.pyx":358 * property ghost_corners: * def __get__(self): * return self.getGhostCorners() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getGhostCorners); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMStag.pyx":357 * * property ghost_corners: * def __get__(self): # <<<<<<<<<<<<<< * return self.getGhostCorners() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMStag.ghost_corners.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":5 * cdef class DMComposite(DM): * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_create[] = "DMComposite.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(50, 5, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 5, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_create(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_create(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DMComposite.pyx":6 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCompositeCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 6, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMComposite.pyx":7 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMComposite.pyx":8 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMCompositeCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(50, 8, __pyx_L1_error) /* "PETSc/DMComposite.pyx":9 * cdef PetscDM newdm = NULL * CHKERR( DMCompositeCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMComposite.pyx":10 * CHKERR( DMCompositeCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def addDM(self, DM dm, *args): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMComposite.pyx":5 * cdef class DMComposite(DM): * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":12 * return self * * def addDM(self, DM dm, *args): # <<<<<<<<<<<<<< * """Add DM to composite""" * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_2addDM[] = "DMComposite.addDM(self, DM dm, *args)\nAdd DM to composite"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_v_args = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addDM (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_args)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_args); } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "addDM") < 0)) __PYX_ERR(50, 12, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addDM", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 12, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.addDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(50, 12, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_2addDM(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_dm, __pyx_v_args); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_2addDM(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_args) { PyObject *__pyx_v_item = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addDM", 0); __Pyx_INCREF((PyObject *)__pyx_v_dm); /* "PETSc/DMComposite.pyx":14 * def addDM(self, DM dm, *args): * """Add DM to composite""" * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * cdef object item * for item in args: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeAddDM(__pyx_v_self->__pyx_base.dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 14, __pyx_L1_error) /* "PETSc/DMComposite.pyx":16 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * cdef object item * for item in args: # <<<<<<<<<<<<<< * dm = item * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) */ __pyx_t_2 = __pyx_v_args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(50, 16, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMComposite.pyx":17 * cdef object item * for item in args: * dm = item # <<<<<<<<<<<<<< * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * */ if (!(likely(__Pyx_TypeTest(__pyx_v_item, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(50, 17, __pyx_L1_error) __pyx_t_4 = __pyx_v_item; __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_dm, ((struct PyPetscDMObject *)__pyx_t_4)); __pyx_t_4 = 0; /* "PETSc/DMComposite.pyx":18 * for item in args: * dm = item * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def getNumber(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeAddDM(__pyx_v_self->__pyx_base.dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 18, __pyx_L1_error) /* "PETSc/DMComposite.pyx":16 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * cdef object item * for item in args: # <<<<<<<<<<<<<< * dm = item * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMComposite.pyx":12 * return self * * def addDM(self, DM dm, *args): # <<<<<<<<<<<<<< * """Add DM to composite""" * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.addDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":20 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * * def getNumber(self): # <<<<<<<<<<<<<< * """Get number of sub-DMs contained in the DMComposite""" * cdef PetscInt n = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_4getNumber[] = "DMComposite.getNumber(self)\nGet number of sub-DMs contained in the DMComposite"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getNumber (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getNumber", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getNumber", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_4getNumber(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_4getNumber(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_n; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getNumber", 0); /* "PETSc/DMComposite.pyx":22 * def getNumber(self): * """Get number of sub-DMs contained in the DMComposite""" * cdef PetscInt n = 0 # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * return toInt(n) */ __pyx_v_n = 0; /* "PETSc/DMComposite.pyx":23 * """Get number of sub-DMs contained in the DMComposite""" * cdef PetscInt n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * return toInt(n) * getNumberDM = getNumber */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 23, __pyx_L1_error) /* "PETSc/DMComposite.pyx":24 * cdef PetscInt n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * return toInt(n) # <<<<<<<<<<<<<< * getNumberDM = getNumber * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMComposite.pyx":20 * CHKERR( DMCompositeAddDM(self.dm, dm.dm) ) * * def getNumber(self): # <<<<<<<<<<<<<< * """Get number of sub-DMs contained in the DMComposite""" * cdef PetscInt n = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getNumber", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":27 * getNumberDM = getNumber * * def getEntries(self): # <<<<<<<<<<<<<< * """Get tuple of sub-DMs contained in the DMComposite""" * cdef PetscInt i, n = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_6getEntries[] = "DMComposite.getEntries(self)\nGet tuple of sub-DMs contained in the DMComposite"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getEntries (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getEntries", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getEntries", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_6getEntries(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_6getEntries(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; DM *__pyx_v_cdms; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; struct PyPetscDMObject *__pyx_v_entry = 0; PyObject *__pyx_v_entries = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getEntries", 0); /* "PETSc/DMComposite.pyx":29 * def getEntries(self): * """Get tuple of sub-DMs contained in the DMComposite""" * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscDM *cdms = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "PETSc/DMComposite.pyx":30 * """Get tuple of sub-DMs contained in the DMComposite""" * cdef PetscInt i, n = 0 * cdef PetscDM *cdms = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) */ __pyx_v_cdms = NULL; /* "PETSc/DMComposite.pyx":31 * cdef PetscInt i, n = 0 * cdef PetscDM *cdms = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 31, __pyx_L1_error) /* "PETSc/DMComposite.pyx":32 * cdef PetscDM *cdms = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) * cdef DM entry = None */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_cdms)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/DMComposite.pyx":33 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) # <<<<<<<<<<<<<< * cdef DM entry = None * cdef list entries = [] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetEntriesArray(__pyx_v_self->__pyx_base.dm, __pyx_v_cdms)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 33, __pyx_L1_error) /* "PETSc/DMComposite.pyx":34 * cdef object tmp = oarray_p(empty_p(n), NULL, &cdms) * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) * cdef DM entry = None # <<<<<<<<<<<<<< * cdef list entries = [] * for i from 0 <= i < n: */ __Pyx_INCREF(Py_None); __pyx_v_entry = ((struct PyPetscDMObject *)Py_None); /* "PETSc/DMComposite.pyx":35 * CHKERR( DMCompositeGetEntriesArray(self.dm, cdms) ) * cdef DM entry = None * cdef list entries = [] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * entry = subtype_DM(cdms[i])() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_entries = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMComposite.pyx":36 * cdef DM entry = None * cdef list entries = [] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * entry = subtype_DM(cdms[i])() * entry.dm = cdms[i] */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "PETSc/DMComposite.pyx":37 * cdef list entries = [] * for i from 0 <= i < n: * entry = subtype_DM(cdms[i])() # <<<<<<<<<<<<<< * entry.dm = cdms[i] * PetscINCREF(entry.obj) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_cdms[__pyx_v_i]))); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(50, 37, __pyx_L1_error) __Pyx_DECREF_SET(__pyx_v_entry, ((struct PyPetscDMObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "PETSc/DMComposite.pyx":38 * for i from 0 <= i < n: * entry = subtype_DM(cdms[i])() * entry.dm = cdms[i] # <<<<<<<<<<<<<< * PetscINCREF(entry.obj) * entries.append(entry) */ __pyx_v_entry->dm = (__pyx_v_cdms[__pyx_v_i]); /* "PETSc/DMComposite.pyx":39 * entry = subtype_DM(cdms[i])() * entry.dm = cdms[i] * PetscINCREF(entry.obj) # <<<<<<<<<<<<<< * entries.append(entry) * return tuple(entries) */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_entry->__pyx_base.obj)); /* "PETSc/DMComposite.pyx":40 * entry.dm = cdms[i] * PetscINCREF(entry.obj) * entries.append(entry) # <<<<<<<<<<<<<< * return tuple(entries) * */ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_entries, ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(50, 40, __pyx_L1_error) } /* "PETSc/DMComposite.pyx":41 * PetscINCREF(entry.obj) * entries.append(entry) * return tuple(entries) # <<<<<<<<<<<<<< * * def scatter(self, Vec gvec, lvecs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyList_AsTuple(__pyx_v_entries); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMComposite.pyx":27 * getNumberDM = getNumber * * def getEntries(self): # <<<<<<<<<<<<<< * """Get tuple of sub-DMs contained in the DMComposite""" * cdef PetscInt i, n = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getEntries", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF((PyObject *)__pyx_v_entry); __Pyx_XDECREF(__pyx_v_entries); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":43 * return tuple(entries) * * def scatter(self, Vec gvec, lvecs): # <<<<<<<<<<<<<< * """Scatter coupled global vector into split local vectors""" * cdef PetscInt i, n = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_8scatter[] = "DMComposite.scatter(self, Vec gvec, lvecs)\nScatter coupled global vector into split local vectors"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_lvecs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("scatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,&__pyx_n_s_lvecs,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gvec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvecs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("scatter", 1, 2, 2, 1); __PYX_ERR(50, 43, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scatter") < 0)) __PYX_ERR(50, 43, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_lvecs = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("scatter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 43, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(50, 43, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_8scatter(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_gvec, __pyx_v_lvecs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_8scatter(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_lvecs) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; Vec *__pyx_v_clvecs; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; Vec __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("scatter", 0); /* "PETSc/DMComposite.pyx":45 * def scatter(self, Vec gvec, lvecs): * """Scatter coupled global vector into split local vectors""" * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL */ __pyx_v_n = 0; /* "PETSc/DMComposite.pyx":46 * """Scatter coupled global vector into split local vectors""" * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 46, __pyx_L1_error) /* "PETSc/DMComposite.pyx":47 * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: */ __pyx_v_clvecs = NULL; /* "PETSc/DMComposite.pyx":48 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_2, NULL, ((void **)(&__pyx_v_clvecs)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/DMComposite.pyx":49 * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) */ __pyx_t_4 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "PETSc/DMComposite.pyx":50 * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec # <<<<<<<<<<<<<< * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) * */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_lvecs, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(50, 50, __pyx_L1_error) __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_clvecs[__pyx_v_i]) = __pyx_t_5; } /* "PETSc/DMComposite.pyx":51 * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) # <<<<<<<<<<<<<< * * def gather(self, Vec gvec, imode, lvecs): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeScatterArray(__pyx_v_self->__pyx_base.dm, __pyx_v_gvec->vec, __pyx_v_clvecs)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 51, __pyx_L1_error) /* "PETSc/DMComposite.pyx":43 * return tuple(entries) * * def scatter(self, Vec gvec, lvecs): # <<<<<<<<<<<<<< * """Scatter coupled global vector into split local vectors""" * cdef PetscInt i, n = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.scatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":53 * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) * * def gather(self, Vec gvec, imode, lvecs): # <<<<<<<<<<<<<< * """Gather split local vectors into coupled global vector""" * cdef PetscInsertMode cimode = insertmode(imode) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_10gather[] = "DMComposite.gather(self, Vec gvec, imode, lvecs)\nGather split local vectors into coupled global vector"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_imode = 0; PyObject *__pyx_v_lvecs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("gather (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,&__pyx_n_s_imode,&__pyx_n_s_lvecs,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gvec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_imode)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, 1); __PYX_ERR(50, 53, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lvecs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, 2); __PYX_ERR(50, 53, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gather") < 0)) __PYX_ERR(50, 53, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_imode = values[1]; __pyx_v_lvecs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 53, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(50, 53, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_10gather(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_gvec, __pyx_v_imode, __pyx_v_lvecs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_10gather(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_imode, PyObject *__pyx_v_lvecs) { InsertMode __pyx_v_cimode; PetscInt __pyx_v_i; PetscInt __pyx_v_n; Vec *__pyx_v_clvecs; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations InsertMode __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PetscInt __pyx_t_5; Vec __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("gather", 0); /* "PETSc/DMComposite.pyx":55 * def gather(self, Vec gvec, imode, lvecs): * """Gather split local vectors into coupled global vector""" * cdef PetscInsertMode cimode = insertmode(imode) # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_imode); if (unlikely(__pyx_t_1 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(50, 55, __pyx_L1_error) __pyx_v_cimode = __pyx_t_1; /* "PETSc/DMComposite.pyx":56 * """Gather split local vectors into coupled global vector""" * cdef PetscInsertMode cimode = insertmode(imode) * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL */ __pyx_v_n = 0; /* "PETSc/DMComposite.pyx":57 * cdef PetscInsertMode cimode = insertmode(imode) * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(50, 57, __pyx_L1_error) /* "PETSc/DMComposite.pyx":58 * cdef PetscInt i, n = 0 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: */ __pyx_v_clvecs = NULL; /* "PETSc/DMComposite.pyx":59 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) # <<<<<<<<<<<<<< * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_clvecs)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/DMComposite.pyx":60 * cdef PetscVec *clvecs = NULL * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: # <<<<<<<<<<<<<< * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) */ __pyx_t_5 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "PETSc/DMComposite.pyx":61 * cdef object tmp = oarray_p(empty_p(n), NULL, &clvecs) * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec # <<<<<<<<<<<<<< * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) * */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_lvecs, ((Py_ssize_t)__pyx_v_i), Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(50, 61, __pyx_L1_error) __pyx_t_6 = ((struct PyPetscVecObject *)__pyx_t_4)->vec; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_clvecs[__pyx_v_i]) = __pyx_t_6; } /* "PETSc/DMComposite.pyx":62 * for i from 0 <= i < n: * clvecs[i] = (lvecs[i]).vec * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) # <<<<<<<<<<<<<< * * def getGlobalISs(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGatherArray(__pyx_v_self->__pyx_base.dm, __pyx_v_cimode, __pyx_v_gvec->vec, __pyx_v_clvecs)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(50, 62, __pyx_L1_error) /* "PETSc/DMComposite.pyx":53 * CHKERR( DMCompositeScatterArray(self.dm, gvec.vec, clvecs) ) * * def gather(self, Vec gvec, imode, lvecs): # <<<<<<<<<<<<<< * """Gather split local vectors into coupled global vector""" * cdef PetscInsertMode cimode = insertmode(imode) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.gather", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":64 * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) * * def getGlobalISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_12getGlobalISs[] = "DMComposite.getGlobalISs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getGlobalISs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getGlobalISs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getGlobalISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_12getGlobalISs(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_12getGlobalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; IS *__pyx_v_cis; PyObject *__pyx_v_isets = 0; PetscInt __pyx_9genexpr16__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getGlobalISs", 0); /* "PETSc/DMComposite.pyx":65 * * def getGlobalISs(self): * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "PETSc/DMComposite.pyx":66 * def getGlobalISs(self): * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) */ __pyx_v_cis = NULL; /* "PETSc/DMComposite.pyx":67 * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 67, __pyx_L1_error) /* "PETSc/DMComposite.pyx":68 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) # <<<<<<<<<<<<<< * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetGlobalISs(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cis))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 68, __pyx_L1_error) /* "PETSc/DMComposite.pyx":69 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_n; for (__pyx_9genexpr16__pyx_v_i = 0; __pyx_9genexpr16__pyx_v_i < __pyx_t_3; __pyx_9genexpr16__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr16__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(50, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_isets = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/DMComposite.pyx":70 * CHKERR( DMCompositeGetGlobalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) */ __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/DMComposite.pyx":71 * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cis) ) * return isets */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&(__pyx_v_cis[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 71, __pyx_L1_error) } /* "PETSc/DMComposite.pyx":72 * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) # <<<<<<<<<<<<<< * return isets * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cis)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 72, __pyx_L1_error) /* "PETSc/DMComposite.pyx":73 * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) * return isets # <<<<<<<<<<<<<< * * def getLocalISs(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_isets); __pyx_r = __pyx_v_isets; goto __pyx_L0; /* "PETSc/DMComposite.pyx":64 * CHKERR( DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs) ) * * def getGlobalISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getGlobalISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_isets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":75 * return isets * * def getLocalISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_14getLocalISs[] = "DMComposite.getLocalISs(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalISs (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalISs", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalISs", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_14getLocalISs(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_14getLocalISs(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; IS *__pyx_v_cis; PyObject *__pyx_v_isets = 0; PetscInt __pyx_9genexpr17__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalISs", 0); /* "PETSc/DMComposite.pyx":76 * * def getLocalISs(self): * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "PETSc/DMComposite.pyx":77 * def getLocalISs(self): * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) */ __pyx_v_cis = NULL; /* "PETSc/DMComposite.pyx":78 * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 78, __pyx_L1_error) /* "PETSc/DMComposite.pyx":79 * cdef PetscIS *cis = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) # <<<<<<<<<<<<<< * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetLocalISs(__pyx_v_self->__pyx_base.dm, (&__pyx_v_cis))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 79, __pyx_L1_error) /* "PETSc/DMComposite.pyx":80 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_n; for (__pyx_9genexpr17__pyx_v_i = 0; __pyx_9genexpr17__pyx_v_i < __pyx_t_3; __pyx_9genexpr17__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr17__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(50, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_isets = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/DMComposite.pyx":81 * CHKERR( DMCompositeGetLocalISs(self.dm, &cis) ) * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) */ __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/DMComposite.pyx":82 * cdef object isets = [ref_IS(cis[i]) for i from 0 <= i < n] * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(cis) ) * return isets */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDestroy((&(__pyx_v_cis[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 82, __pyx_L1_error) } /* "PETSc/DMComposite.pyx":83 * for i from 0 <= i < n: * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) # <<<<<<<<<<<<<< * return isets * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cis)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 83, __pyx_L1_error) /* "PETSc/DMComposite.pyx":84 * CHKERR( ISDestroy(&cis[i]) ) * CHKERR( PetscFree(cis) ) * return isets # <<<<<<<<<<<<<< * * def getLGMaps(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_isets); __pyx_r = __pyx_v_isets; goto __pyx_L0; /* "PETSc/DMComposite.pyx":75 * return isets * * def getLocalISs(self): # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * cdef PetscIS *cis = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getLocalISs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_isets); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":86 * return isets * * def getLGMaps(self): # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * cdef PetscLGMap *clgm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_16getLGMaps[] = "DMComposite.getLGMaps(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLGMaps (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLGMaps", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLGMaps", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_16getLGMaps(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_16getLGMaps(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self) { PetscInt __pyx_v_i; PetscInt __pyx_v_n; ISLocalToGlobalMapping *__pyx_v_clgm; PyObject *__pyx_v_lgms = 0; PetscInt __pyx_9genexpr18__pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PetscInt __pyx_t_3; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLGMaps", 0); /* "PETSc/DMComposite.pyx":87 * * def getLGMaps(self): * cdef PetscInt i, n = 0 # <<<<<<<<<<<<<< * cdef PetscLGMap *clgm = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) */ __pyx_v_n = 0; /* "PETSc/DMComposite.pyx":88 * def getLGMaps(self): * cdef PetscInt i, n = 0 * cdef PetscLGMap *clgm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) */ __pyx_v_clgm = NULL; /* "PETSc/DMComposite.pyx":89 * cdef PetscInt i, n = 0 * cdef PetscLGMap *clgm = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) # <<<<<<<<<<<<<< * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetNumberDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_n))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 89, __pyx_L1_error) /* "PETSc/DMComposite.pyx":90 * cdef PetscLGMap *clgm = NULL * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) # <<<<<<<<<<<<<< * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] * for i from 0 <= i < n: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCompositeGetISLocalToGlobalMappings(__pyx_v_self->__pyx_base.dm, (&__pyx_v_clgm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 90, __pyx_L1_error) /* "PETSc/DMComposite.pyx":91 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] # <<<<<<<<<<<<<< * for i from 0 <= i < n: * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) */ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_v_n; for (__pyx_9genexpr18__pyx_v_i = 0; __pyx_9genexpr18__pyx_v_i < __pyx_t_3; __pyx_9genexpr18__pyx_v_i++) { __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_LGMap((__pyx_v_clgm[__pyx_9genexpr18__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(50, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } /* exit inner scope */ __pyx_v_lgms = __pyx_t_2; __pyx_t_2 = 0; /* "PETSc/DMComposite.pyx":92 * CHKERR( DMCompositeGetISLocalToGlobalMappings(self.dm, &clgm) ) * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] * for i from 0 <= i < n: # <<<<<<<<<<<<<< * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) * CHKERR( PetscFree(clgm) ) */ __pyx_t_3 = __pyx_v_n; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/DMComposite.pyx":93 * cdef object lgms = [ref_LGMap(clgm[i]) for i from 0 <= i < n] * for i from 0 <= i < n: * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) # <<<<<<<<<<<<<< * CHKERR( PetscFree(clgm) ) * return lgms */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingDestroy((&(__pyx_v_clgm[__pyx_v_i])))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 93, __pyx_L1_error) } /* "PETSc/DMComposite.pyx":94 * for i from 0 <= i < n: * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) * CHKERR( PetscFree(clgm) ) # <<<<<<<<<<<<<< * return lgms * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_clgm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(50, 94, __pyx_L1_error) /* "PETSc/DMComposite.pyx":95 * CHKERR( ISLocalToGlobalMappingDestroy(&clgm[i]) ) * CHKERR( PetscFree(clgm) ) * return lgms # <<<<<<<<<<<<<< * * def getAccess(self, Vec gvec, locs=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_lgms); __pyx_r = __pyx_v_lgms; goto __pyx_L0; /* "PETSc/DMComposite.pyx":86 * return isets * * def getLGMaps(self): # <<<<<<<<<<<<<< * cdef PetscInt i, n = 0 * cdef PetscLGMap *clgm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getLGMaps", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_lgms); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMComposite.pyx":97 * return lgms * * def getAccess(self, Vec gvec, locs=None): # <<<<<<<<<<<<<< * """Get access to specified parts of global vector. * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_19getAccess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11DMComposite_18getAccess[] = "DMComposite.getAccess(self, Vec gvec, locs=None)\nGet access to specified parts of global vector.\n\n Use via 'with' context manager (PEP 343).\n "; static PyObject *__pyx_pw_8petsc4py_5PETSc_11DMComposite_19getAccess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_gvec = 0; PyObject *__pyx_v_locs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getAccess (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gvec,&__pyx_n_s_locs,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gvec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_locs); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getAccess") < 0)) __PYX_ERR(50, 97, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]); __pyx_v_locs = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getAccess", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(50, 97, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(50, 97, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11DMComposite_18getAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)__pyx_v_self), __pyx_v_gvec, __pyx_v_locs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11DMComposite_18getAccess(struct __pyx_obj_8petsc4py_5PETSc_DMComposite *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gvec, PyObject *__pyx_v_locs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getAccess", 0); /* "PETSc/DMComposite.pyx":102 * Use via 'with' context manager (PEP 343). * """ * return _DMComposite_access(self, gvec, locs) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(((PyObject *)__pyx_v_gvec)); __Pyx_GIVEREF(((PyObject *)__pyx_v_gvec)); PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_gvec)); __Pyx_INCREF(__pyx_v_locs); __Pyx_GIVEREF(__pyx_v_locs); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_locs); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8petsc4py_5PETSc__DMComposite_access), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/DMComposite.pyx":97 * return lgms * * def getAccess(self, Vec gvec, locs=None): # <<<<<<<<<<<<<< * """Get access to specified parts of global vector. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":3 * cdef class DMShell(DM): * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_create[] = "DMShell.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(51, 3, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 3, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_create(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_create(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DMShell.pyx":4 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMShellCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 4, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMShell.pyx":5 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMShellCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMShell.pyx":6 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMShellCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(51, 6, __pyx_L1_error) /* "PETSc/DMShell.pyx":7 * cdef PetscDM newdm = NULL * CHKERR( DMShellCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMShell.pyx":8 * CHKERR( DMShellCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * return self # <<<<<<<<<<<<<< * * def setMatrix(self, Mat mat): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMShell.pyx":3 * cdef class DMShell(DM): * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":10 * return self * * def setMatrix(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_2setMatrix[] = "DMShell.setMatrix(self, Mat mat)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscMatObject *__pyx_v_mat = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mat,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setMatrix") < 0)) __PYX_ERR(51, 10, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_mat = ((struct PyPetscMatObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setMatrix", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 10, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(51, 10, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_2setMatrix(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_mat); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_2setMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setMatrix", 0); /* "PETSc/DMShell.pyx":11 * * def setMatrix(self, Mat mat): * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) # <<<<<<<<<<<<<< * * def setGlobalVector(self, Vec gv): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetMatrix(__pyx_v_self->__pyx_base.dm, __pyx_v_mat->mat)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(51, 11, __pyx_L1_error) /* "PETSc/DMShell.pyx":10 * return self * * def setMatrix(self, Mat mat): # <<<<<<<<<<<<<< * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":13 * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) * * def setGlobalVector(self, Vec gv): # <<<<<<<<<<<<<< * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_4setGlobalVector[] = "DMShell.setGlobalVector(self, Vec gv)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_gv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalVector (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gv,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gv)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGlobalVector") < 0)) __PYX_ERR(51, 13, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_gv = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalVector", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 13, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gv), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gv", 0))) __PYX_ERR(51, 13, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_4setGlobalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_gv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_4setGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalVector", 0); /* "PETSc/DMShell.pyx":14 * * def setGlobalVector(self, Vec gv): * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) # <<<<<<<<<<<<<< * * def setLocalVector(self, Vec lv): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetGlobalVector(__pyx_v_self->__pyx_base.dm, __pyx_v_gv->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(51, 14, __pyx_L1_error) /* "PETSc/DMShell.pyx":13 * CHKERR( DMShellSetMatrix(self.dm, mat.mat) ) * * def setGlobalVector(self, Vec gv): # <<<<<<<<<<<<<< * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":16 * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) * * def setLocalVector(self, Vec lv): # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_6setLocalVector[] = "DMShell.setLocalVector(self, Vec lv)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscVecObject *__pyx_v_lv = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalVector (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lv,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lv)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLocalVector") < 0)) __PYX_ERR(51, 16, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_lv = ((struct PyPetscVecObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalVector", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 16, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lv), __pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lv", 0))) __PYX_ERR(51, 16, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_6setLocalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_lv); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_6setLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscVecObject *__pyx_v_lv) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalVector", 0); /* "PETSc/DMShell.pyx":17 * * def setLocalVector(self, Vec lv): * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) # <<<<<<<<<<<<<< * * def setCreateGlobalVector(self, create_gvec, args=None, kargs=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalVector(__pyx_v_self->__pyx_base.dm, __pyx_v_lv->vec)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(51, 17, __pyx_L1_error) /* "PETSc/DMShell.pyx":16 * CHKERR( DMShellSetGlobalVector(self.dm, gv.vec) ) * * def setLocalVector(self, Vec lv): # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":19 * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) * * def setCreateGlobalVector(self, create_gvec, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_gvec is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector[] = "DMShell.setCreateGlobalVector(self, create_gvec, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_create_gvec = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateGlobalVector (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_gvec,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create_gvec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateGlobalVector") < 0)) __PYX_ERR(51, 19, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_gvec = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateGlobalVector", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 19, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_gvec, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_gvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateGlobalVector", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":20 * * def setCreateGlobalVector(self, create_gvec, args=None, kargs=None): * if create_gvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_gvec != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":21 * def setCreateGlobalVector(self, create_gvec, args=None, kargs=None): * if create_gvec is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_gvec, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":22 * if create_gvec is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_gvec, args, kargs) * self.set_attr('__create_global_vector__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":23 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_gvec, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_global_vector__', context) * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_create_gvec); __Pyx_GIVEREF(__pyx_v_create_gvec); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_create_gvec); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":24 * if kargs is None: kargs = {} * context = (create_gvec, args, kargs) * self.set_attr('__create_global_vector__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_global_vector__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":25 * context = (create_gvec, args, kargs) * self.set_attr('__create_global_vector__', context) * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateGlobalVector(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateGlobalVector)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 25, __pyx_L1_error) /* "PETSc/DMShell.pyx":20 * * def setCreateGlobalVector(self, create_gvec, args=None, kargs=None): * if create_gvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":27 * CHKERR( DMShellSetCreateGlobalVector(self.dm, DMSHELL_CreateGlobalVector) ) * else: * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateLocalVector(self, create_lvec, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateGlobalVector(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 27, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":19 * CHKERR( DMShellSetLocalVector(self.dm, lv.vec) ) * * def setCreateGlobalVector(self, create_gvec, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_gvec is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateGlobalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":29 * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) * * def setCreateLocalVector(self, create_lvec, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_lvec is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector[] = "DMShell.setCreateLocalVector(self, create_lvec, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_create_lvec = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateLocalVector (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_lvec,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create_lvec)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateLocalVector") < 0)) __PYX_ERR(51, 29, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_lvec = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateLocalVector", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 29, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_lvec, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_lvec, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateLocalVector", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":30 * * def setCreateLocalVector(self, create_lvec, args=None, kargs=None): * if create_lvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_lvec != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":31 * def setCreateLocalVector(self, create_lvec, args=None, kargs=None): * if create_lvec is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_lvec, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":32 * if create_lvec is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_lvec, args, kargs) * self.set_attr('__create_local_vector__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":33 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_lvec, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_local_vector__', context) * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_create_lvec); __Pyx_GIVEREF(__pyx_v_create_lvec); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_create_lvec); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":34 * if kargs is None: kargs = {} * context = (create_lvec, args, kargs) * self.set_attr('__create_local_vector__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_local_vector__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":35 * context = (create_lvec, args, kargs) * self.set_attr('__create_local_vector__', context) * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateLocalVector(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateLocalVector)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 35, __pyx_L1_error) /* "PETSc/DMShell.pyx":30 * * def setCreateLocalVector(self, create_lvec, args=None, kargs=None): * if create_lvec is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":37 * CHKERR( DMShellSetCreateLocalVector(self.dm, DMSHELL_CreateLocalVector) ) * else: * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateLocalVector(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 37, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":29 * CHKERR( DMShellSetCreateGlobalVector(self.dm, NULL) ) * * def setCreateLocalVector(self, create_lvec, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_lvec is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateLocalVector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":39 * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) * * def setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal[] = "DMShell.setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_begin = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_begin_args = 0; PyObject *__pyx_v_begin_kargs = 0; PyObject *__pyx_v_end_args = 0; PyObject *__pyx_v_end_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalToLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,&__pyx_n_s_end,&__pyx_n_s_begin_args,&__pyx_n_s_begin_kargs,&__pyx_n_s_end_args,&__pyx_n_s_end_kargs,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); /* "PETSc/DMShell.pyx":40 * * def setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, * end_args=None, end_kargs=None): # <<<<<<<<<<<<<< * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: */ values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setGlobalToLocal", 0, 2, 6, 1); __PYX_ERR(51, 39, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin_kargs); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end_args); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end_kargs); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGlobalToLocal") < 0)) __PYX_ERR(51, 39, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_begin = values[0]; __pyx_v_end = values[1]; __pyx_v_begin_args = values[2]; __pyx_v_begin_kargs = values[3]; __pyx_v_end_args = values[4]; __pyx_v_end_kargs = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalToLocal", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 39, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_begin, __pyx_v_end, __pyx_v_begin_args, __pyx_v_begin_kargs, __pyx_v_end_args, __pyx_v_end_kargs); /* "PETSc/DMShell.pyx":39 * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) * * def setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs) { __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cbegin; __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cend; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalToLocal", 0); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_INCREF(__pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); /* "PETSc/DMShell.pyx":41 * def setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL # <<<<<<<<<<<<<< * if begin is not None: * if begin_args is None: begin_args = () */ __pyx_v_cbegin = NULL; __pyx_v_cend = NULL; /* "PETSc/DMShell.pyx":42 * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ __pyx_t_1 = (__pyx_v_begin != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":43 * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: * if begin_args is None: begin_args = () # <<<<<<<<<<<<<< * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) */ __pyx_t_2 = (__pyx_v_begin_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":44 * if begin is not None: * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} # <<<<<<<<<<<<<< * context = (begin, begin_args, begin_kargs) * self.set_attr('__g2l_begin__', context) */ __pyx_t_1 = (__pyx_v_begin_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_begin_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":45 * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) # <<<<<<<<<<<<<< * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_begin); __Pyx_GIVEREF(__pyx_v_begin); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_begin); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_GIVEREF(__pyx_v_begin_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_GIVEREF(__pyx_v_begin_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_begin_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":46 * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) * self.set_attr('__g2l_begin__', context) # <<<<<<<<<<<<<< * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__g2l_begin__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":47 * context = (begin, begin_args, begin_kargs) * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin # <<<<<<<<<<<<<< * if end is not None: * if end_args is None: end_args = () */ __pyx_v_cbegin = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalBegin); /* "PETSc/DMShell.pyx":42 * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ } /* "PETSc/DMShell.pyx":48 * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ __pyx_t_2 = (__pyx_v_end != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/DMShell.pyx":49 * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: * if end_args is None: end_args = () # <<<<<<<<<<<<<< * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) */ __pyx_t_1 = (__pyx_v_end_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":50 * if end is not None: * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} # <<<<<<<<<<<<<< * context = (end, end_args, end_kargs) * self.set_attr('__g2l_end__', context) */ __pyx_t_2 = (__pyx_v_end_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_end_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":51 * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) # <<<<<<<<<<<<<< * self.set_attr('__g2l_end__', context) * cend = &DMSHELL_GlobalToLocalEnd */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_end); __Pyx_INCREF(__pyx_v_end_args); __Pyx_GIVEREF(__pyx_v_end_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); __Pyx_GIVEREF(__pyx_v_end_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_end_kargs); __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":52 * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) * self.set_attr('__g2l_end__', context) # <<<<<<<<<<<<<< * cend = &DMSHELL_GlobalToLocalEnd * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__g2l_end__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":53 * context = (end, end_args, end_kargs) * self.set_attr('__g2l_end__', context) * cend = &DMSHELL_GlobalToLocalEnd # <<<<<<<<<<<<<< * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) * */ __pyx_v_cend = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_GlobalToLocalEnd); /* "PETSc/DMShell.pyx":48 * self.set_attr('__g2l_begin__', context) * cbegin = &DMSHELL_GlobalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ } /* "PETSc/DMShell.pyx":54 * self.set_attr('__g2l_end__', context) * cend = &DMSHELL_GlobalToLocalEnd * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) # <<<<<<<<<<<<<< * * def setGlobalToLocalVecScatter(self, Scatter gtol): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetGlobalToLocal(__pyx_v_self->__pyx_base.dm, __pyx_v_cbegin, __pyx_v_cend)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 54, __pyx_L1_error) /* "PETSc/DMShell.pyx":39 * CHKERR( DMShellSetCreateLocalVector(self.dm, NULL) ) * * def setGlobalToLocal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin_args); __Pyx_XDECREF(__pyx_v_begin_kargs); __Pyx_XDECREF(__pyx_v_end_args); __Pyx_XDECREF(__pyx_v_end_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":56 * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) * * def setGlobalToLocalVecScatter(self, Scatter gtol): # <<<<<<<<<<<<<< * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter[] = "DMShell.setGlobalToLocalVecScatter(self, Scatter gtol)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscScatterObject *__pyx_v_gtol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setGlobalToLocalVecScatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gtol,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gtol)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setGlobalToLocalVecScatter") < 0)) __PYX_ERR(51, 56, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_gtol = ((struct PyPetscScatterObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setGlobalToLocalVecScatter", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 56, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gtol), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "gtol", 0))) __PYX_ERR(51, 56, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_gtol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_gtol) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setGlobalToLocalVecScatter", 0); /* "PETSc/DMShell.pyx":57 * * def setGlobalToLocalVecScatter(self, Scatter gtol): * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) # <<<<<<<<<<<<<< * * def setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetGlobalToLocalVecScatter(__pyx_v_self->__pyx_base.dm, __pyx_v_gtol->sct)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(51, 57, __pyx_L1_error) /* "PETSc/DMShell.pyx":56 * CHKERR( DMShellSetGlobalToLocal(self.dm, cbegin, cend) ) * * def setGlobalToLocalVecScatter(self, Scatter gtol): # <<<<<<<<<<<<<< * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setGlobalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":59 * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * * def setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal[] = "DMShell.setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_begin = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_begin_args = 0; PyObject *__pyx_v_begin_kargs = 0; PyObject *__pyx_v_end_args = 0; PyObject *__pyx_v_end_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToGlobal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,&__pyx_n_s_end,&__pyx_n_s_begin_args,&__pyx_n_s_begin_kargs,&__pyx_n_s_end_args,&__pyx_n_s_end_kargs,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); /* "PETSc/DMShell.pyx":60 * * def setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, * end_args=None, end_kargs=None): # <<<<<<<<<<<<<< * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: */ values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setLocalToGlobal", 0, 2, 6, 1); __PYX_ERR(51, 59, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin_kargs); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end_args); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end_kargs); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLocalToGlobal") < 0)) __PYX_ERR(51, 59, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_begin = values[0]; __pyx_v_end = values[1]; __pyx_v_begin_args = values[2]; __pyx_v_begin_kargs = values[3]; __pyx_v_end_args = values[4]; __pyx_v_end_kargs = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToGlobal", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 59, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_begin, __pyx_v_end, __pyx_v_begin_args, __pyx_v_begin_kargs, __pyx_v_end_args, __pyx_v_end_kargs); /* "PETSc/DMShell.pyx":59 * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * * def setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs) { __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cbegin; __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cend; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToGlobal", 0); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_INCREF(__pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); /* "PETSc/DMShell.pyx":61 * def setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL # <<<<<<<<<<<<<< * if begin is not None: * if begin_args is None: begin_args = () */ __pyx_v_cbegin = NULL; __pyx_v_cend = NULL; /* "PETSc/DMShell.pyx":62 * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ __pyx_t_1 = (__pyx_v_begin != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":63 * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: * if begin_args is None: begin_args = () # <<<<<<<<<<<<<< * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) */ __pyx_t_2 = (__pyx_v_begin_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":64 * if begin is not None: * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} # <<<<<<<<<<<<<< * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2g_begin__', context) */ __pyx_t_1 = (__pyx_v_begin_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_begin_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":65 * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_begin); __Pyx_GIVEREF(__pyx_v_begin); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_begin); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_GIVEREF(__pyx_v_begin_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_GIVEREF(__pyx_v_begin_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_begin_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":66 * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2g_begin__', context) # <<<<<<<<<<<<<< * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2g_begin__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":67 * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin # <<<<<<<<<<<<<< * if end is not None: * if end_args is None: end_args = () */ __pyx_v_cbegin = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalBegin); /* "PETSc/DMShell.pyx":62 * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ } /* "PETSc/DMShell.pyx":68 * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ __pyx_t_2 = (__pyx_v_end != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/DMShell.pyx":69 * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: * if end_args is None: end_args = () # <<<<<<<<<<<<<< * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) */ __pyx_t_1 = (__pyx_v_end_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":70 * if end is not None: * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} # <<<<<<<<<<<<<< * context = (end, end_args, end_kargs) * self.set_attr('__l2g_end__', context) */ __pyx_t_2 = (__pyx_v_end_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_end_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":71 * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2g_end__', context) * cend = &DMSHELL_LocalToGlobalEnd */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_end); __Pyx_INCREF(__pyx_v_end_args); __Pyx_GIVEREF(__pyx_v_end_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); __Pyx_GIVEREF(__pyx_v_end_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_end_kargs); __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":72 * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) * self.set_attr('__l2g_end__', context) # <<<<<<<<<<<<<< * cend = &DMSHELL_LocalToGlobalEnd * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2g_end__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":73 * context = (end, end_args, end_kargs) * self.set_attr('__l2g_end__', context) * cend = &DMSHELL_LocalToGlobalEnd # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) * */ __pyx_v_cend = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToGlobalEnd); /* "PETSc/DMShell.pyx":68 * self.set_attr('__l2g_begin__', context) * cbegin = &DMSHELL_LocalToGlobalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ } /* "PETSc/DMShell.pyx":74 * self.set_attr('__l2g_end__', context) * cend = &DMSHELL_LocalToGlobalEnd * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) # <<<<<<<<<<<<<< * * def setLocalToGlobalVecScatter(self, Scatter ltog): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToGlobal(__pyx_v_self->__pyx_base.dm, __pyx_v_cbegin, __pyx_v_cend)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 74, __pyx_L1_error) /* "PETSc/DMShell.pyx":59 * CHKERR( DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct) ) * * def setLocalToGlobal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin_args); __Pyx_XDECREF(__pyx_v_begin_kargs); __Pyx_XDECREF(__pyx_v_end_args); __Pyx_XDECREF(__pyx_v_end_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":76 * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) * * def setLocalToGlobalVecScatter(self, Scatter ltog): # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter[] = "DMShell.setLocalToGlobalVecScatter(self, Scatter ltog)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscScatterObject *__pyx_v_ltog = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToGlobalVecScatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ltog,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ltog)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLocalToGlobalVecScatter") < 0)) __PYX_ERR(51, 76, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ltog = ((struct PyPetscScatterObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToGlobalVecScatter", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 76, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ltog), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "ltog", 0))) __PYX_ERR(51, 76, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_ltog); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltog) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToGlobalVecScatter", 0); /* "PETSc/DMShell.pyx":77 * * def setLocalToGlobalVecScatter(self, Scatter ltog): * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) # <<<<<<<<<<<<<< * * def setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToGlobalVecScatter(__pyx_v_self->__pyx_base.dm, __pyx_v_ltog->sct)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(51, 77, __pyx_L1_error) /* "PETSc/DMShell.pyx":76 * CHKERR( DMShellSetLocalToGlobal(self.dm, cbegin, cend) ) * * def setLocalToGlobalVecScatter(self, Scatter ltog): # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToGlobalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":79 * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * * def setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_20setLocalToLocal[] = "DMShell.setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, end_args=None, end_kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_begin = 0; PyObject *__pyx_v_end = 0; PyObject *__pyx_v_begin_args = 0; PyObject *__pyx_v_begin_kargs = 0; PyObject *__pyx_v_end_args = 0; PyObject *__pyx_v_end_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToLocal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,&__pyx_n_s_end,&__pyx_n_s_begin_args,&__pyx_n_s_begin_kargs,&__pyx_n_s_end_args,&__pyx_n_s_end_kargs,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[2] = ((PyObject *)Py_None); values[3] = ((PyObject *)Py_None); /* "PETSc/DMShell.pyx":80 * * def setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, * end_args=None, end_kargs=None): # <<<<<<<<<<<<<< * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * cbegin = NULL */ values[4] = ((PyObject *)Py_None); values[5] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setLocalToLocal", 0, 2, 6, 1); __PYX_ERR(51, 79, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin_args); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_begin_kargs); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end_args); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end_kargs); if (value) { values[5] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLocalToLocal") < 0)) __PYX_ERR(51, 79, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_begin = values[0]; __pyx_v_end = values[1]; __pyx_v_begin_args = values[2]; __pyx_v_begin_kargs = values[3]; __pyx_v_end_args = values[4]; __pyx_v_end_kargs = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToLocal", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 79, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_20setLocalToLocal(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_begin, __pyx_v_end, __pyx_v_begin_args, __pyx_v_begin_kargs, __pyx_v_end_args, __pyx_v_end_kargs); /* "PETSc/DMShell.pyx":79 * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * * def setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_20setLocalToLocal(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_begin, PyObject *__pyx_v_end, PyObject *__pyx_v_begin_args, PyObject *__pyx_v_begin_kargs, PyObject *__pyx_v_end_args, PyObject *__pyx_v_end_kargs) { __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cbegin; __pyx_t_8petsc4py_5PETSc_PetscDMShellXToYFunction __pyx_v_cend; PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToLocal", 0); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_INCREF(__pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); /* "PETSc/DMShell.pyx":81 * def setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL # <<<<<<<<<<<<<< * cbegin = NULL * cend = NULL */ __pyx_v_cbegin = NULL; __pyx_v_cend = NULL; /* "PETSc/DMShell.pyx":82 * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * cbegin = NULL # <<<<<<<<<<<<<< * cend = NULL * if begin is not None: */ __pyx_v_cbegin = NULL; /* "PETSc/DMShell.pyx":83 * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL * cbegin = NULL * cend = NULL # <<<<<<<<<<<<<< * if begin is not None: * if begin_args is None: begin_args = () */ __pyx_v_cend = NULL; /* "PETSc/DMShell.pyx":84 * cbegin = NULL * cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ __pyx_t_1 = (__pyx_v_begin != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":85 * cend = NULL * if begin is not None: * if begin_args is None: begin_args = () # <<<<<<<<<<<<<< * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) */ __pyx_t_2 = (__pyx_v_begin_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":86 * if begin is not None: * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} # <<<<<<<<<<<<<< * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2l_begin__', context) */ __pyx_t_1 = (__pyx_v_begin_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_begin_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":87 * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_begin); __Pyx_GIVEREF(__pyx_v_begin); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_begin); __Pyx_INCREF(__pyx_v_begin_args); __Pyx_GIVEREF(__pyx_v_begin_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_begin_args); __Pyx_INCREF(__pyx_v_begin_kargs); __Pyx_GIVEREF(__pyx_v_begin_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_begin_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":88 * if begin_kargs is None: begin_kargs = {} * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2l_begin__', context) # <<<<<<<<<<<<<< * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2l_begin__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":89 * context = (begin, begin_args, begin_kargs) * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin # <<<<<<<<<<<<<< * if end is not None: * if end_args is None: end_args = () */ __pyx_v_cbegin = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalBegin); /* "PETSc/DMShell.pyx":84 * cbegin = NULL * cend = NULL * if begin is not None: # <<<<<<<<<<<<<< * if begin_args is None: begin_args = () * if begin_kargs is None: begin_kargs = {} */ } /* "PETSc/DMShell.pyx":90 * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ __pyx_t_2 = (__pyx_v_end != Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "PETSc/DMShell.pyx":91 * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: * if end_args is None: end_args = () # <<<<<<<<<<<<<< * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) */ __pyx_t_1 = (__pyx_v_end_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":92 * if end is not None: * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} # <<<<<<<<<<<<<< * context = (end, end_args, end_kargs) * self.set_attr('__l2l_end__', context) */ __pyx_t_2 = (__pyx_v_end_kargs == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_end_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":93 * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) # <<<<<<<<<<<<<< * self.set_attr('__l2l_end__', context) * cend = &DMSHELL_LocalToLocalEnd */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_end); __Pyx_GIVEREF(__pyx_v_end); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_end); __Pyx_INCREF(__pyx_v_end_args); __Pyx_GIVEREF(__pyx_v_end_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_end_args); __Pyx_INCREF(__pyx_v_end_kargs); __Pyx_GIVEREF(__pyx_v_end_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_end_kargs); __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":94 * if end_kargs is None: end_kargs = {} * context = (end, end_args, end_kargs) * self.set_attr('__l2l_end__', context) # <<<<<<<<<<<<<< * cend = &DMSHELL_LocalToLocalEnd * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__l2l_end__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":95 * context = (end, end_args, end_kargs) * self.set_attr('__l2l_end__', context) * cend = &DMSHELL_LocalToLocalEnd # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) * */ __pyx_v_cend = (&__pyx_f_8petsc4py_5PETSc_DMSHELL_LocalToLocalEnd); /* "PETSc/DMShell.pyx":90 * self.set_attr('__l2l_begin__', context) * cbegin = &DMSHELL_LocalToLocalBegin * if end is not None: # <<<<<<<<<<<<<< * if end_args is None: end_args = () * if end_kargs is None: end_kargs = {} */ } /* "PETSc/DMShell.pyx":96 * self.set_attr('__l2l_end__', context) * cend = &DMSHELL_LocalToLocalEnd * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) # <<<<<<<<<<<<<< * * def setLocalToLocalVecScatter(self, Scatter ltol): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToLocal(__pyx_v_self->__pyx_base.dm, __pyx_v_cbegin, __pyx_v_cend)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 96, __pyx_L1_error) /* "PETSc/DMShell.pyx":79 * CHKERR( DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct) ) * * def setLocalToLocal(self, begin, end, begin_args=None, begin_kargs=None, # <<<<<<<<<<<<<< * end_args=None, end_kargs=None): * cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_begin_args); __Pyx_XDECREF(__pyx_v_begin_kargs); __Pyx_XDECREF(__pyx_v_end_args); __Pyx_XDECREF(__pyx_v_end_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":98 * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) * * def setLocalToLocalVecScatter(self, Scatter ltol): # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter[] = "DMShell.setLocalToLocalVecScatter(self, Scatter ltol)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscScatterObject *__pyx_v_ltol = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalToLocalVecScatter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ltol,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ltol)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLocalToLocalVecScatter") < 0)) __PYX_ERR(51, 98, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_ltol = ((struct PyPetscScatterObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalToLocalVecScatter", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 98, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ltol), __pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "ltol", 0))) __PYX_ERR(51, 98, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_ltol); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_ltol) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalToLocalVecScatter", 0); /* "PETSc/DMShell.pyx":99 * * def setLocalToLocalVecScatter(self, Scatter ltol): * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) # <<<<<<<<<<<<<< * * def setCreateMatrix(self, create_matrix, args=None, kargs=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetLocalToLocalVecScatter(__pyx_v_self->__pyx_base.dm, __pyx_v_ltol->sct)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(51, 99, __pyx_L1_error) /* "PETSc/DMShell.pyx":98 * CHKERR( DMShellSetLocalToLocal(self.dm, cbegin, cend) ) * * def setLocalToLocalVecScatter(self, Scatter ltol): # <<<<<<<<<<<<<< * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setLocalToLocalVecScatter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":101 * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) * * def setCreateMatrix(self, create_matrix, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_matrix is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_24setCreateMatrix[] = "DMShell.setCreateMatrix(self, create_matrix, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_create_matrix = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateMatrix (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_matrix,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create_matrix)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateMatrix") < 0)) __PYX_ERR(51, 101, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_matrix = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateMatrix", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 101, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_24setCreateMatrix(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_matrix, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_24setCreateMatrix(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_matrix, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateMatrix", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":102 * * def setCreateMatrix(self, create_matrix, args=None, kargs=None): * if create_matrix is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_matrix != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":103 * def setCreateMatrix(self, create_matrix, args=None, kargs=None): * if create_matrix is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_matrix, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":104 * if create_matrix is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_matrix, args, kargs) * self.set_attr('__create_matrix__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":105 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_matrix, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_matrix__', context) * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_create_matrix); __Pyx_GIVEREF(__pyx_v_create_matrix); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_create_matrix); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":106 * if kargs is None: kargs = {} * context = (create_matrix, args, kargs) * self.set_attr('__create_matrix__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_matrix__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":107 * context = (create_matrix, args, kargs) * self.set_attr('__create_matrix__', context) * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateMatrix(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateMatrix)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 107, __pyx_L1_error) /* "PETSc/DMShell.pyx":102 * * def setCreateMatrix(self, create_matrix, args=None, kargs=None): * if create_matrix is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":109 * CHKERR( DMShellSetCreateMatrix(self.dm, DMSHELL_CreateMatrix) ) * else: * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCoarsen(self, coarsen, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateMatrix(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 109, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":101 * CHKERR( DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct) ) * * def setCreateMatrix(self, create_matrix, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_matrix is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":111 * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) * * def setCoarsen(self, coarsen, args=None, kargs=None): # <<<<<<<<<<<<<< * if coarsen is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_26setCoarsen[] = "DMShell.setCoarsen(self, coarsen, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_coarsen = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCoarsen (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coarsen,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coarsen)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCoarsen") < 0)) __PYX_ERR(51, 111, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_coarsen = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCoarsen", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 111, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCoarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_26setCoarsen(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_coarsen, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_26setCoarsen(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_coarsen, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCoarsen", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":112 * * def setCoarsen(self, coarsen, args=None, kargs=None): * if coarsen is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_coarsen != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":113 * def setCoarsen(self, coarsen, args=None, kargs=None): * if coarsen is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (coarsen, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":114 * if coarsen is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (coarsen, args, kargs) * self.set_attr('__coarsen__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":115 * if args is None: args = () * if kargs is None: kargs = {} * context = (coarsen, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__coarsen__', context) * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_coarsen); __Pyx_GIVEREF(__pyx_v_coarsen); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_coarsen); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":116 * if kargs is None: kargs = {} * context = (coarsen, args, kargs) * self.set_attr('__coarsen__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__coarsen__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":117 * context = (coarsen, args, kargs) * self.set_attr('__coarsen__', context) * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCoarsen(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_Coarsen)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 117, __pyx_L1_error) /* "PETSc/DMShell.pyx":112 * * def setCoarsen(self, coarsen, args=None, kargs=None): * if coarsen is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":119 * CHKERR( DMShellSetCoarsen(self.dm, DMSHELL_Coarsen) ) * else: * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setRefine(self, refine, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCoarsen(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 119, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":111 * CHKERR( DMShellSetCreateMatrix(self.dm, NULL) ) * * def setCoarsen(self, coarsen, args=None, kargs=None): # <<<<<<<<<<<<<< * if coarsen is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCoarsen", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":121 * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) * * def setRefine(self, refine, args=None, kargs=None): # <<<<<<<<<<<<<< * if refine is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_28setRefine[] = "DMShell.setRefine(self, refine, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_refine = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setRefine (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_refine,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_refine)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setRefine") < 0)) __PYX_ERR(51, 121, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_refine = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setRefine", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 121, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setRefine", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_28setRefine(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_refine, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_28setRefine(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_refine, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setRefine", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":122 * * def setRefine(self, refine, args=None, kargs=None): * if refine is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_refine != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":123 * def setRefine(self, refine, args=None, kargs=None): * if refine is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (refine, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":124 * if refine is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (refine, args, kargs) * self.set_attr('__refine__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":125 * if args is None: args = () * if kargs is None: kargs = {} * context = (refine, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__refine__', context) * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_refine); __Pyx_GIVEREF(__pyx_v_refine); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_refine); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":126 * if kargs is None: kargs = {} * context = (refine, args, kargs) * self.set_attr('__refine__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__refine__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":127 * context = (refine, args, kargs) * self.set_attr('__refine__', context) * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetRefine(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetRefine(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_Refine)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 127, __pyx_L1_error) /* "PETSc/DMShell.pyx":122 * * def setRefine(self, refine, args=None, kargs=None): * if refine is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":129 * CHKERR( DMShellSetRefine(self.dm, DMSHELL_Refine) ) * else: * CHKERR( DMShellSetRefine(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateInterpolation(self, create_interpolation, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetRefine(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 129, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":121 * CHKERR( DMShellSetCoarsen(self.dm, NULL) ) * * def setRefine(self, refine, args=None, kargs=None): # <<<<<<<<<<<<<< * if refine is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setRefine", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":131 * CHKERR( DMShellSetRefine(self.dm, NULL) ) * * def setCreateInterpolation(self, create_interpolation, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_interpolation is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation[] = "DMShell.setCreateInterpolation(self, create_interpolation, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_create_interpolation = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateInterpolation (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_interpolation,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create_interpolation)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateInterpolation") < 0)) __PYX_ERR(51, 131, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_interpolation = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateInterpolation", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 131, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_interpolation, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_interpolation, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateInterpolation", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":132 * * def setCreateInterpolation(self, create_interpolation, args=None, kargs=None): * if create_interpolation is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_interpolation != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":133 * def setCreateInterpolation(self, create_interpolation, args=None, kargs=None): * if create_interpolation is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_interpolation, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":134 * if create_interpolation is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_interpolation, args, kargs) * self.set_attr('__create_interpolation__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":135 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_interpolation, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_interpolation__', context) * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_create_interpolation); __Pyx_GIVEREF(__pyx_v_create_interpolation); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_create_interpolation); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":136 * if kargs is None: kargs = {} * context = (create_interpolation, args, kargs) * self.set_attr('__create_interpolation__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_interpolation__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":137 * context = (create_interpolation, args, kargs) * self.set_attr('__create_interpolation__', context) * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInterpolation(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInterpolation)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 137, __pyx_L1_error) /* "PETSc/DMShell.pyx":132 * * def setCreateInterpolation(self, create_interpolation, args=None, kargs=None): * if create_interpolation is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":139 * CHKERR( DMShellSetCreateInterpolation(self.dm, DMSHELL_CreateInterpolation) ) * else: * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateInjection(self, create_injection, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInterpolation(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 139, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":131 * CHKERR( DMShellSetRefine(self.dm, NULL) ) * * def setCreateInterpolation(self, create_interpolation, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_interpolation is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInterpolation", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":141 * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) * * def setCreateInjection(self, create_injection, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_injection is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_32setCreateInjection[] = "DMShell.setCreateInjection(self, create_injection, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_create_injection = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateInjection (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_injection,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create_injection)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateInjection") < 0)) __PYX_ERR(51, 141, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_injection = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateInjection", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 141, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_32setCreateInjection(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_injection, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_32setCreateInjection(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_injection, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateInjection", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":142 * * def setCreateInjection(self, create_injection, args=None, kargs=None): * if create_injection is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_injection != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":143 * def setCreateInjection(self, create_injection, args=None, kargs=None): * if create_injection is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_injection, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":144 * if create_injection is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_injection, args, kargs) * self.set_attr('__create_injection__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":145 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_injection, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_injection__', context) * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_create_injection); __Pyx_GIVEREF(__pyx_v_create_injection); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_create_injection); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":146 * if kargs is None: kargs = {} * context = (create_injection, args, kargs) * self.set_attr('__create_injection__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_injection__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":147 * context = (create_injection, args, kargs) * self.set_attr('__create_injection__', context) * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInjection(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateInjection)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 147, __pyx_L1_error) /* "PETSc/DMShell.pyx":142 * * def setCreateInjection(self, create_injection, args=None, kargs=None): * if create_injection is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":149 * CHKERR( DMShellSetCreateInjection(self.dm, DMSHELL_CreateInjection) ) * else: * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateRestriction(self, create_restriction, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateInjection(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 149, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":141 * CHKERR( DMShellSetCreateInterpolation(self.dm, NULL) ) * * def setCreateInjection(self, create_injection, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_injection is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateInjection", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":151 * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) * * def setCreateRestriction(self, create_restriction, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_restriction is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_34setCreateRestriction[] = "DMShell.setCreateRestriction(self, create_restriction, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_create_restriction = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateRestriction (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_restriction,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create_restriction)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateRestriction") < 0)) __PYX_ERR(51, 151, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_restriction = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateRestriction", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 151, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_34setCreateRestriction(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_restriction, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_34setCreateRestriction(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_restriction, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateRestriction", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":152 * * def setCreateRestriction(self, create_restriction, args=None, kargs=None): * if create_restriction is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_restriction != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":153 * def setCreateRestriction(self, create_restriction, args=None, kargs=None): * if create_restriction is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_restriction, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":154 * if create_restriction is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_restriction, args, kargs) * self.set_attr('__create_restriction__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":155 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_restriction, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_restriction__', context) * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_create_restriction); __Pyx_GIVEREF(__pyx_v_create_restriction); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_create_restriction); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":156 * if kargs is None: kargs = {} * context = (create_restriction, args, kargs) * self.set_attr('__create_restriction__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_restriction__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":157 * context = (create_restriction, args, kargs) * self.set_attr('__create_restriction__', context) * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateRestriction(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateRestriction)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 157, __pyx_L1_error) /* "PETSc/DMShell.pyx":152 * * def setCreateRestriction(self, create_restriction, args=None, kargs=None): * if create_restriction is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":159 * CHKERR( DMShellSetCreateRestriction(self.dm, DMSHELL_CreateRestriction) ) * else: * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateFieldDecomposition(self, decomp, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateRestriction(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 159, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":151 * CHKERR( DMShellSetCreateInjection(self.dm, NULL) ) * * def setCreateRestriction(self, create_restriction, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_restriction is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateRestriction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":161 * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) * * def setCreateFieldDecomposition(self, decomp, args=None, kargs=None): # <<<<<<<<<<<<<< * if decomp is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition[] = "DMShell.setCreateFieldDecomposition(self, decomp, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_decomp = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateFieldDecomposition (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_decomp,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_decomp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateFieldDecomposition") < 0)) __PYX_ERR(51, 161, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_decomp = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateFieldDecomposition", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 161, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_decomp, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateFieldDecomposition", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":162 * * def setCreateFieldDecomposition(self, decomp, args=None, kargs=None): * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_decomp != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":163 * def setCreateFieldDecomposition(self, decomp, args=None, kargs=None): * if decomp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (decomp, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":164 * if decomp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (decomp, args, kargs) * self.set_attr('__create_field_decomp__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":165 * if args is None: args = () * if kargs is None: kargs = {} * context = (decomp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_field_decomp__', context) * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_decomp); __Pyx_GIVEREF(__pyx_v_decomp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_decomp); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":166 * if kargs is None: kargs = {} * context = (decomp, args, kargs) * self.set_attr('__create_field_decomp__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_field_decomp__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":167 * context = (decomp, args, kargs) * self.set_attr('__create_field_decomp__', context) * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateFieldDecomposition(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateFieldDecomposition)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 167, __pyx_L1_error) /* "PETSc/DMShell.pyx":162 * * def setCreateFieldDecomposition(self, decomp, args=None, kargs=None): * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":169 * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, DMSHELL_CreateFieldDecomposition) ) * else: * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateDomainDecomposition(self, decomp, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateFieldDecomposition(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 169, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":161 * CHKERR( DMShellSetCreateRestriction(self.dm, NULL) ) * * def setCreateFieldDecomposition(self, decomp, args=None, kargs=None): # <<<<<<<<<<<<<< * if decomp is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateFieldDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":171 * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) * * def setCreateDomainDecomposition(self, decomp, args=None, kargs=None): # <<<<<<<<<<<<<< * if decomp is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition[] = "DMShell.setCreateDomainDecomposition(self, decomp, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_decomp = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateDomainDecomposition (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_decomp,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_decomp)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateDomainDecomposition") < 0)) __PYX_ERR(51, 171, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_decomp = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateDomainDecomposition", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 171, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_decomp, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_decomp, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateDomainDecomposition", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":172 * * def setCreateDomainDecomposition(self, decomp, args=None, kargs=None): * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_decomp != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":173 * def setCreateDomainDecomposition(self, decomp, args=None, kargs=None): * if decomp is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (decomp, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":174 * if decomp is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (decomp, args, kargs) * self.set_attr('__create_domain_decomp__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":175 * if args is None: args = () * if kargs is None: kargs = {} * context = (decomp, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_domain_decomp__', context) * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_decomp); __Pyx_GIVEREF(__pyx_v_decomp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_decomp); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":176 * if kargs is None: kargs = {} * context = (decomp, args, kargs) * self.set_attr('__create_domain_decomp__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_domain_decomp__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":177 * context = (decomp, args, kargs) * self.set_attr('__create_domain_decomp__', context) * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecomposition(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecomposition)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 177, __pyx_L1_error) /* "PETSc/DMShell.pyx":172 * * def setCreateDomainDecomposition(self, decomp, args=None, kargs=None): * if decomp is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":179 * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, DMSHELL_CreateDomainDecomposition) ) * else: * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecomposition(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 179, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":171 * CHKERR( DMShellSetCreateFieldDecomposition(self.dm, NULL) ) * * def setCreateDomainDecomposition(self, decomp, args=None, kargs=None): # <<<<<<<<<<<<<< * if decomp is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecomposition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":181 * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) * * def setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None): # <<<<<<<<<<<<<< * if scatter is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters[] = "DMShell.setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_scatter = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateDomainDecompositionScatters (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scatter,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scatter)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateDomainDecompositionScatters") < 0)) __PYX_ERR(51, 181, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_scatter = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateDomainDecompositionScatters", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 181, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecompositionScatters", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_scatter, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_scatter, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateDomainDecompositionScatters", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":182 * * def setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None): * if scatter is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_scatter != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":183 * def setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None): * if scatter is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (scatter, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":184 * if scatter is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (scatter, args, kargs) * self.set_attr('__create_domain_decomp_scatters__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":185 * if args is None: args = () * if kargs is None: kargs = {} * context = (scatter, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_domain_decomp_scatters__', context) * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_scatter); __Pyx_GIVEREF(__pyx_v_scatter); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_scatter); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":186 * if kargs is None: kargs = {} * context = (scatter, args, kargs) * self.set_attr('__create_domain_decomp_scatters__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_domain_decomp_scatters__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":187 * context = (scatter, args, kargs) * self.set_attr('__create_domain_decomp_scatters__', context) * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecompositionScatters(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateDomainDecompositionScatters)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 187, __pyx_L1_error) /* "PETSc/DMShell.pyx":182 * * def setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None): * if scatter is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":189 * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, DMSHELL_CreateDomainDecompositionScatters) ) * else: * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) # <<<<<<<<<<<<<< * * def setCreateSubDM(self, create_subdm, args=None, kargs=None): */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateDomainDecompositionScatters(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 189, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":181 * CHKERR( DMShellSetCreateDomainDecomposition(self.dm, NULL) ) * * def setCreateDomainDecompositionScatters(self, scatter, args=None, kargs=None): # <<<<<<<<<<<<<< * if scatter is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateDomainDecompositionScatters", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMShell.pyx":191 * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) * * def setCreateSubDM(self, create_subdm, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_subdm is not None: * if args is None: args = () */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_43setCreateSubDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMShell_42setCreateSubDM[] = "DMShell.setCreateSubDM(self, create_subdm, args=None, kargs=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMShell_43setCreateSubDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_create_subdm = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kargs = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCreateSubDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_create_subdm,&__pyx_n_s_args,&__pyx_n_s_kargs,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_create_subdm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kargs); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCreateSubDM") < 0)) __PYX_ERR(51, 191, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_create_subdm = values[0]; __pyx_v_args = values[1]; __pyx_v_kargs = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCreateSubDM", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(51, 191, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMShell_42setCreateSubDM(((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)__pyx_v_self), __pyx_v_create_subdm, __pyx_v_args, __pyx_v_kargs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMShell_42setCreateSubDM(struct __pyx_obj_8petsc4py_5PETSc_DMShell *__pyx_v_self, PyObject *__pyx_v_create_subdm, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) { PyObject *__pyx_v_context = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCreateSubDM", 0); __Pyx_INCREF(__pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); /* "PETSc/DMShell.pyx":192 * * def setCreateSubDM(self, create_subdm, args=None, kargs=None): * if create_subdm is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ __pyx_t_1 = (__pyx_v_create_subdm != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "PETSc/DMShell.pyx":193 * def setCreateSubDM(self, create_subdm, args=None, kargs=None): * if create_subdm is not None: * if args is None: args = () # <<<<<<<<<<<<<< * if kargs is None: kargs = {} * context = (create_subdm, args, kargs) */ __pyx_t_2 = (__pyx_v_args == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { __Pyx_INCREF(__pyx_empty_tuple); __Pyx_DECREF_SET(__pyx_v_args, __pyx_empty_tuple); } /* "PETSc/DMShell.pyx":194 * if create_subdm is not None: * if args is None: args = () * if kargs is None: kargs = {} # <<<<<<<<<<<<<< * context = (create_subdm, args, kargs) * self.set_attr('__create_subdm__', context) */ __pyx_t_1 = (__pyx_v_kargs == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/DMShell.pyx":195 * if args is None: args = () * if kargs is None: kargs = {} * context = (create_subdm, args, kargs) # <<<<<<<<<<<<<< * self.set_attr('__create_subdm__', context) * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) */ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_create_subdm); __Pyx_GIVEREF(__pyx_v_create_subdm); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_create_subdm); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_args); __Pyx_INCREF(__pyx_v_kargs); __Pyx_GIVEREF(__pyx_v_kargs); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_kargs); __pyx_v_context = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":196 * if kargs is None: kargs = {} * context = (create_subdm, args, kargs) * self.set_attr('__create_subdm__', context) # <<<<<<<<<<<<<< * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) * else: */ __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__create_subdm__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMShell.pyx":197 * context = (create_subdm, args, kargs) * self.set_attr('__create_subdm__', context) * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) # <<<<<<<<<<<<<< * else: * CHKERR( DMShellSetCreateSubDM(self.dm, NULL) ) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateSubDM(__pyx_v_self->__pyx_base.dm, __pyx_f_8petsc4py_5PETSc_DMSHELL_CreateSubDM)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 197, __pyx_L1_error) /* "PETSc/DMShell.pyx":192 * * def setCreateSubDM(self, create_subdm, args=None, kargs=None): * if create_subdm is not None: # <<<<<<<<<<<<<< * if args is None: args = () * if kargs is None: kargs = {} */ goto __pyx_L3; } /* "PETSc/DMShell.pyx":199 * CHKERR( DMShellSetCreateSubDM(self.dm, DMSHELL_CreateSubDM) ) * else: * CHKERR( DMShellSetCreateSubDM(self.dm, NULL) ) # <<<<<<<<<<<<<< */ /*else*/ { __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMShellSetCreateSubDM(__pyx_v_self->__pyx_base.dm, NULL)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(51, 199, __pyx_L1_error) } __pyx_L3:; /* "PETSc/DMShell.pyx":191 * CHKERR( DMShellSetCreateDomainDecompositionScatters(self.dm, NULL) ) * * def setCreateSubDM(self, create_subdm, args=None, kargs=None): # <<<<<<<<<<<<<< * if create_subdm is not None: * if args is None: args = () */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMShell.setCreateSubDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_context); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kargs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMLabel.pyx":4 * cdef class DMLabel(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dmlabel * self.dmlabel = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_7DMLabel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_7DMLabel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel___cinit__(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_7DMLabel___cinit__(struct PyPetscDMLabelObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/DMLabel.pyx":5 * * def __cinit__(self): * self.obj = &self.dmlabel # <<<<<<<<<<<<<< * self.dmlabel = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dmlabel)); /* "PETSc/DMLabel.pyx":6 * def __cinit__(self): * self.obj = &self.dmlabel * self.dmlabel = NULL # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_v_self->dmlabel = NULL; /* "PETSc/DMLabel.pyx":4 * cdef class DMLabel(Object): * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.dmlabel * self.dmlabel = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMLabel.pyx":8 * self.dmlabel = NULL * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( DMLabelDestroy(&self.dmlabel) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMLabel_2destroy[] = "DMLabel.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_2destroy(((struct PyPetscDMLabelObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_2destroy(struct PyPetscDMLabelObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/DMLabel.pyx":9 * * def destroy(self): * CHKERR( DMLabelDestroy(&self.dmlabel) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDestroy((&__pyx_v_self->dmlabel))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(52, 9, __pyx_L1_error) /* "PETSc/DMLabel.pyx":10 * def destroy(self): * CHKERR( DMLabelDestroy(&self.dmlabel) ) * return self # <<<<<<<<<<<<<< * * def create(self, name, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMLabel.pyx":8 * self.dmlabel = NULL * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( DMLabelDestroy(&self.dmlabel) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMLabel.pyx":12 * return self * * def create(self, name, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMLabel newdmlabel = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_5create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMLabel_4create[] = "DMLabel.create(self, name, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_5create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(52, 12, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_name = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(52, 12, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_4create(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_name, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_4create(struct PyPetscDMLabelObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DMLabel __pyx_v_newdmlabel; char const *__pyx_v_cname; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); __Pyx_INCREF(__pyx_v_name); /* "PETSc/DMLabel.pyx":13 * * def create(self, name, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) # <<<<<<<<<<<<<< * cdef PetscDMLabel newdmlabel = NULL * cdef const char *cname = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 13, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMLabel.pyx":14 * def create(self, name, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMLabel newdmlabel = NULL # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_v_newdmlabel = NULL; /* "PETSc/DMLabel.pyx":15 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMLabel newdmlabel = NULL * cdef const char *cname = NULL # <<<<<<<<<<<<<< * name = str2bytes(name, &cname) * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) */ __pyx_v_cname = NULL; /* "PETSc/DMLabel.pyx":16 * cdef PetscDMLabel newdmlabel = NULL * cdef const char *cname = NULL * name = str2bytes(name, &cname) # <<<<<<<<<<<<<< * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) * PetscCLEAR(self.obj); self.dmlabel = newdmlabel */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMLabel.pyx":17 * cdef const char *cname = NULL * name = str2bytes(name, &cname) * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dmlabel = newdmlabel * return self */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelCreate(__pyx_v_ccomm, __pyx_v_cname, (&__pyx_v_newdmlabel))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(52, 17, __pyx_L1_error) /* "PETSc/DMLabel.pyx":18 * name = str2bytes(name, &cname) * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) * PetscCLEAR(self.obj); self.dmlabel = newdmlabel # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->dmlabel = __pyx_v_newdmlabel; /* "PETSc/DMLabel.pyx":19 * CHKERR( DMLabelCreate(ccomm, cname, &newdmlabel) ) * PetscCLEAR(self.obj); self.dmlabel = newdmlabel * return self # <<<<<<<<<<<<<< * * def insertIS(self, IS iset, value): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMLabel.pyx":12 * return self * * def create(self, name, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF) * cdef PetscDMLabel newdmlabel = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMLabel.pyx":21 * return self * * def insertIS(self, IS iset, value): # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_7insertIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMLabel_6insertIS[] = "DMLabel.insertIS(self, IS iset, value)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMLabel_7insertIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscISObject *__pyx_v_iset = 0; PyObject *__pyx_v_value = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertIS (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iset,&__pyx_n_s_value,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_iset)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("insertIS", 1, 2, 2, 1); __PYX_ERR(52, 21, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertIS") < 0)) __PYX_ERR(52, 21, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_iset = ((struct PyPetscISObject *)values[0]); __pyx_v_value = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertIS", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(52, 21, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.insertIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(52, 21, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMLabel_6insertIS(((struct PyPetscDMLabelObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_value); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMLabel_6insertIS(struct PyPetscDMLabelObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_value) { PetscInt __pyx_v_cvalue; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertIS", 0); /* "PETSc/DMLabel.pyx":22 * * def insertIS(self, IS iset, value): * cdef PetscInt cvalue = asInt(value) # <<<<<<<<<<<<<< * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(52, 22, __pyx_L1_error) __pyx_v_cvalue = __pyx_t_1; /* "PETSc/DMLabel.pyx":23 * def insertIS(self, IS iset, value): * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelInsertIS(__pyx_v_self->dmlabel, __pyx_v_iset->iset, __pyx_v_cvalue)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(52, 23, __pyx_L1_error) /* "PETSc/DMLabel.pyx":24 * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) * return self # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMLabel.pyx":21 * return self * * def insertIS(self, IS iset, value): # <<<<<<<<<<<<<< * cdef PetscInt cvalue = asInt(value) * CHKERR( DMLabelInsertIS(self.dmlabel, iset.iset, cvalue) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMLabel.insertIS", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":32 * PICLayoutType = DMSwarmPICLayoutType * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_create[] = "DMSwarm.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(53, 32, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 32, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_create(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_create(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; DM __pyx_v_newdm; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/DMSwarm.pyx":33 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 33, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/DMSwarm.pyx":34 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm */ __pyx_v_newdm = NULL; /* "PETSc/DMSwarm.pyx":35 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.dm = newdm * CHKERR( DMSetType(self.dm, DMSWARM) ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreate(__pyx_v_ccomm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 35, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":36 * cdef PetscDM newdm = NULL * CHKERR( DMCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm # <<<<<<<<<<<<<< * CHKERR( DMSetType(self.dm, DMSWARM) ) * return self */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); __pyx_v_self->__pyx_base.dm = __pyx_v_newdm; /* "PETSc/DMSwarm.pyx":37 * CHKERR( DMCreate(ccomm, &newdm) ) * PetscCLEAR(self.obj); self.dm = newdm * CHKERR( DMSetType(self.dm, DMSWARM) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetType(__pyx_v_self->__pyx_base.dm, DMSWARM)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 37, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":38 * PetscCLEAR(self.obj); self.dm = newdm * CHKERR( DMSetType(self.dm, DMSWARM) ) * return self # <<<<<<<<<<<<<< * * def createGlobalVectorFromField(self, fieldname): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMSwarm.pyx":32 * PICLayoutType = DMSwarmPICLayoutType * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscDM newdm = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":40 * return self * * def createGlobalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef Vec vg = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField[] = "DMSwarm.createGlobalVectorFromField(self, fieldname)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createGlobalVectorFromField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createGlobalVectorFromField") < 0)) __PYX_ERR(53, 40, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createGlobalVectorFromField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 40, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; struct PyPetscVecObject *__pyx_v_vg = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createGlobalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":41 * * def createGlobalVectorFromField(self, fieldname): * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef Vec vg = Vec() * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "PETSc/DMSwarm.pyx":42 * def createGlobalVectorFromField(self, fieldname): * cdef const char *cfieldname = NULL * cdef Vec vg = Vec() # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":43 * cdef const char *cfieldname = NULL * cdef Vec vg = Vec() * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) * return vg */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":44 * cdef Vec vg = Vec() * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) # <<<<<<<<<<<<<< * return vg * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateGlobalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 44, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":45 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec) ) * return vg # <<<<<<<<<<<<<< * * def destroyGlobalVectorFromField(self, fieldname): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vg)); __pyx_r = ((PyObject *)__pyx_v_vg); goto __pyx_L0; /* "PETSc/DMSwarm.pyx":40 * return self * * def createGlobalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef Vec vg = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vg); __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":47 * return vg * * def destroyGlobalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscVec vec = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField[] = "DMSwarm.destroyGlobalVectorFromField(self, fieldname)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroyGlobalVectorFromField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "destroyGlobalVectorFromField") < 0)) __PYX_ERR(53, 47, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("destroyGlobalVectorFromField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 47, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; Vec __pyx_v_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroyGlobalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":48 * * def destroyGlobalVectorFromField(self, fieldname): * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscVec vec = NULL * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "PETSc/DMSwarm.pyx":49 * def destroyGlobalVectorFromField(self, fieldname): * cdef const char *cfieldname = NULL * cdef PetscVec vec = NULL # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) */ __pyx_v_vec = NULL; /* "PETSc/DMSwarm.pyx":50 * cdef const char *cfieldname = NULL * cdef PetscVec vec = NULL * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":51 * cdef PetscVec vec = NULL * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) # <<<<<<<<<<<<<< * * def createLocalVectorFromField(self, fieldname): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmDestroyGlobalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 51, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":47 * return vg * * def destroyGlobalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscVec vec = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyGlobalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":53 * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) * * def createLocalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef Vec vl = Vec() */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createLocalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField[] = "DMSwarm.createLocalVectorFromField(self, fieldname)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createLocalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("createLocalVectorFromField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "createLocalVectorFromField") < 0)) __PYX_ERR(53, 53, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("createLocalVectorFromField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 53, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; struct PyPetscVecObject *__pyx_v_vl = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("createLocalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":54 * * def createLocalVectorFromField(self, fieldname): * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef Vec vl = Vec() * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "PETSc/DMSwarm.pyx":55 * def createLocalVectorFromField(self, fieldname): * cdef const char *cfieldname = NULL * cdef Vec vl = Vec() # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":56 * cdef const char *cfieldname = NULL * cdef Vec vl = Vec() * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) * return vl */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":57 * cdef Vec vl = Vec() * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) # <<<<<<<<<<<<<< * return vl * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateLocalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 57, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":58 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec) ) * return vl # <<<<<<<<<<<<<< * * def destroyLocalVectorFromField(self, fieldname): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_vl)); __pyx_r = ((PyObject *)__pyx_v_vl); goto __pyx_L0; /* "PETSc/DMSwarm.pyx":53 * CHKERR( DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec) ) * * def createLocalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef Vec vl = Vec() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_vl); __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":60 * return vl * * def destroyLocalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscVec vec */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyLocalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField[] = "DMSwarm.destroyLocalVectorFromField(self, fieldname)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyLocalVectorFromField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroyLocalVectorFromField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "destroyLocalVectorFromField") < 0)) __PYX_ERR(53, 60, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("destroyLocalVectorFromField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 60, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; Vec __pyx_v_vec; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroyLocalVectorFromField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":61 * * def destroyLocalVectorFromField(self, fieldname): * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscVec vec * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_cfieldname = NULL; /* "PETSc/DMSwarm.pyx":63 * cdef const char *cfieldname = NULL * cdef PetscVec vec * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":64 * cdef PetscVec vec * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) # <<<<<<<<<<<<<< * * def initializeFieldRegister(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmDestroyLocalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vec))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 64, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":60 * return vl * * def destroyLocalVectorFromField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscVec vec */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyLocalVectorFromField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":66 * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) * * def initializeFieldRegister(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11initializeFieldRegister(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister[] = "DMSwarm.initializeFieldRegister(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11initializeFieldRegister(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("initializeFieldRegister (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("initializeFieldRegister", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "initializeFieldRegister", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("initializeFieldRegister", 0); /* "PETSc/DMSwarm.pyx":67 * * def initializeFieldRegister(self): * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) # <<<<<<<<<<<<<< * * def finalizeFieldRegister(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmInitializeFieldRegister(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 67, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":66 * CHKERR( DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec) ) * * def initializeFieldRegister(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.initializeFieldRegister", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":69 * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) * * def finalizeFieldRegister(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13finalizeFieldRegister(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister[] = "DMSwarm.finalizeFieldRegister(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13finalizeFieldRegister(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("finalizeFieldRegister (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("finalizeFieldRegister", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "finalizeFieldRegister", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("finalizeFieldRegister", 0); /* "PETSc/DMSwarm.pyx":70 * * def finalizeFieldRegister(self): * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) # <<<<<<<<<<<<<< * * def setLocalSizes(self, nlocal, buffer): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmFinalizeFieldRegister(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 70, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":69 * CHKERR( DMSwarmInitializeFieldRegister(self.dm) ) * * def finalizeFieldRegister(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.finalizeFieldRegister", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":72 * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) * * def setLocalSizes(self, nlocal, buffer): # <<<<<<<<<<<<<< * cdef PetscInt cnlocal = asInt(nlocal) * cdef PetscInt cbuffer = asInt(buffer) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15setLocalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes[] = "DMSwarm.setLocalSizes(self, nlocal, buffer)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15setLocalSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_nlocal = 0; PyObject *__pyx_v_buffer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setLocalSizes (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nlocal,&__pyx_n_s_buffer,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nlocal)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setLocalSizes", 1, 2, 2, 1); __PYX_ERR(53, 72, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLocalSizes") < 0)) __PYX_ERR(53, 72, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_nlocal = values[0]; __pyx_v_buffer = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setLocalSizes", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 72, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setLocalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_nlocal, __pyx_v_buffer); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_nlocal, PyObject *__pyx_v_buffer) { PetscInt __pyx_v_cnlocal; PetscInt __pyx_v_cbuffer; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setLocalSizes", 0); /* "PETSc/DMSwarm.pyx":73 * * def setLocalSizes(self, nlocal, buffer): * cdef PetscInt cnlocal = asInt(nlocal) # <<<<<<<<<<<<<< * cdef PetscInt cbuffer = asInt(buffer) * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlocal); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 73, __pyx_L1_error) __pyx_v_cnlocal = __pyx_t_1; /* "PETSc/DMSwarm.pyx":74 * def setLocalSizes(self, nlocal, buffer): * cdef PetscInt cnlocal = asInt(nlocal) * cdef PetscInt cbuffer = asInt(buffer) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) * return self */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_buffer); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 74, __pyx_L1_error) __pyx_v_cbuffer = __pyx_t_1; /* "PETSc/DMSwarm.pyx":75 * cdef PetscInt cnlocal = asInt(nlocal) * cdef PetscInt cbuffer = asInt(buffer) * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetLocalSizes(__pyx_v_self->__pyx_base.dm, __pyx_v_cnlocal, __pyx_v_cbuffer)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 75, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":76 * cdef PetscInt cbuffer = asInt(buffer) * CHKERR( DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer) ) * return self # <<<<<<<<<<<<<< * * def registerField(self, fieldname, blocksize, dtype=ScalarType): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMSwarm.pyx":72 * CHKERR( DMSwarmFinalizeFieldRegister(self.dm) ) * * def setLocalSizes(self, nlocal, buffer): # <<<<<<<<<<<<<< * cdef PetscInt cnlocal = asInt(nlocal) * cdef PetscInt cbuffer = asInt(buffer) */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setLocalSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":78 * return self * * def registerField(self, fieldname, blocksize, dtype=ScalarType): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscInt cblocksize = asInt(blocksize) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17registerField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_16registerField[] = "DMSwarm.registerField(self, fieldname, blocksize, dtype=ScalarType)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17registerField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; PyObject *__pyx_v_blocksize = 0; PyObject *__pyx_v_dtype = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("registerField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,&__pyx_n_s_blocksize,&__pyx_n_s_dtype,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__53; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blocksize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("registerField", 0, 2, 3, 1); __PYX_ERR(53, 78, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "registerField") < 0)) __PYX_ERR(53, 78, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fieldname = values[0]; __pyx_v_blocksize = values[1]; __pyx_v_dtype = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("registerField", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 78, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.registerField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_16registerField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname, __pyx_v_blocksize, __pyx_v_dtype); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_16registerField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname, PyObject *__pyx_v_blocksize, PyObject *__pyx_v_dtype) { char const *__pyx_v_cfieldname; PetscInt __pyx_v_cblocksize; PetscDataType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("registerField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":79 * * def registerField(self, fieldname, blocksize, dtype=ScalarType): * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscInt cblocksize = asInt(blocksize) * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN */ __pyx_v_cfieldname = NULL; /* "PETSc/DMSwarm.pyx":80 * def registerField(self, fieldname, blocksize, dtype=ScalarType): * cdef const char *cfieldname = NULL * cdef PetscInt cblocksize = asInt(blocksize) # <<<<<<<<<<<<<< * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * if dtype == IntType: ctype = PETSC_INT */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_blocksize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 80, __pyx_L1_error) __pyx_v_cblocksize = __pyx_t_1; /* "PETSc/DMSwarm.pyx":81 * cdef const char *cfieldname = NULL * cdef PetscInt cblocksize = asInt(blocksize) * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * if dtype == IntType: ctype = PETSC_INT * if dtype == RealType: ctype = PETSC_REAL */ __pyx_v_ctype = PETSC_DATATYPE_UNKNOWN; /* "PETSc/DMSwarm.pyx":82 * cdef PetscInt cblocksize = asInt(blocksize) * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * if dtype == IntType: ctype = PETSC_INT # <<<<<<<<<<<<<< * if dtype == RealType: ctype = PETSC_REAL * if dtype == ScalarType: ctype = PETSC_SCALAR */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntType); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(53, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_INT; } /* "PETSc/DMSwarm.pyx":83 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * if dtype == IntType: ctype = PETSC_INT * if dtype == RealType: ctype = PETSC_REAL # <<<<<<<<<<<<<< * if dtype == ScalarType: ctype = PETSC_SCALAR * if dtype == ComplexType: ctype = PETSC_COMPLEX */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RealType); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(53, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_REAL; } /* "PETSc/DMSwarm.pyx":84 * if dtype == IntType: ctype = PETSC_INT * if dtype == RealType: ctype = PETSC_REAL * if dtype == ScalarType: ctype = PETSC_SCALAR # <<<<<<<<<<<<<< * if dtype == ComplexType: ctype = PETSC_COMPLEX * assert ctype != PETSC_DATATYPE_UNKNOWN */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ScalarType); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(53, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_SCALAR; } /* "PETSc/DMSwarm.pyx":85 * if dtype == RealType: ctype = PETSC_REAL * if dtype == ScalarType: ctype = PETSC_SCALAR * if dtype == ComplexType: ctype = PETSC_COMPLEX # <<<<<<<<<<<<<< * assert ctype != PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ComplexType); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(53, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { __pyx_v_ctype = PETSC_COMPLEX; } /* "PETSc/DMSwarm.pyx":86 * if dtype == ScalarType: ctype = PETSC_SCALAR * if dtype == ComplexType: ctype = PETSC_COMPLEX * assert ctype != PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_ctype != PETSC_DATATYPE_UNKNOWN) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(53, 86, __pyx_L1_error) } } #endif /* "PETSc/DMSwarm.pyx":87 * if dtype == ComplexType: ctype = PETSC_COMPLEX * assert ctype != PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMSwarm.pyx":88 * assert ctype != PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) # <<<<<<<<<<<<<< * * def getField(self, fieldname): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRegisterPetscDatatypeField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, __pyx_v_cblocksize, __pyx_v_ctype)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(53, 88, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":78 * return self * * def registerField(self, fieldname, blocksize, dtype=ScalarType): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscInt cblocksize = asInt(blocksize) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.registerField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":90 * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) * * def getField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19getField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_18getField[] = "DMSwarm.getField(self, fieldname)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19getField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getField") < 0)) __PYX_ERR(53, 90, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 90, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_18getField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_18getField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; PetscInt __pyx_v_blocksize; PetscDataType __pyx_v_ctype; PetscReal *__pyx_v_data; PetscInt __pyx_v_nlocal; int __pyx_v_typenum; npy_intp __pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":91 * * def getField(self, fieldname): * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN */ __pyx_v_cfieldname = NULL; /* "PETSc/DMSwarm.pyx":92 * def getField(self, fieldname): * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 # <<<<<<<<<<<<<< * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * cdef PetscReal *data = NULL */ __pyx_v_blocksize = 0; /* "PETSc/DMSwarm.pyx":93 * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * cdef PetscReal *data = NULL * cdef PetscInt nlocal = 0 */ __pyx_v_ctype = PETSC_DATATYPE_UNKNOWN; /* "PETSc/DMSwarm.pyx":94 * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * cdef PetscReal *data = NULL # <<<<<<<<<<<<<< * cdef PetscInt nlocal = 0 * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_data = NULL; /* "PETSc/DMSwarm.pyx":95 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * cdef PetscReal *data = NULL * cdef PetscInt nlocal = 0 # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) */ __pyx_v_nlocal = 0; /* "PETSc/DMSwarm.pyx":96 * cdef PetscReal *data = NULL * cdef PetscInt nlocal = 0 * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":97 * cdef PetscInt nlocal = 0 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) * cdef int typenum = -1 */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_blocksize), (&__pyx_v_ctype), ((void **)(&__pyx_v_data)))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 97, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":98 * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) # <<<<<<<<<<<<<< * cdef int typenum = -1 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetLocalSize(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nlocal))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 98, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":99 * CHKERR( DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, &data) ) * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) * cdef int typenum = -1 # <<<<<<<<<<<<<< * if ctype == PETSC_INT: typenum = NPY_PETSC_INT * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL */ __pyx_v_typenum = -1; /* "PETSc/DMSwarm.pyx":100 * CHKERR( DMSwarmGetLocalSize(self.dm, &nlocal) ) * cdef int typenum = -1 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT # <<<<<<<<<<<<<< * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR */ __pyx_t_3 = ((__pyx_v_ctype == PETSC_INT) != 0); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_INT; } /* "PETSc/DMSwarm.pyx":101 * cdef int typenum = -1 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL # <<<<<<<<<<<<<< * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX */ __pyx_t_3 = ((__pyx_v_ctype == PETSC_REAL) != 0); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_REAL; } /* "PETSc/DMSwarm.pyx":102 * if ctype == PETSC_INT: typenum = NPY_PETSC_INT * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR # <<<<<<<<<<<<<< * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX * assert typenum != -1 */ __pyx_t_3 = ((__pyx_v_ctype == PETSC_SCALAR) != 0); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_SCALAR; } /* "PETSc/DMSwarm.pyx":103 * if ctype == PETSC_REAL: typenum = NPY_PETSC_REAL * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX # <<<<<<<<<<<<<< * assert typenum != -1 * cdef npy_intp s = nlocal * blocksize */ __pyx_t_3 = ((__pyx_v_ctype == PETSC_COMPLEX) != 0); if (__pyx_t_3) { __pyx_v_typenum = NPY_PETSC_COMPLEX; } /* "PETSc/DMSwarm.pyx":104 * if ctype == PETSC_SCALAR: typenum = NPY_PETSC_SCALAR * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX * assert typenum != -1 # <<<<<<<<<<<<<< * cdef npy_intp s = nlocal * blocksize * return PyArray_SimpleNewFromData(1, &s, typenum, data) */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_typenum != -1L) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(53, 104, __pyx_L1_error) } } #endif /* "PETSc/DMSwarm.pyx":105 * if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX * assert typenum != -1 * cdef npy_intp s = nlocal * blocksize # <<<<<<<<<<<<<< * return PyArray_SimpleNewFromData(1, &s, typenum, data) * */ __pyx_v_s = (((npy_intp)__pyx_v_nlocal) * __pyx_v_blocksize); /* "PETSc/DMSwarm.pyx":106 * assert typenum != -1 * cdef npy_intp s = nlocal * blocksize * return PyArray_SimpleNewFromData(1, &s, typenum, data) # <<<<<<<<<<<<<< * * def restoreField(self, fieldname): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), __pyx_v_typenum, __pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_t_1)); __pyx_r = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":90 * CHKERR( DMSwarmRegisterPetscDatatypeField(self.dm, cfieldname, cblocksize, ctype) ) * * def getField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":108 * return PyArray_SimpleNewFromData(1, &s, typenum, data) * * def restoreField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21restoreField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_20restoreField[] = "DMSwarm.restoreField(self, fieldname)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21restoreField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("restoreField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "restoreField") < 0)) __PYX_ERR(53, 108, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("restoreField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 108, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.restoreField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_20restoreField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_20restoreField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cfieldname; PetscInt __pyx_v_blocksize; PetscDataType __pyx_v_ctype; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("restoreField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":109 * * def restoreField(self, fieldname): * cdef const char *cfieldname = NULL # <<<<<<<<<<<<<< * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN */ __pyx_v_cfieldname = NULL; /* "PETSc/DMSwarm.pyx":110 * def restoreField(self, fieldname): * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 # <<<<<<<<<<<<<< * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) */ __pyx_v_blocksize = 0; /* "PETSc/DMSwarm.pyx":111 * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) */ __pyx_v_ctype = PETSC_DATATYPE_UNKNOWN; /* "PETSc/DMSwarm.pyx":112 * cdef PetscInt blocksize = 0 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) # <<<<<<<<<<<<<< * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":113 * cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN * fieldname = str2bytes(fieldname, &cfieldname) * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) # <<<<<<<<<<<<<< * * def vectorDefineField(self, fieldname): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRestoreField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_blocksize), (&__pyx_v_ctype), ((void **)0))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 113, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":108 * return PyArray_SimpleNewFromData(1, &s, typenum, data) * * def restoreField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscInt blocksize = 0 */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.restoreField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":115 * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) * * def vectorDefineField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * fieldname = str2bytes(fieldname, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23vectorDefineField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField[] = "DMSwarm.vectorDefineField(self, fieldname)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23vectorDefineField(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldname = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("vectorDefineField (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldname,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldname)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vectorDefineField") < 0)) __PYX_ERR(53, 115, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_fieldname = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("vectorDefineField", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 115, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.vectorDefineField", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("vectorDefineField", 0); __Pyx_INCREF(__pyx_v_fieldname); /* "PETSc/DMSwarm.pyx":116 * * def vectorDefineField(self, fieldname): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * fieldname = str2bytes(fieldname, &cval) * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DMSwarm.pyx":117 * def vectorDefineField(self, fieldname): * cdef const char *cval = NULL * fieldname = str2bytes(fieldname, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_fieldname, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":118 * cdef const char *cval = NULL * fieldname = str2bytes(fieldname, &cval) * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) # <<<<<<<<<<<<<< * * def addPoint(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmVectorDefineField(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 118, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":115 * CHKERR( DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, 0) ) * * def vectorDefineField(self, fieldname): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * fieldname = str2bytes(fieldname, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.vectorDefineField", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_fieldname); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":120 * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) * * def addPoint(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmAddPoint(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25addPoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_24addPoint[] = "DMSwarm.addPoint(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25addPoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addPoint (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("addPoint", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "addPoint", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_24addPoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_24addPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addPoint", 0); /* "PETSc/DMSwarm.pyx":121 * * def addPoint(self): * CHKERR( DMSwarmAddPoint(self.dm) ) # <<<<<<<<<<<<<< * * def addNPoints(self, npoints): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmAddPoint(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 121, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":120 * CHKERR( DMSwarmVectorDefineField(self.dm, cval) ) * * def addPoint(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmAddPoint(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":123 * CHKERR( DMSwarmAddPoint(self.dm) ) * * def addNPoints(self, npoints): # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = asInt(npoints) * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27addNPoints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_26addNPoints[] = "DMSwarm.addNPoints(self, npoints)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27addNPoints(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_npoints = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addNPoints (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_npoints,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_npoints)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addNPoints") < 0)) __PYX_ERR(53, 123, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_npoints = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("addNPoints", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 123, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addNPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_26addNPoints(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_npoints); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_26addNPoints(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_npoints) { PetscInt __pyx_v_cnpoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addNPoints", 0); /* "PETSc/DMSwarm.pyx":124 * * def addNPoints(self, npoints): * cdef PetscInt cnpoints = asInt(npoints) # <<<<<<<<<<<<<< * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_npoints); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 124, __pyx_L1_error) __pyx_v_cnpoints = __pyx_t_1; /* "PETSc/DMSwarm.pyx":125 * def addNPoints(self, npoints): * cdef PetscInt cnpoints = asInt(npoints) * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) # <<<<<<<<<<<<<< * * def removePoint(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmAddNPoints(__pyx_v_self->__pyx_base.dm, __pyx_v_cnpoints)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 125, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":123 * CHKERR( DMSwarmAddPoint(self.dm) ) * * def addNPoints(self, npoints): # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = asInt(npoints) * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addNPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":127 * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) * * def removePoint(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmRemovePoint(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29removePoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_28removePoint[] = "DMSwarm.removePoint(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29removePoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("removePoint (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("removePoint", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "removePoint", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_28removePoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_28removePoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("removePoint", 0); /* "PETSc/DMSwarm.pyx":128 * * def removePoint(self): * CHKERR( DMSwarmRemovePoint(self.dm) ) # <<<<<<<<<<<<<< * * def removePointAtIndex(self, index): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRemovePoint(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 128, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":127 * CHKERR( DMSwarmAddNPoints(self.dm, cnpoints) ) * * def removePoint(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmRemovePoint(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.removePoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":130 * CHKERR( DMSwarmRemovePoint(self.dm) ) * * def removePointAtIndex(self, index): # <<<<<<<<<<<<<< * cdef PetscInt cindex = asInt(index) * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31removePointAtIndex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex[] = "DMSwarm.removePointAtIndex(self, index)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31removePointAtIndex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_index = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("removePointAtIndex (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "removePointAtIndex") < 0)) __PYX_ERR(53, 130, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_index = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("removePointAtIndex", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 130, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.removePointAtIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_index); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_index) { PetscInt __pyx_v_cindex; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("removePointAtIndex", 0); /* "PETSc/DMSwarm.pyx":131 * * def removePointAtIndex(self, index): * cdef PetscInt cindex = asInt(index) # <<<<<<<<<<<<<< * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_index); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 131, __pyx_L1_error) __pyx_v_cindex = __pyx_t_1; /* "PETSc/DMSwarm.pyx":132 * def removePointAtIndex(self, index): * cdef PetscInt cindex = asInt(index) * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) # <<<<<<<<<<<<<< * * def copyPoint(self, pi, pj): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmRemovePointAtIndex(__pyx_v_self->__pyx_base.dm, __pyx_v_cindex)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 132, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":130 * CHKERR( DMSwarmRemovePoint(self.dm) ) * * def removePointAtIndex(self, index): # <<<<<<<<<<<<<< * cdef PetscInt cindex = asInt(index) * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.removePointAtIndex", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":134 * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) * * def copyPoint(self, pi, pj): # <<<<<<<<<<<<<< * cdef PetscInt cpi = asInt(pi) * cdef PetscInt cpj = asInt(pj) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33copyPoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_32copyPoint[] = "DMSwarm.copyPoint(self, pi, pj)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33copyPoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_pi = 0; PyObject *__pyx_v_pj = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copyPoint (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pi,&__pyx_n_s_pj,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pi)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pj)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copyPoint", 1, 2, 2, 1); __PYX_ERR(53, 134, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copyPoint") < 0)) __PYX_ERR(53, 134, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_pi = values[0]; __pyx_v_pj = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copyPoint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 134, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.copyPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_32copyPoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_pi, __pyx_v_pj); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_32copyPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_pi, PyObject *__pyx_v_pj) { PetscInt __pyx_v_cpi; PetscInt __pyx_v_cpj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copyPoint", 0); /* "PETSc/DMSwarm.pyx":135 * * def copyPoint(self, pi, pj): * cdef PetscInt cpi = asInt(pi) # <<<<<<<<<<<<<< * cdef PetscInt cpj = asInt(pj) * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pi); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 135, __pyx_L1_error) __pyx_v_cpi = __pyx_t_1; /* "PETSc/DMSwarm.pyx":136 * def copyPoint(self, pi, pj): * cdef PetscInt cpi = asInt(pi) * cdef PetscInt cpj = asInt(pj) # <<<<<<<<<<<<<< * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_pj); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 136, __pyx_L1_error) __pyx_v_cpj = __pyx_t_1; /* "PETSc/DMSwarm.pyx":137 * cdef PetscInt cpi = asInt(pi) * cdef PetscInt cpj = asInt(pj) * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) # <<<<<<<<<<<<<< * * def getLocalSize(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCopyPoint(__pyx_v_self->__pyx_base.dm, __pyx_v_cpi, __pyx_v_cpj)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 137, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":134 * CHKERR( DMSwarmRemovePointAtIndex(self.dm, cindex) ) * * def copyPoint(self, pi, pj): # <<<<<<<<<<<<<< * cdef PetscInt cpi = asInt(pi) * cdef PetscInt cpj = asInt(pj) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.copyPoint", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":139 * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_34getLocalSize[] = "DMSwarm.getLocalSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35getLocalSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getLocalSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getLocalSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getLocalSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_34getLocalSize(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_34getLocalSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getLocalSize", 0); /* "PETSc/DMSwarm.pyx":140 * * def getLocalSize(self): * cdef PetscInt size = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) * return toInt(size) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 140, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "PETSc/DMSwarm.pyx":141 * def getLocalSize(self): * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetLocalSize(__pyx_v_self->__pyx_base.dm, (&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 141, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":142 * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def getSize(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":139 * CHKERR( DMSwarmCopyPoint(self.dm, cpi, cpj) ) * * def getLocalSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetLocalSize(self.dm, &size) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getLocalSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":144 * return toInt(size) * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetSize(self.dm, &size) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_36getSize[] = "DMSwarm.getSize(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37getSize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getSize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getSize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_36getSize(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_36getSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscInt __pyx_v_size; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSize", 0); /* "PETSc/DMSwarm.pyx":145 * * def getSize(self): * cdef PetscInt size = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetSize(self.dm, &size) ) * return toInt(size) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 145, __pyx_L1_error) __pyx_v_size = __pyx_t_1; /* "PETSc/DMSwarm.pyx":146 * def getSize(self): * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetSize(self.dm, &size) ) # <<<<<<<<<<<<<< * return toInt(size) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetSize(__pyx_v_self->__pyx_base.dm, (&__pyx_v_size))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 146, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":147 * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetSize(self.dm, &size) ) * return toInt(size) # <<<<<<<<<<<<<< * * def migrate(self, remove_sent_points=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":144 * return toInt(size) * * def getSize(self): # <<<<<<<<<<<<<< * cdef PetscInt size = asInt(0) * CHKERR( DMSwarmGetSize(self.dm, &size) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getSize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":149 * return toInt(size) * * def migrate(self, remove_sent_points=False): # <<<<<<<<<<<<<< * cdef PetscBool remove_pts = asBool(remove_sent_points) * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39migrate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_38migrate[] = "DMSwarm.migrate(self, remove_sent_points=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39migrate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_remove_sent_points = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("migrate (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_remove_sent_points,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_remove_sent_points); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "migrate") < 0)) __PYX_ERR(53, 149, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_remove_sent_points = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("migrate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 149, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.migrate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_38migrate(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_remove_sent_points); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_38migrate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_remove_sent_points) { PetscBool __pyx_v_remove_pts; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("migrate", 0); /* "PETSc/DMSwarm.pyx":150 * * def migrate(self, remove_sent_points=False): * cdef PetscBool remove_pts = asBool(remove_sent_points) # <<<<<<<<<<<<<< * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_remove_sent_points); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(53, 150, __pyx_L1_error) __pyx_v_remove_pts = __pyx_t_1; /* "PETSc/DMSwarm.pyx":151 * def migrate(self, remove_sent_points=False): * cdef PetscBool remove_pts = asBool(remove_sent_points) * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) # <<<<<<<<<<<<<< * * def collectViewCreate(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmMigrate(__pyx_v_self->__pyx_base.dm, __pyx_v_remove_pts)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 151, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":149 * return toInt(size) * * def migrate(self, remove_sent_points=False): # <<<<<<<<<<<<<< * cdef PetscBool remove_pts = asBool(remove_sent_points) * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.migrate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":153 * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) * * def collectViewCreate(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmCollectViewCreate(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41collectViewCreate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate[] = "DMSwarm.collectViewCreate(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41collectViewCreate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collectViewCreate (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("collectViewCreate", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "collectViewCreate", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collectViewCreate", 0); /* "PETSc/DMSwarm.pyx":154 * * def collectViewCreate(self): * CHKERR( DMSwarmCollectViewCreate(self.dm) ) # <<<<<<<<<<<<<< * * def collectViewDestroy(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCollectViewCreate(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 154, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":153 * CHKERR( DMSwarmMigrate(self.dm, remove_pts) ) * * def collectViewCreate(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmCollectViewCreate(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.collectViewCreate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":156 * CHKERR( DMSwarmCollectViewCreate(self.dm) ) * * def collectViewDestroy(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43collectViewDestroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy[] = "DMSwarm.collectViewDestroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43collectViewDestroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("collectViewDestroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("collectViewDestroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "collectViewDestroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collectViewDestroy", 0); /* "PETSc/DMSwarm.pyx":157 * * def collectViewDestroy(self): * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) # <<<<<<<<<<<<<< * * def setCellDM(self, DM dm): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCollectViewDestroy(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 157, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":156 * CHKERR( DMSwarmCollectViewCreate(self.dm) ) * * def collectViewDestroy(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.collectViewDestroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":159 * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) * * def setCellDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45setCellDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_44setCellDM[] = "DMSwarm.setCellDM(self, DM dm)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45setCellDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscDMObject *__pyx_v_dm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setCellDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dm,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setCellDM") < 0)) __PYX_ERR(53, 159, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dm = ((struct PyPetscDMObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setCellDM", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 159, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(53, 159, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_44setCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_dm); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_44setCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setCellDM", 0); /* "PETSc/DMSwarm.pyx":160 * * def setCellDM(self, DM dm): * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) # <<<<<<<<<<<<<< * * def getCellDM(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetCellDM(__pyx_v_self->__pyx_base.dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 160, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":159 * CHKERR( DMSwarmCollectViewDestroy(self.dm) ) * * def setCellDM(self, DM dm): # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":162 * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) * * def getCellDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47getCellDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_46getCellDM[] = "DMSwarm.getCellDM(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47getCellDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getCellDM (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getCellDM", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getCellDM", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_46getCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_46getCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { DM __pyx_v_newdm; struct PyPetscDMObject *__pyx_v_dm = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCellDM", 0); /* "PETSc/DMSwarm.pyx":163 * * def getCellDM(self): * cdef PetscDM newdm = NULL # <<<<<<<<<<<<<< * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() */ __pyx_v_newdm = NULL; /* "PETSc/DMSwarm.pyx":164 * def getCellDM(self): * cdef PetscDM newdm = NULL * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) # <<<<<<<<<<<<<< * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetCellDM(__pyx_v_self->__pyx_base.dm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 164, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":165 * cdef PetscDM newdm = NULL * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() # <<<<<<<<<<<<<< * dm.dm = newdm * PetscINCREF(dm.obj) */ __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(53, 165, __pyx_L1_error) __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":166 * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm # <<<<<<<<<<<<<< * PetscINCREF(dm.obj) * return dm */ __pyx_v_dm->dm = __pyx_v_newdm; /* "PETSc/DMSwarm.pyx":167 * cdef DM dm = subtype_DM(newdm)() * dm.dm = newdm * PetscINCREF(dm.obj) # <<<<<<<<<<<<<< * return dm * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); /* "PETSc/DMSwarm.pyx":168 * dm.dm = newdm * PetscINCREF(dm.obj) * return dm # <<<<<<<<<<<<<< * * def setType(self, dmswarm_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_dm)); __pyx_r = ((PyObject *)__pyx_v_dm); goto __pyx_L0; /* "PETSc/DMSwarm.pyx":162 * CHKERR( DMSwarmSetCellDM(self.dm, dm.dm) ) * * def getCellDM(self): # <<<<<<<<<<<<<< * cdef PetscDM newdm = NULL * CHKERR( DMSwarmGetCellDM(self.dm, &newdm) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_dm); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":170 * return dm * * def setType(self, dmswarm_type): # <<<<<<<<<<<<<< * cdef PetscDMSwarmType cval = dmswarm_type * CHKERR( DMSwarmSetType(self.dm, cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_48setType[] = "DMSwarm.setType(self, dmswarm_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dmswarm_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmswarm_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dmswarm_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(53, 170, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_dmswarm_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 170, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_48setType(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_dmswarm_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_48setType(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_dmswarm_type) { DMSwarmType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMSwarmType __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); /* "PETSc/DMSwarm.pyx":171 * * def setType(self, dmswarm_type): * cdef PetscDMSwarmType cval = dmswarm_type # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetType(self.dm, cval) ) * */ __pyx_t_1 = ((DMSwarmType)__Pyx_PyInt_As_DMSwarmType(__pyx_v_dmswarm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 171, __pyx_L1_error) __pyx_v_cval = __pyx_t_1; /* "PETSc/DMSwarm.pyx":172 * def setType(self, dmswarm_type): * cdef PetscDMSwarmType cval = dmswarm_type * CHKERR( DMSwarmSetType(self.dm, cval) ) # <<<<<<<<<<<<<< * * def setPointsUniformCoordinates(self, min, max, npoints, mode=None): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetType(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 172, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":170 * return dm * * def setType(self, dmswarm_type): # <<<<<<<<<<<<<< * cdef PetscDMSwarmType cval = dmswarm_type * CHKERR( DMSwarmSetType(self.dm, cval) ) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":174 * CHKERR( DMSwarmSetType(self.dm, cval) ) * * def setPointsUniformCoordinates(self, min, max, npoints, mode=None): # <<<<<<<<<<<<<< * cdef PetscInt dim = asInt(0) * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51setPointsUniformCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates[] = "DMSwarm.setPointsUniformCoordinates(self, min, max, npoints, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51setPointsUniformCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_min = 0; PyObject *__pyx_v_max = 0; PyObject *__pyx_v_npoints = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointsUniformCoordinates (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_min,&__pyx_n_s_max,&__pyx_n_s_npoints,&__pyx_n_s_mode,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPointsUniformCoordinates", 0, 3, 4, 1); __PYX_ERR(53, 174, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_npoints)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("setPointsUniformCoordinates", 0, 3, 4, 2); __PYX_ERR(53, 174, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPointsUniformCoordinates") < 0)) __PYX_ERR(53, 174, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_min = values[0]; __pyx_v_max = values[1]; __pyx_v_npoints = values[2]; __pyx_v_mode = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointsUniformCoordinates", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 174, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointsUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_min, __pyx_v_max, __pyx_v_npoints, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_min, PyObject *__pyx_v_max, PyObject *__pyx_v_npoints, PyObject *__pyx_v_mode) { PetscInt __pyx_v_dim; PetscReal __pyx_v_cmin[3]; long __pyx_v_i; PetscReal __pyx_v_cmax[3]; PetscInt __pyx_v_cnpoints[3]; InsertMode __pyx_v_cmode; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PetscReal __pyx_t_3; PyObject *__pyx_t_4 = NULL; PetscInt __pyx_t_5; InsertMode __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointsUniformCoordinates", 0); /* "PETSc/DMSwarm.pyx":175 * * def setPointsUniformCoordinates(self, min, max, npoints, mode=None): * cdef PetscInt dim = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMGetDimension(self.dm, &dim) ) * cdef PetscReal cmin[3] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 175, __pyx_L1_error) __pyx_v_dim = __pyx_t_1; /* "PETSc/DMSwarm.pyx":176 * def setPointsUniformCoordinates(self, min, max, npoints, mode=None): * cdef PetscInt dim = asInt(0) * CHKERR( DMGetDimension(self.dm, &dim) ) # <<<<<<<<<<<<<< * cdef PetscReal cmin[3] * cmin[0] = cmin[1] = cmin[2] = asReal(0.) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDimension(__pyx_v_self->__pyx_base.dm, (&__pyx_v_dim))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 176, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":178 * CHKERR( DMGetDimension(self.dm, &dim) ) * cdef PetscReal cmin[3] * cmin[0] = cmin[1] = cmin[2] = asReal(0.) # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cmin[i] = min[i] * cdef PetscReal cmax[3] */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_float_0_); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(53, 178, __pyx_L1_error) (__pyx_v_cmin[0]) = __pyx_t_3; (__pyx_v_cmin[1]) = __pyx_t_3; (__pyx_v_cmin[2]) = __pyx_t_3; /* "PETSc/DMSwarm.pyx":179 * cdef PetscReal cmin[3] * cmin[0] = cmin[1] = cmin[2] = asReal(0.) * for i from 0 <= i < dim: cmin[i] = min[i] # <<<<<<<<<<<<<< * cdef PetscReal cmax[3] * cmax[0] = cmax[1] = cmax[2] = asReal(0.) */ __pyx_t_1 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_min, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_3 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(53, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_cmin[__pyx_v_i]) = __pyx_t_3; } /* "PETSc/DMSwarm.pyx":181 * for i from 0 <= i < dim: cmin[i] = min[i] * cdef PetscReal cmax[3] * cmax[0] = cmax[1] = cmax[2] = asReal(0.) # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cmax[i] = max[i] * cdef PetscInt cnpoints[3] */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_float_0_); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(53, 181, __pyx_L1_error) (__pyx_v_cmax[0]) = __pyx_t_3; (__pyx_v_cmax[1]) = __pyx_t_3; (__pyx_v_cmax[2]) = __pyx_t_3; /* "PETSc/DMSwarm.pyx":182 * cdef PetscReal cmax[3] * cmax[0] = cmax[1] = cmax[2] = asReal(0.) * for i from 0 <= i < dim: cmax[i] = max[i] # <<<<<<<<<<<<<< * cdef PetscInt cnpoints[3] * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) */ __pyx_t_1 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_max, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_3 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(53, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_cmax[__pyx_v_i]) = __pyx_t_3; } /* "PETSc/DMSwarm.pyx":184 * for i from 0 <= i < dim: cmax[i] = max[i] * cdef PetscInt cnpoints[3] * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) # <<<<<<<<<<<<<< * for i from 0 <= i < dim: cnpoints[i] = npoints[i] * cdef PetscInsertMode cmode = insertmode(mode) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 184, __pyx_L1_error) (__pyx_v_cnpoints[0]) = __pyx_t_1; (__pyx_v_cnpoints[1]) = __pyx_t_1; (__pyx_v_cnpoints[2]) = __pyx_t_1; /* "PETSc/DMSwarm.pyx":185 * cdef PetscInt cnpoints[3] * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) * for i from 0 <= i < dim: cnpoints[i] = npoints[i] # <<<<<<<<<<<<<< * cdef PetscInsertMode cmode = insertmode(mode) * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) */ __pyx_t_1 = __pyx_v_dim; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_npoints, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyInt_As_PetscInt(__pyx_t_4); if (unlikely((__pyx_t_5 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(53, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; (__pyx_v_cnpoints[__pyx_v_i]) = __pyx_t_5; } /* "PETSc/DMSwarm.pyx":186 * cnpoints[0] = cnpoints[1] = cnpoints[2] = asInt(0) * for i from 0 <= i < dim: cnpoints[i] = npoints[i] * cdef PetscInsertMode cmode = insertmode(mode) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) * return self */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_mode); if (unlikely(__pyx_t_6 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(53, 186, __pyx_L1_error) __pyx_v_cmode = __pyx_t_6; /* "PETSc/DMSwarm.pyx":187 * for i from 0 <= i < dim: cnpoints[i] = npoints[i] * cdef PetscInsertMode cmode = insertmode(mode) * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetPointsUniformCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v_cmin, __pyx_v_cmax, __pyx_v_cnpoints, __pyx_v_cmode)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 187, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":188 * cdef PetscInsertMode cmode = insertmode(mode) * CHKERR( DMSwarmSetPointsUniformCoordinates(self.dm, cmin, cmax, cnpoints, cmode) ) * return self # <<<<<<<<<<<<<< * * def setPointCoordinates(self, coordinates, redundant=False, mode=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/DMSwarm.pyx":174 * CHKERR( DMSwarmSetType(self.dm, cval) ) * * def setPointsUniformCoordinates(self, min, max, npoints, mode=None): # <<<<<<<<<<<<<< * cdef PetscInt dim = asInt(0) * CHKERR( DMGetDimension(self.dm, &dim) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointsUniformCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":190 * return self * * def setPointCoordinates(self, coordinates, redundant=False, mode=None): # <<<<<<<<<<<<<< * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setPointCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates[] = "DMSwarm.setPointCoordinates(self, coordinates, redundant=False, mode=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setPointCoordinates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_coordinates = 0; PyObject *__pyx_v_redundant = 0; PyObject *__pyx_v_mode = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointCoordinates (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,&__pyx_n_s_redundant,&__pyx_n_s_mode,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_False); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coordinates)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_redundant); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPointCoordinates") < 0)) __PYX_ERR(53, 190, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_coordinates = values[0]; __pyx_v_redundant = values[1]; __pyx_v_mode = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointCoordinates", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 190, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_coordinates, __pyx_v_redundant, __pyx_v_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates, PyObject *__pyx_v_redundant, PyObject *__pyx_v_mode) { PyArrayObject *__pyx_v_xyz = 0; PetscInt __pyx_v_cnpoints; PetscBool __pyx_v_credundant; InsertMode __pyx_v_cmode; PetscReal *__pyx_v_coords; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscBool __pyx_t_4; InsertMode __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointCoordinates", 0); /* "PETSc/DMSwarm.pyx":191 * * def setPointCoordinates(self, coordinates, redundant=False, mode=None): * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":192 * def setPointCoordinates(self, coordinates, redundant=False, mode=None): * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) # <<<<<<<<<<<<<< * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " */ __pyx_t_2 = (PyArray_ISFORTRAN(__pyx_v_xyz) != 0); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; } /* "PETSc/DMSwarm.pyx":193 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_2 = ((PyArray_NDIM(__pyx_v_xyz) != 2) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/DMSwarm.pyx":195 * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscBool credundant = asBool(redundant) */ __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":193 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(53, 193, __pyx_L1_error) } /* "PETSc/DMSwarm.pyx":196 * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) # <<<<<<<<<<<<<< * cdef PetscBool credundant = asBool(redundant) * cdef PetscInsertMode cmode = insertmode(mode) */ __pyx_v_cnpoints = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0)); /* "PETSc/DMSwarm.pyx":197 * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscBool credundant = asBool(redundant) # <<<<<<<<<<<<<< * cdef PetscInsertMode cmode = insertmode(mode) * cdef PetscReal *coords = PyArray_DATA(xyz) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_redundant); if (unlikely(__pyx_t_4 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(53, 197, __pyx_L1_error) __pyx_v_credundant = __pyx_t_4; /* "PETSc/DMSwarm.pyx":198 * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscBool credundant = asBool(redundant) * cdef PetscInsertMode cmode = insertmode(mode) # <<<<<<<<<<<<<< * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_mode); if (unlikely(__pyx_t_5 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(53, 198, __pyx_L1_error) __pyx_v_cmode = __pyx_t_5; /* "PETSc/DMSwarm.pyx":199 * cdef PetscBool credundant = asBool(redundant) * cdef PetscInsertMode cmode = insertmode(mode) * cdef PetscReal *coords = PyArray_DATA(xyz) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) * */ __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz)); /* "PETSc/DMSwarm.pyx":200 * cdef PetscInsertMode cmode = insertmode(mode) * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) # <<<<<<<<<<<<<< * * def insertPointUsingCellDM(self, layoutType, fill_param): */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetPointCoordinates(__pyx_v_self->__pyx_base.dm, __pyx_v_cnpoints, __pyx_v_coords, __pyx_v_credundant, __pyx_v_cmode)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(53, 200, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":190 * return self * * def setPointCoordinates(self, coordinates, redundant=False, mode=None): # <<<<<<<<<<<<<< * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xyz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":202 * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) * * def insertPointUsingCellDM(self, layoutType, fill_param): # <<<<<<<<<<<<<< * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType * cdef PetscInt cfill_param = asInt(fill_param) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55insertPointUsingCellDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM[] = "DMSwarm.insertPointUsingCellDM(self, layoutType, fill_param)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55insertPointUsingCellDM(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_layoutType = 0; PyObject *__pyx_v_fill_param = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("insertPointUsingCellDM (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_layoutType,&__pyx_n_s_fill_param,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_layoutType)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fill_param)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("insertPointUsingCellDM", 1, 2, 2, 1); __PYX_ERR(53, 202, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insertPointUsingCellDM") < 0)) __PYX_ERR(53, 202, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_layoutType = values[0]; __pyx_v_fill_param = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("insertPointUsingCellDM", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 202, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.insertPointUsingCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_layoutType, __pyx_v_fill_param); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_layoutType, PyObject *__pyx_v_fill_param) { DMSwarmPICLayoutType __pyx_v_clayoutType; PetscInt __pyx_v_cfill_param; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations DMSwarmPICLayoutType __pyx_t_1; PetscInt __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("insertPointUsingCellDM", 0); /* "PETSc/DMSwarm.pyx":203 * * def insertPointUsingCellDM(self, layoutType, fill_param): * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType # <<<<<<<<<<<<<< * cdef PetscInt cfill_param = asInt(fill_param) * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) */ __pyx_t_1 = ((DMSwarmPICLayoutType)__Pyx_PyInt_As_DMSwarmPICLayoutType(__pyx_v_layoutType)); if (unlikely(PyErr_Occurred())) __PYX_ERR(53, 203, __pyx_L1_error) __pyx_v_clayoutType = __pyx_t_1; /* "PETSc/DMSwarm.pyx":204 * def insertPointUsingCellDM(self, layoutType, fill_param): * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType * cdef PetscInt cfill_param = asInt(fill_param) # <<<<<<<<<<<<<< * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_fill_param); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 204, __pyx_L1_error) __pyx_v_cfill_param = __pyx_t_2; /* "PETSc/DMSwarm.pyx":205 * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType * cdef PetscInt cfill_param = asInt(fill_param) * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) # <<<<<<<<<<<<<< * * def setPointCoordinatesCellwise(self, coordinates): */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmInsertPointsUsingCellDM(__pyx_v_self->__pyx_base.dm, __pyx_v_clayoutType, __pyx_v_cfill_param)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(53, 205, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":202 * CHKERR( DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode) ) * * def insertPointUsingCellDM(self, layoutType, fill_param): # <<<<<<<<<<<<<< * cdef PetscDMSwarmPICLayoutType clayoutType = layoutType * cdef PetscInt cfill_param = asInt(fill_param) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.insertPointUsingCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":207 * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) * * def setPointCoordinatesCellwise(self, coordinates): # <<<<<<<<<<<<<< * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setPointCoordinatesCellwise(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise[] = "DMSwarm.setPointCoordinatesCellwise(self, coordinates)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setPointCoordinatesCellwise(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_coordinates = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setPointCoordinatesCellwise (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_coordinates,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coordinates)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setPointCoordinatesCellwise") < 0)) __PYX_ERR(53, 207, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_coordinates = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setPointCoordinatesCellwise", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 207, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinatesCellwise", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_coordinates); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates) { PyArrayObject *__pyx_v_xyz = 0; PetscInt __pyx_v_cnpoints; PetscReal *__pyx_v_coords; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setPointCoordinatesCellwise", 0); /* "PETSc/DMSwarm.pyx":208 * * def setPointCoordinatesCellwise(self, coordinates): * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) # <<<<<<<<<<<<<< * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coordinates, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":209 * def setPointCoordinatesCellwise(self, coordinates): * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) # <<<<<<<<<<<<<< * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " */ __pyx_t_2 = (PyArray_ISFORTRAN(__pyx_v_xyz) != 0); if (__pyx_t_2) { __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_xyz, ((PyArrayObject *)__pyx_t_1)); __pyx_t_1 = 0; } /* "PETSc/DMSwarm.pyx":210 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_2 = ((PyArray_NDIM(__pyx_v_xyz) != 2) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/DMSwarm.pyx":212 * if PyArray_NDIM(xyz) != 2: raise ValueError( * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscReal *coords = PyArray_DATA(xyz) */ __pyx_t_1 = __Pyx_PyInt_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":210 * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) * if PyArray_NDIM(xyz) != 2: raise ValueError( # <<<<<<<<<<<<<< * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) */ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(53, 210, __pyx_L1_error) } /* "PETSc/DMSwarm.pyx":213 * ("coordinates must have two dimensions: " * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) # <<<<<<<<<<<<<< * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) */ __pyx_v_cnpoints = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0)); /* "PETSc/DMSwarm.pyx":214 * "coordinates.ndim=%d") % (PyArray_NDIM(xyz)) ) * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscReal *coords = PyArray_DATA(xyz) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) * */ __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz)); /* "PETSc/DMSwarm.pyx":215 * cdef PetscInt cnpoints = PyArray_DIM(xyz, 0) * cdef PetscReal *coords = PyArray_DATA(xyz) * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) # <<<<<<<<<<<<<< * * def viewFieldsXDMF(self, filename, fieldnames): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetPointCoordinatesCellwise(__pyx_v_self->__pyx_base.dm, __pyx_v_cnpoints, __pyx_v_coords)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(53, 215, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":207 * CHKERR( DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param) ) * * def setPointCoordinatesCellwise(self, coordinates): # <<<<<<<<<<<<<< * cdef ndarray xyz = iarray(coordinates, NPY_PETSC_REAL) * if PyArray_ISFORTRAN(xyz): xyz = PyArray_Copy(xyz) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setPointCoordinatesCellwise", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_xyz); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":217 * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) * * def viewFieldsXDMF(self, filename, fieldnames): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef const char *cfilename = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59viewFieldsXDMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF[] = "DMSwarm.viewFieldsXDMF(self, filename, fieldnames)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59viewFieldsXDMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; PyObject *__pyx_v_fieldnames = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewFieldsXDMF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_fieldnames,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldnames)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("viewFieldsXDMF", 1, 2, 2, 1); __PYX_ERR(53, 217, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "viewFieldsXDMF") < 0)) __PYX_ERR(53, 217, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_filename = values[0]; __pyx_v_fieldnames = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewFieldsXDMF", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 217, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewFieldsXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_filename, __pyx_v_fieldnames); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_fieldnames) { char const *__pyx_v_cval; char const *__pyx_v_cfilename; PetscInt __pyx_v_cnfields; char const **__pyx_v_cfieldnames; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewFieldsXDMF", 0); __Pyx_INCREF(__pyx_v_filename); __Pyx_INCREF(__pyx_v_fieldnames); /* "PETSc/DMSwarm.pyx":218 * * def viewFieldsXDMF(self, filename, fieldnames): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef const char *cfilename = NULL * filename = str2bytes(filename, &cfilename) */ __pyx_v_cval = NULL; /* "PETSc/DMSwarm.pyx":219 * def viewFieldsXDMF(self, filename, fieldnames): * cdef const char *cval = NULL * cdef const char *cfilename = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cfilename) * cdef PetscInt cnfields = len(fieldnames) */ __pyx_v_cfilename = NULL; /* "PETSc/DMSwarm.pyx":220 * cdef const char *cval = NULL * cdef const char *cfilename = NULL * filename = str2bytes(filename, &cfilename) # <<<<<<<<<<<<<< * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cfilename)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":221 * cdef const char *cfilename = NULL * filename = str2bytes(filename, &cfilename) * cdef PetscInt cnfields = len(fieldnames) # <<<<<<<<<<<<<< * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) */ __pyx_t_2 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(53, 221, __pyx_L1_error) __pyx_v_cnfields = ((PetscInt)__pyx_t_2); /* "PETSc/DMSwarm.pyx":222 * filename = str2bytes(filename, &cfilename) * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * fieldnames = list(fieldnames) */ __pyx_v_cfieldnames = NULL; /* "PETSc/DMSwarm.pyx":223 * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) # <<<<<<<<<<<<<< * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_cnfields)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_cfieldnames)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tmp = __pyx_t_3; __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":224 * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * fieldnames = list(fieldnames) # <<<<<<<<<<<<<< * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) */ __pyx_t_3 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_fieldnames, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":225 * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: # <<<<<<<<<<<<<< * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval */ __pyx_t_4 = __pyx_v_cnfields; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { /* "PETSc/DMSwarm.pyx":226 * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) # <<<<<<<<<<<<<< * cfieldnames[i] = cval * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_fieldnames, __pyx_v_i, __pyx_t_1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(53, 226, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":227 * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval # <<<<<<<<<<<<<< * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) * */ (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval; } /* "PETSc/DMSwarm.pyx":228 * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) # <<<<<<<<<<<<<< * * def viewXDMF(self, filename): */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmViewFieldsXDMF(__pyx_v_self->__pyx_base.dm, __pyx_v_cfilename, __pyx_v_cnfields, __pyx_v_cfieldnames)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(53, 228, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":217 * CHKERR( DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords) ) * * def viewFieldsXDMF(self, filename, fieldnames): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef const char *cfilename = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewFieldsXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_filename); __Pyx_XDECREF(__pyx_v_fieldnames); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":230 * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) * * def viewXDMF(self, filename): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * filename = str2bytes(filename, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61viewXDMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_60viewXDMF[] = "DMSwarm.viewXDMF(self, filename)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61viewXDMF(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_filename = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("viewXDMF (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "viewXDMF") < 0)) __PYX_ERR(53, 230, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_filename = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("viewXDMF", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 230, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_60viewXDMF(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_filename); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_60viewXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename) { char const *__pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viewXDMF", 0); __Pyx_INCREF(__pyx_v_filename); /* "PETSc/DMSwarm.pyx":231 * * def viewXDMF(self, filename): * cdef const char *cval = NULL # <<<<<<<<<<<<<< * filename = str2bytes(filename, &cval) * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/DMSwarm.pyx":232 * def viewXDMF(self, filename): * cdef const char *cval = NULL * filename = str2bytes(filename, &cval) # <<<<<<<<<<<<<< * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_filename, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/DMSwarm.pyx":233 * cdef const char *cval = NULL * filename = str2bytes(filename, &cval) * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) # <<<<<<<<<<<<<< * * def sortGetAccess(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmViewXDMF(__pyx_v_self->__pyx_base.dm, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 233, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":230 * CHKERR( DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames ) ) * * def viewXDMF(self, filename): # <<<<<<<<<<<<<< * cdef const char *cval = NULL * filename = str2bytes(filename, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.viewXDMF", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_filename); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":235 * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) * * def sortGetAccess(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetAccess(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63sortGetAccess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess[] = "DMSwarm.sortGetAccess(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63sortGetAccess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetAccess (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("sortGetAccess", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortGetAccess", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetAccess", 0); /* "PETSc/DMSwarm.pyx":236 * * def sortGetAccess(self): * CHKERR( DMSwarmSortGetAccess(self.dm) ) # <<<<<<<<<<<<<< * * def sortRestoreAccess(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetAccess(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 236, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":235 * CHKERR( DMSwarmViewXDMF(self.dm, cval) ) * * def sortGetAccess(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetAccess(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":238 * CHKERR( DMSwarmSortGetAccess(self.dm) ) * * def sortRestoreAccess(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65sortRestoreAccess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess[] = "DMSwarm.sortRestoreAccess(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65sortRestoreAccess(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortRestoreAccess (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("sortRestoreAccess", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortRestoreAccess", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortRestoreAccess", 0); /* "PETSc/DMSwarm.pyx":239 * * def sortRestoreAccess(self): * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) # <<<<<<<<<<<<<< * * def sortGetPointsPerCell(self, e): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortRestoreAccess(__pyx_v_self->__pyx_base.dm)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(53, 239, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":238 * CHKERR( DMSwarmSortGetAccess(self.dm) ) * * def sortRestoreAccess(self): # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortRestoreAccess", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":241 * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) * * def sortGetPointsPerCell(self, e): # <<<<<<<<<<<<<< * cdef PetscInt ce = asInt(e) * cdef PetscInt cnpoints = asInt(0) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67sortGetPointsPerCell(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell[] = "DMSwarm.sortGetPointsPerCell(self, e)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67sortGetPointsPerCell(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_e = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetPointsPerCell (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sortGetPointsPerCell") < 0)) __PYX_ERR(53, 241, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_e = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sortGetPointsPerCell", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 241, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_e); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e) { PetscInt __pyx_v_ce; PetscInt __pyx_v_cnpoints; PetscInt *__pyx_v_cpidlist; PyObject *__pyx_v_pidlist = 0; PetscInt __pyx_v_npoints; long __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PetscInt __pyx_t_4; int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetPointsPerCell", 0); /* "PETSc/DMSwarm.pyx":242 * * def sortGetPointsPerCell(self, e): * cdef PetscInt ce = asInt(e) # <<<<<<<<<<<<<< * cdef PetscInt cnpoints = asInt(0) * cdef PetscInt *cpidlist = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_e); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 242, __pyx_L1_error) __pyx_v_ce = __pyx_t_1; /* "PETSc/DMSwarm.pyx":243 * def sortGetPointsPerCell(self, e): * cdef PetscInt ce = asInt(e) * cdef PetscInt cnpoints = asInt(0) # <<<<<<<<<<<<<< * cdef PetscInt *cpidlist = NULL * cdef list pidlist = [] */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 243, __pyx_L1_error) __pyx_v_cnpoints = __pyx_t_1; /* "PETSc/DMSwarm.pyx":244 * cdef PetscInt ce = asInt(e) * cdef PetscInt cnpoints = asInt(0) * cdef PetscInt *cpidlist = NULL # <<<<<<<<<<<<<< * cdef list pidlist = [] * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) */ __pyx_v_cpidlist = NULL; /* "PETSc/DMSwarm.pyx":245 * cdef PetscInt cnpoints = asInt(0) * cdef PetscInt *cpidlist = NULL * cdef list pidlist = [] # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) * npoints = asInt(cnpoints) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pidlist = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/DMSwarm.pyx":246 * cdef PetscInt *cpidlist = NULL * cdef list pidlist = [] * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) # <<<<<<<<<<<<<< * npoints = asInt(cnpoints) * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetPointsPerCell(__pyx_v_self->__pyx_base.dm, __pyx_v_ce, (&__pyx_v_cnpoints), (&__pyx_v_cpidlist))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(53, 246, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":247 * cdef list pidlist = [] * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) * npoints = asInt(cnpoints) # <<<<<<<<<<<<<< * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) * return pidlist */ __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_v_cnpoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_npoints = __pyx_t_1; /* "PETSc/DMSwarm.pyx":248 * CHKERR( DMSwarmSortGetPointsPerCell(self.dm, ce, &cnpoints, &cpidlist) ) * npoints = asInt(cnpoints) * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) # <<<<<<<<<<<<<< * return pidlist * */ __pyx_t_1 = __pyx_v_npoints; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { __pyx_t_2 = __Pyx_PyInt_From_PetscInt((__pyx_v_cpidlist[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_2); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_PetscInt(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(53, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pidlist, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(53, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/DMSwarm.pyx":249 * npoints = asInt(cnpoints) * for i from 0 <= i < npoints: pidlist.append(asInt(cpidlist[i])) * return pidlist # <<<<<<<<<<<<<< * * def sortGetNumberOfPointsPerCell(self, e): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pidlist); __pyx_r = __pyx_v_pidlist; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":241 * CHKERR( DMSwarmSortRestoreAccess(self.dm) ) * * def sortGetPointsPerCell(self, e): # <<<<<<<<<<<<<< * cdef PetscInt ce = asInt(e) * cdef PetscInt cnpoints = asInt(0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_pidlist); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":251 * return pidlist * * def sortGetNumberOfPointsPerCell(self, e): # <<<<<<<<<<<<<< * cdef PetscInt ce = asInt(e) * cdef PetscInt npoints = asInt(0) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69sortGetNumberOfPointsPerCell(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell[] = "DMSwarm.sortGetNumberOfPointsPerCell(self, e)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69sortGetNumberOfPointsPerCell(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_e = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetNumberOfPointsPerCell (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_e,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_e)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sortGetNumberOfPointsPerCell") < 0)) __PYX_ERR(53, 251, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_e = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("sortGetNumberOfPointsPerCell", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 251, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetNumberOfPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_e); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e) { PetscInt __pyx_v_ce; PetscInt __pyx_v_npoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetNumberOfPointsPerCell", 0); /* "PETSc/DMSwarm.pyx":252 * * def sortGetNumberOfPointsPerCell(self, e): * cdef PetscInt ce = asInt(e) # <<<<<<<<<<<<<< * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_e); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 252, __pyx_L1_error) __pyx_v_ce = __pyx_t_1; /* "PETSc/DMSwarm.pyx":253 * def sortGetNumberOfPointsPerCell(self, e): * cdef PetscInt ce = asInt(e) * cdef PetscInt npoints = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) * return toInt(npoints) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 253, __pyx_L1_error) __pyx_v_npoints = __pyx_t_1; /* "PETSc/DMSwarm.pyx":254 * cdef PetscInt ce = asInt(e) * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) # <<<<<<<<<<<<<< * return toInt(npoints) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetNumberOfPointsPerCell(__pyx_v_self->__pyx_base.dm, __pyx_v_ce, (&__pyx_v_npoints))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 254, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":255 * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetNumberOfPointsPerCell(self.dm, ce, &npoints) ) * return toInt(npoints) # <<<<<<<<<<<<<< * * def sortGetIsValid(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_npoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":251 * return pidlist * * def sortGetNumberOfPointsPerCell(self, e): # <<<<<<<<<<<<<< * cdef PetscInt ce = asInt(e) * cdef PetscInt npoints = asInt(0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetNumberOfPointsPerCell", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":257 * return toInt(npoints) * * def sortGetIsValid(self): # <<<<<<<<<<<<<< * cdef PetscBool isValid = asBool(False) * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetIsValid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid[] = "DMSwarm.sortGetIsValid(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetIsValid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetIsValid (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("sortGetIsValid", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortGetIsValid", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscBool __pyx_v_isValid; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetIsValid", 0); /* "PETSc/DMSwarm.pyx":258 * * def sortGetIsValid(self): * cdef PetscBool isValid = asBool(False) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) * return toBool(isValid) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(Py_False); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(53, 258, __pyx_L1_error) __pyx_v_isValid = __pyx_t_1; /* "PETSc/DMSwarm.pyx":259 * def sortGetIsValid(self): * cdef PetscBool isValid = asBool(False) * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) # <<<<<<<<<<<<<< * return toBool(isValid) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetIsValid(__pyx_v_self->__pyx_base.dm, (&__pyx_v_isValid))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 259, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":260 * cdef PetscBool isValid = asBool(False) * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) * return toBool(isValid) # <<<<<<<<<<<<<< * * def sortGetSizes(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_isValid); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":257 * return toInt(npoints) * * def sortGetIsValid(self): # <<<<<<<<<<<<<< * cdef PetscBool isValid = asBool(False) * CHKERR( DMSwarmSortGetIsValid(self.dm, &isValid) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetIsValid", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":262 * return toBool(isValid) * * def sortGetSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt ncells = asInt(0) * cdef PetscInt npoints = asInt(0) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortGetSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes[] = "DMSwarm.sortGetSizes(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortGetSizes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sortGetSizes (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("sortGetSizes", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "sortGetSizes", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) { PetscInt __pyx_v_ncells; PetscInt __pyx_v_npoints; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("sortGetSizes", 0); /* "PETSc/DMSwarm.pyx":263 * * def sortGetSizes(self): * cdef PetscInt ncells = asInt(0) # <<<<<<<<<<<<<< * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 263, __pyx_L1_error) __pyx_v_ncells = __pyx_t_1; /* "PETSc/DMSwarm.pyx":264 * def sortGetSizes(self): * cdef PetscInt ncells = asInt(0) * cdef PetscInt npoints = asInt(0) # <<<<<<<<<<<<<< * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) * return (toInt(ncells), toInt(npoints)) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(53, 264, __pyx_L1_error) __pyx_v_npoints = __pyx_t_1; /* "PETSc/DMSwarm.pyx":265 * cdef PetscInt ncells = asInt(0) * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) # <<<<<<<<<<<<<< * return (toInt(ncells), toInt(npoints)) * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSortGetSizes(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ncells), (&__pyx_v_npoints))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(53, 265, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":266 * cdef PetscInt npoints = asInt(0) * CHKERR( DMSwarmSortGetSizes(self.dm, &ncells, &npoints) ) * return (toInt(ncells), toInt(npoints)) # <<<<<<<<<<<<<< * * def projectFields(self, fieldnames, reuse=False): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ncells); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_npoints); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":262 * return toBool(isValid) * * def sortGetSizes(self): # <<<<<<<<<<<<<< * cdef PetscInt ncells = asInt(0) * cdef PetscInt npoints = asInt(0) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.sortGetSizes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/DMSwarm.pyx":268 * return (toInt(ncells), toInt(npoints)) * * def projectFields(self, fieldnames, reuse=False): # <<<<<<<<<<<<<< * cdef PetscBool creuse = asBool(reuse) * cdef const char *cval = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75projectFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_7DMSwarm_74projectFields[] = "DMSwarm.projectFields(self, fieldnames, reuse=False)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75projectFields(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fieldnames = 0; PyObject *__pyx_v_reuse = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("projectFields (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fieldnames,&__pyx_n_s_reuse,0}; PyObject* values[2] = {0,0}; values[1] = ((PyObject *)Py_False); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fieldnames)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reuse); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "projectFields") < 0)) __PYX_ERR(53, 268, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_fieldnames = values[0]; __pyx_v_reuse = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("projectFields", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(53, 268, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.projectFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_74projectFields(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldnames, __pyx_v_reuse); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_74projectFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames, PyObject *__pyx_v_reuse) { PetscBool __pyx_v_creuse; char const *__pyx_v_cval; PetscInt __pyx_v_cnfields; char const **__pyx_v_cfieldnames; CYTHON_UNUSED PyObject *__pyx_v_tmp = 0; Vec *__pyx_v_cfieldvecs; long __pyx_v_i; PyObject *__pyx_v_fieldvecs = 0; struct PyPetscVecObject *__pyx_v_newVec = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscBool __pyx_t_1; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PetscInt __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("projectFields", 0); __Pyx_INCREF(__pyx_v_fieldnames); /* "PETSc/DMSwarm.pyx":269 * * def projectFields(self, fieldnames, reuse=False): * cdef PetscBool creuse = asBool(reuse) # <<<<<<<<<<<<<< * cdef const char *cval = NULL * cdef PetscInt cnfields = len(fieldnames) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_reuse); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(53, 269, __pyx_L1_error) __pyx_v_creuse = __pyx_t_1; /* "PETSc/DMSwarm.pyx":270 * def projectFields(self, fieldnames, reuse=False): * cdef PetscBool creuse = asBool(reuse) * cdef const char *cval = NULL # <<<<<<<<<<<<<< * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL */ __pyx_v_cval = NULL; /* "PETSc/DMSwarm.pyx":271 * cdef PetscBool creuse = asBool(reuse) * cdef const char *cval = NULL * cdef PetscInt cnfields = len(fieldnames) # <<<<<<<<<<<<<< * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) */ __pyx_t_2 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(53, 271, __pyx_L1_error) __pyx_v_cnfields = ((PetscInt)__pyx_t_2); /* "PETSc/DMSwarm.pyx":272 * cdef const char *cval = NULL * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL # <<<<<<<<<<<<<< * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * cdef PetscVec *cfieldvecs */ __pyx_v_cfieldnames = NULL; /* "PETSc/DMSwarm.pyx":273 * cdef PetscInt cnfields = len(fieldnames) * cdef const char** cfieldnames = NULL * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) # <<<<<<<<<<<<<< * cdef PetscVec *cfieldvecs * fieldnames = list(fieldnames) */ __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_cnfields)); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_cfieldnames)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tmp = __pyx_t_4; __pyx_t_4 = 0; /* "PETSc/DMSwarm.pyx":275 * cdef object tmp = oarray_p(empty_p(cnfields), NULL, &cfieldnames) * cdef PetscVec *cfieldvecs * fieldnames = list(fieldnames) # <<<<<<<<<<<<<< * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) */ __pyx_t_4 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_fieldnames, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/DMSwarm.pyx":276 * cdef PetscVec *cfieldvecs * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: # <<<<<<<<<<<<<< * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval */ __pyx_t_5 = __pyx_v_cnfields; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "PETSc/DMSwarm.pyx":277 * fieldnames = list(fieldnames) * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) # <<<<<<<<<<<<<< * cfieldnames[i] = cval * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, &cfieldvecs, creuse) ) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_4, (&__pyx_v_cval)); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__Pyx_SetItemInt(__pyx_v_fieldnames, __pyx_v_i, __pyx_t_3, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(53, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":278 * for i from 0 <= i < cnfields: * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval # <<<<<<<<<<<<<< * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, &cfieldvecs, creuse) ) * cdef list fieldvecs = [] */ (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval; } /* "PETSc/DMSwarm.pyx":279 * fieldnames[i] = str2bytes(fieldnames[i], &cval) * cfieldnames[i] = cval * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, &cfieldvecs, creuse) ) # <<<<<<<<<<<<<< * cdef list fieldvecs = [] * for i from 0 <= i < cnfields: */ __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmProjectFields(__pyx_v_self->__pyx_base.dm, __pyx_v_cnfields, __pyx_v_cfieldnames, (&__pyx_v_cfieldvecs), __pyx_v_creuse)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(53, 279, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":280 * cfieldnames[i] = cval * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, &cfieldvecs, creuse) ) * cdef list fieldvecs = [] # <<<<<<<<<<<<<< * for i from 0 <= i < cnfields: * newVec = Vec() */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_fieldvecs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":281 * CHKERR( DMSwarmProjectFields(self.dm, cnfields, cfieldnames, &cfieldvecs, creuse) ) * cdef list fieldvecs = [] * for i from 0 <= i < cnfields: # <<<<<<<<<<<<<< * newVec = Vec() * newVec.vec = cfieldvecs[i] */ __pyx_t_5 = __pyx_v_cnfields; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { /* "PETSc/DMSwarm.pyx":282 * cdef list fieldvecs = [] * for i from 0 <= i < cnfields: * newVec = Vec() # <<<<<<<<<<<<<< * newVec.vec = cfieldvecs[i] * fieldvecs.append(newVec) */ __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_newVec, ((struct PyPetscVecObject *)__pyx_t_3)); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":283 * for i from 0 <= i < cnfields: * newVec = Vec() * newVec.vec = cfieldvecs[i] # <<<<<<<<<<<<<< * fieldvecs.append(newVec) * return fieldvecs */ __pyx_v_newVec->vec = (__pyx_v_cfieldvecs[__pyx_v_i]); /* "PETSc/DMSwarm.pyx":284 * newVec = Vec() * newVec.vec = cfieldvecs[i] * fieldvecs.append(newVec) # <<<<<<<<<<<<<< * return fieldvecs * */ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_fieldvecs, ((PyObject *)__pyx_v_newVec)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(53, 284, __pyx_L1_error) } /* "PETSc/DMSwarm.pyx":285 * newVec.vec = cfieldvecs[i] * fieldvecs.append(newVec) * return fieldvecs # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_fieldvecs); __pyx_r = __pyx_v_fieldvecs; goto __pyx_L0; /* "PETSc/DMSwarm.pyx":268 * return (toInt(ncells), toInt(npoints)) * * def projectFields(self, fieldnames, reuse=False): # <<<<<<<<<<<<<< * cdef PetscBool creuse = asBool(reuse) * cdef const char *cval = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.projectFields", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tmp); __Pyx_XDECREF(__pyx_v_fieldvecs); __Pyx_XDECREF((PyObject *)__pyx_v_newVec); __Pyx_XDECREF(__pyx_v_fieldnames); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":18 * Type = PartitionerType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.part * self.part = NULL */ /* Python wrapper */ static int __pyx_pw_8petsc4py_5PETSc_11Partitioner_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_8petsc4py_5PETSc_11Partitioner_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner___cinit__(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_8petsc4py_5PETSc_11Partitioner___cinit__(struct PyPetscPartitionerObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "PETSc/Partitioner.pyx":19 * * def __cinit__(self): * self.obj = &self.part # <<<<<<<<<<<<<< * self.part = NULL * */ __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->part)); /* "PETSc/Partitioner.pyx":20 * def __cinit__(self): * self.obj = &self.part * self.part = NULL # <<<<<<<<<<<<<< * * def view(self, Viewer viewer=None): */ __pyx_v_self->part = NULL; /* "PETSc/Partitioner.pyx":18 * Type = PartitionerType * * def __cinit__(self): # <<<<<<<<<<<<<< * self.obj = &self.part * self.part = NULL */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":22 * self.part = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_2view[] = "Partitioner.view(self, Viewer viewer=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct PyPetscViewerObject *__pyx_v_viewer = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("view (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_viewer,0}; PyObject* values[1] = {0}; values[0] = (PyObject *)((struct PyPetscViewerObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_viewer); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "view") < 0)) __PYX_ERR(54, 22, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_viewer = ((struct PyPetscViewerObject *)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(54, 22, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_viewer), __pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(54, 22, __pyx_L1_error) __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_2view(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_viewer); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_2view(struct PyPetscPartitionerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer) { PetscViewer __pyx_v_vwr; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PetscViewer __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("view", 0); /* "PETSc/Partitioner.pyx":23 * * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL # <<<<<<<<<<<<<< * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscPartitionerView(self.part, vwr) ) */ __pyx_v_vwr = NULL; /* "PETSc/Partitioner.pyx":24 * def view(self, Viewer viewer=None): * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerView(self.part, vwr) ) * */ __pyx_t_1 = (((PyObject *)__pyx_v_viewer) != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = __pyx_v_viewer->vwr; __pyx_v_vwr = __pyx_t_3; } /* "PETSc/Partitioner.pyx":25 * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr * CHKERR( PetscPartitionerView(self.part, vwr) ) # <<<<<<<<<<<<<< * * def destroy(self): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerView(__pyx_v_self->part, __pyx_v_vwr)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(54, 25, __pyx_L1_error) /* "PETSc/Partitioner.pyx":22 * self.part = NULL * * def view(self, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.view", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":27 * CHKERR( PetscPartitionerView(self.part, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerDestroy(&self.part) ) * return self */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_4destroy[] = "Partitioner.destroy(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("destroy (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("destroy", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "destroy", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_4destroy(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_4destroy(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("destroy", 0); /* "PETSc/Partitioner.pyx":28 * * def destroy(self): * CHKERR( PetscPartitionerDestroy(&self.part) ) # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerDestroy((&__pyx_v_self->part))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(54, 28, __pyx_L1_error) /* "PETSc/Partitioner.pyx":29 * def destroy(self): * CHKERR( PetscPartitionerDestroy(&self.part) ) * return self # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Partitioner.pyx":27 * CHKERR( PetscPartitionerView(self.part, vwr) ) * * def destroy(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerDestroy(&self.part) ) * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":31 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPartitioner newpart = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_6create[] = "Partitioner.create(self, comm=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,0}; PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(54, 31, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_comm = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(54, 31, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_6create(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_6create(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_comm) { MPI_Comm __pyx_v_ccomm; PetscPartitioner __pyx_v_newpart; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations MPI_Comm __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create", 0); /* "PETSc/Partitioner.pyx":32 * * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) # <<<<<<<<<<<<<< * cdef PetscPartitioner newpart = NULL * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(PyErr_Occurred())) __PYX_ERR(54, 32, __pyx_L1_error) __pyx_v_ccomm = __pyx_t_1; /* "PETSc/Partitioner.pyx":33 * def create(self, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPartitioner newpart = NULL # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) * PetscCLEAR(self.obj); self.part = newpart */ __pyx_v_newpart = NULL; /* "PETSc/Partitioner.pyx":34 * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPartitioner newpart = NULL * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) # <<<<<<<<<<<<<< * PetscCLEAR(self.obj); self.part = newpart * return self */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerCreate(__pyx_v_ccomm, (&__pyx_v_newpart))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(54, 34, __pyx_L1_error) /* "PETSc/Partitioner.pyx":35 * cdef PetscPartitioner newpart = NULL * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) * PetscCLEAR(self.obj); self.part = newpart # <<<<<<<<<<<<<< * return self * */ (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); __pyx_v_self->part = __pyx_v_newpart; /* "PETSc/Partitioner.pyx":36 * CHKERR( PetscPartitionerCreate(ccomm, &newpart) ) * PetscCLEAR(self.obj); self.part = newpart * return self # <<<<<<<<<<<<<< * * def setType(self, part_type): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "PETSc/Partitioner.pyx":31 * return self * * def create(self, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscPartitioner newpart = NULL */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.create", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":38 * return self * * def setType(self, part_type): # <<<<<<<<<<<<<< * cdef PetscPartitionerType cval = NULL * part_type = str2bytes(part_type, &cval) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_8setType[] = "Partitioner.setType(self, part_type)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_part_type = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setType (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_part_type,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_part_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setType") < 0)) __PYX_ERR(54, 38, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_part_type = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(54, 38, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_8setType(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_part_type); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_8setType(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_part_type) { PetscPartitionerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setType", 0); __Pyx_INCREF(__pyx_v_part_type); /* "PETSc/Partitioner.pyx":39 * * def setType(self, part_type): * cdef PetscPartitionerType cval = NULL # <<<<<<<<<<<<<< * part_type = str2bytes(part_type, &cval) * CHKERR( PetscPartitionerSetType(self.part, cval) ) */ __pyx_v_cval = NULL; /* "PETSc/Partitioner.pyx":40 * def setType(self, part_type): * cdef PetscPartitionerType cval = NULL * part_type = str2bytes(part_type, &cval) # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerSetType(self.part, cval) ) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_part_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_part_type, __pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Partitioner.pyx":41 * cdef PetscPartitionerType cval = NULL * part_type = str2bytes(part_type, &cval) * CHKERR( PetscPartitionerSetType(self.part, cval) ) # <<<<<<<<<<<<<< * * def getType(self): */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerSetType(__pyx_v_self->part, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(54, 41, __pyx_L1_error) /* "PETSc/Partitioner.pyx":38 * return self * * def setType(self, part_type): # <<<<<<<<<<<<<< * cdef PetscPartitionerType cval = NULL * part_type = str2bytes(part_type, &cval) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_part_type); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":43 * CHKERR( PetscPartitionerSetType(self.part, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscPartitionerType cval = NULL * CHKERR( PetscPartitionerGetType(self.part, &cval) ) */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_10getType[] = "Partitioner.getType(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getType (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("getType", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "getType", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_10getType(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_10getType(struct PyPetscPartitionerObject *__pyx_v_self) { PetscPartitionerType __pyx_v_cval; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getType", 0); /* "PETSc/Partitioner.pyx":44 * * def getType(self): * cdef PetscPartitionerType cval = NULL # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerGetType(self.part, &cval) ) * return bytes2str(cval) */ __pyx_v_cval = NULL; /* "PETSc/Partitioner.pyx":45 * def getType(self): * cdef PetscPartitionerType cval = NULL * CHKERR( PetscPartitionerGetType(self.part, &cval) ) # <<<<<<<<<<<<<< * return bytes2str(cval) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerGetType(__pyx_v_self->part, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(54, 45, __pyx_L1_error) /* "PETSc/Partitioner.pyx":46 * cdef PetscPartitionerType cval = NULL * CHKERR( PetscPartitionerGetType(self.part, &cval) ) * return bytes2str(cval) # <<<<<<<<<<<<<< * * def setFromOptions(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "PETSc/Partitioner.pyx":43 * CHKERR( PetscPartitionerSetType(self.part, cval) ) * * def getType(self): # <<<<<<<<<<<<<< * cdef PetscPartitionerType cval = NULL * CHKERR( PetscPartitionerGetType(self.part, &cval) ) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.getType", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":48 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerSetFromOptions(self.part) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_12setFromOptions[] = "Partitioner.setFromOptions(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setFromOptions (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setFromOptions", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setFromOptions", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_12setFromOptions(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_12setFromOptions(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setFromOptions", 0); /* "PETSc/Partitioner.pyx":49 * * def setFromOptions(self): * CHKERR( PetscPartitionerSetFromOptions(self.part) ) # <<<<<<<<<<<<<< * * def setUp(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerSetFromOptions(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(54, 49, __pyx_L1_error) /* "PETSc/Partitioner.pyx":48 * return bytes2str(cval) * * def setFromOptions(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerSetFromOptions(self.part) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":51 * CHKERR( PetscPartitionerSetFromOptions(self.part) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerSetUp(self.part) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_14setUp[] = "Partitioner.setUp(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setUp (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("setUp", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "setUp", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_14setUp(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_14setUp(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setUp", 0); /* "PETSc/Partitioner.pyx":52 * * def setUp(self): * CHKERR( PetscPartitionerSetUp(self.part) ) # <<<<<<<<<<<<<< * * def reset(self): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerSetUp(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(54, 52, __pyx_L1_error) /* "PETSc/Partitioner.pyx":51 * CHKERR( PetscPartitionerSetFromOptions(self.part) ) * * def setUp(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerSetUp(self.part) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":54 * CHKERR( PetscPartitionerSetUp(self.part) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerReset(self.part) ) * */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_16reset[] = "Partitioner.reset(self)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "reset", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_16reset(((struct PyPetscPartitionerObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_16reset(struct PyPetscPartitionerObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 0); /* "PETSc/Partitioner.pyx":55 * * def reset(self): * CHKERR( PetscPartitionerReset(self.part) ) # <<<<<<<<<<<<<< * * def setShellPartition(self, numProcs, sizes=None, points=None): */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerReset(__pyx_v_self->part)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(54, 55, __pyx_L1_error) /* "PETSc/Partitioner.pyx":54 * CHKERR( PetscPartitionerSetUp(self.part) ) * * def reset(self): # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerReset(self.part) ) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/Partitioner.pyx":57 * CHKERR( PetscPartitionerReset(self.part) ) * * def setShellPartition(self, numProcs, sizes=None, points=None): # <<<<<<<<<<<<<< * cdef PetscInt cnumProcs = asInt(numProcs) * cdef PetscInt *csizes = NULL */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_19setShellPartition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_11Partitioner_18setShellPartition[] = "Partitioner.setShellPartition(self, numProcs, sizes=None, points=None)"; static PyObject *__pyx_pw_8petsc4py_5PETSc_11Partitioner_19setShellPartition(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_numProcs = 0; PyObject *__pyx_v_sizes = 0; PyObject *__pyx_v_points = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setShellPartition (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_numProcs,&__pyx_n_s_sizes,&__pyx_n_s_points,0}; PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_numProcs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sizes); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setShellPartition") < 0)) __PYX_ERR(54, 57, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_numProcs = values[0]; __pyx_v_sizes = values[1]; __pyx_v_points = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("setShellPartition", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(54, 57, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setShellPartition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc_11Partitioner_18setShellPartition(((struct PyPetscPartitionerObject *)__pyx_v_self), __pyx_v_numProcs, __pyx_v_sizes, __pyx_v_points); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_11Partitioner_18setShellPartition(struct PyPetscPartitionerObject *__pyx_v_self, PyObject *__pyx_v_numProcs, PyObject *__pyx_v_sizes, PyObject *__pyx_v_points) { PetscInt __pyx_v_cnumProcs; PetscInt *__pyx_v_csizes; PetscInt *__pyx_v_cpoints; PetscInt __pyx_v_nsize; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PetscInt __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setShellPartition", 0); __Pyx_INCREF(__pyx_v_sizes); __Pyx_INCREF(__pyx_v_points); /* "PETSc/Partitioner.pyx":58 * * def setShellPartition(self, numProcs, sizes=None, points=None): * cdef PetscInt cnumProcs = asInt(numProcs) # <<<<<<<<<<<<<< * cdef PetscInt *csizes = NULL * cdef PetscInt *cpoints = NULL */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_numProcs); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 58, __pyx_L1_error) __pyx_v_cnumProcs = __pyx_t_1; /* "PETSc/Partitioner.pyx":59 * def setShellPartition(self, numProcs, sizes=None, points=None): * cdef PetscInt cnumProcs = asInt(numProcs) * cdef PetscInt *csizes = NULL # <<<<<<<<<<<<<< * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 */ __pyx_v_csizes = NULL; /* "PETSc/Partitioner.pyx":60 * cdef PetscInt cnumProcs = asInt(numProcs) * cdef PetscInt *csizes = NULL * cdef PetscInt *cpoints = NULL # <<<<<<<<<<<<<< * cdef PetscInt nsize = 0 * if sizes is not None: */ __pyx_v_cpoints = NULL; /* "PETSc/Partitioner.pyx":61 * cdef PetscInt *csizes = NULL * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 # <<<<<<<<<<<<<< * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) */ __pyx_v_nsize = 0; /* "PETSc/Partitioner.pyx":62 * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 * if sizes is not None: # <<<<<<<<<<<<<< * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: */ __pyx_t_2 = (__pyx_v_sizes != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Partitioner.pyx":63 * cdef PetscInt nsize = 0 * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) # <<<<<<<<<<<<<< * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % */ __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_sizes, (&__pyx_v_nsize), (&__pyx_v_csizes))); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_sizes, __pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Partitioner.pyx":64 * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: # <<<<<<<<<<<<<< * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) */ __pyx_t_3 = ((__pyx_v_nsize != __pyx_v_cnumProcs) != 0); if (unlikely(__pyx_t_3)) { /* "PETSc/Partitioner.pyx":65 * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % # <<<<<<<<<<<<<< * numProcs, toInt(nsize)) * if points is None: */ __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_sizes_array_should_have_d_entrie, __pyx_v_numProcs); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "PETSc/Partitioner.pyx":66 * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) # <<<<<<<<<<<<<< * if points is None: * raise ValueError("Must provide both sizes and points arrays") */ __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nsize); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "PETSc/Partitioner.pyx":65 * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: * raise ValueError("sizes array should have %d entries (has %d)" % # <<<<<<<<<<<<<< * numProcs, toInt(nsize)) * if points is None: */ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(54, 65, __pyx_L1_error) /* "PETSc/Partitioner.pyx":64 * if sizes is not None: * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: # <<<<<<<<<<<<<< * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) */ } /* "PETSc/Partitioner.pyx":67 * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) * if points is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide both sizes and points arrays") * if points is not None: */ __pyx_t_3 = (__pyx_v_points == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/Partitioner.pyx":68 * numProcs, toInt(nsize)) * if points is None: * raise ValueError("Must provide both sizes and points arrays") # <<<<<<<<<<<<<< * if points is not None: * points = iarray_i(points, NULL, &cpoints) */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(54, 68, __pyx_L1_error) /* "PETSc/Partitioner.pyx":67 * raise ValueError("sizes array should have %d entries (has %d)" % * numProcs, toInt(nsize)) * if points is None: # <<<<<<<<<<<<<< * raise ValueError("Must provide both sizes and points arrays") * if points is not None: */ } /* "PETSc/Partitioner.pyx":62 * cdef PetscInt *cpoints = NULL * cdef PetscInt nsize = 0 * if sizes is not None: # <<<<<<<<<<<<<< * sizes = iarray_i(sizes, &nsize, &csizes) * if nsize != cnumProcs: */ } /* "PETSc/Partitioner.pyx":69 * if points is None: * raise ValueError("Must provide both sizes and points arrays") * if points is not None: # <<<<<<<<<<<<<< * points = iarray_i(points, NULL, &cpoints) * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, */ __pyx_t_2 = (__pyx_v_points != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "PETSc/Partitioner.pyx":70 * raise ValueError("Must provide both sizes and points arrays") * if points is not None: * points = iarray_i(points, NULL, &cpoints) # <<<<<<<<<<<<<< * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, * csizes, cpoints) ) */ __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, NULL, (&__pyx_v_cpoints))); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_5); __pyx_t_5 = 0; /* "PETSc/Partitioner.pyx":69 * if points is None: * raise ValueError("Must provide both sizes and points arrays") * if points is not None: # <<<<<<<<<<<<<< * points = iarray_i(points, NULL, &cpoints) * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, */ } /* "PETSc/Partitioner.pyx":71 * if points is not None: * points = iarray_i(points, NULL, &cpoints) * CHKERR( PetscPartitionerShellSetPartition(self.part, cnumProcs, # <<<<<<<<<<<<<< * csizes, cpoints) ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerShellSetPartition(__pyx_v_self->part, __pyx_v_cnumProcs, __pyx_v_csizes, __pyx_v_cpoints)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(54, 71, __pyx_L1_error) /* "PETSc/Partitioner.pyx":57 * CHKERR( PetscPartitionerReset(self.part) ) * * def setShellPartition(self, numProcs, sizes=None, points=None): # <<<<<<<<<<<<<< * cdef PetscInt cnumProcs = asInt(numProcs) * cdef PetscInt *csizes = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("petsc4py.PETSc.Partitioner.setShellPartition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sizes); __Pyx_XDECREF(__pyx_v_points); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":3 * #--------------------------------------------------------------------- * * cdef inline int setref(void *d, void *s) except -1: # <<<<<<<<<<<<<< * cdef PetscObject *dest = d * cdef PetscObject source = s */ static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_setref(void *__pyx_v_d, void *__pyx_v_s) { PetscObject *__pyx_v_dest; PetscObject __pyx_v_source; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setref", 0); /* "PETSc/CAPI.pyx":4 * * cdef inline int setref(void *d, void *s) except -1: * cdef PetscObject *dest = d # <<<<<<<<<<<<<< * cdef PetscObject source = s * CHKERR( PetscINCREF(&source) ) */ __pyx_v_dest = ((PetscObject *)__pyx_v_d); /* "PETSc/CAPI.pyx":5 * cdef inline int setref(void *d, void *s) except -1: * cdef PetscObject *dest = d * cdef PetscObject source = s # <<<<<<<<<<<<<< * CHKERR( PetscINCREF(&source) ) * dest[0] = source */ __pyx_v_source = ((PetscObject)__pyx_v_s); /* "PETSc/CAPI.pyx":6 * cdef PetscObject *dest = d * cdef PetscObject source = s * CHKERR( PetscINCREF(&source) ) # <<<<<<<<<<<<<< * dest[0] = source * return 0 */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF((&__pyx_v_source))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(55, 6, __pyx_L1_error) /* "PETSc/CAPI.pyx":7 * cdef PetscObject source = s * CHKERR( PetscINCREF(&source) ) * dest[0] = source # <<<<<<<<<<<<<< * return 0 * */ (__pyx_v_dest[0]) = __pyx_v_source; /* "PETSc/CAPI.pyx":8 * CHKERR( PetscINCREF(&source) ) * dest[0] = source * return 0 # <<<<<<<<<<<<<< * * #--------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/CAPI.pyx":3 * #--------------------------------------------------------------------- * * cdef inline int setref(void *d, void *s) except -1: # <<<<<<<<<<<<<< * cdef PetscObject *dest = d * cdef PetscObject source = s */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.setref", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":14 * # -- Error -- * * cdef api int PyPetscError_Set(int ierr): # <<<<<<<<<<<<<< * return SETERR(ierr) * */ static int __pyx_f_8petsc4py_5PETSc_PyPetscError_Set(int __pyx_v_ierr) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("PyPetscError_Set", 0); /* "PETSc/CAPI.pyx":15 * * cdef api int PyPetscError_Set(int ierr): * return SETERR(ierr) # <<<<<<<<<<<<<< * * # -- Comm -- */ __pyx_r = __pyx_f_8petsc4py_5PETSc_SETERR(__pyx_v_ierr); goto __pyx_L0; /* "PETSc/CAPI.pyx":14 * # -- Error -- * * cdef api int PyPetscError_Set(int ierr): # <<<<<<<<<<<<<< * return SETERR(ierr) * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":19 * # -- Comm -- * * cdef api object PyPetscComm_New(MPI_Comm arg): # <<<<<<<<<<<<<< * cdef Comm retv = Comm() * retv.comm = arg */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscComm_New(MPI_Comm __pyx_v_arg) { struct PyPetscCommObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscComm_New", 0); /* "PETSc/CAPI.pyx":20 * * cdef api object PyPetscComm_New(MPI_Comm arg): * cdef Comm retv = Comm() # <<<<<<<<<<<<<< * retv.comm = arg * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":21 * cdef api object PyPetscComm_New(MPI_Comm arg): * cdef Comm retv = Comm() * retv.comm = arg # <<<<<<<<<<<<<< * return retv * */ __pyx_v_retv->comm = __pyx_v_arg; /* "PETSc/CAPI.pyx":22 * cdef Comm retv = Comm() * retv.comm = arg * return retv # <<<<<<<<<<<<<< * * cdef api MPI_Comm PyPetscComm_Get(object arg) except *: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":19 * # -- Comm -- * * cdef api object PyPetscComm_New(MPI_Comm arg): # <<<<<<<<<<<<<< * cdef Comm retv = Comm() * retv.comm = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscComm_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":24 * return retv * * cdef api MPI_Comm PyPetscComm_Get(object arg) except *: # <<<<<<<<<<<<<< * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg */ static MPI_Comm __pyx_f_8petsc4py_5PETSc_PyPetscComm_Get(PyObject *__pyx_v_arg) { MPI_Comm __pyx_v_retv; struct PyPetscCommObject *__pyx_v_ob = 0; MPI_Comm __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; MPI_Comm __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscComm_Get", 0); /* "PETSc/CAPI.pyx":25 * * cdef api MPI_Comm PyPetscComm_Get(object arg) except *: * cdef MPI_Comm retv = MPI_COMM_NULL # <<<<<<<<<<<<<< * cdef Comm ob = arg * retv = ob.comm */ __pyx_v_retv = MPI_COMM_NULL; /* "PETSc/CAPI.pyx":26 * cdef api MPI_Comm PyPetscComm_Get(object arg) except *: * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg # <<<<<<<<<<<<<< * retv = ob.comm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(55, 26, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":27 * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg * retv = ob.comm # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->comm; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":28 * cdef Comm ob = arg * retv = ob.comm * return retv # <<<<<<<<<<<<<< * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":24 * return retv * * cdef api MPI_Comm PyPetscComm_Get(object arg) except *: # <<<<<<<<<<<<<< * cdef MPI_Comm retv = MPI_COMM_NULL * cdef Comm ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscComm_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":30 * return retv * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg */ static MPI_Comm *__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr(PyObject *__pyx_v_arg) { MPI_Comm *__pyx_v_retv; struct PyPetscCommObject *__pyx_v_ob = 0; MPI_Comm *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscComm_GetPtr", 0); /* "PETSc/CAPI.pyx":31 * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: * cdef MPI_Comm *retv = NULL # <<<<<<<<<<<<<< * cdef Comm ob = arg * retv = &ob.comm */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":32 * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg # <<<<<<<<<<<<<< * retv = &ob.comm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(55, 32, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":33 * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg * retv = &ob.comm # <<<<<<<<<<<<<< * return retv * */ __pyx_v_retv = (&__pyx_v_ob->comm); /* "PETSc/CAPI.pyx":34 * cdef Comm ob = arg * retv = &ob.comm * return retv # <<<<<<<<<<<<<< * * # -- Object -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":30 * return retv * * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef MPI_Comm *retv = NULL * cdef Comm ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscComm_GetPtr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":38 * # -- Object -- * * cdef api object PyPetscObject_New(PetscObject arg): # <<<<<<<<<<<<<< * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_New(PetscObject __pyx_v_arg) { struct PyPetscObjectObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscObject_New", 0); /* "PETSc/CAPI.pyx":39 * * cdef api object PyPetscObject_New(PetscObject arg): * cdef Object retv = subtype_Object(arg)() # <<<<<<<<<<<<<< * setref(&retv.obj[0], arg) * return retv */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_arg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(55, 39, __pyx_L1_error) __pyx_v_retv = ((struct PyPetscObjectObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/CAPI.pyx":40 * cdef api object PyPetscObject_New(PetscObject arg): * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_setref((&(__pyx_v_retv->obj[0])), __pyx_v_arg); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(55, 40, __pyx_L1_error) /* "PETSc/CAPI.pyx":41 * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":38 * # -- Object -- * * cdef api object PyPetscObject_New(PetscObject arg): # <<<<<<<<<<<<<< * cdef Object retv = subtype_Object(arg)() * setref(&retv.obj[0], arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscObject_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":43 * return retv * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscObject retv = NULL * cdef Object ob = arg */ static PetscObject __pyx_f_8petsc4py_5PETSc_PyPetscObject_Get(PyObject *__pyx_v_arg) { PetscObject __pyx_v_retv; struct PyPetscObjectObject *__pyx_v_ob = 0; PetscObject __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscObject_Get", 0); /* "PETSc/CAPI.pyx":44 * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: * cdef PetscObject retv = NULL # <<<<<<<<<<<<<< * cdef Object ob = arg * retv = ob.obj[0] */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":45 * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: * cdef PetscObject retv = NULL * cdef Object ob = arg # <<<<<<<<<<<<<< * retv = ob.obj[0] * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(55, 45, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscObjectObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":46 * cdef PetscObject retv = NULL * cdef Object ob = arg * retv = ob.obj[0] # <<<<<<<<<<<<<< * return retv * */ __pyx_v_retv = (__pyx_v_ob->obj[0]); /* "PETSc/CAPI.pyx":47 * cdef Object ob = arg * retv = ob.obj[0] * return retv # <<<<<<<<<<<<<< * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":43 * return retv * * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscObject retv = NULL * cdef Object ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscObject_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":49 * return retv * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef PetscObject *retv = NULL * cdef Object ob = arg */ static PetscObject *__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr(PyObject *__pyx_v_arg) { PetscObject *__pyx_v_retv; struct PyPetscObjectObject *__pyx_v_ob = 0; PetscObject *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscObject *__pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscObject_GetPtr", 0); /* "PETSc/CAPI.pyx":50 * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: * cdef PetscObject *retv = NULL # <<<<<<<<<<<<<< * cdef Object ob = arg * retv = ob.obj */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":51 * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: * cdef PetscObject *retv = NULL * cdef Object ob = arg # <<<<<<<<<<<<<< * retv = ob.obj * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(55, 51, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscObjectObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":52 * cdef PetscObject *retv = NULL * cdef Object ob = arg * retv = ob.obj # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->obj; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":53 * cdef Object ob = arg * retv = ob.obj * return retv # <<<<<<<<<<<<<< * * # -- Viewer -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":49 * return retv * * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL: # <<<<<<<<<<<<<< * cdef PetscObject *retv = NULL * cdef Object ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscObject_GetPtr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":57 * # -- Viewer -- * * cdef api object PyPetscViewer_New(PetscViewer arg): # <<<<<<<<<<<<<< * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New(PetscViewer __pyx_v_arg) { struct PyPetscViewerObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscViewer_New", 0); /* "PETSc/CAPI.pyx":58 * * cdef api object PyPetscViewer_New(PetscViewer arg): * cdef Viewer retv = Viewer() # <<<<<<<<<<<<<< * setref(&retv.vwr, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscViewerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":59 * cdef api object PyPetscViewer_New(PetscViewer arg): * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->vwr), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 59, __pyx_L1_error) /* "PETSc/CAPI.pyx":60 * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":57 * # -- Viewer -- * * cdef api object PyPetscViewer_New(PetscViewer arg): # <<<<<<<<<<<<<< * cdef Viewer retv = Viewer() * setref(&retv.vwr, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscViewer_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":62 * return retv * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscViewer retv = NULL * cdef Viewer ob = arg */ static PetscViewer __pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get(PyObject *__pyx_v_arg) { PetscViewer __pyx_v_retv; struct PyPetscViewerObject *__pyx_v_ob = 0; PetscViewer __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscViewer __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscViewer_Get", 0); /* "PETSc/CAPI.pyx":63 * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: * cdef PetscViewer retv = NULL # <<<<<<<<<<<<<< * cdef Viewer ob = arg * retv = ob.vwr */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":64 * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: * cdef PetscViewer retv = NULL * cdef Viewer ob = arg # <<<<<<<<<<<<<< * retv = ob.vwr * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(55, 64, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscViewerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":65 * cdef PetscViewer retv = NULL * cdef Viewer ob = arg * retv = ob.vwr # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->vwr; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":66 * cdef Viewer ob = arg * retv = ob.vwr * return retv # <<<<<<<<<<<<<< * * # -- Random -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":62 * return retv * * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscViewer retv = NULL * cdef Viewer ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscViewer_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":70 * # -- Random -- * * cdef api object PyPetscRandom_New(PetscRandom arg): # <<<<<<<<<<<<<< * cdef Random retv = Random() * setref(&retv.rnd, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New(PetscRandom __pyx_v_arg) { struct PyPetscRandomObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscRandom_New", 0); /* "PETSc/CAPI.pyx":71 * * cdef api object PyPetscRandom_New(PetscRandom arg): * cdef Random retv = Random() # <<<<<<<<<<<<<< * setref(&retv.rnd, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Random)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscRandomObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":72 * cdef api object PyPetscRandom_New(PetscRandom arg): * cdef Random retv = Random() * setref(&retv.rnd, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->rnd), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 72, __pyx_L1_error) /* "PETSc/CAPI.pyx":73 * cdef Random retv = Random() * setref(&retv.rnd, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":70 * # -- Random -- * * cdef api object PyPetscRandom_New(PetscRandom arg): # <<<<<<<<<<<<<< * cdef Random retv = Random() * setref(&retv.rnd, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscRandom_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":75 * return retv * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscRandom retv = NULL * cdef Random ob = arg */ static PetscRandom __pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get(PyObject *__pyx_v_arg) { PetscRandom __pyx_v_retv; struct PyPetscRandomObject *__pyx_v_ob = 0; PetscRandom __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscRandom __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscRandom_Get", 0); /* "PETSc/CAPI.pyx":76 * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: * cdef PetscRandom retv = NULL # <<<<<<<<<<<<<< * cdef Random ob = arg * retv = ob.rnd */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":77 * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: * cdef PetscRandom retv = NULL * cdef Random ob = arg # <<<<<<<<<<<<<< * retv = ob.rnd * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Random)))) __PYX_ERR(55, 77, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscRandomObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":78 * cdef PetscRandom retv = NULL * cdef Random ob = arg * retv = ob.rnd # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->rnd; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":79 * cdef Random ob = arg * retv = ob.rnd * return retv # <<<<<<<<<<<<<< * * # -- IS -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":75 * return retv * * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscRandom retv = NULL * cdef Random ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscRandom_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":83 * # -- IS -- * * cdef api object PyPetscIS_New(PetscIS arg): # <<<<<<<<<<<<<< * cdef IS retv = IS() * setref(&retv.iset, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscIS_New(IS __pyx_v_arg) { struct PyPetscISObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscIS_New", 0); /* "PETSc/CAPI.pyx":84 * * cdef api object PyPetscIS_New(PetscIS arg): * cdef IS retv = IS() # <<<<<<<<<<<<<< * setref(&retv.iset, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":85 * cdef api object PyPetscIS_New(PetscIS arg): * cdef IS retv = IS() * setref(&retv.iset, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->iset), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 85, __pyx_L1_error) /* "PETSc/CAPI.pyx":86 * cdef IS retv = IS() * setref(&retv.iset, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":83 * # -- IS -- * * cdef api object PyPetscIS_New(PetscIS arg): # <<<<<<<<<<<<<< * cdef IS retv = IS() * setref(&retv.iset, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscIS_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":88 * return retv * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscIS retv = NULL * cdef IS ob = arg */ static IS __pyx_f_8petsc4py_5PETSc_PyPetscIS_Get(PyObject *__pyx_v_arg) { IS __pyx_v_retv; struct PyPetscISObject *__pyx_v_ob = 0; IS __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; IS __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscIS_Get", 0); /* "PETSc/CAPI.pyx":89 * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: * cdef PetscIS retv = NULL # <<<<<<<<<<<<<< * cdef IS ob = arg * retv = ob.iset */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":90 * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: * cdef PetscIS retv = NULL * cdef IS ob = arg # <<<<<<<<<<<<<< * retv = ob.iset * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(55, 90, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":91 * cdef PetscIS retv = NULL * cdef IS ob = arg * retv = ob.iset # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->iset; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":92 * cdef IS ob = arg * retv = ob.iset * return retv # <<<<<<<<<<<<<< * * # -- LGMap -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":88 * return retv * * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscIS retv = NULL * cdef IS ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscIS_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":96 * # -- LGMap -- * * cdef api object PyPetscLGMap_New(PetscLGMap arg): # <<<<<<<<<<<<<< * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New(ISLocalToGlobalMapping __pyx_v_arg) { struct PyPetscLGMapObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscLGMap_New", 0); /* "PETSc/CAPI.pyx":97 * * cdef api object PyPetscLGMap_New(PetscLGMap arg): * cdef LGMap retv = LGMap() # <<<<<<<<<<<<<< * setref(&retv.lgm, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":98 * cdef api object PyPetscLGMap_New(PetscLGMap arg): * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->lgm), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 98, __pyx_L1_error) /* "PETSc/CAPI.pyx":99 * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":96 * # -- LGMap -- * * cdef api object PyPetscLGMap_New(PetscLGMap arg): # <<<<<<<<<<<<<< * cdef LGMap retv = LGMap() * setref(&retv.lgm, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscLGMap_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":101 * return retv * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg */ static ISLocalToGlobalMapping __pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get(PyObject *__pyx_v_arg) { ISLocalToGlobalMapping __pyx_v_retv; struct PyPetscLGMapObject *__pyx_v_ob = 0; ISLocalToGlobalMapping __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; ISLocalToGlobalMapping __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscLGMap_Get", 0); /* "PETSc/CAPI.pyx":102 * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: * cdef PetscLGMap retv = NULL # <<<<<<<<<<<<<< * cdef LGMap ob = arg * retv = ob.lgm */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":103 * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg # <<<<<<<<<<<<<< * retv = ob.lgm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_LGMap)))) __PYX_ERR(55, 103, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscLGMapObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":104 * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg * retv = ob.lgm # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->lgm; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":105 * cdef LGMap ob = arg * retv = ob.lgm * return retv # <<<<<<<<<<<<<< * * # -- SF -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":101 * return retv * * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscLGMap retv = NULL * cdef LGMap ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscLGMap_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":109 * # -- SF -- * * cdef api object PyPetscSF_New(PetscSF arg): # <<<<<<<<<<<<<< * cdef SF retv = SF() * setref(&retv.sf, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSF_New(PetscSF __pyx_v_arg) { struct PyPetscSFObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSF_New", 0); /* "PETSc/CAPI.pyx":110 * * cdef api object PyPetscSF_New(PetscSF arg): * cdef SF retv = SF() # <<<<<<<<<<<<<< * setref(&retv.sf, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":111 * cdef api object PyPetscSF_New(PetscSF arg): * cdef SF retv = SF() * setref(&retv.sf, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sf), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 111, __pyx_L1_error) /* "PETSc/CAPI.pyx":112 * cdef SF retv = SF() * setref(&retv.sf, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":109 * # -- SF -- * * cdef api object PyPetscSF_New(PetscSF arg): # <<<<<<<<<<<<<< * cdef SF retv = SF() * setref(&retv.sf, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSF_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":114 * return retv * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscSF retv = NULL * cdef SF ob = arg */ static PetscSF __pyx_f_8petsc4py_5PETSc_PyPetscSF_Get(PyObject *__pyx_v_arg) { PetscSF __pyx_v_retv; struct PyPetscSFObject *__pyx_v_ob = 0; PetscSF __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscSF __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSF_Get", 0); /* "PETSc/CAPI.pyx":115 * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: * cdef PetscSF retv = NULL # <<<<<<<<<<<<<< * cdef SF ob = arg * retv = ob.sf */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":116 * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: * cdef PetscSF retv = NULL * cdef SF ob = arg # <<<<<<<<<<<<<< * retv = ob.sf * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_SF)))) __PYX_ERR(55, 116, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscSFObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":117 * cdef PetscSF retv = NULL * cdef SF ob = arg * retv = ob.sf # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->sf; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":118 * cdef SF ob = arg * retv = ob.sf * return retv # <<<<<<<<<<<<<< * * # -- Vec -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":114 * return retv * * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL: # <<<<<<<<<<<<<< * cdef PetscSF retv = NULL * cdef SF ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSF_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":122 * # -- Vec -- * * cdef api object PyPetscVec_New(PetscVec arg): # <<<<<<<<<<<<<< * cdef Vec retv = Vec() * setref(&retv.vec, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscVec_New(Vec __pyx_v_arg) { struct PyPetscVecObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscVec_New", 0); /* "PETSc/CAPI.pyx":123 * * cdef api object PyPetscVec_New(PetscVec arg): * cdef Vec retv = Vec() # <<<<<<<<<<<<<< * setref(&retv.vec, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":124 * cdef api object PyPetscVec_New(PetscVec arg): * cdef Vec retv = Vec() * setref(&retv.vec, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->vec), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 124, __pyx_L1_error) /* "PETSc/CAPI.pyx":125 * cdef Vec retv = Vec() * setref(&retv.vec, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":122 * # -- Vec -- * * cdef api object PyPetscVec_New(PetscVec arg): # <<<<<<<<<<<<<< * cdef Vec retv = Vec() * setref(&retv.vec, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscVec_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":127 * return retv * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscVec retv = NULL * cdef Vec ob = arg */ static Vec __pyx_f_8petsc4py_5PETSc_PyPetscVec_Get(PyObject *__pyx_v_arg) { Vec __pyx_v_retv; struct PyPetscVecObject *__pyx_v_ob = 0; Vec __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Vec __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscVec_Get", 0); /* "PETSc/CAPI.pyx":128 * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: * cdef PetscVec retv = NULL # <<<<<<<<<<<<<< * cdef Vec ob = arg * retv = ob.vec */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":129 * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: * cdef PetscVec retv = NULL * cdef Vec ob = arg # <<<<<<<<<<<<<< * retv = ob.vec * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(55, 129, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":130 * cdef PetscVec retv = NULL * cdef Vec ob = arg * retv = ob.vec # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->vec; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":131 * cdef Vec ob = arg * retv = ob.vec * return retv # <<<<<<<<<<<<<< * * # -- Scatter -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":127 * return retv * * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscVec retv = NULL * cdef Vec ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscVec_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":135 * # -- Scatter -- * * cdef api object PyPetscScatter_New(PetscScatter arg): # <<<<<<<<<<<<<< * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New(VecScatter __pyx_v_arg) { struct PyPetscScatterObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscScatter_New", 0); /* "PETSc/CAPI.pyx":136 * * cdef api object PyPetscScatter_New(PetscScatter arg): * cdef Scatter retv = Scatter() # <<<<<<<<<<<<<< * setref(&retv.sct, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":137 * cdef api object PyPetscScatter_New(PetscScatter arg): * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sct), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 137, __pyx_L1_error) /* "PETSc/CAPI.pyx":138 * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":135 * # -- Scatter -- * * cdef api object PyPetscScatter_New(PetscScatter arg): # <<<<<<<<<<<<<< * cdef Scatter retv = Scatter() * setref(&retv.sct, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscScatter_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":140 * return retv * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscScatter retv = NULL * cdef Scatter ob = arg */ static VecScatter __pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get(PyObject *__pyx_v_arg) { VecScatter __pyx_v_retv; struct PyPetscScatterObject *__pyx_v_ob = 0; VecScatter __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; VecScatter __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscScatter_Get", 0); /* "PETSc/CAPI.pyx":141 * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: * cdef PetscScatter retv = NULL # <<<<<<<<<<<<<< * cdef Scatter ob = arg * retv = ob.sct */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":142 * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: * cdef PetscScatter retv = NULL * cdef Scatter ob = arg # <<<<<<<<<<<<<< * retv = ob.sct * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(55, 142, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscScatterObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":143 * cdef PetscScatter retv = NULL * cdef Scatter ob = arg * retv = ob.sct # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->sct; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":144 * cdef Scatter ob = arg * retv = ob.sct * return retv # <<<<<<<<<<<<<< * * # -- Section -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":140 * return retv * * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscScatter retv = NULL * cdef Scatter ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscScatter_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":148 * # -- Section -- * * cdef api object PyPetscSection_New(PetscSection arg): # <<<<<<<<<<<<<< * cdef Section retv = Section() * setref(&retv.sec, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSection_New(PetscSection __pyx_v_arg) { struct PyPetscSectionObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSection_New", 0); /* "PETSc/CAPI.pyx":149 * * cdef api object PyPetscSection_New(PetscSection arg): * cdef Section retv = Section() # <<<<<<<<<<<<<< * setref(&retv.sec, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Section)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":150 * cdef api object PyPetscSection_New(PetscSection arg): * cdef Section retv = Section() * setref(&retv.sec, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sec), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 150, __pyx_L1_error) /* "PETSc/CAPI.pyx":151 * cdef Section retv = Section() * setref(&retv.sec, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":148 * # -- Section -- * * cdef api object PyPetscSection_New(PetscSection arg): # <<<<<<<<<<<<<< * cdef Section retv = Section() * setref(&retv.sec, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSection_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":153 * return retv * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSection retv = NULL * cdef Section ob = arg */ static PetscSection __pyx_f_8petsc4py_5PETSc_PyPetscSection_Get(PyObject *__pyx_v_arg) { PetscSection __pyx_v_retv; struct PyPetscSectionObject *__pyx_v_ob = 0; PetscSection __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscSection __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSection_Get", 0); /* "PETSc/CAPI.pyx":154 * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: * cdef PetscSection retv = NULL # <<<<<<<<<<<<<< * cdef Section ob = arg * retv = ob.sec */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":155 * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: * cdef PetscSection retv = NULL * cdef Section ob = arg # <<<<<<<<<<<<<< * retv = ob.sec * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Section)))) __PYX_ERR(55, 155, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscSectionObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":156 * cdef PetscSection retv = NULL * cdef Section ob = arg * retv = ob.sec # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->sec; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":157 * cdef Section ob = arg * retv = ob.sec * return retv # <<<<<<<<<<<<<< * * # -- Mat -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":153 * return retv * * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSection retv = NULL * cdef Section ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSection_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":161 * # -- Mat -- * * cdef api object PyPetscMat_New(PetscMat arg): # <<<<<<<<<<<<<< * cdef Mat retv = Mat() * setref(&retv.mat, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscMat_New(Mat __pyx_v_arg) { struct PyPetscMatObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscMat_New", 0); /* "PETSc/CAPI.pyx":162 * * cdef api object PyPetscMat_New(PetscMat arg): * cdef Mat retv = Mat() # <<<<<<<<<<<<<< * setref(&retv.mat, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":163 * cdef api object PyPetscMat_New(PetscMat arg): * cdef Mat retv = Mat() * setref(&retv.mat, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->mat), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 163, __pyx_L1_error) /* "PETSc/CAPI.pyx":164 * cdef Mat retv = Mat() * setref(&retv.mat, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":161 * # -- Mat -- * * cdef api object PyPetscMat_New(PetscMat arg): # <<<<<<<<<<<<<< * cdef Mat retv = Mat() * setref(&retv.mat, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscMat_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":166 * return retv * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscMat retv = NULL * cdef Mat ob = arg */ static Mat __pyx_f_8petsc4py_5PETSc_PyPetscMat_Get(PyObject *__pyx_v_arg) { Mat __pyx_v_retv; struct PyPetscMatObject *__pyx_v_ob = 0; Mat __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Mat __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscMat_Get", 0); /* "PETSc/CAPI.pyx":167 * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: * cdef PetscMat retv = NULL # <<<<<<<<<<<<<< * cdef Mat ob = arg * retv = ob.mat */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":168 * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: * cdef PetscMat retv = NULL * cdef Mat ob = arg # <<<<<<<<<<<<<< * retv = ob.mat * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(55, 168, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":169 * cdef PetscMat retv = NULL * cdef Mat ob = arg * retv = ob.mat # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->mat; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":170 * cdef Mat ob = arg * retv = ob.mat * return retv # <<<<<<<<<<<<<< * * # -- PC -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":166 * return retv * * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscMat retv = NULL * cdef Mat ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscMat_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":174 * # -- PC -- * * cdef api object PyPetscPC_New(PetscPC arg): # <<<<<<<<<<<<<< * cdef PC retv = PC() * setref(&retv.pc, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPC_New(PC __pyx_v_arg) { struct PyPetscPCObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPC_New", 0); /* "PETSc/CAPI.pyx":175 * * cdef api object PyPetscPC_New(PetscPC arg): * cdef PC retv = PC() # <<<<<<<<<<<<<< * setref(&retv.pc, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":176 * cdef api object PyPetscPC_New(PetscPC arg): * cdef PC retv = PC() * setref(&retv.pc, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->pc), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 176, __pyx_L1_error) /* "PETSc/CAPI.pyx":177 * cdef PC retv = PC() * setref(&retv.pc, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":174 * # -- PC -- * * cdef api object PyPetscPC_New(PetscPC arg): # <<<<<<<<<<<<<< * cdef PC retv = PC() * setref(&retv.pc, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPC_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":179 * return retv * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPC retv = NULL * cdef PC ob = arg */ static PC __pyx_f_8petsc4py_5PETSc_PyPetscPC_Get(PyObject *__pyx_v_arg) { PC __pyx_v_retv; struct PyPetscPCObject *__pyx_v_ob = 0; PC __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PC __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPC_Get", 0); /* "PETSc/CAPI.pyx":180 * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: * cdef PetscPC retv = NULL # <<<<<<<<<<<<<< * cdef PC ob = arg * retv = ob.pc */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":181 * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: * cdef PetscPC retv = NULL * cdef PC ob = arg # <<<<<<<<<<<<<< * retv = ob.pc * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_PC)))) __PYX_ERR(55, 181, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":182 * cdef PetscPC retv = NULL * cdef PC ob = arg * retv = ob.pc # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->pc; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":183 * cdef PC ob = arg * retv = ob.pc * return retv # <<<<<<<<<<<<<< * * # -- KSP -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":179 * return retv * * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPC retv = NULL * cdef PC ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPC_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":187 * # -- KSP -- * * cdef api object PyPetscKSP_New(PetscKSP arg): # <<<<<<<<<<<<<< * cdef KSP retv = KSP() * setref(&retv.ksp, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New(KSP __pyx_v_arg) { struct PyPetscKSPObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscKSP_New", 0); /* "PETSc/CAPI.pyx":188 * * cdef api object PyPetscKSP_New(PetscKSP arg): * cdef KSP retv = KSP() # <<<<<<<<<<<<<< * setref(&retv.ksp, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":189 * cdef api object PyPetscKSP_New(PetscKSP arg): * cdef KSP retv = KSP() * setref(&retv.ksp, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ksp), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 189, __pyx_L1_error) /* "PETSc/CAPI.pyx":190 * cdef KSP retv = KSP() * setref(&retv.ksp, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":187 * # -- KSP -- * * cdef api object PyPetscKSP_New(PetscKSP arg): # <<<<<<<<<<<<<< * cdef KSP retv = KSP() * setref(&retv.ksp, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscKSP_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":192 * return retv * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscKSP retv = NULL * cdef KSP ob = arg */ static KSP __pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get(PyObject *__pyx_v_arg) { KSP __pyx_v_retv; struct PyPetscKSPObject *__pyx_v_ob = 0; KSP __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; KSP __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscKSP_Get", 0); /* "PETSc/CAPI.pyx":193 * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: * cdef PetscKSP retv = NULL # <<<<<<<<<<<<<< * cdef KSP ob = arg * retv = ob.ksp */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":194 * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: * cdef PetscKSP retv = NULL * cdef KSP ob = arg # <<<<<<<<<<<<<< * retv = ob.ksp * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_KSP)))) __PYX_ERR(55, 194, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":195 * cdef PetscKSP retv = NULL * cdef KSP ob = arg * retv = ob.ksp # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ksp; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":196 * cdef KSP ob = arg * retv = ob.ksp * return retv # <<<<<<<<<<<<<< * * # -- SNES -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":192 * return retv * * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscKSP retv = NULL * cdef KSP ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscKSP_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":200 * # -- SNES -- * * cdef api object PyPetscSNES_New(PetscSNES arg): # <<<<<<<<<<<<<< * cdef SNES retv = SNES() * setref(&retv.snes, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New(SNES __pyx_v_arg) { struct PyPetscSNESObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSNES_New", 0); /* "PETSc/CAPI.pyx":201 * * cdef api object PyPetscSNES_New(PetscSNES arg): * cdef SNES retv = SNES() # <<<<<<<<<<<<<< * setref(&retv.snes, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":202 * cdef api object PyPetscSNES_New(PetscSNES arg): * cdef SNES retv = SNES() * setref(&retv.snes, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->snes), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 202, __pyx_L1_error) /* "PETSc/CAPI.pyx":203 * cdef SNES retv = SNES() * setref(&retv.snes, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":200 * # -- SNES -- * * cdef api object PyPetscSNES_New(PetscSNES arg): # <<<<<<<<<<<<<< * cdef SNES retv = SNES() * setref(&retv.snes, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSNES_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":205 * return retv * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSNES retv = NULL * cdef SNES ob = arg */ static SNES __pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get(PyObject *__pyx_v_arg) { SNES __pyx_v_retv; struct PyPetscSNESObject *__pyx_v_ob = 0; SNES __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; SNES __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscSNES_Get", 0); /* "PETSc/CAPI.pyx":206 * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: * cdef PetscSNES retv = NULL # <<<<<<<<<<<<<< * cdef SNES ob = arg * retv = ob.snes */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":207 * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: * cdef PetscSNES retv = NULL * cdef SNES ob = arg # <<<<<<<<<<<<<< * retv = ob.snes * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_SNES)))) __PYX_ERR(55, 207, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":208 * cdef PetscSNES retv = NULL * cdef SNES ob = arg * retv = ob.snes # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->snes; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":209 * cdef SNES ob = arg * retv = ob.snes * return retv # <<<<<<<<<<<<<< * * # -- TS -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":205 * return retv * * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscSNES retv = NULL * cdef SNES ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSNES_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":213 * # -- TS -- * * cdef api object PyPetscTS_New(PetscTS arg): # <<<<<<<<<<<<<< * cdef TS retv = TS() * setref(&retv.ts, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTS_New(TS __pyx_v_arg) { struct PyPetscTSObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTS_New", 0); /* "PETSc/CAPI.pyx":214 * * cdef api object PyPetscTS_New(PetscTS arg): * cdef TS retv = TS() # <<<<<<<<<<<<<< * setref(&retv.ts, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":215 * cdef api object PyPetscTS_New(PetscTS arg): * cdef TS retv = TS() * setref(&retv.ts, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ts), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 215, __pyx_L1_error) /* "PETSc/CAPI.pyx":216 * cdef TS retv = TS() * setref(&retv.ts, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":213 * # -- TS -- * * cdef api object PyPetscTS_New(PetscTS arg): # <<<<<<<<<<<<<< * cdef TS retv = TS() * setref(&retv.ts, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTS_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":218 * return retv * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTS retv = NULL * cdef TS ob = arg */ static TS __pyx_f_8petsc4py_5PETSc_PyPetscTS_Get(PyObject *__pyx_v_arg) { TS __pyx_v_retv; struct PyPetscTSObject *__pyx_v_ob = 0; TS __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; TS __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTS_Get", 0); /* "PETSc/CAPI.pyx":219 * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: * cdef PetscTS retv = NULL # <<<<<<<<<<<<<< * cdef TS ob = arg * retv = ob.ts */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":220 * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: * cdef PetscTS retv = NULL * cdef TS ob = arg # <<<<<<<<<<<<<< * retv = ob.ts * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_TS)))) __PYX_ERR(55, 220, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":221 * cdef PetscTS retv = NULL * cdef TS ob = arg * retv = ob.ts # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ts; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":222 * cdef TS ob = arg * retv = ob.ts * return retv # <<<<<<<<<<<<<< * * # -- TAO -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":218 * return retv * * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTS retv = NULL * cdef TS ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTS_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":226 * # -- TAO -- * * cdef api object PyPetscTAO_New(PetscTAO arg): # <<<<<<<<<<<<<< * cdef TAO retv = TAO() * setref(&retv.tao, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New(Tao __pyx_v_arg) { struct PyPetscTAOObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTAO_New", 0); /* "PETSc/CAPI.pyx":227 * * cdef api object PyPetscTAO_New(PetscTAO arg): * cdef TAO retv = TAO() # <<<<<<<<<<<<<< * setref(&retv.tao, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":228 * cdef api object PyPetscTAO_New(PetscTAO arg): * cdef TAO retv = TAO() * setref(&retv.tao, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->tao), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 228, __pyx_L1_error) /* "PETSc/CAPI.pyx":229 * cdef TAO retv = TAO() * setref(&retv.tao, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":226 * # -- TAO -- * * cdef api object PyPetscTAO_New(PetscTAO arg): # <<<<<<<<<<<<<< * cdef TAO retv = TAO() * setref(&retv.tao, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAO_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":231 * return retv * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTAO retv = NULL * cdef TAO ob = arg */ static Tao __pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get(PyObject *__pyx_v_arg) { Tao __pyx_v_retv; struct PyPetscTAOObject *__pyx_v_ob = 0; Tao __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Tao __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscTAO_Get", 0); /* "PETSc/CAPI.pyx":232 * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: * cdef PetscTAO retv = NULL # <<<<<<<<<<<<<< * cdef TAO ob = arg * retv = ob.tao */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":233 * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: * cdef PetscTAO retv = NULL * cdef TAO ob = arg # <<<<<<<<<<<<<< * retv = ob.tao * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_TAO)))) __PYX_ERR(55, 233, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscTAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":234 * cdef PetscTAO retv = NULL * cdef TAO ob = arg * retv = ob.tao # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->tao; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":235 * cdef TAO ob = arg * retv = ob.tao * return retv # <<<<<<<<<<<<<< * * # -- AO -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":231 * return retv * * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscTAO retv = NULL * cdef TAO ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAO_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":239 * # -- AO -- * * cdef api object PyPetscAO_New(PetscAO arg): # <<<<<<<<<<<<<< * cdef AO retv = AO() * setref(&retv.ao, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscAO_New(AO __pyx_v_arg) { struct PyPetscAOObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscAO_New", 0); /* "PETSc/CAPI.pyx":240 * * cdef api object PyPetscAO_New(PetscAO arg): * cdef AO retv = AO() # <<<<<<<<<<<<<< * setref(&retv.ao, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_AO)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":241 * cdef api object PyPetscAO_New(PetscAO arg): * cdef AO retv = AO() * setref(&retv.ao, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ao), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 241, __pyx_L1_error) /* "PETSc/CAPI.pyx":242 * cdef AO retv = AO() * setref(&retv.ao, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":239 * # -- AO -- * * cdef api object PyPetscAO_New(PetscAO arg): # <<<<<<<<<<<<<< * cdef AO retv = AO() * setref(&retv.ao, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscAO_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":244 * return retv * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscAO retv = NULL * cdef AO ob = arg */ static AO __pyx_f_8petsc4py_5PETSc_PyPetscAO_Get(PyObject *__pyx_v_arg) { AO __pyx_v_retv; struct PyPetscAOObject *__pyx_v_ob = 0; AO __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; AO __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscAO_Get", 0); /* "PETSc/CAPI.pyx":245 * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: * cdef PetscAO retv = NULL # <<<<<<<<<<<<<< * cdef AO ob = arg * retv = ob.ao */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":246 * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: * cdef PetscAO retv = NULL * cdef AO ob = arg # <<<<<<<<<<<<<< * retv = ob.ao * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_AO)))) __PYX_ERR(55, 246, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscAOObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":247 * cdef PetscAO retv = NULL * cdef AO ob = arg * retv = ob.ao # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ao; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":248 * cdef AO ob = arg * retv = ob.ao * return retv # <<<<<<<<<<<<<< * * # -- DM -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":244 * return retv * * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscAO retv = NULL * cdef AO ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscAO_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":252 * # -- DM -- * * cdef api object PyPetscDM_New(PetscDM arg): # <<<<<<<<<<<<<< * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDM_New(DM __pyx_v_arg) { struct PyPetscDMObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDM_New", 0); /* "PETSc/CAPI.pyx":253 * * cdef api object PyPetscDM_New(PetscDM arg): * cdef DM retv = subtype_DM(arg)() # <<<<<<<<<<<<<< * setref(&retv.dm, arg) * return retv */ __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_arg)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(55, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(55, 253, __pyx_L1_error) __pyx_v_retv = ((struct PyPetscDMObject *)__pyx_t_2); __pyx_t_2 = 0; /* "PETSc/CAPI.pyx":254 * cdef api object PyPetscDM_New(PetscDM arg): * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dm), __pyx_v_arg); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(55, 254, __pyx_L1_error) /* "PETSc/CAPI.pyx":255 * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":252 * # -- DM -- * * cdef api object PyPetscDM_New(PetscDM arg): # <<<<<<<<<<<<<< * cdef DM retv = subtype_DM(arg)() * setref(&retv.dm, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDM_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":257 * return retv * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDM retv = NULL * cdef DM ob = arg */ static DM __pyx_f_8petsc4py_5PETSc_PyPetscDM_Get(PyObject *__pyx_v_arg) { DM __pyx_v_retv; struct PyPetscDMObject *__pyx_v_ob = 0; DM __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; DM __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDM_Get", 0); /* "PETSc/CAPI.pyx":258 * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: * cdef PetscDM retv = NULL # <<<<<<<<<<<<<< * cdef DM ob = arg * retv = ob.dm */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":259 * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: * cdef PetscDM retv = NULL * cdef DM ob = arg # <<<<<<<<<<<<<< * retv = ob.dm * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(55, 259, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscDMObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":260 * cdef PetscDM retv = NULL * cdef DM ob = arg * retv = ob.dm # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->dm; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":261 * cdef DM ob = arg * retv = ob.dm * return retv # <<<<<<<<<<<<<< * * # -- DS -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":257 * return retv * * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDM retv = NULL * cdef DM ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDM_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":265 * # -- DS -- * * cdef api object PyPetscDS_New(PetscDS arg): # <<<<<<<<<<<<<< * cdef DS retv = DS() * setref(&retv.ds, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDS_New(PetscDS __pyx_v_arg) { struct PyPetscDSObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDS_New", 0); /* "PETSc/CAPI.pyx":266 * * cdef api object PyPetscDS_New(PetscDS arg): * cdef DS retv = DS() # <<<<<<<<<<<<<< * setref(&retv.ds, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DS)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscDSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":267 * cdef api object PyPetscDS_New(PetscDS arg): * cdef DS retv = DS() * setref(&retv.ds, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ds), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 267, __pyx_L1_error) /* "PETSc/CAPI.pyx":268 * cdef DS retv = DS() * setref(&retv.ds, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":265 * # -- DS -- * * cdef api object PyPetscDS_New(PetscDS arg): # <<<<<<<<<<<<<< * cdef DS retv = DS() * setref(&retv.ds, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDS_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":270 * return retv * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDS retv = NULL * cdef DS ob = arg */ static PetscDS __pyx_f_8petsc4py_5PETSc_PyPetscDS_Get(PyObject *__pyx_v_arg) { PetscDS __pyx_v_retv; struct PyPetscDSObject *__pyx_v_ob = 0; PetscDS __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscDS __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDS_Get", 0); /* "PETSc/CAPI.pyx":271 * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: * cdef PetscDS retv = NULL # <<<<<<<<<<<<<< * cdef DS ob = arg * retv = ob.ds */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":272 * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: * cdef PetscDS retv = NULL * cdef DS ob = arg # <<<<<<<<<<<<<< * retv = ob.ds * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DS)))) __PYX_ERR(55, 272, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscDSObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":273 * cdef PetscDS retv = NULL * cdef DS ob = arg * retv = ob.ds # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->ds; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":274 * cdef DS ob = arg * retv = ob.ds * return retv # <<<<<<<<<<<<<< * * # -- Partitioner -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":270 * return retv * * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDS retv = NULL * cdef DS ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDS_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":278 * # -- Partitioner -- * * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): # <<<<<<<<<<<<<< * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New(PetscPartitioner __pyx_v_arg) { struct PyPetscPartitionerObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPartitioner_New", 0); /* "PETSc/CAPI.pyx":279 * * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): * cdef Partitioner retv = Partitioner() # <<<<<<<<<<<<<< * setref(&retv.part, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Partitioner)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscPartitionerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":280 * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->part), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 280, __pyx_L1_error) /* "PETSc/CAPI.pyx":281 * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":278 * # -- Partitioner -- * * cdef api object PyPetscPartitioner_New(PetscPartitioner arg): # <<<<<<<<<<<<<< * cdef Partitioner retv = Partitioner() * setref(&retv.part, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPartitioner_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":283 * return retv * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg */ static PetscPartitioner __pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get(PyObject *__pyx_v_arg) { PetscPartitioner __pyx_v_retv; struct PyPetscPartitionerObject *__pyx_v_ob = 0; PetscPartitioner __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscPartitioner __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscPartitioner_Get", 0); /* "PETSc/CAPI.pyx":284 * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: * cdef PetscPartitioner retv = NULL # <<<<<<<<<<<<<< * cdef Partitioner ob = arg * retv = ob.part */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":285 * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg # <<<<<<<<<<<<<< * retv = ob.part * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Partitioner)))) __PYX_ERR(55, 285, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscPartitionerObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":286 * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg * retv = ob.part # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->part; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":287 * cdef Partitioner ob = arg * retv = ob.part * return retv # <<<<<<<<<<<<<< * * # -- FE -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":283 * return retv * * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscPartitioner retv = NULL * cdef Partitioner ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscPartitioner_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":291 * # -- FE -- * * cdef api object PyPetscFE_New(PetscFE arg): # <<<<<<<<<<<<<< * cdef FE retv = FE() * setref(&retv.fe, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscFE_New(PetscFE __pyx_v_arg) { struct PyPetscFEObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscFE_New", 0); /* "PETSc/CAPI.pyx":292 * * cdef api object PyPetscFE_New(PetscFE arg): * cdef FE retv = FE() # <<<<<<<<<<<<<< * setref(&retv.fe, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_FE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscFEObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":293 * cdef api object PyPetscFE_New(PetscFE arg): * cdef FE retv = FE() * setref(&retv.fe, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->fe), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 293, __pyx_L1_error) /* "PETSc/CAPI.pyx":294 * cdef FE retv = FE() * setref(&retv.fe, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":291 * # -- FE -- * * cdef api object PyPetscFE_New(PetscFE arg): # <<<<<<<<<<<<<< * cdef FE retv = FE() * setref(&retv.fe, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscFE_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":296 * return retv * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscFE retv = NULL * cdef FE ob = arg */ static PetscFE __pyx_f_8petsc4py_5PETSc_PyPetscFE_Get(PyObject *__pyx_v_arg) { PetscFE __pyx_v_retv; struct PyPetscFEObject *__pyx_v_ob = 0; PetscFE __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscFE __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscFE_Get", 0); /* "PETSc/CAPI.pyx":297 * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: * cdef PetscFE retv = NULL # <<<<<<<<<<<<<< * cdef FE ob = arg * retv = ob.fe */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":298 * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: * cdef PetscFE retv = NULL * cdef FE ob = arg # <<<<<<<<<<<<<< * retv = ob.fe * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_FE)))) __PYX_ERR(55, 298, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscFEObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":299 * cdef PetscFE retv = NULL * cdef FE ob = arg * retv = ob.fe # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->fe; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":300 * cdef FE ob = arg * retv = ob.fe * return retv # <<<<<<<<<<<<<< * * # -- QUAD -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":296 * return retv * * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscFE retv = NULL * cdef FE ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscFE_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":304 * # -- QUAD -- * * cdef api object PyPetscQuad_New(PetscQuadrature arg): # <<<<<<<<<<<<<< * cdef Quad retv = Quad() * setref(&retv.quad, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New(PetscQuadrature __pyx_v_arg) { struct PyPetscQuadObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscQuad_New", 0); /* "PETSc/CAPI.pyx":305 * * cdef api object PyPetscQuad_New(PetscQuadrature arg): * cdef Quad retv = Quad() # <<<<<<<<<<<<<< * setref(&retv.quad, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Quad)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":306 * cdef api object PyPetscQuad_New(PetscQuadrature arg): * cdef Quad retv = Quad() * setref(&retv.quad, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->quad), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 306, __pyx_L1_error) /* "PETSc/CAPI.pyx":307 * cdef Quad retv = Quad() * setref(&retv.quad, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":304 * # -- QUAD -- * * cdef api object PyPetscQuad_New(PetscQuadrature arg): # <<<<<<<<<<<<<< * cdef Quad retv = Quad() * setref(&retv.quad, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscQuad_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":309 * return retv * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg */ static PetscQuadrature __pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get(PyObject *__pyx_v_arg) { PetscQuadrature __pyx_v_retv; struct PyPetscQuadObject *__pyx_v_ob = 0; PetscQuadrature __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PetscQuadrature __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscQuad_Get", 0); /* "PETSc/CAPI.pyx":310 * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: * cdef PetscQuadrature retv = NULL # <<<<<<<<<<<<<< * cdef Quad ob = arg * retv = ob.quad */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":311 * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg # <<<<<<<<<<<<<< * retv = ob.quad * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_Quad)))) __PYX_ERR(55, 311, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscQuadObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":312 * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg * retv = ob.quad # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->quad; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":313 * cdef Quad ob = arg * retv = ob.quad * return retv # <<<<<<<<<<<<<< * * # -- DMLabel -- */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":309 * return retv * * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscQuadrature retv = NULL * cdef Quad ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscQuad_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":317 * # -- DMLabel -- * * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): # <<<<<<<<<<<<<< * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) */ static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New(DMLabel __pyx_v_arg) { struct PyPetscDMLabelObject *__pyx_v_retv = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDMLabel_New", 0); /* "PETSc/CAPI.pyx":318 * * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): * cdef DMLabel retv = DMLabel() # <<<<<<<<<<<<<< * setref(&retv.dmlabel, arg) * return retv */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMLabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_retv = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":319 * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dmlabel), __pyx_v_arg); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(55, 319, __pyx_L1_error) /* "PETSc/CAPI.pyx":320 * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) * return retv # <<<<<<<<<<<<<< * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_retv)); __pyx_r = ((PyObject *)__pyx_v_retv); goto __pyx_L0; /* "PETSc/CAPI.pyx":317 * # -- DMLabel -- * * cdef api object PyPetscDMLabel_New(PetscDMLabel arg): # <<<<<<<<<<<<<< * cdef DMLabel retv = DMLabel() * setref(&retv.dmlabel, arg) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDMLabel_New", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_retv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/CAPI.pyx":322 * return retv * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg */ static DMLabel __pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get(PyObject *__pyx_v_arg) { DMLabel __pyx_v_retv; struct PyPetscDMLabelObject *__pyx_v_ob = 0; DMLabel __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; DMLabel __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("PyPetscDMLabel_Get", 0); /* "PETSc/CAPI.pyx":323 * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: * cdef PetscDMLabel retv = NULL # <<<<<<<<<<<<<< * cdef DMLabel ob = arg * retv = ob.dmlabel */ __pyx_v_retv = NULL; /* "PETSc/CAPI.pyx":324 * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg # <<<<<<<<<<<<<< * retv = ob.dmlabel * return retv */ if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_ptype_8petsc4py_5PETSc_DMLabel)))) __PYX_ERR(55, 324, __pyx_L1_error) __pyx_t_1 = __pyx_v_arg; __Pyx_INCREF(__pyx_t_1); __pyx_v_ob = ((struct PyPetscDMLabelObject *)__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/CAPI.pyx":325 * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg * retv = ob.dmlabel # <<<<<<<<<<<<<< * return retv * */ __pyx_t_2 = __pyx_v_ob->dmlabel; __pyx_v_retv = __pyx_t_2; /* "PETSc/CAPI.pyx":326 * cdef DMLabel ob = arg * retv = ob.dmlabel * return retv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_retv; goto __pyx_L0; /* "PETSc/CAPI.pyx":322 * return retv * * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL: # <<<<<<<<<<<<<< * cdef PetscDMLabel retv = NULL * cdef DMLabel ob = arg */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDMLabel_Get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ob); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":203 * cdef object tracebacklist = [] * * cdef int traceback(MPI_Comm comm, # <<<<<<<<<<<<<< * int line, * const char *cfun, */ static int __pyx_f_8petsc4py_5PETSc_traceback(MPI_Comm __pyx_v_comm, int __pyx_v_line, char const *__pyx_v_cfun, char const *__pyx_v_cfile, int __pyx_v_n, PetscErrorType __pyx_v_p, char const *__pyx_v_mess, void *__pyx_v_ctx) { PetscLogDouble __pyx_v_mem; PetscLogDouble __pyx_v_rss; char const *__pyx_v_text; PyObject *__pyx_v_tbl = 0; PyObject *__pyx_v_fun = NULL; PyObject *__pyx_v_fnm = NULL; PyObject *__pyx_v_m = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("traceback", 0); /* "PETSc/PETSc.pyx":211 * const char *mess, * void *ctx) with gil: * cdef PetscLogDouble mem=0 # <<<<<<<<<<<<<< * cdef PetscLogDouble rss=0 * cdef const char *text=NULL */ __pyx_v_mem = 0.0; /* "PETSc/PETSc.pyx":212 * void *ctx) with gil: * cdef PetscLogDouble mem=0 * cdef PetscLogDouble rss=0 # <<<<<<<<<<<<<< * cdef const char *text=NULL * global tracebacklist */ __pyx_v_rss = 0.0; /* "PETSc/PETSc.pyx":213 * cdef PetscLogDouble mem=0 * cdef PetscLogDouble rss=0 * cdef const char *text=NULL # <<<<<<<<<<<<<< * global tracebacklist * cdef object tbl = tracebacklist */ __pyx_v_text = NULL; /* "PETSc/PETSc.pyx":215 * cdef const char *text=NULL * global tracebacklist * cdef object tbl = tracebacklist # <<<<<<<<<<<<<< * fun = bytes2str(cfun) * fnm = bytes2str(cfile) */ __Pyx_INCREF(__pyx_v_8petsc4py_5PETSc_tracebacklist); __pyx_v_tbl = __pyx_v_8petsc4py_5PETSc_tracebacklist; /* "PETSc/PETSc.pyx":216 * global tracebacklist * cdef object tbl = tracebacklist * fun = bytes2str(cfun) # <<<<<<<<<<<<<< * fnm = bytes2str(cfile) * m = "%s() line %d in %s" % (fun, line, fnm) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cfun); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fun = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":217 * cdef object tbl = tracebacklist * fun = bytes2str(cfun) * fnm = bytes2str(cfile) # <<<<<<<<<<<<<< * m = "%s() line %d in %s" % (fun, line, fnm) * tbl.insert(0, m) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fnm = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":218 * fun = bytes2str(cfun) * fnm = bytes2str(cfile) * m = "%s() line %d in %s" % (fun, line, fnm) # <<<<<<<<<<<<<< * tbl.insert(0, m) * if p != PETSC_ERROR_INITIAL: */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_fun); __Pyx_GIVEREF(__pyx_v_fun); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fun); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_fnm); __Pyx_GIVEREF(__pyx_v_fnm); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_fnm); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_line_d_in_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_m = __pyx_t_1; __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":219 * fnm = bytes2str(cfile) * m = "%s() line %d in %s" % (fun, line, fnm) * tbl.insert(0, m) # <<<<<<<<<<<<<< * if p != PETSC_ERROR_INITIAL: * return n */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tbl, __pyx_n_s_insert); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_0, __pyx_v_m}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 219, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_0, __pyx_v_m}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 219, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_int_0); __Pyx_INCREF(__pyx_v_m); __Pyx_GIVEREF(__pyx_v_m); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_m); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":220 * m = "%s() line %d in %s" % (fun, line, fnm) * tbl.insert(0, m) * if p != PETSC_ERROR_INITIAL: # <<<<<<<<<<<<<< * return n * # */ __pyx_t_6 = ((__pyx_v_p != PETSC_ERROR_INITIAL) != 0); if (__pyx_t_6) { /* "PETSc/PETSc.pyx":221 * tbl.insert(0, m) * if p != PETSC_ERROR_INITIAL: * return n # <<<<<<<<<<<<<< * # * del tbl[1:] # clear any previous stuff */ __pyx_r = __pyx_v_n; goto __pyx_L0; /* "PETSc/PETSc.pyx":220 * m = "%s() line %d in %s" % (fun, line, fnm) * tbl.insert(0, m) * if p != PETSC_ERROR_INITIAL: # <<<<<<<<<<<<<< * return n * # */ } /* "PETSc/PETSc.pyx":223 * return n * # * del tbl[1:] # clear any previous stuff # <<<<<<<<<<<<<< * if n == PETSC_ERR_MEM: # special case * PetscMallocGetCurrentUsage(&mem) */ if (__Pyx_PyObject_DelSlice(__pyx_v_tbl, 1, 0, NULL, NULL, &__pyx_slice__6, 1, 0, 1) < 0) __PYX_ERR(11, 223, __pyx_L1_error) /* "PETSc/PETSc.pyx":224 * # * del tbl[1:] # clear any previous stuff * if n == PETSC_ERR_MEM: # special case # <<<<<<<<<<<<<< * PetscMallocGetCurrentUsage(&mem) * PetscMemoryGetCurrentUsage(&rss) */ __pyx_t_6 = ((__pyx_v_n == PETSC_ERR_MEM) != 0); if (__pyx_t_6) { /* "PETSc/PETSc.pyx":225 * del tbl[1:] # clear any previous stuff * if n == PETSC_ERR_MEM: # special case * PetscMallocGetCurrentUsage(&mem) # <<<<<<<<<<<<<< * PetscMemoryGetCurrentUsage(&rss) * m = ("Out of memory. " */ (void)(PetscMallocGetCurrentUsage((&__pyx_v_mem))); /* "PETSc/PETSc.pyx":226 * if n == PETSC_ERR_MEM: # special case * PetscMallocGetCurrentUsage(&mem) * PetscMemoryGetCurrentUsage(&rss) # <<<<<<<<<<<<<< * m = ("Out of memory. " * "Allocated: %d, " */ (void)(PetscMemoryGetCurrentUsage((&__pyx_v_rss))); /* "PETSc/PETSc.pyx":229 * m = ("Out of memory. " * "Allocated: %d, " * "Used by process: %d") % (mem, rss) # <<<<<<<<<<<<<< * tbl.append(m) * else: */ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_mem); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyFloat_FromDouble(__pyx_v_rss); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_memory_Allocated_d_Used_b, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_2); __pyx_t_2 = 0; /* "PETSc/PETSc.pyx":230 * "Allocated: %d, " * "Used by process: %d") % (mem, rss) * tbl.append(m) # <<<<<<<<<<<<<< * else: * PetscErrorMessage(n, &text, NULL) */ __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_tbl, __pyx_v_m); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 230, __pyx_L1_error) /* "PETSc/PETSc.pyx":224 * # * del tbl[1:] # clear any previous stuff * if n == PETSC_ERR_MEM: # special case # <<<<<<<<<<<<<< * PetscMallocGetCurrentUsage(&mem) * PetscMemoryGetCurrentUsage(&rss) */ goto __pyx_L4; } /* "PETSc/PETSc.pyx":232 * tbl.append(m) * else: * PetscErrorMessage(n, &text, NULL) # <<<<<<<<<<<<<< * if text != NULL: tbl.append(bytes2str(text)) * if mess != NULL: tbl.append(bytes2str(mess)) */ /*else*/ { (void)(PetscErrorMessage(__pyx_v_n, (&__pyx_v_text), NULL)); } __pyx_L4:; /* "PETSc/PETSc.pyx":233 * else: * PetscErrorMessage(n, &text, NULL) * if text != NULL: tbl.append(bytes2str(text)) # <<<<<<<<<<<<<< * if mess != NULL: tbl.append(bytes2str(mess)) * comm; ctx; # unused */ __pyx_t_6 = ((__pyx_v_text != NULL) != 0); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_tbl, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/PETSc.pyx":234 * PetscErrorMessage(n, &text, NULL) * if text != NULL: tbl.append(bytes2str(text)) * if mess != NULL: tbl.append(bytes2str(mess)) # <<<<<<<<<<<<<< * comm; ctx; # unused * return n */ __pyx_t_6 = ((__pyx_v_mess != NULL) != 0); if (__pyx_t_6) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_mess); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_tbl, __pyx_t_2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(11, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "PETSc/PETSc.pyx":235 * if text != NULL: tbl.append(bytes2str(text)) * if mess != NULL: tbl.append(bytes2str(mess)) * comm; ctx; # unused # <<<<<<<<<<<<<< * return n * */ ((void)__pyx_v_comm); ((void)__pyx_v_ctx); /* "PETSc/PETSc.pyx":236 * if mess != NULL: tbl.append(bytes2str(mess)) * comm; ctx; # unused * return n # <<<<<<<<<<<<<< * * cdef int PetscPythonErrorHandler( */ __pyx_r = __pyx_v_n; goto __pyx_L0; /* "PETSc/PETSc.pyx":203 * cdef object tracebacklist = [] * * cdef int traceback(MPI_Comm comm, # <<<<<<<<<<<<<< * int line, * const char *cfun, */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_WriteUnraisable("petsc4py.PETSc.traceback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tbl); __Pyx_XDECREF(__pyx_v_fun); __Pyx_XDECREF(__pyx_v_fnm); __Pyx_XDECREF(__pyx_v_m); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "PETSc/PETSc.pyx":238 * return n * * cdef int PetscPythonErrorHandler( # <<<<<<<<<<<<<< * MPI_Comm comm, * int line, */ static int __pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler(MPI_Comm __pyx_v_comm, int __pyx_v_line, char const *__pyx_v_cfun, char const *__pyx_v_cfile, int __pyx_v_n, PetscErrorType __pyx_v_p, char const *__pyx_v_mess, void *__pyx_v_ctx) { int __pyx_r; int __pyx_t_1; int __pyx_t_2; /* "PETSc/PETSc.pyx":248 * void *ctx) nogil: * global tracebacklist * if Py_IsInitialized() and (tracebacklist) != NULL: # <<<<<<<<<<<<<< * return traceback(comm, line, cfun, cfile, n, p, mess, ctx) * else: */ __pyx_t_2 = (Py_IsInitialized() != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((((void *)__pyx_v_8petsc4py_5PETSc_tracebacklist) != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/PETSc.pyx":249 * global tracebacklist * if Py_IsInitialized() and (tracebacklist) != NULL: * return traceback(comm, line, cfun, cfile, n, p, mess, ctx) # <<<<<<<<<<<<<< * else: * return PetscTBEH(comm, line, cfun, cfile, n, p, mess, ctx) */ __pyx_r = __pyx_f_8petsc4py_5PETSc_traceback(__pyx_v_comm, __pyx_v_line, __pyx_v_cfun, __pyx_v_cfile, __pyx_v_n, __pyx_v_p, __pyx_v_mess, __pyx_v_ctx); goto __pyx_L0; /* "PETSc/PETSc.pyx":248 * void *ctx) nogil: * global tracebacklist * if Py_IsInitialized() and (tracebacklist) != NULL: # <<<<<<<<<<<<<< * return traceback(comm, line, cfun, cfile, n, p, mess, ctx) * else: */ } /* "PETSc/PETSc.pyx":251 * return traceback(comm, line, cfun, cfile, n, p, mess, ctx) * else: * return PetscTBEH(comm, line, cfun, cfile, n, p, mess, ctx) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ /*else*/ { __pyx_r = PetscTBEH(__pyx_v_comm, __pyx_v_line, __pyx_v_cfun, __pyx_v_cfile, __pyx_v_n, __pyx_v_p, __pyx_v_mess, __pyx_v_ctx); goto __pyx_L0; } /* "PETSc/PETSc.pyx":238 * return n * * cdef int PetscPythonErrorHandler( # <<<<<<<<<<<<<< * MPI_Comm comm, * int line, */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "PETSc/PETSc.pyx":284 * cdef char** PyPetsc_Argv = NULL * * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: # <<<<<<<<<<<<<< * # allocate command line arguments * cdef int i, c = 0 */ static int __pyx_f_8petsc4py_5PETSc_getinitargs(PyObject *__pyx_v_args, int *__pyx_v_argc, char ***__pyx_v_argv) { int __pyx_v_i; int __pyx_v_c; char **__pyx_v_v; PyObject *__pyx_9genexpr19__pyx_v_a = NULL; PyObject *__pyx_9genexpr20__pyx_v_a = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_t_13; char *__pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getinitargs", 0); __Pyx_INCREF(__pyx_v_args); /* "PETSc/PETSc.pyx":286 * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: * # allocate command line arguments * cdef int i, c = 0 # <<<<<<<<<<<<<< * cdef char **v = NULL * if args is None: args = [] */ __pyx_v_c = 0; /* "PETSc/PETSc.pyx":287 * # allocate command line arguments * cdef int i, c = 0 * cdef char **v = NULL # <<<<<<<<<<<<<< * if args is None: args = [] * args = [str(a).encode() for a in args] */ __pyx_v_v = NULL; /* "PETSc/PETSc.pyx":288 * cdef int i, c = 0 * cdef char **v = NULL * if args is None: args = [] # <<<<<<<<<<<<<< * args = [str(a).encode() for a in args] * args = [a for a in args if a] */ __pyx_t_1 = (__pyx_v_args == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); __pyx_t_3 = 0; } /* "PETSc/PETSc.pyx":289 * cdef char **v = NULL * if args is None: args = [] * args = [str(a).encode() for a in args] # <<<<<<<<<<<<<< * args = [a for a in args if a] * c = len(args) */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) { __pyx_t_4 = __pyx_v_args; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 289, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(11, 289, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(11, 289, __pyx_L6_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(11, 289, __pyx_L6_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_a, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_9genexpr19__pyx_v_a); if (unlikely(!__pyx_t_8)) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(11, 289, __pyx_L6_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_a); __pyx_9genexpr19__pyx_v_a = 0; goto __pyx_L9_exit_scope; __pyx_L6_error:; __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_a); __pyx_9genexpr19__pyx_v_a = 0; goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PETSc.pyx":290 * if args is None: args = [] * args = [str(a).encode() for a in args] * args = [a for a in args if a] # <<<<<<<<<<<<<< * c = len(args) * v = malloc((c+1)*sizeof(char*)) */ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 290, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) { __pyx_t_4 = __pyx_v_args; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(11, 290, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 290, __pyx_L12_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(11, 290, __pyx_L12_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 290, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(11, 290, __pyx_L12_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(11, 290, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(11, 290, __pyx_L12_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_a, __pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_9genexpr20__pyx_v_a); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(11, 290, __pyx_L12_error) if (__pyx_t_2) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr20__pyx_v_a))) __PYX_ERR(11, 290, __pyx_L12_error) } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_a); __pyx_9genexpr20__pyx_v_a = 0; goto __pyx_L16_exit_scope; __pyx_L12_error:; __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_a); __pyx_9genexpr20__pyx_v_a = 0; goto __pyx_L1_error; __pyx_L16_exit_scope:; } /* exit inner scope */ __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PETSc.pyx":291 * args = [str(a).encode() for a in args] * args = [a for a in args if a] * c = len(args) # <<<<<<<<<<<<<< * v = malloc((c+1)*sizeof(char*)) * if v == NULL: raise MemoryError */ __pyx_t_5 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(11, 291, __pyx_L1_error) __pyx_v_c = ((int)__pyx_t_5); /* "PETSc/PETSc.pyx":292 * args = [a for a in args if a] * c = len(args) * v = malloc((c+1)*sizeof(char*)) # <<<<<<<<<<<<<< * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) */ __pyx_v_v = ((char **)malloc((((size_t)(__pyx_v_c + 1)) * (sizeof(char *))))); /* "PETSc/PETSc.pyx":293 * c = len(args) * v = malloc((c+1)*sizeof(char*)) * if v == NULL: raise MemoryError # <<<<<<<<<<<<<< * memset(v, 0, (c+1)*sizeof(char*)) * try: */ __pyx_t_2 = ((__pyx_v_v == NULL) != 0); if (unlikely(__pyx_t_2)) { PyErr_NoMemory(); __PYX_ERR(11, 293, __pyx_L1_error) } /* "PETSc/PETSc.pyx":294 * v = malloc((c+1)*sizeof(char*)) * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) # <<<<<<<<<<<<<< * try: * for 0 <= i < c: */ (void)(memset(__pyx_v_v, 0, (((size_t)(__pyx_v_c + 1)) * (sizeof(char *))))); /* "PETSc/PETSc.pyx":295 * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) * try: # <<<<<<<<<<<<<< * for 0 <= i < c: * v[i] = strdup(args[i]) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); /*try:*/ { /* "PETSc/PETSc.pyx":296 * memset(v, 0, (c+1)*sizeof(char*)) * try: * for 0 <= i < c: # <<<<<<<<<<<<<< * v[i] = strdup(args[i]) * if v[i] == NULL: */ __pyx_t_13 = __pyx_v_c; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { /* "PETSc/PETSc.pyx":297 * try: * for 0 <= i < c: * v[i] = strdup(args[i]) # <<<<<<<<<<<<<< * if v[i] == NULL: * raise MemoryError */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 297, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = __Pyx_PyObject_AsWritableString(__pyx_t_3); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) __PYX_ERR(11, 297, __pyx_L18_error) (__pyx_v_v[__pyx_v_i]) = strdup(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PETSc.pyx":298 * for 0 <= i < c: * v[i] = strdup(args[i]) * if v[i] == NULL: # <<<<<<<<<<<<<< * raise MemoryError * except: */ __pyx_t_2 = (((__pyx_v_v[__pyx_v_i]) == NULL) != 0); if (unlikely(__pyx_t_2)) { /* "PETSc/PETSc.pyx":299 * v[i] = strdup(args[i]) * if v[i] == NULL: * raise MemoryError # <<<<<<<<<<<<<< * except: * delinitargs(&c, &v); raise */ PyErr_NoMemory(); __PYX_ERR(11, 299, __pyx_L18_error) /* "PETSc/PETSc.pyx":298 * for 0 <= i < c: * v[i] = strdup(args[i]) * if v[i] == NULL: # <<<<<<<<<<<<<< * raise MemoryError * except: */ } } /* "PETSc/PETSc.pyx":295 * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) * try: # <<<<<<<<<<<<<< * for 0 <= i < c: * v[i] = strdup(args[i]) */ } __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L23_try_end; __pyx_L18_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "PETSc/PETSc.pyx":300 * if v[i] == NULL: * raise MemoryError * except: # <<<<<<<<<<<<<< * delinitargs(&c, &v); raise * argc[0] = c; argv[0] = v */ /*except:*/ { __Pyx_AddTraceback("petsc4py.PETSc.getinitargs", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(11, 300, __pyx_L20_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); /* "PETSc/PETSc.pyx":301 * raise MemoryError * except: * delinitargs(&c, &v); raise # <<<<<<<<<<<<<< * argc[0] = c; argv[0] = v * return 0 */ __pyx_f_8petsc4py_5PETSc_delinitargs((&__pyx_v_c), (&__pyx_v_v)); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_7); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0; __PYX_ERR(11, 301, __pyx_L20_except_error) } __pyx_L20_except_error:; /* "PETSc/PETSc.pyx":295 * if v == NULL: raise MemoryError * memset(v, 0, (c+1)*sizeof(char*)) * try: # <<<<<<<<<<<<<< * for 0 <= i < c: * v[i] = strdup(args[i]) */ __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); goto __pyx_L1_error; __pyx_L23_try_end:; } /* "PETSc/PETSc.pyx":302 * except: * delinitargs(&c, &v); raise * argc[0] = c; argv[0] = v # <<<<<<<<<<<<<< * return 0 * */ (__pyx_v_argc[0]) = __pyx_v_c; (__pyx_v_argv[0]) = __pyx_v_v; /* "PETSc/PETSc.pyx":303 * delinitargs(&c, &v); raise * argc[0] = c; argv[0] = v * return 0 # <<<<<<<<<<<<<< * * cdef void delinitargs(int *argc, char **argv[]) nogil: */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":284 * cdef char** PyPetsc_Argv = NULL * * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: # <<<<<<<<<<<<<< * # allocate command line arguments * cdef int i, c = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("petsc4py.PETSc.getinitargs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_a); __Pyx_XDECREF(__pyx_9genexpr20__pyx_v_a); __Pyx_XDECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":305 * return 0 * * cdef void delinitargs(int *argc, char **argv[]) nogil: # <<<<<<<<<<<<<< * # dallocate command line arguments * cdef int i, c = argc[0] */ static void __pyx_f_8petsc4py_5PETSc_delinitargs(int *__pyx_v_argc, char ***__pyx_v_argv) { int __pyx_v_i; int __pyx_v_c; char **__pyx_v_v; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; /* "PETSc/PETSc.pyx":307 * cdef void delinitargs(int *argc, char **argv[]) nogil: * # dallocate command line arguments * cdef int i, c = argc[0] # <<<<<<<<<<<<<< * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; */ __pyx_v_c = (__pyx_v_argc[0]); /* "PETSc/PETSc.pyx":308 * # dallocate command line arguments * cdef int i, c = argc[0] * cdef char** v = argv[0] # <<<<<<<<<<<<<< * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: */ __pyx_v_v = (__pyx_v_argv[0]); /* "PETSc/PETSc.pyx":309 * cdef int i, c = argc[0] * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; # <<<<<<<<<<<<<< * if c >= 0 and v != NULL: * for 0 <= i < c: */ (__pyx_v_argc[0]) = 0; (__pyx_v_argv[0]) = NULL; /* "PETSc/PETSc.pyx":310 * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: # <<<<<<<<<<<<<< * for 0 <= i < c: * if v[i] != NULL: free(v[i]) */ __pyx_t_2 = ((__pyx_v_c >= 0) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = ((__pyx_v_v != NULL) != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "PETSc/PETSc.pyx":311 * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: * for 0 <= i < c: # <<<<<<<<<<<<<< * if v[i] != NULL: free(v[i]) * free(v) */ __pyx_t_3 = __pyx_v_c; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { /* "PETSc/PETSc.pyx":312 * if c >= 0 and v != NULL: * for 0 <= i < c: * if v[i] != NULL: free(v[i]) # <<<<<<<<<<<<<< * free(v) * */ __pyx_t_1 = (((__pyx_v_v[__pyx_v_i]) != NULL) != 0); if (__pyx_t_1) { free((__pyx_v_v[__pyx_v_i])); } } /* "PETSc/PETSc.pyx":313 * for 0 <= i < c: * if v[i] != NULL: free(v[i]) * free(v) # <<<<<<<<<<<<<< * * cdef void finalize() nogil: */ free(__pyx_v_v); /* "PETSc/PETSc.pyx":310 * cdef char** v = argv[0] * argc[0] = 0; argv[0] = NULL; * if c >= 0 and v != NULL: # <<<<<<<<<<<<<< * for 0 <= i < c: * if v[i] != NULL: free(v[i]) */ } /* "PETSc/PETSc.pyx":305 * return 0 * * cdef void delinitargs(int *argc, char **argv[]) nogil: # <<<<<<<<<<<<<< * # dallocate command line arguments * cdef int i, c = argc[0] */ /* function exit code */ } /* "PETSc/PETSc.pyx":315 * free(v) * * cdef void finalize() nogil: # <<<<<<<<<<<<<< * cdef int ierr = 0 * # deallocate command line arguments */ static void __pyx_f_8petsc4py_5PETSc_finalize(void) { int __pyx_v_ierr; int __pyx_t_1; /* "PETSc/PETSc.pyx":316 * * cdef void finalize() nogil: * cdef int ierr = 0 # <<<<<<<<<<<<<< * # deallocate command line arguments * global PyPetsc_Argc; global PyPetsc_Argv; */ __pyx_v_ierr = 0; /* "PETSc/PETSc.pyx":319 * # deallocate command line arguments * global PyPetsc_Argc; global PyPetsc_Argv; * delinitargs(&PyPetsc_Argc, &PyPetsc_Argv) # <<<<<<<<<<<<<< * # manage PETSc finalization * if not (PetscInitializeCalled): return */ __pyx_f_8petsc4py_5PETSc_delinitargs((&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argc), (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv)); /* "PETSc/PETSc.pyx":321 * delinitargs(&PyPetsc_Argc, &PyPetsc_Argv) * # manage PETSc finalization * if not (PetscInitializeCalled): return # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return * # deinstall Python error handler */ __pyx_t_1 = ((!(((int)PetscInitializeCalled) != 0)) != 0); if (__pyx_t_1) { goto __pyx_L0; } /* "PETSc/PETSc.pyx":322 * # manage PETSc finalization * if not (PetscInitializeCalled): return * if (PetscFinalizeCalled): return # <<<<<<<<<<<<<< * # deinstall Python error handler * ierr = PetscPopErrorHandler() */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { goto __pyx_L0; } /* "PETSc/PETSc.pyx":324 * if (PetscFinalizeCalled): return * # deinstall Python error handler * ierr = PetscPopErrorHandler() # <<<<<<<<<<<<<< * if ierr != 0: * fprintf(stderr, "PetscPopErrorHandler() failed " */ __pyx_v_ierr = PetscPopErrorHandler(); /* "PETSc/PETSc.pyx":325 * # deinstall Python error handler * ierr = PetscPopErrorHandler() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, "PetscPopErrorHandler() failed " * "[error code: %d]\n", ierr) */ __pyx_t_1 = ((__pyx_v_ierr != 0) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":326 * ierr = PetscPopErrorHandler() * if ierr != 0: * fprintf(stderr, "PetscPopErrorHandler() failed " # <<<<<<<<<<<<<< * "[error code: %d]\n", ierr) * # finalize PETSc */ (void)(fprintf(stderr, ((char *)"PetscPopErrorHandler() failed [error code: %d]\n"), __pyx_v_ierr)); /* "PETSc/PETSc.pyx":325 * # deinstall Python error handler * ierr = PetscPopErrorHandler() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, "PetscPopErrorHandler() failed " * "[error code: %d]\n", ierr) */ } /* "PETSc/PETSc.pyx":329 * "[error code: %d]\n", ierr) * # finalize PETSc * ierr = PetscFinalize() # <<<<<<<<<<<<<< * if ierr != 0: * fprintf(stderr, "PetscFinalize() failed " */ __pyx_v_ierr = PetscFinalize(); /* "PETSc/PETSc.pyx":330 * # finalize PETSc * ierr = PetscFinalize() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, "PetscFinalize() failed " * "[error code: %d]\n", ierr) */ __pyx_t_1 = ((__pyx_v_ierr != 0) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":331 * ierr = PetscFinalize() * if ierr != 0: * fprintf(stderr, "PetscFinalize() failed " # <<<<<<<<<<<<<< * "[error code: %d]\n", ierr) * # and we are done, see you later !! */ (void)(fprintf(stderr, ((char *)"PetscFinalize() failed [error code: %d]\n"), __pyx_v_ierr)); /* "PETSc/PETSc.pyx":330 * # finalize PETSc * ierr = PetscFinalize() * if ierr != 0: # <<<<<<<<<<<<<< * fprintf(stderr, "PetscFinalize() failed " * "[error code: %d]\n", ierr) */ } /* "PETSc/PETSc.pyx":315 * free(v) * * cdef void finalize() nogil: # <<<<<<<<<<<<<< * cdef int ierr = 0 * # deallocate command line arguments */ /* function exit code */ __pyx_L0:; } /* "PETSc/PETSc.pyx":335 * # and we are done, see you later !! * * cdef int initialize(object args, object comm) except -1: # <<<<<<<<<<<<<< * if (PetscInitializeCalled): return 1 * if (PetscFinalizeCalled): return 0 */ static int __pyx_f_8petsc4py_5PETSc_initialize(PyObject *__pyx_v_args, PyObject *__pyx_v_comm) { PetscErrorHandlerFunction __pyx_v_handler; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; MPI_Comm __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("initialize", 0); /* "PETSc/PETSc.pyx":336 * * cdef int initialize(object args, object comm) except -1: * if (PetscInitializeCalled): return 1 # <<<<<<<<<<<<<< * if (PetscFinalizeCalled): return 0 * # allocate command line arguments */ __pyx_t_1 = (((int)PetscInitializeCalled) != 0); if (__pyx_t_1) { __pyx_r = 1; goto __pyx_L0; } /* "PETSc/PETSc.pyx":337 * cdef int initialize(object args, object comm) except -1: * if (PetscInitializeCalled): return 1 * if (PetscFinalizeCalled): return 0 # <<<<<<<<<<<<<< * # allocate command line arguments * global PyPetsc_Argc; global PyPetsc_Argv; */ __pyx_t_1 = (((int)PetscFinalizeCalled) != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/PETSc.pyx":340 * # allocate command line arguments * global PyPetsc_Argc; global PyPetsc_Argv; * getinitargs(args, &PyPetsc_Argc, &PyPetsc_Argv) # <<<<<<<<<<<<<< * # communicator * global PETSC_COMM_WORLD */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_getinitargs(__pyx_v_args, (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argc), (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 340, __pyx_L1_error) /* "PETSc/PETSc.pyx":343 * # communicator * global PETSC_COMM_WORLD * PETSC_COMM_WORLD = def_Comm(comm, PETSC_COMM_WORLD) # <<<<<<<<<<<<<< * # initialize PETSc * CHKERR( PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL) ) */ __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_WORLD); if (unlikely(PyErr_Occurred())) __PYX_ERR(11, 343, __pyx_L1_error) PETSC_COMM_WORLD = __pyx_t_3; /* "PETSc/PETSc.pyx":345 * PETSC_COMM_WORLD = def_Comm(comm, PETSC_COMM_WORLD) * # initialize PETSc * CHKERR( PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL) ) # <<<<<<<<<<<<<< * # install Python error handler * cdef PetscErrorHandlerFunction handler = NULL */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInitialize((&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argc), (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv), NULL, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 345, __pyx_L1_error) /* "PETSc/PETSc.pyx":347 * CHKERR( PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL) ) * # install Python error handler * cdef PetscErrorHandlerFunction handler = NULL # <<<<<<<<<<<<<< * handler = PetscPythonErrorHandler * CHKERR( PetscPushErrorHandler(handler, NULL) ) */ __pyx_v_handler = NULL; /* "PETSc/PETSc.pyx":348 * # install Python error handler * cdef PetscErrorHandlerFunction handler = NULL * handler = PetscPythonErrorHandler # <<<<<<<<<<<<<< * CHKERR( PetscPushErrorHandler(handler, NULL) ) * # register finalization function */ __pyx_v_handler = ((PetscErrorHandlerFunction)__pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler); /* "PETSc/PETSc.pyx":349 * cdef PetscErrorHandlerFunction handler = NULL * handler = PetscPythonErrorHandler * CHKERR( PetscPushErrorHandler(handler, NULL) ) # <<<<<<<<<<<<<< * # register finalization function * if Py_AtExit(finalize) < 0: */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPushErrorHandler(__pyx_v_handler, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 349, __pyx_L1_error) /* "PETSc/PETSc.pyx":351 * CHKERR( PetscPushErrorHandler(handler, NULL) ) * # register finalization function * if Py_AtExit(finalize) < 0: # <<<<<<<<<<<<<< * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", * b"PetscFinalize()") */ __pyx_t_1 = ((Py_AtExit(__pyx_f_8petsc4py_5PETSc_finalize) < 0) != 0); if (__pyx_t_1) { /* "PETSc/PETSc.pyx":352 * # register finalization function * if Py_AtExit(finalize) < 0: * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", # <<<<<<<<<<<<<< * b"PetscFinalize()") * return 1 # and we are done, enjoy !! */ PySys_WriteStderr(((char *)"warning: could not register %s with Py_AtExit()"), ((char *)"PetscFinalize()")); /* "PETSc/PETSc.pyx":351 * CHKERR( PetscPushErrorHandler(handler, NULL) ) * # register finalization function * if Py_AtExit(finalize) < 0: # <<<<<<<<<<<<<< * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", * b"PetscFinalize()") */ } /* "PETSc/PETSc.pyx":354 * PySys_WriteStderr(b"warning: could not register %s with Py_AtExit()", * b"PetscFinalize()") * return 1 # and we are done, enjoy !! # <<<<<<<<<<<<<< * * cdef extern from *: */ __pyx_r = 1; goto __pyx_L0; /* "PETSc/PETSc.pyx":335 * # and we are done, see you later !! * * cdef int initialize(object args, object comm) except -1: # <<<<<<<<<<<<<< * if (PetscInitializeCalled): return 1 * if (PetscFinalizeCalled): return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":395 * """ * * cdef int register() except -1: # <<<<<<<<<<<<<< * global registercalled * if registercalled: return 0 */ static int __pyx_f_8petsc4py_5PETSc_register(void) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("register", 0); /* "PETSc/PETSc.pyx":397 * cdef int register() except -1: * global registercalled * if registercalled: return 0 # <<<<<<<<<<<<<< * registercalled = True * # register citation */ __pyx_t_1 = (__pyx_v_8petsc4py_5PETSc_registercalled != 0); if (__pyx_t_1) { __pyx_r = 0; goto __pyx_L0; } /* "PETSc/PETSc.pyx":398 * global registercalled * if registercalled: return 0 * registercalled = True # <<<<<<<<<<<<<< * # register citation * CHKERR( PetscCitationsRegister(citation, NULL) ) */ __pyx_v_8petsc4py_5PETSc_registercalled = 1; /* "PETSc/PETSc.pyx":400 * registercalled = True * # register citation * CHKERR( PetscCitationsRegister(citation, NULL) ) # <<<<<<<<<<<<<< * # make sure all PETSc packages are initialized * CHKERR( PetscInitializePackageAll() ) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCitationsRegister(__pyx_v_8petsc4py_5PETSc_citation, NULL)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 400, __pyx_L1_error) /* "PETSc/PETSc.pyx":402 * CHKERR( PetscCitationsRegister(citation, NULL) ) * # make sure all PETSc packages are initialized * CHKERR( PetscInitializePackageAll() ) # <<<<<<<<<<<<<< * # register custom implementations * import_libpetsc4py() */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscInitializePackageAll()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 402, __pyx_L1_error) /* "PETSc/PETSc.pyx":404 * CHKERR( PetscInitializePackageAll() ) * # register custom implementations * import_libpetsc4py() # <<<<<<<<<<<<<< * CHKERR( PetscPythonRegisterAll() ) * # register Python types */ __pyx_t_2 = import_libpetsc4py(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 404, __pyx_L1_error) /* "PETSc/PETSc.pyx":405 * # register custom implementations * import_libpetsc4py() * CHKERR( PetscPythonRegisterAll() ) # <<<<<<<<<<<<<< * # register Python types * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPythonRegisterAll()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 405, __pyx_L1_error) /* "PETSc/PETSc.pyx":407 * CHKERR( PetscPythonRegisterAll() ) * # register Python types * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_OBJECT_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 407, __pyx_L1_error) /* "PETSc/PETSc.pyx":408 * # register Python types * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) * PyPetscType_Register(PETSC_IS_CLASSID, IS) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_VIEWER_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Viewer); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 408, __pyx_L1_error) /* "PETSc/PETSc.pyx":409 * PyPetscType_Register(PETSC_OBJECT_CLASSID, Object) * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_IS_CLASSID, IS) * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_RANDOM_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Random); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 409, __pyx_L1_error) /* "PETSc/PETSc.pyx":410 * PyPetscType_Register(PETSC_VIEWER_CLASSID, Viewer) * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) * PyPetscType_Register(PETSC_IS_CLASSID, IS) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) * PyPetscType_Register(PETSC_SF_CLASSID, SF) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(IS_CLASSID, __pyx_ptype_8petsc4py_5PETSc_IS); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 410, __pyx_L1_error) /* "PETSc/PETSc.pyx":411 * PyPetscType_Register(PETSC_RANDOM_CLASSID, Random) * PyPetscType_Register(PETSC_IS_CLASSID, IS) * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_SF_CLASSID, SF) * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(IS_LTOGM_CLASSID, __pyx_ptype_8petsc4py_5PETSc_LGMap); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 411, __pyx_L1_error) /* "PETSc/PETSc.pyx":412 * PyPetscType_Register(PETSC_IS_CLASSID, IS) * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) * PyPetscType_Register(PETSC_SF_CLASSID, SF) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCSF_CLASSID, __pyx_ptype_8petsc4py_5PETSc_SF); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 412, __pyx_L1_error) /* "PETSc/PETSc.pyx":413 * PyPetscType_Register(PETSC_LGMAP_CLASSID, LGMap) * PyPetscType_Register(PETSC_SF_CLASSID, SF) * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(VEC_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Vec); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 413, __pyx_L1_error) /* "PETSc/PETSc.pyx":414 * PyPetscType_Register(PETSC_SF_CLASSID, SF) * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSC_SECTION_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Section); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 414, __pyx_L1_error) /* "PETSc/PETSc.pyx":415 * PyPetscType_Register(PETSC_VEC_CLASSID, Vec) * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) * PyPetscType_Register(PETSC_PC_CLASSID, PC) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(MAT_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Mat); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 415, __pyx_L1_error) /* "PETSc/PETSc.pyx":416 * PyPetscType_Register(PETSC_SECTION_CLASSID, Section) * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_PC_CLASSID, PC) * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(MAT_NULLSPACE_CLASSID, __pyx_ptype_8petsc4py_5PETSc_NullSpace); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 416, __pyx_L1_error) /* "PETSc/PETSc.pyx":417 * PyPetscType_Register(PETSC_MAT_CLASSID, Mat) * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) * PyPetscType_Register(PETSC_PC_CLASSID, PC) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PC_CLASSID, __pyx_ptype_8petsc4py_5PETSc_PC); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 417, __pyx_L1_error) /* "PETSc/PETSc.pyx":418 * PyPetscType_Register(PETSC_NULLSPACE_CLASSID, NullSpace) * PyPetscType_Register(PETSC_PC_CLASSID, PC) * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) * PyPetscType_Register(PETSC_TS_CLASSID, TS) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(KSP_CLASSID, __pyx_ptype_8petsc4py_5PETSc_KSP); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 418, __pyx_L1_error) /* "PETSc/PETSc.pyx":419 * PyPetscType_Register(PETSC_PC_CLASSID, PC) * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_TS_CLASSID, TS) * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(SNES_CLASSID, __pyx_ptype_8petsc4py_5PETSc_SNES); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 419, __pyx_L1_error) /* "PETSc/PETSc.pyx":420 * PyPetscType_Register(PETSC_KSP_CLASSID, KSP) * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) * PyPetscType_Register(PETSC_TS_CLASSID, TS) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(TS_CLASSID, __pyx_ptype_8petsc4py_5PETSc_TS); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 420, __pyx_L1_error) /* "PETSc/PETSc.pyx":421 * PyPetscType_Register(PETSC_SNES_CLASSID, SNES) * PyPetscType_Register(PETSC_TS_CLASSID, TS) * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) * PyPetscType_Register(PETSC_AO_CLASSID, AO) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(TAO_CLASSID, __pyx_ptype_8petsc4py_5PETSc_TAO); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 421, __pyx_L1_error) /* "PETSc/PETSc.pyx":422 * PyPetscType_Register(PETSC_TS_CLASSID, TS) * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_AO_CLASSID, AO) * PyPetscType_Register(PETSC_DM_CLASSID, DM) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCPARTITIONER_CLASSID, __pyx_ptype_8petsc4py_5PETSc_Partitioner); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 422, __pyx_L1_error) /* "PETSc/PETSc.pyx":423 * PyPetscType_Register(PETSC_TAO_CLASSID, TAO) * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) * PyPetscType_Register(PETSC_AO_CLASSID, AO) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DM_CLASSID, DM) * PyPetscType_Register(PETSC_DS_CLASSID, DS) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(AO_CLASSID, __pyx_ptype_8petsc4py_5PETSc_AO); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 423, __pyx_L1_error) /* "PETSc/PETSc.pyx":424 * PyPetscType_Register(PETSC_PARTITIONER_CLASSID, Partitioner) * PyPetscType_Register(PETSC_AO_CLASSID, AO) * PyPetscType_Register(PETSC_DM_CLASSID, DM) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DS_CLASSID, DS) * PyPetscType_Register(PETSC_FE_CLASSID, FE) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(DM_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 424, __pyx_L1_error) /* "PETSc/PETSc.pyx":425 * PyPetscType_Register(PETSC_AO_CLASSID, AO) * PyPetscType_Register(PETSC_DM_CLASSID, DM) * PyPetscType_Register(PETSC_DS_CLASSID, DS) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_FE_CLASSID, FE) * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCDS_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DS); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 425, __pyx_L1_error) /* "PETSc/PETSc.pyx":426 * PyPetscType_Register(PETSC_DM_CLASSID, DM) * PyPetscType_Register(PETSC_DS_CLASSID, DS) * PyPetscType_Register(PETSC_FE_CLASSID, FE) # <<<<<<<<<<<<<< * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) * return 0 # and we are done, enjoy !! */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCFE_CLASSID, __pyx_ptype_8petsc4py_5PETSc_FE); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 426, __pyx_L1_error) /* "PETSc/PETSc.pyx":427 * PyPetscType_Register(PETSC_DS_CLASSID, DS) * PyPetscType_Register(PETSC_FE_CLASSID, FE) * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) # <<<<<<<<<<<<<< * return 0 # and we are done, enjoy !! * */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(DMLABEL_CLASSID, __pyx_ptype_8petsc4py_5PETSc_DMLabel); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 427, __pyx_L1_error) /* "PETSc/PETSc.pyx":428 * PyPetscType_Register(PETSC_FE_CLASSID, FE) * PyPetscType_Register(PETSC_DMLABEL_CLASSID, DMLabel) * return 0 # and we are done, enjoy !! # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_r = 0; goto __pyx_L0; /* "PETSc/PETSc.pyx":395 * """ * * cdef int register() except -1: # <<<<<<<<<<<<<< * global registercalled * if registercalled: return 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc.register", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":432 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * global tracebacklist * Error._traceback_ = tracebacklist */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_1_initialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc__initialize[] = "_initialize(args=None, comm=None)"; static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_1_initialize = {"_initialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_1_initialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc__initialize}; static PyObject *__pyx_pw_8petsc4py_5PETSc_1_initialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_comm = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_initialize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_comm,0}; PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = ((PyObject *)Py_None); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args); if (value) { values[0] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_initialize") < 0)) __PYX_ERR(11, 432, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_args = values[0]; __pyx_v_comm = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_initialize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(11, 432, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("petsc4py.PETSc._initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_8petsc4py_5PETSc__initialize(__pyx_self, __pyx_v_args, __pyx_v_comm); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc__initialize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_comm) { int __pyx_v_ready; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_initialize", 0); /* "PETSc/PETSc.pyx":434 * def _initialize(args=None, comm=None): * global tracebacklist * Error._traceback_ = tracebacklist # <<<<<<<<<<<<<< * global PetscError * PetscError = Error */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_traceback, __pyx_v_8petsc4py_5PETSc_tracebacklist) < 0) __PYX_ERR(11, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":436 * Error._traceback_ = tracebacklist * global PetscError * PetscError = Error # <<<<<<<<<<<<<< * # * cdef int ready = initialize(args, comm) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_PetscError); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_PetscError, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":438 * PetscError = Error * # * cdef int ready = initialize(args, comm) # <<<<<<<<<<<<<< * if ready: register() * # */ __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_initialize(__pyx_v_args, __pyx_v_comm); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 438, __pyx_L1_error) __pyx_v_ready = __pyx_t_2; /* "PETSc/PETSc.pyx":439 * # * cdef int ready = initialize(args, comm) * if ready: register() # <<<<<<<<<<<<<< * # * global __COMM_SELF__, __COMM_WORLD__ */ __pyx_t_3 = (__pyx_v_ready != 0); if (__pyx_t_3) { __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_register(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 439, __pyx_L1_error) } /* "PETSc/PETSc.pyx":442 * # * global __COMM_SELF__, __COMM_WORLD__ * __COMM_SELF__.comm = PETSC_COMM_SELF # <<<<<<<<<<<<<< * __COMM_WORLD__.comm = PETSC_COMM_WORLD * # */ __pyx_v_8petsc4py_5PETSc___COMM_SELF__->comm = PETSC_COMM_SELF; /* "PETSc/PETSc.pyx":443 * global __COMM_SELF__, __COMM_WORLD__ * __COMM_SELF__.comm = PETSC_COMM_SELF * __COMM_WORLD__.comm = PETSC_COMM_WORLD # <<<<<<<<<<<<<< * # * global PETSC_COMM_DEFAULT */ __pyx_v_8petsc4py_5PETSc___COMM_WORLD__->comm = PETSC_COMM_WORLD; /* "PETSc/PETSc.pyx":446 * # * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = PETSC_COMM_WORLD # <<<<<<<<<<<<<< * * def _finalize(): */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = PETSC_COMM_WORLD; /* "PETSc/PETSc.pyx":432 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * global tracebacklist * Error._traceback_ = tracebacklist */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("petsc4py.PETSc._initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "PETSc/PETSc.pyx":448 * PETSC_COMM_DEFAULT = PETSC_COMM_WORLD * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ /* Python wrapper */ static PyObject *__pyx_pw_8petsc4py_5PETSc_3_finalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_8petsc4py_5PETSc_2_finalize[] = "_finalize()"; static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3_finalize = {"_finalize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3_finalize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2_finalize}; static PyObject *__pyx_pw_8petsc4py_5PETSc_3_finalize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_finalize (wrapper)", 0); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("_finalize", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;} if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_finalize", 0))) return NULL; __pyx_r = __pyx_pf_8petsc4py_5PETSc_2_finalize(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_8petsc4py_5PETSc_2_finalize(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_finalize", 0); /* "PETSc/PETSc.pyx":449 * * def _finalize(): * finalize() # <<<<<<<<<<<<<< * # * global __COMM_SELF__ */ __pyx_f_8petsc4py_5PETSc_finalize(); /* "PETSc/PETSc.pyx":452 * # * global __COMM_SELF__ * __COMM_SELF__.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * global __COMM_WORLD__ * __COMM_WORLD__.comm = MPI_COMM_NULL */ __pyx_v_8petsc4py_5PETSc___COMM_SELF__->comm = MPI_COMM_NULL; /* "PETSc/PETSc.pyx":454 * __COMM_SELF__.comm = MPI_COMM_NULL * global __COMM_WORLD__ * __COMM_WORLD__.comm = MPI_COMM_NULL # <<<<<<<<<<<<<< * # * global PETSC_COMM_DEFAULT */ __pyx_v_8petsc4py_5PETSc___COMM_WORLD__->comm = MPI_COMM_NULL; /* "PETSc/PETSc.pyx":457 * # * global PETSC_COMM_DEFAULT * PETSC_COMM_DEFAULT = MPI_COMM_NULL # <<<<<<<<<<<<<< * # * global type_registry */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = MPI_COMM_NULL; /* "PETSc/PETSc.pyx":460 * # * global type_registry * type_registry.clear() # <<<<<<<<<<<<<< * global stage_registry * stage_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(11, 460, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_type_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 460, __pyx_L1_error) /* "PETSc/PETSc.pyx":462 * type_registry.clear() * global stage_registry * stage_registry.clear() # <<<<<<<<<<<<<< * global class_registry * class_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_stage_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(11, 462, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_stage_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 462, __pyx_L1_error) /* "PETSc/PETSc.pyx":464 * stage_registry.clear() * global class_registry * class_registry.clear() # <<<<<<<<<<<<<< * global event_registry * event_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_class_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(11, 464, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_class_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 464, __pyx_L1_error) /* "PETSc/PETSc.pyx":466 * class_registry.clear() * global event_registry * event_registry.clear() # <<<<<<<<<<<<<< * global citations_registry * citations_registry.clear() */ if (unlikely(__pyx_v_8petsc4py_5PETSc_event_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(11, 466, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_event_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 466, __pyx_L1_error) /* "PETSc/PETSc.pyx":468 * event_registry.clear() * global citations_registry * citations_registry.clear() # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (unlikely(__pyx_v_8petsc4py_5PETSc_citations_registry == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear"); __PYX_ERR(11, 468, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_citations_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(11, 468, __pyx_L1_error) /* "PETSc/PETSc.pyx":448 * PETSC_COMM_DEFAULT = PETSC_COMM_WORLD * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("petsc4py.PETSc._finalize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":122 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): * */ /* Python wrapper */ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_shape = 0; Py_ssize_t __pyx_v_itemsize; PyObject *__pyx_v_format = 0; PyObject *__pyx_v_mode = 0; int __pyx_v_allocate_buffer; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)__pyx_n_s_c); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(56, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(56, 122, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(56, 122, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_shape = ((PyObject*)values[0]); __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 122, __pyx_L3_error) __pyx_v_format = values[2]; __pyx_v_mode = values[3]; if (values[4]) { __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(56, 123, __pyx_L3_error) } else { /* "View.MemoryView":123 * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<< * * cdef int idx */ __pyx_v_allocate_buffer = ((int)1); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(56, 122, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(56, 122, __pyx_L1_error) if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(56, 122, __pyx_L1_error) } __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer); /* "View.MemoryView":122 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): * */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) { int __pyx_v_idx; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_dim; PyObject **__pyx_v_p; char __pyx_v_order; int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; char *__pyx_t_7; int __pyx_t_8; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_format); /* "View.MemoryView":129 * cdef PyObject **p * * self.ndim = len(shape) # <<<<<<<<<<<<<< * self.itemsize = itemsize * */ if (unlikely(__pyx_v_shape == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(56, 129, __pyx_L1_error) } __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(56, 129, __pyx_L1_error) __pyx_v_self->ndim = ((int)__pyx_t_1); /* "View.MemoryView":130 * * self.ndim = len(shape) * self.itemsize = itemsize # <<<<<<<<<<<<<< * * if not self.ndim: */ __pyx_v_self->itemsize = __pyx_v_itemsize; /* "View.MemoryView":132 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") * */ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":133 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 133, __pyx_L1_error) /* "View.MemoryView":132 * self.itemsize = itemsize * * if not self.ndim: # <<<<<<<<<<<<<< * raise ValueError("Empty shape tuple for cython.array") * */ } /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") * */ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":136 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 136, __pyx_L1_error) /* "View.MemoryView":135 * raise ValueError("Empty shape tuple for cython.array") * * if itemsize <= 0: # <<<<<<<<<<<<<< * raise ValueError("itemsize <= 0 for cython.array") * */ } /* "View.MemoryView":138 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string */ __pyx_t_2 = PyBytes_Check(__pyx_v_format); __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_4) { /* "View.MemoryView":139 * * if not isinstance(format, bytes): * format = format.encode('ASCII') # <<<<<<<<<<<<<< * self._format = format # keep a reference to the byte string * self.format = self._format */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":138 * raise ValueError("itemsize <= 0 for cython.array") * * if not isinstance(format, bytes): # <<<<<<<<<<<<<< * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string */ } /* "View.MemoryView":140 * if not isinstance(format, bytes): * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<< * self.format = self._format * */ if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(56, 140, __pyx_L1_error) __pyx_t_3 = __pyx_v_format; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_format); __Pyx_DECREF(__pyx_v_self->_format); __pyx_v_self->_format = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":141 * format = format.encode('ASCII') * self._format = format # keep a reference to the byte string * self.format = self._format # <<<<<<<<<<<<<< * * */ if (unlikely(__pyx_v_self->_format == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); __PYX_ERR(56, 141, __pyx_L1_error) } __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(56, 141, __pyx_L1_error) __pyx_v_self->format = __pyx_t_7; /* "View.MemoryView":144 * * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<< * self._strides = self._shape + self.ndim * */ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2))); /* "View.MemoryView":145 * * self._shape = PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<< * * if not self._shape: */ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim); /* "View.MemoryView":147 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") * */ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":148 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 148, __pyx_L1_error) /* "View.MemoryView":147 * self._strides = self._shape + self.ndim * * if not self._shape: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate shape and strides.") * */ } /* "View.MemoryView":151 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ __pyx_t_8 = 0; __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0; for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(56, 151, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_dim = __pyx_t_9; __pyx_v_idx = __pyx_t_8; __pyx_t_8 = (__pyx_t_8 + 1); /* "View.MemoryView":152 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim */ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":153 * for idx, dim in enumerate(shape): * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<< * self._shape[idx] = dim * */ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(56, 153, __pyx_L1_error) /* "View.MemoryView":152 * * for idx, dim in enumerate(shape): * if dim <= 0: # <<<<<<<<<<<<<< * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim */ } /* "View.MemoryView":154 * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) * self._shape[idx] = dim # <<<<<<<<<<<<<< * * cdef char order */ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim; /* "View.MemoryView":151 * * * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<< * if dim <= 0: * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":157 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(56, 157, __pyx_L1_error) if (__pyx_t_4) { /* "View.MemoryView":158 * cdef char order * if mode == 'fortran': * order = b'F' # <<<<<<<<<<<<<< * self.mode = u'fortran' * elif mode == 'c': */ __pyx_v_order = 'F'; /* "View.MemoryView":159 * if mode == 'fortran': * order = b'F' * self.mode = u'fortran' # <<<<<<<<<<<<<< * elif mode == 'c': * order = b'C' */ __Pyx_INCREF(__pyx_n_u_fortran); __Pyx_GIVEREF(__pyx_n_u_fortran); __Pyx_GOTREF(__pyx_v_self->mode); __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_fortran; /* "View.MemoryView":157 * * cdef char order * if mode == 'fortran': # <<<<<<<<<<<<<< * order = b'F' * self.mode = u'fortran' */ goto __pyx_L10; } /* "View.MemoryView":160 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< * order = b'C' * self.mode = u'c' */ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(56, 160, __pyx_L1_error) if (likely(__pyx_t_4)) { /* "View.MemoryView":161 * self.mode = u'fortran' * elif mode == 'c': * order = b'C' # <<<<<<<<<<<<<< * self.mode = u'c' * else: */ __pyx_v_order = 'C'; /* "View.MemoryView":162 * elif mode == 'c': * order = b'C' * self.mode = u'c' # <<<<<<<<<<<<<< * else: * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) */ __Pyx_INCREF(__pyx_n_u_c); __Pyx_GIVEREF(__pyx_n_u_c); __Pyx_GOTREF(__pyx_v_self->mode); __Pyx_DECREF(__pyx_v_self->mode); __pyx_v_self->mode = __pyx_n_u_c; /* "View.MemoryView":160 * order = b'F' * self.mode = u'fortran' * elif mode == 'c': # <<<<<<<<<<<<<< * order = b'C' * self.mode = u'c' */ goto __pyx_L10; } /* "View.MemoryView":164 * self.mode = u'c' * else: * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<< * * self.len = fill_contig_strides_array(self._shape, self._strides, */ /*else*/ { __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(56, 164, __pyx_L1_error) } __pyx_L10:; /* "View.MemoryView":166 * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) * * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<< * itemsize, self.ndim, order) * */ __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order); /* "View.MemoryView":169 * itemsize, self.ndim, order) * * self.free_data = allocate_buffer # <<<<<<<<<<<<<< * self.dtype_is_object = format == b'O' * if allocate_buffer: */ __pyx_v_self->free_data = __pyx_v_allocate_buffer; /* "View.MemoryView":170 * * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<< * if allocate_buffer: * */ __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 170, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(56, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_self->dtype_is_object = __pyx_t_4; /* "View.MemoryView":171 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< * * */ __pyx_t_4 = (__pyx_v_allocate_buffer != 0); if (__pyx_t_4) { /* "View.MemoryView":174 * * * self.data = malloc(self.len) # <<<<<<<<<<<<<< * if not self.data: * raise MemoryError("unable to allocate array data.") */ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len)); /* "View.MemoryView":175 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") * */ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":176 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __PYX_ERR(56, 176, __pyx_L1_error) /* "View.MemoryView":175 * * self.data = malloc(self.len) * if not self.data: # <<<<<<<<<<<<<< * raise MemoryError("unable to allocate array data.") * */ } /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): */ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_4) { /* "View.MemoryView":179 * * if self.dtype_is_object: * p = self.data # <<<<<<<<<<<<<< * for i in range(self.len / itemsize): * p[i] = Py_None */ __pyx_v_p = ((PyObject **)__pyx_v_self->data); /* "View.MemoryView":180 * if self.dtype_is_object: * p = self.data * for i in range(self.len / itemsize): # <<<<<<<<<<<<<< * p[i] = Py_None * Py_INCREF(Py_None) */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); __PYX_ERR(56, 180, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); __PYX_ERR(56, 180, __pyx_L1_error) } __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize); __pyx_t_9 = __pyx_t_1; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "View.MemoryView":181 * p = self.data * for i in range(self.len / itemsize): * p[i] = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) * */ (__pyx_v_p[__pyx_v_i]) = Py_None; /* "View.MemoryView":182 * for i in range(self.len / itemsize): * p[i] = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * * @cname('getbuffer') */ Py_INCREF(Py_None); } /* "View.MemoryView":178 * raise MemoryError("unable to allocate array data.") * * if self.dtype_is_object: # <<<<<<<<<<<<<< * p = self.data * for i in range(self.len / itemsize): */ } /* "View.MemoryView":171 * self.free_data = allocate_buffer * self.dtype_is_object = format == b'O' * if allocate_buffer: # <<<<<<<<<<<<<< * * */ } /* "View.MemoryView":122 * cdef bint dtype_is_object * * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<< * mode="c", bint allocate_buffer=True): * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_format); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":185 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 * if self.mode == u"c": */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_v_bufmode; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; Py_ssize_t *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (__pyx_v_info == NULL) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); /* "View.MemoryView":186 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 # <<<<<<<<<<<<<< * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS */ __pyx_v_bufmode = -1; /* "View.MemoryView":187 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(56, 187, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":188 * cdef int bufmode = -1 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS */ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); /* "View.MemoryView":187 * def __getbuffer__(self, Py_buffer *info, int flags): * cdef int bufmode = -1 * if self.mode == u"c": # <<<<<<<<<<<<<< * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": */ goto __pyx_L3; } /* "View.MemoryView":189 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(56, 189, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "View.MemoryView":190 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<< * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") */ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS); /* "View.MemoryView":189 * if self.mode == u"c": * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * elif self.mode == u"fortran": # <<<<<<<<<<<<<< * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): */ } __pyx_L3:; /* "View.MemoryView":191 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data */ __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":192 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 192, __pyx_L1_error) /* "View.MemoryView":191 * elif self.mode == u"fortran": * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): # <<<<<<<<<<<<<< * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data */ } /* "View.MemoryView":193 * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data # <<<<<<<<<<<<<< * info.len = self.len * info.ndim = self.ndim */ __pyx_t_4 = __pyx_v_self->data; __pyx_v_info->buf = __pyx_t_4; /* "View.MemoryView":194 * raise ValueError("Can only create a buffer that is contiguous in memory.") * info.buf = self.data * info.len = self.len # <<<<<<<<<<<<<< * info.ndim = self.ndim * info.shape = self._shape */ __pyx_t_5 = __pyx_v_self->len; __pyx_v_info->len = __pyx_t_5; /* "View.MemoryView":195 * info.buf = self.data * info.len = self.len * info.ndim = self.ndim # <<<<<<<<<<<<<< * info.shape = self._shape * info.strides = self._strides */ __pyx_t_6 = __pyx_v_self->ndim; __pyx_v_info->ndim = __pyx_t_6; /* "View.MemoryView":196 * info.len = self.len * info.ndim = self.ndim * info.shape = self._shape # <<<<<<<<<<<<<< * info.strides = self._strides * info.suboffsets = NULL */ __pyx_t_7 = __pyx_v_self->_shape; __pyx_v_info->shape = __pyx_t_7; /* "View.MemoryView":197 * info.ndim = self.ndim * info.shape = self._shape * info.strides = self._strides # <<<<<<<<<<<<<< * info.suboffsets = NULL * info.itemsize = self.itemsize */ __pyx_t_7 = __pyx_v_self->_strides; __pyx_v_info->strides = __pyx_t_7; /* "View.MemoryView":198 * info.shape = self._shape * info.strides = self._strides * info.suboffsets = NULL # <<<<<<<<<<<<<< * info.itemsize = self.itemsize * info.readonly = 0 */ __pyx_v_info->suboffsets = NULL; /* "View.MemoryView":199 * info.strides = self._strides * info.suboffsets = NULL * info.itemsize = self.itemsize # <<<<<<<<<<<<<< * info.readonly = 0 * */ __pyx_t_5 = __pyx_v_self->itemsize; __pyx_v_info->itemsize = __pyx_t_5; /* "View.MemoryView":200 * info.suboffsets = NULL * info.itemsize = self.itemsize * info.readonly = 0 # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ __pyx_v_info->readonly = 0; /* "View.MemoryView":202 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { /* "View.MemoryView":203 * * if flags & PyBUF_FORMAT: * info.format = self.format # <<<<<<<<<<<<<< * else: * info.format = NULL */ __pyx_t_4 = __pyx_v_self->format; __pyx_v_info->format = __pyx_t_4; /* "View.MemoryView":202 * info.readonly = 0 * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.format * else: */ goto __pyx_L5; } /* "View.MemoryView":205 * info.format = self.format * else: * info.format = NULL # <<<<<<<<<<<<<< * * info.obj = self */ /*else*/ { __pyx_v_info->format = NULL; } __pyx_L5:; /* "View.MemoryView":207 * info.format = NULL * * info.obj = self # <<<<<<<<<<<<<< * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":185 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * cdef int bufmode = -1 * if self.mode == u"c": */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_info->obj != NULL) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_info->obj == Py_None) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) */ /* Python wrapper */ static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_array___dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":212 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) * elif self.free_data: */ __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0); if (__pyx_t_1) { /* "View.MemoryView":213 * def __dealloc__(array self): * if self.callback_free_data != NULL: * self.callback_free_data(self.data) # <<<<<<<<<<<<<< * elif self.free_data: * if self.dtype_is_object: */ __pyx_v_self->callback_free_data(__pyx_v_self->data); /* "View.MemoryView":212 * * def __dealloc__(array self): * if self.callback_free_data != NULL: # <<<<<<<<<<<<<< * self.callback_free_data(self.data) * elif self.free_data: */ goto __pyx_L3; } /* "View.MemoryView":214 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, */ __pyx_t_1 = (__pyx_v_self->free_data != 0); if (__pyx_t_1) { /* "View.MemoryView":215 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) */ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_1) { /* "View.MemoryView":216 * elif self.free_data: * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<< * self._strides, self.ndim, False) * free(self.data) */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0); /* "View.MemoryView":215 * self.callback_free_data(self.data) * elif self.free_data: * if self.dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) */ } /* "View.MemoryView":218 * refcount_objects_in_slice(self.data, self._shape, * self._strides, self.ndim, False) * free(self.data) # <<<<<<<<<<<<<< * PyObject_Free(self._shape) * */ free(__pyx_v_self->data); /* "View.MemoryView":214 * if self.callback_free_data != NULL: * self.callback_free_data(self.data) * elif self.free_data: # <<<<<<<<<<<<<< * if self.dtype_is_object: * refcount_objects_in_slice(self.data, self._shape, */ } __pyx_L3:; /* "View.MemoryView":219 * self._strides, self.ndim, False) * free(self.data) * PyObject_Free(self._shape) # <<<<<<<<<<<<<< * * @property */ PyObject_Free(__pyx_v_self->_shape); /* "View.MemoryView":211 * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") * * def __dealloc__(array self): # <<<<<<<<<<<<<< * if self.callback_free_data != NULL: * self.callback_free_data(self.data) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "View.MemoryView":222 * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":223 * @property * def memview(self): * return self.get_memview() # <<<<<<<<<<<<<< * * @cname('get_memview') */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":222 * * @property * def memview(self): # <<<<<<<<<<<<<< * return self.get_memview() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":226 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) */ static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) { int __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_memview", 0); /* "View.MemoryView":227 * @cname('get_memview') * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<< * return memoryview(self, flags, self.dtype_is_object) * */ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE); /* "View.MemoryView":228 * cdef get_memview(self): * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":226 * * @cname('get_memview') * cdef get_memview(self): # <<<<<<<<<<<<<< * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE * return memoryview(self, flags, self.dtype_is_object) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] * */ /* Python wrapper */ static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":231 * * def __len__(self): * return self._shape[0] # <<<<<<<<<<<<<< * * def __getattr__(self, attr): */ __pyx_r = (__pyx_v_self->_shape[0]); goto __pyx_L0; /* "View.MemoryView":230 * return memoryview(self, flags, self.dtype_is_object) * * def __len__(self): # <<<<<<<<<<<<<< * return self._shape[0] * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":233 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) * */ /* Python wrapper */ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getattr__", 0); /* "View.MemoryView":234 * * def __getattr__(self, attr): * return getattr(self.memview, attr) # <<<<<<<<<<<<<< * * def __getitem__(self, item): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":233 * return self._shape[0] * * def __getattr__(self, attr): # <<<<<<<<<<<<<< * return getattr(self.memview, attr) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":236 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] * */ /* Python wrapper */ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":237 * * def __getitem__(self, item): * return self.memview[item] # <<<<<<<<<<<<<< * * def __setitem__(self, item, value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":236 * return getattr(self.memview, attr) * * def __getitem__(self, item): # <<<<<<<<<<<<<< * return self.memview[item] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":239 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value * */ /* Python wrapper */ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); /* "View.MemoryView":240 * * def __setitem__(self, item, value): * self.memview[item] = value # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(56, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":239 * return self.memview[item] * * def __setitem__(self, item, value): # <<<<<<<<<<<<<< * self.memview[item] = value * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(56, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(56, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":244 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): * cdef array result */ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) { struct __pyx_array_obj *__pyx_v_result = 0; struct __pyx_array_obj *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("array_cwrapper", 0); /* "View.MemoryView":248 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: */ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0); if (__pyx_t_1) { /* "View.MemoryView":249 * * if buf == NULL: * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<< * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":248 * cdef array result * * if buf == NULL: # <<<<<<<<<<<<<< * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: */ goto __pyx_L3; } /* "View.MemoryView":251 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< * allocate_buffer=False) * result.data = buf */ /*else*/ { __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_3 = 0; /* "View.MemoryView":252 * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) # <<<<<<<<<<<<<< * result.data = buf * */ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(56, 252, __pyx_L1_error) /* "View.MemoryView":251 * result = array(shape, itemsize, format, mode.decode('ASCII')) * else: * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<< * allocate_buffer=False) * result.data = buf */ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5); __pyx_t_5 = 0; /* "View.MemoryView":253 * result = array(shape, itemsize, format, mode.decode('ASCII'), * allocate_buffer=False) * result.data = buf # <<<<<<<<<<<<<< * * return result */ __pyx_v_result->data = __pyx_v_buf; } __pyx_L3:; /* "View.MemoryView":255 * result.data = buf * * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "View.MemoryView":244 * * @cname("__pyx_array_new") * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<< * char *mode, char *buf): * cdef array result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":281 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< * self.name = name * def __repr__(self): */ /* Python wrapper */ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_name = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0}; PyObject* values[1] = {0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(56, 281, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); } __pyx_v_name = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(56, 281, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* "View.MemoryView":282 * cdef object name * def __init__(self, name): * self.name = name # <<<<<<<<<<<<<< * def __repr__(self): * return self.name */ __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); __Pyx_GOTREF(__pyx_v_self->name); __Pyx_DECREF(__pyx_v_self->name); __pyx_v_self->name = __pyx_v_name; /* "View.MemoryView":281 * cdef class Enum(object): * cdef object name * def __init__(self, name): # <<<<<<<<<<<<<< * self.name = name * def __repr__(self): */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":283 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name * */ /* Python wrapper */ static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__", 0); /* "View.MemoryView":284 * self.name = name * def __repr__(self): * return self.name # <<<<<<<<<<<<<< * * cdef generic = Enum("") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->name); __pyx_r = __pyx_v_self->name; goto __pyx_L0; /* "View.MemoryView":283 * def __init__(self, name): * self.name = name * def __repr__(self): # <<<<<<<<<<<<<< * return self.name * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.name,) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->name); __Pyx_GIVEREF(__pyx_v_self->name); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.name,) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = (self.name,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.name is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.name,) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self.name is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state */ /*else*/ { __pyx_t_3 = (__pyx_v_self->name != Py_None); __pyx_v_use_setstate = __pyx_t_3; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self.name is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state * else: */ __pyx_t_3 = (__pyx_v_use_setstate != 0); if (__pyx_t_3) { /* "(tree fragment)":13 * use_setstate = self.name is not None * if use_setstate: * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_184977713); __Pyx_GIVEREF(__pyx_int_184977713); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self.name is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state * else: * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_184977713); __Pyx_GIVEREF(__pyx_int_184977713); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(56, 17, __pyx_L1_error) __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":298 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory */ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) { Py_intptr_t __pyx_v_aligned_p; size_t __pyx_v_offset; void *__pyx_r; int __pyx_t_1; /* "View.MemoryView":300 * cdef void *align_pointer(void *memory, size_t alignment) nogil: * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory # <<<<<<<<<<<<<< * cdef size_t offset * */ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory); /* "View.MemoryView":304 * * with cython.cdivision(True): * offset = aligned_p % alignment # <<<<<<<<<<<<<< * * if offset > 0: */ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment); /* "View.MemoryView":306 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset * */ __pyx_t_1 = ((__pyx_v_offset > 0) != 0); if (__pyx_t_1) { /* "View.MemoryView":307 * * if offset > 0: * aligned_p += alignment - offset # <<<<<<<<<<<<<< * * return aligned_p */ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset)); /* "View.MemoryView":306 * offset = aligned_p % alignment * * if offset > 0: # <<<<<<<<<<<<<< * aligned_p += alignment - offset * */ } /* "View.MemoryView":309 * aligned_p += alignment - offset * * return aligned_p # <<<<<<<<<<<<<< * * */ __pyx_r = ((void *)__pyx_v_aligned_p); goto __pyx_L0; /* "View.MemoryView":298 * * @cname('__pyx_align_pointer') * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<< * "Align pointer memory on a given boundary" * cdef Py_intptr_t aligned_p = memory */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags */ /* Python wrapper */ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_obj = 0; int __pyx_v_flags; int __pyx_v_dtype_is_object; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(56, 345, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(56, 345, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_obj = values[0]; __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(56, 345, __pyx_L3_error) if (values[2]) { __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(56, 345, __pyx_L3_error) } else { __pyx_v_dtype_is_object = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(56, 345, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); /* "View.MemoryView":346 * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj # <<<<<<<<<<<<<< * self.flags = flags * if type(self) is memoryview or obj is not None: */ __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); __Pyx_GOTREF(__pyx_v_self->obj); __Pyx_DECREF(__pyx_v_self->obj); __pyx_v_self->obj = __pyx_v_obj; /* "View.MemoryView":347 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): * self.obj = obj * self.flags = flags # <<<<<<<<<<<<<< * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) */ __pyx_v_self->flags = __pyx_v_flags; /* "View.MemoryView":348 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: */ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type)); __pyx_t_3 = (__pyx_t_2 != 0); if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = (__pyx_v_obj != Py_None); __pyx_t_2 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "View.MemoryView":349 * self.flags = flags * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<< * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None */ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(56, 349, __pyx_L1_error) /* "View.MemoryView":350 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) */ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0); if (__pyx_t_1) { /* "View.MemoryView":351 * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None; /* "View.MemoryView":352 * if self.view.obj == NULL: * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * * global __pyx_memoryview_thread_locks_used */ Py_INCREF(Py_None); /* "View.MemoryView":350 * if type(self) is memoryview or obj is not None: * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: # <<<<<<<<<<<<<< * (<__pyx_buffer *> &self.view).obj = Py_None * Py_INCREF(Py_None) */ } /* "View.MemoryView":348 * self.obj = obj * self.flags = flags * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<< * __Pyx_GetBuffer(obj, &self.view, flags) * if self.view.obj == NULL: */ } /* "View.MemoryView":355 * * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 */ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0); if (__pyx_t_1) { /* "View.MemoryView":356 * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: */ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); /* "View.MemoryView":357 * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<< * if self.lock is NULL: * self.lock = PyThread_allocate_lock() */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1); /* "View.MemoryView":355 * * global __pyx_memoryview_thread_locks_used * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<< * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 */ } /* "View.MemoryView":358 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< * self.lock = PyThread_allocate_lock() * if self.lock is NULL: */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); if (__pyx_t_1) { /* "View.MemoryView":359 * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<< * if self.lock is NULL: * raise MemoryError */ __pyx_v_self->lock = PyThread_allocate_lock(); /* "View.MemoryView":360 * if self.lock is NULL: * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError * */ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":361 * self.lock = PyThread_allocate_lock() * if self.lock is NULL: * raise MemoryError # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ PyErr_NoMemory(); __PYX_ERR(56, 361, __pyx_L1_error) /* "View.MemoryView":360 * if self.lock is NULL: * self.lock = PyThread_allocate_lock() * if self.lock is NULL: # <<<<<<<<<<<<<< * raise MemoryError * */ } /* "View.MemoryView":358 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] * __pyx_memoryview_thread_locks_used += 1 * if self.lock is NULL: # <<<<<<<<<<<<<< * self.lock = PyThread_allocate_lock() * if self.lock is NULL: */ } /* "View.MemoryView":363 * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { /* "View.MemoryView":364 * * if flags & PyBUF_FORMAT: * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<< * else: * self.dtype_is_object = dtype_is_object */ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L11_bool_binop_done; } __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; __pyx_v_self->dtype_is_object = __pyx_t_1; /* "View.MemoryView":363 * raise MemoryError * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: */ goto __pyx_L10; } /* "View.MemoryView":366 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') * else: * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<< * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( */ /*else*/ { __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object; } __pyx_L10:; /* "View.MemoryView":368 * self.dtype_is_object = dtype_is_object * * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<< * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL */ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int)))); /* "View.MemoryView":370 * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( * &self.acquisition_count[0], sizeof(__pyx_atomic_int)) * self.typeinfo = NULL # <<<<<<<<<<<<<< * * def __dealloc__(memoryview self): */ __pyx_v_self->typeinfo = NULL; /* "View.MemoryView":345 * cdef __Pyx_TypeInfo *typeinfo * * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<< * self.obj = obj * self.flags = flags */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":372 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) */ /* Python wrapper */ static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) { int __pyx_v_i; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyThread_type_lock __pyx_t_6; PyThread_type_lock __pyx_t_7; __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":373 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: */ __pyx_t_1 = (__pyx_v_self->obj != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":374 * def __dealloc__(memoryview self): * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<< * elif (<__pyx_buffer *> &self.view).obj == Py_None: * */ __Pyx_ReleaseBuffer((&__pyx_v_self->view)); /* "View.MemoryView":373 * * def __dealloc__(memoryview self): * if self.obj is not None: # <<<<<<<<<<<<<< * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: */ goto __pyx_L3; } /* "View.MemoryView":375 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< * * (<__pyx_buffer *> &self.view).obj = NULL */ __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0); if (__pyx_t_2) { /* "View.MemoryView":377 * elif (<__pyx_buffer *> &self.view).obj == Py_None: * * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<< * Py_DECREF(Py_None) * */ ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL; /* "View.MemoryView":378 * * (<__pyx_buffer *> &self.view).obj = NULL * Py_DECREF(Py_None) # <<<<<<<<<<<<<< * * cdef int i */ Py_DECREF(Py_None); /* "View.MemoryView":375 * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<< * * (<__pyx_buffer *> &self.view).obj = NULL */ } __pyx_L3:; /* "View.MemoryView":382 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: */ __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0); if (__pyx_t_2) { /* "View.MemoryView":383 * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<< * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 */ __pyx_t_3 = __pyx_memoryview_thread_locks_used; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "View.MemoryView":384 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: */ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0); if (__pyx_t_2) { /* "View.MemoryView":385 * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<< * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( */ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1); /* "View.MemoryView":386 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0); if (__pyx_t_2) { /* "View.MemoryView":388 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<< * break * else: */ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]); __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]); /* "View.MemoryView":387 * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break */ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6; (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7; /* "View.MemoryView":386 * if __pyx_memoryview_thread_locks[i] is self.lock: * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) */ } /* "View.MemoryView":389 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) * break # <<<<<<<<<<<<<< * else: * PyThread_free_lock(self.lock) */ goto __pyx_L6_break; /* "View.MemoryView":384 * if self.lock != NULL: * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<< * __pyx_memoryview_thread_locks_used -= 1 * if i != __pyx_memoryview_thread_locks_used: */ } } /*else*/ { /* "View.MemoryView":391 * break * else: * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<< * * cdef char *get_item_pointer(memoryview self, object index) except NULL: */ PyThread_free_lock(__pyx_v_self->lock); } __pyx_L6_break:; /* "View.MemoryView":382 * cdef int i * global __pyx_memoryview_thread_locks_used * if self.lock != NULL: # <<<<<<<<<<<<<< * for i in range(__pyx_memoryview_thread_locks_used): * if __pyx_memoryview_thread_locks[i] is self.lock: */ } /* "View.MemoryView":372 * self.typeinfo = NULL * * def __dealloc__(memoryview self): # <<<<<<<<<<<<<< * if self.obj is not None: * __Pyx_ReleaseBuffer(&self.view) */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "View.MemoryView":393 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf */ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { Py_ssize_t __pyx_v_dim; char *__pyx_v_itemp; PyObject *__pyx_v_idx = NULL; char *__pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; char *__pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_item_pointer", 0); /* "View.MemoryView":395 * cdef char *get_item_pointer(memoryview self, object index) except NULL: * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf # <<<<<<<<<<<<<< * * for dim, idx in enumerate(index): */ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf); /* "View.MemoryView":397 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) * */ __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) { __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 397, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(56, 397, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(56, 397, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(56, 397, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5); __pyx_t_5 = 0; __pyx_v_dim = __pyx_t_1; __pyx_t_1 = (__pyx_t_1 + 1); /* "View.MemoryView":398 * * for dim, idx in enumerate(index): * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<< * * return itemp */ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 398, __pyx_L1_error) __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(56, 398, __pyx_L1_error) __pyx_v_itemp = __pyx_t_7; /* "View.MemoryView":397 * cdef char *itemp = self.view.buf * * for dim, idx in enumerate(index): # <<<<<<<<<<<<<< * itemp = pybuffer_index(&self.view, itemp, idx, dim) * */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":400 * itemp = pybuffer_index(&self.view, itemp, idx, dim) * * return itemp # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_itemp; goto __pyx_L0; /* "View.MemoryView":393 * PyThread_free_lock(self.lock) * * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<< * cdef Py_ssize_t dim * cdef char *itemp = self.view.buf */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_idx); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":403 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self */ /* Python wrapper */ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_v_have_slices = NULL; PyObject *__pyx_v_indices = NULL; char *__pyx_v_itemp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; char *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); /* "View.MemoryView":404 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self * */ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":405 * def __getitem__(memoryview self, object index): * if index is Ellipsis: * return self # <<<<<<<<<<<<<< * * have_slices, indices = _unellipsify(index, self.view.ndim) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "View.MemoryView":404 * * def __getitem__(memoryview self, object index): * if index is Ellipsis: # <<<<<<<<<<<<<< * return self * */ } /* "View.MemoryView":407 * return self * * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * cdef char *itemp */ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(__pyx_t_3 != Py_None)) { PyObject* sequence = __pyx_t_3; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(56, 407, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(56, 407, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_4; __pyx_t_4 = 0; __pyx_v_indices = __pyx_t_5; __pyx_t_5 = 0; /* "View.MemoryView":410 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(56, 410, __pyx_L1_error) if (__pyx_t_2) { /* "View.MemoryView":411 * cdef char *itemp * if have_slices: * return memview_slice(self, indices) # <<<<<<<<<<<<<< * else: * itemp = self.get_item_pointer(indices) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "View.MemoryView":410 * * cdef char *itemp * if have_slices: # <<<<<<<<<<<<<< * return memview_slice(self, indices) * else: */ } /* "View.MemoryView":413 * return memview_slice(self, indices) * else: * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<< * return self.convert_item_to_object(itemp) * */ /*else*/ { __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(56, 413, __pyx_L1_error) __pyx_v_itemp = __pyx_t_6; /* "View.MemoryView":414 * else: * itemp = self.get_item_pointer(indices) * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<< * * def __setitem__(memoryview self, object index, object value): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "View.MemoryView":403 * * * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<< * if index is Ellipsis: * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_have_slices); __Pyx_XDECREF(__pyx_v_indices); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") */ /* Python wrapper */ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { PyObject *__pyx_v_have_slices = NULL; PyObject *__pyx_v_obj = NULL; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); __Pyx_INCREF(__pyx_v_index); /* "View.MemoryView":417 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") * */ __pyx_t_1 = (__pyx_v_self->view.readonly != 0); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":418 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(56, 418, __pyx_L1_error) /* "View.MemoryView":417 * * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: # <<<<<<<<<<<<<< * raise TypeError("Cannot assign to read-only memoryview") * */ } /* "View.MemoryView":420 * raise TypeError("Cannot assign to read-only memoryview") * * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<< * * if have_slices: */ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(56, 420, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(56, 420, __pyx_L1_error) } __pyx_v_have_slices = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(56, 422, __pyx_L1_error) if (__pyx_t_1) { /* "View.MemoryView":423 * * if have_slices: * obj = self.is_slice(value) # <<<<<<<<<<<<<< * if obj: * self.setitem_slice_assignment(self[index], obj) */ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_obj = __pyx_t_2; __pyx_t_2 = 0; /* "View.MemoryView":424 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(56, 424, __pyx_L1_error) if (__pyx_t_1) { /* "View.MemoryView":425 * obj = self.is_slice(value) * if obj: * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<< * else: * self.setitem_slice_assign_scalar(self[index], value) */ __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":424 * if have_slices: * obj = self.is_slice(value) * if obj: # <<<<<<<<<<<<<< * self.setitem_slice_assignment(self[index], obj) * else: */ goto __pyx_L5; } /* "View.MemoryView":427 * self.setitem_slice_assignment(self[index], obj) * else: * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<< * else: * self.setitem_indexed(index, value) */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(56, 427, __pyx_L1_error) __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L5:; /* "View.MemoryView":422 * have_slices, index = _unellipsify(index, self.view.ndim) * * if have_slices: # <<<<<<<<<<<<<< * obj = self.is_slice(value) * if obj: */ goto __pyx_L4; } /* "View.MemoryView":429 * self.setitem_slice_assign_scalar(self[index], value) * else: * self.setitem_indexed(index, value) # <<<<<<<<<<<<<< * * cdef is_slice(self, obj): */ /*else*/ { __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L4:; /* "View.MemoryView":416 * return self.convert_item_to_object(itemp) * * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<< * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_have_slices); __Pyx_XDECREF(__pyx_v_obj); __Pyx_XDECREF(__pyx_v_index); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":431 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: */ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_slice", 0); __Pyx_INCREF(__pyx_v_obj); /* "View.MemoryView":432 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":433 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_5); /*try:*/ { /* "View.MemoryView":434 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 434, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":435 * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) # <<<<<<<<<<<<<< * except TypeError: * return None */ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 435, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); /* "View.MemoryView":434 * if not isinstance(obj, memoryview): * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<< * self.dtype_is_object) * except TypeError: */ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(56, 434, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 434, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":433 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "View.MemoryView":436 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) * except TypeError: # <<<<<<<<<<<<<< * return None * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(56, 436, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_6); /* "View.MemoryView":437 * self.dtype_is_object) * except TypeError: * return None # <<<<<<<<<<<<<< * * return obj */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L7_except_return; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "View.MemoryView":433 * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): * try: # <<<<<<<<<<<<<< * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, * self.dtype_is_object) */ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L1_error; __pyx_L7_except_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_XGIVEREF(__pyx_t_5); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5); goto __pyx_L0; __pyx_L9_try_end:; } /* "View.MemoryView":432 * * cdef is_slice(self, obj): * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<< * try: * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, */ } /* "View.MemoryView":439 * return None * * return obj # <<<<<<<<<<<<<< * * cdef setitem_slice_assignment(self, dst, src): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_obj); __pyx_r = __pyx_v_obj; goto __pyx_L0; /* "View.MemoryView":431 * self.setitem_indexed(index, value) * * cdef is_slice(self, obj): # <<<<<<<<<<<<<< * if not isinstance(obj, memoryview): * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":441 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice */ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) { __Pyx_memviewslice __pyx_v_dst_slice; __Pyx_memviewslice __pyx_v_src_slice; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; __Pyx_memviewslice *__pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assignment", 0); /* "View.MemoryView":445 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(56, 445, __pyx_L1_error) __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(56, 445, __pyx_L1_error) /* "View.MemoryView":446 * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<< * src.ndim, dst.ndim, self.dtype_is_object) * */ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(56, 446, __pyx_L1_error) __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(56, 446, __pyx_L1_error) /* "View.MemoryView":447 * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<< * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(56, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(56, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":445 * cdef __Pyx_memviewslice src_slice * * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<< * get_slice_from_memview(dst, &dst_slice)[0], * src.ndim, dst.ndim, self.dtype_is_object) */ __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(56, 445, __pyx_L1_error) /* "View.MemoryView":441 * return obj * * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice dst_slice * cdef __Pyx_memviewslice src_slice */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL */ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) { int __pyx_v_array[0x80]; void *__pyx_v_tmp; void *__pyx_v_item; __Pyx_memviewslice *__pyx_v_dst_slice; __Pyx_memviewslice __pyx_v_tmp_slice; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; char const *__pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0); /* "View.MemoryView":451 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): * cdef int array[128] * cdef void *tmp = NULL # <<<<<<<<<<<<<< * cdef void *item * */ __pyx_v_tmp = NULL; /* "View.MemoryView":456 * cdef __Pyx_memviewslice *dst_slice * cdef __Pyx_memviewslice tmp_slice * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<< * * if self.view.itemsize > sizeof(array): */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(56, 456, __pyx_L1_error) __pyx_v_dst_slice = __pyx_t_1; /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: */ __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0); if (__pyx_t_2) { /* "View.MemoryView":459 * * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<< * if tmp == NULL: * raise MemoryError */ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize); /* "View.MemoryView":460 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< * raise MemoryError * item = tmp */ __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":461 * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: * raise MemoryError # <<<<<<<<<<<<<< * item = tmp * else: */ PyErr_NoMemory(); __PYX_ERR(56, 461, __pyx_L1_error) /* "View.MemoryView":460 * if self.view.itemsize > sizeof(array): * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: # <<<<<<<<<<<<<< * raise MemoryError * item = tmp */ } /* "View.MemoryView":462 * if tmp == NULL: * raise MemoryError * item = tmp # <<<<<<<<<<<<<< * else: * item = array */ __pyx_v_item = __pyx_v_tmp; /* "View.MemoryView":458 * dst_slice = get_slice_from_memview(dst, &tmp_slice) * * if self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<< * tmp = PyMem_Malloc(self.view.itemsize) * if tmp == NULL: */ goto __pyx_L3; } /* "View.MemoryView":464 * item = tmp * else: * item = array # <<<<<<<<<<<<<< * * try: */ /*else*/ { __pyx_v_item = ((void *)__pyx_v_array); } __pyx_L3:; /* "View.MemoryView":466 * item = array * * try: # <<<<<<<<<<<<<< * if self.dtype_is_object: * ( item)[0] = value */ /*try:*/ { /* "View.MemoryView":467 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value * else: */ __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0); if (__pyx_t_2) { /* "View.MemoryView":468 * try: * if self.dtype_is_object: * ( item)[0] = value # <<<<<<<<<<<<<< * else: * self.assign_item_from_object( item, value) */ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value); /* "View.MemoryView":467 * * try: * if self.dtype_is_object: # <<<<<<<<<<<<<< * ( item)[0] = value * else: */ goto __pyx_L8; } /* "View.MemoryView":470 * ( item)[0] = value * else: * self.assign_item_from_object( item, value) # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 470, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L8:; /* "View.MemoryView":474 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, */ __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0); if (__pyx_t_2) { /* "View.MemoryView":475 * * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<< * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, * item, self.dtype_is_object) */ __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 475, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":474 * * * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<< * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, */ } /* "View.MemoryView":476 * if self.view.suboffsets != NULL: * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<< * item, self.dtype_is_object) * finally: */ __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object); } /* "View.MemoryView":479 * item, self.dtype_is_object) * finally: * PyMem_Free(tmp) # <<<<<<<<<<<<<< * * cdef setitem_indexed(self, index, value): */ /*finally:*/ { /*normal exit:*/{ PyMem_Free(__pyx_v_tmp); goto __pyx_L7; } __pyx_L6_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_8); __Pyx_XGOTREF(__pyx_t_9); __Pyx_XGOTREF(__pyx_t_10); __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; { PyMem_Free(__pyx_v_tmp); } if (PY_MAJOR_VERSION >= 3) { __Pyx_XGIVEREF(__pyx_t_10); __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); } __Pyx_XGIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_8); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; goto __pyx_L1_error; } __pyx_L7:; } /* "View.MemoryView":449 * src.ndim, dst.ndim, self.dtype_is_object) * * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<< * cdef int array[128] * cdef void *tmp = NULL */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":481 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) */ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) { char *__pyx_v_itemp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setitem_indexed", 0); /* "View.MemoryView":482 * * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<< * self.assign_item_from_object(itemp, value) * */ __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(56, 482, __pyx_L1_error) __pyx_v_itemp = __pyx_t_1; /* "View.MemoryView":483 * cdef setitem_indexed(self, index, value): * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":481 * PyMem_Free(tmp) * * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<< * cdef char *itemp = self.get_item_pointer(index) * self.assign_item_from_object(itemp, value) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) { PyObject *__pyx_v_struct = NULL; PyObject *__pyx_v_bytesitem = 0; PyObject *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; size_t __pyx_t_10; int __pyx_t_11; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); /* "View.MemoryView":488 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef bytes bytesitem * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; /* "View.MemoryView":491 * cdef bytes bytesitem * * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<< * try: * result = struct.unpack(self.view.format, bytesitem) */ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_bytesitem = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":492 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_4); /*try:*/ { /* "View.MemoryView":493 * bytesitem = itemp[:self.view.itemsize] * try: * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<< * except struct.error: * raise ValueError("Unable to convert item to object") */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 493, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 493, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 493, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 493, __pyx_L3_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 493, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_v_bytesitem); __Pyx_GIVEREF(__pyx_v_bytesitem); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem); __pyx_t_6 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 493, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; /* "View.MemoryView":492 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ } /* "View.MemoryView":497 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< * return result[0] * return result */ /*else:*/ { __pyx_t_10 = strlen(__pyx_v_self->view.format); __pyx_t_11 = ((__pyx_t_10 == 1) != 0); if (__pyx_t_11) { /* "View.MemoryView":498 * else: * if len(self.view.format) == 1: * return result[0] # <<<<<<<<<<<<<< * return result * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 498, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L6_except_return; /* "View.MemoryView":497 * raise ValueError("Unable to convert item to object") * else: * if len(self.view.format) == 1: # <<<<<<<<<<<<<< * return result[0] * return result */ } /* "View.MemoryView":499 * if len(self.view.format) == 1: * return result[0] * return result # <<<<<<<<<<<<<< * * cdef assign_item_from_object(self, char *itemp, object value): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L6_except_return; } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; /* "View.MemoryView":494 * try: * result = struct.unpack(self.view.format, bytesitem) * except struct.error: # <<<<<<<<<<<<<< * raise ValueError("Unable to convert item to object") * else: */ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 494, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0; if (__pyx_t_8) { __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(56, 494, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); /* "View.MemoryView":495 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 495, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_Raise(__pyx_t_6, 0, 0, 0); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __PYX_ERR(56, 495, __pyx_L5_except_error) } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "View.MemoryView":492 * * bytesitem = itemp[:self.view.itemsize] * try: # <<<<<<<<<<<<<< * result = struct.unpack(self.view.format, bytesitem) * except struct.error: */ __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L1_error; __pyx_L6_except_return:; __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); goto __pyx_L0; } /* "View.MemoryView":485 * self.assign_item_from_object(itemp, value) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_struct); __Pyx_XDECREF(__pyx_v_bytesitem); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":501 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { PyObject *__pyx_v_struct = NULL; char __pyx_v_c; PyObject *__pyx_v_bytesvalue = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; Py_ssize_t __pyx_t_9; PyObject *__pyx_t_10 = NULL; char *__pyx_t_11; char *__pyx_t_12; char *__pyx_t_13; char *__pyx_t_14; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); /* "View.MemoryView":504 * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" * import struct # <<<<<<<<<<<<<< * cdef char c * cdef bytes bytesvalue */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_struct = __pyx_t_1; __pyx_t_1 = 0; /* "View.MemoryView":509 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ __pyx_t_2 = PyTuple_Check(__pyx_v_value); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "View.MemoryView":510 * * if isinstance(value, tuple): * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<< * else: * bytesvalue = struct.pack(self.view.format, value) */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(56, 510, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "View.MemoryView":509 * cdef Py_ssize_t i * * if isinstance(value, tuple): # <<<<<<<<<<<<<< * bytesvalue = struct.pack(self.view.format, *value) * else: */ goto __pyx_L3; } /* "View.MemoryView":512 * bytesvalue = struct.pack(self.view.format, *value) * else: * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<< * * for i, c in enumerate(bytesvalue): */ /*else*/ { __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 512, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 512, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(56, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1); __Pyx_INCREF(__pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(56, 512, __pyx_L1_error) __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L3:; /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c * */ __pyx_t_9 = 0; if (unlikely(__pyx_v_bytesvalue == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable"); __PYX_ERR(56, 514, __pyx_L1_error) } __Pyx_INCREF(__pyx_v_bytesvalue); __pyx_t_10 = __pyx_v_bytesvalue; __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10); __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10)); for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) { __pyx_t_11 = __pyx_t_14; __pyx_v_c = (__pyx_t_11[0]); /* "View.MemoryView":515 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< * * @cname('getbuffer') */ __pyx_v_i = __pyx_t_9; /* "View.MemoryView":514 * bytesvalue = struct.pack(self.view.format, value) * * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<< * itemp[i] = c * */ __pyx_t_9 = (__pyx_t_9 + 1); /* "View.MemoryView":515 * * for i, c in enumerate(bytesvalue): * itemp[i] = c # <<<<<<<<<<<<<< * * @cname('getbuffer') */ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "View.MemoryView":501 * return result * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * """Only used if instantiated manually by the user, or if Cython doesn't * know how to convert the type""" */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_struct); __Pyx_XDECREF(__pyx_v_bytesvalue); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":518 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") */ /* Python wrapper */ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t *__pyx_t_4; char *__pyx_t_5; void *__pyx_t_6; int __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; if (__pyx_v_info == NULL) { PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete"); return -1; } __Pyx_RefNannySetupContext("__getbuffer__", 0); __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); __Pyx_GIVEREF(__pyx_v_info->obj); /* "View.MemoryView":519 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") * */ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->view.readonly != 0); __pyx_t_1 = __pyx_t_2; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "View.MemoryView":520 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 520, __pyx_L1_error) /* "View.MemoryView":519 * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<< * raise ValueError("Cannot create writable memory view from read-only memoryview") * */ } /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0); if (__pyx_t_1) { /* "View.MemoryView":523 * * if flags & PyBUF_ND: * info.shape = self.view.shape # <<<<<<<<<<<<<< * else: * info.shape = NULL */ __pyx_t_4 = __pyx_v_self->view.shape; __pyx_v_info->shape = __pyx_t_4; /* "View.MemoryView":522 * raise ValueError("Cannot create writable memory view from read-only memoryview") * * if flags & PyBUF_ND: # <<<<<<<<<<<<<< * info.shape = self.view.shape * else: */ goto __pyx_L6; } /* "View.MemoryView":525 * info.shape = self.view.shape * else: * info.shape = NULL # <<<<<<<<<<<<<< * * if flags & PyBUF_STRIDES: */ /*else*/ { __pyx_v_info->shape = NULL; } __pyx_L6:; /* "View.MemoryView":527 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0); if (__pyx_t_1) { /* "View.MemoryView":528 * * if flags & PyBUF_STRIDES: * info.strides = self.view.strides # <<<<<<<<<<<<<< * else: * info.strides = NULL */ __pyx_t_4 = __pyx_v_self->view.strides; __pyx_v_info->strides = __pyx_t_4; /* "View.MemoryView":527 * info.shape = NULL * * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<< * info.strides = self.view.strides * else: */ goto __pyx_L7; } /* "View.MemoryView":530 * info.strides = self.view.strides * else: * info.strides = NULL # <<<<<<<<<<<<<< * * if flags & PyBUF_INDIRECT: */ /*else*/ { __pyx_v_info->strides = NULL; } __pyx_L7:; /* "View.MemoryView":532 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0); if (__pyx_t_1) { /* "View.MemoryView":533 * * if flags & PyBUF_INDIRECT: * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<< * else: * info.suboffsets = NULL */ __pyx_t_4 = __pyx_v_self->view.suboffsets; __pyx_v_info->suboffsets = __pyx_t_4; /* "View.MemoryView":532 * info.strides = NULL * * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<< * info.suboffsets = self.view.suboffsets * else: */ goto __pyx_L8; } /* "View.MemoryView":535 * info.suboffsets = self.view.suboffsets * else: * info.suboffsets = NULL # <<<<<<<<<<<<<< * * if flags & PyBUF_FORMAT: */ /*else*/ { __pyx_v_info->suboffsets = NULL; } __pyx_L8:; /* "View.MemoryView":537 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: */ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0); if (__pyx_t_1) { /* "View.MemoryView":538 * * if flags & PyBUF_FORMAT: * info.format = self.view.format # <<<<<<<<<<<<<< * else: * info.format = NULL */ __pyx_t_5 = __pyx_v_self->view.format; __pyx_v_info->format = __pyx_t_5; /* "View.MemoryView":537 * info.suboffsets = NULL * * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<< * info.format = self.view.format * else: */ goto __pyx_L9; } /* "View.MemoryView":540 * info.format = self.view.format * else: * info.format = NULL # <<<<<<<<<<<<<< * * info.buf = self.view.buf */ /*else*/ { __pyx_v_info->format = NULL; } __pyx_L9:; /* "View.MemoryView":542 * info.format = NULL * * info.buf = self.view.buf # <<<<<<<<<<<<<< * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize */ __pyx_t_6 = __pyx_v_self->view.buf; __pyx_v_info->buf = __pyx_t_6; /* "View.MemoryView":543 * * info.buf = self.view.buf * info.ndim = self.view.ndim # <<<<<<<<<<<<<< * info.itemsize = self.view.itemsize * info.len = self.view.len */ __pyx_t_7 = __pyx_v_self->view.ndim; __pyx_v_info->ndim = __pyx_t_7; /* "View.MemoryView":544 * info.buf = self.view.buf * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<< * info.len = self.view.len * info.readonly = self.view.readonly */ __pyx_t_8 = __pyx_v_self->view.itemsize; __pyx_v_info->itemsize = __pyx_t_8; /* "View.MemoryView":545 * info.ndim = self.view.ndim * info.itemsize = self.view.itemsize * info.len = self.view.len # <<<<<<<<<<<<<< * info.readonly = self.view.readonly * info.obj = self */ __pyx_t_8 = __pyx_v_self->view.len; __pyx_v_info->len = __pyx_t_8; /* "View.MemoryView":546 * info.itemsize = self.view.itemsize * info.len = self.view.len * info.readonly = self.view.readonly # <<<<<<<<<<<<<< * info.obj = self * */ __pyx_t_1 = __pyx_v_self->view.readonly; __pyx_v_info->readonly = __pyx_t_1; /* "View.MemoryView":547 * info.len = self.view.len * info.readonly = self.view.readonly * info.obj = self # <<<<<<<<<<<<<< * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = ((PyObject *)__pyx_v_self); /* "View.MemoryView":518 * * @cname('getbuffer') * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<< * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; if (__pyx_v_info->obj != NULL) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } goto __pyx_L2; __pyx_L0:; if (__pyx_v_info->obj == Py_None) { __Pyx_GOTREF(__pyx_v_info->obj); __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0; } __pyx_L2:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":553 * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) { struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":554 * @property * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<< * transpose_memslice(&result.from_slice) * return result */ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(56, 554, __pyx_L1_error) __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1); __pyx_t_1 = 0; /* "View.MemoryView":555 * def T(self): * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<< * return result * */ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(56, 555, __pyx_L1_error) /* "View.MemoryView":556 * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) * return result # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "View.MemoryView":553 * * @property * def T(self): # <<<<<<<<<<<<<< * cdef _memoryviewslice result = memoryview_copy(self) * transpose_memslice(&result.from_slice) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":559 * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":560 * @property * def base(self): * return self.obj # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->obj); __pyx_r = __pyx_v_self->obj; goto __pyx_L0; /* "View.MemoryView":559 * * @property * def base(self): # <<<<<<<<<<<<<< * return self.obj * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":563 * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_v_length; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t *__pyx_t_2; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":564 * @property * def shape(self): * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_length = (__pyx_t_2[0]); __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(56, 564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "View.MemoryView":563 * * @property * def shape(self): # <<<<<<<<<<<<<< * return tuple([length for length in self.view.shape[:self.view.ndim]]) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":567 * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_v_stride; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; Py_ssize_t *__pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":568 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< * * raise ValueError("Buffer view does not expose strides") */ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":570 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(56, 570, __pyx_L1_error) /* "View.MemoryView":568 * @property * def strides(self): * if self.view.strides == NULL: # <<<<<<<<<<<<<< * * raise ValueError("Buffer view does not expose strides") */ } /* "View.MemoryView":572 * raise ValueError("Buffer view does not expose strides") * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_v_stride = (__pyx_t_3[0]); __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(56, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "View.MemoryView":567 * * @property * def strides(self): # <<<<<<<<<<<<<< * if self.view.strides == NULL: * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":575 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_v_suboffset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t *__pyx_t_4; Py_ssize_t *__pyx_t_5; Py_ssize_t *__pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":576 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim * */ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0); if (__pyx_t_1) { /* "View.MemoryView":577 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__66, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "View.MemoryView":576 * @property * def suboffsets(self): * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<< * return (-1,) * self.view.ndim * */ } /* "View.MemoryView":579 * return (-1,) * self.view.ndim * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim); for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) { __pyx_t_4 = __pyx_t_6; __pyx_v_suboffset = (__pyx_t_4[0]); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(56, 579, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":575 * * @property * def suboffsets(self): # <<<<<<<<<<<<<< * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":582 * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":583 * @property * def ndim(self): * return self.view.ndim # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":582 * * @property * def ndim(self): # <<<<<<<<<<<<<< * return self.view.ndim * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":586 * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":587 * @property * def itemsize(self): * return self.view.itemsize # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":586 * * @property * def itemsize(self): # <<<<<<<<<<<<<< * return self.view.itemsize * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":590 * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":591 * @property * def nbytes(self): * return self.size * self.view.itemsize # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "View.MemoryView":590 * * @property * def nbytes(self): # <<<<<<<<<<<<<< * return self.size * self.view.itemsize * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":594 * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: * result = 1 */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_v_result = NULL; PyObject *__pyx_v_length = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; Py_ssize_t *__pyx_t_5; PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":595 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 * */ __pyx_t_1 = (__pyx_v_self->_size == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":596 * def size(self): * if self._size is None: * result = 1 # <<<<<<<<<<<<<< * * for length in self.view.shape[:self.view.ndim]: */ __Pyx_INCREF(__pyx_int_1); __pyx_v_result = __pyx_int_1; /* "View.MemoryView":598 * result = 1 * * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<< * result *= length * */ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim); for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) { __pyx_t_3 = __pyx_t_5; __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6); __pyx_t_6 = 0; /* "View.MemoryView":599 * * for length in self.view.shape[:self.view.ndim]: * result *= length # <<<<<<<<<<<<<< * * self._size = result */ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6); __pyx_t_6 = 0; } /* "View.MemoryView":601 * result *= length * * self._size = result # <<<<<<<<<<<<<< * * return self._size */ __Pyx_INCREF(__pyx_v_result); __Pyx_GIVEREF(__pyx_v_result); __Pyx_GOTREF(__pyx_v_self->_size); __Pyx_DECREF(__pyx_v_self->_size); __pyx_v_self->_size = __pyx_v_result; /* "View.MemoryView":595 * @property * def size(self): * if self._size is None: # <<<<<<<<<<<<<< * result = 1 * */ } /* "View.MemoryView":603 * self._size = result * * return self._size # <<<<<<<<<<<<<< * * def __len__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_size); __pyx_r = __pyx_v_self->_size; goto __pyx_L0; /* "View.MemoryView":594 * * @property * def size(self): # <<<<<<<<<<<<<< * if self._size is None: * result = 1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_length); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":605 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] */ /* Python wrapper */ static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/ static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__len__", 0); /* "View.MemoryView":606 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] * */ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0); if (__pyx_t_1) { /* "View.MemoryView":607 * def __len__(self): * if self.view.ndim >= 1: * return self.view.shape[0] # <<<<<<<<<<<<<< * * return 0 */ __pyx_r = (__pyx_v_self->view.shape[0]); goto __pyx_L0; /* "View.MemoryView":606 * * def __len__(self): * if self.view.ndim >= 1: # <<<<<<<<<<<<<< * return self.view.shape[0] * */ } /* "View.MemoryView":609 * return self.view.shape[0] * * return 0 # <<<<<<<<<<<<<< * * def __repr__(self): */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":605 * return self._size * * def __len__(self): # <<<<<<<<<<<<<< * if self.view.ndim >= 1: * return self.view.shape[0] */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":611 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) */ /* Python wrapper */ static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); /* "View.MemoryView":612 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":613 * def __repr__(self): * return "" % (self.base.__class__.__name__, * id(self)) # <<<<<<<<<<<<<< * * def __str__(self): */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "View.MemoryView":612 * * def __repr__(self): * return "" % (self.base.__class__.__name__, # <<<<<<<<<<<<<< * id(self)) * */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":611 * return 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__, * id(self)) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":615 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) * */ /* Python wrapper */ static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); /* "View.MemoryView":616 * * def __str__(self): * return "" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":615 * id(self)) * * def __str__(self): # <<<<<<<<<<<<<< * return "" % (self.base.__class__.__name__,) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":619 * * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* Python wrapper */ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice *__pyx_v_mslice; __Pyx_memviewslice __pyx_v_tmp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_c_contig", 0); /* "View.MemoryView":622 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'C', self.view.ndim) * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(56, 622, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":623 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<< * * def is_f_contig(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":619 * * * def is_c_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* Python wrapper */ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice *__pyx_v_mslice; __Pyx_memviewslice __pyx_v_tmp; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice *__pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_f_contig", 0); /* "View.MemoryView":628 * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<< * return slice_is_contig(mslice[0], 'F', self.view.ndim) * */ __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(56, 628, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":629 * cdef __Pyx_memviewslice tmp * mslice = get_slice_from_memview(self, &tmp) * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<< * * def copy(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":625 * return slice_is_contig(mslice[0], 'C', self.view.ndim) * * def is_f_contig(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice *mslice * cdef __Pyx_memviewslice tmp */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ /* Python wrapper */ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice __pyx_v_mslice; int __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); /* "View.MemoryView":633 * def copy(self): * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<< * * slice_copy(self, &mslice) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS)); /* "View.MemoryView":635 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS * * slice_copy(self, &mslice) # <<<<<<<<<<<<<< * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, * self.view.itemsize, */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice)); /* "View.MemoryView":636 * * slice_copy(self, &mslice) * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_C_CONTIGUOUS, */ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 636, __pyx_L1_error) __pyx_v_mslice = __pyx_t_1; /* "View.MemoryView":641 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<< * * def copy_fortran(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":631 * return slice_is_contig(mslice[0], 'F', self.view.ndim) * * def copy(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice mslice * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ /* Python wrapper */ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0); __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) { __Pyx_memviewslice __pyx_v_src; __Pyx_memviewslice __pyx_v_dst; int __pyx_v_flags; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy_fortran", 0); /* "View.MemoryView":645 * def copy_fortran(self): * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<< * * slice_copy(self, &src) */ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS)); /* "View.MemoryView":647 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS * * slice_copy(self, &src) # <<<<<<<<<<<<<< * dst = slice_copy_contig(&src, "fortran", self.view.ndim, * self.view.itemsize, */ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src)); /* "View.MemoryView":648 * * slice_copy(self, &src) * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<< * self.view.itemsize, * flags|PyBUF_F_CONTIGUOUS, */ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(56, 648, __pyx_L1_error) __pyx_v_dst = __pyx_t_1; /* "View.MemoryView":653 * self.dtype_is_object) * * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":643 * return memoryview_copy_from_slice(self, &mslice) * * def copy_fortran(self): # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice src, dst * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(56, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(56, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":657 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo */ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) { struct __pyx_memoryview_obj *__pyx_v_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_cwrapper", 0); /* "View.MemoryView":658 * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<< * result.typeinfo = typeinfo * return result */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":659 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo # <<<<<<<<<<<<<< * return result * */ __pyx_v_result->typeinfo = __pyx_v_typeinfo; /* "View.MemoryView":660 * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo * return result # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_check') */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "View.MemoryView":657 * * @cname('__pyx_memoryview_new') * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<< * cdef memoryview result = memoryview(o, flags, dtype_is_object) * result.typeinfo = typeinfo */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":663 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) * */ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("memoryview_check", 0); /* "View.MemoryView":664 * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): * return isinstance(o, memoryview) # <<<<<<<<<<<<<< * * cdef tuple _unellipsify(object index, int ndim): */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); __pyx_r = __pyx_t_1; goto __pyx_L0; /* "View.MemoryView":663 * * @cname('__pyx_memoryview_check') * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<< * return isinstance(o, memoryview) * */ /* function exit code */ __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":666 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with */ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) { PyObject *__pyx_v_tup = NULL; PyObject *__pyx_v_result = NULL; int __pyx_v_have_slices; int __pyx_v_seen_ellipsis; CYTHON_UNUSED PyObject *__pyx_v_idx = NULL; PyObject *__pyx_v_item = NULL; Py_ssize_t __pyx_v_nslices; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; int __pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_unellipsify", 0); /* "View.MemoryView":671 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< * tup = (index,) * else: */ __pyx_t_1 = PyTuple_Check(__pyx_v_index); __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":672 * """ * if not isinstance(index, tuple): * tup = (index,) # <<<<<<<<<<<<<< * else: * tup = index */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_index); __Pyx_GIVEREF(__pyx_v_index); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index); __pyx_v_tup = __pyx_t_3; __pyx_t_3 = 0; /* "View.MemoryView":671 * full slices. * """ * if not isinstance(index, tuple): # <<<<<<<<<<<<<< * tup = (index,) * else: */ goto __pyx_L3; } /* "View.MemoryView":674 * tup = (index,) * else: * tup = index # <<<<<<<<<<<<<< * * result = [] */ /*else*/ { __Pyx_INCREF(__pyx_v_index); __pyx_v_tup = __pyx_v_index; } __pyx_L3:; /* "View.MemoryView":676 * tup = index * * result = [] # <<<<<<<<<<<<<< * have_slices = False * seen_ellipsis = False */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":677 * * result = [] * have_slices = False # <<<<<<<<<<<<<< * seen_ellipsis = False * for idx, item in enumerate(tup): */ __pyx_v_have_slices = 0; /* "View.MemoryView":678 * result = [] * have_slices = False * seen_ellipsis = False # <<<<<<<<<<<<<< * for idx, item in enumerate(tup): * if item is Ellipsis: */ __pyx_v_seen_ellipsis = 0; /* "View.MemoryView":679 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< * if item is Ellipsis: * if not seen_ellipsis: */ __Pyx_INCREF(__pyx_int_0); __pyx_t_3 = __pyx_int_0; if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) { __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 679, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(56, 679, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(56, 679, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_6(__pyx_t_4); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(56, 679, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3); __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_t_7; __pyx_t_7 = 0; /* "View.MemoryView":680 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) */ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "View.MemoryView":681 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True */ __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0); if (__pyx_t_1) { /* "View.MemoryView":682 * if item is Ellipsis: * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<< * seen_ellipsis = True * else: */ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(56, 682, __pyx_L1_error) __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) { __Pyx_INCREF(__pyx_slice__39); __Pyx_GIVEREF(__pyx_slice__39); PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__39); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(56, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "View.MemoryView":683 * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True # <<<<<<<<<<<<<< * else: * result.append(slice(None)) */ __pyx_v_seen_ellipsis = 1; /* "View.MemoryView":681 * for idx, item in enumerate(tup): * if item is Ellipsis: * if not seen_ellipsis: # <<<<<<<<<<<<<< * result.extend([slice(None)] * (ndim - len(tup) + 1)) * seen_ellipsis = True */ goto __pyx_L7; } /* "View.MemoryView":685 * seen_ellipsis = True * else: * result.append(slice(None)) # <<<<<<<<<<<<<< * have_slices = True * else: */ /*else*/ { __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__39); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(56, 685, __pyx_L1_error) } __pyx_L7:; /* "View.MemoryView":686 * else: * result.append(slice(None)) * have_slices = True # <<<<<<<<<<<<<< * else: * if not isinstance(item, slice) and not PyIndex_Check(item): */ __pyx_v_have_slices = 1; /* "View.MemoryView":680 * seen_ellipsis = False * for idx, item in enumerate(tup): * if item is Ellipsis: # <<<<<<<<<<<<<< * if not seen_ellipsis: * result.extend([slice(None)] * (ndim - len(tup) + 1)) */ goto __pyx_L6; } /* "View.MemoryView":688 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError("Cannot index with type '%s'" % type(item)) * */ /*else*/ { __pyx_t_2 = PySlice_Check(__pyx_v_item); __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0); if (__pyx_t_10) { } else { __pyx_t_1 = __pyx_t_10; goto __pyx_L9_bool_binop_done; } __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0); __pyx_t_1 = __pyx_t_10; __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_1)) { /* "View.MemoryView":689 * else: * if not isinstance(item, slice) and not PyIndex_Check(item): * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<< * * have_slices = have_slices or isinstance(item, slice) */ __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_Raise(__pyx_t_11, 0, 0, 0); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __PYX_ERR(56, 689, __pyx_L1_error) /* "View.MemoryView":688 * have_slices = True * else: * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<< * raise TypeError("Cannot index with type '%s'" % type(item)) * */ } /* "View.MemoryView":691 * raise TypeError("Cannot index with type '%s'" % type(item)) * * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<< * result.append(item) * */ __pyx_t_10 = (__pyx_v_have_slices != 0); if (!__pyx_t_10) { } else { __pyx_t_1 = __pyx_t_10; goto __pyx_L11_bool_binop_done; } __pyx_t_10 = PySlice_Check(__pyx_v_item); __pyx_t_2 = (__pyx_t_10 != 0); __pyx_t_1 = __pyx_t_2; __pyx_L11_bool_binop_done:; __pyx_v_have_slices = __pyx_t_1; /* "View.MemoryView":692 * * have_slices = have_slices or isinstance(item, slice) * result.append(item) # <<<<<<<<<<<<<< * * nslices = ndim - len(result) */ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(56, 692, __pyx_L1_error) } __pyx_L6:; /* "View.MemoryView":679 * have_slices = False * seen_ellipsis = False * for idx, item in enumerate(tup): # <<<<<<<<<<<<<< * if item is Ellipsis: * if not seen_ellipsis: */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":694 * result.append(item) * * nslices = ndim - len(result) # <<<<<<<<<<<<<< * if nslices: * result.extend([slice(None)] * nslices) */ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(56, 694, __pyx_L1_error) __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5); /* "View.MemoryView":695 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) * */ __pyx_t_1 = (__pyx_v_nslices != 0); if (__pyx_t_1) { /* "View.MemoryView":696 * nslices = ndim - len(result) * if nslices: * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<< * * return have_slices or nslices, tuple(result) */ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) { __Pyx_INCREF(__pyx_slice__39); __Pyx_GIVEREF(__pyx_slice__39); PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__39); } } __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(56, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":695 * * nslices = ndim - len(result) * if nslices: # <<<<<<<<<<<<<< * result.extend([slice(None)] * nslices) * */ } /* "View.MemoryView":698 * result.extend([slice(None)] * nslices) * * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<< * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): */ __Pyx_XDECREF(__pyx_r); if (!__pyx_v_have_slices) { } else { __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L14_bool_binop_done; } __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; __pyx_L14_bool_binop_done:; __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(56, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = ((PyObject*)__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L0; /* "View.MemoryView":666 * return isinstance(o, memoryview) * * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<< * """ * Replace all ellipses with full slices and fill incomplete indices with */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_tup); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_idx); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: */ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) { Py_ssize_t __pyx_v_suboffset; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations Py_ssize_t *__pyx_t_1; Py_ssize_t *__pyx_t_2; Py_ssize_t *__pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assert_direct_dimensions", 0); /* "View.MemoryView":701 * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") */ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim); for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) { __pyx_t_1 = __pyx_t_3; __pyx_v_suboffset = (__pyx_t_1[0]); /* "View.MemoryView":702 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") * */ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0); if (unlikely(__pyx_t_4)) { /* "View.MemoryView":703 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_Raise(__pyx_t_5, 0, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __PYX_ERR(56, 703, __pyx_L1_error) /* "View.MemoryView":702 * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * raise ValueError("Indirect dimensions not supported") * */ } } /* "View.MemoryView":700 * return have_slices or nslices, tuple(result) * * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<< * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":710 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim * cdef bint negative_step */ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) { int __pyx_v_new_ndim; int __pyx_v_suboffset_dim; int __pyx_v_dim; __Pyx_memviewslice __pyx_v_src; __Pyx_memviewslice __pyx_v_dst; __Pyx_memviewslice *__pyx_v_p_src; struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0; __Pyx_memviewslice *__pyx_v_p_dst; int *__pyx_v_p_suboffset_dim; Py_ssize_t __pyx_v_start; Py_ssize_t __pyx_v_stop; Py_ssize_t __pyx_v_step; int __pyx_v_have_start; int __pyx_v_have_stop; int __pyx_v_have_step; PyObject *__pyx_v_index = NULL; struct __pyx_memoryview_obj *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; struct __pyx_memoryview_obj *__pyx_t_4; char *__pyx_t_5; int __pyx_t_6; Py_ssize_t __pyx_t_7; PyObject *(*__pyx_t_8)(PyObject *); PyObject *__pyx_t_9 = NULL; Py_ssize_t __pyx_t_10; int __pyx_t_11; Py_ssize_t __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memview_slice", 0); /* "View.MemoryView":711 * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<< * cdef bint negative_step * cdef __Pyx_memviewslice src, dst */ __pyx_v_new_ndim = 0; __pyx_v_suboffset_dim = -1; /* "View.MemoryView":718 * * * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<< * * cdef _memoryviewslice memviewsliceobj */ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)))); /* "View.MemoryView":722 * cdef _memoryviewslice memviewsliceobj * * assert memview.view.ndim > 0 # <<<<<<<<<<<<<< * * if isinstance(memview, _memoryviewslice): */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(56, 722, __pyx_L1_error) } } #endif /* "View.MemoryView":724 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":725 * * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview # <<<<<<<<<<<<<< * p_src = &memviewsliceobj.from_slice * else: */ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(56, 725, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":726 * if isinstance(memview, _memoryviewslice): * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<< * else: * slice_copy(memview, &src) */ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice); /* "View.MemoryView":724 * assert memview.view.ndim > 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * memviewsliceobj = memview * p_src = &memviewsliceobj.from_slice */ goto __pyx_L3; } /* "View.MemoryView":728 * p_src = &memviewsliceobj.from_slice * else: * slice_copy(memview, &src) # <<<<<<<<<<<<<< * p_src = &src * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src)); /* "View.MemoryView":729 * else: * slice_copy(memview, &src) * p_src = &src # <<<<<<<<<<<<<< * * */ __pyx_v_p_src = (&__pyx_v_src); } __pyx_L3:; /* "View.MemoryView":735 * * * dst.memview = p_src.memview # <<<<<<<<<<<<<< * dst.data = p_src.data * */ __pyx_t_4 = __pyx_v_p_src->memview; __pyx_v_dst.memview = __pyx_t_4; /* "View.MemoryView":736 * * dst.memview = p_src.memview * dst.data = p_src.data # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __pyx_v_p_src->data; __pyx_v_dst.data = __pyx_t_5; /* "View.MemoryView":741 * * * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<< * cdef int *p_suboffset_dim = &suboffset_dim * cdef Py_ssize_t start, stop, step */ __pyx_v_p_dst = (&__pyx_v_dst); /* "View.MemoryView":742 * * cdef __Pyx_memviewslice *p_dst = &dst * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<< * cdef Py_ssize_t start, stop, step * cdef bint have_start, have_stop, have_step */ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim); /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( */ __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) { __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(56, 746, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(56, 746, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(56, 746, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(56, 746, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9); __pyx_t_9 = 0; __pyx_v_dim = __pyx_t_6; __pyx_t_6 = (__pyx_t_6 + 1); /* "View.MemoryView":747 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], */ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0); if (__pyx_t_2) { /* "View.MemoryView":751 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<< * 0, 0, 0, # have_{start,stop,step} * False) */ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 751, __pyx_L1_error) /* "View.MemoryView":748 * for dim, index in enumerate(indices): * if PyIndex_Check(index): * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(56, 748, __pyx_L1_error) /* "View.MemoryView":747 * * for dim, index in enumerate(indices): * if PyIndex_Check(index): # <<<<<<<<<<<<<< * slice_memviewslice( * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], */ goto __pyx_L6; } /* "View.MemoryView":754 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 */ __pyx_t_2 = (__pyx_v_index == Py_None); __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "View.MemoryView":755 * False) * elif index is None: * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<< * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 */ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1; /* "View.MemoryView":756 * elif index is None: * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<< * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 */ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0; /* "View.MemoryView":757 * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<< * new_ndim += 1 * else: */ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L; /* "View.MemoryView":758 * p_dst.strides[new_ndim] = 0 * p_dst.suboffsets[new_ndim] = -1 * new_ndim += 1 # <<<<<<<<<<<<<< * else: * start = index.start or 0 */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); /* "View.MemoryView":754 * 0, 0, 0, # have_{start,stop,step} * False) * elif index is None: # <<<<<<<<<<<<<< * p_dst.shape[new_ndim] = 1 * p_dst.strides[new_ndim] = 0 */ goto __pyx_L6; } /* "View.MemoryView":760 * new_ndim += 1 * else: * start = index.start or 0 # <<<<<<<<<<<<<< * stop = index.stop or 0 * step = index.step or 0 */ /*else*/ { __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(56, 760, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 760, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L7_bool_binop_done; } __pyx_t_10 = 0; __pyx_L7_bool_binop_done:; __pyx_v_start = __pyx_t_10; /* "View.MemoryView":761 * else: * start = index.start or 0 * stop = index.stop or 0 # <<<<<<<<<<<<<< * step = index.step or 0 * */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(56, 761, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 761, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L9_bool_binop_done; } __pyx_t_10 = 0; __pyx_L9_bool_binop_done:; __pyx_v_stop = __pyx_t_10; /* "View.MemoryView":762 * start = index.start or 0 * stop = index.stop or 0 * step = index.step or 0 # <<<<<<<<<<<<<< * * have_start = index.start is not None */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(56, 762, __pyx_L1_error) if (!__pyx_t_1) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else { __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 762, __pyx_L1_error) __pyx_t_10 = __pyx_t_12; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L11_bool_binop_done; } __pyx_t_10 = 0; __pyx_L11_bool_binop_done:; __pyx_v_step = __pyx_t_10; /* "View.MemoryView":764 * step = index.step or 0 * * have_start = index.start is not None # <<<<<<<<<<<<<< * have_stop = index.stop is not None * have_step = index.step is not None */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_start = __pyx_t_1; /* "View.MemoryView":765 * * have_start = index.start is not None * have_stop = index.stop is not None # <<<<<<<<<<<<<< * have_step = index.step is not None * */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_stop = __pyx_t_1; /* "View.MemoryView":766 * have_start = index.start is not None * have_stop = index.stop is not None * have_step = index.step is not None # <<<<<<<<<<<<<< * * slice_memviewslice( */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(56, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = (__pyx_t_9 != Py_None); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_have_step = __pyx_t_1; /* "View.MemoryView":768 * have_step = index.step is not None * * slice_memviewslice( # <<<<<<<<<<<<<< * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim], * dim, new_ndim, p_suboffset_dim, */ __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(56, 768, __pyx_L1_error) /* "View.MemoryView":774 * have_start, have_stop, have_step, * True) * new_ndim += 1 # <<<<<<<<<<<<<< * * if isinstance(memview, _memoryviewslice): */ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1); } __pyx_L6:; /* "View.MemoryView":746 * cdef bint have_start, have_stop, have_step * * for dim, index in enumerate(indices): # <<<<<<<<<<<<<< * if PyIndex_Check(index): * slice_memviewslice( */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":776 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":777 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ __Pyx_XDECREF(((PyObject *)__pyx_r)); /* "View.MemoryView":778 * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<< * memviewsliceobj.to_dtype_func, * memview.dtype_is_object) */ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(56, 778, __pyx_L1_error) } /* "View.MemoryView":779 * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<< * memview.dtype_is_object) * else: */ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(56, 779, __pyx_L1_error) } /* "View.MemoryView":777 * * if isinstance(memview, _memoryviewslice): * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<< * memviewsliceobj.to_object_func, * memviewsliceobj.to_dtype_func, */ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(56, 777, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "View.MemoryView":776 * new_ndim += 1 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * return memoryview_fromslice(dst, new_ndim, * memviewsliceobj.to_object_func, */ } /* "View.MemoryView":782 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ /*else*/ { __Pyx_XDECREF(((PyObject *)__pyx_r)); /* "View.MemoryView":783 * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "View.MemoryView":782 * memview.dtype_is_object) * else: * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<< * memview.dtype_is_object) * */ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(56, 782, __pyx_L1_error) __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } /* "View.MemoryView":710 * * @cname('__pyx_memview_slice') * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<< * cdef int new_ndim = 0, suboffset_dim = -1, dim * cdef bint negative_step */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj); __Pyx_XDECREF(__pyx_v_index); __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":807 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) { Py_ssize_t __pyx_v_new_shape; int __pyx_v_negative_step; int __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "View.MemoryView":827 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< * * if start < 0: */ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_1) { /* "View.MemoryView":829 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: */ __pyx_t_1 = ((__pyx_v_start < 0) != 0); if (__pyx_t_1) { /* "View.MemoryView":830 * * if start < 0: * start += shape # <<<<<<<<<<<<<< * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); /* "View.MemoryView":829 * if not is_slice: * * if start < 0: # <<<<<<<<<<<<<< * start += shape * if not 0 <= start < shape: */ } /* "View.MemoryView":831 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) * else: */ __pyx_t_1 = (0 <= __pyx_v_start); if (__pyx_t_1) { __pyx_t_1 = (__pyx_v_start < __pyx_v_shape); } __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":832 * start += shape * if not 0 <= start < shape: * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<< * else: * */ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(56, 832, __pyx_L1_error) /* "View.MemoryView":831 * if start < 0: * start += shape * if not 0 <= start < shape: # <<<<<<<<<<<<<< * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) * else: */ } /* "View.MemoryView":827 * cdef bint negative_step * * if not is_slice: # <<<<<<<<<<<<<< * * if start < 0: */ goto __pyx_L3; } /* "View.MemoryView":835 * else: * * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<< * * if have_step and step == 0: */ /*else*/ { __pyx_t_1 = ((__pyx_v_have_step != 0) != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } __pyx_t_1 = ((__pyx_v_step < 0) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; __pyx_v_negative_step = __pyx_t_2; /* "View.MemoryView":837 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) * */ __pyx_t_1 = (__pyx_v_have_step != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L9_bool_binop_done; } __pyx_t_1 = ((__pyx_v_step == 0) != 0); __pyx_t_2 = __pyx_t_1; __pyx_L9_bool_binop_done:; if (__pyx_t_2) { /* "View.MemoryView":838 * * if have_step and step == 0: * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(56, 838, __pyx_L1_error) /* "View.MemoryView":837 * negative_step = have_step != 0 and step < 0 * * if have_step and step == 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) * */ } /* "View.MemoryView":841 * * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape */ __pyx_t_2 = (__pyx_v_have_start != 0); if (__pyx_t_2) { /* "View.MemoryView":842 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape * if start < 0: */ __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":843 * if have_start: * if start < 0: * start += shape # <<<<<<<<<<<<<< * if start < 0: * start = 0 */ __pyx_v_start = (__pyx_v_start + __pyx_v_shape); /* "View.MemoryView":844 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< * start = 0 * elif start >= shape: */ __pyx_t_2 = ((__pyx_v_start < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":845 * start += shape * if start < 0: * start = 0 # <<<<<<<<<<<<<< * elif start >= shape: * if negative_step: */ __pyx_v_start = 0; /* "View.MemoryView":844 * if start < 0: * start += shape * if start < 0: # <<<<<<<<<<<<<< * start = 0 * elif start >= shape: */ } /* "View.MemoryView":842 * * if have_start: * if start < 0: # <<<<<<<<<<<<<< * start += shape * if start < 0: */ goto __pyx_L12; } /* "View.MemoryView":846 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< * if negative_step: * start = shape - 1 */ __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0); if (__pyx_t_2) { /* "View.MemoryView":847 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { /* "View.MemoryView":848 * elif start >= shape: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< * else: * start = shape */ __pyx_v_start = (__pyx_v_shape - 1); /* "View.MemoryView":847 * start = 0 * elif start >= shape: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ goto __pyx_L14; } /* "View.MemoryView":850 * start = shape - 1 * else: * start = shape # <<<<<<<<<<<<<< * else: * if negative_step: */ /*else*/ { __pyx_v_start = __pyx_v_shape; } __pyx_L14:; /* "View.MemoryView":846 * if start < 0: * start = 0 * elif start >= shape: # <<<<<<<<<<<<<< * if negative_step: * start = shape - 1 */ } __pyx_L12:; /* "View.MemoryView":841 * * * if have_start: # <<<<<<<<<<<<<< * if start < 0: * start += shape */ goto __pyx_L11; } /* "View.MemoryView":852 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ /*else*/ { __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { /* "View.MemoryView":853 * else: * if negative_step: * start = shape - 1 # <<<<<<<<<<<<<< * else: * start = 0 */ __pyx_v_start = (__pyx_v_shape - 1); /* "View.MemoryView":852 * start = shape * else: * if negative_step: # <<<<<<<<<<<<<< * start = shape - 1 * else: */ goto __pyx_L15; } /* "View.MemoryView":855 * start = shape - 1 * else: * start = 0 # <<<<<<<<<<<<<< * * if have_stop: */ /*else*/ { __pyx_v_start = 0; } __pyx_L15:; } __pyx_L11:; /* "View.MemoryView":857 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape */ __pyx_t_2 = (__pyx_v_have_stop != 0); if (__pyx_t_2) { /* "View.MemoryView":858 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape * if stop < 0: */ __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":859 * if have_stop: * if stop < 0: * stop += shape # <<<<<<<<<<<<<< * if stop < 0: * stop = 0 */ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape); /* "View.MemoryView":860 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< * stop = 0 * elif stop > shape: */ __pyx_t_2 = ((__pyx_v_stop < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":861 * stop += shape * if stop < 0: * stop = 0 # <<<<<<<<<<<<<< * elif stop > shape: * stop = shape */ __pyx_v_stop = 0; /* "View.MemoryView":860 * if stop < 0: * stop += shape * if stop < 0: # <<<<<<<<<<<<<< * stop = 0 * elif stop > shape: */ } /* "View.MemoryView":858 * * if have_stop: * if stop < 0: # <<<<<<<<<<<<<< * stop += shape * if stop < 0: */ goto __pyx_L17; } /* "View.MemoryView":862 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< * stop = shape * else: */ __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0); if (__pyx_t_2) { /* "View.MemoryView":863 * stop = 0 * elif stop > shape: * stop = shape # <<<<<<<<<<<<<< * else: * if negative_step: */ __pyx_v_stop = __pyx_v_shape; /* "View.MemoryView":862 * if stop < 0: * stop = 0 * elif stop > shape: # <<<<<<<<<<<<<< * stop = shape * else: */ } __pyx_L17:; /* "View.MemoryView":857 * start = 0 * * if have_stop: # <<<<<<<<<<<<<< * if stop < 0: * stop += shape */ goto __pyx_L16; } /* "View.MemoryView":865 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< * stop = -1 * else: */ /*else*/ { __pyx_t_2 = (__pyx_v_negative_step != 0); if (__pyx_t_2) { /* "View.MemoryView":866 * else: * if negative_step: * stop = -1 # <<<<<<<<<<<<<< * else: * stop = shape */ __pyx_v_stop = -1L; /* "View.MemoryView":865 * stop = shape * else: * if negative_step: # <<<<<<<<<<<<<< * stop = -1 * else: */ goto __pyx_L19; } /* "View.MemoryView":868 * stop = -1 * else: * stop = shape # <<<<<<<<<<<<<< * * if not have_step: */ /*else*/ { __pyx_v_stop = __pyx_v_shape; } __pyx_L19:; } __pyx_L16:; /* "View.MemoryView":870 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< * step = 1 * */ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":871 * * if not have_step: * step = 1 # <<<<<<<<<<<<<< * * */ __pyx_v_step = 1; /* "View.MemoryView":870 * stop = shape * * if not have_step: # <<<<<<<<<<<<<< * step = 1 * */ } /* "View.MemoryView":875 * * with cython.cdivision(True): * new_shape = (stop - start) // step # <<<<<<<<<<<<<< * * if (stop - start) - step * new_shape: */ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step); /* "View.MemoryView":877 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 * */ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0); if (__pyx_t_2) { /* "View.MemoryView":878 * * if (stop - start) - step * new_shape: * new_shape += 1 # <<<<<<<<<<<<<< * * if new_shape < 0: */ __pyx_v_new_shape = (__pyx_v_new_shape + 1); /* "View.MemoryView":877 * new_shape = (stop - start) // step * * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<< * new_shape += 1 * */ } /* "View.MemoryView":880 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 * */ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":881 * * if new_shape < 0: * new_shape = 0 # <<<<<<<<<<<<<< * * */ __pyx_v_new_shape = 0; /* "View.MemoryView":880 * new_shape += 1 * * if new_shape < 0: # <<<<<<<<<<<<<< * new_shape = 0 * */ } /* "View.MemoryView":884 * * * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<< * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset */ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step); /* "View.MemoryView":885 * * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<< * dst.suboffsets[new_ndim] = suboffset * */ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape; /* "View.MemoryView":886 * dst.strides[new_ndim] = stride * step * dst.shape[new_ndim] = new_shape * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<< * * */ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset; } __pyx_L3:; /* "View.MemoryView":889 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: */ __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":890 * * if suboffset_dim[0] < 0: * dst.data += start * stride # <<<<<<<<<<<<<< * else: * dst.suboffsets[suboffset_dim[0]] += start * stride */ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride)); /* "View.MemoryView":889 * * * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<< * dst.data += start * stride * else: */ goto __pyx_L23; } /* "View.MemoryView":892 * dst.data += start * stride * else: * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<< * * if suboffset >= 0: */ /*else*/ { __pyx_t_3 = (__pyx_v_suboffset_dim[0]); (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride)); } __pyx_L23:; /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: */ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":895 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset */ __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":896 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< * dst.data = ( dst.data)[0] + suboffset * else: */ __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":897 * if not is_slice: * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset # <<<<<<<<<<<<<< * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " */ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset); /* "View.MemoryView":896 * if suboffset >= 0: * if not is_slice: * if new_ndim == 0: # <<<<<<<<<<<<<< * dst.data = ( dst.data)[0] + suboffset * else: */ goto __pyx_L26; } /* "View.MemoryView":899 * dst.data = ( dst.data)[0] + suboffset * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<< * "must be indexed and not sliced", dim) * else: */ /*else*/ { /* "View.MemoryView":900 * else: * _err_dim(IndexError, "All dimensions preceding dimension %d " * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<< * else: * suboffset_dim[0] = new_ndim */ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(56, 899, __pyx_L1_error) } __pyx_L26:; /* "View.MemoryView":895 * * if suboffset >= 0: * if not is_slice: # <<<<<<<<<<<<<< * if new_ndim == 0: * dst.data = ( dst.data)[0] + suboffset */ goto __pyx_L25; } /* "View.MemoryView":902 * "must be indexed and not sliced", dim) * else: * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<< * * return 0 */ /*else*/ { (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim; } __pyx_L25:; /* "View.MemoryView":894 * dst.suboffsets[suboffset_dim[0]] += start * stride * * if suboffset >= 0: # <<<<<<<<<<<<<< * if not is_slice: * if new_ndim == 0: */ } /* "View.MemoryView":904 * suboffset_dim[0] = new_ndim * * return 0 # <<<<<<<<<<<<<< * * */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":807 * * @cname('__pyx_memoryview_slice_memviewslice') * cdef int slice_memviewslice( # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset, */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "View.MemoryView":910 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 */ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) { Py_ssize_t __pyx_v_shape; Py_ssize_t __pyx_v_stride; Py_ssize_t __pyx_v_suboffset; Py_ssize_t __pyx_v_itemsize; char *__pyx_v_resultp; char *__pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pybuffer_index", 0); /* "View.MemoryView":912 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<< * cdef Py_ssize_t itemsize = view.itemsize * cdef char *resultp */ __pyx_v_suboffset = -1L; /* "View.MemoryView":913 * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<< * cdef char *resultp * */ __pyx_t_1 = __pyx_v_view->itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":916 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize */ __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":917 * * if view.ndim == 0: * shape = view.len / itemsize # <<<<<<<<<<<<<< * stride = itemsize * else: */ if (unlikely(__pyx_v_itemsize == 0)) { PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero"); __PYX_ERR(56, 917, __pyx_L1_error) } else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) { PyErr_SetString(PyExc_OverflowError, "value too large to perform division"); __PYX_ERR(56, 917, __pyx_L1_error) } __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize); /* "View.MemoryView":918 * if view.ndim == 0: * shape = view.len / itemsize * stride = itemsize # <<<<<<<<<<<<<< * else: * shape = view.shape[dim] */ __pyx_v_stride = __pyx_v_itemsize; /* "View.MemoryView":916 * cdef char *resultp * * if view.ndim == 0: # <<<<<<<<<<<<<< * shape = view.len / itemsize * stride = itemsize */ goto __pyx_L3; } /* "View.MemoryView":920 * stride = itemsize * else: * shape = view.shape[dim] # <<<<<<<<<<<<<< * stride = view.strides[dim] * if view.suboffsets != NULL: */ /*else*/ { __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]); /* "View.MemoryView":921 * else: * shape = view.shape[dim] * stride = view.strides[dim] # <<<<<<<<<<<<<< * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] */ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]); /* "View.MemoryView":922 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] * */ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0); if (__pyx_t_2) { /* "View.MemoryView":923 * stride = view.strides[dim] * if view.suboffsets != NULL: * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<< * * if index < 0: */ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]); /* "View.MemoryView":922 * shape = view.shape[dim] * stride = view.strides[dim] * if view.suboffsets != NULL: # <<<<<<<<<<<<<< * suboffset = view.suboffsets[dim] * */ } } __pyx_L3:; /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: */ __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":926 * * if index < 0: * index += view.shape[dim] # <<<<<<<<<<<<<< * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) */ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim])); /* "View.MemoryView":927 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * */ __pyx_t_2 = ((__pyx_v_index < 0) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":928 * index += view.shape[dim] * if index < 0: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * if index >= shape: */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 928, __pyx_L1_error) /* "View.MemoryView":927 * if index < 0: * index += view.shape[dim] * if index < 0: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * */ } /* "View.MemoryView":925 * suboffset = view.suboffsets[dim] * * if index < 0: # <<<<<<<<<<<<<< * index += view.shape[dim] * if index < 0: */ } /* "View.MemoryView":930 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * */ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0); if (unlikely(__pyx_t_2)) { /* "View.MemoryView":931 * * if index >= shape: * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<< * * resultp = bufp + index * stride */ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 931, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 931, __pyx_L1_error) /* "View.MemoryView":930 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * if index >= shape: # <<<<<<<<<<<<<< * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * */ } /* "View.MemoryView":933 * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) * * resultp = bufp + index * stride # <<<<<<<<<<<<<< * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset */ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride)); /* "View.MemoryView":934 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset * */ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":935 * resultp = bufp + index * stride * if suboffset >= 0: * resultp = ( resultp)[0] + suboffset # <<<<<<<<<<<<<< * * return resultp */ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset); /* "View.MemoryView":934 * * resultp = bufp + index * stride * if suboffset >= 0: # <<<<<<<<<<<<<< * resultp = ( resultp)[0] + suboffset * */ } /* "View.MemoryView":937 * resultp = ( resultp)[0] + suboffset * * return resultp # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_resultp; goto __pyx_L0; /* "View.MemoryView":910 * * @cname('__pyx_pybuffer_index') * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<< * Py_ssize_t dim) except NULL: * cdef Py_ssize_t shape, stride, suboffset = -1 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":943 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim * */ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) { int __pyx_v_ndim; Py_ssize_t *__pyx_v_shape; Py_ssize_t *__pyx_v_strides; int __pyx_v_i; int __pyx_v_j; int __pyx_r; int __pyx_t_1; Py_ssize_t *__pyx_t_2; long __pyx_t_3; long __pyx_t_4; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "View.MemoryView":944 * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<< * * cdef Py_ssize_t *shape = memslice.shape */ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim; __pyx_v_ndim = __pyx_t_1; /* "View.MemoryView":946 * cdef int ndim = memslice.memview.view.ndim * * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<< * cdef Py_ssize_t *strides = memslice.strides * */ __pyx_t_2 = __pyx_v_memslice->shape; __pyx_v_shape = __pyx_t_2; /* "View.MemoryView":947 * * cdef Py_ssize_t *shape = memslice.shape * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __pyx_v_memslice->strides; __pyx_v_strides = __pyx_t_2; /* "View.MemoryView":951 * * cdef int i, j * for i in range(ndim / 2): # <<<<<<<<<<<<<< * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] */ __pyx_t_3 = (__pyx_v_ndim / 2); __pyx_t_4 = __pyx_t_3; for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) { __pyx_v_i = __pyx_t_1; /* "View.MemoryView":952 * cdef int i, j * for i in range(ndim / 2): * j = ndim - 1 - i # <<<<<<<<<<<<<< * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] */ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i); /* "View.MemoryView":953 * for i in range(ndim / 2): * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<< * shape[i], shape[j] = shape[j], shape[i] * */ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]); __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]); (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5; (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6; /* "View.MemoryView":954 * j = ndim - 1 - i * strides[i], strides[j] = strides[j], strides[i] * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<< * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: */ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]); __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]); (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6; (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5; /* "View.MemoryView":956 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * */ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0); if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L6_bool_binop_done; } __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0); __pyx_t_7 = __pyx_t_8; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { /* "View.MemoryView":957 * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<< * * return 1 */ __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(56, 957, __pyx_L1_error) /* "View.MemoryView":956 * shape[i], shape[j] = shape[j], shape[i] * * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<< * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * */ } } /* "View.MemoryView":959 * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") * * return 1 # <<<<<<<<<<<<<< * * */ __pyx_r = 1; goto __pyx_L0; /* "View.MemoryView":943 * * @cname('__pyx_memslice_transpose') * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<< * cdef int ndim = memslice.memview.view.ndim * */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = 0; __pyx_L0:; return __pyx_r; } /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * */ /* Python wrapper */ static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "View.MemoryView":977 * * def __dealloc__(self): * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<< * * cdef convert_item_to_object(self, char *itemp): */ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1); /* "View.MemoryView":976 * cdef int (*to_dtype_func)(char *, object) except 0 * * def __dealloc__(self): # <<<<<<<<<<<<<< * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) */ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_item_to_object", 0); /* "View.MemoryView":980 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) * else: */ __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0); if (__pyx_t_1) { /* "View.MemoryView":981 * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: * return self.to_object_func(itemp) # <<<<<<<<<<<<<< * else: * return memoryview.convert_item_to_object(self, itemp) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "View.MemoryView":980 * * cdef convert_item_to_object(self, char *itemp): * if self.to_object_func != NULL: # <<<<<<<<<<<<<< * return self.to_object_func(itemp) * else: */ } /* "View.MemoryView":983 * return self.to_object_func(itemp) * else: * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<< * * cdef assign_item_from_object(self, char *itemp, object value): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 983, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; } /* "View.MemoryView":979 * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) * * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<< * if self.to_object_func != NULL: * return self.to_object_func(itemp) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) */ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("assign_item_from_object", 0); /* "View.MemoryView":986 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) * else: */ __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0); if (__pyx_t_1) { /* "View.MemoryView":987 * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<< * else: * memoryview.assign_item_from_object(self, itemp, value) */ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(56, 987, __pyx_L1_error) /* "View.MemoryView":986 * * cdef assign_item_from_object(self, char *itemp, object value): * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<< * self.to_dtype_func(itemp, value) * else: */ goto __pyx_L3; } /* "View.MemoryView":989 * self.to_dtype_func(itemp, value) * else: * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<< * * @property */ /*else*/ { __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_L3:; /* "View.MemoryView":985 * return memoryview.convert_item_to_object(self, itemp) * * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<< * if self.to_dtype_func != NULL: * self.to_dtype_func(itemp, value) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":992 * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object * */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "View.MemoryView":993 * @property * def base(self): * return self.from_object # <<<<<<<<<<<<<< * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->from_object); __pyx_r = __pyx_v_self->from_object; goto __pyx_L0; /* "View.MemoryView":992 * * @property * def base(self): # <<<<<<<<<<<<<< * return self.from_object * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(56, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(56, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":999 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, * object (*to_object_func)(char *), */ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) { struct __pyx_memoryviewslice_obj *__pyx_v_result = 0; Py_ssize_t __pyx_v_suboffset; PyObject *__pyx_v_length = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_TypeInfo *__pyx_t_4; Py_buffer __pyx_t_5; Py_ssize_t *__pyx_t_6; Py_ssize_t *__pyx_t_7; Py_ssize_t *__pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_fromslice", 0); /* "View.MemoryView":1007 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None * */ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0); if (__pyx_t_1) { /* "View.MemoryView":1008 * * if memviewslice.memview == Py_None: * return None # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "View.MemoryView":1007 * cdef _memoryviewslice result * * if memviewslice.memview == Py_None: # <<<<<<<<<<<<<< * return None * */ } /* "View.MemoryView":1013 * * * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<< * * result.from_slice = memviewslice */ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":1015 * result = _memoryviewslice(None, 0, dtype_is_object) * * result.from_slice = memviewslice # <<<<<<<<<<<<<< * __PYX_INC_MEMVIEW(&memviewslice, 1) * */ __pyx_v_result->from_slice = __pyx_v_memviewslice; /* "View.MemoryView":1016 * * result.from_slice = memviewslice * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<< * * result.from_object = ( memviewslice.memview).base */ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1); /* "View.MemoryView":1018 * __PYX_INC_MEMVIEW(&memviewslice, 1) * * result.from_object = ( memviewslice.memview).base # <<<<<<<<<<<<<< * result.typeinfo = memviewslice.memview.typeinfo * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_result->from_object); __Pyx_DECREF(__pyx_v_result->from_object); __pyx_v_result->from_object = __pyx_t_2; __pyx_t_2 = 0; /* "View.MemoryView":1019 * * result.from_object = ( memviewslice.memview).base * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<< * * result.view = memviewslice.memview.view */ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo; __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4; /* "View.MemoryView":1021 * result.typeinfo = memviewslice.memview.typeinfo * * result.view = memviewslice.memview.view # <<<<<<<<<<<<<< * result.view.buf = memviewslice.data * result.view.ndim = ndim */ __pyx_t_5 = __pyx_v_memviewslice.memview->view; __pyx_v_result->__pyx_base.view = __pyx_t_5; /* "View.MemoryView":1022 * * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data # <<<<<<<<<<<<<< * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None */ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data); /* "View.MemoryView":1023 * result.view = memviewslice.memview.view * result.view.buf = memviewslice.data * result.view.ndim = ndim # <<<<<<<<<<<<<< * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) */ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim; /* "View.MemoryView":1024 * result.view.buf = memviewslice.data * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<< * Py_INCREF(Py_None) * */ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None; /* "View.MemoryView":1025 * result.view.ndim = ndim * (<__pyx_buffer *> &result.view).obj = Py_None * Py_INCREF(Py_None) # <<<<<<<<<<<<<< * * if (memviewslice.memview).flags & PyBUF_WRITABLE: */ Py_INCREF(Py_None); /* "View.MemoryView":1027 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: */ __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0); if (__pyx_t_1) { /* "View.MemoryView":1028 * * if (memviewslice.memview).flags & PyBUF_WRITABLE: * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<< * else: * result.flags = PyBUF_RECORDS_RO */ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS; /* "View.MemoryView":1027 * Py_INCREF(Py_None) * * if (memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<< * result.flags = PyBUF_RECORDS * else: */ goto __pyx_L4; } /* "View.MemoryView":1030 * result.flags = PyBUF_RECORDS * else: * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<< * * result.view.shape = result.from_slice.shape */ /*else*/ { __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO; } __pyx_L4:; /* "View.MemoryView":1032 * result.flags = PyBUF_RECORDS_RO * * result.view.shape = result.from_slice.shape # <<<<<<<<<<<<<< * result.view.strides = result.from_slice.strides * */ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape); /* "View.MemoryView":1033 * * result.view.shape = result.from_slice.shape * result.view.strides = result.from_slice.strides # <<<<<<<<<<<<<< * * */ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides); /* "View.MemoryView":1036 * * * result.view.suboffsets = NULL # <<<<<<<<<<<<<< * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: */ __pyx_v_result->__pyx_base.view.suboffsets = NULL; /* "View.MemoryView":1037 * * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<< * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets */ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; __pyx_v_suboffset = (__pyx_t_6[0]); /* "View.MemoryView":1038 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * result.view.suboffsets = result.from_slice.suboffsets * break */ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0); if (__pyx_t_1) { /* "View.MemoryView":1039 * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets # <<<<<<<<<<<<<< * break * */ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets); /* "View.MemoryView":1040 * if suboffset >= 0: * result.view.suboffsets = result.from_slice.suboffsets * break # <<<<<<<<<<<<<< * * result.view.len = result.view.itemsize */ goto __pyx_L6_break; /* "View.MemoryView":1038 * result.view.suboffsets = NULL * for suboffset in result.from_slice.suboffsets[:ndim]: * if suboffset >= 0: # <<<<<<<<<<<<<< * result.view.suboffsets = result.from_slice.suboffsets * break */ } } __pyx_L6_break:; /* "View.MemoryView":1042 * break * * result.view.len = result.view.itemsize # <<<<<<<<<<<<<< * for length in result.view.shape[:ndim]: * result.view.len *= length */ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; /* "View.MemoryView":1043 * * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<< * result.view.len *= length * */ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim); for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) { __pyx_t_6 = __pyx_t_8; __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1043, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2); __pyx_t_2 = 0; /* "View.MemoryView":1044 * result.view.len = result.view.itemsize * for length in result.view.shape[:ndim]: * result.view.len *= length # <<<<<<<<<<<<<< * * result.to_object_func = to_object_func */ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(56, 1044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_result->__pyx_base.view.len = __pyx_t_9; } /* "View.MemoryView":1046 * result.view.len *= length * * result.to_object_func = to_object_func # <<<<<<<<<<<<<< * result.to_dtype_func = to_dtype_func * */ __pyx_v_result->to_object_func = __pyx_v_to_object_func; /* "View.MemoryView":1047 * * result.to_object_func = to_object_func * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<< * * return result */ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func; /* "View.MemoryView":1049 * result.to_dtype_func = to_dtype_func * * return result # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_get_slice_from_memoryview') */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "View.MemoryView":999 * * @cname('__pyx_memoryview_fromslice') * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<< * int ndim, * object (*to_object_func)(char *), */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XDECREF(__pyx_v_length); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1052 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj */ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) { struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0; __Pyx_memviewslice *__pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_slice_from_memview", 0); /* "View.MemoryView":1055 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * obj = memview * return &obj.from_slice */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":1056 * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): * obj = memview # <<<<<<<<<<<<<< * return &obj.from_slice * else: */ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(56, 1056, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_memview); __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":1057 * if isinstance(memview, _memoryviewslice): * obj = memview * return &obj.from_slice # <<<<<<<<<<<<<< * else: * slice_copy(memview, mslice) */ __pyx_r = (&__pyx_v_obj->from_slice); goto __pyx_L0; /* "View.MemoryView":1055 * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * obj = memview * return &obj.from_slice */ } /* "View.MemoryView":1059 * return &obj.from_slice * else: * slice_copy(memview, mslice) # <<<<<<<<<<<<<< * return mslice * */ /*else*/ { __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice); /* "View.MemoryView":1060 * else: * slice_copy(memview, mslice) * return mslice # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_slice_copy') */ __pyx_r = __pyx_v_mslice; goto __pyx_L0; } /* "View.MemoryView":1052 * * @cname('__pyx_memoryview_get_slice_from_memoryview') * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<< * __Pyx_memviewslice *mslice) except NULL: * cdef _memoryviewslice obj */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_obj); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1063 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim * cdef (Py_ssize_t*) shape, strides, suboffsets */ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) { int __pyx_v_dim; Py_ssize_t *__pyx_v_shape; Py_ssize_t *__pyx_v_strides; Py_ssize_t *__pyx_v_suboffsets; __Pyx_RefNannyDeclarations Py_ssize_t *__pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("slice_copy", 0); /* "View.MemoryView":1067 * cdef (Py_ssize_t*) shape, strides, suboffsets * * shape = memview.view.shape # <<<<<<<<<<<<<< * strides = memview.view.strides * suboffsets = memview.view.suboffsets */ __pyx_t_1 = __pyx_v_memview->view.shape; __pyx_v_shape = __pyx_t_1; /* "View.MemoryView":1068 * * shape = memview.view.shape * strides = memview.view.strides # <<<<<<<<<<<<<< * suboffsets = memview.view.suboffsets * */ __pyx_t_1 = __pyx_v_memview->view.strides; __pyx_v_strides = __pyx_t_1; /* "View.MemoryView":1069 * shape = memview.view.shape * strides = memview.view.strides * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<< * * dst.memview = <__pyx_memoryview *> memview */ __pyx_t_1 = __pyx_v_memview->view.suboffsets; __pyx_v_suboffsets = __pyx_t_1; /* "View.MemoryView":1071 * suboffsets = memview.view.suboffsets * * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<< * dst.data = memview.view.buf * */ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview); /* "View.MemoryView":1072 * * dst.memview = <__pyx_memoryview *> memview * dst.data = memview.view.buf # <<<<<<<<<<<<<< * * for dim in range(memview.view.ndim): */ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf); /* "View.MemoryView":1074 * dst.data = memview.view.buf * * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<< * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] */ __pyx_t_2 = __pyx_v_memview->view.ndim; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_dim = __pyx_t_4; /* "View.MemoryView":1075 * * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<< * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 */ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]); /* "View.MemoryView":1076 * for dim in range(memview.view.ndim): * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<< * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 * */ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]); /* "View.MemoryView":1077 * dst.shape[dim] = shape[dim] * dst.strides[dim] = strides[dim] * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_copy_object') */ if ((__pyx_v_suboffsets != 0)) { __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]); } else { __pyx_t_5 = -1L; } (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5; } /* "View.MemoryView":1063 * * @cname('__pyx_memoryview_slice_copy') * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<< * cdef int dim * cdef (Py_ssize_t*) shape, strides, suboffsets */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "View.MemoryView":1080 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice */ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) { __Pyx_memviewslice __pyx_v_memviewslice; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy", 0); /* "View.MemoryView":1083 * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<< * return memoryview_copy_from_slice(memview, &memviewslice) * */ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice)); /* "View.MemoryView":1084 * cdef __Pyx_memviewslice memviewslice * slice_copy(memview, &memviewslice) * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_copy_object_from_slice') */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "View.MemoryView":1080 * * @cname('__pyx_memoryview_copy_object') * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<< * "Create a new memoryview object" * cdef __Pyx_memviewslice memviewslice */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1087 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ * Create a new memoryview object from a given memoryview object and slice. */ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) { PyObject *(*__pyx_v_to_object_func)(char *); int (*__pyx_v_to_dtype_func)(char *, PyObject *); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *(*__pyx_t_3)(char *); int (*__pyx_t_4)(char *, PyObject *); PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0); /* "View.MemoryView":1094 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func */ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "View.MemoryView":1095 * * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<< * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: */ __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func; __pyx_v_to_object_func = __pyx_t_3; /* "View.MemoryView":1096 * if isinstance(memview, _memoryviewslice): * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<< * else: * to_object_func = NULL */ __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func; __pyx_v_to_dtype_func = __pyx_t_4; /* "View.MemoryView":1094 * cdef int (*to_dtype_func)(char *, object) except 0 * * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<< * to_object_func = (<_memoryviewslice> memview).to_object_func * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func */ goto __pyx_L3; } /* "View.MemoryView":1098 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func * else: * to_object_func = NULL # <<<<<<<<<<<<<< * to_dtype_func = NULL * */ /*else*/ { __pyx_v_to_object_func = NULL; /* "View.MemoryView":1099 * else: * to_object_func = NULL * to_dtype_func = NULL # <<<<<<<<<<<<<< * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, */ __pyx_v_to_dtype_func = NULL; } __pyx_L3:; /* "View.MemoryView":1101 * to_dtype_func = NULL * * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<< * to_object_func, to_dtype_func, * memview.dtype_is_object) */ __Pyx_XDECREF(__pyx_r); /* "View.MemoryView":1103 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, * to_object_func, to_dtype_func, * memview.dtype_is_object) # <<<<<<<<<<<<<< * * */ __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "View.MemoryView":1087 * * @cname('__pyx_memoryview_copy_object_from_slice') * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<< * """ * Create a new memoryview object from a given memoryview object and slice. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "View.MemoryView":1109 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg */ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) { Py_ssize_t __pyx_r; int __pyx_t_1; /* "View.MemoryView":1110 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg * else: */ __pyx_t_1 = ((__pyx_v_arg < 0) != 0); if (__pyx_t_1) { /* "View.MemoryView":1111 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: * return -arg # <<<<<<<<<<<<<< * else: * return arg */ __pyx_r = (-__pyx_v_arg); goto __pyx_L0; /* "View.MemoryView":1110 * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: * if arg < 0: # <<<<<<<<<<<<<< * return -arg * else: */ } /* "View.MemoryView":1113 * return -arg * else: * return arg # <<<<<<<<<<<<<< * * @cname('__pyx_get_best_slice_order') */ /*else*/ { __pyx_r = __pyx_v_arg; goto __pyx_L0; } /* "View.MemoryView":1109 * * * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<< * if arg < 0: * return -arg */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1116 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ * Figure out the best memory access order for a given slice. */ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) { int __pyx_v_i; Py_ssize_t __pyx_v_c_stride; Py_ssize_t __pyx_v_f_stride; char __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; /* "View.MemoryView":1121 * """ * cdef int i * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<< * cdef Py_ssize_t f_stride = 0 * */ __pyx_v_c_stride = 0; /* "View.MemoryView":1122 * cdef int i * cdef Py_ssize_t c_stride = 0 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<< * * for i in range(ndim - 1, -1, -1): */ __pyx_v_f_stride = 0; /* "View.MemoryView":1124 * cdef Py_ssize_t f_stride = 0 * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] */ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1125 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] * break */ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { /* "View.MemoryView":1126 * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break * */ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1127 * if mslice.shape[i] > 1: * c_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< * * for i in range(ndim): */ goto __pyx_L4_break; /* "View.MemoryView":1125 * * for i in range(ndim - 1, -1, -1): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * c_stride = mslice.strides[i] * break */ } } __pyx_L4_break:; /* "View.MemoryView":1129 * break * * for i in range(ndim): # <<<<<<<<<<<<<< * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] */ __pyx_t_1 = __pyx_v_ndim; __pyx_t_3 = __pyx_t_1; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1130 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] * break */ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0); if (__pyx_t_2) { /* "View.MemoryView":1131 * for i in range(ndim): * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] # <<<<<<<<<<<<<< * break * */ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1132 * if mslice.shape[i] > 1: * f_stride = mslice.strides[i] * break # <<<<<<<<<<<<<< * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): */ goto __pyx_L7_break; /* "View.MemoryView":1130 * * for i in range(ndim): * if mslice.shape[i] > 1: # <<<<<<<<<<<<<< * f_stride = mslice.strides[i] * break */ } } __pyx_L7_break:; /* "View.MemoryView":1134 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: */ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1135 * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): * return 'C' # <<<<<<<<<<<<<< * else: * return 'F' */ __pyx_r = 'C'; goto __pyx_L0; /* "View.MemoryView":1134 * break * * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<< * return 'C' * else: */ } /* "View.MemoryView":1137 * return 'C' * else: * return 'F' # <<<<<<<<<<<<<< * * @cython.cdivision(True) */ /*else*/ { __pyx_r = 'F'; goto __pyx_L0; } /* "View.MemoryView":1116 * * @cname('__pyx_get_best_slice_order') * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<< * """ * Figure out the best memory access order for a given slice. */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1140 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, */ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) { CYTHON_UNUSED Py_ssize_t __pyx_v_i; CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent; Py_ssize_t __pyx_v_dst_extent; Py_ssize_t __pyx_v_src_stride; Py_ssize_t __pyx_v_dst_stride; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; /* "View.MemoryView":1147 * * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] */ __pyx_v_src_extent = (__pyx_v_src_shape[0]); /* "View.MemoryView":1148 * cdef Py_ssize_t i * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] */ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]); /* "View.MemoryView":1149 * cdef Py_ssize_t src_extent = src_shape[0] * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t dst_stride = dst_strides[0] * */ __pyx_v_src_stride = (__pyx_v_src_strides[0]); /* "View.MemoryView":1150 * cdef Py_ssize_t dst_extent = dst_shape[0] * cdef Py_ssize_t src_stride = src_strides[0] * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<< * * if ndim == 1: */ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]); /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): */ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { /* "View.MemoryView":1153 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0); if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } /* "View.MemoryView":1154 * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): # <<<<<<<<<<<<<< * memcpy(dst_data, src_data, itemsize * dst_extent) * else: */ __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize); if (__pyx_t_2) { __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride)); } __pyx_t_3 = (__pyx_t_2 != 0); __pyx_t_1 = __pyx_t_3; __pyx_L5_bool_binop_done:; /* "View.MemoryView":1153 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ if (__pyx_t_1) { /* "View.MemoryView":1155 * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<< * else: * for i in range(dst_extent): */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent))); /* "View.MemoryView":1153 * * if ndim == 1: * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<< * src_stride == itemsize == dst_stride): * memcpy(dst_data, src_data, itemsize * dst_extent) */ goto __pyx_L4; } /* "View.MemoryView":1157 * memcpy(dst_data, src_data, itemsize * dst_extent) * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< * memcpy(dst_data, src_data, itemsize) * src_data += src_stride */ /*else*/ { __pyx_t_4 = __pyx_v_dst_extent; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1158 * else: * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<< * src_data += src_stride * dst_data += dst_stride */ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize)); /* "View.MemoryView":1159 * for i in range(dst_extent): * memcpy(dst_data, src_data, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride * else: */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); /* "View.MemoryView":1160 * memcpy(dst_data, src_data, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< * else: * for i in range(dst_extent): */ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); } } __pyx_L4:; /* "View.MemoryView":1152 * cdef Py_ssize_t dst_stride = dst_strides[0] * * if ndim == 1: # <<<<<<<<<<<<<< * if (src_stride > 0 and dst_stride > 0 and * src_stride == itemsize == dst_stride): */ goto __pyx_L3; } /* "View.MemoryView":1162 * dst_data += dst_stride * else: * for i in range(dst_extent): # <<<<<<<<<<<<<< * _copy_strided_to_strided(src_data, src_strides + 1, * dst_data, dst_strides + 1, */ /*else*/ { __pyx_t_4 = __pyx_v_dst_extent; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1163 * else: * for i in range(dst_extent): * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<< * dst_data, dst_strides + 1, * src_shape + 1, dst_shape + 1, */ _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize); /* "View.MemoryView":1167 * src_shape + 1, dst_shape + 1, * ndim - 1, itemsize) * src_data += src_stride # <<<<<<<<<<<<<< * dst_data += dst_stride * */ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride); /* "View.MemoryView":1168 * ndim - 1, itemsize) * src_data += src_stride * dst_data += dst_stride # <<<<<<<<<<<<<< * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, */ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride); } } __pyx_L3:; /* "View.MemoryView":1140 * * @cython.cdivision(True) * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<< * char *dst_data, Py_ssize_t *dst_strides, * Py_ssize_t *src_shape, Py_ssize_t *dst_shape, */ /* function exit code */ } /* "View.MemoryView":1170 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: */ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) { /* "View.MemoryView":1173 * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<< * src.shape, dst.shape, ndim, itemsize) * */ _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1170 * dst_data += dst_stride * * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *dst, * int ndim, size_t itemsize) nogil: */ /* function exit code */ } /* "View.MemoryView":1177 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize */ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) { Py_ssize_t __pyx_v_shape; Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_r; Py_ssize_t __pyx_t_1; Py_ssize_t *__pyx_t_2; Py_ssize_t *__pyx_t_3; Py_ssize_t *__pyx_t_4; /* "View.MemoryView":1179 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<< * * for shape in src.shape[:ndim]: */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_size = __pyx_t_1; /* "View.MemoryView":1181 * cdef Py_ssize_t shape, size = src.memview.view.itemsize * * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<< * size *= shape * */ __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim); for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) { __pyx_t_2 = __pyx_t_4; __pyx_v_shape = (__pyx_t_2[0]); /* "View.MemoryView":1182 * * for shape in src.shape[:ndim]: * size *= shape # <<<<<<<<<<<<<< * * return size */ __pyx_v_size = (__pyx_v_size * __pyx_v_shape); } /* "View.MemoryView":1184 * size *= shape * * return size # <<<<<<<<<<<<<< * * @cname('__pyx_fill_contig_strides_array') */ __pyx_r = __pyx_v_size; goto __pyx_L0; /* "View.MemoryView":1177 * * @cname('__pyx_memoryview_slice_get_size') * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<< * "Return the size of the memory occupied by the slice in number of bytes" * cdef Py_ssize_t shape, size = src.memview.view.itemsize */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1187 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, * int ndim, char order) nogil: */ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) { int __pyx_v_idx; Py_ssize_t __pyx_r; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; /* "View.MemoryView":1196 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride */ __pyx_t_1 = ((__pyx_v_order == 'F') != 0); if (__pyx_t_1) { /* "View.MemoryView":1197 * * if order == 'F': * for idx in range(ndim): # <<<<<<<<<<<<<< * strides[idx] = stride * stride *= shape[idx] */ __pyx_t_2 = __pyx_v_ndim; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_idx = __pyx_t_4; /* "View.MemoryView":1198 * if order == 'F': * for idx in range(ndim): * strides[idx] = stride # <<<<<<<<<<<<<< * stride *= shape[idx] * else: */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; /* "View.MemoryView":1199 * for idx in range(ndim): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< * else: * for idx in range(ndim - 1, -1, -1): */ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } /* "View.MemoryView":1196 * cdef int idx * * if order == 'F': # <<<<<<<<<<<<<< * for idx in range(ndim): * strides[idx] = stride */ goto __pyx_L3; } /* "View.MemoryView":1201 * stride *= shape[idx] * else: * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * strides[idx] = stride * stride *= shape[idx] */ /*else*/ { for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) { __pyx_v_idx = __pyx_t_2; /* "View.MemoryView":1202 * else: * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride # <<<<<<<<<<<<<< * stride *= shape[idx] * */ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride; /* "View.MemoryView":1203 * for idx in range(ndim - 1, -1, -1): * strides[idx] = stride * stride *= shape[idx] # <<<<<<<<<<<<<< * * return stride */ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx])); } } __pyx_L3:; /* "View.MemoryView":1205 * stride *= shape[idx] * * return stride # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_copy_data_to_temp') */ __pyx_r = __pyx_v_stride; goto __pyx_L0; /* "View.MemoryView":1187 * * @cname('__pyx_fill_contig_strides_array') * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<< * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, * int ndim, char order) nogil: */ /* function exit code */ __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1208 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, * char order, */ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) { int __pyx_v_i; void *__pyx_v_result; size_t __pyx_v_itemsize; size_t __pyx_v_size; void *__pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; struct __pyx_memoryview_obj *__pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "View.MemoryView":1219 * cdef void *result * * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef size_t size = slice_get_size(src, ndim) * */ __pyx_t_1 = __pyx_v_src->memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1220 * * cdef size_t itemsize = src.memview.view.itemsize * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<< * * result = malloc(size) */ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim); /* "View.MemoryView":1222 * cdef size_t size = slice_get_size(src, ndim) * * result = malloc(size) # <<<<<<<<<<<<<< * if not result: * _err(MemoryError, NULL) */ __pyx_v_result = malloc(__pyx_v_size); /* "View.MemoryView":1223 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) * */ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1224 * result = malloc(size) * if not result: * _err(MemoryError, NULL) # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(56, 1224, __pyx_L1_error) /* "View.MemoryView":1223 * * result = malloc(size) * if not result: # <<<<<<<<<<<<<< * _err(MemoryError, NULL) * */ } /* "View.MemoryView":1227 * * * tmpslice.data = result # <<<<<<<<<<<<<< * tmpslice.memview = src.memview * for i in range(ndim): */ __pyx_v_tmpslice->data = ((char *)__pyx_v_result); /* "View.MemoryView":1228 * * tmpslice.data = result * tmpslice.memview = src.memview # <<<<<<<<<<<<<< * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] */ __pyx_t_4 = __pyx_v_src->memview; __pyx_v_tmpslice->memview = __pyx_t_4; /* "View.MemoryView":1229 * tmpslice.data = result * tmpslice.memview = src.memview * for i in range(ndim): # <<<<<<<<<<<<<< * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 */ __pyx_t_3 = __pyx_v_ndim; __pyx_t_5 = __pyx_t_3; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1230 * tmpslice.memview = src.memview * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<< * tmpslice.suboffsets[i] = -1 * */ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]); /* "View.MemoryView":1231 * for i in range(ndim): * tmpslice.shape[i] = src.shape[i] * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, */ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L; } /* "View.MemoryView":1233 * tmpslice.suboffsets[i] = -1 * * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<< * ndim, order) * */ (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order)); /* "View.MemoryView":1237 * * * for i in range(ndim): # <<<<<<<<<<<<<< * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 */ __pyx_t_3 = __pyx_v_ndim; __pyx_t_5 = __pyx_t_3; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "View.MemoryView":1238 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 * */ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { /* "View.MemoryView":1239 * for i in range(ndim): * if tmpslice.shape[i] == 1: * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<< * * if slice_is_contig(src[0], order, ndim): */ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0; /* "View.MemoryView":1238 * * for i in range(ndim): * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<< * tmpslice.strides[i] = 0 * */ } } /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: */ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0); if (__pyx_t_2) { /* "View.MemoryView":1242 * * if slice_is_contig(src[0], order, ndim): * memcpy(result, src.data, size) # <<<<<<<<<<<<<< * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) */ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size)); /* "View.MemoryView":1241 * tmpslice.strides[i] = 0 * * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<< * memcpy(result, src.data, size) * else: */ goto __pyx_L9; } /* "View.MemoryView":1244 * memcpy(result, src.data, size) * else: * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<< * * return result */ /*else*/ { copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize); } __pyx_L9:; /* "View.MemoryView":1246 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) * * return result # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_result; goto __pyx_L0; /* "View.MemoryView":1208 * * @cname('__pyx_memoryview_copy_data_to_temp') * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<< * __Pyx_memviewslice *tmpslice, * char order, */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = NULL; __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1251 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % */ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_extents", 0); /* "View.MemoryView":1254 * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % * (i, extent1, extent2)) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err_dim') */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; /* "View.MemoryView":1253 * cdef int _err_extents(int i, Py_ssize_t extent1, * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<< * (i, extent1, extent2)) * */ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __PYX_ERR(56, 1253, __pyx_L1_error) /* "View.MemoryView":1251 * * @cname('__pyx_memoryview_err_extents') * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<< * Py_ssize_t extent2) except -1 with gil: * raise ValueError("got differing extents in dimension %d (got %d and %d)" % */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "View.MemoryView":1257 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) * */ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_dim", 0); __Pyx_INCREF(__pyx_v_error); /* "View.MemoryView":1258 * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_err') */ __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_v_error); __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(56, 1258, __pyx_L1_error) /* "View.MemoryView":1257 * * @cname('__pyx_memoryview_err_dim') * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii') % dim) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "View.MemoryView":1261 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: * raise error(msg.decode('ascii')) */ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err", 0); __Pyx_INCREF(__pyx_v_error); /* "View.MemoryView":1262 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii')) * else: */ __pyx_t_1 = ((__pyx_v_msg != NULL) != 0); if (unlikely(__pyx_t_1)) { /* "View.MemoryView":1263 * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<< * else: * raise error */ __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_error); __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(56, 1263, __pyx_L1_error) /* "View.MemoryView":1262 * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: * if msg != NULL: # <<<<<<<<<<<<<< * raise error(msg.decode('ascii')) * else: */ } /* "View.MemoryView":1265 * raise error(msg.decode('ascii')) * else: * raise error # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_copy_contents') */ /*else*/ { __Pyx_Raise(__pyx_v_error, 0, 0, 0); __PYX_ERR(56, 1265, __pyx_L1_error) } /* "View.MemoryView":1261 * * @cname('__pyx_memoryview_err') * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<< * if msg != NULL: * raise error(msg.decode('ascii')) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __Pyx_XDECREF(__pyx_v_error); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif return __pyx_r; } /* "View.MemoryView":1268 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, * int src_ndim, int dst_ndim, */ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) { void *__pyx_v_tmpdata; size_t __pyx_v_itemsize; int __pyx_v_i; char __pyx_v_order; int __pyx_v_broadcasting; int __pyx_v_direct_copy; __Pyx_memviewslice __pyx_v_tmp; int __pyx_v_ndim; int __pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; void *__pyx_t_7; int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; /* "View.MemoryView":1276 * Check for overlapping memory and verify the shapes. * """ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<< * cdef size_t itemsize = src.memview.view.itemsize * cdef int i */ __pyx_v_tmpdata = NULL; /* "View.MemoryView":1277 * """ * cdef void *tmpdata = NULL * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<< * cdef int i * cdef char order = get_best_order(&src, src_ndim) */ __pyx_t_1 = __pyx_v_src.memview->view.itemsize; __pyx_v_itemsize = __pyx_t_1; /* "View.MemoryView":1279 * cdef size_t itemsize = src.memview.view.itemsize * cdef int i * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<< * cdef bint broadcasting = False * cdef bint direct_copy = False */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim); /* "View.MemoryView":1280 * cdef int i * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False # <<<<<<<<<<<<<< * cdef bint direct_copy = False * cdef __Pyx_memviewslice tmp */ __pyx_v_broadcasting = 0; /* "View.MemoryView":1281 * cdef char order = get_best_order(&src, src_ndim) * cdef bint broadcasting = False * cdef bint direct_copy = False # <<<<<<<<<<<<<< * cdef __Pyx_memviewslice tmp * */ __pyx_v_direct_copy = 0; /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: */ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0); if (__pyx_t_2) { /* "View.MemoryView":1285 * * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<< * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) */ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim); /* "View.MemoryView":1284 * cdef __Pyx_memviewslice tmp * * if src_ndim < dst_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: */ goto __pyx_L3; } /* "View.MemoryView":1286 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) * */ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0); if (__pyx_t_2) { /* "View.MemoryView":1287 * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<< * * cdef int ndim = max(src_ndim, dst_ndim) */ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim); /* "View.MemoryView":1286 * if src_ndim < dst_ndim: * broadcast_leading(&src, src_ndim, dst_ndim) * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<< * broadcast_leading(&dst, dst_ndim, src_ndim) * */ } __pyx_L3:; /* "View.MemoryView":1289 * broadcast_leading(&dst, dst_ndim, src_ndim) * * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<< * * for i in range(ndim): */ __pyx_t_3 = __pyx_v_dst_ndim; __pyx_t_4 = __pyx_v_src_ndim; if (((__pyx_t_3 > __pyx_t_4) != 0)) { __pyx_t_5 = __pyx_t_3; } else { __pyx_t_5 = __pyx_t_4; } __pyx_v_ndim = __pyx_t_5; /* "View.MemoryView":1291 * cdef int ndim = max(src_ndim, dst_ndim) * * for i in range(ndim): # <<<<<<<<<<<<<< * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: */ __pyx_t_5 = __pyx_v_ndim; __pyx_t_3 = __pyx_t_5; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1292 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: * broadcasting = True */ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0); if (__pyx_t_2) { /* "View.MemoryView":1293 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< * broadcasting = True * src.strides[i] = 0 */ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0); if (__pyx_t_2) { /* "View.MemoryView":1294 * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: * broadcasting = True # <<<<<<<<<<<<<< * src.strides[i] = 0 * else: */ __pyx_v_broadcasting = 1; /* "View.MemoryView":1295 * if src.shape[i] == 1: * broadcasting = True * src.strides[i] = 0 # <<<<<<<<<<<<<< * else: * _err_extents(i, dst.shape[i], src.shape[i]) */ (__pyx_v_src.strides[__pyx_v_i]) = 0; /* "View.MemoryView":1293 * for i in range(ndim): * if src.shape[i] != dst.shape[i]: * if src.shape[i] == 1: # <<<<<<<<<<<<<< * broadcasting = True * src.strides[i] = 0 */ goto __pyx_L7; } /* "View.MemoryView":1297 * src.strides[i] = 0 * else: * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<< * * if src.suboffsets[i] >= 0: */ /*else*/ { __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(56, 1297, __pyx_L1_error) } __pyx_L7:; /* "View.MemoryView":1292 * * for i in range(ndim): * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<< * if src.shape[i] == 1: * broadcasting = True */ } /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) * */ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0); if (__pyx_t_2) { /* "View.MemoryView":1300 * * if src.suboffsets[i] >= 0: * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<< * * if slices_overlap(&src, &dst, ndim, itemsize): */ __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(56, 1300, __pyx_L1_error) /* "View.MemoryView":1299 * _err_extents(i, dst.shape[i], src.shape[i]) * * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<< * _err_dim(ValueError, "Dimension %d is not direct", i) * */ } } /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< * * if not slice_is_contig(src, order, ndim): */ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0); if (__pyx_t_2) { /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) * */ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1305 * * if not slice_is_contig(src, order, ndim): * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<< * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) */ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim); /* "View.MemoryView":1304 * if slices_overlap(&src, &dst, ndim, itemsize): * * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<< * order = get_best_order(&dst, ndim) * */ } /* "View.MemoryView":1307 * order = get_best_order(&dst, ndim) * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<< * src = tmp * */ __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(56, 1307, __pyx_L1_error) __pyx_v_tmpdata = __pyx_t_7; /* "View.MemoryView":1308 * * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) * src = tmp # <<<<<<<<<<<<<< * * if not broadcasting: */ __pyx_v_src = __pyx_v_tmp; /* "View.MemoryView":1302 * _err_dim(ValueError, "Dimension %d is not direct", i) * * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<< * * if not slice_is_contig(src, order, ndim): */ } /* "View.MemoryView":1310 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< * * */ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0); if (__pyx_t_2) { /* "View.MemoryView":1313 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): */ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0); if (__pyx_t_2) { /* "View.MemoryView":1314 * * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<< * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim); /* "View.MemoryView":1313 * * * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): */ goto __pyx_L12; } /* "View.MemoryView":1315 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) * */ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0); if (__pyx_t_2) { /* "View.MemoryView":1316 * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<< * * if direct_copy: */ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim); /* "View.MemoryView":1315 * if slice_is_contig(src, 'C', ndim): * direct_copy = slice_is_contig(dst, 'C', ndim) * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<< * direct_copy = slice_is_contig(dst, 'F', ndim) * */ } __pyx_L12:; /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, False) */ __pyx_t_2 = (__pyx_v_direct_copy != 0); if (__pyx_t_2) { /* "View.MemoryView":1320 * if direct_copy: * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1321 * * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) */ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim))); /* "View.MemoryView":1322 * refcount_copying(&dst, dtype_is_object, ndim, False) * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< * free(tmpdata) * return 0 */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1323 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) # <<<<<<<<<<<<<< * return 0 * */ free(__pyx_v_tmpdata); /* "View.MemoryView":1324 * refcount_copying(&dst, dtype_is_object, ndim, True) * free(tmpdata) * return 0 # <<<<<<<<<<<<<< * * if order == 'F' == get_best_order(&dst, ndim): */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":1318 * direct_copy = slice_is_contig(dst, 'F', ndim) * * if direct_copy: # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, False) */ } /* "View.MemoryView":1310 * src = tmp * * if not broadcasting: # <<<<<<<<<<<<<< * * */ } /* "View.MemoryView":1326 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< * * */ __pyx_t_2 = (__pyx_v_order == 'F'); if (__pyx_t_2) { __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim)); } __pyx_t_8 = (__pyx_t_2 != 0); if (__pyx_t_8) { /* "View.MemoryView":1329 * * * transpose_memslice(&src) # <<<<<<<<<<<<<< * transpose_memslice(&dst) * */ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(56, 1329, __pyx_L1_error) /* "View.MemoryView":1330 * * transpose_memslice(&src) * transpose_memslice(&dst) # <<<<<<<<<<<<<< * * refcount_copying(&dst, dtype_is_object, ndim, False) */ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(56, 1330, __pyx_L1_error) /* "View.MemoryView":1326 * return 0 * * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<< * * */ } /* "View.MemoryView":1332 * transpose_memslice(&dst) * * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1333 * * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<< * refcount_copying(&dst, dtype_is_object, ndim, True) * */ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize); /* "View.MemoryView":1334 * refcount_copying(&dst, dtype_is_object, ndim, False) * copy_strided_to_strided(&src, &dst, ndim, itemsize) * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< * * free(tmpdata) */ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1336 * refcount_copying(&dst, dtype_is_object, ndim, True) * * free(tmpdata) # <<<<<<<<<<<<<< * return 0 * */ free(__pyx_v_tmpdata); /* "View.MemoryView":1337 * * free(tmpdata) * return 0 # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_broadcast_leading') */ __pyx_r = 0; goto __pyx_L0; /* "View.MemoryView":1268 * * @cname('__pyx_memoryview_copy_contents') * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<< * __Pyx_memviewslice dst, * int src_ndim, int dst_ndim, */ /* function exit code */ __pyx_L1_error:; { #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } __pyx_r = -1; __pyx_L0:; return __pyx_r; } /* "View.MemoryView":1340 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, * int ndim_other) nogil: */ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) { int __pyx_v_i; int __pyx_v_offset; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; /* "View.MemoryView":1344 * int ndim_other) nogil: * cdef int i * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<< * * for i in range(ndim - 1, -1, -1): */ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim); /* "View.MemoryView":1346 * cdef int offset = ndim_other - ndim * * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<< * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] */ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) { __pyx_v_i = __pyx_t_1; /* "View.MemoryView":1347 * * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<< * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] */ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]); /* "View.MemoryView":1348 * for i in range(ndim - 1, -1, -1): * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<< * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * */ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]); /* "View.MemoryView":1349 * mslice.shape[i + offset] = mslice.shape[i] * mslice.strides[i + offset] = mslice.strides[i] * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<< * * for i in range(offset): */ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]); } /* "View.MemoryView":1351 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] * * for i in range(offset): # <<<<<<<<<<<<<< * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] */ __pyx_t_1 = __pyx_v_offset; __pyx_t_2 = __pyx_t_1; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1352 * * for i in range(offset): * mslice.shape[i] = 1 # <<<<<<<<<<<<<< * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 */ (__pyx_v_mslice->shape[__pyx_v_i]) = 1; /* "View.MemoryView":1353 * for i in range(offset): * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<< * mslice.suboffsets[i] = -1 * */ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]); /* "View.MemoryView":1354 * mslice.shape[i] = 1 * mslice.strides[i] = mslice.strides[0] * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<< * * */ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L; } /* "View.MemoryView":1340 * * @cname('__pyx_memoryview_broadcast_leading') * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<< * int ndim, * int ndim_other) nogil: */ /* function exit code */ } /* "View.MemoryView":1362 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: * */ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) { int __pyx_t_1; /* "View.MemoryView":1366 * * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) */ __pyx_t_1 = (__pyx_v_dtype_is_object != 0); if (__pyx_t_1) { /* "View.MemoryView":1367 * * if dtype_is_object: * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<< * dst.strides, ndim, inc) * */ __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1366 * * * if dtype_is_object: # <<<<<<<<<<<<<< * refcount_objects_in_slice_with_gil(dst.data, dst.shape, * dst.strides, ndim, inc) */ } /* "View.MemoryView":1362 * * @cname('__pyx_memoryview_refcount_copying') * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<< * int ndim, bint inc) nogil: * */ /* function exit code */ } /* "View.MemoryView":1371 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * bint inc) with gil: */ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { __Pyx_RefNannyDeclarations #ifdef WITH_THREAD PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0); /* "View.MemoryView":1374 * Py_ssize_t *strides, int ndim, * bint inc) with gil: * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<< * * @cname('__pyx_memoryview_refcount_objects_in_slice') */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc); /* "View.MemoryView":1371 * * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * bint inc) with gil: */ /* function exit code */ __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD __Pyx_PyGILState_Release(__pyx_gilstate_save); #endif } /* "View.MemoryView":1377 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): * cdef Py_ssize_t i */ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) { CYTHON_UNUSED Py_ssize_t __pyx_v_i; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0); /* "View.MemoryView":1381 * cdef Py_ssize_t i * * for i in range(shape[0]): # <<<<<<<<<<<<<< * if ndim == 1: * if inc: */ __pyx_t_1 = (__pyx_v_shape[0]); __pyx_t_2 = __pyx_t_1; for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; /* "View.MemoryView":1382 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: * Py_INCREF(( data)[0]) */ __pyx_t_4 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_4) { /* "View.MemoryView":1383 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< * Py_INCREF(( data)[0]) * else: */ __pyx_t_4 = (__pyx_v_inc != 0); if (__pyx_t_4) { /* "View.MemoryView":1384 * if ndim == 1: * if inc: * Py_INCREF(( data)[0]) # <<<<<<<<<<<<<< * else: * Py_DECREF(( data)[0]) */ Py_INCREF((((PyObject **)__pyx_v_data)[0])); /* "View.MemoryView":1383 * for i in range(shape[0]): * if ndim == 1: * if inc: # <<<<<<<<<<<<<< * Py_INCREF(( data)[0]) * else: */ goto __pyx_L6; } /* "View.MemoryView":1386 * Py_INCREF(( data)[0]) * else: * Py_DECREF(( data)[0]) # <<<<<<<<<<<<<< * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, */ /*else*/ { Py_DECREF((((PyObject **)__pyx_v_data)[0])); } __pyx_L6:; /* "View.MemoryView":1382 * * for i in range(shape[0]): * if ndim == 1: # <<<<<<<<<<<<<< * if inc: * Py_INCREF(( data)[0]) */ goto __pyx_L5; } /* "View.MemoryView":1388 * Py_DECREF(( data)[0]) * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< * ndim - 1, inc) * */ /*else*/ { /* "View.MemoryView":1389 * else: * refcount_objects_in_slice(data, shape + 1, strides + 1, * ndim - 1, inc) # <<<<<<<<<<<<<< * * data += strides[0] */ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc); } __pyx_L5:; /* "View.MemoryView":1391 * ndim - 1, inc) * * data += strides[0] # <<<<<<<<<<<<<< * * */ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0])); } /* "View.MemoryView":1377 * * @cname('__pyx_memoryview_refcount_objects_in_slice') * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, bint inc): * cdef Py_ssize_t i */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "View.MemoryView":1397 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, * bint dtype_is_object) nogil: */ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) { /* "View.MemoryView":1400 * size_t itemsize, void *item, * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<< * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0); /* "View.MemoryView":1401 * bint dtype_is_object) nogil: * refcount_copying(dst, dtype_is_object, ndim, False) * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<< * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) */ __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item); /* "View.MemoryView":1403 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, * itemsize, item) * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<< * * */ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1); /* "View.MemoryView":1397 * * @cname('__pyx_memoryview_slice_assign_scalar') * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<< * size_t itemsize, void *item, * bint dtype_is_object) nogil: */ /* function exit code */ } /* "View.MemoryView":1407 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * size_t itemsize, void *item) nogil: */ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) { CYTHON_UNUSED Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_stride; Py_ssize_t __pyx_v_extent; int __pyx_t_1; Py_ssize_t __pyx_t_2; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; /* "View.MemoryView":1411 * size_t itemsize, void *item) nogil: * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<< * cdef Py_ssize_t extent = shape[0] * */ __pyx_v_stride = (__pyx_v_strides[0]); /* "View.MemoryView":1412 * cdef Py_ssize_t i * cdef Py_ssize_t stride = strides[0] * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<< * * if ndim == 1: */ __pyx_v_extent = (__pyx_v_shape[0]); /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) */ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0); if (__pyx_t_1) { /* "View.MemoryView":1415 * * if ndim == 1: * for i in range(extent): # <<<<<<<<<<<<<< * memcpy(data, item, itemsize) * data += stride */ __pyx_t_2 = __pyx_v_extent; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1416 * if ndim == 1: * for i in range(extent): * memcpy(data, item, itemsize) # <<<<<<<<<<<<<< * data += stride * else: */ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize)); /* "View.MemoryView":1417 * for i in range(extent): * memcpy(data, item, itemsize) * data += stride # <<<<<<<<<<<<<< * else: * for i in range(extent): */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } /* "View.MemoryView":1414 * cdef Py_ssize_t extent = shape[0] * * if ndim == 1: # <<<<<<<<<<<<<< * for i in range(extent): * memcpy(data, item, itemsize) */ goto __pyx_L3; } /* "View.MemoryView":1419 * data += stride * else: * for i in range(extent): # <<<<<<<<<<<<<< * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) */ /*else*/ { __pyx_t_2 = __pyx_v_extent; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "View.MemoryView":1420 * else: * for i in range(extent): * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<< * ndim - 1, itemsize, item) * data += stride */ __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item); /* "View.MemoryView":1422 * _slice_assign_scalar(data, shape + 1, strides + 1, * ndim - 1, itemsize, item) * data += stride # <<<<<<<<<<<<<< * * */ __pyx_v_data = (__pyx_v_data + __pyx_v_stride); } } __pyx_L3:; /* "View.MemoryView":1407 * * @cname('__pyx_memoryview__slice_assign_scalar') * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<< * Py_ssize_t *strides, int ndim, * size_t itemsize, void *item) nogil: */ /* function exit code */ } /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(56, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(56, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(56, 1, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(56, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(56, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0xb068931: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0xb068931: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __PYX_ERR(56, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(56, 9, __pyx_L1_error) __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) * __pyx_result = Enum.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; int __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<< * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(56, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->name); __Pyx_DECREF(__pyx_v___pyx_result->name); __pyx_v___pyx_result->name = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(56, 13, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(56, 13, __pyx_L1_error) __pyx_t_4 = ((__pyx_t_3 > 1) != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(56, 13, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(56, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(56, 14, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[1]) */ } /* "(tree fragment)":11 * __pyx_unpickle_Enum__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.name = __pyx_state[0] * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "BufferFormatFromTypeInfo":1463 * * @cname('__pyx_format_from_typeinfo') * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< * cdef __Pyx_StructField *field * cdef __pyx_typeinfo_string fmt */ static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) { __Pyx_StructField *__pyx_v_field; struct __pyx_typeinfo_string __pyx_v_fmt; PyObject *__pyx_v_part = 0; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_alignment = NULL; PyObject *__pyx_v_parts = NULL; PyObject *__pyx_v_extents = NULL; int __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_StructField *__pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("format_from_typeinfo", 0); /* "BufferFormatFromTypeInfo":1468 * cdef bytes part, result * * if type.typegroup == 'S': # <<<<<<<<<<<<<< * assert type.fields != NULL * assert type.fields.type != NULL */ __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0); if (__pyx_t_1) { /* "BufferFormatFromTypeInfo":1469 * * if type.typegroup == 'S': * assert type.fields != NULL # <<<<<<<<<<<<<< * assert type.fields.type != NULL * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(56, 1469, __pyx_L1_error) } } #endif /* "BufferFormatFromTypeInfo":1470 * if type.typegroup == 'S': * assert type.fields != NULL * assert type.fields.type != NULL # <<<<<<<<<<<<<< * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(56, 1470, __pyx_L1_error) } } #endif /* "BufferFormatFromTypeInfo":1472 * assert type.fields.type != NULL * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< * alignment = b'^' * else: */ __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0); if (__pyx_t_1) { /* "BufferFormatFromTypeInfo":1473 * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: * alignment = b'^' # <<<<<<<<<<<<<< * else: * alignment = b'' */ __Pyx_INCREF(__pyx_kp_b__72); __pyx_v_alignment = __pyx_kp_b__72; /* "BufferFormatFromTypeInfo":1472 * assert type.fields.type != NULL * * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<< * alignment = b'^' * else: */ goto __pyx_L4; } /* "BufferFormatFromTypeInfo":1475 * alignment = b'^' * else: * alignment = b'' # <<<<<<<<<<<<<< * * parts = [b"T{"] */ /*else*/ { __Pyx_INCREF(__pyx_kp_b__7); __pyx_v_alignment = __pyx_kp_b__7; } __pyx_L4:; /* "BufferFormatFromTypeInfo":1477 * alignment = b'' * * parts = [b"T{"] # <<<<<<<<<<<<<< * field = type.fields * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_kp_b_T_2); __Pyx_GIVEREF(__pyx_kp_b_T_2); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T_2); __pyx_v_parts = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "BufferFormatFromTypeInfo":1478 * * parts = [b"T{"] * field = type.fields # <<<<<<<<<<<<<< * * while field.type: */ __pyx_t_3 = __pyx_v_type->fields; __pyx_v_field = __pyx_t_3; /* "BufferFormatFromTypeInfo":1480 * field = type.fields * * while field.type: # <<<<<<<<<<<<<< * part = format_from_typeinfo(field.type) * parts.append(part + b':' + field.name + b':') */ while (1) { __pyx_t_1 = (__pyx_v_field->type != 0); if (!__pyx_t_1) break; /* "BufferFormatFromTypeInfo":1481 * * while field.type: * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<< * parts.append(part + b':' + field.name + b':') * field += 1 */ __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "BufferFormatFromTypeInfo":1482 * while field.type: * part = format_from_typeinfo(field.type) * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<< * field += 1 * */ __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__73); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__73); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(56, 1482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "BufferFormatFromTypeInfo":1483 * part = format_from_typeinfo(field.type) * parts.append(part + b':' + field.name + b':') * field += 1 # <<<<<<<<<<<<<< * * result = alignment.join(parts) + b'}' */ __pyx_v_field = (__pyx_v_field + 1); } /* "BufferFormatFromTypeInfo":1485 * field += 1 * * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<< * else: * fmt = __Pyx_TypeInfoToFormat(type) */ __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__74); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(56, 1485, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1468 * cdef bytes part, result * * if type.typegroup == 'S': # <<<<<<<<<<<<<< * assert type.fields != NULL * assert type.fields.type != NULL */ goto __pyx_L3; } /* "BufferFormatFromTypeInfo":1487 * result = alignment.join(parts) + b'}' * else: * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<< * if type.arraysize[0]: * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] */ /*else*/ { __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type); /* "BufferFormatFromTypeInfo":1488 * else: * fmt = __Pyx_TypeInfoToFormat(type) * if type.arraysize[0]: # <<<<<<<<<<<<<< * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string */ __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0); if (__pyx_t_1) { /* "BufferFormatFromTypeInfo":1489 * fmt = __Pyx_TypeInfoToFormat(type) * if type.arraysize[0]: * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<< * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string * else: */ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_type->ndim; __pyx_t_8 = __pyx_t_7; for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { __pyx_v_i = __pyx_t_9; __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(56, 1489, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_extents = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; /* "BufferFormatFromTypeInfo":1490 * if type.arraysize[0]: * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<< * else: * result = fmt.string */ __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__14, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s_2, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(56, 1490, __pyx_L1_error) __pyx_v_result = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; /* "BufferFormatFromTypeInfo":1488 * else: * fmt = __Pyx_TypeInfoToFormat(type) * if type.arraysize[0]: # <<<<<<<<<<<<<< * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string */ goto __pyx_L7; } /* "BufferFormatFromTypeInfo":1492 * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string * else: * result = fmt.string # <<<<<<<<<<<<<< * * return result */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_result = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; } __pyx_L7:; } __pyx_L3:; /* "BufferFormatFromTypeInfo":1494 * result = fmt.string * * return result # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "BufferFormatFromTypeInfo":1463 * * @cname('__pyx_format_from_typeinfo') * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< * cdef __Pyx_StructField *field * cdef __pyx_typeinfo_string fmt */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_part); __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_alignment); __Pyx_XDECREF(__pyx_v_parts); __Pyx_XDECREF(__pyx_v_extents); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Comm(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscCommObject *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct PyPetscCommObject *)o); p->base = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_4Comm_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Comm(PyObject *o) { struct PyPetscCommObject *p = (struct PyPetscCommObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_4Comm_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->base); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_8petsc4py_5PETSc_Comm(PyObject *o, visitproc v, void *a) { int e; struct PyPetscCommObject *p = (struct PyPetscCommObject *)o; if (p->base) { e = (*v)(p->base, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc_Comm(PyObject *o) { PyObject* tmp; struct PyPetscCommObject *p = (struct PyPetscCommObject *)o; tmp = ((PyObject*)p->base); p->base = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4Comm_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4Comm_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4Comm_rank(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4Comm_4rank_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4Comm_fortran(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4Comm_7fortran_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Comm[] = { {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_8destroy}, {"duplicate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_10duplicate}, {"getSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_12getSize}, {"getRank", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_14getRank}, {"barrier", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_16barrier}, {"tompi4py", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_18tompi4py}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Comm[] = { {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_4Comm_size, 0, (char *)0, 0}, {(char *)"rank", __pyx_getprop_8petsc4py_5PETSc_4Comm_rank, 0, (char *)0, 0}, {(char *)"fortran", __pyx_getprop_8petsc4py_5PETSc_4Comm_fortran, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Comm = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_pw_8petsc4py_5PETSc_4Comm_7__nonzero__, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; DL_EXPORT(PyTypeObject) PyPetscComm_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Comm", /*tp_name*/ sizeof(struct PyPetscCommObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Comm, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Comm, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Comm, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Comm, /*tp_clear*/ __pyx_pw_8petsc4py_5PETSc_4Comm_5__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Comm, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Comm, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Comm, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_vtable_8petsc4py_5PETSc_Object; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Object(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct PyPetscObjectObject *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct PyPetscObjectObject *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc_Object; p->__pyx___dummy__ = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Object(PyObject *o) { struct PyPetscObjectObject *p = (struct PyPetscObjectObject *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } if (p->__weakref__) PyObject_ClearWeakRefs(o); Py_CLEAR(p->__pyx___dummy__); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_8petsc4py_5PETSc_Object(PyObject *o, visitproc v, void *a) { int e; struct PyPetscObjectObject *p = (struct PyPetscObjectObject *)o; if (p->__pyx___dummy__) { e = (*v)(p->__pyx___dummy__, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc_Object(PyObject *o) { PyObject* tmp; struct PyPetscObjectObject *p = (struct PyPetscObjectObject *)o; tmp = ((PyObject*)p->__pyx___dummy__); p->__pyx___dummy__ = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_4type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Object_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Object_4type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_prefix(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Object_prefix(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Object_6prefix_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_comm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_4comm_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Object_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Object_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_classid(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_7classid_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_klass(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_5klass_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_refcount(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_8refcount_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_handle(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_6handle_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Object_fortran(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Object_7fortran_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Object[] = { {"__copy__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_8__copy__}, {"__deepcopy__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_10__deepcopy__}, {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_13view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_12view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_15destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_14destroy}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_17getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_16getType}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_18setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_20getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_23setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_22setFromOptions}, {"viewFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_25viewFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_24viewFromOptions}, {"getComm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_27getComm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_26getComm}, {"getName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_29getName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_28getName}, {"setName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_31setName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_30setName}, {"getClassId", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_33getClassId, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_32getClassId}, {"getClassName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_35getClassName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_34getClassName}, {"getRefCount", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_37getRefCount, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_36getRefCount}, {"compose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_39compose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_38compose}, {"query", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_41query, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_40query}, {"incRef", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_43incRef, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_42incRef}, {"decRef", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_45decRef, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_44decRef}, {"getAttr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_47getAttr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_46getAttr}, {"setAttr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_49setAttr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_48setAttr}, {"getDict", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_51getDict, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_50getDict}, {"stateIncrease", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_53stateIncrease, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_52stateIncrease}, {"incrementTabLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_55incrementTabLevel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_54incrementTabLevel}, {"setTabLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_57setTabLevel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_56setTabLevel}, {"getTabLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_59getTabLevel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_58getTabLevel}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Object[] = { {(char *)"type", __pyx_getprop_8petsc4py_5PETSc_6Object_type, __pyx_setprop_8petsc4py_5PETSc_6Object_type, (char *)0, 0}, {(char *)"prefix", __pyx_getprop_8petsc4py_5PETSc_6Object_prefix, __pyx_setprop_8petsc4py_5PETSc_6Object_prefix, (char *)0, 0}, {(char *)"comm", __pyx_getprop_8petsc4py_5PETSc_6Object_comm, 0, (char *)0, 0}, {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_6Object_name, __pyx_setprop_8petsc4py_5PETSc_6Object_name, (char *)0, 0}, {(char *)"classid", __pyx_getprop_8petsc4py_5PETSc_6Object_classid, 0, (char *)0, 0}, {(char *)"klass", __pyx_getprop_8petsc4py_5PETSc_6Object_klass, 0, (char *)0, 0}, {(char *)"refcount", __pyx_getprop_8petsc4py_5PETSc_6Object_refcount, 0, (char *)0, 0}, {(char *)"handle", __pyx_getprop_8petsc4py_5PETSc_6Object_handle, 0, (char *)0, 0}, {(char *)"fortran", __pyx_getprop_8petsc4py_5PETSc_6Object_fortran, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Object = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ __pyx_pw_8petsc4py_5PETSc_6Object_7__nonzero__, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; DL_EXPORT(PyTypeObject) PyPetscObject_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Object", /*tp_name*/ sizeof(struct PyPetscObjectObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Object, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ __pyx_pw_8petsc4py_5PETSc_6Object_5__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Object, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Object, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Object, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Viewer __pyx_vtable_8petsc4py_5PETSc_Viewer; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Viewer(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscViewerObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscViewerObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Viewer; if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Viewer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Viewer[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_8create}, {"createASCII", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_10createASCII}, {"createBinary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_12createBinary}, {"createMPIIO", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_14createMPIIO}, {"createVTK", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_16createVTK}, {"createHDF5", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_18createHDF5}, {"createDraw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_20createDraw}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_22setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_24getType}, {"getFormat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_27getFormat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_26getFormat}, {"pushFormat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_29pushFormat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_28pushFormat}, {"popFormat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_31popFormat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_30popFormat}, {"STDOUT", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_33STDOUT, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_32STDOUT}, {"STDERR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_35STDERR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_34STDERR}, {"ASCII", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_37ASCII, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_36ASCII}, {"BINARY", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_39BINARY, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_38BINARY}, {"DRAW", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_41DRAW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_40DRAW}, {"setASCIITab", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_43setASCIITab, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_42setASCIITab}, {"getASCIITab", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_45getASCIITab, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_44getASCIITab}, {"addASCIITab", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_47addASCIITab, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_46addASCIITab}, {"subtractASCIITab", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_49subtractASCIITab, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_48subtractASCIITab}, {"pushASCIISynchronized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_51pushASCIISynchronized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_50pushASCIISynchronized}, {"popASCIISynchronized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_53popASCIISynchronized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_52popASCIISynchronized}, {"pushASCIITab", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_55pushASCIITab, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_54pushASCIITab}, {"popASCIITab", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_57popASCIITab, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_56popASCIITab}, {"useASCIITabs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_59useASCIITabs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_58useASCIITabs}, {"printfASCII", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_61printfASCII, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_60printfASCII}, {"printfASCIISynchronized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_63printfASCIISynchronized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_62printfASCIISynchronized}, {"flush", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_65flush, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_64flush}, {"setFileMode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_67setFileMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_66setFileMode}, {"getFileMode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_69getFileMode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_68getFileMode}, {"setFileName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_71setFileName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_70setFileName}, {"getFileName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_73getFileName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_72getFileName}, {"setDrawInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_75setDrawInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_74setDrawInfo}, {"clearDraw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_77clearDraw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_76clearDraw}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscViewer_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Viewer", /*tp_name*/ sizeof(struct PyPetscViewerObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Viewer, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Viewer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Random __pyx_vtable_8petsc4py_5PETSc_Random; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Random(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscRandomObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscRandomObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Random; if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Random_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Random_seed(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Random_4seed_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Random_seed(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Random_4seed_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6Random_interval(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6Random_8interval_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_6Random_interval(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_6Random_8interval_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Random[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_8create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_11setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_10setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_13getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_12getType}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_14setFromOptions}, {"getValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_17getValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_16getValue}, {"getValueReal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_18getValueReal}, {"getSeed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_20getSeed}, {"setSeed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_22setSeed}, {"getInterval", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_24getInterval}, {"setInterval", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_26setInterval}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Random[] = { {(char *)"seed", __pyx_getprop_8petsc4py_5PETSc_6Random_seed, __pyx_setprop_8petsc4py_5PETSc_6Random_seed, (char *)0, 0}, {(char *)"interval", __pyx_getprop_8petsc4py_5PETSc_6Random_interval, __pyx_setprop_8petsc4py_5PETSc_6Random_interval, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscRandom_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Random", /*tp_name*/ sizeof(struct PyPetscRandomObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_6Random_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Random, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Random, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Random, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_IS __pyx_vtable_8petsc4py_5PETSc_IS; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_IS(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscISObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscISObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_IS; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2IS_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_permutation(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_11permutation_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_identity(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_8identity_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_sorted(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_6sorted_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_5sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_local_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_10local_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_indices(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_7indices_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS_array(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_5array_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2IS___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2IS_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_IS[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_6__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_8__exit__}, {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_11view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_10view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_13destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_12destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_15create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_14create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_17setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_16setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_19getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_18getType}, {"createGeneral", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_20createGeneral}, {"createBlock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_22createBlock}, {"createStride", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_25createStride, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_24createStride}, {"duplicate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_26duplicate}, {"copy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_29copy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_28copy}, {"load", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_31load, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_30load}, {"allGather", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_33allGather, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_32allGather}, {"toGeneral", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_34toGeneral}, {"invertPermutation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_37invertPermutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_36invertPermutation}, {"getSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_39getSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_38getSize}, {"getLocalSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_41getLocalSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_40getLocalSize}, {"getSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_43getSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_42getSizes}, {"getBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_45getBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_44getBlockSize}, {"setBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_47setBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_46setBlockSize}, {"sort", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_49sort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_48sort}, {"isSorted", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_51isSorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_50isSorted}, {"setPermutation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_53setPermutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_52setPermutation}, {"isPermutation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_55isPermutation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_54isPermutation}, {"setIdentity", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_57setIdentity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_56setIdentity}, {"isIdentity", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_59isIdentity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_58isIdentity}, {"equal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_61equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_60equal}, {"sum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_63sum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_62sum}, {"expand", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_65expand, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_64expand}, {"union", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_67union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_66union}, {"difference", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_69difference, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_68difference}, {"complement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_71complement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_70complement}, {"embed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_73embed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_72embed}, {"renumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_75renumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_74renumber}, {"setIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_77setIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_76setIndices}, {"getIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_79getIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_78getIndices}, {"setBlockIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_81setBlockIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_80setBlockIndices}, {"getBlockIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_83getBlockIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_82getBlockIndices}, {"setStride", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_85setStride, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_84setStride}, {"getStride", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_87getStride, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_86getStride}, {"getInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_89getInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_88getInfo}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_IS[] = { {(char *)"permutation", __pyx_getprop_8petsc4py_5PETSc_2IS_permutation, 0, (char *)0, 0}, {(char *)"identity", __pyx_getprop_8petsc4py_5PETSc_2IS_identity, 0, (char *)0, 0}, {(char *)"sorted", __pyx_getprop_8petsc4py_5PETSc_2IS_sorted, 0, (char *)0, 0}, {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_2IS_sizes, 0, (char *)0, 0}, {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_2IS_size, 0, (char *)0, 0}, {(char *)"local_size", __pyx_getprop_8petsc4py_5PETSc_2IS_local_size, 0, (char *)0, 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_2IS_block_size, 0, (char *)0, 0}, {(char *)"indices", __pyx_getprop_8petsc4py_5PETSc_2IS_indices, 0, (char *)0, 0}, {(char *)"array", __pyx_getprop_8petsc4py_5PETSc_2IS_array, 0, (char *)0, 0}, {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_2IS___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyBufferProcs __pyx_tp_as_buffer_IS = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__, /*bf_releasebuffer*/ }; DL_EXPORT(PyTypeObject) PyPetscIS_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.IS", /*tp_name*/ sizeof(struct PyPetscISObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_IS, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_IS, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_IS, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_IS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_LGMap __pyx_vtable_8petsc4py_5PETSc_LGMap; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LGMap(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscLGMapObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscLGMapObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_LGMap; if (unlikely(__pyx_pw_8petsc4py_5PETSc_5LGMap_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_indices(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_7indices_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_block_indices(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_13block_indices_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_info(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_4info_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_5LGMap_block_info(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_5LGMap_10block_info_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LGMap[] = { {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_4setType}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_6setFromOptions}, {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_9view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_8view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_11destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_10destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_13create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_12create}, {"createIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_15createIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_14createIS}, {"createSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_17createSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_16createSF}, {"getSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_19getSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_18getSize}, {"getBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_21getBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_20getBlockSize}, {"getIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_23getIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_22getIndices}, {"getBlockIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_25getBlockIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_24getBlockIndices}, {"getInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_27getInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_26getInfo}, {"getBlockInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_29getBlockInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_28getBlockInfo}, {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_31apply, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_30apply}, {"applyBlock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_33applyBlock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_32applyBlock}, {"applyIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_34applyIS}, {"applyInverse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyInverse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_36applyInverse}, {"applyBlockInverse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyBlockInverse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_38applyBlockInverse}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LGMap[] = { {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_5LGMap_size, 0, (char *)0, 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_size, 0, (char *)0, 0}, {(char *)"indices", __pyx_getprop_8petsc4py_5PETSc_5LGMap_indices, 0, (char *)0, 0}, {(char *)"block_indices", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_indices, 0, (char *)0, 0}, {(char *)"info", __pyx_getprop_8petsc4py_5PETSc_5LGMap_info, 0, (char *)0, 0}, {(char *)"block_info", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_info, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscLGMap_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.LGMap", /*tp_name*/ sizeof(struct PyPetscLGMapObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LGMap, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LGMap, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LGMap, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SF __pyx_vtable_8petsc4py_5PETSc_SF; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SF(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscSFObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscSFObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_SF; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2SF_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_SF(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_2SF_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } PyObject_GC_Track(o); __pyx_tp_dealloc_8petsc4py_5PETSc_Object(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_SF[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_8create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_11setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_10setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_13getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_12getType}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_15setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_14setFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_17setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_16setUp}, {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_19reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_18reset}, {"getGraph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_21getGraph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_20getGraph}, {"setGraph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_23setGraph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_22setGraph}, {"setRankOrder", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_25setRankOrder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_24setRankOrder}, {"getMulti", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_27getMulti, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_26getMulti}, {"createInverse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_29createInverse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_28createInverse}, {"computeDegree", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_31computeDegree, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_30computeDegree}, {"createEmbeddedRootSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedRootSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_32createEmbeddedRootSF}, {"createEmbeddedLeafSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_35createEmbeddedLeafSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_34createEmbeddedLeafSF}, {"bcastBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_37bcastBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_36bcastBegin}, {"bcastEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_39bcastEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_38bcastEnd}, {"reduceBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_41reduceBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_40reduceBegin}, {"reduceEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_43reduceEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_42reduceEnd}, {"scatterBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_45scatterBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_44scatterBegin}, {"scatterEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_47scatterEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_46scatterEnd}, {"gatherBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_49gatherBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_48gatherBegin}, {"gatherEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_51gatherEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_50gatherEnd}, {"fetchAndOpBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_53fetchAndOpBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_52fetchAndOpBegin}, {"fetchAndOpEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_55fetchAndOpEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_54fetchAndOpEnd}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscSF_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.SF", /*tp_name*/ sizeof(struct PyPetscSFObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_SF, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_SF, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_SF, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Vec __pyx_vtable_8petsc4py_5PETSc_Vec; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Vec(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscVecObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscVecObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Vec; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3Vec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc_Vec(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc_Vec(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_31__setitem__(o, i, v); } else { if (__pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping && __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript) return __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript(o, i, v); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Vec_sizes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5sizes_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_local_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_10local_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_owner_range(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_11owner_range_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_owner_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_12owner_ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_w_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_8buffer_r_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_array_w(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Vec_array_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_7array_w_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_array_r(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_7array_r_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_buffer(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_6buffer_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec_array(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5array_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Vec_array(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Vec_5array_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Vec___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Vec_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Vec[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_37__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_36__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_39__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_38__exit__}, {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_41view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_40view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_43destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_42destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_45create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_44create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_47setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_46setType}, {"setSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_49setSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_48setSizes}, {"createSeq", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_51createSeq, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_50createSeq}, {"createMPI", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_53createMPI, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_52createMPI}, {"createWithArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_55createWithArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_54createWithArray}, {"createCUDAWithArrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_57createCUDAWithArrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_56createCUDAWithArrays}, {"createViennaCLWithArrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_59createViennaCLWithArrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_58createViennaCLWithArrays}, {"createWithDLPack", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_61createWithDLPack, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_60createWithDLPack}, {"attachDLPackInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_63attachDLPackInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_62attachDLPackInfo}, {"clearDLPackInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_65clearDLPackInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_64clearDLPackInfo}, {"toDLPack", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_67toDLPack, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_66toDLPack}, {"createGhost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_69createGhost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_68createGhost}, {"createGhostWithArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_71createGhostWithArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_70createGhostWithArray}, {"createShared", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_73createShared, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_72createShared}, {"createNest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_75createNest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_74createNest}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_77setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_76setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_79getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_78getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_81setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_80setFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_83setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_82setUp}, {"setOption", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_85setOption, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_84setOption}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_87getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_86getType}, {"getSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_89getSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_88getSize}, {"getLocalSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_91getLocalSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_90getLocalSize}, {"getSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_93getSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_92getSizes}, {"setBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_95setBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_94setBlockSize}, {"getBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_97getBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_96getBlockSize}, {"getOwnershipRange", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_99getOwnershipRange, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_98getOwnershipRange}, {"getOwnershipRanges", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_101getOwnershipRanges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_100getOwnershipRanges}, {"getBuffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_103getBuffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_102getBuffer}, {"getArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_105getArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_104getArray}, {"setArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_107setArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_106setArray}, {"placeArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_109placeArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_108placeArray}, {"resetArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_111resetArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_110resetArray}, {"bindToCPU", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_113bindToCPU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_112bindToCPU}, {"getCUDAHandle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_115getCUDAHandle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_114getCUDAHandle}, {"restoreCUDAHandle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_117restoreCUDAHandle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_116restoreCUDAHandle}, {"getOffloadMask", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_119getOffloadMask, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_118getOffloadMask}, {"getCLContextHandle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_121getCLContextHandle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_120getCLContextHandle}, {"getCLQueueHandle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_123getCLQueueHandle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_122getCLQueueHandle}, {"getCLMemHandle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_125getCLMemHandle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_124getCLMemHandle}, {"restoreCLMemHandle", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreCLMemHandle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_126restoreCLMemHandle}, {"duplicate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_129duplicate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_128duplicate}, {"copy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_131copy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_130copy}, {"chop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_133chop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_132chop}, {"load", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_135load, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_134load}, {"equal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_137equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_136equal}, {"dot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_139dot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_138dot}, {"dotBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_141dotBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_140dotBegin}, {"dotEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_143dotEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_142dotEnd}, {"tDot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_145tDot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_144tDot}, {"tDotBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_147tDotBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_146tDotBegin}, {"tDotEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_149tDotEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_148tDotEnd}, {"mDot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_151mDot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_150mDot}, {"mDotBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_153mDotBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_152mDotBegin}, {"mDotEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_155mDotEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_154mDotEnd}, {"mtDot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_157mtDot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_156mtDot}, {"mtDotBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_159mtDotBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_158mtDotBegin}, {"mtDotEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_161mtDotEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_160mtDotEnd}, {"norm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_163norm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_162norm}, {"normBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_165normBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_164normBegin}, {"normEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_167normEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_166normEnd}, {"sum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_169sum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_168sum}, {"min", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_171min, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_170min}, {"max", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_173max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_172max}, {"normalize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_175normalize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_174normalize}, {"reciprocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_177reciprocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_176reciprocal}, {"exp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_179exp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_178exp}, {"log", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_181log, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_180log}, {"sqrtabs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_183sqrtabs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_182sqrtabs}, {"abs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_185abs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_184abs}, {"conjugate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_187conjugate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_186conjugate}, {"setRandom", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_189setRandom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_188setRandom}, {"permute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_191permute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_190permute}, {"zeroEntries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_193zeroEntries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_192zeroEntries}, {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_195set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_194set}, {"isset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_197isset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_196isset}, {"scale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_199scale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_198scale}, {"shift", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_201shift, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_200shift}, {"chop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_203chop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_202chop}, {"swap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_205swap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_204swap}, {"axpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_207axpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_206axpy}, {"isaxpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_209isaxpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_208isaxpy}, {"aypx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_211aypx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_210aypx}, {"axpby", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_213axpby, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_212axpby}, {"waxpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_215waxpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_214waxpy}, {"maxpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_217maxpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_216maxpy}, {"pointwiseMult", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_219pointwiseMult, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_218pointwiseMult}, {"pointwiseDivide", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_221pointwiseDivide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_220pointwiseDivide}, {"pointwiseMin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_223pointwiseMin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_222pointwiseMin}, {"pointwiseMax", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_225pointwiseMax, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_224pointwiseMax}, {"pointwiseMaxAbs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_227pointwiseMaxAbs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_226pointwiseMaxAbs}, {"maxPointwiseDivide", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_229maxPointwiseDivide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_228maxPointwiseDivide}, {"getValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_231getValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_230getValue}, {"getValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_233getValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_232getValues}, {"getValuesStagStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_235getValuesStagStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_234getValuesStagStencil}, {"setValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_237setValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_236setValue}, {"setValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_239setValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_238setValues}, {"setValuesBlocked", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_241setValuesBlocked, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_240setValuesBlocked}, {"setValuesStagStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_243setValuesStagStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_242setValuesStagStencil}, {"setLGMap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_245setLGMap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_244setLGMap}, {"getLGMap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_247getLGMap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_246getLGMap}, {"setValueLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_249setValueLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_248setValueLocal}, {"setValuesLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_251setValuesLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_250setValuesLocal}, {"setValuesBlockedLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_253setValuesBlockedLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_252setValuesBlockedLocal}, {"assemblyBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_255assemblyBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_254assemblyBegin}, {"assemblyEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_257assemblyEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_256assemblyEnd}, {"assemble", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_259assemble, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_258assemble}, {"strideScale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_261strideScale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_260strideScale}, {"strideSum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_263strideSum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_262strideSum}, {"strideMin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_265strideMin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_264strideMin}, {"strideMax", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_267strideMax, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_266strideMax}, {"strideNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_269strideNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_268strideNorm}, {"strideScatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_271strideScatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_270strideScatter}, {"strideGather", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_273strideGather, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_272strideGather}, {"localForm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_275localForm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_274localForm}, {"ghostUpdateBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_277ghostUpdateBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_276ghostUpdateBegin}, {"ghostUpdateEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_279ghostUpdateEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_278ghostUpdateEnd}, {"ghostUpdate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_281ghostUpdate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_280ghostUpdate}, {"setMPIGhost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_283setMPIGhost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_282setMPIGhost}, {"getSubVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_285getSubVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_284getSubVector}, {"restoreSubVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_287restoreSubVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_286restoreSubVector}, {"getNestSubVecs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_289getNestSubVecs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_288getNestSubVecs}, {"setNestSubVecs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_291setNestSubVecs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_290setNestSubVecs}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Vec[] = { {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_3Vec_sizes, __pyx_setprop_8petsc4py_5PETSc_3Vec_sizes, (char *)0, 0}, {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_3Vec_size, 0, (char *)0, 0}, {(char *)"local_size", __pyx_getprop_8petsc4py_5PETSc_3Vec_local_size, 0, (char *)0, 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_3Vec_block_size, 0, (char *)0, 0}, {(char *)"owner_range", __pyx_getprop_8petsc4py_5PETSc_3Vec_owner_range, 0, (char *)0, 0}, {(char *)"owner_ranges", __pyx_getprop_8petsc4py_5PETSc_3Vec_owner_ranges, 0, (char *)0, 0}, {(char *)"buffer_w", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_w, 0, (char *)"Vec buffer (writable)", 0}, {(char *)"buffer_r", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_r, 0, (char *)"Vec buffer (read-only)", 0}, {(char *)"array_w", __pyx_getprop_8petsc4py_5PETSc_3Vec_array_w, __pyx_setprop_8petsc4py_5PETSc_3Vec_array_w, (char *)"Vec array (writable)", 0}, {(char *)"array_r", __pyx_getprop_8petsc4py_5PETSc_3Vec_array_r, 0, (char *)"Vec array (read-only)", 0}, {(char *)"buffer", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer, 0, (char *)0, 0}, {(char *)"array", __pyx_getprop_8petsc4py_5PETSc_3Vec_array, __pyx_setprop_8petsc4py_5PETSc_3Vec_array, (char *)0, 0}, {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_3Vec___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Vec = { __pyx_pw_8petsc4py_5PETSc_3Vec_19__add__, /*nb_add*/ __pyx_pw_8petsc4py_5PETSc_3Vec_21__sub__, /*nb_subtract*/ __pyx_pw_8petsc4py_5PETSc_3Vec_23__mul__, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_8petsc4py_5PETSc_3Vec_25__div__, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ __pyx_pw_8petsc4py_5PETSc_3Vec_5__neg__, /*nb_negative*/ __pyx_pw_8petsc4py_5PETSc_3Vec_3__pos__, /*nb_positive*/ __pyx_pw_8petsc4py_5PETSc_3Vec_7__abs__, /*nb_absolute*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_8petsc4py_5PETSc_6Object_7__nonzero__, /*nb_nonzero*/ #else 0, /*nb_nonzero*/ #endif 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif __pyx_pw_8petsc4py_5PETSc_3Vec_9__iadd__, /*nb_inplace_add*/ __pyx_pw_8petsc4py_5PETSc_3Vec_11__isub__, /*nb_inplace_subtract*/ __pyx_pw_8petsc4py_5PETSc_3Vec_13__imul__, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ __pyx_pw_8petsc4py_5PETSc_3Vec_27__truediv__, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ __pyx_pw_8petsc4py_5PETSc_3Vec_17__itruediv__, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Vec = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc_Vec, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Vec = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_3Vec_29__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc_Vec, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_Vec = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_3Vec_33__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_3Vec_35__releasebuffer__, /*bf_releasebuffer*/ }; DL_EXPORT(PyTypeObject) PyPetscVec_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Vec", /*tp_name*/ sizeof(struct PyPetscVecObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Vec, /*tp_as_number*/ &__pyx_tp_as_sequence_Vec, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Vec, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Vec, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Vec, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Vec, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Vec, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_FE __pyx_vtable_8petsc4py_5PETSc_FE; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_FE(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscFEObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscFEObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_FE; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2FE_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_FE[] = { {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_3destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_2destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_5create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_4create}, {"createDefault", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_7createDefault, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_6createDefault}, {"getQuadrature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_9getQuadrature, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_8getQuadrature}, {"getFaceQuadrature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_11getFaceQuadrature, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_10getFaceQuadrature}, {"setQuadrature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_13setQuadrature, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_12setQuadrature}, {"setFaceQuadrature", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_15setFaceQuadrature, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_14setFaceQuadrature}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_17setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_16setType}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscFE_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.FE", /*tp_name*/ sizeof(struct PyPetscFEObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_FE, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_FE, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Quad __pyx_vtable_8petsc4py_5PETSc_Quad; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Quad(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscQuadObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscQuadObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Quad; if (unlikely(__pyx_pw_8petsc4py_5PETSc_4Quad_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Quad[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_3create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_2create}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_5destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_4destroy}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscQuad_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Quad", /*tp_name*/ sizeof(struct PyPetscQuadObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Quad, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Quad, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Scatter __pyx_vtable_8petsc4py_5PETSc_Scatter; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Scatter(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscScatterObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscScatterObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Scatter; if (unlikely(__pyx_pw_8petsc4py_5PETSc_7Scatter_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Scatter[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_8create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_10setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_12getType}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_14setFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_16setUp}, {"copy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_18copy}, {"toAll", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_20toAll}, {"toZero", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_22toZero}, {"begin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_24begin}, {"end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_27end, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_26end}, {"scatterBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatterBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_28scatterBegin}, {"scatterEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_31scatterEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_30scatterEnd}, {"scatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_33scatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_32scatter}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscScatter_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Scatter", /*tp_name*/ sizeof(struct PyPetscScatterObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_7Scatter_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Scatter, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Scatter, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Section __pyx_vtable_8petsc4py_5PETSc_Section; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Section(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscSectionObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscSectionObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Section; if (unlikely(__pyx_pw_8petsc4py_5PETSc_7Section_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Section(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_7Section_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } PyObject_GC_Track(o); __pyx_tp_dealloc_8petsc4py_5PETSc_Object(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Section[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_8create}, {"clone", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_11clone, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_10clone}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_13setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_12setUp}, {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_15reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_14reset}, {"getNumFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_17getNumFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_16getNumFields}, {"setNumFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_19setNumFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_18setNumFields}, {"getFieldName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_21getFieldName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_20getFieldName}, {"setFieldName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_23setFieldName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_22setFieldName}, {"getFieldComponents", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_25getFieldComponents, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_24getFieldComponents}, {"setFieldComponents", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_27setFieldComponents, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_26setFieldComponents}, {"getChart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_29getChart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_28getChart}, {"setChart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_31setChart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_30setChart}, {"getDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_33getDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_32getDof}, {"setDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_35setDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_34setDof}, {"addDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_37addDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_36addDof}, {"getFieldDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_39getFieldDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_38getFieldDof}, {"setFieldDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_41setFieldDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_40setFieldDof}, {"addFieldDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_43addFieldDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_42addFieldDof}, {"getConstraintDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_45getConstraintDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_44getConstraintDof}, {"setConstraintDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_47setConstraintDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_46setConstraintDof}, {"addConstraintDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_49addConstraintDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_48addConstraintDof}, {"getFieldConstraintDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_51getFieldConstraintDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_50getFieldConstraintDof}, {"setFieldConstraintDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_53setFieldConstraintDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_52setFieldConstraintDof}, {"addFieldConstraintDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_55addFieldConstraintDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_54addFieldConstraintDof}, {"getConstraintIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_57getConstraintIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_56getConstraintIndices}, {"setConstraintIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_59setConstraintIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_58setConstraintIndices}, {"getFieldConstraintIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_61getFieldConstraintIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_60getFieldConstraintIndices}, {"setFieldConstraintIndices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_63setFieldConstraintIndices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_62setFieldConstraintIndices}, {"getMaxDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_65getMaxDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_64getMaxDof}, {"getStorageSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_67getStorageSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_66getStorageSize}, {"getConstrainedStorageSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_69getConstrainedStorageSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_68getConstrainedStorageSize}, {"getOffset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_71getOffset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_70getOffset}, {"setOffset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_73setOffset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_72setOffset}, {"getFieldOffset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_75getFieldOffset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_74getFieldOffset}, {"setFieldOffset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_77setFieldOffset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_76setFieldOffset}, {"getOffsetRange", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_79getOffsetRange, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_78getOffsetRange}, {"createGlobalSection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_81createGlobalSection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_80createGlobalSection}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscSection_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Section", /*tp_name*/ sizeof(struct PyPetscSectionObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Section, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Section, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Section, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat __pyx_vtable_8petsc4py_5PETSc_Mat; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Mat(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscMatObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscMatObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Mat; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3Mat_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc_Mat(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc_Mat(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Mat_29__setitem__(o, i, v); } else { if (__pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping && __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript) return __pyx_ptype_8petsc4py_5PETSc_Object->tp_as_mapping->mp_ass_subscript(o, i, v); PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3Mat_sizes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3Mat_5sizes_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_4size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_local_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_10local_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_block_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_10block_size_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_block_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_11block_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_owner_range(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_11owner_range_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_owner_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_12owner_ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_assembled(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_9assembled_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_symmetric(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_9symmetric_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_hermitian(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_9hermitian_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3Mat_structsymm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3Mat_10structsymm_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Mat[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_33view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_32view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_35destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_34destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_37create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_36create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_39setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_38setType}, {"setSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_41setSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_40setSizes}, {"setBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_43setBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_42setBlockSize}, {"setBlockSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_45setBlockSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_44setBlockSizes}, {"createAIJ", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_47createAIJ, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_46createAIJ}, {"createBAIJ", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_49createBAIJ, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_48createBAIJ}, {"createSBAIJ", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_51createSBAIJ, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_50createSBAIJ}, {"createAIJCRL", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_53createAIJCRL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_52createAIJCRL}, {"setPreallocationNNZ", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_55setPreallocationNNZ, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_54setPreallocationNNZ}, {"setPreallocationCSR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_57setPreallocationCSR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_56setPreallocationCSR}, {"createAIJWithArrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_59createAIJWithArrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_58createAIJWithArrays}, {"createDense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_61createDense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_60createDense}, {"setPreallocationDense", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_63setPreallocationDense, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_62setPreallocationDense}, {"createScatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_65createScatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_64createScatter}, {"createNormal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_67createNormal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_66createNormal}, {"createTranspose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_69createTranspose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_68createTranspose}, {"createLRC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_71createLRC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_70createLRC}, {"createSubMatrixVirtual", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_73createSubMatrixVirtual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_72createSubMatrixVirtual}, {"createNest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_75createNest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_74createNest}, {"createPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_77createPython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_76createPython}, {"setPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_79setPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_78setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_81getPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_80getPythonContext}, {"setPythonType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_83setPythonType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_82setPythonType}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_85setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_84setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_87getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_86getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_89setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_88setFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_91setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_90setUp}, {"setOption", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_93setOption, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_92setOption}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_95getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_94getType}, {"getSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_97getSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_96getSize}, {"getLocalSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_99getLocalSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_98getLocalSize}, {"getSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_101getSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_100getSizes}, {"getBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_103getBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_102getBlockSize}, {"getBlockSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_105getBlockSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_104getBlockSizes}, {"getOwnershipRange", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_107getOwnershipRange, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_106getOwnershipRange}, {"getOwnershipRanges", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_109getOwnershipRanges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_108getOwnershipRanges}, {"getOwnershipRangeColumn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_111getOwnershipRangeColumn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_110getOwnershipRangeColumn}, {"getOwnershipRangesColumn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_113getOwnershipRangesColumn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_112getOwnershipRangesColumn}, {"getOwnershipIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_115getOwnershipIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_114getOwnershipIS}, {"getInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_117getInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_116getInfo}, {"duplicate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_119duplicate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_118duplicate}, {"copy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_121copy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_120copy}, {"load", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_123load, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_122load}, {"convert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_125convert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_124convert}, {"transpose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_127transpose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_126transpose}, {"realPart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_129realPart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_128realPart}, {"imagPart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_131imagPart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_130imagPart}, {"conjugate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_133conjugate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_132conjugate}, {"permute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_135permute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_134permute}, {"equal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_137equal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_136equal}, {"isTranspose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_139isTranspose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_138isTranspose}, {"isSymmetric", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_141isSymmetric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_140isSymmetric}, {"isSymmetricKnown", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_143isSymmetricKnown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_142isSymmetricKnown}, {"isHermitian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_145isHermitian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_144isHermitian}, {"isHermitianKnown", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_147isHermitianKnown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_146isHermitianKnown}, {"isStructurallySymmetric", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_149isStructurallySymmetric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_148isStructurallySymmetric}, {"zeroEntries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_151zeroEntries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_150zeroEntries}, {"getValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_153getValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_152getValue}, {"getValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_155getValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_154getValues}, {"getValuesCSR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_157getValuesCSR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_156getValuesCSR}, {"getRow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_159getRow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_158getRow}, {"getRowIJ", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_161getRowIJ, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_160getRowIJ}, {"getColumnIJ", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_163getColumnIJ, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_162getColumnIJ}, {"setValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_165setValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_164setValue}, {"setValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_167setValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_166setValues}, {"setValuesRCV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_169setValuesRCV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_168setValuesRCV}, {"setValuesIJV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_171setValuesIJV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_170setValuesIJV}, {"setValuesCSR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_173setValuesCSR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_172setValuesCSR}, {"setValuesBlocked", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_175setValuesBlocked, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_174setValuesBlocked}, {"setValuesBlockedRCV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_177setValuesBlockedRCV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_176setValuesBlockedRCV}, {"setValuesBlockedIJV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_179setValuesBlockedIJV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_178setValuesBlockedIJV}, {"setValuesBlockedCSR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_181setValuesBlockedCSR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_180setValuesBlockedCSR}, {"setLGMap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_183setLGMap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_182setLGMap}, {"getLGMap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_185getLGMap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_184getLGMap}, {"setValueLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_187setValueLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_186setValueLocal}, {"setValuesLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_189setValuesLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_188setValuesLocal}, {"setValuesLocalRCV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_191setValuesLocalRCV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_190setValuesLocalRCV}, {"setValuesLocalIJV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_193setValuesLocalIJV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_192setValuesLocalIJV}, {"setValuesLocalCSR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_195setValuesLocalCSR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_194setValuesLocalCSR}, {"setValuesBlockedLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_197setValuesBlockedLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_196setValuesBlockedLocal}, {"setValuesBlockedLocalRCV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_199setValuesBlockedLocalRCV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_198setValuesBlockedLocalRCV}, {"setValuesBlockedLocalIJV", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_201setValuesBlockedLocalIJV, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_200setValuesBlockedLocalIJV}, {"setValuesBlockedLocalCSR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_203setValuesBlockedLocalCSR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_202setValuesBlockedLocalCSR}, {"setStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_205setStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_204setStencil}, {"setValueStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_207setValueStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_206setValueStencil}, {"setValueStagStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_209setValueStagStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_208setValueStagStencil}, {"setValueBlockedStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_211setValueBlockedStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_210setValueBlockedStencil}, {"setValueBlockedStagStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_213setValueBlockedStagStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_212setValueBlockedStagStencil}, {"zeroRows", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_215zeroRows, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_214zeroRows}, {"zeroRowsLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_217zeroRowsLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_216zeroRowsLocal}, {"zeroRowsColumns", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_219zeroRowsColumns, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_218zeroRowsColumns}, {"zeroRowsColumnsLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_221zeroRowsColumnsLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_220zeroRowsColumnsLocal}, {"storeValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_223storeValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_222storeValues}, {"retrieveValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_225retrieveValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_224retrieveValues}, {"assemblyBegin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_227assemblyBegin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_226assemblyBegin}, {"assemblyEnd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_229assemblyEnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_228assemblyEnd}, {"assemble", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_231assemble, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_230assemble}, {"isAssembled", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_233isAssembled, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_232isAssembled}, {"createVecs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_235createVecs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_234createVecs}, {"createVecRight", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_237createVecRight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_236createVecRight}, {"createVecLeft", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_239createVecLeft, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_238createVecLeft}, {"getColumnVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_241getColumnVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_240getColumnVector}, {"getRedundantMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_243getRedundantMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_242getRedundantMatrix}, {"getDiagonal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_245getDiagonal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_244getDiagonal}, {"getRowSum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_247getRowSum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_246getRowSum}, {"setDiagonal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_249setDiagonal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_248setDiagonal}, {"diagonalScale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_251diagonalScale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_250diagonalScale}, {"invertBlockDiagonal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_253invertBlockDiagonal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_252invertBlockDiagonal}, {"setNullSpace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_255setNullSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_254setNullSpace}, {"getNullSpace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_257getNullSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_256getNullSpace}, {"setTransposeNullSpace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_259setTransposeNullSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_258setTransposeNullSpace}, {"getTransposeNullSpace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_261getTransposeNullSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_260getTransposeNullSpace}, {"setNearNullSpace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_263setNearNullSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_262setNearNullSpace}, {"getNearNullSpace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_265getNearNullSpace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_264getNearNullSpace}, {"mult", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_267mult, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_266mult}, {"multAdd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_269multAdd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_268multAdd}, {"multTranspose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_271multTranspose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_270multTranspose}, {"multTransposeAdd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_273multTransposeAdd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_272multTransposeAdd}, {"multHermitian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_275multHermitian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_274multHermitian}, {"multHermitianAdd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_277multHermitianAdd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_276multHermitianAdd}, {"SOR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_279SOR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_278SOR}, {"getDiagonalBlock", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_281getDiagonalBlock, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_280getDiagonalBlock}, {"increaseOverlap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_283increaseOverlap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_282increaseOverlap}, {"createSubMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_285createSubMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_284createSubMatrix}, {"createSubMatrices", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_287createSubMatrices, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_286createSubMatrices}, {"getLocalSubMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_289getLocalSubMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_288getLocalSubMatrix}, {"restoreLocalSubMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_291restoreLocalSubMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_290restoreLocalSubMatrix}, {"norm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_293norm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_292norm}, {"scale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_295scale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_294scale}, {"shift", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_297shift, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_296shift}, {"chop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_299chop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_298chop}, {"axpy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_301axpy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_300axpy}, {"aypx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_303aypx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_302aypx}, {"matMult", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_305matMult, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_304matMult}, {"matTransposeMult", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_307matTransposeMult, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_306matTransposeMult}, {"transposeMatMult", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_309transposeMatMult, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_308transposeMatMult}, {"PtAP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_311PtAP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_310PtAP}, {"getOrdering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_313getOrdering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_312getOrdering}, {"reorderForNonzeroDiagonal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_315reorderForNonzeroDiagonal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_314reorderForNonzeroDiagonal}, {"factorLU", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_317factorLU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_316factorLU}, {"factorSymbolicLU", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_319factorSymbolicLU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_318factorSymbolicLU}, {"factorNumericLU", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_321factorNumericLU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_320factorNumericLU}, {"factorILU", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_323factorILU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_322factorILU}, {"factorSymbolicILU", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_325factorSymbolicILU, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_324factorSymbolicILU}, {"factorCholesky", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_327factorCholesky, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_326factorCholesky}, {"factorSymbolicCholesky", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_329factorSymbolicCholesky, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_328factorSymbolicCholesky}, {"factorNumericCholesky", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_331factorNumericCholesky, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_330factorNumericCholesky}, {"factorICC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_333factorICC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_332factorICC}, {"factorSymbolicICC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_335factorSymbolicICC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_334factorSymbolicICC}, {"getInertia", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_337getInertia, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_336getInertia}, {"setUnfactored", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_339setUnfactored, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_338setUnfactored}, {"fixISLocalEmpty", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_341fixISLocalEmpty, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_340fixISLocalEmpty}, {"getISLocalMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_343getISLocalMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_342getISLocalMat}, {"restoreISLocalMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_345restoreISLocalMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_344restoreISLocalMat}, {"setISLocalMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_347setISLocalMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_346setISLocalMat}, {"setISPreallocation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_349setISPreallocation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_348setISPreallocation}, {"getLRCMats", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_351getLRCMats, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_350getLRCMats}, {"setMumpsIcntl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_353setMumpsIcntl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_352setMumpsIcntl}, {"getMumpsIcntl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_355getMumpsIcntl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_354getMumpsIcntl}, {"setMumpsCntl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_357setMumpsCntl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_356setMumpsCntl}, {"getMumpsCntl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_359getMumpsCntl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_358getMumpsCntl}, {"getMumpsInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_361getMumpsInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_360getMumpsInfo}, {"getMumpsInfog", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_363getMumpsInfog, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_362getMumpsInfog}, {"getMumpsRinfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_365getMumpsRinfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_364getMumpsRinfo}, {"getMumpsRinfog", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_367getMumpsRinfog, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_366getMumpsRinfog}, {"solveForward", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_369solveForward, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_368solveForward}, {"solveBackward", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_371solveBackward, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_370solveBackward}, {"solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_373solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_372solve}, {"solveTranspose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_375solveTranspose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_374solveTranspose}, {"solveAdd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_377solveAdd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_376solveAdd}, {"solveTransposeAdd", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_379solveTransposeAdd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_378solveTransposeAdd}, {"matSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_381matSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_380matSolve}, {"getDenseArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_383getDenseArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_382getDenseArray}, {"getDenseLocalMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_385getDenseLocalMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_384getDenseLocalMatrix}, {"getNestSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_387getNestSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_386getNestSize}, {"getNestISs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_389getNestISs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_388getNestISs}, {"getNestLocalISs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_391getNestLocalISs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_390getNestLocalISs}, {"getNestSubMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_393getNestSubMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_392getNestSubMatrix}, {"getISLocalMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_395getISLocalMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_394getISLocalMat}, {"getDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_397getDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_396getDM}, {"setDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_399setDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_398setDM}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Mat[] = { {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_3Mat_sizes, __pyx_setprop_8petsc4py_5PETSc_3Mat_sizes, (char *)0, 0}, {(char *)"size", __pyx_getprop_8petsc4py_5PETSc_3Mat_size, 0, (char *)0, 0}, {(char *)"local_size", __pyx_getprop_8petsc4py_5PETSc_3Mat_local_size, 0, (char *)0, 0}, {(char *)"block_size", __pyx_getprop_8petsc4py_5PETSc_3Mat_block_size, 0, (char *)0, 0}, {(char *)"block_sizes", __pyx_getprop_8petsc4py_5PETSc_3Mat_block_sizes, 0, (char *)0, 0}, {(char *)"owner_range", __pyx_getprop_8petsc4py_5PETSc_3Mat_owner_range, 0, (char *)0, 0}, {(char *)"owner_ranges", __pyx_getprop_8petsc4py_5PETSc_3Mat_owner_ranges, 0, (char *)0, 0}, {(char *)"assembled", __pyx_getprop_8petsc4py_5PETSc_3Mat_assembled, 0, (char *)0, 0}, {(char *)"symmetric", __pyx_getprop_8petsc4py_5PETSc_3Mat_symmetric, 0, (char *)0, 0}, {(char *)"hermitian", __pyx_getprop_8petsc4py_5PETSc_3Mat_hermitian, 0, (char *)0, 0}, {(char *)"structsymm", __pyx_getprop_8petsc4py_5PETSc_3Mat_structsymm, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Mat = { __pyx_pw_8petsc4py_5PETSc_3Mat_17__add__, /*nb_add*/ __pyx_pw_8petsc4py_5PETSc_3Mat_19__sub__, /*nb_subtract*/ __pyx_pw_8petsc4py_5PETSc_3Mat_21__mul__, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_8petsc4py_5PETSc_3Mat_23__div__, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ __pyx_pw_8petsc4py_5PETSc_3Mat_5__neg__, /*nb_negative*/ __pyx_pw_8petsc4py_5PETSc_3Mat_3__pos__, /*nb_positive*/ 0, /*nb_absolute*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_8petsc4py_5PETSc_6Object_7__nonzero__, /*nb_nonzero*/ #else 0, /*nb_nonzero*/ #endif 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif __pyx_pw_8petsc4py_5PETSc_3Mat_7__iadd__, /*nb_inplace_add*/ __pyx_pw_8petsc4py_5PETSc_3Mat_9__isub__, /*nb_inplace_subtract*/ __pyx_pw_8petsc4py_5PETSc_3Mat_11__imul__, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) __pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ __pyx_pw_8petsc4py_5PETSc_3Mat_25__truediv__, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ __pyx_pw_8petsc4py_5PETSc_3Mat_15__itruediv__, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Mat = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc_Mat, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Mat = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_3Mat_27__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc_Mat, /*mp_ass_subscript*/ }; DL_EXPORT(PyTypeObject) PyPetscMat_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Mat", /*tp_name*/ sizeof(struct PyPetscMatObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Mat, /*tp_as_number*/ &__pyx_tp_as_sequence_Mat, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Mat, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_3Mat_31__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Mat, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Mat, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Mat, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_NullSpace __pyx_vtable_8petsc4py_5PETSc_NullSpace; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_NullSpace(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscNullSpaceObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscNullSpaceObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_NullSpace; if (unlikely(__pyx_pw_8petsc4py_5PETSc_9NullSpace_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_NullSpace[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_8create}, {"createRigidBody", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_10createRigidBody}, {"setFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_12setFunction}, {"hasConstant", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_14hasConstant}, {"getVecs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_16getVecs}, {"getFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_18getFunction}, {"remove", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_20remove}, {"test", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_22test}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscNullSpace_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.NullSpace", /*tp_name*/ sizeof(struct PyPetscNullSpaceObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_9NullSpace_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_NullSpace, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_NullSpace, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_PC __pyx_vtable_8petsc4py_5PETSc_PC; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_PC(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscPCObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscPCObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_PC; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2PC_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_PC[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_8create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_11setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_10setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_13getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_12getType}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_14setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_16getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_19setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_18setFromOptions}, {"setOperators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_21setOperators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_20setOperators}, {"getOperators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_23getOperators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_22getOperators}, {"setUseAmat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_25setUseAmat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_24setUseAmat}, {"setReusePreconditioner", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_27setReusePreconditioner, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_26setReusePreconditioner}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_29setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_28setUp}, {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_31reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_30reset}, {"setUpOnBlocks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_33setUpOnBlocks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_32setUpOnBlocks}, {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_35apply, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_34apply}, {"applyTranspose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_37applyTranspose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_36applyTranspose}, {"applySymmetricLeft", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_39applySymmetricLeft, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_38applySymmetricLeft}, {"applySymmetricRight", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_41applySymmetricRight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_40applySymmetricRight}, {"getDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_43getDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_42getDM}, {"setDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_45setDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_44setDM}, {"setCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_47setCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_46setCoordinates}, {"createPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_49createPython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_48createPython}, {"setPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_51setPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_50setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_53getPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_52getPythonContext}, {"setPythonType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_55setPythonType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_54setPythonType}, {"setASMType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_57setASMType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_56setASMType}, {"setASMOverlap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_59setASMOverlap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_58setASMOverlap}, {"setASMLocalSubdomains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_61setASMLocalSubdomains, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_60setASMLocalSubdomains}, {"setASMTotalSubdomains", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_63setASMTotalSubdomains, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_62setASMTotalSubdomains}, {"getASMSubKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_65getASMSubKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_64getASMSubKSP}, {"setGASMType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_67setGASMType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_66setGASMType}, {"setGASMOverlap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_69setGASMOverlap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_68setGASMOverlap}, {"setGAMGType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_71setGAMGType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_70setGAMGType}, {"setGAMGLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_73setGAMGLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_72setGAMGLevels}, {"setGAMGSmooths", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_75setGAMGSmooths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_74setGAMGSmooths}, {"getHYPREType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_77getHYPREType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_76getHYPREType}, {"setHYPREType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_79setHYPREType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_78setHYPREType}, {"setHYPREDiscreteCurl", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_81setHYPREDiscreteCurl, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_80setHYPREDiscreteCurl}, {"setHYPREDiscreteGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_83setHYPREDiscreteGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_82setHYPREDiscreteGradient}, {"setHYPRESetAlphaPoissonMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_85setHYPRESetAlphaPoissonMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_84setHYPRESetAlphaPoissonMatrix}, {"setHYPRESetBetaPoissonMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_87setHYPRESetBetaPoissonMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_86setHYPRESetBetaPoissonMatrix}, {"setHYPRESetEdgeConstantVectors", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_89setHYPRESetEdgeConstantVectors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_88setHYPRESetEdgeConstantVectors}, {"setFactorSolverType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_91setFactorSolverType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_90setFactorSolverType}, {"getFactorSolverType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_93getFactorSolverType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_92getFactorSolverType}, {"setFactorSetUpSolverType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_95setFactorSetUpSolverType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_94setFactorSetUpSolverType}, {"setFactorOrdering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_97setFactorOrdering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_96setFactorOrdering}, {"setFactorPivot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_99setFactorPivot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_98setFactorPivot}, {"setFactorShift", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_101setFactorShift, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_100setFactorShift}, {"setFactorLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_103setFactorLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_102setFactorLevels}, {"getFactorMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_105getFactorMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_104getFactorMatrix}, {"setFieldSplitType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_107setFieldSplitType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_106setFieldSplitType}, {"setFieldSplitIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_109setFieldSplitIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_108setFieldSplitIS}, {"setFieldSplitFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_111setFieldSplitFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_110setFieldSplitFields}, {"getFieldSplitSubKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_113getFieldSplitSubKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_112getFieldSplitSubKSP}, {"getFieldSplitSchurGetSubKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_115getFieldSplitSchurGetSubKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_114getFieldSplitSchurGetSubKSP}, {"setFieldSplitSchurFactType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_117setFieldSplitSchurFactType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_116setFieldSplitSchurFactType}, {"setFieldSplitSchurPreType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_119setFieldSplitSchurPreType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_118setFieldSplitSchurPreType}, {"setCompositeType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_121setCompositeType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_120setCompositeType}, {"getCompositePC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_123getCompositePC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_122getCompositePC}, {"addCompositePCType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_125addCompositePCType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_124addCompositePCType}, {"getKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_127getKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_126getKSP}, {"getMGType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_129getMGType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_128getMGType}, {"setMGType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_131setMGType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_130setMGType}, {"getMGLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_133getMGLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_132getMGLevels}, {"setMGLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_135setMGLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_134setMGLevels}, {"getMGCoarseSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_137getMGCoarseSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_136getMGCoarseSolve}, {"setMGInterpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_139setMGInterpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_138setMGInterpolation}, {"getMGInterpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_141getMGInterpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_140getMGInterpolation}, {"setMGRestriction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_143setMGRestriction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_142setMGRestriction}, {"getMGRestriction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_145getMGRestriction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_144getMGRestriction}, {"setMGRScale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_147setMGRScale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_146setMGRScale}, {"getMGRScale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_149getMGRScale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_148getMGRScale}, {"getMGSmoother", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_151getMGSmoother, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_150getMGSmoother}, {"getMGSmootherDown", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_153getMGSmootherDown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_152getMGSmootherDown}, {"getMGSmootherUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_155getMGSmootherUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_154getMGSmootherUp}, {"setMGCycleType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_157setMGCycleType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_156setMGCycleType}, {"setMGCycleTypeOnLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_159setMGCycleTypeOnLevel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_158setMGCycleTypeOnLevel}, {"setMGRhs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_161setMGRhs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_160setMGRhs}, {"setMGX", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_163setMGX, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_162setMGX}, {"setMGR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_165setMGR, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_164setMGR}, {"setBDDCDivergenceMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_167setBDDCDivergenceMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_166setBDDCDivergenceMat}, {"setBDDCDiscreteGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_169setBDDCDiscreteGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_168setBDDCDiscreteGradient}, {"setBDDCChangeOfBasisMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_171setBDDCChangeOfBasisMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_170setBDDCChangeOfBasisMat}, {"setBDDCPrimalVerticesIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_173setBDDCPrimalVerticesIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_172setBDDCPrimalVerticesIS}, {"setBDDCPrimalVerticesLocalIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_175setBDDCPrimalVerticesLocalIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_174setBDDCPrimalVerticesLocalIS}, {"setBDDCCoarseningRatio", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_177setBDDCCoarseningRatio, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_176setBDDCCoarseningRatio}, {"setBDDCLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_179setBDDCLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_178setBDDCLevels}, {"setBDDCDirichletBoundaries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_181setBDDCDirichletBoundaries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_180setBDDCDirichletBoundaries}, {"setBDDCDirichletBoundariesLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_183setBDDCDirichletBoundariesLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_182setBDDCDirichletBoundariesLocal}, {"setBDDCNeumannBoundaries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_185setBDDCNeumannBoundaries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_184setBDDCNeumannBoundaries}, {"setBDDCNeumannBoundariesLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_187setBDDCNeumannBoundariesLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_186setBDDCNeumannBoundariesLocal}, {"setBDDCDofsSplitting", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_189setBDDCDofsSplitting, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_188setBDDCDofsSplitting}, {"setBDDCDofsSplittingLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCDofsSplittingLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_190setBDDCDofsSplittingLocal}, {"setPatchCellNumbering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_193setPatchCellNumbering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_192setPatchCellNumbering}, {"setPatchDiscretisationInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_195setPatchDiscretisationInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_194setPatchDiscretisationInfo}, {"setPatchComputeOperator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_197setPatchComputeOperator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_196setPatchComputeOperator}, {"setPatchComputeOperatorInteriorFacets", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_199setPatchComputeOperatorInteriorFacets, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_198setPatchComputeOperatorInteriorFacets}, {"setPatchComputeFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_201setPatchComputeFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_200setPatchComputeFunction}, {"setPatchComputeFunctionInteriorFacets", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_203setPatchComputeFunctionInteriorFacets, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_202setPatchComputeFunctionInteriorFacets}, {"setPatchConstructType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_205setPatchConstructType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_204setPatchConstructType}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscPC_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.PC", /*tp_name*/ sizeof(struct PyPetscPCObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_2PC_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_PC, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_PC, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_KSP __pyx_vtable_8petsc4py_5PETSc_KSP; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_KSP(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscKSPObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscKSPObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_KSP; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3KSP_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_dm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_dm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_2dm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_vec_sol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7vec_sol_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_vec_rhs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7vec_rhs_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_mat_op(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6mat_op_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_mat_pc(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6mat_pc_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_guess_nonzero(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_nonzero(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_13guess_nonzero_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_guess_knoll(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_knoll(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_11guess_knoll_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_pc(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_2pc_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_pc_side(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_pc_side(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7pc_side_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_norm_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_norm_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_9norm_type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_rtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_rtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4rtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_atol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_atol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4atol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_divtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_divtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6divtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_max_it(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_max_it(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6max_it_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_its(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_3its_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_its(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_3its_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_norm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_norm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_4norm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_history(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_7history_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3KSP_reason(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3KSP_6reason_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_9iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_9converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3KSP_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3KSP_8diverged_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_KSP[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_5view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_4view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_8create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_11setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_10setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_13getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_12getType}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_14setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_16getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_19setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_18setFromOptions}, {"setAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_21setAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_20setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_23getAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_22getAppCtx}, {"getDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_25getDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_24getDM}, {"setDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_27setDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_26setDM}, {"setDMActive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_29setDMActive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_28setDMActive}, {"setComputeRHS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_31setComputeRHS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_30setComputeRHS}, {"setComputeOperators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeOperators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_32setComputeOperators}, {"setOperators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_35setOperators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_34setOperators}, {"getOperators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_37getOperators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_36getOperators}, {"setPC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_39setPC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_38setPC}, {"getPC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_41getPC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_40getPC}, {"setTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_43setTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_42setTolerances}, {"getTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_45getTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_44getTolerances}, {"setConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_47setConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_46setConvergenceTest}, {"getConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_49getConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_48getConvergenceTest}, {"callConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_51callConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_50callConvergenceTest}, {"setConvergenceHistory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_53setConvergenceHistory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_52setConvergenceHistory}, {"getConvergenceHistory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_55getConvergenceHistory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_54getConvergenceHistory}, {"logConvergenceHistory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_57logConvergenceHistory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_56logConvergenceHistory}, {"setMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_59setMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_58setMonitor}, {"getMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_61getMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_60getMonitor}, {"cancelMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_63cancelMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_62cancelMonitor}, {"monitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_65monitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_64monitor}, {"setPCSide", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_67setPCSide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_66setPCSide}, {"getPCSide", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_69getPCSide, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_68getPCSide}, {"setNormType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_71setNormType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_70setNormType}, {"getNormType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_73getNormType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_72getNormType}, {"setComputeEigenvalues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_75setComputeEigenvalues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_74setComputeEigenvalues}, {"getComputeEigenvalues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_77getComputeEigenvalues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_76getComputeEigenvalues}, {"setComputeSingularValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_79setComputeSingularValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_78setComputeSingularValues}, {"getComputeSingularValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_81getComputeSingularValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_80getComputeSingularValues}, {"setInitialGuessNonzero", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_83setInitialGuessNonzero, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_82setInitialGuessNonzero}, {"getInitialGuessNonzero", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_85getInitialGuessNonzero, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_84getInitialGuessNonzero}, {"setInitialGuessKnoll", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_87setInitialGuessKnoll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_86setInitialGuessKnoll}, {"getInitialGuessKnoll", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_89getInitialGuessKnoll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_88getInitialGuessKnoll}, {"setUseFischerGuess", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_91setUseFischerGuess, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_90setUseFischerGuess}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_93setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_92setUp}, {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_95reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_94reset}, {"setUpOnBlocks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_97setUpOnBlocks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_96setUpOnBlocks}, {"solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_99solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_98solve}, {"solveTranspose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_101solveTranspose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_100solveTranspose}, {"setIterationNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_103setIterationNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_102setIterationNumber}, {"getIterationNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_105getIterationNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_104getIterationNumber}, {"setResidualNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_107setResidualNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_106setResidualNorm}, {"getResidualNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_109getResidualNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_108getResidualNorm}, {"setConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_111setConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_110setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_113getConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_112getConvergedReason}, {"getRhs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_115getRhs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_114getRhs}, {"getSolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_117getSolution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_116getSolution}, {"getWorkVecs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_119getWorkVecs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_118getWorkVecs}, {"buildSolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_121buildSolution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_120buildSolution}, {"buildResidual", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_123buildResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_122buildResidual}, {"computeEigenvalues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_125computeEigenvalues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_124computeEigenvalues}, {"computeExtremeSingularValues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_127computeExtremeSingularValues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_126computeExtremeSingularValues}, {"setGMRESRestart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_129setGMRESRestart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_128setGMRESRestart}, {"createPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_131createPython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_130createPython}, {"setPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_133setPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_132setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_135getPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_134getPythonContext}, {"setPythonType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_137setPythonType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_136setPythonType}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_KSP[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_3KSP_appctx, __pyx_setprop_8petsc4py_5PETSc_3KSP_appctx, (char *)0, 0}, {(char *)"dm", __pyx_getprop_8petsc4py_5PETSc_3KSP_dm, __pyx_setprop_8petsc4py_5PETSc_3KSP_dm, (char *)0, 0}, {(char *)"vec_sol", __pyx_getprop_8petsc4py_5PETSc_3KSP_vec_sol, 0, (char *)0, 0}, {(char *)"vec_rhs", __pyx_getprop_8petsc4py_5PETSc_3KSP_vec_rhs, 0, (char *)0, 0}, {(char *)"mat_op", __pyx_getprop_8petsc4py_5PETSc_3KSP_mat_op, 0, (char *)0, 0}, {(char *)"mat_pc", __pyx_getprop_8petsc4py_5PETSc_3KSP_mat_pc, 0, (char *)0, 0}, {(char *)"guess_nonzero", __pyx_getprop_8petsc4py_5PETSc_3KSP_guess_nonzero, __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_nonzero, (char *)0, 0}, {(char *)"guess_knoll", __pyx_getprop_8petsc4py_5PETSc_3KSP_guess_knoll, __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_knoll, (char *)0, 0}, {(char *)"pc", __pyx_getprop_8petsc4py_5PETSc_3KSP_pc, 0, (char *)0, 0}, {(char *)"pc_side", __pyx_getprop_8petsc4py_5PETSc_3KSP_pc_side, __pyx_setprop_8petsc4py_5PETSc_3KSP_pc_side, (char *)0, 0}, {(char *)"norm_type", __pyx_getprop_8petsc4py_5PETSc_3KSP_norm_type, __pyx_setprop_8petsc4py_5PETSc_3KSP_norm_type, (char *)0, 0}, {(char *)"rtol", __pyx_getprop_8petsc4py_5PETSc_3KSP_rtol, __pyx_setprop_8petsc4py_5PETSc_3KSP_rtol, (char *)0, 0}, {(char *)"atol", __pyx_getprop_8petsc4py_5PETSc_3KSP_atol, __pyx_setprop_8petsc4py_5PETSc_3KSP_atol, (char *)0, 0}, {(char *)"divtol", __pyx_getprop_8petsc4py_5PETSc_3KSP_divtol, __pyx_setprop_8petsc4py_5PETSc_3KSP_divtol, (char *)0, 0}, {(char *)"max_it", __pyx_getprop_8petsc4py_5PETSc_3KSP_max_it, __pyx_setprop_8petsc4py_5PETSc_3KSP_max_it, (char *)0, 0}, {(char *)"its", __pyx_getprop_8petsc4py_5PETSc_3KSP_its, __pyx_setprop_8petsc4py_5PETSc_3KSP_its, (char *)0, 0}, {(char *)"norm", __pyx_getprop_8petsc4py_5PETSc_3KSP_norm, __pyx_setprop_8petsc4py_5PETSc_3KSP_norm, (char *)0, 0}, {(char *)"history", __pyx_getprop_8petsc4py_5PETSc_3KSP_history, 0, (char *)0, 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_3KSP_reason, __pyx_setprop_8petsc4py_5PETSc_3KSP_reason, (char *)0, 0}, {(char *)"iterating", __pyx_getprop_8petsc4py_5PETSc_3KSP_iterating, 0, (char *)0, 0}, {(char *)"converged", __pyx_getprop_8petsc4py_5PETSc_3KSP_converged, 0, (char *)0, 0}, {(char *)"diverged", __pyx_getprop_8petsc4py_5PETSc_3KSP_diverged, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscKSP_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.KSP", /*tp_name*/ sizeof(struct PyPetscKSPObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_8petsc4py_5PETSc_3KSP_3__call__, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_KSP, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_KSP, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_KSP, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_SNES __pyx_vtable_8petsc4py_5PETSc_SNES; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SNES(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscSNESObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscSNESObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_SNES; if (unlikely(__pyx_pw_8petsc4py_5PETSc_4SNES_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_dm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_dm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_2dm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_npc(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_npc(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3npc_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_vec_sol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7vec_sol_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_vec_upd(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7vec_upd_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_vec_rhs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7vec_rhs_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_ksp(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_ksp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3ksp_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_use_ew(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_use_ew(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_ew_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_rtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_rtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4rtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_atol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_atol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4atol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_stol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_stol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4stol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_max_it(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_max_it(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6max_it_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_max_funcs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_max_funcs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_9max_funcs_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_its(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3its_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_its(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_3its_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_norm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_norm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_4norm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_history(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_7history_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_reason(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6reason_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_9iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_9converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_8diverged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_use_mf(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_use_mf(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_mf_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_use_fd(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_4SNES_use_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_4SNES_6use_fd_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_SNES[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_3view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_2view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_4destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_7create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_6create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_9setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_8setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_11getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_10getType}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_12setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_14getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_17setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_16setFromOptions}, {"setAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_19setAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_18setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_21getAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_20getAppCtx}, {"getDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_23getDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_22getDM}, {"setDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_25setDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_24setDM}, {"setFASInterpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_27setFASInterpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_26setFASInterpolation}, {"getFASInterpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_29getFASInterpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_28getFASInterpolation}, {"setFASRestriction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_31setFASRestriction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_30setFASRestriction}, {"getFASRestriction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_33getFASRestriction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_32getFASRestriction}, {"setFASInjection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_35setFASInjection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_34setFASInjection}, {"getFASInjection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_37getFASInjection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_36getFASInjection}, {"setFASRScale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_39setFASRScale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_38setFASRScale}, {"setFASLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_40setFASLevels}, {"getFASLevels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_43getFASLevels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_42getFASLevels}, {"getFASCycleSNES", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_45getFASCycleSNES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_44getFASCycleSNES}, {"getFASCoarseSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASCoarseSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_46getFASCoarseSolve}, {"getFASSmoother", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_49getFASSmoother, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_48getFASSmoother}, {"getFASSmootherDown", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_51getFASSmootherDown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_50getFASSmootherDown}, {"getFASSmootherUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASSmootherUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_52getFASSmootherUp}, {"getNPC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_55getNPC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_54getNPC}, {"hasNPC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_57hasNPC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_56hasNPC}, {"setNPC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_59setNPC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_58setNPC}, {"setLineSearchPreCheck", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_61setLineSearchPreCheck, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_60setLineSearchPreCheck}, {"setInitialGuess", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_63setInitialGuess, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_62setInitialGuess}, {"getInitialGuess", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_65getInitialGuess, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_64getInitialGuess}, {"setFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_67setFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_66setFunction}, {"getFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_69getFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_68getFunction}, {"setUpdate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_71setUpdate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_70setUpdate}, {"getUpdate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_73getUpdate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_72getUpdate}, {"setJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_75setJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_74setJacobian}, {"getJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_77getJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_76getJacobian}, {"setObjective", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_79setObjective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_78setObjective}, {"getObjective", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_81getObjective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_80getObjective}, {"computeFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_83computeFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_82computeFunction}, {"computeJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_85computeJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_84computeJacobian}, {"computeObjective", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_87computeObjective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_86computeObjective}, {"setNGS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_89setNGS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_88setNGS}, {"getNGS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_91getNGS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_90getNGS}, {"computeNGS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_93computeNGS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_92computeNGS}, {"setTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_95setTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_94setTolerances}, {"getTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_97getTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_96getTolerances}, {"setNormSchedule", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_99setNormSchedule, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_98setNormSchedule}, {"getNormSchedule", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_101getNormSchedule, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_100getNormSchedule}, {"setConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_103setConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_102setConvergenceTest}, {"getConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_105getConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_104getConvergenceTest}, {"callConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_107callConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_106callConvergenceTest}, {"setConvergenceHistory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_109setConvergenceHistory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_108setConvergenceHistory}, {"getConvergenceHistory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_111getConvergenceHistory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_110getConvergenceHistory}, {"logConvergenceHistory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_113logConvergenceHistory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_112logConvergenceHistory}, {"setResetCounters", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_115setResetCounters, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_114setResetCounters}, {"setMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_117setMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_116setMonitor}, {"getMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_119getMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_118getMonitor}, {"cancelMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_121cancelMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_120cancelMonitor}, {"monitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_123monitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_122monitor}, {"setMaxFunctionEvaluations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_125setMaxFunctionEvaluations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_124setMaxFunctionEvaluations}, {"getMaxFunctionEvaluations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_127getMaxFunctionEvaluations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_126getMaxFunctionEvaluations}, {"getFunctionEvaluations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_129getFunctionEvaluations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_128getFunctionEvaluations}, {"setMaxStepFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_131setMaxStepFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_130setMaxStepFailures}, {"getMaxStepFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_133getMaxStepFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_132getMaxStepFailures}, {"getStepFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_135getStepFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_134getStepFailures}, {"setMaxKSPFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_137setMaxKSPFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_136setMaxKSPFailures}, {"getMaxKSPFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_139getMaxKSPFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_138getMaxKSPFailures}, {"getKSPFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_141getKSPFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_140getKSPFailures}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_143setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_142setUp}, {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_145reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_144reset}, {"solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_147solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_146solve}, {"setConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_149setConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_148setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_151getConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_150getConvergedReason}, {"setIterationNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_153setIterationNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_152setIterationNumber}, {"getIterationNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_155getIterationNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_154getIterationNumber}, {"setFunctionNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_157setFunctionNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_156setFunctionNorm}, {"getFunctionNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_159getFunctionNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_158getFunctionNorm}, {"getLinearSolveIterations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_161getLinearSolveIterations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_160getLinearSolveIterations}, {"getRhs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_163getRhs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_162getRhs}, {"getSolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_165getSolution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_164getSolution}, {"setSolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_167setSolution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_166setSolution}, {"getSolutionUpdate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_169getSolutionUpdate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_168getSolutionUpdate}, {"setKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_171setKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_170setKSP}, {"getKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_173getKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_172getKSP}, {"setUseEW", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_175setUseEW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_174setUseEW}, {"getUseEW", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_177getUseEW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_176getUseEW}, {"setParamsEW", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_179setParamsEW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_178setParamsEW}, {"getParamsEW", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_181getParamsEW, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_180getParamsEW}, {"setUseMF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_183setUseMF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_182setUseMF}, {"getUseMF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_185getUseMF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_184getUseMF}, {"setUseFD", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_187setUseFD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_186setUseFD}, {"getUseFD", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_189getUseFD, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_188getUseFD}, {"setVariableBounds", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_191setVariableBounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_190setVariableBounds}, {"getVIInactiveSet", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_193getVIInactiveSet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_192getVIInactiveSet}, {"createPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_195createPython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_194createPython}, {"setPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_197setPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_196setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_199getPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_198getPythonContext}, {"setPythonType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_201setPythonType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_200setPythonType}, {"getCompositeSNES", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_203getCompositeSNES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_202getCompositeSNES}, {"getCompositeNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_205getCompositeNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_204getCompositeNumber}, {"getNASMSNES", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_207getNASMSNES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_206getNASMSNES}, {"getNASMNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_209getNASMNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_208getNASMNumber}, {"setPatchCellNumbering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_211setPatchCellNumbering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_210setPatchCellNumbering}, {"setPatchDiscretisationInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_213setPatchDiscretisationInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_212setPatchDiscretisationInfo}, {"setPatchComputeOperator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_215setPatchComputeOperator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_214setPatchComputeOperator}, {"setPatchComputeFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_217setPatchComputeFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_216setPatchComputeFunction}, {"setPatchConstructType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_219setPatchConstructType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_218setPatchConstructType}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_SNES[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_4SNES_appctx, __pyx_setprop_8petsc4py_5PETSc_4SNES_appctx, (char *)0, 0}, {(char *)"dm", __pyx_getprop_8petsc4py_5PETSc_4SNES_dm, __pyx_setprop_8petsc4py_5PETSc_4SNES_dm, (char *)0, 0}, {(char *)"npc", __pyx_getprop_8petsc4py_5PETSc_4SNES_npc, __pyx_setprop_8petsc4py_5PETSc_4SNES_npc, (char *)0, 0}, {(char *)"vec_sol", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_sol, 0, (char *)0, 0}, {(char *)"vec_upd", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_upd, 0, (char *)0, 0}, {(char *)"vec_rhs", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_rhs, 0, (char *)0, 0}, {(char *)"ksp", __pyx_getprop_8petsc4py_5PETSc_4SNES_ksp, __pyx_setprop_8petsc4py_5PETSc_4SNES_ksp, (char *)0, 0}, {(char *)"use_ew", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_ew, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_ew, (char *)0, 0}, {(char *)"rtol", __pyx_getprop_8petsc4py_5PETSc_4SNES_rtol, __pyx_setprop_8petsc4py_5PETSc_4SNES_rtol, (char *)0, 0}, {(char *)"atol", __pyx_getprop_8petsc4py_5PETSc_4SNES_atol, __pyx_setprop_8petsc4py_5PETSc_4SNES_atol, (char *)0, 0}, {(char *)"stol", __pyx_getprop_8petsc4py_5PETSc_4SNES_stol, __pyx_setprop_8petsc4py_5PETSc_4SNES_stol, (char *)0, 0}, {(char *)"max_it", __pyx_getprop_8petsc4py_5PETSc_4SNES_max_it, __pyx_setprop_8petsc4py_5PETSc_4SNES_max_it, (char *)0, 0}, {(char *)"max_funcs", __pyx_getprop_8petsc4py_5PETSc_4SNES_max_funcs, __pyx_setprop_8petsc4py_5PETSc_4SNES_max_funcs, (char *)0, 0}, {(char *)"its", __pyx_getprop_8petsc4py_5PETSc_4SNES_its, __pyx_setprop_8petsc4py_5PETSc_4SNES_its, (char *)0, 0}, {(char *)"norm", __pyx_getprop_8petsc4py_5PETSc_4SNES_norm, __pyx_setprop_8petsc4py_5PETSc_4SNES_norm, (char *)0, 0}, {(char *)"history", __pyx_getprop_8petsc4py_5PETSc_4SNES_history, 0, (char *)0, 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_4SNES_reason, __pyx_setprop_8petsc4py_5PETSc_4SNES_reason, (char *)0, 0}, {(char *)"iterating", __pyx_getprop_8petsc4py_5PETSc_4SNES_iterating, 0, (char *)0, 0}, {(char *)"converged", __pyx_getprop_8petsc4py_5PETSc_4SNES_converged, 0, (char *)0, 0}, {(char *)"diverged", __pyx_getprop_8petsc4py_5PETSc_4SNES_diverged, 0, (char *)0, 0}, {(char *)"use_mf", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_mf, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_mf, (char *)0, 0}, {(char *)"use_fd", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_fd, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_fd, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscSNES_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.SNES", /*tp_name*/ sizeof(struct PyPetscSNESObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_SNES, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_SNES, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_SNES, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TS __pyx_vtable_8petsc4py_5PETSc_TS; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TS(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscTSObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscTSObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_TS; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2TS_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_dm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_2dm_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_dm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_2dm_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_problem_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_problem_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_12problem_type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_equation_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_equation_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_13equation_type_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_snes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4snes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_ksp(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_3ksp_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_vec_sol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_7vec_sol_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_time(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4time_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_time(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_4time_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_time_step(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_time_step(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_9time_step_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_step_number(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_step_number(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_11step_number_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_max_time(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_max_time(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_8max_time_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_max_steps(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_max_steps(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_9max_steps_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_rtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_rtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_4rtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_atol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_4atol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_atol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_4atol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_6reason_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2TS_reason(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2TS_6reason_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_9converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2TS_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2TS_8diverged_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_TS[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_3view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_2view}, {"load", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_5load, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_4load}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_8create}, {"clone", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_11clone, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_10clone}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_13setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_12setType}, {"setRKType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_14setRKType}, {"setARKIMEXType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_16setARKIMEXType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_19getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_18getType}, {"getRKType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_21getRKType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_20getRKType}, {"getARKIMEXType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_23getARKIMEXType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_22getARKIMEXType}, {"setProblemType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_25setProblemType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_24setProblemType}, {"getProblemType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_27getProblemType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_26getProblemType}, {"setEquationType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_29setEquationType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_28setEquationType}, {"getEquationType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_31getEquationType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_30getEquationType}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_33setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_32setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_35getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_34getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_37setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_36setFromOptions}, {"setAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_39setAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_38setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_41getAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_40getAppCtx}, {"setRHSFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_43setRHSFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_42setRHSFunction}, {"setRHSJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_45setRHSJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_44setRHSJacobian}, {"computeRHSFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_47computeRHSFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_46computeRHSFunction}, {"computeRHSFunctionLinear", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_49computeRHSFunctionLinear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_48computeRHSFunctionLinear}, {"computeRHSJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_51computeRHSJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_50computeRHSJacobian}, {"computeRHSJacobianConstant", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_53computeRHSJacobianConstant, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_52computeRHSJacobianConstant}, {"getRHSFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_55getRHSFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_54getRHSFunction}, {"getRHSJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_57getRHSJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_56getRHSJacobian}, {"setIFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_59setIFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_58setIFunction}, {"setIJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_61setIJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_60setIJacobian}, {"setIJacobianP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_63setIJacobianP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_62setIJacobianP}, {"computeIFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_65computeIFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_64computeIFunction}, {"computeIJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_67computeIJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_66computeIJacobian}, {"computeIJacobianP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_69computeIJacobianP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_68computeIJacobianP}, {"getIFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_71getIFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_70getIFunction}, {"getIJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_73getIJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_72getIJacobian}, {"setI2Function", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_75setI2Function, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_74setI2Function}, {"setI2Jacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_77setI2Jacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_76setI2Jacobian}, {"computeI2Function", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_79computeI2Function, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_78computeI2Function}, {"computeI2Jacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_81computeI2Jacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_80computeI2Jacobian}, {"getI2Function", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_83getI2Function, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_82getI2Function}, {"getI2Jacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_85getI2Jacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_84getI2Jacobian}, {"setSolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_87setSolution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_86setSolution}, {"getSolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_89getSolution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_88getSolution}, {"setSolution2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_91setSolution2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_90setSolution2}, {"getSolution2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_93getSolution2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_92getSolution2}, {"getSNES", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_95getSNES, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_94getSNES}, {"getKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_97getKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_96getKSP}, {"getDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_99getDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_98getDM}, {"setDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_101setDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_100setDM}, {"setTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_103setTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_102setTime}, {"getTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_105getTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_104getTime}, {"getPrevTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_107getPrevTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_106getPrevTime}, {"getSolveTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_109getSolveTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_108getSolveTime}, {"setTimeStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_111setTimeStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_110setTimeStep}, {"getTimeStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_113getTimeStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_112getTimeStep}, {"setStepNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_115setStepNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_114setStepNumber}, {"getStepNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_117getStepNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_116getStepNumber}, {"setMaxTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_119setMaxTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_118setMaxTime}, {"getMaxTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_121getMaxTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_120getMaxTime}, {"setMaxSteps", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_123setMaxSteps, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_122setMaxSteps}, {"getMaxSteps", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_125getMaxSteps, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_124getMaxSteps}, {"getSNESIterations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_127getSNESIterations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_126getSNESIterations}, {"getKSPIterations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_129getKSPIterations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_128getKSPIterations}, {"setMaxStepRejections", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_131setMaxStepRejections, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_130setMaxStepRejections}, {"getStepRejections", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_133getStepRejections, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_132getStepRejections}, {"setMaxSNESFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_135setMaxSNESFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_134setMaxSNESFailures}, {"getSNESFailures", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_137getSNESFailures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_136getSNESFailures}, {"setErrorIfStepFails", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_139setErrorIfStepFails, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_138setErrorIfStepFails}, {"setTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_141setTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_140setTolerances}, {"getTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_143getTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_142getTolerances}, {"setExactFinalTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_145setExactFinalTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_144setExactFinalTime}, {"setConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_147setConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_146setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_149getConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_148getConvergedReason}, {"setMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_151setMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_150setMonitor}, {"getMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_153getMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_152getMonitor}, {"cancelMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_155cancelMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_154cancelMonitor}, {"monitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_157monitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_156monitor}, {"setEventHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_159setEventHandler, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_158setEventHandler}, {"setEventTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_161setEventTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_160setEventTolerances}, {"getNumEvents", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_163getNumEvents, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_162getNumEvents}, {"setPreStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_165setPreStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_164setPreStep}, {"getPreStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_167getPreStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_166getPreStep}, {"setPostStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_169setPostStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_168setPostStep}, {"getPostStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_171getPostStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_170getPostStep}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_173setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_172setUp}, {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_175reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_174reset}, {"step", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_177step, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_176step}, {"restartStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_179restartStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_178restartStep}, {"rollBack", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_181rollBack, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_180rollBack}, {"solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_183solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_182solve}, {"interpolate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_185interpolate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_184interpolate}, {"setSaveTrajectory", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_187setSaveTrajectory, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_186setSaveTrajectory}, {"getCostIntegral", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_189getCostIntegral, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_188getCostIntegral}, {"setCostGradients", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_191setCostGradients, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_190setCostGradients}, {"getCostGradients", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_193getCostGradients, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_192getCostGradients}, {"setRHSJacobianP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_195setRHSJacobianP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_194setRHSJacobianP}, {"createQuadratureTS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_197createQuadratureTS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_196createQuadratureTS}, {"getQuadratureTS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_199getQuadratureTS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_198getQuadratureTS}, {"setRHSJacobianP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_201setRHSJacobianP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_200setRHSJacobianP}, {"computeRHSJacobianP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_203computeRHSJacobianP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_202computeRHSJacobianP}, {"adjointSetSteps", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_205adjointSetSteps, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_204adjointSetSteps}, {"adjointSetUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_207adjointSetUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_206adjointSetUp}, {"adjointSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_209adjointSolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_208adjointSolve}, {"adjointStep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_211adjointStep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_210adjointStep}, {"createPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_213createPython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_212createPython}, {"setPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_215setPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_214setPythonContext}, {"getPythonContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_217getPythonContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_216getPythonContext}, {"setPythonType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_219setPythonType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_218setPythonType}, {"setTheta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_221setTheta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_220setTheta}, {"getTheta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_223getTheta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_222getTheta}, {"setThetaEndpoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_225setThetaEndpoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_224setThetaEndpoint}, {"getThetaEndpoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_227getThetaEndpoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_226getThetaEndpoint}, {"setAlphaRadius", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_229setAlphaRadius, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_228setAlphaRadius}, {"setAlphaParams", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_231setAlphaParams, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_230setAlphaParams}, {"getAlphaParams", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_233getAlphaParams, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_232getAlphaParams}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_TS[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_2TS_appctx, __pyx_setprop_8petsc4py_5PETSc_2TS_appctx, (char *)0, 0}, {(char *)"dm", __pyx_getprop_8petsc4py_5PETSc_2TS_dm, __pyx_setprop_8petsc4py_5PETSc_2TS_dm, (char *)0, 0}, {(char *)"problem_type", __pyx_getprop_8petsc4py_5PETSc_2TS_problem_type, __pyx_setprop_8petsc4py_5PETSc_2TS_problem_type, (char *)0, 0}, {(char *)"equation_type", __pyx_getprop_8petsc4py_5PETSc_2TS_equation_type, __pyx_setprop_8petsc4py_5PETSc_2TS_equation_type, (char *)0, 0}, {(char *)"snes", __pyx_getprop_8petsc4py_5PETSc_2TS_snes, 0, (char *)0, 0}, {(char *)"ksp", __pyx_getprop_8petsc4py_5PETSc_2TS_ksp, 0, (char *)0, 0}, {(char *)"vec_sol", __pyx_getprop_8petsc4py_5PETSc_2TS_vec_sol, 0, (char *)0, 0}, {(char *)"time", __pyx_getprop_8petsc4py_5PETSc_2TS_time, __pyx_setprop_8petsc4py_5PETSc_2TS_time, (char *)0, 0}, {(char *)"time_step", __pyx_getprop_8petsc4py_5PETSc_2TS_time_step, __pyx_setprop_8petsc4py_5PETSc_2TS_time_step, (char *)0, 0}, {(char *)"step_number", __pyx_getprop_8petsc4py_5PETSc_2TS_step_number, __pyx_setprop_8petsc4py_5PETSc_2TS_step_number, (char *)0, 0}, {(char *)"max_time", __pyx_getprop_8petsc4py_5PETSc_2TS_max_time, __pyx_setprop_8petsc4py_5PETSc_2TS_max_time, (char *)0, 0}, {(char *)"max_steps", __pyx_getprop_8petsc4py_5PETSc_2TS_max_steps, __pyx_setprop_8petsc4py_5PETSc_2TS_max_steps, (char *)0, 0}, {(char *)"rtol", __pyx_getprop_8petsc4py_5PETSc_2TS_rtol, __pyx_setprop_8petsc4py_5PETSc_2TS_rtol, (char *)0, 0}, {(char *)"atol", __pyx_getprop_8petsc4py_5PETSc_2TS_atol, __pyx_setprop_8petsc4py_5PETSc_2TS_atol, (char *)0, 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_2TS_reason, __pyx_setprop_8petsc4py_5PETSc_2TS_reason, (char *)0, 0}, {(char *)"iterating", __pyx_getprop_8petsc4py_5PETSc_2TS_iterating, 0, (char *)0, 0}, {(char *)"converged", __pyx_getprop_8petsc4py_5PETSc_2TS_converged, 0, (char *)0, 0}, {(char *)"diverged", __pyx_getprop_8petsc4py_5PETSc_2TS_diverged, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscTS_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.TS", /*tp_name*/ sizeof(struct PyPetscTSObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_TS, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_TS, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_TS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAO __pyx_vtable_8petsc4py_5PETSc_TAO; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAO(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscTAOObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscTAOObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_TAO; if (unlikely(__pyx_pw_8petsc4py_5PETSc_3TAO_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_ksp(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_3ksp_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_ftol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_ftol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ftol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_gtol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_gtol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4gtol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_ctol(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_3TAO_ctol(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_3TAO_4ctol_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_its(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_3its_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_gnorm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_5gnorm_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_cnorm(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_5cnorm_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_solution(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8solution_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_objective(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_9objective_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_function(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8function_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_gradient(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8gradient_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_reason(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_6reason_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_iterating(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_9iterating_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_converged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_9converged_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_3TAO_diverged(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_3TAO_8diverged_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_TAO[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_3view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_2view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_4destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_7create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_6create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_9setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_8setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_11getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_10getType}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_12setOptionsPrefix}, {"getOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_15getOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_14getOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_17setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_16setFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_19setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_18setUp}, {"setInitialTrustRegionRadius", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_21setInitialTrustRegionRadius, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_20setInitialTrustRegionRadius}, {"setAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_23setAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_22setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_25getAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_24getAppCtx}, {"setInitial", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_27setInitial, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_26setInitial}, {"setObjective", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_29setObjective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_28setObjective}, {"setResidual", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_31setResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_30setResidual}, {"setJacobianResidual", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_33setJacobianResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_32setJacobianResidual}, {"setGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_35setGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_34setGradient}, {"setObjectiveGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_37setObjectiveGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_36setObjectiveGradient}, {"setVariableBounds", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_39setVariableBounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_38setVariableBounds}, {"setConstraints", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_41setConstraints, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_40setConstraints}, {"setHessian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_43setHessian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_42setHessian}, {"setJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_45setJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_44setJacobian}, {"setStateDesignIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_47setStateDesignIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_46setStateDesignIS}, {"setJacobianState", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_49setJacobianState, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_48setJacobianState}, {"setJacobianDesign", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_51setJacobianDesign, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_50setJacobianDesign}, {"computeObjective", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_53computeObjective, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_52computeObjective}, {"computeResidual", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_55computeResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_54computeResidual}, {"computeGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_57computeGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_56computeGradient}, {"computeObjectiveGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_59computeObjectiveGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_58computeObjectiveGradient}, {"computeDualVariables", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_61computeDualVariables, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_60computeDualVariables}, {"computeVariableBounds", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_63computeVariableBounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_62computeVariableBounds}, {"computeConstraints", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_65computeConstraints, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_64computeConstraints}, {"computeHessian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_67computeHessian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_66computeHessian}, {"computeJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_69computeJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_68computeJacobian}, {"setTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_71setTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_70setTolerances}, {"getTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_73getTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_72getTolerances}, {"setConstraintTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_75setConstraintTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_74setConstraintTolerances}, {"getConstraintTolerances", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_77getConstraintTolerances, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_76getConstraintTolerances}, {"setConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_79setConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_78setConvergenceTest}, {"getConvergenceTest", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_81getConvergenceTest, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_80getConvergenceTest}, {"setConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_83setConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_82setConvergedReason}, {"getConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_85getConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_84getConvergedReason}, {"setMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_87setMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_86setMonitor}, {"getMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_89getMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_88getMonitor}, {"cancelMonitor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_91cancelMonitor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_90cancelMonitor}, {"solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_93solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_92solve}, {"getSolution", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_95getSolution, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_94getSolution}, {"getGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_97getGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_96getGradient}, {"setGradientNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_99setGradientNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_98setGradientNorm}, {"getGradientNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_101getGradientNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_100getGradientNorm}, {"setLMVMH0", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_103setLMVMH0, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_102setLMVMH0}, {"getLMVMH0", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_105getLMVMH0, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_104getLMVMH0}, {"getLMVMH0KSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_107getLMVMH0KSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_106getLMVMH0KSP}, {"getVariableBounds", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_109getVariableBounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_108getVariableBounds}, {"getIterationNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_111getIterationNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_110getIterationNumber}, {"getObjectiveValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_113getObjectiveValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_112getObjectiveValue}, {"getConvergedReason", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_115getConvergedReason, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_114getConvergedReason}, {"getSolutionNorm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_117getSolutionNorm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_116getSolutionNorm}, {"getSolutionStatus", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_119getSolutionStatus, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_118getSolutionStatus}, {"getKSP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_121getKSP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_120getKSP}, {"getBRGNSubsolver", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_123getBRGNSubsolver, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_122getBRGNSubsolver}, {"setBRGNRegularizerObjectiveGradient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_125setBRGNRegularizerObjectiveGradient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_124setBRGNRegularizerObjectiveGradient}, {"setBRGNRegularizerHessian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_127setBRGNRegularizerHessian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_126setBRGNRegularizerHessian}, {"setBRGNRegularizerWeight", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_129setBRGNRegularizerWeight, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_128setBRGNRegularizerWeight}, {"setBRGNSmoothL1Epsilon", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_131setBRGNSmoothL1Epsilon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_130setBRGNSmoothL1Epsilon}, {"setBRGNDictionaryMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_133setBRGNDictionaryMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_132setBRGNDictionaryMatrix}, {"getBRGNDampingVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_135getBRGNDampingVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_134getBRGNDampingVector}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_TAO[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_3TAO_appctx, __pyx_setprop_8petsc4py_5PETSc_3TAO_appctx, (char *)0, 0}, {(char *)"ksp", __pyx_getprop_8petsc4py_5PETSc_3TAO_ksp, 0, (char *)0, 0}, {(char *)"ftol", __pyx_getprop_8petsc4py_5PETSc_3TAO_ftol, __pyx_setprop_8petsc4py_5PETSc_3TAO_ftol, (char *)0, 0}, {(char *)"gtol", __pyx_getprop_8petsc4py_5PETSc_3TAO_gtol, __pyx_setprop_8petsc4py_5PETSc_3TAO_gtol, (char *)0, 0}, {(char *)"ctol", __pyx_getprop_8petsc4py_5PETSc_3TAO_ctol, __pyx_setprop_8petsc4py_5PETSc_3TAO_ctol, (char *)0, 0}, {(char *)"its", __pyx_getprop_8petsc4py_5PETSc_3TAO_its, 0, (char *)0, 0}, {(char *)"gnorm", __pyx_getprop_8petsc4py_5PETSc_3TAO_gnorm, 0, (char *)0, 0}, {(char *)"cnorm", __pyx_getprop_8petsc4py_5PETSc_3TAO_cnorm, 0, (char *)0, 0}, {(char *)"solution", __pyx_getprop_8petsc4py_5PETSc_3TAO_solution, 0, (char *)0, 0}, {(char *)"objective", __pyx_getprop_8petsc4py_5PETSc_3TAO_objective, 0, (char *)0, 0}, {(char *)"function", __pyx_getprop_8petsc4py_5PETSc_3TAO_function, 0, (char *)0, 0}, {(char *)"gradient", __pyx_getprop_8petsc4py_5PETSc_3TAO_gradient, 0, (char *)0, 0}, {(char *)"reason", __pyx_getprop_8petsc4py_5PETSc_3TAO_reason, 0, (char *)0, 0}, {(char *)"iterating", __pyx_getprop_8petsc4py_5PETSc_3TAO_iterating, 0, (char *)0, 0}, {(char *)"converged", __pyx_getprop_8petsc4py_5PETSc_3TAO_converged, 0, (char *)0, 0}, {(char *)"diverged", __pyx_getprop_8petsc4py_5PETSc_3TAO_diverged, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscTAO_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.TAO", /*tp_name*/ sizeof(struct PyPetscTAOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "\n TAO Solver\n ", /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_TAO, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_TAO, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_TAO, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_AO __pyx_vtable_8petsc4py_5PETSc_AO; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_AO(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscAOObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscAOObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_AO; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2AO_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_AO[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_3view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_2view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_5destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_4destroy}, {"createBasic", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_6createBasic}, {"createMemoryScalable", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_8createMemoryScalable}, {"createMapping", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_10createMapping}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_13getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_12getType}, {"app2petsc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_14app2petsc}, {"petsc2app", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_17petsc2app, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_16petsc2app}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscAO_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.AO", /*tp_name*/ sizeof(struct PyPetscAOObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_AO, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_AO, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DM __pyx_vtable_8petsc4py_5PETSc_DM; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DM(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDMObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDMObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DM; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2DM_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2DM_appctx(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2DM_appctx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2DM_6appctx_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_2DM_ds(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_2DM_2ds_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_2DM_ds(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_2DM_2ds_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DM[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_3view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_2view}, {"load", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_5load, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_4load}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_7destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_6destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_9create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_8create}, {"clone", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_11clone, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_10clone}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_13setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_12setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_15getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_14getType}, {"getDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_16getDimension}, {"setDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_18setDimension}, {"getCoordinateDim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_20getCoordinateDim}, {"setCoordinateDim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_22setCoordinateDim}, {"setOptionsPrefix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_24setOptionsPrefix}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_27setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_26setFromOptions}, {"viewFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_29viewFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_28viewFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_31setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_30setUp}, {"setAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_33setAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_32setAppCtx}, {"getAppCtx", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_35getAppCtx, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_34getAppCtx}, {"setBasicAdjacency", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_37setBasicAdjacency, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_36setBasicAdjacency}, {"getBasicAdjacency", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_39getBasicAdjacency, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_38getBasicAdjacency}, {"setFieldAdjacency", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_41setFieldAdjacency, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_40setFieldAdjacency}, {"getFieldAdjacency", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_43getFieldAdjacency, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_42getFieldAdjacency}, {"setNumFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_45setNumFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_44setNumFields}, {"getNumFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_47getNumFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_46getNumFields}, {"setField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_49setField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_48setField}, {"getField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_51getField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_50getField}, {"addField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_53addField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_52addField}, {"copyFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_55copyFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_54copyFields}, {"createDS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_57createDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_56createDS}, {"clearDS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_59clearDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_58clearDS}, {"getDS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_61getDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_60getDS}, {"copyDS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_63copyDS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_62copyDS}, {"copyDisc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_65copyDisc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_64copyDisc}, {"getBlockSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_67getBlockSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_66getBlockSize}, {"setVecType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_69setVecType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_68setVecType}, {"createGlobalVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_71createGlobalVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_70createGlobalVec}, {"createLocalVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_73createLocalVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_72createLocalVec}, {"getGlobalVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_75getGlobalVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_74getGlobalVec}, {"restoreGlobalVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_77restoreGlobalVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_76restoreGlobalVec}, {"getLocalVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_79getLocalVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_78getLocalVec}, {"restoreLocalVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_81restoreLocalVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_80restoreLocalVec}, {"globalToLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_83globalToLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_82globalToLocal}, {"localToGlobal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_85localToGlobal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_84localToGlobal}, {"localToLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_87localToLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_86localToLocal}, {"getLGMap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_89getLGMap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_88getLGMap}, {"getCoordinateDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_91getCoordinateDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_90getCoordinateDM}, {"getCoordinateSection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_93getCoordinateSection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_92getCoordinateSection}, {"setCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_95setCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_94setCoordinates}, {"getCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_97getCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_96getCoordinates}, {"setCoordinatesLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_99setCoordinatesLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_98setCoordinatesLocal}, {"getCoordinatesLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_101getCoordinatesLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_100getCoordinatesLocal}, {"getBoundingBox", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_103getBoundingBox, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_102getBoundingBox}, {"getLocalBoundingBox", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_105getLocalBoundingBox, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_104getLocalBoundingBox}, {"localizeCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_107localizeCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_106localizeCoordinates}, {"setMatType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_109setMatType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_108setMatType}, {"createMat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_111createMat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_110createMat}, {"createInterpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_113createInterpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_112createInterpolation}, {"createInjection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_115createInjection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_114createInjection}, {"createRestriction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_117createRestriction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_116createRestriction}, {"convert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_119convert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_118convert}, {"refine", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_121refine, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_120refine}, {"coarsen", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_123coarsen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_122coarsen}, {"refineHierarchy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_125refineHierarchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_124refineHierarchy}, {"coarsenHierarchy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_127coarsenHierarchy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_126coarsenHierarchy}, {"getRefineLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_129getRefineLevel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_128getRefineLevel}, {"setRefineLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_131setRefineLevel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_130setRefineLevel}, {"getCoarsenLevel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_133getCoarsenLevel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_132getCoarsenLevel}, {"adaptLabel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_135adaptLabel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_134adaptLabel}, {"adaptMetric", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_137adaptMetric, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_136adaptMetric}, {"getLabel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_139getLabel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_138getLabel}, {"setSection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_141setSection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_140setSection}, {"getSection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_143getSection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_142getSection}, {"setGlobalSection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_145setGlobalSection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_144setGlobalSection}, {"getGlobalSection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_147getGlobalSection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_146getGlobalSection}, {"createSectionSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_149createSectionSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_148createSectionSF}, {"getSectionSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_151getSectionSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_150getSectionSF}, {"setSectionSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_153setSectionSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_152setSectionSF}, {"getPointSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_155getPointSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_154getPointSF}, {"setPointSF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_157setPointSF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_156setPointSF}, {"getNumLabels", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_159getNumLabels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_158getNumLabels}, {"getLabelName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_161getLabelName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_160getLabelName}, {"hasLabel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_163hasLabel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_162hasLabel}, {"createLabel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_165createLabel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_164createLabel}, {"removeLabel", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_167removeLabel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_166removeLabel}, {"getLabelValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_169getLabelValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_168getLabelValue}, {"setLabelValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_171setLabelValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_170setLabelValue}, {"clearLabelValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_173clearLabelValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_172clearLabelValue}, {"getLabelSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_175getLabelSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_174getLabelSize}, {"getLabelIdIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_177getLabelIdIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_176getLabelIdIS}, {"getStratumSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_179getStratumSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_178getStratumSize}, {"getStratumIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_181getStratumIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_180getStratumIS}, {"clearLabelStratum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_183clearLabelStratum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_182clearLabelStratum}, {"setLabelOutput", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_185setLabelOutput, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_184setLabelOutput}, {"getLabelOutput", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_187getLabelOutput, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_186getLabelOutput}, {"setKSPComputeOperators", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_189setKSPComputeOperators, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_188setKSPComputeOperators}, {"createFieldDecomposition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_191createFieldDecomposition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_190createFieldDecomposition}, {"setSNESFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_193setSNESFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_192setSNESFunction}, {"setSNESJacobian", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_195setSNESJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_194setSNESJacobian}, {"addCoarsenHook", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_197addCoarsenHook, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_196addCoarsenHook}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DM[] = { {(char *)"appctx", __pyx_getprop_8petsc4py_5PETSc_2DM_appctx, __pyx_setprop_8petsc4py_5PETSc_2DM_appctx, (char *)0, 0}, {(char *)"ds", __pyx_getprop_8petsc4py_5PETSc_2DM_ds, __pyx_setprop_8petsc4py_5PETSc_2DM_ds, (char *)0, 0}, {0, 0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscDM_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DM", /*tp_name*/ sizeof(struct PyPetscDMObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DM, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_DM, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DM, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DS __pyx_vtable_8petsc4py_5PETSc_DS; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DS(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDSObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDSObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DS; if (unlikely(__pyx_pw_8petsc4py_5PETSc_2DS_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DS[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_3view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_2view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_5destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_4destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_7create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_6create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_9setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_8setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_11getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_10getType}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_12setFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_15setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_14setUp}, {"getSpatialDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_16getSpatialDimension}, {"getCoordinateDimension", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_18getCoordinateDimension}, {"getNumFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_20getNumFields}, {"getFieldIndex", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_22getFieldIndex}, {"getTotalDimensions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_24getTotalDimensions}, {"getTotalComponents", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_26getTotalComponents}, {"getDimensions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_28getDimensions}, {"getComponents", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_30getComponents}, {"setDiscretisation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_33setDiscretisation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_32setDiscretisation}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscDS_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DS", /*tp_name*/ sizeof(struct PyPetscDSObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DS, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DS, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_Partitioner __pyx_vtable_8petsc4py_5PETSc_Partitioner; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Partitioner(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscPartitionerObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscPartitionerObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Partitioner; if (unlikely(__pyx_pw_8petsc4py_5PETSc_11Partitioner_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Partitioner[] = { {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_2view}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_4destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_6create}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_8setType}, {"getType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_10getType}, {"setFromOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_12setFromOptions}, {"setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_14setUp}, {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_16reset}, {"setShellPartition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_19setShellPartition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_18setShellPartition}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscPartitioner_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Partitioner", /*tp_name*/ sizeof(struct PyPetscPartitionerObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Partitioner, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Partitioner, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMLabel __pyx_vtable_8petsc4py_5PETSc_DMLabel; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMLabel(PyTypeObject *t, PyObject *a, PyObject *k) { struct PyPetscDMLabelObject *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k); if (unlikely(!o)) return 0; p = ((struct PyPetscDMLabelObject *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMLabel; if (unlikely(__pyx_pw_8petsc4py_5PETSc_7DMLabel_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMLabel[] = { {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_2destroy}, {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_5create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_4create}, {"insertIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_7insertIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_6insertIS}, {0, 0, 0, 0} }; DL_EXPORT(PyTypeObject) PyPetscDMLabel_Type = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DMLabel", /*tp_name*/ sizeof(struct PyPetscDMLabelObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMLabel, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMLabel, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer __pyx_vtable_8petsc4py_5PETSc__IS_buffer; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__IS_buffer(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc__IS_buffer; if (unlikely(__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__IS_buffer(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_10_IS_buffer___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__IS_buffer[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_9__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_8__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_10__exit__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc__IS_buffer[] = { {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_10_IS_buffer___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyBufferProcs __pyx_tp_as_buffer__IS_buffer = { #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_15__getreadbuffer__, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_13__getsegcount__, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__IS_buffer = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc._IS_buffer", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__IS_buffer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__IS_buffer, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__IS_buffer, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc__IS_buffer, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__IS_buffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__Vec_buffer __pyx_vtable_8petsc4py_5PETSc__Vec_buffer; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_buffer(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer; if (unlikely(__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_buffer(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_11_Vec_buffer___array_interface__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_19__array_interface___1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__Vec_buffer[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_9__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_8__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_10__exit__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc__Vec_buffer[] = { {(char *)"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_11_Vec_buffer___array_interface__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyBufferProcs __pyx_tp_as_buffer__Vec_buffer = { #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_15__getreadbuffer__, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_17__getwritebuffer__, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_13__getsegcount__, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__, /*bf_getbuffer*/ __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__Vec_buffer = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc._Vec_buffer", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_buffer, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__Vec_buffer, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__Vec_buffer, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc__Vec_buffer, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__Vec_buffer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o); p->gvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); p->lvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_LocalForm(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p = (struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->gvec); Py_CLEAR(p->lvec); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_8petsc4py_5PETSc__Vec_LocalForm(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p = (struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o; if (p->gvec) { e = (*v)(((PyObject *)p->gvec), a); if (e) return e; } if (p->lvec) { e = (*v)(((PyObject *)p->lvec), a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc__Vec_LocalForm(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p = (struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *)o; tmp = ((PyObject*)p->gvec); p->gvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->lvec); p->lvec = ((struct PyPetscVecObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__Vec_LocalForm[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_2__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__Vec_LocalForm = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc._Vec_LocalForm", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__Vec_LocalForm, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "_Vec_LocalForm(Vec gvec)\nContext manager for `Vec` local form", /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__Vec_LocalForm, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__Vec_LocalForm, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__Vec_LocalForm, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__Vec_LocalForm, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__Mat_Stencil(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__Mat_Stencil(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static int __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_i(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1i_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_j(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1j_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_k(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1k_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_c(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_1c_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5index_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static int __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_field(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_12_Mat_Stencil_5field_1__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc__Mat_Stencil[] = { {(char *)"i", 0, __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_i, (char *)0, 0}, {(char *)"j", 0, __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_j, (char *)0, 0}, {(char *)"k", 0, __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_k, (char *)0, 0}, {(char *)"c", 0, __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_c, (char *)0, 0}, {(char *)"index", 0, __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_index, (char *)0, 0}, {(char *)"field", 0, __pyx_setprop_8petsc4py_5PETSc_12_Mat_Stencil_field, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__Mat_Stencil = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc._Mat_Stencil", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__Mat_Stencil), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__Mat_Stencil, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc__Mat_Stencil, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__Mat_Stencil, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc__DMDA_Vec_array __pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMDA_Vec_array(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o); p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array; p->vecbuf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)Py_None); Py_INCREF(Py_None); p->starts = ((PyObject*)Py_None); Py_INCREF(Py_None); p->sizes = ((PyObject*)Py_None); Py_INCREF(Py_None); p->shape = ((PyObject*)Py_None); Py_INCREF(Py_None); p->strides = ((PyObject*)Py_None); Py_INCREF(Py_None); p->array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p = (struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->vecbuf); Py_CLEAR(p->starts); Py_CLEAR(p->sizes); Py_CLEAR(p->shape); Py_CLEAR(p->strides); Py_CLEAR(p->array); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p = (struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o; if (p->vecbuf) { e = (*v)(((PyObject *)p->vecbuf), a); if (e) return e; } if (p->starts) { e = (*v)(p->starts, a); if (e) return e; } if (p->sizes) { e = (*v)(p->sizes, a); if (e) return e; } if (p->shape) { e = (*v)(p->shape, a); if (e) return e; } if (p->strides) { e = (*v)(p->strides, a); if (e) return e; } if (p->array) { e = (*v)(((PyObject *)p->array), a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *p = (struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *)o; tmp = ((PyObject*)p->vecbuf); p->vecbuf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->starts); p->starts = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->sizes); p->sizes = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->shape); p->shape = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->strides); p->strides = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->array); p->array = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc__DMDA_Vec_array(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5__setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_starts(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_6starts_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_shape(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5shape_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_strides(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7strides_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_array(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_5array_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__DMDA_Vec_array[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_6__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15_DMDA_Vec_array_8__exit__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc__DMDA_Vec_array[] = { {(char *)"starts", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_starts, 0, (char *)0, 0}, {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_sizes, 0, (char *)0, 0}, {(char *)"shape", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_shape, 0, (char *)0, 0}, {(char *)"strides", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_strides, 0, (char *)0, 0}, {(char *)"array", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_array, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence__DMDA_Vec_array = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc__DMDA_Vec_array, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping__DMDA_Vec_array = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_15_DMDA_Vec_array_3__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc__DMDA_Vec_array, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc._DMDA_Vec_array", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence__DMDA_Vec_array, /*tp_as_sequence*/ &__pyx_tp_as_mapping__DMDA_Vec_array, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__DMDA_Vec_array, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc__DMComposite_access(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o); p->locs_mem = Py_None; Py_INCREF(Py_None); p->vecs_mem = Py_None; Py_INCREF(Py_None); p->access = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc__DMComposite_access(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p = (struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->locs_mem); Py_CLEAR(p->vecs_mem); Py_CLEAR(p->access); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_8petsc4py_5PETSc__DMComposite_access(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p = (struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o; if (p->locs_mem) { e = (*v)(p->locs_mem, a); if (e) return e; } if (p->vecs_mem) { e = (*v)(p->vecs_mem, a); if (e) return e; } if (p->access) { e = (*v)(p->access, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc__DMComposite_access(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *p = (struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access *)o; tmp = ((PyObject*)p->locs_mem); p->locs_mem = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->vecs_mem); p->vecs_mem = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->access); p->access = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc__DMComposite_access[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_5__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_4__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_6__exit__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc__DMComposite_access = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc._DMComposite_access", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc__DMComposite_access), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc__DMComposite_access, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc__DMComposite_access, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc__DMComposite_access, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc__DMComposite_access, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc__DMComposite_access, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Options(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_Options *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_Options *)o); p->_prefix = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Options(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc_Options *p = (struct __pyx_obj_8petsc4py_5PETSc_Options *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->_prefix); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_8petsc4py_5PETSc_Options(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc_Options *p = (struct __pyx_obj_8petsc4py_5PETSc_Options *)o; if (p->_prefix) { e = (*v)(p->_prefix, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc_Options(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc_Options *p = (struct __pyx_obj_8petsc4py_5PETSc_Options *)o; tmp = ((PyObject*)p->_prefix); p->_prefix = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_sq_item_8petsc4py_5PETSc_Options(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_8petsc4py_5PETSc_Options(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_pw_8petsc4py_5PETSc_7Options_9__setitem__(o, i, v); } else { return __pyx_pw_8petsc4py_5PETSc_7Options_11__delitem__(o, i); } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_7Options_prefix(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_7Options_prefix(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_3__set__(o, v); } else { return __pyx_pw_8petsc4py_5PETSc_7Options_6prefix_5__del__(o); } } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Options[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_13create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_12create}, {"destroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_15destroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_14destroy}, {"clear", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_17clear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_16clear}, {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_19view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_18view}, {"prefixPush", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_20prefixPush}, {"prefixPop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_22prefixPop}, {"hasName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_25hasName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_24hasName}, {"setValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_27setValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_26setValue}, {"delValue", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_29delValue, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_28delValue}, {"getBool", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_31getBool, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_30getBool}, {"getInt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_33getInt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_32getInt}, {"getReal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_35getReal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_34getReal}, {"getScalar", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_37getScalar, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_36getScalar}, {"getString", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_39getString, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_38getString}, {"insertString", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_41insertString, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_40insertString}, {"getAll", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_43getAll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_42getAll}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Options[] = { {(char *)"prefix", __pyx_getprop_8petsc4py_5PETSc_7Options_prefix, __pyx_setprop_8petsc4py_5PETSc_7Options_prefix, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_Options = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_8petsc4py_5PETSc_Options, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ __pyx_pw_8petsc4py_5PETSc_7Options_5__contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Options = { 0, /*mp_length*/ __pyx_pw_8petsc4py_5PETSc_7Options_7__getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_8petsc4py_5PETSc_Options, /*mp_ass_subscript*/ }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_Options = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Options", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_Options), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Options, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_Options, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Options, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Options(prefix=None)", /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Options, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Options, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Options, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_Options, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_8petsc4py_5PETSc_7Options_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Options, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Sys(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Sys(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Sys[] = { {"getVersion", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_getVersion}, {"getVersionInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_2getVersionInfo}, {"isInitialized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_4isInitialized}, {"isFinalized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_6isFinalized}, {"getDefaultComm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_8getDefaultComm}, {"setDefaultComm", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_10setDefaultComm}, {"Print", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_13Print, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_12Print}, {"syncPrint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_14syncPrint}, {"syncFlush", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_16syncFlush}, {"splitOwnership", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_18splitOwnership}, {"sleep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_20sleep}, {"pushErrorHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_22pushErrorHandler}, {"popErrorHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_24popErrorHandler}, {"popSignalHandler", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_26popSignalHandler}, {"infoAllow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_28infoAllow}, {"registerCitation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_30registerCitation}, {"hasExternalPackage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_32hasExternalPackage}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_Sys = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Sys", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_Sys), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Sys, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Sys, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Sys, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Log(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_Log(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Log[] = { {"Stage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_1Stage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_Stage}, {"Class", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_3Class, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_2Class}, {"Event", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_5Event, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_4Event}, {"begin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_7begin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_6begin}, {"view", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_9view, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_8view}, {"logFlops", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_10logFlops}, {"addFlops", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_12addFlops}, {"getFlops", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_14getFlops}, {"getTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_17getTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_16getTime}, {"getCPUTime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_18getCPUTime}, {"EventDecorator", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_20EventDecorator}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_Log = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Log", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_Log), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Log, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_Log, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_Log, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogStage(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_LogStage(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogStage_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogStage_active(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_6active_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_visible(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogStage_visible(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_7visible_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogStage_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogStage_2id_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogStage[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_4__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_6__exit__}, {"push", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_9push, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_8push}, {"pop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_10pop}, {"getName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_12getName}, {"activate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_14activate}, {"deactivate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_16deactivate}, {"getActive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_18getActive}, {"setActive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_20setActive}, {"getVisible", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_22getVisible}, {"setVisible", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_24setVisible}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LogStage[] = { {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_8LogStage_name, __pyx_setprop_8petsc4py_5PETSc_8LogStage_name, (char *)0, 0}, {(char *)"active", __pyx_getprop_8petsc4py_5PETSc_8LogStage_active, __pyx_setprop_8petsc4py_5PETSc_8LogStage_active, (char *)0, 0}, {(char *)"visible", __pyx_getprop_8petsc4py_5PETSc_8LogStage_visible, __pyx_setprop_8petsc4py_5PETSc_8LogStage_visible, (char *)0, 0}, {(char *)"id", __pyx_getprop_8petsc4py_5PETSc_8LogStage_id, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_LogStage = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_LogStage = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.LogStage", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogStage), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_LogStage, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_LogStage, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LogStage, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LogStage, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LogStage, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogClass(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_LogClass(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogClass_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogClass_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogClass_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogClass_active(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_6active_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogClass_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogClass_2id_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogClass[] = { {"getName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_4getName}, {"activate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_6activate}, {"deactivate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_8deactivate}, {"getActive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_10getActive}, {"setActive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_12setActive}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LogClass[] = { {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_8LogClass_name, __pyx_setprop_8petsc4py_5PETSc_8LogClass_name, (char *)0, 0}, {(char *)"active", __pyx_getprop_8petsc4py_5PETSc_8LogClass_active, __pyx_setprop_8petsc4py_5PETSc_8LogClass_active, (char *)0, 0}, {(char *)"id", __pyx_getprop_8petsc4py_5PETSc_8LogClass_id, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_LogClass = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_LogClass = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.LogClass", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogClass), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_LogClass, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_LogClass, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LogClass, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LogClass, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LogClass, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_LogEvent(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_8petsc4py_5PETSc_LogEvent(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_name(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogEvent_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_4name_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_active(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_6active_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_active_all(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_1__get__(o); } static int __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active_all(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_10active_all_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_8petsc4py_5PETSc_8LogEvent_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_8LogEvent_2id_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogEvent[] = { {"__enter__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_4__enter__}, {"__exit__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_6__exit__}, {"begin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_8begin}, {"end", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_10end}, {"getName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_12getName}, {"activate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_14activate}, {"deactivate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_16deactivate}, {"getActive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_18getActive}, {"setActive", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_20setActive}, {"getActiveAll", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_22getActiveAll}, {"setActiveAll", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_24setActiveAll}, {"getPerfInfo", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_26getPerfInfo}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LogEvent[] = { {(char *)"name", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_name, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_name, (char *)0, 0}, {(char *)"active", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_active, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active, (char *)0, 0}, {(char *)"active_all", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_active_all, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active_all, (char *)0, 0}, {(char *)"id", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_id, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_LogEvent = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_coerce*/ #endif __pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__, /*nb_int*/ #if PY_MAJOR_VERSION < 3 __pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000) 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ 0, /*nb_index*/ #if PY_VERSION_HEX >= 0x03050000 0, /*nb_matrix_multiply*/ #endif #if PY_VERSION_HEX >= 0x03050000 0, /*nb_inplace_matrix_multiply*/ #endif }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_LogEvent = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.LogEvent", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_LogEvent), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_LogEvent, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_LogEvent, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_LogEvent, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_LogEvent, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_LogEvent, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_ViewerHDF5 __pyx_vtable_8petsc4py_5PETSc_ViewerHDF5; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_ViewerHDF5(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Viewer(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_ViewerHDF5[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_create}, {"getTimestep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3getTimestep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_2getTimestep}, {"setTimestep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5setTimestep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_4setTimestep}, {"incrementTimestep", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7incrementTimestep, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_6incrementTimestep}, {"pushGroup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9pushGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_8pushGroup}, {"popGroup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11popGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_10popGroup}, {"getGroup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13getGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_12getGroup}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_ViewerHDF5 = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.ViewerHDF5", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_8petsc4py_5PETSc_6Viewer_3__call__, /*tp_call*/ #else 0, /*tp_call*/ #endif 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_ViewerHDF5, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_ViewerHDF5, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMDA __pyx_vtable_8petsc4py_5PETSc_DMDA; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMDA(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMDA *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMDA; return o; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_dim(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_3dim_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_dof(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_3dof_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_5sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_proc_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_10proc_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_boundary_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_13boundary_type_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_7stencil_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_12stencil_type_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_13stencil_width_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_6ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_ranges(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_12ghost_ranges_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_7corners_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_4DMDA_13ghost_corners_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMDA[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_create}, {"duplicate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_2duplicate}, {"setDim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_4setDim}, {"getDim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_6getDim}, {"setDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_8setDof}, {"getDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_10getDof}, {"setSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_12setSizes}, {"getSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_14getSizes}, {"setProcSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_16setProcSizes}, {"getProcSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_18getProcSizes}, {"setBoundaryType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_20setBoundaryType}, {"getBoundaryType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_22getBoundaryType}, {"setStencilType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_24setStencilType}, {"getStencilType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_26getStencilType}, {"setStencilWidth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_28setStencilWidth}, {"getStencilWidth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_30getStencilWidth}, {"setStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_32setStencil}, {"getStencil", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_34getStencil}, {"getRanges", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_36getRanges}, {"getGhostRanges", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_38getGhostRanges}, {"getOwnershipRanges", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges}, {"getCorners", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_42getCorners}, {"getGhostCorners", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_44getGhostCorners}, {"setFieldName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_46setFieldName}, {"getFieldName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_48getFieldName}, {"getVecArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_50getVecArray}, {"setUniformCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates}, {"setCoordinateName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_54setCoordinateName}, {"getCoordinateName", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_56getCoordinateName}, {"createNaturalVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_58createNaturalVec}, {"globalToNatural", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_60globalToNatural}, {"naturalToGlobal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_62naturalToGlobal}, {"getAO", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_64getAO}, {"getScatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_66getScatter}, {"setRefinementFactor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_68setRefinementFactor}, {"getRefinementFactor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_70getRefinementFactor}, {"setInterpolationType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_72setInterpolationType}, {"getInterpolationType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_74getInterpolationType}, {"setElementType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_76setElementType}, {"getElementType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_78getElementType}, {"getElements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_81getElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_80getElements}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DMDA[] = { {(char *)"dim", __pyx_getprop_8petsc4py_5PETSc_4DMDA_dim, 0, (char *)0, 0}, {(char *)"dof", __pyx_getprop_8petsc4py_5PETSc_4DMDA_dof, 0, (char *)0, 0}, {(char *)"sizes", __pyx_getprop_8petsc4py_5PETSc_4DMDA_sizes, 0, (char *)0, 0}, {(char *)"proc_sizes", __pyx_getprop_8petsc4py_5PETSc_4DMDA_proc_sizes, 0, (char *)0, 0}, {(char *)"boundary_type", __pyx_getprop_8petsc4py_5PETSc_4DMDA_boundary_type, 0, (char *)0, 0}, {(char *)"stencil", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil, 0, (char *)0, 0}, {(char *)"stencil_type", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_type, 0, (char *)0, 0}, {(char *)"stencil_width", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_width, 0, (char *)0, 0}, {(char *)"ranges", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ranges, 0, (char *)0, 0}, {(char *)"ghost_ranges", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_ranges, 0, (char *)0, 0}, {(char *)"corners", __pyx_getprop_8petsc4py_5PETSc_4DMDA_corners, 0, (char *)0, 0}, {(char *)"ghost_corners", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_corners, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMDA = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DMDA", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMDA), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMDA, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_DMDA, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMDA, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMPlex __pyx_vtable_8petsc4py_5PETSc_DMPlex; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMPlex(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMPlex *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMPlex; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMPlex[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_create}, {"createFromCellList", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_2createFromCellList}, {"createBoxMesh", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_4createBoxMesh}, {"createFromFile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createFromFile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_6createFromFile}, {"createCGNS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createCGNS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_8createCGNS}, {"createCGNSFromFile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNSFromFile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_10createCGNSFromFile}, {"createExodusFromFile", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createExodusFromFile, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_12createExodusFromFile}, {"createExodus", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodus, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_14createExodus}, {"createGmsh", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createGmsh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_16createGmsh}, {"createCohesiveSubmesh", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createCohesiveSubmesh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_18createCohesiveSubmesh}, {"getChart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_21getChart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_20getChart}, {"setChart", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_23setChart, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_22setChart}, {"getConeSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_25getConeSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_24getConeSize}, {"setConeSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_27setConeSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_26setConeSize}, {"getCone", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_29getCone, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_28getCone}, {"setCone", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_31setCone, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_30setCone}, {"insertCone", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_33insertCone, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_32insertCone}, {"insertConeOrientation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_35insertConeOrientation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_34insertConeOrientation}, {"getConeOrientation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_37getConeOrientation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_36getConeOrientation}, {"setConeOrientation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_39setConeOrientation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_38setConeOrientation}, {"getSupportSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_41getSupportSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_40getSupportSize}, {"setSupportSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_43setSupportSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_42setSupportSize}, {"getSupport", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getSupport, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_44getSupport}, {"setSupport", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_47setSupport, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_46setSupport}, {"getMaxSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_49getMaxSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_48getMaxSizes}, {"symmetrize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_51symmetrize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_50symmetrize}, {"stratify", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_53stratify, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_52stratify}, {"orient", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_55orient, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_54orient}, {"getCellNumbering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_57getCellNumbering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_56getCellNumbering}, {"getVertexNumbering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_59getVertexNumbering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_58getVertexNumbering}, {"createPointNumbering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_61createPointNumbering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_60createPointNumbering}, {"getDepth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_63getDepth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_62getDepth}, {"getDepthStratum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_65getDepthStratum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_64getDepthStratum}, {"getHeightStratum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_67getHeightStratum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_66getHeightStratum}, {"getMeet", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_69getMeet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_68getMeet}, {"getJoin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getJoin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_70getJoin}, {"getTransitiveClosure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getTransitiveClosure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_72getTransitiveClosure}, {"vecGetClosure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_75vecGetClosure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_74vecGetClosure}, {"getVecClosure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getVecClosure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_76getVecClosure}, {"setVecClosure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_79setVecClosure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_78setVecClosure}, {"setMatClosure", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_81setMatClosure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_80setMatClosure}, {"generate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_83generate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_82generate}, {"setTriangleOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_85setTriangleOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_84setTriangleOptions}, {"setTetGenOptions", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_87setTetGenOptions, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_86setTetGenOptions}, {"createSquareBoundary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_89createSquareBoundary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_88createSquareBoundary}, {"createCubeBoundary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_91createCubeBoundary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_90createCubeBoundary}, {"markBoundaryFaces", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_93markBoundaryFaces, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_92markBoundaryFaces}, {"setAdjacencyUseAnchors", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_95setAdjacencyUseAnchors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_94setAdjacencyUseAnchors}, {"getAdjacencyUseAnchors", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_97getAdjacencyUseAnchors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_96getAdjacencyUseAnchors}, {"getAdjacency", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_99getAdjacency, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_98getAdjacency}, {"setPartitioner", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setPartitioner, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_100setPartitioner}, {"getPartitioner", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_103getPartitioner, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_102getPartitioner}, {"rebalanceSharedPoints", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_105rebalanceSharedPoints, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_104rebalanceSharedPoints}, {"distribute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_107distribute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_106distribute}, {"distributeOverlap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_109distributeOverlap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_108distributeOverlap}, {"isDistributed", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_111isDistributed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_110isDistributed}, {"interpolate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_113interpolate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_112interpolate}, {"uninterpolate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_115uninterpolate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_114uninterpolate}, {"distributeField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_117distributeField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_116distributeField}, {"createCoarsePointIS", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_119createCoarsePointIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_118createCoarsePointIS}, {"createSection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_121createSection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_120createSection}, {"getPointLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_123getPointLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_122getPointLocal}, {"getPointLocalField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_125getPointLocalField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_124getPointLocalField}, {"getPointGlobal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_127getPointGlobal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_126getPointGlobal}, {"getPointGlobalField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_129getPointGlobalField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_128getPointGlobalField}, {"createClosureIndex", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_131createClosureIndex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_130createClosureIndex}, {"setRefinementUniform", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_133setRefinementUniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_132setRefinementUniform}, {"getRefinementUniform", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_135getRefinementUniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_134getRefinementUniform}, {"setRefinementLimit", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_137setRefinementLimit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_136setRefinementLimit}, {"getRefinementLimit", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_139getRefinementLimit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_138getRefinementLimit}, {"getOrdering", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_141getOrdering, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_140getOrdering}, {"permute", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_143permute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_142permute}, {"computeCellGeometryFVM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_145computeCellGeometryFVM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_144computeCellGeometryFVM}, {"constructGhostCells", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_147constructGhostCells, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_146constructGhostCells}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMPlex = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DMPlex", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMPlex), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMPlex, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMPlex, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMStag __pyx_vtable_8petsc4py_5PETSc_DMStag; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMStag(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMStag *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMStag *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMStag; return o; } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_dim(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_3dim_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_dofs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_4dofs_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_entries_per_element(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_19entries_per_element_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_global_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_12global_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_local_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_11local_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_proc_sizes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_10proc_sizes_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_boundary_types(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_14boundary_types_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_type(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_12stencil_type_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_width(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_13stencil_width_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_7corners_1__get__(o); } static PyObject *__pyx_getprop_8petsc4py_5PETSc_6DMStag_ghost_corners(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_8petsc4py_5PETSc_6DMStag_13ghost_corners_1__get__(o); } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMStag[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_create}, {"setStencilWidth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_2setStencilWidth}, {"setStencilType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_4setStencilType}, {"setBoundaryTypes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes}, {"setDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_8setDof}, {"setGlobalSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_10setGlobalSizes}, {"setProcSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_12setProcSizes}, {"setOwnershipRanges", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges}, {"getDim", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_16getDim}, {"getEntriesPerElement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement}, {"getStencilWidth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_20getStencilWidth}, {"getDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_22getDof}, {"getCorners", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_24getCorners}, {"getGhostCorners", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_26getGhostCorners}, {"getLocalSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_28getLocalSizes}, {"getGlobalSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_30getGlobalSizes}, {"getProcSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_32getProcSizes}, {"getStencilType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_34getStencilType}, {"getOwnershipRanges", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges}, {"getBoundaryTypes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes}, {"getIsFirstRank", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_40getIsFirstRank}, {"getIsLastRank", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_42getIsLastRank}, {"setUniformCoordinatesExplicit", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit}, {"setUniformCoordinatesProduct", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct}, {"setUniformCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates}, {"setCoordinateDMType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType}, {"getLocationSlot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_52getLocationSlot}, {"getProductCoordinateLocationSlot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot}, {"getLocationDof", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_56getLocationDof}, {"migrateVec", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_58migrateVec}, {"createCompatibleDMStag", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag}, {"VecSplitToDMDA", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA}, {"getVecArray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_64getVecArray}, {"get1dCoordinatecArrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DMStag[] = { {(char *)"dim", __pyx_getprop_8petsc4py_5PETSc_6DMStag_dim, 0, (char *)0, 0}, {(char *)"dofs", __pyx_getprop_8petsc4py_5PETSc_6DMStag_dofs, 0, (char *)0, 0}, {(char *)"entries_per_element", __pyx_getprop_8petsc4py_5PETSc_6DMStag_entries_per_element, 0, (char *)0, 0}, {(char *)"global_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_global_sizes, 0, (char *)0, 0}, {(char *)"local_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_local_sizes, 0, (char *)0, 0}, {(char *)"proc_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_proc_sizes, 0, (char *)0, 0}, {(char *)"boundary_types", __pyx_getprop_8petsc4py_5PETSc_6DMStag_boundary_types, 0, (char *)0, 0}, {(char *)"stencil_type", __pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_type, 0, (char *)0, 0}, {(char *)"stencil_width", __pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_width, 0, (char *)0, 0}, {(char *)"corners", __pyx_getprop_8petsc4py_5PETSc_6DMStag_corners, 0, (char *)0, 0}, {(char *)"ghost_corners", __pyx_getprop_8petsc4py_5PETSc_6DMStag_ghost_corners, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMStag = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DMStag", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMStag), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMStag, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_8petsc4py_5PETSc_DMStag, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMStag, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMComposite __pyx_vtable_8petsc4py_5PETSc_DMComposite; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMComposite(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMComposite *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMComposite *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMComposite; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMComposite[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_create}, {"addDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_2addDM}, {"getNumber", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_4getNumber}, {"getEntries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_6getEntries}, {"scatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_8scatter}, {"gather", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_10gather}, {"getGlobalISs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_12getGlobalISs}, {"getLocalISs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_14getLocalISs}, {"getLGMaps", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_16getLGMaps}, {"getAccess", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_19getAccess, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_18getAccess}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMComposite = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DMComposite", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMComposite), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMComposite, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMComposite, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMShell __pyx_vtable_8petsc4py_5PETSc_DMShell; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMShell(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMShell *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMShell *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMShell; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMShell[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_create}, {"setMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_2setMatrix}, {"setGlobalVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_4setGlobalVector}, {"setLocalVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_6setLocalVector}, {"setCreateGlobalVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector}, {"setCreateLocalVector", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector}, {"setGlobalToLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal}, {"setGlobalToLocalVecScatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter}, {"setLocalToGlobal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal}, {"setLocalToGlobalVecScatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter}, {"setLocalToLocal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_20setLocalToLocal}, {"setLocalToLocalVecScatter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter}, {"setCreateMatrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_24setCreateMatrix}, {"setCoarsen", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_26setCoarsen}, {"setRefine", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_28setRefine}, {"setCreateInterpolation", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation}, {"setCreateInjection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_32setCreateInjection}, {"setCreateRestriction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_34setCreateRestriction}, {"setCreateFieldDecomposition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition}, {"setCreateDomainDecomposition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition}, {"setCreateDomainDecompositionScatters", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters}, {"setCreateSubDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_43setCreateSubDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_42setCreateSubDM}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMShell = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DMShell", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMShell), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMShell, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMShell, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_8petsc4py_5PETSc_DMSwarm __pyx_vtable_8petsc4py_5PETSc_DMSwarm; static PyObject *__pyx_tp_new_8petsc4py_5PETSc_DMSwarm(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *p; PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_DM(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_DMSwarm; return o; } static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMSwarm[] = { {"create", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_create}, {"createGlobalVectorFromField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField}, {"destroyGlobalVectorFromField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField}, {"createLocalVectorFromField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createLocalVectorFromField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_6createLocalVectorFromField}, {"destroyLocalVectorFromField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyLocalVectorFromField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_8destroyLocalVectorFromField}, {"initializeFieldRegister", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11initializeFieldRegister, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_10initializeFieldRegister}, {"finalizeFieldRegister", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13finalizeFieldRegister, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_12finalizeFieldRegister}, {"setLocalSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15setLocalSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_14setLocalSizes}, {"registerField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17registerField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_16registerField}, {"getField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19getField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_18getField}, {"restoreField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21restoreField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_20restoreField}, {"vectorDefineField", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23vectorDefineField, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_22vectorDefineField}, {"addPoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25addPoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_24addPoint}, {"addNPoints", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27addNPoints, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_26addNPoints}, {"removePoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29removePoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_28removePoint}, {"removePointAtIndex", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31removePointAtIndex, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_30removePointAtIndex}, {"copyPoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33copyPoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_32copyPoint}, {"getLocalSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35getLocalSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_34getLocalSize}, {"getSize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37getSize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_36getSize}, {"migrate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39migrate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_38migrate}, {"collectViewCreate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41collectViewCreate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_40collectViewCreate}, {"collectViewDestroy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43collectViewDestroy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_42collectViewDestroy}, {"setCellDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45setCellDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_44setCellDM}, {"getCellDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47getCellDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_46getCellDM}, {"setType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49setType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_48setType}, {"setPointsUniformCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51setPointsUniformCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_50setPointsUniformCoordinates}, {"setPointCoordinates", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setPointCoordinates, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_52setPointCoordinates}, {"insertPointUsingCellDM", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55insertPointUsingCellDM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_54insertPointUsingCellDM}, {"setPointCoordinatesCellwise", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setPointCoordinatesCellwise, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_56setPointCoordinatesCellwise}, {"viewFieldsXDMF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59viewFieldsXDMF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_58viewFieldsXDMF}, {"viewXDMF", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61viewXDMF, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_60viewXDMF}, {"sortGetAccess", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63sortGetAccess, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_62sortGetAccess}, {"sortRestoreAccess", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65sortRestoreAccess, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_64sortRestoreAccess}, {"sortGetPointsPerCell", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67sortGetPointsPerCell, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_66sortGetPointsPerCell}, {"sortGetNumberOfPointsPerCell", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69sortGetNumberOfPointsPerCell, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_68sortGetNumberOfPointsPerCell}, {"sortGetIsValid", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetIsValid, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_70sortGetIsValid}, {"sortGetSizes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortGetSizes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_72sortGetSizes}, {"projectFields", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75projectFields, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_74projectFields}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_8petsc4py_5PETSc_DMSwarm = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.DMSwarm", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc_Object, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc_Object, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_8petsc4py_5PETSc_DMSwarm, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc_DMSwarm, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[8]; static int __pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = 0; static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)))) { o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator]; memset(o, 0, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_cls); Py_CLEAR(p->__pyx_v_klass); Py_CLEAR(p->__pyx_v_name); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)))) { __pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator++] = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o; if (p->__pyx_v_cls) { e = (*v)(((PyObject *)p->__pyx_v_cls), a); if (e) return e; } if (p->__pyx_v_klass) { e = (*v)(p->__pyx_v_klass, a); if (e) return e; } if (p->__pyx_v_name) { e = (*v)(p->__pyx_v_name, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o; tmp = ((PyObject*)p->__pyx_v_cls); p->__pyx_v_cls = ((PyTypeObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_klass); p->__pyx_v_klass = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_name); p->__pyx_v_name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.__pyx_scope_struct__EventDecorator", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[8]; static int __pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = 0; static PyObject *__pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)))) { o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator]; memset(o, 0, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else { o = (*t->tp_alloc)(t, 0); if (unlikely(!o)) return 0; } return o; } static void __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyObject *o) { struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_func); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)))) { __pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator++] = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_func) { e = (*v)(p->__pyx_v_func, a); if (e) return e; } return 0; } static int __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct_1_decorator(PyObject *o) { PyObject* tmp; struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *p = (struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o; tmp = ((PyObject*)p->__pyx_outer_scope); p->__pyx_outer_scope = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_func); p->__pyx_v_func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.__pyx_scope_struct_1_decorator", /*tp_name*/ sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_traverse*/ __pyx_tp_clear_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ 0, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_array __pyx_vtable_array; static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_array_obj *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_array_obj *)o); p->__pyx_vtab = __pyx_vtabptr_array; p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_array(PyObject *o) { struct __pyx_array_obj *p = (struct __pyx_array_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_array___dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->mode); Py_CLEAR(p->_format); (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_array___setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) { PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n); if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); v = __pyx_array___getattr__(o, n); } return v; } static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o); } static PyMethodDef __pyx_methods_array[] = { {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_array[] = { {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_array = { __pyx_array___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_array, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_array = { __pyx_array___len__, /*mp_length*/ __pyx_array___getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_array = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_array_getbuffer, /*bf_getbuffer*/ 0, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type___pyx_array = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.array", /*tp_name*/ sizeof(struct __pyx_array_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_array, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_array, /*tp_as_sequence*/ &__pyx_tp_as_mapping_array, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ __pyx_tp_getattro_array, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_array, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_array, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_array, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_array, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_MemviewEnum_obj *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_MemviewEnum_obj *)o); p->name = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_Enum(PyObject *o) { struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->name); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) { int e; struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; if (p->name) { e = (*v)(p->name, a); if (e) return e; } return 0; } static int __pyx_tp_clear_Enum(PyObject *o) { PyObject* tmp; struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o; tmp = ((PyObject*)p->name); p->name = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_Enum[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type___pyx_MemviewEnum = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.Enum", /*tp_name*/ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_Enum, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_MemviewEnum___repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_Enum, /*tp_traverse*/ __pyx_tp_clear_Enum, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_Enum, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_MemviewEnum___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_Enum, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview; static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_memoryview_obj *p; PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; p = ((struct __pyx_memoryview_obj *)o); p->__pyx_vtab = __pyx_vtabptr_memoryview; p->obj = Py_None; Py_INCREF(Py_None); p->_size = Py_None; Py_INCREF(Py_None); p->_array_interface = Py_None; Py_INCREF(Py_None); p->view.obj = NULL; if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_memoryview(PyObject *o) { struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_memoryview___dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->obj); Py_CLEAR(p->_size); Py_CLEAR(p->_array_interface); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) { int e; struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; if (p->obj) { e = (*v)(p->obj, a); if (e) return e; } if (p->_size) { e = (*v)(p->_size, a); if (e) return e; } if (p->_array_interface) { e = (*v)(p->_array_interface, a); if (e) return e; } if (p->view.obj) { e = (*v)(p->view.obj, a); if (e) return e; } return 0; } static int __pyx_tp_clear_memoryview(PyObject *o) { PyObject* tmp; struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o; tmp = ((PyObject*)p->obj); p->obj = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_size); p->_size = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_array_interface); p->_array_interface = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); Py_CLEAR(p->view.obj); return 0; } static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) { if (v) { return __pyx_memoryview___setitem__(o, i, v); } else { PyErr_Format(PyExc_NotImplementedError, "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name); return -1; } } static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o); } static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o); } static PyMethodDef __pyx_methods_memoryview[] = { {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0}, {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0}, {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0}, {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_memoryview[] = { {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0}, {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0}, {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0}, {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0}, {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0}, {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0}, {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0}, {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0}, {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PySequenceMethods __pyx_tp_as_sequence_memoryview = { __pyx_memoryview___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_memoryview, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_memoryview = { __pyx_memoryview___len__, /*mp_length*/ __pyx_memoryview___getitem__, /*mp_subscript*/ __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_memoryview = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif __pyx_memoryview_getbuffer, /*bf_getbuffer*/ 0, /*bf_releasebuffer*/ }; static PyTypeObject __pyx_type___pyx_memoryview = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc.memoryview", /*tp_name*/ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_memoryview___repr__, /*tp_repr*/ 0, /*tp_as_number*/ &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/ &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ __pyx_memoryview___str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_memoryview, /*tp_traverse*/ __pyx_tp_clear_memoryview, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_memoryview, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_memoryview, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_memoryview, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice; static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_memoryviewslice_obj *p; PyObject *o = __pyx_tp_new_memoryview(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_memoryviewslice_obj *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice; p->from_object = Py_None; Py_INCREF(Py_None); p->from_slice.memview = NULL; return o; } static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) { struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); __pyx_memoryviewslice___dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } Py_CLEAR(p->from_object); PyObject_GC_Track(o); __pyx_tp_dealloc_memoryview(o); } static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) { int e; struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e; if (p->from_object) { e = (*v)(p->from_object, a); if (e) return e; } return 0; } static int __pyx_tp_clear__memoryviewslice(PyObject *o) { PyObject* tmp; struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o; __pyx_tp_clear_memoryview(o); tmp = ((PyObject*)p->from_object); p->from_object = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); __PYX_XDEC_MEMVIEW(&p->from_slice, 1); return 0; } static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o); } static PyMethodDef __pyx_methods__memoryviewslice[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = { {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type___pyx_memoryviewslice = { PyVarObject_HEAD_INIT(0, 0) "petsc4py.PETSc._memoryviewslice", /*tp_name*/ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_memoryview___repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY __pyx_memoryview___str__, /*tp_str*/ #else 0, /*tp_str*/ #endif 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "Internal class for passing memoryview slices to Python", /*tp_doc*/ __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/ __pyx_tp_clear__memoryviewslice, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods__memoryviewslice, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets__memoryviewslice, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new__memoryviewslice, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_PETSc(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_PETSc}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "PETSc", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ (freefunc)__pyx_module_cleanup /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, {&__pyx_n_s_A11, __pyx_k_A11, sizeof(__pyx_k_A11), 0, 0, 1, 1}, {&__pyx_n_s_ADD, __pyx_k_ADD, sizeof(__pyx_k_ADD), 0, 0, 1, 1}, {&__pyx_n_s_ADDITIVE, __pyx_k_ADDITIVE, sizeof(__pyx_k_ADDITIVE), 0, 0, 1, 1}, {&__pyx_n_s_ADD_ALL, __pyx_k_ADD_ALL, sizeof(__pyx_k_ADD_ALL), 0, 0, 1, 1}, {&__pyx_n_s_ADD_ALL_VALUES, __pyx_k_ADD_ALL_VALUES, sizeof(__pyx_k_ADD_ALL_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_ADD_BC, __pyx_k_ADD_BC, sizeof(__pyx_k_ADD_BC), 0, 0, 1, 1}, {&__pyx_n_s_ADD_BC_VALUES, __pyx_k_ADD_BC_VALUES, sizeof(__pyx_k_ADD_BC_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_ADD_VALUES, __pyx_k_ADD_VALUES, sizeof(__pyx_k_ADD_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_ADIOS, __pyx_k_ADIOS, sizeof(__pyx_k_ADIOS), 0, 0, 1, 1}, {&__pyx_n_s_ADIOS2, __pyx_k_ADIOS2, sizeof(__pyx_k_ADIOS2), 0, 0, 1, 1}, {&__pyx_n_s_ADMM, __pyx_k_ADMM, sizeof(__pyx_k_ADMM), 0, 0, 1, 1}, {&__pyx_n_s_ADVANCED, __pyx_k_ADVANCED, sizeof(__pyx_k_ADVANCED), 0, 0, 1, 1}, {&__pyx_n_s_AGG, __pyx_k_AGG, sizeof(__pyx_k_AGG), 0, 0, 1, 1}, {&__pyx_n_s_AIJ, __pyx_k_AIJ, sizeof(__pyx_k_AIJ), 0, 0, 1, 1}, {&__pyx_n_s_AIJCRL, __pyx_k_AIJCRL, sizeof(__pyx_k_AIJCRL), 0, 0, 1, 1}, {&__pyx_n_s_AIJCUSPARSE, __pyx_k_AIJCUSPARSE, sizeof(__pyx_k_AIJCUSPARSE), 0, 0, 1, 1}, {&__pyx_n_s_AIJMKL, __pyx_k_AIJMKL, sizeof(__pyx_k_AIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_AIJPERM, __pyx_k_AIJPERM, sizeof(__pyx_k_AIJPERM), 0, 0, 1, 1}, {&__pyx_n_s_AIJSELL, __pyx_k_AIJSELL, sizeof(__pyx_k_AIJSELL), 0, 0, 1, 1}, {&__pyx_n_s_AIJVIENNACL, __pyx_k_AIJVIENNACL, sizeof(__pyx_k_AIJVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_ALLGATHER, __pyx_k_ALLGATHER, sizeof(__pyx_k_ALLGATHER), 0, 0, 1, 1}, {&__pyx_n_s_ALLGATHERV, __pyx_k_ALLGATHERV, sizeof(__pyx_k_ALLGATHERV), 0, 0, 1, 1}, {&__pyx_n_s_ALLTOALL, __pyx_k_ALLTOALL, sizeof(__pyx_k_ALLTOALL), 0, 0, 1, 1}, {&__pyx_n_s_ALMM, __pyx_k_ALMM, sizeof(__pyx_k_ALMM), 0, 0, 1, 1}, {&__pyx_n_s_ALPHA, __pyx_k_ALPHA, sizeof(__pyx_k_ALPHA), 0, 0, 1, 1}, {&__pyx_n_s_ALPHA2, __pyx_k_ALPHA2, sizeof(__pyx_k_ALPHA2), 0, 0, 1, 1}, {&__pyx_n_s_ALWAYS, __pyx_k_ALWAYS, sizeof(__pyx_k_ALWAYS), 0, 0, 1, 1}, {&__pyx_n_s_AMD, __pyx_k_AMD, sizeof(__pyx_k_AMD), 0, 0, 1, 1}, {&__pyx_n_s_ANDERSON, __pyx_k_ANDERSON, sizeof(__pyx_k_ANDERSON), 0, 0, 1, 1}, {&__pyx_n_s_AO, __pyx_k_AO, sizeof(__pyx_k_AO), 0, 0, 1, 1}, {&__pyx_n_s_AOType, __pyx_k_AOType, sizeof(__pyx_k_AOType), 0, 0, 1, 1}, {&__pyx_n_s_APPEND, __pyx_k_APPEND, sizeof(__pyx_k_APPEND), 0, 0, 1, 1}, {&__pyx_n_s_APPEND_UPDATE, __pyx_k_APPEND_UPDATE, sizeof(__pyx_k_APPEND_UPDATE), 0, 0, 1, 1}, {&__pyx_n_s_APPLY_LOWER, __pyx_k_APPLY_LOWER, sizeof(__pyx_k_APPLY_LOWER), 0, 0, 1, 1}, {&__pyx_n_s_APPLY_UPPER, __pyx_k_APPLY_UPPER, sizeof(__pyx_k_APPLY_UPPER), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX, __pyx_k_ARKIMEX, sizeof(__pyx_k_ARKIMEX), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX1BEE, __pyx_k_ARKIMEX1BEE, sizeof(__pyx_k_ARKIMEX1BEE), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX2C, __pyx_k_ARKIMEX2C, sizeof(__pyx_k_ARKIMEX2C), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX2D, __pyx_k_ARKIMEX2D, sizeof(__pyx_k_ARKIMEX2D), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX2E, __pyx_k_ARKIMEX2E, sizeof(__pyx_k_ARKIMEX2E), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX3, __pyx_k_ARKIMEX3, sizeof(__pyx_k_ARKIMEX3), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX4, __pyx_k_ARKIMEX4, sizeof(__pyx_k_ARKIMEX4), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEX5, __pyx_k_ARKIMEX5, sizeof(__pyx_k_ARKIMEX5), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXA2, __pyx_k_ARKIMEXA2, sizeof(__pyx_k_ARKIMEXA2), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXARS122, __pyx_k_ARKIMEXARS122, sizeof(__pyx_k_ARKIMEXARS122), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXARS443, __pyx_k_ARKIMEXARS443, sizeof(__pyx_k_ARKIMEXARS443), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXBPR3, __pyx_k_ARKIMEXBPR3, sizeof(__pyx_k_ARKIMEXBPR3), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXL2, __pyx_k_ARKIMEXL2, sizeof(__pyx_k_ARKIMEXL2), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXPRSSP2, __pyx_k_ARKIMEXPRSSP2, sizeof(__pyx_k_ARKIMEXPRSSP2), 0, 0, 1, 1}, {&__pyx_n_s_ARKIMEXType, __pyx_k_ARKIMEXType, sizeof(__pyx_k_ARKIMEXType), 0, 0, 1, 1}, {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_COMMON, __pyx_k_ASCII_COMMON, sizeof(__pyx_k_ASCII_COMMON), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_CSV, __pyx_k_ASCII_CSV, sizeof(__pyx_k_ASCII_CSV), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_DENSE, __pyx_k_ASCII_DENSE, sizeof(__pyx_k_ASCII_DENSE), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_FACTOR_INFO, __pyx_k_ASCII_FACTOR_INFO, sizeof(__pyx_k_ASCII_FACTOR_INFO), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_GLVIS, __pyx_k_ASCII_GLVIS, sizeof(__pyx_k_ASCII_GLVIS), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_IMPL, __pyx_k_ASCII_IMPL, sizeof(__pyx_k_ASCII_IMPL), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_INDEX, __pyx_k_ASCII_INDEX, sizeof(__pyx_k_ASCII_INDEX), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_INFO, __pyx_k_ASCII_INFO, sizeof(__pyx_k_ASCII_INFO), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_INFO_DETAIL, __pyx_k_ASCII_INFO_DETAIL, sizeof(__pyx_k_ASCII_INFO_DETAIL), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_LATEX, __pyx_k_ASCII_LATEX, sizeof(__pyx_k_ASCII_LATEX), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_MATHEMATICA, __pyx_k_ASCII_MATHEMATICA, sizeof(__pyx_k_ASCII_MATHEMATICA), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_MATLAB, __pyx_k_ASCII_MATLAB, sizeof(__pyx_k_ASCII_MATLAB), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_MATRIXMARKET, __pyx_k_ASCII_MATRIXMARKET, sizeof(__pyx_k_ASCII_MATRIXMARKET), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_PCICE, __pyx_k_ASCII_PCICE, sizeof(__pyx_k_ASCII_PCICE), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_PYTHON, __pyx_k_ASCII_PYTHON, sizeof(__pyx_k_ASCII_PYTHON), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_SYMMODU, __pyx_k_ASCII_SYMMODU, sizeof(__pyx_k_ASCII_SYMMODU), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_VTK, __pyx_k_ASCII_VTK, sizeof(__pyx_k_ASCII_VTK), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_VTK_CELL, __pyx_k_ASCII_VTK_CELL, sizeof(__pyx_k_ASCII_VTK_CELL), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_VTK_COORDS, __pyx_k_ASCII_VTK_COORDS, sizeof(__pyx_k_ASCII_VTK_COORDS), 0, 0, 1, 1}, {&__pyx_n_s_ASCII_XML, __pyx_k_ASCII_XML, sizeof(__pyx_k_ASCII_XML), 0, 0, 1, 1}, {&__pyx_n_s_ASFLS, __pyx_k_ASFLS, sizeof(__pyx_k_ASFLS), 0, 0, 1, 1}, {&__pyx_n_s_ASILS, __pyx_k_ASILS, sizeof(__pyx_k_ASILS), 0, 0, 1, 1}, {&__pyx_n_s_ASM, __pyx_k_ASM, sizeof(__pyx_k_ASM), 0, 0, 1, 1}, {&__pyx_n_s_ASMType, __pyx_k_ASMType, sizeof(__pyx_k_ASMType), 0, 0, 1, 1}, {&__pyx_n_s_ASPIN, __pyx_k_ASPIN, sizeof(__pyx_k_ASPIN), 0, 0, 1, 1}, {&__pyx_n_s_AU, __pyx_k_AU, sizeof(__pyx_k_AU), 0, 0, 1, 1}, {&__pyx_kp_s_A_matrix_with_d_rows_requires_a, __pyx_k_A_matrix_with_d_rows_requires_a, sizeof(__pyx_k_A_matrix_with_d_rows_requires_a), 0, 0, 1, 0}, {&__pyx_n_s_AssemblyType, __pyx_k_AssemblyType, sizeof(__pyx_k_AssemblyType), 0, 0, 1, 1}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, {&__pyx_n_s_BACK, __pyx_k_BACK, sizeof(__pyx_k_BACK), 0, 0, 1, 1}, {&__pyx_n_s_BACKWARD_SWEEP, __pyx_k_BACKWARD_SWEEP, sizeof(__pyx_k_BACKWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_BACK_DOWN, __pyx_k_BACK_DOWN, sizeof(__pyx_k_BACK_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_BACK_DOWN_LEFT, __pyx_k_BACK_DOWN_LEFT, sizeof(__pyx_k_BACK_DOWN_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_DOWN_RIGHT, __pyx_k_BACK_DOWN_RIGHT, sizeof(__pyx_k_BACK_DOWN_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_LEFT, __pyx_k_BACK_LEFT, sizeof(__pyx_k_BACK_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_RIGHT, __pyx_k_BACK_RIGHT, sizeof(__pyx_k_BACK_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_UP, __pyx_k_BACK_UP, sizeof(__pyx_k_BACK_UP), 0, 0, 1, 1}, {&__pyx_n_s_BACK_UP_LEFT, __pyx_k_BACK_UP_LEFT, sizeof(__pyx_k_BACK_UP_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_BACK_UP_RIGHT, __pyx_k_BACK_UP_RIGHT, sizeof(__pyx_k_BACK_UP_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_BAIJ, __pyx_k_BAIJ, sizeof(__pyx_k_BAIJ), 0, 0, 1, 1}, {&__pyx_n_s_BAIJMKL, __pyx_k_BAIJMKL, sizeof(__pyx_k_BAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_BAS, __pyx_k_BAS, sizeof(__pyx_k_BAS), 0, 0, 1, 1}, {&__pyx_n_s_BASIC, __pyx_k_BASIC, sizeof(__pyx_k_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_BASICSYMPLECTIC, __pyx_k_BASICSYMPLECTIC, sizeof(__pyx_k_BASICSYMPLECTIC), 0, 0, 1, 1}, {&__pyx_n_s_BCGS, __pyx_k_BCGS, sizeof(__pyx_k_BCGS), 0, 0, 1, 1}, {&__pyx_n_s_BCGSL, __pyx_k_BCGSL, sizeof(__pyx_k_BCGSL), 0, 0, 1, 1}, {&__pyx_n_s_BDDC, __pyx_k_BDDC, sizeof(__pyx_k_BDDC), 0, 0, 1, 1}, {&__pyx_n_s_BDF, __pyx_k_BDF, sizeof(__pyx_k_BDF), 0, 0, 1, 1}, {&__pyx_n_s_BE, __pyx_k_BE, sizeof(__pyx_k_BE), 0, 0, 1, 1}, {&__pyx_n_s_BEULER, __pyx_k_BEULER, sizeof(__pyx_k_BEULER), 0, 0, 1, 1}, {&__pyx_n_s_BFBT, __pyx_k_BFBT, sizeof(__pyx_k_BFBT), 0, 0, 1, 1}, {&__pyx_n_s_BICG, __pyx_k_BICG, sizeof(__pyx_k_BICG), 0, 0, 1, 1}, {&__pyx_n_s_BINARY, __pyx_k_BINARY, sizeof(__pyx_k_BINARY), 0, 0, 1, 1}, {&__pyx_n_s_BINARY_MATLAB, __pyx_k_BINARY_MATLAB, sizeof(__pyx_k_BINARY_MATLAB), 0, 0, 1, 1}, {&__pyx_n_s_BJACOBI, __pyx_k_BJACOBI, sizeof(__pyx_k_BJACOBI), 0, 0, 1, 1}, {&__pyx_n_s_BLMVM, __pyx_k_BLMVM, sizeof(__pyx_k_BLMVM), 0, 0, 1, 1}, {&__pyx_n_s_BLOCK, __pyx_k_BLOCK, sizeof(__pyx_k_BLOCK), 0, 0, 1, 1}, {&__pyx_n_s_BLOCKMAT, __pyx_k_BLOCKMAT, sizeof(__pyx_k_BLOCKMAT), 0, 0, 1, 1}, {&__pyx_n_s_BMRM, __pyx_k_BMRM, sizeof(__pyx_k_BMRM), 0, 0, 1, 1}, {&__pyx_n_s_BNCG, __pyx_k_BNCG, sizeof(__pyx_k_BNCG), 0, 0, 1, 1}, {&__pyx_n_s_BNLS, __pyx_k_BNLS, sizeof(__pyx_k_BNLS), 0, 0, 1, 1}, {&__pyx_n_s_BNTL, __pyx_k_BNTL, sizeof(__pyx_k_BNTL), 0, 0, 1, 1}, {&__pyx_n_s_BNTR, __pyx_k_BNTR, sizeof(__pyx_k_BNTR), 0, 0, 1, 1}, {&__pyx_n_s_BOX, __pyx_k_BOX, sizeof(__pyx_k_BOX), 0, 0, 1, 1}, {&__pyx_n_s_BQNKLS, __pyx_k_BQNKLS, sizeof(__pyx_k_BQNKLS), 0, 0, 1, 1}, {&__pyx_n_s_BQNKTL, __pyx_k_BQNKTL, sizeof(__pyx_k_BQNKTL), 0, 0, 1, 1}, {&__pyx_n_s_BQNKTR, __pyx_k_BQNKTR, sizeof(__pyx_k_BQNKTR), 0, 0, 1, 1}, {&__pyx_n_s_BQNLS, __pyx_k_BQNLS, sizeof(__pyx_k_BQNLS), 0, 0, 1, 1}, {&__pyx_n_s_BQPIP, __pyx_k_BQPIP, sizeof(__pyx_k_BQPIP), 0, 0, 1, 1}, {&__pyx_n_s_BRGN, __pyx_k_BRGN, sizeof(__pyx_k_BRGN), 0, 0, 1, 1}, {&__pyx_n_s_Barrier, __pyx_k_Barrier, sizeof(__pyx_k_Barrier), 0, 0, 1, 1}, {&__pyx_n_s_BoundaryType, __pyx_k_BoundaryType, sizeof(__pyx_k_BoundaryType), 0, 0, 1, 1}, {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0}, {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_n_s_CG, __pyx_k_CG, sizeof(__pyx_k_CG), 0, 0, 1, 1}, {&__pyx_n_s_CGLS, __pyx_k_CGLS, sizeof(__pyx_k_CGLS), 0, 0, 1, 1}, {&__pyx_n_s_CGNE, __pyx_k_CGNE, sizeof(__pyx_k_CGNE), 0, 0, 1, 1}, {&__pyx_n_s_CGS, __pyx_k_CGS, sizeof(__pyx_k_CGS), 0, 0, 1, 1}, {&__pyx_n_s_CHACO, __pyx_k_CHACO, sizeof(__pyx_k_CHACO), 0, 0, 1, 1}, {&__pyx_n_s_CHEBYSHEV, __pyx_k_CHEBYSHEV, sizeof(__pyx_k_CHEBYSHEV), 0, 0, 1, 1}, {&__pyx_n_s_CHOLESKY, __pyx_k_CHOLESKY, sizeof(__pyx_k_CHOLESKY), 0, 0, 1, 1}, {&__pyx_n_s_CHOLMOD, __pyx_k_CHOLMOD, sizeof(__pyx_k_CHOLMOD), 0, 0, 1, 1}, {&__pyx_n_s_CHOWILUVIENNACL, __pyx_k_CHOWILUVIENNACL, sizeof(__pyx_k_CHOWILUVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_CLASSICAL, __pyx_k_CLASSICAL, sizeof(__pyx_k_CLASSICAL), 0, 0, 1, 1}, {&__pyx_n_s_CN, __pyx_k_CN, sizeof(__pyx_k_CN), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_BASIC, __pyx_k_COLLECT_BASIC, sizeof(__pyx_k_COLLECT_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_DMDABOUNDINGBOX, __pyx_k_COLLECT_DMDABOUNDINGBOX, sizeof(__pyx_k_COLLECT_DMDABOUNDINGBOX), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_GENERAL, __pyx_k_COLLECT_GENERAL, sizeof(__pyx_k_COLLECT_GENERAL), 0, 0, 1, 1}, {&__pyx_n_s_COLLECT_USER, __pyx_k_COLLECT_USER, sizeof(__pyx_k_COLLECT_USER), 0, 0, 1, 1}, {&__pyx_n_s_COMM_NULL, __pyx_k_COMM_NULL, sizeof(__pyx_k_COMM_NULL), 0, 0, 1, 1}, {&__pyx_n_s_COMM_SELF, __pyx_k_COMM_SELF, sizeof(__pyx_k_COMM_SELF), 0, 0, 1, 1}, {&__pyx_n_s_COMM_WORLD, __pyx_k_COMM_WORLD, sizeof(__pyx_k_COMM_WORLD), 0, 0, 1, 1}, {&__pyx_n_s_COMPOSITE, __pyx_k_COMPOSITE, sizeof(__pyx_k_COMPOSITE), 0, 0, 1, 1}, {&__pyx_n_s_CONSTANTDIAGONAL, __pyx_k_CONSTANTDIAGONAL, sizeof(__pyx_k_CONSTANTDIAGONAL), 0, 0, 1, 1}, {&__pyx_n_s_CONTINUE_ITERATING, __pyx_k_CONTINUE_ITERATING, sizeof(__pyx_k_CONTINUE_ITERATING), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ATOL, __pyx_k_CONVERGED_ATOL, sizeof(__pyx_k_CONVERGED_ATOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ATOL_NORMAL, __pyx_k_CONVERGED_ATOL_NORMAL, sizeof(__pyx_k_CONVERGED_ATOL_NORMAL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_CG_CONSTRAINED, __pyx_k_CONVERGED_CG_CONSTRAINED, sizeof(__pyx_k_CONVERGED_CG_CONSTRAINED), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_CG_NEG_CURVE, __pyx_k_CONVERGED_CG_NEG_CURVE, sizeof(__pyx_k_CONVERGED_CG_NEG_CURVE), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_EVENT, __pyx_k_CONVERGED_EVENT, sizeof(__pyx_k_CONVERGED_EVENT), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_FNORM_ABS, __pyx_k_CONVERGED_FNORM_ABS, sizeof(__pyx_k_CONVERGED_FNORM_ABS), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_FNORM_RELATIVE, __pyx_k_CONVERGED_FNORM_RELATIVE, sizeof(__pyx_k_CONVERGED_FNORM_RELATIVE), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_GATOL, __pyx_k_CONVERGED_GATOL, sizeof(__pyx_k_CONVERGED_GATOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_GRTOL, __pyx_k_CONVERGED_GRTOL, sizeof(__pyx_k_CONVERGED_GRTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_GTTOL, __pyx_k_CONVERGED_GTTOL, sizeof(__pyx_k_CONVERGED_GTTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_HAPPY_BREAKDOWN, __pyx_k_CONVERGED_HAPPY_BREAKDOWN, sizeof(__pyx_k_CONVERGED_HAPPY_BREAKDOWN), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ITERATING, __pyx_k_CONVERGED_ITERATING, sizeof(__pyx_k_CONVERGED_ITERATING), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_ITS, __pyx_k_CONVERGED_ITS, sizeof(__pyx_k_CONVERGED_ITS), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_MINF, __pyx_k_CONVERGED_MINF, sizeof(__pyx_k_CONVERGED_MINF), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_RTOL, __pyx_k_CONVERGED_RTOL, sizeof(__pyx_k_CONVERGED_RTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_RTOL_NORMAL, __pyx_k_CONVERGED_RTOL_NORMAL, sizeof(__pyx_k_CONVERGED_RTOL_NORMAL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_SNORM_RELATIVE, __pyx_k_CONVERGED_SNORM_RELATIVE, sizeof(__pyx_k_CONVERGED_SNORM_RELATIVE), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_STEPTOL, __pyx_k_CONVERGED_STEPTOL, sizeof(__pyx_k_CONVERGED_STEPTOL), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_STEP_LENGTH, __pyx_k_CONVERGED_STEP_LENGTH, sizeof(__pyx_k_CONVERGED_STEP_LENGTH), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_TIME, __pyx_k_CONVERGED_TIME, sizeof(__pyx_k_CONVERGED_TIME), 0, 0, 1, 1}, {&__pyx_n_s_CONVERGED_USER, __pyx_k_CONVERGED_USER, sizeof(__pyx_k_CONVERGED_USER), 0, 0, 1, 1}, {&__pyx_n_s_CP, __pyx_k_CP, sizeof(__pyx_k_CP), 0, 0, 1, 1}, {&__pyx_n_s_CR, __pyx_k_CR, sizeof(__pyx_k_CR), 0, 0, 1, 1}, {&__pyx_n_s_CRANK_NICOLSON, __pyx_k_CRANK_NICOLSON, sizeof(__pyx_k_CRANK_NICOLSON), 0, 0, 1, 1}, {&__pyx_n_s_CUDA, __pyx_k_CUDA, sizeof(__pyx_k_CUDA), 0, 0, 1, 1}, {&__pyx_n_s_CUSPARSE, __pyx_k_CUSPARSE, sizeof(__pyx_k_CUSPARSE), 0, 0, 1, 1}, {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0}, {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0}, {&__pyx_n_s_Class, __pyx_k_Class, sizeof(__pyx_k_Class), 0, 0, 1, 1}, {&__pyx_n_s_Clone, __pyx_k_Clone, sizeof(__pyx_k_Clone), 0, 0, 1, 1}, {&__pyx_n_s_CollectType, __pyx_k_CollectType, sizeof(__pyx_k_CollectType), 0, 0, 1, 1}, {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1}, {&__pyx_n_s_ComplexType, __pyx_k_ComplexType, sizeof(__pyx_k_ComplexType), 0, 0, 1, 1}, {&__pyx_n_s_CompositeType, __pyx_k_CompositeType, sizeof(__pyx_k_CompositeType), 0, 0, 1, 1}, {&__pyx_n_s_ConvergedReason, __pyx_k_ConvergedReason, sizeof(__pyx_k_ConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, {&__pyx_n_s_DA, __pyx_k_DA, sizeof(__pyx_k_DA), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEX1, __pyx_k_DAE_IMPLICIT_INDEX1, sizeof(__pyx_k_DAE_IMPLICIT_INDEX1), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEX2, __pyx_k_DAE_IMPLICIT_INDEX2, sizeof(__pyx_k_DAE_IMPLICIT_INDEX2), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEX3, __pyx_k_DAE_IMPLICIT_INDEX3, sizeof(__pyx_k_DAE_IMPLICIT_INDEX3), 0, 0, 1, 1}, {&__pyx_n_s_DAE_IMPLICIT_INDEXHI, __pyx_k_DAE_IMPLICIT_INDEXHI, sizeof(__pyx_k_DAE_IMPLICIT_INDEXHI), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1, __pyx_k_DAE_SEMI_EXPLICIT_INDEX1, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEX1), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2, __pyx_k_DAE_SEMI_EXPLICIT_INDEX2, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEX2), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3, __pyx_k_DAE_SEMI_EXPLICIT_INDEX3, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEX3), 0, 0, 1, 1}, {&__pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI, __pyx_k_DAE_SEMI_EXPLICIT_INDEXHI, sizeof(__pyx_k_DAE_SEMI_EXPLICIT_INDEXHI), 0, 0, 1, 1}, {&__pyx_n_s_DECIDE, __pyx_k_DECIDE, sizeof(__pyx_k_DECIDE), 0, 0, 1, 1}, {&__pyx_n_s_DEFAULT, __pyx_k_DEFAULT, sizeof(__pyx_k_DEFAULT), 0, 0, 1, 1}, {&__pyx_n_s_DEFLATION, __pyx_k_DEFLATION, sizeof(__pyx_k_DEFLATION), 0, 0, 1, 1}, {&__pyx_n_s_DENSE, __pyx_k_DENSE, sizeof(__pyx_k_DENSE), 0, 0, 1, 1}, {&__pyx_n_s_DETERMINE, __pyx_k_DETERMINE, sizeof(__pyx_k_DETERMINE), 0, 0, 1, 1}, {&__pyx_n_s_DGMRES, __pyx_k_DGMRES, sizeof(__pyx_k_DGMRES), 0, 0, 1, 1}, {&__pyx_n_s_DIAG, __pyx_k_DIAG, sizeof(__pyx_k_DIAG), 0, 0, 1, 1}, {&__pyx_n_s_DIFFERENT, __pyx_k_DIFFERENT, sizeof(__pyx_k_DIFFERENT), 0, 0, 1, 1}, {&__pyx_n_s_DIFFERENT_NONZERO_PATTERN, __pyx_k_DIFFERENT_NONZERO_PATTERN, sizeof(__pyx_k_DIFFERENT_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_DIFFERENT_NZ, __pyx_k_DIFFERENT_NZ, sizeof(__pyx_k_DIFFERENT_NZ), 0, 0, 1, 1}, {&__pyx_n_s_DISCGRAD, __pyx_k_DISCGRAD, sizeof(__pyx_k_DISCGRAD), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_BREAKDOWN, __pyx_k_DIVERGED_BREAKDOWN, sizeof(__pyx_k_DIVERGED_BREAKDOWN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_BREAKDOWN_BICG, __pyx_k_DIVERGED_BREAKDOWN_BICG, sizeof(__pyx_k_DIVERGED_BREAKDOWN_BICG), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_DTOL, __pyx_k_DIVERGED_DTOL, sizeof(__pyx_k_DIVERGED_DTOL), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_FNORM_NAN, __pyx_k_DIVERGED_FNORM_NAN, sizeof(__pyx_k_DIVERGED_FNORM_NAN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_FUNCTION_COUNT, __pyx_k_DIVERGED_FUNCTION_COUNT, sizeof(__pyx_k_DIVERGED_FUNCTION_COUNT), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_FUNCTION_DOMAIN, __pyx_k_DIVERGED_FUNCTION_DOMAIN, sizeof(__pyx_k_DIVERGED_FUNCTION_DOMAIN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_INDEFINITE_MAT, __pyx_k_DIVERGED_INDEFINITE_MAT, sizeof(__pyx_k_DIVERGED_INDEFINITE_MAT), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_INDEFINITE_PC, __pyx_k_DIVERGED_INDEFINITE_PC, sizeof(__pyx_k_DIVERGED_INDEFINITE_PC), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_INNER, __pyx_k_DIVERGED_INNER, sizeof(__pyx_k_DIVERGED_INNER), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_JACOBIAN_DOMAIN, __pyx_k_DIVERGED_JACOBIAN_DOMAIN, sizeof(__pyx_k_DIVERGED_JACOBIAN_DOMAIN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LINEAR_SOLVE, __pyx_k_DIVERGED_LINEAR_SOLVE, sizeof(__pyx_k_DIVERGED_LINEAR_SOLVE), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LINE_SEARCH, __pyx_k_DIVERGED_LINE_SEARCH, sizeof(__pyx_k_DIVERGED_LINE_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LOCAL_MIN, __pyx_k_DIVERGED_LOCAL_MIN, sizeof(__pyx_k_DIVERGED_LOCAL_MIN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_LS_FAILURE, __pyx_k_DIVERGED_LS_FAILURE, sizeof(__pyx_k_DIVERGED_LS_FAILURE), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_MAXFCN, __pyx_k_DIVERGED_MAXFCN, sizeof(__pyx_k_DIVERGED_MAXFCN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_MAXITS, __pyx_k_DIVERGED_MAXITS, sizeof(__pyx_k_DIVERGED_MAXITS), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_MAX_IT, __pyx_k_DIVERGED_MAX_IT, sizeof(__pyx_k_DIVERGED_MAX_IT), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NAN, __pyx_k_DIVERGED_NAN, sizeof(__pyx_k_DIVERGED_NAN), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NANORINF, __pyx_k_DIVERGED_NANORINF, sizeof(__pyx_k_DIVERGED_NANORINF), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NONLINEAR_SOLVE, __pyx_k_DIVERGED_NONLINEAR_SOLVE, sizeof(__pyx_k_DIVERGED_NONLINEAR_SOLVE), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NONSYMMETRIC, __pyx_k_DIVERGED_NONSYMMETRIC, sizeof(__pyx_k_DIVERGED_NONSYMMETRIC), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_NULL, __pyx_k_DIVERGED_NULL, sizeof(__pyx_k_DIVERGED_NULL), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_PCSETUP_FAILED, __pyx_k_DIVERGED_PCSETUP_FAILED, sizeof(__pyx_k_DIVERGED_PCSETUP_FAILED), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_STEP_REJECTED, __pyx_k_DIVERGED_STEP_REJECTED, sizeof(__pyx_k_DIVERGED_STEP_REJECTED), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_TR_DELTA, __pyx_k_DIVERGED_TR_DELTA, sizeof(__pyx_k_DIVERGED_TR_DELTA), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_TR_REDUCTION, __pyx_k_DIVERGED_TR_REDUCTION, sizeof(__pyx_k_DIVERGED_TR_REDUCTION), 0, 0, 1, 1}, {&__pyx_n_s_DIVERGED_USER, __pyx_k_DIVERGED_USER, sizeof(__pyx_k_DIVERGED_USER), 0, 0, 1, 1}, {&__pyx_n_s_DM, __pyx_k_DM, sizeof(__pyx_k_DM), 0, 0, 1, 1}, {&__pyx_n_s_DMBoundaryType, __pyx_k_DMBoundaryType, sizeof(__pyx_k_DMBoundaryType), 0, 0, 1, 1}, {&__pyx_n_s_DMComposite, __pyx_k_DMComposite, sizeof(__pyx_k_DMComposite), 0, 0, 1, 1}, {&__pyx_n_s_DMComposite_access, __pyx_k_DMComposite_access, sizeof(__pyx_k_DMComposite_access), 0, 0, 1, 1}, {&__pyx_n_s_DMDA, __pyx_k_DMDA, sizeof(__pyx_k_DMDA), 0, 0, 1, 1}, {&__pyx_n_s_DMDAElementType, __pyx_k_DMDAElementType, sizeof(__pyx_k_DMDAElementType), 0, 0, 1, 1}, {&__pyx_n_s_DMDAInterpolationType, __pyx_k_DMDAInterpolationType, sizeof(__pyx_k_DMDAInterpolationType), 0, 0, 1, 1}, {&__pyx_n_s_DMDAStencilType, __pyx_k_DMDAStencilType, sizeof(__pyx_k_DMDAStencilType), 0, 0, 1, 1}, {&__pyx_n_s_DMDA_Vec_array, __pyx_k_DMDA_Vec_array, sizeof(__pyx_k_DMDA_Vec_array), 0, 0, 1, 1}, {&__pyx_n_s_DMLabel, __pyx_k_DMLabel, sizeof(__pyx_k_DMLabel), 0, 0, 1, 1}, {&__pyx_n_s_DMPlex, __pyx_k_DMPlex, sizeof(__pyx_k_DMPlex), 0, 0, 1, 1}, {&__pyx_n_s_DMShell, __pyx_k_DMShell, sizeof(__pyx_k_DMShell), 0, 0, 1, 1}, {&__pyx_n_s_DMStag, __pyx_k_DMStag, sizeof(__pyx_k_DMStag), 0, 0, 1, 1}, {&__pyx_n_s_DMStagStencilLocation, __pyx_k_DMStagStencilLocation, sizeof(__pyx_k_DMStagStencilLocation), 0, 0, 1, 1}, {&__pyx_n_s_DMStagStencilType, __pyx_k_DMStagStencilType, sizeof(__pyx_k_DMStagStencilType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarm, __pyx_k_DMSwarm, sizeof(__pyx_k_DMSwarm), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmCollectType, __pyx_k_DMSwarmCollectType, sizeof(__pyx_k_DMSwarmCollectType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmMigrateType, __pyx_k_DMSwarmMigrateType, sizeof(__pyx_k_DMSwarmMigrateType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmPICLayoutType, __pyx_k_DMSwarmPICLayoutType, sizeof(__pyx_k_DMSwarmPICLayoutType), 0, 0, 1, 1}, {&__pyx_n_s_DMSwarmType, __pyx_k_DMSwarmType, sizeof(__pyx_k_DMSwarmType), 0, 0, 1, 1}, {&__pyx_n_s_DMType, __pyx_k_DMType, sizeof(__pyx_k_DMType), 0, 0, 1, 1}, {&__pyx_n_s_DOF, __pyx_k_DOF, sizeof(__pyx_k_DOF), 0, 0, 1, 1}, {&__pyx_n_s_DOWN, __pyx_k_DOWN, sizeof(__pyx_k_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_DOWN_LEFT, __pyx_k_DOWN_LEFT, sizeof(__pyx_k_DOWN_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_DOWN_RIGHT, __pyx_k_DOWN_RIGHT, sizeof(__pyx_k_DOWN_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_DRAW, __pyx_k_DRAW, sizeof(__pyx_k_DRAW), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_BASIC, __pyx_k_DRAW_BASIC, sizeof(__pyx_k_DRAW_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_CONTOUR, __pyx_k_DRAW_CONTOUR, sizeof(__pyx_k_DRAW_CONTOUR), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_LG, __pyx_k_DRAW_LG, sizeof(__pyx_k_DRAW_LG), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_LG_XRANGE, __pyx_k_DRAW_LG_XRANGE, sizeof(__pyx_k_DRAW_LG_XRANGE), 0, 0, 1, 1}, {&__pyx_n_s_DRAW_PORTS, __pyx_k_DRAW_PORTS, sizeof(__pyx_k_DRAW_PORTS), 0, 0, 1, 1}, {&__pyx_n_s_DROP, __pyx_k_DROP, sizeof(__pyx_k_DROP), 0, 0, 1, 1}, {&__pyx_n_s_DS, __pyx_k_DS, sizeof(__pyx_k_DS), 0, 0, 1, 1}, {&__pyx_n_s_DSType, __pyx_k_DSType, sizeof(__pyx_k_DSType), 0, 0, 1, 1}, {&__pyx_n_s_DUMMY, __pyx_k_DUMMY, sizeof(__pyx_k_DUMMY), 0, 0, 1, 1}, {&__pyx_n_s_DrawSize, __pyx_k_DrawSize, sizeof(__pyx_k_DrawSize), 0, 0, 1, 1}, {&__pyx_n_s_Dup, __pyx_k_Dup, sizeof(__pyx_k_Dup), 0, 0, 1, 1}, {&__pyx_n_s_EIMEX, __pyx_k_EIMEX, sizeof(__pyx_k_EIMEX), 0, 0, 1, 1}, {&__pyx_n_s_EISENSTAT, __pyx_k_EISENSTAT, sizeof(__pyx_k_EISENSTAT), 0, 0, 1, 1}, {&__pyx_n_s_ELEMENT, __pyx_k_ELEMENT, sizeof(__pyx_k_ELEMENT), 0, 0, 1, 1}, {&__pyx_n_s_ELEMENTAL, __pyx_k_ELEMENTAL, sizeof(__pyx_k_ELEMENTAL), 0, 0, 1, 1}, {&__pyx_n_s_ERROR_LOWER_TRIANGULAR, __pyx_k_ERROR_LOWER_TRIANGULAR, sizeof(__pyx_k_ERROR_LOWER_TRIANGULAR), 0, 0, 1, 1}, {&__pyx_n_s_ESSL, __pyx_k_ESSL, sizeof(__pyx_k_ESSL), 0, 0, 1, 1}, {&__pyx_n_s_EULER, __pyx_k_EULER, sizeof(__pyx_k_EULER), 0, 0, 1, 1}, {&__pyx_n_s_EXODUSII, __pyx_k_EXODUSII, sizeof(__pyx_k_EXODUSII), 0, 0, 1, 1}, {&__pyx_n_s_EXOTIC, __pyx_k_EXOTIC, sizeof(__pyx_k_EXOTIC), 0, 0, 1, 1}, {&__pyx_n_s_EXPLICIT, __pyx_k_EXPLICIT, sizeof(__pyx_k_EXPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_ElementType, __pyx_k_ElementType, sizeof(__pyx_k_ElementType), 0, 0, 1, 1}, {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1}, {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0}, {&__pyx_n_s_EquationType, __pyx_k_EquationType, sizeof(__pyx_k_EquationType), 0, 0, 1, 1}, {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1}, {&__pyx_n_s_Error___init, __pyx_k_Error___init, sizeof(__pyx_k_Error___init), 0, 0, 1, 1}, {&__pyx_n_s_Error___nonzero, __pyx_k_Error___nonzero, sizeof(__pyx_k_Error___nonzero), 0, 0, 1, 1}, {&__pyx_n_s_Error___repr, __pyx_k_Error___repr, sizeof(__pyx_k_Error___repr), 0, 0, 1, 1}, {&__pyx_n_s_Error___str, __pyx_k_Error___str, sizeof(__pyx_k_Error___str), 0, 0, 1, 1}, {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1}, {&__pyx_n_s_EventDecorator, __pyx_k_EventDecorator, sizeof(__pyx_k_EventDecorator), 0, 0, 1, 1}, {&__pyx_n_s_EventDecorator_locals_decorator, __pyx_k_EventDecorator_locals_decorator, sizeof(__pyx_k_EventDecorator_locals_decorator), 0, 0, 1, 1}, {&__pyx_n_s_EventDecorator_locals_decorator_2, __pyx_k_EventDecorator_locals_decorator_2, sizeof(__pyx_k_EventDecorator_locals_decorator_2), 0, 0, 1, 1}, {&__pyx_n_s_ExactFinalTime, __pyx_k_ExactFinalTime, sizeof(__pyx_k_ExactFinalTime), 0, 0, 1, 1}, {&__pyx_n_s_ExactFinalTimeOption, __pyx_k_ExactFinalTimeOption, sizeof(__pyx_k_ExactFinalTimeOption), 0, 0, 1, 1}, {&__pyx_kp_s_Expect_a_dltensor_field_pycapsul, __pyx_k_Expect_a_dltensor_field_pycapsul, sizeof(__pyx_k_Expect_a_dltensor_field_pycapsul), 0, 0, 1, 0}, {&__pyx_kp_s_Expect_a_dltensor_or_used_dltens, __pyx_k_Expect_a_dltensor_or_used_dltens, sizeof(__pyx_k_Expect_a_dltensor_or_used_dltens), 0, 0, 1, 0}, {&__pyx_n_s_FAILED, __pyx_k_FAILED, sizeof(__pyx_k_FAILED), 0, 0, 1, 1}, {&__pyx_n_s_FAS, __pyx_k_FAS, sizeof(__pyx_k_FAS), 0, 0, 1, 1}, {&__pyx_n_s_FBCGS, __pyx_k_FBCGS, sizeof(__pyx_k_FBCGS), 0, 0, 1, 1}, {&__pyx_n_s_FBCGSR, __pyx_k_FBCGSR, sizeof(__pyx_k_FBCGSR), 0, 0, 1, 1}, {&__pyx_n_s_FCG, __pyx_k_FCG, sizeof(__pyx_k_FCG), 0, 0, 1, 1}, {&__pyx_n_s_FE, __pyx_k_FE, sizeof(__pyx_k_FE), 0, 0, 1, 1}, {&__pyx_n_s_FETIDP, __pyx_k_FETIDP, sizeof(__pyx_k_FETIDP), 0, 0, 1, 1}, {&__pyx_n_s_FEType, __pyx_k_FEType, sizeof(__pyx_k_FEType), 0, 0, 1, 1}, {&__pyx_n_s_FFT, __pyx_k_FFT, sizeof(__pyx_k_FFT), 0, 0, 1, 1}, {&__pyx_n_s_FFTW, __pyx_k_FFTW, sizeof(__pyx_k_FFTW), 0, 0, 1, 1}, {&__pyx_n_s_FGMRES, __pyx_k_FGMRES, sizeof(__pyx_k_FGMRES), 0, 0, 1, 1}, {&__pyx_n_s_FIELDSPLIT, __pyx_k_FIELDSPLIT, sizeof(__pyx_k_FIELDSPLIT), 0, 0, 1, 1}, {&__pyx_n_s_FINAL, __pyx_k_FINAL, sizeof(__pyx_k_FINAL), 0, 0, 1, 1}, {&__pyx_n_s_FINAL_ASSEMBLY, __pyx_k_FINAL_ASSEMBLY, sizeof(__pyx_k_FINAL_ASSEMBLY), 0, 0, 1, 1}, {&__pyx_n_s_FINAL_ONLY, __pyx_k_FINAL_ONLY, sizeof(__pyx_k_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_FLUSH, __pyx_k_FLUSH, sizeof(__pyx_k_FLUSH), 0, 0, 1, 1}, {&__pyx_n_s_FLUSH_ASSEMBLY, __pyx_k_FLUSH_ASSEMBLY, sizeof(__pyx_k_FLUSH_ASSEMBLY), 0, 0, 1, 1}, {&__pyx_n_s_FORCE_DIAGONAL_ENTRIES, __pyx_k_FORCE_DIAGONAL_ENTRIES, sizeof(__pyx_k_FORCE_DIAGONAL_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_FOREST, __pyx_k_FOREST, sizeof(__pyx_k_FOREST), 0, 0, 1, 1}, {&__pyx_n_s_FORWARD, __pyx_k_FORWARD, sizeof(__pyx_k_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_FORWARD_LOCAL, __pyx_k_FORWARD_LOCAL, sizeof(__pyx_k_FORWARD_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_FORWARD_SWEEP, __pyx_k_FORWARD_SWEEP, sizeof(__pyx_k_FORWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_FRB, __pyx_k_FRB, sizeof(__pyx_k_FRB), 0, 0, 1, 1}, {&__pyx_n_s_FROBENIUS, __pyx_k_FROBENIUS, sizeof(__pyx_k_FROBENIUS), 0, 0, 1, 1}, {&__pyx_n_s_FRONT, __pyx_k_FRONT, sizeof(__pyx_k_FRONT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_DOWN, __pyx_k_FRONT_DOWN, sizeof(__pyx_k_FRONT_DOWN), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_DOWN_LEFT, __pyx_k_FRONT_DOWN_LEFT, sizeof(__pyx_k_FRONT_DOWN_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_DOWN_RIGHT, __pyx_k_FRONT_DOWN_RIGHT, sizeof(__pyx_k_FRONT_DOWN_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_LEFT, __pyx_k_FRONT_LEFT, sizeof(__pyx_k_FRONT_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_RIGHT, __pyx_k_FRONT_RIGHT, sizeof(__pyx_k_FRONT_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_UP, __pyx_k_FRONT_UP, sizeof(__pyx_k_FRONT_UP), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_UP_LEFT, __pyx_k_FRONT_UP_LEFT, sizeof(__pyx_k_FRONT_UP_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_FRONT_UP_RIGHT, __pyx_k_FRONT_UP_RIGHT, sizeof(__pyx_k_FRONT_UP_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_FULL, __pyx_k_FULL, sizeof(__pyx_k_FULL), 0, 0, 1, 1}, {&__pyx_n_s_FULL_SIZE, __pyx_k_FULL_SIZE, sizeof(__pyx_k_FULL_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_FactorShiftType, __pyx_k_FactorShiftType, sizeof(__pyx_k_FactorShiftType), 0, 0, 1, 1}, {&__pyx_n_s_FileMode, __pyx_k_FileMode, sizeof(__pyx_k_FileMode), 0, 0, 1, 1}, {&__pyx_n_s_Format, __pyx_k_Format, sizeof(__pyx_k_Format), 0, 0, 1, 1}, {&__pyx_n_s_Free, __pyx_k_Free, sizeof(__pyx_k_Free), 0, 0, 1, 1}, {&__pyx_n_s_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 1, 1}, {&__pyx_n_s_GALERKIN, __pyx_k_GALERKIN, sizeof(__pyx_k_GALERKIN), 0, 0, 1, 1}, {&__pyx_n_s_GAMG, __pyx_k_GAMG, sizeof(__pyx_k_GAMG), 0, 0, 1, 1}, {&__pyx_n_s_GAMGType, __pyx_k_GAMGType, sizeof(__pyx_k_GAMGType), 0, 0, 1, 1}, {&__pyx_n_s_GASM, __pyx_k_GASM, sizeof(__pyx_k_GASM), 0, 0, 1, 1}, {&__pyx_n_s_GASMType, __pyx_k_GASMType, sizeof(__pyx_k_GASMType), 0, 0, 1, 1}, {&__pyx_n_s_GATHER, __pyx_k_GATHER, sizeof(__pyx_k_GATHER), 0, 0, 1, 1}, {&__pyx_n_s_GATHERV, __pyx_k_GATHERV, sizeof(__pyx_k_GATHERV), 0, 0, 1, 1}, {&__pyx_n_s_GCR, __pyx_k_GCR, sizeof(__pyx_k_GCR), 0, 0, 1, 1}, {&__pyx_n_s_GENERAL, __pyx_k_GENERAL, sizeof(__pyx_k_GENERAL), 0, 0, 1, 1}, {&__pyx_n_s_GEO, __pyx_k_GEO, sizeof(__pyx_k_GEO), 0, 0, 1, 1}, {&__pyx_n_s_GETROW_UPPERTRIANGULAR, __pyx_k_GETROW_UPPERTRIANGULAR, sizeof(__pyx_k_GETROW_UPPERTRIANGULAR), 0, 0, 1, 1}, {&__pyx_n_s_GHOSTED, __pyx_k_GHOSTED, sizeof(__pyx_k_GHOSTED), 0, 0, 1, 1}, {&__pyx_kp_s_GIT_Date, __pyx_k_GIT_Date, sizeof(__pyx_k_GIT_Date), 0, 0, 1, 0}, {&__pyx_n_s_GLEE, __pyx_k_GLEE, sizeof(__pyx_k_GLEE), 0, 0, 1, 1}, {&__pyx_n_s_GLLE, __pyx_k_GLLE, sizeof(__pyx_k_GLLE), 0, 0, 1, 1}, {&__pyx_n_s_GLMapMode, __pyx_k_GLMapMode, sizeof(__pyx_k_GLMapMode), 0, 0, 1, 1}, {&__pyx_n_s_GLOBAL_MAX, __pyx_k_GLOBAL_MAX, sizeof(__pyx_k_GLOBAL_MAX), 0, 0, 1, 1}, {&__pyx_n_s_GLOBAL_SUM, __pyx_k_GLOBAL_SUM, sizeof(__pyx_k_GLOBAL_SUM), 0, 0, 1, 1}, {&__pyx_n_s_GLTR, __pyx_k_GLTR, sizeof(__pyx_k_GLTR), 0, 0, 1, 1}, {&__pyx_n_s_GLVIS, __pyx_k_GLVIS, sizeof(__pyx_k_GLVIS), 0, 0, 1, 1}, {&__pyx_n_s_GMRES, __pyx_k_GMRES, sizeof(__pyx_k_GMRES), 0, 0, 1, 1}, {&__pyx_n_s_GPCG, __pyx_k_GPCG, sizeof(__pyx_k_GPCG), 0, 0, 1, 1}, {&__pyx_n_s_GROPPCG, __pyx_k_GROPPCG, sizeof(__pyx_k_GROPPCG), 0, 0, 1, 1}, {&__pyx_n_s_Get_rank, __pyx_k_Get_rank, sizeof(__pyx_k_Get_rank), 0, 0, 1, 1}, {&__pyx_n_s_Get_size, __pyx_k_Get_size, sizeof(__pyx_k_Get_size), 0, 0, 1, 1}, {&__pyx_kp_s_Given_d_column_indices_but_d_non, __pyx_k_Given_d_column_indices_but_d_non, sizeof(__pyx_k_Given_d_column_indices_but_d_non), 0, 0, 1, 0}, {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1}, {&__pyx_n_s_HALF, __pyx_k_HALF, sizeof(__pyx_k_HALF), 0, 0, 1, 1}, {&__pyx_n_s_HALF_SIZE, __pyx_k_HALF_SIZE, sizeof(__pyx_k_HALF_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_HARA, __pyx_k_HARA, sizeof(__pyx_k_HARA), 0, 0, 1, 1}, {&__pyx_n_s_HASH, __pyx_k_HASH, sizeof(__pyx_k_HASH), 0, 0, 1, 1}, {&__pyx_n_s_HDF5, __pyx_k_HDF5, sizeof(__pyx_k_HDF5), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_MAT, __pyx_k_HDF5_MAT, sizeof(__pyx_k_HDF5_MAT), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_PETSC, __pyx_k_HDF5_PETSC, sizeof(__pyx_k_HDF5_PETSC), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_VIZ, __pyx_k_HDF5_VIZ, sizeof(__pyx_k_HDF5_VIZ), 0, 0, 1, 1}, {&__pyx_n_s_HDF5_XDMF, __pyx_k_HDF5_XDMF, sizeof(__pyx_k_HDF5_XDMF), 0, 0, 1, 1}, {&__pyx_n_s_HERMITIAN, __pyx_k_HERMITIAN, sizeof(__pyx_k_HERMITIAN), 0, 0, 1, 1}, {&__pyx_n_s_HMG, __pyx_k_HMG, sizeof(__pyx_k_HMG), 0, 0, 1, 1}, {&__pyx_n_s_HPDDM, __pyx_k_HPDDM, sizeof(__pyx_k_HPDDM), 0, 0, 1, 1}, {&__pyx_n_s_HYPRE, __pyx_k_HYPRE, sizeof(__pyx_k_HYPRE), 0, 0, 1, 1}, {&__pyx_n_s_HYPRESSTRUCT, __pyx_k_HYPRESSTRUCT, sizeof(__pyx_k_HYPRESSTRUCT), 0, 0, 1, 1}, {&__pyx_n_s_HYPRESTRUCT, __pyx_k_HYPRESTRUCT, sizeof(__pyx_k_HYPRESTRUCT), 0, 0, 1, 1}, {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1}, {&__pyx_n_s_IBCGS, __pyx_k_IBCGS, sizeof(__pyx_k_IBCGS), 0, 0, 1, 1}, {&__pyx_n_s_ICC, __pyx_k_ICC, sizeof(__pyx_k_ICC), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_LOWER_TRIANGULAR, __pyx_k_IGNORE_LOWER_TRIANGULAR, sizeof(__pyx_k_IGNORE_LOWER_TRIANGULAR), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_NEGATIVE_INDICES, __pyx_k_IGNORE_NEGATIVE_INDICES, sizeof(__pyx_k_IGNORE_NEGATIVE_INDICES), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_OFF_PROC_ENTRIES, __pyx_k_IGNORE_OFF_PROC_ENTRIES, sizeof(__pyx_k_IGNORE_OFF_PROC_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_IGNORE_ZERO_ENTRIES, __pyx_k_IGNORE_ZERO_ENTRIES, sizeof(__pyx_k_IGNORE_ZERO_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_ILU, __pyx_k_ILU, sizeof(__pyx_k_ILU), 0, 0, 1, 1}, {&__pyx_n_s_IMPLICIT, __pyx_k_IMPLICIT, sizeof(__pyx_k_IMPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_INBLOCKS, __pyx_k_INBLOCKS, sizeof(__pyx_k_INBLOCKS), 0, 0, 1, 1}, {&__pyx_n_s_INF, __pyx_k_INF, sizeof(__pyx_k_INF), 0, 0, 1, 1}, {&__pyx_n_s_INFINITY, __pyx_k_INFINITY, sizeof(__pyx_k_INFINITY), 0, 0, 1, 1}, {&__pyx_n_s_INITIAL_FINAL_ONLY, __pyx_k_INITIAL_FINAL_ONLY, sizeof(__pyx_k_INITIAL_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_INITIAL_ONLY, __pyx_k_INITIAL_ONLY, sizeof(__pyx_k_INITIAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_INSERT, __pyx_k_INSERT, sizeof(__pyx_k_INSERT), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_ALL, __pyx_k_INSERT_ALL, sizeof(__pyx_k_INSERT_ALL), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_ALL_VALUES, __pyx_k_INSERT_ALL_VALUES, sizeof(__pyx_k_INSERT_ALL_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_BC, __pyx_k_INSERT_BC, sizeof(__pyx_k_INSERT_BC), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_BC_VALUES, __pyx_k_INSERT_BC_VALUES, sizeof(__pyx_k_INSERT_BC_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_INSERT_VALUES, __pyx_k_INSERT_VALUES, sizeof(__pyx_k_INSERT_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_INTERPOLATE, __pyx_k_INTERPOLATE, sizeof(__pyx_k_INTERPOLATE), 0, 0, 1, 1}, {&__pyx_n_s_IPM, __pyx_k_IPM, sizeof(__pyx_k_IPM), 0, 0, 1, 1}, {&__pyx_n_s_IS, __pyx_k_IS, sizeof(__pyx_k_IS), 0, 0, 1, 1}, {&__pyx_n_s_ISType, __pyx_k_ISType, sizeof(__pyx_k_ISType), 0, 0, 1, 1}, {&__pyx_n_s_IS_buffer, __pyx_k_IS_buffer, sizeof(__pyx_k_IS_buffer), 0, 0, 1, 1}, {&__pyx_n_s_ITERATING, __pyx_k_ITERATING, sizeof(__pyx_k_ITERATING), 0, 0, 1, 1}, {&__pyx_kp_s_I_0_is_d_expected_d, __pyx_k_I_0_is_d_expected_d, sizeof(__pyx_k_I_0_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0}, {&__pyx_n_s_InfoType, __pyx_k_InfoType, sizeof(__pyx_k_InfoType), 0, 0, 1, 1}, {&__pyx_kp_s_Input_vector_has_no_tensor_infor, __pyx_k_Input_vector_has_no_tensor_infor, sizeof(__pyx_k_Input_vector_has_no_tensor_infor), 0, 0, 1, 0}, {&__pyx_kp_s_Input_vector_type_does_not_match, __pyx_k_Input_vector_type_does_not_match, sizeof(__pyx_k_Input_vector_type_does_not_match), 0, 0, 1, 0}, {&__pyx_n_s_InsertMode, __pyx_k_InsertMode, sizeof(__pyx_k_InsertMode), 0, 0, 1, 1}, {&__pyx_n_s_IntType, __pyx_k_IntType, sizeof(__pyx_k_IntType), 0, 0, 1, 1}, {&__pyx_n_s_InterpolationType, __pyx_k_InterpolationType, sizeof(__pyx_k_InterpolationType), 0, 0, 1, 1}, {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_r_w_or_rw, __pyx_k_Invalid_mode_expected_r_w_or_rw, sizeof(__pyx_k_Invalid_mode_expected_r_w_or_rw), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_mode_expected_rw_r_or_w, __pyx_k_Invalid_mode_expected_rw_r_or_w, sizeof(__pyx_k_Invalid_mode_expected_rw_r_or_w), 0, 0, 1, 0}, {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0}, {&__pyx_n_s_J, __pyx_k_J, sizeof(__pyx_k_J), 0, 0, 1, 1}, {&__pyx_n_s_JACOBI, __pyx_k_JACOBI, sizeof(__pyx_k_JACOBI), 0, 0, 1, 1}, {&__pyx_n_s_KACZMARZ, __pyx_k_KACZMARZ, sizeof(__pyx_k_KACZMARZ), 0, 0, 1, 1}, {&__pyx_n_s_KAIJ, __pyx_k_KAIJ, sizeof(__pyx_k_KAIJ), 0, 0, 1, 1}, {&__pyx_n_s_KASKADE, __pyx_k_KASKADE, sizeof(__pyx_k_KASKADE), 0, 0, 1, 1}, {&__pyx_n_s_KEEP_NONZERO_PATTERN, __pyx_k_KEEP_NONZERO_PATTERN, sizeof(__pyx_k_KEEP_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_KLU, __pyx_k_KLU, sizeof(__pyx_k_KLU), 0, 0, 1, 1}, {&__pyx_n_s_KOKKOS, __pyx_k_KOKKOS, sizeof(__pyx_k_KOKKOS), 0, 0, 1, 1}, {&__pyx_n_s_KSP, __pyx_k_KSP, sizeof(__pyx_k_KSP), 0, 0, 1, 1}, {&__pyx_n_s_KSPConvergedReason, __pyx_k_KSPConvergedReason, sizeof(__pyx_k_KSPConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_KSPNormType, __pyx_k_KSPNormType, sizeof(__pyx_k_KSPNormType), 0, 0, 1, 1}, {&__pyx_n_s_KSPONLY, __pyx_k_KSPONLY, sizeof(__pyx_k_KSPONLY), 0, 0, 1, 1}, {&__pyx_n_s_KSPTRANSPOSEONLY, __pyx_k_KSPTRANSPOSEONLY, sizeof(__pyx_k_KSPTRANSPOSEONLY), 0, 0, 1, 1}, {&__pyx_n_s_KSPType, __pyx_k_KSPType, sizeof(__pyx_k_KSPType), 0, 0, 1, 1}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1}, {&__pyx_n_s_LAYOUT_GAUSS, __pyx_k_LAYOUT_GAUSS, sizeof(__pyx_k_LAYOUT_GAUSS), 0, 0, 1, 1}, {&__pyx_n_s_LAYOUT_REGULAR, __pyx_k_LAYOUT_REGULAR, sizeof(__pyx_k_LAYOUT_REGULAR), 0, 0, 1, 1}, {&__pyx_n_s_LAYOUT_SUBDIVISION, __pyx_k_LAYOUT_SUBDIVISION, sizeof(__pyx_k_LAYOUT_SUBDIVISION), 0, 0, 1, 1}, {&__pyx_n_s_LCD, __pyx_k_LCD, sizeof(__pyx_k_LCD), 0, 0, 1, 1}, {&__pyx_n_s_LCL, __pyx_k_LCL, sizeof(__pyx_k_LCL), 0, 0, 1, 1}, {&__pyx_n_s_LEFT, __pyx_k_LEFT, sizeof(__pyx_k_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_LGMRES, __pyx_k_LGMRES, sizeof(__pyx_k_LGMRES), 0, 0, 1, 1}, {&__pyx_n_s_LGMap, __pyx_k_LGMap, sizeof(__pyx_k_LGMap), 0, 0, 1, 1}, {&__pyx_n_s_LGMapType, __pyx_k_LGMapType, sizeof(__pyx_k_LGMapType), 0, 0, 1, 1}, {&__pyx_n_s_LINEAR, __pyx_k_LINEAR, sizeof(__pyx_k_LINEAR), 0, 0, 1, 1}, {&__pyx_n_s_LMVM, __pyx_k_LMVM, sizeof(__pyx_k_LMVM), 0, 0, 1, 1}, {&__pyx_n_s_LMVMBADBROYDEN, __pyx_k_LMVMBADBROYDEN, sizeof(__pyx_k_LMVMBADBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMBFGS, __pyx_k_LMVMBFGS, sizeof(__pyx_k_LMVMBFGS), 0, 0, 1, 1}, {&__pyx_n_s_LMVMBROYDEN, __pyx_k_LMVMBROYDEN, sizeof(__pyx_k_LMVMBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMDFP, __pyx_k_LMVMDFP, sizeof(__pyx_k_LMVMDFP), 0, 0, 1, 1}, {&__pyx_n_s_LMVMDIAGBBROYDEN, __pyx_k_LMVMDIAGBBROYDEN, sizeof(__pyx_k_LMVMDIAGBBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMSR1, __pyx_k_LMVMSR1, sizeof(__pyx_k_LMVMSR1), 0, 0, 1, 1}, {&__pyx_n_s_LMVMSYMBADBROYDEN, __pyx_k_LMVMSYMBADBROYDEN, sizeof(__pyx_k_LMVMSYMBADBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LMVMSYMBROYDEN, __pyx_k_LMVMSYMBROYDEN, sizeof(__pyx_k_LMVMSYMBROYDEN), 0, 0, 1, 1}, {&__pyx_n_s_LOAD_BALANCE, __pyx_k_LOAD_BALANCE, sizeof(__pyx_k_LOAD_BALANCE), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL, __pyx_k_LOCAL, sizeof(__pyx_k_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_LOCALREF, __pyx_k_LOCALREF, sizeof(__pyx_k_LOCALREF), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL_BACKWARD_SWEEP, __pyx_k_LOCAL_BACKWARD_SWEEP, sizeof(__pyx_k_LOCAL_BACKWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL_FORWARD_SWEEP, __pyx_k_LOCAL_FORWARD_SWEEP, sizeof(__pyx_k_LOCAL_FORWARD_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_LOCAL_SYMMETRIC_SWEEP, __pyx_k_LOCAL_SYMMETRIC_SWEEP, sizeof(__pyx_k_LOCAL_SYMMETRIC_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_LOWER, __pyx_k_LOWER, sizeof(__pyx_k_LOWER), 0, 0, 1, 1}, {&__pyx_n_s_LRC, __pyx_k_LRC, sizeof(__pyx_k_LRC), 0, 0, 1, 1}, {&__pyx_n_s_LSC, __pyx_k_LSC, sizeof(__pyx_k_LSC), 0, 0, 1, 1}, {&__pyx_n_s_LSQR, __pyx_k_LSQR, sizeof(__pyx_k_LSQR), 0, 0, 1, 1}, {&__pyx_n_s_LU, __pyx_k_LU, sizeof(__pyx_k_LU), 0, 0, 1, 1}, {&__pyx_n_s_LUSOL, __pyx_k_LUSOL, sizeof(__pyx_k_LUSOL), 0, 0, 1, 1}, {&__pyx_n_s_Left, __pyx_k_Left, sizeof(__pyx_k_Left), 0, 0, 1, 1}, {&__pyx_n_s_Log, __pyx_k_Log, sizeof(__pyx_k_Log), 0, 0, 1, 1}, {&__pyx_n_s_LogClass, __pyx_k_LogClass, sizeof(__pyx_k_LogClass), 0, 0, 1, 1}, {&__pyx_n_s_LogEvent, __pyx_k_LogEvent, sizeof(__pyx_k_LogEvent), 0, 0, 1, 1}, {&__pyx_n_s_LogStage, __pyx_k_LogStage, sizeof(__pyx_k_LogStage), 0, 0, 1, 1}, {&__pyx_n_s_MAIJ, __pyx_k_MAIJ, sizeof(__pyx_k_MAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MAPPING, __pyx_k_MAPPING, sizeof(__pyx_k_MAPPING), 0, 0, 1, 1}, {&__pyx_n_s_MASK, __pyx_k_MASK, sizeof(__pyx_k_MASK), 0, 0, 1, 1}, {&__pyx_n_s_MAT, __pyx_k_MAT, sizeof(__pyx_k_MAT), 0, 0, 1, 1}, {&__pyx_n_s_MATCHSTEP, __pyx_k_MATCHSTEP, sizeof(__pyx_k_MATCHSTEP), 0, 0, 1, 1}, {&__pyx_n_s_MATHEMATICA, __pyx_k_MATHEMATICA, sizeof(__pyx_k_MATHEMATICA), 0, 0, 1, 1}, {&__pyx_n_s_MATLAB, __pyx_k_MATLAB, sizeof(__pyx_k_MATLAB), 0, 0, 1, 1}, {&__pyx_n_s_MATPARTITIONING, __pyx_k_MATPARTITIONING, sizeof(__pyx_k_MATPARTITIONING), 0, 0, 1, 1}, {&__pyx_n_s_MAX, __pyx_k_MAX, sizeof(__pyx_k_MAX), 0, 0, 1, 1}, {&__pyx_n_s_MAX_VALUES, __pyx_k_MAX_VALUES, sizeof(__pyx_k_MAX_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_MEMORYSCALABLE, __pyx_k_MEMORYSCALABLE, sizeof(__pyx_k_MEMORYSCALABLE), 0, 0, 1, 1}, {&__pyx_n_s_MFFD, __pyx_k_MFFD, sizeof(__pyx_k_MFFD), 0, 0, 1, 1}, {&__pyx_n_s_MG, __pyx_k_MG, sizeof(__pyx_k_MG), 0, 0, 1, 1}, {&__pyx_n_s_MGCycleType, __pyx_k_MGCycleType, sizeof(__pyx_k_MGCycleType), 0, 0, 1, 1}, {&__pyx_n_s_MGType, __pyx_k_MGType, sizeof(__pyx_k_MGType), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_BASIC, __pyx_k_MIGRATE_BASIC, sizeof(__pyx_k_MIGRATE_BASIC), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_DMCELLEXACT, __pyx_k_MIGRATE_DMCELLEXACT, sizeof(__pyx_k_MIGRATE_DMCELLEXACT), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_DMCELLNSCATTER, __pyx_k_MIGRATE_DMCELLNSCATTER, sizeof(__pyx_k_MIGRATE_DMCELLNSCATTER), 0, 0, 1, 1}, {&__pyx_n_s_MIGRATE_USER, __pyx_k_MIGRATE_USER, sizeof(__pyx_k_MIGRATE_USER), 0, 0, 1, 1}, {&__pyx_n_s_MIMEX, __pyx_k_MIMEX, sizeof(__pyx_k_MIMEX), 0, 0, 1, 1}, {&__pyx_n_s_MINRES, __pyx_k_MINRES, sizeof(__pyx_k_MINRES), 0, 0, 1, 1}, {&__pyx_n_s_MIRROR, __pyx_k_MIRROR, sizeof(__pyx_k_MIRROR), 0, 0, 1, 1}, {&__pyx_n_s_MKL_CPARDISO, __pyx_k_MKL_CPARDISO, sizeof(__pyx_k_MKL_CPARDISO), 0, 0, 1, 1}, {&__pyx_n_s_MKL_PARDISO, __pyx_k_MKL_PARDISO, sizeof(__pyx_k_MKL_PARDISO), 0, 0, 1, 1}, {&__pyx_n_s_ML, __pyx_k_ML, sizeof(__pyx_k_ML), 0, 0, 1, 1}, {&__pyx_n_s_MOAB, __pyx_k_MOAB, sizeof(__pyx_k_MOAB), 0, 0, 1, 1}, {&__pyx_n_s_MPI, __pyx_k_MPI, sizeof(__pyx_k_MPI), 0, 0, 1, 1}, {&__pyx_n_s_MPIADJ, __pyx_k_MPIADJ, sizeof(__pyx_k_MPIADJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJ, __pyx_k_MPIAIJ, sizeof(__pyx_k_MPIAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJCRL, __pyx_k_MPIAIJCRL, sizeof(__pyx_k_MPIAIJCRL), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJCUSPARSE, __pyx_k_MPIAIJCUSPARSE, sizeof(__pyx_k_MPIAIJCUSPARSE), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJMKL, __pyx_k_MPIAIJMKL, sizeof(__pyx_k_MPIAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJPERM, __pyx_k_MPIAIJPERM, sizeof(__pyx_k_MPIAIJPERM), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJSELL, __pyx_k_MPIAIJSELL, sizeof(__pyx_k_MPIAIJSELL), 0, 0, 1, 1}, {&__pyx_n_s_MPIAIJVIENNACL, __pyx_k_MPIAIJVIENNACL, sizeof(__pyx_k_MPIAIJVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_MPIBAIJ, __pyx_k_MPIBAIJ, sizeof(__pyx_k_MPIBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIBAIJMKL, __pyx_k_MPIBAIJMKL, sizeof(__pyx_k_MPIBAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_MPICUDA, __pyx_k_MPICUDA, sizeof(__pyx_k_MPICUDA), 0, 0, 1, 1}, {&__pyx_n_s_MPIDENSE, __pyx_k_MPIDENSE, sizeof(__pyx_k_MPIDENSE), 0, 0, 1, 1}, {&__pyx_n_s_MPIKAIJ, __pyx_k_MPIKAIJ, sizeof(__pyx_k_MPIKAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPIKOKKOS, __pyx_k_MPIKOKKOS, sizeof(__pyx_k_MPIKOKKOS), 0, 0, 1, 1}, {&__pyx_n_s_MPIMAIJ, __pyx_k_MPIMAIJ, sizeof(__pyx_k_MPIMAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPISBAIJ, __pyx_k_MPISBAIJ, sizeof(__pyx_k_MPISBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_MPISELL, __pyx_k_MPISELL, sizeof(__pyx_k_MPISELL), 0, 0, 1, 1}, {&__pyx_n_s_MPIVIENNACL, __pyx_k_MPIVIENNACL, sizeof(__pyx_k_MPIVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_MPRK, __pyx_k_MPRK, sizeof(__pyx_k_MPRK), 0, 0, 1, 1}, {&__pyx_n_s_MS, __pyx_k_MS, sizeof(__pyx_k_MS), 0, 0, 1, 1}, {&__pyx_n_s_MULTIPLICATIVE, __pyx_k_MULTIPLICATIVE, sizeof(__pyx_k_MULTIPLICATIVE), 0, 0, 1, 1}, {&__pyx_n_s_MUMPS, __pyx_k_MUMPS, sizeof(__pyx_k_MUMPS), 0, 0, 1, 1}, {&__pyx_n_s_MapMode, __pyx_k_MapMode, sizeof(__pyx_k_MapMode), 0, 0, 1, 1}, {&__pyx_n_s_Mat, __pyx_k_Mat, sizeof(__pyx_k_Mat), 0, 0, 1, 1}, {&__pyx_n_s_MatAssemblyType, __pyx_k_MatAssemblyType, sizeof(__pyx_k_MatAssemblyType), 0, 0, 1, 1}, {&__pyx_n_s_MatFactorShiftType, __pyx_k_MatFactorShiftType, sizeof(__pyx_k_MatFactorShiftType), 0, 0, 1, 1}, {&__pyx_n_s_MatInfoType, __pyx_k_MatInfoType, sizeof(__pyx_k_MatInfoType), 0, 0, 1, 1}, {&__pyx_n_s_MatOption, __pyx_k_MatOption, sizeof(__pyx_k_MatOption), 0, 0, 1, 1}, {&__pyx_n_s_MatOrderingType, __pyx_k_MatOrderingType, sizeof(__pyx_k_MatOrderingType), 0, 0, 1, 1}, {&__pyx_n_s_MatSORType, __pyx_k_MatSORType, sizeof(__pyx_k_MatSORType), 0, 0, 1, 1}, {&__pyx_n_s_MatSolverType, __pyx_k_MatSolverType, sizeof(__pyx_k_MatSolverType), 0, 0, 1, 1}, {&__pyx_n_s_MatStructure, __pyx_k_MatStructure, sizeof(__pyx_k_MatStructure), 0, 0, 1, 1}, {&__pyx_n_s_MatType, __pyx_k_MatType, sizeof(__pyx_k_MatType), 0, 0, 1, 1}, {&__pyx_n_s_Mat_Stencil, __pyx_k_Mat_Stencil, sizeof(__pyx_k_Mat_Stencil), 0, 0, 1, 1}, {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0}, {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0}, {&__pyx_n_s_MigrateType, __pyx_k_MigrateType, sizeof(__pyx_k_MigrateType), 0, 0, 1, 1}, {&__pyx_kp_s_Missing_input_parameters, __pyx_k_Missing_input_parameters, sizeof(__pyx_k_Missing_input_parameters), 0, 0, 1, 0}, {&__pyx_kp_s_Missing_tensor_information, __pyx_k_Missing_tensor_information, sizeof(__pyx_k_Missing_tensor_information), 0, 0, 1, 0}, {&__pyx_n_s_Mode, __pyx_k_Mode, sizeof(__pyx_k_Mode), 0, 0, 1, 1}, {&__pyx_kp_s_Must_provide_as_many_communicato, __pyx_k_Must_provide_as_many_communicato, sizeof(__pyx_k_Must_provide_as_many_communicato), 0, 0, 1, 0}, {&__pyx_kp_s_Must_provide_both_sizes_and_poin, __pyx_k_Must_provide_both_sizes_and_poin, sizeof(__pyx_k_Must_provide_both_sizes_and_poin), 0, 0, 1, 0}, {&__pyx_kp_s_Must_provide_operator_for_USER_o, __pyx_k_Must_provide_operator_for_USER_o, sizeof(__pyx_k_Must_provide_operator_for_USER_o), 0, 0, 1, 0}, {&__pyx_n_s_N1, __pyx_k_N1, sizeof(__pyx_k_N1), 0, 0, 1, 1}, {&__pyx_n_s_N12, __pyx_k_N12, sizeof(__pyx_k_N12), 0, 0, 1, 1}, {&__pyx_n_s_N2, __pyx_k_N2, sizeof(__pyx_k_N2), 0, 0, 1, 1}, {&__pyx_n_s_NASH, __pyx_k_NASH, sizeof(__pyx_k_NASH), 0, 0, 1, 1}, {&__pyx_n_s_NASM, __pyx_k_NASM, sizeof(__pyx_k_NASM), 0, 0, 1, 1}, {&__pyx_n_s_NATIVE, __pyx_k_NATIVE, sizeof(__pyx_k_NATIVE), 0, 0, 1, 1}, {&__pyx_n_s_NATURAL, __pyx_k_NATURAL, sizeof(__pyx_k_NATURAL), 0, 0, 1, 1}, {&__pyx_n_s_NCG, __pyx_k_NCG, sizeof(__pyx_k_NCG), 0, 0, 1, 1}, {&__pyx_n_s_ND, __pyx_k_ND, sizeof(__pyx_k_ND), 0, 0, 1, 1}, {&__pyx_n_s_NEIGHBOR, __pyx_k_NEIGHBOR, sizeof(__pyx_k_NEIGHBOR), 0, 0, 1, 1}, {&__pyx_n_s_NEST, __pyx_k_NEST, sizeof(__pyx_k_NEST), 0, 0, 1, 1}, {&__pyx_n_s_NETWORK, __pyx_k_NETWORK, sizeof(__pyx_k_NETWORK), 0, 0, 1, 1}, {&__pyx_n_s_NEWTONLS, __pyx_k_NEWTONLS, sizeof(__pyx_k_NEWTONLS), 0, 0, 1, 1}, {&__pyx_n_s_NEWTONTR, __pyx_k_NEWTONTR, sizeof(__pyx_k_NEWTONTR), 0, 0, 1, 1}, {&__pyx_n_s_NEW_NONZERO_ALLOCATION_ERR, __pyx_k_NEW_NONZERO_ALLOCATION_ERR, sizeof(__pyx_k_NEW_NONZERO_ALLOCATION_ERR), 0, 0, 1, 1}, {&__pyx_n_s_NEW_NONZERO_LOCATIONS, __pyx_k_NEW_NONZERO_LOCATIONS, sizeof(__pyx_k_NEW_NONZERO_LOCATIONS), 0, 0, 1, 1}, {&__pyx_n_s_NEW_NONZERO_LOCATION_ERR, __pyx_k_NEW_NONZERO_LOCATION_ERR, sizeof(__pyx_k_NEW_NONZERO_LOCATION_ERR), 0, 0, 1, 1}, {&__pyx_n_s_NGMRES, __pyx_k_NGMRES, sizeof(__pyx_k_NGMRES), 0, 0, 1, 1}, {&__pyx_n_s_NGS, __pyx_k_NGS, sizeof(__pyx_k_NGS), 0, 0, 1, 1}, {&__pyx_n_s_NINFINITY, __pyx_k_NINFINITY, sizeof(__pyx_k_NINFINITY), 0, 0, 1, 1}, {&__pyx_n_s_NLS, __pyx_k_NLS, sizeof(__pyx_k_NLS), 0, 0, 1, 1}, {&__pyx_n_s_NM, __pyx_k_NM, sizeof(__pyx_k_NM), 0, 0, 1, 1}, {&__pyx_n_s_NN, __pyx_k_NN, sizeof(__pyx_k_NN), 0, 0, 1, 1}, {&__pyx_n_s_NO, __pyx_k_NO, sizeof(__pyx_k_NO), 0, 0, 1, 1}, {&__pyx_n_s_NOFORMAT, __pyx_k_NOFORMAT, sizeof(__pyx_k_NOFORMAT), 0, 0, 1, 1}, {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1}, {&__pyx_n_s_NONLINEAR, __pyx_k_NONLINEAR, sizeof(__pyx_k_NONLINEAR), 0, 0, 1, 1}, {&__pyx_n_s_NONZERO, __pyx_k_NONZERO, sizeof(__pyx_k_NONZERO), 0, 0, 1, 1}, {&__pyx_n_s_NORMAL, __pyx_k_NORMAL, sizeof(__pyx_k_NORMAL), 0, 0, 1, 1}, {&__pyx_n_s_NORMALHERMITIAN, __pyx_k_NORMALHERMITIAN, sizeof(__pyx_k_NORMALHERMITIAN), 0, 0, 1, 1}, {&__pyx_n_s_NORM_1, __pyx_k_NORM_1, sizeof(__pyx_k_NORM_1), 0, 0, 1, 1}, {&__pyx_n_s_NORM_1_AND_2, __pyx_k_NORM_1_AND_2, sizeof(__pyx_k_NORM_1_AND_2), 0, 0, 1, 1}, {&__pyx_n_s_NORM_2, __pyx_k_NORM_2, sizeof(__pyx_k_NORM_2), 0, 0, 1, 1}, {&__pyx_n_s_NORM_ALWAYS, __pyx_k_NORM_ALWAYS, sizeof(__pyx_k_NORM_ALWAYS), 0, 0, 1, 1}, {&__pyx_n_s_NORM_DEFAULT, __pyx_k_NORM_DEFAULT, sizeof(__pyx_k_NORM_DEFAULT), 0, 0, 1, 1}, {&__pyx_n_s_NORM_FINAL_ONLY, __pyx_k_NORM_FINAL_ONLY, sizeof(__pyx_k_NORM_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_FROBENIUS, __pyx_k_NORM_FROBENIUS, sizeof(__pyx_k_NORM_FROBENIUS), 0, 0, 1, 1}, {&__pyx_n_s_NORM_INFINITY, __pyx_k_NORM_INFINITY, sizeof(__pyx_k_NORM_INFINITY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_INITIAL_FINAL_ONLY, __pyx_k_NORM_INITIAL_FINAL_ONLY, sizeof(__pyx_k_NORM_INITIAL_FINAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_INITIAL_ONLY, __pyx_k_NORM_INITIAL_ONLY, sizeof(__pyx_k_NORM_INITIAL_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_NORM_MAX, __pyx_k_NORM_MAX, sizeof(__pyx_k_NORM_MAX), 0, 0, 1, 1}, {&__pyx_n_s_NORM_NATURAL, __pyx_k_NORM_NATURAL, sizeof(__pyx_k_NORM_NATURAL), 0, 0, 1, 1}, {&__pyx_n_s_NORM_NONE, __pyx_k_NORM_NONE, sizeof(__pyx_k_NORM_NONE), 0, 0, 1, 1}, {&__pyx_n_s_NORM_PRECONDITIONED, __pyx_k_NORM_PRECONDITIONED, sizeof(__pyx_k_NORM_PRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_NORM_UNPRECONDITIONED, __pyx_k_NORM_UNPRECONDITIONED, sizeof(__pyx_k_NORM_UNPRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_NOT_SET_VALUES, __pyx_k_NOT_SET_VALUES, sizeof(__pyx_k_NOT_SET_VALUES), 0, 0, 1, 1}, {&__pyx_n_s_NO_OFF_PROC_ENTRIES, __pyx_k_NO_OFF_PROC_ENTRIES, sizeof(__pyx_k_NO_OFF_PROC_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_NO_OFF_PROC_ZERO_ROWS, __pyx_k_NO_OFF_PROC_ZERO_ROWS, sizeof(__pyx_k_NO_OFF_PROC_ZERO_ROWS), 0, 0, 1, 1}, {&__pyx_n_s_NRICHARDSON, __pyx_k_NRICHARDSON, sizeof(__pyx_k_NRICHARDSON), 0, 0, 1, 1}, {&__pyx_n_s_NTL, __pyx_k_NTL, sizeof(__pyx_k_NTL), 0, 0, 1, 1}, {&__pyx_n_s_NTR, __pyx_k_NTR, sizeof(__pyx_k_NTR), 0, 0, 1, 1}, {&__pyx_n_s_NULLLOC, __pyx_k_NULLLOC, sizeof(__pyx_k_NULLLOC), 0, 0, 1, 1}, {&__pyx_n_s_NZ, __pyx_k_NZ, sizeof(__pyx_k_NZ), 0, 0, 1, 1}, {&__pyx_n_s_NormSchedule, __pyx_k_NormSchedule, sizeof(__pyx_k_NormSchedule), 0, 0, 1, 1}, {&__pyx_n_s_NormType, __pyx_k_NormType, sizeof(__pyx_k_NormType), 0, 0, 1, 1}, {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, {&__pyx_n_s_NullSpace, __pyx_k_NullSpace, sizeof(__pyx_k_NullSpace), 0, 0, 1, 1}, {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1}, {&__pyx_n_s_ODE_EXPLICIT, __pyx_k_ODE_EXPLICIT, sizeof(__pyx_k_ODE_EXPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_ODE_IMPLICIT, __pyx_k_ODE_IMPLICIT, sizeof(__pyx_k_ODE_IMPLICIT), 0, 0, 1, 1}, {&__pyx_n_s_OPENCL, __pyx_k_OPENCL, sizeof(__pyx_k_OPENCL), 0, 0, 1, 1}, {&__pyx_n_s_OPTION_MAX, __pyx_k_OPTION_MAX, sizeof(__pyx_k_OPTION_MAX), 0, 0, 1, 1}, {&__pyx_n_s_OPTION_MIN, __pyx_k_OPTION_MIN, sizeof(__pyx_k_OPTION_MIN), 0, 0, 1, 1}, {&__pyx_n_s_OWD, __pyx_k_OWD, sizeof(__pyx_k_OWD), 0, 0, 1, 1}, {&__pyx_n_s_OWLQN, __pyx_k_OWLQN, sizeof(__pyx_k_OWLQN), 0, 0, 1, 1}, {&__pyx_n_s_Object, __pyx_k_Object, sizeof(__pyx_k_Object), 0, 0, 1, 1}, {&__pyx_kp_s_Object_is_not_writable, __pyx_k_Object_is_not_writable, sizeof(__pyx_k_Object_is_not_writable), 0, 0, 1, 0}, {&__pyx_n_s_Option, __pyx_k_Option, sizeof(__pyx_k_Option), 0, 0, 1, 1}, {&__pyx_n_s_Options, __pyx_k_Options, sizeof(__pyx_k_Options), 0, 0, 1, 1}, {&__pyx_n_s_OrderingType, __pyx_k_OrderingType, sizeof(__pyx_k_OrderingType), 0, 0, 1, 1}, {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0}, {&__pyx_kp_s_Out_of_memory_Allocated_d_Used_b, __pyx_k_Out_of_memory_Allocated_d_Used_b, sizeof(__pyx_k_Out_of_memory_Allocated_d_Used_b), 0, 0, 1, 0}, {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1}, {&__pyx_n_s_P1, __pyx_k_P1, sizeof(__pyx_k_P1), 0, 0, 1, 1}, {&__pyx_n_s_P4EST, __pyx_k_P4EST, sizeof(__pyx_k_P4EST), 0, 0, 1, 1}, {&__pyx_n_s_P8EST, __pyx_k_P8EST, sizeof(__pyx_k_P8EST), 0, 0, 1, 1}, {&__pyx_n_s_PARDECOMP, __pyx_k_PARDECOMP, sizeof(__pyx_k_PARDECOMP), 0, 0, 1, 1}, {&__pyx_n_s_PARMETIS, __pyx_k_PARMETIS, sizeof(__pyx_k_PARMETIS), 0, 0, 1, 1}, {&__pyx_n_s_PARMS, __pyx_k_PARMS, sizeof(__pyx_k_PARMS), 0, 0, 1, 1}, {&__pyx_n_s_PASTIX, __pyx_k_PASTIX, sizeof(__pyx_k_PASTIX), 0, 0, 1, 1}, {&__pyx_n_s_PATCH, __pyx_k_PATCH, sizeof(__pyx_k_PATCH), 0, 0, 1, 1}, {&__pyx_n_s_PBJACOBI, __pyx_k_PBJACOBI, sizeof(__pyx_k_PBJACOBI), 0, 0, 1, 1}, {&__pyx_n_s_PC, __pyx_k_PC, sizeof(__pyx_k_PC), 0, 0, 1, 1}, {&__pyx_n_s_PCASMType, __pyx_k_PCASMType, sizeof(__pyx_k_PCASMType), 0, 0, 1, 1}, {&__pyx_n_s_PCCompositeType, __pyx_k_PCCompositeType, sizeof(__pyx_k_PCCompositeType), 0, 0, 1, 1}, {&__pyx_n_s_PCFieldSplitSchurFactType, __pyx_k_PCFieldSplitSchurFactType, sizeof(__pyx_k_PCFieldSplitSchurFactType), 0, 0, 1, 1}, {&__pyx_n_s_PCFieldSplitSchurPreType, __pyx_k_PCFieldSplitSchurPreType, sizeof(__pyx_k_PCFieldSplitSchurPreType), 0, 0, 1, 1}, {&__pyx_n_s_PCGAMGType, __pyx_k_PCGAMGType, sizeof(__pyx_k_PCGAMGType), 0, 0, 1, 1}, {&__pyx_n_s_PCGASMType, __pyx_k_PCGASMType, sizeof(__pyx_k_PCGASMType), 0, 0, 1, 1}, {&__pyx_n_s_PCMGCycleType, __pyx_k_PCMGCycleType, sizeof(__pyx_k_PCMGCycleType), 0, 0, 1, 1}, {&__pyx_n_s_PCMGType, __pyx_k_PCMGType, sizeof(__pyx_k_PCMGType), 0, 0, 1, 1}, {&__pyx_n_s_PCPatchConstructType, __pyx_k_PCPatchConstructType, sizeof(__pyx_k_PCPatchConstructType), 0, 0, 1, 1}, {&__pyx_n_s_PCSide, __pyx_k_PCSide, sizeof(__pyx_k_PCSide), 0, 0, 1, 1}, {&__pyx_n_s_PCType, __pyx_k_PCType, sizeof(__pyx_k_PCType), 0, 0, 1, 1}, {&__pyx_n_s_PD, __pyx_k_PD, sizeof(__pyx_k_PD), 0, 0, 1, 1}, {&__pyx_n_s_PDIPM, __pyx_k_PDIPM, sizeof(__pyx_k_PDIPM), 0, 0, 1, 1}, {&__pyx_n_s_PERIODIC, __pyx_k_PERIODIC, sizeof(__pyx_k_PERIODIC), 0, 0, 1, 1}, {&__pyx_n_s_PETSC, __pyx_k_PETSC, sizeof(__pyx_k_PETSC), 0, 0, 1, 1}, {&__pyx_kp_s_PETSc_Error_d, __pyx_k_PETSc_Error_d, sizeof(__pyx_k_PETSc_Error_d), 0, 0, 1, 0}, {&__pyx_kp_s_PETSc_Error_pyx, __pyx_k_PETSc_Error_pyx, sizeof(__pyx_k_PETSc_Error_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_PETSc_Log_pyx, __pyx_k_PETSc_Log_pyx, sizeof(__pyx_k_PETSc_Log_pyx), 0, 0, 1, 0}, {&__pyx_kp_s_PETSc_PETSc_pyx, __pyx_k_PETSc_PETSc_pyx, sizeof(__pyx_k_PETSc_PETSc_pyx), 0, 0, 1, 0}, {&__pyx_n_s_PFMG, __pyx_k_PFMG, sizeof(__pyx_k_PFMG), 0, 0, 1, 1}, {&__pyx_n_s_PGMRES, __pyx_k_PGMRES, sizeof(__pyx_k_PGMRES), 0, 0, 1, 1}, {&__pyx_n_s_PIC, __pyx_k_PIC, sizeof(__pyx_k_PIC), 0, 0, 1, 1}, {&__pyx_n_s_PICLayoutType, __pyx_k_PICLayoutType, sizeof(__pyx_k_PICLayoutType), 0, 0, 1, 1}, {&__pyx_n_s_PINFINITY, __pyx_k_PINFINITY, sizeof(__pyx_k_PINFINITY), 0, 0, 1, 1}, {&__pyx_n_s_PIPEBCGS, __pyx_k_PIPEBCGS, sizeof(__pyx_k_PIPEBCGS), 0, 0, 1, 1}, {&__pyx_n_s_PIPECG, __pyx_k_PIPECG, sizeof(__pyx_k_PIPECG), 0, 0, 1, 1}, {&__pyx_n_s_PIPECG2, __pyx_k_PIPECG2, sizeof(__pyx_k_PIPECG2), 0, 0, 1, 1}, {&__pyx_n_s_PIPECGRR, __pyx_k_PIPECGRR, sizeof(__pyx_k_PIPECGRR), 0, 0, 1, 1}, {&__pyx_n_s_PIPECR, __pyx_k_PIPECR, sizeof(__pyx_k_PIPECR), 0, 0, 1, 1}, {&__pyx_n_s_PIPEFCG, __pyx_k_PIPEFCG, sizeof(__pyx_k_PIPEFCG), 0, 0, 1, 1}, {&__pyx_n_s_PIPEFGMRES, __pyx_k_PIPEFGMRES, sizeof(__pyx_k_PIPEFGMRES), 0, 0, 1, 1}, {&__pyx_n_s_PIPEGCR, __pyx_k_PIPEGCR, sizeof(__pyx_k_PIPEGCR), 0, 0, 1, 1}, {&__pyx_n_s_PIPELCG, __pyx_k_PIPELCG, sizeof(__pyx_k_PIPELCG), 0, 0, 1, 1}, {&__pyx_n_s_PIPEPRCG, __pyx_k_PIPEPRCG, sizeof(__pyx_k_PIPEPRCG), 0, 0, 1, 1}, {&__pyx_n_s_PLEX, __pyx_k_PLEX, sizeof(__pyx_k_PLEX), 0, 0, 1, 1}, {&__pyx_n_s_POSITIVE_DEFINITE, __pyx_k_POSITIVE_DEFINITE, sizeof(__pyx_k_POSITIVE_DEFINITE), 0, 0, 1, 1}, {&__pyx_n_s_POUNDERS, __pyx_k_POUNDERS, sizeof(__pyx_k_POUNDERS), 0, 0, 1, 1}, {&__pyx_n_s_PREALLOCATOR, __pyx_k_PREALLOCATOR, sizeof(__pyx_k_PREALLOCATOR), 0, 0, 1, 1}, {&__pyx_n_s_PRECONDITIONED, __pyx_k_PRECONDITIONED, sizeof(__pyx_k_PRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_PREONLY, __pyx_k_PREONLY, sizeof(__pyx_k_PREONLY), 0, 0, 1, 1}, {&__pyx_n_s_PRODUCT, __pyx_k_PRODUCT, sizeof(__pyx_k_PRODUCT), 0, 0, 1, 1}, {&__pyx_n_s_PSEUDO, __pyx_k_PSEUDO, sizeof(__pyx_k_PSEUDO), 0, 0, 1, 1}, {&__pyx_n_s_PTSCOTCH, __pyx_k_PTSCOTCH, sizeof(__pyx_k_PTSCOTCH), 0, 0, 1, 1}, {&__pyx_n_s_PYTHON, __pyx_k_PYTHON, sizeof(__pyx_k_PYTHON), 0, 0, 1, 1}, {&__pyx_n_s_Partitioner, __pyx_k_Partitioner, sizeof(__pyx_k_Partitioner), 0, 0, 1, 1}, {&__pyx_n_s_PartitionerType, __pyx_k_PartitionerType, sizeof(__pyx_k_PartitionerType), 0, 0, 1, 1}, {&__pyx_n_s_PatchConstructType, __pyx_k_PatchConstructType, sizeof(__pyx_k_PatchConstructType), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_u_Portable_Extensible_Toolkit_for, __pyx_k_Portable_Extensible_Toolkit_for, sizeof(__pyx_k_Portable_Extensible_Toolkit_for), 0, 1, 0, 0}, {&__pyx_n_s_Print, __pyx_k_Print, sizeof(__pyx_k_Print), 0, 0, 1, 1}, {&__pyx_n_s_ProblemType, __pyx_k_ProblemType, sizeof(__pyx_k_ProblemType), 0, 0, 1, 1}, {&__pyx_n_s_Q0, __pyx_k_Q0, sizeof(__pyx_k_Q0), 0, 0, 1, 1}, {&__pyx_n_s_Q1, __pyx_k_Q1, sizeof(__pyx_k_Q1), 0, 0, 1, 1}, {&__pyx_n_s_QCG, __pyx_k_QCG, sizeof(__pyx_k_QCG), 0, 0, 1, 1}, {&__pyx_n_s_QMD, __pyx_k_QMD, sizeof(__pyx_k_QMD), 0, 0, 1, 1}, {&__pyx_n_s_QN, __pyx_k_QN, sizeof(__pyx_k_QN), 0, 0, 1, 1}, {&__pyx_n_s_QUARTER, __pyx_k_QUARTER, sizeof(__pyx_k_QUARTER), 0, 0, 1, 1}, {&__pyx_n_s_QUARTER_SIZE, __pyx_k_QUARTER_SIZE, sizeof(__pyx_k_QUARTER_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_Quad, __pyx_k_Quad, sizeof(__pyx_k_Quad), 0, 0, 1, 1}, {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1}, {&__pyx_n_s_RADAU5, __pyx_k_RADAU5, sizeof(__pyx_k_RADAU5), 0, 0, 1, 1}, {&__pyx_n_s_RAND, __pyx_k_RAND, sizeof(__pyx_k_RAND), 0, 0, 1, 1}, {&__pyx_n_s_RAND48, __pyx_k_RAND48, sizeof(__pyx_k_RAND48), 0, 0, 1, 1}, {&__pyx_n_s_RANDER48, __pyx_k_RANDER48, sizeof(__pyx_k_RANDER48), 0, 0, 1, 1}, {&__pyx_n_s_RANDOM123, __pyx_k_RANDOM123, sizeof(__pyx_k_RANDOM123), 0, 0, 1, 1}, {&__pyx_n_s_RCM, __pyx_k_RCM, sizeof(__pyx_k_RCM), 0, 0, 1, 1}, {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1}, {&__pyx_n_s_REDISTRIBUTE, __pyx_k_REDISTRIBUTE, sizeof(__pyx_k_REDISTRIBUTE), 0, 0, 1, 1}, {&__pyx_n_s_REDUNDANT, __pyx_k_REDUNDANT, sizeof(__pyx_k_REDUNDANT), 0, 0, 1, 1}, {&__pyx_n_s_RESTRICT, __pyx_k_RESTRICT, sizeof(__pyx_k_RESTRICT), 0, 0, 1, 1}, {&__pyx_n_s_REVERSE, __pyx_k_REVERSE, sizeof(__pyx_k_REVERSE), 0, 0, 1, 1}, {&__pyx_n_s_REVERSE_LOCAL, __pyx_k_REVERSE_LOCAL, sizeof(__pyx_k_REVERSE_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_RICHARDSON, __pyx_k_RICHARDSON, sizeof(__pyx_k_RICHARDSON), 0, 0, 1, 1}, {&__pyx_n_s_RIGHT, __pyx_k_RIGHT, sizeof(__pyx_k_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_RK, __pyx_k_RK, sizeof(__pyx_k_RK), 0, 0, 1, 1}, {&__pyx_n_s_RK1FE, __pyx_k_RK1FE, sizeof(__pyx_k_RK1FE), 0, 0, 1, 1}, {&__pyx_n_s_RK2A, __pyx_k_RK2A, sizeof(__pyx_k_RK2A), 0, 0, 1, 1}, {&__pyx_n_s_RK3, __pyx_k_RK3, sizeof(__pyx_k_RK3), 0, 0, 1, 1}, {&__pyx_n_s_RK3BS, __pyx_k_RK3BS, sizeof(__pyx_k_RK3BS), 0, 0, 1, 1}, {&__pyx_n_s_RK4, __pyx_k_RK4, sizeof(__pyx_k_RK4), 0, 0, 1, 1}, {&__pyx_n_s_RK5BS, __pyx_k_RK5BS, sizeof(__pyx_k_RK5BS), 0, 0, 1, 1}, {&__pyx_n_s_RK5DP, __pyx_k_RK5DP, sizeof(__pyx_k_RK5DP), 0, 0, 1, 1}, {&__pyx_n_s_RK5F, __pyx_k_RK5F, sizeof(__pyx_k_RK5F), 0, 0, 1, 1}, {&__pyx_n_s_RK6VR, __pyx_k_RK6VR, sizeof(__pyx_k_RK6VR), 0, 0, 1, 1}, {&__pyx_n_s_RK7VR, __pyx_k_RK7VR, sizeof(__pyx_k_RK7VR), 0, 0, 1, 1}, {&__pyx_n_s_RK8VR, __pyx_k_RK8VR, sizeof(__pyx_k_RK8VR), 0, 0, 1, 1}, {&__pyx_n_s_RKType, __pyx_k_RKType, sizeof(__pyx_k_RKType), 0, 0, 1, 1}, {&__pyx_n_s_ROSW, __pyx_k_ROSW, sizeof(__pyx_k_ROSW), 0, 0, 1, 1}, {&__pyx_n_s_ROWLENGTH, __pyx_k_ROWLENGTH, sizeof(__pyx_k_ROWLENGTH), 0, 0, 1, 1}, {&__pyx_n_s_ROWSCALINGVIENNACL, __pyx_k_ROWSCALINGVIENNACL, sizeof(__pyx_k_ROWSCALINGVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_ROW_ORIENTED, __pyx_k_ROW_ORIENTED, sizeof(__pyx_k_ROW_ORIENTED), 0, 0, 1, 1}, {&__pyx_n_s_RUNGE_KUTTA, __pyx_k_RUNGE_KUTTA, sizeof(__pyx_k_RUNGE_KUTTA), 0, 0, 1, 1}, {&__pyx_n_s_Random, __pyx_k_Random, sizeof(__pyx_k_Random), 0, 0, 1, 1}, {&__pyx_n_s_RandomType, __pyx_k_RandomType, sizeof(__pyx_k_RandomType), 0, 0, 1, 1}, {&__pyx_n_s_RealType, __pyx_k_RealType, sizeof(__pyx_k_RealType), 0, 0, 1, 1}, {&__pyx_n_s_Reason, __pyx_k_Reason, sizeof(__pyx_k_Reason), 0, 0, 1, 1}, {&__pyx_n_s_Right, __pyx_k_Right, sizeof(__pyx_k_Right), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, {&__pyx_n_s_SAME, __pyx_k_SAME, sizeof(__pyx_k_SAME), 0, 0, 1, 1}, {&__pyx_n_s_SAME_NONZERO_PATTERN, __pyx_k_SAME_NONZERO_PATTERN, sizeof(__pyx_k_SAME_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_SAME_NZ, __pyx_k_SAME_NZ, sizeof(__pyx_k_SAME_NZ), 0, 0, 1, 1}, {&__pyx_n_s_SAVIENNACL, __pyx_k_SAVIENNACL, sizeof(__pyx_k_SAVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_SAWS, __pyx_k_SAWS, sizeof(__pyx_k_SAWS), 0, 0, 1, 1}, {&__pyx_n_s_SBAIJ, __pyx_k_SBAIJ, sizeof(__pyx_k_SBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SCALAPACK, __pyx_k_SCALAPACK, sizeof(__pyx_k_SCALAPACK), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER, __pyx_k_SCATTER, sizeof(__pyx_k_SCATTER), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_FORWARD, __pyx_k_SCATTER_FORWARD, sizeof(__pyx_k_SCATTER_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_FORWARD_LOCAL, __pyx_k_SCATTER_FORWARD_LOCAL, sizeof(__pyx_k_SCATTER_FORWARD_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_LOCAL, __pyx_k_SCATTER_LOCAL, sizeof(__pyx_k_SCATTER_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_REVERSE, __pyx_k_SCATTER_REVERSE, sizeof(__pyx_k_SCATTER_REVERSE), 0, 0, 1, 1}, {&__pyx_n_s_SCATTER_REVERSE_LOCAL, __pyx_k_SCATTER_REVERSE_LOCAL, sizeof(__pyx_k_SCATTER_REVERSE_LOCAL), 0, 0, 1, 1}, {&__pyx_n_s_SCHUR, __pyx_k_SCHUR, sizeof(__pyx_k_SCHUR), 0, 0, 1, 1}, {&__pyx_n_s_SCHURCOMPLEMENT, __pyx_k_SCHURCOMPLEMENT, sizeof(__pyx_k_SCHURCOMPLEMENT), 0, 0, 1, 1}, {&__pyx_n_s_SELF, __pyx_k_SELF, sizeof(__pyx_k_SELF), 0, 0, 1, 1}, {&__pyx_n_s_SELFP, __pyx_k_SELFP, sizeof(__pyx_k_SELFP), 0, 0, 1, 1}, {&__pyx_n_s_SELL, __pyx_k_SELL, sizeof(__pyx_k_SELL), 0, 0, 1, 1}, {&__pyx_n_s_SEQ, __pyx_k_SEQ, sizeof(__pyx_k_SEQ), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJ, __pyx_k_SEQAIJ, sizeof(__pyx_k_SEQAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJCRL, __pyx_k_SEQAIJCRL, sizeof(__pyx_k_SEQAIJCRL), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJCUSPARSE, __pyx_k_SEQAIJCUSPARSE, sizeof(__pyx_k_SEQAIJCUSPARSE), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJMKL, __pyx_k_SEQAIJMKL, sizeof(__pyx_k_SEQAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJPERM, __pyx_k_SEQAIJPERM, sizeof(__pyx_k_SEQAIJPERM), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJSELL, __pyx_k_SEQAIJSELL, sizeof(__pyx_k_SEQAIJSELL), 0, 0, 1, 1}, {&__pyx_n_s_SEQAIJVIENNACL, __pyx_k_SEQAIJVIENNACL, sizeof(__pyx_k_SEQAIJVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_SEQBAIJ, __pyx_k_SEQBAIJ, sizeof(__pyx_k_SEQBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQBAIJMKL, __pyx_k_SEQBAIJMKL, sizeof(__pyx_k_SEQBAIJMKL), 0, 0, 1, 1}, {&__pyx_n_s_SEQCUDA, __pyx_k_SEQCUDA, sizeof(__pyx_k_SEQCUDA), 0, 0, 1, 1}, {&__pyx_n_s_SEQCUFFT, __pyx_k_SEQCUFFT, sizeof(__pyx_k_SEQCUFFT), 0, 0, 1, 1}, {&__pyx_n_s_SEQDENSE, __pyx_k_SEQDENSE, sizeof(__pyx_k_SEQDENSE), 0, 0, 1, 1}, {&__pyx_n_s_SEQDENSECUDA, __pyx_k_SEQDENSECUDA, sizeof(__pyx_k_SEQDENSECUDA), 0, 0, 1, 1}, {&__pyx_n_s_SEQKAIJ, __pyx_k_SEQKAIJ, sizeof(__pyx_k_SEQKAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQKOKKOS, __pyx_k_SEQKOKKOS, sizeof(__pyx_k_SEQKOKKOS), 0, 0, 1, 1}, {&__pyx_n_s_SEQMAIJ, __pyx_k_SEQMAIJ, sizeof(__pyx_k_SEQMAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQSBAIJ, __pyx_k_SEQSBAIJ, sizeof(__pyx_k_SEQSBAIJ), 0, 0, 1, 1}, {&__pyx_n_s_SEQSELL, __pyx_k_SEQSELL, sizeof(__pyx_k_SEQSELL), 0, 0, 1, 1}, {&__pyx_n_s_SEQVIENNACL, __pyx_k_SEQVIENNACL, sizeof(__pyx_k_SEQVIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_SF, __pyx_k_SF, sizeof(__pyx_k_SF), 0, 0, 1, 1}, {&__pyx_n_s_SFType, __pyx_k_SFType, sizeof(__pyx_k_SFType), 0, 0, 1, 1}, {&__pyx_n_s_SHARED, __pyx_k_SHARED, sizeof(__pyx_k_SHARED), 0, 0, 1, 1}, {&__pyx_n_s_SHELL, __pyx_k_SHELL, sizeof(__pyx_k_SHELL), 0, 0, 1, 1}, {&__pyx_n_s_SIMPLE, __pyx_k_SIMPLE, sizeof(__pyx_k_SIMPLE), 0, 0, 1, 1}, {&__pyx_n_s_SLICED, __pyx_k_SLICED, sizeof(__pyx_k_SLICED), 0, 0, 1, 1}, {&__pyx_n_s_SNES, __pyx_k_SNES, sizeof(__pyx_k_SNES), 0, 0, 1, 1}, {&__pyx_n_s_SNESConvergedReason, __pyx_k_SNESConvergedReason, sizeof(__pyx_k_SNESConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_SNESNormSchedule, __pyx_k_SNESNormSchedule, sizeof(__pyx_k_SNESNormSchedule), 0, 0, 1, 1}, {&__pyx_n_s_SNESType, __pyx_k_SNESType, sizeof(__pyx_k_SNESType), 0, 0, 1, 1}, {&__pyx_n_s_SOCKET, __pyx_k_SOCKET, sizeof(__pyx_k_SOCKET), 0, 0, 1, 1}, {&__pyx_n_s_SOR, __pyx_k_SOR, sizeof(__pyx_k_SOR), 0, 0, 1, 1}, {&__pyx_n_s_SORTED_FULL, __pyx_k_SORTED_FULL, sizeof(__pyx_k_SORTED_FULL), 0, 0, 1, 1}, {&__pyx_n_s_SORType, __pyx_k_SORType, sizeof(__pyx_k_SORType), 0, 0, 1, 1}, {&__pyx_n_s_SPAI, __pyx_k_SPAI, sizeof(__pyx_k_SPAI), 0, 0, 1, 1}, {&__pyx_n_s_SPARSEELEMENTAL, __pyx_k_SPARSEELEMENTAL, sizeof(__pyx_k_SPARSEELEMENTAL), 0, 0, 1, 1}, {&__pyx_n_s_SPD, __pyx_k_SPD, sizeof(__pyx_k_SPD), 0, 0, 1, 1}, {&__pyx_n_s_SPECIAL, __pyx_k_SPECIAL, sizeof(__pyx_k_SPECIAL), 0, 0, 1, 1}, {&__pyx_n_s_SPECTRAL, __pyx_k_SPECTRAL, sizeof(__pyx_k_SPECTRAL), 0, 0, 1, 1}, {&__pyx_n_s_SPRNG, __pyx_k_SPRNG, sizeof(__pyx_k_SPRNG), 0, 0, 1, 1}, {&__pyx_n_s_SSFLS, __pyx_k_SSFLS, sizeof(__pyx_k_SSFLS), 0, 0, 1, 1}, {&__pyx_n_s_SSILS, __pyx_k_SSILS, sizeof(__pyx_k_SSILS), 0, 0, 1, 1}, {&__pyx_n_s_SSP, __pyx_k_SSP, sizeof(__pyx_k_SSP), 0, 0, 1, 1}, {&__pyx_n_s_STAG, __pyx_k_STAG, sizeof(__pyx_k_STAG), 0, 0, 1, 1}, {&__pyx_n_s_STANDARD, __pyx_k_STANDARD, sizeof(__pyx_k_STANDARD), 0, 0, 1, 1}, {&__pyx_n_s_STAR, __pyx_k_STAR, sizeof(__pyx_k_STAR), 0, 0, 1, 1}, {&__pyx_n_s_STCG, __pyx_k_STCG, sizeof(__pyx_k_STCG), 0, 0, 1, 1}, {&__pyx_n_s_STDERR, __pyx_k_STDERR, sizeof(__pyx_k_STDERR), 0, 0, 1, 1}, {&__pyx_n_s_STDOUT, __pyx_k_STDOUT, sizeof(__pyx_k_STDOUT), 0, 0, 1, 1}, {&__pyx_n_s_STEPOVER, __pyx_k_STEPOVER, sizeof(__pyx_k_STEPOVER), 0, 0, 1, 1}, {&__pyx_n_s_STRIDE, __pyx_k_STRIDE, sizeof(__pyx_k_STRIDE), 0, 0, 1, 1}, {&__pyx_n_s_STRING, __pyx_k_STRING, sizeof(__pyx_k_STRING), 0, 0, 1, 1}, {&__pyx_n_s_STRUCTURALLY_SYMMETRIC, __pyx_k_STRUCTURALLY_SYMMETRIC, sizeof(__pyx_k_STRUCTURALLY_SYMMETRIC), 0, 0, 1, 1}, {&__pyx_n_s_STRUCTURE_ONLY, __pyx_k_STRUCTURE_ONLY, sizeof(__pyx_k_STRUCTURE_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_STRUMPACK, __pyx_k_STRUMPACK, sizeof(__pyx_k_STRUMPACK), 0, 0, 1, 1}, {&__pyx_n_s_SUBMATRIX, __pyx_k_SUBMATRIX, sizeof(__pyx_k_SUBMATRIX), 0, 0, 1, 1}, {&__pyx_n_s_SUBMAT_SINGLEIS, __pyx_k_SUBMAT_SINGLEIS, sizeof(__pyx_k_SUBMAT_SINGLEIS), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET, __pyx_k_SUBSET, sizeof(__pyx_k_SUBSET), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET_NONZERO_PATTERN, __pyx_k_SUBSET_NONZERO_PATTERN, sizeof(__pyx_k_SUBSET_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET_NZ, __pyx_k_SUBSET_NZ, sizeof(__pyx_k_SUBSET_NZ), 0, 0, 1, 1}, {&__pyx_n_s_SUBSET_OFF_PROC_ENTRIES, __pyx_k_SUBSET_OFF_PROC_ENTRIES, sizeof(__pyx_k_SUBSET_OFF_PROC_ENTRIES), 0, 0, 1, 1}, {&__pyx_n_s_SUNDIALS, __pyx_k_SUNDIALS, sizeof(__pyx_k_SUNDIALS), 0, 0, 1, 1}, {&__pyx_n_s_SUPERLU, __pyx_k_SUPERLU, sizeof(__pyx_k_SUPERLU), 0, 0, 1, 1}, {&__pyx_n_s_SUPERLU_DIST, __pyx_k_SUPERLU_DIST, sizeof(__pyx_k_SUPERLU_DIST), 0, 0, 1, 1}, {&__pyx_n_s_SVD, __pyx_k_SVD, sizeof(__pyx_k_SVD), 0, 0, 1, 1}, {&__pyx_n_s_SWARM, __pyx_k_SWARM, sizeof(__pyx_k_SWARM), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRIC, __pyx_k_SYMMETRIC, sizeof(__pyx_k_SYMMETRIC), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRIC_MULTIPLICATIVE, __pyx_k_SYMMETRIC_MULTIPLICATIVE, sizeof(__pyx_k_SYMMETRIC_MULTIPLICATIVE), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRY_ETERNAL, __pyx_k_SYMMETRY_ETERNAL, sizeof(__pyx_k_SYMMETRY_ETERNAL), 0, 0, 1, 1}, {&__pyx_n_s_SYMMETRY_SWEEP, __pyx_k_SYMMETRY_SWEEP, sizeof(__pyx_k_SYMMETRY_SWEEP), 0, 0, 1, 1}, {&__pyx_n_s_SYMMLQ, __pyx_k_SYMMLQ, sizeof(__pyx_k_SYMMLQ), 0, 0, 1, 1}, {&__pyx_n_s_SYSPFMG, __pyx_k_SYSPFMG, sizeof(__pyx_k_SYSPFMG), 0, 0, 1, 1}, {&__pyx_n_s_ScalarType, __pyx_k_ScalarType, sizeof(__pyx_k_ScalarType), 0, 0, 1, 1}, {&__pyx_n_s_Scatter, __pyx_k_Scatter, sizeof(__pyx_k_Scatter), 0, 0, 1, 1}, {&__pyx_n_s_ScatterMode, __pyx_k_ScatterMode, sizeof(__pyx_k_ScatterMode), 0, 0, 1, 1}, {&__pyx_n_s_ScatterType, __pyx_k_ScatterType, sizeof(__pyx_k_ScatterType), 0, 0, 1, 1}, {&__pyx_n_s_SchurFactType, __pyx_k_SchurFactType, sizeof(__pyx_k_SchurFactType), 0, 0, 1, 1}, {&__pyx_n_s_SchurPreType, __pyx_k_SchurPreType, sizeof(__pyx_k_SchurPreType), 0, 0, 1, 1}, {&__pyx_n_s_Section, __pyx_k_Section, sizeof(__pyx_k_Section), 0, 0, 1, 1}, {&__pyx_n_s_Side, __pyx_k_Side, sizeof(__pyx_k_Side), 0, 0, 1, 1}, {&__pyx_n_s_Size, __pyx_k_Size, sizeof(__pyx_k_Size), 0, 0, 1, 1}, {&__pyx_n_s_SolverType, __pyx_k_SolverType, sizeof(__pyx_k_SolverType), 0, 0, 1, 1}, {&__pyx_n_s_Stage, __pyx_k_Stage, sizeof(__pyx_k_Stage), 0, 0, 1, 1}, {&__pyx_n_s_Stencil, __pyx_k_Stencil, sizeof(__pyx_k_Stencil), 0, 0, 1, 1}, {&__pyx_n_s_StencilLocation, __pyx_k_StencilLocation, sizeof(__pyx_k_StencilLocation), 0, 0, 1, 1}, {&__pyx_n_s_StencilType, __pyx_k_StencilType, sizeof(__pyx_k_StencilType), 0, 0, 1, 1}, {&__pyx_n_s_Structure, __pyx_k_Structure, sizeof(__pyx_k_Structure), 0, 0, 1, 1}, {&__pyx_n_s_Sys, __pyx_k_Sys, sizeof(__pyx_k_Sys), 0, 0, 1, 1}, {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1}, {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, {&__pyx_n_s_TAO, __pyx_k_TAO, sizeof(__pyx_k_TAO), 0, 0, 1, 1}, {&__pyx_n_s_TAOConvergedReason, __pyx_k_TAOConvergedReason, sizeof(__pyx_k_TAOConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_TAOType, __pyx_k_TAOType, sizeof(__pyx_k_TAOType), 0, 0, 1, 1}, {&__pyx_kp_s_TAO_Solver_Termination_Reasons, __pyx_k_TAO_Solver_Termination_Reasons, sizeof(__pyx_k_TAO_Solver_Termination_Reasons), 0, 0, 1, 0}, {&__pyx_kp_s_TAO_Solver_Types, __pyx_k_TAO_Solver_Types, sizeof(__pyx_k_TAO_Solver_Types), 0, 0, 1, 0}, {&__pyx_n_s_TCQMR, __pyx_k_TCQMR, sizeof(__pyx_k_TCQMR), 0, 0, 1, 1}, {&__pyx_n_s_TELESCOPE, __pyx_k_TELESCOPE, sizeof(__pyx_k_TELESCOPE), 0, 0, 1, 1}, {&__pyx_n_s_TFQMR, __pyx_k_TFQMR, sizeof(__pyx_k_TFQMR), 0, 0, 1, 1}, {&__pyx_n_s_TFS, __pyx_k_TFS, sizeof(__pyx_k_TFS), 0, 0, 1, 1}, {&__pyx_n_s_TH, __pyx_k_TH, sizeof(__pyx_k_TH), 0, 0, 1, 1}, {&__pyx_n_s_THETA, __pyx_k_THETA, sizeof(__pyx_k_THETA), 0, 0, 1, 1}, {&__pyx_n_s_THIRD, __pyx_k_THIRD, sizeof(__pyx_k_THIRD), 0, 0, 1, 1}, {&__pyx_n_s_THIRD_SIZE, __pyx_k_THIRD_SIZE, sizeof(__pyx_k_THIRD_SIZE), 0, 0, 1, 1}, {&__pyx_n_s_TRANSPOSEMAT, __pyx_k_TRANSPOSEMAT, sizeof(__pyx_k_TRANSPOSEMAT), 0, 0, 1, 1}, {&__pyx_n_s_TRON, __pyx_k_TRON, sizeof(__pyx_k_TRON), 0, 0, 1, 1}, {&__pyx_n_s_TS, __pyx_k_TS, sizeof(__pyx_k_TS), 0, 0, 1, 1}, {&__pyx_n_s_TSARKIMEXType, __pyx_k_TSARKIMEXType, sizeof(__pyx_k_TSARKIMEXType), 0, 0, 1, 1}, {&__pyx_n_s_TSConvergedReason, __pyx_k_TSConvergedReason, sizeof(__pyx_k_TSConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_TSEquationType, __pyx_k_TSEquationType, sizeof(__pyx_k_TSEquationType), 0, 0, 1, 1}, {&__pyx_n_s_TSExactFinalTime, __pyx_k_TSExactFinalTime, sizeof(__pyx_k_TSExactFinalTime), 0, 0, 1, 1}, {&__pyx_n_s_TSIRM, __pyx_k_TSIRM, sizeof(__pyx_k_TSIRM), 0, 0, 1, 1}, {&__pyx_n_s_TSProblemType, __pyx_k_TSProblemType, sizeof(__pyx_k_TSProblemType), 0, 0, 1, 1}, {&__pyx_n_s_TSRKType, __pyx_k_TSRKType, sizeof(__pyx_k_TSRKType), 0, 0, 1, 1}, {&__pyx_n_s_TSType, __pyx_k_TSType, sizeof(__pyx_k_TSType), 0, 0, 1, 1}, {&__pyx_n_s_TWIST, __pyx_k_TWIST, sizeof(__pyx_k_TWIST), 0, 0, 1, 1}, {&__pyx_kp_b_T_2, __pyx_k_T_2, sizeof(__pyx_k_T_2), 0, 0, 0, 0}, {&__pyx_kp_s_Tensor_dtype_does_not_match_PETS, __pyx_k_Tensor_dtype_does_not_match_PETS, sizeof(__pyx_k_Tensor_dtype_does_not_match_PETS), 0, 0, 1, 0}, {&__pyx_n_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, {&__pyx_n_s_UA, __pyx_k_UA, sizeof(__pyx_k_UA), 0, 0, 1, 1}, {&__pyx_n_s_UMFPACK, __pyx_k_UMFPACK, sizeof(__pyx_k_UMFPACK), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN_NONZERO_PATTERN, __pyx_k_UNKNOWN_NONZERO_PATTERN, sizeof(__pyx_k_UNKNOWN_NONZERO_PATTERN), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN_NZ, __pyx_k_UNKNOWN_NZ, sizeof(__pyx_k_UNKNOWN_NZ), 0, 0, 1, 1}, {&__pyx_n_s_UNPRECONDITIONED, __pyx_k_UNPRECONDITIONED, sizeof(__pyx_k_UNPRECONDITIONED), 0, 0, 1, 1}, {&__pyx_n_s_UNSPECIFIED, __pyx_k_UNSPECIFIED, sizeof(__pyx_k_UNSPECIFIED), 0, 0, 1, 1}, {&__pyx_n_s_UNUSED_NONZERO_LOCATION_ERR, __pyx_k_UNUSED_NONZERO_LOCATION_ERR, sizeof(__pyx_k_UNUSED_NONZERO_LOCATION_ERR), 0, 0, 1, 1}, {&__pyx_n_s_UP, __pyx_k_UP, sizeof(__pyx_k_UP), 0, 0, 1, 1}, {&__pyx_n_s_UPDATE, __pyx_k_UPDATE, sizeof(__pyx_k_UPDATE), 0, 0, 1, 1}, {&__pyx_n_s_UPPER, __pyx_k_UPPER, sizeof(__pyx_k_UPPER), 0, 0, 1, 1}, {&__pyx_n_s_UP_LEFT, __pyx_k_UP_LEFT, sizeof(__pyx_k_UP_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_UP_RIGHT, __pyx_k_UP_RIGHT, sizeof(__pyx_k_UP_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_USER, __pyx_k_USER, sizeof(__pyx_k_USER), 0, 0, 1, 1}, {&__pyx_n_s_USE_HASH_TABLE, __pyx_k_USE_HASH_TABLE, sizeof(__pyx_k_USE_HASH_TABLE), 0, 0, 1, 1}, {&__pyx_n_s_USE_INODES, __pyx_k_USE_INODES, sizeof(__pyx_k_USE_INODES), 0, 0, 1, 1}, {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0}, {&__pyx_kp_s_Unsupported_PetscScalar_type, __pyx_k_Unsupported_PetscScalar_type, sizeof(__pyx_k_Unsupported_PetscScalar_type), 0, 0, 1, 0}, {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1}, {&__pyx_n_s_VANKA, __pyx_k_VANKA, sizeof(__pyx_k_VANKA), 0, 0, 1, 1}, {&__pyx_n_s_VIENNACL, __pyx_k_VIENNACL, sizeof(__pyx_k_VIENNACL), 0, 0, 1, 1}, {&__pyx_n_s_VINEWTONRSLS, __pyx_k_VINEWTONRSLS, sizeof(__pyx_k_VINEWTONRSLS), 0, 0, 1, 1}, {&__pyx_n_s_VINEWTONSSLS, __pyx_k_VINEWTONSSLS, sizeof(__pyx_k_VINEWTONSSLS), 0, 0, 1, 1}, {&__pyx_n_s_VPBJACOBI, __pyx_k_VPBJACOBI, sizeof(__pyx_k_VPBJACOBI), 0, 0, 1, 1}, {&__pyx_n_s_VTK, __pyx_k_VTK, sizeof(__pyx_k_VTK), 0, 0, 1, 1}, {&__pyx_n_s_VTK_VTR, __pyx_k_VTK_VTR, sizeof(__pyx_k_VTK_VTR), 0, 0, 1, 1}, {&__pyx_n_s_VTK_VTS, __pyx_k_VTK_VTS, sizeof(__pyx_k_VTK_VTS), 0, 0, 1, 1}, {&__pyx_n_s_VTK_VTU, __pyx_k_VTK_VTU, sizeof(__pyx_k_VTK_VTU), 0, 0, 1, 1}, {&__pyx_n_s_VU, __pyx_k_VU, sizeof(__pyx_k_VU), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_Vec, __pyx_k_Vec, sizeof(__pyx_k_Vec), 0, 0, 1, 1}, {&__pyx_n_s_VecOption, __pyx_k_VecOption, sizeof(__pyx_k_VecOption), 0, 0, 1, 1}, {&__pyx_n_s_VecType, __pyx_k_VecType, sizeof(__pyx_k_VecType), 0, 0, 1, 1}, {&__pyx_n_s_Vec_LocalForm, __pyx_k_Vec_LocalForm, sizeof(__pyx_k_Vec_LocalForm), 0, 0, 1, 1}, {&__pyx_n_s_Vec_buffer, __pyx_k_Vec_buffer, sizeof(__pyx_k_Vec_buffer), 0, 0, 1, 1}, {&__pyx_kp_s_Vector_local_size_d_is_not_compa, __pyx_k_Vector_local_size_d_is_not_compa, sizeof(__pyx_k_Vector_local_size_d_is_not_compa), 0, 0, 1, 0}, {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1}, {&__pyx_n_s_Viewer, __pyx_k_Viewer, sizeof(__pyx_k_Viewer), 0, 0, 1, 1}, {&__pyx_n_s_ViewerFormat, __pyx_k_ViewerFormat, sizeof(__pyx_k_ViewerFormat), 0, 0, 1, 1}, {&__pyx_n_s_ViewerHDF5, __pyx_k_ViewerHDF5, sizeof(__pyx_k_ViewerHDF5), 0, 0, 1, 1}, {&__pyx_n_s_ViewerType, __pyx_k_ViewerType, sizeof(__pyx_k_ViewerType), 0, 0, 1, 1}, {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, {&__pyx_n_s_WBM, __pyx_k_WBM, sizeof(__pyx_k_WBM), 0, 0, 1, 1}, {&__pyx_n_s_WINDOW, __pyx_k_WINDOW, sizeof(__pyx_k_WINDOW), 0, 0, 1, 1}, {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1}, {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1}, {&__pyx_n_s_ZERO_INITIAL_GUESS, __pyx_k_ZERO_INITIAL_GUESS, sizeof(__pyx_k_ZERO_INITIAL_GUESS), 0, 0, 1, 1}, {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0}, {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0}, {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0}, {&__pyx_kp_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0}, {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0}, {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0}, {&__pyx_kp_b__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 0, 0}, {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, {&__pyx_kp_b__72, __pyx_k__72, sizeof(__pyx_k__72), 0, 0, 0, 0}, {&__pyx_kp_b__73, __pyx_k__73, sizeof(__pyx_k__73), 0, 0, 0, 0}, {&__pyx_kp_b__74, __pyx_k__74, sizeof(__pyx_k__74), 0, 0, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_kp_s_a_2, __pyx_k_a_2, sizeof(__pyx_k_a_2), 0, 0, 1, 0}, {&__pyx_n_s_abort, __pyx_k_abort, sizeof(__pyx_k_abort), 0, 0, 1, 1}, {&__pyx_kp_s_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 0, 1, 0}, {&__pyx_n_s_addFlops, __pyx_k_addFlops, sizeof(__pyx_k_addFlops), 0, 0, 1, 1}, {&__pyx_n_s_addv, __pyx_k_addv, sizeof(__pyx_k_addv), 0, 0, 1, 1}, {&__pyx_n_s_adjoint_steps, __pyx_k_adjoint_steps, sizeof(__pyx_k_adjoint_steps), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1}, {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1}, {&__pyx_n_s_alpha2, __pyx_k_alpha2, sizeof(__pyx_k_alpha2), 0, 0, 1, 1}, {&__pyx_n_s_alpha_f, __pyx_k_alpha_f, sizeof(__pyx_k_alpha_f), 0, 0, 1, 1}, {&__pyx_n_s_alpha_m, __pyx_k_alpha_m, sizeof(__pyx_k_alpha_m), 0, 0, 1, 1}, {&__pyx_n_s_alphas, __pyx_k_alphas, sizeof(__pyx_k_alphas), 0, 0, 1, 1}, {&__pyx_n_s_amount, __pyx_k_amount, sizeof(__pyx_k_amount), 0, 0, 1, 1}, {&__pyx_n_s_app, __pyx_k_app, sizeof(__pyx_k_app), 0, 0, 1, 1}, {&__pyx_n_s_appctx, __pyx_k_appctx, sizeof(__pyx_k_appctx), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1}, {&__pyx_n_s_array_interface, __pyx_k_array_interface, sizeof(__pyx_k_array_interface), 0, 0, 1, 1}, {&__pyx_kp_s_array_size_d_and_vector_local_si, __pyx_k_array_size_d_and_vector_local_si, sizeof(__pyx_k_array_size_d_and_vector_local_si), 0, 0, 1, 0}, {&__pyx_kp_s_array_size_d_incompatible_with_v, __pyx_k_array_size_d_incompatible_with_v, sizeof(__pyx_k_array_size_d_incompatible_with_v), 0, 0, 1, 0}, {&__pyx_n_s_array_w, __pyx_k_array_w, sizeof(__pyx_k_array_w), 0, 0, 1, 1}, {&__pyx_n_s_asmtype, __pyx_k_asmtype, sizeof(__pyx_k_asmtype), 0, 0, 1, 1}, {&__pyx_n_s_assemblies, __pyx_k_assemblies, sizeof(__pyx_k_assemblies), 0, 0, 1, 1}, {&__pyx_n_s_assembly, __pyx_k_assembly, sizeof(__pyx_k_assembly), 0, 0, 1, 1}, {&__pyx_n_s_atol, __pyx_k_atol, sizeof(__pyx_k_atol), 0, 0, 1, 1}, {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1}, {&__pyx_n_s_au, __pyx_k_au, sizeof(__pyx_k_au), 0, 0, 1, 1}, {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, {&__pyx_n_s_authorinfo, __pyx_k_authorinfo, sizeof(__pyx_k_authorinfo), 0, 0, 1, 1}, {&__pyx_n_s_axpy, __pyx_k_axpy, sizeof(__pyx_k_axpy), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_back, __pyx_k_back, sizeof(__pyx_k_back), 0, 0, 1, 1}, {&__pyx_n_s_back_down, __pyx_k_back_down, sizeof(__pyx_k_back_down), 0, 0, 1, 1}, {&__pyx_n_s_back_down_left, __pyx_k_back_down_left, sizeof(__pyx_k_back_down_left), 0, 0, 1, 1}, {&__pyx_n_s_back_down_right, __pyx_k_back_down_right, sizeof(__pyx_k_back_down_right), 0, 0, 1, 1}, {&__pyx_n_s_back_left, __pyx_k_back_left, sizeof(__pyx_k_back_left), 0, 0, 1, 1}, {&__pyx_n_s_back_right, __pyx_k_back_right, sizeof(__pyx_k_back_right), 0, 0, 1, 1}, {&__pyx_n_s_back_up, __pyx_k_back_up, sizeof(__pyx_k_back_up), 0, 0, 1, 1}, {&__pyx_n_s_back_up_left, __pyx_k_back_up_left, sizeof(__pyx_k_back_up_left), 0, 0, 1, 1}, {&__pyx_n_s_back_up_right, __pyx_k_back_up_right, sizeof(__pyx_k_back_up_right), 0, 0, 1, 1}, {&__pyx_n_s_barrier, __pyx_k_barrier, sizeof(__pyx_k_barrier), 0, 0, 1, 1}, {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, {&__pyx_n_s_bcComps, __pyx_k_bcComps, sizeof(__pyx_k_bcComps), 0, 0, 1, 1}, {&__pyx_n_s_bcField, __pyx_k_bcField, sizeof(__pyx_k_bcField), 0, 0, 1, 1}, {&__pyx_n_s_bcPoints, __pyx_k_bcPoints, sizeof(__pyx_k_bcPoints), 0, 0, 1, 1}, {&__pyx_kp_s_bcPoints_is_a_required_argument, __pyx_k_bcPoints_is_a_required_argument, sizeof(__pyx_k_bcPoints_is_a_required_argument), 0, 0, 1, 0}, {&__pyx_n_s_begin, __pyx_k_begin, sizeof(__pyx_k_begin), 0, 0, 1, 1}, {&__pyx_n_s_begin_args, __pyx_k_begin_args, sizeof(__pyx_k_begin_args), 0, 0, 1, 1}, {&__pyx_n_s_begin_kargs, __pyx_k_begin_kargs, sizeof(__pyx_k_begin_kargs), 0, 0, 1, 1}, {&__pyx_n_s_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 0, 1, 1}, {&__pyx_n_s_bits, __pyx_k_bits, sizeof(__pyx_k_bits), 0, 0, 1, 1}, {&__pyx_n_s_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 0, 1, 1}, {&__pyx_kp_s_block_size_d_must_be_positive, __pyx_k_block_size_d_must_be_positive, sizeof(__pyx_k_block_size_d_must_be_positive), 0, 0, 1, 0}, {&__pyx_kp_s_block_size_not_set, __pyx_k_block_size_not_set, sizeof(__pyx_k_block_size_not_set), 0, 0, 1, 0}, {&__pyx_n_s_blocksize, __pyx_k_blocksize, sizeof(__pyx_k_blocksize), 0, 0, 1, 1}, {&__pyx_n_s_bndr, __pyx_k_bndr, sizeof(__pyx_k_bndr), 0, 0, 1, 1}, {&__pyx_n_s_boundary, __pyx_k_boundary, sizeof(__pyx_k_boundary), 0, 0, 1, 1}, {&__pyx_n_s_boundary_type, __pyx_k_boundary_type, sizeof(__pyx_k_boundary_type), 0, 0, 1, 1}, {&__pyx_n_s_boundary_types, __pyx_k_boundary_types, sizeof(__pyx_k_boundary_types), 0, 0, 1, 1}, {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1}, {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1}, {&__pyx_n_s_bsize, __pyx_k_bsize, sizeof(__pyx_k_bsize), 0, 0, 1, 1}, {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1}, {&__pyx_n_s_buffer_w, __pyx_k_buffer_w, sizeof(__pyx_k_buffer_w), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1}, {&__pyx_kp_s_c_d, __pyx_k_c_d, sizeof(__pyx_k_c_d), 0, 0, 1, 0}, {&__pyx_kp_s_cannot_place_input_array_size_d, __pyx_k_cannot_place_input_array_size_d, sizeof(__pyx_k_cannot_place_input_array_size_d), 0, 0, 1, 0}, {&__pyx_n_s_catol, __pyx_k_catol, sizeof(__pyx_k_catol), 0, 0, 1, 1}, {&__pyx_n_s_cell, __pyx_k_cell, sizeof(__pyx_k_cell), 0, 0, 1, 1}, {&__pyx_n_s_cellNodeMaps, __pyx_k_cellNodeMaps, sizeof(__pyx_k_cellNodeMaps), 0, 0, 1, 1}, {&__pyx_kp_s_cell_indices_must_have_two_dimen, __pyx_k_cell_indices_must_have_two_dimen, sizeof(__pyx_k_cell_indices_must_have_two_dimen), 0, 0, 1, 0}, {&__pyx_n_s_cells, __pyx_k_cells, sizeof(__pyx_k_cells), 0, 0, 1, 1}, {&__pyx_n_s_cgid, __pyx_k_cgid, sizeof(__pyx_k_cgid), 0, 0, 1, 1}, {&__pyx_n_s_citation, __pyx_k_citation, sizeof(__pyx_k_citation), 0, 0, 1, 1}, {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_cmap, __pyx_k_cmap, sizeof(__pyx_k_cmap), 0, 0, 1, 1}, {&__pyx_n_s_coarsen, __pyx_k_coarsen, sizeof(__pyx_k_coarsen), 0, 0, 1, 1}, {&__pyx_n_s_coarsenhook, __pyx_k_coarsenhook, sizeof(__pyx_k_coarsenhook), 0, 0, 1, 1}, {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1}, {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1}, {&__pyx_n_s_col_bsize, __pyx_k_col_bsize, sizeof(__pyx_k_col_bsize), 0, 0, 1, 1}, {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1}, {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1}, {&__pyx_kp_s_column_indices_must_have_two_dim, __pyx_k_column_indices_must_have_two_dim, sizeof(__pyx_k_column_indices_must_have_two_dim), 0, 0, 1, 0}, {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1}, {&__pyx_n_s_comms, __pyx_k_comms, sizeof(__pyx_k_comms), 0, 0, 1, 1}, {&__pyx_kp_s_communicator_not_owned, __pyx_k_communicator_not_owned, sizeof(__pyx_k_communicator_not_owned), 0, 0, 1, 0}, {&__pyx_n_s_compressed, __pyx_k_compressed, sizeof(__pyx_k_compressed), 0, 0, 1, 1}, {&__pyx_n_s_cone, __pyx_k_cone, sizeof(__pyx_k_cone), 0, 0, 1, 1}, {&__pyx_n_s_coneOrientation, __pyx_k_coneOrientation, sizeof(__pyx_k_coneOrientation), 0, 0, 1, 1}, {&__pyx_n_s_conePoint, __pyx_k_conePoint, sizeof(__pyx_k_conePoint), 0, 0, 1, 1}, {&__pyx_n_s_conePos, __pyx_k_conePos, sizeof(__pyx_k_conePos), 0, 0, 1, 1}, {&__pyx_n_s_conforming, __pyx_k_conforming, sizeof(__pyx_k_conforming), 0, 0, 1, 1}, {&__pyx_n_s_constant, __pyx_k_constant, sizeof(__pyx_k_constant), 0, 0, 1, 1}, {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1}, {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0}, {&__pyx_n_s_converged, __pyx_k_converged, sizeof(__pyx_k_converged), 0, 0, 1, 1}, {&__pyx_n_s_coordinates, __pyx_k_coordinates, sizeof(__pyx_k_coordinates), 0, 0, 1, 1}, {&__pyx_kp_s_coordinates_must_have_two_dimens, __pyx_k_coordinates_must_have_two_dimens, sizeof(__pyx_k_coordinates_must_have_two_dimens), 0, 0, 1, 0}, {&__pyx_n_s_coords, __pyx_k_coords, sizeof(__pyx_k_coords), 0, 0, 1, 1}, {&__pyx_kp_s_coords_vertices_must_have_two_di, __pyx_k_coords_vertices_must_have_two_di, sizeof(__pyx_k_coords_vertices_must_have_two_di), 0, 0, 1, 0}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_cpuarray, __pyx_k_cpuarray, sizeof(__pyx_k_cpuarray), 0, 0, 1, 1}, {&__pyx_n_s_crank, __pyx_k_crank, sizeof(__pyx_k_crank), 0, 0, 1, 1}, {&__pyx_n_s_cratio, __pyx_k_cratio, sizeof(__pyx_k_cratio), 0, 0, 1, 1}, {&__pyx_n_s_createDefaultSF, __pyx_k_createDefaultSF, sizeof(__pyx_k_createDefaultSF), 0, 0, 1, 1}, {&__pyx_n_s_createGlobalVec, __pyx_k_createGlobalVec, sizeof(__pyx_k_createGlobalVec), 0, 0, 1, 1}, {&__pyx_n_s_createGlobalVector, __pyx_k_createGlobalVector, sizeof(__pyx_k_createGlobalVector), 0, 0, 1, 1}, {&__pyx_n_s_createLabel, __pyx_k_createLabel, sizeof(__pyx_k_createLabel), 0, 0, 1, 1}, {&__pyx_n_s_createLocalVec, __pyx_k_createLocalVec, sizeof(__pyx_k_createLocalVec), 0, 0, 1, 1}, {&__pyx_n_s_createLocalVector, __pyx_k_createLocalVector, sizeof(__pyx_k_createLocalVector), 0, 0, 1, 1}, {&__pyx_n_s_createMat, __pyx_k_createMat, sizeof(__pyx_k_createMat), 0, 0, 1, 1}, {&__pyx_n_s_createMatrix, __pyx_k_createMatrix, sizeof(__pyx_k_createMatrix), 0, 0, 1, 1}, {&__pyx_n_s_createNaturalVec, __pyx_k_createNaturalVec, sizeof(__pyx_k_createNaturalVec), 0, 0, 1, 1}, {&__pyx_n_s_createNaturalVector, __pyx_k_createNaturalVector, sizeof(__pyx_k_createNaturalVector), 0, 0, 1, 1}, {&__pyx_n_s_createSectionSF, __pyx_k_createSectionSF, sizeof(__pyx_k_createSectionSF), 0, 0, 1, 1}, {&__pyx_n_s_createVecLeft, __pyx_k_createVecLeft, sizeof(__pyx_k_createVecLeft), 0, 0, 1, 1}, {&__pyx_n_s_createVecRight, __pyx_k_createVecRight, sizeof(__pyx_k_createVecRight), 0, 0, 1, 1}, {&__pyx_n_s_createVecs, __pyx_k_createVecs, sizeof(__pyx_k_createVecs), 0, 0, 1, 1}, {&__pyx_n_s_create_gvec, __pyx_k_create_gvec, sizeof(__pyx_k_create_gvec), 0, 0, 1, 1}, {&__pyx_n_s_create_injection, __pyx_k_create_injection, sizeof(__pyx_k_create_injection), 0, 0, 1, 1}, {&__pyx_n_s_create_interpolation, __pyx_k_create_interpolation, sizeof(__pyx_k_create_interpolation), 0, 0, 1, 1}, {&__pyx_n_s_create_lvec, __pyx_k_create_lvec, sizeof(__pyx_k_create_lvec), 0, 0, 1, 1}, {&__pyx_n_s_create_matrix, __pyx_k_create_matrix, sizeof(__pyx_k_create_matrix), 0, 0, 1, 1}, {&__pyx_n_s_create_restriction, __pyx_k_create_restriction, sizeof(__pyx_k_create_restriction), 0, 0, 1, 1}, {&__pyx_n_s_create_subdm, __pyx_k_create_subdm, sizeof(__pyx_k_create_subdm), 0, 0, 1, 1}, {&__pyx_n_s_crtol, __pyx_k_crtol, sizeof(__pyx_k_crtol), 0, 0, 1, 1}, {&__pyx_n_s_csize, __pyx_k_csize, sizeof(__pyx_k_csize), 0, 0, 1, 1}, {&__pyx_n_s_csr, __pyx_k_csr, sizeof(__pyx_k_csr), 0, 0, 1, 1}, {&__pyx_n_s_ctype, __pyx_k_ctype, sizeof(__pyx_k_ctype), 0, 0, 1, 1}, {&__pyx_n_s_cudahandle, __pyx_k_cudahandle, sizeof(__pyx_k_cudahandle), 0, 0, 1, 1}, {&__pyx_n_s_cycle_type, __pyx_k_cycle_type, sizeof(__pyx_k_cycle_type), 0, 0, 1, 1}, {&__pyx_kp_s_d_s, __pyx_k_d_s, sizeof(__pyx_k_d_s), 0, 0, 1, 0}, {&__pyx_n_s_da, __pyx_k_da, sizeof(__pyx_k_da), 0, 0, 1, 1}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1}, {&__pyx_n_s_debugger, __pyx_k_debugger, sizeof(__pyx_k_debugger), 0, 0, 1, 1}, {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1}, {&__pyx_n_s_decomp, __pyx_k_decomp, sizeof(__pyx_k_decomp), 0, 0, 1, 1}, {&__pyx_n_s_decorator, __pyx_k_decorator, sizeof(__pyx_k_decorator), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_delValue, __pyx_k_delValue, sizeof(__pyx_k_delValue), 0, 0, 1, 1}, {&__pyx_n_s_design, __pyx_k_design, sizeof(__pyx_k_design), 0, 0, 1, 1}, {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1}, {&__pyx_n_s_devel, __pyx_k_devel, sizeof(__pyx_k_devel), 0, 0, 1, 1}, {&__pyx_n_s_diag, __pyx_k_diag, sizeof(__pyx_k_diag), 0, 0, 1, 1}, {&__pyx_n_s_diagonalScale, __pyx_k_diagonalScale, sizeof(__pyx_k_diagonalScale), 0, 0, 1, 1}, {&__pyx_n_s_diagonal_fill, __pyx_k_diagonal_fill, sizeof(__pyx_k_diagonal_fill), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 0, 1, 1}, {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1}, {&__pyx_n_s_direction, __pyx_k_direction, sizeof(__pyx_k_direction), 0, 0, 1, 1}, {&__pyx_n_s_disc, __pyx_k_disc, sizeof(__pyx_k_disc), 0, 0, 1, 1}, {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1}, {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1}, {&__pyx_n_s_divtol, __pyx_k_divtol, sizeof(__pyx_k_divtol), 0, 0, 1, 1}, {&__pyx_n_s_dlpack, __pyx_k_dlpack, sizeof(__pyx_k_dlpack), 0, 0, 1, 1}, {&__pyx_n_s_dltensor, __pyx_k_dltensor, sizeof(__pyx_k_dltensor), 0, 0, 1, 1}, {&__pyx_n_s_dm, __pyx_k_dm, sizeof(__pyx_k_dm), 0, 0, 1, 1}, {&__pyx_n_s_dmTo, __pyx_k_dmTo, sizeof(__pyx_k_dmTo), 0, 0, 1, 1}, {&__pyx_n_s_dm_type, __pyx_k_dm_type, sizeof(__pyx_k_dm_type), 0, 0, 1, 1}, {&__pyx_n_s_dms, __pyx_k_dms, sizeof(__pyx_k_dms), 0, 0, 1, 1}, {&__pyx_n_s_dmswarm_type, __pyx_k_dmswarm_type, sizeof(__pyx_k_dmswarm_type), 0, 0, 1, 1}, {&__pyx_n_s_dmtype, __pyx_k_dmtype, sizeof(__pyx_k_dmtype), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dof, __pyx_k_dof, sizeof(__pyx_k_dof), 0, 0, 1, 1}, {&__pyx_n_s_dofs, __pyx_k_dofs, sizeof(__pyx_k_dofs), 0, 0, 1, 1}, {&__pyx_n_s_down, __pyx_k_down, sizeof(__pyx_k_down), 0, 0, 1, 1}, {&__pyx_n_s_down_left, __pyx_k_down_left, sizeof(__pyx_k_down_left), 0, 0, 1, 1}, {&__pyx_n_s_down_right, __pyx_k_down_right, sizeof(__pyx_k_down_right), 0, 0, 1, 1}, {&__pyx_n_s_drop, __pyx_k_drop, sizeof(__pyx_k_drop), 0, 0, 1, 1}, {&__pyx_n_s_ds_type, __pyx_k_ds_type, sizeof(__pyx_k_ds_type), 0, 0, 1, 1}, {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1}, {&__pyx_n_s_dtcol, __pyx_k_dtcol, sizeof(__pyx_k_dtcol), 0, 0, 1, 1}, {&__pyx_n_s_dtcount, __pyx_k_dtcount, sizeof(__pyx_k_dtcount), 0, 0, 1, 1}, {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1}, {&__pyx_n_s_duplicate, __pyx_k_duplicate, sizeof(__pyx_k_duplicate), 0, 0, 1, 1}, {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1}, {&__pyx_n_s_elem_type, __pyx_k_elem_type, sizeof(__pyx_k_elem_type), 0, 0, 1, 1}, {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1}, {&__pyx_n_s_emacs, __pyx_k_emacs, sizeof(__pyx_k_emacs), 0, 0, 1, 1}, {&__pyx_kp_s_empty_citation, __pyx_k_empty_citation, sizeof(__pyx_k_empty_citation), 0, 0, 1, 0}, {&__pyx_kp_s_empty_name, __pyx_k_empty_name, sizeof(__pyx_k_empty_name), 0, 0, 1, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_end_args, __pyx_k_end_args, sizeof(__pyx_k_end_args), 0, 0, 1, 1}, {&__pyx_n_s_end_kargs, __pyx_k_end_kargs, sizeof(__pyx_k_end_kargs), 0, 0, 1, 1}, {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, {&__pyx_n_s_entityDepth, __pyx_k_entityDepth, sizeof(__pyx_k_entityDepth), 0, 0, 1, 1}, {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_epsilon, __pyx_k_epsilon, sizeof(__pyx_k_epsilon), 0, 0, 1, 1}, {&__pyx_n_s_eqtype, __pyx_k_eqtype, sizeof(__pyx_k_eqtype), 0, 0, 1, 1}, {&__pyx_n_s_errhandler, __pyx_k_errhandler, sizeof(__pyx_k_errhandler), 0, 0, 1, 1}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_kp_s_error_code_d, __pyx_k_error_code_d, sizeof(__pyx_k_error_code_d), 0, 0, 1, 0}, {&__pyx_n_s_eventhandler, __pyx_k_eventhandler, sizeof(__pyx_k_eventhandler), 0, 0, 1, 1}, {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, {&__pyx_n_s_exoid, __pyx_k_exoid, sizeof(__pyx_k_exoid), 0, 0, 1, 1}, {&__pyx_kp_s_expecting_a_C_contiguous_array, __pyx_k_expecting_a_C_contiguous_array, sizeof(__pyx_k_expecting_a_C_contiguous_array), 0, 0, 1, 0}, {&__pyx_kp_s_expecting_tuple_list_or_dict, __pyx_k_expecting_tuple_list_or_dict, sizeof(__pyx_k_expecting_tuple_list_or_dict), 0, 0, 1, 0}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_n_s_faces, __pyx_k_faces, sizeof(__pyx_k_faces), 0, 0, 1, 1}, {&__pyx_n_s_factor_mallocs, __pyx_k_factor_mallocs, sizeof(__pyx_k_factor_mallocs), 0, 0, 1, 1}, {&__pyx_n_s_fe_type, __pyx_k_fe_type, sizeof(__pyx_k_fe_type), 0, 0, 1, 1}, {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1}, {&__pyx_n_s_fieldName, __pyx_k_fieldName, sizeof(__pyx_k_fieldName), 0, 0, 1, 1}, {&__pyx_n_s_fieldname, __pyx_k_fieldname, sizeof(__pyx_k_fieldname), 0, 0, 1, 1}, {&__pyx_n_s_fieldnames, __pyx_k_fieldnames, sizeof(__pyx_k_fieldnames), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1}, {&__pyx_n_s_fill_param, __pyx_k_fill_param, sizeof(__pyx_k_fill_param), 0, 0, 1, 1}, {&__pyx_n_s_fill_ratio_given, __pyx_k_fill_ratio_given, sizeof(__pyx_k_fill_ratio_given), 0, 0, 1, 1}, {&__pyx_n_s_fill_ratio_needed, __pyx_k_fill_ratio_needed, sizeof(__pyx_k_fill_ratio_needed), 0, 0, 1, 1}, {&__pyx_n_s_finalize, __pyx_k_finalize, sizeof(__pyx_k_finalize), 0, 0, 1, 1}, {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, {&__pyx_n_s_fix, __pyx_k_fix, sizeof(__pyx_k_fix), 0, 0, 1, 1}, {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, {&__pyx_n_s_flg, __pyx_k_flg, sizeof(__pyx_k_flg), 0, 0, 1, 1}, {&__pyx_n_s_flops, __pyx_k_flops, sizeof(__pyx_k_flops), 0, 0, 1, 1}, {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1}, {&__pyx_n_s_fnorm, __pyx_k_fnorm, sizeof(__pyx_k_fnorm), 0, 0, 1, 1}, {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1}, {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1}, {&__pyx_n_s_forward, __pyx_k_forward, sizeof(__pyx_k_forward), 0, 0, 1, 1}, {&__pyx_n_s_front, __pyx_k_front, sizeof(__pyx_k_front), 0, 0, 1, 1}, {&__pyx_n_s_front_down, __pyx_k_front_down, sizeof(__pyx_k_front_down), 0, 0, 1, 1}, {&__pyx_n_s_front_down_left, __pyx_k_front_down_left, sizeof(__pyx_k_front_down_left), 0, 0, 1, 1}, {&__pyx_n_s_front_down_right, __pyx_k_front_down_right, sizeof(__pyx_k_front_down_right), 0, 0, 1, 1}, {&__pyx_n_s_front_left, __pyx_k_front_left, sizeof(__pyx_k_front_left), 0, 0, 1, 1}, {&__pyx_n_s_front_right, __pyx_k_front_right, sizeof(__pyx_k_front_right), 0, 0, 1, 1}, {&__pyx_n_s_front_up, __pyx_k_front_up, sizeof(__pyx_k_front_up), 0, 0, 1, 1}, {&__pyx_n_s_front_up_left, __pyx_k_front_up_left, sizeof(__pyx_k_front_up_left), 0, 0, 1, 1}, {&__pyx_n_s_front_up_right, __pyx_k_front_up_right, sizeof(__pyx_k_front_up_right), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 0, 1, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_gamgtype, __pyx_k_gamgtype, sizeof(__pyx_k_gamgtype), 0, 0, 1, 1}, {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1}, {&__pyx_n_s_gasmtype, __pyx_k_gasmtype, sizeof(__pyx_k_gasmtype), 0, 0, 1, 1}, {&__pyx_n_s_gatol, __pyx_k_gatol, sizeof(__pyx_k_gatol), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_kp_s_get1dCoordinatecArrays_for_DMSta, __pyx_k_get1dCoordinatecArrays_for_DMSta, sizeof(__pyx_k_get1dCoordinatecArrays_for_DMSta), 0, 0, 1, 0}, {&__pyx_n_s_getActive, __pyx_k_getActive, sizeof(__pyx_k_getActive), 0, 0, 1, 1}, {&__pyx_n_s_getActiveAll, __pyx_k_getActiveAll, sizeof(__pyx_k_getActiveAll), 0, 0, 1, 1}, {&__pyx_n_s_getAppCtx, __pyx_k_getAppCtx, sizeof(__pyx_k_getAppCtx), 0, 0, 1, 1}, {&__pyx_n_s_getArray, __pyx_k_getArray, sizeof(__pyx_k_getArray), 0, 0, 1, 1}, {&__pyx_n_s_getBlockIndices, __pyx_k_getBlockIndices, sizeof(__pyx_k_getBlockIndices), 0, 0, 1, 1}, {&__pyx_n_s_getBlockInfo, __pyx_k_getBlockInfo, sizeof(__pyx_k_getBlockInfo), 0, 0, 1, 1}, {&__pyx_n_s_getBlockSize, __pyx_k_getBlockSize, sizeof(__pyx_k_getBlockSize), 0, 0, 1, 1}, {&__pyx_n_s_getBlockSizes, __pyx_k_getBlockSizes, sizeof(__pyx_k_getBlockSizes), 0, 0, 1, 1}, {&__pyx_n_s_getBoundaryType, __pyx_k_getBoundaryType, sizeof(__pyx_k_getBoundaryType), 0, 0, 1, 1}, {&__pyx_n_s_getBoundaryTypes, __pyx_k_getBoundaryTypes, sizeof(__pyx_k_getBoundaryTypes), 0, 0, 1, 1}, {&__pyx_n_s_getBuffer, __pyx_k_getBuffer, sizeof(__pyx_k_getBuffer), 0, 0, 1, 1}, {&__pyx_n_s_getCPUTime, __pyx_k_getCPUTime, sizeof(__pyx_k_getCPUTime), 0, 0, 1, 1}, {&__pyx_n_s_getClassId, __pyx_k_getClassId, sizeof(__pyx_k_getClassId), 0, 0, 1, 1}, {&__pyx_n_s_getClassName, __pyx_k_getClassName, sizeof(__pyx_k_getClassName), 0, 0, 1, 1}, {&__pyx_n_s_getComm, __pyx_k_getComm, sizeof(__pyx_k_getComm), 0, 0, 1, 1}, {&__pyx_n_s_getConstraintTolerances, __pyx_k_getConstraintTolerances, sizeof(__pyx_k_getConstraintTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getConvergedReason, __pyx_k_getConvergedReason, sizeof(__pyx_k_getConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_getConvergenceHistory, __pyx_k_getConvergenceHistory, sizeof(__pyx_k_getConvergenceHistory), 0, 0, 1, 1}, {&__pyx_n_s_getCorners, __pyx_k_getCorners, sizeof(__pyx_k_getCorners), 0, 0, 1, 1}, {&__pyx_n_s_getDM, __pyx_k_getDM, sizeof(__pyx_k_getDM), 0, 0, 1, 1}, {&__pyx_n_s_getDS, __pyx_k_getDS, sizeof(__pyx_k_getDS), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultComm, __pyx_k_getDefaultComm, sizeof(__pyx_k_getDefaultComm), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultGlobalSection, __pyx_k_getDefaultGlobalSection, sizeof(__pyx_k_getDefaultGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultSF, __pyx_k_getDefaultSF, sizeof(__pyx_k_getDefaultSF), 0, 0, 1, 1}, {&__pyx_n_s_getDefaultSection, __pyx_k_getDefaultSection, sizeof(__pyx_k_getDefaultSection), 0, 0, 1, 1}, {&__pyx_n_s_getDim, __pyx_k_getDim, sizeof(__pyx_k_getDim), 0, 0, 1, 1}, {&__pyx_n_s_getDimension, __pyx_k_getDimension, sizeof(__pyx_k_getDimension), 0, 0, 1, 1}, {&__pyx_n_s_getDof, __pyx_k_getDof, sizeof(__pyx_k_getDof), 0, 0, 1, 1}, {&__pyx_n_s_getEntriesPerElement, __pyx_k_getEntriesPerElement, sizeof(__pyx_k_getEntriesPerElement), 0, 0, 1, 1}, {&__pyx_n_s_getEquationType, __pyx_k_getEquationType, sizeof(__pyx_k_getEquationType), 0, 0, 1, 1}, {&__pyx_n_s_getFlops, __pyx_k_getFlops, sizeof(__pyx_k_getFlops), 0, 0, 1, 1}, {&__pyx_n_s_getFunctionNorm, __pyx_k_getFunctionNorm, sizeof(__pyx_k_getFunctionNorm), 0, 0, 1, 1}, {&__pyx_n_s_getFunctionTolerances, __pyx_k_getFunctionTolerances, sizeof(__pyx_k_getFunctionTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getFunctionValue, __pyx_k_getFunctionValue, sizeof(__pyx_k_getFunctionValue), 0, 0, 1, 1}, {&__pyx_n_s_getGhostCorners, __pyx_k_getGhostCorners, sizeof(__pyx_k_getGhostCorners), 0, 0, 1, 1}, {&__pyx_n_s_getGhostRanges, __pyx_k_getGhostRanges, sizeof(__pyx_k_getGhostRanges), 0, 0, 1, 1}, {&__pyx_n_s_getGlobalSection, __pyx_k_getGlobalSection, sizeof(__pyx_k_getGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_getGlobalSizes, __pyx_k_getGlobalSizes, sizeof(__pyx_k_getGlobalSizes), 0, 0, 1, 1}, {&__pyx_n_s_getGradient, __pyx_k_getGradient, sizeof(__pyx_k_getGradient), 0, 0, 1, 1}, {&__pyx_n_s_getGradientTolerances, __pyx_k_getGradientTolerances, sizeof(__pyx_k_getGradientTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getIndices, __pyx_k_getIndices, sizeof(__pyx_k_getIndices), 0, 0, 1, 1}, {&__pyx_n_s_getInfo, __pyx_k_getInfo, sizeof(__pyx_k_getInfo), 0, 0, 1, 1}, {&__pyx_n_s_getInitialGuessKnoll, __pyx_k_getInitialGuessKnoll, sizeof(__pyx_k_getInitialGuessKnoll), 0, 0, 1, 1}, {&__pyx_n_s_getInitialGuessNonzero, __pyx_k_getInitialGuessNonzero, sizeof(__pyx_k_getInitialGuessNonzero), 0, 0, 1, 1}, {&__pyx_n_s_getInterval, __pyx_k_getInterval, sizeof(__pyx_k_getInterval), 0, 0, 1, 1}, {&__pyx_n_s_getIterationNumber, __pyx_k_getIterationNumber, sizeof(__pyx_k_getIterationNumber), 0, 0, 1, 1}, {&__pyx_n_s_getKSP, __pyx_k_getKSP, sizeof(__pyx_k_getKSP), 0, 0, 1, 1}, {&__pyx_n_s_getKSPFailures, __pyx_k_getKSPFailures, sizeof(__pyx_k_getKSPFailures), 0, 0, 1, 1}, {&__pyx_n_s_getLinearSolveFailures, __pyx_k_getLinearSolveFailures, sizeof(__pyx_k_getLinearSolveFailures), 0, 0, 1, 1}, {&__pyx_n_s_getLocalSize, __pyx_k_getLocalSize, sizeof(__pyx_k_getLocalSize), 0, 0, 1, 1}, {&__pyx_n_s_getLocalSizes, __pyx_k_getLocalSizes, sizeof(__pyx_k_getLocalSizes), 0, 0, 1, 1}, {&__pyx_n_s_getMatrix, __pyx_k_getMatrix, sizeof(__pyx_k_getMatrix), 0, 0, 1, 1}, {&__pyx_n_s_getMaxFunctionEvaluations, __pyx_k_getMaxFunctionEvaluations, sizeof(__pyx_k_getMaxFunctionEvaluations), 0, 0, 1, 1}, {&__pyx_n_s_getMaxKSPFailures, __pyx_k_getMaxKSPFailures, sizeof(__pyx_k_getMaxKSPFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxLinearSolveFailures, __pyx_k_getMaxLinearSolveFailures, sizeof(__pyx_k_getMaxLinearSolveFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxNonlinearStepFailures, __pyx_k_getMaxNonlinearStepFailures, sizeof(__pyx_k_getMaxNonlinearStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxStepFailures, __pyx_k_getMaxStepFailures, sizeof(__pyx_k_getMaxStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getMaxSteps, __pyx_k_getMaxSteps, sizeof(__pyx_k_getMaxSteps), 0, 0, 1, 1}, {&__pyx_n_s_getMaxTime, __pyx_k_getMaxTime, sizeof(__pyx_k_getMaxTime), 0, 0, 1, 1}, {&__pyx_n_s_getNPC, __pyx_k_getNPC, sizeof(__pyx_k_getNPC), 0, 0, 1, 1}, {&__pyx_n_s_getName, __pyx_k_getName, sizeof(__pyx_k_getName), 0, 0, 1, 1}, {&__pyx_n_s_getNonlinearStepFailures, __pyx_k_getNonlinearStepFailures, sizeof(__pyx_k_getNonlinearStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getNormType, __pyx_k_getNormType, sizeof(__pyx_k_getNormType), 0, 0, 1, 1}, {&__pyx_n_s_getNumber, __pyx_k_getNumber, sizeof(__pyx_k_getNumber), 0, 0, 1, 1}, {&__pyx_n_s_getNumberDM, __pyx_k_getNumberDM, sizeof(__pyx_k_getNumberDM), 0, 0, 1, 1}, {&__pyx_n_s_getObjectiveValue, __pyx_k_getObjectiveValue, sizeof(__pyx_k_getObjectiveValue), 0, 0, 1, 1}, {&__pyx_n_s_getOperators, __pyx_k_getOperators, sizeof(__pyx_k_getOperators), 0, 0, 1, 1}, {&__pyx_n_s_getOptionsPrefix, __pyx_k_getOptionsPrefix, sizeof(__pyx_k_getOptionsPrefix), 0, 0, 1, 1}, {&__pyx_n_s_getOwnershipRange, __pyx_k_getOwnershipRange, sizeof(__pyx_k_getOwnershipRange), 0, 0, 1, 1}, {&__pyx_n_s_getOwnershipRanges, __pyx_k_getOwnershipRanges, sizeof(__pyx_k_getOwnershipRanges), 0, 0, 1, 1}, {&__pyx_n_s_getPC, __pyx_k_getPC, sizeof(__pyx_k_getPC), 0, 0, 1, 1}, {&__pyx_n_s_getPCSide, __pyx_k_getPCSide, sizeof(__pyx_k_getPCSide), 0, 0, 1, 1}, {&__pyx_n_s_getProblemType, __pyx_k_getProblemType, sizeof(__pyx_k_getProblemType), 0, 0, 1, 1}, {&__pyx_n_s_getProcSizes, __pyx_k_getProcSizes, sizeof(__pyx_k_getProcSizes), 0, 0, 1, 1}, {&__pyx_n_s_getRanges, __pyx_k_getRanges, sizeof(__pyx_k_getRanges), 0, 0, 1, 1}, {&__pyx_n_s_getRank, __pyx_k_getRank, sizeof(__pyx_k_getRank), 0, 0, 1, 1}, {&__pyx_n_s_getRefCount, __pyx_k_getRefCount, sizeof(__pyx_k_getRefCount), 0, 0, 1, 1}, {&__pyx_n_s_getResidualNorm, __pyx_k_getResidualNorm, sizeof(__pyx_k_getResidualNorm), 0, 0, 1, 1}, {&__pyx_n_s_getRhs, __pyx_k_getRhs, sizeof(__pyx_k_getRhs), 0, 0, 1, 1}, {&__pyx_n_s_getSNES, __pyx_k_getSNES, sizeof(__pyx_k_getSNES), 0, 0, 1, 1}, {&__pyx_n_s_getSection, __pyx_k_getSection, sizeof(__pyx_k_getSection), 0, 0, 1, 1}, {&__pyx_n_s_getSectionSF, __pyx_k_getSectionSF, sizeof(__pyx_k_getSectionSF), 0, 0, 1, 1}, {&__pyx_n_s_getSeed, __pyx_k_getSeed, sizeof(__pyx_k_getSeed), 0, 0, 1, 1}, {&__pyx_n_s_getSize, __pyx_k_getSize, sizeof(__pyx_k_getSize), 0, 0, 1, 1}, {&__pyx_n_s_getSizes, __pyx_k_getSizes, sizeof(__pyx_k_getSizes), 0, 0, 1, 1}, {&__pyx_n_s_getSolution, __pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 0, 1, 1}, {&__pyx_n_s_getSolutionNorm, __pyx_k_getSolutionNorm, sizeof(__pyx_k_getSolutionNorm), 0, 0, 1, 1}, {&__pyx_n_s_getSolutionUpdate, __pyx_k_getSolutionUpdate, sizeof(__pyx_k_getSolutionUpdate), 0, 0, 1, 1}, {&__pyx_n_s_getStencil, __pyx_k_getStencil, sizeof(__pyx_k_getStencil), 0, 0, 1, 1}, {&__pyx_n_s_getStencilType, __pyx_k_getStencilType, sizeof(__pyx_k_getStencilType), 0, 0, 1, 1}, {&__pyx_n_s_getStencilWidth, __pyx_k_getStencilWidth, sizeof(__pyx_k_getStencilWidth), 0, 0, 1, 1}, {&__pyx_n_s_getStepFailures, __pyx_k_getStepFailures, sizeof(__pyx_k_getStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_getStepNumber, __pyx_k_getStepNumber, sizeof(__pyx_k_getStepNumber), 0, 0, 1, 1}, {&__pyx_n_s_getString, __pyx_k_getString, sizeof(__pyx_k_getString), 0, 0, 1, 1}, {&__pyx_n_s_getTime, __pyx_k_getTime, sizeof(__pyx_k_getTime), 0, 0, 1, 1}, {&__pyx_n_s_getTimeStep, __pyx_k_getTimeStep, sizeof(__pyx_k_getTimeStep), 0, 0, 1, 1}, {&__pyx_n_s_getTolerances, __pyx_k_getTolerances, sizeof(__pyx_k_getTolerances), 0, 0, 1, 1}, {&__pyx_n_s_getType, __pyx_k_getType, sizeof(__pyx_k_getType), 0, 0, 1, 1}, {&__pyx_n_s_getUseEW, __pyx_k_getUseEW, sizeof(__pyx_k_getUseEW), 0, 0, 1, 1}, {&__pyx_n_s_getUseFD, __pyx_k_getUseFD, sizeof(__pyx_k_getUseFD), 0, 0, 1, 1}, {&__pyx_n_s_getUseMF, __pyx_k_getUseMF, sizeof(__pyx_k_getUseMF), 0, 0, 1, 1}, {&__pyx_n_s_getValue, __pyx_k_getValue, sizeof(__pyx_k_getValue), 0, 0, 1, 1}, {&__pyx_kp_s_getValuesStagStencil_not_yet_imp, __pyx_k_getValuesStagStencil_not_yet_imp, sizeof(__pyx_k_getValuesStagStencil_not_yet_imp), 0, 0, 1, 0}, {&__pyx_kp_s_getVecArray_for_DMStag_not_yet_i, __pyx_k_getVecArray_for_DMStag_not_yet_i, sizeof(__pyx_k_getVecArray_for_DMStag_not_yet_i), 0, 0, 1, 0}, {&__pyx_n_s_getVecLeft, __pyx_k_getVecLeft, sizeof(__pyx_k_getVecLeft), 0, 0, 1, 1}, {&__pyx_n_s_getVecRight, __pyx_k_getVecRight, sizeof(__pyx_k_getVecRight), 0, 0, 1, 1}, {&__pyx_n_s_getVecs, __pyx_k_getVecs, sizeof(__pyx_k_getVecs), 0, 0, 1, 1}, {&__pyx_n_s_getVersion, __pyx_k_getVersion, sizeof(__pyx_k_getVersion), 0, 0, 1, 1}, {&__pyx_n_s_getVersionInfo, __pyx_k_getVersionInfo, sizeof(__pyx_k_getVersionInfo), 0, 0, 1, 1}, {&__pyx_n_s_getVisible, __pyx_k_getVisible, sizeof(__pyx_k_getVisible), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_ghostBcNodes, __pyx_k_ghostBcNodes, sizeof(__pyx_k_ghostBcNodes), 0, 0, 1, 1}, {&__pyx_n_s_ghosted, __pyx_k_ghosted, sizeof(__pyx_k_ghosted), 0, 0, 1, 1}, {&__pyx_n_s_ghosts, __pyx_k_ghosts, sizeof(__pyx_k_ghosts), 0, 0, 1, 1}, {&__pyx_kp_s_ghosts_size_d_array_size_d_and_v, __pyx_k_ghosts_size_d_array_size_d_and_v, sizeof(__pyx_k_ghosts_size_d_array_size_d_and_v), 0, 0, 1, 0}, {&__pyx_n_s_globalBcNodes, __pyx_k_globalBcNodes, sizeof(__pyx_k_globalBcNodes), 0, 0, 1, 1}, {&__pyx_kp_s_global_size_d_not_divisible_by_b, __pyx_k_global_size_d_not_divisible_by_b, sizeof(__pyx_k_global_size_d_not_divisible_by_b), 0, 0, 1, 0}, {&__pyx_n_s_globalsec, __pyx_k_globalsec, sizeof(__pyx_k_globalsec), 0, 0, 1, 1}, {&__pyx_n_s_gord, __pyx_k_gord, sizeof(__pyx_k_gord), 0, 0, 1, 1}, {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0}, {&__pyx_n_s_gradient, __pyx_k_gradient, sizeof(__pyx_k_gradient), 0, 0, 1, 1}, {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, {&__pyx_n_s_grtol, __pyx_k_grtol, sizeof(__pyx_k_grtol), 0, 0, 1, 1}, {&__pyx_n_s_gsec, __pyx_k_gsec, sizeof(__pyx_k_gsec), 0, 0, 1, 1}, {&__pyx_n_s_gtol, __pyx_k_gtol, sizeof(__pyx_k_gtol), 0, 0, 1, 1}, {&__pyx_n_s_gttol, __pyx_k_gttol, sizeof(__pyx_k_gttol), 0, 0, 1, 1}, {&__pyx_n_s_gv, __pyx_k_gv, sizeof(__pyx_k_gv), 0, 0, 1, 1}, {&__pyx_n_s_gvec, __pyx_k_gvec, sizeof(__pyx_k_gvec), 0, 0, 1, 1}, {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 0, 0, 1, 1}, {&__pyx_n_s_hasExternalPackage, __pyx_k_hasExternalPackage, sizeof(__pyx_k_hasExternalPackage), 0, 0, 1, 1}, {&__pyx_n_s_hasLabel, __pyx_k_hasLabel, sizeof(__pyx_k_hasLabel), 0, 0, 1, 1}, {&__pyx_n_s_hasLagrange, __pyx_k_hasLagrange, sizeof(__pyx_k_hasLagrange), 0, 0, 1, 1}, {&__pyx_n_s_hasName, __pyx_k_hasName, sizeof(__pyx_k_hasName), 0, 0, 1, 1}, {&__pyx_n_s_hessian, __pyx_k_hessian, sizeof(__pyx_k_hessian), 0, 0, 1, 1}, {&__pyx_n_s_hypretype, __pyx_k_hypretype, sizeof(__pyx_k_hypretype), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_icntl, __pyx_k_icntl, sizeof(__pyx_k_icntl), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1}, {&__pyx_n_s_idxm, __pyx_k_idxm, sizeof(__pyx_k_idxm), 0, 0, 1, 1}, {&__pyx_n_s_ierr, __pyx_k_ierr, sizeof(__pyx_k_ierr), 0, 0, 1, 1}, {&__pyx_n_s_ignore, __pyx_k_ignore, sizeof(__pyx_k_ignore), 0, 0, 1, 1}, {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1}, {&__pyx_n_s_imex, __pyx_k_imex, sizeof(__pyx_k_imex), 0, 0, 1, 1}, {&__pyx_n_s_imode, __pyx_k_imode, sizeof(__pyx_k_imode), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_inblocks, __pyx_k_inblocks, sizeof(__pyx_k_inblocks), 0, 0, 1, 1}, {&__pyx_kp_s_incompatible_array_sizes, __pyx_k_incompatible_array_sizes, sizeof(__pyx_k_incompatible_array_sizes), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_ni_d_nj, __pyx_k_incompatible_array_sizes_ni_d_nj, sizeof(__pyx_k_incompatible_array_sizes_ni_d_nj), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_ni_d_nv, __pyx_k_incompatible_array_sizes_ni_d_nv, sizeof(__pyx_k_incompatible_array_sizes_ni_d_nv), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_ni_d_nv_2, __pyx_k_incompatible_array_sizes_ni_d_nv_2, sizeof(__pyx_k_incompatible_array_sizes_ni_d_nv_2), 0, 0, 1, 0}, {&__pyx_kp_s_incompatible_array_sizes_nv_d, __pyx_k_incompatible_array_sizes_nv_d, sizeof(__pyx_k_incompatible_array_sizes_nv_d), 0, 0, 1, 0}, {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1}, {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1}, {&__pyx_n_s_infoAllow, __pyx_k_infoAllow, sizeof(__pyx_k_infoAllow), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initialguess, __pyx_k_initialguess, sizeof(__pyx_k_initialguess), 0, 0, 1, 1}, {&__pyx_n_s_initialize, __pyx_k_initialize, sizeof(__pyx_k_initialize), 0, 0, 1, 1}, {&__pyx_kp_s_input_arrays_have_incompatible_s, __pyx_k_input_arrays_have_incompatible_s, sizeof(__pyx_k_input_arrays_have_incompatible_s), 0, 0, 1, 0}, {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1}, {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1}, {&__pyx_n_s_interior, __pyx_k_interior, sizeof(__pyx_k_interior), 0, 0, 1, 1}, {&__pyx_n_s_interp_type, __pyx_k_interp_type, sizeof(__pyx_k_interp_type), 0, 0, 1, 1}, {&__pyx_n_s_interpolate, __pyx_k_interpolate, sizeof(__pyx_k_interpolate), 0, 0, 1, 1}, {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1}, {&__pyx_n_s_invert, __pyx_k_invert, sizeof(__pyx_k_invert), 0, 0, 1, 1}, {&__pyx_n_s_is, __pyx_k_is, sizeof(__pyx_k_is), 0, 0, 1, 1}, {&__pyx_n_s_isAssembled, __pyx_k_isAssembled, sizeof(__pyx_k_isAssembled), 0, 0, 1, 1}, {&__pyx_n_s_isFinalized, __pyx_k_isFinalized, sizeof(__pyx_k_isFinalized), 0, 0, 1, 1}, {&__pyx_n_s_isHermitian, __pyx_k_isHermitian, sizeof(__pyx_k_isHermitian), 0, 0, 1, 1}, {&__pyx_n_s_isIdentity, __pyx_k_isIdentity, sizeof(__pyx_k_isIdentity), 0, 0, 1, 1}, {&__pyx_n_s_isInitialized, __pyx_k_isInitialized, sizeof(__pyx_k_isInitialized), 0, 0, 1, 1}, {&__pyx_n_s_isPermutation, __pyx_k_isPermutation, sizeof(__pyx_k_isPermutation), 0, 0, 1, 1}, {&__pyx_n_s_isSimplex, __pyx_k_isSimplex, sizeof(__pyx_k_isSimplex), 0, 0, 1, 1}, {&__pyx_n_s_isSorted, __pyx_k_isSorted, sizeof(__pyx_k_isSorted), 0, 0, 1, 1}, {&__pyx_n_s_isStructurallySymmetric, __pyx_k_isStructurallySymmetric, sizeof(__pyx_k_isStructurallySymmetric), 0, 0, 1, 1}, {&__pyx_n_s_isSymmetric, __pyx_k_isSymmetric, sizeof(__pyx_k_isSymmetric), 0, 0, 1, 1}, {&__pyx_n_s_is_from, __pyx_k_is_from, sizeof(__pyx_k_is_from), 0, 0, 1, 1}, {&__pyx_n_s_is_local, __pyx_k_is_local, sizeof(__pyx_k_is_local), 0, 0, 1, 1}, {&__pyx_n_s_is_to, __pyx_k_is_to, sizeof(__pyx_k_is_to), 0, 0, 1, 1}, {&__pyx_n_s_is_type, __pyx_k_is_type, sizeof(__pyx_k_is_type), 0, 0, 1, 1}, {&__pyx_n_s_iscol, __pyx_k_iscol, sizeof(__pyx_k_iscol), 0, 0, 1, 1}, {&__pyx_n_s_iscols, __pyx_k_iscols, sizeof(__pyx_k_iscols), 0, 0, 1, 1}, {&__pyx_n_s_iset, __pyx_k_iset, sizeof(__pyx_k_iset), 0, 0, 1, 1}, {&__pyx_n_s_isets, __pyx_k_isets, sizeof(__pyx_k_isets), 0, 0, 1, 1}, {&__pyx_n_s_isfields, __pyx_k_isfields, sizeof(__pyx_k_isfields), 0, 0, 1, 1}, {&__pyx_n_s_isperm, __pyx_k_isperm, sizeof(__pyx_k_isperm), 0, 0, 1, 1}, {&__pyx_n_s_isrow, __pyx_k_isrow, sizeof(__pyx_k_isrow), 0, 0, 1, 1}, {&__pyx_n_s_isrows, __pyx_k_isrows, sizeof(__pyx_k_isrows), 0, 0, 1, 1}, {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1}, {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0}, {&__pyx_n_s_its, __pyx_k_its, sizeof(__pyx_k_its), 0, 0, 1, 1}, {&__pyx_n_s_ival, __pyx_k_ival, sizeof(__pyx_k_ival), 0, 0, 1, 1}, {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, {&__pyx_n_s_jacobian, __pyx_k_jacobian, sizeof(__pyx_k_jacobian), 0, 0, 1, 1}, {&__pyx_n_s_jacobian_design, __pyx_k_jacobian_design, sizeof(__pyx_k_jacobian_design), 0, 0, 1, 1}, {&__pyx_n_s_jacobian_state, __pyx_k_jacobian_state, sizeof(__pyx_k_jacobian_state), 0, 0, 1, 1}, {&__pyx_n_s_jacobianp, __pyx_k_jacobianp, sizeof(__pyx_k_jacobianp), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_kargs, __pyx_k_kargs, sizeof(__pyx_k_kargs), 0, 0, 1, 1}, {&__pyx_kp_s_key_d_cannot_register_s_already, __pyx_k_key_d_cannot_register_s_already, sizeof(__pyx_k_key_d_cannot_register_s_already), 0, 0, 1, 0}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_klass, __pyx_k_klass, sizeof(__pyx_k_klass), 0, 0, 1, 1}, {&__pyx_n_s_ksp, __pyx_k_ksp, sizeof(__pyx_k_ksp), 0, 0, 1, 1}, {&__pyx_n_s_ksp_type, __pyx_k_ksp_type, sizeof(__pyx_k_ksp_type), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, {&__pyx_n_s_l2l, __pyx_k_l2l, sizeof(__pyx_k_l2l), 0, 0, 1, 1}, {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1}, {&__pyx_n_s_labelName, __pyx_k_labelName, sizeof(__pyx_k_labelName), 0, 0, 1, 1}, {&__pyx_n_s_lanes, __pyx_k_lanes, sizeof(__pyx_k_lanes), 0, 0, 1, 1}, {&__pyx_n_s_layoutType, __pyx_k_layoutType, sizeof(__pyx_k_layoutType), 0, 0, 1, 1}, {&__pyx_n_s_leafdata, __pyx_k_leafdata, sizeof(__pyx_k_leafdata), 0, 0, 1, 1}, {&__pyx_n_s_leafupdate, __pyx_k_leafupdate, sizeof(__pyx_k_leafupdate), 0, 0, 1, 1}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1}, {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1}, {&__pyx_n_s_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 0, 0, 1, 1}, {&__pyx_n_s_lgmap, __pyx_k_lgmap, sizeof(__pyx_k_lgmap), 0, 0, 1, 1}, {&__pyx_n_s_lgmap_type, __pyx_k_lgmap_type, sizeof(__pyx_k_lgmap_type), 0, 0, 1, 1}, {&__pyx_n_s_linear_its, __pyx_k_linear_its, sizeof(__pyx_k_linear_its), 0, 0, 1, 1}, {&__pyx_n_s_lits, __pyx_k_lits, sizeof(__pyx_k_lits), 0, 0, 1, 1}, {&__pyx_n_s_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 0, 0, 1, 1}, {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1}, {&__pyx_kp_s_local_and_global_sizes_cannot_be, __pyx_k_local_and_global_sizes_cannot_be, sizeof(__pyx_k_local_and_global_sizes_cannot_be), 0, 0, 1, 0}, {&__pyx_kp_s_local_size_d_not_divisible_by_bl, __pyx_k_local_size_d_not_divisible_by_bl, sizeof(__pyx_k_local_size_d_not_divisible_by_bl), 0, 0, 1, 0}, {&__pyx_n_s_localsec, __pyx_k_localsec, sizeof(__pyx_k_localsec), 0, 0, 1, 1}, {&__pyx_n_s_locs, __pyx_k_locs, sizeof(__pyx_k_locs), 0, 0, 1, 1}, {&__pyx_n_s_logFlops, __pyx_k_logFlops, sizeof(__pyx_k_logFlops), 0, 0, 1, 1}, {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1}, {&__pyx_n_s_ltog, __pyx_k_ltog, sizeof(__pyx_k_ltog), 0, 0, 1, 1}, {&__pyx_n_s_ltol, __pyx_k_ltol, sizeof(__pyx_k_ltol), 0, 0, 1, 1}, {&__pyx_n_s_lv, __pyx_k_lv, sizeof(__pyx_k_lv), 0, 0, 1, 1}, {&__pyx_n_s_lvecs, __pyx_k_lvecs, sizeof(__pyx_k_lvecs), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1}, {&__pyx_n_s_mallocs, __pyx_k_mallocs, sizeof(__pyx_k_mallocs), 0, 0, 1, 1}, {&__pyx_n_s_mat, __pyx_k_mat, sizeof(__pyx_k_mat), 0, 0, 1, 1}, {&__pyx_n_s_matMult, __pyx_k_matMult, sizeof(__pyx_k_matMult), 0, 0, 1, 1}, {&__pyx_n_s_mat_type, __pyx_k_mat_type, sizeof(__pyx_k_mat_type), 0, 0, 1, 1}, {&__pyx_n_s_mats, __pyx_k_mats, sizeof(__pyx_k_mats), 0, 0, 1, 1}, {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, {&__pyx_n_s_max_fails, __pyx_k_max_fails, sizeof(__pyx_k_max_fails), 0, 0, 1, 1}, {&__pyx_n_s_max_funcs, __pyx_k_max_funcs, sizeof(__pyx_k_max_funcs), 0, 0, 1, 1}, {&__pyx_n_s_max_it, __pyx_k_max_it, sizeof(__pyx_k_max_it), 0, 0, 1, 1}, {&__pyx_n_s_max_steps, __pyx_k_max_steps, sizeof(__pyx_k_max_steps), 0, 0, 1, 1}, {&__pyx_n_s_max_time, __pyx_k_max_time, sizeof(__pyx_k_max_time), 0, 0, 1, 1}, {&__pyx_n_s_memo, __pyx_k_memo, sizeof(__pyx_k_memo), 0, 0, 1, 1}, {&__pyx_n_s_memory, __pyx_k_memory, sizeof(__pyx_k_memory), 0, 0, 1, 1}, {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, {&__pyx_n_s_messageLength, __pyx_k_messageLength, sizeof(__pyx_k_messageLength), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_metric, __pyx_k_metric, sizeof(__pyx_k_metric), 0, 0, 1, 1}, {&__pyx_n_s_mgtype, __pyx_k_mgtype, sizeof(__pyx_k_mgtype), 0, 0, 1, 1}, {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1}, {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1}, {&__pyx_n_s_mirror, __pyx_k_mirror, sizeof(__pyx_k_mirror), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_monitor, __pyx_k_monitor, sizeof(__pyx_k_monitor), 0, 0, 1, 1}, {&__pyx_n_s_mpi4py, __pyx_k_mpi4py, sizeof(__pyx_k_mpi4py), 0, 0, 1, 1}, {&__pyx_kp_s_mpi4py_MPI, __pyx_k_mpi4py_MPI, sizeof(__pyx_k_mpi4py_MPI), 0, 0, 1, 0}, {&__pyx_n_s_mpiabort, __pyx_k_mpiabort, sizeof(__pyx_k_mpiabort), 0, 0, 1, 1}, {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, {&__pyx_n_s_mult, __pyx_k_mult, sizeof(__pyx_k_mult), 0, 0, 1, 1}, {&__pyx_n_s_multirootdata, __pyx_k_multirootdata, sizeof(__pyx_k_multirootdata), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_na, __pyx_k_na, sizeof(__pyx_k_na), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, {&__pyx_n_s_name_3, __pyx_k_name_3, sizeof(__pyx_k_name_3), 0, 0, 1, 1}, {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1}, {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_newsec, __pyx_k_newsec, sizeof(__pyx_k_newsec), 0, 0, 1, 1}, {&__pyx_n_s_newvec, __pyx_k_newvec, sizeof(__pyx_k_newvec), 0, 0, 1, 1}, {&__pyx_n_s_ngs, __pyx_k_ngs, sizeof(__pyx_k_ngs), 0, 0, 1, 1}, {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1}, {&__pyx_n_s_nlocal, __pyx_k_nlocal, sizeof(__pyx_k_nlocal), 0, 0, 1, 1}, {&__pyx_n_s_nmax, __pyx_k_nmax, sizeof(__pyx_k_nmax), 0, 0, 1, 1}, {&__pyx_n_s_nmin, __pyx_k_nmin, sizeof(__pyx_k_nmin), 0, 0, 1, 1}, {&__pyx_n_s_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 0, 1, 1}, {&__pyx_n_s_nonzero, __pyx_k_nonzero, sizeof(__pyx_k_nonzero), 0, 0, 1, 1}, {&__pyx_n_s_nonzero_2, __pyx_k_nonzero_2, sizeof(__pyx_k_nonzero_2), 0, 0, 1, 1}, {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1}, {&__pyx_n_s_norm_type, __pyx_k_norm_type, sizeof(__pyx_k_norm_type), 0, 0, 1, 1}, {&__pyx_n_s_normsched, __pyx_k_normsched, sizeof(__pyx_k_normsched), 0, 0, 1, 1}, {&__pyx_n_s_normtype, __pyx_k_normtype, sizeof(__pyx_k_normtype), 0, 0, 1, 1}, {&__pyx_n_s_npoints, __pyx_k_npoints, sizeof(__pyx_k_npoints), 0, 0, 1, 1}, {&__pyx_n_s_nroots, __pyx_k_nroots, sizeof(__pyx_k_nroots), 0, 0, 1, 1}, {&__pyx_n_s_nsd, __pyx_k_nsd, sizeof(__pyx_k_nsd), 0, 0, 1, 1}, {&__pyx_n_s_nsp, __pyx_k_nsp, sizeof(__pyx_k_nsp), 0, 0, 1, 1}, {&__pyx_n_s_nsubcomm, __pyx_k_nsubcomm, sizeof(__pyx_k_nsubcomm), 0, 0, 1, 1}, {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1}, {&__pyx_kp_s_null_communicator, __pyx_k_null_communicator, sizeof(__pyx_k_null_communicator), 0, 0, 1, 0}, {&__pyx_n_s_numComp, __pyx_k_numComp, sizeof(__pyx_k_numComp), 0, 0, 1, 1}, {&__pyx_n_s_numDof, __pyx_k_numDof, sizeof(__pyx_k_numDof), 0, 0, 1, 1}, {&__pyx_n_s_numFields, __pyx_k_numFields, sizeof(__pyx_k_numFields), 0, 0, 1, 1}, {&__pyx_n_s_numMessages, __pyx_k_numMessages, sizeof(__pyx_k_numMessages), 0, 0, 1, 1}, {&__pyx_n_s_numProcs, __pyx_k_numProcs, sizeof(__pyx_k_numProcs), 0, 0, 1, 1}, {&__pyx_n_s_numReductions, __pyx_k_numReductions, sizeof(__pyx_k_numReductions), 0, 0, 1, 1}, {&__pyx_kp_s_number_of_dimensions_d_and_numbe, __pyx_k_number_of_dimensions_d_and_numbe, sizeof(__pyx_k_number_of_dimensions_d_and_numbe), 0, 0, 1, 0}, {&__pyx_n_s_nz_allocated, __pyx_k_nz_allocated, sizeof(__pyx_k_nz_allocated), 0, 0, 1, 1}, {&__pyx_n_s_nz_unneeded, __pyx_k_nz_unneeded, sizeof(__pyx_k_nz_unneeded), 0, 0, 1, 1}, {&__pyx_n_s_nz_used, __pyx_k_nz_used, sizeof(__pyx_k_nz_used), 0, 0, 1, 1}, {&__pyx_n_s_nzdiag, __pyx_k_nzdiag, sizeof(__pyx_k_nzdiag), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1}, {&__pyx_n_s_objective, __pyx_k_objective, sizeof(__pyx_k_objective), 0, 0, 1, 1}, {&__pyx_n_s_objgrad, __pyx_k_objgrad, sizeof(__pyx_k_objgrad), 0, 0, 1, 1}, {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1}, {&__pyx_n_s_omega, __pyx_k_omega, sizeof(__pyx_k_omega), 0, 0, 1, 1}, {&__pyx_kp_s_only_and, __pyx_k_only_and, sizeof(__pyx_k_only_and), 0, 0, 1, 0}, {&__pyx_n_s_onnz, __pyx_k_onnz, sizeof(__pyx_k_onnz), 0, 0, 1, 1}, {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1}, {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, {&__pyx_n_s_operators, __pyx_k_operators, sizeof(__pyx_k_operators), 0, 0, 1, 1}, {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1}, {&__pyx_kp_s_option_prefix_must_be_string, __pyx_k_option_prefix_must_be_string, sizeof(__pyx_k_option_prefix_must_be_string), 0, 0, 1, 0}, {&__pyx_kp_s_option_prefix_should_not_have_sp, __pyx_k_option_prefix_should_not_have_sp, sizeof(__pyx_k_option_prefix_should_not_have_sp), 0, 0, 1, 0}, {&__pyx_kp_s_option_prefix_should_not_start_w, __pyx_k_option_prefix_should_not_start_w, sizeof(__pyx_k_option_prefix_should_not_start_w), 0, 0, 1, 0}, {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1}, {&__pyx_n_s_opts, __pyx_k_opts, sizeof(__pyx_k_opts), 0, 0, 1, 1}, {&__pyx_n_s_ord_type, __pyx_k_ord_type, sizeof(__pyx_k_ord_type), 0, 0, 1, 1}, {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, {&__pyx_n_s_orientation, __pyx_k_orientation, sizeof(__pyx_k_orientation), 0, 0, 1, 1}, {&__pyx_n_s_otype, __pyx_k_otype, sizeof(__pyx_k_otype), 0, 0, 1, 1}, {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, {&__pyx_n_s_overlap, __pyx_k_overlap, sizeof(__pyx_k_overlap), 0, 0, 1, 1}, {&__pyx_kp_s_ownership_range_size_d_and_numbe, __pyx_k_ownership_range_size_d_and_numbe, sizeof(__pyx_k_ownership_range_size_d_and_numbe), 0, 0, 1, 0}, {&__pyx_n_s_ownership_ranges, __pyx_k_ownership_ranges, sizeof(__pyx_k_ownership_ranges), 0, 0, 1, 1}, {&__pyx_n_s_ozz, __pyx_k_ozz, sizeof(__pyx_k_ozz), 0, 0, 1, 1}, {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1}, {&__pyx_n_s_pEnd, __pyx_k_pEnd, sizeof(__pyx_k_pEnd), 0, 0, 1, 1}, {&__pyx_n_s_pStart, __pyx_k_pStart, sizeof(__pyx_k_pStart), 0, 0, 1, 1}, {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1}, {&__pyx_n_s_package, __pyx_k_package, sizeof(__pyx_k_package), 0, 0, 1, 1}, {&__pyx_n_s_parallel, __pyx_k_parallel, sizeof(__pyx_k_parallel), 0, 0, 1, 1}, {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1}, {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1}, {&__pyx_n_s_part_type, __pyx_k_part_type, sizeof(__pyx_k_part_type), 0, 0, 1, 1}, {&__pyx_n_s_pc, __pyx_k_pc, sizeof(__pyx_k_pc), 0, 0, 1, 1}, {&__pyx_n_s_pc_type, __pyx_k_pc_type, sizeof(__pyx_k_pc_type), 0, 0, 1, 1}, {&__pyx_n_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1}, {&__pyx_n_s_periodic, __pyx_k_periodic, sizeof(__pyx_k_periodic), 0, 0, 1, 1}, {&__pyx_n_s_perm, __pyx_k_perm, sizeof(__pyx_k_perm), 0, 0, 1, 1}, {&__pyx_n_s_petsc, __pyx_k_petsc, sizeof(__pyx_k_petsc), 0, 0, 1, 1}, {&__pyx_n_s_petsc4py_PETSc, __pyx_k_petsc4py_PETSc, sizeof(__pyx_k_petsc4py_PETSc), 0, 0, 1, 1}, {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pj, __pyx_k_pj, sizeof(__pyx_k_pj), 0, 0, 1, 1}, {&__pyx_n_s_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1}, {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_popErrorHandler, __pyx_k_popErrorHandler, sizeof(__pyx_k_popErrorHandler), 0, 0, 1, 1}, {&__pyx_n_s_popSignalHandler, __pyx_k_popSignalHandler, sizeof(__pyx_k_popSignalHandler), 0, 0, 1, 1}, {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1}, {&__pyx_n_s_positive_definite, __pyx_k_positive_definite, sizeof(__pyx_k_positive_definite), 0, 0, 1, 1}, {&__pyx_n_s_postevent, __pyx_k_postevent, sizeof(__pyx_k_postevent), 0, 0, 1, 1}, {&__pyx_n_s_poststep, __pyx_k_poststep, sizeof(__pyx_k_poststep), 0, 0, 1, 1}, {&__pyx_n_s_pre, __pyx_k_pre, sizeof(__pyx_k_pre), 0, 0, 1, 1}, {&__pyx_n_s_precheck, __pyx_k_precheck, sizeof(__pyx_k_precheck), 0, 0, 1, 1}, {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1}, {&__pyx_kp_s_prefix_s_name_s, __pyx_k_prefix_s_name_s, sizeof(__pyx_k_prefix_s_name_s), 0, 0, 1, 0}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_prestep, __pyx_k_prestep, sizeof(__pyx_k_prestep), 0, 0, 1, 1}, {&__pyx_n_s_primv, __pyx_k_primv, sizeof(__pyx_k_primv), 0, 0, 1, 1}, {&__pyx_n_s_proc_sizes, __pyx_k_proc_sizes, sizeof(__pyx_k_proc_sizes), 0, 0, 1, 1}, {&__pyx_n_s_ptype, __pyx_k_ptype, sizeof(__pyx_k_ptype), 0, 0, 1, 1}, {&__pyx_n_s_push, __pyx_k_push, sizeof(__pyx_k_push), 0, 0, 1, 1}, {&__pyx_n_s_pushErrorHandler, __pyx_k_pushErrorHandler, sizeof(__pyx_k_pushErrorHandler), 0, 0, 1, 1}, {&__pyx_n_s_py_type, __pyx_k_py_type, sizeof(__pyx_k_py_type), 0, 0, 1, 1}, {&__pyx_n_s_python, __pyx_k_python, sizeof(__pyx_k_python), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_q0, __pyx_k_q0, sizeof(__pyx_k_q0), 0, 0, 1, 1}, {&__pyx_n_s_q1, __pyx_k_q1, sizeof(__pyx_k_q1), 0, 0, 1, 1}, {&__pyx_n_s_qorder, __pyx_k_qorder, sizeof(__pyx_k_qorder), 0, 0, 1, 1}, {&__pyx_n_s_quad, __pyx_k_quad, sizeof(__pyx_k_quad), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, {&__pyx_kp_s_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 0, 1, 0}, {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1}, {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_ranges, __pyx_k_ranges, sizeof(__pyx_k_ranges), 0, 0, 1, 1}, {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1}, {&__pyx_n_s_readonly, __pyx_k_readonly, sizeof(__pyx_k_readonly), 0, 0, 1, 1}, {&__pyx_kp_s_readonly_attribute, __pyx_k_readonly_attribute, sizeof(__pyx_k_readonly_attribute), 0, 0, 1, 0}, {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1}, {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, {&__pyx_n_s_reason, __pyx_k_reason, sizeof(__pyx_k_reason), 0, 0, 1, 1}, {&__pyx_n_s_reciprocal, __pyx_k_reciprocal, sizeof(__pyx_k_reciprocal), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_redundant, __pyx_k_redundant, sizeof(__pyx_k_redundant), 0, 0, 1, 1}, {&__pyx_n_s_refine, __pyx_k_refine, sizeof(__pyx_k_refine), 0, 0, 1, 1}, {&__pyx_n_s_refine_x, __pyx_k_refine_x, sizeof(__pyx_k_refine_x), 0, 0, 1, 1}, {&__pyx_n_s_refine_y, __pyx_k_refine_y, sizeof(__pyx_k_refine_y), 0, 0, 1, 1}, {&__pyx_n_s_refine_z, __pyx_k_refine_z, sizeof(__pyx_k_refine_z), 0, 0, 1, 1}, {&__pyx_n_s_refinementLimit, __pyx_k_refinementLimit, sizeof(__pyx_k_refinementLimit), 0, 0, 1, 1}, {&__pyx_n_s_refinementUniform, __pyx_k_refinementUniform, sizeof(__pyx_k_refinementUniform), 0, 0, 1, 1}, {&__pyx_n_s_registerCitation, __pyx_k_registerCitation, sizeof(__pyx_k_registerCitation), 0, 0, 1, 1}, {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1}, {&__pyx_n_s_remote, __pyx_k_remote, sizeof(__pyx_k_remote), 0, 0, 1, 1}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_remove_sent_points, __pyx_k_remove_sent_points, sizeof(__pyx_k_remove_sent_points), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, {&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1}, {&__pyx_n_s_residual, __pyx_k_residual, sizeof(__pyx_k_residual), 0, 0, 1, 1}, {&__pyx_n_s_restart, __pyx_k_restart, sizeof(__pyx_k_restart), 0, 0, 1, 1}, {&__pyx_n_s_restricthook, __pyx_k_restricthook, sizeof(__pyx_k_restricthook), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_reuse, __pyx_k_reuse, sizeof(__pyx_k_reuse), 0, 0, 1, 1}, {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1}, {&__pyx_n_s_rhsjacobianp, __pyx_k_rhsjacobianp, sizeof(__pyx_k_rhsjacobianp), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_rmap, __pyx_k_rmap, sizeof(__pyx_k_rmap), 0, 0, 1, 1}, {&__pyx_n_s_rnd_type, __pyx_k_rnd_type, sizeof(__pyx_k_rnd_type), 0, 0, 1, 1}, {&__pyx_n_s_rnorm, __pyx_k_rnorm, sizeof(__pyx_k_rnorm), 0, 0, 1, 1}, {&__pyx_n_s_rootdata, __pyx_k_rootdata, sizeof(__pyx_k_rootdata), 0, 0, 1, 1}, {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1}, {&__pyx_n_s_row_bsize, __pyx_k_row_bsize, sizeof(__pyx_k_row_bsize), 0, 0, 1, 1}, {&__pyx_kp_s_row_indices_must_have_two_dimens, __pyx_k_row_indices_must_have_two_dimens, sizeof(__pyx_k_row_indices_must_have_two_dimens), 0, 0, 1, 0}, {&__pyx_n_s_rowmap, __pyx_k_rowmap, sizeof(__pyx_k_rowmap), 0, 0, 1, 1}, {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1}, {&__pyx_n_s_rscale, __pyx_k_rscale, sizeof(__pyx_k_rscale), 0, 0, 1, 1}, {&__pyx_n_s_rtol, __pyx_k_rtol, sizeof(__pyx_k_rtol), 0, 0, 1, 1}, {&__pyx_n_s_rtol_0, __pyx_k_rtol_0, sizeof(__pyx_k_rtol_0), 0, 0, 1, 1}, {&__pyx_n_s_rtol_max, __pyx_k_rtol_max, sizeof(__pyx_k_rtol_max), 0, 0, 1, 1}, {&__pyx_n_s_rw, __pyx_k_rw, sizeof(__pyx_k_rw), 0, 0, 1, 1}, {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0}, {&__pyx_kp_s_s_line_d_in_s, __pyx_k_s_line_d_in_s, sizeof(__pyx_k_s_line_d_in_s), 0, 0, 1, 0}, {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1}, {&__pyx_n_s_scatter, __pyx_k_scatter, sizeof(__pyx_k_scatter), 0, 0, 1, 1}, {&__pyx_n_s_scatter_type, __pyx_k_scatter_type, sizeof(__pyx_k_scatter_type), 0, 0, 1, 1}, {&__pyx_n_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 1}, {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 1}, {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1}, {&__pyx_n_s_selected, __pyx_k_selected, sizeof(__pyx_k_selected), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 0, 0, 1, 1}, {&__pyx_n_s_setActive, __pyx_k_setActive, sizeof(__pyx_k_setActive), 0, 0, 1, 1}, {&__pyx_n_s_setActiveAll, __pyx_k_setActiveAll, sizeof(__pyx_k_setActiveAll), 0, 0, 1, 1}, {&__pyx_n_s_setAppCtx, __pyx_k_setAppCtx, sizeof(__pyx_k_setAppCtx), 0, 0, 1, 1}, {&__pyx_n_s_setConvergedReason, __pyx_k_setConvergedReason, sizeof(__pyx_k_setConvergedReason), 0, 0, 1, 1}, {&__pyx_n_s_setDM, __pyx_k_setDM, sizeof(__pyx_k_setDM), 0, 0, 1, 1}, {&__pyx_n_s_setDS, __pyx_k_setDS, sizeof(__pyx_k_setDS), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultComm, __pyx_k_setDefaultComm, sizeof(__pyx_k_setDefaultComm), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultGlobalSection, __pyx_k_setDefaultGlobalSection, sizeof(__pyx_k_setDefaultGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultSF, __pyx_k_setDefaultSF, sizeof(__pyx_k_setDefaultSF), 0, 0, 1, 1}, {&__pyx_n_s_setDefaultSection, __pyx_k_setDefaultSection, sizeof(__pyx_k_setDefaultSection), 0, 0, 1, 1}, {&__pyx_n_s_setDiagonal, __pyx_k_setDiagonal, sizeof(__pyx_k_setDiagonal), 0, 0, 1, 1}, {&__pyx_n_s_setDimension, __pyx_k_setDimension, sizeof(__pyx_k_setDimension), 0, 0, 1, 1}, {&__pyx_n_s_setEquationType, __pyx_k_setEquationType, sizeof(__pyx_k_setEquationType), 0, 0, 1, 1}, {&__pyx_n_s_setFunctionNorm, __pyx_k_setFunctionNorm, sizeof(__pyx_k_setFunctionNorm), 0, 0, 1, 1}, {&__pyx_n_s_setFunctionTolerances, __pyx_k_setFunctionTolerances, sizeof(__pyx_k_setFunctionTolerances), 0, 0, 1, 1}, {&__pyx_n_s_setGlobalSection, __pyx_k_setGlobalSection, sizeof(__pyx_k_setGlobalSection), 0, 0, 1, 1}, {&__pyx_n_s_setInitialGuessKnoll, __pyx_k_setInitialGuessKnoll, sizeof(__pyx_k_setInitialGuessKnoll), 0, 0, 1, 1}, {&__pyx_n_s_setInitialGuessNonzero, __pyx_k_setInitialGuessNonzero, sizeof(__pyx_k_setInitialGuessNonzero), 0, 0, 1, 1}, {&__pyx_n_s_setInterval, __pyx_k_setInterval, sizeof(__pyx_k_setInterval), 0, 0, 1, 1}, {&__pyx_n_s_setIterationNumber, __pyx_k_setIterationNumber, sizeof(__pyx_k_setIterationNumber), 0, 0, 1, 1}, {&__pyx_n_s_setKSP, __pyx_k_setKSP, sizeof(__pyx_k_setKSP), 0, 0, 1, 1}, {&__pyx_n_s_setMaxFunctionEvaluations, __pyx_k_setMaxFunctionEvaluations, sizeof(__pyx_k_setMaxFunctionEvaluations), 0, 0, 1, 1}, {&__pyx_n_s_setMaxKSPFailures, __pyx_k_setMaxKSPFailures, sizeof(__pyx_k_setMaxKSPFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxLinearSolveFailures, __pyx_k_setMaxLinearSolveFailures, sizeof(__pyx_k_setMaxLinearSolveFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxNonlinearStepFailures, __pyx_k_setMaxNonlinearStepFailures, sizeof(__pyx_k_setMaxNonlinearStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxStepFailures, __pyx_k_setMaxStepFailures, sizeof(__pyx_k_setMaxStepFailures), 0, 0, 1, 1}, {&__pyx_n_s_setMaxSteps, __pyx_k_setMaxSteps, sizeof(__pyx_k_setMaxSteps), 0, 0, 1, 1}, {&__pyx_n_s_setMaxTime, __pyx_k_setMaxTime, sizeof(__pyx_k_setMaxTime), 0, 0, 1, 1}, {&__pyx_n_s_setNPC, __pyx_k_setNPC, sizeof(__pyx_k_setNPC), 0, 0, 1, 1}, {&__pyx_n_s_setName, __pyx_k_setName, sizeof(__pyx_k_setName), 0, 0, 1, 1}, {&__pyx_n_s_setNormType, __pyx_k_setNormType, sizeof(__pyx_k_setNormType), 0, 0, 1, 1}, {&__pyx_n_s_setOptionsPrefix, __pyx_k_setOptionsPrefix, sizeof(__pyx_k_setOptionsPrefix), 0, 0, 1, 1}, {&__pyx_n_s_setPCSide, __pyx_k_setPCSide, sizeof(__pyx_k_setPCSide), 0, 0, 1, 1}, {&__pyx_n_s_setParamsEW, __pyx_k_setParamsEW, sizeof(__pyx_k_setParamsEW), 0, 0, 1, 1}, {&__pyx_n_s_setProblemType, __pyx_k_setProblemType, sizeof(__pyx_k_setProblemType), 0, 0, 1, 1}, {&__pyx_n_s_setResidualNorm, __pyx_k_setResidualNorm, sizeof(__pyx_k_setResidualNorm), 0, 0, 1, 1}, {&__pyx_n_s_setSection, __pyx_k_setSection, sizeof(__pyx_k_setSection), 0, 0, 1, 1}, {&__pyx_n_s_setSectionSF, __pyx_k_setSectionSF, sizeof(__pyx_k_setSectionSF), 0, 0, 1, 1}, {&__pyx_n_s_setSeed, __pyx_k_setSeed, sizeof(__pyx_k_setSeed), 0, 0, 1, 1}, {&__pyx_n_s_setSizes, __pyx_k_setSizes, sizeof(__pyx_k_setSizes), 0, 0, 1, 1}, {&__pyx_n_s_setStepNumber, __pyx_k_setStepNumber, sizeof(__pyx_k_setStepNumber), 0, 0, 1, 1}, {&__pyx_n_s_setTime, __pyx_k_setTime, sizeof(__pyx_k_setTime), 0, 0, 1, 1}, {&__pyx_n_s_setTimeStep, __pyx_k_setTimeStep, sizeof(__pyx_k_setTimeStep), 0, 0, 1, 1}, {&__pyx_n_s_setTolerances, __pyx_k_setTolerances, sizeof(__pyx_k_setTolerances), 0, 0, 1, 1}, {&__pyx_n_s_setType, __pyx_k_setType, sizeof(__pyx_k_setType), 0, 0, 1, 1}, {&__pyx_n_s_setUp, __pyx_k_setUp, sizeof(__pyx_k_setUp), 0, 0, 1, 1}, {&__pyx_n_s_setUseEW, __pyx_k_setUseEW, sizeof(__pyx_k_setUseEW), 0, 0, 1, 1}, {&__pyx_n_s_setUseFD, __pyx_k_setUseFD, sizeof(__pyx_k_setUseFD), 0, 0, 1, 1}, {&__pyx_n_s_setUseMF, __pyx_k_setUseMF, sizeof(__pyx_k_setUseMF), 0, 0, 1, 1}, {&__pyx_n_s_setValue, __pyx_k_setValue, sizeof(__pyx_k_setValue), 0, 0, 1, 1}, {&__pyx_kp_s_setValueBlockedStagStencil_not_y, __pyx_k_setValueBlockedStagStencil_not_y, sizeof(__pyx_k_setValueBlockedStagStencil_not_y), 0, 0, 1, 0}, {&__pyx_kp_s_setValueStagStencil_not_yet_impl, __pyx_k_setValueStagStencil_not_yet_impl, sizeof(__pyx_k_setValueStagStencil_not_yet_impl), 0, 0, 1, 0}, {&__pyx_kp_s_setValuesStagStencil_not_yet_imp, __pyx_k_setValuesStagStencil_not_yet_imp, sizeof(__pyx_k_setValuesStagStencil_not_yet_imp), 0, 0, 1, 0}, {&__pyx_n_s_setVisible, __pyx_k_setVisible, sizeof(__pyx_k_setVisible), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 0, 1, 1}, {&__pyx_n_s_sf, __pyx_k_sf, sizeof(__pyx_k_sf), 0, 0, 1, 1}, {&__pyx_n_s_sf_type, __pyx_k_sf_type, sizeof(__pyx_k_sf_type), 0, 0, 1, 1}, {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1}, {&__pyx_n_s_shift, __pyx_k_shift, sizeof(__pyx_k_shift), 0, 0, 1, 1}, {&__pyx_n_s_shift_type, __pyx_k_shift_type, sizeof(__pyx_k_shift_type), 0, 0, 1, 1}, {&__pyx_n_s_shiftamount, __pyx_k_shiftamount, sizeof(__pyx_k_shiftamount), 0, 0, 1, 1}, {&__pyx_n_s_shifttype, __pyx_k_shifttype, sizeof(__pyx_k_shifttype), 0, 0, 1, 1}, {&__pyx_n_s_side, __pyx_k_side, sizeof(__pyx_k_side), 0, 0, 1, 1}, {&__pyx_kp_s_side_r_not_understood, __pyx_k_side_r_not_understood, sizeof(__pyx_k_side_r_not_understood), 0, 0, 1, 0}, {&__pyx_n_s_simplex, __pyx_k_simplex, sizeof(__pyx_k_simplex), 0, 0, 1, 1}, {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1}, {&__pyx_kp_s_size_I_is_d_expected_d, __pyx_k_size_I_is_d_expected_d, sizeof(__pyx_k_size_I_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_J_is_d_expected_d, __pyx_k_size_J_is_d_expected_d, sizeof(__pyx_k_size_J_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_V_is_d_expected_d, __pyx_k_size_V_is_d_expected_d, sizeof(__pyx_k_size_V_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_array_is_d_expected_dx_d_d, __pyx_k_size_array_is_d_expected_dx_d_d, sizeof(__pyx_k_size_array_is_d_expected_dx_d_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_d_nnz_is_d_expected_d, __pyx_k_size_d_nnz_is_d_expected_d, sizeof(__pyx_k_size_d_nnz_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_kp_s_size_o_nnz_is_d_expected_d, __pyx_k_size_o_nnz_is_d_expected_d, sizeof(__pyx_k_size_o_nnz_is_d_expected_d), 0, 0, 1, 0}, {&__pyx_n_s_sizes, __pyx_k_sizes, sizeof(__pyx_k_sizes), 0, 0, 1, 1}, {&__pyx_kp_s_sizes_array_should_have_d_entrie, __pyx_k_sizes_array_should_have_d_entrie, sizeof(__pyx_k_sizes_array_should_have_d_entrie), 0, 0, 1, 0}, {&__pyx_n_s_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 0, 0, 1, 1}, {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1}, {&__pyx_n_s_smooths, __pyx_k_smooths, sizeof(__pyx_k_smooths), 0, 0, 1, 1}, {&__pyx_n_s_snes, __pyx_k_snes, sizeof(__pyx_k_snes), 0, 0, 1, 1}, {&__pyx_n_s_snes_type, __pyx_k_snes_type, sizeof(__pyx_k_snes_type), 0, 0, 1, 1}, {&__pyx_n_s_solve, __pyx_k_solve, sizeof(__pyx_k_solve), 0, 0, 1, 1}, {&__pyx_n_s_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 0, 1, 1}, {&__pyx_n_s_sortype, __pyx_k_sortype, sizeof(__pyx_k_sortype), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_splitOwnership, __pyx_k_splitOwnership, sizeof(__pyx_k_splitOwnership), 0, 0, 1, 1}, {&__pyx_n_s_stage, __pyx_k_stage, sizeof(__pyx_k_stage), 0, 0, 1, 1}, {&__pyx_n_s_star, __pyx_k_star, sizeof(__pyx_k_star), 0, 0, 1, 1}, {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, {&__pyx_n_s_starts, __pyx_k_starts, sizeof(__pyx_k_starts), 0, 0, 1, 1}, {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stencil_type, __pyx_k_stencil_type, sizeof(__pyx_k_stencil_type), 0, 0, 1, 1}, {&__pyx_n_s_stencil_width, __pyx_k_stencil_width, sizeof(__pyx_k_stencil_width), 0, 0, 1, 1}, {&__pyx_n_s_stenciltype, __pyx_k_stenciltype, sizeof(__pyx_k_stenciltype), 0, 0, 1, 1}, {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1}, {&__pyx_n_s_step_number, __pyx_k_step_number, sizeof(__pyx_k_step_number), 0, 0, 1, 1}, {&__pyx_n_s_stol, __pyx_k_stol, sizeof(__pyx_k_stol), 0, 0, 1, 1}, {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1}, {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0}, {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0}, {&__pyx_n_s_strides, __pyx_k_strides, sizeof(__pyx_k_strides), 0, 0, 1, 1}, {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1}, {&__pyx_n_s_structure, __pyx_k_structure, sizeof(__pyx_k_structure), 0, 0, 1, 1}, {&__pyx_n_s_subcomm, __pyx_k_subcomm, sizeof(__pyx_k_subcomm), 0, 0, 1, 1}, {&__pyx_n_s_submat, __pyx_k_submat, sizeof(__pyx_k_submat), 0, 0, 1, 1}, {&__pyx_n_s_submats, __pyx_k_submats, sizeof(__pyx_k_submats), 0, 0, 1, 1}, {&__pyx_n_s_subminor, __pyx_k_subminor, sizeof(__pyx_k_subminor), 0, 0, 1, 1}, {&__pyx_n_s_subspaceOffsets, __pyx_k_subspaceOffsets, sizeof(__pyx_k_subspaceOffsets), 0, 0, 1, 1}, {&__pyx_n_s_subvec, __pyx_k_subvec, sizeof(__pyx_k_subvec), 0, 0, 1, 1}, {&__pyx_n_s_supp, __pyx_k_supp, sizeof(__pyx_k_supp), 0, 0, 1, 1}, {&__pyx_n_s_svalue, __pyx_k_svalue, sizeof(__pyx_k_svalue), 0, 0, 1, 1}, {&__pyx_n_s_swidth, __pyx_k_swidth, sizeof(__pyx_k_swidth), 0, 0, 1, 1}, {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1}, {&__pyx_n_s_symmetric, __pyx_k_symmetric, sizeof(__pyx_k_symmetric), 0, 0, 1, 1}, {&__pyx_n_s_syncFlush, __pyx_k_syncFlush, sizeof(__pyx_k_syncFlush), 0, 0, 1, 1}, {&__pyx_n_s_syncPrint, __pyx_k_syncPrint, sizeof(__pyx_k_syncPrint), 0, 0, 1, 1}, {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, {&__pyx_n_s_tab, __pyx_k_tab, sizeof(__pyx_k_tab), 0, 0, 1, 1}, {&__pyx_n_s_tabs, __pyx_k_tabs, sizeof(__pyx_k_tabs), 0, 0, 1, 1}, {&__pyx_n_s_tao_type, __pyx_k_tao_type, sizeof(__pyx_k_tao_type), 0, 0, 1, 1}, {&__pyx_n_s_tbline, __pyx_k_tbline, sizeof(__pyx_k_tbline), 0, 0, 1, 1}, {&__pyx_n_s_tblist, __pyx_k_tblist, sizeof(__pyx_k_tblist), 0, 0, 1, 1}, {&__pyx_n_s_terminate, __pyx_k_terminate, sizeof(__pyx_k_terminate), 0, 0, 1, 1}, {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1}, {&__pyx_n_s_threshold, __pyx_k_threshold, sizeof(__pyx_k_threshold), 0, 0, 1, 1}, {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1}, {&__pyx_n_s_time_step, __pyx_k_time_step, sizeof(__pyx_k_time_step), 0, 0, 1, 1}, {&__pyx_n_s_timestep, __pyx_k_timestep, sizeof(__pyx_k_timestep), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_n_s_toAll, __pyx_k_toAll, sizeof(__pyx_k_toAll), 0, 0, 1, 1}, {&__pyx_n_s_toZero, __pyx_k_toZero, sizeof(__pyx_k_toZero), 0, 0, 1, 1}, {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1}, {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1}, {&__pyx_n_s_traceback_2, __pyx_k_traceback_2, sizeof(__pyx_k_traceback_2), 0, 0, 1, 1}, {&__pyx_n_s_trans, __pyx_k_trans, sizeof(__pyx_k_trans), 0, 0, 1, 1}, {&__pyx_n_s_transpose, __pyx_k_transpose, sizeof(__pyx_k_transpose), 0, 0, 1, 1}, {&__pyx_n_s_ts_type, __pyx_k_ts_type, sizeof(__pyx_k_ts_type), 0, 0, 1, 1}, {&__pyx_n_s_twist, __pyx_k_twist, sizeof(__pyx_k_twist), 0, 0, 1, 1}, {&__pyx_n_s_typ, __pyx_k_typ, sizeof(__pyx_k_typ), 0, 0, 1, 1}, {&__pyx_n_s_type_registry, __pyx_k_type_registry, sizeof(__pyx_k_type_registry), 0, 0, 1, 1}, {&__pyx_n_s_typestr, __pyx_k_typestr, sizeof(__pyx_k_typestr), 0, 0, 1, 1}, {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, {&__pyx_n_s_ua, __pyx_k_ua, sizeof(__pyx_k_ua), 0, 0, 1, 1}, {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0}, {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0}, {&__pyx_n_s_unit, __pyx_k_unit, sizeof(__pyx_k_unit), 0, 0, 1, 1}, {&__pyx_kp_s_unknown_boundary_type_s, __pyx_k_unknown_boundary_type_s, sizeof(__pyx_k_unknown_boundary_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_element_type_s, __pyx_k_unknown_element_type_s, sizeof(__pyx_k_unknown_element_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_error_handler_s, __pyx_k_unknown_error_handler_s, sizeof(__pyx_k_unknown_error_handler_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_interpolation_type_s, __pyx_k_unknown_interpolation_type_s, sizeof(__pyx_k_unknown_interpolation_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_options_s, __pyx_k_unknown_options_s, sizeof(__pyx_k_unknown_options_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_scatter_mode_s, __pyx_k_unknown_scatter_mode_s, sizeof(__pyx_k_unknown_scatter_mode_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_shift_type_s, __pyx_k_unknown_shift_type_s, sizeof(__pyx_k_unknown_shift_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_stencil_location_type_s, __pyx_k_unknown_stencil_location_type_s, sizeof(__pyx_k_unknown_stencil_location_type_s), 0, 0, 1, 0}, {&__pyx_kp_s_unknown_stencil_type_s, __pyx_k_unknown_stencil_type_s, sizeof(__pyx_k_unknown_stencil_type_s), 0, 0, 1, 0}, {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1}, {&__pyx_n_s_up, __pyx_k_up, sizeof(__pyx_k_up), 0, 0, 1, 1}, {&__pyx_n_s_up_left, __pyx_k_up_left, sizeof(__pyx_k_up_left), 0, 0, 1, 1}, {&__pyx_n_s_up_right, __pyx_k_up_right, sizeof(__pyx_k_up_right), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1}, {&__pyx_n_s_useAnchors, __pyx_k_useAnchors, sizeof(__pyx_k_useAnchors), 0, 0, 1, 1}, {&__pyx_n_s_useClosure, __pyx_k_useClosure, sizeof(__pyx_k_useClosure), 0, 0, 1, 1}, {&__pyx_n_s_useCone, __pyx_k_useCone, sizeof(__pyx_k_useCone), 0, 0, 1, 1}, {&__pyx_n_s_useInitialGuess, __pyx_k_useInitialGuess, sizeof(__pyx_k_useInitialGuess), 0, 0, 1, 1}, {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_kp_s_values_must_have_two_or_more_dim, __pyx_k_values_must_have_two_or_more_dim, sizeof(__pyx_k_values_must_have_two_or_more_dim), 0, 0, 1, 0}, {&__pyx_n_s_varbounds, __pyx_k_varbounds, sizeof(__pyx_k_varbounds), 0, 0, 1, 1}, {&__pyx_n_s_vec, __pyx_k_vec, sizeof(__pyx_k_vec), 0, 0, 1, 1}, {&__pyx_n_s_vecTo, __pyx_k_vecTo, sizeof(__pyx_k_vecTo), 0, 0, 1, 1}, {&__pyx_n_s_vec_from, __pyx_k_vec_from, sizeof(__pyx_k_vec_from), 0, 0, 1, 1}, {&__pyx_n_s_vec_to, __pyx_k_vec_to, sizeof(__pyx_k_vec_to), 0, 0, 1, 1}, {&__pyx_n_s_vec_type, __pyx_k_vec_type, sizeof(__pyx_k_vec_type), 0, 0, 1, 1}, {&__pyx_n_s_vecs, __pyx_k_vecs, sizeof(__pyx_k_vecs), 0, 0, 1, 1}, {&__pyx_n_s_vectors, __pyx_k_vectors, sizeof(__pyx_k_vectors), 0, 0, 1, 1}, {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, {&__pyx_n_s_vg, __pyx_k_vg, sizeof(__pyx_k_vg), 0, 0, 1, 1}, {&__pyx_n_s_viennaclvechandle, __pyx_k_viennaclvechandle, sizeof(__pyx_k_viennaclvechandle), 0, 0, 1, 1}, {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1}, {&__pyx_n_s_viewer, __pyx_k_viewer, sizeof(__pyx_k_viewer), 0, 0, 1, 1}, {&__pyx_n_s_vl, __pyx_k_vl, sizeof(__pyx_k_vl), 0, 0, 1, 1}, {&__pyx_n_s_vlg, __pyx_k_vlg, sizeof(__pyx_k_vlg), 0, 0, 1, 1}, {&__pyx_n_s_vm, __pyx_k_vm, sizeof(__pyx_k_vm), 0, 0, 1, 1}, {&__pyx_n_s_vn, __pyx_k_vn, sizeof(__pyx_k_vn), 0, 0, 1, 1}, {&__pyx_n_s_vtol, __pyx_k_vtol, sizeof(__pyx_k_vtol), 0, 0, 1, 1}, {&__pyx_n_s_vwr_type, __pyx_k_vwr_type, sizeof(__pyx_k_vwr_type), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_kp_s_w_2, __pyx_k_w_2, sizeof(__pyx_k_w_2), 0, 0, 1, 0}, {&__pyx_n_s_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_wrapped_func, __pyx_k_wrapped_func, sizeof(__pyx_k_wrapped_func), 0, 0, 1, 1}, {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_xdot, __pyx_k_xdot, sizeof(__pyx_k_xdot), 0, 0, 1, 1}, {&__pyx_n_s_xdotdot, __pyx_k_xdotdot, sizeof(__pyx_k_xdotdot), 0, 0, 1, 1}, {&__pyx_n_s_xl, __pyx_k_xl, sizeof(__pyx_k_xl), 0, 0, 1, 1}, {&__pyx_n_s_xmax, __pyx_k_xmax, sizeof(__pyx_k_xmax), 0, 0, 1, 1}, {&__pyx_n_s_xmin, __pyx_k_xmin, sizeof(__pyx_k_xmin), 0, 0, 1, 1}, {&__pyx_n_s_xnorm, __pyx_k_xnorm, sizeof(__pyx_k_xnorm), 0, 0, 1, 1}, {&__pyx_n_s_xu, __pyx_k_xu, sizeof(__pyx_k_xu), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_ymax, __pyx_k_ymax, sizeof(__pyx_k_ymax), 0, 0, 1, 1}, {&__pyx_n_s_ymin, __pyx_k_ymin, sizeof(__pyx_k_ymin), 0, 0, 1, 1}, {&__pyx_n_s_ynorm, __pyx_k_ynorm, sizeof(__pyx_k_ynorm), 0, 0, 1, 1}, {&__pyx_n_s_zeropivot, __pyx_k_zeropivot, sizeof(__pyx_k_zeropivot), 0, 0, 1, 1}, {&__pyx_n_s_zmax, __pyx_k_zmax, sizeof(__pyx_k_zmax), 0, 0, 1, 1}, {&__pyx_n_s_zmin, __pyx_k_zmin, sizeof(__pyx_k_zmin), 0, 0, 1, 1}, {&__pyx_n_s_zoz, __pyx_k_zoz, sizeof(__pyx_k_zoz), 0, 0, 1, 1}, {&__pyx_n_s_zzo, __pyx_k_zzo, sizeof(__pyx_k_zzo), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 15, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 3, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 77, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(3, 46, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(3, 68, __pyx_L1_error) __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(4, 209, __pyx_L1_error) __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(5, 398, __pyx_L1_error) __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(6, 602, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(7, 417, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(8, 293, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(9, 23, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(10, 38, __pyx_L1_error) __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(11, 293, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(56, 613, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(56, 832, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "PETSc/petscopt.pxi":46 * prefix = prefix.getOptionsPrefix() * elif not isinstance(prefix, str): * raise TypeError('option prefix must be string') # <<<<<<<<<<<<<< * if not prefix: * return None */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_option_prefix_must_be_string); if (unlikely(!__pyx_tuple_)) __PYX_ERR(3, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "PETSc/petscopt.pxi":50 * return None * if prefix.count(' '): * raise ValueError('option prefix should not have spaces') # <<<<<<<<<<<<<< * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hypen') */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_option_prefix_should_not_have_sp); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "PETSc/petscopt.pxi":52 * raise ValueError('option prefix should not have spaces') * if prefix.startswith('-'): * raise ValueError('option prefix should not start with a hypen') # <<<<<<<<<<<<<< * return prefix * */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_option_prefix_should_not_start_w); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "PETSc/petscopt.pxi":175 * if not iskey(key): * return None * key = key[1:] # <<<<<<<<<<<<<< * if key[0] == '-': * key = key[1:] */ __pyx_slice__6 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__6)) __PYX_ERR(3, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__6); __Pyx_GIVEREF(__pyx_slice__6); /* "PETSc/petscmpi.pxi":113 * * cdef inline int comm_size(MPI_Comm comm) except ? -1: * if comm == MPI_COMM_NULL: raise ValueError("null communicator") # <<<<<<<<<<<<<< * cdef int size = 0 * CHKERR( MPI_Comm_size(comm, &size) ) */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_null_communicator); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(13, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "PETSc/petscsys.pxi":80 * if (bs < 1): raise ValueError( * "block size %d must be positive" % toInt(bs)) * if n==PETSC_DECIDE and N==PETSC_DECIDE: raise ValueError( # <<<<<<<<<<<<<< * "local and global sizes cannot be both 'DECIDE'") * if (n > 0) and (n % bs): raise ValueError( */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_local_and_global_sizes_cannot_be); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(14, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "PETSc/petscis.pxi":209 * * def __getreadbuffer__(self, Py_ssize_t idx, void **p): * if idx != 0: raise SystemError( # <<<<<<<<<<<<<< * "accessing non-existent buffer segment") * return self.getbuffer(p) */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(4, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "PETSc/petscvec.pxi":536 * if idx != 0: raise SystemError( * "accessing non-existent buffer segment") * if self.readonly: raise TypeError( # <<<<<<<<<<<<<< * "Object is not writable.") * return self.getbuffer(p) */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Object_is_not_writable); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(5, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "PETSc/petscmat.pxi":859 * ("row indices must have two dimensions: " * "rows.ndim=%d") % (PyArray_NDIM(ai)) ) * elif not PyArray_ISCONTIGUOUS(ai): raise ValueError( # <<<<<<<<<<<<<< * "expecting a C-contiguous array") * if PyArray_NDIM(aj) != 2: raise ValueError( */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_expecting_a_C_contiguous_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(6, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "PETSc/Sys.pyx":19 * vstr = bytes2str(cversion) * if release != 0: * date = vstr.split(",", 1)[-1].strip() # <<<<<<<<<<<<<< * else: * date = vstr.split("GIT Date:")[-1].strip() */ __pyx_tuple__15 = PyTuple_Pack(2, __pyx_kp_s__14, __pyx_int_1); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(27, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "PETSc/Sys.pyx":31 * @classmethod * def getVersionInfo(cls): * version, dev, date, author = cls.getVersion(True, True, True) # <<<<<<<<<<<<<< * return dict(major = version[0], * minor = version[1], */ __pyx_tuple__16 = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(27, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "PETSc/Sys.pyx":74 * cdef object end = kargs.get('end', '\n') * if comm_rank(ccomm) == 0: * if not args: args = ('',) # <<<<<<<<<<<<<< * format = ['%s', sep] * len(args) * format[-1] = end */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(27, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "PETSc/Sys.pyx":173 * @classmethod * def registerCitation(cls, citation): * if not citation: raise ValueError("empty citation") # <<<<<<<<<<<<<< * cdef const char *cit = NULL * citation = str2bytes(citation, &cit) */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_empty_citation); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(27, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "PETSc/Log.pyx":9 * @classmethod * def Stage(cls, name): * if not name: raise ValueError("empty name") # <<<<<<<<<<<<<< * cdef const char *cname = NULL * name = str2bytes(name, &cname) */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_empty_name); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(28, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "PETSc/Log.pyx":115 * else: * name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)]) * with cls.Event(name_, klass): # <<<<<<<<<<<<<< * return func(*args, **kwargs) * return wrapped_func */ __pyx_tuple__21 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(28, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "PETSc/Log.pyx":110 * def decorator(func): * @functools.wraps(func) * def wrapped_func(*args, **kwargs): # <<<<<<<<<<<<<< * if name: * name_ = name */ __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_name_3); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(28, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_Log_pyx, __pyx_n_s_wrapped_func, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(28, 110, __pyx_L1_error) /* "PETSc/Log.pyx":108 * ... * """ * def decorator(func): # <<<<<<<<<<<<<< * @functools.wraps(func) * def wrapped_func(*args, **kwargs): */ __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_wrapped_func, __pyx_n_s_wrapped_func); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(28, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_Log_pyx, __pyx_n_s_decorator, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(28, 108, __pyx_L1_error) /* "PETSc/Log.pyx":160 * def __set__(self, value): * self; value; # unused * raise TypeError("readonly attribute") # <<<<<<<<<<<<<< * * # */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_readonly_attribute); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(28, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "PETSc/Comm.pyx":25 * if not isinstance(self, Comm): return NotImplemented * if not isinstance(other, Comm): return NotImplemented * if op!=2 and op!=3: raise TypeError("only '==' and '!='") # <<<<<<<<<<<<<< * cdef Comm s = self * cdef Comm o = other */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_only_and); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(9, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "PETSc/Comm.pyx":48 * if self.comm == MPI_COMM_NULL: return * if not self.isdup: * raise ValueError("communicator not owned") # <<<<<<<<<<<<<< * CHKERR( PetscCommDestroy(&self.comm) ) * self.comm = MPI_COMM_NULL */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_communicator_not_owned); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(9, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "PETSc/Vec.pyx":330 * PyCapsule_SetName(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor field, pycapsule.PyCapsule can only be consumed once") # <<<<<<<<<<<<<< * if size is None: size = (toInt(nz), toInt(PETSC_DECIDE)) * Vec_Sizes(size, bsize, &bs, &n, &N) */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Expect_a_dltensor_field_pycapsul); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(33, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "PETSc/Vec.pyx":387 * * if vec is None and dltensor is None: * raise ValueError('Missing input parameters') # <<<<<<<<<<<<<< * if vec is not None: * t0 = self.getType() */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Missing_input_parameters); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(33, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "PETSc/Vec.pyx":395 * ctx = (vec).get_attr('__dltensor_ctx__') * if ctx is None: * raise ValueError('Input vector has no tensor information') # <<<<<<<<<<<<<< * self.set_attr('__dltensor_ctx__', ctx) * else: */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Input_vector_has_no_tensor_infor); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(33, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "PETSc/Vec.pyx":403 * ptr = PyCapsule_GetPointer(dltensor, 'used_dltensor') * else: * raise ValueError("Expect a dltensor or used_dltensor field") # <<<<<<<<<<<<<< * bits = ptr.dl_tensor.dtype.bits * if bits != 8*sizeof(PetscScalar): */ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Expect_a_dltensor_or_used_dltens); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(33, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "PETSc/Vec.pyx":463 * shape_strides[i+ndim] = strides[i] * else: * raise ValueError('Missing tensor information') # <<<<<<<<<<<<<< * dl_tensor.ndim = ndim * dl_tensor.shape = shape_strides */ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Missing_tensor_information); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(33, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "PETSc/Vec.pyx":475 * dtype.bits = 32 * else: * raise ValueError('Unsupported PetscScalar type') # <<<<<<<<<<<<<< * dtype.lanes = 1 * dlm_tensor.manager_ctx = self.vec */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Unsupported_PetscScalar_type); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(33, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "PETSc/Vec.pyx":686 * CHKERR( VecCUDAGetArrayWrite(self.vec, &hdl) ) * else: * raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'") # <<<<<<<<<<<<<< * return hdl * */ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Invalid_mode_expected_rw_r_or_w); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(33, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "PETSc/Vec.pyx":754 * CHKERR( VecViennaCLGetCLMemWrite(self.vec, &memhdl) ) * else: * raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'") # <<<<<<<<<<<<<< * return memhdl * */ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Invalid_mode_expected_r_w_or_rw); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(33, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "PETSc/Vec.pyx":1016 * * def getValuesStagStencil(self, indices, values=None): * raise NotImplementedError('getValuesStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def setValue(self, index, value, addv=None): */ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_getValuesStagStencil_not_yet_imp); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(33, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); /* "PETSc/Vec.pyx":1031 * * def setValuesStagStencil(self, indices, values, addv=None): * raise NotImplementedError('setValuesStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def setLGMap(self, LGMap lgmap): */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_setValuesStagStencil_not_yet_imp); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(33, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); /* "PETSc/Vec.pyx":1226 * def __set__(self, value): * cdef buf = self.getBuffer() * with buf as array: array[:] = value # <<<<<<<<<<<<<< * * property array_r: */ __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(33, 1226, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__39); __Pyx_GIVEREF(__pyx_slice__39); /* "PETSc/Mat.pyx":976 * * def setValueStagStencil(self, row, col, value, addv=None): * raise NotImplementedError('setValueStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def setValueBlockedStencil(self, row, col, value, addv=None): */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_setValueStagStencil_not_yet_impl); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(38, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "PETSc/Mat.pyx":984 * * def setValueBlockedStagStencil(self, row, col, value, addv=None): * raise NotImplementedError('setValueBlockedStagStencil not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def zeroRows(self, rows, diag=1, Vec x=None, Vec b=None): */ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_setValueBlockedStagStencil_not_y); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(38, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "PETSc/Mat.pyx":1145 * cdef ndarray ibdiag = array_s(m*bs, cibdiag) * ibdiag.shape = (toInt(m//bs), toInt(bs), toInt(bs)) * return ibdiag.transpose(0, 2, 1) # <<<<<<<<<<<<<< * * # null space */ __pyx_tuple__42 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_2, __pyx_int_1); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(38, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "PETSc/PC.pyx":782 * * if typ in {PC.PatchConstructType.PYTHON, PC.PatchConstructType.USER} and operator is None: * raise ValueError("Must provide operator for USER or PYTHON type") # <<<<<<<<<<<<<< * if operator is not None: * context = (operator, args, kargs) */ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Must_provide_operator_for_USER_o); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(39, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "PETSc/SNES.pyx":183 * if comms is not None: * if clevels != len(comms): * raise ValueError("Must provide as many communicators as levels") # <<<<<<<<<<<<<< * CHKERR( PetscMalloc(sizeof(MPI_Comm)*clevels, &ccomms) ) * try: */ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Must_provide_as_many_communicato); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(41, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "PETSc/TAO.pyx":659 * self.setFunctionTolerances(**value) * else: * raise TypeError("expecting tuple/list or dict") # <<<<<<<<<<<<<< * * property gtol: */ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_expecting_tuple_list_or_dict); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(43, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "PETSc/DMPlex.pyx":44 * return self * * def createBoxMesh(self, faces, lower=(0,0,0), upper=(1,1,1), # <<<<<<<<<<<<<< * simplex=True, periodic=False, interpolate=True, comm=None): * cdef Py_ssize_t i = 0 */ __pyx_tuple__46 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(48, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); __pyx_tuple__47 = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(48, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "PETSc/DMPlex.pyx":345 * finally: * CHKERR( DMPlexRestoreTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points) ) * return out[::2],out[1::2] # <<<<<<<<<<<<<< * * def vecGetClosure(self, Section sec, Vec vec, p): */ __pyx_slice__48 = PySlice_New(Py_None, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__48)) __PYX_ERR(48, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__48); __Pyx_GIVEREF(__pyx_slice__48); __pyx_slice__49 = PySlice_New(__pyx_int_1, Py_None, __pyx_int_2); if (unlikely(!__pyx_slice__49)) __PYX_ERR(48, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__49); __Pyx_GIVEREF(__pyx_slice__49); /* "PETSc/DMPlex.pyx":561 * bcpoints[i] = (bcPoints[i]).iset * else: * raise ValueError("bcPoints is a required argument") # <<<<<<<<<<<<<< * else: * assert bcComps is None */ __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_bcPoints_is_a_required_argument); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(48, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "PETSc/DMStag.pyx":311 * * def getVecArray(self, Vec vec): * raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * def get1dCoordinatecArrays(self): */ __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_getVecArray_for_DMStag_not_yet_i); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(49, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "PETSc/DMStag.pyx":314 * * def get1dCoordinatecArrays(self): * raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py') # <<<<<<<<<<<<<< * * property dim: */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_get1dCoordinatecArrays_for_DMSta); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(49, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "PETSc/Partitioner.pyx":68 * numProcs, toInt(nsize)) * if points is None: * raise ValueError("Must provide both sizes and points arrays") # <<<<<<<<<<<<<< * if points is not None: * points = iarray_i(points, NULL, &cpoints) */ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_Must_provide_both_sizes_and_poin); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(54, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "View.MemoryView":133 * * if not self.ndim: * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<< * * if itemsize <= 0: */ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(56, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "View.MemoryView":136 * * if itemsize <= 0: * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<< * * if not isinstance(format, bytes): */ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(56, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "View.MemoryView":148 * * if not self._shape: * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<< * * */ __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(56, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "View.MemoryView":176 * self.data = malloc(self.len) * if not self.data: * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<< * * if self.dtype_is_object: */ __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(56, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "View.MemoryView":192 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS * if not (flags & bufmode): * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<< * info.buf = self.data * info.len = self.len */ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(56, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(56, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "View.MemoryView":418 * def __setitem__(memoryview self, object index, object value): * if self.view.readonly: * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<< * * have_slices, index = _unellipsify(index, self.view.ndim) */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(56, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "View.MemoryView":495 * result = struct.unpack(self.view.format, bytesitem) * except struct.error: * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<< * else: * if len(self.view.format) == 1: */ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(56, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "View.MemoryView":520 * def __getbuffer__(self, Py_buffer *info, int flags): * if flags & PyBUF_WRITABLE and self.view.readonly: * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<< * * if flags & PyBUF_ND: */ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(56, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "View.MemoryView":570 * if self.view.strides == NULL: * * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<< * * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) */ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(56, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "View.MemoryView":577 * def suboffsets(self): * if self.view.suboffsets == NULL: * return (-1,) * self.view.ndim # <<<<<<<<<<<<<< * * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) */ __pyx_tuple__66 = PyTuple_New(1); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(56, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_INCREF(__pyx_int_neg_1); __Pyx_GIVEREF(__pyx_int_neg_1); PyTuple_SET_ITEM(__pyx_tuple__66, 0, __pyx_int_neg_1); __Pyx_GIVEREF(__pyx_tuple__66); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(56, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "View.MemoryView":703 * for suboffset in suboffsets[:ndim]: * if suboffset >= 0: * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<< * * */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(56, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(56, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(56, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "PETSc/Const.pyx":15 * # -------------------------------------------------------------------- * * class InsertMode(object): # <<<<<<<<<<<<<< * # native * NOT_SET_VALUES = PETSC_NOT_SET_VALUES */ __pyx_tuple__75 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "PETSc/Const.pyx":36 * # -------------------------------------------------------------------- * * class ScatterMode(object): # <<<<<<<<<<<<<< * # native * SCATTER_FORWARD = PETSC_SCATTER_FORWARD */ __pyx_tuple__76 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "PETSc/Const.pyx":51 * # -------------------------------------------------------------------- * * class NormType(object): # <<<<<<<<<<<<<< * # native * NORM_1 = PETSC_NORM_1 */ __pyx_tuple__77 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); /* "PETSc/Error.pyx":3 * # -------------------------------------------------------------------- * * class Error(RuntimeError): # <<<<<<<<<<<<<< * * _traceback_ = [] */ __pyx_tuple__78 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "PETSc/Error.pyx":7 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ __pyx_tuple__79 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ierr); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_Error_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(1, 7, __pyx_L1_error) /* "PETSc/Error.pyx":11 * RuntimeError.__init__(self, self.ierr) * * def __nonzero__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ __pyx_tuple__81 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ierr); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_Error_pyx, __pyx_n_s_nonzero_2, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(1, 11, __pyx_L1_error) /* "PETSc/Error.pyx":15 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_Error_pyx, __pyx_n_s_repr, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(1, 15, __pyx_L1_error) /* "PETSc/Error.pyx":18 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ __pyx_tuple__85 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_csize, __pyx_n_s_crank, __pyx_n_s_width, __pyx_n_s_rank, __pyx_n_s_tblist, __pyx_n_s_entry, __pyx_n_s_tbline); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_Error_pyx, __pyx_n_s_str, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(1, 18, __pyx_L1_error) /* "PETSc/Viewer.pyx":3 * # -------------------------------------------------------------------- * * class ViewerType(object): # <<<<<<<<<<<<<< * SOCKET = S_(PETSCVIEWERSOCKET) * ASCII = S_(PETSCVIEWERASCII) */ __pyx_tuple__87 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(29, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); /* "PETSc/Viewer.pyx":20 * EXODUSII = S_(PETSCVIEWEREXODUSII) * * class ViewerFormat(object): # <<<<<<<<<<<<<< * DEFAULT = PETSC_VIEWER_DEFAULT * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB */ __pyx_tuple__88 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(29, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__88); __Pyx_GIVEREF(__pyx_tuple__88); /* "PETSc/Viewer.pyx":60 * FAILED = PETSC_VIEWER_FAILED * * class FileMode(object): # <<<<<<<<<<<<<< * # native * READ = PETSC_FILE_MODE_READ */ __pyx_tuple__89 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(29, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); /* "PETSc/Viewer.pyx":71 * AU = UA = APPEND_UPDATE * * class DrawSize(object): # <<<<<<<<<<<<<< * # native * FULL_SIZE = PETSC_DRAW_FULL_SIZE */ __pyx_tuple__90 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(29, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__90); __Pyx_GIVEREF(__pyx_tuple__90); /* "PETSc/Random.pyx":3 * # -------------------------------------------------------------------- * * class RandomType(object): # <<<<<<<<<<<<<< * RAND = S_(PETSCRAND) * RAND48 = S_(PETSCRAND48) */ __pyx_tuple__91 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(30, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); /* "PETSc/IS.pyx":3 * # -------------------------------------------------------------------- * * class ISType(object): # <<<<<<<<<<<<<< * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) */ __pyx_tuple__92 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(31, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__92); __Pyx_GIVEREF(__pyx_tuple__92); /* "PETSc/IS.pyx":350 * * * class GLMapMode(object): # <<<<<<<<<<<<<< * MASK = PETSC_IS_GTOLM_MASK * DROP = PETSC_IS_GTOLM_DROP */ __pyx_tuple__93 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(31, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); /* "PETSc/IS.pyx":355 * * * class LGMapType(object): # <<<<<<<<<<<<<< * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) */ __pyx_tuple__94 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(31, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__94); __Pyx_GIVEREF(__pyx_tuple__94); /* "PETSc/SF.pyx":3 * # -------------------------------------------------------------------- * * class SFType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_tuple__95 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(32, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); /* "PETSc/Vec.pyx":3 * # -------------------------------------------------------------------- * * class VecType(object): # <<<<<<<<<<<<<< * SEQ = S_(VECSEQ) * MPI = S_(VECMPI) */ __pyx_tuple__96 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(33, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__96); __Pyx_GIVEREF(__pyx_tuple__96); /* "PETSc/Vec.pyx":19 * KOKKOS = S_(VECKOKKOS) * * class VecOption(object): # <<<<<<<<<<<<<< * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES * IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES */ __pyx_tuple__97 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(33, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); /* "PETSc/FE.pyx":3 * # -------------------------------------------------------------------- * * class FEType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) */ __pyx_tuple__98 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(35, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__98); __Pyx_GIVEREF(__pyx_tuple__98); /* "PETSc/Scatter.pyx":3 * # -------------------------------------------------------------------- * * class ScatterType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_tuple__99 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(36, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); /* "PETSc/Mat.pyx":3 * # -------------------------------------------------------------------- * * class MatType(object): # <<<<<<<<<<<<<< * SAME = S_(MATSAME) * MAIJ = S_(MATMAIJ) */ __pyx_tuple__100 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__100); __Pyx_GIVEREF(__pyx_tuple__100); /* "PETSc/Mat.pyx":85 * HARA = S_(MATHARA) * * class MatOption(object): # <<<<<<<<<<<<<< * OPTION_MIN = MAT_OPTION_MIN * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR */ __pyx_tuple__101 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(38, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); /* "PETSc/Mat.pyx":114 * OPTION_MAX = MAT_OPTION_MAX * * class MatAssemblyType(object): # <<<<<<<<<<<<<< * # native * FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY */ __pyx_tuple__102 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(38, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__102); __Pyx_GIVEREF(__pyx_tuple__102); /* "PETSc/Mat.pyx":122 * FLUSH = FLUSH_ASSEMBLY * * class MatInfoType(object): # <<<<<<<<<<<<<< * LOCAL = MAT_LOCAL * GLOBAL_MAX = MAT_GLOBAL_MAX */ __pyx_tuple__103 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(38, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); /* "PETSc/Mat.pyx":127 * GLOBAL_SUM = MAT_GLOBAL_SUM * * class MatStructure(object): # <<<<<<<<<<<<<< * # native * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN */ __pyx_tuple__104 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(38, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__104); __Pyx_GIVEREF(__pyx_tuple__104); /* "PETSc/Mat.pyx":139 * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * * class MatOrderingType(object): # <<<<<<<<<<<<<< * NATURAL = S_(MATORDERINGNATURAL) * ND = S_(MATORDERINGND) */ __pyx_tuple__105 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(38, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); /* "PETSc/Mat.pyx":150 * AMD = S_(MATORDERINGAMD) * * class MatSolverType(object): # <<<<<<<<<<<<<< * SUPERLU = S_(MATSOLVERSUPERLU) * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) */ __pyx_tuple__106 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(38, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__106); __Pyx_GIVEREF(__pyx_tuple__106); /* "PETSc/Mat.pyx":172 * CUDA = S_(MATSOLVERCUDA) * * class MatFactorShiftType(object): # <<<<<<<<<<<<<< * # native * NONE = MAT_SHIFT_NONE */ __pyx_tuple__107 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(38, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); /* "PETSc/Mat.pyx":182 * PD = MAT_SHIFT_POSITIVE_DEFINITE * * class MatSORType(object): # <<<<<<<<<<<<<< * FORWARD_SWEEP = SOR_FORWARD_SWEEP * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP */ __pyx_tuple__108 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(38, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__108); __Pyx_GIVEREF(__pyx_tuple__108); /* "PETSc/PC.pyx":3 * # -------------------------------------------------------------------- * * class PCType(object): # <<<<<<<<<<<<<< * NONE = S_(PCNONE) * JACOBI = S_(PCJACOBI) */ __pyx_tuple__109 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); /* "PETSc/PC.pyx":54 * HARA = S_(PCHARA) * * class PCSide(object): # <<<<<<<<<<<<<< * # native * LEFT = PC_LEFT */ __pyx_tuple__110 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(39, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__110); __Pyx_GIVEREF(__pyx_tuple__110); /* "PETSc/PC.pyx":64 * S = SYMMETRIC * * class PCASMType(object): # <<<<<<<<<<<<<< * NONE = PC_ASM_NONE * BASIC = PC_ASM_BASIC */ __pyx_tuple__111 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(39, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); /* "PETSc/PC.pyx":70 * INTERPOLATE = PC_ASM_INTERPOLATE * * class PCGASMType(object): # <<<<<<<<<<<<<< * NONE = PC_GASM_NONE * BASIC = PC_GASM_BASIC */ __pyx_tuple__112 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(39, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__112); __Pyx_GIVEREF(__pyx_tuple__112); /* "PETSc/PC.pyx":76 * INTERPOLATE = PC_GASM_INTERPOLATE * * class PCMGType(object): # <<<<<<<<<<<<<< * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE * ADDITIVE = PC_MG_ADDITIVE */ __pyx_tuple__113 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(39, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); /* "PETSc/PC.pyx":82 * KASKADE = PC_MG_KASKADE * * class PCMGCycleType(object): # <<<<<<<<<<<<<< * V = PC_MG_CYCLE_V * W = PC_MG_CYCLE_W */ __pyx_tuple__114 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(39, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__114); __Pyx_GIVEREF(__pyx_tuple__114); /* "PETSc/PC.pyx":86 * W = PC_MG_CYCLE_W * * class PCGAMGType(object): # <<<<<<<<<<<<<< * AGG = S_(PCGAMGAGG) * GEO = S_(PCGAMGGEO) */ __pyx_tuple__115 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(39, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); /* "PETSc/PC.pyx":91 * CLASSICAL = S_(PCGAMGCLASSICAL) * * class PCCompositeType(object): # <<<<<<<<<<<<<< * ADDITIVE = PC_COMPOSITE_ADDITIVE * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE */ __pyx_tuple__116 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(39, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__116); __Pyx_GIVEREF(__pyx_tuple__116); /* "PETSc/PC.pyx":98 * SCHUR = PC_COMPOSITE_SCHUR * * class PCFieldSplitSchurPreType(object): # <<<<<<<<<<<<<< * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP */ __pyx_tuple__117 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(39, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); /* "PETSc/PC.pyx":105 * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * * class PCFieldSplitSchurFactType(object): # <<<<<<<<<<<<<< * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER */ __pyx_tuple__118 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(39, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__118); __Pyx_GIVEREF(__pyx_tuple__118); /* "PETSc/PC.pyx":111 * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * * class PCPatchConstructType(object): # <<<<<<<<<<<<<< * STAR = PC_PATCH_STAR * VANKA = PC_PATCH_VANKA */ __pyx_tuple__119 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(39, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); /* "PETSc/KSP.pyx":3 * # -------------------------------------------------------------------- * * class KSPType(object): # <<<<<<<<<<<<<< * RICHARDSON = S_(KSPRICHARDSON) * CHEBYSHEV = S_(KSPCHEBYSHEV) */ __pyx_tuple__120 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__120); __Pyx_GIVEREF(__pyx_tuple__120); /* "PETSc/KSP.pyx":51 * HPDDM = S_(KSPHPDDM) * * class KSPNormType(object): # <<<<<<<<<<<<<< * # native * NORM_DEFAULT = KSP_NORM_DEFAULT */ __pyx_tuple__121 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(40, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); /* "PETSc/KSP.pyx":65 * NATURAL = NORM_NATURAL * * class KSPConvergedReason(object): # <<<<<<<<<<<<<< * #iterating * CONVERGED_ITERATING = KSP_CONVERGED_ITERATING */ __pyx_tuple__122 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(40, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__122); __Pyx_GIVEREF(__pyx_tuple__122); /* "PETSc/SNES.pyx":3 * # -------------------------------------------------------------------- * * class SNESType(object): # <<<<<<<<<<<<<< * NEWTONLS = S_(SNESNEWTONLS) * NEWTONTR = S_(SNESNEWTONTR) */ __pyx_tuple__123 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); /* "PETSc/SNES.pyx":25 * PATCH = S_(SNESPATCH) * * class SNESNormSchedule(object): # <<<<<<<<<<<<<< * # native * NORM_DEFAULT = SNES_NORM_DEFAULT */ __pyx_tuple__124 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(41, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__124); __Pyx_GIVEREF(__pyx_tuple__124); /* "PETSc/SNES.pyx":41 * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY * * class SNESConvergedReason(object): # <<<<<<<<<<<<<< * # iterating * CONVERGED_ITERATING = SNES_CONVERGED_ITERATING */ __pyx_tuple__125 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(41, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); /* "PETSc/TS.pyx":3 * # ----------------------------------------------------------------------------- * * class TSType(object): # <<<<<<<<<<<<<< * # native * EULER = S_(TSEULER) */ __pyx_tuple__126 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(42, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__126); __Pyx_GIVEREF(__pyx_tuple__126); /* "PETSc/TS.pyx":34 * RUNGE_KUTTA = RK * * class TSRKType(object): # <<<<<<<<<<<<<< * RK1FE = S_(TSRK1FE) * RK2A = S_(TSRK2A) */ __pyx_tuple__127 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(42, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); /* "PETSc/TS.pyx":47 * RK8VR = S_(TSRK8VR) * * class TSARKIMEXType(object): # <<<<<<<<<<<<<< * ARKIMEX1BEE = S_(TSARKIMEX1BEE) * ARKIMEXA2 = S_(TSARKIMEXA2) */ __pyx_tuple__128 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(42, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__128); __Pyx_GIVEREF(__pyx_tuple__128); /* "PETSc/TS.pyx":62 * ARKIMEX5 = S_(TSARKIMEX5) * * class TSProblemType(object): # <<<<<<<<<<<<<< * LINEAR = TS_LINEAR * NONLINEAR = TS_NONLINEAR */ __pyx_tuple__129 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(42, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); /* "PETSc/TS.pyx":66 * NONLINEAR = TS_NONLINEAR * * class TSEquationType(object): # <<<<<<<<<<<<<< * UNSPECIFIED = TS_EQ_UNSPECIFIED * EXPLICIT = TS_EQ_EXPLICIT */ __pyx_tuple__130 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(42, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__130); __Pyx_GIVEREF(__pyx_tuple__130); /* "PETSc/TS.pyx":81 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * * class TSExactFinalTime(object): # <<<<<<<<<<<<<< * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED * STEPOVER = TS_EXACTFINALTIME_STEPOVER */ __pyx_tuple__131 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(42, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); /* "PETSc/TS.pyx":87 * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * * class TSConvergedReason(object): # <<<<<<<<<<<<<< * # iterating * CONVERGED_ITERATING = TS_CONVERGED_ITERATING */ __pyx_tuple__132 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(42, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__132); __Pyx_GIVEREF(__pyx_tuple__132); /* "PETSc/AO.pyx":3 * # -------------------------------------------------------------------- * * class AOType(object): # <<<<<<<<<<<<<< * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) */ __pyx_tuple__133 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); /* "PETSc/DM.pyx":3 * # -------------------------------------------------------------------- * * class DMType(object): # <<<<<<<<<<<<<< * DA = S_(DMDA_type) * COMPOSITE = S_(DMCOMPOSITE) */ __pyx_tuple__134 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(45, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__134); __Pyx_GIVEREF(__pyx_tuple__134); /* "PETSc/DM.pyx":20 * STAG = S_(DMSTAG) * * class DMBoundaryType(object): # <<<<<<<<<<<<<< * NONE = DM_BOUNDARY_NONE * GHOSTED = DM_BOUNDARY_GHOSTED */ __pyx_tuple__135 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(45, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); /* "PETSc/DS.pyx":3 * # -------------------------------------------------------------------- * * class DSType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCDSBASIC) * */ __pyx_tuple__136 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__136); __Pyx_GIVEREF(__pyx_tuple__136); /* "PETSc/DMDA.pyx":3 * # -------------------------------------------------------------------- * * class DMDAStencilType(object): # <<<<<<<<<<<<<< * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX */ __pyx_tuple__137 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); /* "PETSc/DMDA.pyx":7 * BOX = DMDA_STENCIL_BOX * * class DMDAInterpolationType(object): # <<<<<<<<<<<<<< * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 */ __pyx_tuple__138 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(47, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__138); __Pyx_GIVEREF(__pyx_tuple__138); /* "PETSc/DMDA.pyx":11 * Q1 = DMDA_INTERPOLATION_Q1 * * class DMDAElementType(object): # <<<<<<<<<<<<<< * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 */ __pyx_tuple__139 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(47, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); /* "PETSc/DMStag.pyx":3 * # -------------------------------------------------------------------- * * class DMStagStencilType(object): # <<<<<<<<<<<<<< * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX */ __pyx_tuple__140 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__140); __Pyx_GIVEREF(__pyx_tuple__140); /* "PETSc/DMStag.pyx":8 * NONE = DMSTAG_STENCIL_NONE * * class DMStagStencilLocation(object): # <<<<<<<<<<<<<< * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT */ __pyx_tuple__141 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(49, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "PETSc/DMSwarm.pyx":3 * # -------------------------------------------------------------------- * * class DMSwarmType(object): # <<<<<<<<<<<<<< * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC */ __pyx_tuple__142 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); /* "PETSc/DMSwarm.pyx":7 * PIC = DMSWARM_PIC * * class DMSwarmMigrateType(object): # <<<<<<<<<<<<<< * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER */ __pyx_tuple__143 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(53, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); /* "PETSc/DMSwarm.pyx":13 * MIGRATE_USER = DMSWARM_MIGRATE_USER * * class DMSwarmCollectType(object): # <<<<<<<<<<<<<< * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX */ __pyx_tuple__144 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(53, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__144); __Pyx_GIVEREF(__pyx_tuple__144); /* "PETSc/DMSwarm.pyx":19 * COLLECT_USER = DMSWARM_COLLECT_USER * * class DMSwarmPICLayoutType(object): # <<<<<<<<<<<<<< * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS */ __pyx_tuple__145 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(53, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); /* "PETSc/Partitioner.pyx":3 * # -------------------------------------------------------------------- * * class PartitionerType(object): # <<<<<<<<<<<<<< * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) */ __pyx_tuple__146 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__146); __Pyx_GIVEREF(__pyx_tuple__146); /* "PETSc/PETSc.pyx":432 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * global tracebacklist * Error._traceback_ = tracebacklist */ __pyx_tuple__147 = PyTuple_Pack(3, __pyx_n_s_args, __pyx_n_s_comm, __pyx_n_s_ready); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(11, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_PETSc_pyx, __pyx_n_s_initialize, 432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(11, 432, __pyx_L1_error) /* "PETSc/PETSc.pyx":448 * PETSC_COMM_DEFAULT = PETSC_COMM_WORLD * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PETSc_PETSc_pyx, __pyx_n_s_finalize, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(11, 448, __pyx_L1_error) /* "View.MemoryView":286 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(56, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__150); __Pyx_GIVEREF(__pyx_tuple__150); /* "View.MemoryView":287 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(56, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); /* "View.MemoryView":288 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(56, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__152); __Pyx_GIVEREF(__pyx_tuple__152); /* "View.MemoryView":291 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(56, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); /* "View.MemoryView":292 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(56, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__154); __Pyx_GIVEREF(__pyx_tuple__154); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__155 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(56, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(56, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(57, 1, __pyx_L1_error); __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(57, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_8petsc4py_5PETSc_PetscError = Py_None; Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_citations_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_stage_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_class_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_event_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc___COMM_NULL__ = ((struct PyPetscCommObject *)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc___COMM_SELF__ = ((struct PyPetscCommObject *)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc___COMM_WORLD__ = ((struct PyPetscCommObject *)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_type_registry = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_8petsc4py_5PETSc_tracebacklist = Py_None; Py_INCREF(Py_None); generic = Py_None; Py_INCREF(Py_None); strided = Py_None; Py_INCREF(Py_None); indirect = Py_None; Py_INCREF(Py_None); contiguous = Py_None; Py_INCREF(Py_None); indirect_contiguous = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("GetComm", (void (*)(void))__pyx_f_8petsc4py_5PETSc_GetComm, "MPI_Comm (PyObject *, MPI_Comm)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("GetCommDefault", (void (*)(void))__pyx_f_8petsc4py_5PETSc_GetCommDefault, "MPI_Comm (void)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscType_Register", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscType_Register, "int (int, PyTypeObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscType_Lookup", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup, "PyTypeObject *(int)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscError_Set", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscError_Set, "int (int)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscComm_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscComm_New, "PyObject *(MPI_Comm)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscComm_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscComm_Get, "MPI_Comm (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscComm_GetPtr", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr, "MPI_Comm *(PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscObject_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscObject_New, "PyObject *(PetscObject)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscObject_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscObject_Get, "PetscObject (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscObject_GetPtr", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr, "PetscObject *(PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscViewer_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New, "PyObject *(PetscViewer)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscViewer_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get, "PetscViewer (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscRandom_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New, "PyObject *(PetscRandom)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscRandom_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get, "PetscRandom (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscIS_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscIS_New, "PyObject *(IS)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscIS_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscIS_Get, "IS (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscLGMap_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New, "PyObject *(ISLocalToGlobalMapping)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscLGMap_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get, "ISLocalToGlobalMapping (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSF_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSF_New, "PyObject *(PetscSF)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSF_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSF_Get, "PetscSF (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscVec_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscVec_New, "PyObject *(Vec)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscVec_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscVec_Get, "Vec (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscScatter_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New, "PyObject *(VecScatter)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscScatter_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get, "VecScatter (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSection_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSection_New, "PyObject *(PetscSection)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSection_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSection_Get, "PetscSection (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscMat_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscMat_New, "PyObject *(Mat)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscMat_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscMat_Get, "Mat (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPC_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPC_New, "PyObject *(PC)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPC_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPC_Get, "PC (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscKSP_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New, "PyObject *(KSP)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscKSP_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get, "KSP (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSNES_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New, "PyObject *(SNES)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscSNES_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get, "SNES (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTS_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTS_New, "PyObject *(TS)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTS_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTS_Get, "TS (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTAO_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New, "PyObject *(Tao)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscTAO_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get, "Tao (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscAO_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscAO_New, "PyObject *(AO)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscAO_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscAO_Get, "AO (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDM_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDM_New, "PyObject *(DM)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDM_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDM_Get, "DM (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDS_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDS_New, "PyObject *(PetscDS)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDS_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDS_Get, "PetscDS (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPartitioner_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New, "PyObject *(PetscPartitioner)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscPartitioner_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get, "PetscPartitioner (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscFE_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscFE_New, "PyObject *(PetscFE)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscFE_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscFE_Get, "PetscFE (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscQuad_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New, "PyObject *(PetscQuadrature)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscQuad_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get, "PetscQuadrature (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDMLabel_New", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New, "PyObject *(DMLabel)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyPetscDMLabel_Get", (void (*)(void))__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get, "DMLabel (PyObject *)") < 0) __PYX_ERR(57, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&PyPetscComm_Type) < 0) __PYX_ERR(9, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscComm_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscComm_Type.tp_dictoffset && PyPetscComm_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscComm_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Comm, (PyObject *)&PyPetscComm_Type) < 0) __PYX_ERR(9, 3, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Comm = &PyPetscComm_Type; __pyx_vtabptr_8petsc4py_5PETSc_Object = &__pyx_vtable_8petsc4py_5PETSc_Object; __pyx_vtable_8petsc4py_5PETSc_Object.get_attr = (PyObject *(*)(struct PyPetscObjectObject *, char *))__pyx_f_8petsc4py_5PETSc_6Object_get_attr; __pyx_vtable_8petsc4py_5PETSc_Object.set_attr = (PyObject *(*)(struct PyPetscObjectObject *, char *, PyObject *))__pyx_f_8petsc4py_5PETSc_6Object_set_attr; __pyx_vtable_8petsc4py_5PETSc_Object.get_dict = (PyObject *(*)(struct PyPetscObjectObject *))__pyx_f_8petsc4py_5PETSc_6Object_get_dict; if (PyType_Ready(&PyPetscObject_Type) < 0) __PYX_ERR(10, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscObject_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscObject_Type.tp_dictoffset && PyPetscObject_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscObject_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscObject_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Object) < 0) __PYX_ERR(10, 3, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Object, (PyObject *)&PyPetscObject_Type) < 0) __PYX_ERR(10, 3, __pyx_L1_error) if (PyPetscObject_Type.tp_weaklistoffset == 0) PyPetscObject_Type.tp_weaklistoffset = offsetof(struct PyPetscObjectObject, __weakref__); __pyx_ptype_8petsc4py_5PETSc_Object = &PyPetscObject_Type; __pyx_vtabptr_8petsc4py_5PETSc_Viewer = &__pyx_vtable_8petsc4py_5PETSc_Viewer; __pyx_vtable_8petsc4py_5PETSc_Viewer.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscViewer_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscViewer_Type) < 0) __PYX_ERR(29, 85, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscViewer_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscViewer_Type.tp_dictoffset && PyPetscViewer_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscViewer_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscViewer_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Viewer) < 0) __PYX_ERR(29, 85, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Viewer, (PyObject *)&PyPetscViewer_Type) < 0) __PYX_ERR(29, 85, __pyx_L1_error) if (PyPetscViewer_Type.tp_weaklistoffset == 0) PyPetscViewer_Type.tp_weaklistoffset = offsetof(struct PyPetscViewerObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Viewer = &PyPetscViewer_Type; __pyx_vtabptr_8petsc4py_5PETSc_Random = &__pyx_vtable_8petsc4py_5PETSc_Random; __pyx_vtable_8petsc4py_5PETSc_Random.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscRandom_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscRandom_Type) < 0) __PYX_ERR(30, 12, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscRandom_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscRandom_Type.tp_dictoffset && PyPetscRandom_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscRandom_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscRandom_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Random) < 0) __PYX_ERR(30, 12, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Random, (PyObject *)&PyPetscRandom_Type) < 0) __PYX_ERR(30, 12, __pyx_L1_error) if (PyPetscRandom_Type.tp_weaklistoffset == 0) PyPetscRandom_Type.tp_weaklistoffset = offsetof(struct PyPetscRandomObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Random = &PyPetscRandom_Type; __pyx_vtabptr_8petsc4py_5PETSc_IS = &__pyx_vtable_8petsc4py_5PETSc_IS; __pyx_vtable_8petsc4py_5PETSc_IS.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscIS_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscIS_Type) < 0) __PYX_ERR(31, 10, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscIS_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscIS_Type.tp_dictoffset && PyPetscIS_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscIS_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscIS_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_IS) < 0) __PYX_ERR(31, 10, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IS, (PyObject *)&PyPetscIS_Type) < 0) __PYX_ERR(31, 10, __pyx_L1_error) if (PyPetscIS_Type.tp_weaklistoffset == 0) PyPetscIS_Type.tp_weaklistoffset = offsetof(struct PyPetscISObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_IS = &PyPetscIS_Type; __pyx_vtabptr_8petsc4py_5PETSc_LGMap = &__pyx_vtable_8petsc4py_5PETSc_LGMap; __pyx_vtable_8petsc4py_5PETSc_LGMap.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscLGMap_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscLGMap_Type) < 0) __PYX_ERR(31, 362, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscLGMap_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscLGMap_Type.tp_dictoffset && PyPetscLGMap_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscLGMap_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscLGMap_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_LGMap) < 0) __PYX_ERR(31, 362, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LGMap, (PyObject *)&PyPetscLGMap_Type) < 0) __PYX_ERR(31, 362, __pyx_L1_error) if (PyPetscLGMap_Type.tp_weaklistoffset == 0) PyPetscLGMap_Type.tp_weaklistoffset = offsetof(struct PyPetscLGMapObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_LGMap = &PyPetscLGMap_Type; __pyx_vtabptr_8petsc4py_5PETSc_SF = &__pyx_vtable_8petsc4py_5PETSc_SF; __pyx_vtable_8petsc4py_5PETSc_SF.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscSF_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscSF_Type) < 0) __PYX_ERR(32, 15, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscSF_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscSF_Type.tp_dictoffset && PyPetscSF_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscSF_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscSF_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_SF) < 0) __PYX_ERR(32, 15, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SF, (PyObject *)&PyPetscSF_Type) < 0) __PYX_ERR(32, 15, __pyx_L1_error) if (PyPetscSF_Type.tp_weaklistoffset == 0) PyPetscSF_Type.tp_weaklistoffset = offsetof(struct PyPetscSFObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_SF = &PyPetscSF_Type; __pyx_vtabptr_8petsc4py_5PETSc_Vec = &__pyx_vtable_8petsc4py_5PETSc_Vec; __pyx_vtable_8petsc4py_5PETSc_Vec.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscVec_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscVec_Type) < 0) __PYX_ERR(33, 25, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscVec_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscVec_Type.tp_dictoffset && PyPetscVec_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscVec_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscVec_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Vec) < 0) __PYX_ERR(33, 25, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Vec, (PyObject *)&PyPetscVec_Type) < 0) __PYX_ERR(33, 25, __pyx_L1_error) if (PyPetscVec_Type.tp_weaklistoffset == 0) PyPetscVec_Type.tp_weaklistoffset = offsetof(struct PyPetscVecObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Vec = &PyPetscVec_Type; __pyx_vtabptr_8petsc4py_5PETSc_FE = &__pyx_vtable_8petsc4py_5PETSc_FE; __pyx_vtable_8petsc4py_5PETSc_FE.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscFE_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscFE_Type) < 0) __PYX_ERR(35, 10, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscFE_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscFE_Type.tp_dictoffset && PyPetscFE_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscFE_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscFE_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_FE) < 0) __PYX_ERR(35, 10, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FE, (PyObject *)&PyPetscFE_Type) < 0) __PYX_ERR(35, 10, __pyx_L1_error) if (PyPetscFE_Type.tp_weaklistoffset == 0) PyPetscFE_Type.tp_weaklistoffset = offsetof(struct PyPetscFEObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_FE = &PyPetscFE_Type; __pyx_vtabptr_8petsc4py_5PETSc_Quad = &__pyx_vtable_8petsc4py_5PETSc_Quad; __pyx_vtable_8petsc4py_5PETSc_Quad.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscQuad_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscQuad_Type) < 0) __PYX_ERR(34, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscQuad_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscQuad_Type.tp_dictoffset && PyPetscQuad_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscQuad_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscQuad_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Quad) < 0) __PYX_ERR(34, 3, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Quad, (PyObject *)&PyPetscQuad_Type) < 0) __PYX_ERR(34, 3, __pyx_L1_error) if (PyPetscQuad_Type.tp_weaklistoffset == 0) PyPetscQuad_Type.tp_weaklistoffset = offsetof(struct PyPetscQuadObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Quad = &PyPetscQuad_Type; __pyx_vtabptr_8petsc4py_5PETSc_Scatter = &__pyx_vtable_8petsc4py_5PETSc_Scatter; __pyx_vtable_8petsc4py_5PETSc_Scatter.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscScatter_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscScatter_Type) < 0) __PYX_ERR(36, 15, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscScatter_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscScatter_Type.tp_dictoffset && PyPetscScatter_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscScatter_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscScatter_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Scatter) < 0) __PYX_ERR(36, 15, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Scatter, (PyObject *)&PyPetscScatter_Type) < 0) __PYX_ERR(36, 15, __pyx_L1_error) if (PyPetscScatter_Type.tp_weaklistoffset == 0) PyPetscScatter_Type.tp_weaklistoffset = offsetof(struct PyPetscScatterObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Scatter = &PyPetscScatter_Type; __pyx_vtabptr_8petsc4py_5PETSc_Section = &__pyx_vtable_8petsc4py_5PETSc_Section; __pyx_vtable_8petsc4py_5PETSc_Section.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscSection_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscSection_Type) < 0) __PYX_ERR(37, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscSection_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscSection_Type.tp_dictoffset && PyPetscSection_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscSection_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscSection_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Section) < 0) __PYX_ERR(37, 3, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Section, (PyObject *)&PyPetscSection_Type) < 0) __PYX_ERR(37, 3, __pyx_L1_error) if (PyPetscSection_Type.tp_weaklistoffset == 0) PyPetscSection_Type.tp_weaklistoffset = offsetof(struct PyPetscSectionObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Section = &PyPetscSection_Type; __pyx_vtabptr_8petsc4py_5PETSc_Mat = &__pyx_vtable_8petsc4py_5PETSc_Mat; __pyx_vtable_8petsc4py_5PETSc_Mat.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscMat_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscMat_Type) < 0) __PYX_ERR(38, 196, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscMat_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscMat_Type.tp_dictoffset && PyPetscMat_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscMat_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscMat_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Mat) < 0) __PYX_ERR(38, 196, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Mat, (PyObject *)&PyPetscMat_Type) < 0) __PYX_ERR(38, 196, __pyx_L1_error) if (PyPetscMat_Type.tp_weaklistoffset == 0) PyPetscMat_Type.tp_weaklistoffset = offsetof(struct PyPetscMatObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Mat = &PyPetscMat_Type; __pyx_vtabptr_8petsc4py_5PETSc_NullSpace = &__pyx_vtable_8petsc4py_5PETSc_NullSpace; __pyx_vtable_8petsc4py_5PETSc_NullSpace.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscNullSpace_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscNullSpace_Type) < 0) __PYX_ERR(38, 1656, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscNullSpace_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscNullSpace_Type.tp_dictoffset && PyPetscNullSpace_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscNullSpace_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscNullSpace_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_NullSpace) < 0) __PYX_ERR(38, 1656, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullSpace, (PyObject *)&PyPetscNullSpace_Type) < 0) __PYX_ERR(38, 1656, __pyx_L1_error) if (PyPetscNullSpace_Type.tp_weaklistoffset == 0) PyPetscNullSpace_Type.tp_weaklistoffset = offsetof(struct PyPetscNullSpaceObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_NullSpace = &PyPetscNullSpace_Type; __pyx_vtabptr_8petsc4py_5PETSc_PC = &__pyx_vtable_8petsc4py_5PETSc_PC; __pyx_vtable_8petsc4py_5PETSc_PC.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscPC_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscPC_Type) < 0) __PYX_ERR(39, 120, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscPC_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscPC_Type.tp_dictoffset && PyPetscPC_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscPC_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscPC_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_PC) < 0) __PYX_ERR(39, 120, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PC, (PyObject *)&PyPetscPC_Type) < 0) __PYX_ERR(39, 120, __pyx_L1_error) if (PyPetscPC_Type.tp_weaklistoffset == 0) PyPetscPC_Type.tp_weaklistoffset = offsetof(struct PyPetscPCObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_PC = &PyPetscPC_Type; __pyx_vtabptr_8petsc4py_5PETSc_KSP = &__pyx_vtable_8petsc4py_5PETSc_KSP; __pyx_vtable_8petsc4py_5PETSc_KSP.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscKSP_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscKSP_Type) < 0) __PYX_ERR(40, 93, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscKSP_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscKSP_Type.tp_dictoffset && PyPetscKSP_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscKSP_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscKSP_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_KSP) < 0) __PYX_ERR(40, 93, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KSP, (PyObject *)&PyPetscKSP_Type) < 0) __PYX_ERR(40, 93, __pyx_L1_error) if (PyPetscKSP_Type.tp_weaklistoffset == 0) PyPetscKSP_Type.tp_weaklistoffset = offsetof(struct PyPetscKSPObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_KSP = &PyPetscKSP_Type; __pyx_vtabptr_8petsc4py_5PETSc_SNES = &__pyx_vtable_8petsc4py_5PETSc_SNES; __pyx_vtable_8petsc4py_5PETSc_SNES.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscSNES_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscSNES_Type) < 0) __PYX_ERR(41, 65, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscSNES_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscSNES_Type.tp_dictoffset && PyPetscSNES_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscSNES_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscSNES_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_SNES) < 0) __PYX_ERR(41, 65, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SNES, (PyObject *)&PyPetscSNES_Type) < 0) __PYX_ERR(41, 65, __pyx_L1_error) if (PyPetscSNES_Type.tp_weaklistoffset == 0) PyPetscSNES_Type.tp_weaklistoffset = offsetof(struct PyPetscSNESObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_SNES = &PyPetscSNES_Type; __pyx_vtabptr_8petsc4py_5PETSc_TS = &__pyx_vtable_8petsc4py_5PETSc_TS; __pyx_vtable_8petsc4py_5PETSc_TS.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscTS_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscTS_Type) < 0) __PYX_ERR(42, 102, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscTS_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscTS_Type.tp_dictoffset && PyPetscTS_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscTS_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscTS_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_TS) < 0) __PYX_ERR(42, 102, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TS, (PyObject *)&PyPetscTS_Type) < 0) __PYX_ERR(42, 102, __pyx_L1_error) if (PyPetscTS_Type.tp_weaklistoffset == 0) PyPetscTS_Type.tp_weaklistoffset = offsetof(struct PyPetscTSObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_TS = &PyPetscTS_Type; __pyx_vtabptr_8petsc4py_5PETSc_TAO = &__pyx_vtable_8petsc4py_5PETSc_TAO; __pyx_vtable_8petsc4py_5PETSc_TAO.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscTAO_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscTAO_Type) < 0) __PYX_ERR(43, 65, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscTAO_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscTAO_Type.tp_dictoffset && PyPetscTAO_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscTAO_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscTAO_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_TAO) < 0) __PYX_ERR(43, 65, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TAO, (PyObject *)&PyPetscTAO_Type) < 0) __PYX_ERR(43, 65, __pyx_L1_error) if (PyPetscTAO_Type.tp_weaklistoffset == 0) PyPetscTAO_Type.tp_weaklistoffset = offsetof(struct PyPetscTAOObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_TAO = &PyPetscTAO_Type; __pyx_vtabptr_8petsc4py_5PETSc_AO = &__pyx_vtable_8petsc4py_5PETSc_AO; __pyx_vtable_8petsc4py_5PETSc_AO.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscAO_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscAO_Type) < 0) __PYX_ERR(44, 11, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscAO_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscAO_Type.tp_dictoffset && PyPetscAO_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscAO_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscAO_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_AO) < 0) __PYX_ERR(44, 11, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AO, (PyObject *)&PyPetscAO_Type) < 0) __PYX_ERR(44, 11, __pyx_L1_error) if (PyPetscAO_Type.tp_weaklistoffset == 0) PyPetscAO_Type.tp_weaklistoffset = offsetof(struct PyPetscAOObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_AO = &PyPetscAO_Type; __pyx_vtabptr_8petsc4py_5PETSc_DM = &__pyx_vtable_8petsc4py_5PETSc_DM; __pyx_vtable_8petsc4py_5PETSc_DM.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscDM_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscDM_Type) < 0) __PYX_ERR(45, 29, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscDM_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscDM_Type.tp_dictoffset && PyPetscDM_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscDM_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscDM_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DM) < 0) __PYX_ERR(45, 29, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DM, (PyObject *)&PyPetscDM_Type) < 0) __PYX_ERR(45, 29, __pyx_L1_error) if (PyPetscDM_Type.tp_weaklistoffset == 0) PyPetscDM_Type.tp_weaklistoffset = offsetof(struct PyPetscDMObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DM = &PyPetscDM_Type; __pyx_vtabptr_8petsc4py_5PETSc_DS = &__pyx_vtable_8petsc4py_5PETSc_DS; __pyx_vtable_8petsc4py_5PETSc_DS.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscDS_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscDS_Type) < 0) __PYX_ERR(46, 8, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscDS_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscDS_Type.tp_dictoffset && PyPetscDS_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscDS_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscDS_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DS) < 0) __PYX_ERR(46, 8, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DS, (PyObject *)&PyPetscDS_Type) < 0) __PYX_ERR(46, 8, __pyx_L1_error) if (PyPetscDS_Type.tp_weaklistoffset == 0) PyPetscDS_Type.tp_weaklistoffset = offsetof(struct PyPetscDSObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DS = &PyPetscDS_Type; __pyx_vtabptr_8petsc4py_5PETSc_Partitioner = &__pyx_vtable_8petsc4py_5PETSc_Partitioner; __pyx_vtable_8petsc4py_5PETSc_Partitioner.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscPartitioner_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscPartitioner_Type) < 0) __PYX_ERR(54, 14, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscPartitioner_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscPartitioner_Type.tp_dictoffset && PyPetscPartitioner_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscPartitioner_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscPartitioner_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_Partitioner) < 0) __PYX_ERR(54, 14, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Partitioner, (PyObject *)&PyPetscPartitioner_Type) < 0) __PYX_ERR(54, 14, __pyx_L1_error) if (PyPetscPartitioner_Type.tp_weaklistoffset == 0) PyPetscPartitioner_Type.tp_weaklistoffset = offsetof(struct PyPetscPartitionerObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_Partitioner = &PyPetscPartitioner_Type; __pyx_vtabptr_8petsc4py_5PETSc_DMLabel = &__pyx_vtable_8petsc4py_5PETSc_DMLabel; __pyx_vtable_8petsc4py_5PETSc_DMLabel.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object; PyPetscDMLabel_Type.tp_base = __pyx_ptype_8petsc4py_5PETSc_Object; if (PyType_Ready(&PyPetscDMLabel_Type) < 0) __PYX_ERR(52, 2, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 PyPetscDMLabel_Type.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!PyPetscDMLabel_Type.tp_dictoffset && PyPetscDMLabel_Type.tp_getattro == PyObject_GenericGetAttr)) { PyPetscDMLabel_Type.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(PyPetscDMLabel_Type.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DMLabel) < 0) __PYX_ERR(52, 2, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMLabel, (PyObject *)&PyPetscDMLabel_Type) < 0) __PYX_ERR(52, 2, __pyx_L1_error) if (PyPetscDMLabel_Type.tp_weaklistoffset == 0) PyPetscDMLabel_Type.tp_weaklistoffset = offsetof(struct PyPetscDMLabelObject, __pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DMLabel = &PyPetscDMLabel_Type; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_8petsc4py_5PETSc_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_dtype) __PYX_ERR(12, 9, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_8petsc4py_5PETSc_ndarray) __PYX_ERR(12, 12, __pyx_L1_error) __pyx_vtabptr_8petsc4py_5PETSc__IS_buffer = &__pyx_vtable_8petsc4py_5PETSc__IS_buffer; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.acquire = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquire; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.release = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_release; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.acquirebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *, int))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_acquirebuffer; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.releasebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, Py_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_releasebuffer; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.enter = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_enter; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.exit = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_exit; __pyx_vtable_8petsc4py_5PETSc__IS_buffer.getbuffer = (Py_ssize_t (*)(struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *, void **))__pyx_f_8petsc4py_5PETSc_10_IS_buffer_getbuffer; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(4, 118, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc__IS_buffer.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc__IS_buffer.tp_dictoffset && __pyx_type_8petsc4py_5PETSc__IS_buffer.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc__IS_buffer.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc__IS_buffer.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(4, 118, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IS_buffer, (PyObject *)&__pyx_type_8petsc4py_5PETSc__IS_buffer) < 0) __PYX_ERR(4, 118, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc__IS_buffer = &__pyx_type_8petsc4py_5PETSc__IS_buffer; __pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer = &__pyx_vtable_8petsc4py_5PETSc__Vec_buffer; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.acquire = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquire; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.release = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_release; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.acquirebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *, int))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_acquirebuffer; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.releasebuffer = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, Py_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_releasebuffer; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.enter = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_enter; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.exit = (PyObject *(*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_exit; __pyx_vtable_8petsc4py_5PETSc__Vec_buffer.getbuffer = (Py_ssize_t (*)(struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *, void **))__pyx_f_8petsc4py_5PETSc_11_Vec_buffer_getbuffer; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(5, 437, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc__Vec_buffer.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc__Vec_buffer.tp_dictoffset && __pyx_type_8petsc4py_5PETSc__Vec_buffer.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc__Vec_buffer.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc__Vec_buffer.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(5, 437, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Vec_buffer, (PyObject *)&__pyx_type_8petsc4py_5PETSc__Vec_buffer) < 0) __PYX_ERR(5, 437, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc__Vec_buffer = &__pyx_type_8petsc4py_5PETSc__Vec_buffer; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc__Vec_LocalForm) < 0) __PYX_ERR(5, 557, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc__Vec_LocalForm.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc__Vec_LocalForm.tp_dictoffset && __pyx_type_8petsc4py_5PETSc__Vec_LocalForm.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc__Vec_LocalForm.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Vec_LocalForm, (PyObject *)&__pyx_type_8petsc4py_5PETSc__Vec_LocalForm) < 0) __PYX_ERR(5, 557, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm = &__pyx_type_8petsc4py_5PETSc__Vec_LocalForm; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc__Mat_Stencil) < 0) __PYX_ERR(6, 1079, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc__Mat_Stencil.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc__Mat_Stencil.tp_dictoffset && __pyx_type_8petsc4py_5PETSc__Mat_Stencil.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc__Mat_Stencil.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Mat_Stencil, (PyObject *)&__pyx_type_8petsc4py_5PETSc__Mat_Stencil) < 0) __PYX_ERR(6, 1079, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc__Mat_Stencil = &__pyx_type_8petsc4py_5PETSc__Mat_Stencil; __pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array = &__pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array; __pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array.acquire = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *))__pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_acquire; __pyx_vtable_8petsc4py_5PETSc__DMDA_Vec_array.release = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__DMDA_Vec_array *))__pyx_f_8petsc4py_5PETSc_15_DMDA_Vec_array_release; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(8, 198, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array.tp_dictoffset && __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc__DMDA_Vec_array.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(8, 198, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMDA_Vec_array, (PyObject *)&__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array) < 0) __PYX_ERR(8, 198, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array = &__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc__DMComposite_access) < 0) __PYX_ERR(24, 17, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc__DMComposite_access.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc__DMComposite_access.tp_dictoffset && __pyx_type_8petsc4py_5PETSc__DMComposite_access.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc__DMComposite_access.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMComposite_access, (PyObject *)&__pyx_type_8petsc4py_5PETSc__DMComposite_access) < 0) __PYX_ERR(24, 17, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc__DMComposite_access = &__pyx_type_8petsc4py_5PETSc__DMComposite_access; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_Options) < 0) __PYX_ERR(26, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_Options.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_Options.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_Options.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_Options.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Options, (PyObject *)&__pyx_type_8petsc4py_5PETSc_Options) < 0) __PYX_ERR(26, 3, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Options = &__pyx_type_8petsc4py_5PETSc_Options; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_Sys) < 0) __PYX_ERR(27, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_Sys.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_Sys.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_Sys.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_Sys.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Sys, (PyObject *)&__pyx_type_8petsc4py_5PETSc_Sys) < 0) __PYX_ERR(27, 3, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Sys = &__pyx_type_8petsc4py_5PETSc_Sys; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_Log) < 0) __PYX_ERR(28, 5, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_Log.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_Log.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_Log.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_Log.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Log, (PyObject *)&__pyx_type_8petsc4py_5PETSc_Log) < 0) __PYX_ERR(28, 5, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_Log = &__pyx_type_8petsc4py_5PETSc_Log; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_LogStage) < 0) __PYX_ERR(28, 122, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_LogStage.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_LogStage.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_LogStage.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_LogStage.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LogStage, (PyObject *)&__pyx_type_8petsc4py_5PETSc_LogStage) < 0) __PYX_ERR(28, 122, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_LogStage = &__pyx_type_8petsc4py_5PETSc_LogStage; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_LogClass) < 0) __PYX_ERR(28, 218, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_LogClass.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_LogClass.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_LogClass.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_LogClass.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LogClass, (PyObject *)&__pyx_type_8petsc4py_5PETSc_LogClass) < 0) __PYX_ERR(28, 218, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_LogClass = &__pyx_type_8petsc4py_5PETSc_LogClass; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_LogEvent) < 0) __PYX_ERR(28, 280, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_LogEvent.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_LogEvent.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_LogEvent.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_LogEvent.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LogEvent, (PyObject *)&__pyx_type_8petsc4py_5PETSc_LogEvent) < 0) __PYX_ERR(28, 280, __pyx_L1_error) __pyx_ptype_8petsc4py_5PETSc_LogEvent = &__pyx_type_8petsc4py_5PETSc_LogEvent; __pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5 = &__pyx_vtable_8petsc4py_5PETSc_ViewerHDF5; __pyx_vtable_8petsc4py_5PETSc_ViewerHDF5.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Viewer; __pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_base = __pyx_ptype_8petsc4py_5PETSc_Viewer; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(29, 365, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(29, 365, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ViewerHDF5, (PyObject *)&__pyx_type_8petsc4py_5PETSc_ViewerHDF5) < 0) __PYX_ERR(29, 365, __pyx_L1_error) if (__pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_weaklistoffset == 0) __pyx_type_8petsc4py_5PETSc_ViewerHDF5.tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5, __pyx_base.__pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 = &__pyx_type_8petsc4py_5PETSc_ViewerHDF5; __pyx_vtabptr_8petsc4py_5PETSc_DMDA = &__pyx_vtable_8petsc4py_5PETSc_DMDA; __pyx_vtable_8petsc4py_5PETSc_DMDA.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; __pyx_type_8petsc4py_5PETSc_DMDA.tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(47, 17, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_DMDA.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_DMDA.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_DMDA.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_DMDA.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc_DMDA.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(47, 17, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMDA, (PyObject *)&__pyx_type_8petsc4py_5PETSc_DMDA) < 0) __PYX_ERR(47, 17, __pyx_L1_error) if (__pyx_type_8petsc4py_5PETSc_DMDA.tp_weaklistoffset == 0) __pyx_type_8petsc4py_5PETSc_DMDA.tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMDA, __pyx_base.__pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DMDA = &__pyx_type_8petsc4py_5PETSc_DMDA; __pyx_vtabptr_8petsc4py_5PETSc_DMPlex = &__pyx_vtable_8petsc4py_5PETSc_DMPlex; __pyx_vtable_8petsc4py_5PETSc_DMPlex.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; __pyx_type_8petsc4py_5PETSc_DMPlex.tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(48, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_DMPlex.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_DMPlex.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_DMPlex.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_DMPlex.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc_DMPlex.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(48, 3, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMPlex, (PyObject *)&__pyx_type_8petsc4py_5PETSc_DMPlex) < 0) __PYX_ERR(48, 3, __pyx_L1_error) if (__pyx_type_8petsc4py_5PETSc_DMPlex.tp_weaklistoffset == 0) __pyx_type_8petsc4py_5PETSc_DMPlex.tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMPlex, __pyx_base.__pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DMPlex = &__pyx_type_8petsc4py_5PETSc_DMPlex; __pyx_vtabptr_8petsc4py_5PETSc_DMStag = &__pyx_vtable_8petsc4py_5PETSc_DMStag; __pyx_vtable_8petsc4py_5PETSc_DMStag.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; __pyx_type_8petsc4py_5PETSc_DMStag.tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(49, 40, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_DMStag.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_DMStag.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_DMStag.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_DMStag.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc_DMStag.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(49, 40, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMStag, (PyObject *)&__pyx_type_8petsc4py_5PETSc_DMStag) < 0) __PYX_ERR(49, 40, __pyx_L1_error) if (__pyx_type_8petsc4py_5PETSc_DMStag.tp_weaklistoffset == 0) __pyx_type_8petsc4py_5PETSc_DMStag.tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMStag, __pyx_base.__pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DMStag = &__pyx_type_8petsc4py_5PETSc_DMStag; __pyx_vtabptr_8petsc4py_5PETSc_DMComposite = &__pyx_vtable_8petsc4py_5PETSc_DMComposite; __pyx_vtable_8petsc4py_5PETSc_DMComposite.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; __pyx_type_8petsc4py_5PETSc_DMComposite.tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(50, 3, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_DMComposite.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_DMComposite.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_DMComposite.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_DMComposite.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc_DMComposite.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(50, 3, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMComposite, (PyObject *)&__pyx_type_8petsc4py_5PETSc_DMComposite) < 0) __PYX_ERR(50, 3, __pyx_L1_error) if (__pyx_type_8petsc4py_5PETSc_DMComposite.tp_weaklistoffset == 0) __pyx_type_8petsc4py_5PETSc_DMComposite.tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMComposite, __pyx_base.__pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DMComposite = &__pyx_type_8petsc4py_5PETSc_DMComposite; __pyx_vtabptr_8petsc4py_5PETSc_DMShell = &__pyx_vtable_8petsc4py_5PETSc_DMShell; __pyx_vtable_8petsc4py_5PETSc_DMShell.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; __pyx_type_8petsc4py_5PETSc_DMShell.tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(51, 1, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_DMShell.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_DMShell.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_DMShell.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_DMShell.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc_DMShell.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(51, 1, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMShell, (PyObject *)&__pyx_type_8petsc4py_5PETSc_DMShell) < 0) __PYX_ERR(51, 1, __pyx_L1_error) if (__pyx_type_8petsc4py_5PETSc_DMShell.tp_weaklistoffset == 0) __pyx_type_8petsc4py_5PETSc_DMShell.tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMShell, __pyx_base.__pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DMShell = &__pyx_type_8petsc4py_5PETSc_DMShell; __pyx_vtabptr_8petsc4py_5PETSc_DMSwarm = &__pyx_vtable_8petsc4py_5PETSc_DMSwarm; __pyx_vtable_8petsc4py_5PETSc_DMSwarm.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_DM; __pyx_type_8petsc4py_5PETSc_DMSwarm.tp_base = __pyx_ptype_8petsc4py_5PETSc_DM; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(53, 25, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc_DMSwarm.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc_DMSwarm.tp_dictoffset && __pyx_type_8petsc4py_5PETSc_DMSwarm.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc_DMSwarm.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_8petsc4py_5PETSc_DMSwarm.tp_dict, __pyx_vtabptr_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(53, 25, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DMSwarm, (PyObject *)&__pyx_type_8petsc4py_5PETSc_DMSwarm) < 0) __PYX_ERR(53, 25, __pyx_L1_error) if (__pyx_type_8petsc4py_5PETSc_DMSwarm.tp_weaklistoffset == 0) __pyx_type_8petsc4py_5PETSc_DMSwarm.tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm, __pyx_base.__pyx_base.__weakref__); __pyx_ptype_8petsc4py_5PETSc_DMSwarm = &__pyx_type_8petsc4py_5PETSc_DMSwarm; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator) < 0) __PYX_ERR(28, 92, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator.tp_dictoffset && __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator = &__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator; if (PyType_Ready(&__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator) < 0) __PYX_ERR(28, 108, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator.tp_dictoffset && __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator = &__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator; __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(56, 105, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_array.tp_print = 0; #endif if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(56, 105, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(56, 105, __pyx_L1_error) __pyx_array_type = &__pyx_type___pyx_array; if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(56, 279, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_MemviewEnum.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(56, 279, __pyx_L1_error) __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum; __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview; __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer; __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice; __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment; __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar; __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed; __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object; __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object; if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(56, 330, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryview.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(56, 330, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(56, 330, __pyx_L1_error) __pyx_memoryview_type = &__pyx_type___pyx_memoryview; __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice; __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview; __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object; __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object; __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type; if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(56, 965, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type___pyx_memoryviewslice.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(56, 965, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(56, 965, __pyx_L1_error) __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #ifndef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #elif PY_MAJOR_VERSION < 3 #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" void #else #define __Pyx_PyMODINIT_FUNC void #endif #else #ifdef __cplusplus #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * #else #define __Pyx_PyMODINIT_FUNC PyObject * #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initPETSc(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initPETSc(void) #else __Pyx_PyMODINIT_FUNC PyInit_PETSc(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_PETSc(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_PETSc(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; static PyThread_type_lock __pyx_t_8[8]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'PETSc' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_PETSc(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(57, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(57, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("PETSc", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(57, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(57, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(57, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(57, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(57, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_petsc4py__PETSc) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(57, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(57, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "petsc4py.PETSc")) { if (unlikely(PyDict_SetItemString(modules, "petsc4py.PETSc", __pyx_m) < 0)) __PYX_ERR(57, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(57, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(57, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(57, 1, __pyx_L1_error) if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(57, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(57, 1, __pyx_L1_error) #endif /* "PETSc/PETSc.pyx":44 * void *PyExc_RuntimeError * * cdef object PetscError = PyExc_RuntimeError # <<<<<<<<<<<<<< * * cdef inline int SETERR(int ierr) with gil: */ __pyx_t_1 = ((PyObject *)PyExc_RuntimeError); __Pyx_INCREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_PetscError); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_PetscError, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":105 * include "arraynpy.pxi" * * import_array() # <<<<<<<<<<<<<< * * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) */ __pyx_t_2 = _import_array(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(11, 105, __pyx_L1_error) /* "PETSc/PETSc.pyx":107 * import_array() * * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) # <<<<<<<<<<<<<< * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) */ __pyx_t_1 = PyArray_TypeObjectFromType(NPY_PETSC_INT); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntType, __pyx_t_1) < 0) __PYX_ERR(11, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":108 * * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) # <<<<<<<<<<<<<< * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) * ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX) */ __pyx_t_1 = PyArray_TypeObjectFromType(NPY_PETSC_REAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RealType, __pyx_t_1) < 0) __PYX_ERR(11, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":109 * IntType = PyArray_TypeObjectFromType(NPY_PETSC_INT) * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) # <<<<<<<<<<<<<< * ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX) * */ __pyx_t_1 = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ScalarType, __pyx_t_1) < 0) __PYX_ERR(11, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":110 * RealType = PyArray_TypeObjectFromType(NPY_PETSC_REAL) * ScalarType = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR) * ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ComplexType, __pyx_t_1) < 0) __PYX_ERR(11, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/PETSc.pyx":150 * # -------------------------------------------------------------------- * * __doc__ = u""" # <<<<<<<<<<<<<< * Portable, Extensible Toolkit for Scientific Computation * """ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_kp_u_Portable_Extensible_Toolkit_for) < 0) __PYX_ERR(11, 150, __pyx_L1_error) /* "PETSc/Const.pyx":3 * # -------------------------------------------------------------------- * * DECIDE = PETSC_DECIDE # <<<<<<<<<<<<<< * DEFAULT = PETSC_DEFAULT * DETERMINE = PETSC_DETERMINE */ __pyx_t_1 = __Pyx_PyInt_From_int(PETSC_DECIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DECIDE, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":4 * * DECIDE = PETSC_DECIDE * DEFAULT = PETSC_DEFAULT # <<<<<<<<<<<<<< * DETERMINE = PETSC_DETERMINE * */ __pyx_t_1 = __Pyx_PyInt_From_int(PETSC_DEFAULT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":5 * DECIDE = PETSC_DECIDE * DEFAULT = PETSC_DEFAULT * DETERMINE = PETSC_DETERMINE # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __Pyx_PyInt_From_int(PETSC_DETERMINE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DETERMINE, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":9 * # -------------------------------------------------------------------- * * INFINITY = toReal(PETSC_INFINITY) # <<<<<<<<<<<<<< * NINFINITY = toReal(PETSC_NINFINITY) * PINFINITY = toReal(PETSC_INFINITY) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_INFINITY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_INFINITY, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":10 * * INFINITY = toReal(PETSC_INFINITY) * NINFINITY = toReal(PETSC_NINFINITY) # <<<<<<<<<<<<<< * PINFINITY = toReal(PETSC_INFINITY) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_NINFINITY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NINFINITY, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":11 * INFINITY = toReal(PETSC_INFINITY) * NINFINITY = toReal(PETSC_NINFINITY) * PINFINITY = toReal(PETSC_INFINITY) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_INFINITY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PINFINITY, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":15 * # -------------------------------------------------------------------- * * class InsertMode(object): # <<<<<<<<<<<<<< * # native * NOT_SET_VALUES = PETSC_NOT_SET_VALUES */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__75); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__75, __pyx_n_s_InsertMode, __pyx_n_s_InsertMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Const.pyx":17 * class InsertMode(object): * # native * NOT_SET_VALUES = PETSC_NOT_SET_VALUES # <<<<<<<<<<<<<< * INSERT_VALUES = PETSC_INSERT_VALUES * ADD_VALUES = PETSC_ADD_VALUES */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(NOT_SET_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOT_SET_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":18 * # native * NOT_SET_VALUES = PETSC_NOT_SET_VALUES * INSERT_VALUES = PETSC_INSERT_VALUES # <<<<<<<<<<<<<< * ADD_VALUES = PETSC_ADD_VALUES * MAX_VALUES = PETSC_MAX_VALUES */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(INSERT_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INSERT_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":19 * NOT_SET_VALUES = PETSC_NOT_SET_VALUES * INSERT_VALUES = PETSC_INSERT_VALUES * ADD_VALUES = PETSC_ADD_VALUES # <<<<<<<<<<<<<< * MAX_VALUES = PETSC_MAX_VALUES * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":20 * INSERT_VALUES = PETSC_INSERT_VALUES * ADD_VALUES = PETSC_ADD_VALUES * MAX_VALUES = PETSC_MAX_VALUES # <<<<<<<<<<<<<< * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(MAX_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MAX_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":21 * ADD_VALUES = PETSC_ADD_VALUES * MAX_VALUES = PETSC_MAX_VALUES * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES # <<<<<<<<<<<<<< * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(INSERT_ALL_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INSERT_ALL_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":22 * MAX_VALUES = PETSC_MAX_VALUES * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES # <<<<<<<<<<<<<< * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES * ADD_BC_VALUES = PETSC_ADD_BC_VALUES */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(ADD_ALL_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_ALL_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":23 * INSERT_ALL_VALUES = PETSC_INSERT_ALL_VALUES * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES # <<<<<<<<<<<<<< * ADD_BC_VALUES = PETSC_ADD_BC_VALUES * # aliases */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(INSERT_BC_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INSERT_BC_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":24 * ADD_ALL_VALUES = PETSC_ADD_ALL_VALUES * INSERT_BC_VALUES = PETSC_INSERT_BC_VALUES * ADD_BC_VALUES = PETSC_ADD_BC_VALUES # <<<<<<<<<<<<<< * # aliases * INSERT = INSERT_VALUES */ __pyx_t_4 = __Pyx_PyInt_From_InsertMode(ADD_BC_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_BC_VALUES, __pyx_t_4) < 0) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":26 * ADD_BC_VALUES = PETSC_ADD_BC_VALUES * # aliases * INSERT = INSERT_VALUES # <<<<<<<<<<<<<< * ADD = ADD_VALUES * MAX = MAX_VALUES */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_INSERT_VALUES); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_INSERT_VALUES); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INSERT, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":27 * # aliases * INSERT = INSERT_VALUES * ADD = ADD_VALUES # <<<<<<<<<<<<<< * MAX = MAX_VALUES * INSERT_ALL = INSERT_ALL_VALUES */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_ADD_VALUES); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ADD_VALUES); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":28 * INSERT = INSERT_VALUES * ADD = ADD_VALUES * MAX = MAX_VALUES # <<<<<<<<<<<<<< * INSERT_ALL = INSERT_ALL_VALUES * ADD_ALL = ADD_ALL_VALUES */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_MAX_VALUES); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MAX_VALUES); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MAX, __pyx_t_4) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":29 * ADD = ADD_VALUES * MAX = MAX_VALUES * INSERT_ALL = INSERT_ALL_VALUES # <<<<<<<<<<<<<< * ADD_ALL = ADD_ALL_VALUES * INSERT_BC = INSERT_BC_VALUES */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_INSERT_ALL_VALUES); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_INSERT_ALL_VALUES); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INSERT_ALL, __pyx_t_4) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":30 * MAX = MAX_VALUES * INSERT_ALL = INSERT_ALL_VALUES * ADD_ALL = ADD_ALL_VALUES # <<<<<<<<<<<<<< * INSERT_BC = INSERT_BC_VALUES * ADD_BC = ADD_BC_VALUES */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_ADD_ALL_VALUES); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ADD_ALL_VALUES); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_ALL, __pyx_t_4) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":31 * INSERT_ALL = INSERT_ALL_VALUES * ADD_ALL = ADD_ALL_VALUES * INSERT_BC = INSERT_BC_VALUES # <<<<<<<<<<<<<< * ADD_BC = ADD_BC_VALUES * */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_INSERT_BC_VALUES); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_INSERT_BC_VALUES); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INSERT_BC, __pyx_t_4) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":32 * ADD_ALL = ADD_ALL_VALUES * INSERT_BC = INSERT_BC_VALUES * ADD_BC = ADD_BC_VALUES # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_ADD_BC_VALUES); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ADD_BC_VALUES); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADD_BC, __pyx_t_4) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":15 * # -------------------------------------------------------------------- * * class InsertMode(object): # <<<<<<<<<<<<<< * # native * NOT_SET_VALUES = PETSC_NOT_SET_VALUES */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InsertMode, __pyx_tuple__75, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_InsertMode, __pyx_t_4) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":36 * # -------------------------------------------------------------------- * * class ScatterMode(object): # <<<<<<<<<<<<<< * # native * SCATTER_FORWARD = PETSC_SCATTER_FORWARD */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__76); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__76, __pyx_n_s_ScatterMode, __pyx_n_s_ScatterMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Const.pyx":38 * class ScatterMode(object): * # native * SCATTER_FORWARD = PETSC_SCATTER_FORWARD # <<<<<<<<<<<<<< * SCATTER_REVERSE = PETSC_SCATTER_REVERSE * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL */ __pyx_t_4 = __Pyx_PyInt_From_ScatterMode(SCATTER_FORWARD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SCATTER_FORWARD, __pyx_t_4) < 0) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":39 * # native * SCATTER_FORWARD = PETSC_SCATTER_FORWARD * SCATTER_REVERSE = PETSC_SCATTER_REVERSE # <<<<<<<<<<<<<< * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL */ __pyx_t_4 = __Pyx_PyInt_From_ScatterMode(SCATTER_REVERSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SCATTER_REVERSE, __pyx_t_4) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":40 * SCATTER_FORWARD = PETSC_SCATTER_FORWARD * SCATTER_REVERSE = PETSC_SCATTER_REVERSE * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL # <<<<<<<<<<<<<< * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL * SCATTER_LOCAL = PETSC_SCATTER_LOCAL */ __pyx_t_4 = __Pyx_PyInt_From_ScatterMode(SCATTER_FORWARD_LOCAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SCATTER_FORWARD_LOCAL, __pyx_t_4) < 0) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":41 * SCATTER_REVERSE = PETSC_SCATTER_REVERSE * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL # <<<<<<<<<<<<<< * SCATTER_LOCAL = PETSC_SCATTER_LOCAL * # aliases */ __pyx_t_4 = __Pyx_PyInt_From_ScatterMode(SCATTER_REVERSE_LOCAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SCATTER_REVERSE_LOCAL, __pyx_t_4) < 0) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":42 * SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL * SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL * SCATTER_LOCAL = PETSC_SCATTER_LOCAL # <<<<<<<<<<<<<< * # aliases * FORWARD = SCATTER_FORWARD */ __pyx_t_4 = __Pyx_PyInt_From_ScatterMode(SCATTER_LOCAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SCATTER_LOCAL, __pyx_t_4) < 0) __PYX_ERR(0, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":44 * SCATTER_LOCAL = PETSC_SCATTER_LOCAL * # aliases * FORWARD = SCATTER_FORWARD # <<<<<<<<<<<<<< * REVERSE = SCATTER_REVERSE * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_SCATTER_FORWARD); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCATTER_FORWARD); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FORWARD, __pyx_t_4) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":45 * # aliases * FORWARD = SCATTER_FORWARD * REVERSE = SCATTER_REVERSE # <<<<<<<<<<<<<< * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL * REVERSE_LOCAL = SCATTER_REVERSE_LOCAL */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_SCATTER_REVERSE); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCATTER_REVERSE); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_REVERSE, __pyx_t_4) < 0) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":46 * FORWARD = SCATTER_FORWARD * REVERSE = SCATTER_REVERSE * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL # <<<<<<<<<<<<<< * REVERSE_LOCAL = SCATTER_REVERSE_LOCAL * */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_SCATTER_FORWARD_LOCAL); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCATTER_FORWARD_LOCAL); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FORWARD_LOCAL, __pyx_t_4) < 0) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":47 * REVERSE = SCATTER_REVERSE * FORWARD_LOCAL = SCATTER_FORWARD_LOCAL * REVERSE_LOCAL = SCATTER_REVERSE_LOCAL # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_SCATTER_REVERSE_LOCAL); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SCATTER_REVERSE_LOCAL); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_REVERSE_LOCAL, __pyx_t_4) < 0) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":36 * # -------------------------------------------------------------------- * * class ScatterMode(object): # <<<<<<<<<<<<<< * # native * SCATTER_FORWARD = PETSC_SCATTER_FORWARD */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ScatterMode, __pyx_tuple__76, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ScatterMode, __pyx_t_4) < 0) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Const.pyx":51 * # -------------------------------------------------------------------- * * class NormType(object): # <<<<<<<<<<<<<< * # native * NORM_1 = PETSC_NORM_1 */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__77); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__77, __pyx_n_s_NormType, __pyx_n_s_NormType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Const.pyx":53 * class NormType(object): * # native * NORM_1 = PETSC_NORM_1 # <<<<<<<<<<<<<< * NORM_2 = PETSC_NORM_2 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 */ __pyx_t_4 = __Pyx_PyInt_From_NormType(NORM_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORM_1, __pyx_t_4) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":54 * # native * NORM_1 = PETSC_NORM_1 * NORM_2 = PETSC_NORM_2 # <<<<<<<<<<<<<< * NORM_1_AND_2 = PETSC_NORM_1_AND_2 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS */ __pyx_t_4 = __Pyx_PyInt_From_NormType(NORM_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORM_2, __pyx_t_4) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":55 * NORM_1 = PETSC_NORM_1 * NORM_2 = PETSC_NORM_2 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 # <<<<<<<<<<<<<< * NORM_FROBENIUS = PETSC_NORM_FROBENIUS * NORM_INFINITY = PETSC_NORM_INFINITY */ __pyx_t_4 = __Pyx_PyInt_From_NormType(NORM_1_AND_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORM_1_AND_2, __pyx_t_4) < 0) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":56 * NORM_2 = PETSC_NORM_2 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS # <<<<<<<<<<<<<< * NORM_INFINITY = PETSC_NORM_INFINITY * NORM_MAX = PETSC_NORM_MAX */ __pyx_t_4 = __Pyx_PyInt_From_NormType(NORM_FROBENIUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORM_FROBENIUS, __pyx_t_4) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":57 * NORM_1_AND_2 = PETSC_NORM_1_AND_2 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS * NORM_INFINITY = PETSC_NORM_INFINITY # <<<<<<<<<<<<<< * NORM_MAX = PETSC_NORM_MAX * # aliases */ __pyx_t_4 = __Pyx_PyInt_From_NormType(NORM_INFINITY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORM_INFINITY, __pyx_t_4) < 0) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":58 * NORM_FROBENIUS = PETSC_NORM_FROBENIUS * NORM_INFINITY = PETSC_NORM_INFINITY * NORM_MAX = PETSC_NORM_MAX # <<<<<<<<<<<<<< * # aliases * N1 = NORM_1 */ __pyx_t_4 = __Pyx_PyInt_From_NormType(NORM_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORM_MAX, __pyx_t_4) < 0) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":60 * NORM_MAX = PETSC_NORM_MAX * # aliases * N1 = NORM_1 # <<<<<<<<<<<<<< * N2 = NORM_2 * N12 = NORM_1_AND_2 */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NORM_1); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NORM_1); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_N1, __pyx_t_4) < 0) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":61 * # aliases * N1 = NORM_1 * N2 = NORM_2 # <<<<<<<<<<<<<< * N12 = NORM_1_AND_2 * MAX = NORM_MAX */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NORM_2); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NORM_2); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_N2, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":62 * N1 = NORM_1 * N2 = NORM_2 * N12 = NORM_1_AND_2 # <<<<<<<<<<<<<< * MAX = NORM_MAX * FROBENIUS = NORM_FROBENIUS */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NORM_1_AND_2); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NORM_1_AND_2); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_N12, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":63 * N2 = NORM_2 * N12 = NORM_1_AND_2 * MAX = NORM_MAX # <<<<<<<<<<<<<< * FROBENIUS = NORM_FROBENIUS * INFINITY = NORM_INFINITY */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NORM_MAX); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NORM_MAX); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MAX, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":64 * N12 = NORM_1_AND_2 * MAX = NORM_MAX * FROBENIUS = NORM_FROBENIUS # <<<<<<<<<<<<<< * INFINITY = NORM_INFINITY * # extra aliases */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NORM_FROBENIUS); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NORM_FROBENIUS); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FROBENIUS, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":65 * MAX = NORM_MAX * FROBENIUS = NORM_FROBENIUS * INFINITY = NORM_INFINITY # <<<<<<<<<<<<<< * # extra aliases * FRB = FROBENIUS */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_NORM_INFINITY); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NORM_INFINITY); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INFINITY, __pyx_t_4) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":67 * INFINITY = NORM_INFINITY * # extra aliases * FRB = FROBENIUS # <<<<<<<<<<<<<< * INF = INFINITY * */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_FROBENIUS); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_FROBENIUS); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FRB, __pyx_t_4) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":68 * # extra aliases * FRB = FROBENIUS * INF = INFINITY # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_INFINITY); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_INFINITY); } if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INF, __pyx_t_4) < 0) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Const.pyx":51 * # -------------------------------------------------------------------- * * class NormType(object): # <<<<<<<<<<<<<< * # native * NORM_1 = PETSC_NORM_1 */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_NormType, __pyx_tuple__77, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_NormType, __pyx_t_4) < 0) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Error.pyx":3 * # -------------------------------------------------------------------- * * class Error(RuntimeError): # <<<<<<<<<<<<<< * * _traceback_ = [] */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__78); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__78, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Error.pyx":5 * class Error(RuntimeError): * * _traceback_ = [] # <<<<<<<<<<<<<< * * def __init__(self, int ierr=0): */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_traceback, __pyx_t_4) < 0) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Error.pyx":7 * _traceback_ = [] * * def __init__(self, int ierr=0): # <<<<<<<<<<<<<< * self.ierr = ierr * RuntimeError.__init__(self, self.ierr) */ __pyx_t_4 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_1__init__, 0, __pyx_n_s_Error___init, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Error.pyx":11 * RuntimeError.__init__(self, self.ierr) * * def __nonzero__(self): # <<<<<<<<<<<<<< * cdef int ierr = self.ierr * return ierr != 0 */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_3__nonzero__, 0, __pyx_n_s_Error___nonzero, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_nonzero_2, __pyx_t_4) < 0) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Error.pyx":15 * return ierr != 0 * * def __repr__(self): # <<<<<<<<<<<<<< * return 'PETSc.Error(%d)' % self.ierr * */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_5__repr__, 0, __pyx_n_s_Error___repr, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Error.pyx":18 * return 'PETSc.Error(%d)' % self.ierr * * def __str__(self): # <<<<<<<<<<<<<< * cdef int csize=1, crank=0 * if not (PetscFinalizeCalled): */ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_7__str__, 0, __pyx_n_s_Error___str, NULL, __pyx_n_s_petsc4py_PETSc, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Error.pyx":3 * # -------------------------------------------------------------------- * * class Error(RuntimeError): # <<<<<<<<<<<<<< * * _traceback_ = [] */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Error, __pyx_tuple__78, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Sys.pyx":6 * * @classmethod * def getVersion(cls, devel=False, date=False, author=False): # <<<<<<<<<<<<<< * cdef char cversion[256] * cdef PetscInt major=0, minor=0, micro=0, release=0 */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getVersion); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":5 * cdef class Sys: * * @classmethod # <<<<<<<<<<<<<< * def getVersion(cls, devel=False, date=False, author=False): * cdef char cversion[256] */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_getVersion, __pyx_t_3) < 0) __PYX_ERR(27, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":30 * * @classmethod * def getVersionInfo(cls): # <<<<<<<<<<<<<< * version, dev, date, author = cls.getVersion(True, True, True) * return dict(major = version[0], */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getVersionInfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":29 * return tuple(out) * * @classmethod # <<<<<<<<<<<<<< * def getVersionInfo(cls): * version, dev, date, author = cls.getVersion(True, True, True) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_getVersionInfo, __pyx_t_1) < 0) __PYX_ERR(27, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":42 * * @classmethod * def isInitialized(cls): # <<<<<<<<<<<<<< * return toBool(PetscInitializeCalled) * */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_isInitialized); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":41 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def isInitialized(cls): * return toBool(PetscInitializeCalled) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_isInitialized, __pyx_t_3) < 0) __PYX_ERR(27, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":46 * * @classmethod * def isFinalized(cls): # <<<<<<<<<<<<<< * return toBool(PetscFinalizeCalled) * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_isFinalized); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":45 * return toBool(PetscInitializeCalled) * * @classmethod # <<<<<<<<<<<<<< * def isFinalized(cls): * return toBool(PetscFinalizeCalled) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_isFinalized, __pyx_t_1) < 0) __PYX_ERR(27, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":52 * * @classmethod * def getDefaultComm(cls): # <<<<<<<<<<<<<< * cdef Comm comm = Comm() * comm.comm = PETSC_COMM_DEFAULT */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_getDefaultComm); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":51 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def getDefaultComm(cls): * cdef Comm comm = Comm() */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_getDefaultComm, __pyx_t_3) < 0) __PYX_ERR(27, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":58 * * @classmethod * def setDefaultComm(cls, comm): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) * if ccomm == MPI_COMM_NULL: */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_setDefaultComm); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":57 * return comm * * @classmethod # <<<<<<<<<<<<<< * def setDefaultComm(cls, comm): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_WORLD) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_setDefaultComm, __pyx_t_1) < 0) __PYX_ERR(27, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":68 * * @classmethod * def Print(cls, *args, **kargs): # <<<<<<<<<<<<<< * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_Print); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":67 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def Print(cls, *args, **kargs): * cdef object comm = kargs.get('comm', None) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_Print, __pyx_t_3) < 0) __PYX_ERR(27, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":85 * * @classmethod * def syncPrint(cls, *args, **kargs): # <<<<<<<<<<<<<< * cdef object comm = kargs.get('comm', None) * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_syncPrint); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":84 * CHKERR( PetscPrintf(ccomm, m) ) * * @classmethod # <<<<<<<<<<<<<< * def syncPrint(cls, *args, **kargs): * cdef object comm = kargs.get('comm', None) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_syncPrint, __pyx_t_1) < 0) __PYX_ERR(27, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":101 * * @classmethod * def syncFlush(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_syncFlush); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":100 * if flush: CHKERR( PetscSynchronizedFlush(ccomm, PETSC_STDOUT) ) * * @classmethod # <<<<<<<<<<<<<< * def syncFlush(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_syncFlush, __pyx_t_3) < 0) __PYX_ERR(27, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":108 * * @classmethod * def splitOwnership(cls, size, bsize=None, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef PetscInt bs=0, n=0, N=0 */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_splitOwnership); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":107 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def splitOwnership(cls, size, bsize=None, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_splitOwnership, __pyx_t_1) < 0) __PYX_ERR(27, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":121 * * @classmethod * def sleep(cls, seconds=1): # <<<<<<<<<<<<<< * cdef int s = seconds * CHKERR( PetscSleep(s) ) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_sleep); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":120 * return (toInt(n), toInt(N)) * * @classmethod # <<<<<<<<<<<<<< * def sleep(cls, seconds=1): * cdef int s = seconds */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_sleep, __pyx_t_3) < 0) __PYX_ERR(27, 121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":128 * * @classmethod * def pushErrorHandler(cls, errhandler): # <<<<<<<<<<<<<< * cdef PetscErrorHandlerFunction handler = NULL * if errhandler == "python": */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_pushErrorHandler); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":127 * # --- xxx --- * * @classmethod # <<<<<<<<<<<<<< * def pushErrorHandler(cls, errhandler): * cdef PetscErrorHandlerFunction handler = NULL */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_pushErrorHandler, __pyx_t_1) < 0) __PYX_ERR(27, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":152 * * @classmethod * def popErrorHandler(cls): # <<<<<<<<<<<<<< * CHKERR( PetscPopErrorHandler() ) * */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_popErrorHandler); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":151 * * * @classmethod # <<<<<<<<<<<<<< * def popErrorHandler(cls): * CHKERR( PetscPopErrorHandler() ) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_popErrorHandler, __pyx_t_3) < 0) __PYX_ERR(27, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":156 * * @classmethod * def popSignalHandler(cls): # <<<<<<<<<<<<<< * CHKERR( PetscPopSignalHandler() ) * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_popSignalHandler); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":155 * CHKERR( PetscPopErrorHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def popSignalHandler(cls): * CHKERR( PetscPopSignalHandler() ) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_popSignalHandler, __pyx_t_1) < 0) __PYX_ERR(27, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":160 * * @classmethod * def infoAllow(cls, flag, filename=None, mode="w"): # <<<<<<<<<<<<<< * cdef PetscBool tval = PETSC_FALSE * cdef const char *cfilename = NULL */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_infoAllow); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":159 * CHKERR( PetscPopSignalHandler() ) * * @classmethod # <<<<<<<<<<<<<< * def infoAllow(cls, flag, filename=None, mode="w"): * cdef PetscBool tval = PETSC_FALSE */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_infoAllow, __pyx_t_3) < 0) __PYX_ERR(27, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":172 * * @classmethod * def registerCitation(cls, citation): # <<<<<<<<<<<<<< * if not citation: raise ValueError("empty citation") * cdef const char *cit = NULL */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_registerCitation); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Sys.pyx":171 * CHKERR( PetscInfoSetFile(cfilename, cmode) ) * * @classmethod # <<<<<<<<<<<<<< * def registerCitation(cls, citation): * if not citation: raise ValueError("empty citation") */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_registerCitation, __pyx_t_1) < 0) __PYX_ERR(27, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":181 * * @classmethod * def hasExternalPackage(cls, package): # <<<<<<<<<<<<<< * cdef const char *cpackage = NULL * package = str2bytes(package, &cpackage) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_n_s_hasExternalPackage); if (unlikely(!__pyx_t_1)) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Sys.pyx":180 * set_citation(citation, toBool(flag)) * * @classmethod # <<<<<<<<<<<<<< * def hasExternalPackage(cls, package): * cdef const char *cpackage = NULL */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dict, __pyx_n_s_hasExternalPackage, __pyx_t_3) < 0) __PYX_ERR(27, 181, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Sys); /* "PETSc/Sys.pyx":188 * return toBool(has) * * cdef dict citations_registry = { } # <<<<<<<<<<<<<< * * cdef PetscBool get_citation(object citation): */ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_citations_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_citations_registry, ((PyObject*)__pyx_t_3)); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":2 * # -------------------------------------------------------------------- * import functools # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_Import(__pyx_n_s_functools, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_functools, __pyx_t_3) < 0) __PYX_ERR(28, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Log.pyx":8 * * @classmethod * def Stage(cls, name): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Stage); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Log.pyx":7 * cdef class Log: * * @classmethod # <<<<<<<<<<<<<< * def Stage(cls, name): * if not name: raise ValueError("empty name") */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_Stage, __pyx_t_1) < 0) __PYX_ERR(28, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":22 * * @classmethod * def Class(cls, name): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Class); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Log.pyx":21 * return stage * * @classmethod # <<<<<<<<<<<<<< * def Class(cls, name): * if not name: raise ValueError("empty name") */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_Class, __pyx_t_3) < 0) __PYX_ERR(28, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":36 * * @classmethod * def Event(cls, name, klass=None): # <<<<<<<<<<<<<< * if not name: raise ValueError("empty name") * cdef const char *cname = NULL */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_Event); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Log.pyx":35 * return klass * * @classmethod # <<<<<<<<<<<<<< * def Event(cls, name, klass=None): * if not name: raise ValueError("empty name") */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_Event, __pyx_t_1) < 0) __PYX_ERR(28, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":52 * * @classmethod * def begin(cls, all=False): # <<<<<<<<<<<<<< * if all: CHKERR( PetscLogAllBegin() ) * else: CHKERR( PetscLogDefaultBegin() ) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Log.pyx":51 * return event * * @classmethod # <<<<<<<<<<<<<< * def begin(cls, all=False): * if all: CHKERR( PetscLogAllBegin() ) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_begin, __pyx_t_3) < 0) __PYX_ERR(28, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":57 * * @classmethod * def view(cls, Viewer viewer=None): # <<<<<<<<<<<<<< * cdef PetscViewer vwr = NULL * if viewer is not None: vwr = viewer.vwr */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Log.pyx":56 * else: CHKERR( PetscLogDefaultBegin() ) * * @classmethod # <<<<<<<<<<<<<< * def view(cls, Viewer viewer=None): * cdef PetscViewer vwr = NULL */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_view, __pyx_t_1) < 0) __PYX_ERR(28, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":64 * * @classmethod * def logFlops(cls, flops): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_logFlops); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Log.pyx":63 * CHKERR( PetscLogView(vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def logFlops(cls, flops): * cdef PetscLogDouble cflops=flops */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_logFlops, __pyx_t_3) < 0) __PYX_ERR(28, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":69 * * @classmethod * def addFlops(cls, flops): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=flops * CHKERR( PetscLogFlops(cflops) ) */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_addFlops); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Log.pyx":68 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def addFlops(cls, flops): * cdef PetscLogDouble cflops=flops */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_addFlops, __pyx_t_1) < 0) __PYX_ERR(28, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":74 * * @classmethod * def getFlops(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble cflops=0 * CHKERR( PetscGetFlops(&cflops) ) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getFlops); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Log.pyx":73 * CHKERR( PetscLogFlops(cflops) ) * * @classmethod # <<<<<<<<<<<<<< * def getFlops(cls): * cdef PetscLogDouble cflops=0 */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_getFlops, __pyx_t_3) < 0) __PYX_ERR(28, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":80 * * @classmethod * def getTime(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble wctime=0 * CHKERR( PetscTime(&wctime) ) */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getTime); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Log.pyx":79 * return cflops * * @classmethod # <<<<<<<<<<<<<< * def getTime(cls): * cdef PetscLogDouble wctime=0 */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_getTime, __pyx_t_1) < 0) __PYX_ERR(28, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":86 * * @classmethod * def getCPUTime(cls): # <<<<<<<<<<<<<< * cdef PetscLogDouble cputime=0 * CHKERR( PetscGetCPUTime(&cputime) ) */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_getCPUTime); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Log.pyx":85 * return wctime * * @classmethod # <<<<<<<<<<<<<< * def getCPUTime(cls): * cdef PetscLogDouble cputime=0 */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_getCPUTime, __pyx_t_3) < 0) __PYX_ERR(28, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":92 * * @classmethod * def EventDecorator(cls, name=None, klass=None): # <<<<<<<<<<<<<< * """Decorate a function with a PETSc event. * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_n_s_EventDecorator); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Log.pyx":91 * return cputime * * @classmethod # <<<<<<<<<<<<<< * def EventDecorator(cls, name=None, klass=None): * """Decorate a function with a PETSc event. */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Log->tp_dict, __pyx_n_s_EventDecorator, __pyx_t_1) < 0) __PYX_ERR(28, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Log); /* "PETSc/Log.pyx":205 * * * cdef dict stage_registry = { } # <<<<<<<<<<<<<< * * cdef LogStage get_LogStage(object name): */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_stage_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_stage_registry, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":267 * * * cdef dict class_registry = { } # <<<<<<<<<<<<<< * * cdef LogClass get_LogClass(object name): */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_class_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_class_registry, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Log.pyx":371 * return info * * cdef dict event_registry = { } # <<<<<<<<<<<<<< * * cdef LogEvent get_LogEvent(object name): */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_event_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_event_registry, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Comm.pyx":109 * # --- mpi4py compatibility API --- * * Free = destroy # <<<<<<<<<<<<<< * Clone = duplicate * Dup = duplicate */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_destroy); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dict, __pyx_n_s_Free, __pyx_t_1) < 0) __PYX_ERR(9, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "PETSc/Comm.pyx":110 * * Free = destroy * Clone = duplicate # <<<<<<<<<<<<<< * Dup = duplicate * Get_size = getSize */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dict, __pyx_n_s_Clone, __pyx_t_1) < 0) __PYX_ERR(9, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "PETSc/Comm.pyx":111 * Free = destroy * Clone = duplicate * Dup = duplicate # <<<<<<<<<<<<<< * Get_size = getSize * Get_rank = getRank */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_duplicate); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dict, __pyx_n_s_Dup, __pyx_t_1) < 0) __PYX_ERR(9, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "PETSc/Comm.pyx":112 * Clone = duplicate * Dup = duplicate * Get_size = getSize # <<<<<<<<<<<<<< * Get_rank = getRank * Barrier = barrier */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_getSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dict, __pyx_n_s_Get_size, __pyx_t_1) < 0) __PYX_ERR(9, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "PETSc/Comm.pyx":113 * Dup = duplicate * Get_size = getSize * Get_rank = getRank # <<<<<<<<<<<<<< * Barrier = barrier * */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_getRank); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dict, __pyx_n_s_Get_rank, __pyx_t_1) < 0) __PYX_ERR(9, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "PETSc/Comm.pyx":114 * Get_size = getSize * Get_rank = getRank * Barrier = barrier # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dict, __pyx_n_s_Barrier, __pyx_t_1) < 0) __PYX_ERR(9, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Comm); /* "PETSc/Comm.pyx":118 * # -------------------------------------------------------------------- * * cdef Comm __COMM_NULL__ = Comm() # <<<<<<<<<<<<<< * cdef Comm __COMM_SELF__ = Comm() * cdef Comm __COMM_WORLD__ = Comm() */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_NULL__)); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_NULL__, ((struct PyPetscCommObject *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Comm.pyx":119 * * cdef Comm __COMM_NULL__ = Comm() * cdef Comm __COMM_SELF__ = Comm() # <<<<<<<<<<<<<< * cdef Comm __COMM_WORLD__ = Comm() * */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_SELF__)); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_SELF__, ((struct PyPetscCommObject *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Comm.pyx":120 * cdef Comm __COMM_NULL__ = Comm() * cdef Comm __COMM_SELF__ = Comm() * cdef Comm __COMM_WORLD__ = Comm() # <<<<<<<<<<<<<< * * COMM_NULL = __COMM_NULL__ */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_WORLD__)); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_WORLD__, ((struct PyPetscCommObject *)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Comm.pyx":122 * cdef Comm __COMM_WORLD__ = Comm() * * COMM_NULL = __COMM_NULL__ # <<<<<<<<<<<<<< * COMM_SELF = __COMM_SELF__ * COMM_WORLD = __COMM_WORLD__ */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMM_NULL, ((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_NULL__)) < 0) __PYX_ERR(9, 122, __pyx_L1_error) /* "PETSc/Comm.pyx":123 * * COMM_NULL = __COMM_NULL__ * COMM_SELF = __COMM_SELF__ # <<<<<<<<<<<<<< * COMM_WORLD = __COMM_WORLD__ * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMM_SELF, ((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_SELF__)) < 0) __PYX_ERR(9, 123, __pyx_L1_error) /* "PETSc/Comm.pyx":124 * COMM_NULL = __COMM_NULL__ * COMM_SELF = __COMM_SELF__ * COMM_WORLD = __COMM_WORLD__ # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMM_WORLD, ((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_WORLD__)) < 0) __PYX_ERR(9, 124, __pyx_L1_error) /* "PETSc/Comm.pyx":128 * # -------------------------------------------------------------------- * * cdef MPI_Comm PETSC_COMM_DEFAULT = MPI_COMM_NULL # <<<<<<<<<<<<<< * * cdef MPI_Comm GetComm(object comm, MPI_Comm defv) except *: */ __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT = MPI_COMM_NULL; /* "PETSc/Object.pyx":249 * include "cyclicgc.pxi" * * cdef dict type_registry = { 0 : None } # <<<<<<<<<<<<<< * __type_registry__ = type_registry * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_int_0, Py_None) < 0) __PYX_ERR(10, 249, __pyx_L1_error) __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_type_registry); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_type_registry, ((PyObject*)__pyx_t_1)); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Object.pyx":250 * * cdef dict type_registry = { 0 : None } * __type_registry__ = type_registry # <<<<<<<<<<<<<< * * cdef int PyPetscType_Register(int classid, type cls) except -1: */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_type_registry, __pyx_v_8petsc4py_5PETSc_type_registry) < 0) __PYX_ERR(10, 250, __pyx_L1_error) /* "PETSc/Viewer.pyx":3 * # -------------------------------------------------------------------- * * class ViewerType(object): # <<<<<<<<<<<<<< * SOCKET = S_(PETSCVIEWERSOCKET) * ASCII = S_(PETSCVIEWERASCII) */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__87); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__87, __pyx_n_s_ViewerType, __pyx_n_s_ViewerType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Viewer.pyx":4 * * class ViewerType(object): * SOCKET = S_(PETSCVIEWERSOCKET) # <<<<<<<<<<<<<< * ASCII = S_(PETSCVIEWERASCII) * BINARY = S_(PETSCVIEWERBINARY) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSOCKET); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SOCKET, __pyx_t_4) < 0) __PYX_ERR(29, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":5 * class ViewerType(object): * SOCKET = S_(PETSCVIEWERSOCKET) * ASCII = S_(PETSCVIEWERASCII) # <<<<<<<<<<<<<< * BINARY = S_(PETSCVIEWERBINARY) * STRING = S_(PETSCVIEWERSTRING) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII, __pyx_t_4) < 0) __PYX_ERR(29, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":6 * SOCKET = S_(PETSCVIEWERSOCKET) * ASCII = S_(PETSCVIEWERASCII) * BINARY = S_(PETSCVIEWERBINARY) # <<<<<<<<<<<<<< * STRING = S_(PETSCVIEWERSTRING) * DRAW = S_(PETSCVIEWERDRAW) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERBINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BINARY, __pyx_t_4) < 0) __PYX_ERR(29, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":7 * ASCII = S_(PETSCVIEWERASCII) * BINARY = S_(PETSCVIEWERBINARY) * STRING = S_(PETSCVIEWERSTRING) # <<<<<<<<<<<<<< * DRAW = S_(PETSCVIEWERDRAW) * VU = S_(PETSCVIEWERVU) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSTRING); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_STRING, __pyx_t_4) < 0) __PYX_ERR(29, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":8 * BINARY = S_(PETSCVIEWERBINARY) * STRING = S_(PETSCVIEWERSTRING) * DRAW = S_(PETSCVIEWERDRAW) # <<<<<<<<<<<<<< * VU = S_(PETSCVIEWERVU) * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERDRAW); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DRAW, __pyx_t_4) < 0) __PYX_ERR(29, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":9 * STRING = S_(PETSCVIEWERSTRING) * DRAW = S_(PETSCVIEWERDRAW) * VU = S_(PETSCVIEWERVU) # <<<<<<<<<<<<<< * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) * HDF5 = S_(PETSCVIEWERHDF5) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERVU); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VU, __pyx_t_4) < 0) __PYX_ERR(29, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":10 * DRAW = S_(PETSCVIEWERDRAW) * VU = S_(PETSCVIEWERVU) * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) # <<<<<<<<<<<<<< * HDF5 = S_(PETSCVIEWERHDF5) * VTK = S_(PETSCVIEWERVTK) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERMATHEMATICA); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MATHEMATICA, __pyx_t_4) < 0) __PYX_ERR(29, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":11 * VU = S_(PETSCVIEWERVU) * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) * HDF5 = S_(PETSCVIEWERHDF5) # <<<<<<<<<<<<<< * VTK = S_(PETSCVIEWERVTK) * MATLAB = S_(PETSCVIEWERMATLAB) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERHDF5); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HDF5, __pyx_t_4) < 0) __PYX_ERR(29, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":12 * MATHEMATICA = S_(PETSCVIEWERMATHEMATICA) * HDF5 = S_(PETSCVIEWERHDF5) * VTK = S_(PETSCVIEWERVTK) # <<<<<<<<<<<<<< * MATLAB = S_(PETSCVIEWERMATLAB) * SAWS = S_(PETSCVIEWERSAWS) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERVTK); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VTK, __pyx_t_4) < 0) __PYX_ERR(29, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":13 * HDF5 = S_(PETSCVIEWERHDF5) * VTK = S_(PETSCVIEWERVTK) * MATLAB = S_(PETSCVIEWERMATLAB) # <<<<<<<<<<<<<< * SAWS = S_(PETSCVIEWERSAWS) * GLVIS = S_(PETSCVIEWERGLVIS) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERMATLAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MATLAB, __pyx_t_4) < 0) __PYX_ERR(29, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":14 * VTK = S_(PETSCVIEWERVTK) * MATLAB = S_(PETSCVIEWERMATLAB) * SAWS = S_(PETSCVIEWERSAWS) # <<<<<<<<<<<<<< * GLVIS = S_(PETSCVIEWERGLVIS) * ADIOS = S_(PETSCVIEWERADIOS) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSAWS); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SAWS, __pyx_t_4) < 0) __PYX_ERR(29, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":15 * MATLAB = S_(PETSCVIEWERMATLAB) * SAWS = S_(PETSCVIEWERSAWS) * GLVIS = S_(PETSCVIEWERGLVIS) # <<<<<<<<<<<<<< * ADIOS = S_(PETSCVIEWERADIOS) * ADIOS2 = S_(PETSCVIEWERADIOS2) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERGLVIS); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GLVIS, __pyx_t_4) < 0) __PYX_ERR(29, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":16 * SAWS = S_(PETSCVIEWERSAWS) * GLVIS = S_(PETSCVIEWERGLVIS) * ADIOS = S_(PETSCVIEWERADIOS) # <<<<<<<<<<<<<< * ADIOS2 = S_(PETSCVIEWERADIOS2) * EXODUSII = S_(PETSCVIEWEREXODUSII) */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERADIOS); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADIOS, __pyx_t_4) < 0) __PYX_ERR(29, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":17 * GLVIS = S_(PETSCVIEWERGLVIS) * ADIOS = S_(PETSCVIEWERADIOS) * ADIOS2 = S_(PETSCVIEWERADIOS2) # <<<<<<<<<<<<<< * EXODUSII = S_(PETSCVIEWEREXODUSII) * */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERADIOS2); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADIOS2, __pyx_t_4) < 0) __PYX_ERR(29, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":18 * ADIOS = S_(PETSCVIEWERADIOS) * ADIOS2 = S_(PETSCVIEWERADIOS2) * EXODUSII = S_(PETSCVIEWEREXODUSII) # <<<<<<<<<<<<<< * * class ViewerFormat(object): */ __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWEREXODUSII); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXODUSII, __pyx_t_4) < 0) __PYX_ERR(29, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":3 * # -------------------------------------------------------------------- * * class ViewerType(object): # <<<<<<<<<<<<<< * SOCKET = S_(PETSCVIEWERSOCKET) * ASCII = S_(PETSCVIEWERASCII) */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ViewerType, __pyx_tuple__87, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ViewerType, __pyx_t_4) < 0) __PYX_ERR(29, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":20 * EXODUSII = S_(PETSCVIEWEREXODUSII) * * class ViewerFormat(object): # <<<<<<<<<<<<<< * DEFAULT = PETSC_VIEWER_DEFAULT * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__88); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__88, __pyx_n_s_ViewerFormat, __pyx_n_s_ViewerFormat, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Viewer.pyx":21 * * class ViewerFormat(object): * DEFAULT = PETSC_VIEWER_DEFAULT # <<<<<<<<<<<<<< * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DEFAULT, __pyx_t_4) < 0) __PYX_ERR(29, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":22 * class ViewerFormat(object): * DEFAULT = PETSC_VIEWER_DEFAULT * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB # <<<<<<<<<<<<<< * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATLAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_MATLAB, __pyx_t_4) < 0) __PYX_ERR(29, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":23 * DEFAULT = PETSC_VIEWER_DEFAULT * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA # <<<<<<<<<<<<<< * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL * ASCII_INFO = PETSC_VIEWER_ASCII_INFO */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATHEMATICA); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_MATHEMATICA, __pyx_t_4) < 0) __PYX_ERR(29, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":24 * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL # <<<<<<<<<<<<<< * ASCII_INFO = PETSC_VIEWER_ASCII_INFO * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_IMPL); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_IMPL, __pyx_t_4) < 0) __PYX_ERR(29, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":25 * ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL * ASCII_INFO = PETSC_VIEWER_ASCII_INFO # <<<<<<<<<<<<<< * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INFO); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_INFO, __pyx_t_4) < 0) __PYX_ERR(29, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":26 * ASCII_IMPL = PETSC_VIEWER_ASCII_IMPL * ASCII_INFO = PETSC_VIEWER_ASCII_INFO * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL # <<<<<<<<<<<<<< * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INFO_DETAIL); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_INFO_DETAIL, __pyx_t_4) < 0) __PYX_ERR(29, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":27 * ASCII_INFO = PETSC_VIEWER_ASCII_INFO * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON # <<<<<<<<<<<<<< * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_COMMON); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_COMMON, __pyx_t_4) < 0) __PYX_ERR(29, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":28 * ASCII_INFO_DETAIL = PETSC_VIEWER_ASCII_INFO_DETAIL * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU # <<<<<<<<<<<<<< * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_SYMMODU); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_SYMMODU, __pyx_t_4) < 0) __PYX_ERR(29, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":29 * ASCII_COMMON = PETSC_VIEWER_ASCII_COMMON * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX # <<<<<<<<<<<<<< * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INDEX); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_INDEX, __pyx_t_4) < 0) __PYX_ERR(29, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":30 * ASCII_SYMMODU = PETSC_VIEWER_ASCII_SYMMODU * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE # <<<<<<<<<<<<<< * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_DENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_DENSE, __pyx_t_4) < 0) __PYX_ERR(29, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":31 * ASCII_INDEX = PETSC_VIEWER_ASCII_INDEX * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET # <<<<<<<<<<<<<< * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATRIXMARKET); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_MATRIXMARKET, __pyx_t_4) < 0) __PYX_ERR(29, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":32 * ASCII_DENSE = PETSC_VIEWER_ASCII_DENSE * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED # <<<<<<<<<<<<<< * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_VTK_DEPRECATED); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_VTK, __pyx_t_4) < 0) __PYX_ERR(29, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":33 * ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED # <<<<<<<<<<<<<< * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_VTK_CELL, __pyx_t_4) < 0) __PYX_ERR(29, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":34 * ASCII_VTK = PETSC_VIEWER_ASCII_VTK_DEPRECATED * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED # <<<<<<<<<<<<<< * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_VTK_COORDS, __pyx_t_4) < 0) __PYX_ERR(29, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":35 * ASCII_VTK_CELL = PETSC_VIEWER_ASCII_VTK_CELL_DEPRECATED * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE # <<<<<<<<<<<<<< * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_PCICE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_PCICE, __pyx_t_4) < 0) __PYX_ERR(29, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":36 * ASCII_VTK_COORDS = PETSC_VIEWER_ASCII_VTK_COORDS_DEPRECATED * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON # <<<<<<<<<<<<<< * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_PYTHON); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_PYTHON, __pyx_t_4) < 0) __PYX_ERR(29, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":37 * ASCII_PCICE = PETSC_VIEWER_ASCII_PCICE * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO # <<<<<<<<<<<<<< * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX * ASCII_XML = PETSC_VIEWER_ASCII_XML */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_FACTOR_INFO); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_FACTOR_INFO, __pyx_t_4) < 0) __PYX_ERR(29, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":38 * ASCII_PYTHON = PETSC_VIEWER_ASCII_PYTHON * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX # <<<<<<<<<<<<<< * ASCII_XML = PETSC_VIEWER_ASCII_XML * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_LATEX); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_LATEX, __pyx_t_4) < 0) __PYX_ERR(29, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":39 * ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX * ASCII_XML = PETSC_VIEWER_ASCII_XML # <<<<<<<<<<<<<< * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS * ASCII_CSV = PETSC_VIEWER_ASCII_CSV */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_XML); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_XML, __pyx_t_4) < 0) __PYX_ERR(29, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":40 * ASCII_LATEX = PETSC_VIEWER_ASCII_LATEX * ASCII_XML = PETSC_VIEWER_ASCII_XML * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS # <<<<<<<<<<<<<< * ASCII_CSV = PETSC_VIEWER_ASCII_CSV * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_GLVIS); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_GLVIS, __pyx_t_4) < 0) __PYX_ERR(29, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":41 * ASCII_XML = PETSC_VIEWER_ASCII_XML * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS * ASCII_CSV = PETSC_VIEWER_ASCII_CSV # <<<<<<<<<<<<<< * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC * DRAW_LG = PETSC_VIEWER_DRAW_LG */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_ASCII_CSV); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASCII_CSV, __pyx_t_4) < 0) __PYX_ERR(29, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":42 * ASCII_GLVIS = PETSC_VIEWER_ASCII_GLVIS * ASCII_CSV = PETSC_VIEWER_ASCII_CSV * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC # <<<<<<<<<<<<<< * DRAW_LG = PETSC_VIEWER_DRAW_LG * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_BASIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DRAW_BASIC, __pyx_t_4) < 0) __PYX_ERR(29, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":43 * ASCII_CSV = PETSC_VIEWER_ASCII_CSV * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC * DRAW_LG = PETSC_VIEWER_DRAW_LG # <<<<<<<<<<<<<< * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_LG); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DRAW_LG, __pyx_t_4) < 0) __PYX_ERR(29, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":44 * DRAW_BASIC = PETSC_VIEWER_DRAW_BASIC * DRAW_LG = PETSC_VIEWER_DRAW_LG * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE # <<<<<<<<<<<<<< * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_LG_XRANGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DRAW_LG_XRANGE, __pyx_t_4) < 0) __PYX_ERR(29, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":45 * DRAW_LG = PETSC_VIEWER_DRAW_LG * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR # <<<<<<<<<<<<<< * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS * VTK_VTS = PETSC_VIEWER_VTK_VTS */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_CONTOUR); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DRAW_CONTOUR, __pyx_t_4) < 0) __PYX_ERR(29, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":46 * DRAW_LG_XRANGE = PETSC_VIEWER_DRAW_LG_XRANGE * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS # <<<<<<<<<<<<<< * VTK_VTS = PETSC_VIEWER_VTK_VTS * VTK_VTR = PETSC_VIEWER_VTK_VTR */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_DRAW_PORTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DRAW_PORTS, __pyx_t_4) < 0) __PYX_ERR(29, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":47 * DRAW_CONTOUR = PETSC_VIEWER_DRAW_CONTOUR * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS * VTK_VTS = PETSC_VIEWER_VTK_VTS # <<<<<<<<<<<<<< * VTK_VTR = PETSC_VIEWER_VTK_VTR * VTK_VTU = PETSC_VIEWER_VTK_VTU */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VTK_VTS, __pyx_t_4) < 0) __PYX_ERR(29, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":48 * DRAW_PORTS = PETSC_VIEWER_DRAW_PORTS * VTK_VTS = PETSC_VIEWER_VTK_VTS * VTK_VTR = PETSC_VIEWER_VTK_VTR # <<<<<<<<<<<<<< * VTK_VTU = PETSC_VIEWER_VTK_VTU * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTR); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VTK_VTR, __pyx_t_4) < 0) __PYX_ERR(29, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":49 * VTK_VTS = PETSC_VIEWER_VTK_VTS * VTK_VTR = PETSC_VIEWER_VTK_VTR * VTK_VTU = PETSC_VIEWER_VTK_VTU # <<<<<<<<<<<<<< * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB * NATIVE = PETSC_VIEWER_NATIVE */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTU); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VTK_VTU, __pyx_t_4) < 0) __PYX_ERR(29, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":50 * VTK_VTR = PETSC_VIEWER_VTK_VTR * VTK_VTU = PETSC_VIEWER_VTK_VTU * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB # <<<<<<<<<<<<<< * NATIVE = PETSC_VIEWER_NATIVE * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_BINARY_MATLAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BINARY_MATLAB, __pyx_t_4) < 0) __PYX_ERR(29, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":51 * VTK_VTU = PETSC_VIEWER_VTK_VTU * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB * NATIVE = PETSC_VIEWER_NATIVE # <<<<<<<<<<<<<< * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_NATIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NATIVE, __pyx_t_4) < 0) __PYX_ERR(29, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":52 * BINARY_MATLAB = PETSC_VIEWER_BINARY_MATLAB * NATIVE = PETSC_VIEWER_NATIVE * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC # <<<<<<<<<<<<<< * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_PETSC); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HDF5_PETSC, __pyx_t_4) < 0) __PYX_ERR(29, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":53 * NATIVE = PETSC_VIEWER_NATIVE * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ # <<<<<<<<<<<<<< * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF * HDF5_MAT = PETSC_VIEWER_HDF5_MAT */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_VIZ); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HDF5_VIZ, __pyx_t_4) < 0) __PYX_ERR(29, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":54 * HDF5_PETSC = PETSC_VIEWER_HDF5_PETSC * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF # <<<<<<<<<<<<<< * HDF5_MAT = PETSC_VIEWER_HDF5_MAT * NOFORMAT = PETSC_VIEWER_NOFORMAT */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_XDMF); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HDF5_XDMF, __pyx_t_4) < 0) __PYX_ERR(29, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":55 * HDF5_VIZ = PETSC_VIEWER_HDF5_VIZ * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF * HDF5_MAT = PETSC_VIEWER_HDF5_MAT # <<<<<<<<<<<<<< * NOFORMAT = PETSC_VIEWER_NOFORMAT * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_HDF5_MAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HDF5_MAT, __pyx_t_4) < 0) __PYX_ERR(29, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":56 * HDF5_XDMF = PETSC_VIEWER_HDF5_XDMF * HDF5_MAT = PETSC_VIEWER_HDF5_MAT * NOFORMAT = PETSC_VIEWER_NOFORMAT # <<<<<<<<<<<<<< * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE * FAILED = PETSC_VIEWER_FAILED */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_NOFORMAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOFORMAT, __pyx_t_4) < 0) __PYX_ERR(29, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":57 * HDF5_MAT = PETSC_VIEWER_HDF5_MAT * NOFORMAT = PETSC_VIEWER_NOFORMAT * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE # <<<<<<<<<<<<<< * FAILED = PETSC_VIEWER_FAILED * */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_LOAD_BALANCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LOAD_BALANCE, __pyx_t_4) < 0) __PYX_ERR(29, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":58 * NOFORMAT = PETSC_VIEWER_NOFORMAT * LOAD_BALANCE = PETSC_VIEWER_LOAD_BALANCE * FAILED = PETSC_VIEWER_FAILED # <<<<<<<<<<<<<< * * class FileMode(object): */ __pyx_t_4 = __Pyx_PyInt_From_PetscViewerFormat(PETSC_VIEWER_FAILED); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FAILED, __pyx_t_4) < 0) __PYX_ERR(29, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":20 * EXODUSII = S_(PETSCVIEWEREXODUSII) * * class ViewerFormat(object): # <<<<<<<<<<<<<< * DEFAULT = PETSC_VIEWER_DEFAULT * ASCII_MATLAB = PETSC_VIEWER_ASCII_MATLAB */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ViewerFormat, __pyx_tuple__88, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ViewerFormat, __pyx_t_4) < 0) __PYX_ERR(29, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":60 * FAILED = PETSC_VIEWER_FAILED * * class FileMode(object): # <<<<<<<<<<<<<< * # native * READ = PETSC_FILE_MODE_READ */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__89); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__89, __pyx_n_s_FileMode, __pyx_n_s_FileMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Viewer.pyx":62 * class FileMode(object): * # native * READ = PETSC_FILE_MODE_READ # <<<<<<<<<<<<<< * WRITE = PETSC_FILE_MODE_WRITE * APPEND = PETSC_FILE_MODE_APPEND */ __pyx_t_4 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_READ); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_READ, __pyx_t_4) < 0) __PYX_ERR(29, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":63 * # native * READ = PETSC_FILE_MODE_READ * WRITE = PETSC_FILE_MODE_WRITE # <<<<<<<<<<<<<< * APPEND = PETSC_FILE_MODE_APPEND * UPDATE = PETSC_FILE_MODE_UPDATE */ __pyx_t_4 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_WRITE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WRITE, __pyx_t_4) < 0) __PYX_ERR(29, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":64 * READ = PETSC_FILE_MODE_READ * WRITE = PETSC_FILE_MODE_WRITE * APPEND = PETSC_FILE_MODE_APPEND # <<<<<<<<<<<<<< * UPDATE = PETSC_FILE_MODE_UPDATE * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE */ __pyx_t_4 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_APPEND); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_APPEND, __pyx_t_4) < 0) __PYX_ERR(29, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":65 * WRITE = PETSC_FILE_MODE_WRITE * APPEND = PETSC_FILE_MODE_APPEND * UPDATE = PETSC_FILE_MODE_UPDATE # <<<<<<<<<<<<<< * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE * # aliases */ __pyx_t_4 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_UPDATE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UPDATE, __pyx_t_4) < 0) __PYX_ERR(29, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":66 * APPEND = PETSC_FILE_MODE_APPEND * UPDATE = PETSC_FILE_MODE_UPDATE * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE # <<<<<<<<<<<<<< * # aliases * R, W, A, U = READ, WRITE, APPEND, UPDATE */ __pyx_t_4 = __Pyx_PyInt_From_PetscFileMode(FILE_MODE_APPEND_UPDATE); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_APPEND_UPDATE, __pyx_t_4) < 0) __PYX_ERR(29, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "PETSc/Viewer.pyx":68 * APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE * # aliases * R, W, A, U = READ, WRITE, APPEND, UPDATE # <<<<<<<<<<<<<< * AU = UA = APPEND_UPDATE * */ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_READ); if (unlikely(!__pyx_t_4)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_READ); } if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_WRITE); if (unlikely(!__pyx_t_5)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_WRITE); } if (unlikely(!__pyx_t_5)) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_APPEND); if (unlikely(!__pyx_t_6)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_APPEND); } if (unlikely(!__pyx_t_6)) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_UPDATE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_UPDATE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_R, __pyx_t_4) < 0) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_W, __pyx_t_5) < 0) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_A, __pyx_t_6) < 0) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_U, __pyx_t_7) < 0) __PYX_ERR(29, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":69 * # aliases * R, W, A, U = READ, WRITE, APPEND, UPDATE * AU = UA = APPEND_UPDATE # <<<<<<<<<<<<<< * * class DrawSize(object): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_APPEND_UPDATE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_APPEND_UPDATE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AU, __pyx_t_7) < 0) __PYX_ERR(29, 69, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UA, __pyx_t_7) < 0) __PYX_ERR(29, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":60 * FAILED = PETSC_VIEWER_FAILED * * class FileMode(object): # <<<<<<<<<<<<<< * # native * READ = PETSC_FILE_MODE_READ */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_FileMode, __pyx_tuple__89, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FileMode, __pyx_t_7) < 0) __PYX_ERR(29, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":71 * AU = UA = APPEND_UPDATE * * class DrawSize(object): # <<<<<<<<<<<<<< * # native * FULL_SIZE = PETSC_DRAW_FULL_SIZE */ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__90); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__90, __pyx_n_s_DrawSize, __pyx_n_s_DrawSize, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Viewer.pyx":73 * class DrawSize(object): * # native * FULL_SIZE = PETSC_DRAW_FULL_SIZE # <<<<<<<<<<<<<< * HALF_SIZE = PETSC_DRAW_HALF_SIZE * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE */ __pyx_t_7 = __Pyx_PyInt_From_int(PETSC_DRAW_FULL_SIZE); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FULL_SIZE, __pyx_t_7) < 0) __PYX_ERR(29, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":74 * # native * FULL_SIZE = PETSC_DRAW_FULL_SIZE * HALF_SIZE = PETSC_DRAW_HALF_SIZE # <<<<<<<<<<<<<< * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE */ __pyx_t_7 = __Pyx_PyInt_From_int(PETSC_DRAW_HALF_SIZE); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HALF_SIZE, __pyx_t_7) < 0) __PYX_ERR(29, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":75 * FULL_SIZE = PETSC_DRAW_FULL_SIZE * HALF_SIZE = PETSC_DRAW_HALF_SIZE * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE # <<<<<<<<<<<<<< * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE * # aliases */ __pyx_t_7 = __Pyx_PyInt_From_int(PETSC_DRAW_THIRD_SIZE); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_THIRD_SIZE, __pyx_t_7) < 0) __PYX_ERR(29, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":76 * HALF_SIZE = PETSC_DRAW_HALF_SIZE * THIRD_SIZE = PETSC_DRAW_THIRD_SIZE * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE # <<<<<<<<<<<<<< * # aliases * FULL = FULL_SIZE */ __pyx_t_7 = __Pyx_PyInt_From_int(PETSC_DRAW_QUARTER_SIZE); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_QUARTER_SIZE, __pyx_t_7) < 0) __PYX_ERR(29, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":78 * QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE * # aliases * FULL = FULL_SIZE # <<<<<<<<<<<<<< * HALF = HALF_SIZE * THIRD = THIRD_SIZE */ __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_FULL_SIZE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FULL_SIZE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FULL, __pyx_t_7) < 0) __PYX_ERR(29, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":79 * # aliases * FULL = FULL_SIZE * HALF = HALF_SIZE # <<<<<<<<<<<<<< * THIRD = THIRD_SIZE * QUARTER = QUARTER_SIZE */ __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_HALF_SIZE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_HALF_SIZE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HALF, __pyx_t_7) < 0) __PYX_ERR(29, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":80 * FULL = FULL_SIZE * HALF = HALF_SIZE * THIRD = THIRD_SIZE # <<<<<<<<<<<<<< * QUARTER = QUARTER_SIZE * */ __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_THIRD_SIZE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_THIRD_SIZE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_THIRD, __pyx_t_7) < 0) __PYX_ERR(29, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":81 * HALF = HALF_SIZE * THIRD = THIRD_SIZE * QUARTER = QUARTER_SIZE # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_QUARTER_SIZE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_QUARTER_SIZE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_QUARTER, __pyx_t_7) < 0) __PYX_ERR(29, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Viewer.pyx":71 * AU = UA = APPEND_UPDATE * * class DrawSize(object): # <<<<<<<<<<<<<< * # native * FULL_SIZE = PETSC_DRAW_FULL_SIZE */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DrawSize, __pyx_tuple__90, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(29, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DrawSize, __pyx_t_7) < 0) __PYX_ERR(29, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/Viewer.pyx":87 * cdef class Viewer(Object): * * Type = ViewerType # <<<<<<<<<<<<<< * Format = ViewerFormat * Mode = FileMode */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ViewerType); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_Type, __pyx_t_1) < 0) __PYX_ERR(29, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":88 * * Type = ViewerType * Format = ViewerFormat # <<<<<<<<<<<<<< * Mode = FileMode * Size = DrawSize */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ViewerFormat); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_Format, __pyx_t_1) < 0) __PYX_ERR(29, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":89 * Type = ViewerType * Format = ViewerFormat * Mode = FileMode # <<<<<<<<<<<<<< * Size = DrawSize * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FileMode); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_Mode, __pyx_t_1) < 0) __PYX_ERR(29, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":90 * Format = ViewerFormat * Mode = FileMode * Size = DrawSize # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DrawSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_Size, __pyx_t_1) < 0) __PYX_ERR(29, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":232 * * @classmethod * def STDOUT(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_STDOUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Viewer.pyx":231 * CHKERR( PetscViewerPopFormat(self.vwr) ) * * @classmethod # <<<<<<<<<<<<<< * def STDOUT(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_STDOUT, __pyx_t_3) < 0) __PYX_ERR(29, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":240 * * @classmethod * def STDERR(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_STDERR); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Viewer.pyx":239 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def STDERR(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_STDERR, __pyx_t_1) < 0) __PYX_ERR(29, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":248 * * @classmethod * def ASCII(cls, name, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef const char *cname = NULL */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_ASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Viewer.pyx":247 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def ASCII(cls, name, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_ASCII, __pyx_t_3) < 0) __PYX_ERR(29, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":257 * * @classmethod * def BINARY(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_BINARY); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Viewer.pyx":256 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def BINARY(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_BINARY, __pyx_t_1) < 0) __PYX_ERR(29, 257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":265 * * @classmethod * def DRAW(cls, comm=None): # <<<<<<<<<<<<<< * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) * cdef Viewer viewer = Viewer() */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_n_s_DRAW); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Viewer.pyx":264 * return viewer * * @classmethod # <<<<<<<<<<<<<< * def DRAW(cls, comm=None): * cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT) */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(29, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dict, __pyx_n_s_DRAW, __pyx_t_3) < 0) __PYX_ERR(29, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Viewer); /* "PETSc/Viewer.pyx":406 * # -------------------------------------------------------------------- * * del ViewerType # <<<<<<<<<<<<<< * del ViewerFormat * del FileMode */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ViewerType) < 0) __PYX_ERR(29, 406, __pyx_L1_error) /* "PETSc/Viewer.pyx":407 * * del ViewerType * del ViewerFormat # <<<<<<<<<<<<<< * del FileMode * del DrawSize */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ViewerFormat) < 0) __PYX_ERR(29, 407, __pyx_L1_error) /* "PETSc/Viewer.pyx":408 * del ViewerType * del ViewerFormat * del FileMode # <<<<<<<<<<<<<< * del DrawSize * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_FileMode) < 0) __PYX_ERR(29, 408, __pyx_L1_error) /* "PETSc/Viewer.pyx":409 * del ViewerFormat * del FileMode * del DrawSize # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DrawSize) < 0) __PYX_ERR(29, 409, __pyx_L1_error) /* "PETSc/Random.pyx":3 * # -------------------------------------------------------------------- * * class RandomType(object): # <<<<<<<<<<<<<< * RAND = S_(PETSCRAND) * RAND48 = S_(PETSCRAND48) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__91); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__91, __pyx_n_s_RandomType, __pyx_n_s_RandomType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Random.pyx":4 * * class RandomType(object): * RAND = S_(PETSCRAND) # <<<<<<<<<<<<<< * RAND48 = S_(PETSCRAND48) * SPRNG = S_(PETSCSPRNG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRAND); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RAND, __pyx_t_7) < 0) __PYX_ERR(30, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Random.pyx":5 * class RandomType(object): * RAND = S_(PETSCRAND) * RAND48 = S_(PETSCRAND48) # <<<<<<<<<<<<<< * SPRNG = S_(PETSCSPRNG) * RANDER48 = S_(PETSCRANDER48) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRAND48); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RAND48, __pyx_t_7) < 0) __PYX_ERR(30, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Random.pyx":6 * RAND = S_(PETSCRAND) * RAND48 = S_(PETSCRAND48) * SPRNG = S_(PETSCSPRNG) # <<<<<<<<<<<<<< * RANDER48 = S_(PETSCRANDER48) * RANDOM123 = S_(PETSCRANDOM123) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPRNG); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SPRNG, __pyx_t_7) < 0) __PYX_ERR(30, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Random.pyx":7 * RAND48 = S_(PETSCRAND48) * SPRNG = S_(PETSCSPRNG) * RANDER48 = S_(PETSCRANDER48) # <<<<<<<<<<<<<< * RANDOM123 = S_(PETSCRANDOM123) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRANDER48); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RANDER48, __pyx_t_7) < 0) __PYX_ERR(30, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Random.pyx":8 * SPRNG = S_(PETSCSPRNG) * RANDER48 = S_(PETSCRANDER48) * RANDOM123 = S_(PETSCRANDOM123) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRANDOM123); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RANDOM123, __pyx_t_7) < 0) __PYX_ERR(30, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Random.pyx":3 * # -------------------------------------------------------------------- * * class RandomType(object): # <<<<<<<<<<<<<< * RAND = S_(PETSCRAND) * RAND48 = S_(PETSCRAND48) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_RandomType, __pyx_tuple__91, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_RandomType, __pyx_t_7) < 0) __PYX_ERR(30, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Random.pyx":14 * cdef class Random(Object): * * Type = RandomType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RandomType); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Random->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(30, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Random); /* "PETSc/Random.pyx":101 * # -------------------------------------------------------------------- * * del RandomType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_RandomType) < 0) __PYX_ERR(30, 101, __pyx_L1_error) /* "PETSc/IS.pyx":3 * # -------------------------------------------------------------------- * * class ISType(object): # <<<<<<<<<<<<<< * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__92); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__92, __pyx_n_s_ISType, __pyx_n_s_ISType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/IS.pyx":4 * * class ISType(object): * GENERAL = S_(ISGENERAL) # <<<<<<<<<<<<<< * BLOCK = S_(ISBLOCK) * STRIDE = S_(ISSTRIDE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(ISGENERAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GENERAL, __pyx_t_7) < 0) __PYX_ERR(31, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/IS.pyx":5 * class ISType(object): * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) # <<<<<<<<<<<<<< * STRIDE = S_(ISSTRIDE) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(ISBLOCK); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BLOCK, __pyx_t_7) < 0) __PYX_ERR(31, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/IS.pyx":6 * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) * STRIDE = S_(ISSTRIDE) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(ISSTRIDE); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STRIDE, __pyx_t_7) < 0) __PYX_ERR(31, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/IS.pyx":3 * # -------------------------------------------------------------------- * * class ISType(object): # <<<<<<<<<<<<<< * GENERAL = S_(ISGENERAL) * BLOCK = S_(ISBLOCK) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_ISType, __pyx_tuple__92, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ISType, __pyx_t_7) < 0) __PYX_ERR(31, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/IS.pyx":12 * cdef class IS(Object): * * Type = ISType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ISType); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_IS->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(31, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_IS); /* "PETSc/IS.pyx":350 * * * class GLMapMode(object): # <<<<<<<<<<<<<< * MASK = PETSC_IS_GTOLM_MASK * DROP = PETSC_IS_GTOLM_DROP */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__93); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__93, __pyx_n_s_GLMapMode, __pyx_n_s_GLMapMode, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/IS.pyx":351 * * class GLMapMode(object): * MASK = PETSC_IS_GTOLM_MASK # <<<<<<<<<<<<<< * DROP = PETSC_IS_GTOLM_DROP * */ __pyx_t_7 = __Pyx_PyInt_From_ISGlobalToLocalMappingMode(IS_GTOLM_MASK); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MASK, __pyx_t_7) < 0) __PYX_ERR(31, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/IS.pyx":352 * class GLMapMode(object): * MASK = PETSC_IS_GTOLM_MASK * DROP = PETSC_IS_GTOLM_DROP # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __Pyx_PyInt_From_ISGlobalToLocalMappingMode(IS_GTOLM_DROP); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DROP, __pyx_t_7) < 0) __PYX_ERR(31, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/IS.pyx":350 * * * class GLMapMode(object): # <<<<<<<<<<<<<< * MASK = PETSC_IS_GTOLM_MASK * DROP = PETSC_IS_GTOLM_DROP */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_GLMapMode, __pyx_tuple__93, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_GLMapMode, __pyx_t_7) < 0) __PYX_ERR(31, 350, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/IS.pyx":355 * * * class LGMapType(object): # <<<<<<<<<<<<<< * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__94); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__94, __pyx_n_s_LGMapType, __pyx_n_s_LGMapType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/IS.pyx":356 * * class LGMapType(object): * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) # <<<<<<<<<<<<<< * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(ISLOCALTOGLOBALMAPPINGBASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(31, 356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/IS.pyx":357 * class LGMapType(object): * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(ISLOCALTOGLOBALMAPPINGHASH); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HASH, __pyx_t_7) < 0) __PYX_ERR(31, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/IS.pyx":355 * * * class LGMapType(object): # <<<<<<<<<<<<<< * BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC) * HASH = S_(ISLOCALTOGLOBALMAPPINGHASH) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_LGMapType, __pyx_tuple__94, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(31, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_LGMapType, __pyx_t_7) < 0) __PYX_ERR(31, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/IS.pyx":364 * cdef class LGMap(Object): * * MapMode = GLMapMode # <<<<<<<<<<<<<< * * Type = LGMapType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_GLMapMode); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_dict, __pyx_n_s_MapMode, __pyx_t_3) < 0) __PYX_ERR(31, 364, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_LGMap); /* "PETSc/IS.pyx":366 * MapMode = GLMapMode * * Type = LGMapType # <<<<<<<<<<<<<< * # * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LGMapType); if (unlikely(!__pyx_t_3)) __PYX_ERR(31, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(31, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_LGMap); /* "PETSc/IS.pyx":577 * # -------------------------------------------------------------------- * * del ISType # <<<<<<<<<<<<<< * del GLMapMode * del LGMapType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ISType) < 0) __PYX_ERR(31, 577, __pyx_L1_error) /* "PETSc/IS.pyx":578 * * del ISType * del GLMapMode # <<<<<<<<<<<<<< * del LGMapType * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_GLMapMode) < 0) __PYX_ERR(31, 578, __pyx_L1_error) /* "PETSc/IS.pyx":579 * del ISType * del GLMapMode * del LGMapType # <<<<<<<<<<<<<< * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_LGMapType) < 0) __PYX_ERR(31, 579, __pyx_L1_error) /* "PETSc/SF.pyx":3 * # -------------------------------------------------------------------- * * class SFType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__95); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__95, __pyx_n_s_SFType, __pyx_n_s_SFType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/SF.pyx":4 * * class SFType(object): * BASIC = S_(PETSCSFBASIC) # <<<<<<<<<<<<<< * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFBASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(32, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":5 * class SFType(object): * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) # <<<<<<<<<<<<<< * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFNEIGHBOR); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEIGHBOR, __pyx_t_7) < 0) __PYX_ERR(32, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":6 * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) # <<<<<<<<<<<<<< * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHERV); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALLGATHERV, __pyx_t_7) < 0) __PYX_ERR(32, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":7 * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) # <<<<<<<<<<<<<< * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHER); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALLGATHER, __pyx_t_7) < 0) __PYX_ERR(32, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":8 * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) # <<<<<<<<<<<<<< * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHERV); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GATHERV, __pyx_t_7) < 0) __PYX_ERR(32, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":9 * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) # <<<<<<<<<<<<<< * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHER); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GATHER, __pyx_t_7) < 0) __PYX_ERR(32, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":10 * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) # <<<<<<<<<<<<<< * WINDOW = S_(PETSCSFWINDOW) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLTOALL); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALLTOALL, __pyx_t_7) < 0) __PYX_ERR(32, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":11 * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFWINDOW); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_WINDOW, __pyx_t_7) < 0) __PYX_ERR(32, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SF.pyx":3 * # -------------------------------------------------------------------- * * class SFType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SFType, __pyx_tuple__95, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SFType, __pyx_t_7) < 0) __PYX_ERR(32, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SF.pyx":17 * cdef class SF(Object): * * Type = SFType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SFType); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SF->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(32, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SF); /* "PETSc/SF.pyx":200 * # -------------------------------------------------------------------- * * del SFType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SFType) < 0) __PYX_ERR(32, 200, __pyx_L1_error) /* "PETSc/Vec.pyx":3 * # -------------------------------------------------------------------- * * class VecType(object): # <<<<<<<<<<<<<< * SEQ = S_(VECSEQ) * MPI = S_(VECMPI) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__96); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__96, __pyx_n_s_VecType, __pyx_n_s_VecType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Vec.pyx":4 * * class VecType(object): * SEQ = S_(VECSEQ) # <<<<<<<<<<<<<< * MPI = S_(VECMPI) * STANDARD = S_(VECSTANDARD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQ); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQ, __pyx_t_7) < 0) __PYX_ERR(33, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":5 * class VecType(object): * SEQ = S_(VECSEQ) * MPI = S_(VECMPI) # <<<<<<<<<<<<<< * STANDARD = S_(VECSTANDARD) * SHARED = S_(VECSHARED) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECMPI); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPI, __pyx_t_7) < 0) __PYX_ERR(33, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":6 * SEQ = S_(VECSEQ) * MPI = S_(VECMPI) * STANDARD = S_(VECSTANDARD) # <<<<<<<<<<<<<< * SHARED = S_(VECSHARED) * SEQVIENNACL= S_(VECSEQVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECSTANDARD); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STANDARD, __pyx_t_7) < 0) __PYX_ERR(33, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":7 * MPI = S_(VECMPI) * STANDARD = S_(VECSTANDARD) * SHARED = S_(VECSHARED) # <<<<<<<<<<<<<< * SEQVIENNACL= S_(VECSEQVIENNACL) * MPIVIENNACL= S_(VECMPIVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECSHARED); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SHARED, __pyx_t_7) < 0) __PYX_ERR(33, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":8 * STANDARD = S_(VECSTANDARD) * SHARED = S_(VECSHARED) * SEQVIENNACL= S_(VECSEQVIENNACL) # <<<<<<<<<<<<<< * MPIVIENNACL= S_(VECMPIVIENNACL) * VIENNACL = S_(VECVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQVIENNACL, __pyx_t_7) < 0) __PYX_ERR(33, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":9 * SHARED = S_(VECSHARED) * SEQVIENNACL= S_(VECSEQVIENNACL) * MPIVIENNACL= S_(VECMPIVIENNACL) # <<<<<<<<<<<<<< * VIENNACL = S_(VECVIENNACL) * SEQCUDA = S_(VECSEQCUDA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIVIENNACL, __pyx_t_7) < 0) __PYX_ERR(33, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":10 * SEQVIENNACL= S_(VECSEQVIENNACL) * MPIVIENNACL= S_(VECMPIVIENNACL) * VIENNACL = S_(VECVIENNACL) # <<<<<<<<<<<<<< * SEQCUDA = S_(VECSEQCUDA) * MPICUDA = S_(VECMPICUDA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VIENNACL, __pyx_t_7) < 0) __PYX_ERR(33, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":11 * MPIVIENNACL= S_(VECMPIVIENNACL) * VIENNACL = S_(VECVIENNACL) * SEQCUDA = S_(VECSEQCUDA) # <<<<<<<<<<<<<< * MPICUDA = S_(VECMPICUDA) * CUDA = S_(VECCUDA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQCUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQCUDA, __pyx_t_7) < 0) __PYX_ERR(33, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":12 * VIENNACL = S_(VECVIENNACL) * SEQCUDA = S_(VECSEQCUDA) * MPICUDA = S_(VECMPICUDA) # <<<<<<<<<<<<<< * CUDA = S_(VECCUDA) * NEST = S_(VECNEST) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECMPICUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPICUDA, __pyx_t_7) < 0) __PYX_ERR(33, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":13 * SEQCUDA = S_(VECSEQCUDA) * MPICUDA = S_(VECMPICUDA) * CUDA = S_(VECCUDA) # <<<<<<<<<<<<<< * NEST = S_(VECNEST) * SEQKOKKOS = S_(VECSEQKOKKOS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECCUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CUDA, __pyx_t_7) < 0) __PYX_ERR(33, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":14 * MPICUDA = S_(VECMPICUDA) * CUDA = S_(VECCUDA) * NEST = S_(VECNEST) # <<<<<<<<<<<<<< * SEQKOKKOS = S_(VECSEQKOKKOS) * MPIKOKKOS = S_(VECMPIKOKKOS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECNEST); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEST, __pyx_t_7) < 0) __PYX_ERR(33, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":15 * CUDA = S_(VECCUDA) * NEST = S_(VECNEST) * SEQKOKKOS = S_(VECSEQKOKKOS) # <<<<<<<<<<<<<< * MPIKOKKOS = S_(VECMPIKOKKOS) * KOKKOS = S_(VECKOKKOS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQKOKKOS); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQKOKKOS, __pyx_t_7) < 0) __PYX_ERR(33, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":16 * NEST = S_(VECNEST) * SEQKOKKOS = S_(VECSEQKOKKOS) * MPIKOKKOS = S_(VECMPIKOKKOS) # <<<<<<<<<<<<<< * KOKKOS = S_(VECKOKKOS) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIKOKKOS); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIKOKKOS, __pyx_t_7) < 0) __PYX_ERR(33, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":17 * SEQKOKKOS = S_(VECSEQKOKKOS) * MPIKOKKOS = S_(VECMPIKOKKOS) * KOKKOS = S_(VECKOKKOS) # <<<<<<<<<<<<<< * * class VecOption(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(VECKOKKOS); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KOKKOS, __pyx_t_7) < 0) __PYX_ERR(33, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":3 * # -------------------------------------------------------------------- * * class VecType(object): # <<<<<<<<<<<<<< * SEQ = S_(VECSEQ) * MPI = S_(VECMPI) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_VecType, __pyx_tuple__96, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VecType, __pyx_t_7) < 0) __PYX_ERR(33, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Vec.pyx":19 * KOKKOS = S_(VECKOKKOS) * * class VecOption(object): # <<<<<<<<<<<<<< * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES * IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__97); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__97, __pyx_n_s_VecOption, __pyx_n_s_VecOption, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Vec.pyx":20 * * class VecOption(object): * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES * */ __pyx_t_7 = __Pyx_PyInt_From_VecOption(VEC_IGNORE_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IGNORE_OFF_PROC_ENTRIES, __pyx_t_7) < 0) __PYX_ERR(33, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":21 * class VecOption(object): * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES * IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_VecOption(VEC_IGNORE_NEGATIVE_INDICES); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IGNORE_NEGATIVE_INDICES, __pyx_t_7) < 0) __PYX_ERR(33, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Vec.pyx":19 * KOKKOS = S_(VECKOKKOS) * * class VecOption(object): # <<<<<<<<<<<<<< * IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES * IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_VecOption, __pyx_tuple__97, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_VecOption, __pyx_t_7) < 0) __PYX_ERR(33, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Vec.pyx":27 * cdef class Vec(Object): * * Type = VecType # <<<<<<<<<<<<<< * Option = VecOption * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_VecType); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(33, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Vec); /* "PETSc/Vec.pyx":28 * * Type = VecType * Option = VecOption # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_VecOption); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Vec->tp_dict, __pyx_n_s_Option, __pyx_t_3) < 0) __PYX_ERR(33, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Vec); /* "PETSc/Vec.pyx":1252 * # -------------------------------------------------------------------- * * del VecType # <<<<<<<<<<<<<< * del VecOption * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_VecType) < 0) __PYX_ERR(33, 1252, __pyx_L1_error) /* "PETSc/Vec.pyx":1253 * * del VecType * del VecOption # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_VecOption) < 0) __PYX_ERR(33, 1253, __pyx_L1_error) /* "PETSc/FE.pyx":3 * # -------------------------------------------------------------------- * * class FEType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__98); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__98, __pyx_n_s_FEType, __pyx_n_s_FEType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/FE.pyx":4 * * class FEType(object): * BASIC = S_(PETSCFEBASIC) # <<<<<<<<<<<<<< * OPENCL = S_(PETSCFEOPENCL) * COMPOSITE = S_(PETSCFECOMPOSITE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFEBASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(35, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(35, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/FE.pyx":5 * class FEType(object): * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) # <<<<<<<<<<<<<< * COMPOSITE = S_(PETSCFECOMPOSITE) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFEOPENCL); if (unlikely(!__pyx_t_7)) __PYX_ERR(35, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_OPENCL, __pyx_t_7) < 0) __PYX_ERR(35, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/FE.pyx":6 * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) * COMPOSITE = S_(PETSCFECOMPOSITE) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFECOMPOSITE); if (unlikely(!__pyx_t_7)) __PYX_ERR(35, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COMPOSITE, __pyx_t_7) < 0) __PYX_ERR(35, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/FE.pyx":3 * # -------------------------------------------------------------------- * * class FEType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCFEBASIC) * OPENCL = S_(PETSCFEOPENCL) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_FEType, __pyx_tuple__98, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(35, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_FEType, __pyx_t_7) < 0) __PYX_ERR(35, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/FE.pyx":12 * cdef class FE(Object): * * Type = FEType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FEType); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_FE->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(35, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_FE); /* "PETSc/FE.pyx":69 * # -------------------------------------------------------------------- * * del FEType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_FEType) < 0) __PYX_ERR(35, 69, __pyx_L1_error) /* "PETSc/Scatter.pyx":3 * # -------------------------------------------------------------------- * * class ScatterType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__99); if (unlikely(!__pyx_t_3)) __PYX_ERR(36, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__99, __pyx_n_s_ScatterType, __pyx_n_s_ScatterType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Scatter.pyx":4 * * class ScatterType(object): * BASIC = S_(PETSCSFBASIC) # <<<<<<<<<<<<<< * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFBASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(36, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":5 * class ScatterType(object): * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) # <<<<<<<<<<<<<< * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFNEIGHBOR); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEIGHBOR, __pyx_t_7) < 0) __PYX_ERR(36, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":6 * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) # <<<<<<<<<<<<<< * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHERV); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALLGATHERV, __pyx_t_7) < 0) __PYX_ERR(36, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":7 * NEIGHBOR = S_(PETSCSFNEIGHBOR) * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) # <<<<<<<<<<<<<< * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHER); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALLGATHER, __pyx_t_7) < 0) __PYX_ERR(36, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":8 * ALLGATHERV = S_(PETSCSFALLGATHERV) * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) # <<<<<<<<<<<<<< * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHERV); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GATHERV, __pyx_t_7) < 0) __PYX_ERR(36, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":9 * ALLGATHER = S_(PETSCSFALLGATHER) * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) # <<<<<<<<<<<<<< * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHER); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GATHER, __pyx_t_7) < 0) __PYX_ERR(36, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":10 * GATHERV = S_(PETSCSFGATHERV) * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) # <<<<<<<<<<<<<< * WINDOW = S_(PETSCSFWINDOW) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLTOALL); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALLTOALL, __pyx_t_7) < 0) __PYX_ERR(36, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":11 * GATHER = S_(PETSCSFGATHER) * ALLTOALL = S_(PETSCSFALLTOALL) * WINDOW = S_(PETSCSFWINDOW) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFWINDOW); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_WINDOW, __pyx_t_7) < 0) __PYX_ERR(36, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Scatter.pyx":3 * # -------------------------------------------------------------------- * * class ScatterType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCSFBASIC) * NEIGHBOR = S_(PETSCSFNEIGHBOR) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_ScatterType, __pyx_tuple__99, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(36, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ScatterType, __pyx_t_7) < 0) __PYX_ERR(36, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Scatter.pyx":17 * cdef class Scatter(Object): * * Type = ScatterType # <<<<<<<<<<<<<< * Mode = ScatterMode * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ScatterType); if (unlikely(!__pyx_t_3)) __PYX_ERR(36, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(36, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "PETSc/Scatter.pyx":18 * * Type = ScatterType * Mode = ScatterMode # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ScatterMode); if (unlikely(!__pyx_t_3)) __PYX_ERR(36, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_dict, __pyx_n_s_Mode, __pyx_t_3) < 0) __PYX_ERR(36, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "PETSc/Scatter.pyx":74 * * @classmethod * def toAll(cls, Vec vec): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_toAll); if (unlikely(!__pyx_t_3)) __PYX_ERR(36, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/Scatter.pyx":73 * return scatter * * @classmethod # <<<<<<<<<<<<<< * def toAll(cls, Vec vec): * cdef Scatter scatter = Scatter() */ __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_dict, __pyx_n_s_toAll, __pyx_t_1) < 0) __PYX_ERR(36, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "PETSc/Scatter.pyx":82 * * @classmethod * def toZero(cls, Vec vec): # <<<<<<<<<<<<<< * cdef Scatter scatter = Scatter() * cdef Vec ovec = Vec() */ __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_n_s_toZero); if (unlikely(!__pyx_t_1)) __PYX_ERR(36, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Scatter.pyx":81 * return (scatter, ovec) * * @classmethod # <<<<<<<<<<<<<< * def toZero(cls, Vec vec): * cdef Scatter scatter = Scatter() */ __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(36, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_dict, __pyx_n_s_toZero, __pyx_t_3) < 0) __PYX_ERR(36, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Scatter); /* "PETSc/Scatter.pyx":126 * # -------------------------------------------------------------------- * * del ScatterType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_ScatterType) < 0) __PYX_ERR(36, 126, __pyx_L1_error) /* "PETSc/Mat.pyx":3 * # -------------------------------------------------------------------- * * class MatType(object): # <<<<<<<<<<<<<< * SAME = S_(MATSAME) * MAIJ = S_(MATMAIJ) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__100); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__100, __pyx_n_s_MatType, __pyx_n_s_MatType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":4 * * class MatType(object): * SAME = S_(MATSAME) # <<<<<<<<<<<<<< * MAIJ = S_(MATMAIJ) * SEQMAIJ = S_(MATSEQMAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSAME); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SAME, __pyx_t_7) < 0) __PYX_ERR(38, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":5 * class MatType(object): * SAME = S_(MATSAME) * MAIJ = S_(MATMAIJ) # <<<<<<<<<<<<<< * SEQMAIJ = S_(MATSEQMAIJ) * MPIMAIJ = S_(MATMPIMAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":6 * SAME = S_(MATSAME) * MAIJ = S_(MATMAIJ) * SEQMAIJ = S_(MATSEQMAIJ) # <<<<<<<<<<<<<< * MPIMAIJ = S_(MATMPIMAIJ) * KAIJ = S_(MATKAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQMAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQMAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":7 * MAIJ = S_(MATMAIJ) * SEQMAIJ = S_(MATSEQMAIJ) * MPIMAIJ = S_(MATMPIMAIJ) # <<<<<<<<<<<<<< * KAIJ = S_(MATKAIJ) * SEQKAIJ = S_(MATSEQKAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIMAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIMAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":8 * SEQMAIJ = S_(MATSEQMAIJ) * MPIMAIJ = S_(MATMPIMAIJ) * KAIJ = S_(MATKAIJ) # <<<<<<<<<<<<<< * SEQKAIJ = S_(MATSEQKAIJ) * MPIKAIJ = S_(MATMPIKAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATKAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":9 * MPIMAIJ = S_(MATMPIMAIJ) * KAIJ = S_(MATKAIJ) * SEQKAIJ = S_(MATSEQKAIJ) # <<<<<<<<<<<<<< * MPIKAIJ = S_(MATMPIKAIJ) * IS = S_(MATIS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQKAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQKAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":10 * KAIJ = S_(MATKAIJ) * SEQKAIJ = S_(MATSEQKAIJ) * MPIKAIJ = S_(MATMPIKAIJ) # <<<<<<<<<<<<<< * IS = S_(MATIS) * AIJ = S_(MATAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIKAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIKAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":11 * SEQKAIJ = S_(MATSEQKAIJ) * MPIKAIJ = S_(MATMPIKAIJ) * IS = S_(MATIS) # <<<<<<<<<<<<<< * AIJ = S_(MATAIJ) * SEQAIJ = S_(MATSEQAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATIS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IS, __pyx_t_7) < 0) __PYX_ERR(38, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":12 * MPIKAIJ = S_(MATMPIKAIJ) * IS = S_(MATIS) * AIJ = S_(MATAIJ) # <<<<<<<<<<<<<< * SEQAIJ = S_(MATSEQAIJ) * MPIAIJ = S_(MATMPIAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AIJ, __pyx_t_7) < 0) __PYX_ERR(38, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":13 * IS = S_(MATIS) * AIJ = S_(MATAIJ) * SEQAIJ = S_(MATSEQAIJ) # <<<<<<<<<<<<<< * MPIAIJ = S_(MATMPIAIJ) * AIJCRL = S_(MATAIJCRL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":14 * AIJ = S_(MATAIJ) * SEQAIJ = S_(MATSEQAIJ) * MPIAIJ = S_(MATMPIAIJ) # <<<<<<<<<<<<<< * AIJCRL = S_(MATAIJCRL) * SEQAIJCRL = S_(MATSEQAIJCRL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":15 * SEQAIJ = S_(MATSEQAIJ) * MPIAIJ = S_(MATMPIAIJ) * AIJCRL = S_(MATAIJCRL) # <<<<<<<<<<<<<< * SEQAIJCRL = S_(MATSEQAIJCRL) * MPIAIJCRL = S_(MATMPIAIJCRL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJCRL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AIJCRL, __pyx_t_7) < 0) __PYX_ERR(38, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":16 * MPIAIJ = S_(MATMPIAIJ) * AIJCRL = S_(MATAIJCRL) * SEQAIJCRL = S_(MATSEQAIJCRL) # <<<<<<<<<<<<<< * MPIAIJCRL = S_(MATMPIAIJCRL) * AIJCUSPARSE = S_(MATAIJCUSPARSE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJCRL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQAIJCRL, __pyx_t_7) < 0) __PYX_ERR(38, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":17 * AIJCRL = S_(MATAIJCRL) * SEQAIJCRL = S_(MATSEQAIJCRL) * MPIAIJCRL = S_(MATMPIAIJCRL) # <<<<<<<<<<<<<< * AIJCUSPARSE = S_(MATAIJCUSPARSE) * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJCRL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIAIJCRL, __pyx_t_7) < 0) __PYX_ERR(38, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":18 * SEQAIJCRL = S_(MATSEQAIJCRL) * MPIAIJCRL = S_(MATMPIAIJCRL) * AIJCUSPARSE = S_(MATAIJCUSPARSE) # <<<<<<<<<<<<<< * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJCUSPARSE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AIJCUSPARSE, __pyx_t_7) < 0) __PYX_ERR(38, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":19 * MPIAIJCRL = S_(MATMPIAIJCRL) * AIJCUSPARSE = S_(MATAIJCUSPARSE) * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) # <<<<<<<<<<<<<< * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) * AIJVIENNACL = S_(MATAIJVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJCUSPARSE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQAIJCUSPARSE, __pyx_t_7) < 0) __PYX_ERR(38, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":20 * AIJCUSPARSE = S_(MATAIJCUSPARSE) * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) # <<<<<<<<<<<<<< * AIJVIENNACL = S_(MATAIJVIENNACL) * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJCUSPARSE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIAIJCUSPARSE, __pyx_t_7) < 0) __PYX_ERR(38, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":21 * SEQAIJCUSPARSE = S_(MATSEQAIJCUSPARSE) * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) * AIJVIENNACL = S_(MATAIJVIENNACL) # <<<<<<<<<<<<<< * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AIJVIENNACL, __pyx_t_7) < 0) __PYX_ERR(38, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":22 * MPIAIJCUSPARSE = S_(MATMPIAIJCUSPARSE) * AIJVIENNACL = S_(MATAIJVIENNACL) * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) # <<<<<<<<<<<<<< * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) * AIJPERM = S_(MATAIJPERM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQAIJVIENNACL, __pyx_t_7) < 0) __PYX_ERR(38, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":23 * AIJVIENNACL = S_(MATAIJVIENNACL) * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) # <<<<<<<<<<<<<< * AIJPERM = S_(MATAIJPERM) * SEQAIJPERM = S_(MATSEQAIJPERM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIAIJVIENNACL, __pyx_t_7) < 0) __PYX_ERR(38, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":24 * SEQAIJVIENNACL = S_(MATSEQAIJVIENNACL) * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) * AIJPERM = S_(MATAIJPERM) # <<<<<<<<<<<<<< * SEQAIJPERM = S_(MATSEQAIJPERM) * MPIAIJPERM = S_(MATMPIAIJPERM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJPERM); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AIJPERM, __pyx_t_7) < 0) __PYX_ERR(38, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":25 * MPIAIJVIENNACL = S_(MATMPIAIJVIENNACL) * AIJPERM = S_(MATAIJPERM) * SEQAIJPERM = S_(MATSEQAIJPERM) # <<<<<<<<<<<<<< * MPIAIJPERM = S_(MATMPIAIJPERM) * AIJSELL = S_(MATAIJSELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJPERM); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQAIJPERM, __pyx_t_7) < 0) __PYX_ERR(38, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":26 * AIJPERM = S_(MATAIJPERM) * SEQAIJPERM = S_(MATSEQAIJPERM) * MPIAIJPERM = S_(MATMPIAIJPERM) # <<<<<<<<<<<<<< * AIJSELL = S_(MATAIJSELL) * SEQAIJSELL = S_(MATSEQAIJSELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJPERM); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIAIJPERM, __pyx_t_7) < 0) __PYX_ERR(38, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":27 * SEQAIJPERM = S_(MATSEQAIJPERM) * MPIAIJPERM = S_(MATMPIAIJPERM) * AIJSELL = S_(MATAIJSELL) # <<<<<<<<<<<<<< * SEQAIJSELL = S_(MATSEQAIJSELL) * MPIAIJSELL = S_(MATMPIAIJSELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJSELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AIJSELL, __pyx_t_7) < 0) __PYX_ERR(38, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":28 * MPIAIJPERM = S_(MATMPIAIJPERM) * AIJSELL = S_(MATAIJSELL) * SEQAIJSELL = S_(MATSEQAIJSELL) # <<<<<<<<<<<<<< * MPIAIJSELL = S_(MATMPIAIJSELL) * AIJMKL = S_(MATAIJMKL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJSELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQAIJSELL, __pyx_t_7) < 0) __PYX_ERR(38, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":29 * AIJSELL = S_(MATAIJSELL) * SEQAIJSELL = S_(MATSEQAIJSELL) * MPIAIJSELL = S_(MATMPIAIJSELL) # <<<<<<<<<<<<<< * AIJMKL = S_(MATAIJMKL) * SEQAIJMKL = S_(MATSEQAIJMKL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJSELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIAIJSELL, __pyx_t_7) < 0) __PYX_ERR(38, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":30 * SEQAIJSELL = S_(MATSEQAIJSELL) * MPIAIJSELL = S_(MATMPIAIJSELL) * AIJMKL = S_(MATAIJMKL) # <<<<<<<<<<<<<< * SEQAIJMKL = S_(MATSEQAIJMKL) * MPIAIJMKL = S_(MATMPIAIJMKL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJMKL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AIJMKL, __pyx_t_7) < 0) __PYX_ERR(38, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":31 * MPIAIJSELL = S_(MATMPIAIJSELL) * AIJMKL = S_(MATAIJMKL) * SEQAIJMKL = S_(MATSEQAIJMKL) # <<<<<<<<<<<<<< * MPIAIJMKL = S_(MATMPIAIJMKL) * BAIJMKL = S_(MATBAIJMKL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJMKL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQAIJMKL, __pyx_t_7) < 0) __PYX_ERR(38, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":32 * AIJMKL = S_(MATAIJMKL) * SEQAIJMKL = S_(MATSEQAIJMKL) * MPIAIJMKL = S_(MATMPIAIJMKL) # <<<<<<<<<<<<<< * BAIJMKL = S_(MATBAIJMKL) * SEQBAIJMKL = S_(MATSEQBAIJMKL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJMKL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIAIJMKL, __pyx_t_7) < 0) __PYX_ERR(38, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":33 * SEQAIJMKL = S_(MATSEQAIJMKL) * MPIAIJMKL = S_(MATMPIAIJMKL) * BAIJMKL = S_(MATBAIJMKL) # <<<<<<<<<<<<<< * SEQBAIJMKL = S_(MATSEQBAIJMKL) * MPIBAIJMKL = S_(MATMPIBAIJMKL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATBAIJMKL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BAIJMKL, __pyx_t_7) < 0) __PYX_ERR(38, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":34 * MPIAIJMKL = S_(MATMPIAIJMKL) * BAIJMKL = S_(MATBAIJMKL) * SEQBAIJMKL = S_(MATSEQBAIJMKL) # <<<<<<<<<<<<<< * MPIBAIJMKL = S_(MATMPIBAIJMKL) * SHELL = S_(MATSHELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQBAIJMKL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQBAIJMKL, __pyx_t_7) < 0) __PYX_ERR(38, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":35 * BAIJMKL = S_(MATBAIJMKL) * SEQBAIJMKL = S_(MATSEQBAIJMKL) * MPIBAIJMKL = S_(MATMPIBAIJMKL) # <<<<<<<<<<<<<< * SHELL = S_(MATSHELL) * DENSE = S_(MATDENSE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIBAIJMKL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIBAIJMKL, __pyx_t_7) < 0) __PYX_ERR(38, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":36 * SEQBAIJMKL = S_(MATSEQBAIJMKL) * MPIBAIJMKL = S_(MATMPIBAIJMKL) * SHELL = S_(MATSHELL) # <<<<<<<<<<<<<< * DENSE = S_(MATDENSE) * SEQDENSE = S_(MATSEQDENSE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSHELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SHELL, __pyx_t_7) < 0) __PYX_ERR(38, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":37 * MPIBAIJMKL = S_(MATMPIBAIJMKL) * SHELL = S_(MATSHELL) * DENSE = S_(MATDENSE) # <<<<<<<<<<<<<< * SEQDENSE = S_(MATSEQDENSE) * SEQDENSECUDA = S_(MATSEQDENSECUDA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATDENSE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DENSE, __pyx_t_7) < 0) __PYX_ERR(38, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":38 * SHELL = S_(MATSHELL) * DENSE = S_(MATDENSE) * SEQDENSE = S_(MATSEQDENSE) # <<<<<<<<<<<<<< * SEQDENSECUDA = S_(MATSEQDENSECUDA) * MPIDENSE = S_(MATMPIDENSE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQDENSE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQDENSE, __pyx_t_7) < 0) __PYX_ERR(38, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":39 * DENSE = S_(MATDENSE) * SEQDENSE = S_(MATSEQDENSE) * SEQDENSECUDA = S_(MATSEQDENSECUDA) # <<<<<<<<<<<<<< * MPIDENSE = S_(MATMPIDENSE) * ELEMENTAL = S_(MATELEMENTAL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQDENSECUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQDENSECUDA, __pyx_t_7) < 0) __PYX_ERR(38, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":40 * SEQDENSE = S_(MATSEQDENSE) * SEQDENSECUDA = S_(MATSEQDENSECUDA) * MPIDENSE = S_(MATMPIDENSE) # <<<<<<<<<<<<<< * ELEMENTAL = S_(MATELEMENTAL) * BAIJ = S_(MATBAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIDENSE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIDENSE, __pyx_t_7) < 0) __PYX_ERR(38, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":41 * SEQDENSECUDA = S_(MATSEQDENSECUDA) * MPIDENSE = S_(MATMPIDENSE) * ELEMENTAL = S_(MATELEMENTAL) # <<<<<<<<<<<<<< * BAIJ = S_(MATBAIJ) * SEQBAIJ = S_(MATSEQBAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATELEMENTAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ELEMENTAL, __pyx_t_7) < 0) __PYX_ERR(38, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":42 * MPIDENSE = S_(MATMPIDENSE) * ELEMENTAL = S_(MATELEMENTAL) * BAIJ = S_(MATBAIJ) # <<<<<<<<<<<<<< * SEQBAIJ = S_(MATSEQBAIJ) * MPIBAIJ = S_(MATMPIBAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATBAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":43 * ELEMENTAL = S_(MATELEMENTAL) * BAIJ = S_(MATBAIJ) * SEQBAIJ = S_(MATSEQBAIJ) # <<<<<<<<<<<<<< * MPIBAIJ = S_(MATMPIBAIJ) * MPIADJ = S_(MATMPIADJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQBAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQBAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":44 * BAIJ = S_(MATBAIJ) * SEQBAIJ = S_(MATSEQBAIJ) * MPIBAIJ = S_(MATMPIBAIJ) # <<<<<<<<<<<<<< * MPIADJ = S_(MATMPIADJ) * SBAIJ = S_(MATSBAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIBAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIBAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":45 * SEQBAIJ = S_(MATSEQBAIJ) * MPIBAIJ = S_(MATMPIBAIJ) * MPIADJ = S_(MATMPIADJ) # <<<<<<<<<<<<<< * SBAIJ = S_(MATSBAIJ) * SEQSBAIJ = S_(MATSEQSBAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIADJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPIADJ, __pyx_t_7) < 0) __PYX_ERR(38, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":46 * MPIBAIJ = S_(MATMPIBAIJ) * MPIADJ = S_(MATMPIADJ) * SBAIJ = S_(MATSBAIJ) # <<<<<<<<<<<<<< * SEQSBAIJ = S_(MATSEQSBAIJ) * MPISBAIJ = S_(MATMPISBAIJ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSBAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SBAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":47 * MPIADJ = S_(MATMPIADJ) * SBAIJ = S_(MATSBAIJ) * SEQSBAIJ = S_(MATSEQSBAIJ) # <<<<<<<<<<<<<< * MPISBAIJ = S_(MATMPISBAIJ) * MFFD = S_(MATMFFD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQSBAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQSBAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":48 * SBAIJ = S_(MATSBAIJ) * SEQSBAIJ = S_(MATSEQSBAIJ) * MPISBAIJ = S_(MATMPISBAIJ) # <<<<<<<<<<<<<< * MFFD = S_(MATMFFD) * NORMAL = S_(MATNORMAL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPISBAIJ); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPISBAIJ, __pyx_t_7) < 0) __PYX_ERR(38, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":49 * SEQSBAIJ = S_(MATSEQSBAIJ) * MPISBAIJ = S_(MATMPISBAIJ) * MFFD = S_(MATMFFD) # <<<<<<<<<<<<<< * NORMAL = S_(MATNORMAL) * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMFFD); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MFFD, __pyx_t_7) < 0) __PYX_ERR(38, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":50 * MPISBAIJ = S_(MATMPISBAIJ) * MFFD = S_(MATMFFD) * NORMAL = S_(MATNORMAL) # <<<<<<<<<<<<<< * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) * LRC = S_(MATLRC) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATNORMAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORMAL, __pyx_t_7) < 0) __PYX_ERR(38, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":51 * MFFD = S_(MATMFFD) * NORMAL = S_(MATNORMAL) * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) # <<<<<<<<<<<<<< * LRC = S_(MATLRC) * SCATTER = S_(MATSCATTER) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATNORMALHERMITIAN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORMALHERMITIAN, __pyx_t_7) < 0) __PYX_ERR(38, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":52 * NORMAL = S_(MATNORMAL) * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) * LRC = S_(MATLRC) # <<<<<<<<<<<<<< * SCATTER = S_(MATSCATTER) * BLOCKMAT = S_(MATBLOCKMAT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLRC); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LRC, __pyx_t_7) < 0) __PYX_ERR(38, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":53 * NORMALHERMITIAN = S_(MATNORMALHERMITIAN) * LRC = S_(MATLRC) * SCATTER = S_(MATSCATTER) # <<<<<<<<<<<<<< * BLOCKMAT = S_(MATBLOCKMAT) * COMPOSITE = S_(MATCOMPOSITE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSCATTER); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SCATTER, __pyx_t_7) < 0) __PYX_ERR(38, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":54 * LRC = S_(MATLRC) * SCATTER = S_(MATSCATTER) * BLOCKMAT = S_(MATBLOCKMAT) # <<<<<<<<<<<<<< * COMPOSITE = S_(MATCOMPOSITE) * FFT = S_(MATFFT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATBLOCKMAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BLOCKMAT, __pyx_t_7) < 0) __PYX_ERR(38, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":55 * SCATTER = S_(MATSCATTER) * BLOCKMAT = S_(MATBLOCKMAT) * COMPOSITE = S_(MATCOMPOSITE) # <<<<<<<<<<<<<< * FFT = S_(MATFFT) * FFTW = S_(MATFFTW) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATCOMPOSITE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COMPOSITE, __pyx_t_7) < 0) __PYX_ERR(38, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":56 * BLOCKMAT = S_(MATBLOCKMAT) * COMPOSITE = S_(MATCOMPOSITE) * FFT = S_(MATFFT) # <<<<<<<<<<<<<< * FFTW = S_(MATFFTW) * SEQCUFFT = S_(MATSEQCUFFT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATFFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FFT, __pyx_t_7) < 0) __PYX_ERR(38, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":57 * COMPOSITE = S_(MATCOMPOSITE) * FFT = S_(MATFFT) * FFTW = S_(MATFFTW) # <<<<<<<<<<<<<< * SEQCUFFT = S_(MATSEQCUFFT) * TRANSPOSEMAT = S_(MATTRANSPOSEMAT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATFFTW); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FFTW, __pyx_t_7) < 0) __PYX_ERR(38, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":58 * FFT = S_(MATFFT) * FFTW = S_(MATFFTW) * SEQCUFFT = S_(MATSEQCUFFT) # <<<<<<<<<<<<<< * TRANSPOSEMAT = S_(MATTRANSPOSEMAT) * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQCUFFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQCUFFT, __pyx_t_7) < 0) __PYX_ERR(38, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":59 * FFTW = S_(MATFFTW) * SEQCUFFT = S_(MATSEQCUFFT) * TRANSPOSEMAT = S_(MATTRANSPOSEMAT) # <<<<<<<<<<<<<< * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) * PYTHON = S_(MATPYTHON) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATTRANSPOSEMAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TRANSPOSEMAT, __pyx_t_7) < 0) __PYX_ERR(38, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":60 * SEQCUFFT = S_(MATSEQCUFFT) * TRANSPOSEMAT = S_(MATTRANSPOSEMAT) * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) # <<<<<<<<<<<<<< * PYTHON = S_(MATPYTHON) * HYPRE = S_(MATHYPRE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSCHURCOMPLEMENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SCHURCOMPLEMENT, __pyx_t_7) < 0) __PYX_ERR(38, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":61 * TRANSPOSEMAT = S_(MATTRANSPOSEMAT) * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) * PYTHON = S_(MATPYTHON) # <<<<<<<<<<<<<< * HYPRE = S_(MATHYPRE) * HYPRESTRUCT = S_(MATHYPRESTRUCT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATPYTHON); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PYTHON, __pyx_t_7) < 0) __PYX_ERR(38, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":62 * SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT) * PYTHON = S_(MATPYTHON) * HYPRE = S_(MATHYPRE) # <<<<<<<<<<<<<< * HYPRESTRUCT = S_(MATHYPRESTRUCT) * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HYPRE, __pyx_t_7) < 0) __PYX_ERR(38, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":63 * PYTHON = S_(MATPYTHON) * HYPRE = S_(MATHYPRE) * HYPRESTRUCT = S_(MATHYPRESTRUCT) # <<<<<<<<<<<<<< * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) * SUBMATRIX = S_(MATSUBMATRIX) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRESTRUCT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HYPRESTRUCT, __pyx_t_7) < 0) __PYX_ERR(38, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":64 * HYPRE = S_(MATHYPRE) * HYPRESTRUCT = S_(MATHYPRESTRUCT) * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) # <<<<<<<<<<<<<< * SUBMATRIX = S_(MATSUBMATRIX) * LOCALREF = S_(MATLOCALREF) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRESSTRUCT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HYPRESSTRUCT, __pyx_t_7) < 0) __PYX_ERR(38, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":65 * HYPRESTRUCT = S_(MATHYPRESTRUCT) * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) * SUBMATRIX = S_(MATSUBMATRIX) # <<<<<<<<<<<<<< * LOCALREF = S_(MATLOCALREF) * NEST = S_(MATNEST) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSUBMATRIX); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUBMATRIX, __pyx_t_7) < 0) __PYX_ERR(38, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":66 * HYPRESSTRUCT = S_(MATHYPRESSTRUCT) * SUBMATRIX = S_(MATSUBMATRIX) * LOCALREF = S_(MATLOCALREF) # <<<<<<<<<<<<<< * NEST = S_(MATNEST) * PREALLOCATOR = S_(MATPREALLOCATOR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLOCALREF); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LOCALREF, __pyx_t_7) < 0) __PYX_ERR(38, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":67 * SUBMATRIX = S_(MATSUBMATRIX) * LOCALREF = S_(MATLOCALREF) * NEST = S_(MATNEST) # <<<<<<<<<<<<<< * PREALLOCATOR = S_(MATPREALLOCATOR) * SELL = S_(MATSELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATNEST); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEST, __pyx_t_7) < 0) __PYX_ERR(38, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":68 * LOCALREF = S_(MATLOCALREF) * NEST = S_(MATNEST) * PREALLOCATOR = S_(MATPREALLOCATOR) # <<<<<<<<<<<<<< * SELL = S_(MATSELL) * SEQSELL = S_(MATSEQSELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATPREALLOCATOR); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PREALLOCATOR, __pyx_t_7) < 0) __PYX_ERR(38, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":69 * NEST = S_(MATNEST) * PREALLOCATOR = S_(MATPREALLOCATOR) * SELL = S_(MATSELL) # <<<<<<<<<<<<<< * SEQSELL = S_(MATSEQSELL) * MPISELL = S_(MATMPISELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SELL, __pyx_t_7) < 0) __PYX_ERR(38, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":70 * PREALLOCATOR = S_(MATPREALLOCATOR) * SELL = S_(MATSELL) * SEQSELL = S_(MATSEQSELL) # <<<<<<<<<<<<<< * MPISELL = S_(MATMPISELL) * DUMMY = S_(MATDUMMY) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQSELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SEQSELL, __pyx_t_7) < 0) __PYX_ERR(38, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":71 * SELL = S_(MATSELL) * SEQSELL = S_(MATSEQSELL) * MPISELL = S_(MATMPISELL) # <<<<<<<<<<<<<< * DUMMY = S_(MATDUMMY) * LMVM = S_(MATLMVM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATMPISELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPISELL, __pyx_t_7) < 0) __PYX_ERR(38, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":72 * SEQSELL = S_(MATSEQSELL) * MPISELL = S_(MATMPISELL) * DUMMY = S_(MATDUMMY) # <<<<<<<<<<<<<< * LMVM = S_(MATLMVM) * LMVMDFP = S_(MATLMVMDFP) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATDUMMY); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DUMMY, __pyx_t_7) < 0) __PYX_ERR(38, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":73 * MPISELL = S_(MATMPISELL) * DUMMY = S_(MATDUMMY) * LMVM = S_(MATLMVM) # <<<<<<<<<<<<<< * LMVMDFP = S_(MATLMVMDFP) * LMVMBFGS = S_(MATLMVMBFGS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVM); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVM, __pyx_t_7) < 0) __PYX_ERR(38, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":74 * DUMMY = S_(MATDUMMY) * LMVM = S_(MATLMVM) * LMVMDFP = S_(MATLMVMDFP) # <<<<<<<<<<<<<< * LMVMBFGS = S_(MATLMVMBFGS) * LMVMSR1 = S_(MATLMVMSR1) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDFP); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMDFP, __pyx_t_7) < 0) __PYX_ERR(38, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":75 * LMVM = S_(MATLMVM) * LMVMDFP = S_(MATLMVMDFP) * LMVMBFGS = S_(MATLMVMBFGS) # <<<<<<<<<<<<<< * LMVMSR1 = S_(MATLMVMSR1) * LMVMBROYDEN = S_(MATLMVMBROYDEN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBFGS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMBFGS, __pyx_t_7) < 0) __PYX_ERR(38, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":76 * LMVMDFP = S_(MATLMVMDFP) * LMVMBFGS = S_(MATLMVMBFGS) * LMVMSR1 = S_(MATLMVMSR1) # <<<<<<<<<<<<<< * LMVMBROYDEN = S_(MATLMVMBROYDEN) * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSR1); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMSR1, __pyx_t_7) < 0) __PYX_ERR(38, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":77 * LMVMBFGS = S_(MATLMVMBFGS) * LMVMSR1 = S_(MATLMVMSR1) * LMVMBROYDEN = S_(MATLMVMBROYDEN) # <<<<<<<<<<<<<< * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBROYDEN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMBROYDEN, __pyx_t_7) < 0) __PYX_ERR(38, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":78 * LMVMSR1 = S_(MATLMVMSR1) * LMVMBROYDEN = S_(MATLMVMBROYDEN) * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) # <<<<<<<<<<<<<< * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBADBROYDEN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMBADBROYDEN, __pyx_t_7) < 0) __PYX_ERR(38, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":79 * LMVMBROYDEN = S_(MATLMVMBROYDEN) * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) # <<<<<<<<<<<<<< * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSYMBROYDEN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMSYMBROYDEN, __pyx_t_7) < 0) __PYX_ERR(38, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":80 * LMVMBADBROYDEN = S_(MATLMVMBADBROYDEN) * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) # <<<<<<<<<<<<<< * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSYMBADBROYDEN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMSYMBADBROYDEN, __pyx_t_7) < 0) __PYX_ERR(38, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":81 * LMVMSYMBROYDEN = S_(MATLMVMSYMBROYDEN) * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) # <<<<<<<<<<<<<< * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) * HARA = S_(MATHARA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDIAGBROYDEN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVMDIAGBBROYDEN, __pyx_t_7) < 0) __PYX_ERR(38, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":82 * LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN) * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) # <<<<<<<<<<<<<< * HARA = S_(MATHARA) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATCONSTANTDIAGONAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONSTANTDIAGONAL, __pyx_t_7) < 0) __PYX_ERR(38, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":83 * LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN) * CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL) * HARA = S_(MATHARA) # <<<<<<<<<<<<<< * * class MatOption(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATHARA); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HARA, __pyx_t_7) < 0) __PYX_ERR(38, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":3 * # -------------------------------------------------------------------- * * class MatType(object): # <<<<<<<<<<<<<< * SAME = S_(MATSAME) * MAIJ = S_(MATMAIJ) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatType, __pyx_tuple__100, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatType, __pyx_t_7) < 0) __PYX_ERR(38, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":85 * HARA = S_(MATHARA) * * class MatOption(object): # <<<<<<<<<<<<<< * OPTION_MIN = MAT_OPTION_MIN * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__101); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__101, __pyx_n_s_MatOption, __pyx_n_s_MatOption, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":86 * * class MatOption(object): * OPTION_MIN = MAT_OPTION_MIN # <<<<<<<<<<<<<< * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR * ROW_ORIENTED = MAT_ROW_ORIENTED */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_OPTION_MIN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_OPTION_MIN, __pyx_t_7) < 0) __PYX_ERR(38, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":87 * class MatOption(object): * OPTION_MIN = MAT_OPTION_MIN * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR # <<<<<<<<<<<<<< * ROW_ORIENTED = MAT_ROW_ORIENTED * SYMMETRIC = MAT_SYMMETRIC */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_UNUSED_NONZERO_LOCATION_ERR); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UNUSED_NONZERO_LOCATION_ERR, __pyx_t_7) < 0) __PYX_ERR(38, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":88 * OPTION_MIN = MAT_OPTION_MIN * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR * ROW_ORIENTED = MAT_ROW_ORIENTED # <<<<<<<<<<<<<< * SYMMETRIC = MAT_SYMMETRIC * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_ROW_ORIENTED); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ROW_ORIENTED, __pyx_t_7) < 0) __PYX_ERR(38, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":89 * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR * ROW_ORIENTED = MAT_ROW_ORIENTED * SYMMETRIC = MAT_SYMMETRIC # <<<<<<<<<<<<<< * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_SYMMETRIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SYMMETRIC, __pyx_t_7) < 0) __PYX_ERR(38, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":90 * ROW_ORIENTED = MAT_ROW_ORIENTED * SYMMETRIC = MAT_SYMMETRIC * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC # <<<<<<<<<<<<<< * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_STRUCTURALLY_SYMMETRIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STRUCTURALLY_SYMMETRIC, __pyx_t_7) < 0) __PYX_ERR(38, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":91 * SYMMETRIC = MAT_SYMMETRIC * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES # <<<<<<<<<<<<<< * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES * USE_HASH_TABLE = MAT_USE_HASH_TABLE */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_FORCE_DIAGONAL_ENTRIES); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FORCE_DIAGONAL_ENTRIES, __pyx_t_7) < 0) __PYX_ERR(38, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":92 * STRUCTURALLY_SYMMETRIC = MAT_STRUCTURALLY_SYMMETRIC * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * USE_HASH_TABLE = MAT_USE_HASH_TABLE * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_IGNORE_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IGNORE_OFF_PROC_ENTRIES, __pyx_t_7) < 0) __PYX_ERR(38, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":93 * FORCE_DIAGONAL_ENTRIES = MAT_FORCE_DIAGONAL_ENTRIES * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES * USE_HASH_TABLE = MAT_USE_HASH_TABLE # <<<<<<<<<<<<<< * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_USE_HASH_TABLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_USE_HASH_TABLE, __pyx_t_7) < 0) __PYX_ERR(38, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":94 * IGNORE_OFF_PROC_ENTRIES = MAT_IGNORE_OFF_PROC_ENTRIES * USE_HASH_TABLE = MAT_USE_HASH_TABLE * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN # <<<<<<<<<<<<<< * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES * USE_INODES = MAT_USE_INODES */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_KEEP_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KEEP_NONZERO_PATTERN, __pyx_t_7) < 0) __PYX_ERR(38, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":95 * USE_HASH_TABLE = MAT_USE_HASH_TABLE * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES # <<<<<<<<<<<<<< * USE_INODES = MAT_USE_INODES * HERMITIAN = MAT_HERMITIAN */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_IGNORE_ZERO_ENTRIES); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IGNORE_ZERO_ENTRIES, __pyx_t_7) < 0) __PYX_ERR(38, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":96 * KEEP_NONZERO_PATTERN = MAT_KEEP_NONZERO_PATTERN * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES * USE_INODES = MAT_USE_INODES # <<<<<<<<<<<<<< * HERMITIAN = MAT_HERMITIAN * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_USE_INODES); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_USE_INODES, __pyx_t_7) < 0) __PYX_ERR(38, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":97 * IGNORE_ZERO_ENTRIES = MAT_IGNORE_ZERO_ENTRIES * USE_INODES = MAT_USE_INODES * HERMITIAN = MAT_HERMITIAN # <<<<<<<<<<<<<< * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_HERMITIAN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HERMITIAN, __pyx_t_7) < 0) __PYX_ERR(38, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":98 * USE_INODES = MAT_USE_INODES * HERMITIAN = MAT_HERMITIAN * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL # <<<<<<<<<<<<<< * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_SYMMETRY_ETERNAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SYMMETRY_ETERNAL, __pyx_t_7) < 0) __PYX_ERR(38, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":99 * HERMITIAN = MAT_HERMITIAN * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR # <<<<<<<<<<<<<< * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_NEW_NONZERO_LOCATION_ERR); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEW_NONZERO_LOCATION_ERR, __pyx_t_7) < 0) __PYX_ERR(38, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":100 * SYMMETRY_ETERNAL = MAT_SYMMETRY_ETERNAL * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR # <<<<<<<<<<<<<< * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_IGNORE_LOWER_TRIANGULAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IGNORE_LOWER_TRIANGULAR, __pyx_t_7) < 0) __PYX_ERR(38, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":101 * NEW_NONZERO_LOCATION_ERR = MAT_NEW_NONZERO_LOCATION_ERR * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR # <<<<<<<<<<<<<< * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR * SPD = MAT_SPD */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_ERROR_LOWER_TRIANGULAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ERROR_LOWER_TRIANGULAR, __pyx_t_7) < 0) __PYX_ERR(38, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":102 * IGNORE_LOWER_TRIANGULAR = MAT_IGNORE_LOWER_TRIANGULAR * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR # <<<<<<<<<<<<<< * SPD = MAT_SPD * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_GETROW_UPPERTRIANGULAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GETROW_UPPERTRIANGULAR, __pyx_t_7) < 0) __PYX_ERR(38, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":103 * ERROR_LOWER_TRIANGULAR = MAT_ERROR_LOWER_TRIANGULAR * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR * SPD = MAT_SPD # <<<<<<<<<<<<<< * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_SPD); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SPD, __pyx_t_7) < 0) __PYX_ERR(38, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":104 * GETROW_UPPERTRIANGULAR = MAT_GETROW_UPPERTRIANGULAR * SPD = MAT_SPD * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS # <<<<<<<<<<<<<< * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_NO_OFF_PROC_ZERO_ROWS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NO_OFF_PROC_ZERO_ROWS, __pyx_t_7) < 0) __PYX_ERR(38, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":105 * SPD = MAT_SPD * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_NO_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NO_OFF_PROC_ENTRIES, __pyx_t_7) < 0) __PYX_ERR(38, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":106 * NO_OFF_PROC_ZERO_ROWS = MAT_NO_OFF_PROC_ZERO_ROWS * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS # <<<<<<<<<<<<<< * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_NEW_NONZERO_LOCATIONS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEW_NONZERO_LOCATIONS, __pyx_t_7) < 0) __PYX_ERR(38, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":107 * NO_OFF_PROC_ENTRIES = MAT_NO_OFF_PROC_ENTRIES * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR # <<<<<<<<<<<<<< * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_NEW_NONZERO_ALLOCATION_ERR); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEW_NONZERO_ALLOCATION_ERR, __pyx_t_7) < 0) __PYX_ERR(38, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":108 * NEW_NONZERO_LOCATIONS = MAT_NEW_NONZERO_LOCATIONS * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES # <<<<<<<<<<<<<< * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_SUBSET_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUBSET_OFF_PROC_ENTRIES, __pyx_t_7) < 0) __PYX_ERR(38, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":109 * NEW_NONZERO_ALLOCATION_ERR = MAT_NEW_NONZERO_ALLOCATION_ERR * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS # <<<<<<<<<<<<<< * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY * SORTED_FULL = MAT_SORTED_FULL */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_SUBMAT_SINGLEIS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUBMAT_SINGLEIS, __pyx_t_7) < 0) __PYX_ERR(38, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":110 * SUBSET_OFF_PROC_ENTRIES = MAT_SUBSET_OFF_PROC_ENTRIES * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY # <<<<<<<<<<<<<< * SORTED_FULL = MAT_SORTED_FULL * OPTION_MAX = MAT_OPTION_MAX */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_STRUCTURE_ONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STRUCTURE_ONLY, __pyx_t_7) < 0) __PYX_ERR(38, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":111 * SUBMAT_SINGLEIS = MAT_SUBMAT_SINGLEIS * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY * SORTED_FULL = MAT_SORTED_FULL # <<<<<<<<<<<<<< * OPTION_MAX = MAT_OPTION_MAX * */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_SORTED_FULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SORTED_FULL, __pyx_t_7) < 0) __PYX_ERR(38, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":112 * STRUCTURE_ONLY = MAT_STRUCTURE_ONLY * SORTED_FULL = MAT_SORTED_FULL * OPTION_MAX = MAT_OPTION_MAX # <<<<<<<<<<<<<< * * class MatAssemblyType(object): */ __pyx_t_7 = __Pyx_PyInt_From_MatOption(MAT_OPTION_MAX); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_OPTION_MAX, __pyx_t_7) < 0) __PYX_ERR(38, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":85 * HARA = S_(MATHARA) * * class MatOption(object): # <<<<<<<<<<<<<< * OPTION_MIN = MAT_OPTION_MIN * UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatOption, __pyx_tuple__101, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatOption, __pyx_t_7) < 0) __PYX_ERR(38, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":114 * OPTION_MAX = MAT_OPTION_MAX * * class MatAssemblyType(object): # <<<<<<<<<<<<<< * # native * FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__102); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__102, __pyx_n_s_MatAssemblyType, __pyx_n_s_MatAssemblyType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":116 * class MatAssemblyType(object): * # native * FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY # <<<<<<<<<<<<<< * FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY * # aliases */ __pyx_t_7 = __Pyx_PyInt_From_MatAssemblyType(MAT_FINAL_ASSEMBLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FINAL_ASSEMBLY, __pyx_t_7) < 0) __PYX_ERR(38, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":117 * # native * FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY * FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY # <<<<<<<<<<<<<< * # aliases * FINAL = FINAL_ASSEMBLY */ __pyx_t_7 = __Pyx_PyInt_From_MatAssemblyType(MAT_FLUSH_ASSEMBLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FLUSH_ASSEMBLY, __pyx_t_7) < 0) __PYX_ERR(38, 117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":119 * FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY * # aliases * FINAL = FINAL_ASSEMBLY # <<<<<<<<<<<<<< * FLUSH = FLUSH_ASSEMBLY * */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_FINAL_ASSEMBLY); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FINAL_ASSEMBLY); } if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FINAL, __pyx_t_7) < 0) __PYX_ERR(38, 119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":120 * # aliases * FINAL = FINAL_ASSEMBLY * FLUSH = FLUSH_ASSEMBLY # <<<<<<<<<<<<<< * * class MatInfoType(object): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_FLUSH_ASSEMBLY); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_FLUSH_ASSEMBLY); } if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FLUSH, __pyx_t_7) < 0) __PYX_ERR(38, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":114 * OPTION_MAX = MAT_OPTION_MAX * * class MatAssemblyType(object): # <<<<<<<<<<<<<< * # native * FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatAssemblyType, __pyx_tuple__102, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatAssemblyType, __pyx_t_7) < 0) __PYX_ERR(38, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":122 * FLUSH = FLUSH_ASSEMBLY * * class MatInfoType(object): # <<<<<<<<<<<<<< * LOCAL = MAT_LOCAL * GLOBAL_MAX = MAT_GLOBAL_MAX */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__103); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__103, __pyx_n_s_MatInfoType, __pyx_n_s_MatInfoType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":123 * * class MatInfoType(object): * LOCAL = MAT_LOCAL # <<<<<<<<<<<<<< * GLOBAL_MAX = MAT_GLOBAL_MAX * GLOBAL_SUM = MAT_GLOBAL_SUM */ __pyx_t_7 = __Pyx_PyInt_From_MatInfoType(MAT_LOCAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LOCAL, __pyx_t_7) < 0) __PYX_ERR(38, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":124 * class MatInfoType(object): * LOCAL = MAT_LOCAL * GLOBAL_MAX = MAT_GLOBAL_MAX # <<<<<<<<<<<<<< * GLOBAL_SUM = MAT_GLOBAL_SUM * */ __pyx_t_7 = __Pyx_PyInt_From_MatInfoType(MAT_GLOBAL_MAX); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GLOBAL_MAX, __pyx_t_7) < 0) __PYX_ERR(38, 124, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":125 * LOCAL = MAT_LOCAL * GLOBAL_MAX = MAT_GLOBAL_MAX * GLOBAL_SUM = MAT_GLOBAL_SUM # <<<<<<<<<<<<<< * * class MatStructure(object): */ __pyx_t_7 = __Pyx_PyInt_From_MatInfoType(MAT_GLOBAL_SUM); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GLOBAL_SUM, __pyx_t_7) < 0) __PYX_ERR(38, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":122 * FLUSH = FLUSH_ASSEMBLY * * class MatInfoType(object): # <<<<<<<<<<<<<< * LOCAL = MAT_LOCAL * GLOBAL_MAX = MAT_GLOBAL_MAX */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatInfoType, __pyx_tuple__103, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatInfoType, __pyx_t_7) < 0) __PYX_ERR(38, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":127 * GLOBAL_SUM = MAT_GLOBAL_SUM * * class MatStructure(object): # <<<<<<<<<<<<<< * # native * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__104); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__104, __pyx_n_s_MatStructure, __pyx_n_s_MatStructure, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":129 * class MatStructure(object): * # native * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN # <<<<<<<<<<<<<< * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN */ __pyx_t_7 = __Pyx_PyInt_From_MatStructure(SAME_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SAME_NONZERO_PATTERN, __pyx_t_7) < 0) __PYX_ERR(38, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":130 * # native * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN */ __pyx_t_7 = __Pyx_PyInt_From_MatStructure(DIFFERENT_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIFFERENT_NONZERO_PATTERN, __pyx_t_7) < 0) __PYX_ERR(38, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":131 * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN # <<<<<<<<<<<<<< * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN * # aliases */ __pyx_t_7 = __Pyx_PyInt_From_MatStructure(SUBSET_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUBSET_NONZERO_PATTERN, __pyx_t_7) < 0) __PYX_ERR(38, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":132 * DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN * SUBSET_NONZERO_PATTERN = MAT_SUBSET_NONZERO_PATTERN * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN # <<<<<<<<<<<<<< * # aliases * SAME = SAME_NZ = SAME_NONZERO_PATTERN */ __pyx_t_7 = __Pyx_PyInt_From_MatStructure(UNKNOWN_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UNKNOWN_NONZERO_PATTERN, __pyx_t_7) < 0) __PYX_ERR(38, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":134 * UNKNOWN_NONZERO_PATTERN = MAT_UNKNOWN_NONZERO_PATTERN * # aliases * SAME = SAME_NZ = SAME_NONZERO_PATTERN # <<<<<<<<<<<<<< * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_SAME_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_SAME_NONZERO_PATTERN); } if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SAME, __pyx_t_7) < 0) __PYX_ERR(38, 134, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SAME_NZ, __pyx_t_7) < 0) __PYX_ERR(38, 134, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":135 * # aliases * SAME = SAME_NZ = SAME_NONZERO_PATTERN * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN # <<<<<<<<<<<<<< * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_SUBSET_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_SUBSET_NONZERO_PATTERN); } if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUBSET, __pyx_t_7) < 0) __PYX_ERR(38, 135, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUBSET_NZ, __pyx_t_7) < 0) __PYX_ERR(38, 135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":136 * SAME = SAME_NZ = SAME_NONZERO_PATTERN * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN # <<<<<<<<<<<<<< * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_DIFFERENT_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_DIFFERENT_NONZERO_PATTERN); } if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIFFERENT, __pyx_t_7) < 0) __PYX_ERR(38, 136, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIFFERENT_NZ, __pyx_t_7) < 0) __PYX_ERR(38, 136, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":137 * SUBSET = SUBSET_NZ = SUBSET_NONZERO_PATTERN * DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN # <<<<<<<<<<<<<< * * class MatOrderingType(object): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_UNKNOWN_NONZERO_PATTERN); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_UNKNOWN_NONZERO_PATTERN); } if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UNKNOWN, __pyx_t_7) < 0) __PYX_ERR(38, 137, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UNKNOWN_NZ, __pyx_t_7) < 0) __PYX_ERR(38, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":127 * GLOBAL_SUM = MAT_GLOBAL_SUM * * class MatStructure(object): # <<<<<<<<<<<<<< * # native * SAME_NONZERO_PATTERN = MAT_SAME_NONZERO_PATTERN */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatStructure, __pyx_tuple__104, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatStructure, __pyx_t_7) < 0) __PYX_ERR(38, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":139 * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * * class MatOrderingType(object): # <<<<<<<<<<<<<< * NATURAL = S_(MATORDERINGNATURAL) * ND = S_(MATORDERINGND) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__105); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__105, __pyx_n_s_MatOrderingType, __pyx_n_s_MatOrderingType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":140 * * class MatOrderingType(object): * NATURAL = S_(MATORDERINGNATURAL) # <<<<<<<<<<<<<< * ND = S_(MATORDERINGND) * OWD = S_(MATORDERING1WD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGNATURAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NATURAL, __pyx_t_7) < 0) __PYX_ERR(38, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":141 * class MatOrderingType(object): * NATURAL = S_(MATORDERINGNATURAL) * ND = S_(MATORDERINGND) # <<<<<<<<<<<<<< * OWD = S_(MATORDERING1WD) * RCM = S_(MATORDERINGRCM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGND); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ND, __pyx_t_7) < 0) __PYX_ERR(38, 141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":142 * NATURAL = S_(MATORDERINGNATURAL) * ND = S_(MATORDERINGND) * OWD = S_(MATORDERING1WD) # <<<<<<<<<<<<<< * RCM = S_(MATORDERINGRCM) * QMD = S_(MATORDERINGQMD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERING1WD); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_OWD, __pyx_t_7) < 0) __PYX_ERR(38, 142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":143 * ND = S_(MATORDERINGND) * OWD = S_(MATORDERING1WD) * RCM = S_(MATORDERINGRCM) # <<<<<<<<<<<<<< * QMD = S_(MATORDERINGQMD) * ROWLENGTH = S_(MATORDERINGROWLENGTH) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGRCM); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RCM, __pyx_t_7) < 0) __PYX_ERR(38, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":144 * OWD = S_(MATORDERING1WD) * RCM = S_(MATORDERINGRCM) * QMD = S_(MATORDERINGQMD) # <<<<<<<<<<<<<< * ROWLENGTH = S_(MATORDERINGROWLENGTH) * WBM = S_(MATORDERINGWBM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGQMD); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_QMD, __pyx_t_7) < 0) __PYX_ERR(38, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":145 * RCM = S_(MATORDERINGRCM) * QMD = S_(MATORDERINGQMD) * ROWLENGTH = S_(MATORDERINGROWLENGTH) # <<<<<<<<<<<<<< * WBM = S_(MATORDERINGWBM) * SPECTRAL = S_(MATORDERINGSPECTRAL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGROWLENGTH); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ROWLENGTH, __pyx_t_7) < 0) __PYX_ERR(38, 145, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":146 * QMD = S_(MATORDERINGQMD) * ROWLENGTH = S_(MATORDERINGROWLENGTH) * WBM = S_(MATORDERINGWBM) # <<<<<<<<<<<<<< * SPECTRAL = S_(MATORDERINGSPECTRAL) * AMD = S_(MATORDERINGAMD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGWBM); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_WBM, __pyx_t_7) < 0) __PYX_ERR(38, 146, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":147 * ROWLENGTH = S_(MATORDERINGROWLENGTH) * WBM = S_(MATORDERINGWBM) * SPECTRAL = S_(MATORDERINGSPECTRAL) # <<<<<<<<<<<<<< * AMD = S_(MATORDERINGAMD) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGSPECTRAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SPECTRAL, __pyx_t_7) < 0) __PYX_ERR(38, 147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":148 * WBM = S_(MATORDERINGWBM) * SPECTRAL = S_(MATORDERINGSPECTRAL) * AMD = S_(MATORDERINGAMD) # <<<<<<<<<<<<<< * * class MatSolverType(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGAMD); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AMD, __pyx_t_7) < 0) __PYX_ERR(38, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":139 * UNKNOWN = UNKNOWN_NZ = UNKNOWN_NONZERO_PATTERN * * class MatOrderingType(object): # <<<<<<<<<<<<<< * NATURAL = S_(MATORDERINGNATURAL) * ND = S_(MATORDERINGND) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatOrderingType, __pyx_tuple__105, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatOrderingType, __pyx_t_7) < 0) __PYX_ERR(38, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":150 * AMD = S_(MATORDERINGAMD) * * class MatSolverType(object): # <<<<<<<<<<<<<< * SUPERLU = S_(MATSOLVERSUPERLU) * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__106); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__106, __pyx_n_s_MatSolverType, __pyx_n_s_MatSolverType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":151 * * class MatSolverType(object): * SUPERLU = S_(MATSOLVERSUPERLU) # <<<<<<<<<<<<<< * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) * STRUMPACK = S_(MATSOLVERSTRUMPACK) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSUPERLU); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUPERLU, __pyx_t_7) < 0) __PYX_ERR(38, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":152 * class MatSolverType(object): * SUPERLU = S_(MATSOLVERSUPERLU) * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) # <<<<<<<<<<<<<< * STRUMPACK = S_(MATSOLVERSTRUMPACK) * UMFPACK = S_(MATSOLVERUMFPACK) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSUPERLU_DIST); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUPERLU_DIST, __pyx_t_7) < 0) __PYX_ERR(38, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":153 * SUPERLU = S_(MATSOLVERSUPERLU) * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) * STRUMPACK = S_(MATSOLVERSTRUMPACK) # <<<<<<<<<<<<<< * UMFPACK = S_(MATSOLVERUMFPACK) * CHOLMOD = S_(MATSOLVERCHOLMOD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSTRUMPACK); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STRUMPACK, __pyx_t_7) < 0) __PYX_ERR(38, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":154 * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) * STRUMPACK = S_(MATSOLVERSTRUMPACK) * UMFPACK = S_(MATSOLVERUMFPACK) # <<<<<<<<<<<<<< * CHOLMOD = S_(MATSOLVERCHOLMOD) * KLU = S_(MATSOLVERKLU) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERUMFPACK); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UMFPACK, __pyx_t_7) < 0) __PYX_ERR(38, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":155 * STRUMPACK = S_(MATSOLVERSTRUMPACK) * UMFPACK = S_(MATSOLVERUMFPACK) * CHOLMOD = S_(MATSOLVERCHOLMOD) # <<<<<<<<<<<<<< * KLU = S_(MATSOLVERKLU) * SPARSEELEMENTAL = S_(MATSOLVERSPARSEELEMENTAL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCHOLMOD); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CHOLMOD, __pyx_t_7) < 0) __PYX_ERR(38, 155, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":156 * UMFPACK = S_(MATSOLVERUMFPACK) * CHOLMOD = S_(MATSOLVERCHOLMOD) * KLU = S_(MATSOLVERKLU) # <<<<<<<<<<<<<< * SPARSEELEMENTAL = S_(MATSOLVERSPARSEELEMENTAL) * ELEMENTAL = S_(MATSOLVERELEMENTAL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERKLU); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KLU, __pyx_t_7) < 0) __PYX_ERR(38, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":157 * CHOLMOD = S_(MATSOLVERCHOLMOD) * KLU = S_(MATSOLVERKLU) * SPARSEELEMENTAL = S_(MATSOLVERSPARSEELEMENTAL) # <<<<<<<<<<<<<< * ELEMENTAL = S_(MATSOLVERELEMENTAL) * SCALAPACK = S_(MATSOLVERSCALAPACK) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSPARSEELEMENTAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SPARSEELEMENTAL, __pyx_t_7) < 0) __PYX_ERR(38, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":158 * KLU = S_(MATSOLVERKLU) * SPARSEELEMENTAL = S_(MATSOLVERSPARSEELEMENTAL) * ELEMENTAL = S_(MATSOLVERELEMENTAL) # <<<<<<<<<<<<<< * SCALAPACK = S_(MATSOLVERSCALAPACK) * ESSL = S_(MATSOLVERESSL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERELEMENTAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ELEMENTAL, __pyx_t_7) < 0) __PYX_ERR(38, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":159 * SPARSEELEMENTAL = S_(MATSOLVERSPARSEELEMENTAL) * ELEMENTAL = S_(MATSOLVERELEMENTAL) * SCALAPACK = S_(MATSOLVERSCALAPACK) # <<<<<<<<<<<<<< * ESSL = S_(MATSOLVERESSL) * LUSOL = S_(MATSOLVERLUSOL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSCALAPACK); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SCALAPACK, __pyx_t_7) < 0) __PYX_ERR(38, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":160 * ELEMENTAL = S_(MATSOLVERELEMENTAL) * SCALAPACK = S_(MATSOLVERSCALAPACK) * ESSL = S_(MATSOLVERESSL) # <<<<<<<<<<<<<< * LUSOL = S_(MATSOLVERLUSOL) * MUMPS = S_(MATSOLVERMUMPS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERESSL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ESSL, __pyx_t_7) < 0) __PYX_ERR(38, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":161 * SCALAPACK = S_(MATSOLVERSCALAPACK) * ESSL = S_(MATSOLVERESSL) * LUSOL = S_(MATSOLVERLUSOL) # <<<<<<<<<<<<<< * MUMPS = S_(MATSOLVERMUMPS) * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERLUSOL); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LUSOL, __pyx_t_7) < 0) __PYX_ERR(38, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":162 * ESSL = S_(MATSOLVERESSL) * LUSOL = S_(MATSOLVERLUSOL) * MUMPS = S_(MATSOLVERMUMPS) # <<<<<<<<<<<<<< * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMUMPS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MUMPS, __pyx_t_7) < 0) __PYX_ERR(38, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":163 * LUSOL = S_(MATSOLVERLUSOL) * MUMPS = S_(MATSOLVERMUMPS) * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) # <<<<<<<<<<<<<< * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) * PASTIX = S_(MATSOLVERPASTIX) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMKL_PARDISO); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MKL_PARDISO, __pyx_t_7) < 0) __PYX_ERR(38, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":164 * MUMPS = S_(MATSOLVERMUMPS) * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) # <<<<<<<<<<<<<< * PASTIX = S_(MATSOLVERPASTIX) * MATLAB = S_(MATSOLVERMATLAB) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMKL_CPARDISO); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MKL_CPARDISO, __pyx_t_7) < 0) __PYX_ERR(38, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":165 * MKL_PARDISO = S_(MATSOLVERMKL_PARDISO) * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) * PASTIX = S_(MATSOLVERPASTIX) # <<<<<<<<<<<<<< * MATLAB = S_(MATSOLVERMATLAB) * PETSC = S_(MATSOLVERPETSC) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERPASTIX); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PASTIX, __pyx_t_7) < 0) __PYX_ERR(38, 165, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":166 * MKL_CPARDISO = S_(MATSOLVERMKL_CPARDISO) * PASTIX = S_(MATSOLVERPASTIX) * MATLAB = S_(MATSOLVERMATLAB) # <<<<<<<<<<<<<< * PETSC = S_(MATSOLVERPETSC) * BAS = S_(MATSOLVERBAS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMATLAB); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MATLAB, __pyx_t_7) < 0) __PYX_ERR(38, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":167 * PASTIX = S_(MATSOLVERPASTIX) * MATLAB = S_(MATSOLVERMATLAB) * PETSC = S_(MATSOLVERPETSC) # <<<<<<<<<<<<<< * BAS = S_(MATSOLVERBAS) * CUSPARSE = S_(MATSOLVERCUSPARSE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERPETSC); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PETSC, __pyx_t_7) < 0) __PYX_ERR(38, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":168 * MATLAB = S_(MATSOLVERMATLAB) * PETSC = S_(MATSOLVERPETSC) * BAS = S_(MATSOLVERBAS) # <<<<<<<<<<<<<< * CUSPARSE = S_(MATSOLVERCUSPARSE) * CUDA = S_(MATSOLVERCUDA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERBAS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BAS, __pyx_t_7) < 0) __PYX_ERR(38, 168, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":169 * PETSC = S_(MATSOLVERPETSC) * BAS = S_(MATSOLVERBAS) * CUSPARSE = S_(MATSOLVERCUSPARSE) # <<<<<<<<<<<<<< * CUDA = S_(MATSOLVERCUDA) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCUSPARSE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CUSPARSE, __pyx_t_7) < 0) __PYX_ERR(38, 169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":170 * BAS = S_(MATSOLVERBAS) * CUSPARSE = S_(MATSOLVERCUSPARSE) * CUDA = S_(MATSOLVERCUDA) # <<<<<<<<<<<<<< * * class MatFactorShiftType(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CUDA, __pyx_t_7) < 0) __PYX_ERR(38, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":150 * AMD = S_(MATORDERINGAMD) * * class MatSolverType(object): # <<<<<<<<<<<<<< * SUPERLU = S_(MATSOLVERSUPERLU) * SUPERLU_DIST = S_(MATSOLVERSUPERLU_DIST) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatSolverType, __pyx_tuple__106, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatSolverType, __pyx_t_7) < 0) __PYX_ERR(38, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":172 * CUDA = S_(MATSOLVERCUDA) * * class MatFactorShiftType(object): # <<<<<<<<<<<<<< * # native * NONE = MAT_SHIFT_NONE */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__107); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__107, __pyx_n_s_MatFactorShiftType, __pyx_n_s_MatFactorShiftType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":174 * class MatFactorShiftType(object): * # native * NONE = MAT_SHIFT_NONE # <<<<<<<<<<<<<< * NONZERO = MAT_SHIFT_NONZERO * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE */ __pyx_t_7 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_NONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(38, 174, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":175 * # native * NONE = MAT_SHIFT_NONE * NONZERO = MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE * INBLOCKS = MAT_SHIFT_INBLOCKS */ __pyx_t_7 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_NONZERO); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONZERO, __pyx_t_7) < 0) __PYX_ERR(38, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":176 * NONE = MAT_SHIFT_NONE * NONZERO = MAT_SHIFT_NONZERO * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * INBLOCKS = MAT_SHIFT_INBLOCKS * # aliases */ __pyx_t_7 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_POSITIVE_DEFINITE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_POSITIVE_DEFINITE, __pyx_t_7) < 0) __PYX_ERR(38, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":177 * NONZERO = MAT_SHIFT_NONZERO * POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE * INBLOCKS = MAT_SHIFT_INBLOCKS # <<<<<<<<<<<<<< * # aliases * NZ = MAT_SHIFT_NONZERO */ __pyx_t_7 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_INBLOCKS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_INBLOCKS, __pyx_t_7) < 0) __PYX_ERR(38, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":179 * INBLOCKS = MAT_SHIFT_INBLOCKS * # aliases * NZ = MAT_SHIFT_NONZERO # <<<<<<<<<<<<<< * PD = MAT_SHIFT_POSITIVE_DEFINITE * */ __pyx_t_7 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_NONZERO); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NZ, __pyx_t_7) < 0) __PYX_ERR(38, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":180 * # aliases * NZ = MAT_SHIFT_NONZERO * PD = MAT_SHIFT_POSITIVE_DEFINITE # <<<<<<<<<<<<<< * * class MatSORType(object): */ __pyx_t_7 = __Pyx_PyInt_From_MatFactorShiftType(MAT_SHIFT_POSITIVE_DEFINITE); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PD, __pyx_t_7) < 0) __PYX_ERR(38, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":172 * CUDA = S_(MATSOLVERCUDA) * * class MatFactorShiftType(object): # <<<<<<<<<<<<<< * # native * NONE = MAT_SHIFT_NONE */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatFactorShiftType, __pyx_tuple__107, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatFactorShiftType, __pyx_t_7) < 0) __PYX_ERR(38, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":182 * PD = MAT_SHIFT_POSITIVE_DEFINITE * * class MatSORType(object): # <<<<<<<<<<<<<< * FORWARD_SWEEP = SOR_FORWARD_SWEEP * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__108); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__108, __pyx_n_s_MatSORType, __pyx_n_s_MatSORType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Mat.pyx":183 * * class MatSORType(object): * FORWARD_SWEEP = SOR_FORWARD_SWEEP # <<<<<<<<<<<<<< * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_FORWARD_SWEEP); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FORWARD_SWEEP, __pyx_t_7) < 0) __PYX_ERR(38, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":184 * class MatSORType(object): * FORWARD_SWEEP = SOR_FORWARD_SWEEP * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP # <<<<<<<<<<<<<< * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_BACKWARD_SWEEP); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACKWARD_SWEEP, __pyx_t_7) < 0) __PYX_ERR(38, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":185 * FORWARD_SWEEP = SOR_FORWARD_SWEEP * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP # <<<<<<<<<<<<<< * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_SYMMETRIC_SWEEP); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SYMMETRY_SWEEP, __pyx_t_7) < 0) __PYX_ERR(38, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":186 * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP # <<<<<<<<<<<<<< * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_LOCAL_FORWARD_SWEEP); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LOCAL_FORWARD_SWEEP, __pyx_t_7) < 0) __PYX_ERR(38, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":187 * SYMMETRY_SWEEP = SOR_SYMMETRIC_SWEEP * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP # <<<<<<<<<<<<<< * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_LOCAL_BACKWARD_SWEEP); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LOCAL_BACKWARD_SWEEP, __pyx_t_7) < 0) __PYX_ERR(38, 187, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":188 * LOCAL_FORWARD_SWEEP = SOR_LOCAL_FORWARD_SWEEP * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP # <<<<<<<<<<<<<< * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS * EISENSTAT = SOR_EISENSTAT */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_LOCAL_SYMMETRIC_SWEEP); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LOCAL_SYMMETRIC_SWEEP, __pyx_t_7) < 0) __PYX_ERR(38, 188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":189 * LOCAL_BACKWARD_SWEEP = SOR_LOCAL_BACKWARD_SWEEP * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS # <<<<<<<<<<<<<< * EISENSTAT = SOR_EISENSTAT * APPLY_UPPER = SOR_APPLY_UPPER */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_ZERO_INITIAL_GUESS); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ZERO_INITIAL_GUESS, __pyx_t_7) < 0) __PYX_ERR(38, 189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":190 * LOCAL_SYMMETRIC_SWEEP = SOR_LOCAL_SYMMETRIC_SWEEP * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS * EISENSTAT = SOR_EISENSTAT # <<<<<<<<<<<<<< * APPLY_UPPER = SOR_APPLY_UPPER * APPLY_LOWER = SOR_APPLY_LOWER */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_EISENSTAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_EISENSTAT, __pyx_t_7) < 0) __PYX_ERR(38, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":191 * ZERO_INITIAL_GUESS = SOR_ZERO_INITIAL_GUESS * EISENSTAT = SOR_EISENSTAT * APPLY_UPPER = SOR_APPLY_UPPER # <<<<<<<<<<<<<< * APPLY_LOWER = SOR_APPLY_LOWER * */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_APPLY_UPPER); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_APPLY_UPPER, __pyx_t_7) < 0) __PYX_ERR(38, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":192 * EISENSTAT = SOR_EISENSTAT * APPLY_UPPER = SOR_APPLY_UPPER * APPLY_LOWER = SOR_APPLY_LOWER # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_MatSORType(SOR_APPLY_LOWER); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_APPLY_LOWER, __pyx_t_7) < 0) __PYX_ERR(38, 192, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Mat.pyx":182 * PD = MAT_SHIFT_POSITIVE_DEFINITE * * class MatSORType(object): # <<<<<<<<<<<<<< * FORWARD_SWEEP = SOR_FORWARD_SWEEP * BACKWARD_SWEEP = SOR_BACKWARD_SWEEP */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MatSORType, __pyx_tuple__108, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(38, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MatSORType, __pyx_t_7) < 0) __PYX_ERR(38, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Mat.pyx":198 * cdef class Mat(Object): * * Type = MatType # <<<<<<<<<<<<<< * Option = MatOption * AssemblyType = MatAssemblyType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatType); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(38, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":199 * * Type = MatType * Option = MatOption # <<<<<<<<<<<<<< * AssemblyType = MatAssemblyType * InfoType = MatInfoType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatOption); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_Option, __pyx_t_3) < 0) __PYX_ERR(38, 199, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":200 * Type = MatType * Option = MatOption * AssemblyType = MatAssemblyType # <<<<<<<<<<<<<< * InfoType = MatInfoType * Structure = MatStructure */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatAssemblyType); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_AssemblyType, __pyx_t_3) < 0) __PYX_ERR(38, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":201 * Option = MatOption * AssemblyType = MatAssemblyType * InfoType = MatInfoType # <<<<<<<<<<<<<< * Structure = MatStructure * OrderingType = MatOrderingType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatInfoType); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_InfoType, __pyx_t_3) < 0) __PYX_ERR(38, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":202 * AssemblyType = MatAssemblyType * InfoType = MatInfoType * Structure = MatStructure # <<<<<<<<<<<<<< * OrderingType = MatOrderingType * SolverType = MatSolverType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatStructure); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_Structure, __pyx_t_3) < 0) __PYX_ERR(38, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":203 * InfoType = MatInfoType * Structure = MatStructure * OrderingType = MatOrderingType # <<<<<<<<<<<<<< * SolverType = MatSolverType * FactorShiftType = MatFactorShiftType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatOrderingType); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_OrderingType, __pyx_t_3) < 0) __PYX_ERR(38, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":204 * Structure = MatStructure * OrderingType = MatOrderingType * SolverType = MatSolverType # <<<<<<<<<<<<<< * FactorShiftType = MatFactorShiftType * SORType = MatSORType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatSolverType); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_SolverType, __pyx_t_3) < 0) __PYX_ERR(38, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":205 * OrderingType = MatOrderingType * SolverType = MatSolverType * FactorShiftType = MatFactorShiftType # <<<<<<<<<<<<<< * SORType = MatSORType * # */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatFactorShiftType); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_FactorShiftType, __pyx_t_3) < 0) __PYX_ERR(38, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":206 * SolverType = MatSolverType * FactorShiftType = MatFactorShiftType * SORType = MatSORType # <<<<<<<<<<<<<< * # * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MatSORType); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_SORType, __pyx_t_3) < 0) __PYX_ERR(38, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":957 * # * * Stencil = _Mat_Stencil # <<<<<<<<<<<<<< * * def setStencil(self, dims, starts=None, dof=1): */ if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_Stencil, ((PyObject *)__pyx_ptype_8petsc4py_5PETSc__Mat_Stencil)) < 0) __PYX_ERR(38, 957, __pyx_L1_error) PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":1086 * return vecl * * getVecs = createVecs # <<<<<<<<<<<<<< * getVecRight = createVecRight * getVecLeft = createVecLeft */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_createVecs); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_getVecs, __pyx_t_3) < 0) __PYX_ERR(38, 1086, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":1087 * * getVecs = createVecs * getVecRight = createVecRight # <<<<<<<<<<<<<< * getVecLeft = createVecLeft * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_createVecRight); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1087, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_getVecRight, __pyx_t_3) < 0) __PYX_ERR(38, 1087, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":1088 * getVecs = createVecs * getVecRight = createVecRight * getVecLeft = createVecLeft # <<<<<<<<<<<<<< * * # */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_n_s_createVecLeft); if (unlikely(!__pyx_t_3)) __PYX_ERR(38, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dict, __pyx_n_s_getVecLeft, __pyx_t_3) < 0) __PYX_ERR(38, 1088, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Mat); /* "PETSc/Mat.pyx":1743 * # -------------------------------------------------------------------- * * del MatType # <<<<<<<<<<<<<< * del MatOption * del MatAssemblyType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatType) < 0) __PYX_ERR(38, 1743, __pyx_L1_error) /* "PETSc/Mat.pyx":1744 * * del MatType * del MatOption # <<<<<<<<<<<<<< * del MatAssemblyType * del MatInfoType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatOption) < 0) __PYX_ERR(38, 1744, __pyx_L1_error) /* "PETSc/Mat.pyx":1745 * del MatType * del MatOption * del MatAssemblyType # <<<<<<<<<<<<<< * del MatInfoType * del MatStructure */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatAssemblyType) < 0) __PYX_ERR(38, 1745, __pyx_L1_error) /* "PETSc/Mat.pyx":1746 * del MatOption * del MatAssemblyType * del MatInfoType # <<<<<<<<<<<<<< * del MatStructure * del MatOrderingType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatInfoType) < 0) __PYX_ERR(38, 1746, __pyx_L1_error) /* "PETSc/Mat.pyx":1747 * del MatAssemblyType * del MatInfoType * del MatStructure # <<<<<<<<<<<<<< * del MatOrderingType * del MatSolverType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatStructure) < 0) __PYX_ERR(38, 1747, __pyx_L1_error) /* "PETSc/Mat.pyx":1748 * del MatInfoType * del MatStructure * del MatOrderingType # <<<<<<<<<<<<<< * del MatSolverType * del MatFactorShiftType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatOrderingType) < 0) __PYX_ERR(38, 1748, __pyx_L1_error) /* "PETSc/Mat.pyx":1749 * del MatStructure * del MatOrderingType * del MatSolverType # <<<<<<<<<<<<<< * del MatFactorShiftType * del MatSORType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatSolverType) < 0) __PYX_ERR(38, 1749, __pyx_L1_error) /* "PETSc/Mat.pyx":1750 * del MatOrderingType * del MatSolverType * del MatFactorShiftType # <<<<<<<<<<<<<< * del MatSORType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatFactorShiftType) < 0) __PYX_ERR(38, 1750, __pyx_L1_error) /* "PETSc/Mat.pyx":1751 * del MatSolverType * del MatFactorShiftType * del MatSORType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_MatSORType) < 0) __PYX_ERR(38, 1751, __pyx_L1_error) /* "PETSc/PC.pyx":3 * # -------------------------------------------------------------------- * * class PCType(object): # <<<<<<<<<<<<<< * NONE = S_(PCNONE) * JACOBI = S_(PCJACOBI) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__109); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__109, __pyx_n_s_PCType, __pyx_n_s_PCType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":4 * * class PCType(object): * NONE = S_(PCNONE) # <<<<<<<<<<<<<< * JACOBI = S_(PCJACOBI) * SOR = S_(PCSOR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCNONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(39, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":5 * class PCType(object): * NONE = S_(PCNONE) * JACOBI = S_(PCJACOBI) # <<<<<<<<<<<<<< * SOR = S_(PCSOR) * LU = S_(PCLU) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCJACOBI); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_JACOBI, __pyx_t_7) < 0) __PYX_ERR(39, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":6 * NONE = S_(PCNONE) * JACOBI = S_(PCJACOBI) * SOR = S_(PCSOR) # <<<<<<<<<<<<<< * LU = S_(PCLU) * SHELL = S_(PCSHELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCSOR); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SOR, __pyx_t_7) < 0) __PYX_ERR(39, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":7 * JACOBI = S_(PCJACOBI) * SOR = S_(PCSOR) * LU = S_(PCLU) # <<<<<<<<<<<<<< * SHELL = S_(PCSHELL) * BJACOBI = S_(PCBJACOBI) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCLU); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LU, __pyx_t_7) < 0) __PYX_ERR(39, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":8 * SOR = S_(PCSOR) * LU = S_(PCLU) * SHELL = S_(PCSHELL) # <<<<<<<<<<<<<< * BJACOBI = S_(PCBJACOBI) * VPBJACOBI = S_(PCVPBJACOBI) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCSHELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SHELL, __pyx_t_7) < 0) __PYX_ERR(39, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":9 * LU = S_(PCLU) * SHELL = S_(PCSHELL) * BJACOBI = S_(PCBJACOBI) # <<<<<<<<<<<<<< * VPBJACOBI = S_(PCVPBJACOBI) * MG = S_(PCMG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCBJACOBI); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BJACOBI, __pyx_t_7) < 0) __PYX_ERR(39, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":10 * SHELL = S_(PCSHELL) * BJACOBI = S_(PCBJACOBI) * VPBJACOBI = S_(PCVPBJACOBI) # <<<<<<<<<<<<<< * MG = S_(PCMG) * EISENSTAT = S_(PCEISENSTAT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCVPBJACOBI); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VPBJACOBI, __pyx_t_7) < 0) __PYX_ERR(39, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":11 * BJACOBI = S_(PCBJACOBI) * VPBJACOBI = S_(PCVPBJACOBI) * MG = S_(PCMG) # <<<<<<<<<<<<<< * EISENSTAT = S_(PCEISENSTAT) * ILU = S_(PCILU) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCMG); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MG, __pyx_t_7) < 0) __PYX_ERR(39, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":12 * VPBJACOBI = S_(PCVPBJACOBI) * MG = S_(PCMG) * EISENSTAT = S_(PCEISENSTAT) # <<<<<<<<<<<<<< * ILU = S_(PCILU) * ICC = S_(PCICC) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCEISENSTAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_EISENSTAT, __pyx_t_7) < 0) __PYX_ERR(39, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":13 * MG = S_(PCMG) * EISENSTAT = S_(PCEISENSTAT) * ILU = S_(PCILU) # <<<<<<<<<<<<<< * ICC = S_(PCICC) * ASM = S_(PCASM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCILU); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ILU, __pyx_t_7) < 0) __PYX_ERR(39, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":14 * EISENSTAT = S_(PCEISENSTAT) * ILU = S_(PCILU) * ICC = S_(PCICC) # <<<<<<<<<<<<<< * ASM = S_(PCASM) * GASM = S_(PCGASM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCICC); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ICC, __pyx_t_7) < 0) __PYX_ERR(39, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":15 * ILU = S_(PCILU) * ICC = S_(PCICC) * ASM = S_(PCASM) # <<<<<<<<<<<<<< * GASM = S_(PCGASM) * KSP = S_(PCKSP) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCASM); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ASM, __pyx_t_7) < 0) __PYX_ERR(39, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":16 * ICC = S_(PCICC) * ASM = S_(PCASM) * GASM = S_(PCGASM) # <<<<<<<<<<<<<< * KSP = S_(PCKSP) * COMPOSITE = S_(PCCOMPOSITE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCGASM); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GASM, __pyx_t_7) < 0) __PYX_ERR(39, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":17 * ASM = S_(PCASM) * GASM = S_(PCGASM) * KSP = S_(PCKSP) # <<<<<<<<<<<<<< * COMPOSITE = S_(PCCOMPOSITE) * REDUNDANT = S_(PCREDUNDANT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCKSP); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KSP, __pyx_t_7) < 0) __PYX_ERR(39, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":18 * GASM = S_(PCGASM) * KSP = S_(PCKSP) * COMPOSITE = S_(PCCOMPOSITE) # <<<<<<<<<<<<<< * REDUNDANT = S_(PCREDUNDANT) * SPAI = S_(PCSPAI) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCCOMPOSITE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COMPOSITE, __pyx_t_7) < 0) __PYX_ERR(39, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":19 * KSP = S_(PCKSP) * COMPOSITE = S_(PCCOMPOSITE) * REDUNDANT = S_(PCREDUNDANT) # <<<<<<<<<<<<<< * SPAI = S_(PCSPAI) * NN = S_(PCNN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCREDUNDANT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_REDUNDANT, __pyx_t_7) < 0) __PYX_ERR(39, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":20 * COMPOSITE = S_(PCCOMPOSITE) * REDUNDANT = S_(PCREDUNDANT) * SPAI = S_(PCSPAI) # <<<<<<<<<<<<<< * NN = S_(PCNN) * CHOLESKY = S_(PCCHOLESKY) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCSPAI); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SPAI, __pyx_t_7) < 0) __PYX_ERR(39, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":21 * REDUNDANT = S_(PCREDUNDANT) * SPAI = S_(PCSPAI) * NN = S_(PCNN) # <<<<<<<<<<<<<< * CHOLESKY = S_(PCCHOLESKY) * PBJACOBI = S_(PCPBJACOBI) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCNN); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NN, __pyx_t_7) < 0) __PYX_ERR(39, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":22 * SPAI = S_(PCSPAI) * NN = S_(PCNN) * CHOLESKY = S_(PCCHOLESKY) # <<<<<<<<<<<<<< * PBJACOBI = S_(PCPBJACOBI) * MAT = S_(PCMAT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCCHOLESKY); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CHOLESKY, __pyx_t_7) < 0) __PYX_ERR(39, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":23 * NN = S_(PCNN) * CHOLESKY = S_(PCCHOLESKY) * PBJACOBI = S_(PCPBJACOBI) # <<<<<<<<<<<<<< * MAT = S_(PCMAT) * HYPRE = S_(PCHYPRE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCPBJACOBI); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PBJACOBI, __pyx_t_7) < 0) __PYX_ERR(39, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":24 * CHOLESKY = S_(PCCHOLESKY) * PBJACOBI = S_(PCPBJACOBI) * MAT = S_(PCMAT) # <<<<<<<<<<<<<< * HYPRE = S_(PCHYPRE) * PARMS = S_(PCPARMS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCMAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MAT, __pyx_t_7) < 0) __PYX_ERR(39, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":25 * PBJACOBI = S_(PCPBJACOBI) * MAT = S_(PCMAT) * HYPRE = S_(PCHYPRE) # <<<<<<<<<<<<<< * PARMS = S_(PCPARMS) * FIELDSPLIT = S_(PCFIELDSPLIT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCHYPRE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HYPRE, __pyx_t_7) < 0) __PYX_ERR(39, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":26 * MAT = S_(PCMAT) * HYPRE = S_(PCHYPRE) * PARMS = S_(PCPARMS) # <<<<<<<<<<<<<< * FIELDSPLIT = S_(PCFIELDSPLIT) * TFS = S_(PCTFS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCPARMS); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PARMS, __pyx_t_7) < 0) __PYX_ERR(39, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":27 * HYPRE = S_(PCHYPRE) * PARMS = S_(PCPARMS) * FIELDSPLIT = S_(PCFIELDSPLIT) # <<<<<<<<<<<<<< * TFS = S_(PCTFS) * ML = S_(PCML) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCFIELDSPLIT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FIELDSPLIT, __pyx_t_7) < 0) __PYX_ERR(39, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":28 * PARMS = S_(PCPARMS) * FIELDSPLIT = S_(PCFIELDSPLIT) * TFS = S_(PCTFS) # <<<<<<<<<<<<<< * ML = S_(PCML) * GALERKIN = S_(PCGALERKIN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCTFS); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TFS, __pyx_t_7) < 0) __PYX_ERR(39, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":29 * FIELDSPLIT = S_(PCFIELDSPLIT) * TFS = S_(PCTFS) * ML = S_(PCML) # <<<<<<<<<<<<<< * GALERKIN = S_(PCGALERKIN) * EXOTIC = S_(PCEXOTIC) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCML); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ML, __pyx_t_7) < 0) __PYX_ERR(39, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":30 * TFS = S_(PCTFS) * ML = S_(PCML) * GALERKIN = S_(PCGALERKIN) # <<<<<<<<<<<<<< * EXOTIC = S_(PCEXOTIC) * CP = S_(PCCP) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCGALERKIN); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GALERKIN, __pyx_t_7) < 0) __PYX_ERR(39, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":31 * ML = S_(PCML) * GALERKIN = S_(PCGALERKIN) * EXOTIC = S_(PCEXOTIC) # <<<<<<<<<<<<<< * CP = S_(PCCP) * BFBT = S_(PCBFBT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCEXOTIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_EXOTIC, __pyx_t_7) < 0) __PYX_ERR(39, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":32 * GALERKIN = S_(PCGALERKIN) * EXOTIC = S_(PCEXOTIC) * CP = S_(PCCP) # <<<<<<<<<<<<<< * BFBT = S_(PCBFBT) * LSC = S_(PCLSC) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCCP); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CP, __pyx_t_7) < 0) __PYX_ERR(39, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":33 * EXOTIC = S_(PCEXOTIC) * CP = S_(PCCP) * BFBT = S_(PCBFBT) # <<<<<<<<<<<<<< * LSC = S_(PCLSC) * PYTHON = S_(PCPYTHON) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCBFBT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BFBT, __pyx_t_7) < 0) __PYX_ERR(39, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":34 * CP = S_(PCCP) * BFBT = S_(PCBFBT) * LSC = S_(PCLSC) # <<<<<<<<<<<<<< * PYTHON = S_(PCPYTHON) * PFMG = S_(PCPFMG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCLSC); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LSC, __pyx_t_7) < 0) __PYX_ERR(39, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":35 * BFBT = S_(PCBFBT) * LSC = S_(PCLSC) * PYTHON = S_(PCPYTHON) # <<<<<<<<<<<<<< * PFMG = S_(PCPFMG) * SYSPFMG = S_(PCSYSPFMG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCPYTHON); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PYTHON, __pyx_t_7) < 0) __PYX_ERR(39, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":36 * LSC = S_(PCLSC) * PYTHON = S_(PCPYTHON) * PFMG = S_(PCPFMG) # <<<<<<<<<<<<<< * SYSPFMG = S_(PCSYSPFMG) * REDISTRIBUTE = S_(PCREDISTRIBUTE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCPFMG); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PFMG, __pyx_t_7) < 0) __PYX_ERR(39, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":37 * PYTHON = S_(PCPYTHON) * PFMG = S_(PCPFMG) * SYSPFMG = S_(PCSYSPFMG) # <<<<<<<<<<<<<< * REDISTRIBUTE = S_(PCREDISTRIBUTE) * SVD = S_(PCSVD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCSYSPFMG); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SYSPFMG, __pyx_t_7) < 0) __PYX_ERR(39, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":38 * PFMG = S_(PCPFMG) * SYSPFMG = S_(PCSYSPFMG) * REDISTRIBUTE = S_(PCREDISTRIBUTE) # <<<<<<<<<<<<<< * SVD = S_(PCSVD) * GAMG = S_(PCGAMG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCREDISTRIBUTE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_REDISTRIBUTE, __pyx_t_7) < 0) __PYX_ERR(39, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":39 * SYSPFMG = S_(PCSYSPFMG) * REDISTRIBUTE = S_(PCREDISTRIBUTE) * SVD = S_(PCSVD) # <<<<<<<<<<<<<< * GAMG = S_(PCGAMG) * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCSVD); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SVD, __pyx_t_7) < 0) __PYX_ERR(39, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":40 * REDISTRIBUTE = S_(PCREDISTRIBUTE) * SVD = S_(PCSVD) * GAMG = S_(PCGAMG) # <<<<<<<<<<<<<< * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMG); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GAMG, __pyx_t_7) < 0) __PYX_ERR(39, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":41 * SVD = S_(PCSVD) * GAMG = S_(PCGAMG) * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) # <<<<<<<<<<<<<< * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) * SAVIENNACL = S_(PCSAVIENNACL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCCHOWILUVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CHOWILUVIENNACL, __pyx_t_7) < 0) __PYX_ERR(39, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":42 * GAMG = S_(PCGAMG) * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) # <<<<<<<<<<<<<< * SAVIENNACL = S_(PCSAVIENNACL) * BDDC = S_(PCBDDC) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCROWSCALINGVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ROWSCALINGVIENNACL, __pyx_t_7) < 0) __PYX_ERR(39, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":43 * CHOWILUVIENNACL = S_(PCCHOWILUVIENNACL) * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) * SAVIENNACL = S_(PCSAVIENNACL) # <<<<<<<<<<<<<< * BDDC = S_(PCBDDC) * KACZMARZ = S_(PCKACZMARZ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCSAVIENNACL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SAVIENNACL, __pyx_t_7) < 0) __PYX_ERR(39, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":44 * ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL) * SAVIENNACL = S_(PCSAVIENNACL) * BDDC = S_(PCBDDC) # <<<<<<<<<<<<<< * KACZMARZ = S_(PCKACZMARZ) * TELESCOPE = S_(PCTELESCOPE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCBDDC); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BDDC, __pyx_t_7) < 0) __PYX_ERR(39, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":45 * SAVIENNACL = S_(PCSAVIENNACL) * BDDC = S_(PCBDDC) * KACZMARZ = S_(PCKACZMARZ) # <<<<<<<<<<<<<< * TELESCOPE = S_(PCTELESCOPE) * PATCH = S_(PCPATCH) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCKACZMARZ); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KACZMARZ, __pyx_t_7) < 0) __PYX_ERR(39, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":46 * BDDC = S_(PCBDDC) * KACZMARZ = S_(PCKACZMARZ) * TELESCOPE = S_(PCTELESCOPE) # <<<<<<<<<<<<<< * PATCH = S_(PCPATCH) * LMVM = S_(PCLMVM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCTELESCOPE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TELESCOPE, __pyx_t_7) < 0) __PYX_ERR(39, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":47 * KACZMARZ = S_(PCKACZMARZ) * TELESCOPE = S_(PCTELESCOPE) * PATCH = S_(PCPATCH) # <<<<<<<<<<<<<< * LMVM = S_(PCLMVM) * HMG = S_(PCHMG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCPATCH); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PATCH, __pyx_t_7) < 0) __PYX_ERR(39, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":48 * TELESCOPE = S_(PCTELESCOPE) * PATCH = S_(PCPATCH) * LMVM = S_(PCLMVM) # <<<<<<<<<<<<<< * HMG = S_(PCHMG) * DEFLATION = S_(PCDEFLATION) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCLMVM); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LMVM, __pyx_t_7) < 0) __PYX_ERR(39, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":49 * PATCH = S_(PCPATCH) * LMVM = S_(PCLMVM) * HMG = S_(PCHMG) # <<<<<<<<<<<<<< * DEFLATION = S_(PCDEFLATION) * HPDDM = S_(PCHPDDM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCHMG); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HMG, __pyx_t_7) < 0) __PYX_ERR(39, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":50 * LMVM = S_(PCLMVM) * HMG = S_(PCHMG) * DEFLATION = S_(PCDEFLATION) # <<<<<<<<<<<<<< * HPDDM = S_(PCHPDDM) * HARA = S_(PCHARA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCDEFLATION); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DEFLATION, __pyx_t_7) < 0) __PYX_ERR(39, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":51 * HMG = S_(PCHMG) * DEFLATION = S_(PCDEFLATION) * HPDDM = S_(PCHPDDM) # <<<<<<<<<<<<<< * HARA = S_(PCHARA) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCHPDDM); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HPDDM, __pyx_t_7) < 0) __PYX_ERR(39, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":52 * DEFLATION = S_(PCDEFLATION) * HPDDM = S_(PCHPDDM) * HARA = S_(PCHARA) # <<<<<<<<<<<<<< * * class PCSide(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCHARA); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HARA, __pyx_t_7) < 0) __PYX_ERR(39, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":3 * # -------------------------------------------------------------------- * * class PCType(object): # <<<<<<<<<<<<<< * NONE = S_(PCNONE) * JACOBI = S_(PCJACOBI) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCType, __pyx_tuple__109, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCType, __pyx_t_7) < 0) __PYX_ERR(39, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":54 * HARA = S_(PCHARA) * * class PCSide(object): # <<<<<<<<<<<<<< * # native * LEFT = PC_LEFT */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__110); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__110, __pyx_n_s_PCSide, __pyx_n_s_PCSide, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":56 * class PCSide(object): * # native * LEFT = PC_LEFT # <<<<<<<<<<<<<< * RIGHT = PC_RIGHT * SYMMETRIC = PC_SYMMETRIC */ __pyx_t_7 = __Pyx_PyInt_From_PCSide(PC_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LEFT, __pyx_t_7) < 0) __PYX_ERR(39, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":57 * # native * LEFT = PC_LEFT * RIGHT = PC_RIGHT # <<<<<<<<<<<<<< * SYMMETRIC = PC_SYMMETRIC * # aliases */ __pyx_t_7 = __Pyx_PyInt_From_PCSide(PC_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RIGHT, __pyx_t_7) < 0) __PYX_ERR(39, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":58 * LEFT = PC_LEFT * RIGHT = PC_RIGHT * SYMMETRIC = PC_SYMMETRIC # <<<<<<<<<<<<<< * # aliases * L = LEFT */ __pyx_t_7 = __Pyx_PyInt_From_PCSide(PC_SYMMETRIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SYMMETRIC, __pyx_t_7) < 0) __PYX_ERR(39, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":60 * SYMMETRIC = PC_SYMMETRIC * # aliases * L = LEFT # <<<<<<<<<<<<<< * R = RIGHT * S = SYMMETRIC */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_LEFT); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_LEFT); } if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_L, __pyx_t_7) < 0) __PYX_ERR(39, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":61 * # aliases * L = LEFT * R = RIGHT # <<<<<<<<<<<<<< * S = SYMMETRIC * */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_RIGHT); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_RIGHT); } if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_R, __pyx_t_7) < 0) __PYX_ERR(39, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":62 * L = LEFT * R = RIGHT * S = SYMMETRIC # <<<<<<<<<<<<<< * * class PCASMType(object): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_SYMMETRIC); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_SYMMETRIC); } if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_S, __pyx_t_7) < 0) __PYX_ERR(39, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":54 * HARA = S_(PCHARA) * * class PCSide(object): # <<<<<<<<<<<<<< * # native * LEFT = PC_LEFT */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCSide, __pyx_tuple__110, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCSide, __pyx_t_7) < 0) __PYX_ERR(39, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":64 * S = SYMMETRIC * * class PCASMType(object): # <<<<<<<<<<<<<< * NONE = PC_ASM_NONE * BASIC = PC_ASM_BASIC */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__111); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__111, __pyx_n_s_PCASMType, __pyx_n_s_PCASMType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":65 * * class PCASMType(object): * NONE = PC_ASM_NONE # <<<<<<<<<<<<<< * BASIC = PC_ASM_BASIC * RESTRICT = PC_ASM_RESTRICT */ __pyx_t_7 = __Pyx_PyInt_From_PCASMType(PC_ASM_NONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(39, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":66 * class PCASMType(object): * NONE = PC_ASM_NONE * BASIC = PC_ASM_BASIC # <<<<<<<<<<<<<< * RESTRICT = PC_ASM_RESTRICT * INTERPOLATE = PC_ASM_INTERPOLATE */ __pyx_t_7 = __Pyx_PyInt_From_PCASMType(PC_ASM_BASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(39, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":67 * NONE = PC_ASM_NONE * BASIC = PC_ASM_BASIC * RESTRICT = PC_ASM_RESTRICT # <<<<<<<<<<<<<< * INTERPOLATE = PC_ASM_INTERPOLATE * */ __pyx_t_7 = __Pyx_PyInt_From_PCASMType(PC_ASM_RESTRICT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RESTRICT, __pyx_t_7) < 0) __PYX_ERR(39, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":68 * BASIC = PC_ASM_BASIC * RESTRICT = PC_ASM_RESTRICT * INTERPOLATE = PC_ASM_INTERPOLATE # <<<<<<<<<<<<<< * * class PCGASMType(object): */ __pyx_t_7 = __Pyx_PyInt_From_PCASMType(PC_ASM_INTERPOLATE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_INTERPOLATE, __pyx_t_7) < 0) __PYX_ERR(39, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":64 * S = SYMMETRIC * * class PCASMType(object): # <<<<<<<<<<<<<< * NONE = PC_ASM_NONE * BASIC = PC_ASM_BASIC */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCASMType, __pyx_tuple__111, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCASMType, __pyx_t_7) < 0) __PYX_ERR(39, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":70 * INTERPOLATE = PC_ASM_INTERPOLATE * * class PCGASMType(object): # <<<<<<<<<<<<<< * NONE = PC_GASM_NONE * BASIC = PC_GASM_BASIC */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__112); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__112, __pyx_n_s_PCGASMType, __pyx_n_s_PCGASMType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":71 * * class PCGASMType(object): * NONE = PC_GASM_NONE # <<<<<<<<<<<<<< * BASIC = PC_GASM_BASIC * RESTRICT = PC_GASM_RESTRICT */ __pyx_t_7 = __Pyx_PyInt_From_PCGASMType(PC_GASM_NONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(39, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":72 * class PCGASMType(object): * NONE = PC_GASM_NONE * BASIC = PC_GASM_BASIC # <<<<<<<<<<<<<< * RESTRICT = PC_GASM_RESTRICT * INTERPOLATE = PC_GASM_INTERPOLATE */ __pyx_t_7 = __Pyx_PyInt_From_PCGASMType(PC_GASM_BASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(39, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":73 * NONE = PC_GASM_NONE * BASIC = PC_GASM_BASIC * RESTRICT = PC_GASM_RESTRICT # <<<<<<<<<<<<<< * INTERPOLATE = PC_GASM_INTERPOLATE * */ __pyx_t_7 = __Pyx_PyInt_From_PCGASMType(PC_GASM_RESTRICT); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RESTRICT, __pyx_t_7) < 0) __PYX_ERR(39, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":74 * BASIC = PC_GASM_BASIC * RESTRICT = PC_GASM_RESTRICT * INTERPOLATE = PC_GASM_INTERPOLATE # <<<<<<<<<<<<<< * * class PCMGType(object): */ __pyx_t_7 = __Pyx_PyInt_From_PCGASMType(PC_GASM_INTERPOLATE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_INTERPOLATE, __pyx_t_7) < 0) __PYX_ERR(39, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":70 * INTERPOLATE = PC_ASM_INTERPOLATE * * class PCGASMType(object): # <<<<<<<<<<<<<< * NONE = PC_GASM_NONE * BASIC = PC_GASM_BASIC */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCGASMType, __pyx_tuple__112, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCGASMType, __pyx_t_7) < 0) __PYX_ERR(39, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":76 * INTERPOLATE = PC_GASM_INTERPOLATE * * class PCMGType(object): # <<<<<<<<<<<<<< * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE * ADDITIVE = PC_MG_ADDITIVE */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__113); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__113, __pyx_n_s_PCMGType, __pyx_n_s_PCMGType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":77 * * class PCMGType(object): * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE # <<<<<<<<<<<<<< * ADDITIVE = PC_MG_ADDITIVE * FULL = PC_MG_FULL */ __pyx_t_7 = __Pyx_PyInt_From_PCMGType(PC_MG_MULTIPLICATIVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MULTIPLICATIVE, __pyx_t_7) < 0) __PYX_ERR(39, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":78 * class PCMGType(object): * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE * ADDITIVE = PC_MG_ADDITIVE # <<<<<<<<<<<<<< * FULL = PC_MG_FULL * KASKADE = PC_MG_KASKADE */ __pyx_t_7 = __Pyx_PyInt_From_PCMGType(PC_MG_ADDITIVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ADDITIVE, __pyx_t_7) < 0) __PYX_ERR(39, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":79 * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE * ADDITIVE = PC_MG_ADDITIVE * FULL = PC_MG_FULL # <<<<<<<<<<<<<< * KASKADE = PC_MG_KASKADE * */ __pyx_t_7 = __Pyx_PyInt_From_PCMGType(PC_MG_FULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FULL, __pyx_t_7) < 0) __PYX_ERR(39, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":80 * ADDITIVE = PC_MG_ADDITIVE * FULL = PC_MG_FULL * KASKADE = PC_MG_KASKADE # <<<<<<<<<<<<<< * * class PCMGCycleType(object): */ __pyx_t_7 = __Pyx_PyInt_From_PCMGType(PC_MG_KASKADE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KASKADE, __pyx_t_7) < 0) __PYX_ERR(39, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":76 * INTERPOLATE = PC_GASM_INTERPOLATE * * class PCMGType(object): # <<<<<<<<<<<<<< * MULTIPLICATIVE = PC_MG_MULTIPLICATIVE * ADDITIVE = PC_MG_ADDITIVE */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCMGType, __pyx_tuple__113, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCMGType, __pyx_t_7) < 0) __PYX_ERR(39, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":82 * KASKADE = PC_MG_KASKADE * * class PCMGCycleType(object): # <<<<<<<<<<<<<< * V = PC_MG_CYCLE_V * W = PC_MG_CYCLE_W */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__114); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__114, __pyx_n_s_PCMGCycleType, __pyx_n_s_PCMGCycleType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":83 * * class PCMGCycleType(object): * V = PC_MG_CYCLE_V # <<<<<<<<<<<<<< * W = PC_MG_CYCLE_W * */ __pyx_t_7 = __Pyx_PyInt_From_PCMGCycleType(PC_MG_CYCLE_V); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_V, __pyx_t_7) < 0) __PYX_ERR(39, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":84 * class PCMGCycleType(object): * V = PC_MG_CYCLE_V * W = PC_MG_CYCLE_W # <<<<<<<<<<<<<< * * class PCGAMGType(object): */ __pyx_t_7 = __Pyx_PyInt_From_PCMGCycleType(PC_MG_CYCLE_W); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_W, __pyx_t_7) < 0) __PYX_ERR(39, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":82 * KASKADE = PC_MG_KASKADE * * class PCMGCycleType(object): # <<<<<<<<<<<<<< * V = PC_MG_CYCLE_V * W = PC_MG_CYCLE_W */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCMGCycleType, __pyx_tuple__114, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCMGCycleType, __pyx_t_7) < 0) __PYX_ERR(39, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":86 * W = PC_MG_CYCLE_W * * class PCGAMGType(object): # <<<<<<<<<<<<<< * AGG = S_(PCGAMGAGG) * GEO = S_(PCGAMGGEO) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__115); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__115, __pyx_n_s_PCGAMGType, __pyx_n_s_PCGAMGType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":87 * * class PCGAMGType(object): * AGG = S_(PCGAMGAGG) # <<<<<<<<<<<<<< * GEO = S_(PCGAMGGEO) * CLASSICAL = S_(PCGAMGCLASSICAL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGAGG); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_AGG, __pyx_t_7) < 0) __PYX_ERR(39, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":88 * class PCGAMGType(object): * AGG = S_(PCGAMGAGG) * GEO = S_(PCGAMGGEO) # <<<<<<<<<<<<<< * CLASSICAL = S_(PCGAMGCLASSICAL) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGGEO); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GEO, __pyx_t_7) < 0) __PYX_ERR(39, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":89 * AGG = S_(PCGAMGAGG) * GEO = S_(PCGAMGGEO) * CLASSICAL = S_(PCGAMGCLASSICAL) # <<<<<<<<<<<<<< * * class PCCompositeType(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGCLASSICAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CLASSICAL, __pyx_t_7) < 0) __PYX_ERR(39, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":86 * W = PC_MG_CYCLE_W * * class PCGAMGType(object): # <<<<<<<<<<<<<< * AGG = S_(PCGAMGAGG) * GEO = S_(PCGAMGGEO) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCGAMGType, __pyx_tuple__115, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCGAMGType, __pyx_t_7) < 0) __PYX_ERR(39, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":91 * CLASSICAL = S_(PCGAMGCLASSICAL) * * class PCCompositeType(object): # <<<<<<<<<<<<<< * ADDITIVE = PC_COMPOSITE_ADDITIVE * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__116); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__116, __pyx_n_s_PCCompositeType, __pyx_n_s_PCCompositeType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":92 * * class PCCompositeType(object): * ADDITIVE = PC_COMPOSITE_ADDITIVE # <<<<<<<<<<<<<< * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE */ __pyx_t_7 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_ADDITIVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ADDITIVE, __pyx_t_7) < 0) __PYX_ERR(39, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":93 * class PCCompositeType(object): * ADDITIVE = PC_COMPOSITE_ADDITIVE * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE # <<<<<<<<<<<<<< * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE * SPECIAL = PC_COMPOSITE_SPECIAL */ __pyx_t_7 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_MULTIPLICATIVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MULTIPLICATIVE, __pyx_t_7) < 0) __PYX_ERR(39, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":94 * ADDITIVE = PC_COMPOSITE_ADDITIVE * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE # <<<<<<<<<<<<<< * SPECIAL = PC_COMPOSITE_SPECIAL * SCHUR = PC_COMPOSITE_SCHUR */ __pyx_t_7 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SYMMETRIC_MULTIPLICATIVE, __pyx_t_7) < 0) __PYX_ERR(39, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":95 * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE * SPECIAL = PC_COMPOSITE_SPECIAL # <<<<<<<<<<<<<< * SCHUR = PC_COMPOSITE_SCHUR * */ __pyx_t_7 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_SPECIAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SPECIAL, __pyx_t_7) < 0) __PYX_ERR(39, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":96 * SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE * SPECIAL = PC_COMPOSITE_SPECIAL * SCHUR = PC_COMPOSITE_SCHUR # <<<<<<<<<<<<<< * * class PCFieldSplitSchurPreType(object): */ __pyx_t_7 = __Pyx_PyInt_From_PCCompositeType(PC_COMPOSITE_SCHUR); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SCHUR, __pyx_t_7) < 0) __PYX_ERR(39, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":91 * CLASSICAL = S_(PCGAMGCLASSICAL) * * class PCCompositeType(object): # <<<<<<<<<<<<<< * ADDITIVE = PC_COMPOSITE_ADDITIVE * MULTIPLICATIVE = PC_COMPOSITE_MULTIPLICATIVE */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCCompositeType, __pyx_tuple__116, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCCompositeType, __pyx_t_7) < 0) __PYX_ERR(39, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":98 * SCHUR = PC_COMPOSITE_SCHUR * * class PCFieldSplitSchurPreType(object): # <<<<<<<<<<<<<< * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__117); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__117, __pyx_n_s_PCFieldSplitSchurPreType, __pyx_n_s_PCFieldSplitSchurPreType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":99 * * class PCFieldSplitSchurPreType(object): * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF # <<<<<<<<<<<<<< * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_SELF); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SELF, __pyx_t_7) < 0) __PYX_ERR(39, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":100 * class PCFieldSplitSchurPreType(object): * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP # <<<<<<<<<<<<<< * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 * USER = PC_FIELDSPLIT_SCHUR_PRE_USER */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_SELFP); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SELFP, __pyx_t_7) < 0) __PYX_ERR(39, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":101 * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 # <<<<<<<<<<<<<< * USER = PC_FIELDSPLIT_SCHUR_PRE_USER * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_A11); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_A11, __pyx_t_7) < 0) __PYX_ERR(39, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":102 * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 * USER = PC_FIELDSPLIT_SCHUR_PRE_USER # <<<<<<<<<<<<<< * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_USER); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_USER, __pyx_t_7) < 0) __PYX_ERR(39, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":103 * A11 = PC_FIELDSPLIT_SCHUR_PRE_A11 * USER = PC_FIELDSPLIT_SCHUR_PRE_USER * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL # <<<<<<<<<<<<<< * * class PCFieldSplitSchurFactType(object): */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_FULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FULL, __pyx_t_7) < 0) __PYX_ERR(39, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":98 * SCHUR = PC_COMPOSITE_SCHUR * * class PCFieldSplitSchurPreType(object): # <<<<<<<<<<<<<< * SELF = PC_FIELDSPLIT_SCHUR_PRE_SELF * SELFP = PC_FIELDSPLIT_SCHUR_PRE_SELFP */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCFieldSplitSchurPreType, __pyx_tuple__117, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCFieldSplitSchurPreType, __pyx_t_7) < 0) __PYX_ERR(39, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":105 * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * * class PCFieldSplitSchurFactType(object): # <<<<<<<<<<<<<< * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__118); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__118, __pyx_n_s_PCFieldSplitSchurFactType, __pyx_n_s_PCFieldSplitSchurFactType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":106 * * class PCFieldSplitSchurFactType(object): * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG # <<<<<<<<<<<<<< * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_DIAG); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIAG, __pyx_t_7) < 0) __PYX_ERR(39, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":107 * class PCFieldSplitSchurFactType(object): * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER # <<<<<<<<<<<<<< * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_LOWER); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LOWER, __pyx_t_7) < 0) __PYX_ERR(39, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":108 * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER # <<<<<<<<<<<<<< * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_UPPER); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UPPER, __pyx_t_7) < 0) __PYX_ERR(39, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":109 * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER * UPPER = PC_FIELDSPLIT_SCHUR_FACT_UPPER * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL # <<<<<<<<<<<<<< * * class PCPatchConstructType(object): */ __pyx_t_7 = __Pyx_PyInt_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_FULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FULL, __pyx_t_7) < 0) __PYX_ERR(39, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":105 * FULL = PC_FIELDSPLIT_SCHUR_PRE_FULL * * class PCFieldSplitSchurFactType(object): # <<<<<<<<<<<<<< * DIAG = PC_FIELDSPLIT_SCHUR_FACT_DIAG * LOWER = PC_FIELDSPLIT_SCHUR_FACT_LOWER */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCFieldSplitSchurFactType, __pyx_tuple__118, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCFieldSplitSchurFactType, __pyx_t_7) < 0) __PYX_ERR(39, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":111 * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * * class PCPatchConstructType(object): # <<<<<<<<<<<<<< * STAR = PC_PATCH_STAR * VANKA = PC_PATCH_VANKA */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__119); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__119, __pyx_n_s_PCPatchConstructType, __pyx_n_s_PCPatchConstructType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/PC.pyx":112 * * class PCPatchConstructType(object): * STAR = PC_PATCH_STAR # <<<<<<<<<<<<<< * VANKA = PC_PATCH_VANKA * PARDECOMP = PC_PATCH_PARDECOMP */ __pyx_t_7 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_STAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STAR, __pyx_t_7) < 0) __PYX_ERR(39, 112, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":113 * class PCPatchConstructType(object): * STAR = PC_PATCH_STAR * VANKA = PC_PATCH_VANKA # <<<<<<<<<<<<<< * PARDECOMP = PC_PATCH_PARDECOMP * USER = PC_PATCH_USER */ __pyx_t_7 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_VANKA); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VANKA, __pyx_t_7) < 0) __PYX_ERR(39, 113, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":114 * STAR = PC_PATCH_STAR * VANKA = PC_PATCH_VANKA * PARDECOMP = PC_PATCH_PARDECOMP # <<<<<<<<<<<<<< * USER = PC_PATCH_USER * PYTHON = PC_PATCH_PYTHON */ __pyx_t_7 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_PARDECOMP); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PARDECOMP, __pyx_t_7) < 0) __PYX_ERR(39, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":115 * VANKA = PC_PATCH_VANKA * PARDECOMP = PC_PATCH_PARDECOMP * USER = PC_PATCH_USER # <<<<<<<<<<<<<< * PYTHON = PC_PATCH_PYTHON * */ __pyx_t_7 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_USER); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_USER, __pyx_t_7) < 0) __PYX_ERR(39, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":116 * PARDECOMP = PC_PATCH_PARDECOMP * USER = PC_PATCH_USER * PYTHON = PC_PATCH_PYTHON # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_PCPatchConstructType(PC_PATCH_PYTHON); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PYTHON, __pyx_t_7) < 0) __PYX_ERR(39, 116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/PC.pyx":111 * FULL = PC_FIELDSPLIT_SCHUR_FACT_FULL * * class PCPatchConstructType(object): # <<<<<<<<<<<<<< * STAR = PC_PATCH_STAR * VANKA = PC_PATCH_VANKA */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PCPatchConstructType, __pyx_tuple__119, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(39, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PCPatchConstructType, __pyx_t_7) < 0) __PYX_ERR(39, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PC.pyx":122 * cdef class PC(Object): * * Type = PCType # <<<<<<<<<<<<<< * Side = PCSide * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(39, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":123 * * Type = PCType * Side = PCSide # <<<<<<<<<<<<<< * * ASMType = PCASMType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCSide); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_Side, __pyx_t_3) < 0) __PYX_ERR(39, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":125 * Side = PCSide * * ASMType = PCASMType # <<<<<<<<<<<<<< * GASMType = PCGASMType * MGType = PCMGType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCASMType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_ASMType, __pyx_t_3) < 0) __PYX_ERR(39, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":126 * * ASMType = PCASMType * GASMType = PCGASMType # <<<<<<<<<<<<<< * MGType = PCMGType * MGCycleType = PCMGCycleType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCGASMType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_GASMType, __pyx_t_3) < 0) __PYX_ERR(39, 126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":127 * ASMType = PCASMType * GASMType = PCGASMType * MGType = PCMGType # <<<<<<<<<<<<<< * MGCycleType = PCMGCycleType * GAMGType = PCGAMGType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCMGType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_MGType, __pyx_t_3) < 0) __PYX_ERR(39, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":128 * GASMType = PCGASMType * MGType = PCMGType * MGCycleType = PCMGCycleType # <<<<<<<<<<<<<< * GAMGType = PCGAMGType * CompositeType = PCCompositeType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCMGCycleType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_MGCycleType, __pyx_t_3) < 0) __PYX_ERR(39, 128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":129 * MGType = PCMGType * MGCycleType = PCMGCycleType * GAMGType = PCGAMGType # <<<<<<<<<<<<<< * CompositeType = PCCompositeType * SchurFactType = PCFieldSplitSchurFactType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCGAMGType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_GAMGType, __pyx_t_3) < 0) __PYX_ERR(39, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":130 * MGCycleType = PCMGCycleType * GAMGType = PCGAMGType * CompositeType = PCCompositeType # <<<<<<<<<<<<<< * SchurFactType = PCFieldSplitSchurFactType * SchurPreType = PCFieldSplitSchurPreType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCCompositeType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_CompositeType, __pyx_t_3) < 0) __PYX_ERR(39, 130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":131 * GAMGType = PCGAMGType * CompositeType = PCCompositeType * SchurFactType = PCFieldSplitSchurFactType # <<<<<<<<<<<<<< * SchurPreType = PCFieldSplitSchurPreType * PatchConstructType = PCPatchConstructType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCFieldSplitSchurFactType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_SchurFactType, __pyx_t_3) < 0) __PYX_ERR(39, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":132 * CompositeType = PCCompositeType * SchurFactType = PCFieldSplitSchurFactType * SchurPreType = PCFieldSplitSchurPreType # <<<<<<<<<<<<<< * PatchConstructType = PCPatchConstructType * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCFieldSplitSchurPreType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_SchurPreType, __pyx_t_3) < 0) __PYX_ERR(39, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":133 * SchurFactType = PCFieldSplitSchurFactType * SchurPreType = PCFieldSplitSchurPreType * PatchConstructType = PCPatchConstructType # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PCPatchConstructType); if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_PC->tp_dict, __pyx_n_s_PatchConstructType, __pyx_t_3) < 0) __PYX_ERR(39, 133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_PC); /* "PETSc/PC.pyx":792 * # -------------------------------------------------------------------- * * del PCType # <<<<<<<<<<<<<< * del PCSide * del PCASMType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCType) < 0) __PYX_ERR(39, 792, __pyx_L1_error) /* "PETSc/PC.pyx":793 * * del PCType * del PCSide # <<<<<<<<<<<<<< * del PCASMType * del PCGASMType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCSide) < 0) __PYX_ERR(39, 793, __pyx_L1_error) /* "PETSc/PC.pyx":794 * del PCType * del PCSide * del PCASMType # <<<<<<<<<<<<<< * del PCGASMType * del PCMGType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCASMType) < 0) __PYX_ERR(39, 794, __pyx_L1_error) /* "PETSc/PC.pyx":795 * del PCSide * del PCASMType * del PCGASMType # <<<<<<<<<<<<<< * del PCMGType * del PCMGCycleType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCGASMType) < 0) __PYX_ERR(39, 795, __pyx_L1_error) /* "PETSc/PC.pyx":796 * del PCASMType * del PCGASMType * del PCMGType # <<<<<<<<<<<<<< * del PCMGCycleType * del PCGAMGType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCMGType) < 0) __PYX_ERR(39, 796, __pyx_L1_error) /* "PETSc/PC.pyx":797 * del PCGASMType * del PCMGType * del PCMGCycleType # <<<<<<<<<<<<<< * del PCGAMGType * del PCCompositeType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCMGCycleType) < 0) __PYX_ERR(39, 797, __pyx_L1_error) /* "PETSc/PC.pyx":798 * del PCMGType * del PCMGCycleType * del PCGAMGType # <<<<<<<<<<<<<< * del PCCompositeType * del PCFieldSplitSchurPreType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCGAMGType) < 0) __PYX_ERR(39, 798, __pyx_L1_error) /* "PETSc/PC.pyx":799 * del PCMGCycleType * del PCGAMGType * del PCCompositeType # <<<<<<<<<<<<<< * del PCFieldSplitSchurPreType * del PCFieldSplitSchurFactType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCCompositeType) < 0) __PYX_ERR(39, 799, __pyx_L1_error) /* "PETSc/PC.pyx":800 * del PCGAMGType * del PCCompositeType * del PCFieldSplitSchurPreType # <<<<<<<<<<<<<< * del PCFieldSplitSchurFactType * del PCPatchConstructType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCFieldSplitSchurPreType) < 0) __PYX_ERR(39, 800, __pyx_L1_error) /* "PETSc/PC.pyx":801 * del PCCompositeType * del PCFieldSplitSchurPreType * del PCFieldSplitSchurFactType # <<<<<<<<<<<<<< * del PCPatchConstructType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCFieldSplitSchurFactType) < 0) __PYX_ERR(39, 801, __pyx_L1_error) /* "PETSc/PC.pyx":802 * del PCFieldSplitSchurPreType * del PCFieldSplitSchurFactType * del PCPatchConstructType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_PCPatchConstructType) < 0) __PYX_ERR(39, 802, __pyx_L1_error) /* "PETSc/KSP.pyx":3 * # -------------------------------------------------------------------- * * class KSPType(object): # <<<<<<<<<<<<<< * RICHARDSON = S_(KSPRICHARDSON) * CHEBYSHEV = S_(KSPCHEBYSHEV) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__120); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__120, __pyx_n_s_KSPType, __pyx_n_s_KSPType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/KSP.pyx":4 * * class KSPType(object): * RICHARDSON = S_(KSPRICHARDSON) # <<<<<<<<<<<<<< * CHEBYSHEV = S_(KSPCHEBYSHEV) * CG = S_(KSPCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPRICHARDSON); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RICHARDSON, __pyx_t_7) < 0) __PYX_ERR(40, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":5 * class KSPType(object): * RICHARDSON = S_(KSPRICHARDSON) * CHEBYSHEV = S_(KSPCHEBYSHEV) # <<<<<<<<<<<<<< * CG = S_(KSPCG) * GROPPCG = S_(KSPGROPPCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPCHEBYSHEV); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CHEBYSHEV, __pyx_t_7) < 0) __PYX_ERR(40, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":6 * RICHARDSON = S_(KSPRICHARDSON) * CHEBYSHEV = S_(KSPCHEBYSHEV) * CG = S_(KSPCG) # <<<<<<<<<<<<<< * GROPPCG = S_(KSPGROPPCG) * PIPECG = S_(KSPPIPECG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CG, __pyx_t_7) < 0) __PYX_ERR(40, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":7 * CHEBYSHEV = S_(KSPCHEBYSHEV) * CG = S_(KSPCG) * GROPPCG = S_(KSPGROPPCG) # <<<<<<<<<<<<<< * PIPECG = S_(KSPPIPECG) * PIPECGRR = S_(KSPPIPECGRR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPGROPPCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GROPPCG, __pyx_t_7) < 0) __PYX_ERR(40, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":8 * CG = S_(KSPCG) * GROPPCG = S_(KSPGROPPCG) * PIPECG = S_(KSPPIPECG) # <<<<<<<<<<<<<< * PIPECGRR = S_(KSPPIPECGRR) * PIPELCG = S_(KSPPIPELCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPECG, __pyx_t_7) < 0) __PYX_ERR(40, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":9 * GROPPCG = S_(KSPGROPPCG) * PIPECG = S_(KSPPIPECG) * PIPECGRR = S_(KSPPIPECGRR) # <<<<<<<<<<<<<< * PIPELCG = S_(KSPPIPELCG) * PIPEPRCG = S_(KSPPIPEPRCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECGRR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPECGRR, __pyx_t_7) < 0) __PYX_ERR(40, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":10 * PIPECG = S_(KSPPIPECG) * PIPECGRR = S_(KSPPIPECGRR) * PIPELCG = S_(KSPPIPELCG) # <<<<<<<<<<<<<< * PIPEPRCG = S_(KSPPIPEPRCG) * PIPECG2 = S_(KSPPIPECG2) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPELCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPELCG, __pyx_t_7) < 0) __PYX_ERR(40, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":11 * PIPECGRR = S_(KSPPIPECGRR) * PIPELCG = S_(KSPPIPELCG) * PIPEPRCG = S_(KSPPIPEPRCG) # <<<<<<<<<<<<<< * PIPECG2 = S_(KSPPIPECG2) * CGNE = S_(KSPCGNE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEPRCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPEPRCG, __pyx_t_7) < 0) __PYX_ERR(40, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":12 * PIPELCG = S_(KSPPIPELCG) * PIPEPRCG = S_(KSPPIPEPRCG) * PIPECG2 = S_(KSPPIPECG2) # <<<<<<<<<<<<<< * CGNE = S_(KSPCGNE) * NASH = S_(KSPNASH) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECG2); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPECG2, __pyx_t_7) < 0) __PYX_ERR(40, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":13 * PIPEPRCG = S_(KSPPIPEPRCG) * PIPECG2 = S_(KSPPIPECG2) * CGNE = S_(KSPCGNE) # <<<<<<<<<<<<<< * NASH = S_(KSPNASH) * STCG = S_(KSPSTCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGNE); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CGNE, __pyx_t_7) < 0) __PYX_ERR(40, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":14 * PIPECG2 = S_(KSPPIPECG2) * CGNE = S_(KSPCGNE) * NASH = S_(KSPNASH) # <<<<<<<<<<<<<< * STCG = S_(KSPSTCG) * GLTR = S_(KSPGLTR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPNASH); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NASH, __pyx_t_7) < 0) __PYX_ERR(40, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":15 * CGNE = S_(KSPCGNE) * NASH = S_(KSPNASH) * STCG = S_(KSPSTCG) # <<<<<<<<<<<<<< * GLTR = S_(KSPGLTR) * FCG = S_(KSPFCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPSTCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STCG, __pyx_t_7) < 0) __PYX_ERR(40, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":16 * NASH = S_(KSPNASH) * STCG = S_(KSPSTCG) * GLTR = S_(KSPGLTR) # <<<<<<<<<<<<<< * FCG = S_(KSPFCG) * PIPEFCG = S_(KSPPIPEFCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPGLTR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GLTR, __pyx_t_7) < 0) __PYX_ERR(40, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":17 * STCG = S_(KSPSTCG) * GLTR = S_(KSPGLTR) * FCG = S_(KSPFCG) # <<<<<<<<<<<<<< * PIPEFCG = S_(KSPPIPEFCG) * GMRES = S_(KSPGMRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPFCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FCG, __pyx_t_7) < 0) __PYX_ERR(40, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":18 * GLTR = S_(KSPGLTR) * FCG = S_(KSPFCG) * PIPEFCG = S_(KSPPIPEFCG) # <<<<<<<<<<<<<< * GMRES = S_(KSPGMRES) * PIPEFGMRES = S_(KSPPIPEFGMRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEFCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPEFCG, __pyx_t_7) < 0) __PYX_ERR(40, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":19 * FCG = S_(KSPFCG) * PIPEFCG = S_(KSPPIPEFCG) * GMRES = S_(KSPGMRES) # <<<<<<<<<<<<<< * PIPEFGMRES = S_(KSPPIPEFGMRES) * FGMRES = S_(KSPFGMRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPGMRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GMRES, __pyx_t_7) < 0) __PYX_ERR(40, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":20 * PIPEFCG = S_(KSPPIPEFCG) * GMRES = S_(KSPGMRES) * PIPEFGMRES = S_(KSPPIPEFGMRES) # <<<<<<<<<<<<<< * FGMRES = S_(KSPFGMRES) * LGMRES = S_(KSPLGMRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEFGMRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPEFGMRES, __pyx_t_7) < 0) __PYX_ERR(40, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":21 * GMRES = S_(KSPGMRES) * PIPEFGMRES = S_(KSPPIPEFGMRES) * FGMRES = S_(KSPFGMRES) # <<<<<<<<<<<<<< * LGMRES = S_(KSPLGMRES) * DGMRES = S_(KSPDGMRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPFGMRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FGMRES, __pyx_t_7) < 0) __PYX_ERR(40, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":22 * PIPEFGMRES = S_(KSPPIPEFGMRES) * FGMRES = S_(KSPFGMRES) * LGMRES = S_(KSPLGMRES) # <<<<<<<<<<<<<< * DGMRES = S_(KSPDGMRES) * PGMRES = S_(KSPPGMRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPLGMRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LGMRES, __pyx_t_7) < 0) __PYX_ERR(40, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":23 * FGMRES = S_(KSPFGMRES) * LGMRES = S_(KSPLGMRES) * DGMRES = S_(KSPDGMRES) # <<<<<<<<<<<<<< * PGMRES = S_(KSPPGMRES) * TCQMR = S_(KSPTCQMR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPDGMRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DGMRES, __pyx_t_7) < 0) __PYX_ERR(40, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":24 * LGMRES = S_(KSPLGMRES) * DGMRES = S_(KSPDGMRES) * PGMRES = S_(KSPPGMRES) # <<<<<<<<<<<<<< * TCQMR = S_(KSPTCQMR) * BCGS = S_(KSPBCGS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPGMRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PGMRES, __pyx_t_7) < 0) __PYX_ERR(40, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":25 * DGMRES = S_(KSPDGMRES) * PGMRES = S_(KSPPGMRES) * TCQMR = S_(KSPTCQMR) # <<<<<<<<<<<<<< * BCGS = S_(KSPBCGS) * IBCGS = S_(KSPIBCGS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPTCQMR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TCQMR, __pyx_t_7) < 0) __PYX_ERR(40, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":26 * PGMRES = S_(KSPPGMRES) * TCQMR = S_(KSPTCQMR) * BCGS = S_(KSPBCGS) # <<<<<<<<<<<<<< * IBCGS = S_(KSPIBCGS) * FBCGS = S_(KSPFBCGS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPBCGS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BCGS, __pyx_t_7) < 0) __PYX_ERR(40, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":27 * TCQMR = S_(KSPTCQMR) * BCGS = S_(KSPBCGS) * IBCGS = S_(KSPIBCGS) # <<<<<<<<<<<<<< * FBCGS = S_(KSPFBCGS) * FBCGSR = S_(KSPFBCGSR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPIBCGS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IBCGS, __pyx_t_7) < 0) __PYX_ERR(40, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":28 * BCGS = S_(KSPBCGS) * IBCGS = S_(KSPIBCGS) * FBCGS = S_(KSPFBCGS) # <<<<<<<<<<<<<< * FBCGSR = S_(KSPFBCGSR) * BCGSL = S_(KSPBCGSL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPFBCGS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FBCGS, __pyx_t_7) < 0) __PYX_ERR(40, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":29 * IBCGS = S_(KSPIBCGS) * FBCGS = S_(KSPFBCGS) * FBCGSR = S_(KSPFBCGSR) # <<<<<<<<<<<<<< * BCGSL = S_(KSPBCGSL) * PIPEBCGS = S_(KSPPIPEBCGS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPFBCGSR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FBCGSR, __pyx_t_7) < 0) __PYX_ERR(40, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":30 * FBCGS = S_(KSPFBCGS) * FBCGSR = S_(KSPFBCGSR) * BCGSL = S_(KSPBCGSL) # <<<<<<<<<<<<<< * PIPEBCGS = S_(KSPPIPEBCGS) * CGS = S_(KSPCGS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPBCGSL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BCGSL, __pyx_t_7) < 0) __PYX_ERR(40, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":31 * FBCGSR = S_(KSPFBCGSR) * BCGSL = S_(KSPBCGSL) * PIPEBCGS = S_(KSPPIPEBCGS) # <<<<<<<<<<<<<< * CGS = S_(KSPCGS) * TFQMR = S_(KSPTFQMR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEBCGS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPEBCGS, __pyx_t_7) < 0) __PYX_ERR(40, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":32 * BCGSL = S_(KSPBCGSL) * PIPEBCGS = S_(KSPPIPEBCGS) * CGS = S_(KSPCGS) # <<<<<<<<<<<<<< * TFQMR = S_(KSPTFQMR) * CR = S_(KSPCR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CGS, __pyx_t_7) < 0) __PYX_ERR(40, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":33 * PIPEBCGS = S_(KSPPIPEBCGS) * CGS = S_(KSPCGS) * TFQMR = S_(KSPTFQMR) # <<<<<<<<<<<<<< * CR = S_(KSPCR) * PIPECR = S_(KSPPIPECR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPTFQMR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TFQMR, __pyx_t_7) < 0) __PYX_ERR(40, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":34 * CGS = S_(KSPCGS) * TFQMR = S_(KSPTFQMR) * CR = S_(KSPCR) # <<<<<<<<<<<<<< * PIPECR = S_(KSPPIPECR) * LSQR = S_(KSPLSQR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPCR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CR, __pyx_t_7) < 0) __PYX_ERR(40, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":35 * TFQMR = S_(KSPTFQMR) * CR = S_(KSPCR) * PIPECR = S_(KSPPIPECR) # <<<<<<<<<<<<<< * LSQR = S_(KSPLSQR) * PREONLY = S_(KSPPREONLY) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPECR, __pyx_t_7) < 0) __PYX_ERR(40, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":36 * CR = S_(KSPCR) * PIPECR = S_(KSPPIPECR) * LSQR = S_(KSPLSQR) # <<<<<<<<<<<<<< * PREONLY = S_(KSPPREONLY) * QCG = S_(KSPQCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPLSQR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LSQR, __pyx_t_7) < 0) __PYX_ERR(40, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":37 * PIPECR = S_(KSPPIPECR) * LSQR = S_(KSPLSQR) * PREONLY = S_(KSPPREONLY) # <<<<<<<<<<<<<< * QCG = S_(KSPQCG) * BICG = S_(KSPBICG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPREONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PREONLY, __pyx_t_7) < 0) __PYX_ERR(40, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":38 * LSQR = S_(KSPLSQR) * PREONLY = S_(KSPPREONLY) * QCG = S_(KSPQCG) # <<<<<<<<<<<<<< * BICG = S_(KSPBICG) * MINRES = S_(KSPMINRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPQCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_QCG, __pyx_t_7) < 0) __PYX_ERR(40, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":39 * PREONLY = S_(KSPPREONLY) * QCG = S_(KSPQCG) * BICG = S_(KSPBICG) # <<<<<<<<<<<<<< * MINRES = S_(KSPMINRES) * SYMMLQ = S_(KSPSYMMLQ) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPBICG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BICG, __pyx_t_7) < 0) __PYX_ERR(40, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":40 * QCG = S_(KSPQCG) * BICG = S_(KSPBICG) * MINRES = S_(KSPMINRES) # <<<<<<<<<<<<<< * SYMMLQ = S_(KSPSYMMLQ) * LCD = S_(KSPLCD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPMINRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MINRES, __pyx_t_7) < 0) __PYX_ERR(40, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":41 * BICG = S_(KSPBICG) * MINRES = S_(KSPMINRES) * SYMMLQ = S_(KSPSYMMLQ) # <<<<<<<<<<<<<< * LCD = S_(KSPLCD) * PYTHON = S_(KSPPYTHON) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPSYMMLQ); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SYMMLQ, __pyx_t_7) < 0) __PYX_ERR(40, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":42 * MINRES = S_(KSPMINRES) * SYMMLQ = S_(KSPSYMMLQ) * LCD = S_(KSPLCD) # <<<<<<<<<<<<<< * PYTHON = S_(KSPPYTHON) * GCR = S_(KSPGCR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPLCD); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LCD, __pyx_t_7) < 0) __PYX_ERR(40, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":43 * SYMMLQ = S_(KSPSYMMLQ) * LCD = S_(KSPLCD) * PYTHON = S_(KSPPYTHON) # <<<<<<<<<<<<<< * GCR = S_(KSPGCR) * PIPEGCR = S_(KSPPIPEGCR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPYTHON); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PYTHON, __pyx_t_7) < 0) __PYX_ERR(40, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":44 * LCD = S_(KSPLCD) * PYTHON = S_(KSPPYTHON) * GCR = S_(KSPGCR) # <<<<<<<<<<<<<< * PIPEGCR = S_(KSPPIPEGCR) * TSIRM = S_(KSPTSIRM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPGCR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GCR, __pyx_t_7) < 0) __PYX_ERR(40, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":45 * PYTHON = S_(KSPPYTHON) * GCR = S_(KSPGCR) * PIPEGCR = S_(KSPPIPEGCR) # <<<<<<<<<<<<<< * TSIRM = S_(KSPTSIRM) * CGLS = S_(KSPCGLS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEGCR); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIPEGCR, __pyx_t_7) < 0) __PYX_ERR(40, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":46 * GCR = S_(KSPGCR) * PIPEGCR = S_(KSPPIPEGCR) * TSIRM = S_(KSPTSIRM) # <<<<<<<<<<<<<< * CGLS = S_(KSPCGLS) * FETIDP = S_(KSPFETIDP) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPTSIRM); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TSIRM, __pyx_t_7) < 0) __PYX_ERR(40, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":47 * PIPEGCR = S_(KSPPIPEGCR) * TSIRM = S_(KSPTSIRM) * CGLS = S_(KSPCGLS) # <<<<<<<<<<<<<< * FETIDP = S_(KSPFETIDP) * HPDDM = S_(KSPHPDDM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGLS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CGLS, __pyx_t_7) < 0) __PYX_ERR(40, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":48 * TSIRM = S_(KSPTSIRM) * CGLS = S_(KSPCGLS) * FETIDP = S_(KSPFETIDP) # <<<<<<<<<<<<<< * HPDDM = S_(KSPHPDDM) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPFETIDP); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FETIDP, __pyx_t_7) < 0) __PYX_ERR(40, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":49 * CGLS = S_(KSPCGLS) * FETIDP = S_(KSPFETIDP) * HPDDM = S_(KSPHPDDM) # <<<<<<<<<<<<<< * * class KSPNormType(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(KSPHPDDM); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_HPDDM, __pyx_t_7) < 0) __PYX_ERR(40, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":3 * # -------------------------------------------------------------------- * * class KSPType(object): # <<<<<<<<<<<<<< * RICHARDSON = S_(KSPRICHARDSON) * CHEBYSHEV = S_(KSPCHEBYSHEV) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_KSPType, __pyx_tuple__120, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KSPType, __pyx_t_7) < 0) __PYX_ERR(40, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":51 * HPDDM = S_(KSPHPDDM) * * class KSPNormType(object): # <<<<<<<<<<<<<< * # native * NORM_DEFAULT = KSP_NORM_DEFAULT */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__121); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__121, __pyx_n_s_KSPNormType, __pyx_n_s_KSPNormType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/KSP.pyx":53 * class KSPNormType(object): * # native * NORM_DEFAULT = KSP_NORM_DEFAULT # <<<<<<<<<<<<<< * NORM_NONE = KSP_NORM_NONE * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED */ __pyx_t_7 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_DEFAULT); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_DEFAULT, __pyx_t_7) < 0) __PYX_ERR(40, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":54 * # native * NORM_DEFAULT = KSP_NORM_DEFAULT * NORM_NONE = KSP_NORM_NONE # <<<<<<<<<<<<<< * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED */ __pyx_t_7 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_NONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_NONE, __pyx_t_7) < 0) __PYX_ERR(40, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":55 * NORM_DEFAULT = KSP_NORM_DEFAULT * NORM_NONE = KSP_NORM_NONE * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED # <<<<<<<<<<<<<< * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED * NORM_NATURAL = KSP_NORM_NATURAL */ __pyx_t_7 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_PRECONDITIONED); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_PRECONDITIONED, __pyx_t_7) < 0) __PYX_ERR(40, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":56 * NORM_NONE = KSP_NORM_NONE * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED # <<<<<<<<<<<<<< * NORM_NATURAL = KSP_NORM_NATURAL * # aliases */ __pyx_t_7 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_UNPRECONDITIONED); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_UNPRECONDITIONED, __pyx_t_7) < 0) __PYX_ERR(40, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":57 * NORM_PRECONDITIONED = KSP_NORM_PRECONDITIONED * NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED * NORM_NATURAL = KSP_NORM_NATURAL # <<<<<<<<<<<<<< * # aliases * DEFAULT = NORM_DEFAULT */ __pyx_t_7 = __Pyx_PyInt_From_KSPNormType(KSP_NORM_NATURAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_NATURAL, __pyx_t_7) < 0) __PYX_ERR(40, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":59 * NORM_NATURAL = KSP_NORM_NATURAL * # aliases * DEFAULT = NORM_DEFAULT # <<<<<<<<<<<<<< * NONE = NO = NORM_NONE * PRECONDITIONED = NORM_PRECONDITIONED */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_DEFAULT); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_DEFAULT); } if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DEFAULT, __pyx_t_7) < 0) __PYX_ERR(40, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":60 * # aliases * DEFAULT = NORM_DEFAULT * NONE = NO = NORM_NONE # <<<<<<<<<<<<<< * PRECONDITIONED = NORM_PRECONDITIONED * UNPRECONDITIONED = NORM_UNPRECONDITIONED */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_NONE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_NONE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(40, 60, __pyx_L1_error) if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NO, __pyx_t_7) < 0) __PYX_ERR(40, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":61 * DEFAULT = NORM_DEFAULT * NONE = NO = NORM_NONE * PRECONDITIONED = NORM_PRECONDITIONED # <<<<<<<<<<<<<< * UNPRECONDITIONED = NORM_UNPRECONDITIONED * NATURAL = NORM_NATURAL */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_PRECONDITIONED); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_PRECONDITIONED); } if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PRECONDITIONED, __pyx_t_7) < 0) __PYX_ERR(40, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":62 * NONE = NO = NORM_NONE * PRECONDITIONED = NORM_PRECONDITIONED * UNPRECONDITIONED = NORM_UNPRECONDITIONED # <<<<<<<<<<<<<< * NATURAL = NORM_NATURAL * */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_UNPRECONDITIONED); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_UNPRECONDITIONED); } if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UNPRECONDITIONED, __pyx_t_7) < 0) __PYX_ERR(40, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":63 * PRECONDITIONED = NORM_PRECONDITIONED * UNPRECONDITIONED = NORM_UNPRECONDITIONED * NATURAL = NORM_NATURAL # <<<<<<<<<<<<<< * * class KSPConvergedReason(object): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_NATURAL); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_NATURAL); } if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NATURAL, __pyx_t_7) < 0) __PYX_ERR(40, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":51 * HPDDM = S_(KSPHPDDM) * * class KSPNormType(object): # <<<<<<<<<<<<<< * # native * NORM_DEFAULT = KSP_NORM_DEFAULT */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_KSPNormType, __pyx_tuple__121, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KSPNormType, __pyx_t_7) < 0) __PYX_ERR(40, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":65 * NATURAL = NORM_NATURAL * * class KSPConvergedReason(object): # <<<<<<<<<<<<<< * #iterating * CONVERGED_ITERATING = KSP_CONVERGED_ITERATING */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__122); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__122, __pyx_n_s_KSPConvergedReason, __pyx_n_s_KSPConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/KSP.pyx":67 * class KSPConvergedReason(object): * #iterating * CONVERGED_ITERATING = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * ITERATING = KSP_CONVERGED_ITERATING * # converged */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ITERATING); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_7) < 0) __PYX_ERR(40, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":68 * #iterating * CONVERGED_ITERATING = KSP_CONVERGED_ITERATING * ITERATING = KSP_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # converged * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ITERATING); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ITERATING, __pyx_t_7) < 0) __PYX_ERR(40, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":70 * ITERATING = KSP_CONVERGED_ITERATING * # converged * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL # <<<<<<<<<<<<<< * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL * CONVERGED_RTOL = KSP_CONVERGED_RTOL */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_RTOL_NORMAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_RTOL_NORMAL, __pyx_t_7) < 0) __PYX_ERR(40, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":71 * # converged * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL # <<<<<<<<<<<<<< * CONVERGED_RTOL = KSP_CONVERGED_RTOL * CONVERGED_ATOL = KSP_CONVERGED_ATOL */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ATOL_NORMAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ATOL_NORMAL, __pyx_t_7) < 0) __PYX_ERR(40, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":72 * CONVERGED_RTOL_NORMAL = KSP_CONVERGED_RTOL_NORMAL * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL * CONVERGED_RTOL = KSP_CONVERGED_RTOL # <<<<<<<<<<<<<< * CONVERGED_ATOL = KSP_CONVERGED_ATOL * CONVERGED_ITS = KSP_CONVERGED_ITS */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_RTOL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_RTOL, __pyx_t_7) < 0) __PYX_ERR(40, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":73 * CONVERGED_ATOL_NORMAL = KSP_CONVERGED_ATOL_NORMAL * CONVERGED_RTOL = KSP_CONVERGED_RTOL * CONVERGED_ATOL = KSP_CONVERGED_ATOL # <<<<<<<<<<<<<< * CONVERGED_ITS = KSP_CONVERGED_ITS * CONVERGED_CG_NEG_CURVE = KSP_CONVERGED_CG_NEG_CURVE */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ATOL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ATOL, __pyx_t_7) < 0) __PYX_ERR(40, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":74 * CONVERGED_RTOL = KSP_CONVERGED_RTOL * CONVERGED_ATOL = KSP_CONVERGED_ATOL * CONVERGED_ITS = KSP_CONVERGED_ITS # <<<<<<<<<<<<<< * CONVERGED_CG_NEG_CURVE = KSP_CONVERGED_CG_NEG_CURVE * CONVERGED_CG_CONSTRAINED = KSP_CONVERGED_CG_CONSTRAINED */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_ITS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ITS, __pyx_t_7) < 0) __PYX_ERR(40, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":75 * CONVERGED_ATOL = KSP_CONVERGED_ATOL * CONVERGED_ITS = KSP_CONVERGED_ITS * CONVERGED_CG_NEG_CURVE = KSP_CONVERGED_CG_NEG_CURVE # <<<<<<<<<<<<<< * CONVERGED_CG_CONSTRAINED = KSP_CONVERGED_CG_CONSTRAINED * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_CG_NEG_CURVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_CG_NEG_CURVE, __pyx_t_7) < 0) __PYX_ERR(40, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":76 * CONVERGED_ITS = KSP_CONVERGED_ITS * CONVERGED_CG_NEG_CURVE = KSP_CONVERGED_CG_NEG_CURVE * CONVERGED_CG_CONSTRAINED = KSP_CONVERGED_CG_CONSTRAINED # <<<<<<<<<<<<<< * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_CG_CONSTRAINED); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_CG_CONSTRAINED, __pyx_t_7) < 0) __PYX_ERR(40, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":77 * CONVERGED_CG_NEG_CURVE = KSP_CONVERGED_CG_NEG_CURVE * CONVERGED_CG_CONSTRAINED = KSP_CONVERGED_CG_CONSTRAINED * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH # <<<<<<<<<<<<<< * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN * # diverged */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_STEP_LENGTH); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_STEP_LENGTH, __pyx_t_7) < 0) __PYX_ERR(40, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":78 * CONVERGED_CG_CONSTRAINED = KSP_CONVERGED_CG_CONSTRAINED * CONVERGED_STEP_LENGTH = KSP_CONVERGED_STEP_LENGTH * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN # <<<<<<<<<<<<<< * # diverged * DIVERGED_NULL = KSP_DIVERGED_NULL */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_CONVERGED_HAPPY_BREAKDOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_HAPPY_BREAKDOWN, __pyx_t_7) < 0) __PYX_ERR(40, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":80 * CONVERGED_HAPPY_BREAKDOWN = KSP_CONVERGED_HAPPY_BREAKDOWN * # diverged * DIVERGED_NULL = KSP_DIVERGED_NULL # <<<<<<<<<<<<<< * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT * DIVERGED_DTOL = KSP_DIVERGED_DTOL */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_NULL, __pyx_t_7) < 0) __PYX_ERR(40, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":81 * # diverged * DIVERGED_NULL = KSP_DIVERGED_NULL * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT # <<<<<<<<<<<<<< * DIVERGED_DTOL = KSP_DIVERGED_DTOL * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_ITS); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_MAX_IT, __pyx_t_7) < 0) __PYX_ERR(40, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":82 * DIVERGED_NULL = KSP_DIVERGED_NULL * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT * DIVERGED_DTOL = KSP_DIVERGED_DTOL # <<<<<<<<<<<<<< * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_DTOL); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_DTOL, __pyx_t_7) < 0) __PYX_ERR(40, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":83 * DIVERGED_MAX_IT = KSP_DIVERGED_MAX_IT * DIVERGED_DTOL = KSP_DIVERGED_DTOL * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN # <<<<<<<<<<<<<< * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_BREAKDOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_BREAKDOWN, __pyx_t_7) < 0) __PYX_ERR(40, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":84 * DIVERGED_DTOL = KSP_DIVERGED_DTOL * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG # <<<<<<<<<<<<<< * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_BREAKDOWN_BICG); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_BREAKDOWN_BICG, __pyx_t_7) < 0) __PYX_ERR(40, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":85 * DIVERGED_BREAKDOWN = KSP_DIVERGED_BREAKDOWN * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC # <<<<<<<<<<<<<< * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_NONSYMMETRIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_NONSYMMETRIC, __pyx_t_7) < 0) __PYX_ERR(40, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":86 * DIVERGED_BREAKDOWN_BICG = KSP_DIVERGED_BREAKDOWN_BICG * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC # <<<<<<<<<<<<<< * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_INDEFINITE_PC); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_INDEFINITE_PC, __pyx_t_7) < 0) __PYX_ERR(40, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":87 * DIVERGED_NONSYMMETRIC = KSP_DIVERGED_NONSYMMETRIC * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF # <<<<<<<<<<<<<< * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_NANORINF); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_NANORINF, __pyx_t_7) < 0) __PYX_ERR(40, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":88 * DIVERGED_INDEFINITE_PC = KSP_DIVERGED_INDEFINITE_PC * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT # <<<<<<<<<<<<<< * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED * */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_INDEFINITE_MAT); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_INDEFINITE_MAT, __pyx_t_7) < 0) __PYX_ERR(40, 88, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":89 * DIVERGED_NANORINF = KSP_DIVERGED_NANORINF * DIVERGED_INDEFINITE_MAT = KSP_DIVERGED_INDEFINITE_MAT * DIVERGED_PCSETUP_FAILED = KSP_DIVERGED_PC_FAILED # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_KSPConvergedReason(KSP_DIVERGED_PC_FAILED); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_PCSETUP_FAILED, __pyx_t_7) < 0) __PYX_ERR(40, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/KSP.pyx":65 * NATURAL = NORM_NATURAL * * class KSPConvergedReason(object): # <<<<<<<<<<<<<< * #iterating * CONVERGED_ITERATING = KSP_CONVERGED_ITERATING */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_KSPConvergedReason, __pyx_tuple__122, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(40, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KSPConvergedReason, __pyx_t_7) < 0) __PYX_ERR(40, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/KSP.pyx":95 * cdef class KSP(Object): * * Type = KSPType # <<<<<<<<<<<<<< * NormType = KSPNormType * ConvergedReason = KSPConvergedReason */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KSPType); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(40, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "PETSc/KSP.pyx":96 * * Type = KSPType * NormType = KSPNormType # <<<<<<<<<<<<<< * ConvergedReason = KSPConvergedReason * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KSPNormType); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP->tp_dict, __pyx_n_s_NormType, __pyx_t_3) < 0) __PYX_ERR(40, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "PETSc/KSP.pyx":97 * Type = KSPType * NormType = KSPNormType * ConvergedReason = KSPConvergedReason # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KSPConvergedReason); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_KSP->tp_dict, __pyx_n_s_ConvergedReason, __pyx_t_3) < 0) __PYX_ERR(40, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_KSP); /* "PETSc/KSP.pyx":666 * # -------------------------------------------------------------------- * * del KSPType # <<<<<<<<<<<<<< * del KSPNormType * del KSPConvergedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_KSPType) < 0) __PYX_ERR(40, 666, __pyx_L1_error) /* "PETSc/KSP.pyx":667 * * del KSPType * del KSPNormType # <<<<<<<<<<<<<< * del KSPConvergedReason * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_KSPNormType) < 0) __PYX_ERR(40, 667, __pyx_L1_error) /* "PETSc/KSP.pyx":668 * del KSPType * del KSPNormType * del KSPConvergedReason # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_KSPConvergedReason) < 0) __PYX_ERR(40, 668, __pyx_L1_error) /* "PETSc/SNES.pyx":3 * # -------------------------------------------------------------------- * * class SNESType(object): # <<<<<<<<<<<<<< * NEWTONLS = S_(SNESNEWTONLS) * NEWTONTR = S_(SNESNEWTONTR) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__123); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__123, __pyx_n_s_SNESType, __pyx_n_s_SNESType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/SNES.pyx":4 * * class SNESType(object): * NEWTONLS = S_(SNESNEWTONLS) # <<<<<<<<<<<<<< * NEWTONTR = S_(SNESNEWTONTR) * PYTHON = S_(SNESPYTHON) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESNEWTONLS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEWTONLS, __pyx_t_7) < 0) __PYX_ERR(41, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":5 * class SNESType(object): * NEWTONLS = S_(SNESNEWTONLS) * NEWTONTR = S_(SNESNEWTONTR) # <<<<<<<<<<<<<< * PYTHON = S_(SNESPYTHON) * NRICHARDSON = S_(SNESNRICHARDSON) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESNEWTONTR); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NEWTONTR, __pyx_t_7) < 0) __PYX_ERR(41, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":6 * NEWTONLS = S_(SNESNEWTONLS) * NEWTONTR = S_(SNESNEWTONTR) * PYTHON = S_(SNESPYTHON) # <<<<<<<<<<<<<< * NRICHARDSON = S_(SNESNRICHARDSON) * KSPONLY = S_(SNESKSPONLY) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESPYTHON); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PYTHON, __pyx_t_7) < 0) __PYX_ERR(41, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":7 * NEWTONTR = S_(SNESNEWTONTR) * PYTHON = S_(SNESPYTHON) * NRICHARDSON = S_(SNESNRICHARDSON) # <<<<<<<<<<<<<< * KSPONLY = S_(SNESKSPONLY) * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESNRICHARDSON); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NRICHARDSON, __pyx_t_7) < 0) __PYX_ERR(41, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":8 * PYTHON = S_(SNESPYTHON) * NRICHARDSON = S_(SNESNRICHARDSON) * KSPONLY = S_(SNESKSPONLY) # <<<<<<<<<<<<<< * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) * VINEWTONRSLS = S_(SNESVINEWTONRSLS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESKSPONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KSPONLY, __pyx_t_7) < 0) __PYX_ERR(41, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":9 * NRICHARDSON = S_(SNESNRICHARDSON) * KSPONLY = S_(SNESKSPONLY) * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) # <<<<<<<<<<<<<< * VINEWTONRSLS = S_(SNESVINEWTONRSLS) * VINEWTONSSLS = S_(SNESVINEWTONSSLS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESKSPTRANSPOSEONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_KSPTRANSPOSEONLY, __pyx_t_7) < 0) __PYX_ERR(41, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":10 * KSPONLY = S_(SNESKSPONLY) * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) * VINEWTONRSLS = S_(SNESVINEWTONRSLS) # <<<<<<<<<<<<<< * VINEWTONSSLS = S_(SNESVINEWTONSSLS) * NGMRES = S_(SNESNGMRES) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESVINEWTONRSLS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VINEWTONRSLS, __pyx_t_7) < 0) __PYX_ERR(41, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":11 * KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY) * VINEWTONRSLS = S_(SNESVINEWTONRSLS) * VINEWTONSSLS = S_(SNESVINEWTONSSLS) # <<<<<<<<<<<<<< * NGMRES = S_(SNESNGMRES) * QN = S_(SNESQN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESVINEWTONSSLS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VINEWTONSSLS, __pyx_t_7) < 0) __PYX_ERR(41, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":12 * VINEWTONRSLS = S_(SNESVINEWTONRSLS) * VINEWTONSSLS = S_(SNESVINEWTONSSLS) * NGMRES = S_(SNESNGMRES) # <<<<<<<<<<<<<< * QN = S_(SNESQN) * SHELL = S_(SNESSHELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESNGMRES); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NGMRES, __pyx_t_7) < 0) __PYX_ERR(41, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":13 * VINEWTONSSLS = S_(SNESVINEWTONSSLS) * NGMRES = S_(SNESNGMRES) * QN = S_(SNESQN) # <<<<<<<<<<<<<< * SHELL = S_(SNESSHELL) * NGS = S_(SNESNGS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESQN); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_QN, __pyx_t_7) < 0) __PYX_ERR(41, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":14 * NGMRES = S_(SNESNGMRES) * QN = S_(SNESQN) * SHELL = S_(SNESSHELL) # <<<<<<<<<<<<<< * NGS = S_(SNESNGS) * NCG = S_(SNESNCG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESSHELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SHELL, __pyx_t_7) < 0) __PYX_ERR(41, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":15 * QN = S_(SNESQN) * SHELL = S_(SNESSHELL) * NGS = S_(SNESNGS) # <<<<<<<<<<<<<< * NCG = S_(SNESNCG) * FAS = S_(SNESFAS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESNGS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NGS, __pyx_t_7) < 0) __PYX_ERR(41, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":16 * SHELL = S_(SNESSHELL) * NGS = S_(SNESNGS) * NCG = S_(SNESNCG) # <<<<<<<<<<<<<< * FAS = S_(SNESFAS) * MS = S_(SNESMS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESNCG); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NCG, __pyx_t_7) < 0) __PYX_ERR(41, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":17 * NGS = S_(SNESNGS) * NCG = S_(SNESNCG) * FAS = S_(SNESFAS) # <<<<<<<<<<<<<< * MS = S_(SNESMS) * NASM = S_(SNESNASM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESFAS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FAS, __pyx_t_7) < 0) __PYX_ERR(41, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":18 * NCG = S_(SNESNCG) * FAS = S_(SNESFAS) * MS = S_(SNESMS) # <<<<<<<<<<<<<< * NASM = S_(SNESNASM) * ANDERSON = S_(SNESANDERSON) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESMS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MS, __pyx_t_7) < 0) __PYX_ERR(41, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":19 * FAS = S_(SNESFAS) * MS = S_(SNESMS) * NASM = S_(SNESNASM) # <<<<<<<<<<<<<< * ANDERSON = S_(SNESANDERSON) * ASPIN = S_(SNESASPIN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESNASM); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NASM, __pyx_t_7) < 0) __PYX_ERR(41, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":20 * MS = S_(SNESMS) * NASM = S_(SNESNASM) * ANDERSON = S_(SNESANDERSON) # <<<<<<<<<<<<<< * ASPIN = S_(SNESASPIN) * COMPOSITE = S_(SNESCOMPOSITE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESANDERSON); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ANDERSON, __pyx_t_7) < 0) __PYX_ERR(41, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":21 * NASM = S_(SNESNASM) * ANDERSON = S_(SNESANDERSON) * ASPIN = S_(SNESASPIN) # <<<<<<<<<<<<<< * COMPOSITE = S_(SNESCOMPOSITE) * PATCH = S_(SNESPATCH) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESASPIN); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ASPIN, __pyx_t_7) < 0) __PYX_ERR(41, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":22 * ANDERSON = S_(SNESANDERSON) * ASPIN = S_(SNESASPIN) * COMPOSITE = S_(SNESCOMPOSITE) # <<<<<<<<<<<<<< * PATCH = S_(SNESPATCH) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESCOMPOSITE); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COMPOSITE, __pyx_t_7) < 0) __PYX_ERR(41, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":23 * ASPIN = S_(SNESASPIN) * COMPOSITE = S_(SNESCOMPOSITE) * PATCH = S_(SNESPATCH) # <<<<<<<<<<<<<< * * class SNESNormSchedule(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(SNESPATCH); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PATCH, __pyx_t_7) < 0) __PYX_ERR(41, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":3 * # -------------------------------------------------------------------- * * class SNESType(object): # <<<<<<<<<<<<<< * NEWTONLS = S_(SNESNEWTONLS) * NEWTONTR = S_(SNESNEWTONTR) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SNESType, __pyx_tuple__123, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNESType, __pyx_t_7) < 0) __PYX_ERR(41, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":25 * PATCH = S_(SNESPATCH) * * class SNESNormSchedule(object): # <<<<<<<<<<<<<< * # native * NORM_DEFAULT = SNES_NORM_DEFAULT */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__124); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__124, __pyx_n_s_SNESNormSchedule, __pyx_n_s_SNESNormSchedule, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/SNES.pyx":27 * class SNESNormSchedule(object): * # native * NORM_DEFAULT = SNES_NORM_DEFAULT # <<<<<<<<<<<<<< * NORM_NONE = SNES_NORM_NONE * NORM_ALWAYS = SNES_NORM_ALWAYS */ __pyx_t_7 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_DEFAULT); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_DEFAULT, __pyx_t_7) < 0) __PYX_ERR(41, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":28 * # native * NORM_DEFAULT = SNES_NORM_DEFAULT * NORM_NONE = SNES_NORM_NONE # <<<<<<<<<<<<<< * NORM_ALWAYS = SNES_NORM_ALWAYS * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY */ __pyx_t_7 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_NONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_NONE, __pyx_t_7) < 0) __PYX_ERR(41, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":29 * NORM_DEFAULT = SNES_NORM_DEFAULT * NORM_NONE = SNES_NORM_NONE * NORM_ALWAYS = SNES_NORM_ALWAYS # <<<<<<<<<<<<<< * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY */ __pyx_t_7 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_ALWAYS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_ALWAYS, __pyx_t_7) < 0) __PYX_ERR(41, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":30 * NORM_NONE = SNES_NORM_NONE * NORM_ALWAYS = SNES_NORM_ALWAYS * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY # <<<<<<<<<<<<<< * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY */ __pyx_t_7 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_INITIAL_ONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_INITIAL_ONLY, __pyx_t_7) < 0) __PYX_ERR(41, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":31 * NORM_ALWAYS = SNES_NORM_ALWAYS * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY # <<<<<<<<<<<<<< * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY * # aliases */ __pyx_t_7 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_FINAL_ONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_FINAL_ONLY, __pyx_t_7) < 0) __PYX_ERR(41, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":32 * NORM_INITIAL_ONLY = SNES_NORM_INITIAL_ONLY * NORM_FINAL_ONLY = SNES_NORM_FINAL_ONLY * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY # <<<<<<<<<<<<<< * # aliases * DEFAULT = NORM_DEFAULT */ __pyx_t_7 = __Pyx_PyInt_From_SNESNormSchedule(SNES_NORM_INITIAL_FINAL_ONLY); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NORM_INITIAL_FINAL_ONLY, __pyx_t_7) < 0) __PYX_ERR(41, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":34 * NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY * # aliases * DEFAULT = NORM_DEFAULT # <<<<<<<<<<<<<< * NONE = NORM_NONE * ALWAYS = NORM_ALWAYS */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_DEFAULT); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_DEFAULT); } if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DEFAULT, __pyx_t_7) < 0) __PYX_ERR(41, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":35 * # aliases * DEFAULT = NORM_DEFAULT * NONE = NORM_NONE # <<<<<<<<<<<<<< * ALWAYS = NORM_ALWAYS * INITIAL_ONLY = NORM_INITIAL_ONLY */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_NONE); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_NONE); } if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(41, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":36 * DEFAULT = NORM_DEFAULT * NONE = NORM_NONE * ALWAYS = NORM_ALWAYS # <<<<<<<<<<<<<< * INITIAL_ONLY = NORM_INITIAL_ONLY * FINAL_ONLY = NORM_FINAL_ONLY */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_ALWAYS); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_ALWAYS); } if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALWAYS, __pyx_t_7) < 0) __PYX_ERR(41, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":37 * NONE = NORM_NONE * ALWAYS = NORM_ALWAYS * INITIAL_ONLY = NORM_INITIAL_ONLY # <<<<<<<<<<<<<< * FINAL_ONLY = NORM_FINAL_ONLY * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_INITIAL_ONLY); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_INITIAL_ONLY); } if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_INITIAL_ONLY, __pyx_t_7) < 0) __PYX_ERR(41, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":38 * ALWAYS = NORM_ALWAYS * INITIAL_ONLY = NORM_INITIAL_ONLY * FINAL_ONLY = NORM_FINAL_ONLY # <<<<<<<<<<<<<< * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY * */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_FINAL_ONLY); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_FINAL_ONLY); } if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FINAL_ONLY, __pyx_t_7) < 0) __PYX_ERR(41, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":39 * INITIAL_ONLY = NORM_INITIAL_ONLY * FINAL_ONLY = NORM_FINAL_ONLY * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY # <<<<<<<<<<<<<< * * class SNESConvergedReason(object): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_NORM_INITIAL_FINAL_ONLY); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NORM_INITIAL_FINAL_ONLY); } if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_INITIAL_FINAL_ONLY, __pyx_t_7) < 0) __PYX_ERR(41, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":25 * PATCH = S_(SNESPATCH) * * class SNESNormSchedule(object): # <<<<<<<<<<<<<< * # native * NORM_DEFAULT = SNES_NORM_DEFAULT */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SNESNormSchedule, __pyx_tuple__124, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNESNormSchedule, __pyx_t_7) < 0) __PYX_ERR(41, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":41 * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY * * class SNESConvergedReason(object): # <<<<<<<<<<<<<< * # iterating * CONVERGED_ITERATING = SNES_CONVERGED_ITERATING */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__125); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__125, __pyx_n_s_SNESConvergedReason, __pyx_n_s_SNESConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/SNES.pyx":43 * class SNESConvergedReason(object): * # iterating * CONVERGED_ITERATING = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * ITERATING = SNES_CONVERGED_ITERATING * # converged */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_ITERATING); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_7) < 0) __PYX_ERR(41, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":44 * # iterating * CONVERGED_ITERATING = SNES_CONVERGED_ITERATING * ITERATING = SNES_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # converged * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_ITERATING); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ITERATING, __pyx_t_7) < 0) __PYX_ERR(41, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":46 * ITERATING = SNES_CONVERGED_ITERATING * # converged * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS # <<<<<<<<<<<<<< * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_FNORM_ABS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_FNORM_ABS, __pyx_t_7) < 0) __PYX_ERR(41, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":47 * # converged * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE # <<<<<<<<<<<<<< * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE * CONVERGED_ITS = SNES_CONVERGED_ITS */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_FNORM_RELATIVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_FNORM_RELATIVE, __pyx_t_7) < 0) __PYX_ERR(41, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":48 * CONVERGED_FNORM_ABS = SNES_CONVERGED_FNORM_ABS * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE # <<<<<<<<<<<<<< * CONVERGED_ITS = SNES_CONVERGED_ITS * # diverged */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_SNORM_RELATIVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_SNORM_RELATIVE, __pyx_t_7) < 0) __PYX_ERR(41, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":49 * CONVERGED_FNORM_RELATIVE = SNES_CONVERGED_FNORM_RELATIVE * CONVERGED_SNORM_RELATIVE = SNES_CONVERGED_SNORM_RELATIVE * CONVERGED_ITS = SNES_CONVERGED_ITS # <<<<<<<<<<<<<< * # diverged * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_CONVERGED_ITS); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ITS, __pyx_t_7) < 0) __PYX_ERR(41, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":51 * CONVERGED_ITS = SNES_CONVERGED_ITS * # diverged * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN # <<<<<<<<<<<<<< * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_FUNCTION_DOMAIN); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_FUNCTION_DOMAIN, __pyx_t_7) < 0) __PYX_ERR(41, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":52 * # diverged * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT # <<<<<<<<<<<<<< * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_FUNCTION_COUNT); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_FUNCTION_COUNT, __pyx_t_7) < 0) __PYX_ERR(41, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":53 * DIVERGED_FUNCTION_DOMAIN = SNES_DIVERGED_FUNCTION_DOMAIN * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE # <<<<<<<<<<<<<< * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_LINEAR_SOLVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_LINEAR_SOLVE, __pyx_t_7) < 0) __PYX_ERR(41, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":54 * DIVERGED_FUNCTION_COUNT = SNES_DIVERGED_FUNCTION_COUNT * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN # <<<<<<<<<<<<<< * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_FNORM_NAN); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_FNORM_NAN, __pyx_t_7) < 0) __PYX_ERR(41, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":55 * DIVERGED_LINEAR_SOLVE = SNES_DIVERGED_LINEAR_SOLVE * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT # <<<<<<<<<<<<<< * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH * DIVERGED_INNER = SNES_DIVERGED_INNER */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_MAX_IT); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_MAX_IT, __pyx_t_7) < 0) __PYX_ERR(41, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":56 * DIVERGED_FNORM_NAN = SNES_DIVERGED_FNORM_NAN * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH # <<<<<<<<<<<<<< * DIVERGED_INNER = SNES_DIVERGED_INNER * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_LINE_SEARCH); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_LINE_SEARCH, __pyx_t_7) < 0) __PYX_ERR(41, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":57 * DIVERGED_MAX_IT = SNES_DIVERGED_MAX_IT * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH * DIVERGED_INNER = SNES_DIVERGED_INNER # <<<<<<<<<<<<<< * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN * DIVERGED_DTOL = SNES_DIVERGED_DTOL */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_INNER); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_INNER, __pyx_t_7) < 0) __PYX_ERR(41, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":58 * DIVERGED_LINE_SEARCH = SNES_DIVERGED_LINE_SEARCH * DIVERGED_INNER = SNES_DIVERGED_INNER * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN # <<<<<<<<<<<<<< * DIVERGED_DTOL = SNES_DIVERGED_DTOL * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_LOCAL_MIN); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_LOCAL_MIN, __pyx_t_7) < 0) __PYX_ERR(41, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":59 * DIVERGED_INNER = SNES_DIVERGED_INNER * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN * DIVERGED_DTOL = SNES_DIVERGED_DTOL # <<<<<<<<<<<<<< * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN * DIVERGED_TR_DELTA = SNES_DIVERGED_TR_DELTA */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_DTOL); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_DTOL, __pyx_t_7) < 0) __PYX_ERR(41, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":60 * DIVERGED_LOCAL_MIN = SNES_DIVERGED_LOCAL_MIN * DIVERGED_DTOL = SNES_DIVERGED_DTOL * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN # <<<<<<<<<<<<<< * DIVERGED_TR_DELTA = SNES_DIVERGED_TR_DELTA * */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_JACOBIAN_DOMAIN); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_JACOBIAN_DOMAIN, __pyx_t_7) < 0) __PYX_ERR(41, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":61 * DIVERGED_DTOL = SNES_DIVERGED_DTOL * DIVERGED_JACOBIAN_DOMAIN = SNES_DIVERGED_JACOBIAN_DOMAIN * DIVERGED_TR_DELTA = SNES_DIVERGED_TR_DELTA # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_SNESConvergedReason(SNES_DIVERGED_TR_DELTA); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_TR_DELTA, __pyx_t_7) < 0) __PYX_ERR(41, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/SNES.pyx":41 * INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY * * class SNESConvergedReason(object): # <<<<<<<<<<<<<< * # iterating * CONVERGED_ITERATING = SNES_CONVERGED_ITERATING */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SNESConvergedReason, __pyx_tuple__125, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_SNESConvergedReason, __pyx_t_7) < 0) __PYX_ERR(41, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/SNES.pyx":67 * cdef class SNES(Object): * * Type = SNESType # <<<<<<<<<<<<<< * NormSchedule = SNESNormSchedule * ConvergedReason = SNESConvergedReason */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SNESType); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(41, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":68 * * Type = SNESType * NormSchedule = SNESNormSchedule # <<<<<<<<<<<<<< * ConvergedReason = SNESConvergedReason * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SNESNormSchedule); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_NormSchedule, __pyx_t_3) < 0) __PYX_ERR(41, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":69 * Type = SNESType * NormSchedule = SNESNormSchedule * ConvergedReason = SNESConvergedReason # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SNESConvergedReason); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_ConvergedReason, __pyx_t_3) < 0) __PYX_ERR(41, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":553 * return toInt(ival) * * setMaxNonlinearStepFailures = setMaxStepFailures # <<<<<<<<<<<<<< * getMaxNonlinearStepFailures = getMaxStepFailures * getNonlinearStepFailures = getStepFailures */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setMaxStepFailures); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_setMaxNonlinearStepFailures, __pyx_t_3) < 0) __PYX_ERR(41, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":554 * * setMaxNonlinearStepFailures = setMaxStepFailures * getMaxNonlinearStepFailures = getMaxStepFailures # <<<<<<<<<<<<<< * getNonlinearStepFailures = getStepFailures * setMaxLinearSolveFailures = setMaxKSPFailures */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getMaxStepFailures); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_getMaxNonlinearStepFailures, __pyx_t_3) < 0) __PYX_ERR(41, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":555 * setMaxNonlinearStepFailures = setMaxStepFailures * getMaxNonlinearStepFailures = getMaxStepFailures * getNonlinearStepFailures = getStepFailures # <<<<<<<<<<<<<< * setMaxLinearSolveFailures = setMaxKSPFailures * getMaxLinearSolveFailures = getMaxKSPFailures */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getStepFailures); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_getNonlinearStepFailures, __pyx_t_3) < 0) __PYX_ERR(41, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":556 * getMaxNonlinearStepFailures = getMaxStepFailures * getNonlinearStepFailures = getStepFailures * setMaxLinearSolveFailures = setMaxKSPFailures # <<<<<<<<<<<<<< * getMaxLinearSolveFailures = getMaxKSPFailures * getLinearSolveFailures = getKSPFailures */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_setMaxKSPFailures); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_setMaxLinearSolveFailures, __pyx_t_3) < 0) __PYX_ERR(41, 556, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":557 * getNonlinearStepFailures = getStepFailures * setMaxLinearSolveFailures = setMaxKSPFailures * getMaxLinearSolveFailures = getMaxKSPFailures # <<<<<<<<<<<<<< * getLinearSolveFailures = getKSPFailures * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getMaxKSPFailures); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_getMaxLinearSolveFailures, __pyx_t_3) < 0) __PYX_ERR(41, 557, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":558 * setMaxLinearSolveFailures = setMaxKSPFailures * getMaxLinearSolveFailures = getMaxKSPFailures * getLinearSolveFailures = getKSPFailures # <<<<<<<<<<<<<< * * # --- solving --- */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_n_s_getKSPFailures); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dict, __pyx_n_s_getLinearSolveFailures, __pyx_t_3) < 0) __PYX_ERR(41, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_SNES); /* "PETSc/SNES.pyx":982 * # -------------------------------------------------------------------- * * del SNESType # <<<<<<<<<<<<<< * del SNESNormSchedule * del SNESConvergedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SNESType) < 0) __PYX_ERR(41, 982, __pyx_L1_error) /* "PETSc/SNES.pyx":983 * * del SNESType * del SNESNormSchedule # <<<<<<<<<<<<<< * del SNESConvergedReason * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SNESNormSchedule) < 0) __PYX_ERR(41, 983, __pyx_L1_error) /* "PETSc/SNES.pyx":984 * del SNESType * del SNESNormSchedule * del SNESConvergedReason # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_SNESConvergedReason) < 0) __PYX_ERR(41, 984, __pyx_L1_error) /* "PETSc/TS.pyx":3 * # ----------------------------------------------------------------------------- * * class TSType(object): # <<<<<<<<<<<<<< * # native * EULER = S_(TSEULER) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__126); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__126, __pyx_n_s_TSType, __pyx_n_s_TSType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/TS.pyx":5 * class TSType(object): * # native * EULER = S_(TSEULER) # <<<<<<<<<<<<<< * BEULER = S_(TSBEULER) * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSEULER); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_EULER, __pyx_t_7) < 0) __PYX_ERR(42, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":6 * # native * EULER = S_(TSEULER) * BEULER = S_(TSBEULER) # <<<<<<<<<<<<<< * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) * PSEUDO = S_(TSPSEUDO) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSBEULER); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BEULER, __pyx_t_7) < 0) __PYX_ERR(42, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":7 * EULER = S_(TSEULER) * BEULER = S_(TSBEULER) * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) # <<<<<<<<<<<<<< * PSEUDO = S_(TSPSEUDO) * CN = S_(TSCN) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSBASICSYMPLECTIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASICSYMPLECTIC, __pyx_t_7) < 0) __PYX_ERR(42, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":8 * BEULER = S_(TSBEULER) * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) * PSEUDO = S_(TSPSEUDO) # <<<<<<<<<<<<<< * CN = S_(TSCN) * SUNDIALS = S_(TSSUNDIALS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSPSEUDO); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PSEUDO, __pyx_t_7) < 0) __PYX_ERR(42, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":9 * BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC) * PSEUDO = S_(TSPSEUDO) * CN = S_(TSCN) # <<<<<<<<<<<<<< * SUNDIALS = S_(TSSUNDIALS) * RK = S_(TSRK) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSCN); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CN, __pyx_t_7) < 0) __PYX_ERR(42, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":10 * PSEUDO = S_(TSPSEUDO) * CN = S_(TSCN) * SUNDIALS = S_(TSSUNDIALS) # <<<<<<<<<<<<<< * RK = S_(TSRK) * PYTHON = S_(TSPYTHON) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSSUNDIALS); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SUNDIALS, __pyx_t_7) < 0) __PYX_ERR(42, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":11 * CN = S_(TSCN) * SUNDIALS = S_(TSSUNDIALS) * RK = S_(TSRK) # <<<<<<<<<<<<<< * PYTHON = S_(TSPYTHON) * THETA = S_(TSTHETA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK, __pyx_t_7) < 0) __PYX_ERR(42, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":12 * SUNDIALS = S_(TSSUNDIALS) * RK = S_(TSRK) * PYTHON = S_(TSPYTHON) # <<<<<<<<<<<<<< * THETA = S_(TSTHETA) * ALPHA = S_(TSALPHA) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSPYTHON); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PYTHON, __pyx_t_7) < 0) __PYX_ERR(42, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":13 * RK = S_(TSRK) * PYTHON = S_(TSPYTHON) * THETA = S_(TSTHETA) # <<<<<<<<<<<<<< * ALPHA = S_(TSALPHA) * ALPHA2 = S_(TSALPHA2) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSTHETA); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_THETA, __pyx_t_7) < 0) __PYX_ERR(42, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":14 * PYTHON = S_(TSPYTHON) * THETA = S_(TSTHETA) * ALPHA = S_(TSALPHA) # <<<<<<<<<<<<<< * ALPHA2 = S_(TSALPHA2) * GLLE = S_(TSGLLE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSALPHA); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALPHA, __pyx_t_7) < 0) __PYX_ERR(42, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":15 * THETA = S_(TSTHETA) * ALPHA = S_(TSALPHA) * ALPHA2 = S_(TSALPHA2) # <<<<<<<<<<<<<< * GLLE = S_(TSGLLE) * GLEE = S_(TSGLEE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSALPHA2); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ALPHA2, __pyx_t_7) < 0) __PYX_ERR(42, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":16 * ALPHA = S_(TSALPHA) * ALPHA2 = S_(TSALPHA2) * GLLE = S_(TSGLLE) # <<<<<<<<<<<<<< * GLEE = S_(TSGLEE) * SSP = S_(TSSSP) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSGLLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GLLE, __pyx_t_7) < 0) __PYX_ERR(42, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":17 * ALPHA2 = S_(TSALPHA2) * GLLE = S_(TSGLLE) * GLEE = S_(TSGLEE) # <<<<<<<<<<<<<< * SSP = S_(TSSSP) * ARKIMEX = S_(TSARKIMEX) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSGLEE); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GLEE, __pyx_t_7) < 0) __PYX_ERR(42, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":18 * GLLE = S_(TSGLLE) * GLEE = S_(TSGLEE) * SSP = S_(TSSSP) # <<<<<<<<<<<<<< * ARKIMEX = S_(TSARKIMEX) * ROSW = S_(TSROSW) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSSSP); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SSP, __pyx_t_7) < 0) __PYX_ERR(42, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":19 * GLEE = S_(TSGLEE) * SSP = S_(TSSSP) * ARKIMEX = S_(TSARKIMEX) # <<<<<<<<<<<<<< * ROSW = S_(TSROSW) * EIMEX = S_(TSEIMEX) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX, __pyx_t_7) < 0) __PYX_ERR(42, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":20 * SSP = S_(TSSSP) * ARKIMEX = S_(TSARKIMEX) * ROSW = S_(TSROSW) # <<<<<<<<<<<<<< * EIMEX = S_(TSEIMEX) * MIMEX = S_(TSMIMEX) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSROSW); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ROSW, __pyx_t_7) < 0) __PYX_ERR(42, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":21 * ARKIMEX = S_(TSARKIMEX) * ROSW = S_(TSROSW) * EIMEX = S_(TSEIMEX) # <<<<<<<<<<<<<< * MIMEX = S_(TSMIMEX) * BDF = S_(TSBDF) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSEIMEX); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_EIMEX, __pyx_t_7) < 0) __PYX_ERR(42, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":22 * ROSW = S_(TSROSW) * EIMEX = S_(TSEIMEX) * MIMEX = S_(TSMIMEX) # <<<<<<<<<<<<<< * BDF = S_(TSBDF) * RADAU5 = S_(TSRADAU5) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSMIMEX); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MIMEX, __pyx_t_7) < 0) __PYX_ERR(42, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":23 * EIMEX = S_(TSEIMEX) * MIMEX = S_(TSMIMEX) * BDF = S_(TSBDF) # <<<<<<<<<<<<<< * RADAU5 = S_(TSRADAU5) * MPRK = S_(TSMPRK) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSBDF); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BDF, __pyx_t_7) < 0) __PYX_ERR(42, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":24 * MIMEX = S_(TSMIMEX) * BDF = S_(TSBDF) * RADAU5 = S_(TSRADAU5) # <<<<<<<<<<<<<< * MPRK = S_(TSMPRK) * DISCGRAD = S_(TSDISCGRAD) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRADAU5); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RADAU5, __pyx_t_7) < 0) __PYX_ERR(42, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":25 * BDF = S_(TSBDF) * RADAU5 = S_(TSRADAU5) * MPRK = S_(TSMPRK) # <<<<<<<<<<<<<< * DISCGRAD = S_(TSDISCGRAD) * # aliases */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSMPRK); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MPRK, __pyx_t_7) < 0) __PYX_ERR(42, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":26 * RADAU5 = S_(TSRADAU5) * MPRK = S_(TSMPRK) * DISCGRAD = S_(TSDISCGRAD) # <<<<<<<<<<<<<< * # aliases * FE = EULER */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSDISCGRAD); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DISCGRAD, __pyx_t_7) < 0) __PYX_ERR(42, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":28 * DISCGRAD = S_(TSDISCGRAD) * # aliases * FE = EULER # <<<<<<<<<<<<<< * BE = BEULER * TH = THETA */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_EULER); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_EULER); } if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FE, __pyx_t_7) < 0) __PYX_ERR(42, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":29 * # aliases * FE = EULER * BE = BEULER # <<<<<<<<<<<<<< * TH = THETA * CRANK_NICOLSON = CN */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_BEULER); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BEULER); } if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BE, __pyx_t_7) < 0) __PYX_ERR(42, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":30 * FE = EULER * BE = BEULER * TH = THETA # <<<<<<<<<<<<<< * CRANK_NICOLSON = CN * RUNGE_KUTTA = RK */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_THETA); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_THETA); } if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TH, __pyx_t_7) < 0) __PYX_ERR(42, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":31 * BE = BEULER * TH = THETA * CRANK_NICOLSON = CN # <<<<<<<<<<<<<< * RUNGE_KUTTA = RK * */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_CN); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CN); } if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CRANK_NICOLSON, __pyx_t_7) < 0) __PYX_ERR(42, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":32 * TH = THETA * CRANK_NICOLSON = CN * RUNGE_KUTTA = RK # <<<<<<<<<<<<<< * * class TSRKType(object): */ __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_RK); if (unlikely(!__pyx_t_7)) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_RK); } if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RUNGE_KUTTA, __pyx_t_7) < 0) __PYX_ERR(42, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":3 * # ----------------------------------------------------------------------------- * * class TSType(object): # <<<<<<<<<<<<<< * # native * EULER = S_(TSEULER) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TSType, __pyx_tuple__126, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSType, __pyx_t_7) < 0) __PYX_ERR(42, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":34 * RUNGE_KUTTA = RK * * class TSRKType(object): # <<<<<<<<<<<<<< * RK1FE = S_(TSRK1FE) * RK2A = S_(TSRK2A) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__127); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__127, __pyx_n_s_TSRKType, __pyx_n_s_TSRKType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/TS.pyx":35 * * class TSRKType(object): * RK1FE = S_(TSRK1FE) # <<<<<<<<<<<<<< * RK2A = S_(TSRK2A) * RK4 = S_(TSRK4) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK1FE); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK1FE, __pyx_t_7) < 0) __PYX_ERR(42, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":36 * class TSRKType(object): * RK1FE = S_(TSRK1FE) * RK2A = S_(TSRK2A) # <<<<<<<<<<<<<< * RK4 = S_(TSRK4) * RK3BS = S_(TSRK3BS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK2A); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK2A, __pyx_t_7) < 0) __PYX_ERR(42, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":37 * RK1FE = S_(TSRK1FE) * RK2A = S_(TSRK2A) * RK4 = S_(TSRK4) # <<<<<<<<<<<<<< * RK3BS = S_(TSRK3BS) * RK3 = S_(TSRK3) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK4); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK4, __pyx_t_7) < 0) __PYX_ERR(42, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":38 * RK2A = S_(TSRK2A) * RK4 = S_(TSRK4) * RK3BS = S_(TSRK3BS) # <<<<<<<<<<<<<< * RK3 = S_(TSRK3) * RK5F = S_(TSRK5F) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK3BS); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK3BS, __pyx_t_7) < 0) __PYX_ERR(42, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":39 * RK4 = S_(TSRK4) * RK3BS = S_(TSRK3BS) * RK3 = S_(TSRK3) # <<<<<<<<<<<<<< * RK5F = S_(TSRK5F) * RK5DP = S_(TSRK5DP) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK3); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK3, __pyx_t_7) < 0) __PYX_ERR(42, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":40 * RK3BS = S_(TSRK3BS) * RK3 = S_(TSRK3) * RK5F = S_(TSRK5F) # <<<<<<<<<<<<<< * RK5DP = S_(TSRK5DP) * RK5BS = S_(TSRK5BS) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5F); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK5F, __pyx_t_7) < 0) __PYX_ERR(42, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":41 * RK3 = S_(TSRK3) * RK5F = S_(TSRK5F) * RK5DP = S_(TSRK5DP) # <<<<<<<<<<<<<< * RK5BS = S_(TSRK5BS) * RK6VR = S_(TSRK6VR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5DP); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK5DP, __pyx_t_7) < 0) __PYX_ERR(42, 41, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":42 * RK5F = S_(TSRK5F) * RK5DP = S_(TSRK5DP) * RK5BS = S_(TSRK5BS) # <<<<<<<<<<<<<< * RK6VR = S_(TSRK6VR) * RK7VR = S_(TSRK7VR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5BS); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK5BS, __pyx_t_7) < 0) __PYX_ERR(42, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":43 * RK5DP = S_(TSRK5DP) * RK5BS = S_(TSRK5BS) * RK6VR = S_(TSRK6VR) # <<<<<<<<<<<<<< * RK7VR = S_(TSRK7VR) * RK8VR = S_(TSRK8VR) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK6VR); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK6VR, __pyx_t_7) < 0) __PYX_ERR(42, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":44 * RK5BS = S_(TSRK5BS) * RK6VR = S_(TSRK6VR) * RK7VR = S_(TSRK7VR) # <<<<<<<<<<<<<< * RK8VR = S_(TSRK8VR) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK7VR); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK7VR, __pyx_t_7) < 0) __PYX_ERR(42, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":45 * RK6VR = S_(TSRK6VR) * RK7VR = S_(TSRK7VR) * RK8VR = S_(TSRK8VR) # <<<<<<<<<<<<<< * * class TSARKIMEXType(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSRK8VR); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RK8VR, __pyx_t_7) < 0) __PYX_ERR(42, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":34 * RUNGE_KUTTA = RK * * class TSRKType(object): # <<<<<<<<<<<<<< * RK1FE = S_(TSRK1FE) * RK2A = S_(TSRK2A) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TSRKType, __pyx_tuple__127, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSRKType, __pyx_t_7) < 0) __PYX_ERR(42, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":47 * RK8VR = S_(TSRK8VR) * * class TSARKIMEXType(object): # <<<<<<<<<<<<<< * ARKIMEX1BEE = S_(TSARKIMEX1BEE) * ARKIMEXA2 = S_(TSARKIMEXA2) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__128); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__128, __pyx_n_s_TSARKIMEXType, __pyx_n_s_TSARKIMEXType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/TS.pyx":48 * * class TSARKIMEXType(object): * ARKIMEX1BEE = S_(TSARKIMEX1BEE) # <<<<<<<<<<<<<< * ARKIMEXA2 = S_(TSARKIMEXA2) * ARKIMEXL2 = S_(TSARKIMEXL2) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX1BEE); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX1BEE, __pyx_t_7) < 0) __PYX_ERR(42, 48, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":49 * class TSARKIMEXType(object): * ARKIMEX1BEE = S_(TSARKIMEX1BEE) * ARKIMEXA2 = S_(TSARKIMEXA2) # <<<<<<<<<<<<<< * ARKIMEXL2 = S_(TSARKIMEXL2) * ARKIMEXARS122 = S_(TSARKIMEXARS122) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXA2); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEXA2, __pyx_t_7) < 0) __PYX_ERR(42, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":50 * ARKIMEX1BEE = S_(TSARKIMEX1BEE) * ARKIMEXA2 = S_(TSARKIMEXA2) * ARKIMEXL2 = S_(TSARKIMEXL2) # <<<<<<<<<<<<<< * ARKIMEXARS122 = S_(TSARKIMEXARS122) * ARKIMEX2C = S_(TSARKIMEX2C) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXL2); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEXL2, __pyx_t_7) < 0) __PYX_ERR(42, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":51 * ARKIMEXA2 = S_(TSARKIMEXA2) * ARKIMEXL2 = S_(TSARKIMEXL2) * ARKIMEXARS122 = S_(TSARKIMEXARS122) # <<<<<<<<<<<<<< * ARKIMEX2C = S_(TSARKIMEX2C) * ARKIMEX2D = S_(TSARKIMEX2D) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXARS122); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEXARS122, __pyx_t_7) < 0) __PYX_ERR(42, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":52 * ARKIMEXL2 = S_(TSARKIMEXL2) * ARKIMEXARS122 = S_(TSARKIMEXARS122) * ARKIMEX2C = S_(TSARKIMEX2C) # <<<<<<<<<<<<<< * ARKIMEX2D = S_(TSARKIMEX2D) * ARKIMEX2E = S_(TSARKIMEX2E) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2C); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX2C, __pyx_t_7) < 0) __PYX_ERR(42, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":53 * ARKIMEXARS122 = S_(TSARKIMEXARS122) * ARKIMEX2C = S_(TSARKIMEX2C) * ARKIMEX2D = S_(TSARKIMEX2D) # <<<<<<<<<<<<<< * ARKIMEX2E = S_(TSARKIMEX2E) * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2D); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX2D, __pyx_t_7) < 0) __PYX_ERR(42, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":54 * ARKIMEX2C = S_(TSARKIMEX2C) * ARKIMEX2D = S_(TSARKIMEX2D) * ARKIMEX2E = S_(TSARKIMEX2E) # <<<<<<<<<<<<<< * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) * ARKIMEX3 = S_(TSARKIMEX3) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2E); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX2E, __pyx_t_7) < 0) __PYX_ERR(42, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":55 * ARKIMEX2D = S_(TSARKIMEX2D) * ARKIMEX2E = S_(TSARKIMEX2E) * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) # <<<<<<<<<<<<<< * ARKIMEX3 = S_(TSARKIMEX3) * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXPRSSP2); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEXPRSSP2, __pyx_t_7) < 0) __PYX_ERR(42, 55, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":56 * ARKIMEX2E = S_(TSARKIMEX2E) * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) * ARKIMEX3 = S_(TSARKIMEX3) # <<<<<<<<<<<<<< * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) * ARKIMEXARS443 = S_(TSARKIMEXARS443) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX3); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX3, __pyx_t_7) < 0) __PYX_ERR(42, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":57 * ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2) * ARKIMEX3 = S_(TSARKIMEX3) * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) # <<<<<<<<<<<<<< * ARKIMEXARS443 = S_(TSARKIMEXARS443) * ARKIMEX4 = S_(TSARKIMEX4) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXBPR3); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEXBPR3, __pyx_t_7) < 0) __PYX_ERR(42, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":58 * ARKIMEX3 = S_(TSARKIMEX3) * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) * ARKIMEXARS443 = S_(TSARKIMEXARS443) # <<<<<<<<<<<<<< * ARKIMEX4 = S_(TSARKIMEX4) * ARKIMEX5 = S_(TSARKIMEX5) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXARS443); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEXARS443, __pyx_t_7) < 0) __PYX_ERR(42, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":59 * ARKIMEXBPR3 = S_(TSARKIMEXBPR3) * ARKIMEXARS443 = S_(TSARKIMEXARS443) * ARKIMEX4 = S_(TSARKIMEX4) # <<<<<<<<<<<<<< * ARKIMEX5 = S_(TSARKIMEX5) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX4); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX4, __pyx_t_7) < 0) __PYX_ERR(42, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":60 * ARKIMEXARS443 = S_(TSARKIMEXARS443) * ARKIMEX4 = S_(TSARKIMEX4) * ARKIMEX5 = S_(TSARKIMEX5) # <<<<<<<<<<<<<< * * class TSProblemType(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX5); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ARKIMEX5, __pyx_t_7) < 0) __PYX_ERR(42, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":47 * RK8VR = S_(TSRK8VR) * * class TSARKIMEXType(object): # <<<<<<<<<<<<<< * ARKIMEX1BEE = S_(TSARKIMEX1BEE) * ARKIMEXA2 = S_(TSARKIMEXA2) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TSARKIMEXType, __pyx_tuple__128, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSARKIMEXType, __pyx_t_7) < 0) __PYX_ERR(42, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":62 * ARKIMEX5 = S_(TSARKIMEX5) * * class TSProblemType(object): # <<<<<<<<<<<<<< * LINEAR = TS_LINEAR * NONLINEAR = TS_NONLINEAR */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__129); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__129, __pyx_n_s_TSProblemType, __pyx_n_s_TSProblemType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/TS.pyx":63 * * class TSProblemType(object): * LINEAR = TS_LINEAR # <<<<<<<<<<<<<< * NONLINEAR = TS_NONLINEAR * */ __pyx_t_7 = __Pyx_PyInt_From_TSProblemType(TS_LINEAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LINEAR, __pyx_t_7) < 0) __PYX_ERR(42, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":64 * class TSProblemType(object): * LINEAR = TS_LINEAR * NONLINEAR = TS_NONLINEAR # <<<<<<<<<<<<<< * * class TSEquationType(object): */ __pyx_t_7 = __Pyx_PyInt_From_TSProblemType(TS_NONLINEAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONLINEAR, __pyx_t_7) < 0) __PYX_ERR(42, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":62 * ARKIMEX5 = S_(TSARKIMEX5) * * class TSProblemType(object): # <<<<<<<<<<<<<< * LINEAR = TS_LINEAR * NONLINEAR = TS_NONLINEAR */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TSProblemType, __pyx_tuple__129, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSProblemType, __pyx_t_7) < 0) __PYX_ERR(42, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":66 * NONLINEAR = TS_NONLINEAR * * class TSEquationType(object): # <<<<<<<<<<<<<< * UNSPECIFIED = TS_EQ_UNSPECIFIED * EXPLICIT = TS_EQ_EXPLICIT */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__130); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__130, __pyx_n_s_TSEquationType, __pyx_n_s_TSEquationType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/TS.pyx":67 * * class TSEquationType(object): * UNSPECIFIED = TS_EQ_UNSPECIFIED # <<<<<<<<<<<<<< * EXPLICIT = TS_EQ_EXPLICIT * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_UNSPECIFIED); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UNSPECIFIED, __pyx_t_7) < 0) __PYX_ERR(42, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":68 * class TSEquationType(object): * UNSPECIFIED = TS_EQ_UNSPECIFIED * EXPLICIT = TS_EQ_EXPLICIT # <<<<<<<<<<<<<< * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_EXPLICIT); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_EXPLICIT, __pyx_t_7) < 0) __PYX_ERR(42, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":69 * UNSPECIFIED = TS_EQ_UNSPECIFIED * EXPLICIT = TS_EQ_EXPLICIT * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_ODE_EXPLICIT); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ODE_EXPLICIT, __pyx_t_7) < 0) __PYX_ERR(42, 69, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":70 * EXPLICIT = TS_EQ_EXPLICIT * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX1); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX1, __pyx_t_7) < 0) __PYX_ERR(42, 70, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":71 * ODE_EXPLICIT = TS_EQ_ODE_EXPLICIT * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX2); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX2, __pyx_t_7) < 0) __PYX_ERR(42, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":72 * DAE_SEMI_EXPLICIT_INDEX1 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 # <<<<<<<<<<<<<< * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI * IMPLICIT = TS_EQ_IMPLICIT */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX3); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEX3, __pyx_t_7) < 0) __PYX_ERR(42, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":73 * DAE_SEMI_EXPLICIT_INDEX2 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI # <<<<<<<<<<<<<< * IMPLICIT = TS_EQ_IMPLICIT * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_SEMI_EXPLICIT_INDEXHI, __pyx_t_7) < 0) __PYX_ERR(42, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":74 * DAE_SEMI_EXPLICIT_INDEX3 = TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI * IMPLICIT = TS_EQ_IMPLICIT # <<<<<<<<<<<<<< * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_IMPLICIT); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_IMPLICIT, __pyx_t_7) < 0) __PYX_ERR(42, 74, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":75 * DAE_SEMI_EXPLICIT_INDEXHI = TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI * IMPLICIT = TS_EQ_IMPLICIT * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_ODE_IMPLICIT); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ODE_IMPLICIT, __pyx_t_7) < 0) __PYX_ERR(42, 75, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":76 * IMPLICIT = TS_EQ_IMPLICIT * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX1); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_IMPLICIT_INDEX1, __pyx_t_7) < 0) __PYX_ERR(42, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":77 * ODE_IMPLICIT = TS_EQ_ODE_IMPLICIT * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX2); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_IMPLICIT_INDEX2, __pyx_t_7) < 0) __PYX_ERR(42, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":78 * DAE_IMPLICIT_INDEX1 = TS_EQ_DAE_IMPLICIT_INDEX1 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 # <<<<<<<<<<<<<< * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX3); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_IMPLICIT_INDEX3, __pyx_t_7) < 0) __PYX_ERR(42, 78, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":79 * DAE_IMPLICIT_INDEX2 = TS_EQ_DAE_IMPLICIT_INDEX2 * DAE_IMPLICIT_INDEX3 = TS_EQ_DAE_IMPLICIT_INDEX3 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI # <<<<<<<<<<<<<< * * class TSExactFinalTime(object): */ __pyx_t_7 = __Pyx_PyInt_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEXHI); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DAE_IMPLICIT_INDEXHI, __pyx_t_7) < 0) __PYX_ERR(42, 79, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":66 * NONLINEAR = TS_NONLINEAR * * class TSEquationType(object): # <<<<<<<<<<<<<< * UNSPECIFIED = TS_EQ_UNSPECIFIED * EXPLICIT = TS_EQ_EXPLICIT */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TSEquationType, __pyx_tuple__130, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSEquationType, __pyx_t_7) < 0) __PYX_ERR(42, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":81 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * * class TSExactFinalTime(object): # <<<<<<<<<<<<<< * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED * STEPOVER = TS_EXACTFINALTIME_STEPOVER */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__131); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__131, __pyx_n_s_TSExactFinalTime, __pyx_n_s_TSExactFinalTime, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/TS.pyx":82 * * class TSExactFinalTime(object): * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED # <<<<<<<<<<<<<< * STEPOVER = TS_EXACTFINALTIME_STEPOVER * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE */ __pyx_t_7 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_UNSPECIFIED); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UNSPECIFIED, __pyx_t_7) < 0) __PYX_ERR(42, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":83 * class TSExactFinalTime(object): * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED * STEPOVER = TS_EXACTFINALTIME_STEPOVER # <<<<<<<<<<<<<< * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP */ __pyx_t_7 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_STEPOVER); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STEPOVER, __pyx_t_7) < 0) __PYX_ERR(42, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":84 * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED * STEPOVER = TS_EXACTFINALTIME_STEPOVER * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE # <<<<<<<<<<<<<< * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * */ __pyx_t_7 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_INTERPOLATE); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_INTERPOLATE, __pyx_t_7) < 0) __PYX_ERR(42, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":85 * STEPOVER = TS_EXACTFINALTIME_STEPOVER * INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP # <<<<<<<<<<<<<< * * class TSConvergedReason(object): */ __pyx_t_7 = __Pyx_PyInt_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_MATCHSTEP); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MATCHSTEP, __pyx_t_7) < 0) __PYX_ERR(42, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":81 * DAE_IMPLICIT_INDEXHI = TS_EQ_DAE_IMPLICIT_INDEXHI * * class TSExactFinalTime(object): # <<<<<<<<<<<<<< * UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED * STEPOVER = TS_EXACTFINALTIME_STEPOVER */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TSExactFinalTime, __pyx_tuple__131, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSExactFinalTime, __pyx_t_7) < 0) __PYX_ERR(42, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":87 * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * * class TSConvergedReason(object): # <<<<<<<<<<<<<< * # iterating * CONVERGED_ITERATING = TS_CONVERGED_ITERATING */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__132); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__132, __pyx_n_s_TSConvergedReason, __pyx_n_s_TSConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/TS.pyx":89 * class TSConvergedReason(object): * # iterating * CONVERGED_ITERATING = TS_CONVERGED_ITERATING # <<<<<<<<<<<<<< * ITERATING = TS_CONVERGED_ITERATING * # converged */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_ITERATING); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_7) < 0) __PYX_ERR(42, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":90 * # iterating * CONVERGED_ITERATING = TS_CONVERGED_ITERATING * ITERATING = TS_CONVERGED_ITERATING # <<<<<<<<<<<<<< * # converged * CONVERGED_TIME = TS_CONVERGED_TIME */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_ITERATING); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ITERATING, __pyx_t_7) < 0) __PYX_ERR(42, 90, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":92 * ITERATING = TS_CONVERGED_ITERATING * # converged * CONVERGED_TIME = TS_CONVERGED_TIME # <<<<<<<<<<<<<< * CONVERGED_ITS = TS_CONVERGED_ITS * CONVERGED_USER = TS_CONVERGED_USER */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_TIME); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_TIME, __pyx_t_7) < 0) __PYX_ERR(42, 92, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":93 * # converged * CONVERGED_TIME = TS_CONVERGED_TIME * CONVERGED_ITS = TS_CONVERGED_ITS # <<<<<<<<<<<<<< * CONVERGED_USER = TS_CONVERGED_USER * CONVERGED_EVENT = TS_CONVERGED_EVENT */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_ITS); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_ITS, __pyx_t_7) < 0) __PYX_ERR(42, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":94 * CONVERGED_TIME = TS_CONVERGED_TIME * CONVERGED_ITS = TS_CONVERGED_ITS * CONVERGED_USER = TS_CONVERGED_USER # <<<<<<<<<<<<<< * CONVERGED_EVENT = TS_CONVERGED_EVENT * # diverged */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_USER); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_USER, __pyx_t_7) < 0) __PYX_ERR(42, 94, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":95 * CONVERGED_ITS = TS_CONVERGED_ITS * CONVERGED_USER = TS_CONVERGED_USER * CONVERGED_EVENT = TS_CONVERGED_EVENT # <<<<<<<<<<<<<< * # diverged * DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_CONVERGED_EVENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CONVERGED_EVENT, __pyx_t_7) < 0) __PYX_ERR(42, 95, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":97 * CONVERGED_EVENT = TS_CONVERGED_EVENT * # diverged * DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE # <<<<<<<<<<<<<< * DIVERGED_STEP_REJECTED = TS_DIVERGED_STEP_REJECTED * */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_DIVERGED_NONLINEAR_SOLVE); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_NONLINEAR_SOLVE, __pyx_t_7) < 0) __PYX_ERR(42, 97, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":98 * # diverged * DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE * DIVERGED_STEP_REJECTED = TS_DIVERGED_STEP_REJECTED # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_TSConvergedReason(TS_DIVERGED_STEP_REJECTED); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DIVERGED_STEP_REJECTED, __pyx_t_7) < 0) __PYX_ERR(42, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/TS.pyx":87 * MATCHSTEP = TS_EXACTFINALTIME_MATCHSTEP * * class TSConvergedReason(object): # <<<<<<<<<<<<<< * # iterating * CONVERGED_ITERATING = TS_CONVERGED_ITERATING */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_TSConvergedReason, __pyx_tuple__132, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(42, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TSConvergedReason, __pyx_t_7) < 0) __PYX_ERR(42, 87, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TS.pyx":104 * cdef class TS(Object): * * Type = TSType # <<<<<<<<<<<<<< * RKType = TSRKType * ARKIMEXType = TSARKIMEXType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSType); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(42, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":105 * * Type = TSType * RKType = TSRKType # <<<<<<<<<<<<<< * ARKIMEXType = TSARKIMEXType * ProblemType = TSProblemType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSRKType); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_RKType, __pyx_t_3) < 0) __PYX_ERR(42, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":106 * Type = TSType * RKType = TSRKType * ARKIMEXType = TSARKIMEXType # <<<<<<<<<<<<<< * ProblemType = TSProblemType * EquationType = TSEquationType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSARKIMEXType); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_ARKIMEXType, __pyx_t_3) < 0) __PYX_ERR(42, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":107 * RKType = TSRKType * ARKIMEXType = TSARKIMEXType * ProblemType = TSProblemType # <<<<<<<<<<<<<< * EquationType = TSEquationType * ExactFinalTime = TSExactFinalTime */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSProblemType); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_ProblemType, __pyx_t_3) < 0) __PYX_ERR(42, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":108 * ARKIMEXType = TSARKIMEXType * ProblemType = TSProblemType * EquationType = TSEquationType # <<<<<<<<<<<<<< * ExactFinalTime = TSExactFinalTime * ExactFinalTimeOption = TSExactFinalTime */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSEquationType); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_EquationType, __pyx_t_3) < 0) __PYX_ERR(42, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":109 * ProblemType = TSProblemType * EquationType = TSEquationType * ExactFinalTime = TSExactFinalTime # <<<<<<<<<<<<<< * ExactFinalTimeOption = TSExactFinalTime * ConvergedReason = TSConvergedReason */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSExactFinalTime); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_ExactFinalTime, __pyx_t_3) < 0) __PYX_ERR(42, 109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":110 * EquationType = TSEquationType * ExactFinalTime = TSExactFinalTime * ExactFinalTimeOption = TSExactFinalTime # <<<<<<<<<<<<<< * ConvergedReason = TSConvergedReason * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSExactFinalTime); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_ExactFinalTimeOption, __pyx_t_3) < 0) __PYX_ERR(42, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":111 * ExactFinalTime = TSExactFinalTime * ExactFinalTimeOption = TSExactFinalTime * ConvergedReason = TSConvergedReason # <<<<<<<<<<<<<< * * # --- xxx --- */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TSConvergedReason); if (unlikely(!__pyx_t_3)) __PYX_ERR(42, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TS->tp_dict, __pyx_n_s_ConvergedReason, __pyx_t_3) < 0) __PYX_ERR(42, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TS); /* "PETSc/TS.pyx":1011 * # ----------------------------------------------------------------------------- * * del TSType # <<<<<<<<<<<<<< * del TSRKType * del TSARKIMEXType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSType) < 0) __PYX_ERR(42, 1011, __pyx_L1_error) /* "PETSc/TS.pyx":1012 * * del TSType * del TSRKType # <<<<<<<<<<<<<< * del TSARKIMEXType * del TSProblemType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSRKType) < 0) __PYX_ERR(42, 1012, __pyx_L1_error) /* "PETSc/TS.pyx":1013 * del TSType * del TSRKType * del TSARKIMEXType # <<<<<<<<<<<<<< * del TSProblemType * del TSEquationType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSARKIMEXType) < 0) __PYX_ERR(42, 1013, __pyx_L1_error) /* "PETSc/TS.pyx":1014 * del TSRKType * del TSARKIMEXType * del TSProblemType # <<<<<<<<<<<<<< * del TSEquationType * del TSExactFinalTime */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSProblemType) < 0) __PYX_ERR(42, 1014, __pyx_L1_error) /* "PETSc/TS.pyx":1015 * del TSARKIMEXType * del TSProblemType * del TSEquationType # <<<<<<<<<<<<<< * del TSExactFinalTime * del TSConvergedReason */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSEquationType) < 0) __PYX_ERR(42, 1015, __pyx_L1_error) /* "PETSc/TS.pyx":1016 * del TSProblemType * del TSEquationType * del TSExactFinalTime # <<<<<<<<<<<<<< * del TSConvergedReason * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSExactFinalTime) < 0) __PYX_ERR(42, 1016, __pyx_L1_error) /* "PETSc/TS.pyx":1017 * del TSEquationType * del TSExactFinalTime * del TSConvergedReason # <<<<<<<<<<<<<< * * # ----------------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TSConvergedReason) < 0) __PYX_ERR(42, 1017, __pyx_L1_error) /* "PETSc/TAO.pyx":3 * # -------------------------------------------------------------------- * * class TAOType: # <<<<<<<<<<<<<< * """ * TAO Solver Types */ __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TAOType, __pyx_n_s_TAOType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_TAO_Solver_Types); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/TAO.pyx":7 * TAO Solver Types * """ * LMVM = S_(TAOLMVM) # <<<<<<<<<<<<<< * NLS = S_(TAONLS) * NTR = S_(TAONTR) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOLMVM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LMVM, __pyx_t_1) < 0) __PYX_ERR(43, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":8 * """ * LMVM = S_(TAOLMVM) * NLS = S_(TAONLS) # <<<<<<<<<<<<<< * NTR = S_(TAONTR) * NTL = S_(TAONTL) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAONLS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NLS, __pyx_t_1) < 0) __PYX_ERR(43, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":9 * LMVM = S_(TAOLMVM) * NLS = S_(TAONLS) * NTR = S_(TAONTR) # <<<<<<<<<<<<<< * NTL = S_(TAONTL) * CG = S_(TAOCG) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAONTR); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NTR, __pyx_t_1) < 0) __PYX_ERR(43, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":10 * NLS = S_(TAONLS) * NTR = S_(TAONTR) * NTL = S_(TAONTL) # <<<<<<<<<<<<<< * CG = S_(TAOCG) * TRON = S_(TAOTRON) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAONTL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NTL, __pyx_t_1) < 0) __PYX_ERR(43, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":11 * NTR = S_(TAONTR) * NTL = S_(TAONTL) * CG = S_(TAOCG) # <<<<<<<<<<<<<< * TRON = S_(TAOTRON) * OWLQN = S_(TAOOWLQN) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOCG); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CG, __pyx_t_1) < 0) __PYX_ERR(43, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":12 * NTL = S_(TAONTL) * CG = S_(TAOCG) * TRON = S_(TAOTRON) # <<<<<<<<<<<<<< * OWLQN = S_(TAOOWLQN) * BMRM = S_(TAOBMRM) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOTRON); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TRON, __pyx_t_1) < 0) __PYX_ERR(43, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":13 * CG = S_(TAOCG) * TRON = S_(TAOTRON) * OWLQN = S_(TAOOWLQN) # <<<<<<<<<<<<<< * BMRM = S_(TAOBMRM) * BLMVM = S_(TAOBLMVM) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOOWLQN); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_OWLQN, __pyx_t_1) < 0) __PYX_ERR(43, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":14 * TRON = S_(TAOTRON) * OWLQN = S_(TAOOWLQN) * BMRM = S_(TAOBMRM) # <<<<<<<<<<<<<< * BLMVM = S_(TAOBLMVM) * BQNLS = S_(TAOBQNLS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBMRM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BMRM, __pyx_t_1) < 0) __PYX_ERR(43, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":15 * OWLQN = S_(TAOOWLQN) * BMRM = S_(TAOBMRM) * BLMVM = S_(TAOBLMVM) # <<<<<<<<<<<<<< * BQNLS = S_(TAOBQNLS) * BNCG = S_(TAOBNCG) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBLMVM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BLMVM, __pyx_t_1) < 0) __PYX_ERR(43, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":16 * BMRM = S_(TAOBMRM) * BLMVM = S_(TAOBLMVM) * BQNLS = S_(TAOBQNLS) # <<<<<<<<<<<<<< * BNCG = S_(TAOBNCG) * BNLS = S_(TAOBNLS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNLS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BQNLS, __pyx_t_1) < 0) __PYX_ERR(43, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":17 * BLMVM = S_(TAOBLMVM) * BQNLS = S_(TAOBQNLS) * BNCG = S_(TAOBNCG) # <<<<<<<<<<<<<< * BNLS = S_(TAOBNLS) * BNTR = S_(TAOBNTR) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNCG); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BNCG, __pyx_t_1) < 0) __PYX_ERR(43, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":18 * BQNLS = S_(TAOBQNLS) * BNCG = S_(TAOBNCG) * BNLS = S_(TAOBNLS) # <<<<<<<<<<<<<< * BNTR = S_(TAOBNTR) * BNTL = S_(TAOBNTL) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNLS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BNLS, __pyx_t_1) < 0) __PYX_ERR(43, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":19 * BNCG = S_(TAOBNCG) * BNLS = S_(TAOBNLS) * BNTR = S_(TAOBNTR) # <<<<<<<<<<<<<< * BNTL = S_(TAOBNTL) * BQNKLS = S_(TAOBQNKLS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNTR); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BNTR, __pyx_t_1) < 0) __PYX_ERR(43, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":20 * BNLS = S_(TAOBNLS) * BNTR = S_(TAOBNTR) * BNTL = S_(TAOBNTL) # <<<<<<<<<<<<<< * BQNKLS = S_(TAOBQNKLS) * BQNKTR = S_(TAOBQNKTR) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNTL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BNTL, __pyx_t_1) < 0) __PYX_ERR(43, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":21 * BNTR = S_(TAOBNTR) * BNTL = S_(TAOBNTL) * BQNKLS = S_(TAOBQNKLS) # <<<<<<<<<<<<<< * BQNKTR = S_(TAOBQNKTR) * BQNKTL = S_(TAOBQNKTL) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKLS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BQNKLS, __pyx_t_1) < 0) __PYX_ERR(43, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":22 * BNTL = S_(TAOBNTL) * BQNKLS = S_(TAOBQNKLS) * BQNKTR = S_(TAOBQNKTR) # <<<<<<<<<<<<<< * BQNKTL = S_(TAOBQNKTL) * BQPIP = S_(TAOBQPIP) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKTR); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BQNKTR, __pyx_t_1) < 0) __PYX_ERR(43, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":23 * BQNKLS = S_(TAOBQNKLS) * BQNKTR = S_(TAOBQNKTR) * BQNKTL = S_(TAOBQNKTL) # <<<<<<<<<<<<<< * BQPIP = S_(TAOBQPIP) * GPCG = S_(TAOGPCG) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKTL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BQNKTL, __pyx_t_1) < 0) __PYX_ERR(43, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":24 * BQNKTR = S_(TAOBQNKTR) * BQNKTL = S_(TAOBQNKTL) * BQPIP = S_(TAOBQPIP) # <<<<<<<<<<<<<< * GPCG = S_(TAOGPCG) * NM = S_(TAONM) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQPIP); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BQPIP, __pyx_t_1) < 0) __PYX_ERR(43, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":25 * BQNKTL = S_(TAOBQNKTL) * BQPIP = S_(TAOBQPIP) * GPCG = S_(TAOGPCG) # <<<<<<<<<<<<<< * NM = S_(TAONM) * POUNDERS = S_(TAOPOUNDERS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOGPCG); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GPCG, __pyx_t_1) < 0) __PYX_ERR(43, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":26 * BQPIP = S_(TAOBQPIP) * GPCG = S_(TAOGPCG) * NM = S_(TAONM) # <<<<<<<<<<<<<< * POUNDERS = S_(TAOPOUNDERS) * BRGN = S_(TAOBRGN) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAONM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NM, __pyx_t_1) < 0) __PYX_ERR(43, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":27 * GPCG = S_(TAOGPCG) * NM = S_(TAONM) * POUNDERS = S_(TAOPOUNDERS) # <<<<<<<<<<<<<< * BRGN = S_(TAOBRGN) * LCL = S_(TAOLCL) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOPOUNDERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_POUNDERS, __pyx_t_1) < 0) __PYX_ERR(43, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":28 * NM = S_(TAONM) * POUNDERS = S_(TAOPOUNDERS) * BRGN = S_(TAOBRGN) # <<<<<<<<<<<<<< * LCL = S_(TAOLCL) * SSILS = S_(TAOSSILS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOBRGN); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BRGN, __pyx_t_1) < 0) __PYX_ERR(43, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":29 * POUNDERS = S_(TAOPOUNDERS) * BRGN = S_(TAOBRGN) * LCL = S_(TAOLCL) # <<<<<<<<<<<<<< * SSILS = S_(TAOSSILS) * SSFLS = S_(TAOSSFLS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOLCL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LCL, __pyx_t_1) < 0) __PYX_ERR(43, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":30 * BRGN = S_(TAOBRGN) * LCL = S_(TAOLCL) * SSILS = S_(TAOSSILS) # <<<<<<<<<<<<<< * SSFLS = S_(TAOSSFLS) * ASILS = S_(TAOASILS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOSSILS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SSILS, __pyx_t_1) < 0) __PYX_ERR(43, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":31 * LCL = S_(TAOLCL) * SSILS = S_(TAOSSILS) * SSFLS = S_(TAOSSFLS) # <<<<<<<<<<<<<< * ASILS = S_(TAOASILS) * ASFLS = S_(TAOASFLS) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOSSFLS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SSFLS, __pyx_t_1) < 0) __PYX_ERR(43, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":32 * SSILS = S_(TAOSSILS) * SSFLS = S_(TAOSSFLS) * ASILS = S_(TAOASILS) # <<<<<<<<<<<<<< * ASFLS = S_(TAOASFLS) * IPM = S_(TAOIPM) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOASILS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASILS, __pyx_t_1) < 0) __PYX_ERR(43, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":33 * SSFLS = S_(TAOSSFLS) * ASILS = S_(TAOASILS) * ASFLS = S_(TAOASFLS) # <<<<<<<<<<<<<< * IPM = S_(TAOIPM) * PDIPM = S_(TAOPDIPM) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOASFLS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASFLS, __pyx_t_1) < 0) __PYX_ERR(43, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":34 * ASILS = S_(TAOASILS) * ASFLS = S_(TAOASFLS) * IPM = S_(TAOIPM) # <<<<<<<<<<<<<< * PDIPM = S_(TAOPDIPM) * SHELL = S_(TAOSHELL) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOIPM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_IPM, __pyx_t_1) < 0) __PYX_ERR(43, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":35 * ASFLS = S_(TAOASFLS) * IPM = S_(TAOIPM) * PDIPM = S_(TAOPDIPM) # <<<<<<<<<<<<<< * SHELL = S_(TAOSHELL) * ADMM = S_(TAOADMM) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOPDIPM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PDIPM, __pyx_t_1) < 0) __PYX_ERR(43, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":36 * IPM = S_(TAOIPM) * PDIPM = S_(TAOPDIPM) * SHELL = S_(TAOSHELL) # <<<<<<<<<<<<<< * ADMM = S_(TAOADMM) * ALMM = S_(TAOALMM) */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOSHELL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SHELL, __pyx_t_1) < 0) __PYX_ERR(43, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":37 * PDIPM = S_(TAOPDIPM) * SHELL = S_(TAOSHELL) * ADMM = S_(TAOADMM) # <<<<<<<<<<<<<< * ALMM = S_(TAOALMM) * */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOADMM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ADMM, __pyx_t_1) < 0) __PYX_ERR(43, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":38 * SHELL = S_(TAOSHELL) * ADMM = S_(TAOADMM) * ALMM = S_(TAOALMM) # <<<<<<<<<<<<<< * * class TAOConvergedReason: */ __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_S_(TAOALMM); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ALMM, __pyx_t_1) < 0) __PYX_ERR(43, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":3 * # -------------------------------------------------------------------- * * class TAOType: # <<<<<<<<<<<<<< * """ * TAO Solver Types */ __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_TAOType, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAOType, __pyx_t_1) < 0) __PYX_ERR(43, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":40 * ALMM = S_(TAOALMM) * * class TAOConvergedReason: # <<<<<<<<<<<<<< * """ * TAO Solver Termination Reasons */ __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TAOConvergedReason, __pyx_n_s_TAOConvergedReason, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, __pyx_kp_s_TAO_Solver_Termination_Reasons); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "PETSc/TAO.pyx":45 * """ * # iterating * CONTINUE_ITERATING = TAO_CONTINUE_ITERATING # iterating # <<<<<<<<<<<<<< * CONVERGED_ITERATING = TAO_CONTINUE_ITERATING # iterating * ITERATING = TAO_CONTINUE_ITERATING # iterating */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONTINUE_ITERATING, __pyx_t_1) < 0) __PYX_ERR(43, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":46 * # iterating * CONTINUE_ITERATING = TAO_CONTINUE_ITERATING # iterating * CONVERGED_ITERATING = TAO_CONTINUE_ITERATING # iterating # <<<<<<<<<<<<<< * ITERATING = TAO_CONTINUE_ITERATING # iterating * # converged */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONVERGED_ITERATING, __pyx_t_1) < 0) __PYX_ERR(43, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":47 * CONTINUE_ITERATING = TAO_CONTINUE_ITERATING # iterating * CONVERGED_ITERATING = TAO_CONTINUE_ITERATING # iterating * ITERATING = TAO_CONTINUE_ITERATING # iterating # <<<<<<<<<<<<<< * # converged * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ITERATING, __pyx_t_1) < 0) __PYX_ERR(43, 47, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":49 * ITERATING = TAO_CONTINUE_ITERATING # iterating * # converged * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol # <<<<<<<<<<<<<< * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_GATOL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONVERGED_GATOL, __pyx_t_1) < 0) __PYX_ERR(43, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":50 * # converged * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol # <<<<<<<<<<<<<< * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_GRTOL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONVERGED_GRTOL, __pyx_t_1) < 0) __PYX_ERR(43, 50, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":51 * CONVERGED_GATOL = TAO_CONVERGED_GATOL # ||g(X)|| < gatol * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol # <<<<<<<<<<<<<< * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_GTTOL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONVERGED_GTTOL, __pyx_t_1) < 0) __PYX_ERR(43, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":52 * CONVERGED_GRTOL = TAO_CONVERGED_GRTOL # ||g(X)||/f(X) < grtol * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size # <<<<<<<<<<<<<< * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min * CONVERGED_USER = TAO_CONVERGED_USER # user defined */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_STEPTOL); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONVERGED_STEPTOL, __pyx_t_1) < 0) __PYX_ERR(43, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":53 * CONVERGED_GTTOL = TAO_CONVERGED_GTTOL # ||g(X)||/||g(X0)|| < gttol * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min # <<<<<<<<<<<<<< * CONVERGED_USER = TAO_CONVERGED_USER # user defined * # diverged */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_MINF); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONVERGED_MINF, __pyx_t_1) < 0) __PYX_ERR(43, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":54 * CONVERGED_STEPTOL = TAO_CONVERGED_STEPTOL # small step size * CONVERGED_MINF = TAO_CONVERGED_MINF # f(X) < F_min * CONVERGED_USER = TAO_CONVERGED_USER # user defined # <<<<<<<<<<<<<< * # diverged * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_CONVERGED_USER); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CONVERGED_USER, __pyx_t_1) < 0) __PYX_ERR(43, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":56 * CONVERGED_USER = TAO_CONVERGED_USER # user defined * # diverged * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # # <<<<<<<<<<<<<< * DIVERGED_NAN = TAO_DIVERGED_NAN # * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_MAXITS); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DIVERGED_MAXITS, __pyx_t_1) < 0) __PYX_ERR(43, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":57 * # diverged * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # * DIVERGED_NAN = TAO_DIVERGED_NAN # # <<<<<<<<<<<<<< * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_NAN); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DIVERGED_NAN, __pyx_t_1) < 0) __PYX_ERR(43, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":58 * DIVERGED_MAXITS = TAO_DIVERGED_MAXITS # * DIVERGED_NAN = TAO_DIVERGED_NAN # * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # # <<<<<<<<<<<<<< * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_MAXFCN); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DIVERGED_MAXFCN, __pyx_t_1) < 0) __PYX_ERR(43, 58, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":59 * DIVERGED_NAN = TAO_DIVERGED_NAN # * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # # <<<<<<<<<<<<<< * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # * DIVERGED_USER = TAO_DIVERGED_USER # user defined */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_LS_FAILURE); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DIVERGED_LS_FAILURE, __pyx_t_1) < 0) __PYX_ERR(43, 59, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":60 * DIVERGED_MAXFCN = TAO_DIVERGED_MAXFCN # * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # # <<<<<<<<<<<<<< * DIVERGED_USER = TAO_DIVERGED_USER # user defined * */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_TR_REDUCTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DIVERGED_TR_REDUCTION, __pyx_t_1) < 0) __PYX_ERR(43, 60, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":61 * DIVERGED_LS_FAILURE = TAO_DIVERGED_LS_FAILURE # * DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION # * DIVERGED_USER = TAO_DIVERGED_USER # user defined # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_1 = __Pyx_PyInt_From_TaoConvergedReason(TAO_DIVERGED_USER); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DIVERGED_USER, __pyx_t_1) < 0) __PYX_ERR(43, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "PETSc/TAO.pyx":40 * ALMM = S_(TAOALMM) * * class TAOConvergedReason: # <<<<<<<<<<<<<< * """ * TAO Solver Termination Reasons */ __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_TAOConvergedReason, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_TAOConvergedReason, __pyx_t_1) < 0) __PYX_ERR(43, 40, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/TAO.pyx":71 * """ * * Type = TAOType # <<<<<<<<<<<<<< * Reason = TAOConvergedReason * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TAOType); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(43, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "PETSc/TAO.pyx":72 * * Type = TAOType * Reason = TAOConvergedReason # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TAOConvergedReason); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO->tp_dict, __pyx_n_s_Reason, __pyx_t_3) < 0) __PYX_ERR(43, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "PETSc/TAO.pyx":542 * return toReal(fval) * * getFunctionValue = getObjectiveValue # <<<<<<<<<<<<<< * * def getConvergedReason(self): */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_n_s_getObjectiveValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(43, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_TAO->tp_dict, __pyx_n_s_getFunctionValue, __pyx_t_3) < 0) __PYX_ERR(43, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_TAO); /* "PETSc/TAO.pyx":733 * # -------------------------------------------------------------------- * * del TAOType # <<<<<<<<<<<<<< * del TAOConvergedReason * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TAOType) < 0) __PYX_ERR(43, 733, __pyx_L1_error) /* "PETSc/TAO.pyx":734 * * del TAOType * del TAOConvergedReason # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_TAOConvergedReason) < 0) __PYX_ERR(43, 734, __pyx_L1_error) /* "PETSc/AO.pyx":3 * # -------------------------------------------------------------------- * * class AOType(object): # <<<<<<<<<<<<<< * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__133); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__133, __pyx_n_s_AOType, __pyx_n_s_AOType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/AO.pyx":4 * * class AOType(object): * BASIC = S_(AOBASIC) # <<<<<<<<<<<<<< * ADVANCED = S_(AOADVANCED) * MAPPING = S_(AOMAPPING) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(AOBASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(44, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(44, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/AO.pyx":5 * class AOType(object): * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) # <<<<<<<<<<<<<< * MAPPING = S_(AOMAPPING) * MEMORYSCALABLE = S_(AOMEMORYSCALABLE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(AOADVANCED); if (unlikely(!__pyx_t_7)) __PYX_ERR(44, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ADVANCED, __pyx_t_7) < 0) __PYX_ERR(44, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/AO.pyx":6 * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) * MAPPING = S_(AOMAPPING) # <<<<<<<<<<<<<< * MEMORYSCALABLE = S_(AOMEMORYSCALABLE) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(AOMAPPING); if (unlikely(!__pyx_t_7)) __PYX_ERR(44, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MAPPING, __pyx_t_7) < 0) __PYX_ERR(44, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/AO.pyx":7 * ADVANCED = S_(AOADVANCED) * MAPPING = S_(AOMAPPING) * MEMORYSCALABLE = S_(AOMEMORYSCALABLE) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(AOMEMORYSCALABLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(44, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MEMORYSCALABLE, __pyx_t_7) < 0) __PYX_ERR(44, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/AO.pyx":3 * # -------------------------------------------------------------------- * * class AOType(object): # <<<<<<<<<<<<<< * BASIC = S_(AOBASIC) * ADVANCED = S_(AOADVANCED) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_AOType, __pyx_tuple__133, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_AOType, __pyx_t_7) < 0) __PYX_ERR(44, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/AO.pyx":13 * cdef class AO(Object): * * Type = AOType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AOType); if (unlikely(!__pyx_t_3)) __PYX_ERR(44, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_AO->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(44, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_AO); /* "PETSc/AO.pyx":117 * # -------------------------------------------------------------------- * * del AOType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_AOType) < 0) __PYX_ERR(44, 117, __pyx_L1_error) /* "PETSc/DM.pyx":3 * # -------------------------------------------------------------------- * * class DMType(object): # <<<<<<<<<<<<<< * DA = S_(DMDA_type) * COMPOSITE = S_(DMCOMPOSITE) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__134); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__134, __pyx_n_s_DMType, __pyx_n_s_DMType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DM.pyx":4 * * class DMType(object): * DA = S_(DMDA_type) # <<<<<<<<<<<<<< * COMPOSITE = S_(DMCOMPOSITE) * SLICED = S_(DMSLICED) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DA, __pyx_t_7) < 0) __PYX_ERR(45, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":5 * class DMType(object): * DA = S_(DMDA_type) * COMPOSITE = S_(DMCOMPOSITE) # <<<<<<<<<<<<<< * SLICED = S_(DMSLICED) * SHELL = S_(DMSHELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMCOMPOSITE); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COMPOSITE, __pyx_t_7) < 0) __PYX_ERR(45, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":6 * DA = S_(DMDA_type) * COMPOSITE = S_(DMCOMPOSITE) * SLICED = S_(DMSLICED) # <<<<<<<<<<<<<< * SHELL = S_(DMSHELL) * PLEX = S_(DMPLEX) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMSLICED); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SLICED, __pyx_t_7) < 0) __PYX_ERR(45, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":7 * COMPOSITE = S_(DMCOMPOSITE) * SLICED = S_(DMSLICED) * SHELL = S_(DMSHELL) # <<<<<<<<<<<<<< * PLEX = S_(DMPLEX) * REDUNDANT = S_(DMREDUNDANT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMSHELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SHELL, __pyx_t_7) < 0) __PYX_ERR(45, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":8 * SLICED = S_(DMSLICED) * SHELL = S_(DMSHELL) * PLEX = S_(DMPLEX) # <<<<<<<<<<<<<< * REDUNDANT = S_(DMREDUNDANT) * PATCH = S_(DMPATCH) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEX); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PLEX, __pyx_t_7) < 0) __PYX_ERR(45, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":9 * SHELL = S_(DMSHELL) * PLEX = S_(DMPLEX) * REDUNDANT = S_(DMREDUNDANT) # <<<<<<<<<<<<<< * PATCH = S_(DMPATCH) * MOAB = S_(DMMOAB) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMREDUNDANT); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_REDUNDANT, __pyx_t_7) < 0) __PYX_ERR(45, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":10 * PLEX = S_(DMPLEX) * REDUNDANT = S_(DMREDUNDANT) * PATCH = S_(DMPATCH) # <<<<<<<<<<<<<< * MOAB = S_(DMMOAB) * NETWORK = S_(DMNETWORK) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMPATCH); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PATCH, __pyx_t_7) < 0) __PYX_ERR(45, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":11 * REDUNDANT = S_(DMREDUNDANT) * PATCH = S_(DMPATCH) * MOAB = S_(DMMOAB) # <<<<<<<<<<<<<< * NETWORK = S_(DMNETWORK) * FOREST = S_(DMFOREST) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMMOAB); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MOAB, __pyx_t_7) < 0) __PYX_ERR(45, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":12 * PATCH = S_(DMPATCH) * MOAB = S_(DMMOAB) * NETWORK = S_(DMNETWORK) # <<<<<<<<<<<<<< * FOREST = S_(DMFOREST) * P4EST = S_(DMP4EST) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMNETWORK); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NETWORK, __pyx_t_7) < 0) __PYX_ERR(45, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":13 * MOAB = S_(DMMOAB) * NETWORK = S_(DMNETWORK) * FOREST = S_(DMFOREST) # <<<<<<<<<<<<<< * P4EST = S_(DMP4EST) * P8EST = S_(DMP8EST) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMFOREST); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FOREST, __pyx_t_7) < 0) __PYX_ERR(45, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":14 * NETWORK = S_(DMNETWORK) * FOREST = S_(DMFOREST) * P4EST = S_(DMP4EST) # <<<<<<<<<<<<<< * P8EST = S_(DMP8EST) * SWARM = S_(DMSWARM) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMP4EST); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_P4EST, __pyx_t_7) < 0) __PYX_ERR(45, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":15 * FOREST = S_(DMFOREST) * P4EST = S_(DMP4EST) * P8EST = S_(DMP8EST) # <<<<<<<<<<<<<< * SWARM = S_(DMSWARM) * PRODUCT = S_(DMPRODUCT) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMP8EST); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_P8EST, __pyx_t_7) < 0) __PYX_ERR(45, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":16 * P4EST = S_(DMP4EST) * P8EST = S_(DMP8EST) * SWARM = S_(DMSWARM) # <<<<<<<<<<<<<< * PRODUCT = S_(DMPRODUCT) * STAG = S_(DMSTAG) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMSWARM); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SWARM, __pyx_t_7) < 0) __PYX_ERR(45, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":17 * P8EST = S_(DMP8EST) * SWARM = S_(DMSWARM) * PRODUCT = S_(DMPRODUCT) # <<<<<<<<<<<<<< * STAG = S_(DMSTAG) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMPRODUCT); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PRODUCT, __pyx_t_7) < 0) __PYX_ERR(45, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":18 * SWARM = S_(DMSWARM) * PRODUCT = S_(DMPRODUCT) * STAG = S_(DMSTAG) # <<<<<<<<<<<<<< * * class DMBoundaryType(object): */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(DMSTAG); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STAG, __pyx_t_7) < 0) __PYX_ERR(45, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":3 * # -------------------------------------------------------------------- * * class DMType(object): # <<<<<<<<<<<<<< * DA = S_(DMDA_type) * COMPOSITE = S_(DMCOMPOSITE) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMType, __pyx_tuple__134, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMType, __pyx_t_7) < 0) __PYX_ERR(45, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":20 * STAG = S_(DMSTAG) * * class DMBoundaryType(object): # <<<<<<<<<<<<<< * NONE = DM_BOUNDARY_NONE * GHOSTED = DM_BOUNDARY_GHOSTED */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__135); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__135, __pyx_n_s_DMBoundaryType, __pyx_n_s_DMBoundaryType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DM.pyx":21 * * class DMBoundaryType(object): * NONE = DM_BOUNDARY_NONE # <<<<<<<<<<<<<< * GHOSTED = DM_BOUNDARY_GHOSTED * MIRROR = DM_BOUNDARY_MIRROR */ __pyx_t_7 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_NONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(45, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":22 * class DMBoundaryType(object): * NONE = DM_BOUNDARY_NONE * GHOSTED = DM_BOUNDARY_GHOSTED # <<<<<<<<<<<<<< * MIRROR = DM_BOUNDARY_MIRROR * PERIODIC = DM_BOUNDARY_PERIODIC */ __pyx_t_7 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_GHOSTED); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GHOSTED, __pyx_t_7) < 0) __PYX_ERR(45, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":23 * NONE = DM_BOUNDARY_NONE * GHOSTED = DM_BOUNDARY_GHOSTED * MIRROR = DM_BOUNDARY_MIRROR # <<<<<<<<<<<<<< * PERIODIC = DM_BOUNDARY_PERIODIC * TWIST = DM_BOUNDARY_TWIST */ __pyx_t_7 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_MIRROR); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MIRROR, __pyx_t_7) < 0) __PYX_ERR(45, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":24 * GHOSTED = DM_BOUNDARY_GHOSTED * MIRROR = DM_BOUNDARY_MIRROR * PERIODIC = DM_BOUNDARY_PERIODIC # <<<<<<<<<<<<<< * TWIST = DM_BOUNDARY_TWIST * */ __pyx_t_7 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_PERIODIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PERIODIC, __pyx_t_7) < 0) __PYX_ERR(45, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":25 * MIRROR = DM_BOUNDARY_MIRROR * PERIODIC = DM_BOUNDARY_PERIODIC * TWIST = DM_BOUNDARY_TWIST # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_DMBoundaryType(DM_BOUNDARY_TWIST); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_TWIST, __pyx_t_7) < 0) __PYX_ERR(45, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DM.pyx":20 * STAG = S_(DMSTAG) * * class DMBoundaryType(object): # <<<<<<<<<<<<<< * NONE = DM_BOUNDARY_NONE * GHOSTED = DM_BOUNDARY_GHOSTED */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMBoundaryType, __pyx_tuple__135, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(45, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMBoundaryType, __pyx_t_7) < 0) __PYX_ERR(45, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":31 * cdef class DM(Object): * * Type = DMType # <<<<<<<<<<<<<< * BoundaryType = DMBoundaryType * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMType); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(45, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":32 * * Type = DMType * BoundaryType = DMBoundaryType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMBoundaryType); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_BoundaryType, __pyx_t_3) < 0) __PYX_ERR(45, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":463 * return sec * * setDefaultSection = setSection # <<<<<<<<<<<<<< * getDefaultSection = getSection * setDefaultGlobalSection = setGlobalSection */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setSection); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_setDefaultSection, __pyx_t_3) < 0) __PYX_ERR(45, 463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":464 * * setDefaultSection = setSection * getDefaultSection = getSection # <<<<<<<<<<<<<< * setDefaultGlobalSection = setGlobalSection * getDefaultGlobalSection = getGlobalSection */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getSection); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_getDefaultSection, __pyx_t_3) < 0) __PYX_ERR(45, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":465 * setDefaultSection = setSection * getDefaultSection = getSection * setDefaultGlobalSection = setGlobalSection # <<<<<<<<<<<<<< * getDefaultGlobalSection = getGlobalSection * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setGlobalSection); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_setDefaultGlobalSection, __pyx_t_3) < 0) __PYX_ERR(45, 465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":466 * getDefaultSection = getSection * setDefaultGlobalSection = setGlobalSection * getDefaultGlobalSection = getGlobalSection # <<<<<<<<<<<<<< * * def createSectionSF(self, Section localsec, Section globalsec): */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getGlobalSection); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_getDefaultGlobalSection, __pyx_t_3) < 0) __PYX_ERR(45, 466, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":480 * CHKERR( DMSetSectionSF(self.dm, sf.sf) ) * * createDefaultSF = createSectionSF # <<<<<<<<<<<<<< * getDefaultSF = getSectionSF * setDefaultSF = setSectionSF */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createSectionSF); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_createDefaultSF, __pyx_t_3) < 0) __PYX_ERR(45, 480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":481 * * createDefaultSF = createSectionSF * getDefaultSF = getSectionSF # <<<<<<<<<<<<<< * setDefaultSF = setSectionSF * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_getSectionSF); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_getDefaultSF, __pyx_t_3) < 0) __PYX_ERR(45, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":482 * createDefaultSF = createSectionSF * getDefaultSF = getSectionSF * setDefaultSF = setSectionSF # <<<<<<<<<<<<<< * * def getPointSF(self): */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_setSectionSF); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_setDefaultSF, __pyx_t_3) < 0) __PYX_ERR(45, 482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":593 * * # backward compatibility * createGlobalVector = createGlobalVec # <<<<<<<<<<<<<< * createLocalVector = createLocalVec * getMatrix = createMatrix = createMat */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createGlobalVec); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_createGlobalVector, __pyx_t_3) < 0) __PYX_ERR(45, 593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":594 * # backward compatibility * createGlobalVector = createGlobalVec * createLocalVector = createLocalVec # <<<<<<<<<<<<<< * getMatrix = createMatrix = createMat * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createLocalVec); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_createLocalVector, __pyx_t_3) < 0) __PYX_ERR(45, 594, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); /* "PETSc/DM.pyx":595 * createGlobalVector = createGlobalVec * createLocalVector = createLocalVec * getMatrix = createMatrix = createMat # <<<<<<<<<<<<<< * * def setKSPComputeOperators(self, operators, args=None, kargs=None): */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_n_s_createMat); if (unlikely(!__pyx_t_3)) __PYX_ERR(45, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_getMatrix, __pyx_t_3) < 0) __PYX_ERR(45, 595, __pyx_L1_error) PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DM->tp_dict, __pyx_n_s_createMatrix, __pyx_t_3) < 0) __PYX_ERR(45, 595, __pyx_L1_error) PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DM); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DM.pyx":703 * # -------------------------------------------------------------------- * * del DMType # <<<<<<<<<<<<<< * del DMBoundaryType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMType) < 0) __PYX_ERR(45, 703, __pyx_L1_error) /* "PETSc/DM.pyx":704 * * del DMType * del DMBoundaryType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMBoundaryType) < 0) __PYX_ERR(45, 704, __pyx_L1_error) /* "PETSc/DS.pyx":3 * # -------------------------------------------------------------------- * * class DSType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCDSBASIC) * */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__136); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__136, __pyx_n_s_DSType, __pyx_n_s_DSType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DS.pyx":4 * * class DSType(object): * BASIC = S_(PETSCDSBASIC) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDSBASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(46, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DS.pyx":3 * # -------------------------------------------------------------------- * * class DSType(object): # <<<<<<<<<<<<<< * BASIC = S_(PETSCDSBASIC) * */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DSType, __pyx_tuple__136, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DSType, __pyx_t_7) < 0) __PYX_ERR(46, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DS.pyx":10 * cdef class DS(Object): * * Type = DSType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DSType); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DS->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(46, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DS); /* "PETSc/DS.pyx":104 * # -------------------------------------------------------------------- * * del DSType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DSType) < 0) __PYX_ERR(46, 104, __pyx_L1_error) /* "PETSc/DMDA.pyx":3 * # -------------------------------------------------------------------- * * class DMDAStencilType(object): # <<<<<<<<<<<<<< * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__137); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__137, __pyx_n_s_DMDAStencilType, __pyx_n_s_DMDAStencilType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMDA.pyx":4 * * class DMDAStencilType(object): * STAR = DMDA_STENCIL_STAR # <<<<<<<<<<<<<< * BOX = DMDA_STENCIL_BOX * */ __pyx_t_7 = __Pyx_PyInt_From_DMDAStencilType(DMDA_STENCIL_STAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STAR, __pyx_t_7) < 0) __PYX_ERR(47, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMDA.pyx":5 * class DMDAStencilType(object): * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX # <<<<<<<<<<<<<< * * class DMDAInterpolationType(object): */ __pyx_t_7 = __Pyx_PyInt_From_DMDAStencilType(DMDA_STENCIL_BOX); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BOX, __pyx_t_7) < 0) __PYX_ERR(47, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMDA.pyx":3 * # -------------------------------------------------------------------- * * class DMDAStencilType(object): # <<<<<<<<<<<<<< * STAR = DMDA_STENCIL_STAR * BOX = DMDA_STENCIL_BOX */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMDAStencilType, __pyx_tuple__137, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMDAStencilType, __pyx_t_7) < 0) __PYX_ERR(47, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMDA.pyx":7 * BOX = DMDA_STENCIL_BOX * * class DMDAInterpolationType(object): # <<<<<<<<<<<<<< * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__138); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__138, __pyx_n_s_DMDAInterpolationType, __pyx_n_s_DMDAInterpolationType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMDA.pyx":8 * * class DMDAInterpolationType(object): * Q0 = DMDA_INTERPOLATION_Q0 # <<<<<<<<<<<<<< * Q1 = DMDA_INTERPOLATION_Q1 * */ __pyx_t_7 = __Pyx_PyInt_From_DMDAInterpolationType(DMDA_Q0); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_Q0, __pyx_t_7) < 0) __PYX_ERR(47, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMDA.pyx":9 * class DMDAInterpolationType(object): * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 # <<<<<<<<<<<<<< * * class DMDAElementType(object): */ __pyx_t_7 = __Pyx_PyInt_From_DMDAInterpolationType(DMDA_Q1); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_Q1, __pyx_t_7) < 0) __PYX_ERR(47, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMDA.pyx":7 * BOX = DMDA_STENCIL_BOX * * class DMDAInterpolationType(object): # <<<<<<<<<<<<<< * Q0 = DMDA_INTERPOLATION_Q0 * Q1 = DMDA_INTERPOLATION_Q1 */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMDAInterpolationType, __pyx_tuple__138, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMDAInterpolationType, __pyx_t_7) < 0) __PYX_ERR(47, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMDA.pyx":11 * Q1 = DMDA_INTERPOLATION_Q1 * * class DMDAElementType(object): # <<<<<<<<<<<<<< * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__139); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__139, __pyx_n_s_DMDAElementType, __pyx_n_s_DMDAElementType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMDA.pyx":12 * * class DMDAElementType(object): * P1 = DMDA_ELEMENT_P1 # <<<<<<<<<<<<<< * Q1 = DMDA_ELEMENT_Q1 * */ __pyx_t_7 = __Pyx_PyInt_From_DMDAElementType(DMDA_ELEMENT_P1); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_P1, __pyx_t_7) < 0) __PYX_ERR(47, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMDA.pyx":13 * class DMDAElementType(object): * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_DMDAElementType(DMDA_ELEMENT_Q1); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_Q1, __pyx_t_7) < 0) __PYX_ERR(47, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMDA.pyx":11 * Q1 = DMDA_INTERPOLATION_Q1 * * class DMDAElementType(object): # <<<<<<<<<<<<<< * P1 = DMDA_ELEMENT_P1 * Q1 = DMDA_ELEMENT_Q1 */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMDAElementType, __pyx_tuple__139, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(47, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMDAElementType, __pyx_t_7) < 0) __PYX_ERR(47, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMDA.pyx":19 * cdef class DMDA(DM): * * StencilType = DMDAStencilType # <<<<<<<<<<<<<< * InterpolationType = DMDAInterpolationType * ElementType = DMDAElementType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMDAStencilType); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_dict, __pyx_n_s_StencilType, __pyx_t_3) < 0) __PYX_ERR(47, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "PETSc/DMDA.pyx":20 * * StencilType = DMDAStencilType * InterpolationType = DMDAInterpolationType # <<<<<<<<<<<<<< * ElementType = DMDAElementType * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMDAInterpolationType); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_dict, __pyx_n_s_InterpolationType, __pyx_t_3) < 0) __PYX_ERR(47, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "PETSc/DMDA.pyx":21 * StencilType = DMDAStencilType * InterpolationType = DMDAInterpolationType * ElementType = DMDAElementType # <<<<<<<<<<<<<< * * # */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMDAElementType); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_dict, __pyx_n_s_ElementType, __pyx_t_3) < 0) __PYX_ERR(47, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "PETSc/DMDA.pyx":514 * * # backward compatibility * createNaturalVector = createNaturalVec # <<<<<<<<<<<<<< * * */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_n_s_createNaturalVec); if (unlikely(!__pyx_t_3)) __PYX_ERR(47, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_dict, __pyx_n_s_createNaturalVector, __pyx_t_3) < 0) __PYX_ERR(47, 514, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMDA); /* "PETSc/DMDA.pyx":518 * * # backward compatibility alias * DA = DMDA # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DA, ((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMDA)) < 0) __PYX_ERR(47, 518, __pyx_L1_error) /* "PETSc/DMDA.pyx":522 * # -------------------------------------------------------------------- * * del DMDAStencilType # <<<<<<<<<<<<<< * del DMDAInterpolationType * del DMDAElementType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMDAStencilType) < 0) __PYX_ERR(47, 522, __pyx_L1_error) /* "PETSc/DMDA.pyx":523 * * del DMDAStencilType * del DMDAInterpolationType # <<<<<<<<<<<<<< * del DMDAElementType * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMDAInterpolationType) < 0) __PYX_ERR(47, 523, __pyx_L1_error) /* "PETSc/DMDA.pyx":524 * del DMDAStencilType * del DMDAInterpolationType * del DMDAElementType # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMDAElementType) < 0) __PYX_ERR(47, 524, __pyx_L1_error) /* "PETSc/DMStag.pyx":3 * # -------------------------------------------------------------------- * * class DMStagStencilType(object): # <<<<<<<<<<<<<< * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__140); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__140, __pyx_n_s_DMStagStencilType, __pyx_n_s_DMStagStencilType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMStag.pyx":4 * * class DMStagStencilType(object): * STAR = DMSTAG_STENCIL_STAR # <<<<<<<<<<<<<< * BOX = DMSTAG_STENCIL_BOX * NONE = DMSTAG_STENCIL_NONE */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilType(DMSTAG_STENCIL_STAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_STAR, __pyx_t_7) < 0) __PYX_ERR(49, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":5 * class DMStagStencilType(object): * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX # <<<<<<<<<<<<<< * NONE = DMSTAG_STENCIL_NONE * */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilType(DMSTAG_STENCIL_BOX); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BOX, __pyx_t_7) < 0) __PYX_ERR(49, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":6 * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX * NONE = DMSTAG_STENCIL_NONE # <<<<<<<<<<<<<< * * class DMStagStencilLocation(object): */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilType(DMSTAG_STENCIL_NONE); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NONE, __pyx_t_7) < 0) __PYX_ERR(49, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":3 * # -------------------------------------------------------------------- * * class DMStagStencilType(object): # <<<<<<<<<<<<<< * STAR = DMSTAG_STENCIL_STAR * BOX = DMSTAG_STENCIL_BOX */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMStagStencilType, __pyx_tuple__140, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMStagStencilType, __pyx_t_7) < 0) __PYX_ERR(49, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMStag.pyx":8 * NONE = DMSTAG_STENCIL_NONE * * class DMStagStencilLocation(object): # <<<<<<<<<<<<<< * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__141); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__141, __pyx_n_s_DMStagStencilLocation, __pyx_n_s_DMStagStencilLocation, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMStag.pyx":9 * * class DMStagStencilLocation(object): * NULLLOC = DMSTAG_NULL_LOCATION # <<<<<<<<<<<<<< * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT * BACK_DOWN = DMSTAG_BACK_DOWN */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_NULL_LOCATION); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_NULLLOC, __pyx_t_7) < 0) __PYX_ERR(49, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":10 * class DMStagStencilLocation(object): * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT # <<<<<<<<<<<<<< * BACK_DOWN = DMSTAG_BACK_DOWN * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_DOWN_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_DOWN_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":11 * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT * BACK_DOWN = DMSTAG_BACK_DOWN # <<<<<<<<<<<<<< * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT * BACK_LEFT = DMSTAG_BACK_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_DOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_DOWN, __pyx_t_7) < 0) __PYX_ERR(49, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":12 * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT * BACK_DOWN = DMSTAG_BACK_DOWN * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT # <<<<<<<<<<<<<< * BACK_LEFT = DMSTAG_BACK_LEFT * BACK = DMSTAG_BACK */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_DOWN_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_DOWN_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":13 * BACK_DOWN = DMSTAG_BACK_DOWN * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT * BACK_LEFT = DMSTAG_BACK_LEFT # <<<<<<<<<<<<<< * BACK = DMSTAG_BACK * BACK_RIGHT = DMSTAG_BACK_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":14 * BACK_DOWN_RIGHT = DMSTAG_BACK_DOWN_RIGHT * BACK_LEFT = DMSTAG_BACK_LEFT * BACK = DMSTAG_BACK # <<<<<<<<<<<<<< * BACK_RIGHT = DMSTAG_BACK_RIGHT * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK, __pyx_t_7) < 0) __PYX_ERR(49, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":15 * BACK_LEFT = DMSTAG_BACK_LEFT * BACK = DMSTAG_BACK * BACK_RIGHT = DMSTAG_BACK_RIGHT # <<<<<<<<<<<<<< * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT * BACK_UP = DMSTAG_BACK_UP */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":16 * BACK = DMSTAG_BACK * BACK_RIGHT = DMSTAG_BACK_RIGHT * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT # <<<<<<<<<<<<<< * BACK_UP = DMSTAG_BACK_UP * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_UP_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_UP_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":17 * BACK_RIGHT = DMSTAG_BACK_RIGHT * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT * BACK_UP = DMSTAG_BACK_UP # <<<<<<<<<<<<<< * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT * DOWN_LEFT = DMSTAG_DOWN_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_UP); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_UP, __pyx_t_7) < 0) __PYX_ERR(49, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":18 * BACK_UP_LEFT = DMSTAG_BACK_UP_LEFT * BACK_UP = DMSTAG_BACK_UP * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT # <<<<<<<<<<<<<< * DOWN_LEFT = DMSTAG_DOWN_LEFT * DOWN = DMSTAG_DOWN */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_BACK_UP_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BACK_UP_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":19 * BACK_UP = DMSTAG_BACK_UP * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT * DOWN_LEFT = DMSTAG_DOWN_LEFT # <<<<<<<<<<<<<< * DOWN = DMSTAG_DOWN * DOWN_RIGHT = DMSTAG_DOWN_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_DOWN_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DOWN_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":20 * BACK_UP_RIGHT = DMSTAG_BACK_UP_RIGHT * DOWN_LEFT = DMSTAG_DOWN_LEFT * DOWN = DMSTAG_DOWN # <<<<<<<<<<<<<< * DOWN_RIGHT = DMSTAG_DOWN_RIGHT * LEFT = DMSTAG_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_DOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DOWN, __pyx_t_7) < 0) __PYX_ERR(49, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":21 * DOWN_LEFT = DMSTAG_DOWN_LEFT * DOWN = DMSTAG_DOWN * DOWN_RIGHT = DMSTAG_DOWN_RIGHT # <<<<<<<<<<<<<< * LEFT = DMSTAG_LEFT * ELEMENT = DMSTAG_ELEMENT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_DOWN_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_DOWN_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":22 * DOWN = DMSTAG_DOWN * DOWN_RIGHT = DMSTAG_DOWN_RIGHT * LEFT = DMSTAG_LEFT # <<<<<<<<<<<<<< * ELEMENT = DMSTAG_ELEMENT * RIGHT = DMSTAG_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":23 * DOWN_RIGHT = DMSTAG_DOWN_RIGHT * LEFT = DMSTAG_LEFT * ELEMENT = DMSTAG_ELEMENT # <<<<<<<<<<<<<< * RIGHT = DMSTAG_RIGHT * UP_LEFT = DMSTAG_UP_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_ELEMENT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ELEMENT, __pyx_t_7) < 0) __PYX_ERR(49, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":24 * LEFT = DMSTAG_LEFT * ELEMENT = DMSTAG_ELEMENT * RIGHT = DMSTAG_RIGHT # <<<<<<<<<<<<<< * UP_LEFT = DMSTAG_UP_LEFT * UP = DMSTAG_UP */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":25 * ELEMENT = DMSTAG_ELEMENT * RIGHT = DMSTAG_RIGHT * UP_LEFT = DMSTAG_UP_LEFT # <<<<<<<<<<<<<< * UP = DMSTAG_UP * UP_RIGHT = DMSTAG_UP_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_UP_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UP_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":26 * RIGHT = DMSTAG_RIGHT * UP_LEFT = DMSTAG_UP_LEFT * UP = DMSTAG_UP # <<<<<<<<<<<<<< * UP_RIGHT = DMSTAG_UP_RIGHT * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_UP); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UP, __pyx_t_7) < 0) __PYX_ERR(49, 26, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":27 * UP_LEFT = DMSTAG_UP_LEFT * UP = DMSTAG_UP * UP_RIGHT = DMSTAG_UP_RIGHT # <<<<<<<<<<<<<< * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT * FRONT_DOWN = DMSTAG_FRONT_DOWN */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_UP_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_UP_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":28 * UP = DMSTAG_UP * UP_RIGHT = DMSTAG_UP_RIGHT * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT # <<<<<<<<<<<<<< * FRONT_DOWN = DMSTAG_FRONT_DOWN * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_DOWN_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":29 * UP_RIGHT = DMSTAG_UP_RIGHT * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT * FRONT_DOWN = DMSTAG_FRONT_DOWN # <<<<<<<<<<<<<< * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT * FRONT_LEFT = DMSTAG_FRONT_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_DOWN, __pyx_t_7) < 0) __PYX_ERR(49, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":30 * FRONT_DOWN_LEFT = DMSTAG_FRONT_DOWN_LEFT * FRONT_DOWN = DMSTAG_FRONT_DOWN * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT # <<<<<<<<<<<<<< * FRONT_LEFT = DMSTAG_FRONT_LEFT * FRONT = DMSTAG_FRONT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_DOWN_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":31 * FRONT_DOWN = DMSTAG_FRONT_DOWN * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT * FRONT_LEFT = DMSTAG_FRONT_LEFT # <<<<<<<<<<<<<< * FRONT = DMSTAG_FRONT * FRONT_RIGHT = DMSTAG_FRONT_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":32 * FRONT_DOWN_RIGHT = DMSTAG_FRONT_DOWN_RIGHT * FRONT_LEFT = DMSTAG_FRONT_LEFT * FRONT = DMSTAG_FRONT # <<<<<<<<<<<<<< * FRONT_RIGHT = DMSTAG_FRONT_RIGHT * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT, __pyx_t_7) < 0) __PYX_ERR(49, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":33 * FRONT_LEFT = DMSTAG_FRONT_LEFT * FRONT = DMSTAG_FRONT * FRONT_RIGHT = DMSTAG_FRONT_RIGHT # <<<<<<<<<<<<<< * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT * FRONT_UP = DMSTAG_FRONT_UP */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":34 * FRONT = DMSTAG_FRONT * FRONT_RIGHT = DMSTAG_FRONT_RIGHT * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT # <<<<<<<<<<<<<< * FRONT_UP = DMSTAG_FRONT_UP * FRONT_UP_RIGHT = DMSTAG_FRONT_UP_RIGHT */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_UP_LEFT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_UP_LEFT, __pyx_t_7) < 0) __PYX_ERR(49, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":35 * FRONT_RIGHT = DMSTAG_FRONT_RIGHT * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT * FRONT_UP = DMSTAG_FRONT_UP # <<<<<<<<<<<<<< * FRONT_UP_RIGHT = DMSTAG_FRONT_UP_RIGHT * */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_UP); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_UP, __pyx_t_7) < 0) __PYX_ERR(49, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":36 * FRONT_UP_LEFT = DMSTAG_FRONT_UP_LEFT * FRONT_UP = DMSTAG_FRONT_UP * FRONT_UP_RIGHT = DMSTAG_FRONT_UP_RIGHT # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __Pyx_PyInt_From_DMStagStencilLocation(DMSTAG_FRONT_UP_RIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_FRONT_UP_RIGHT, __pyx_t_7) < 0) __PYX_ERR(49, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMStag.pyx":8 * NONE = DMSTAG_STENCIL_NONE * * class DMStagStencilLocation(object): # <<<<<<<<<<<<<< * NULLLOC = DMSTAG_NULL_LOCATION * BACK_DOWN_LEFT = DMSTAG_BACK_DOWN_LEFT */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMStagStencilLocation, __pyx_tuple__141, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(49, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMStagStencilLocation, __pyx_t_7) < 0) __PYX_ERR(49, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMStag.pyx":42 * cdef class DMStag(DM): * * StencilType = DMStagStencilType # <<<<<<<<<<<<<< * StencilLocation = DMStagStencilLocation * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMStagStencilType); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_dict, __pyx_n_s_StencilType, __pyx_t_3) < 0) __PYX_ERR(49, 42, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMStag); /* "PETSc/DMStag.pyx":43 * * StencilType = DMStagStencilType * StencilLocation = DMStagStencilLocation # <<<<<<<<<<<<<< * * def create(self, dim, dofs=None, sizes=None, boundary_types=None, stencil_type=None, stencil_width=None, proc_sizes=None, ownership_ranges=None, comm=None, setUp=False): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMStagStencilLocation); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_dict, __pyx_n_s_StencilLocation, __pyx_t_3) < 0) __PYX_ERR(49, 43, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMStag); /* "PETSc/DMStag.pyx":363 * # -------------------------------------------------------------------- * * del DMStagStencilType # <<<<<<<<<<<<<< * del DMStagStencilLocation * */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMStagStencilType) < 0) __PYX_ERR(49, 363, __pyx_L1_error) /* "PETSc/DMStag.pyx":364 * * del DMStagStencilType * del DMStagStencilLocation # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMStagStencilLocation) < 0) __PYX_ERR(49, 364, __pyx_L1_error) /* "PETSc/DMComposite.pyx":25 * CHKERR( DMCompositeGetNumberDM(self.dm, &n) ) * return toInt(n) * getNumberDM = getNumber # <<<<<<<<<<<<<< * * def getEntries(self): */ __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_n_s_getNumber); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_dict, __pyx_n_s_getNumberDM, __pyx_t_3) < 0) __PYX_ERR(50, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMComposite); /* "PETSc/DMSwarm.pyx":3 * # -------------------------------------------------------------------- * * class DMSwarmType(object): # <<<<<<<<<<<<<< * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__142); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__142, __pyx_n_s_DMSwarmType, __pyx_n_s_DMSwarmType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMSwarm.pyx":4 * * class DMSwarmType(object): * BASIC = DMSWARM_BASIC # <<<<<<<<<<<<<< * PIC = DMSWARM_PIC * */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmType(DMSWARM_BASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_BASIC, __pyx_t_7) < 0) __PYX_ERR(53, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":5 * class DMSwarmType(object): * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC # <<<<<<<<<<<<<< * * class DMSwarmMigrateType(object): */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmType(DMSWARM_PIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PIC, __pyx_t_7) < 0) __PYX_ERR(53, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":3 * # -------------------------------------------------------------------- * * class DMSwarmType(object): # <<<<<<<<<<<<<< * BASIC = DMSWARM_BASIC * PIC = DMSWARM_PIC */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMSwarmType, __pyx_tuple__142, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmType, __pyx_t_7) < 0) __PYX_ERR(53, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":7 * PIC = DMSWARM_PIC * * class DMSwarmMigrateType(object): # <<<<<<<<<<<<<< * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__143); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__143, __pyx_n_s_DMSwarmMigrateType, __pyx_n_s_DMSwarmMigrateType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMSwarm.pyx":8 * * class DMSwarmMigrateType(object): * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC # <<<<<<<<<<<<<< * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_BASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MIGRATE_BASIC, __pyx_t_7) < 0) __PYX_ERR(53, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":9 * class DMSwarmMigrateType(object): * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER # <<<<<<<<<<<<<< * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT * MIGRATE_USER = DMSWARM_MIGRATE_USER */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_DMCELLNSCATTER); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MIGRATE_DMCELLNSCATTER, __pyx_t_7) < 0) __PYX_ERR(53, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":10 * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT # <<<<<<<<<<<<<< * MIGRATE_USER = DMSWARM_MIGRATE_USER * */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_DMCELLEXACT); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MIGRATE_DMCELLEXACT, __pyx_t_7) < 0) __PYX_ERR(53, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":11 * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER * MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT * MIGRATE_USER = DMSWARM_MIGRATE_USER # <<<<<<<<<<<<<< * * class DMSwarmCollectType(object): */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmMigrateType(DMSWARM_MIGRATE_USER); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MIGRATE_USER, __pyx_t_7) < 0) __PYX_ERR(53, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":7 * PIC = DMSWARM_PIC * * class DMSwarmMigrateType(object): # <<<<<<<<<<<<<< * MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC * MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMSwarmMigrateType, __pyx_tuple__143, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmMigrateType, __pyx_t_7) < 0) __PYX_ERR(53, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":13 * MIGRATE_USER = DMSWARM_MIGRATE_USER * * class DMSwarmCollectType(object): # <<<<<<<<<<<<<< * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__144); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__144, __pyx_n_s_DMSwarmCollectType, __pyx_n_s_DMSwarmCollectType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMSwarm.pyx":14 * * class DMSwarmCollectType(object): * COLLECT_BASIC = DMSWARM_COLLECT_BASIC # <<<<<<<<<<<<<< * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_BASIC); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COLLECT_BASIC, __pyx_t_7) < 0) __PYX_ERR(53, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":15 * class DMSwarmCollectType(object): * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX # <<<<<<<<<<<<<< * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL * COLLECT_USER = DMSWARM_COLLECT_USER */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_DMDABOUNDINGBOX); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COLLECT_DMDABOUNDINGBOX, __pyx_t_7) < 0) __PYX_ERR(53, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":16 * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL # <<<<<<<<<<<<<< * COLLECT_USER = DMSWARM_COLLECT_USER * */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_GENERAL); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COLLECT_GENERAL, __pyx_t_7) < 0) __PYX_ERR(53, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":17 * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX * COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL * COLLECT_USER = DMSWARM_COLLECT_USER # <<<<<<<<<<<<<< * * class DMSwarmPICLayoutType(object): */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmCollectType(DMSWARM_COLLECT_USER); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_COLLECT_USER, __pyx_t_7) < 0) __PYX_ERR(53, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":13 * MIGRATE_USER = DMSWARM_MIGRATE_USER * * class DMSwarmCollectType(object): # <<<<<<<<<<<<<< * COLLECT_BASIC = DMSWARM_COLLECT_BASIC * COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMSwarmCollectType, __pyx_tuple__144, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmCollectType, __pyx_t_7) < 0) __PYX_ERR(53, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":19 * COLLECT_USER = DMSWARM_COLLECT_USER * * class DMSwarmPICLayoutType(object): # <<<<<<<<<<<<<< * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__145); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__145, __pyx_n_s_DMSwarmPICLayoutType, __pyx_n_s_DMSwarmPICLayoutType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/DMSwarm.pyx":20 * * class DMSwarmPICLayoutType(object): * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR # <<<<<<<<<<<<<< * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS * LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_REGULAR); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LAYOUT_REGULAR, __pyx_t_7) < 0) __PYX_ERR(53, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":21 * class DMSwarmPICLayoutType(object): * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS # <<<<<<<<<<<<<< * LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION * */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_GAUSS); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LAYOUT_GAUSS, __pyx_t_7) < 0) __PYX_ERR(53, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":22 * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS * LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION # <<<<<<<<<<<<<< * * */ __pyx_t_7 = __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_SUBDIVISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_LAYOUT_SUBDIVISION, __pyx_t_7) < 0) __PYX_ERR(53, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/DMSwarm.pyx":19 * COLLECT_USER = DMSWARM_COLLECT_USER * * class DMSwarmPICLayoutType(object): # <<<<<<<<<<<<<< * LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR * LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_DMSwarmPICLayoutType, __pyx_tuple__145, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(53, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_DMSwarmPICLayoutType, __pyx_t_7) < 0) __PYX_ERR(53, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":27 * cdef class DMSwarm(DM): * * Type = DMSwarmType # <<<<<<<<<<<<<< * MigrateType = DMSwarmMigrateType * CollectType = DMSwarmCollectType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMSwarmType); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(53, 27, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "PETSc/DMSwarm.pyx":28 * * Type = DMSwarmType * MigrateType = DMSwarmMigrateType # <<<<<<<<<<<<<< * CollectType = DMSwarmCollectType * PICLayoutType = DMSwarmPICLayoutType */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMSwarmMigrateType); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_dict, __pyx_n_s_MigrateType, __pyx_t_3) < 0) __PYX_ERR(53, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "PETSc/DMSwarm.pyx":29 * Type = DMSwarmType * MigrateType = DMSwarmMigrateType * CollectType = DMSwarmCollectType # <<<<<<<<<<<<<< * PICLayoutType = DMSwarmPICLayoutType * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMSwarmCollectType); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_dict, __pyx_n_s_CollectType, __pyx_t_3) < 0) __PYX_ERR(53, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "PETSc/DMSwarm.pyx":30 * MigrateType = DMSwarmMigrateType * CollectType = DMSwarmCollectType * PICLayoutType = DMSwarmPICLayoutType # <<<<<<<<<<<<<< * * def create(self, comm=None): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DMSwarmPICLayoutType); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_dict, __pyx_n_s_PICLayoutType, __pyx_t_3) < 0) __PYX_ERR(53, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_DMSwarm); /* "PETSc/DMSwarm.pyx":78 * return self * * def registerField(self, fieldname, blocksize, dtype=ScalarType): # <<<<<<<<<<<<<< * cdef const char *cfieldname = NULL * cdef PetscInt cblocksize = asInt(blocksize) */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ScalarType); if (unlikely(!__pyx_t_3)) __PYX_ERR(53, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_k__53 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/DMSwarm.pyx":288 * * * del DMSwarmType # <<<<<<<<<<<<<< * del DMSwarmMigrateType * del DMSwarmCollectType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmType) < 0) __PYX_ERR(53, 288, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":289 * * del DMSwarmType * del DMSwarmMigrateType # <<<<<<<<<<<<<< * del DMSwarmCollectType * del DMSwarmPICLayoutType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmMigrateType) < 0) __PYX_ERR(53, 289, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":290 * del DMSwarmType * del DMSwarmMigrateType * del DMSwarmCollectType # <<<<<<<<<<<<<< * del DMSwarmPICLayoutType */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmCollectType) < 0) __PYX_ERR(53, 290, __pyx_L1_error) /* "PETSc/DMSwarm.pyx":291 * del DMSwarmMigrateType * del DMSwarmCollectType * del DMSwarmPICLayoutType # <<<<<<<<<<<<<< */ if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_DMSwarmPICLayoutType) < 0) __PYX_ERR(53, 291, __pyx_L1_error) /* "PETSc/Partitioner.pyx":3 * # -------------------------------------------------------------------- * * class PartitionerType(object): # <<<<<<<<<<<<<< * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) */ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__146); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_tuple__146, __pyx_n_s_PartitionerType, __pyx_n_s_PartitionerType, (PyObject *) NULL, __pyx_n_s_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "PETSc/Partitioner.pyx":4 * * class PartitionerType(object): * PARMETIS = S_(PETSCPARTITIONERPARMETIS) # <<<<<<<<<<<<<< * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) * CHACO = S_(PETSCPARTITIONERCHACO) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERPARMETIS); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PARMETIS, __pyx_t_7) < 0) __PYX_ERR(54, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Partitioner.pyx":5 * class PartitionerType(object): * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) # <<<<<<<<<<<<<< * CHACO = S_(PETSCPARTITIONERCHACO) * SIMPLE = S_(PETSCPARTITIONERSIMPLE) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERPTSCOTCH); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_PTSCOTCH, __pyx_t_7) < 0) __PYX_ERR(54, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Partitioner.pyx":6 * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) * CHACO = S_(PETSCPARTITIONERCHACO) # <<<<<<<<<<<<<< * SIMPLE = S_(PETSCPARTITIONERSIMPLE) * SHELL = S_(PETSCPARTITIONERSHELL) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERCHACO); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_CHACO, __pyx_t_7) < 0) __PYX_ERR(54, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Partitioner.pyx":7 * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) * CHACO = S_(PETSCPARTITIONERCHACO) * SIMPLE = S_(PETSCPARTITIONERSIMPLE) # <<<<<<<<<<<<<< * SHELL = S_(PETSCPARTITIONERSHELL) * GATHER = S_(PETSCPARTITIONERGATHER) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERSIMPLE); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SIMPLE, __pyx_t_7) < 0) __PYX_ERR(54, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Partitioner.pyx":8 * CHACO = S_(PETSCPARTITIONERCHACO) * SIMPLE = S_(PETSCPARTITIONERSIMPLE) * SHELL = S_(PETSCPARTITIONERSHELL) # <<<<<<<<<<<<<< * GATHER = S_(PETSCPARTITIONERGATHER) * MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING) */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERSHELL); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_SHELL, __pyx_t_7) < 0) __PYX_ERR(54, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Partitioner.pyx":9 * SIMPLE = S_(PETSCPARTITIONERSIMPLE) * SHELL = S_(PETSCPARTITIONERSHELL) * GATHER = S_(PETSCPARTITIONERGATHER) # <<<<<<<<<<<<<< * MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING) * */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERGATHER); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_GATHER, __pyx_t_7) < 0) __PYX_ERR(54, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Partitioner.pyx":10 * SHELL = S_(PETSCPARTITIONERSHELL) * GATHER = S_(PETSCPARTITIONERGATHER) * MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING) # <<<<<<<<<<<<<< * * # -------------------------------------------------------------------- */ __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERMATPARTITIONING); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_MATPARTITIONING, __pyx_t_7) < 0) __PYX_ERR(54, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "PETSc/Partitioner.pyx":3 * # -------------------------------------------------------------------- * * class PartitionerType(object): # <<<<<<<<<<<<<< * PARMETIS = S_(PETSCPARTITIONERPARMETIS) * PTSCOTCH = S_(PETSCPARTITIONERPTSCOTCH) */ __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_PartitionerType, __pyx_tuple__146, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PartitionerType, __pyx_t_7) < 0) __PYX_ERR(54, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/Partitioner.pyx":16 * cdef class Partitioner(Object): * * Type = PartitionerType # <<<<<<<<<<<<<< * * def __cinit__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PartitionerType); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_dict, __pyx_n_s_Type, __pyx_t_3) < 0) __PYX_ERR(54, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_8petsc4py_5PETSc_Partitioner); /* "PETSc/PETSc.pyx":201 * int,PetscErrorType,char*,void*) * * cdef object tracebacklist = [] # <<<<<<<<<<<<<< * * cdef int traceback(MPI_Comm comm, */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_tracebacklist); __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_tracebacklist, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PETSc.pyx":281 * int PetscPythonRegisterAll() * * cdef int PyPetsc_Argc = 0 # <<<<<<<<<<<<<< * cdef char** PyPetsc_Argv = NULL * */ __pyx_v_8petsc4py_5PETSc_PyPetsc_Argc = 0; /* "PETSc/PETSc.pyx":282 * * cdef int PyPetsc_Argc = 0 * cdef char** PyPetsc_Argv = NULL # <<<<<<<<<<<<<< * * cdef int getinitargs(object args, int *argc, char **argv[]) except -1: */ __pyx_v_8petsc4py_5PETSc_PyPetsc_Argv = NULL; /* "PETSc/PETSc.pyx":379 * PetscClassId PETSC_DMLABEL_CLASSID "DMLABEL_CLASSID" * * cdef bint registercalled = 0 # <<<<<<<<<<<<<< * * cdef const char *citation = b"""\ */ __pyx_v_8petsc4py_5PETSc_registercalled = 0; /* "PETSc/PETSc.pyx":381 * cdef bint registercalled = 0 * * cdef const char *citation = b"""\ # <<<<<<<<<<<<<< * @Article{Dalcin2011, * Author = {Lisandro D. Dalcin and Rodrigo R. Paz and Pablo A. Kler and Alejandro Cosimo}, */ __pyx_v_8petsc4py_5PETSc_citation = ((char const *)"@Article{Dalcin2011,\n Author = {Lisandro D. Dalcin and Rodrigo R. Paz and Pablo A. Kler and Alejandro Cosimo},\n Title = {Parallel distributed computing using {P}ython},\n Journal = {Advances in Water Resources},\n Note = {New Computational Methods and Software Tools},\n Volume = {34},\n Number = {9},\n Pages = {1124--1139},\n Year = {2011},\n DOI = {http://dx.doi.org/10.1016/j.advwatres.2011.04.013}\n}\n"); /* "PETSc/PETSc.pyx":432 * # -------------------------------------------------------------------- * * def _initialize(args=None, comm=None): # <<<<<<<<<<<<<< * global tracebacklist * Error._traceback_ = tracebacklist */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_1_initialize, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_initialize, __pyx_t_3) < 0) __PYX_ERR(11, 432, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "PETSc/PETSc.pyx":448 * PETSC_COMM_DEFAULT = PETSC_COMM_WORLD * * def _finalize(): # <<<<<<<<<<<<<< * finalize() * # */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8petsc4py_5PETSc_3_finalize, NULL, __pyx_n_s_petsc4py_PETSc); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_finalize, __pyx_t_3) < 0) __PYX_ERR(11, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":209 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * def __dealloc__(array self): */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(56, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_array_type); /* "View.MemoryView":286 * return self.name * * cdef generic = Enum("") # <<<<<<<<<<<<<< * cdef strided = Enum("") # default * cdef indirect = Enum("") */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(generic); __Pyx_DECREF_SET(generic, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":287 * * cdef generic = Enum("") * cdef strided = Enum("") # default # <<<<<<<<<<<<<< * cdef indirect = Enum("") * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(strided); __Pyx_DECREF_SET(strided, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":288 * cdef generic = Enum("") * cdef strided = Enum("") # default * cdef indirect = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect); __Pyx_DECREF_SET(indirect, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":291 * * * cdef contiguous = Enum("") # <<<<<<<<<<<<<< * cdef indirect_contiguous = Enum("") * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(contiguous); __Pyx_DECREF_SET(contiguous, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":292 * * cdef contiguous = Enum("") * cdef indirect_contiguous = Enum("") # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(indirect_contiguous); __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "View.MemoryView":316 * * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<< * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ * PyThread_allocate_lock(), */ __pyx_memoryview_thread_locks_used = 0; /* "View.MemoryView":317 * DEF THREAD_LOCKS_PREALLOCATED = 8 * cdef int __pyx_memoryview_thread_locks_used = 0 * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<< * PyThread_allocate_lock(), * PyThread_allocate_lock(), */ __pyx_t_8[0] = PyThread_allocate_lock(); __pyx_t_8[1] = PyThread_allocate_lock(); __pyx_t_8[2] = PyThread_allocate_lock(); __pyx_t_8[3] = PyThread_allocate_lock(); __pyx_t_8[4] = PyThread_allocate_lock(); __pyx_t_8[5] = PyThread_allocate_lock(); __pyx_t_8[6] = PyThread_allocate_lock(); __pyx_t_8[7] = PyThread_allocate_lock(); memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8)); /* "View.MemoryView":549 * info.obj = self * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(56, 549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryview_type); /* "View.MemoryView":995 * return self.from_object * * __pyx_getbuffer = capsule( &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<< * * */ __pyx_t_3 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_3) < 0) __PYX_ERR(56, 995, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_memoryviewslice_type); /* "(tree fragment)":1 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_3) < 0) __PYX_ERR(56, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "BufferFormatFromTypeInfo":1463 * * @cname('__pyx_format_from_typeinfo') * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<< * cdef __Pyx_StructField *field * cdef __pyx_typeinfo_string fmt */ /*--- Wrapped vars code ---*/ if (__Pyx_RegisterCleanup()) __PYX_ERR(57, 1, __pyx_L1_error); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init petsc4py.PETSc", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init petsc4py.PETSc"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) { Py_CLEAR(__pyx_tuple_); Py_CLEAR(__pyx_tuple__3); Py_CLEAR(__pyx_tuple__5); Py_CLEAR(__pyx_slice__6); Py_CLEAR(__pyx_tuple__8); Py_CLEAR(__pyx_tuple__9); Py_CLEAR(__pyx_tuple__10); Py_CLEAR(__pyx_tuple__11); Py_CLEAR(__pyx_tuple__12); Py_CLEAR(__pyx_tuple__15); Py_CLEAR(__pyx_tuple__16); Py_CLEAR(__pyx_tuple__17); Py_CLEAR(__pyx_tuple__18); Py_CLEAR(__pyx_tuple__19); Py_CLEAR(__pyx_tuple__21); Py_CLEAR(__pyx_tuple__22); Py_CLEAR(__pyx_codeobj__23); Py_CLEAR(__pyx_tuple__24); Py_CLEAR(__pyx_codeobj__25); Py_CLEAR(__pyx_tuple__26); Py_CLEAR(__pyx_tuple__27); Py_CLEAR(__pyx_tuple__28); Py_CLEAR(__pyx_tuple__29); Py_CLEAR(__pyx_tuple__30); Py_CLEAR(__pyx_tuple__31); Py_CLEAR(__pyx_tuple__32); Py_CLEAR(__pyx_tuple__33); Py_CLEAR(__pyx_tuple__34); Py_CLEAR(__pyx_tuple__35); Py_CLEAR(__pyx_tuple__36); Py_CLEAR(__pyx_tuple__37); Py_CLEAR(__pyx_tuple__38); Py_CLEAR(__pyx_slice__39); Py_CLEAR(__pyx_tuple__40); Py_CLEAR(__pyx_tuple__41); Py_CLEAR(__pyx_tuple__42); Py_CLEAR(__pyx_tuple__43); Py_CLEAR(__pyx_tuple__44); Py_CLEAR(__pyx_tuple__45); Py_CLEAR(__pyx_tuple__46); Py_CLEAR(__pyx_tuple__47); Py_CLEAR(__pyx_slice__48); Py_CLEAR(__pyx_slice__49); Py_CLEAR(__pyx_tuple__50); Py_CLEAR(__pyx_tuple__51); Py_CLEAR(__pyx_tuple__52); Py_CLEAR(__pyx_tuple__54); Py_CLEAR(__pyx_tuple__55); Py_CLEAR(__pyx_tuple__56); Py_CLEAR(__pyx_tuple__57); Py_CLEAR(__pyx_tuple__58); Py_CLEAR(__pyx_tuple__59); Py_CLEAR(__pyx_tuple__60); Py_CLEAR(__pyx_tuple__61); Py_CLEAR(__pyx_tuple__62); Py_CLEAR(__pyx_tuple__63); Py_CLEAR(__pyx_tuple__64); Py_CLEAR(__pyx_tuple__65); Py_CLEAR(__pyx_tuple__66); Py_CLEAR(__pyx_tuple__67); Py_CLEAR(__pyx_tuple__68); Py_CLEAR(__pyx_tuple__69); Py_CLEAR(__pyx_tuple__70); Py_CLEAR(__pyx_tuple__71); Py_CLEAR(__pyx_tuple__75); Py_CLEAR(__pyx_tuple__76); Py_CLEAR(__pyx_tuple__77); Py_CLEAR(__pyx_tuple__78); Py_CLEAR(__pyx_tuple__79); Py_CLEAR(__pyx_codeobj__80); Py_CLEAR(__pyx_tuple__81); Py_CLEAR(__pyx_codeobj__82); Py_CLEAR(__pyx_tuple__83); Py_CLEAR(__pyx_codeobj__84); Py_CLEAR(__pyx_tuple__85); Py_CLEAR(__pyx_codeobj__86); Py_CLEAR(__pyx_tuple__87); Py_CLEAR(__pyx_tuple__88); Py_CLEAR(__pyx_tuple__89); Py_CLEAR(__pyx_tuple__90); Py_CLEAR(__pyx_tuple__91); Py_CLEAR(__pyx_tuple__92); Py_CLEAR(__pyx_tuple__93); Py_CLEAR(__pyx_tuple__94); Py_CLEAR(__pyx_tuple__95); Py_CLEAR(__pyx_tuple__96); Py_CLEAR(__pyx_tuple__97); Py_CLEAR(__pyx_tuple__98); Py_CLEAR(__pyx_tuple__99); Py_CLEAR(__pyx_tuple__100); Py_CLEAR(__pyx_tuple__101); Py_CLEAR(__pyx_tuple__102); Py_CLEAR(__pyx_tuple__103); Py_CLEAR(__pyx_tuple__104); Py_CLEAR(__pyx_tuple__105); Py_CLEAR(__pyx_tuple__106); Py_CLEAR(__pyx_tuple__107); Py_CLEAR(__pyx_tuple__108); Py_CLEAR(__pyx_tuple__109); Py_CLEAR(__pyx_tuple__110); Py_CLEAR(__pyx_tuple__111); Py_CLEAR(__pyx_tuple__112); Py_CLEAR(__pyx_tuple__113); Py_CLEAR(__pyx_tuple__114); Py_CLEAR(__pyx_tuple__115); Py_CLEAR(__pyx_tuple__116); Py_CLEAR(__pyx_tuple__117); Py_CLEAR(__pyx_tuple__118); Py_CLEAR(__pyx_tuple__119); Py_CLEAR(__pyx_tuple__120); Py_CLEAR(__pyx_tuple__121); Py_CLEAR(__pyx_tuple__122); Py_CLEAR(__pyx_tuple__123); Py_CLEAR(__pyx_tuple__124); Py_CLEAR(__pyx_tuple__125); Py_CLEAR(__pyx_tuple__126); Py_CLEAR(__pyx_tuple__127); Py_CLEAR(__pyx_tuple__128); Py_CLEAR(__pyx_tuple__129); Py_CLEAR(__pyx_tuple__130); Py_CLEAR(__pyx_tuple__131); Py_CLEAR(__pyx_tuple__132); Py_CLEAR(__pyx_tuple__133); Py_CLEAR(__pyx_tuple__134); Py_CLEAR(__pyx_tuple__135); Py_CLEAR(__pyx_tuple__136); Py_CLEAR(__pyx_tuple__137); Py_CLEAR(__pyx_tuple__138); Py_CLEAR(__pyx_tuple__139); Py_CLEAR(__pyx_tuple__140); Py_CLEAR(__pyx_tuple__141); Py_CLEAR(__pyx_tuple__142); Py_CLEAR(__pyx_tuple__143); Py_CLEAR(__pyx_tuple__144); Py_CLEAR(__pyx_tuple__145); Py_CLEAR(__pyx_tuple__146); Py_CLEAR(__pyx_tuple__147); Py_CLEAR(__pyx_codeobj__148); Py_CLEAR(__pyx_codeobj__149); Py_CLEAR(__pyx_tuple__150); Py_CLEAR(__pyx_tuple__151); Py_CLEAR(__pyx_tuple__152); Py_CLEAR(__pyx_tuple__153); Py_CLEAR(__pyx_tuple__154); Py_CLEAR(__pyx_tuple__155); Py_CLEAR(__pyx_codeobj__156); /* CodeObjectCache.cleanup */ if (__pyx_code_cache.entries) { __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; int i, count = __pyx_code_cache.count; __pyx_code_cache.count = 0; __pyx_code_cache.max_count = 0; __pyx_code_cache.entries = NULL; for (i=0; i 0) { PyObject* o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator]; (*Py_TYPE(o)->tp_free)(o); } while (__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator > 0) { PyObject* o = (PyObject*)__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[--__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator]; (*Py_TYPE(o)->tp_free)(o); } Py_CLEAR(__pyx_d); Py_CLEAR(__pyx_cython_runtime); Py_CLEAR(__pyx_b); } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* decode_c_bytes */ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { if (unlikely((start < 0) | (stop < 0))) { if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (stop > length) stop = length; if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (__Pyx_PyFastCFunction_Check(func)) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* WriteUnraisableException */ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, int full_traceback, CYTHON_UNUSED int nogil) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_PyThreadState_declare #ifdef WITH_THREAD PyGILState_STATE state; if (nogil) state = PyGILState_Ensure(); #ifdef _MSC_VER else state = (PyGILState_STATE)-1; #endif #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); if (full_traceback) { Py_XINCREF(old_exc); Py_XINCREF(old_val); Py_XINCREF(old_tb); __Pyx_ErrRestore(old_exc, old_val, old_tb); PyErr_PrintEx(1); } #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } #ifdef WITH_THREAD if (nogil) PyGILState_Release(state); #endif } /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { return (equals == Py_EQ); } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { const char *ps1, *ps2; Py_ssize_t length = PyBytes_GET_SIZE(s1); if (length != PyBytes_GET_SIZE(s2)) return (equals == Py_NE); ps1 = PyBytes_AS_STRING(s1); ps2 = PyBytes_AS_STRING(s2); if (ps1[0] != ps2[0]) { return (equals == Py_NE); } else if (length == 1) { return (equals == Py_EQ); } else { int result; #if CYTHON_USE_UNICODE_INTERNALS Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif result = memcmp(ps1, ps2, (size_t)length); return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { return (equals == Py_NE); } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { return (equals == Py_NE); } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } #endif } /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); #else #if PY_MAJOR_VERSION < 3 PyObject* owned_ref = NULL; #endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); #if PY_MAJOR_VERSION < 3 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { owned_ref = PyUnicode_FromObject(s2); if (unlikely(!owned_ref)) return -1; s2 = owned_ref; s2_is_unicode = 1; } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { owned_ref = PyUnicode_FromObject(s1); if (unlikely(!owned_ref)) return -1; s1 = owned_ref; s1_is_unicode = 1; } else if (((!s2_is_unicode) & (!s1_is_unicode))) { return __Pyx_PyBytes_Equals(s1, s2, equals); } #endif if (s1_is_unicode & s2_is_unicode) { Py_ssize_t length; int kind; void *data1, *data2; if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif kind = __Pyx_PyUnicode_KIND(s1); if (kind != __Pyx_PyUnicode_KIND(s2)) { goto return_ne; } data1 = __Pyx_PyUnicode_DATA(s1); data2 = __Pyx_PyUnicode_DATA(s2); if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { goto return_ne; } else if (length == 1) { goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { goto return_ne; } else if ((s2 == Py_None) & s1_is_unicode) { goto return_ne; } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); Py_DECREF(py_result); return result; } return_eq: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_EQ); return_ne: #if PY_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif return (equals == Py_NE); #endif } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = *type; tstate->exc_value = *value; tstate->exc_traceback = *tb; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (descr != NULL) { *method = descr; return 0; } PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(name)); #endif return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); } /* pop_index */ static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) { PyObject *r; if (unlikely(!py_ix)) return NULL; r = __Pyx__PyObject_PopIndex(L, py_ix); Py_DECREF(py_ix); return r; } static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) { return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) { Py_ssize_t size = PyList_GET_SIZE(L); if (likely(size > (((PyListObject*)L)->allocated >> 1))) { Py_ssize_t cix = ix; if (cix < 0) { cix += size; } if (likely(__Pyx_is_valid_index(cix, size))) { PyObject* v = PyList_GET_ITEM(L, cix); __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); size -= 1; memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*)); return v; } } if (py_ix == Py_None) { return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix)); } else { return __Pyx__PyObject_PopIndex(L, py_ix); } } #endif /* SliceObject */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_slice(obj, cstart, cstop); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) #endif { PyObject* result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else result = PyObject_GetItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name); bad: return NULL; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Format(PyExc_ImportError, #if PY_MAJOR_VERSION < 3 "cannot import name %.230s", PyString_AS_STRING(name)); #else "cannot import name %S", name); #endif } return value; } /* ExtTypeTest */ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } if (likely(__Pyx_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); return 0; } /* KeywordStringCheck */ static int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; #if CYTHON_COMPILING_IN_PYPY if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) goto invalid_keyword; return 1; #else while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_Check(key))) #endif if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); return 0; #endif invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } #endif return 0; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { if (PY_VERSION_HEX >= 0x030700A0) { return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); } else { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* py_dict_pop */ static CYTHON_INLINE PyObject *__Pyx_PyDict_Pop(PyObject *d, PyObject *key, PyObject *default_value) { #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B3 if ((1)) { return _PyDict_Pop(d, key, default_value); } else #endif if (default_value) { return __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_pop, d, key, default_value); } else { return __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_pop, d, key); } } /* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *args, *result = NULL; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_ASSUME_SAFE_MACROS args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); #else args = PyTuple_Pack(1, self); if (unlikely(!args)) goto bad; #endif result = __Pyx_PyObject_Call(cfunc->method, args, NULL); Py_DECREF(args); bad: return result; } /* py_dict_keys */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { if (PY_MAJOR_VERSION >= 3) return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); else return PyDict_Keys(d); } /* MemviewSliceInit */ static int __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview, int ndim, __Pyx_memviewslice *memviewslice, int memview_is_new_reference) { __Pyx_RefNannyDeclarations int i, retval=-1; Py_buffer *buf = &memview->view; __Pyx_RefNannySetupContext("init_memviewslice", 0); if (unlikely(memviewslice->memview || memviewslice->data)) { PyErr_SetString(PyExc_ValueError, "memviewslice is already initialized!"); goto fail; } if (buf->strides) { for (i = 0; i < ndim; i++) { memviewslice->strides[i] = buf->strides[i]; } } else { Py_ssize_t stride = buf->itemsize; for (i = ndim - 1; i >= 0; i--) { memviewslice->strides[i] = stride; stride *= buf->shape[i]; } } for (i = 0; i < ndim; i++) { memviewslice->shape[i] = buf->shape[i]; if (buf->suboffsets) { memviewslice->suboffsets[i] = buf->suboffsets[i]; } else { memviewslice->suboffsets[i] = -1; } } memviewslice->memview = memview; memviewslice->data = (char *)buf->buf; if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) { Py_INCREF(memview); } retval = 0; goto no_fail; fail: memviewslice->memview = 0; memviewslice->data = 0; retval = -1; no_fail: __Pyx_RefNannyFinishContext(); return retval; } #ifndef Py_NO_RETURN #define Py_NO_RETURN #endif static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN { va_list vargs; char msg[200]; #ifdef HAVE_STDARG_PROTOTYPES va_start(vargs, fmt); #else va_start(vargs); #endif vsnprintf(msg, 200, fmt, vargs); va_end(vargs); Py_FatalError(msg); } static CYTHON_INLINE int __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count, PyThread_type_lock lock) { int result; PyThread_acquire_lock(lock, 1); result = (*acquisition_count)++; PyThread_release_lock(lock); return result; } static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count, PyThread_type_lock lock) { int result; PyThread_acquire_lock(lock, 1); result = (*acquisition_count)--; PyThread_release_lock(lock); return result; } static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) { int first_time; struct __pyx_memoryview_obj *memview = memslice->memview; if (unlikely(!memview || (PyObject *) memview == Py_None)) return; if (unlikely(__pyx_get_slice_count(memview) < 0)) __pyx_fatalerror("Acquisition count is %d (line %d)", __pyx_get_slice_count(memview), lineno); first_time = __pyx_add_acquisition_count(memview) == 0; if (unlikely(first_time)) { if (have_gil) { Py_INCREF((PyObject *) memview); } else { PyGILState_STATE _gilstate = PyGILState_Ensure(); Py_INCREF((PyObject *) memview); PyGILState_Release(_gilstate); } } } static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) { int last_time; struct __pyx_memoryview_obj *memview = memslice->memview; if (unlikely(!memview || (PyObject *) memview == Py_None)) { memslice->memview = NULL; return; } if (unlikely(__pyx_get_slice_count(memview) <= 0)) __pyx_fatalerror("Acquisition count is %d (line %d)", __pyx_get_slice_count(memview), lineno); last_time = __pyx_sub_acquisition_count(memview) == 1; memslice->data = NULL; if (unlikely(last_time)) { if (have_gil) { Py_CLEAR(memslice->memview); } else { PyGILState_STATE _gilstate = PyGILState_Ensure(); Py_CLEAR(memslice->memview); PyGILState_Release(_gilstate); } } else { memslice->memview = NULL; } } /* PyIntCompare */ static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) { if (op1 == op2) { Py_RETURN_TRUE; } #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long a = PyInt_AS_LONG(op1); if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; unsigned long uintval; Py_ssize_t size = Py_SIZE(op1); const digit* digits = ((PyLongObject*)op1)->ob_digit; if (intval == 0) { if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } else if (intval < 0) { if (size >= 0) Py_RETURN_FALSE; intval = -intval; size = -size; } else { if (size <= 0) Py_RETURN_FALSE; } uintval = (unsigned long) intval; #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 4)) { unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 3)) { unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 2)) { unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 if (uintval >> (PyLong_SHIFT * 1)) { unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK)) | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)); } else #endif unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK)); if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE; } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( PyObject_RichCompare(op1, op2, Py_EQ)); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* SetItemInt */ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); Py_DECREF(j); return r; } static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o)); if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) { PyObject* old = PyList_GET_ITEM(o, n); Py_INCREF(v); PyList_SET_ITEM(o, n, v); Py_DECREF(old); return 1; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_ass_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return -1; PyErr_Clear(); } } return m->sq_ass_item(o, i, v); } } #else #if CYTHON_COMPILING_IN_PYPY if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) #else if (is_list || PySequence_Check(o)) #endif { return PySequence_SetItem(o, i, v); } #endif return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { PyObject *runerr; Py_ssize_t key_value; PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; if (unlikely(!(m && m->sq_item))) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); return NULL; } key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; if (likely(m && m->mp_subscript)) { return m->mp_subscript(obj, key); } return __Pyx_PyObject_GetIndex(obj, key); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { (void)inplace; (void)zerodivision_check; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* StringJoin */ #if !CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) { return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL); } #endif /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #else if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; } Py_INCREF(value); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* None */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* GetAttr3 */ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunctionShared */ #include static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) #else if (unlikely(value == NULL || !PyString_Check(value))) #endif { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { if (unlikely(op == NULL)) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { #if PY_MAJOR_VERSION < 3 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; #endif return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); #else return PyString_FromFormat("", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; m->defaults_size = size; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CythonFunction */ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { PyObject_GC_Track(op); } return op; } /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_CallOneArg(method, obj); Py_DECREF(method); return result; } if (unlikely(!method)) goto bad; result = __Pyx_PyObject_CallNoArg(method); Py_DECREF(method); bad: return result; } /* pop */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (Py_TYPE(L) == &PySet_Type) { return PySet_Pop(L); } return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); } #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); } #endif /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* SliceObject */ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) { #if CYTHON_USE_TYPE_SLOTS PyMappingMethods* mp; #if PY_MAJOR_VERSION < 3 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; if (likely(ms && ms->sq_ass_slice)) { if (!has_cstart) { if (_py_start && (*_py_start != Py_None)) { cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstart = 0; } if (!has_cstop) { if (_py_stop && (*_py_stop != Py_None)) { cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; } else cstop = PY_SSIZE_T_MAX; } if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { Py_ssize_t l = ms->sq_length(obj); if (likely(l >= 0)) { if (cstop < 0) { cstop += l; if (cstop < 0) cstop = 0; } if (cstart < 0) { cstart += l; if (cstart < 0) cstart = 0; } } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) goto bad; PyErr_Clear(); } } return ms->sq_ass_slice(obj, cstart, cstop, value); } #endif mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) #endif { int result; PyObject *py_slice, *py_start, *py_stop; if (_py_slice) { py_slice = *_py_slice; } else { PyObject* owned_start = NULL; PyObject* owned_stop = NULL; if (_py_start) { py_start = *_py_start; } else { if (has_cstart) { owned_start = py_start = PyInt_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; } if (_py_stop) { py_stop = *_py_stop; } else { if (has_cstop) { owned_stop = py_stop = PyInt_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; } } else py_stop = Py_None; } py_slice = PySlice_New(py_start, py_stop, Py_None); Py_XDECREF(owned_start); Py_XDECREF(owned_stop); if (unlikely(!py_slice)) goto bad; } #if CYTHON_USE_TYPE_SLOTS result = mp->mp_ass_subscript(obj, py_slice, value); #else result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); #endif if (!_py_slice) { Py_DECREF(py_slice); } return result; } PyErr_Format(PyExc_TypeError, "'%.200s' object does not support slice %.10s", Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion"); bad: return -1; } /* SliceTupleAndList */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { Py_ssize_t start = *_start, stop = *_stop, length = *_length; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; else if (stop > length) stop = length; *_length = stop - start; *_start = start; *_stop = stop; } static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; for (i = 0; i < length; i++) { v = dest[i] = src[i]; Py_INCREF(v); } } static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { PyObject* dest; Py_ssize_t length = PyList_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); if (unlikely(length <= 0)) return PyList_New(0); dest = PyList_New(length); if (unlikely(!dest)) return NULL; __Pyx_copy_object_array( ((PyListObject*)src)->ob_item + start, ((PyListObject*)dest)->ob_item, length); return dest; } static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( PyObject* src, Py_ssize_t start, Py_ssize_t stop) { PyObject* dest; Py_ssize_t length = PyTuple_GET_SIZE(src); __Pyx_crop_slice(&start, &stop, &length); if (unlikely(length <= 0)) return PyTuple_New(0); dest = PyTuple_New(length); if (unlikely(!dest)) return NULL; __Pyx_copy_object_array( ((PyTupleObject*)src)->ob_item + start, ((PyTupleObject*)dest)->ob_item, length); return dest; } #endif /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } if (unlikely(stop <= start)) return __Pyx_NewRef(__pyx_empty_unicode); length = stop - start; cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* RaiseNoneIterError */ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%.200s.%.200s is not a type object", module_name, class_name); goto bad; } #ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; #else py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; basicsize = PyLong_AsSsize_t(py_basicsize); Py_DECREF(py_basicsize); py_basicsize = 0; if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad; #endif if ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* PyObjectGetAttrStrNoError */ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) __Pyx_PyErr_Clear(); } static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); } #endif result = __Pyx_PyObject_GetAttrStr(obj, attr_name); if (unlikely(!result)) { __Pyx_PyObject_GetAttrStr_ClearAttributeError(); } return result; } /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); if (likely(reduce_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (reduce == object_reduce || PyErr_Occurred()) { goto __PYX_BAD; } setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); if (likely(setstate_cython)) { ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; } else if (!setstate || PyErr_Occurred()) { goto __PYX_BAD; } } PyType_Modified((PyTypeObject*)type_obj); } } goto __PYX_GOOD; __PYX_BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; __PYX_GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* ClassMethod */ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { return PyClassMethod_New(method); } #else #if CYTHON_COMPILING_IN_PYSTON || CYTHON_COMPILING_IN_PYPY if (PyMethodDescr_Check(method)) #else #if PY_MAJOR_VERSION == 2 static PyTypeObject *methoddescr_type = NULL; if (methoddescr_type == NULL) { PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); if (!meth) return NULL; methoddescr_type = Py_TYPE(meth); Py_DECREF(meth); } #else PyTypeObject *methoddescr_type = &PyMethodDescr_Type; #endif if (__Pyx_TypeCheck(method, methoddescr_type)) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject *)method; #if PY_VERSION_HEX < 0x03020000 PyTypeObject *d_type = descr->d_type; #else PyTypeObject *d_type = descr->d_common.d_type; #endif return PyDescr_NewClassMethod(d_type, descr->d_method); } #endif else if (PyMethod_Check(method)) { return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); } else { return PyClassMethod_New(method); } } /* GetNameInClass */ static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) { PyObject *result; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); __Pyx_GetModuleGlobalNameUncached(result, name); return result; } static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { PyObject *result; result = __Pyx_PyObject_GetAttrStr(nmspace, name); if (!result) { result = __Pyx_GetGlobalNameAfterAttributeLookup(name); } return result; } /* RegisterModuleCleanup */ #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) { __pyx_module_cleanup(module); Py_INCREF(Py_None); return Py_None; } static int __Pyx_RegisterCleanup(void) { static PyMethodDef cleanup_def = { "__cleanup", (PyCFunction)__pyx_module_cleanup_atexit, METH_NOARGS, 0}; PyObject *cleanup_func = 0; PyObject *atexit = 0; PyObject *reg = 0; PyObject *args = 0; PyObject *res = 0; int ret = -1; cleanup_func = PyCFunction_New(&cleanup_def, 0); if (!cleanup_func) goto bad; atexit = PyImport_ImportModule("atexit"); if (!atexit) goto bad; reg = PyObject_GetAttrString(atexit, "_exithandlers"); if (reg && PyList_Check(reg)) { PyObject *a, *kw; a = PyTuple_New(0); kw = PyDict_New(); if (!a || !kw) { Py_XDECREF(a); Py_XDECREF(kw); goto bad; } args = PyTuple_Pack(3, cleanup_func, a, kw); Py_DECREF(a); Py_DECREF(kw); if (!args) goto bad; ret = PyList_Insert(reg, 0, args); } else { if (!reg) PyErr_Clear(); Py_XDECREF(reg); reg = PyObject_GetAttrString(atexit, "register"); if (!reg) goto bad; args = PyTuple_Pack(1, cleanup_func); if (!args) goto bad; res = PyObject_CallObject(reg, args); if (!res) goto bad; ret = 0; } bad: Py_XDECREF(cleanup_func); Py_XDECREF(atexit); Py_XDECREF(reg); Py_XDECREF(args); Py_XDECREF(res); return ret; } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } #if PY_MAJOR_VERSION < 3 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) { if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_IS)) return __pyx_pw_8petsc4py_5PETSc_2IS_3__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_Vec)) return __pyx_pw_8petsc4py_5PETSc_3Vec_33__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__IS_buffer)) return __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_5__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer)) return __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_5__getbuffer__(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags); if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags); PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name); return -1; } static void __Pyx_ReleaseBuffer(Py_buffer *view) { PyObject *obj = view->obj; if (!obj) return; if (PyObject_CheckBuffer(obj)) { PyBuffer_Release(view); return; } if ((0)) {} else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_IS)) __pyx_pw_8petsc4py_5PETSc_2IS_5__releasebuffer__(obj, view); else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc_Vec)) __pyx_pw_8petsc4py_5PETSc_3Vec_35__releasebuffer__(obj, view); else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__IS_buffer)) __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_7__releasebuffer__(obj, view); else if (__Pyx_TypeCheck(obj, __pyx_ptype_8petsc4py_5PETSc__Vec_buffer)) __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_7__releasebuffer__(obj, view); view->obj = NULL; Py_DECREF(obj); } #endif /* MemviewSliceIsContig */ static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim) { int i, index, step, start; Py_ssize_t itemsize = mvs.memview->view.itemsize; if (order == 'F') { step = 1; start = 0; } else { step = -1; start = ndim - 1; } for (i = 0; i < ndim; i++) { index = start + step * i; if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize) return 0; itemsize *= mvs.shape[index]; } return 1; } /* OverlappingSlices */ static void __pyx_get_array_memory_extents(__Pyx_memviewslice *slice, void **out_start, void **out_end, int ndim, size_t itemsize) { char *start, *end; int i; start = end = slice->data; for (i = 0; i < ndim; i++) { Py_ssize_t stride = slice->strides[i]; Py_ssize_t extent = slice->shape[i]; if (extent == 0) { *out_start = *out_end = start; return; } else { if (stride > 0) end += stride * (extent - 1); else start += stride * (extent - 1); } } *out_start = start; *out_end = end + itemsize; } static int __pyx_slices_overlap(__Pyx_memviewslice *slice1, __Pyx_memviewslice *slice2, int ndim, size_t itemsize) { void *start1, *end1, *start2, *end2; __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize); __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize); return (start1 < end2) && (start2 < end1); } /* Capsule */ static CYTHON_INLINE PyObject * __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig) { PyObject *cobj; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(p, sig, NULL); #else cobj = PyCObject_FromVoidPtr(p, NULL); #endif return cobj; } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* MemviewDtypeToObject */ static CYTHON_INLINE PyObject *__pyx_memview_get_nn_PetscInt(const char *itemp) { return (PyObject *) __Pyx_PyInt_From_PetscInt(*(PetscInt *) itemp); } static CYTHON_INLINE int __pyx_memview_set_nn_PetscInt(const char *itemp, PyObject *obj) { PetscInt value = __Pyx_PyInt_As_PetscInt(obj); if ((value == ((PetscInt)-1)) && PyErr_Occurred()) return 0; *(PetscInt *) itemp = value; return 1; } static PyObject* __pyx_convert__to_py_PetscEventPerfInfo(PetscEventPerfInfo s) { PyObject* res; PyObject* member; res = __Pyx_PyDict_NewPresized(6); if (unlikely(!res)) return NULL; member = __Pyx_PyInt_From_int(s.count); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_count, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.flops); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_flops, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.time); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_time, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.numMessages); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_numMessages, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.messageLength); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_messageLength, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.numReductions); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_numReductions, member) < 0)) goto bad; Py_DECREF(member); return res; bad: Py_XDECREF(member); Py_DECREF(res); return NULL; } static PyObject* __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(struct __pyx_t_8petsc4py_5PETSc_DLDataType s) { PyObject* res; PyObject* member; res = __Pyx_PyDict_NewPresized(3); if (unlikely(!res)) return NULL; member = __Pyx_PyInt_From_uint8_t(s.code); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_code, member) < 0)) goto bad; Py_DECREF(member); member = __Pyx_PyInt_From_uint8_t(s.bits); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_bits, member) < 0)) goto bad; Py_DECREF(member); member = __Pyx_PyInt_From_uint16_t(s.lanes); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_lanes, member) < 0)) goto bad; Py_DECREF(member); return res; bad: Py_XDECREF(member); Py_DECREF(res); return NULL; } static PyObject* __pyx_convert__to_py_MatInfo(MatInfo s) { PyObject* res; PyObject* member; res = __Pyx_PyDict_NewPresized(10); if (unlikely(!res)) return NULL; member = PyFloat_FromDouble(s.block_size); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_block_size, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.nz_allocated); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_nz_allocated, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.nz_used); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_nz_used, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.nz_unneeded); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_nz_unneeded, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.memory); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_memory, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.assemblies); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_assemblies, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.mallocs); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_mallocs, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.fill_ratio_given); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_fill_ratio_given, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.fill_ratio_needed); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_fill_ratio_needed, member) < 0)) goto bad; Py_DECREF(member); member = PyFloat_FromDouble(s.factor_mallocs); if (unlikely(!member)) goto bad; if (unlikely(PyDict_SetItem(res, __pyx_n_s_factor_mallocs, member) < 0)) goto bad; Py_DECREF(member); return res; bad: Py_XDECREF(member); Py_DECREF(res); return NULL; } /* MemviewSliceCopyTemplate */ static __Pyx_memviewslice __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs, const char *mode, int ndim, size_t sizeof_dtype, int contig_flag, int dtype_is_object) { __Pyx_RefNannyDeclarations int i; __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } }; struct __pyx_memoryview_obj *from_memview = from_mvs->memview; Py_buffer *buf = &from_memview->view; PyObject *shape_tuple = NULL; PyObject *temp_int = NULL; struct __pyx_array_obj *array_obj = NULL; struct __pyx_memoryview_obj *memview_obj = NULL; __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0); for (i = 0; i < ndim; i++) { if (unlikely(from_mvs->suboffsets[i] >= 0)) { PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with " "indirect dimensions (axis %d)", i); goto fail; } } shape_tuple = PyTuple_New(ndim); if (unlikely(!shape_tuple)) { goto fail; } __Pyx_GOTREF(shape_tuple); for(i = 0; i < ndim; i++) { temp_int = PyInt_FromSsize_t(from_mvs->shape[i]); if(unlikely(!temp_int)) { goto fail; } else { PyTuple_SET_ITEM(shape_tuple, i, temp_int); temp_int = NULL; } } array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL); if (unlikely(!array_obj)) { goto fail; } __Pyx_GOTREF(array_obj); memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( (PyObject *) array_obj, contig_flag, dtype_is_object, from_mvs->memview->typeinfo); if (unlikely(!memview_obj)) goto fail; if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0)) goto fail; if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim, dtype_is_object) < 0)) goto fail; goto no_fail; fail: __Pyx_XDECREF(new_mvs.memview); new_mvs.memview = NULL; new_mvs.data = NULL; no_fail: __Pyx_XDECREF(shape_tuple); __Pyx_XDECREF(temp_int); __Pyx_XDECREF(array_obj); __Pyx_RefNannyFinishContext(); return new_mvs; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int neg_one = (int) -1, const_zero = (int) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_InsertMode(InsertMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const InsertMode neg_one = (InsertMode) -1, const_zero = (InsertMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(InsertMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(InsertMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(InsertMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(InsertMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(InsertMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(InsertMode), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ScatterMode(ScatterMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ScatterMode neg_one = (ScatterMode) -1, const_zero = (ScatterMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ScatterMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ScatterMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ScatterMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ScatterMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ScatterMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(ScatterMode), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_NormType(NormType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const NormType neg_one = (NormType) -1, const_zero = (NormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(NormType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(NormType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(NormType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(NormType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscViewerFormat(PetscViewerFormat value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscViewerFormat neg_one = (PetscViewerFormat) -1, const_zero = (PetscViewerFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscViewerFormat) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscViewerFormat) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscViewerFormat) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscViewerFormat) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscViewerFormat) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscViewerFormat), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscFileMode(PetscFileMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscFileMode neg_one = (PetscFileMode) -1, const_zero = (PetscFileMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscFileMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscFileMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscFileMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscFileMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscFileMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscFileMode), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ISGlobalToLocalMappingMode(ISGlobalToLocalMappingMode value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ISGlobalToLocalMappingMode neg_one = (ISGlobalToLocalMappingMode) -1, const_zero = (ISGlobalToLocalMappingMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(ISGlobalToLocalMappingMode) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(ISGlobalToLocalMappingMode), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_VecOption(VecOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const VecOption neg_one = (VecOption) -1, const_zero = (VecOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(VecOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(VecOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(VecOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(VecOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(VecOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(VecOption), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatOption(MatOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatOption neg_one = (MatOption) -1, const_zero = (MatOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatOption), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatAssemblyType(MatAssemblyType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatAssemblyType neg_one = (MatAssemblyType) -1, const_zero = (MatAssemblyType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatAssemblyType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatAssemblyType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatAssemblyType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatAssemblyType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatAssemblyType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatAssemblyType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatInfoType(MatInfoType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatInfoType neg_one = (MatInfoType) -1, const_zero = (MatInfoType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatInfoType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatInfoType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatInfoType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatInfoType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatInfoType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatInfoType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatStructure(MatStructure value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatStructure neg_one = (MatStructure) -1, const_zero = (MatStructure) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatStructure) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatStructure) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatStructure) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatStructure) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatStructure) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatStructure), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatFactorShiftType(MatFactorShiftType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatFactorShiftType neg_one = (MatFactorShiftType) -1, const_zero = (MatFactorShiftType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatFactorShiftType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatFactorShiftType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatFactorShiftType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatFactorShiftType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatFactorShiftType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatFactorShiftType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatSORType(MatSORType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatSORType neg_one = (MatSORType) -1, const_zero = (MatSORType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatSORType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatSORType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatSORType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatSORType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatSORType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatSORType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCSide(PCSide value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCSide neg_one = (PCSide) -1, const_zero = (PCSide) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCSide) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCSide) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCSide) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCSide) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCSide) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCSide), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCASMType(PCASMType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCASMType neg_one = (PCASMType) -1, const_zero = (PCASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCASMType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCASMType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCASMType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCASMType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCASMType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCASMType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCGASMType(PCGASMType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCGASMType neg_one = (PCGASMType) -1, const_zero = (PCGASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCGASMType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCGASMType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCGASMType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCGASMType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCGASMType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCGASMType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGType(PCMGType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGType neg_one = (PCMGType) -1, const_zero = (PCMGType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCMGType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCMGType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCMGType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCMGType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCMGCycleType(PCMGCycleType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGCycleType neg_one = (PCMGCycleType) -1, const_zero = (PCMGCycleType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCMGCycleType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCMGCycleType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGCycleType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCMGCycleType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGCycleType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCMGCycleType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCCompositeType(PCCompositeType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCCompositeType neg_one = (PCCompositeType) -1, const_zero = (PCCompositeType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCCompositeType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCCompositeType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCCompositeType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCCompositeType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCCompositeType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCCompositeType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurPreType(PCFieldSplitSchurPreType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurPreType neg_one = (PCFieldSplitSchurPreType) -1, const_zero = (PCFieldSplitSchurPreType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCFieldSplitSchurPreType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCFieldSplitSchurPreType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCFieldSplitSchurPreType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCFieldSplitSchurFactType(PCFieldSplitSchurFactType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurFactType neg_one = (PCFieldSplitSchurFactType) -1, const_zero = (PCFieldSplitSchurFactType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCFieldSplitSchurFactType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCFieldSplitSchurFactType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCFieldSplitSchurFactType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCPatchConstructType(PCPatchConstructType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCPatchConstructType neg_one = (PCPatchConstructType) -1, const_zero = (PCPatchConstructType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PCPatchConstructType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PCPatchConstructType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCPatchConstructType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PCPatchConstructType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PCPatchConstructType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PCPatchConstructType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPNormType(KSPNormType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPNormType neg_one = (KSPNormType) -1, const_zero = (KSPNormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(KSPNormType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(KSPNormType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPNormType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(KSPNormType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPNormType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(KSPNormType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_KSPConvergedReason(KSPConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPConvergedReason neg_one = (KSPConvergedReason) -1, const_zero = (KSPConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(KSPConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(KSPConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(KSPConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(KSPConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(KSPConvergedReason), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESNormSchedule(SNESNormSchedule value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESNormSchedule neg_one = (SNESNormSchedule) -1, const_zero = (SNESNormSchedule) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SNESNormSchedule) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SNESNormSchedule) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESNormSchedule) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SNESNormSchedule) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESNormSchedule) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SNESNormSchedule), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SNESConvergedReason(SNESConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESConvergedReason neg_one = (SNESConvergedReason) -1, const_zero = (SNESConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(SNESConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(SNESConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(SNESConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(SNESConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(SNESConvergedReason), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSProblemType(TSProblemType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSProblemType neg_one = (TSProblemType) -1, const_zero = (TSProblemType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSProblemType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSProblemType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSProblemType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSProblemType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSProblemType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(TSProblemType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSEquationType(TSEquationType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSEquationType neg_one = (TSEquationType) -1, const_zero = (TSEquationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSEquationType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSEquationType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSEquationType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSEquationType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSEquationType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(TSEquationType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSExactFinalTimeOption(TSExactFinalTimeOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSExactFinalTimeOption neg_one = (TSExactFinalTimeOption) -1, const_zero = (TSExactFinalTimeOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSExactFinalTimeOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSExactFinalTimeOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSExactFinalTimeOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSExactFinalTimeOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSExactFinalTimeOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(TSExactFinalTimeOption), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TSConvergedReason(TSConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSConvergedReason neg_one = (TSConvergedReason) -1, const_zero = (TSConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TSConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TSConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TSConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TSConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(TSConvergedReason), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_TaoConvergedReason(TaoConvergedReason value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TaoConvergedReason neg_one = (TaoConvergedReason) -1, const_zero = (TaoConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(TaoConvergedReason) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(TaoConvergedReason) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(TaoConvergedReason) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(TaoConvergedReason) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(TaoConvergedReason), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMBoundaryType(DMBoundaryType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMBoundaryType neg_one = (DMBoundaryType) -1, const_zero = (DMBoundaryType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMBoundaryType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMBoundaryType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMBoundaryType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMBoundaryType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMBoundaryType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMBoundaryType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAStencilType(DMDAStencilType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAStencilType neg_one = (DMDAStencilType) -1, const_zero = (DMDAStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMDAStencilType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMDAStencilType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAStencilType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMDAStencilType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAStencilType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMDAStencilType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAInterpolationType(DMDAInterpolationType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAInterpolationType neg_one = (DMDAInterpolationType) -1, const_zero = (DMDAInterpolationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMDAInterpolationType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMDAInterpolationType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAInterpolationType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMDAInterpolationType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAInterpolationType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMDAInterpolationType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMDAElementType(DMDAElementType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAElementType neg_one = (DMDAElementType) -1, const_zero = (DMDAElementType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMDAElementType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMDAElementType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAElementType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMDAElementType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAElementType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMDAElementType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilType(DMStagStencilType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilType neg_one = (DMStagStencilType) -1, const_zero = (DMStagStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMStagStencilType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMStagStencilType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMStagStencilType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMStagStencilType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMStagStencilLocation(DMStagStencilLocation value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilLocation neg_one = (DMStagStencilLocation) -1, const_zero = (DMStagStencilLocation) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMStagStencilLocation) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMStagStencilLocation) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilLocation) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMStagStencilLocation) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilLocation) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMStagStencilLocation), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmType(DMSwarmType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmType neg_one = (DMSwarmType) -1, const_zero = (DMSwarmType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMSwarmType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmMigrateType(DMSwarmMigrateType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmMigrateType neg_one = (DMSwarmMigrateType) -1, const_zero = (DMSwarmMigrateType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmMigrateType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmMigrateType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmMigrateType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmMigrateType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmMigrateType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMSwarmMigrateType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmCollectType(DMSwarmCollectType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmCollectType neg_one = (DMSwarmCollectType) -1, const_zero = (DMSwarmCollectType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmCollectType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmCollectType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmCollectType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmCollectType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmCollectType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMSwarmCollectType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_DMSwarmPICLayoutType(DMSwarmPICLayoutType value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmPICLayoutType neg_one = (DMSwarmPICLayoutType) -1, const_zero = (DMSwarmPICLayoutType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(DMSwarmPICLayoutType) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(DMSwarmPICLayoutType) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(DMSwarmPICLayoutType), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* TypeInfoToFormat */ static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) { struct __pyx_typeinfo_string result = { {0} }; char *buf = (char *) result.string; size_t size = type->size; switch (type->typegroup) { case 'H': *buf = 'c'; break; case 'I': case 'U': if (size == 1) *buf = (type->is_unsigned) ? 'B' : 'b'; else if (size == 2) *buf = (type->is_unsigned) ? 'H' : 'h'; else if (size == 4) *buf = (type->is_unsigned) ? 'I' : 'i'; else if (size == 8) *buf = (type->is_unsigned) ? 'Q' : 'q'; break; case 'P': *buf = 'P'; break; case 'C': { __Pyx_TypeInfo complex_type = *type; complex_type.typegroup = 'R'; complex_type.size /= 2; *buf++ = 'Z'; *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0]; break; } case 'R': if (size == 4) *buf = 'f'; else if (size == 8) *buf = 'd'; else *buf = 'g'; break; } return result; } /* CIntFromPy */ static CYTHON_INLINE PetscInt __Pyx_PyInt_As_PetscInt(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscInt neg_one = (PetscInt) -1, const_zero = (PetscInt) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PetscInt) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PetscInt, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscInt) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscInt) 0; case 1: __PYX_VERIFY_RETURN_INT(PetscInt, digit, digits[0]) case 2: if (8 * sizeof(PetscInt) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) >= 2 * PyLong_SHIFT) { return (PetscInt) (((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; case 3: if (8 * sizeof(PetscInt) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) >= 3 * PyLong_SHIFT) { return (PetscInt) (((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; case 4: if (8 * sizeof(PetscInt) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) >= 4 * PyLong_SHIFT) { return (PetscInt) (((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscInt) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PetscInt) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscInt) 0; case -1: __PYX_VERIFY_RETURN_INT(PetscInt, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PetscInt, digit, +digits[0]) case -2: if (8 * sizeof(PetscInt) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT) { return (PetscInt) (((PetscInt)-1)*(((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 2: if (8 * sizeof(PetscInt) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT) { return (PetscInt) ((((((PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case -3: if (8 * sizeof(PetscInt) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT) { return (PetscInt) (((PetscInt)-1)*(((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 3: if (8 * sizeof(PetscInt) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT) { return (PetscInt) ((((((((PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case -4: if (8 * sizeof(PetscInt) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 4 * PyLong_SHIFT) { return (PetscInt) (((PetscInt)-1)*(((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; case 4: if (8 * sizeof(PetscInt) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscInt) - 1 > 4 * PyLong_SHIFT) { return (PetscInt) ((((((((((PetscInt)digits[3]) << PyLong_SHIFT) | (PetscInt)digits[2]) << PyLong_SHIFT) | (PetscInt)digits[1]) << PyLong_SHIFT) | (PetscInt)digits[0]))); } } break; } #endif if (sizeof(PetscInt) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscInt, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PetscInt val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PetscInt) -1; } } else { PetscInt val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscInt) -1; val = __Pyx_PyInt_As_PetscInt(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscInt"); return (PetscInt) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscInt"); return (PetscInt) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscInt(PetscInt value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscInt neg_one = (PetscInt) -1, const_zero = (PetscInt) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscInt) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscInt) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscInt) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscInt) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscInt), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE InsertMode __Pyx_PyInt_As_InsertMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const InsertMode neg_one = (InsertMode) -1, const_zero = (InsertMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(InsertMode) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(InsertMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (InsertMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (InsertMode) 0; case 1: __PYX_VERIFY_RETURN_INT(InsertMode, digit, digits[0]) case 2: if (8 * sizeof(InsertMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) >= 2 * PyLong_SHIFT) { return (InsertMode) (((((InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0])); } } break; case 3: if (8 * sizeof(InsertMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) >= 3 * PyLong_SHIFT) { return (InsertMode) (((((((InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0])); } } break; case 4: if (8 * sizeof(InsertMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) >= 4 * PyLong_SHIFT) { return (InsertMode) (((((((((InsertMode)digits[3]) << PyLong_SHIFT) | (InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (InsertMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(InsertMode) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(InsertMode) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (InsertMode) 0; case -1: __PYX_VERIFY_RETURN_INT(InsertMode, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(InsertMode, digit, +digits[0]) case -2: if (8 * sizeof(InsertMode) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) - 1 > 2 * PyLong_SHIFT) { return (InsertMode) (((InsertMode)-1)*(((((InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case 2: if (8 * sizeof(InsertMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) - 1 > 2 * PyLong_SHIFT) { return (InsertMode) ((((((InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case -3: if (8 * sizeof(InsertMode) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) - 1 > 3 * PyLong_SHIFT) { return (InsertMode) (((InsertMode)-1)*(((((((InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case 3: if (8 * sizeof(InsertMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) - 1 > 3 * PyLong_SHIFT) { return (InsertMode) ((((((((InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case -4: if (8 * sizeof(InsertMode) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) - 1 > 4 * PyLong_SHIFT) { return (InsertMode) (((InsertMode)-1)*(((((((((InsertMode)digits[3]) << PyLong_SHIFT) | (InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; case 4: if (8 * sizeof(InsertMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(InsertMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(InsertMode) - 1 > 4 * PyLong_SHIFT) { return (InsertMode) ((((((((((InsertMode)digits[3]) << PyLong_SHIFT) | (InsertMode)digits[2]) << PyLong_SHIFT) | (InsertMode)digits[1]) << PyLong_SHIFT) | (InsertMode)digits[0]))); } } break; } #endif if (sizeof(InsertMode) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(InsertMode) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(InsertMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else InsertMode val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (InsertMode) -1; } } else { InsertMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (InsertMode) -1; val = __Pyx_PyInt_As_InsertMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to InsertMode"); return (InsertMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to InsertMode"); return (InsertMode) -1; } /* CIntFromPy */ static CYTHON_INLINE ScatterMode __Pyx_PyInt_As_ScatterMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ScatterMode neg_one = (ScatterMode) -1, const_zero = (ScatterMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(ScatterMode) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (ScatterMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (ScatterMode) 0; case 1: __PYX_VERIFY_RETURN_INT(ScatterMode, digit, digits[0]) case 2: if (8 * sizeof(ScatterMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) >= 2 * PyLong_SHIFT) { return (ScatterMode) (((((ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0])); } } break; case 3: if (8 * sizeof(ScatterMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) >= 3 * PyLong_SHIFT) { return (ScatterMode) (((((((ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0])); } } break; case 4: if (8 * sizeof(ScatterMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) >= 4 * PyLong_SHIFT) { return (ScatterMode) (((((((((ScatterMode)digits[3]) << PyLong_SHIFT) | (ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (ScatterMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(ScatterMode) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(ScatterMode) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (ScatterMode) 0; case -1: __PYX_VERIFY_RETURN_INT(ScatterMode, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(ScatterMode, digit, +digits[0]) case -2: if (8 * sizeof(ScatterMode) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) - 1 > 2 * PyLong_SHIFT) { return (ScatterMode) (((ScatterMode)-1)*(((((ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case 2: if (8 * sizeof(ScatterMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) - 1 > 2 * PyLong_SHIFT) { return (ScatterMode) ((((((ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case -3: if (8 * sizeof(ScatterMode) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) - 1 > 3 * PyLong_SHIFT) { return (ScatterMode) (((ScatterMode)-1)*(((((((ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case 3: if (8 * sizeof(ScatterMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) - 1 > 3 * PyLong_SHIFT) { return (ScatterMode) ((((((((ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case -4: if (8 * sizeof(ScatterMode) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) - 1 > 4 * PyLong_SHIFT) { return (ScatterMode) (((ScatterMode)-1)*(((((((((ScatterMode)digits[3]) << PyLong_SHIFT) | (ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; case 4: if (8 * sizeof(ScatterMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ScatterMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ScatterMode) - 1 > 4 * PyLong_SHIFT) { return (ScatterMode) ((((((((((ScatterMode)digits[3]) << PyLong_SHIFT) | (ScatterMode)digits[2]) << PyLong_SHIFT) | (ScatterMode)digits[1]) << PyLong_SHIFT) | (ScatterMode)digits[0]))); } } break; } #endif if (sizeof(ScatterMode) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(ScatterMode) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else ScatterMode val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (ScatterMode) -1; } } else { ScatterMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (ScatterMode) -1; val = __Pyx_PyInt_As_ScatterMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to ScatterMode"); return (ScatterMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to ScatterMode"); return (ScatterMode) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscFileMode __Pyx_PyInt_As_PetscFileMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscFileMode neg_one = (PetscFileMode) -1, const_zero = (PetscFileMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PetscFileMode) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscFileMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscFileMode) 0; case 1: __PYX_VERIFY_RETURN_INT(PetscFileMode, digit, digits[0]) case 2: if (8 * sizeof(PetscFileMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) >= 2 * PyLong_SHIFT) { return (PetscFileMode) (((((PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0])); } } break; case 3: if (8 * sizeof(PetscFileMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) >= 3 * PyLong_SHIFT) { return (PetscFileMode) (((((((PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0])); } } break; case 4: if (8 * sizeof(PetscFileMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) >= 4 * PyLong_SHIFT) { return (PetscFileMode) (((((((((PetscFileMode)digits[3]) << PyLong_SHIFT) | (PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscFileMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PetscFileMode) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscFileMode) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscFileMode) 0; case -1: __PYX_VERIFY_RETURN_INT(PetscFileMode, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PetscFileMode, digit, +digits[0]) case -2: if (8 * sizeof(PetscFileMode) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) - 1 > 2 * PyLong_SHIFT) { return (PetscFileMode) (((PetscFileMode)-1)*(((((PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case 2: if (8 * sizeof(PetscFileMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) - 1 > 2 * PyLong_SHIFT) { return (PetscFileMode) ((((((PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case -3: if (8 * sizeof(PetscFileMode) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) - 1 > 3 * PyLong_SHIFT) { return (PetscFileMode) (((PetscFileMode)-1)*(((((((PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case 3: if (8 * sizeof(PetscFileMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) - 1 > 3 * PyLong_SHIFT) { return (PetscFileMode) ((((((((PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case -4: if (8 * sizeof(PetscFileMode) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) - 1 > 4 * PyLong_SHIFT) { return (PetscFileMode) (((PetscFileMode)-1)*(((((((((PetscFileMode)digits[3]) << PyLong_SHIFT) | (PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; case 4: if (8 * sizeof(PetscFileMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscFileMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscFileMode) - 1 > 4 * PyLong_SHIFT) { return (PetscFileMode) ((((((((((PetscFileMode)digits[3]) << PyLong_SHIFT) | (PetscFileMode)digits[2]) << PyLong_SHIFT) | (PetscFileMode)digits[1]) << PyLong_SHIFT) | (PetscFileMode)digits[0]))); } } break; } #endif if (sizeof(PetscFileMode) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscFileMode) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PetscFileMode val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PetscFileMode) -1; } } else { PetscFileMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscFileMode) -1; val = __Pyx_PyInt_As_PetscFileMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscFileMode"); return (PetscFileMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscFileMode"); return (PetscFileMode) -1; } /* CIntFromPy */ static CYTHON_INLINE MatStructure __Pyx_PyInt_As_MatStructure(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatStructure neg_one = (MatStructure) -1, const_zero = (MatStructure) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(MatStructure) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(MatStructure, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatStructure) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatStructure) 0; case 1: __PYX_VERIFY_RETURN_INT(MatStructure, digit, digits[0]) case 2: if (8 * sizeof(MatStructure) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) >= 2 * PyLong_SHIFT) { return (MatStructure) (((((MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0])); } } break; case 3: if (8 * sizeof(MatStructure) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) >= 3 * PyLong_SHIFT) { return (MatStructure) (((((((MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0])); } } break; case 4: if (8 * sizeof(MatStructure) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) >= 4 * PyLong_SHIFT) { return (MatStructure) (((((((((MatStructure)digits[3]) << PyLong_SHIFT) | (MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatStructure) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(MatStructure) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatStructure) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatStructure) 0; case -1: __PYX_VERIFY_RETURN_INT(MatStructure, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(MatStructure, digit, +digits[0]) case -2: if (8 * sizeof(MatStructure) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) - 1 > 2 * PyLong_SHIFT) { return (MatStructure) (((MatStructure)-1)*(((((MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case 2: if (8 * sizeof(MatStructure) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) - 1 > 2 * PyLong_SHIFT) { return (MatStructure) ((((((MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case -3: if (8 * sizeof(MatStructure) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) - 1 > 3 * PyLong_SHIFT) { return (MatStructure) (((MatStructure)-1)*(((((((MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case 3: if (8 * sizeof(MatStructure) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) - 1 > 3 * PyLong_SHIFT) { return (MatStructure) ((((((((MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case -4: if (8 * sizeof(MatStructure) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) - 1 > 4 * PyLong_SHIFT) { return (MatStructure) (((MatStructure)-1)*(((((((((MatStructure)digits[3]) << PyLong_SHIFT) | (MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; case 4: if (8 * sizeof(MatStructure) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatStructure, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatStructure) - 1 > 4 * PyLong_SHIFT) { return (MatStructure) ((((((((((MatStructure)digits[3]) << PyLong_SHIFT) | (MatStructure)digits[2]) << PyLong_SHIFT) | (MatStructure)digits[1]) << PyLong_SHIFT) | (MatStructure)digits[0]))); } } break; } #endif if (sizeof(MatStructure) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatStructure) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatStructure, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else MatStructure val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (MatStructure) -1; } } else { MatStructure val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatStructure) -1; val = __Pyx_PyInt_As_MatStructure(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatStructure"); return (MatStructure) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatStructure"); return (MatStructure) -1; } /* CIntFromPy */ static CYTHON_INLINE MatAssemblyType __Pyx_PyInt_As_MatAssemblyType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatAssemblyType neg_one = (MatAssemblyType) -1, const_zero = (MatAssemblyType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(MatAssemblyType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatAssemblyType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatAssemblyType) 0; case 1: __PYX_VERIFY_RETURN_INT(MatAssemblyType, digit, digits[0]) case 2: if (8 * sizeof(MatAssemblyType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) >= 2 * PyLong_SHIFT) { return (MatAssemblyType) (((((MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0])); } } break; case 3: if (8 * sizeof(MatAssemblyType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) >= 3 * PyLong_SHIFT) { return (MatAssemblyType) (((((((MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0])); } } break; case 4: if (8 * sizeof(MatAssemblyType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) >= 4 * PyLong_SHIFT) { return (MatAssemblyType) (((((((((MatAssemblyType)digits[3]) << PyLong_SHIFT) | (MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatAssemblyType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(MatAssemblyType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatAssemblyType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatAssemblyType) 0; case -1: __PYX_VERIFY_RETURN_INT(MatAssemblyType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(MatAssemblyType, digit, +digits[0]) case -2: if (8 * sizeof(MatAssemblyType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) - 1 > 2 * PyLong_SHIFT) { return (MatAssemblyType) (((MatAssemblyType)-1)*(((((MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case 2: if (8 * sizeof(MatAssemblyType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) - 1 > 2 * PyLong_SHIFT) { return (MatAssemblyType) ((((((MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case -3: if (8 * sizeof(MatAssemblyType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) - 1 > 3 * PyLong_SHIFT) { return (MatAssemblyType) (((MatAssemblyType)-1)*(((((((MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case 3: if (8 * sizeof(MatAssemblyType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) - 1 > 3 * PyLong_SHIFT) { return (MatAssemblyType) ((((((((MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case -4: if (8 * sizeof(MatAssemblyType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) - 1 > 4 * PyLong_SHIFT) { return (MatAssemblyType) (((MatAssemblyType)-1)*(((((((((MatAssemblyType)digits[3]) << PyLong_SHIFT) | (MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; case 4: if (8 * sizeof(MatAssemblyType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatAssemblyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatAssemblyType) - 1 > 4 * PyLong_SHIFT) { return (MatAssemblyType) ((((((((((MatAssemblyType)digits[3]) << PyLong_SHIFT) | (MatAssemblyType)digits[2]) << PyLong_SHIFT) | (MatAssemblyType)digits[1]) << PyLong_SHIFT) | (MatAssemblyType)digits[0]))); } } break; } #endif if (sizeof(MatAssemblyType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatAssemblyType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else MatAssemblyType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (MatAssemblyType) -1; } } else { MatAssemblyType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatAssemblyType) -1; val = __Pyx_PyInt_As_MatAssemblyType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatAssemblyType"); return (MatAssemblyType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatAssemblyType"); return (MatAssemblyType) -1; } /* CIntFromPy */ static CYTHON_INLINE MatInfoType __Pyx_PyInt_As_MatInfoType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatInfoType neg_one = (MatInfoType) -1, const_zero = (MatInfoType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(MatInfoType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatInfoType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatInfoType) 0; case 1: __PYX_VERIFY_RETURN_INT(MatInfoType, digit, digits[0]) case 2: if (8 * sizeof(MatInfoType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) >= 2 * PyLong_SHIFT) { return (MatInfoType) (((((MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0])); } } break; case 3: if (8 * sizeof(MatInfoType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) >= 3 * PyLong_SHIFT) { return (MatInfoType) (((((((MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0])); } } break; case 4: if (8 * sizeof(MatInfoType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) >= 4 * PyLong_SHIFT) { return (MatInfoType) (((((((((MatInfoType)digits[3]) << PyLong_SHIFT) | (MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatInfoType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(MatInfoType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatInfoType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatInfoType) 0; case -1: __PYX_VERIFY_RETURN_INT(MatInfoType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(MatInfoType, digit, +digits[0]) case -2: if (8 * sizeof(MatInfoType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) - 1 > 2 * PyLong_SHIFT) { return (MatInfoType) (((MatInfoType)-1)*(((((MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case 2: if (8 * sizeof(MatInfoType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) - 1 > 2 * PyLong_SHIFT) { return (MatInfoType) ((((((MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case -3: if (8 * sizeof(MatInfoType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) - 1 > 3 * PyLong_SHIFT) { return (MatInfoType) (((MatInfoType)-1)*(((((((MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case 3: if (8 * sizeof(MatInfoType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) - 1 > 3 * PyLong_SHIFT) { return (MatInfoType) ((((((((MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case -4: if (8 * sizeof(MatInfoType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) - 1 > 4 * PyLong_SHIFT) { return (MatInfoType) (((MatInfoType)-1)*(((((((((MatInfoType)digits[3]) << PyLong_SHIFT) | (MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; case 4: if (8 * sizeof(MatInfoType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatInfoType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatInfoType) - 1 > 4 * PyLong_SHIFT) { return (MatInfoType) ((((((((((MatInfoType)digits[3]) << PyLong_SHIFT) | (MatInfoType)digits[2]) << PyLong_SHIFT) | (MatInfoType)digits[1]) << PyLong_SHIFT) | (MatInfoType)digits[0]))); } } break; } #endif if (sizeof(MatInfoType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatInfoType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else MatInfoType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (MatInfoType) -1; } } else { MatInfoType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatInfoType) -1; val = __Pyx_PyInt_As_MatInfoType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatInfoType"); return (MatInfoType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatInfoType"); return (MatInfoType) -1; } /* CIntFromPy */ static CYTHON_INLINE MatFactorShiftType __Pyx_PyInt_As_MatFactorShiftType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatFactorShiftType neg_one = (MatFactorShiftType) -1, const_zero = (MatFactorShiftType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(MatFactorShiftType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatFactorShiftType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatFactorShiftType) 0; case 1: __PYX_VERIFY_RETURN_INT(MatFactorShiftType, digit, digits[0]) case 2: if (8 * sizeof(MatFactorShiftType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) >= 2 * PyLong_SHIFT) { return (MatFactorShiftType) (((((MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0])); } } break; case 3: if (8 * sizeof(MatFactorShiftType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) >= 3 * PyLong_SHIFT) { return (MatFactorShiftType) (((((((MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0])); } } break; case 4: if (8 * sizeof(MatFactorShiftType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) >= 4 * PyLong_SHIFT) { return (MatFactorShiftType) (((((((((MatFactorShiftType)digits[3]) << PyLong_SHIFT) | (MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatFactorShiftType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(MatFactorShiftType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatFactorShiftType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatFactorShiftType) 0; case -1: __PYX_VERIFY_RETURN_INT(MatFactorShiftType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(MatFactorShiftType, digit, +digits[0]) case -2: if (8 * sizeof(MatFactorShiftType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) - 1 > 2 * PyLong_SHIFT) { return (MatFactorShiftType) (((MatFactorShiftType)-1)*(((((MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case 2: if (8 * sizeof(MatFactorShiftType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) - 1 > 2 * PyLong_SHIFT) { return (MatFactorShiftType) ((((((MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case -3: if (8 * sizeof(MatFactorShiftType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) - 1 > 3 * PyLong_SHIFT) { return (MatFactorShiftType) (((MatFactorShiftType)-1)*(((((((MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case 3: if (8 * sizeof(MatFactorShiftType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) - 1 > 3 * PyLong_SHIFT) { return (MatFactorShiftType) ((((((((MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case -4: if (8 * sizeof(MatFactorShiftType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) - 1 > 4 * PyLong_SHIFT) { return (MatFactorShiftType) (((MatFactorShiftType)-1)*(((((((((MatFactorShiftType)digits[3]) << PyLong_SHIFT) | (MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; case 4: if (8 * sizeof(MatFactorShiftType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatFactorShiftType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatFactorShiftType) - 1 > 4 * PyLong_SHIFT) { return (MatFactorShiftType) ((((((((((MatFactorShiftType)digits[3]) << PyLong_SHIFT) | (MatFactorShiftType)digits[2]) << PyLong_SHIFT) | (MatFactorShiftType)digits[1]) << PyLong_SHIFT) | (MatFactorShiftType)digits[0]))); } } break; } #endif if (sizeof(MatFactorShiftType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatFactorShiftType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else MatFactorShiftType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (MatFactorShiftType) -1; } } else { MatFactorShiftType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatFactorShiftType) -1; val = __Pyx_PyInt_As_MatFactorShiftType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatFactorShiftType"); return (MatFactorShiftType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatFactorShiftType"); return (MatFactorShiftType) -1; } /* CIntFromPy */ static CYTHON_INLINE KSPConvergedReason __Pyx_PyInt_As_KSPConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPConvergedReason neg_one = (KSPConvergedReason) -1, const_zero = (KSPConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(KSPConvergedReason) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (KSPConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (KSPConvergedReason) 0; case 1: __PYX_VERIFY_RETURN_INT(KSPConvergedReason, digit, digits[0]) case 2: if (8 * sizeof(KSPConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) >= 2 * PyLong_SHIFT) { return (KSPConvergedReason) (((((KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0])); } } break; case 3: if (8 * sizeof(KSPConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) >= 3 * PyLong_SHIFT) { return (KSPConvergedReason) (((((((KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0])); } } break; case 4: if (8 * sizeof(KSPConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) >= 4 * PyLong_SHIFT) { return (KSPConvergedReason) (((((((((KSPConvergedReason)digits[3]) << PyLong_SHIFT) | (KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (KSPConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(KSPConvergedReason) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(KSPConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (KSPConvergedReason) 0; case -1: __PYX_VERIFY_RETURN_INT(KSPConvergedReason, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(KSPConvergedReason, digit, +digits[0]) case -2: if (8 * sizeof(KSPConvergedReason) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (KSPConvergedReason) (((KSPConvergedReason)-1)*(((((KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case 2: if (8 * sizeof(KSPConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (KSPConvergedReason) ((((((KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case -3: if (8 * sizeof(KSPConvergedReason) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (KSPConvergedReason) (((KSPConvergedReason)-1)*(((((((KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case 3: if (8 * sizeof(KSPConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (KSPConvergedReason) ((((((((KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case -4: if (8 * sizeof(KSPConvergedReason) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (KSPConvergedReason) (((KSPConvergedReason)-1)*(((((((((KSPConvergedReason)digits[3]) << PyLong_SHIFT) | (KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; case 4: if (8 * sizeof(KSPConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (KSPConvergedReason) ((((((((((KSPConvergedReason)digits[3]) << PyLong_SHIFT) | (KSPConvergedReason)digits[2]) << PyLong_SHIFT) | (KSPConvergedReason)digits[1]) << PyLong_SHIFT) | (KSPConvergedReason)digits[0]))); } } break; } #endif if (sizeof(KSPConvergedReason) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(KSPConvergedReason) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else KSPConvergedReason val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (KSPConvergedReason) -1; } } else { KSPConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (KSPConvergedReason) -1; val = __Pyx_PyInt_As_KSPConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to KSPConvergedReason"); return (KSPConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to KSPConvergedReason"); return (KSPConvergedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE SNESConvergedReason __Pyx_PyInt_As_SNESConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESConvergedReason neg_one = (SNESConvergedReason) -1, const_zero = (SNESConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SNESConvergedReason) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SNESConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SNESConvergedReason) 0; case 1: __PYX_VERIFY_RETURN_INT(SNESConvergedReason, digit, digits[0]) case 2: if (8 * sizeof(SNESConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) >= 2 * PyLong_SHIFT) { return (SNESConvergedReason) (((((SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0])); } } break; case 3: if (8 * sizeof(SNESConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) >= 3 * PyLong_SHIFT) { return (SNESConvergedReason) (((((((SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0])); } } break; case 4: if (8 * sizeof(SNESConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) >= 4 * PyLong_SHIFT) { return (SNESConvergedReason) (((((((((SNESConvergedReason)digits[3]) << PyLong_SHIFT) | (SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SNESConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SNESConvergedReason) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SNESConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SNESConvergedReason) 0; case -1: __PYX_VERIFY_RETURN_INT(SNESConvergedReason, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(SNESConvergedReason, digit, +digits[0]) case -2: if (8 * sizeof(SNESConvergedReason) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (SNESConvergedReason) (((SNESConvergedReason)-1)*(((((SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case 2: if (8 * sizeof(SNESConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (SNESConvergedReason) ((((((SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case -3: if (8 * sizeof(SNESConvergedReason) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (SNESConvergedReason) (((SNESConvergedReason)-1)*(((((((SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case 3: if (8 * sizeof(SNESConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (SNESConvergedReason) ((((((((SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case -4: if (8 * sizeof(SNESConvergedReason) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (SNESConvergedReason) (((SNESConvergedReason)-1)*(((((((((SNESConvergedReason)digits[3]) << PyLong_SHIFT) | (SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; case 4: if (8 * sizeof(SNESConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (SNESConvergedReason) ((((((((((SNESConvergedReason)digits[3]) << PyLong_SHIFT) | (SNESConvergedReason)digits[2]) << PyLong_SHIFT) | (SNESConvergedReason)digits[1]) << PyLong_SHIFT) | (SNESConvergedReason)digits[0]))); } } break; } #endif if (sizeof(SNESConvergedReason) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SNESConvergedReason) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SNESConvergedReason val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SNESConvergedReason) -1; } } else { SNESConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SNESConvergedReason) -1; val = __Pyx_PyInt_As_SNESConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SNESConvergedReason"); return (SNESConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SNESConvergedReason"); return (SNESConvergedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE TaoConvergedReason __Pyx_PyInt_As_TaoConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TaoConvergedReason neg_one = (TaoConvergedReason) -1, const_zero = (TaoConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(TaoConvergedReason) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TaoConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TaoConvergedReason) 0; case 1: __PYX_VERIFY_RETURN_INT(TaoConvergedReason, digit, digits[0]) case 2: if (8 * sizeof(TaoConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) >= 2 * PyLong_SHIFT) { return (TaoConvergedReason) (((((TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0])); } } break; case 3: if (8 * sizeof(TaoConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) >= 3 * PyLong_SHIFT) { return (TaoConvergedReason) (((((((TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0])); } } break; case 4: if (8 * sizeof(TaoConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) >= 4 * PyLong_SHIFT) { return (TaoConvergedReason) (((((((((TaoConvergedReason)digits[3]) << PyLong_SHIFT) | (TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TaoConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(TaoConvergedReason) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TaoConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TaoConvergedReason) 0; case -1: __PYX_VERIFY_RETURN_INT(TaoConvergedReason, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(TaoConvergedReason, digit, +digits[0]) case -2: if (8 * sizeof(TaoConvergedReason) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (TaoConvergedReason) (((TaoConvergedReason)-1)*(((((TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case 2: if (8 * sizeof(TaoConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (TaoConvergedReason) ((((((TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case -3: if (8 * sizeof(TaoConvergedReason) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (TaoConvergedReason) (((TaoConvergedReason)-1)*(((((((TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case 3: if (8 * sizeof(TaoConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (TaoConvergedReason) ((((((((TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case -4: if (8 * sizeof(TaoConvergedReason) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (TaoConvergedReason) (((TaoConvergedReason)-1)*(((((((((TaoConvergedReason)digits[3]) << PyLong_SHIFT) | (TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; case 4: if (8 * sizeof(TaoConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TaoConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TaoConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (TaoConvergedReason) ((((((((((TaoConvergedReason)digits[3]) << PyLong_SHIFT) | (TaoConvergedReason)digits[2]) << PyLong_SHIFT) | (TaoConvergedReason)digits[1]) << PyLong_SHIFT) | (TaoConvergedReason)digits[0]))); } } break; } #endif if (sizeof(TaoConvergedReason) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TaoConvergedReason) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else TaoConvergedReason val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (TaoConvergedReason) -1; } } else { TaoConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TaoConvergedReason) -1; val = __Pyx_PyInt_As_TaoConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TaoConvergedReason"); return (TaoConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TaoConvergedReason"); return (TaoConvergedReason) -1; } /* CIntFromPy */ static CYTHON_INLINE DMBoundaryType __Pyx_PyInt_As_DMBoundaryType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMBoundaryType neg_one = (DMBoundaryType) -1, const_zero = (DMBoundaryType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMBoundaryType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMBoundaryType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMBoundaryType) 0; case 1: __PYX_VERIFY_RETURN_INT(DMBoundaryType, digit, digits[0]) case 2: if (8 * sizeof(DMBoundaryType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) >= 2 * PyLong_SHIFT) { return (DMBoundaryType) (((((DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0])); } } break; case 3: if (8 * sizeof(DMBoundaryType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) >= 3 * PyLong_SHIFT) { return (DMBoundaryType) (((((((DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0])); } } break; case 4: if (8 * sizeof(DMBoundaryType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) >= 4 * PyLong_SHIFT) { return (DMBoundaryType) (((((((((DMBoundaryType)digits[3]) << PyLong_SHIFT) | (DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMBoundaryType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMBoundaryType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMBoundaryType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMBoundaryType) 0; case -1: __PYX_VERIFY_RETURN_INT(DMBoundaryType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMBoundaryType, digit, +digits[0]) case -2: if (8 * sizeof(DMBoundaryType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) - 1 > 2 * PyLong_SHIFT) { return (DMBoundaryType) (((DMBoundaryType)-1)*(((((DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case 2: if (8 * sizeof(DMBoundaryType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) - 1 > 2 * PyLong_SHIFT) { return (DMBoundaryType) ((((((DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case -3: if (8 * sizeof(DMBoundaryType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) - 1 > 3 * PyLong_SHIFT) { return (DMBoundaryType) (((DMBoundaryType)-1)*(((((((DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case 3: if (8 * sizeof(DMBoundaryType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) - 1 > 3 * PyLong_SHIFT) { return (DMBoundaryType) ((((((((DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case -4: if (8 * sizeof(DMBoundaryType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) - 1 > 4 * PyLong_SHIFT) { return (DMBoundaryType) (((DMBoundaryType)-1)*(((((((((DMBoundaryType)digits[3]) << PyLong_SHIFT) | (DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; case 4: if (8 * sizeof(DMBoundaryType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMBoundaryType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMBoundaryType) - 1 > 4 * PyLong_SHIFT) { return (DMBoundaryType) ((((((((((DMBoundaryType)digits[3]) << PyLong_SHIFT) | (DMBoundaryType)digits[2]) << PyLong_SHIFT) | (DMBoundaryType)digits[1]) << PyLong_SHIFT) | (DMBoundaryType)digits[0]))); } } break; } #endif if (sizeof(DMBoundaryType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMBoundaryType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMBoundaryType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMBoundaryType) -1; } } else { DMBoundaryType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMBoundaryType) -1; val = __Pyx_PyInt_As_DMBoundaryType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMBoundaryType"); return (DMBoundaryType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMBoundaryType"); return (DMBoundaryType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMDAStencilType __Pyx_PyInt_As_DMDAStencilType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAStencilType neg_one = (DMDAStencilType) -1, const_zero = (DMDAStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMDAStencilType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMDAStencilType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMDAStencilType) 0; case 1: __PYX_VERIFY_RETURN_INT(DMDAStencilType, digit, digits[0]) case 2: if (8 * sizeof(DMDAStencilType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) >= 2 * PyLong_SHIFT) { return (DMDAStencilType) (((((DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0])); } } break; case 3: if (8 * sizeof(DMDAStencilType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) >= 3 * PyLong_SHIFT) { return (DMDAStencilType) (((((((DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0])); } } break; case 4: if (8 * sizeof(DMDAStencilType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) >= 4 * PyLong_SHIFT) { return (DMDAStencilType) (((((((((DMDAStencilType)digits[3]) << PyLong_SHIFT) | (DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMDAStencilType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMDAStencilType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAStencilType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMDAStencilType) 0; case -1: __PYX_VERIFY_RETURN_INT(DMDAStencilType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMDAStencilType, digit, +digits[0]) case -2: if (8 * sizeof(DMDAStencilType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) - 1 > 2 * PyLong_SHIFT) { return (DMDAStencilType) (((DMDAStencilType)-1)*(((((DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case 2: if (8 * sizeof(DMDAStencilType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) - 1 > 2 * PyLong_SHIFT) { return (DMDAStencilType) ((((((DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case -3: if (8 * sizeof(DMDAStencilType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) - 1 > 3 * PyLong_SHIFT) { return (DMDAStencilType) (((DMDAStencilType)-1)*(((((((DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case 3: if (8 * sizeof(DMDAStencilType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) - 1 > 3 * PyLong_SHIFT) { return (DMDAStencilType) ((((((((DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case -4: if (8 * sizeof(DMDAStencilType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) - 1 > 4 * PyLong_SHIFT) { return (DMDAStencilType) (((DMDAStencilType)-1)*(((((((((DMDAStencilType)digits[3]) << PyLong_SHIFT) | (DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; case 4: if (8 * sizeof(DMDAStencilType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAStencilType) - 1 > 4 * PyLong_SHIFT) { return (DMDAStencilType) ((((((((((DMDAStencilType)digits[3]) << PyLong_SHIFT) | (DMDAStencilType)digits[2]) << PyLong_SHIFT) | (DMDAStencilType)digits[1]) << PyLong_SHIFT) | (DMDAStencilType)digits[0]))); } } break; } #endif if (sizeof(DMDAStencilType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAStencilType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMDAStencilType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMDAStencilType) -1; } } else { DMDAStencilType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMDAStencilType) -1; val = __Pyx_PyInt_As_DMDAStencilType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMDAStencilType"); return (DMDAStencilType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMDAStencilType"); return (DMDAStencilType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMDAInterpolationType __Pyx_PyInt_As_DMDAInterpolationType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAInterpolationType neg_one = (DMDAInterpolationType) -1, const_zero = (DMDAInterpolationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMDAInterpolationType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMDAInterpolationType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMDAInterpolationType) 0; case 1: __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, digit, digits[0]) case 2: if (8 * sizeof(DMDAInterpolationType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) >= 2 * PyLong_SHIFT) { return (DMDAInterpolationType) (((((DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0])); } } break; case 3: if (8 * sizeof(DMDAInterpolationType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) >= 3 * PyLong_SHIFT) { return (DMDAInterpolationType) (((((((DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0])); } } break; case 4: if (8 * sizeof(DMDAInterpolationType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) >= 4 * PyLong_SHIFT) { return (DMDAInterpolationType) (((((((((DMDAInterpolationType)digits[3]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMDAInterpolationType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMDAInterpolationType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAInterpolationType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMDAInterpolationType) 0; case -1: __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, digit, +digits[0]) case -2: if (8 * sizeof(DMDAInterpolationType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) - 1 > 2 * PyLong_SHIFT) { return (DMDAInterpolationType) (((DMDAInterpolationType)-1)*(((((DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case 2: if (8 * sizeof(DMDAInterpolationType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) - 1 > 2 * PyLong_SHIFT) { return (DMDAInterpolationType) ((((((DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case -3: if (8 * sizeof(DMDAInterpolationType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) - 1 > 3 * PyLong_SHIFT) { return (DMDAInterpolationType) (((DMDAInterpolationType)-1)*(((((((DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case 3: if (8 * sizeof(DMDAInterpolationType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) - 1 > 3 * PyLong_SHIFT) { return (DMDAInterpolationType) ((((((((DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case -4: if (8 * sizeof(DMDAInterpolationType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) - 1 > 4 * PyLong_SHIFT) { return (DMDAInterpolationType) (((DMDAInterpolationType)-1)*(((((((((DMDAInterpolationType)digits[3]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; case 4: if (8 * sizeof(DMDAInterpolationType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAInterpolationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAInterpolationType) - 1 > 4 * PyLong_SHIFT) { return (DMDAInterpolationType) ((((((((((DMDAInterpolationType)digits[3]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[2]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[1]) << PyLong_SHIFT) | (DMDAInterpolationType)digits[0]))); } } break; } #endif if (sizeof(DMDAInterpolationType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAInterpolationType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMDAInterpolationType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMDAInterpolationType) -1; } } else { DMDAInterpolationType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMDAInterpolationType) -1; val = __Pyx_PyInt_As_DMDAInterpolationType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMDAInterpolationType"); return (DMDAInterpolationType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMDAInterpolationType"); return (DMDAInterpolationType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMDAElementType __Pyx_PyInt_As_DMDAElementType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMDAElementType neg_one = (DMDAElementType) -1, const_zero = (DMDAElementType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMDAElementType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMDAElementType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMDAElementType) 0; case 1: __PYX_VERIFY_RETURN_INT(DMDAElementType, digit, digits[0]) case 2: if (8 * sizeof(DMDAElementType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) >= 2 * PyLong_SHIFT) { return (DMDAElementType) (((((DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0])); } } break; case 3: if (8 * sizeof(DMDAElementType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) >= 3 * PyLong_SHIFT) { return (DMDAElementType) (((((((DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0])); } } break; case 4: if (8 * sizeof(DMDAElementType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) >= 4 * PyLong_SHIFT) { return (DMDAElementType) (((((((((DMDAElementType)digits[3]) << PyLong_SHIFT) | (DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMDAElementType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMDAElementType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAElementType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMDAElementType) 0; case -1: __PYX_VERIFY_RETURN_INT(DMDAElementType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMDAElementType, digit, +digits[0]) case -2: if (8 * sizeof(DMDAElementType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) - 1 > 2 * PyLong_SHIFT) { return (DMDAElementType) (((DMDAElementType)-1)*(((((DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case 2: if (8 * sizeof(DMDAElementType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) - 1 > 2 * PyLong_SHIFT) { return (DMDAElementType) ((((((DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case -3: if (8 * sizeof(DMDAElementType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) - 1 > 3 * PyLong_SHIFT) { return (DMDAElementType) (((DMDAElementType)-1)*(((((((DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case 3: if (8 * sizeof(DMDAElementType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) - 1 > 3 * PyLong_SHIFT) { return (DMDAElementType) ((((((((DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case -4: if (8 * sizeof(DMDAElementType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) - 1 > 4 * PyLong_SHIFT) { return (DMDAElementType) (((DMDAElementType)-1)*(((((((((DMDAElementType)digits[3]) << PyLong_SHIFT) | (DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; case 4: if (8 * sizeof(DMDAElementType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMDAElementType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMDAElementType) - 1 > 4 * PyLong_SHIFT) { return (DMDAElementType) ((((((((((DMDAElementType)digits[3]) << PyLong_SHIFT) | (DMDAElementType)digits[2]) << PyLong_SHIFT) | (DMDAElementType)digits[1]) << PyLong_SHIFT) | (DMDAElementType)digits[0]))); } } break; } #endif if (sizeof(DMDAElementType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMDAElementType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMDAElementType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMDAElementType) -1; } } else { DMDAElementType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMDAElementType) -1; val = __Pyx_PyInt_As_DMDAElementType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMDAElementType"); return (DMDAElementType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMDAElementType"); return (DMDAElementType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMStagStencilType __Pyx_PyInt_As_DMStagStencilType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilType neg_one = (DMStagStencilType) -1, const_zero = (DMStagStencilType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMStagStencilType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMStagStencilType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMStagStencilType) 0; case 1: __PYX_VERIFY_RETURN_INT(DMStagStencilType, digit, digits[0]) case 2: if (8 * sizeof(DMStagStencilType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) >= 2 * PyLong_SHIFT) { return (DMStagStencilType) (((((DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0])); } } break; case 3: if (8 * sizeof(DMStagStencilType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) >= 3 * PyLong_SHIFT) { return (DMStagStencilType) (((((((DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0])); } } break; case 4: if (8 * sizeof(DMStagStencilType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) >= 4 * PyLong_SHIFT) { return (DMStagStencilType) (((((((((DMStagStencilType)digits[3]) << PyLong_SHIFT) | (DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMStagStencilType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMStagStencilType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMStagStencilType) 0; case -1: __PYX_VERIFY_RETURN_INT(DMStagStencilType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMStagStencilType, digit, +digits[0]) case -2: if (8 * sizeof(DMStagStencilType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) - 1 > 2 * PyLong_SHIFT) { return (DMStagStencilType) (((DMStagStencilType)-1)*(((((DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case 2: if (8 * sizeof(DMStagStencilType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) - 1 > 2 * PyLong_SHIFT) { return (DMStagStencilType) ((((((DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case -3: if (8 * sizeof(DMStagStencilType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) - 1 > 3 * PyLong_SHIFT) { return (DMStagStencilType) (((DMStagStencilType)-1)*(((((((DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case 3: if (8 * sizeof(DMStagStencilType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) - 1 > 3 * PyLong_SHIFT) { return (DMStagStencilType) ((((((((DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case -4: if (8 * sizeof(DMStagStencilType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) - 1 > 4 * PyLong_SHIFT) { return (DMStagStencilType) (((DMStagStencilType)-1)*(((((((((DMStagStencilType)digits[3]) << PyLong_SHIFT) | (DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; case 4: if (8 * sizeof(DMStagStencilType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilType) - 1 > 4 * PyLong_SHIFT) { return (DMStagStencilType) ((((((((((DMStagStencilType)digits[3]) << PyLong_SHIFT) | (DMStagStencilType)digits[2]) << PyLong_SHIFT) | (DMStagStencilType)digits[1]) << PyLong_SHIFT) | (DMStagStencilType)digits[0]))); } } break; } #endif if (sizeof(DMStagStencilType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMStagStencilType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMStagStencilType) -1; } } else { DMStagStencilType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMStagStencilType) -1; val = __Pyx_PyInt_As_DMStagStencilType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMStagStencilType"); return (DMStagStencilType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMStagStencilType"); return (DMStagStencilType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMStagStencilLocation __Pyx_PyInt_As_DMStagStencilLocation(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMStagStencilLocation neg_one = (DMStagStencilLocation) -1, const_zero = (DMStagStencilLocation) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMStagStencilLocation) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMStagStencilLocation) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMStagStencilLocation) 0; case 1: __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, digit, digits[0]) case 2: if (8 * sizeof(DMStagStencilLocation) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) >= 2 * PyLong_SHIFT) { return (DMStagStencilLocation) (((((DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0])); } } break; case 3: if (8 * sizeof(DMStagStencilLocation) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) >= 3 * PyLong_SHIFT) { return (DMStagStencilLocation) (((((((DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0])); } } break; case 4: if (8 * sizeof(DMStagStencilLocation) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) >= 4 * PyLong_SHIFT) { return (DMStagStencilLocation) (((((((((DMStagStencilLocation)digits[3]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMStagStencilLocation) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMStagStencilLocation) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilLocation) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMStagStencilLocation) 0; case -1: __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, digit, +digits[0]) case -2: if (8 * sizeof(DMStagStencilLocation) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) - 1 > 2 * PyLong_SHIFT) { return (DMStagStencilLocation) (((DMStagStencilLocation)-1)*(((((DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case 2: if (8 * sizeof(DMStagStencilLocation) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) - 1 > 2 * PyLong_SHIFT) { return (DMStagStencilLocation) ((((((DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case -3: if (8 * sizeof(DMStagStencilLocation) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) - 1 > 3 * PyLong_SHIFT) { return (DMStagStencilLocation) (((DMStagStencilLocation)-1)*(((((((DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case 3: if (8 * sizeof(DMStagStencilLocation) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) - 1 > 3 * PyLong_SHIFT) { return (DMStagStencilLocation) ((((((((DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case -4: if (8 * sizeof(DMStagStencilLocation) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) - 1 > 4 * PyLong_SHIFT) { return (DMStagStencilLocation) (((DMStagStencilLocation)-1)*(((((((((DMStagStencilLocation)digits[3]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; case 4: if (8 * sizeof(DMStagStencilLocation) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMStagStencilLocation, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMStagStencilLocation) - 1 > 4 * PyLong_SHIFT) { return (DMStagStencilLocation) ((((((((((DMStagStencilLocation)digits[3]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[2]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[1]) << PyLong_SHIFT) | (DMStagStencilLocation)digits[0]))); } } break; } #endif if (sizeof(DMStagStencilLocation) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMStagStencilLocation) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMStagStencilLocation val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMStagStencilLocation) -1; } } else { DMStagStencilLocation val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMStagStencilLocation) -1; val = __Pyx_PyInt_As_DMStagStencilLocation(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMStagStencilLocation"); return (DMStagStencilLocation) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMStagStencilLocation"); return (DMStagStencilLocation) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscClassId __Pyx_PyInt_As_PetscClassId(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscClassId neg_one = (PetscClassId) -1, const_zero = (PetscClassId) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PetscClassId) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscClassId) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscClassId) 0; case 1: __PYX_VERIFY_RETURN_INT(PetscClassId, digit, digits[0]) case 2: if (8 * sizeof(PetscClassId) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) >= 2 * PyLong_SHIFT) { return (PetscClassId) (((((PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0])); } } break; case 3: if (8 * sizeof(PetscClassId) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) >= 3 * PyLong_SHIFT) { return (PetscClassId) (((((((PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0])); } } break; case 4: if (8 * sizeof(PetscClassId) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) >= 4 * PyLong_SHIFT) { return (PetscClassId) (((((((((PetscClassId)digits[3]) << PyLong_SHIFT) | (PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscClassId) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PetscClassId) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscClassId) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscClassId) 0; case -1: __PYX_VERIFY_RETURN_INT(PetscClassId, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PetscClassId, digit, +digits[0]) case -2: if (8 * sizeof(PetscClassId) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) - 1 > 2 * PyLong_SHIFT) { return (PetscClassId) (((PetscClassId)-1)*(((((PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case 2: if (8 * sizeof(PetscClassId) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) - 1 > 2 * PyLong_SHIFT) { return (PetscClassId) ((((((PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case -3: if (8 * sizeof(PetscClassId) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) - 1 > 3 * PyLong_SHIFT) { return (PetscClassId) (((PetscClassId)-1)*(((((((PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case 3: if (8 * sizeof(PetscClassId) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) - 1 > 3 * PyLong_SHIFT) { return (PetscClassId) ((((((((PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case -4: if (8 * sizeof(PetscClassId) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) - 1 > 4 * PyLong_SHIFT) { return (PetscClassId) (((PetscClassId)-1)*(((((((((PetscClassId)digits[3]) << PyLong_SHIFT) | (PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; case 4: if (8 * sizeof(PetscClassId) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscClassId, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscClassId) - 1 > 4 * PyLong_SHIFT) { return (PetscClassId) ((((((((((PetscClassId)digits[3]) << PyLong_SHIFT) | (PetscClassId)digits[2]) << PyLong_SHIFT) | (PetscClassId)digits[1]) << PyLong_SHIFT) | (PetscClassId)digits[0]))); } } break; } #endif if (sizeof(PetscClassId) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscClassId) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PetscClassId val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PetscClassId) -1; } } else { PetscClassId val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscClassId) -1; val = __Pyx_PyInt_As_PetscClassId(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscClassId"); return (PetscClassId) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscClassId"); return (PetscClassId) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogStage(PetscLogStage value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscLogStage neg_one = (PetscLogStage) -1, const_zero = (PetscLogStage) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscLogStage) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscLogStage) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogStage) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscLogStage) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogStage) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscLogStage), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscClassId(PetscClassId value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscClassId neg_one = (PetscClassId) -1, const_zero = (PetscClassId) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscClassId) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscClassId) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscClassId) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscClassId) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscClassId) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscClassId), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscLogEvent(PetscLogEvent value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscLogEvent neg_one = (PetscLogEvent) -1, const_zero = (PetscLogEvent) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscLogEvent) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscLogEvent) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogEvent) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscLogEvent) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscLogEvent) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscLogEvent), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MPI_Fint(MPI_Fint value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MPI_Fint neg_one = (MPI_Fint) -1, const_zero = (MPI_Fint) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MPI_Fint) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MPI_Fint) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MPI_Fint) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MPI_Fint) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MPI_Fint) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MPI_Fint), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE PetscViewerFormat __Pyx_PyInt_As_PetscViewerFormat(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscViewerFormat neg_one = (PetscViewerFormat) -1, const_zero = (PetscViewerFormat) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PetscViewerFormat) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscViewerFormat) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscViewerFormat) 0; case 1: __PYX_VERIFY_RETURN_INT(PetscViewerFormat, digit, digits[0]) case 2: if (8 * sizeof(PetscViewerFormat) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) >= 2 * PyLong_SHIFT) { return (PetscViewerFormat) (((((PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0])); } } break; case 3: if (8 * sizeof(PetscViewerFormat) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) >= 3 * PyLong_SHIFT) { return (PetscViewerFormat) (((((((PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0])); } } break; case 4: if (8 * sizeof(PetscViewerFormat) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) >= 4 * PyLong_SHIFT) { return (PetscViewerFormat) (((((((((PetscViewerFormat)digits[3]) << PyLong_SHIFT) | (PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscViewerFormat) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PetscViewerFormat) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscViewerFormat) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscViewerFormat) 0; case -1: __PYX_VERIFY_RETURN_INT(PetscViewerFormat, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PetscViewerFormat, digit, +digits[0]) case -2: if (8 * sizeof(PetscViewerFormat) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) - 1 > 2 * PyLong_SHIFT) { return (PetscViewerFormat) (((PetscViewerFormat)-1)*(((((PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case 2: if (8 * sizeof(PetscViewerFormat) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) - 1 > 2 * PyLong_SHIFT) { return (PetscViewerFormat) ((((((PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case -3: if (8 * sizeof(PetscViewerFormat) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) - 1 > 3 * PyLong_SHIFT) { return (PetscViewerFormat) (((PetscViewerFormat)-1)*(((((((PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case 3: if (8 * sizeof(PetscViewerFormat) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) - 1 > 3 * PyLong_SHIFT) { return (PetscViewerFormat) ((((((((PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case -4: if (8 * sizeof(PetscViewerFormat) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) - 1 > 4 * PyLong_SHIFT) { return (PetscViewerFormat) (((PetscViewerFormat)-1)*(((((((((PetscViewerFormat)digits[3]) << PyLong_SHIFT) | (PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; case 4: if (8 * sizeof(PetscViewerFormat) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscViewerFormat, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscViewerFormat) - 1 > 4 * PyLong_SHIFT) { return (PetscViewerFormat) ((((((((((PetscViewerFormat)digits[3]) << PyLong_SHIFT) | (PetscViewerFormat)digits[2]) << PyLong_SHIFT) | (PetscViewerFormat)digits[1]) << PyLong_SHIFT) | (PetscViewerFormat)digits[0]))); } } break; } #endif if (sizeof(PetscViewerFormat) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscViewerFormat) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PetscViewerFormat val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PetscViewerFormat) -1; } } else { PetscViewerFormat val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscViewerFormat) -1; val = __Pyx_PyInt_As_PetscViewerFormat(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscViewerFormat"); return (PetscViewerFormat) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscViewerFormat"); return (PetscViewerFormat) -1; } /* CIntFromPy */ static CYTHON_INLINE PetscBool __Pyx_PyInt_As_PetscBool(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscBool neg_one = (PetscBool) -1, const_zero = (PetscBool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PetscBool) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PetscBool, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PetscBool) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscBool) 0; case 1: __PYX_VERIFY_RETURN_INT(PetscBool, digit, digits[0]) case 2: if (8 * sizeof(PetscBool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) >= 2 * PyLong_SHIFT) { return (PetscBool) (((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; case 3: if (8 * sizeof(PetscBool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) >= 3 * PyLong_SHIFT) { return (PetscBool) (((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; case 4: if (8 * sizeof(PetscBool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) >= 4 * PyLong_SHIFT) { return (PetscBool) (((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PetscBool) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PetscBool) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PetscBool) 0; case -1: __PYX_VERIFY_RETURN_INT(PetscBool, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PetscBool, digit, +digits[0]) case -2: if (8 * sizeof(PetscBool) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT) { return (PetscBool) (((PetscBool)-1)*(((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 2: if (8 * sizeof(PetscBool) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT) { return (PetscBool) ((((((PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case -3: if (8 * sizeof(PetscBool) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT) { return (PetscBool) (((PetscBool)-1)*(((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 3: if (8 * sizeof(PetscBool) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT) { return (PetscBool) ((((((((PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case -4: if (8 * sizeof(PetscBool) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 4 * PyLong_SHIFT) { return (PetscBool) (((PetscBool)-1)*(((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; case 4: if (8 * sizeof(PetscBool) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PetscBool, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PetscBool) - 1 > 4 * PyLong_SHIFT) { return (PetscBool) ((((((((((PetscBool)digits[3]) << PyLong_SHIFT) | (PetscBool)digits[2]) << PyLong_SHIFT) | (PetscBool)digits[1]) << PyLong_SHIFT) | (PetscBool)digits[0]))); } } break; } #endif if (sizeof(PetscBool) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PetscBool, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PetscBool val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PetscBool) -1; } } else { PetscBool val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PetscBool) -1; val = __Pyx_PyInt_As_PetscBool(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PetscBool"); return (PetscBool) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PetscBool"); return (PetscBool) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(unsigned long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(unsigned long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(unsigned long), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(unsigned long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (unsigned long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (unsigned long) 0; case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, digits[0]) case 2: if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT) { return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 3: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT) { return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; case 4: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT) { return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (unsigned long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(unsigned long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (unsigned long) 0; case -1: __PYX_VERIFY_RETURN_INT(unsigned long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, +digits[0]) case -2: if (8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) { return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 2: if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) { return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -3: if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) { return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 3: if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) { return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case -4: if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) { return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; case 4: if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) { return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); } } break; } #endif if (sizeof(unsigned long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else unsigned long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (unsigned long) -1; } } else { unsigned long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (unsigned long) -1; val = __Pyx_PyInt_As_unsigned_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to unsigned long"); return (unsigned long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long) -1; } /* CIntFromPy */ static CYTHON_INLINE ISGlobalToLocalMappingMode __Pyx_PyInt_As_ISGlobalToLocalMappingMode(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const ISGlobalToLocalMappingMode neg_one = (ISGlobalToLocalMappingMode) -1, const_zero = (ISGlobalToLocalMappingMode) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(ISGlobalToLocalMappingMode) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (ISGlobalToLocalMappingMode) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (ISGlobalToLocalMappingMode) 0; case 1: __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, digit, digits[0]) case 2: if (8 * sizeof(ISGlobalToLocalMappingMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) >= 2 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) (((((ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0])); } } break; case 3: if (8 * sizeof(ISGlobalToLocalMappingMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) >= 3 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) (((((((ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0])); } } break; case 4: if (8 * sizeof(ISGlobalToLocalMappingMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) >= 4 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) (((((((((ISGlobalToLocalMappingMode)digits[3]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (ISGlobalToLocalMappingMode) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (ISGlobalToLocalMappingMode) 0; case -1: __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, digit, +digits[0]) case -2: if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 2 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) (((ISGlobalToLocalMappingMode)-1)*(((((ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case 2: if (8 * sizeof(ISGlobalToLocalMappingMode) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 2 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) ((((((ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case -3: if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 3 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) (((ISGlobalToLocalMappingMode)-1)*(((((((ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case 3: if (8 * sizeof(ISGlobalToLocalMappingMode) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 3 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) ((((((((ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case -4: if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 4 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) (((ISGlobalToLocalMappingMode)-1)*(((((((((ISGlobalToLocalMappingMode)digits[3]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; case 4: if (8 * sizeof(ISGlobalToLocalMappingMode) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(ISGlobalToLocalMappingMode, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(ISGlobalToLocalMappingMode) - 1 > 4 * PyLong_SHIFT) { return (ISGlobalToLocalMappingMode) ((((((((((ISGlobalToLocalMappingMode)digits[3]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[2]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[1]) << PyLong_SHIFT) | (ISGlobalToLocalMappingMode)digits[0]))); } } break; } #endif if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else ISGlobalToLocalMappingMode val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (ISGlobalToLocalMappingMode) -1; } } else { ISGlobalToLocalMappingMode val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (ISGlobalToLocalMappingMode) -1; val = __Pyx_PyInt_As_ISGlobalToLocalMappingMode(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to ISGlobalToLocalMappingMode"); return (ISGlobalToLocalMappingMode) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to ISGlobalToLocalMappingMode"); return (ISGlobalToLocalMappingMode) -1; } /* CIntFromPy */ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(size_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (size_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (size_t) 0; case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) case 2: if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 3: if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; case 4: if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (size_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(size_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (size_t) 0; case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) case -2: if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 2: if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -3: if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 3: if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case -4: if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; case 4: if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); } } break; } #endif if (sizeof(size_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else size_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (size_t) -1; } } else { size_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (size_t) -1; val = __Pyx_PyInt_As_size_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to size_t"); return (size_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint16_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint16_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint16_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint16_t), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int64_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int64_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, digits[0]) case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 2 * PyLong_SHIFT) { return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 3 * PyLong_SHIFT) { return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) >= 4 * PyLong_SHIFT) { return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int64_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int64_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int64_t) 0; case -1: __PYX_VERIFY_RETURN_INT(int64_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int64_t, digit, +digits[0]) case -2: if (8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 2: if (8 * sizeof(int64_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -3: if (8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 3: if (8 * sizeof(int64_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case -4: if (8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; case 4: if (8 * sizeof(int64_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT) { return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]))); } } break; } #endif if (sizeof(int64_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int64_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int64_t) -1; } } else { int64_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int64_t) -1; val = __Pyx_PyInt_As_int64_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int64_t"); return (int64_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int64_t"); return (int64_t) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int64_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int64_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE VecOption __Pyx_PyInt_As_VecOption(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const VecOption neg_one = (VecOption) -1, const_zero = (VecOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(VecOption) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(VecOption, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (VecOption) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (VecOption) 0; case 1: __PYX_VERIFY_RETURN_INT(VecOption, digit, digits[0]) case 2: if (8 * sizeof(VecOption) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) >= 2 * PyLong_SHIFT) { return (VecOption) (((((VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0])); } } break; case 3: if (8 * sizeof(VecOption) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) >= 3 * PyLong_SHIFT) { return (VecOption) (((((((VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0])); } } break; case 4: if (8 * sizeof(VecOption) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) >= 4 * PyLong_SHIFT) { return (VecOption) (((((((((VecOption)digits[3]) << PyLong_SHIFT) | (VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (VecOption) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(VecOption) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(VecOption) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (VecOption) 0; case -1: __PYX_VERIFY_RETURN_INT(VecOption, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(VecOption, digit, +digits[0]) case -2: if (8 * sizeof(VecOption) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) - 1 > 2 * PyLong_SHIFT) { return (VecOption) (((VecOption)-1)*(((((VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case 2: if (8 * sizeof(VecOption) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) - 1 > 2 * PyLong_SHIFT) { return (VecOption) ((((((VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case -3: if (8 * sizeof(VecOption) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) - 1 > 3 * PyLong_SHIFT) { return (VecOption) (((VecOption)-1)*(((((((VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case 3: if (8 * sizeof(VecOption) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) - 1 > 3 * PyLong_SHIFT) { return (VecOption) ((((((((VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case -4: if (8 * sizeof(VecOption) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) - 1 > 4 * PyLong_SHIFT) { return (VecOption) (((VecOption)-1)*(((((((((VecOption)digits[3]) << PyLong_SHIFT) | (VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; case 4: if (8 * sizeof(VecOption) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(VecOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(VecOption) - 1 > 4 * PyLong_SHIFT) { return (VecOption) ((((((((((VecOption)digits[3]) << PyLong_SHIFT) | (VecOption)digits[2]) << PyLong_SHIFT) | (VecOption)digits[1]) << PyLong_SHIFT) | (VecOption)digits[0]))); } } break; } #endif if (sizeof(VecOption) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(VecOption) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(VecOption, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else VecOption val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (VecOption) -1; } } else { VecOption val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (VecOption) -1; val = __Pyx_PyInt_As_VecOption(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to VecOption"); return (VecOption) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to VecOption"); return (VecOption) -1; } /* CIntFromPy */ static CYTHON_INLINE NormType __Pyx_PyInt_As_NormType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const NormType neg_one = (NormType) -1, const_zero = (NormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(NormType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(NormType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (NormType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (NormType) 0; case 1: __PYX_VERIFY_RETURN_INT(NormType, digit, digits[0]) case 2: if (8 * sizeof(NormType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) >= 2 * PyLong_SHIFT) { return (NormType) (((((NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0])); } } break; case 3: if (8 * sizeof(NormType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) >= 3 * PyLong_SHIFT) { return (NormType) (((((((NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0])); } } break; case 4: if (8 * sizeof(NormType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) >= 4 * PyLong_SHIFT) { return (NormType) (((((((((NormType)digits[3]) << PyLong_SHIFT) | (NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (NormType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(NormType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(NormType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(NormType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (NormType) 0; case -1: __PYX_VERIFY_RETURN_INT(NormType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(NormType, digit, +digits[0]) case -2: if (8 * sizeof(NormType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) - 1 > 2 * PyLong_SHIFT) { return (NormType) (((NormType)-1)*(((((NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case 2: if (8 * sizeof(NormType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) - 1 > 2 * PyLong_SHIFT) { return (NormType) ((((((NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case -3: if (8 * sizeof(NormType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) - 1 > 3 * PyLong_SHIFT) { return (NormType) (((NormType)-1)*(((((((NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case 3: if (8 * sizeof(NormType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) - 1 > 3 * PyLong_SHIFT) { return (NormType) ((((((((NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case -4: if (8 * sizeof(NormType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) - 1 > 4 * PyLong_SHIFT) { return (NormType) (((NormType)-1)*(((((((((NormType)digits[3]) << PyLong_SHIFT) | (NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; case 4: if (8 * sizeof(NormType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(NormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(NormType) - 1 > 4 * PyLong_SHIFT) { return (NormType) ((((((((((NormType)digits[3]) << PyLong_SHIFT) | (NormType)digits[2]) << PyLong_SHIFT) | (NormType)digits[1]) << PyLong_SHIFT) | (NormType)digits[0]))); } } break; } #endif if (sizeof(NormType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(NormType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(NormType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(NormType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else NormType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (NormType) -1; } } else { NormType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (NormType) -1; val = __Pyx_PyInt_As_NormType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to NormType"); return (NormType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to NormType"); return (NormType) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscOffloadMask(PetscOffloadMask value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscOffloadMask neg_one = (PetscOffloadMask) -1, const_zero = (PetscOffloadMask) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscOffloadMask) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscOffloadMask) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscOffloadMask) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscOffloadMask) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscOffloadMask) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscOffloadMask), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE MatOption __Pyx_PyInt_As_MatOption(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatOption neg_one = (MatOption) -1, const_zero = (MatOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(MatOption) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(MatOption, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (MatOption) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatOption) 0; case 1: __PYX_VERIFY_RETURN_INT(MatOption, digit, digits[0]) case 2: if (8 * sizeof(MatOption) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) >= 2 * PyLong_SHIFT) { return (MatOption) (((((MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0])); } } break; case 3: if (8 * sizeof(MatOption) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) >= 3 * PyLong_SHIFT) { return (MatOption) (((((((MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0])); } } break; case 4: if (8 * sizeof(MatOption) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) >= 4 * PyLong_SHIFT) { return (MatOption) (((((((((MatOption)digits[3]) << PyLong_SHIFT) | (MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (MatOption) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(MatOption) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatOption) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (MatOption) 0; case -1: __PYX_VERIFY_RETURN_INT(MatOption, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(MatOption, digit, +digits[0]) case -2: if (8 * sizeof(MatOption) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) - 1 > 2 * PyLong_SHIFT) { return (MatOption) (((MatOption)-1)*(((((MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case 2: if (8 * sizeof(MatOption) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) - 1 > 2 * PyLong_SHIFT) { return (MatOption) ((((((MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case -3: if (8 * sizeof(MatOption) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) - 1 > 3 * PyLong_SHIFT) { return (MatOption) (((MatOption)-1)*(((((((MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case 3: if (8 * sizeof(MatOption) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) - 1 > 3 * PyLong_SHIFT) { return (MatOption) ((((((((MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case -4: if (8 * sizeof(MatOption) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) - 1 > 4 * PyLong_SHIFT) { return (MatOption) (((MatOption)-1)*(((((((((MatOption)digits[3]) << PyLong_SHIFT) | (MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; case 4: if (8 * sizeof(MatOption) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(MatOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(MatOption) - 1 > 4 * PyLong_SHIFT) { return (MatOption) ((((((((((MatOption)digits[3]) << PyLong_SHIFT) | (MatOption)digits[2]) << PyLong_SHIFT) | (MatOption)digits[1]) << PyLong_SHIFT) | (MatOption)digits[0]))); } } break; } #endif if (sizeof(MatOption) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(MatOption) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(MatOption, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else MatOption val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (MatOption) -1; } } else { MatOption val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (MatOption) -1; val = __Pyx_PyInt_As_MatOption(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to MatOption"); return (MatOption) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to MatOption"); return (MatOption) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MatDuplicateOption(MatDuplicateOption value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const MatDuplicateOption neg_one = (MatDuplicateOption) -1, const_zero = (MatDuplicateOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(MatDuplicateOption) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(MatDuplicateOption) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatDuplicateOption) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(MatDuplicateOption) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(MatDuplicateOption) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(MatDuplicateOption), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE PCASMType __Pyx_PyInt_As_PCASMType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCASMType neg_one = (PCASMType) -1, const_zero = (PCASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCASMType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCASMType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCASMType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCASMType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCASMType, digit, digits[0]) case 2: if (8 * sizeof(PCASMType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) >= 2 * PyLong_SHIFT) { return (PCASMType) (((((PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0])); } } break; case 3: if (8 * sizeof(PCASMType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) >= 3 * PyLong_SHIFT) { return (PCASMType) (((((((PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0])); } } break; case 4: if (8 * sizeof(PCASMType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) >= 4 * PyLong_SHIFT) { return (PCASMType) (((((((((PCASMType)digits[3]) << PyLong_SHIFT) | (PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCASMType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCASMType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCASMType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCASMType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCASMType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCASMType, digit, +digits[0]) case -2: if (8 * sizeof(PCASMType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) - 1 > 2 * PyLong_SHIFT) { return (PCASMType) (((PCASMType)-1)*(((((PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case 2: if (8 * sizeof(PCASMType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) - 1 > 2 * PyLong_SHIFT) { return (PCASMType) ((((((PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case -3: if (8 * sizeof(PCASMType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) - 1 > 3 * PyLong_SHIFT) { return (PCASMType) (((PCASMType)-1)*(((((((PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case 3: if (8 * sizeof(PCASMType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) - 1 > 3 * PyLong_SHIFT) { return (PCASMType) ((((((((PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case -4: if (8 * sizeof(PCASMType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) - 1 > 4 * PyLong_SHIFT) { return (PCASMType) (((PCASMType)-1)*(((((((((PCASMType)digits[3]) << PyLong_SHIFT) | (PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; case 4: if (8 * sizeof(PCASMType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCASMType) - 1 > 4 * PyLong_SHIFT) { return (PCASMType) ((((((((((PCASMType)digits[3]) << PyLong_SHIFT) | (PCASMType)digits[2]) << PyLong_SHIFT) | (PCASMType)digits[1]) << PyLong_SHIFT) | (PCASMType)digits[0]))); } } break; } #endif if (sizeof(PCASMType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCASMType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCASMType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCASMType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCASMType) -1; } } else { PCASMType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCASMType) -1; val = __Pyx_PyInt_As_PCASMType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCASMType"); return (PCASMType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCASMType"); return (PCASMType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCGASMType __Pyx_PyInt_As_PCGASMType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCGASMType neg_one = (PCGASMType) -1, const_zero = (PCGASMType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCGASMType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCGASMType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCGASMType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCGASMType, digit, digits[0]) case 2: if (8 * sizeof(PCGASMType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) >= 2 * PyLong_SHIFT) { return (PCGASMType) (((((PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0])); } } break; case 3: if (8 * sizeof(PCGASMType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) >= 3 * PyLong_SHIFT) { return (PCGASMType) (((((((PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0])); } } break; case 4: if (8 * sizeof(PCGASMType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) >= 4 * PyLong_SHIFT) { return (PCGASMType) (((((((((PCGASMType)digits[3]) << PyLong_SHIFT) | (PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCGASMType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCGASMType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCGASMType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCGASMType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCGASMType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCGASMType, digit, +digits[0]) case -2: if (8 * sizeof(PCGASMType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) - 1 > 2 * PyLong_SHIFT) { return (PCGASMType) (((PCGASMType)-1)*(((((PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case 2: if (8 * sizeof(PCGASMType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) - 1 > 2 * PyLong_SHIFT) { return (PCGASMType) ((((((PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case -3: if (8 * sizeof(PCGASMType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) - 1 > 3 * PyLong_SHIFT) { return (PCGASMType) (((PCGASMType)-1)*(((((((PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case 3: if (8 * sizeof(PCGASMType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) - 1 > 3 * PyLong_SHIFT) { return (PCGASMType) ((((((((PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case -4: if (8 * sizeof(PCGASMType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) - 1 > 4 * PyLong_SHIFT) { return (PCGASMType) (((PCGASMType)-1)*(((((((((PCGASMType)digits[3]) << PyLong_SHIFT) | (PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; case 4: if (8 * sizeof(PCGASMType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCGASMType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCGASMType) - 1 > 4 * PyLong_SHIFT) { return (PCGASMType) ((((((((((PCGASMType)digits[3]) << PyLong_SHIFT) | (PCGASMType)digits[2]) << PyLong_SHIFT) | (PCGASMType)digits[1]) << PyLong_SHIFT) | (PCGASMType)digits[0]))); } } break; } #endif if (sizeof(PCGASMType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCGASMType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCGASMType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCGASMType) -1; } } else { PCGASMType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCGASMType) -1; val = __Pyx_PyInt_As_PCGASMType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCGASMType"); return (PCGASMType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCGASMType"); return (PCGASMType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCCompositeType __Pyx_PyInt_As_PCCompositeType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCCompositeType neg_one = (PCCompositeType) -1, const_zero = (PCCompositeType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCCompositeType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCCompositeType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCCompositeType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCCompositeType, digit, digits[0]) case 2: if (8 * sizeof(PCCompositeType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) >= 2 * PyLong_SHIFT) { return (PCCompositeType) (((((PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0])); } } break; case 3: if (8 * sizeof(PCCompositeType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) >= 3 * PyLong_SHIFT) { return (PCCompositeType) (((((((PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0])); } } break; case 4: if (8 * sizeof(PCCompositeType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) >= 4 * PyLong_SHIFT) { return (PCCompositeType) (((((((((PCCompositeType)digits[3]) << PyLong_SHIFT) | (PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCCompositeType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCCompositeType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCCompositeType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCCompositeType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCCompositeType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCCompositeType, digit, +digits[0]) case -2: if (8 * sizeof(PCCompositeType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) - 1 > 2 * PyLong_SHIFT) { return (PCCompositeType) (((PCCompositeType)-1)*(((((PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case 2: if (8 * sizeof(PCCompositeType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) - 1 > 2 * PyLong_SHIFT) { return (PCCompositeType) ((((((PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case -3: if (8 * sizeof(PCCompositeType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) - 1 > 3 * PyLong_SHIFT) { return (PCCompositeType) (((PCCompositeType)-1)*(((((((PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case 3: if (8 * sizeof(PCCompositeType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) - 1 > 3 * PyLong_SHIFT) { return (PCCompositeType) ((((((((PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case -4: if (8 * sizeof(PCCompositeType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) - 1 > 4 * PyLong_SHIFT) { return (PCCompositeType) (((PCCompositeType)-1)*(((((((((PCCompositeType)digits[3]) << PyLong_SHIFT) | (PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; case 4: if (8 * sizeof(PCCompositeType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCCompositeType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCCompositeType) - 1 > 4 * PyLong_SHIFT) { return (PCCompositeType) ((((((((((PCCompositeType)digits[3]) << PyLong_SHIFT) | (PCCompositeType)digits[2]) << PyLong_SHIFT) | (PCCompositeType)digits[1]) << PyLong_SHIFT) | (PCCompositeType)digits[0]))); } } break; } #endif if (sizeof(PCCompositeType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCCompositeType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCCompositeType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCCompositeType) -1; } } else { PCCompositeType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCCompositeType) -1; val = __Pyx_PyInt_As_PCCompositeType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCCompositeType"); return (PCCompositeType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCCompositeType"); return (PCCompositeType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCFieldSplitSchurFactType __Pyx_PyInt_As_PCFieldSplitSchurFactType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurFactType neg_one = (PCFieldSplitSchurFactType) -1, const_zero = (PCFieldSplitSchurFactType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCFieldSplitSchurFactType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCFieldSplitSchurFactType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCFieldSplitSchurFactType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, digit, digits[0]) case 2: if (8 * sizeof(PCFieldSplitSchurFactType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) >= 2 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) (((((PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0])); } } break; case 3: if (8 * sizeof(PCFieldSplitSchurFactType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) >= 3 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) (((((((PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0])); } } break; case 4: if (8 * sizeof(PCFieldSplitSchurFactType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) >= 4 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) (((((((((PCFieldSplitSchurFactType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCFieldSplitSchurFactType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCFieldSplitSchurFactType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, digit, +digits[0]) case -2: if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 2 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) (((PCFieldSplitSchurFactType)-1)*(((((PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case 2: if (8 * sizeof(PCFieldSplitSchurFactType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 2 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) ((((((PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case -3: if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 3 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) (((PCFieldSplitSchurFactType)-1)*(((((((PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case 3: if (8 * sizeof(PCFieldSplitSchurFactType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 3 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) ((((((((PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case -4: if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 4 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) (((PCFieldSplitSchurFactType)-1)*(((((((((PCFieldSplitSchurFactType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; case 4: if (8 * sizeof(PCFieldSplitSchurFactType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurFactType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurFactType) - 1 > 4 * PyLong_SHIFT) { return (PCFieldSplitSchurFactType) ((((((((((PCFieldSplitSchurFactType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurFactType)digits[0]))); } } break; } #endif if (sizeof(PCFieldSplitSchurFactType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCFieldSplitSchurFactType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCFieldSplitSchurFactType) -1; } } else { PCFieldSplitSchurFactType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCFieldSplitSchurFactType) -1; val = __Pyx_PyInt_As_PCFieldSplitSchurFactType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCFieldSplitSchurFactType"); return (PCFieldSplitSchurFactType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCFieldSplitSchurFactType"); return (PCFieldSplitSchurFactType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCFieldSplitSchurPreType __Pyx_PyInt_As_PCFieldSplitSchurPreType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCFieldSplitSchurPreType neg_one = (PCFieldSplitSchurPreType) -1, const_zero = (PCFieldSplitSchurPreType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCFieldSplitSchurPreType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCFieldSplitSchurPreType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCFieldSplitSchurPreType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, digit, digits[0]) case 2: if (8 * sizeof(PCFieldSplitSchurPreType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) >= 2 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) (((((PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0])); } } break; case 3: if (8 * sizeof(PCFieldSplitSchurPreType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) >= 3 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) (((((((PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0])); } } break; case 4: if (8 * sizeof(PCFieldSplitSchurPreType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) >= 4 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) (((((((((PCFieldSplitSchurPreType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCFieldSplitSchurPreType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCFieldSplitSchurPreType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, digit, +digits[0]) case -2: if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 2 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) (((PCFieldSplitSchurPreType)-1)*(((((PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case 2: if (8 * sizeof(PCFieldSplitSchurPreType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 2 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) ((((((PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case -3: if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 3 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) (((PCFieldSplitSchurPreType)-1)*(((((((PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case 3: if (8 * sizeof(PCFieldSplitSchurPreType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 3 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) ((((((((PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case -4: if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 4 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) (((PCFieldSplitSchurPreType)-1)*(((((((((PCFieldSplitSchurPreType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; case 4: if (8 * sizeof(PCFieldSplitSchurPreType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCFieldSplitSchurPreType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCFieldSplitSchurPreType) - 1 > 4 * PyLong_SHIFT) { return (PCFieldSplitSchurPreType) ((((((((((PCFieldSplitSchurPreType)digits[3]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[2]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[1]) << PyLong_SHIFT) | (PCFieldSplitSchurPreType)digits[0]))); } } break; } #endif if (sizeof(PCFieldSplitSchurPreType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCFieldSplitSchurPreType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCFieldSplitSchurPreType) -1; } } else { PCFieldSplitSchurPreType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCFieldSplitSchurPreType) -1; val = __Pyx_PyInt_As_PCFieldSplitSchurPreType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCFieldSplitSchurPreType"); return (PCFieldSplitSchurPreType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCFieldSplitSchurPreType"); return (PCFieldSplitSchurPreType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCMGType __Pyx_PyInt_As_PCMGType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGType neg_one = (PCMGType) -1, const_zero = (PCMGType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCMGType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCMGType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCMGType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCMGType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCMGType, digit, digits[0]) case 2: if (8 * sizeof(PCMGType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) >= 2 * PyLong_SHIFT) { return (PCMGType) (((((PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0])); } } break; case 3: if (8 * sizeof(PCMGType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) >= 3 * PyLong_SHIFT) { return (PCMGType) (((((((PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0])); } } break; case 4: if (8 * sizeof(PCMGType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) >= 4 * PyLong_SHIFT) { return (PCMGType) (((((((((PCMGType)digits[3]) << PyLong_SHIFT) | (PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCMGType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCMGType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCMGType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCMGType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCMGType, digit, +digits[0]) case -2: if (8 * sizeof(PCMGType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) - 1 > 2 * PyLong_SHIFT) { return (PCMGType) (((PCMGType)-1)*(((((PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case 2: if (8 * sizeof(PCMGType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) - 1 > 2 * PyLong_SHIFT) { return (PCMGType) ((((((PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case -3: if (8 * sizeof(PCMGType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) - 1 > 3 * PyLong_SHIFT) { return (PCMGType) (((PCMGType)-1)*(((((((PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case 3: if (8 * sizeof(PCMGType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) - 1 > 3 * PyLong_SHIFT) { return (PCMGType) ((((((((PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case -4: if (8 * sizeof(PCMGType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) - 1 > 4 * PyLong_SHIFT) { return (PCMGType) (((PCMGType)-1)*(((((((((PCMGType)digits[3]) << PyLong_SHIFT) | (PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; case 4: if (8 * sizeof(PCMGType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGType) - 1 > 4 * PyLong_SHIFT) { return (PCMGType) ((((((((((PCMGType)digits[3]) << PyLong_SHIFT) | (PCMGType)digits[2]) << PyLong_SHIFT) | (PCMGType)digits[1]) << PyLong_SHIFT) | (PCMGType)digits[0]))); } } break; } #endif if (sizeof(PCMGType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCMGType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCMGType) -1; } } else { PCMGType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCMGType) -1; val = __Pyx_PyInt_As_PCMGType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCMGType"); return (PCMGType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCMGType"); return (PCMGType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCMGCycleType __Pyx_PyInt_As_PCMGCycleType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCMGCycleType neg_one = (PCMGCycleType) -1, const_zero = (PCMGCycleType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCMGCycleType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCMGCycleType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCMGCycleType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCMGCycleType, digit, digits[0]) case 2: if (8 * sizeof(PCMGCycleType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) >= 2 * PyLong_SHIFT) { return (PCMGCycleType) (((((PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0])); } } break; case 3: if (8 * sizeof(PCMGCycleType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) >= 3 * PyLong_SHIFT) { return (PCMGCycleType) (((((((PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0])); } } break; case 4: if (8 * sizeof(PCMGCycleType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) >= 4 * PyLong_SHIFT) { return (PCMGCycleType) (((((((((PCMGCycleType)digits[3]) << PyLong_SHIFT) | (PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCMGCycleType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCMGCycleType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGCycleType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCMGCycleType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCMGCycleType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCMGCycleType, digit, +digits[0]) case -2: if (8 * sizeof(PCMGCycleType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) - 1 > 2 * PyLong_SHIFT) { return (PCMGCycleType) (((PCMGCycleType)-1)*(((((PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case 2: if (8 * sizeof(PCMGCycleType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) - 1 > 2 * PyLong_SHIFT) { return (PCMGCycleType) ((((((PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case -3: if (8 * sizeof(PCMGCycleType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) - 1 > 3 * PyLong_SHIFT) { return (PCMGCycleType) (((PCMGCycleType)-1)*(((((((PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case 3: if (8 * sizeof(PCMGCycleType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) - 1 > 3 * PyLong_SHIFT) { return (PCMGCycleType) ((((((((PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case -4: if (8 * sizeof(PCMGCycleType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) - 1 > 4 * PyLong_SHIFT) { return (PCMGCycleType) (((PCMGCycleType)-1)*(((((((((PCMGCycleType)digits[3]) << PyLong_SHIFT) | (PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; case 4: if (8 * sizeof(PCMGCycleType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCMGCycleType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCMGCycleType) - 1 > 4 * PyLong_SHIFT) { return (PCMGCycleType) ((((((((((PCMGCycleType)digits[3]) << PyLong_SHIFT) | (PCMGCycleType)digits[2]) << PyLong_SHIFT) | (PCMGCycleType)digits[1]) << PyLong_SHIFT) | (PCMGCycleType)digits[0]))); } } break; } #endif if (sizeof(PCMGCycleType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCMGCycleType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCMGCycleType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCMGCycleType) -1; } } else { PCMGCycleType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCMGCycleType) -1; val = __Pyx_PyInt_As_PCMGCycleType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCMGCycleType"); return (PCMGCycleType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCMGCycleType"); return (PCMGCycleType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCPatchConstructType __Pyx_PyInt_As_PCPatchConstructType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCPatchConstructType neg_one = (PCPatchConstructType) -1, const_zero = (PCPatchConstructType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCPatchConstructType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCPatchConstructType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCPatchConstructType) 0; case 1: __PYX_VERIFY_RETURN_INT(PCPatchConstructType, digit, digits[0]) case 2: if (8 * sizeof(PCPatchConstructType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) >= 2 * PyLong_SHIFT) { return (PCPatchConstructType) (((((PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0])); } } break; case 3: if (8 * sizeof(PCPatchConstructType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) >= 3 * PyLong_SHIFT) { return (PCPatchConstructType) (((((((PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0])); } } break; case 4: if (8 * sizeof(PCPatchConstructType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) >= 4 * PyLong_SHIFT) { return (PCPatchConstructType) (((((((((PCPatchConstructType)digits[3]) << PyLong_SHIFT) | (PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCPatchConstructType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCPatchConstructType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCPatchConstructType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCPatchConstructType) 0; case -1: __PYX_VERIFY_RETURN_INT(PCPatchConstructType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCPatchConstructType, digit, +digits[0]) case -2: if (8 * sizeof(PCPatchConstructType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) - 1 > 2 * PyLong_SHIFT) { return (PCPatchConstructType) (((PCPatchConstructType)-1)*(((((PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case 2: if (8 * sizeof(PCPatchConstructType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) - 1 > 2 * PyLong_SHIFT) { return (PCPatchConstructType) ((((((PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case -3: if (8 * sizeof(PCPatchConstructType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) - 1 > 3 * PyLong_SHIFT) { return (PCPatchConstructType) (((PCPatchConstructType)-1)*(((((((PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case 3: if (8 * sizeof(PCPatchConstructType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) - 1 > 3 * PyLong_SHIFT) { return (PCPatchConstructType) ((((((((PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case -4: if (8 * sizeof(PCPatchConstructType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) - 1 > 4 * PyLong_SHIFT) { return (PCPatchConstructType) (((PCPatchConstructType)-1)*(((((((((PCPatchConstructType)digits[3]) << PyLong_SHIFT) | (PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; case 4: if (8 * sizeof(PCPatchConstructType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCPatchConstructType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCPatchConstructType) - 1 > 4 * PyLong_SHIFT) { return (PCPatchConstructType) ((((((((((PCPatchConstructType)digits[3]) << PyLong_SHIFT) | (PCPatchConstructType)digits[2]) << PyLong_SHIFT) | (PCPatchConstructType)digits[1]) << PyLong_SHIFT) | (PCPatchConstructType)digits[0]))); } } break; } #endif if (sizeof(PCPatchConstructType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCPatchConstructType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCPatchConstructType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCPatchConstructType) -1; } } else { PCPatchConstructType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCPatchConstructType) -1; val = __Pyx_PyInt_As_PCPatchConstructType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCPatchConstructType"); return (PCPatchConstructType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCPatchConstructType"); return (PCPatchConstructType) -1; } /* CIntFromPy */ static CYTHON_INLINE PCSide __Pyx_PyInt_As_PCSide(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PCSide neg_one = (PCSide) -1, const_zero = (PCSide) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(PCSide) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(PCSide, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (PCSide) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCSide) 0; case 1: __PYX_VERIFY_RETURN_INT(PCSide, digit, digits[0]) case 2: if (8 * sizeof(PCSide) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) >= 2 * PyLong_SHIFT) { return (PCSide) (((((PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0])); } } break; case 3: if (8 * sizeof(PCSide) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) >= 3 * PyLong_SHIFT) { return (PCSide) (((((((PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0])); } } break; case 4: if (8 * sizeof(PCSide) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) >= 4 * PyLong_SHIFT) { return (PCSide) (((((((((PCSide)digits[3]) << PyLong_SHIFT) | (PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (PCSide) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(PCSide) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCSide) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (PCSide) 0; case -1: __PYX_VERIFY_RETURN_INT(PCSide, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(PCSide, digit, +digits[0]) case -2: if (8 * sizeof(PCSide) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) - 1 > 2 * PyLong_SHIFT) { return (PCSide) (((PCSide)-1)*(((((PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case 2: if (8 * sizeof(PCSide) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) - 1 > 2 * PyLong_SHIFT) { return (PCSide) ((((((PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case -3: if (8 * sizeof(PCSide) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) - 1 > 3 * PyLong_SHIFT) { return (PCSide) (((PCSide)-1)*(((((((PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case 3: if (8 * sizeof(PCSide) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) - 1 > 3 * PyLong_SHIFT) { return (PCSide) ((((((((PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case -4: if (8 * sizeof(PCSide) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) - 1 > 4 * PyLong_SHIFT) { return (PCSide) (((PCSide)-1)*(((((((((PCSide)digits[3]) << PyLong_SHIFT) | (PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; case 4: if (8 * sizeof(PCSide) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(PCSide, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(PCSide) - 1 > 4 * PyLong_SHIFT) { return (PCSide) ((((((((((PCSide)digits[3]) << PyLong_SHIFT) | (PCSide)digits[2]) << PyLong_SHIFT) | (PCSide)digits[1]) << PyLong_SHIFT) | (PCSide)digits[0]))); } } break; } #endif if (sizeof(PCSide) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(PCSide) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(PCSide, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else PCSide val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (PCSide) -1; } } else { PCSide val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (PCSide) -1; val = __Pyx_PyInt_As_PCSide(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to PCSide"); return (PCSide) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PCSide"); return (PCSide) -1; } /* CIntFromPy */ static CYTHON_INLINE KSPNormType __Pyx_PyInt_As_KSPNormType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const KSPNormType neg_one = (KSPNormType) -1, const_zero = (KSPNormType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(KSPNormType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (KSPNormType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (KSPNormType) 0; case 1: __PYX_VERIFY_RETURN_INT(KSPNormType, digit, digits[0]) case 2: if (8 * sizeof(KSPNormType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) >= 2 * PyLong_SHIFT) { return (KSPNormType) (((((KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0])); } } break; case 3: if (8 * sizeof(KSPNormType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) >= 3 * PyLong_SHIFT) { return (KSPNormType) (((((((KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0])); } } break; case 4: if (8 * sizeof(KSPNormType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) >= 4 * PyLong_SHIFT) { return (KSPNormType) (((((((((KSPNormType)digits[3]) << PyLong_SHIFT) | (KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (KSPNormType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(KSPNormType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(KSPNormType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (KSPNormType) 0; case -1: __PYX_VERIFY_RETURN_INT(KSPNormType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(KSPNormType, digit, +digits[0]) case -2: if (8 * sizeof(KSPNormType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) - 1 > 2 * PyLong_SHIFT) { return (KSPNormType) (((KSPNormType)-1)*(((((KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case 2: if (8 * sizeof(KSPNormType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) - 1 > 2 * PyLong_SHIFT) { return (KSPNormType) ((((((KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case -3: if (8 * sizeof(KSPNormType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) - 1 > 3 * PyLong_SHIFT) { return (KSPNormType) (((KSPNormType)-1)*(((((((KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case 3: if (8 * sizeof(KSPNormType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) - 1 > 3 * PyLong_SHIFT) { return (KSPNormType) ((((((((KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case -4: if (8 * sizeof(KSPNormType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) - 1 > 4 * PyLong_SHIFT) { return (KSPNormType) (((KSPNormType)-1)*(((((((((KSPNormType)digits[3]) << PyLong_SHIFT) | (KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; case 4: if (8 * sizeof(KSPNormType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(KSPNormType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(KSPNormType) - 1 > 4 * PyLong_SHIFT) { return (KSPNormType) ((((((((((KSPNormType)digits[3]) << PyLong_SHIFT) | (KSPNormType)digits[2]) << PyLong_SHIFT) | (KSPNormType)digits[1]) << PyLong_SHIFT) | (KSPNormType)digits[0]))); } } break; } #endif if (sizeof(KSPNormType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(KSPNormType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else KSPNormType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (KSPNormType) -1; } } else { KSPNormType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (KSPNormType) -1; val = __Pyx_PyInt_As_KSPNormType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to KSPNormType"); return (KSPNormType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to KSPNormType"); return (KSPNormType) -1; } /* CIntFromPy */ static CYTHON_INLINE SNESNormSchedule __Pyx_PyInt_As_SNESNormSchedule(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const SNESNormSchedule neg_one = (SNESNormSchedule) -1, const_zero = (SNESNormSchedule) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(SNESNormSchedule) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (SNESNormSchedule) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SNESNormSchedule) 0; case 1: __PYX_VERIFY_RETURN_INT(SNESNormSchedule, digit, digits[0]) case 2: if (8 * sizeof(SNESNormSchedule) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) >= 2 * PyLong_SHIFT) { return (SNESNormSchedule) (((((SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0])); } } break; case 3: if (8 * sizeof(SNESNormSchedule) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) >= 3 * PyLong_SHIFT) { return (SNESNormSchedule) (((((((SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0])); } } break; case 4: if (8 * sizeof(SNESNormSchedule) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) >= 4 * PyLong_SHIFT) { return (SNESNormSchedule) (((((((((SNESNormSchedule)digits[3]) << PyLong_SHIFT) | (SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (SNESNormSchedule) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(SNESNormSchedule) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SNESNormSchedule) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (SNESNormSchedule) 0; case -1: __PYX_VERIFY_RETURN_INT(SNESNormSchedule, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(SNESNormSchedule, digit, +digits[0]) case -2: if (8 * sizeof(SNESNormSchedule) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) - 1 > 2 * PyLong_SHIFT) { return (SNESNormSchedule) (((SNESNormSchedule)-1)*(((((SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case 2: if (8 * sizeof(SNESNormSchedule) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) - 1 > 2 * PyLong_SHIFT) { return (SNESNormSchedule) ((((((SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case -3: if (8 * sizeof(SNESNormSchedule) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) - 1 > 3 * PyLong_SHIFT) { return (SNESNormSchedule) (((SNESNormSchedule)-1)*(((((((SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case 3: if (8 * sizeof(SNESNormSchedule) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) - 1 > 3 * PyLong_SHIFT) { return (SNESNormSchedule) ((((((((SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case -4: if (8 * sizeof(SNESNormSchedule) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) - 1 > 4 * PyLong_SHIFT) { return (SNESNormSchedule) (((SNESNormSchedule)-1)*(((((((((SNESNormSchedule)digits[3]) << PyLong_SHIFT) | (SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; case 4: if (8 * sizeof(SNESNormSchedule) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(SNESNormSchedule, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(SNESNormSchedule) - 1 > 4 * PyLong_SHIFT) { return (SNESNormSchedule) ((((((((((SNESNormSchedule)digits[3]) << PyLong_SHIFT) | (SNESNormSchedule)digits[2]) << PyLong_SHIFT) | (SNESNormSchedule)digits[1]) << PyLong_SHIFT) | (SNESNormSchedule)digits[0]))); } } break; } #endif if (sizeof(SNESNormSchedule) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(SNESNormSchedule) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else SNESNormSchedule val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (SNESNormSchedule) -1; } } else { SNESNormSchedule val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (SNESNormSchedule) -1; val = __Pyx_PyInt_As_SNESNormSchedule(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to SNESNormSchedule"); return (SNESNormSchedule) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to SNESNormSchedule"); return (SNESNormSchedule) -1; } /* CIntFromPy */ static CYTHON_INLINE TSProblemType __Pyx_PyInt_As_TSProblemType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSProblemType neg_one = (TSProblemType) -1, const_zero = (TSProblemType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(TSProblemType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSProblemType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSProblemType) 0; case 1: __PYX_VERIFY_RETURN_INT(TSProblemType, digit, digits[0]) case 2: if (8 * sizeof(TSProblemType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) >= 2 * PyLong_SHIFT) { return (TSProblemType) (((((TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0])); } } break; case 3: if (8 * sizeof(TSProblemType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) >= 3 * PyLong_SHIFT) { return (TSProblemType) (((((((TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0])); } } break; case 4: if (8 * sizeof(TSProblemType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) >= 4 * PyLong_SHIFT) { return (TSProblemType) (((((((((TSProblemType)digits[3]) << PyLong_SHIFT) | (TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSProblemType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(TSProblemType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSProblemType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSProblemType) 0; case -1: __PYX_VERIFY_RETURN_INT(TSProblemType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(TSProblemType, digit, +digits[0]) case -2: if (8 * sizeof(TSProblemType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) - 1 > 2 * PyLong_SHIFT) { return (TSProblemType) (((TSProblemType)-1)*(((((TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case 2: if (8 * sizeof(TSProblemType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) - 1 > 2 * PyLong_SHIFT) { return (TSProblemType) ((((((TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case -3: if (8 * sizeof(TSProblemType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) - 1 > 3 * PyLong_SHIFT) { return (TSProblemType) (((TSProblemType)-1)*(((((((TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case 3: if (8 * sizeof(TSProblemType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) - 1 > 3 * PyLong_SHIFT) { return (TSProblemType) ((((((((TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case -4: if (8 * sizeof(TSProblemType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) - 1 > 4 * PyLong_SHIFT) { return (TSProblemType) (((TSProblemType)-1)*(((((((((TSProblemType)digits[3]) << PyLong_SHIFT) | (TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; case 4: if (8 * sizeof(TSProblemType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSProblemType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSProblemType) - 1 > 4 * PyLong_SHIFT) { return (TSProblemType) ((((((((((TSProblemType)digits[3]) << PyLong_SHIFT) | (TSProblemType)digits[2]) << PyLong_SHIFT) | (TSProblemType)digits[1]) << PyLong_SHIFT) | (TSProblemType)digits[0]))); } } break; } #endif if (sizeof(TSProblemType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSProblemType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else TSProblemType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (TSProblemType) -1; } } else { TSProblemType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSProblemType) -1; val = __Pyx_PyInt_As_TSProblemType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSProblemType"); return (TSProblemType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSProblemType"); return (TSProblemType) -1; } /* CIntFromPy */ static CYTHON_INLINE TSEquationType __Pyx_PyInt_As_TSEquationType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSEquationType neg_one = (TSEquationType) -1, const_zero = (TSEquationType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(TSEquationType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSEquationType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSEquationType) 0; case 1: __PYX_VERIFY_RETURN_INT(TSEquationType, digit, digits[0]) case 2: if (8 * sizeof(TSEquationType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) >= 2 * PyLong_SHIFT) { return (TSEquationType) (((((TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0])); } } break; case 3: if (8 * sizeof(TSEquationType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) >= 3 * PyLong_SHIFT) { return (TSEquationType) (((((((TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0])); } } break; case 4: if (8 * sizeof(TSEquationType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) >= 4 * PyLong_SHIFT) { return (TSEquationType) (((((((((TSEquationType)digits[3]) << PyLong_SHIFT) | (TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSEquationType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(TSEquationType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSEquationType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSEquationType) 0; case -1: __PYX_VERIFY_RETURN_INT(TSEquationType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(TSEquationType, digit, +digits[0]) case -2: if (8 * sizeof(TSEquationType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) - 1 > 2 * PyLong_SHIFT) { return (TSEquationType) (((TSEquationType)-1)*(((((TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case 2: if (8 * sizeof(TSEquationType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) - 1 > 2 * PyLong_SHIFT) { return (TSEquationType) ((((((TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case -3: if (8 * sizeof(TSEquationType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) - 1 > 3 * PyLong_SHIFT) { return (TSEquationType) (((TSEquationType)-1)*(((((((TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case 3: if (8 * sizeof(TSEquationType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) - 1 > 3 * PyLong_SHIFT) { return (TSEquationType) ((((((((TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case -4: if (8 * sizeof(TSEquationType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) - 1 > 4 * PyLong_SHIFT) { return (TSEquationType) (((TSEquationType)-1)*(((((((((TSEquationType)digits[3]) << PyLong_SHIFT) | (TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; case 4: if (8 * sizeof(TSEquationType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSEquationType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSEquationType) - 1 > 4 * PyLong_SHIFT) { return (TSEquationType) ((((((((((TSEquationType)digits[3]) << PyLong_SHIFT) | (TSEquationType)digits[2]) << PyLong_SHIFT) | (TSEquationType)digits[1]) << PyLong_SHIFT) | (TSEquationType)digits[0]))); } } break; } #endif if (sizeof(TSEquationType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSEquationType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else TSEquationType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (TSEquationType) -1; } } else { TSEquationType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSEquationType) -1; val = __Pyx_PyInt_As_TSEquationType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSEquationType"); return (TSEquationType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSEquationType"); return (TSEquationType) -1; } /* CIntFromPy */ static CYTHON_INLINE TSExactFinalTimeOption __Pyx_PyInt_As_TSExactFinalTimeOption(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSExactFinalTimeOption neg_one = (TSExactFinalTimeOption) -1, const_zero = (TSExactFinalTimeOption) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(TSExactFinalTimeOption) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSExactFinalTimeOption) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSExactFinalTimeOption) 0; case 1: __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, digit, digits[0]) case 2: if (8 * sizeof(TSExactFinalTimeOption) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) >= 2 * PyLong_SHIFT) { return (TSExactFinalTimeOption) (((((TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0])); } } break; case 3: if (8 * sizeof(TSExactFinalTimeOption) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) >= 3 * PyLong_SHIFT) { return (TSExactFinalTimeOption) (((((((TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0])); } } break; case 4: if (8 * sizeof(TSExactFinalTimeOption) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) >= 4 * PyLong_SHIFT) { return (TSExactFinalTimeOption) (((((((((TSExactFinalTimeOption)digits[3]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSExactFinalTimeOption) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(TSExactFinalTimeOption) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSExactFinalTimeOption) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSExactFinalTimeOption) 0; case -1: __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, digit, +digits[0]) case -2: if (8 * sizeof(TSExactFinalTimeOption) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) - 1 > 2 * PyLong_SHIFT) { return (TSExactFinalTimeOption) (((TSExactFinalTimeOption)-1)*(((((TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case 2: if (8 * sizeof(TSExactFinalTimeOption) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) - 1 > 2 * PyLong_SHIFT) { return (TSExactFinalTimeOption) ((((((TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case -3: if (8 * sizeof(TSExactFinalTimeOption) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) - 1 > 3 * PyLong_SHIFT) { return (TSExactFinalTimeOption) (((TSExactFinalTimeOption)-1)*(((((((TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case 3: if (8 * sizeof(TSExactFinalTimeOption) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) - 1 > 3 * PyLong_SHIFT) { return (TSExactFinalTimeOption) ((((((((TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case -4: if (8 * sizeof(TSExactFinalTimeOption) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) - 1 > 4 * PyLong_SHIFT) { return (TSExactFinalTimeOption) (((TSExactFinalTimeOption)-1)*(((((((((TSExactFinalTimeOption)digits[3]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; case 4: if (8 * sizeof(TSExactFinalTimeOption) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSExactFinalTimeOption, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSExactFinalTimeOption) - 1 > 4 * PyLong_SHIFT) { return (TSExactFinalTimeOption) ((((((((((TSExactFinalTimeOption)digits[3]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[2]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[1]) << PyLong_SHIFT) | (TSExactFinalTimeOption)digits[0]))); } } break; } #endif if (sizeof(TSExactFinalTimeOption) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSExactFinalTimeOption) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else TSExactFinalTimeOption val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (TSExactFinalTimeOption) -1; } } else { TSExactFinalTimeOption val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSExactFinalTimeOption) -1; val = __Pyx_PyInt_As_TSExactFinalTimeOption(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSExactFinalTimeOption"); return (TSExactFinalTimeOption) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSExactFinalTimeOption"); return (TSExactFinalTimeOption) -1; } /* CIntFromPy */ static CYTHON_INLINE TSConvergedReason __Pyx_PyInt_As_TSConvergedReason(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const TSConvergedReason neg_one = (TSConvergedReason) -1, const_zero = (TSConvergedReason) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(TSConvergedReason) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (TSConvergedReason) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSConvergedReason) 0; case 1: __PYX_VERIFY_RETURN_INT(TSConvergedReason, digit, digits[0]) case 2: if (8 * sizeof(TSConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) >= 2 * PyLong_SHIFT) { return (TSConvergedReason) (((((TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0])); } } break; case 3: if (8 * sizeof(TSConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) >= 3 * PyLong_SHIFT) { return (TSConvergedReason) (((((((TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0])); } } break; case 4: if (8 * sizeof(TSConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) >= 4 * PyLong_SHIFT) { return (TSConvergedReason) (((((((((TSConvergedReason)digits[3]) << PyLong_SHIFT) | (TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (TSConvergedReason) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(TSConvergedReason) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSConvergedReason) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (TSConvergedReason) 0; case -1: __PYX_VERIFY_RETURN_INT(TSConvergedReason, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(TSConvergedReason, digit, +digits[0]) case -2: if (8 * sizeof(TSConvergedReason) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (TSConvergedReason) (((TSConvergedReason)-1)*(((((TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case 2: if (8 * sizeof(TSConvergedReason) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) - 1 > 2 * PyLong_SHIFT) { return (TSConvergedReason) ((((((TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case -3: if (8 * sizeof(TSConvergedReason) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (TSConvergedReason) (((TSConvergedReason)-1)*(((((((TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case 3: if (8 * sizeof(TSConvergedReason) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) - 1 > 3 * PyLong_SHIFT) { return (TSConvergedReason) ((((((((TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case -4: if (8 * sizeof(TSConvergedReason) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (TSConvergedReason) (((TSConvergedReason)-1)*(((((((((TSConvergedReason)digits[3]) << PyLong_SHIFT) | (TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; case 4: if (8 * sizeof(TSConvergedReason) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(TSConvergedReason, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(TSConvergedReason) - 1 > 4 * PyLong_SHIFT) { return (TSConvergedReason) ((((((((((TSConvergedReason)digits[3]) << PyLong_SHIFT) | (TSConvergedReason)digits[2]) << PyLong_SHIFT) | (TSConvergedReason)digits[1]) << PyLong_SHIFT) | (TSConvergedReason)digits[0]))); } } break; } #endif if (sizeof(TSConvergedReason) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(TSConvergedReason) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else TSConvergedReason val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (TSConvergedReason) -1; } } else { TSConvergedReason val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (TSConvergedReason) -1; val = __Pyx_PyInt_As_TSConvergedReason(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to TSConvergedReason"); return (TSConvergedReason) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to TSConvergedReason"); return (TSConvergedReason) -1; } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PetscBool(PetscBool value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const PetscBool neg_one = (PetscBool) -1, const_zero = (PetscBool) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(PetscBool) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(PetscBool) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(PetscBool) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(PetscBool) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(PetscBool), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE DMSwarmType __Pyx_PyInt_As_DMSwarmType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmType neg_one = (DMSwarmType) -1, const_zero = (DMSwarmType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMSwarmType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMSwarmType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMSwarmType) 0; case 1: __PYX_VERIFY_RETURN_INT(DMSwarmType, digit, digits[0]) case 2: if (8 * sizeof(DMSwarmType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) >= 2 * PyLong_SHIFT) { return (DMSwarmType) (((((DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0])); } } break; case 3: if (8 * sizeof(DMSwarmType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) >= 3 * PyLong_SHIFT) { return (DMSwarmType) (((((((DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0])); } } break; case 4: if (8 * sizeof(DMSwarmType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) >= 4 * PyLong_SHIFT) { return (DMSwarmType) (((((((((DMSwarmType)digits[3]) << PyLong_SHIFT) | (DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMSwarmType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMSwarmType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMSwarmType) 0; case -1: __PYX_VERIFY_RETURN_INT(DMSwarmType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMSwarmType, digit, +digits[0]) case -2: if (8 * sizeof(DMSwarmType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) - 1 > 2 * PyLong_SHIFT) { return (DMSwarmType) (((DMSwarmType)-1)*(((((DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case 2: if (8 * sizeof(DMSwarmType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) - 1 > 2 * PyLong_SHIFT) { return (DMSwarmType) ((((((DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case -3: if (8 * sizeof(DMSwarmType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) - 1 > 3 * PyLong_SHIFT) { return (DMSwarmType) (((DMSwarmType)-1)*(((((((DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case 3: if (8 * sizeof(DMSwarmType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) - 1 > 3 * PyLong_SHIFT) { return (DMSwarmType) ((((((((DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case -4: if (8 * sizeof(DMSwarmType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) - 1 > 4 * PyLong_SHIFT) { return (DMSwarmType) (((DMSwarmType)-1)*(((((((((DMSwarmType)digits[3]) << PyLong_SHIFT) | (DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; case 4: if (8 * sizeof(DMSwarmType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmType) - 1 > 4 * PyLong_SHIFT) { return (DMSwarmType) ((((((((((DMSwarmType)digits[3]) << PyLong_SHIFT) | (DMSwarmType)digits[2]) << PyLong_SHIFT) | (DMSwarmType)digits[1]) << PyLong_SHIFT) | (DMSwarmType)digits[0]))); } } break; } #endif if (sizeof(DMSwarmType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMSwarmType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMSwarmType) -1; } } else { DMSwarmType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMSwarmType) -1; val = __Pyx_PyInt_As_DMSwarmType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMSwarmType"); return (DMSwarmType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMSwarmType"); return (DMSwarmType) -1; } /* CIntFromPy */ static CYTHON_INLINE DMSwarmPICLayoutType __Pyx_PyInt_As_DMSwarmPICLayoutType(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const DMSwarmPICLayoutType neg_one = (DMSwarmPICLayoutType) -1, const_zero = (DMSwarmPICLayoutType) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(DMSwarmPICLayoutType) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (DMSwarmPICLayoutType) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMSwarmPICLayoutType) 0; case 1: __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, digit, digits[0]) case 2: if (8 * sizeof(DMSwarmPICLayoutType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) >= 2 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) (((((DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0])); } } break; case 3: if (8 * sizeof(DMSwarmPICLayoutType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) >= 3 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) (((((((DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0])); } } break; case 4: if (8 * sizeof(DMSwarmPICLayoutType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) >= 4 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) (((((((((DMSwarmPICLayoutType)digits[3]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (DMSwarmPICLayoutType) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (DMSwarmPICLayoutType) 0; case -1: __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, digit, +digits[0]) case -2: if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 2 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) (((DMSwarmPICLayoutType)-1)*(((((DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case 2: if (8 * sizeof(DMSwarmPICLayoutType) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 2 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) ((((((DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case -3: if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 3 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) (((DMSwarmPICLayoutType)-1)*(((((((DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case 3: if (8 * sizeof(DMSwarmPICLayoutType) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 3 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) ((((((((DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case -4: if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 4 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) (((DMSwarmPICLayoutType)-1)*(((((((((DMSwarmPICLayoutType)digits[3]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; case 4: if (8 * sizeof(DMSwarmPICLayoutType) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(DMSwarmPICLayoutType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(DMSwarmPICLayoutType) - 1 > 4 * PyLong_SHIFT) { return (DMSwarmPICLayoutType) ((((((((((DMSwarmPICLayoutType)digits[3]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[2]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[1]) << PyLong_SHIFT) | (DMSwarmPICLayoutType)digits[0]))); } } break; } #endif if (sizeof(DMSwarmPICLayoutType) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else DMSwarmPICLayoutType val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (DMSwarmPICLayoutType) -1; } } else { DMSwarmPICLayoutType val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (DMSwarmPICLayoutType) -1; val = __Pyx_PyInt_As_DMSwarmPICLayoutType(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to DMSwarmPICLayoutType"); return (DMSwarmPICLayoutType) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to DMSwarmPICLayoutType"); return (DMSwarmPICLayoutType) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const long neg_one = (long) -1, const_zero = (long) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" #endif const char neg_one = (char) -1, const_zero = (char) 0; #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(char) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (char) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (char) 0; case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) case 2: if (8 * sizeof(char) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 3: if (8 * sizeof(char) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 4: if (8 * sizeof(char) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(char) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (char) 0; case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) case -2: if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 2: if (8 * sizeof(char) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -3: if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 3: if (8 * sizeof(char) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -4: if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 4: if (8 * sizeof(char) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; } #endif if (sizeof(char) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (char) -1; } } else { char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (char) -1; val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to char"); return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to char"); return (char) -1; } /* IsLittleEndian */ static CYTHON_INLINE int __Pyx_Is_Little_Endian(void) { union { uint32_t u32; uint8_t u8[4]; } S; S.u32 = 0x01020304; return S.u8[0] == 4; } /* BufferFormatCheck */ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, __Pyx_BufFmt_StackElem* stack, __Pyx_TypeInfo* type) { stack[0].field = &ctx->root; stack[0].parent_offset = 0; ctx->root.type = type; ctx->root.name = "buffer dtype"; ctx->root.offset = 0; ctx->head = stack; ctx->head->field = &ctx->root; ctx->fmt_offset = 0; ctx->head->parent_offset = 0; ctx->new_packmode = '@'; ctx->enc_packmode = '@'; ctx->new_count = 1; ctx->enc_count = 0; ctx->enc_type = 0; ctx->is_complex = 0; ctx->is_valid_array = 0; ctx->struct_alignment = 0; while (type->typegroup == 'S') { ++ctx->head; ctx->head->field = type->fields; ctx->head->parent_offset = 0; type = type->fields->type; } } static int __Pyx_BufFmt_ParseNumber(const char** ts) { int count; const char* t = *ts; if (*t < '0' || *t > '9') { return -1; } else { count = *t++ - '0'; while (*t >= '0' && *t <= '9') { count *= 10; count += *t++ - '0'; } } *ts = t; return count; } static int __Pyx_BufFmt_ExpectNumber(const char **ts) { int number = __Pyx_BufFmt_ParseNumber(ts); if (number == -1) PyErr_Format(PyExc_ValueError,\ "Does not understand character buffer dtype format string ('%c')", **ts); return number; } static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) { PyErr_Format(PyExc_ValueError, "Unexpected format string character: '%c'", ch); } static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) { switch (ch) { case '?': return "'bool'"; case 'c': return "'char'"; case 'b': return "'signed char'"; case 'B': return "'unsigned char'"; case 'h': return "'short'"; case 'H': return "'unsigned short'"; case 'i': return "'int'"; case 'I': return "'unsigned int'"; case 'l': return "'long'"; case 'L': return "'unsigned long'"; case 'q': return "'long long'"; case 'Q': return "'unsigned long long'"; case 'f': return (is_complex ? "'complex float'" : "'float'"); case 'd': return (is_complex ? "'complex double'" : "'double'"); case 'g': return (is_complex ? "'complex long double'" : "'long double'"); case 'T': return "a struct"; case 'O': return "Python object"; case 'P': return "a pointer"; case 's': case 'p': return "a string"; case 0: return "end"; default: return "unparseable format string"; } } static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) { switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return 2; case 'i': case 'I': case 'l': case 'L': return 4; case 'q': case 'Q': return 8; case 'f': return (is_complex ? 8 : 4); case 'd': return (is_complex ? 16 : 8); case 'g': { PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g').."); return 0; } case 'O': case 'P': return sizeof(void*); default: __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) { switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return sizeof(short); case 'i': case 'I': return sizeof(int); case 'l': case 'L': return sizeof(long); #ifdef HAVE_LONG_LONG case 'q': case 'Q': return sizeof(PY_LONG_LONG); #endif case 'f': return sizeof(float) * (is_complex ? 2 : 1); case 'd': return sizeof(double) * (is_complex ? 2 : 1); case 'g': return sizeof(long double) * (is_complex ? 2 : 1); case 'O': case 'P': return sizeof(void*); default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } } typedef struct { char c; short x; } __Pyx_st_short; typedef struct { char c; int x; } __Pyx_st_int; typedef struct { char c; long x; } __Pyx_st_long; typedef struct { char c; float x; } __Pyx_st_float; typedef struct { char c; double x; } __Pyx_st_double; typedef struct { char c; long double x; } __Pyx_st_longdouble; typedef struct { char c; void *x; } __Pyx_st_void_p; #ifdef HAVE_LONG_LONG typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong; #endif static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) { switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short); case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int); case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long); #ifdef HAVE_LONG_LONG case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG); #endif case 'f': return sizeof(__Pyx_st_float) - sizeof(float); case 'd': return sizeof(__Pyx_st_double) - sizeof(double); case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double); case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*); default: __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } /* These are for computing the padding at the end of the struct to align on the first member of the struct. This will probably the same as above, but we don't have any guarantees. */ typedef struct { short x; char c; } __Pyx_pad_short; typedef struct { int x; char c; } __Pyx_pad_int; typedef struct { long x; char c; } __Pyx_pad_long; typedef struct { float x; char c; } __Pyx_pad_float; typedef struct { double x; char c; } __Pyx_pad_double; typedef struct { long double x; char c; } __Pyx_pad_longdouble; typedef struct { void *x; char c; } __Pyx_pad_void_p; #ifdef HAVE_LONG_LONG typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong; #endif static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) { switch (ch) { case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1; case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short); case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int); case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long); #ifdef HAVE_LONG_LONG case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG); #endif case 'f': return sizeof(__Pyx_pad_float) - sizeof(float); case 'd': return sizeof(__Pyx_pad_double) - sizeof(double); case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double); case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*); default: __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) { switch (ch) { case 'c': return 'H'; case 'b': case 'h': case 'i': case 'l': case 'q': case 's': case 'p': return 'I'; case '?': case 'B': case 'H': case 'I': case 'L': case 'Q': return 'U'; case 'f': case 'd': case 'g': return (is_complex ? 'C' : 'R'); case 'O': return 'O'; case 'P': return 'P'; default: { __Pyx_BufFmt_RaiseUnexpectedChar(ch); return 0; } } } static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) { if (ctx->head == NULL || ctx->head->field == &ctx->root) { const char* expected; const char* quote; if (ctx->head == NULL) { expected = "end"; quote = ""; } else { expected = ctx->head->field->type->name; quote = "'"; } PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch, expected %s%s%s but got %s", quote, expected, quote, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex)); } else { __Pyx_StructField* field = ctx->head->field; __Pyx_StructField* parent = (ctx->head - 1)->field; PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'", field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex), parent->type->name, field->name); } } static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { char group; size_t size, offset, arraysize = 1; if (ctx->enc_type == 0) return 0; if (ctx->head->field->type->arraysize[0]) { int i, ndim = 0; if (ctx->enc_type == 's' || ctx->enc_type == 'p') { ctx->is_valid_array = ctx->head->field->type->ndim == 1; ndim = 1; if (ctx->enc_count != ctx->head->field->type->arraysize[0]) { PyErr_Format(PyExc_ValueError, "Expected a dimension of size %zu, got %zu", ctx->head->field->type->arraysize[0], ctx->enc_count); return -1; } } if (!ctx->is_valid_array) { PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d", ctx->head->field->type->ndim, ndim); return -1; } for (i = 0; i < ctx->head->field->type->ndim; i++) { arraysize *= ctx->head->field->type->arraysize[i]; } ctx->is_valid_array = 0; ctx->enc_count = 1; } group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex); do { __Pyx_StructField* field = ctx->head->field; __Pyx_TypeInfo* type = field->type; if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') { size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex); } else { size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex); } if (ctx->enc_packmode == '@') { size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex); size_t align_mod_offset; if (align_at == 0) return -1; align_mod_offset = ctx->fmt_offset % align_at; if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset; if (ctx->struct_alignment == 0) ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type, ctx->is_complex); } if (type->size != size || type->typegroup != group) { if (type->typegroup == 'C' && type->fields != NULL) { size_t parent_offset = ctx->head->parent_offset + field->offset; ++ctx->head; ctx->head->field = type->fields; ctx->head->parent_offset = parent_offset; continue; } if ((type->typegroup == 'H' || group == 'H') && type->size == size) { } else { __Pyx_BufFmt_RaiseExpected(ctx); return -1; } } offset = ctx->head->parent_offset + field->offset; if (ctx->fmt_offset != offset) { PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); return -1; } ctx->fmt_offset += size; if (arraysize) ctx->fmt_offset += (arraysize - 1) * size; --ctx->enc_count; while (1) { if (field == &ctx->root) { ctx->head = NULL; if (ctx->enc_count != 0) { __Pyx_BufFmt_RaiseExpected(ctx); return -1; } break; } ctx->head->field = ++field; if (field->type == NULL) { --ctx->head; field = ctx->head->field; continue; } else if (field->type->typegroup == 'S') { size_t parent_offset = ctx->head->parent_offset + field->offset; if (field->type->fields->type == NULL) continue; field = field->type->fields; ++ctx->head; ctx->head->field = field; ctx->head->parent_offset = parent_offset; break; } else { break; } } } while (ctx->enc_count); ctx->enc_type = 0; ctx->is_complex = 0; return 0; } static PyObject * __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp) { const char *ts = *tsp; int i = 0, number, ndim; ++ts; if (ctx->new_count != 1) { PyErr_SetString(PyExc_ValueError, "Cannot handle repeated arrays in format string"); return NULL; } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ndim = ctx->head->field->type->ndim; while (*ts && *ts != ')') { switch (*ts) { case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue; default: break; } number = __Pyx_BufFmt_ExpectNumber(&ts); if (number == -1) return NULL; if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) return PyErr_Format(PyExc_ValueError, "Expected a dimension of size %zu, got %d", ctx->head->field->type->arraysize[i], number); if (*ts != ',' && *ts != ')') return PyErr_Format(PyExc_ValueError, "Expected a comma in format string, got '%c'", *ts); if (*ts == ',') ts++; i++; } if (i != ndim) return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d", ctx->head->field->type->ndim, i); if (!*ts) { PyErr_SetString(PyExc_ValueError, "Unexpected end of format string, expected ')'"); return NULL; } ctx->is_valid_array = 1; ctx->new_count = 1; *tsp = ++ts; return Py_None; } static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) { int got_Z = 0; while (1) { switch(*ts) { case 0: if (ctx->enc_type != 0 && ctx->head == NULL) { __Pyx_BufFmt_RaiseExpected(ctx); return NULL; } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; if (ctx->head != NULL) { __Pyx_BufFmt_RaiseExpected(ctx); return NULL; } return ts; case ' ': case '\r': case '\n': ++ts; break; case '<': if (!__Pyx_Is_Little_Endian()) { PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); return NULL; } ctx->new_packmode = '='; ++ts; break; case '>': case '!': if (__Pyx_Is_Little_Endian()) { PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); return NULL; } ctx->new_packmode = '='; ++ts; break; case '=': case '@': case '^': ctx->new_packmode = *ts++; break; case 'T': { const char* ts_after_sub; size_t i, struct_count = ctx->new_count; size_t struct_alignment = ctx->struct_alignment; ctx->new_count = 1; ++ts; if (*ts != '{') { PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'"); return NULL; } if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->enc_type = 0; ctx->enc_count = 0; ctx->struct_alignment = 0; ++ts; ts_after_sub = ts; for (i = 0; i != struct_count; ++i) { ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts); if (!ts_after_sub) return NULL; } ts = ts_after_sub; if (struct_alignment) ctx->struct_alignment = struct_alignment; } break; case '}': { size_t alignment = ctx->struct_alignment; ++ts; if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->enc_type = 0; if (alignment && ctx->fmt_offset % alignment) { ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment); } } return ts; case 'x': if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->fmt_offset += ctx->new_count; ctx->new_count = 1; ctx->enc_count = 0; ctx->enc_type = 0; ctx->enc_packmode = ctx->new_packmode; ++ts; break; case 'Z': got_Z = 1; ++ts; if (*ts != 'f' && *ts != 'd' && *ts != 'g') { __Pyx_BufFmt_RaiseUnexpectedChar('Z'); return NULL; } CYTHON_FALLTHROUGH; case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I': case 'l': case 'L': case 'q': case 'Q': case 'f': case 'd': case 'g': case 'O': case 'p': if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) && (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) { ctx->enc_count += ctx->new_count; ctx->new_count = 1; got_Z = 0; ++ts; break; } CYTHON_FALLTHROUGH; case 's': if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL; ctx->enc_count = ctx->new_count; ctx->enc_packmode = ctx->new_packmode; ctx->enc_type = *ts; ctx->is_complex = got_Z; ++ts; ctx->new_count = 1; got_Z = 0; break; case ':': ++ts; while(*ts != ':') ++ts; ++ts; break; case '(': if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL; break; default: { int number = __Pyx_BufFmt_ExpectNumber(&ts); if (number == -1) return NULL; ctx->new_count = (size_t)number; } } } } /* TypeInfoCompare */ static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b) { int i; if (!a || !b) return 0; if (a == b) return 1; if (a->size != b->size || a->typegroup != b->typegroup || a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) { if (a->typegroup == 'H' || b->typegroup == 'H') { return a->size == b->size; } else { return 0; } } if (a->ndim) { for (i = 0; i < a->ndim; i++) if (a->arraysize[i] != b->arraysize[i]) return 0; } if (a->typegroup == 'S') { if (a->flags != b->flags) return 0; if (a->fields || b->fields) { if (!(a->fields && b->fields)) return 0; for (i = 0; a->fields[i].type && b->fields[i].type; i++) { __Pyx_StructField *field_a = a->fields + i; __Pyx_StructField *field_b = b->fields + i; if (field_a->offset != field_b->offset || !__pyx_typeinfo_cmp(field_a->type, field_b->type)) return 0; } return !a->fields[i].type && !b->fields[i].type; } } return 1; } /* MemviewSliceValidateAndInit */ static int __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec) { if (buf->shape[dim] <= 1) return 1; if (buf->strides) { if (spec & __Pyx_MEMVIEW_CONTIG) { if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) { if (unlikely(buf->strides[dim] != sizeof(void *))) { PyErr_Format(PyExc_ValueError, "Buffer is not indirectly contiguous " "in dimension %d.", dim); goto fail; } } else if (unlikely(buf->strides[dim] != buf->itemsize)) { PyErr_SetString(PyExc_ValueError, "Buffer and memoryview are not contiguous " "in the same dimension."); goto fail; } } if (spec & __Pyx_MEMVIEW_FOLLOW) { Py_ssize_t stride = buf->strides[dim]; if (stride < 0) stride = -stride; if (unlikely(stride < buf->itemsize)) { PyErr_SetString(PyExc_ValueError, "Buffer and memoryview are not contiguous " "in the same dimension."); goto fail; } } } else { if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) { PyErr_Format(PyExc_ValueError, "C-contiguous buffer is not contiguous in " "dimension %d", dim); goto fail; } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) { PyErr_Format(PyExc_ValueError, "C-contiguous buffer is not indirect in " "dimension %d", dim); goto fail; } else if (unlikely(buf->suboffsets)) { PyErr_SetString(PyExc_ValueError, "Buffer exposes suboffsets but no strides"); goto fail; } } return 1; fail: return 0; } static int __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec) { if (spec & __Pyx_MEMVIEW_DIRECT) { if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) { PyErr_Format(PyExc_ValueError, "Buffer not compatible with direct access " "in dimension %d.", dim); goto fail; } } if (spec & __Pyx_MEMVIEW_PTR) { if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) { PyErr_Format(PyExc_ValueError, "Buffer is not indirectly accessible " "in dimension %d.", dim); goto fail; } } return 1; fail: return 0; } static int __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag) { int i; if (c_or_f_flag & __Pyx_IS_F_CONTIG) { Py_ssize_t stride = 1; for (i = 0; i < ndim; i++) { if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { PyErr_SetString(PyExc_ValueError, "Buffer not fortran contiguous."); goto fail; } stride = stride * buf->shape[i]; } } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) { Py_ssize_t stride = 1; for (i = ndim - 1; i >- 1; i--) { if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) { PyErr_SetString(PyExc_ValueError, "Buffer not C contiguous."); goto fail; } stride = stride * buf->shape[i]; } } return 1; fail: return 0; } static int __Pyx_ValidateAndInit_memviewslice( int *axes_specs, int c_or_f_flag, int buf_flags, int ndim, __Pyx_TypeInfo *dtype, __Pyx_BufFmt_StackElem stack[], __Pyx_memviewslice *memviewslice, PyObject *original_obj) { struct __pyx_memoryview_obj *memview, *new_memview; __Pyx_RefNannyDeclarations Py_buffer *buf; int i, spec = 0, retval = -1; __Pyx_BufFmt_Context ctx; int from_memoryview = __pyx_memoryview_check(original_obj); __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0); if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *) original_obj)->typeinfo)) { memview = (struct __pyx_memoryview_obj *) original_obj; new_memview = NULL; } else { memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new( original_obj, buf_flags, 0, dtype); new_memview = memview; if (unlikely(!memview)) goto fail; } buf = &memview->view; if (unlikely(buf->ndim != ndim)) { PyErr_Format(PyExc_ValueError, "Buffer has wrong number of dimensions (expected %d, got %d)", ndim, buf->ndim); goto fail; } if (new_memview) { __Pyx_BufFmt_Init(&ctx, stack, dtype); if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail; } if (unlikely((unsigned) buf->itemsize != dtype->size)) { PyErr_Format(PyExc_ValueError, "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)", buf->itemsize, (buf->itemsize > 1) ? "s" : "", dtype->name, dtype->size, (dtype->size > 1) ? "s" : ""); goto fail; } if (buf->len > 0) { for (i = 0; i < ndim; i++) { spec = axes_specs[i]; if (unlikely(!__pyx_check_strides(buf, i, ndim, spec))) goto fail; if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec))) goto fail; } if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))) goto fail; } if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice, new_memview != NULL) == -1)) { goto fail; } retval = 0; goto no_fail; fail: Py_XDECREF(new_memview); retval = -1; no_fail: __Pyx_RefNannyFinishContext(); return retval; } /* ObjectToMemviewSlice */ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(PyObject *obj, int writable_flag) { __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_BufFmt_StackElem stack[1]; int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) }; int retcode; if (obj == Py_None) { result.memview = (struct __pyx_memoryview_obj *) Py_None; return result; } retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0, PyBUF_RECORDS_RO | writable_flag, 1, &__Pyx_TypeInfo_nn_PetscInt, stack, &result, obj); if (unlikely(retcode == -1)) goto __pyx_fail; return result; __pyx_fail: result.memview = NULL; result.data = NULL; return result; } /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* FunctionExport */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { PyObject *d = 0; PyObject *cobj = 0; union { void (*fp)(void); void *p; } tmp; d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) goto bad; } tmp.fp = f; #if PY_VERSION_HEX >= 0x02070000 cobj = PyCapsule_New(tmp.p, sig, 0); #else cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); #endif if (!cobj) goto bad; if (PyDict_SetItemString(d, name, cobj) < 0) goto bad; Py_DECREF(cobj); Py_DECREF(d); return 0; bad: Py_XDECREF(cobj); Py_XDECREF(d); return -1; } /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ petsc4py-3.15.1/src/PETSc.py0000644000175000017500000000020213750315427015636 0ustar balaybalay00000000000000ARCH = None from petsc4py.lib import ImportPETSc PETSc = ImportPETSc(ARCH) PETSc._initialize() del PETSc del ImportPETSc del ARCH petsc4py-3.15.1/src/__init__.py0000644000175000017500000000506514062763234016473 0ustar balaybalay00000000000000# Author: Lisandro Dalcin # Contact: dalcinl@gmail.com # -------------------------------------------------------------------- """ PETSc for Python ================ This package is an interface to PETSc libraries. PETSc_ (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI_ standard for all message-passing communication. .. _PETSc: http://www.mcs.anl.gov/petsc .. _MPI: http://www.mpi-forum.org """ __author__ = 'Lisandro Dalcin' __version__ = '3.15.1' __credits__ = 'PETSc Team ' # -------------------------------------------------------------------- def init(args=None, arch=None, comm=None): """ Initialize PETSc. :Parameters: - `args`: command-line arguments, usually the 'sys.argv' list. - `arch`: specific configuration to use. - `comm`: MPI commmunicator .. note:: This function should be called only once, typically at the very beginning of the bootstrap script of an application. """ import petsc4py.lib PETSc = petsc4py.lib.ImportPETSc(arch) args = petsc4py.lib.getInitArgs(args) PETSc._initialize(args, comm) # -------------------------------------------------------------------- def get_include(): """ Return the directory in the package that contains header files. Extension modules that need to compile against petsc4py should use this function to locate the appropriate include directory. Using Python distutils (or perhaps NumPy distutils):: import petsc4py Extension('extension_name', ... include_dirs=[..., petsc4py.get_include()]) """ from os.path import dirname, join return join(dirname(__file__), 'include') # -------------------------------------------------------------------- def get_config(): """Return a dictionary with information about PETSc.""" import sys, os.path as p if sys.version_info[0] >= 3: from io import StringIO from configparser import ConfigParser else: from StringIO import StringIO from ConfigParser import ConfigParser filename = p.join(p.dirname(__file__), 'lib', 'petsc.cfg') with open(filename) as fp: stream = StringIO("[petsc]\n"+fp.read()) parser = ConfigParser() parser.optionxform = str parser.readfp(stream, filename) return dict(parser.items('petsc')) # -------------------------------------------------------------------- petsc4py-3.15.1/src/PETSc.c0000644000175000017500000000020513750315427015433 0ustar balaybalay00000000000000#define MPICH_SKIP_MPICXX 1 #define OMPI_SKIP_MPICXX 1 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include "petsc4py.PETSc.c" petsc4py-3.15.1/MANIFEST.in0000644000175000017500000000076013750315427015326 0ustar balaybalay00000000000000include setup*.py *.cfg *.rst recursive-include demo [M,m]akefile* *.py *.pyx *.i *.[hc] recursive-include demo .f2py_f2cmap *.pyf *.[fF]90 recursive-include conf *.py *.cfg recursive-include src *.py *.pyx *.px[di] *.h *.c *.i *.cfg recursive-include test *.py recursive-include * [M,m]akefile include docs/*.html include docs/*.pdf include docs/*.info include docs/*.[137] include docs/*.rst recursive-include docs/usrman * recursive-include docs/apiref * recursive-include docs/source * petsc4py-3.15.1/PKG-INFO0000644000175000017500000000407214062764472014672 0ustar balaybalay00000000000000Metadata-Version: 1.2 Name: petsc4py Version: 3.15.1 Summary: PETSc for Python Home-page: https://gitlab.com/petsc/petsc Author: Lisandro Dalcin Author-email: dalcinl@gmail.com Maintainer: Lisandro Dalcin Maintainer-email: dalcinl@gmail.com License: BSD Download-URL: https://pypi.io/packages/source/p/petsc4py/petsc4py-3.15.1.tar.gz Description: PETSc for Python ================ Python bindings for PETSc. Citations --------- If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project. * L. Dalcin, P. Kler, R. Paz, and A. Cosimo, *Parallel Distributed Computing using Python*, Advances in Water Resources, 34(9):1124-1139, 2011. http://dx.doi.org/10.1016/j.advwatres.2011.04.013 * S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, *PETSc Users Manual*, ANL-95/11 - Revision 3.15, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf Keywords: scientific computing,parallel computing,PETSc,MPI Platform: POSIX Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: POSIX Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research Classifier: Programming Language :: C Classifier: Programming Language :: C++ Classifier: Programming Language :: Cython Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Scientific/Engineering Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Development Status :: 5 - Production/Stable Requires: numpy Provides: petsc4py petsc4py-3.15.1/petsc4py.egg-info/0000755000175000017500000000000014062764472017037 5ustar balaybalay00000000000000petsc4py-3.15.1/petsc4py.egg-info/top_level.txt0000644000175000017500000000001114062764472021561 0ustar balaybalay00000000000000petsc4py petsc4py-3.15.1/petsc4py.egg-info/SOURCES.txt0000644000175000017500000004116614062764472020733 0ustar balaybalay00000000000000CHANGES.rst DESCRIPTION.rst LICENSE.rst MANIFEST.in README.rst setup.cfg setup.py conf/__init__.py conf/baseconf.py conf/cythonize.py conf/epydoc.cfg conf/epydocify.py conf/metadata.py conf/petscconf.py demo/makefile demo/binary-io/makefile demo/binary-io/matvecio.py demo/bratu2d/bratu2d.py demo/bratu2d/bratu2df90.f90 demo/bratu2d/bratu2dnpy.py demo/bratu2d/makefile demo/bratu3d/bratu3d.py demo/bratu3d/makefile demo/dmplex/adaptivity.py demo/dmplex/distribute_field.py demo/kspsolve/makefile demo/kspsolve/petsc-cg.py demo/kspsolve/petsc-ksp.py demo/kspsolve/petsc-mat.py demo/kspsolve/test_mat_cg.py demo/kspsolve/test_mat_ksp.py demo/ode/bouncing_ball.py demo/ode/ce.py demo/ode/heat.py demo/ode/orego.py demo/ode/rober.py demo/ode/vanderpol.py demo/perftest/App.f90 demo/perftest/App.pyf demo/perftest/driver.c demo/perftest/driver.py demo/perftest/makefile demo/perftest/makefile.f2py demo/perftest/makefile.petsc demo/petsc-examples/makefile demo/petsc-examples/ksp/ex2.py demo/petsc-examples/ksp/ex23.py demo/petsc-examples/ksp/makefile demo/poisson2d/makefile demo/poisson2d/poisson2d.py demo/poisson3d/del2lib.f90 demo/poisson3d/del2mat.h demo/poisson3d/del2mat.py demo/poisson3d/makefile demo/poisson3d/makefile.petsc demo/poisson3d/poisson3d.c demo/poisson3d/poisson3d.py demo/taosolve/chwirut.py demo/taosolve/rosenbrock.py demo/wrap-cython/Bratu3D.pyx demo/wrap-cython/Bratu3Dimpl.c demo/wrap-cython/Bratu3Dimpl.h demo/wrap-cython/makefile demo/wrap-cython/run_demo.py demo/wrap-cython/setup.py demo/wrap-f2py/.f2py_f2cmap demo/wrap-f2py/Bratu2D.F90 demo/wrap-f2py/Bratu2D.pyf demo/wrap-f2py/Bratu2Dmodule.h demo/wrap-f2py/makefile demo/wrap-f2py/run_demo.py demo/wrap-f2py/setup.py demo/wrap-swig/Bratu3D.c demo/wrap-swig/Bratu3D.h demo/wrap-swig/Bratu3D.i demo/wrap-swig/makefile demo/wrap-swig/run_demo.py demo/wrap-swig/setup.py docs/CHANGES.html docs/LICENSE.html docs/index.html docs/index.rst docs/petsc4py.1 docs/petsc4py.info docs/petsc4py.pdf docs/apiref/api-objects.txt docs/apiref/class-tree.html docs/apiref/class_hierarchy_for__dmcomposi.png docs/apiref/class_hierarchy_for__dmda_vec_.png docs/apiref/class_hierarchy_for__is_buffer.png docs/apiref/class_hierarchy_for__mat_stenc.png docs/apiref/class_hierarchy_for__vec_buffe.png docs/apiref/class_hierarchy_for__vec_local.png docs/apiref/class_hierarchy_for_ao.png docs/apiref/class_hierarchy_for_arkimextyp.png docs/apiref/class_hierarchy_for_asmtype.png docs/apiref/class_hierarchy_for_assemblyty.png docs/apiref/class_hierarchy_for_boundaryty.png docs/apiref/class_hierarchy_for_collecttyp.png docs/apiref/class_hierarchy_for_comm.png docs/apiref/class_hierarchy_for_compositet.png docs/apiref/class_hierarchy_for_convergedr.png docs/apiref/class_hierarchy_for_convergedr_2.png docs/apiref/class_hierarchy_for_convergedr_3.png docs/apiref/class_hierarchy_for_dm.png docs/apiref/class_hierarchy_for_dmcomposit.png docs/apiref/class_hierarchy_for_dmda.png docs/apiref/class_hierarchy_for_dmlabel.png docs/apiref/class_hierarchy_for_dmplex.png docs/apiref/class_hierarchy_for_dmshell.png docs/apiref/class_hierarchy_for_dmstag.png docs/apiref/class_hierarchy_for_dmswarm.png docs/apiref/class_hierarchy_for_ds.png docs/apiref/class_hierarchy_for_elementtyp.png docs/apiref/class_hierarchy_for_equationty.png docs/apiref/class_hierarchy_for_error.png docs/apiref/class_hierarchy_for_exactfinal.png docs/apiref/class_hierarchy_for_factorshif.png docs/apiref/class_hierarchy_for_fe.png docs/apiref/class_hierarchy_for_format.png docs/apiref/class_hierarchy_for_gamgtype.png docs/apiref/class_hierarchy_for_gasmtype.png docs/apiref/class_hierarchy_for_infotype.png docs/apiref/class_hierarchy_for_insertmode.png docs/apiref/class_hierarchy_for_interpolat.png docs/apiref/class_hierarchy_for_is.png docs/apiref/class_hierarchy_for_ksp.png docs/apiref/class_hierarchy_for_lgmap.png docs/apiref/class_hierarchy_for_log.png docs/apiref/class_hierarchy_for_logclass.png docs/apiref/class_hierarchy_for_logevent.png docs/apiref/class_hierarchy_for_logstage.png docs/apiref/class_hierarchy_for_mapmode.png docs/apiref/class_hierarchy_for_mat.png docs/apiref/class_hierarchy_for_mgcycletyp.png docs/apiref/class_hierarchy_for_mgtype.png docs/apiref/class_hierarchy_for_migratetyp.png docs/apiref/class_hierarchy_for_mode.png docs/apiref/class_hierarchy_for_normschedu.png docs/apiref/class_hierarchy_for_normtype.png docs/apiref/class_hierarchy_for_normtype_2.png docs/apiref/class_hierarchy_for_nullspace.png docs/apiref/class_hierarchy_for_object.png docs/apiref/class_hierarchy_for_option.png docs/apiref/class_hierarchy_for_option_2.png docs/apiref/class_hierarchy_for_options.png docs/apiref/class_hierarchy_for_orderingty.png docs/apiref/class_hierarchy_for_partitione.png docs/apiref/class_hierarchy_for_partitione_2.png docs/apiref/class_hierarchy_for_patchconst.png docs/apiref/class_hierarchy_for_pc.png docs/apiref/class_hierarchy_for_piclayoutt.png docs/apiref/class_hierarchy_for_problemtyp.png docs/apiref/class_hierarchy_for_quad.png docs/apiref/class_hierarchy_for_random.png docs/apiref/class_hierarchy_for_rktype.png docs/apiref/class_hierarchy_for_scatter.png docs/apiref/class_hierarchy_for_scattermod.png docs/apiref/class_hierarchy_for_schurfactt.png docs/apiref/class_hierarchy_for_schurprety.png docs/apiref/class_hierarchy_for_section.png docs/apiref/class_hierarchy_for_sf.png docs/apiref/class_hierarchy_for_side.png docs/apiref/class_hierarchy_for_size.png docs/apiref/class_hierarchy_for_snes.png docs/apiref/class_hierarchy_for_solvertype.png docs/apiref/class_hierarchy_for_sortype.png docs/apiref/class_hierarchy_for_stencilloc.png docs/apiref/class_hierarchy_for_stenciltyp.png docs/apiref/class_hierarchy_for_stenciltyp_2.png docs/apiref/class_hierarchy_for_structure.png docs/apiref/class_hierarchy_for_sys.png docs/apiref/class_hierarchy_for_tao.png docs/apiref/class_hierarchy_for_ts.png docs/apiref/class_hierarchy_for_type.png docs/apiref/class_hierarchy_for_type_10.png docs/apiref/class_hierarchy_for_type_11.png docs/apiref/class_hierarchy_for_type_12.png docs/apiref/class_hierarchy_for_type_13.png docs/apiref/class_hierarchy_for_type_14.png docs/apiref/class_hierarchy_for_type_15.png docs/apiref/class_hierarchy_for_type_16.png docs/apiref/class_hierarchy_for_type_17.png docs/apiref/class_hierarchy_for_type_2.png docs/apiref/class_hierarchy_for_type_3.png docs/apiref/class_hierarchy_for_type_4.png docs/apiref/class_hierarchy_for_type_5.png docs/apiref/class_hierarchy_for_type_6.png docs/apiref/class_hierarchy_for_type_7.png docs/apiref/class_hierarchy_for_type_8.png docs/apiref/class_hierarchy_for_type_9.png docs/apiref/class_hierarchy_for_vec.png docs/apiref/class_hierarchy_for_viewer.png docs/apiref/class_hierarchy_for_viewerhdf5.png docs/apiref/crarr.png docs/apiref/epydoc.css docs/apiref/epydoc.js docs/apiref/frames.html docs/apiref/help.html docs/apiref/identifier-index.html docs/apiref/index.html docs/apiref/module-tree.html docs/apiref/petsc4py-module.html docs/apiref/petsc4py.PETSc-module.html docs/apiref/petsc4py.PETSc.AO-class.html docs/apiref/petsc4py.PETSc.AO.Type-class.html docs/apiref/petsc4py.PETSc.Comm-class.html docs/apiref/petsc4py.PETSc.DM-class.html docs/apiref/petsc4py.PETSc.DM.BoundaryType-class.html docs/apiref/petsc4py.PETSc.DM.Type-class.html docs/apiref/petsc4py.PETSc.DMComposite-class.html docs/apiref/petsc4py.PETSc.DMDA-class.html docs/apiref/petsc4py.PETSc.DMDA.ElementType-class.html docs/apiref/petsc4py.PETSc.DMDA.InterpolationType-class.html docs/apiref/petsc4py.PETSc.DMDA.StencilType-class.html docs/apiref/petsc4py.PETSc.DMLabel-class.html docs/apiref/petsc4py.PETSc.DMPlex-class.html docs/apiref/petsc4py.PETSc.DMShell-class.html docs/apiref/petsc4py.PETSc.DMStag-class.html docs/apiref/petsc4py.PETSc.DMStag.StencilLocation-class.html docs/apiref/petsc4py.PETSc.DMStag.StencilType-class.html docs/apiref/petsc4py.PETSc.DMSwarm-class.html docs/apiref/petsc4py.PETSc.DMSwarm.CollectType-class.html docs/apiref/petsc4py.PETSc.DMSwarm.MigrateType-class.html docs/apiref/petsc4py.PETSc.DMSwarm.PICLayoutType-class.html docs/apiref/petsc4py.PETSc.DMSwarm.Type-class.html docs/apiref/petsc4py.PETSc.DS-class.html docs/apiref/petsc4py.PETSc.DS.Type-class.html docs/apiref/petsc4py.PETSc.Error-class.html docs/apiref/petsc4py.PETSc.FE-class.html docs/apiref/petsc4py.PETSc.FE.Type-class.html docs/apiref/petsc4py.PETSc.IS-class.html docs/apiref/petsc4py.PETSc.IS.Type-class.html docs/apiref/petsc4py.PETSc.InsertMode-class.html docs/apiref/petsc4py.PETSc.KSP-class.html docs/apiref/petsc4py.PETSc.KSP.ConvergedReason-class.html docs/apiref/petsc4py.PETSc.KSP.NormType-class.html docs/apiref/petsc4py.PETSc.KSP.Type-class.html docs/apiref/petsc4py.PETSc.LGMap-class.html docs/apiref/petsc4py.PETSc.LGMap.MapMode-class.html docs/apiref/petsc4py.PETSc.LGMap.Type-class.html docs/apiref/petsc4py.PETSc.Log-class.html docs/apiref/petsc4py.PETSc.LogClass-class.html docs/apiref/petsc4py.PETSc.LogEvent-class.html docs/apiref/petsc4py.PETSc.LogStage-class.html docs/apiref/petsc4py.PETSc.Mat-class.html docs/apiref/petsc4py.PETSc.Mat.AssemblyType-class.html docs/apiref/petsc4py.PETSc.Mat.FactorShiftType-class.html docs/apiref/petsc4py.PETSc.Mat.InfoType-class.html docs/apiref/petsc4py.PETSc.Mat.Option-class.html docs/apiref/petsc4py.PETSc.Mat.OrderingType-class.html docs/apiref/petsc4py.PETSc.Mat.SORType-class.html docs/apiref/petsc4py.PETSc.Mat.SolverType-class.html docs/apiref/petsc4py.PETSc.Mat.Structure-class.html docs/apiref/petsc4py.PETSc.Mat.Type-class.html docs/apiref/petsc4py.PETSc.NormType-class.html docs/apiref/petsc4py.PETSc.NullSpace-class.html docs/apiref/petsc4py.PETSc.Object-class.html docs/apiref/petsc4py.PETSc.Options-class.html docs/apiref/petsc4py.PETSc.PC-class.html docs/apiref/petsc4py.PETSc.PC.ASMType-class.html docs/apiref/petsc4py.PETSc.PC.CompositeType-class.html docs/apiref/petsc4py.PETSc.PC.GAMGType-class.html docs/apiref/petsc4py.PETSc.PC.GASMType-class.html docs/apiref/petsc4py.PETSc.PC.MGCycleType-class.html docs/apiref/petsc4py.PETSc.PC.MGType-class.html docs/apiref/petsc4py.PETSc.PC.PatchConstructType-class.html docs/apiref/petsc4py.PETSc.PC.SchurFactType-class.html docs/apiref/petsc4py.PETSc.PC.SchurPreType-class.html docs/apiref/petsc4py.PETSc.PC.Side-class.html docs/apiref/petsc4py.PETSc.PC.Type-class.html docs/apiref/petsc4py.PETSc.Partitioner-class.html docs/apiref/petsc4py.PETSc.PartitionerType-class.html docs/apiref/petsc4py.PETSc.Quad-class.html docs/apiref/petsc4py.PETSc.Random-class.html docs/apiref/petsc4py.PETSc.Random.Type-class.html docs/apiref/petsc4py.PETSc.SF-class.html docs/apiref/petsc4py.PETSc.SF.Type-class.html docs/apiref/petsc4py.PETSc.SNES-class.html docs/apiref/petsc4py.PETSc.SNES.ConvergedReason-class.html docs/apiref/petsc4py.PETSc.SNES.NormSchedule-class.html docs/apiref/petsc4py.PETSc.SNES.Type-class.html docs/apiref/petsc4py.PETSc.Scatter-class.html docs/apiref/petsc4py.PETSc.Scatter.Type-class.html docs/apiref/petsc4py.PETSc.ScatterMode-class.html docs/apiref/petsc4py.PETSc.Section-class.html docs/apiref/petsc4py.PETSc.Sys-class.html docs/apiref/petsc4py.PETSc.TAO-class.html docs/apiref/petsc4py.PETSc.TAO.Reason-class.html docs/apiref/petsc4py.PETSc.TAO.Type-class.html docs/apiref/petsc4py.PETSc.TS-class.html docs/apiref/petsc4py.PETSc.TS.ARKIMEXType-class.html docs/apiref/petsc4py.PETSc.TS.ConvergedReason-class.html docs/apiref/petsc4py.PETSc.TS.EquationType-class.html docs/apiref/petsc4py.PETSc.TS.ExactFinalTime-class.html docs/apiref/petsc4py.PETSc.TS.ProblemType-class.html docs/apiref/petsc4py.PETSc.TS.RKType-class.html docs/apiref/petsc4py.PETSc.TS.Type-class.html docs/apiref/petsc4py.PETSc.Vec-class.html docs/apiref/petsc4py.PETSc.Vec.Option-class.html docs/apiref/petsc4py.PETSc.Vec.Type-class.html docs/apiref/petsc4py.PETSc.Viewer-class.html docs/apiref/petsc4py.PETSc.Viewer.Format-class.html docs/apiref/petsc4py.PETSc.Viewer.Mode-class.html docs/apiref/petsc4py.PETSc.Viewer.Size-class.html docs/apiref/petsc4py.PETSc.Viewer.Type-class.html docs/apiref/petsc4py.PETSc.ViewerHDF5-class.html docs/apiref/petsc4py.PETSc._DMComposite_access-class.html docs/apiref/petsc4py.PETSc._DMDA_Vec_array-class.html docs/apiref/petsc4py.PETSc._IS_buffer-class.html docs/apiref/petsc4py.PETSc._Mat_Stencil-class.html docs/apiref/petsc4py.PETSc._Vec_LocalForm-class.html docs/apiref/petsc4py.PETSc._Vec_buffer-class.html docs/apiref/petsc4py.lib-module.html docs/apiref/redirect.html docs/apiref/toc-everything.html docs/apiref/toc-petsc4py-module.html docs/apiref/toc-petsc4py.PETSc-module.html docs/apiref/toc-petsc4py.lib-module.html docs/apiref/toc.html docs/source/Makefile docs/source/abstract.txt docs/source/citing.rst docs/source/conf.py docs/source/index.rst docs/source/install.rst docs/source/links.txt docs/source/make.bat docs/source/manual.rst docs/source/overview.rst docs/source/toctree.txt docs/source/tutorial.rst docs/usrman/citing.html docs/usrman/genindex.html docs/usrman/index.html docs/usrman/install.html docs/usrman/manual.html docs/usrman/objects.inv docs/usrman/overview.html docs/usrman/search.html docs/usrman/searchindex.js docs/usrman/tutorial.html docs/usrman/_sources/citing.rst.txt docs/usrman/_sources/index.rst.txt docs/usrman/_sources/install.rst.txt docs/usrman/_sources/manual.rst.txt docs/usrman/_sources/overview.rst.txt docs/usrman/_sources/tutorial.rst.txt docs/usrman/_static/basic.css docs/usrman/_static/classic.css docs/usrman/_static/default.css docs/usrman/_static/doctools.js docs/usrman/_static/documentation_options.js docs/usrman/_static/file.png docs/usrman/_static/jquery-3.5.1.js docs/usrman/_static/jquery.js docs/usrman/_static/language_data.js docs/usrman/_static/minus.png docs/usrman/_static/plus.png docs/usrman/_static/pygments.css docs/usrman/_static/searchtools.js docs/usrman/_static/sidebar.js docs/usrman/_static/underscore-1.12.0.js docs/usrman/_static/underscore.js petsc4py.egg-info/PKG-INFO petsc4py.egg-info/SOURCES.txt petsc4py.egg-info/dependency_links.txt petsc4py.egg-info/not-zip-safe petsc4py.egg-info/requires.txt petsc4py.egg-info/top_level.txt src/PETSc.c src/PETSc.pxd src/PETSc.py src/__init__.py src/__main__.py src/libpetsc4py.c src/libpetsc4py.h src/petsc4py.PETSc.c src/petsc4py.PETSc.pyx src/PETSc/AO.pyx src/PETSc/CAPI.pyx src/PETSc/Comm.pyx src/PETSc/Const.pyx src/PETSc/DM.pyx src/PETSc/DMComposite.pyx src/PETSc/DMDA.pyx src/PETSc/DMLabel.pyx src/PETSc/DMPlex.pyx src/PETSc/DMShell.pyx src/PETSc/DMStag.pyx src/PETSc/DMSwarm.pyx src/PETSc/DS.pyx src/PETSc/DT.pyx src/PETSc/Error.pyx src/PETSc/FE.pyx src/PETSc/IS.pyx src/PETSc/KSP.pyx src/PETSc/Log.pyx src/PETSc/Mat.pyx src/PETSc/Object.pyx src/PETSc/Options.pyx src/PETSc/PC.pyx src/PETSc/PETSc.pyx src/PETSc/Partitioner.pyx src/PETSc/Random.pyx src/PETSc/SF.pyx src/PETSc/SNES.pyx src/PETSc/Scatter.pyx src/PETSc/Section.pyx src/PETSc/Sys.pyx src/PETSc/TAO.pyx src/PETSc/TS.pyx src/PETSc/Vec.pyx src/PETSc/Viewer.pyx src/PETSc/cyclicgc.pxi src/PETSc/petscao.pxi src/PETSc/petscdef.pxi src/PETSc/petscdm.pxi src/PETSc/petscdmcomposite.pxi src/PETSc/petscdmda.pxi src/PETSc/petscdmlabel.pxi src/PETSc/petscdmplex.pxi src/PETSc/petscdmshell.pxi src/PETSc/petscdmstag.pxi src/PETSc/petscdmswarm.pxi src/PETSc/petscds.pxi src/PETSc/petscdt.pxi src/PETSc/petscfe.pxi src/PETSc/petscis.pxi src/PETSc/petscksp.pxi src/PETSc/petsclog.pxi src/PETSc/petscmat.pxi src/PETSc/petscmem.pxi src/PETSc/petscmpi.pxi src/PETSc/petscobj.pxi src/PETSc/petscopt.pxi src/PETSc/petscpartitioner.pxi src/PETSc/petscpc.pxi src/PETSc/petscrand.pxi src/PETSc/petscsct.pxi src/PETSc/petscsec.pxi src/PETSc/petscsf.pxi src/PETSc/petscsnes.pxi src/PETSc/petscsys.pxi src/PETSc/petsctao.pxi src/PETSc/petscts.pxi src/PETSc/petscvec.pxi src/PETSc/petscvwr.pxi src/include/arraynpy.pxi src/include/compat.h src/include/custom.h src/include/cython.h src/include/initpkg.h src/include/pep3118.h src/include/scalar.h src/include/compat/cuda.h src/include/compat/hdf5.h src/include/compat/hypre.h src/include/compat/mpi.h src/include/compat/mumps.h src/include/compat/tao.h src/include/compat/viennacl.h src/include/petsc4py/PETSc.pxd src/include/petsc4py/__init__.pxd src/include/petsc4py/__init__.pyx src/include/petsc4py/numpy.h src/include/petsc4py/petsc4py.PETSc.h src/include/petsc4py/petsc4py.PETSc_api.h src/include/petsc4py/petsc4py.h src/include/petsc4py/petsc4py.i src/lib/__init__.py src/lib/petsc.cfg src/libpetsc4py/custom.h src/libpetsc4py/libpetsc4py.c src/libpetsc4py/libpetsc4py.h src/libpetsc4py/libpetsc4py.pyx test/runtests.py test/test_comm.py test/test_dmda.py test/test_dmplex.py test/test_dmshell.py test/test_dmstag.py test/test_gc.py test/test_is.py test/test_ksp.py test/test_ksp_py.py test/test_lgmap.py test/test_log.py test/test_mat_aij.py test/test_mat_dense.py test/test_mat_fact.py test/test_mat_py.py test/test_nsp.py test/test_object.py test/test_optdb.py test/test_pc_py.py test/test_snes.py test/test_snes_py.py test/test_sys.py test/test_tao.py test/test_ts.py test/test_ts_py.py test/test_vec.pypetsc4py-3.15.1/petsc4py.egg-info/not-zip-safe0000644000175000017500000000000114062764472021265 0ustar balaybalay00000000000000 petsc4py-3.15.1/petsc4py.egg-info/requires.txt0000644000175000017500000000000614062764472021433 0ustar balaybalay00000000000000numpy petsc4py-3.15.1/petsc4py.egg-info/PKG-INFO0000644000175000017500000000407214062764472020137 0ustar balaybalay00000000000000Metadata-Version: 1.2 Name: petsc4py Version: 3.15.1 Summary: PETSc for Python Home-page: https://gitlab.com/petsc/petsc Author: Lisandro Dalcin Author-email: dalcinl@gmail.com Maintainer: Lisandro Dalcin Maintainer-email: dalcinl@gmail.com License: BSD Download-URL: https://pypi.io/packages/source/p/petsc4py/petsc4py-3.15.1.tar.gz Description: PETSc for Python ================ Python bindings for PETSc. Citations --------- If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project. * L. Dalcin, P. Kler, R. Paz, and A. Cosimo, *Parallel Distributed Computing using Python*, Advances in Water Resources, 34(9):1124-1139, 2011. http://dx.doi.org/10.1016/j.advwatres.2011.04.013 * S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, *PETSc Users Manual*, ANL-95/11 - Revision 3.15, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf Keywords: scientific computing,parallel computing,PETSc,MPI Platform: POSIX Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: POSIX Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Science/Research Classifier: Programming Language :: C Classifier: Programming Language :: C++ Classifier: Programming Language :: Cython Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Topic :: Scientific/Engineering Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Development Status :: 5 - Production/Stable Requires: numpy Provides: petsc4py petsc4py-3.15.1/petsc4py.egg-info/dependency_links.txt0000644000175000017500000000000114062764472023105 0ustar balaybalay00000000000000 petsc4py-3.15.1/DESCRIPTION.rst0000644000175000017500000000146714062763234016112 0ustar balaybalay00000000000000PETSc for Python ================ Python bindings for PETSc. Citations --------- If PETSc for Python been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project. * L. Dalcin, P. Kler, R. Paz, and A. Cosimo, *Parallel Distributed Computing using Python*, Advances in Water Resources, 34(9):1124-1139, 2011. http://dx.doi.org/10.1016/j.advwatres.2011.04.013 * S. Balay, S. Abhyankar, M. Adams, J. Brown, P. Brune, K. Buschelman, L. Dalcin, A. Dener, V. Eijkhout, W. Gropp, D. Karpeyev, D. Kaushik, M. Knepley, D. May, L. Curfman McInnes, R. Mills, T. Munson, K. Rupp, P. Sanan, B. Smith, S. Zampini, H. Zhang, and H. Zhang, *PETSc Users Manual*, ANL-95/11 - Revision 3.15, 2021. http://www.mcs.anl.gov/petsc/petsc-current/docs/manual.pdf petsc4py-3.15.1/CHANGES.rst0000644000175000017500000001333114030740317015360 0ustar balaybalay00000000000000========================= CHANGES: PETSc for Python ========================= :Author: Lisandro Dalcin :Contact: dalcinl@gmail.com Release 3.15.0 ============== - Update to PETSc 3.15 release. Release 3.14.1 ============== - Fix build issues after changes in recent PETSc patch releases. - Add various missing types and enums definitions. - Update Cython build, require ``Cython >= 0.24``. Release 3.14.0 ============== - Update to PETSc 3.14 release. Release 3.13.0 ============== - Update to PETSc 3.13 release. Release 3.12.0 ============== - Update to PETSc 3.12 release. Release 3.11.0 ============== - Update to PETSc 3.11 release. Release 3.10.1 ============== - Fix for removal of ``SNESTEST``. - Fix ``Mat`` in-place divide. Release 3.10.0 ============== - Update to PETSc 3.10 release. Release 3.9.1 ============= - Add ``Mat.zeroRowsColumnsLocal()``. - Add ``Mat.getISLocalMat()``. - Add ``Mat.convertISToAIJ()``. Release 3.9.0 ============= - Update to PETSc 3.9 release. Release 3.8.0 ============= - Update to PETSc 3.8 release. Release 3.7.0 ============= - Update to PETSc 3.7 release. Release 3.6.0 ============= - Update to PETSc 3.6 release. Release 3.5.1 ============= - Add ``Log.{begin|view|destroy}()``. - Add ``Mat.SOR()`` and ``Mat.SORType``. - Add ``DMPlex.createCoarsePointIS()``. - Add ``LGMap.createSF()``. - Add ``SNES.getVIInactiveSet()``. - Add ``Vec.isaxpy()``. - Add ``PC.setReusePreconditioner()``. - Return correct type in ``DM.getCoordinateDM()``. - Fix SWIG wrappers to handle 64bit ``PetscInt``. - Fix linker flags for Python from Fink. Release 3.5 =========== - Update to PETSc 3.5 release. Release 3.4 =========== - Update to PETSc 3.4 release. - Add support for ``DMComposite`` and ``DMPlex``. - Change ``Mat.getSizes()`` to return ``((m,M),(n,N))``. Release 3.3.1 ============= - Fix ``Options.getAll()`` mishandling values with negative numbers. - Minor backward compatibility fix for PETSc 3.2 . - Minor bugfix for TSPYTHON subtype. Release 3.3 =========== - Update to PETSc 3.3 release. - Change ``Vec.getLocalForm()`` to ``Vec.localForm()`` for use with context manager and add ``Vec.setMPIGhost()``. - Add ``AO.createMemoryScalable()`` and ``LGMap.block()`` / ``LGMap.unblock()`` - Add ``Object.handle`` property (C pointer as a Python integer). Can be used with ``ctypes`` to pass a PETSc handle. - Add ``Comm.tompi4py()`` to get a ``mpi4py`` communicator instance. Release 1.2 =========== - Update to PETSc 3.2 release. - Add new ``DM`` class , make ``DA`` inherit from ``DM``. - Better support for inplace LU/ILU and Cholesky/ICC factorization and factor PC subtypes. - Now the ``Mat``/``PC``/``KSP``/``SNES``/``TS`` Python subtypes are implemented with Cython. - Better interaction between Python garbage collector and PETSc objects. - Support for PEP 3118 and legacy Python's buffer interface. Release 1.1.2 ============= This is a new-features and bug-fix release. - Add support for copying and computing complements in ``IS`` (``IS.copy()`` and ``IS.complement()``). - Add support for coarsening in ``DA`` (``DA.coarsen()``). - Support for shallow copy and deep copy operations (use ``copy.copy`` and ``copy.deepcopy``). Deep copy is only supported for a bunch of types (``IS``, ``Scatter``, ``Vec``, ``Mat``) - Support for ``pip install petsc4py`` to download and install PETSc. Release 1.1.1 ============= This is a new-features and bug-fix release. - Support for setting PETSC_COMM_WORLD before PETSc initialization. - Support for coordinates, refinement and interpolation in DA. Many thanks to Blaise Bourdin. - Workaround build failures when PETSc is built with *mpiuni*. - Workaround GIL-related APIs for non-threaded Python builds. Release 1.1 =========== - Update for API cleanups, changes, and new calls in PETSc 3.1 and some other missing features. - Add support for Jed Brown's THETA an GL timestepper implementations. - Fix the annoying issues related to Open MPI shared libraries dependencies and Python dynamic loading. - Many minor bug-fixes. Many thanks to Ethan Coon, Dmitry Karpeev, Juha Jaykka, and Michele De Stefano. Release 1.0.3 ============= This is a bug-fix release. - Added a quick fix to solve build issues. The macro __SDIR__ is no longer passed to the compiler in the command line. Release 1.0.2 ============= This is a new-features and bug-fix release. - Now ``petsc4py`` works against core PETSc built with complex scalars. - Added support for PETSc logging features like stages, classes and events. Stages and events support the context manager interface (``with`` statement). - Documentation generated with Epydoc and Sphinx is now included in the release tarball. - Removed enumeration-like classes from the ``petsc4py.PETSc`` module namespace. For example, now you have to use ``PETSc.KSP.Type`` instead of ``PETSc.KSPType``. - The ``PETSc.IS`` to ``numpy.ndarray`` conversion now works for stride and block index sets. - Implemented a more robust import machinery for multi-arch ``petsc4py`` installations. Now a wrong value in the ``PETSC_ARCH`` environmental variable emit a warning (instead of failing) at import time. - The unittest-based testsuite now can run under ``nose`` with its default options. - Removed the dependency on ``numpy.distutils``, just use core Python ``distutils``. Release 1.0.1 ============= This is a bug-fix release. Compile Cython-generated C sources with ``-Wwrite-strings`` removed, as this flag (inherited from PETSc) made GCC emit a lot of (harmless but annoying) warnings about conversion of string literals to non-const char pointers. Release 1.0.0 ============= This is the fist release of the all-new, Cython-based, implementation of *PETSc for Python*. petsc4py-3.15.1/conf/0000755000175000017500000000000014062764472014517 5ustar balaybalay00000000000000petsc4py-3.15.1/conf/cythonize.py0000755000175000017500000000470213776460567017124 0ustar balaybalay00000000000000#!/usr/bin/env python import sys, os def cythonize(source, output=None, includes=(), destdir_c=None, destdir_h=None, wdir=None): from Cython.Compiler.Main import \ CompilationOptions, default_options, \ compile, \ PyrexError from Cython.Compiler import Options cwd = os.getcwd() try: if output is None: name, _ = os.path.splitext(source) output = name + '.c' else: name, _ = os.path.splitext(output) outputs_c = [output] outputs_h = [name + '.h', name + '_api.h'] # change working directory if wdir: os.chdir(wdir) # run Cython on source options = CompilationOptions(default_options) if Options.directive_types['language_level'] is str: options.language_level = '3str' options.output_file = outputs_c[0] options.include_path = list(includes) Options.generate_cleanup_code = 3 any_failures = 0 try: result = compile(source, options) if result.num_errors > 0: any_failures = 1 except (EnvironmentError, PyrexError): e = sys.exc_info()[1] sys.stderr.write(str(e) + '\n') any_failures = 1 if any_failures: for output in outputs_c + outputs_h: try: os.remove(output) except OSError: pass return 1 # move ouputs for destdir, outputs in ( (destdir_c, outputs_c), (destdir_h, outputs_h)): if destdir is None: continue for output in outputs: dest = os.path.join( destdir, os.path.basename(output)) try: os.remove(dest) except OSError: pass os.rename(output, dest) # return 0 # finally: os.chdir(cwd) if __name__ == "__main__": sys.exit( cythonize('petsc4py.PETSc.pyx', 'petsc4py.PETSc.c', includes=['include'], destdir_h=os.path.join('include', 'petsc4py'), wdir='src') or cythonize(os.path.join('libpetsc4py', 'libpetsc4py.pyx'), includes=['include'], wdir='src') ) petsc4py-3.15.1/conf/petscconf.py0000644000175000017500000000113313750315427017046 0ustar balaybalay00000000000000# -------------------------------------------------------------------- __all__ = ['setup', 'Extension', 'config', 'build', 'build_src', 'build_ext', 'install', 'clean', 'test', 'sdist', ] # -------------------------------------------------------------------- from conf.baseconf import setup, Extension from conf.baseconf import config, build, build_src, build_ext, install from conf.baseconf import clean, test, sdist # -------------------------------------------------------------------- petsc4py-3.15.1/conf/metadata.py0000644000175000017500000000160613750315427016647 0ustar balaybalay00000000000000classifiers = """ License :: OSI Approved :: BSD License Operating System :: POSIX Intended Audience :: Developers Intended Audience :: Science/Research Programming Language :: C Programming Language :: C++ Programming Language :: Cython Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 3 Topic :: Scientific/Engineering Topic :: Software Development :: Libraries :: Python Modules """ keywords = """ scientific computing parallel computing """ metadata = { 'author' : 'Lisandro Dalcin', 'author_email' : 'dalcinl@gmail.com', 'classifiers' : [c for c in classifiers.split('\n') if c], 'keywords' : [k for k in keywords.split('\n') if k], 'license' : 'BSD', 'platforms' : ['POSIX'], 'maintainer' : 'Lisandro Dalcin', 'maintainer_email' : 'dalcinl@gmail.com', } petsc4py-3.15.1/conf/epydoc.cfg0000644000175000017500000001055114030740317016450 0ustar balaybalay00000000000000[epydoc] # Epydoc section marker (required by ConfigParser) # The list of objects to document. Objects can be named using # dotted names, module filenames, or package directory names. # Alases for this option include "objects" and "values". modules: petsc4py # The type of output that should be generated. Should be one # of: html, text, latex, dvi, ps, pdf. #output: html # The path to the output directory. May be relative or absolute. #target: docs/html/ # An integer indicating how verbose epydoc should be. The default # value is 0; negative values will supress warnings and errors; # positive values will give more verbose output. verbosity: 0 # A boolean value indicating that Epydoc should show a tracaback # in case of unexpected error. By default don't show tracebacks #debug: 0 # If True, don't try to use colors or cursor control when doing # textual output. The default False assumes a rich text prompt #simple-term: 0 ### Generation options # The default markup language for docstrings, for modules that do # not define __docformat__. Defaults to epytext. docformat: reStructuredText # Whether or not parsing should be used to examine objects. parse: yes # Whether or not introspection should be used to examine objects. introspect: yes # Don't examine in any way the modules whose dotted name match this # regular expression pattern. exclude: petsc4py.__main__ # Don't perform introspection on the modules whose dotted name match this # regular expression pattern. #exclude-introspect # Don't perform parsing on the modules whose dotted name match this # regular expression pattern. #exclude-parse: # The format for showing inheritance objects. # It should be one of: 'grouped', 'listed', 'included'. inheritance: listed # Whether or not to inclue private variables. (Even if included, # private variables will be hidden by default.) private: yes # Whether or not to list each module's imports. imports: no # Whether or not to include syntax highlighted source code in # the output (HTML only). sourcecode: no # Whether or not to include a a page with Epydoc log, containing # effective option at the time of generation and the reported logs. include-log: no ### Output options # The documented project's name. name: PETSc for Python # The documented project's URL. url: https://gitlab.com/petsc/petsc # The CSS stylesheet for HTML output. Can be the name of a builtin # stylesheet, or the name of a file. css: white # HTML code for the project link in the navigation bar. If left # unspecified, the project link will be generated based on the # project's name and URL. #link: My Cool Project # The "top" page for the documentation. Can be a URL, the name # of a module or class, or one of the special names "trees.html", # "indices.html", or "help.html" #top: os.path # An alternative help file. The named file should contain the # body of an HTML file; navigation bars will be added to it. #help: my_helpfile.html # Whether or not to include a frames-based table of contents. frames: yes # Whether each class should be listed in its own section when # generating LaTeX or PDF output. separate-classes: no ### API linking options # Define a new API document. A new interpreted text role # will be created #external-api: epydoc # Use the records in this file to resolve objects in the API named NAME. #external-api-file: epydoc:api-objects.txt # Use this URL prefix to configure the string returned for external API. #external-api-root: epydoc:http://epydoc.sourceforge.net/api ### Graph options # The list of graph types that should be automatically included # in the output. Graphs are generated using the Graphviz "dot" # executable. Graph types include: "classtree", "callgraph", # "umlclasstree". Use "all" to include all graph types graph: classtree # The path to the Graphviz "dot" executable, used to generate # graphs. #dotpath: /usr/local/bin/dot # The name of one or more pstat files (generated by the profile # or hotshot module). These are used to generate call graphs. #pstat: profile.out # Specify the font used to generate Graphviz graphs. # (e.g., helvetica or times). graph-font: Helvetica # Specify the font size used to generate Graphviz graphs. graph-font-size: 10 ### Return value options # The condition upon which Epydoc should exit with a non-zero # exit status. Possible values are error, warning, docstring_warning #fail-on: error petsc4py-3.15.1/conf/__init__.py0000644000175000017500000000000013750315427016611 0ustar balaybalay00000000000000petsc4py-3.15.1/conf/baseconf.py0000644000175000017500000007205514062763234016655 0ustar balaybalay00000000000000# -------------------------------------------------------------------- __all__ = ['PetscConfig', 'setup', 'Extension', 'config', 'build', 'build_src', 'build_ext', 'clean', 'test', 'sdist', 'log', ] # -------------------------------------------------------------------- import sys, os import re try: import setuptools except ImportError: setuptools = None def import_command(cmd): try: from importlib import import_module except ImportError: import_module = lambda n: __import__(n, fromlist=[None]) try: if not setuptools: raise ImportError mod = import_module('setuptools.command.' + cmd) return getattr(mod, cmd) except ImportError: mod = import_module('distutils.command.' + cmd) return getattr(mod, cmd) if setuptools: from setuptools import setup from setuptools import Extension as _Extension from setuptools import Command else: from distutils.core import setup from distutils.core import Extension as _Extension from distutils.core import Command _config = import_command('config') _build = import_command('build') _build_ext = import_command('build_ext') _install = import_command('install') _clean = import_command('clean') _sdist = import_command('sdist') from distutils import sysconfig from distutils import log from distutils.util import split_quoted, execute from distutils.errors import DistutilsError # -------------------------------------------------------------------- def fix_config_vars(names, values): import os, re values = list(values) if 'CONDA_BUILD' in os.environ: return values if sys.platform == 'darwin': if 'ARCHFLAGS' in os.environ: ARCHFLAGS = os.environ['ARCHFLAGS'] for i, flag in enumerate(list(values)): flag, count = re.subn('-arch\s+\w+', ' ', flag) if count and ARCHFLAGS: flag = flag + ' ' + ARCHFLAGS values[i] = flag if 'SDKROOT' in os.environ: SDKROOT = os.environ['SDKROOT'] for i, flag in enumerate(list(values)): flag, count = re.subn('-isysroot [^ \t]*', ' ', flag) if count and SDKROOT: flag = flag + ' ' + '-isysroot ' + SDKROOT values[i] = flag return values def get_config_vars(*names): # Core Python configuration values = sysconfig.get_config_vars(*names) # Do any distutils flags fixup right now values = fix_config_vars(names, values) return values from distutils.unixccompiler import UnixCCompiler rpath_option_orig = UnixCCompiler.runtime_library_dir_option def rpath_option(compiler, dir): option = rpath_option_orig(compiler, dir) if sys.platform[:5] == 'linux': if option.startswith('-R'): option = option.replace('-R', '-Wl,-rpath,', 1) elif option.startswith('-Wl,-R'): option = option.replace('-Wl,-R', '-Wl,-rpath,', 1) return option UnixCCompiler.runtime_library_dir_option = rpath_option # -------------------------------------------------------------------- class PetscConfig: def __init__(self, petsc_dir, petsc_arch, dest_dir=None): if dest_dir is None: dest_dir = os.environ.get('DESTDIR') self.configdict = { } if not petsc_dir: raise DistutilsError("PETSc not found") if not os.path.isdir(petsc_dir): raise DistutilsError("invalid PETSC_DIR: %s" % petsc_dir) self.version = self._get_petsc_version(petsc_dir) self.configdict = self._get_petsc_config(petsc_dir, petsc_arch) self.PETSC_DIR = self['PETSC_DIR'] self.PETSC_ARCH = self['PETSC_ARCH'] self.DESTDIR = dest_dir language_map = {'CONLY':'c', 'CXXONLY':'c++'} self.language = language_map[self['PETSC_LANGUAGE']] def __getitem__(self, item): return self.configdict[item] def get(self, item, default=None): return self.configdict.get(item, default) def configure(self, extension, compiler=None): self.configure_extension(extension) if compiler is not None: self.configure_compiler(compiler) def _get_petsc_version(self, petsc_dir): import re version_re = { 'major' : re.compile(r"#define\s+PETSC_VERSION_MAJOR\s+(\d+)"), 'minor' : re.compile(r"#define\s+PETSC_VERSION_MINOR\s+(\d+)"), 'micro' : re.compile(r"#define\s+PETSC_VERSION_SUBMINOR\s+(\d+)"), 'patch' : re.compile(r"#define\s+PETSC_VERSION_PATCH\s+(\d+)"), 'release': re.compile(r"#define\s+PETSC_VERSION_RELEASE\s+(-*\d+)"), } petscversion_h = os.path.join(petsc_dir, 'include', 'petscversion.h') with open(petscversion_h, 'rt') as f: data = f.read() major = int(version_re['major'].search(data).groups()[0]) minor = int(version_re['minor'].search(data).groups()[0]) micro = int(version_re['micro'].search(data).groups()[0]) release = int(version_re['release'].search(data).groups()[0]) return (major, minor, micro), (release == 1) def _get_petsc_config(self, petsc_dir, petsc_arch): from os.path import join, isdir, exists PETSC_DIR = petsc_dir PETSC_ARCH = petsc_arch # confdir = join('lib', 'petsc', 'conf') if not (PETSC_ARCH and isdir(join(PETSC_DIR, PETSC_ARCH))): petscvars = join(PETSC_DIR, confdir, 'petscvariables') PETSC_ARCH = makefile(open(petscvars, 'rt')).get('PETSC_ARCH') if not (PETSC_ARCH and isdir(join(PETSC_DIR, PETSC_ARCH))): PETSC_ARCH = '' # variables = join(PETSC_DIR, confdir, 'variables') if not exists(variables): variables = join(PETSC_DIR, PETSC_ARCH, confdir, 'variables') petscvariables = join(PETSC_DIR, PETSC_ARCH, confdir, 'petscvariables') # with open(variables) as f: contents = f.read() with open(petscvariables) as f: contents += f.read() # try: from cStringIO import StringIO except ImportError: from io import StringIO confstr = 'PETSC_DIR = %s\n' % PETSC_DIR confstr += 'PETSC_ARCH = %s\n' % PETSC_ARCH confstr += contents confdict = makefile(StringIO(confstr)) return confdict def _configure_ext(self, ext, dct, preppend=False): extdict = ext.__dict__ for key, values in dct.items(): if key in extdict: for value in values: if value not in extdict[key]: if preppend: extdict[key].insert(0, value) else: extdict[key].append(value) def configure_extension(self, extension): # includes and libraries # paths in PETSc config files point to final installation location, but # we might be building against PETSc in staging location (DESTDIR) when # DESTDIR is set, so append DESTDIR (if nonempty) to those paths petsc_inc = flaglist(prepend_to_flags(self.DESTDIR, self['PETSC_CC_INCLUDES'])) lib_flags = prepend_to_flags(self.DESTDIR, '-L%s %s' % \ (self['PETSC_LIB_DIR'], self['PETSC_LIB_BASIC'])) petsc_lib = flaglist(lib_flags) # runtime_library_dirs is not supported on Windows if sys.platform != 'win32': # if DESTDIR is set, then we're building against PETSc in a staging # directory, but rpath needs to point to final install directory. rpath = strip_prefix(self.DESTDIR, self['PETSC_LIB_DIR']) petsc_lib['runtime_library_dirs'].append(rpath) # Link in extra libraries on static builds if self['BUILDSHAREDLIB'] != 'yes': petsc_ext_lib = split_quoted(self['PETSC_EXTERNAL_LIB_BASIC']) petsc_lib['extra_link_args'].extend(petsc_ext_lib) self._configure_ext(extension, petsc_inc, preppend=True) self._configure_ext(extension, petsc_lib) def configure_compiler(self, compiler): if compiler.compiler_type != 'unix': return getenv = os.environ.get # distutils C/C++ compiler (cc, cflags, ccshared, cxx) = get_config_vars( 'CC', 'CFLAGS', 'CCSHARED', 'CXX') ccshared = getenv('CCSHARED', ccshared or '') cflags = getenv('CFLAGS', cflags or '') cflags = cflags.replace('-Wstrict-prototypes', '') # distutils linker (ldflags, ldshared, so_ext) = get_config_vars( 'LDFLAGS', 'LDSHARED', 'SO') ld = cc ldshared = getenv('LDSHARED', ldshared) ldflags = getenv('LDFLAGS', cflags + ' ' + (ldflags or '')) ldcmd = split_quoted(ld) + split_quoted(ldflags) ldshared = [flg for flg in split_quoted(ldshared) if flg not in ldcmd] ldshared = str.join(' ', ldshared) # def get_flags(cmd): try: return ' '.join(split_quoted(cmd)[1:]) except: return '' # PETSc C compiler PCC = self['PCC'] PCC_FLAGS = get_flags(cc) + ' ' + self['PCC_FLAGS'] PCC_FLAGS = PCC_FLAGS.replace('-fvisibility=hidden', '') PCC = getenv('PCC', PCC) + ' ' + getenv('PCCFLAGS', PCC_FLAGS) PCC_SHARED = str.join(' ', (PCC, ccshared, cflags)) # PETSc C++ compiler PCXX = PCC if self.language == 'c++' else self.get('CXX', cxx) # PETSc linker PLD = self['PCC_LINKER'] PLD_FLAGS = get_flags(ld) + ' ' + self['PCC_LINKER_FLAGS'] PLD_FLAGS = PLD_FLAGS.replace('-fvisibility=hidden', '') PLD = getenv('PLD', PLD) + ' ' + getenv('PLDFLAGS', PLD_FLAGS) PLD_SHARED = str.join(' ', (PLD, ldshared, ldflags)) # compiler.set_executables( compiler = PCC, compiler_cxx = PCXX, linker_exe = PLD, compiler_so = PCC_SHARED, linker_so = PLD_SHARED, ) compiler.shared_lib_extension = so_ext # if sys.platform == 'darwin': for attr in ('preprocessor', 'compiler', 'compiler_cxx', 'compiler_so', 'linker_so', 'linker_exe'): compiler_cmd = getattr(compiler, attr, []) while '-mno-fused-madd' in compiler_cmd: compiler_cmd.remove('-mno-fused-madd') def log_info(self): PETSC_DIR = self['PETSC_DIR'] PETSC_ARCH = self['PETSC_ARCH'] version = ".".join([str(i) for i in self.version[0]]) release = ("development", "release")[self.version[1]] version_info = version + ' ' + release integer_size = '%s-bit' % self['PETSC_INDEX_SIZE'] scalar_type = self['PETSC_SCALAR'] precision = self['PETSC_PRECISION'] language = self['PETSC_LANGUAGE'] compiler = self['PCC'] linker = self['PCC_LINKER'] log.info('PETSC_DIR: %s' % PETSC_DIR ) log.info('PETSC_ARCH: %s' % PETSC_ARCH ) log.info('version: %s' % version_info) log.info('integer-size: %s' % integer_size) log.info('scalar-type: %s' % scalar_type) log.info('precision: %s' % precision) log.info('language: %s' % language) log.info('compiler: %s' % compiler) log.info('linker: %s' % linker) # -------------------------------------------------------------------- class Extension(_Extension): pass # -------------------------------------------------------------------- cmd_petsc_opts = [ ('petsc-dir=', None, "define PETSC_DIR, overriding environmental variables"), ('petsc-arch=', None, "define PETSC_ARCH, overriding environmental variables"), ] class config(_config): Configure = PetscConfig user_options = _config.user_options + cmd_petsc_opts def initialize_options(self): _config.initialize_options(self) self.petsc_dir = None self.petsc_arch = None def get_config_arch(self, arch): return config.Configure(self.petsc_dir, arch) def run(self): _config.run(self) self.petsc_dir = config.get_petsc_dir(self.petsc_dir) if self.petsc_dir is None: return petsc_arch = config.get_petsc_arch(self.petsc_dir, self.petsc_arch) log.info('-' * 70) log.info('PETSC_DIR: %s' % self.petsc_dir) arch_list = petsc_arch if not arch_list : arch_list = [ None ] for arch in arch_list: conf = self.get_config_arch(arch) archname = conf.PETSC_ARCH or conf['PETSC_ARCH'] scalar_type = conf['PETSC_SCALAR'] precision = conf['PETSC_PRECISION'] language = conf['PETSC_LANGUAGE'] compiler = conf['PCC'] linker = conf['PCC_LINKER'] log.info('-'*70) log.info('PETSC_ARCH: %s' % archname) log.info(' * scalar-type: %s' % scalar_type) log.info(' * precision: %s' % precision) log.info(' * language: %s' % language) log.info(' * compiler: %s' % compiler) log.info(' * linker: %s' % linker) log.info('-' * 70) #@staticmethod def get_petsc_dir(petsc_dir): if not petsc_dir: return None petsc_dir = os.path.expandvars(petsc_dir) if not petsc_dir or '$PETSC_DIR' in petsc_dir: try: import petsc petsc_dir = petsc.get_petsc_dir() except ImportError: log.warn("PETSC_DIR not specified") return None petsc_dir = os.path.expanduser(petsc_dir) petsc_dir = os.path.abspath(petsc_dir) return config.chk_petsc_dir(petsc_dir) get_petsc_dir = staticmethod(get_petsc_dir) #@staticmethod def chk_petsc_dir(petsc_dir): if not os.path.isdir(petsc_dir): log.error('invalid PETSC_DIR: %s (ignored)' % petsc_dir) return None return petsc_dir chk_petsc_dir = staticmethod(chk_petsc_dir) #@staticmethod def get_petsc_arch(petsc_dir, petsc_arch): if not petsc_dir: return None petsc_arch = os.path.expandvars(petsc_arch) if (not petsc_arch or '$PETSC_ARCH' in petsc_arch): petsc_arch = '' petsc_conf = os.path.join(petsc_dir, 'lib', 'petsc', 'conf') if os.path.isdir(petsc_conf): petscvariables = os.path.join(petsc_conf, 'petscvariables') if os.path.exists(petscvariables): conf = makefile(open(petscvariables, 'rt')) petsc_arch = conf.get('PETSC_ARCH', '') petsc_arch = petsc_arch.split(os.pathsep) petsc_arch = unique(petsc_arch) petsc_arch = [arch for arch in petsc_arch if arch] return config.chk_petsc_arch(petsc_dir, petsc_arch) get_petsc_arch = staticmethod(get_petsc_arch) #@staticmethod def chk_petsc_arch(petsc_dir, petsc_arch): valid_archs = [] for arch in petsc_arch: arch_path = os.path.join(petsc_dir, arch) if os.path.isdir(arch_path): valid_archs.append(arch) else: log.warn("invalid PETSC_ARCH: %s (ignored)" % arch) return valid_archs chk_petsc_arch = staticmethod(chk_petsc_arch) class build(_build): user_options = _build.user_options + cmd_petsc_opts def initialize_options(self): _build.initialize_options(self) self.petsc_dir = None self.petsc_arch = None def finalize_options(self): _build.finalize_options(self) self.set_undefined_options('config', ('petsc_dir', 'petsc_dir'), ('petsc_arch', 'petsc_arch')) self.petsc_dir = config.get_petsc_dir(self.petsc_dir) self.petsc_arch = config.get_petsc_arch(self.petsc_dir, self.petsc_arch) sub_commands = \ [('build_src', lambda *args: True)] + \ _build.sub_commands class build_src(Command): description = "build C sources from Cython files" user_options = [ ('force', 'f', "forcibly build everything (ignore file timestamps)"), ] boolean_options = ['force'] def initialize_options(self): self.force = False def finalize_options(self): self.set_undefined_options('build', ('force', 'force'), ) def run(self): pass class build_ext(_build_ext): user_options = _build_ext.user_options + cmd_petsc_opts def initialize_options(self): _build_ext.initialize_options(self) self.petsc_dir = None self.petsc_arch = None self._outputs = [] def finalize_options(self): _build_ext.finalize_options(self) self.set_undefined_options('build', ('petsc_dir', 'petsc_dir'), ('petsc_arch', 'petsc_arch')) if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') or sys.platform.startswith('sunos')) and sysconfig.get_config_var('Py_ENABLE_SHARED')): py_version = sysconfig.get_python_version() bad_pylib_dir = os.path.join(sys.prefix, "lib", "python" + py_version, "config") try: self.library_dirs.remove(bad_pylib_dir) except ValueError: pass pylib_dir = sysconfig.get_config_var("LIBDIR") if pylib_dir not in self.library_dirs: self.library_dirs.append(pylib_dir) if pylib_dir not in self.rpath: self.rpath.append(pylib_dir) if sys.exec_prefix == '/usr': self.library_dirs.remove(pylib_dir) self.rpath.remove(pylib_dir) def _copy_ext(self, ext): from copy import deepcopy extclass = ext.__class__ fullname = self.get_ext_fullname(ext.name) modpath = str.split(fullname, '.') pkgpath = os.path.join('', *modpath[0:-1]) name = modpath[-1] sources = list(ext.sources) newext = extclass(name, sources) newext.__dict__.update(deepcopy(ext.__dict__)) newext.name = name return pkgpath, newext def _build_ext_arch(self, ext, pkgpath, arch): build_temp = self.build_temp build_lib = self.build_lib try: self.build_temp = os.path.join(build_temp, arch) self.build_lib = os.path.join(build_lib, pkgpath, arch) _build_ext.build_extension(self, ext) finally: self.build_temp = build_temp self.build_lib = build_lib def get_config_arch(self, arch): return config.Configure(self.petsc_dir, arch) def build_extension(self, ext): if not isinstance(ext, Extension): return _build_ext.build_extension(self, ext) petsc_arch = self.petsc_arch if not petsc_arch: petsc_arch = [ None ] for arch in petsc_arch: config = self.get_config_arch(arch) ARCH = arch or config['PETSC_ARCH'] if ARCH not in self.PETSC_ARCH_LIST: self.PETSC_ARCH_LIST.append(ARCH) self.DESTDIR = config.DESTDIR ext.language = config.language config.log_info() pkgpath, newext = self._copy_ext(ext) config.configure(newext, self.compiler) name = self.distribution.get_name() version = self.distribution.get_version() distdir = "%s-%s/" % (name, version) self._build_ext_arch(newext, pkgpath, ARCH) def build_extensions(self, *args, **kargs): self.PETSC_ARCH_LIST = [] _build_ext.build_extensions(self, *args,**kargs) if not self.PETSC_ARCH_LIST: return self.build_configuration(self.PETSC_ARCH_LIST) def build_configuration(self, arch_list): # template, variables = self.get_config_data(arch_list) config_data = template % variables # build_lib = self.build_lib dist_name = self.distribution.get_name() config_file = os.path.join(build_lib, dist_name, 'lib', dist_name.replace('4py', '') + '.cfg') # def write_file(filename, data): with open(filename, 'w') as fh: fh.write(config_data) execute(write_file, (config_file, config_data), msg='writing %s' % config_file, verbose=self.verbose, dry_run=self.dry_run) def get_config_data(self, arch_list): template = """\ PETSC_DIR = %(PETSC_DIR)s PETSC_ARCH = %(PETSC_ARCH)s """ variables = {'PETSC_DIR' : strip_prefix(self.DESTDIR, self.petsc_dir), 'PETSC_ARCH' : os.path.pathsep.join(arch_list)} return template, variables def get_outputs(self): self.check_extensions_list(self.extensions) outputs = [] for ext in self.extensions: fullname = self.get_ext_fullname(ext.name) filename = self.get_ext_filename(fullname) if isinstance(ext, Extension) and self.petsc_arch: head, tail = os.path.split(filename) for arch in self.petsc_arch: outfile = os.path.join(self.build_lib, head, arch, tail) outputs.append(outfile) else: outfile = os.path.join(self.build_lib, filename) outputs.append(outfile) outputs = list(set(outputs)) return outputs class install(_install): def run(self): _install.run(self) class clean(_clean): def run(self): _clean.run(self) from distutils.dir_util import remove_tree if self.all: # remove the .egg_info directory try: egg_info = self.get_finalized_command('egg_info').egg_info if os.path.exists(egg_info): remove_tree(egg_info, dry_run=self.dry_run) else: log.debug("'%s' does not exist -- can't clean it", egg_info) except DistutilsError: pass class test(Command): description = "run the test suite" user_options = [('args=', None, "options")] def initialize_options(self): self.args = None def finalize_options(self): if self.args: self.args = split_quoted(self.args) else: self.args = [] def run(self): pass class sdist(_sdist): def run(self): build_src = self.get_finalized_command('build_src') build_src.run() _sdist.run(self) # -------------------------------------------------------------------- if setuptools: try: from setuptools.command import egg_info as mod_egg_info _FileList = mod_egg_info.FileList class FileList(_FileList): def process_template_line(self, line): level = log.set_threshold(log.ERROR) try: _FileList.process_template_line(self, line) finally: log.set_threshold(level) mod_egg_info.FileList = FileList except: pass # -------------------------------------------------------------------- def append(seq, item): if item not in seq: seq.append(item) def append_dict(conf, dct): for key, values in dct.items(): if key in conf: for value in values: if value not in conf[key]: conf[key].append(value) def unique(seq): res = [] for item in seq: if item not in res: res.append(item) return res def flaglist(flags): conf = { 'define_macros' : [], 'undef_macros' : [], 'include_dirs' : [], 'libraries' : [], 'library_dirs' : [], 'runtime_library_dirs': [], 'extra_compile_args' : [], 'extra_link_args' : [], } if type(flags) is str: flags = flags.split() switch = '-Wl,' newflags = [] linkopts = [] for f in flags: if f.startswith(switch): if len(f) > 4: append(linkopts, f[4:]) else: append(newflags, f) if linkopts: newflags.append(switch + ','.join(linkopts)) flags = newflags append_next_word = None for word in flags: if append_next_word is not None: append(append_next_word, word) append_next_word = None continue switch, value = word[0:2], word[2:] if switch == "-I": append(conf['include_dirs'], value) elif switch == "-D": try: idx = value.index("=") macro = (value[:idx], value[idx+1:]) except ValueError: macro = (value, None) append(conf['define_macros'], macro) elif switch == "-U": append(conf['undef_macros'], value) elif switch == "-l": append(conf['libraries'], value) elif switch == "-L": append(conf['library_dirs'], value) elif switch == "-R": append(conf['runtime_library_dirs'], value) elif word.startswith("-Wl"): linkopts = word.split(',') append_dict(conf, flaglist(linkopts[1:])) elif word == "-rpath": append_next_word = conf['runtime_library_dirs'] elif word == "-Xlinker": append_next_word = conf['extra_link_args'] else: #log.warn("unrecognized flag '%s'" % word) pass return conf def prepend_to_flags(path, flags): """Prepend a path to compiler flags with absolute paths""" if not path: return flags def append_path(m): switch = m.group(1) open_quote = m.group(4) old_path = m.group(5) close_quote = m.group(6) if os.path.isabs(old_path): moded_path = os.path.normpath(path + os.path.sep + old_path) return switch + open_quote + moded_path + close_quote return m.group(0) return re.sub(r'((^|\s+)(-I|-L))(\s*["\']?)(\S+)(["\']?)', append_path, flags) def strip_prefix(prefix, string): if not prefix: return string return re.sub(r'^' + prefix, '', string) # -------------------------------------------------------------------- from distutils.text_file import TextFile # Regexes needed for parsing Makefile-like syntaxes import re as _re _variable_rx = _re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)") _findvar1_rx = _re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)") _findvar2_rx = _re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}") def makefile(fileobj, dct=None): """Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ fp = TextFile(file=fileobj, strip_comments=1, skip_blanks=1, join_lines=1) if dct is None: dct = {} done = {} notdone = {} while 1: line = fp.readline() if line is None: # eof break m = _variable_rx.match(line) if m: n, v = m.group(1, 2) v = str.strip(v) if "$" in v: notdone[n] = v else: try: v = int(v) except ValueError: pass done[n] = v try: del notdone[n] except KeyError: pass fp.close() # do variable interpolation here while notdone: for name in list(notdone.keys()): value = notdone[name] m = _findvar1_rx.search(value) or _findvar2_rx.search(value) if m: n = m.group(1) found = True if n in done: item = str(done[n]) elif n in notdone: # get it on a subsequent round found = False else: done[n] = item = "" if found: after = value[m.end():] value = value[:m.start()] + item + after if "$" in after: notdone[name] = value else: try: value = int(value) except ValueError: done[name] = str.strip(value) else: done[name] = value del notdone[name] else: # bogus variable reference; # just drop it since we can't deal del notdone[name] # save the results in the global dictionary dct.update(done) return dct # -------------------------------------------------------------------- petsc4py-3.15.1/conf/epydocify.py0000755000175000017500000000550513750315427017067 0ustar balaybalay00000000000000#!/usr/bin/env python # -------------------------------------------------------------------- from petsc4py import PETSc # -------------------------------------------------------------------- try: from docutils.nodes import NodeVisitor NodeVisitor.unknown_visit = lambda self, node: None NodeVisitor.unknown_departure = lambda self, node: None except ImportError: pass try: # epydoc 3.0.1 + docutils 0.6 from docutils.nodes import Text from UserString import UserString if not isinstance(Text, UserString): def Text_get_data(s): try: return s._data except AttributeError: return s.astext() def Text_set_data(s, d): s.astext = lambda: d s._data = d Text.data = property(Text_get_data, Text_set_data) except ImportError: pass # -------------------------------------------------------------------- from epydoc.docwriter import dotgraph import re dotgraph._DOT_VERSION_RE = \ re.compile(r'dot (?:- Graphviz )version ([\d\.]+)') try: dotgraph.DotGraph.DEFAULT_HTML_IMAGE_FORMAT dotgraph.DotGraph.DEFAULT_HTML_IMAGE_FORMAT = 'png' except AttributeError: DotGraph_to_html = dotgraph.DotGraph.to_html DotGraph_run_dot = dotgraph.DotGraph._run_dot def to_html(self, image_file, image_url, center=True): if image_file[-4:] == '.gif': image_file = image_file[:-4] + '.png' if image_url[-4:] == '.gif': image_url = image_url[:-4] + '.png' return DotGraph_to_html(self, image_file, image_url) def _run_dot(self, *options): if '-Tgif' in options: opts = list(options) for i, o in enumerate(opts): if o == '-Tgif': opts[i] = '-Tpng' options = type(options)(opts) return DotGraph_run_dot(self, *options) dotgraph.DotGraph.to_html = to_html dotgraph.DotGraph._run_dot = _run_dot # -------------------------------------------------------------------- import re _SIGNATURE_RE = re.compile( # Class name (for builtin methods) r'^\s*((?P\w+)\.)?' + # The function name r'(?P\w+)' + # The parameters r'\(((?P(?:self|cls|mcs)),?)?(?P.*)\)' + # The return value (optional) r'(\s*(->)\s*(?P\S.*?))?'+ # The end marker r'\s*(\n|\s+(--|<=+>)\s+|$|\.\s+|\.\n)') from epydoc import docstringparser as dsp dsp._SIGNATURE_RE = _SIGNATURE_RE # -------------------------------------------------------------------- import sys, os import epydoc.cli def epydocify(): dirname = os.path.dirname(__file__) config = os.path.join(dirname, 'epydoc.cfg') sys.argv.append('--config=' + config) epydoc.cli.cli() if __name__ == '__main__': epydocify() # -------------------------------------------------------------------- petsc4py-3.15.1/test/0000755000175000017500000000000014062764472014551 5ustar balaybalay00000000000000petsc4py-3.15.1/test/test_mat_py.py0000644000175000017500000001634513750315427017457 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest from sys import getrefcount # -------------------------------------------------------------------- class Matrix(object): def __init__(self): pass def create(self, mat): pass def destroy(self, mat): pass class Identity(Matrix): def mult(self, mat, x, y): x.copy(y) def getDiagonal(self, mat, vd): vd.set(1) class Diagonal(Matrix): def create(self, mat): super(Diagonal,self).create(mat) mat.setUp() self.D = mat.createVecLeft() def destroy(self, mat): self.D.destroy() super(Diagonal,self).destroy(mat) def scale(self, mat, a): self.D.scale(a) def shift(self, mat, a): self.D.shift(a) def zeroEntries(self, mat): self.D.zeroEntries() def mult(self, mat, x, y): y.pointwiseMult(x, self.D) def getDiagonal(self, mat, vd): self.D.copy(vd) def setDiagonal(self, mat, vd, im): if isinstance (im, bool): addv = im if addv: self.D.axpy(1, vd) else: vd.copy(self.D) elif im == PETSc.InsertMode.INSERT_VALUES: vd.copy(self.D) elif im == PETSc.InsertMode.ADD_VALUES: self.D.axpy(1, vd) else: raise ValueError('wrong InsertMode %d'% im) def diagonalScale(self, mat, vl, vr): if vl: self.D.pointwiseMult(self.D, vl) if vr: self.D.pointwiseMult(self.D, vr) # -------------------------------------------------------------------- class TestMatrix(unittest.TestCase): COMM = PETSc.COMM_WORLD PYMOD = __name__ PYCLS = 'Matrix' def _getCtx(self): return self.A.getPythonContext() def setUp(self): N = self.N = 10 self.A = PETSc.Mat() if 0: # command line way self.A.create(self.COMM) self.A.setSizes([N,N]) self.A.setType('python') OptDB = PETSc.Options(self.A) OptDB['mat_python_type'] = '%s.%s' % (self.PYMOD,self.PYCLS) self.A.setFromOptions() self.A.setUp() del OptDB['mat_python_type'] self.assertTrue(self._getCtx() is not None) else: # python way context = globals()[self.PYCLS]() self.A.createPython([N,N], context, comm=self.COMM) self.A.setUp() self.assertTrue(self._getCtx() is context) self.assertEqual(getrefcount(context), 3) del context self.assertEqual(getrefcount(self._getCtx()), 2) def tearDown(self): ctx = self.A.getPythonContext() self.assertEqual(getrefcount(ctx), 3) self.A.destroy() # XXX self.A = None self.assertEqual(getrefcount(ctx), 2) #import gc,pprint; pprint.pprint(gc.get_referrers(ctx)) def testBasic(self): ctx = self.A.getPythonContext() self.assertTrue(self._getCtx() is ctx) self.assertEqual(getrefcount(ctx), 3) def testZeroEntries(self): f = lambda : self.A.zeroEntries() self.assertRaises(Exception, f) def testMult(self): x, y = self.A.createVecs() f = lambda : self.A.mult(x, y) self.assertRaises(Exception, f) def testMultTranspose(self): x, y = self.A.createVecs() f = lambda : self.A.multTranspose(x, y) self.assertRaises(Exception, f) def testGetDiagonal(self): d = self.A.createVecLeft() f = lambda : self.A.getDiagonal(d) self.assertRaises(Exception, f) def testSetDiagonal(self): d = self.A.createVecLeft() f = lambda : self.A.setDiagonal(d) self.assertRaises(Exception, f) def testDiagonalScale(self): x, y = self.A.createVecs() f = lambda : self.A.diagonalScale(x, y) self.assertRaises(Exception, f) class TestIdentity(TestMatrix): PYCLS = 'Identity' def testMult(self): x, y = self.A.createVecs() x.setRandom() self.A.mult(x,y) self.assertTrue(y.equal(x)) def testMultTransposeSymmKnown(self): x, y = self.A.createVecs() x.setRandom() self.A.setOption(PETSc.Mat.Option.SYMMETRIC, True) self.A.multTranspose(x,y) self.assertTrue(y.equal(x)) self.A.setOption(PETSc.Mat.Option.SYMMETRIC, False) f = lambda : self.A.multTranspose(x, y) self.assertRaises(Exception, f) def testMultTransposeNewMeth(self): x, y = self.A.createVecs() x.setRandom() AA = self.A.getPythonContext() AA.multTranspose = AA.mult self.A.multTranspose(x,y) del AA.multTranspose self.assertTrue(y.equal(x)) def testGetDiagonal(self): d = self.A.createVecLeft() o = d.duplicate() o.set(1) self.A.getDiagonal(d) self.assertTrue(o.equal(d)) class TestDiagonal(TestMatrix): PYCLS = 'Diagonal' def setUp(self): super(TestDiagonal, self).setUp() D = self.A.createVecLeft() s, e = D.getOwnershipRange() for i in range(s, e): D[i] = i+1 D.assemble() self.A.setDiagonal(D) def testZeroEntries(self): self.A.zeroEntries() D = self._getCtx().D self.assertEqual(D.norm(), 0) def testMult(self): x, y = self.A.createVecs() x.set(1) self.A.mult(x,y) self.assertTrue(y.equal(self._getCtx().D)) def testMultTransposeSymmKnown(self): x, y = self.A.createVecs() x.set(1) self.A.setOption(PETSc.Mat.Option.SYMMETRIC, True) self.A.multTranspose(x,y) self.assertTrue(y.equal(self._getCtx().D)) self.A.setOption(PETSc.Mat.Option.SYMMETRIC, False) f = lambda : self.A.multTranspose(x, y) self.assertRaises(Exception, f) def testMultTransposeNewMeth(self): x, y = self.A.createVecs() x.set(1) AA = self.A.getPythonContext() AA.multTranspose = AA.mult self.A.multTranspose(x,y) del AA.multTranspose self.assertTrue(y.equal(self._getCtx().D)) def testGetDiagonal(self): d = self.A.createVecLeft() self.A.getDiagonal(d) self.assertTrue(d.equal(self._getCtx().D)) def testSetDiagonal(self): d = self.A.createVecLeft() d.setRandom() self.A.setDiagonal(d) self.assertTrue(d.equal(self._getCtx().D)) def testDiagonalScale(self): x, y = self.A.createVecs() x.set(2) y.set(3) old = self._getCtx().D.copy() self.A.diagonalScale(x, y) D = self._getCtx().D self.assertTrue(D.equal(old*6)) def testCreateTranspose(self): A = self.A A.setOption(PETSc.Mat.Option.SYMMETRIC, True) AT = PETSc.Mat().createTranspose(A) x, y = A.createVecs() xt, yt = AT.createVecs() # y.setRandom() A.multTranspose(y, x) y.copy(xt) AT.mult(xt, yt) self.assertTrue(yt.equal(x)) # x.setRandom() A.mult(x, y) x.copy(yt) AT.multTranspose(yt, xt) self.assertTrue(xt.equal(y)) del A # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_object.py0000644000175000017500000002003414030740317017412 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class BaseTestObject(object): CLASS, FACTORY = None, None TARGS, KARGS = (), {} BUILD = None def setUp(self): self.obj = self.CLASS() getattr(self.obj,self.FACTORY)(*self.TARGS, **self.KARGS) if not self.obj: self.obj.create() def tearDown(self): self.obj = None def testTypeRegistry(self): type_reg = PETSc.__type_registry__ classid = self.obj.getClassId() typeobj = self.CLASS if isinstance(self.obj, PETSc.DMDA): typeobj = PETSc.DM self.assertTrue(type_reg[classid] is typeobj ) def testLogClass(self): name = self.CLASS.__name__ if name == 'DMDA': name = 'DM' logcls = PETSc.Log.Class(name) classid = self.obj.getClassId() self.assertEqual(logcls.id, classid) def testClass(self): self.assertTrue(isinstance(self.obj, self.CLASS)) self.assertTrue(type(self.obj) is self.CLASS) def testNonZero(self): self.assertTrue(bool(self.obj)) def testDestroy(self): self.assertTrue(bool(self.obj)) self.obj.destroy() self.assertFalse(bool(self.obj)) ## self.assertRaises(PETSc.Error, self.obj.destroy) ## self.assertTrue(self.obj.this is this) def testOptions(self): self.assertFalse(self.obj.getOptionsPrefix()) prefix1 = 'my_' self.obj.setOptionsPrefix(prefix1) self.assertEqual(self.obj.getOptionsPrefix(), prefix1) prefix2 = 'opt_' self.obj.setOptionsPrefix(prefix2) self.assertEqual(self.obj.getOptionsPrefix(), prefix2) ## self.obj.appendOptionsPrefix(prefix1) ## self.assertEqual(self.obj.getOptionsPrefix(), ## prefix2 + prefix1) ## self.obj.prependOptionsPrefix(prefix1) ## self.assertEqual(self.obj.getOptionsPrefix(), ## prefix1 + prefix2 + prefix1) self.obj.setFromOptions() def testName(self): oldname = self.obj.getName() newname = '%s-%s' %(oldname, oldname) self.obj.setName(newname) self.assertEqual(self.obj.getName(), newname) self.obj.setName(oldname) self.assertEqual(self.obj.getName(), oldname) def testComm(self): comm = self.obj.getComm() self.assertTrue(isinstance(comm, PETSc.Comm)) self.assertTrue(comm in [PETSc.COMM_SELF, PETSc.COMM_WORLD]) def testRefCount(self): self.assertEqual(self.obj.getRefCount(), 1) self.obj.incRef() self.assertEqual(self.obj.getRefCount(), 2) self.obj.incRef() self.assertEqual(self.obj.getRefCount(), 3) self.obj.decRef() self.assertEqual(self.obj.getRefCount(), 2) self.obj.decRef() self.assertEqual(self.obj.getRefCount(), 1) self.obj.decRef() self.assertFalse(bool(self.obj)) def testHandle(self): self.assertTrue(self.obj.handle) self.assertTrue(self.obj.fortran) h, f = self.obj.handle, self.obj.fortran if (h>0 and f>0) or (h<0 and f<0): self.assertEqual(h, f) self.obj.destroy() self.assertFalse(self.obj.handle) self.assertFalse(self.obj.fortran) def testComposeQuery(self): import copy try: myobj = copy.deepcopy(self.obj) except NotImplementedError: return self.assertEqual(myobj.getRefCount(), 1) self.obj.compose('myobj', myobj) self.assertTrue(type(self.obj.query('myobj')) is self.CLASS) self.assertEqual(self.obj.query('myobj'), myobj) self.assertEqual(myobj.getRefCount(), 2) self.obj.compose('myobj', None) self.assertEqual(myobj.getRefCount(), 1) self.assertEqual(self.obj.query('myobj'), None) myobj.destroy() def testProperties(self): self.assertEqual(self.obj.getClassId(), self.obj.classid) self.assertEqual(self.obj.getClassName(), self.obj.klass) self.assertEqual(self.obj.getType(), self.obj.type) self.assertEqual(self.obj.getName(), self.obj.name) self.assertEqual(self.obj.getComm(), self.obj.comm) self.assertEqual(self.obj.getRefCount(), self.obj.refcount) def testShallowCopy(self): import copy rc = self.obj.getRefCount() obj = copy.copy(self.obj) self.assertTrue(obj is not self.obj) self.assertTrue(obj == self.obj) self.assertTrue(type(obj) is type(self.obj)) self.assertEqual(obj.getRefCount(), rc+1) del obj self.assertEqual(self.obj.getRefCount(), rc) def testDeepCopy(self): import copy rc = self.obj.getRefCount() try: obj = copy.deepcopy(self.obj) except NotImplementedError: return self.assertTrue(obj is not self.obj) self.assertTrue(obj != self.obj) self.assertTrue(type(obj) is type(self.obj)) self.assertEqual(self.obj.getRefCount(), rc) self.assertEqual(obj.getRefCount(), 1) del obj # -------------------------------------------------------------------- class TestObjectRandom(BaseTestObject, unittest.TestCase): CLASS = PETSc.Random FACTORY = 'create' class TestObjectViewer(BaseTestObject, unittest.TestCase): CLASS = PETSc.Viewer FACTORY = 'create' class TestObjectIS(BaseTestObject, unittest.TestCase): CLASS = PETSc.IS FACTORY = 'createGeneral' TARGS = ([],) class TestObjectLGMap(BaseTestObject, unittest.TestCase): CLASS = PETSc.LGMap FACTORY = 'create' TARGS = ([],) class TestObjectAO(BaseTestObject, unittest.TestCase): CLASS = PETSc.AO FACTORY = 'createMapping' TARGS = ([], []) class TestObjectDMDA(BaseTestObject, unittest.TestCase): CLASS = PETSc.DMDA FACTORY = 'create' TARGS = ([3,3,3],) class TestObjectDS(BaseTestObject, unittest.TestCase): CLASS = PETSc.DS FACTORY = 'create' class TestObjectVec(BaseTestObject, unittest.TestCase): CLASS = PETSc.Vec FACTORY = 'createSeq' TARGS = (0,) def setUp(self): BaseTestObject.setUp(self) self.obj.assemble() class TestObjectMat(BaseTestObject, unittest.TestCase): CLASS = PETSc.Mat FACTORY = 'createAIJ' TARGS = (0,) KARGS = {'nnz':0, 'comm': PETSc.COMM_SELF} def setUp(self): BaseTestObject.setUp(self) self.obj.assemble() class TestObjectNullSpace(BaseTestObject, unittest.TestCase): CLASS = PETSc.NullSpace FACTORY = 'create' TARGS = (True, []) class TestObjectKSP(BaseTestObject, unittest.TestCase): CLASS = PETSc.KSP FACTORY = 'create' class TestObjectPC(BaseTestObject, unittest.TestCase): CLASS = PETSc.PC FACTORY = 'create' class TestObjectSNES(BaseTestObject, unittest.TestCase): CLASS = PETSc.SNES FACTORY = 'create' class TestObjectTS(BaseTestObject, unittest.TestCase): CLASS = PETSc.TS FACTORY = 'create' def setUp(self): super(TestObjectTS, self).setUp() self.obj.setProblemType(PETSc.TS.ProblemType.NONLINEAR) self.obj.setType(PETSc.TS.Type.BEULER) class TestObjectTAO(BaseTestObject, unittest.TestCase): CLASS = PETSc.TAO FACTORY = 'create' class TestObjectAOBasic(BaseTestObject, unittest.TestCase): CLASS = PETSc.AO FACTORY = 'createBasic' TARGS = ([], []) class TestObjectAOMapping(BaseTestObject, unittest.TestCase): CLASS = PETSc.AO FACTORY = 'createMapping' TARGS = ([], []) # class TestObjectFE(BaseTestObject, unittest.TestCase): # CLASS = PETSc.FE # FACTORY = 'create' # # class TestObjectQuad(BaseTestObject, unittest.TestCase): # CLASS = PETSc.Quad # FACTORY = 'create' class TestObjectDMLabel(BaseTestObject, unittest.TestCase): CLASS = PETSc.DMLabel FACTORY = 'create' TARGS = ("test",) # -------------------------------------------------------------------- import numpy if numpy.iscomplexobj(PETSc.ScalarType()): del TestObjectTAO if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/runtests.py0000644000175000017500000001653613750315427017020 0ustar balaybalay00000000000000import sys, os import optparse import unittest def getoptionparser(): parser = optparse.OptionParser() parser.add_option("-q", "--quiet", action="store_const", const=0, dest="verbose", default=1, help="do not print status messages to stdout") parser.add_option("-v", "--verbose", action="store_const", const=2, dest="verbose", default=1, help="print status messages to stdout") parser.add_option("-i", "--include", type="string", action="append", dest="include", default=[], help="include tests matching PATTERN", metavar="PATTERN") parser.add_option("-e", "--exclude", type="string", action="append", dest="exclude", default=[], help="exclude tests matching PATTERN", metavar="PATTERN") parser.add_option("-f", "--failfast", action="store_true", dest="failfast", default=False, help="Stop on first failure") parser.add_option("--no-builddir", action="store_false", dest="builddir", default=True, help="disable testing from build directory") parser.add_option("--path", type="string", action="append", dest="path", default=[], help="prepend PATH to sys.path", metavar="PATH") parser.add_option("--refleaks", type="int", action="store", dest="repeats", default=3, help="run tests REPEAT times in a loop to catch leaks", metavar="REPEAT") parser.add_option("--arch", type="string", action="store", dest="arch", default=None, help="use PETSC_ARCH", metavar="PETSC_ARCH") parser.add_option("-s","--summary", action="store_true", dest="summary", default=0, help="print PETSc log summary") return parser def getbuilddir(): from distutils.util import get_platform s = os.path.join("build", "lib.%s-%.3s" % (get_platform(), sys.version)) if hasattr(sys, 'gettotalrefcount'): s += '-pydebug' return s def setup_python(options): rootdir = os.path.dirname(os.path.dirname(__file__)) builddir = os.path.join(rootdir, getbuilddir()) if options.builddir and os.path.exists(builddir): sys.path.insert(0, builddir) if options.path: path = options.path[:] path.reverse() for p in path: sys.path.insert(0, p) def setup_unittest(options): from unittest import TestSuite try: from unittest.runner import _WritelnDecorator except ImportError: from unittest import _WritelnDecorator # writeln_orig = _WritelnDecorator.writeln def writeln(self, message=''): try: self.stream.flush() except: pass writeln_orig(self, message) try: self.stream.flush() except: pass _WritelnDecorator.writeln = writeln def import_package(options, pkgname): args = [ sys.argv[0], '-malloc', '-malloc_debug', '-malloc_dump', ] if options.summary: args.append('-log_view') package = __import__(pkgname) package.init(args, arch=options.arch) return package def getprocessorinfo(): try: name = os.uname()[1] except: import platform name = platform.uname()[1] from petsc4py.PETSc import COMM_WORLD rank = COMM_WORLD.getRank() return (rank, name) def getlibraryinfo(): from petsc4py import PETSc (major, minor, micro) = PETSc.Sys.getVersion() r = PETSc.Sys.getVersionInfo()['release'] if r: release = 'release' else: release = 'development' arch = PETSc.__arch__ return ("PETSc %d.%d.%d %s (conf: '%s')" % (major, minor, micro, release, arch) ) def getpythoninfo(): x, y = sys.version_info[:2] return ("Python %d.%d (%s)" % (x, y, sys.executable)) def getpackageinfo(pkg): return ("%s %s (%s)" % (pkg.__name__, pkg.__version__, pkg.__path__[0])) def writeln(message='', endl='\n'): from petsc4py.PETSc import Sys Sys.syncPrint(message, endl=endl, flush=True) def print_banner(options, package): r, n = getprocessorinfo() fmt = "[%d@%s] %s" if options.verbose: writeln(fmt % (r, n, getpythoninfo())) writeln(fmt % (r, n, getlibraryinfo())) writeln(fmt % (r, n, getpackageinfo(package))) def load_tests(options, args): from glob import glob import re testsuitedir = os.path.dirname(__file__) sys.path.insert(0, testsuitedir) pattern = 'test_*.py' wildcard = os.path.join(testsuitedir, pattern) testfiles = glob(wildcard) testfiles.sort() testsuite = unittest.TestSuite() testloader = unittest.TestLoader() include = exclude = None if options.include: include = re.compile('|'.join(options.include)).search if options.exclude: exclude = re.compile('|'.join(options.exclude)).search for testfile in testfiles: filename = os.path.basename(testfile) testname = os.path.splitext(filename)[0] if ((exclude and exclude(testname)) or (include and not include(testname))): continue module = __import__(testname) for arg in args: try: cases = testloader.loadTestsFromNames((arg,), module) testsuite.addTests(cases) except AttributeError: pass if not args: cases = testloader.loadTestsFromModule(module) testsuite.addTests(cases) return testsuite def run_tests(options, testsuite, runner=None): if runner is None: runner = unittest.TextTestRunner(verbosity=options.verbose) runner.failfast = options.failfast result = runner.run(testsuite) return result.wasSuccessful() def test_refleaks(options, args): from sys import gettotalrefcount from gc import collect from copy import deepcopy testsuite = load_tests(options, args) class EmptyIO(object): def write(self, *args): pass runner = unittest.TextTestRunner(stream=EmptyIO(), verbosity=0) rank, name = getprocessorinfo() r1 = r2 = 0 repeats = options.repeats while repeats: collect() r1 = gettotalrefcount() run_tests(options, deepcopy(testsuite), runner) collect() r2 = gettotalrefcount() leaks = r2-r1 if leaks and repeats < options.repeats: writeln('[%d@%s] refleaks: (%d - %d) --> %d' % (rank, name, r2, r1, leaks)) repeats -= 1 def abort(code=1): os.abort() def shutdown(success): pass def main(args=None): pkgname = 'petsc4py' parser = getoptionparser() (options, args) = parser.parse_args(args) setup_python(options) setup_unittest(options) package = import_package(options, pkgname) print_banner(options, package) testsuite = load_tests(options, args) success = run_tests(options, testsuite) if not success and options.failfast: abort() if success and hasattr(sys, 'gettotalrefcount'): test_refleaks(options, args) shutdown(success) return not success if __name__ == '__main__': import sys sys.dont_write_bytecode = True sys.exit(main()) petsc4py-3.15.1/test/test_ksp_py.py0000644000175000017500000000535713750315427017474 0ustar balaybalay00000000000000# -------------------------------------------------------------------- from petsc4py import PETSc import unittest from sys import getrefcount # -------------------------------------------------------------------- class MyKSP(object): def __init__(self): pass def create(self, ksp): self.work = [] def destroy(self, ksp): for v in self.work: v.destroy() def setUp(self, ksp): self.work[:] = ksp.getWorkVecs(right=2, left=None) def reset(self, ksp): for v in self.work: v.destroy() del self.work[:] def loop(self, ksp, r): its = ksp.getIterationNumber() rnorm = r.norm() ksp.setResidualNorm(rnorm) ksp.logConvergenceHistory(rnorm) ksp.monitor(its, rnorm) reason = ksp.callConvergenceTest(its, rnorm) if not reason: ksp.setIterationNumber(its+1) else: ksp.setConvergedReason(reason) return reason class MyRichardson(MyKSP): def solve(self, ksp, b, x): A, B = ksp.getOperators() P = ksp.getPC() r, z = self.work # A.mult(x, r) r.aypx(-1, b) P.apply(r, z) x.axpy(1, z) while not self.loop(ksp, z): A.mult(x, r) r.aypx(-1, b) P.apply(r, z) x.axpy(1, z) class MyCG(MyKSP): def setUp(self, ksp): super(MyCG, self).setUp(ksp) d = self.work[0].duplicate() q = d.duplicate() self.work += [d, q] def solve(self, ksp, b, x): A, B = ksp.getOperators() P = ksp.getPC() r, z, d, q = self.work # A.mult(x, r) r.aypx(-1, b) r.copy(d) delta_0 = r.dot(r) delta = delta_0 while not self.loop(ksp, r): A.mult(d, q) alpha = delta / d.dot(q) x.axpy(+alpha, d) r.axpy(-alpha, q) delta_old = delta delta = r.dot(r) beta = delta / delta_old d.aypx(beta, r) # -------------------------------------------------------------------- from test_ksp import BaseTestKSP class BaseTestKSPPYTHON(BaseTestKSP): KSP_TYPE = PETSc.KSP.Type.PYTHON ContextClass = None def setUp(self): super(BaseTestKSPPYTHON, self).setUp() ctx = self.ContextClass() self.ksp.setPythonContext(ctx) class TestKSPPYTHON_RICH(BaseTestKSPPYTHON, unittest.TestCase): PC_TYPE = PETSc.PC.Type.JACOBI ContextClass = MyRichardson class TestKSPPYTHON_CG(BaseTestKSPPYTHON, unittest.TestCase): PC_TYPE = PETSc.PC.Type.NONE ContextClass = MyCG # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_sys.py0000644000175000017500000000321713750315427016776 0ustar balaybalay00000000000000import unittest from petsc4py import PETSc # -------------------------------------------------------------------- class TestVersion(unittest.TestCase): def testGetVersion(self): version = PETSc.Sys.getVersion() self.assertTrue(version > (0, 0, 0)) v, date = PETSc.Sys.getVersion(date=True) self.assertTrue(version == v) self.assertTrue(isinstance(date, str)) v, author = PETSc.Sys.getVersion(author=True) self.assertTrue(version == v) self.assertTrue(isinstance(author, (list,tuple))) def testGetVersionInfo(self): version = PETSc.Sys.getVersion() info = PETSc.Sys.getVersionInfo() self.assertEqual(version, (info['major'], info['minor'], info['subminor'],)) self.assertTrue(isinstance(info['release'], bool)) v, date = PETSc.Sys.getVersion(date=True) self.assertEqual(date, info['date']) def testGetSetDefaultComm(self): c = PETSc.Sys.getDefaultComm() self.assertEqual(c, PETSc.COMM_WORLD) PETSc.Sys.setDefaultComm(PETSc.COMM_SELF) c = PETSc.Sys.getDefaultComm() self.assertEqual(c, PETSc.COMM_SELF) PETSc.Sys.setDefaultComm(PETSc.COMM_WORLD) c = PETSc.Sys.getDefaultComm() self.assertEqual(c, PETSc.COMM_WORLD) f = lambda : PETSc.Sys.setDefaultComm(PETSc.COMM_NULL) self.assertRaises(ValueError, f) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # -------------------------------------------------------------------- petsc4py-3.15.1/test/test_pc_py.py0000644000175000017500000002142413750315427017272 0ustar balaybalay00000000000000# -------------------------------------------------------------------- from petsc4py import PETSc import unittest from sys import getrefcount # -------------------------------------------------------------------- class BaseMyPC(object): def setup(self, pc): pass def reset(self, pc): pass def apply(self, pc, x, y): raise NotImplementedError def applyT(self, pc, x, y): self.apply(pc, x, y) def applyS(self, pc, x, y): self.apply(pc, x, y) def applySL(self, pc, x, y): self.applyS(pc, x, y) def applySR(self, pc, x, y): self.applyS(pc, x, y) def applyRich(self, pc, x, y, w, tols): self.apply(pc, x, y) class MyPCNone(BaseMyPC): def apply(self, pc, x, y): x.copy(y) class MyPCJacobi(BaseMyPC): def setup(self, pc): A, P = pc.getOperators() self.diag = P.getDiagonal() self.diag.reciprocal() def reset(self, pc): self.diag.destroy() del self.diag def apply(self, pc, x, y): y.pointwiseMult(self.diag, x) def applyS(self, pc, x, y): self.diag.copy(y) y.sqrtabs() y.pointwiseMult(y, x) class PC_PYTHON_CLASS(object): def __init__(self): self.impl = None self.log = {} def _log(self, method, *args): self.log.setdefault(method, 0) self.log[method] += 1 def create(self, pc): self._log('create', pc) def destroy(self, pc): self._log('destroy') self.impl = None def reset(self, pc): self._log('reset', pc) def view(self, pc, vw): self._log('view', pc, vw) assert isinstance(pc, PETSc.PC) assert isinstance(vw, PETSc.Viewer) pass def setFromOptions(self, pc): self._log('setFromOptions', pc) assert isinstance(pc, PETSc.PC) OptDB = PETSc.Options(pc) impl = OptDB.getString('impl','MyPCNone') klass = globals()[impl] self.impl = klass() def setUp(self, pc): self._log('setUp', pc) assert isinstance(pc, PETSc.PC) self.impl.setup(pc) def preSolve(self, pc, ksp, b, x): self._log('preSolve', pc, ksp, b, x) def postSolve(self, pc, ksp, b, x): self._log('postSolve', pc, ksp, b, x) def apply(self, pc, x, y): self._log('apply', pc, x, y) assert isinstance(pc, PETSc.PC) assert isinstance(x, PETSc.Vec) assert isinstance(y, PETSc.Vec) self.impl.apply(pc, x, y) def applySymmetricLeft(self, pc, x, y): self._log('applySymmetricLeft', pc, x, y) assert isinstance(pc, PETSc.PC) assert isinstance(x, PETSc.Vec) assert isinstance(y, PETSc.Vec) self.impl.applySL(pc, x, y) def applySymmetricRight(self, pc, x, y): self._log('applySymmetricRight', pc, x, y) assert isinstance(pc, PETSc.PC) assert isinstance(x, PETSc.Vec) assert isinstance(y, PETSc.Vec) self.impl.applySR(pc, x, y) def applyTranspose(self, pc, x, y): self._log('applyTranspose', pc, x, y) assert isinstance(pc, PETSc.PC) assert isinstance(x, PETSc.Vec) assert isinstance(y, PETSc.Vec) self.impl.applyT(pc, x, y) def applyRichardson(self, pc, x, y, w, tols): self._log('applyRichardson', pc, x, y, w, tols) assert isinstance(pc, PETSc.PC) assert isinstance(x, PETSc.Vec) assert isinstance(y, PETSc.Vec) assert isinstance(w, PETSc.Vec) assert isinstance(tols, tuple) assert len(tols) == 4 self.impl.applyRich(pc, x, y, w, tols) class TestPCPYTHON(unittest.TestCase): PC_TYPE = PETSc.PC.Type.PYTHON PC_PREFIX = 'test-' def setUp(self): pc = self.pc = PETSc.PC() pc.create(PETSc.COMM_SELF) pc.setType(self.PC_TYPE) module = __name__ factory = 'PC_PYTHON_CLASS' self.pc.prefix = self.PC_PREFIX OptDB = PETSc.Options(self.pc) assert OptDB.prefix == self.pc.prefix OptDB['pc_python_type'] = '%s.%s' % (module, factory) self.pc.setFromOptions() del OptDB['pc_python_type'] assert self._getCtx().log['create'] == 1 assert self._getCtx().log['setFromOptions'] == 1 ctx = self._getCtx() self.assertEqual(getrefcount(ctx), 3) def tearDown(self): ctx = self._getCtx() self.pc.destroy() # XXX self.pc = None assert ctx.log['destroy'] == 1 self.assertEqual(getrefcount(ctx), 2) def _prepare(self): A = PETSc.Mat().createAIJ([3,3], comm=PETSc.COMM_SELF) A.setUp() A.assemble() A.shift(10) x, y = A.createVecs() x.setRandom() self.pc.setOperators(A, A) assert (A,A) == self.pc.getOperators() return A, x, y def _getCtx(self): return self.pc.getPythonContext() def _applyMeth(self, meth): A, x, y = self._prepare() getattr(self.pc, meth)(x,y) if 'reset' not in self._getCtx().log: assert self._getCtx().log['setUp'] == 1 assert self._getCtx().log[meth] == 1 else: nreset = self._getCtx().log['reset'] nsetup = self._getCtx().log['setUp'] nmeth = self._getCtx().log[meth] assert (nreset == nsetup) assert (nreset == nmeth) if isinstance(self._getCtx().impl, MyPCNone): self.assertTrue(y.equal(x)) def testApply(self): self._applyMeth('apply') def testApplySymmetricLeft(self): self._applyMeth('applySymmetricLeft') def testApplySymmetricRight(self): self._applyMeth('applySymmetricRight') def testApplyTranspose(self): self._applyMeth('applyTranspose') ## def testApplyRichardson(self): ## x, y = self._prepare() ## w = x.duplicate() ## tols = 0,0,0,0 ## self.pc.applyRichardson(x,y,w,tols) ## assert self._getCtx().log['setUp'] == 1 ## assert self._getCtx().log['applyRichardson'] == 1 ## def testView(self): ## vw = PETSc.ViewerString(100, self.pc.comm) ## self.pc.view(vw) ## s = vw.getString() ## assert 'python' in s ## module = __name__ ## factory = 'self._getCtx()' ## assert '.'.join([module, factory]) in s def testResetAndApply(self): self.pc.reset() self.testApply() self.pc.reset() self.testApply() self.pc.reset() def testKSPSolve(self): A, x, y = self._prepare() ksp = PETSc.KSP().create(self.pc.comm) ksp.setType(PETSc.KSP.Type.PREONLY) assert self.pc.getRefCount() == 1 ksp.setPC(self.pc) assert self.pc.getRefCount() == 2 # normal ksp solve, twice ksp.solve(x,y) assert self._getCtx().log['setUp' ] == 1 assert self._getCtx().log['apply' ] == 1 assert self._getCtx().log['preSolve' ] == 1 assert self._getCtx().log['postSolve'] == 1 ksp.solve(x,y) assert self._getCtx().log['setUp' ] == 1 assert self._getCtx().log['apply' ] == 2 assert self._getCtx().log['preSolve' ] == 2 assert self._getCtx().log['postSolve'] == 2 # transpose ksp solve, twice ksp.solveTranspose(x,y) assert self._getCtx().log['setUp' ] == 1 assert self._getCtx().log['applyTranspose'] == 1 ksp.solveTranspose(x,y) assert self._getCtx().log['setUp' ] == 1 assert self._getCtx().log['applyTranspose'] == 2 del ksp # ksp.destroy() assert self.pc.getRefCount() == 1 def testGetSetContext(self): ctx = self.pc.getPythonContext() self.pc.setPythonContext(ctx) self.assertEqual(getrefcount(ctx), 3) del ctx class TestPCPYTHON2(TestPCPYTHON): def setUp(self): OptDB = PETSc.Options(self.PC_PREFIX) OptDB['impl'] = 'MyPCJacobi' super(TestPCPYTHON2, self).setUp() clsname = type(self._getCtx().impl).__name__ assert clsname == OptDB['impl'] del OptDB['impl'] class TestPCPYTHON3(TestPCPYTHON): def setUp(self): pc = self.pc = PETSc.PC() ctx = PC_PYTHON_CLASS() pc.createPython(ctx, comm=PETSc.COMM_SELF) self.pc.prefix = self.PC_PREFIX self.pc.setFromOptions() assert self._getCtx().log['create'] == 1 assert self._getCtx().log['setFromOptions'] == 1 class TestPCPYTHON4(TestPCPYTHON3): def setUp(self): OptDB = PETSc.Options(self.PC_PREFIX) OptDB['impl'] = 'MyPCJacobi' super(TestPCPYTHON4, self).setUp() clsname = type(self._getCtx().impl).__name__ assert clsname == OptDB['impl'] del OptDB['impl'] # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_comm.py0000644000175000017500000000572613750315427017122 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class TestComm(unittest.TestCase): def testInit(self): comm_null1 = PETSc.Comm() comm_null2 = PETSc.Comm(PETSc.COMM_NULL) comm_world = PETSc.Comm(PETSc.COMM_WORLD) comm_self = PETSc.Comm(PETSc.COMM_SELF) self.assertEqual(comm_null1, PETSc.COMM_NULL) self.assertEqual(comm_null2, PETSc.COMM_NULL) self.assertEqual(comm_world, PETSc.COMM_WORLD) self.assertEqual(comm_self, PETSc.COMM_SELF) def testDupDestr(self): self.assertRaises(ValueError, PETSc.COMM_NULL.duplicate) comm = PETSc.COMM_SELF.duplicate() comm.destroy() self.assertEqual(comm, PETSc.COMM_NULL) del comm comm = PETSc.COMM_WORLD.duplicate() comm.destroy() self.assertEqual(comm, PETSc.COMM_NULL) del comm def testBarrier(self): self.assertRaises(ValueError, PETSc.COMM_NULL.barrier) PETSc.COMM_SELF.barrier() PETSc.COMM_WORLD.barrier() def testSize(self): self.assertRaises(ValueError, PETSc.COMM_NULL.getSize) self.assertTrue(PETSc.COMM_WORLD.getSize() >= 1) self.assertEqual(PETSc.COMM_SELF.getSize(), 1) def testRank(self): self.assertRaises(ValueError, PETSc.COMM_NULL.getRank) self.assertEqual(PETSc.COMM_SELF.getRank(), 0) self.assertTrue(PETSc.COMM_WORLD.getRank() >= 0) def testProperties(self): self.assertEqual(PETSc.COMM_SELF.getSize(), PETSc.COMM_SELF.size) self.assertEqual(PETSc.COMM_SELF.getRank(), PETSc.COMM_SELF.rank) self.assertEqual(PETSc.COMM_WORLD.getSize(), PETSc.COMM_WORLD.size) self.assertEqual(PETSc.COMM_WORLD.getRank(), PETSc.COMM_WORLD.rank) def testCompatMPI4PY(self): try: from mpi4py import MPI except ImportError: return # mpi4py -> petsc4py cn = PETSc.Comm(MPI.COMM_NULL) cs = PETSc.Comm(MPI.COMM_SELF) cw = PETSc.Comm(MPI.COMM_WORLD) self.assertEqual(cn, PETSc.COMM_NULL) self.assertEqual(cs, PETSc.COMM_SELF) self.assertEqual(cw, PETSc.COMM_WORLD) # petsc4py - > mpi4py cn = PETSc.COMM_NULL.tompi4py() self.assertTrue(isinstance(cn, MPI.Comm)) self.assertFalse(cn) cs = PETSc.COMM_SELF.tompi4py() self.assertTrue(isinstance(cs, MPI.Intracomm)) self.assertEqual(cs.Get_size(), 1) self.assertEqual(cs.Get_rank(), 0) cw = PETSc.COMM_WORLD.tompi4py() self.assertTrue(isinstance(cw, MPI.Intracomm)) self.assertEqual(cw.Get_size(), PETSc.COMM_WORLD.getSize()) self.assertEqual(cw.Get_rank(), PETSc.COMM_WORLD.getRank()) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_lgmap.py0000644000175000017500000001067713750315427017270 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class BaseTestLGMap(object): def _mk_idx(self, comm): comm_size = comm.getSize() comm_rank = comm.getRank() lsize = 10 first = lsize * comm_rank last = first + lsize if comm_rank > 0: first -= 1 if comm_rank < (comm_size-1): last += 1 return list(range(first, last)) def tearDown(self): self.lgmap = None def testGetSize(self): size = self.lgmap.getSize() self.assertTrue(size >= 0) def testGetIndices(self): size = self.lgmap.getSize() idx = self.lgmap.getIndices() self.assertEqual(len(idx), size) for i, val in enumerate(self.idx): self.assertEqual(idx[i], val) def testGetInfo(self): info = self.lgmap.getInfo() self.assertEqual(type(info), dict) if self.lgmap.getComm().getSize() == 1: self.assertEqual(info, {}) else: self.assertTrue(len(info) > 1) self.assertTrue(len(info) < 4) def testApply(self): idxin = list(range(self.lgmap.getSize())) idxout = self.lgmap.apply(idxin) self.lgmap.apply(idxin, idxout) invmap = self.lgmap.applyInverse(idxout) def testApplyIS(self): is_in = PETSc.IS().createStride(self.lgmap.getSize()) is_out = self.lgmap.apply(is_in) def testProperties(self): for prop in ('size', 'indices', 'info'): self.assertTrue(hasattr(self.lgmap, prop)) # -------------------------------------------------------------------- class TestLGMap(BaseTestLGMap, unittest.TestCase): def setUp(self): self.idx = self._mk_idx(PETSc.COMM_WORLD) self.lgmap = PETSc.LGMap().create(self.idx, comm=PETSc.COMM_WORLD) class TestLGMapIS(BaseTestLGMap, unittest.TestCase): def setUp(self): self.idx = self._mk_idx(PETSc.COMM_WORLD) self.iset = PETSc.IS().createGeneral(self.idx, comm=PETSc.COMM_WORLD) self.lgmap = PETSc.LGMap().create(self.iset) def tearDown(self): self.iset = None self.lgmap = None def testSameComm(self): comm1 = self.lgmap.getComm() comm2 = self.iset.getComm() self.assertEqual(comm1, comm2) # -------------------------------------------------------------------- class TestLGMapBlock(unittest.TestCase): BS = 3 def setUp(self): comm = PETSc.COMM_WORLD comm_size = comm.getSize() comm_rank = comm.getRank() lsize = 10 first = lsize * comm_rank last = first + lsize if comm_rank > 0: first -= 1 if comm_rank < (comm_size-1): last += 1 self.idx = list(range(first, last)) bs = self.BS self.lgmap = PETSc.LGMap().create(self.idx, bs, comm=PETSc.COMM_WORLD) def tearDown(self): self.lgmap = None def testGetSize(self): size = self.lgmap.getSize() self.assertTrue(size >= 0) def testGetBlockSize(self): bs = self.lgmap.getBlockSize() self.assertEqual(bs, self.BS) def testGetBlockIndices(self): size = self.lgmap.getSize() bs = self.lgmap.getBlockSize() idx = self.lgmap.getBlockIndices() self.assertEqual(len(idx), size//bs) for i, val in enumerate(self.idx): self.assertEqual(idx[i], val) def testGetIndices(self): size = self.lgmap.getSize() bs = self.lgmap.getBlockSize() idx = self.lgmap.getIndices() self.assertEqual(len(idx), size) for i, val in enumerate(self.idx): for j in range(bs): self.assertEqual(idx[i*bs+j], val*bs+j) def testGetBlockInfo(self): info = self.lgmap.getBlockInfo() self.assertEqual(type(info), dict) if self.lgmap.getComm().getSize() == 1: self.assertEqual(info, {}) else: self.assertTrue(len(info) > 1) self.assertTrue(len(info) < 4) def testGetInfo(self): info = self.lgmap.getInfo() self.assertEqual(type(info), dict) if self.lgmap.getComm().getSize() == 1: self.assertEqual(info, {}) else: self.assertTrue(len(info) > 1) self.assertTrue(len(info) < 4) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_mat_aij.py0000644000175000017500000007000513750315427017563 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest import numpy as N import numpy as np def mkgraph(comm, m, n): start = m*n * comm.rank end = start + m*n idt = PETSc.IntType rows = [] for I in range(start, end) : rows.append([]) adj = rows[-1] i = I//n; j = I - i*n if i> 0 : J = I-n; adj.append(J) if j> 0 : J = I-1; adj.append(J) adj.append(I) if j< n-1: J = I+1; adj.append(J) if i< m-1: J = I+n; adj.append(J) nods = N.array(range(start, end), dtype=idt) xadj = N.array([0]*(len(rows)+1), dtype=idt) xadj[0] = 0 xadj[1:] = N.cumsum([len(r) for r in rows], dtype=idt) if not rows: adjy = N.array([],dtype=idt) else: adjy = N.concatenate(rows).astype(idt) return nods, xadj, adjy class BaseTestMatAnyAIJ(object): COMM = PETSc.COMM_NULL TYPE = None GRID = 0, 0 BSIZE = None def setUp(self): COMM = self.COMM GM, GN = self.GRID BS = self.BSIZE # try: rbs, cbs = BS rbs = rbs or 1 cbs = cbs or 1 except (TypeError, ValueError): rbs = cbs = BS or 1 sdt = dtype = PETSc.ScalarType self.rows, self.xadj, self.adjy = mkgraph(COMM, GM, GN) self.vals = N.array(range(1, 1 + len(self.adjy)* rbs*cbs), dtype=sdt) self.vals.shape = (-1, rbs, cbs) # m, n = GM, GN rowsz = (m*n*rbs, None) colsz = (m*n*cbs, None) A = self.A = PETSc.Mat().create(comm=COMM) A.setType(self.TYPE) A.setSizes([rowsz, colsz], BS) def tearDown(self): self.A.destroy() self.A = None def testSetPreallocNNZ(self): nnz = [5, 2] self.A.setPreallocationNNZ(nnz) self._chk_bs(self.A, self.BSIZE) opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) def testSetPreallocNNZ_2(self): _, ai, _, _ =self._get_aijv() d_nnz = N.diff(ai) nnz = [d_nnz, 3] self.A.setPreallocationNNZ(nnz) self._chk_bs(self.A, self.BSIZE) opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av =self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) def testSetPreallocCSR(self): _, ai, aj, _ = self._get_aijv() csr = [ai, aj] self.A.setPreallocationCSR(csr) self._chk_bs(self.A, self.BSIZE) self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) def testSetPreallocCSR_2(self): _, ai, aj, av =self._get_aijv() csr = [ai, aj, av] self.A.setPreallocationCSR(csr) self._chk_bs(self.A, self.BSIZE) self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) def testSetValues(self): self._preallocate() opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) def testSetValuesIJV(self): self._preallocate() opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) def testGetValuesCSR(self): self._preallocate() self._set_values_ijv() A = self.A A.assemble() if 'sbaij' in A.getType(): opt = PETSc.Mat.Option.GETROW_UPPERTRIANGULAR self.A.setOption(opt, True) ai, aj, av = A.getValuesCSR() rstart, rend = A.getOwnershipRange() for row in range(rstart, rend): cols, vals = A.getRow(row) i = row - rstart self.assertTrue(N.allclose(aj[ai[i]:ai[i+1]], cols)) self.assertTrue(N.allclose(av[ai[i]:ai[i+1]], vals)) def testConvertToSAME(self): self._preallocate() self._set_values_ijv() A = self.A A.assemble() A.convert('same') def testConvertToDENSE(self): self._preallocate() self._set_values_ijv() A = self.A A.assemble() x, y = A.getVecs() x.setRandom() z = y.duplicate() A.mult(x, y) if A.type.endswith('sbaij'): return B = PETSc.Mat() A.convert('dense', B) # initial B.mult(x, z) self.assertTrue(np.allclose(y.array, z.array)) A.convert('dense', B) # reuse B.mult(x, z) self.assertTrue(np.allclose(y.array, z.array)) A.convert('dense') # inplace A.mult(x, z) self.assertTrue(np.allclose(y.array, z.array)) def testConvertToAIJ(self): self._preallocate() self._set_values_ijv() A = self.A A.assemble() x, y = A.getVecs() x.setRandom() z = y.duplicate() A.mult(x, y) if A.type.endswith('sbaij'): return B = PETSc.Mat() A.convert('aij', B) # initial B.mult(x, z) self.assertTrue(np.allclose(y.array, z.array)) A.convert('aij', B) # reuse B.mult(x, z) self.assertTrue(np.allclose(y.array, z.array)) A.convert('aij') # inplace A.mult(x, z) self.assertTrue(np.allclose(y.array, z.array)) def testGetDiagonalBlock(self): self._preallocate() self._set_values_ijv() self.A.assemble() B = self.A.getDiagonalBlock() self.assertEqual(self.A.getLocalSize(), B.getSize()) B.destroy() def testInvertBlockDiagonal(self): try: _ = len(self.BSIZE) return except (TypeError, ValueError): pass self._preallocate() rbs, cbs = self.A.getBlockSizes() if rbs != cbs: return self._set_values_ijv() self.A.assemble() self.A.shift(1000) # Make nonsingular ibdiag = self.A.invertBlockDiagonal() bs = self.A.getBlockSize() m, _ = self.A.getLocalSize() self.assertEqual(ibdiag.shape, (m//bs, bs, bs)) tmp = N.empty((m//bs, bs, bs), dtype=PETSc.ScalarType) rstart, rend = self.A.getOwnershipRange() s, e = rstart//bs, rend//bs for i in range(s, e): rows = cols = N.arange(i*bs,(i+1)*bs, dtype=PETSc.IntType) vals = self.A.getValues(rows,cols) tmp[i-s,:,:] = N.linalg.inv(vals) self.assertTrue(N.allclose(ibdiag, tmp)) def testCreateSubMatrix(self): if 'baij' in self.A.getType(): return # XXX self._preallocate() self._set_values_ijv() self.A.assemble() # rank = self.A.getComm().getRank() rs, re = self.A.getOwnershipRange() cs, ce = self.A.getOwnershipRangeColumn() rows = N.array(range(rs, re), dtype=PETSc.IntType) cols = N.array(range(cs, ce), dtype=PETSc.IntType) rows = PETSc.IS().createGeneral(rows, comm=self.A.getComm()) cols = PETSc.IS().createGeneral(cols, comm=self.A.getComm()) # S = self.A.createSubMatrix(rows, None) S.zeroEntries() self.A.createSubMatrix(rows, None, S) S.destroy() # S = self.A.createSubMatrix(rows, cols) S.zeroEntries() self.A.createSubMatrix(rows, cols, S) S.destroy() def testCreateSubMatrices(self): if 'baij' in self.A.getType(): return # XXX self._preallocate() self._set_values_ijv() self.A.assemble() # rs, re = self.A.getOwnershipRange() cs, ce = self.A.getOwnershipRangeColumn() rows = N.array(range(rs, re), dtype=PETSc.IntType) cols = N.array(range(cs, ce), dtype=PETSc.IntType) rows = PETSc.IS().createGeneral(rows, comm=self.A.getComm()) cols = PETSc.IS().createGeneral(cols, comm=self.A.getComm()) # (S,) = self.A.createSubMatrices(rows, cols) S.zeroEntries() self.A.createSubMatrices(rows, cols, submats=[S]) S.destroy() # (S1,) = self.A.createSubMatrices([rows], [cols]) (S2,) = self.A.createSubMatrices([rows], [cols]) self.assertTrue(S1.equal(S2)) S2.zeroEntries() self.A.createSubMatrices([rows], [cols], [S2]) self.assertTrue(S1.equal(S2)) S1.destroy() S2.destroy() # if 'seq' not in self.A.getType(): return # XXX S1, S2 = self.A.createSubMatrices([rows, rows], [cols, cols]) self.assertTrue(S1.equal(S2)) S1.zeroEntries() S2.zeroEntries() self.A.createSubMatrices([rows, rows], [cols, cols], [S1, S2]) self.assertTrue(S1.equal(S2)) S1.destroy() S2.destroy() def testGetRedundantMatrix(self): if 'aijcrl' in self.A.getType(): return # duplicate not supported if 'mpisbaij' in self.A.getType(): return # not working self._preallocate() self._set_values_ijv() self.A.assemble() #Test the most simple case sizecommA = self.A.getComm().getSize() Ared = self.A.getRedundantMatrix(sizecommA) sizecommAred = Ared.getComm().getSize() self.assertEqual(1, sizecommAred) Ared.destroy() def testCreateTranspose(self): self._preallocate() self._set_values_ijv() self.A.assemble() A = self.A AT = PETSc.Mat().createTranspose(A) x, y = A.createVecs() xt, yt = AT.createVecs() # y.setRandom() A.multTranspose(y, x) y.copy(xt) AT.mult(xt, yt) self.assertTrue(yt.equal(x)) # x.setRandom() A.mult(x, y) x.copy(yt) AT.multTranspose(yt, xt) self.assertTrue(xt.equal(y)) def _get_aijv(self): return (self.rows, self.xadj, self.adjy, self.vals,) def _preallocate(self): self.A.setPreallocationNNZ([5, 2]) def _set_values(self): import sys if hasattr(sys, 'gettotalrefcount'): return self._set_values_ijv() # XXX Why the code below leak refs as a beast ??? row, ai, aj, av =self._get_aijv() if not self.BSIZE: setvalues = self.A.setValues else: setvalues = self.A.setValuesBlocked for i, r in enumerate(row): s, e = ai[i], ai[i+1] setvalues(r, aj[s:e], av[s:e]) return ai, aj, av def _set_values_ijv(self): row, ai, aj, av =self._get_aijv() if not self.BSIZE: setvalues = self.A.setValuesIJV else: setvalues = self.A.setValuesBlockedIJV setvalues(ai, aj, av, rowmap=row) setvalues(ai, aj, av, rowmap=None) return ai, aj, av def _chk_bs(self, A, bs): self.assertEqual(A.getBlockSize(), bs or 1) def _chk_bsizes(self, A, bsizes): try: rbs, cbs = bsizes except (TypeError, ValueError): rbs = cbs = bsizes self.assertEqual(A.getBlockSizes(), (rbs, cbs)) def _chk_aij(self, A, i, j): compressed = bool(self.BSIZE) ai, aj = A.getRowIJ(compressed=compressed) if ai is not None and aj is not None: self.assertTrue(N.all(i==ai)) self.assertTrue(N.all(j==aj)) ai, aj = A.getColumnIJ(compressed=compressed) if ai is not None and aj is not None: self.assertTrue(N.all(i==ai)) self.assertTrue(N.all(j==aj)) # -- AIJ --------------------- class BaseTestMatAIJ(BaseTestMatAnyAIJ, unittest.TestCase): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.AIJ GRID = 0, 0 BSIZE = None # -- Seq AIJ -- class TestMatSeqAIJ(BaseTestMatAIJ): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQAIJ class TestMatSeqAIJ_G23(TestMatSeqAIJ): GRID = 2, 3 class TestMatSeqAIJ_G45(TestMatSeqAIJ): GRID = 4, 5 class TestMatSeqAIJ_G89(TestMatSeqAIJ): GRID = 8, 9 # -- MPI AIJ -- class TestMatMPIAIJ(BaseTestMatAIJ): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPIAIJ class TestMatMPIAIJ_G23(TestMatMPIAIJ): GRID = 2, 3 class TestMatMPIAIJ_G45(TestMatMPIAIJ): GRID = 4, 5 class TestMatMPIAIJ_G89(TestMatMPIAIJ): GRID = 8, 9 # -- Block AIJ --------------- class BaseTestMatBAIJ(BaseTestMatAnyAIJ, unittest.TestCase): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.BAIJ GRID = 0, 0 BSIZE = 1 # -- Seq Block AIJ -- class TestMatSeqBAIJ(BaseTestMatBAIJ): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQBAIJ # bs = 1 class TestMatSeqBAIJ_G23(TestMatSeqBAIJ): GRID = 2, 3 class TestMatSeqBAIJ_G45(TestMatSeqBAIJ): GRID = 4, 5 class TestMatSeqBAIJ_G89(TestMatSeqBAIJ): GRID = 8, 9 # bs = 2 class TestMatSeqBAIJ_G23_B2(TestMatSeqBAIJ_G23): BSIZE = 2 class TestMatSeqBAIJ_G45_B2(TestMatSeqBAIJ_G45): BSIZE = 2 class TestMatSeqBAIJ_G89_B2(TestMatSeqBAIJ_G89): BSIZE = 2 # bs = 3 class TestMatSeqBAIJ_G23_B3(TestMatSeqBAIJ_G23): BSIZE = 3 class TestMatSeqBAIJ_G45_B3(TestMatSeqBAIJ_G45): BSIZE = 3 class TestMatSeqBAIJ_G89_B3(TestMatSeqBAIJ_G89): BSIZE = 3 # bs = 4 class TestMatSeqBAIJ_G23_B4(TestMatSeqBAIJ_G23): BSIZE = 4 class TestMatSeqBAIJ_G45_B4(TestMatSeqBAIJ_G45): BSIZE = 4 class TestMatSeqBAIJ_G89_B4(TestMatSeqBAIJ_G89): BSIZE = 4 # bs = 5 class TestMatSeqBAIJ_G23_B5(TestMatSeqBAIJ_G23): BSIZE = 5 class TestMatSeqBAIJ_G45_B5(TestMatSeqBAIJ_G45): BSIZE = 5 class TestMatSeqBAIJ_G89_B5(TestMatSeqBAIJ_G89): BSIZE = 5 # -- MPI Block AIJ -- class TestMatMPIBAIJ(BaseTestMatBAIJ): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPIBAIJ # bs = 1 class TestMatMPIBAIJ_G23(TestMatMPIBAIJ): GRID = 2, 3 class TestMatMPIBAIJ_G45(TestMatMPIBAIJ): GRID = 4, 5 class TestMatMPIBAIJ_G89(TestMatMPIBAIJ): GRID = 8, 9 # bs = 2 class TestMatMPIBAIJ_G23_B2(TestMatMPIBAIJ_G23): BSIZE = 2 class TestMatMPIBAIJ_G45_B2(TestMatMPIBAIJ_G45): BSIZE = 2 class TestMatMPIBAIJ_G89_B2(TestMatMPIBAIJ_G89): BSIZE = 2 # bs = 3 class TestMatMPIBAIJ_G23_B3(TestMatMPIBAIJ_G23): BSIZE = 3 class TestMatMPIBAIJ_G45_B3(TestMatMPIBAIJ_G45): BSIZE = 3 class TestMatMPIBAIJ_G89_B3(TestMatMPIBAIJ_G89): BSIZE = 3 # bs = 4 class TestMatMPIBAIJ_G23_B4(TestMatMPIBAIJ_G23): BSIZE = 4 class TestMatMPIBAIJ_G45_B4(TestMatMPIBAIJ_G45): BSIZE = 4 class TestMatMPIBAIJ_G89_B4(TestMatMPIBAIJ_G89): BSIZE = 4 # bs = 5 class TestMatMPIBAIJ_G23_B5(TestMatMPIBAIJ_G23): BSIZE = 5 class TestMatMPIBAIJ_G45_B5(TestMatMPIBAIJ_G45): BSIZE = 5 class TestMatMPIBAIJ_G89_B5(TestMatMPIBAIJ_G89): BSIZE = 5 # -- SymmBlock AIJ --------------- class BaseTestMatSBAIJ(BaseTestMatAnyAIJ, unittest.TestCase): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.SBAIJ GRID = 0, 0 BSIZE = 1 def testInvertBlockDiagonal(self): pass def _chk_aij(self, A, i, j): ai, aj = A.getRowIJ(compressed=True) if ai is not None and aj is not None: if 0: # XXX Implement self.assertTrue(N.all(i==ai)) self.assertTrue(N.all(j==aj)) ai, aj = A.getColumnIJ(compressed=True) if ai is not None and aj is not None: if 0: # XXX Implement self.assertTrue(N.all(i==ai)) self.assertTrue(N.all(j==aj)) # -- Seq SymmBlock AIJ -- class TestMatSeqSBAIJ(BaseTestMatSBAIJ): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQSBAIJ # bs = 1 class TestMatSeqSBAIJ_G23(TestMatSeqSBAIJ): GRID = 2, 3 class TestMatSeqSBAIJ_G45(TestMatSeqSBAIJ): GRID = 4, 5 class TestMatSeqSBAIJ_G89(TestMatSeqSBAIJ): GRID = 8, 9 # bs = 2 class TestMatSeqSBAIJ_G23_B2(TestMatSeqSBAIJ_G23): BSIZE = 2 class TestMatSeqSBAIJ_G45_B2(TestMatSeqSBAIJ_G45): BSIZE = 2 class TestMatSeqSBAIJ_G89_B2(TestMatSeqSBAIJ_G89): BSIZE = 2 # bs = 3 class TestMatSeqSBAIJ_G23_B3(TestMatSeqSBAIJ_G23): BSIZE = 3 class TestMatSeqSBAIJ_G45_B3(TestMatSeqSBAIJ_G45): BSIZE = 3 class TestMatSeqSBAIJ_G89_B3(TestMatSeqSBAIJ_G89): BSIZE = 3 # bs = 4 class TestMatSeqSBAIJ_G23_B4(TestMatSeqSBAIJ_G23): BSIZE = 4 class TestMatSeqSBAIJ_G45_B4(TestMatSeqSBAIJ_G45): BSIZE = 4 class TestMatSeqSBAIJ_G89_B4(TestMatSeqSBAIJ_G89): BSIZE = 4 # bs = 5 class TestMatSeqSBAIJ_G23_B5(TestMatSeqSBAIJ_G23): BSIZE = 5 class TestMatSeqSBAIJ_G45_B5(TestMatSeqSBAIJ_G45): BSIZE = 5 class TestMatSeqSBAIJ_G89_B5(TestMatSeqSBAIJ_G89): BSIZE = 5 # -- MPI SymmBlock AIJ -- class TestMatMPISBAIJ(BaseTestMatSBAIJ): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPISBAIJ # bs = 1 class TestMatMPISBAIJ_G23(TestMatMPISBAIJ): GRID = 2, 3 class TestMatMPISBAIJ_G45(TestMatMPISBAIJ): GRID = 4, 5 class TestMatMPISBAIJ_G89(TestMatMPISBAIJ): GRID = 8, 9 # bs = 2 class TestMatMPISBAIJ_G23_B2(TestMatMPISBAIJ_G23): BSIZE = 2 class TestMatMPISBAIJ_G45_B2(TestMatMPISBAIJ_G45): BSIZE = 2 class TestMatMPISBAIJ_G89_B2(TestMatMPISBAIJ_G89): BSIZE = 2 # bs = 3 class TestMatMPISBAIJ_G23_B3(TestMatMPISBAIJ_G23): BSIZE = 3 class TestMatMPISBAIJ_G45_B3(TestMatMPISBAIJ_G45): BSIZE = 3 class TestMatMPISBAIJ_G89_B3(TestMatMPISBAIJ_G89): BSIZE = 3 # bs = 4 class TestMatMPISBAIJ_G23_B4(TestMatMPISBAIJ_G23): BSIZE = 4 class TestMatMPISBAIJ_G45_B4(TestMatMPISBAIJ_G45): BSIZE = 4 class TestMatMPISBAIJ_G89_B4(TestMatMPISBAIJ_G89): BSIZE = 4 # bs = 5 class TestMatMPISBAIJ_G23_B5(TestMatMPISBAIJ_G23): BSIZE = 5 class TestMatMPISBAIJ_G45_B5(TestMatMPISBAIJ_G45): BSIZE = 5 class TestMatMPISBAIJ_G89_B5(TestMatMPISBAIJ_G89): BSIZE = 5 # -- AIJ + Block --------------- class BaseTestMatAIJ_B(BaseTestMatAnyAIJ, unittest.TestCase): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.AIJ GRID = 0, 0 BSIZE = 1 def testSetPreallocNNZ(self):pass def testSetPreallocNNZ_2(self):pass def testSetPreallocCSR(self):pass def testSetPreallocCSR_2(self):pass def testSetValues(self): self._preallocate() opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) def testSetValuesIJV(self): self._preallocate() opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) def _preallocate(self): self.A.setPreallocationNNZ([5*self.BSIZE, 3*self.BSIZE]) self._chk_bs(self.A, self.BSIZE) def _chk_aij(self, A, i, j): bs = self.BSIZE or 1 ai, aj = A.getRowIJ() if ai is not None and aj is not None: ## XXX map and check !! #self.assertTrue(N.all(i==ai)) #self.assertTrue(N.all(j==aj)) pass ai, aj = A.getColumnIJ(compressed=bool(self.BSIZE)) if ai is not None and aj is not None: ## XXX map and check !! #self.assertTrue(N.all(i==ai)) #self.assertTrue(N.all(j==aj)) pass # -- Seq AIJ + Block -- class TestMatSeqAIJ_B(BaseTestMatAIJ_B): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQAIJ # bs = 1 class TestMatSeqAIJ_B_G23(TestMatSeqAIJ_B): GRID = 2, 3 class TestMatSeqAIJ_B_G45(TestMatSeqAIJ_B): GRID = 4, 5 class TestMatSeqAIJ_B_G89(TestMatSeqAIJ_B): GRID = 8, 9 # bs = 2 class TestMatSeqAIJ_B_G23_B2(TestMatSeqAIJ_B_G23): BSIZE = 2 class TestMatSeqAIJ_B_G45_B2(TestMatSeqAIJ_B_G45): BSIZE = 2 class TestMatSeqAIJ_B_G89_B2(TestMatSeqAIJ_B_G89): BSIZE = 2 # bs = 3 class TestMatSeqAIJ_B_G23_B3(TestMatSeqAIJ_B_G23): BSIZE = 3 class TestMatSeqAIJ_B_G45_B3(TestMatSeqAIJ_B_G45): BSIZE = 3 class TestMatSeqAIJ_B_G89_B3(TestMatSeqAIJ_B_G89): BSIZE = 3 # bs = 4 class TestMatSeqAIJ_B_G23_B4(TestMatSeqAIJ_B_G23): BSIZE = 4 class TestMatSeqAIJ_B_G45_B4(TestMatSeqAIJ_B_G45): BSIZE = 4 class TestMatSeqAIJ_B_G89_B4(TestMatSeqAIJ_B_G89): BSIZE = 4 # bs = 5 class TestMatSeqAIJ_B_G23_B5(TestMatSeqAIJ_B_G23): BSIZE = 5 class TestMatSeqAIJ_B_G45_B5(TestMatSeqAIJ_B_G45): BSIZE = 5 class TestMatSeqAIJ_B_G89_B5(TestMatSeqAIJ_B_G89): BSIZE = 5 # -- MPI AIJ + Block -- class TestMatMPIAIJ_B(BaseTestMatAIJ_B): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPIAIJ # bs = 1 class TestMatMPIAIJ_B_G23(TestMatMPIAIJ_B): GRID = 2, 3 class TestMatMPIAIJ_B_G45(TestMatMPIAIJ_B): GRID = 4, 5 class TestMatMPIAIJ_B_G89(TestMatMPIAIJ_B): GRID = 8, 9 # bs = 2 class TestMatMPIAIJ_B_G23_B2(TestMatMPIAIJ_B_G23): BSIZE = 2 class TestMatMPIAIJ_B_G45_B2(TestMatMPIAIJ_B_G45): BSIZE = 2 class TestMatMPIAIJ_B_G89_B2(TestMatMPIAIJ_B_G89): BSIZE = 2 # bs = 3 class TestMatMPIAIJ_B_G23_B3(TestMatMPIAIJ_B_G23): BSIZE = 3 class TestMatMPIAIJ_B_G45_B3(TestMatMPIAIJ_B_G45): BSIZE = 3 class TestMatMPIAIJ_B_G89_B3(TestMatMPIAIJ_B_G89): BSIZE = 3 # bs = 4 class TestMatMPIAIJ_B_G23_B4(TestMatMPIAIJ_B_G23): BSIZE = 4 class TestMatMPIAIJ_B_G45_B4(TestMatMPIAIJ_B_G45): BSIZE = 4 class TestMatMPIAIJ_B_G89_B4(TestMatMPIAIJ_B_G89): BSIZE = 4 # bs = 5 class TestMatMPIAIJ_B_G23_B5(TestMatMPIAIJ_B_G23): BSIZE = 5 class TestMatMPIAIJ_B_G45_B5(TestMatMPIAIJ_B_G45): BSIZE = 5 class TestMatMPIAIJ_B_G89_B5(TestMatMPIAIJ_B_G89): BSIZE = 5 # -- Non-square blocks -- class BaseTestMatAIJ_B(BaseTestMatAnyAIJ, unittest.TestCase): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.AIJ GRID = 0, 0 BSIZE = 4, 2 def _preallocate(self): try: rbs, cbs = self.BSIZE except (TypeError, ValueError): rbs = cbs = self.BSIZE self.A.setPreallocationNNZ([5*rbs, 3*cbs]) self._chk_bsizes(self.A, self.BSIZE) def testSetPreallocNNZ(self):pass def testSetPreallocNNZ_2(self):pass def testSetPreallocCSR(self):pass def testSetPreallocCSR_2(self):pass def testSetValues(self): self._preallocate() opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values() self.A.assemble() self._chk_aij(self.A, ai, aj) def testSetValuesIJV(self): self._preallocate() opt = PETSc.Mat.Option.NEW_NONZERO_ALLOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) opt = PETSc.Mat.Option.NEW_NONZERO_LOCATION_ERR self.A.setOption(opt, True) ai, aj, av = self._set_values_ijv() self.A.assemble() self._chk_aij(self.A, ai, aj) def _chk_aij(self, A, i, j): bs = self.BSIZE or 1 ai, aj = A.getRowIJ() if ai is not None and aj is not None: ## XXX map and check !! #self.assertTrue(N.all(i==ai)) #self.assertTrue(N.all(j==aj)) pass ai, aj = A.getColumnIJ() if ai is not None and aj is not None: ## XXX map and check !! #self.assertTrue(N.all(i==ai)) #self.assertTrue(N.all(j==aj)) pass # -- AIJCRL --------------------- class BaseTestMatAIJCRL(BaseTestMatAIJ, unittest.TestCase): TYPE = PETSc.Mat.Type.AIJCRL # -- Seq AIJCRL -- class TestMatSeqAIJCRL(BaseTestMatAIJCRL): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQAIJCRL class TestMatSeqAIJCRL_G23(TestMatSeqAIJCRL): GRID = 2, 3 class TestMatSeqAIJCRL_G45(TestMatSeqAIJCRL): GRID = 4, 5 class TestMatSeqAIJCRL_G89(TestMatSeqAIJCRL): GRID = 8, 9 # -- MPI AIJCRL -- class TestMatMPIAIJCRL(BaseTestMatAIJCRL): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPIAIJCRL class TestMatMPIAIJCRL_G23(TestMatMPIAIJCRL): GRID = 2, 3 class TestMatMPIAIJCRL_G45(TestMatMPIAIJCRL): GRID = 4, 5 class TestMatMPIAIJCRL_G89(TestMatMPIAIJCRL): GRID = 8, 9 # -- AIJCRL + Block ------------- class BaseTestMatAIJCRL_B(BaseTestMatAIJ_B, unittest.TestCase): TYPE = PETSc.Mat.Type.AIJCRL # -- Seq AIJCRL + Block -- class TestMatSeqAIJCRL_B(BaseTestMatAIJCRL_B): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQAIJCRL # bs = 1 class TestMatSeqAIJCRL_B_G23(TestMatSeqAIJCRL_B): GRID = 2, 3 class TestMatSeqAIJCRL_B_G45(TestMatSeqAIJCRL_B): GRID = 4, 5 class TestMatSeqAIJCRL_B_G89(TestMatSeqAIJCRL_B): GRID = 8, 9 # bs = 2 class TestMatSeqAIJCRL_B_G23_B2(TestMatSeqAIJCRL_B_G23): BSIZE = 2 class TestMatSeqAIJCRL_B_G45_B2(TestMatSeqAIJCRL_B_G45): BSIZE = 2 class TestMatSeqAIJCRL_B_G89_B2(TestMatSeqAIJCRL_B_G89): BSIZE = 2 # bs = 3 class TestMatSeqAIJCRL_B_G23_B3(TestMatSeqAIJCRL_B_G23): BSIZE = 3 class TestMatSeqAIJCRL_B_G45_B3(TestMatSeqAIJCRL_B_G45): BSIZE = 3 class TestMatSeqAIJCRL_B_G89_B3(TestMatSeqAIJCRL_B_G89): BSIZE = 3 # bs = 4 class TestMatSeqAIJCRL_B_G23_B4(TestMatSeqAIJCRL_B_G23): BSIZE = 4 class TestMatSeqAIJCRL_B_G45_B4(TestMatSeqAIJCRL_B_G45): BSIZE = 4 class TestMatSeqAIJCRL_B_G89_B4(TestMatSeqAIJCRL_B_G89): BSIZE = 4 # bs = 5 class TestMatSeqAIJCRL_B_G23_B5(TestMatSeqAIJCRL_B_G23): BSIZE = 5 class TestMatSeqAIJCRL_B_G45_B5(TestMatSeqAIJCRL_B_G45): BSIZE = 5 class TestMatSeqAIJCRL_B_G89_B5(TestMatSeqAIJCRL_B_G89): BSIZE = 5 # -- MPI AIJCRL + Block -- class TestMatMPIAIJCRL_B(BaseTestMatAIJCRL_B): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPIAIJCRL # bs = 1 class TestMatMPIAIJCRL_B_G23(TestMatMPIAIJCRL_B): GRID = 2, 3 class TestMatMPIAIJCRL_B_G45(TestMatMPIAIJCRL_B): GRID = 4, 5 class TestMatMPIAIJCRL_B_G89(TestMatMPIAIJCRL_B): GRID = 8, 9 # bs = 2 class TestMatMPIAIJCRL_B_G23_B2(TestMatMPIAIJCRL_B_G23): BSIZE = 2 class TestMatMPIAIJCRL_B_G45_B2(TestMatMPIAIJCRL_B_G45): BSIZE = 2 class TestMatMPIAIJCRL_B_G89_B2(TestMatMPIAIJCRL_B_G89): BSIZE = 2 # bs = 3 class TestMatMPIAIJCRL_B_G23_B3(TestMatMPIAIJCRL_B_G23): BSIZE = 3 class TestMatMPIAIJCRL_B_G45_B3(TestMatMPIAIJCRL_B_G45): BSIZE = 3 class TestMatMPIAIJCRL_B_G89_B3(TestMatMPIAIJCRL_B_G89): BSIZE = 3 # bs = 4 class TestMatMPIAIJCRL_B_G23_B4(TestMatMPIAIJCRL_B_G23): BSIZE = 4 class TestMatMPIAIJCRL_B_G45_B4(TestMatMPIAIJCRL_B_G45): BSIZE = 4 class TestMatMPIAIJCRL_B_G89_B4(TestMatMPIAIJCRL_B_G89): BSIZE = 4 # bs = 5 class TestMatMPIAIJCRL_B_G23_B5(TestMatMPIAIJCRL_B_G23): BSIZE = 5 class TestMatMPIAIJCRL_B_G45_B5(TestMatMPIAIJCRL_B_G45): BSIZE = 5 class TestMatMPIAIJCRL_B_G89_B5(TestMatMPIAIJCRL_B_G89): BSIZE = 5 # ----- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_log.py0000644000175000017500000000733613750315427016747 0ustar balaybalay00000000000000# -------------------------------------------------------------------- if __name__ == "__main__": import sys, petsc4py petsc4py.init(sys.argv+['-log_summary']) # -------------------------------------------------------------------- from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class TestLog(unittest.TestCase): def setUp(self): #PETSc.Log.begin() # register stages self.stage1 = PETSc.Log.Stage('Stage 1') self.stage2 = PETSc.Log.Stage('Stage 2') # register classes self.klassA = PETSc.Log.Class('Class A') self.klassB = PETSc.Log.Class('Class B') # register events self.event1 = PETSc.Log.Event('Event 1') # no class self.event2 = PETSc.Log.Event('Event 2') # no class self.eventA = PETSc.Log.Event('Event A', self.klassA) self.eventB = PETSc.Log.Event('Event B', self.klassB) def testGetName(self): self.assertEqual(self.klassA.name, 'Class A') self.assertEqual(self.klassB.name, 'Class B') self.assertEqual(self.event1.name, 'Event 1') self.assertEqual(self.event2.name, 'Event 2') self.assertEqual(self.eventA.name, 'Event A') self.assertEqual(self.eventB.name, 'Event B') self.assertEqual(self.stage1.name, 'Stage 1') self.assertEqual(self.stage2.name, 'Stage 2') def testLogBeginEnd(self): # ----- self._run_events() # in main stage self._run_stages() # in user stages # ----- for event in self._get_events(): event.deactivate() event.setActive(False) event.active = False self._run_events() # should not be logged for event in self._get_events(): event.activate() event.setActive(True) event.active = True # ----- for klass in self._get_classes(): klass.deactivate() klass.setActive(False) klass.active = False self._run_events() # A and B should not be logged for klass in self._get_classes(): klass.activate() klass.setActive(True) klass.active = True # ----- for stage in self._get_stages(): active = stage.getActive() self.assertTrue(active) self.assertTrue(stage.active) stage.setActive(False) active = stage.getActive() self.assertFalse(active) self.assertFalse(stage.active) self._run_stages() # should not be logged for stage in self._get_stages(): stage.setActive(True) stage.active = True active = stage.getActive() self.assertTrue(active) self.assertTrue(stage.active) # ----- self._run_events() self._run_stages() def _run_stages(self): for stage in self._get_stages(): self._run_events(stage) def _get_stages(self): return (self.stage1, self.stage2) def _get_classes(self): return (self.klassA, self.klassB) def _get_events(self): return (self.event1, self.event2, self.eventA, self.eventB) def _run_events(self, stage=None): if stage is not None: stage.push() self._events_begin() self._events_end() if stage is not None: stage.pop() def _events_begin(self): for event in self._get_events(): event.begin() def _events_end(self): for event in reversed(self._get_events()): event.end() # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_mat_fact.py0000644000175000017500000001156113750315427017737 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest import numpy as N def mkmat(n, mtype, opts): A = PETSc.Mat().create(PETSc.COMM_SELF) A.setSizes([n,n]) A.setType(mtype) A.setUp() for o in opts: A.setOption(o, True) return A def mksys_diag(n, mtype, opts): A = mkmat(n, mtype, opts) x, b = A.createVecs() for i in range(n): A[i,i] = i+1 x[i] = 1.0/(i+1) b[i] = 1 A.assemble() x.assemble() b.assemble() return A, x, b def mksys_poi2(n, mtype, opts): A = mkmat(n, mtype, opts) x, b = A.createVecs() for i in range(n): if i == 0: cols = [i, i+1] vals = [2, -1] elif i == n-1: cols = [i-1, i] vals = [-1, 2] else: cols = [i-1, i, i+1] vals = [-1, 2, -1] A[i,cols] = vals x[i] = i+1 b[i] = 0 A.assemble() x.assemble() b.assemble() A.mult(x,b) return A, x, b class BaseTestMatFactor(object): MKSYS = None MTYPE = None MOPTS = () def setUp(self): A, x, b = self.MKSYS(10, self.MTYPE, self.MOPTS) self.A = A self.x = x self.b = b def tearDown(self): self.A.setUnfactored() self.A.destroy(); self.A = None self.x.destroy(); self.x = None self.b.destroy(); self.b = None class BaseTestMatFactorLU(BaseTestMatFactor): def testFactorLU(self): r, c = self.A.getOrdering("nd") self.A.reorderForNonzeroDiagonal(r, c) self.A.factorLU(r,c,{'zeropivot':1e-5}) x = self.x.duplicate() self.A.solve(self.b, x) x.axpy(-1, self.x) self.assertTrue(x.norm() < 1e-3) class BaseTestMatFactorILU(BaseTestMatFactor): def testFactorILU(self): r, c = self.A.getOrdering("natural") self.A.factorILU(r,c,{'levels':0}) x = self.x.duplicate() self.A.solve(self.b, x) x.axpy(-1, self.x) self.assertTrue(x.norm() < 1e-3) ## class BaseTestMatFactorILUDT(BaseTestMatFactor): ## ## def testFactorILUDT(self): ## r, c = self.A.getOrdering("natural") ## self.A = self.A.factorILUDT(r,c) ## x = self.x.duplicate() ## self.A.solve(self.b, x) ## x.axpy(-1, self.x) ## self.assertTrue(x.norm() < 1e-3) ## class BaseTestMatFactorChol(BaseTestMatFactor): def testFactorChol(self): r, c = self.A.getOrdering("natural") self.A.factorCholesky(r) x = self.x.duplicate() self.A.solve(self.b, x) x.axpy(-1, self.x) self.assertTrue(x.norm() < 1e-3) class BaseTestMatFactorICC(BaseTestMatFactor): def testFactorICC(self): r, c = self.A.getOrdering("natural") self.A.factorICC(r) x = self.x.duplicate() self.A.solve(self.b, x) x.axpy(-1, self.x) self.assertTrue(x.norm() < 1e-3) # -------------------------------------------------------------------- class TestMatFactorA1(BaseTestMatFactorLU, BaseTestMatFactorChol, unittest.TestCase): MKSYS = staticmethod(mksys_diag) MTYPE = PETSc.Mat.Type.SEQDENSE class TestMatFactorA2(BaseTestMatFactorLU, BaseTestMatFactorChol, unittest.TestCase): MKSYS = staticmethod(mksys_poi2) MTYPE = PETSc.Mat.Type.SEQDENSE # --- class TestMatFactorB1(BaseTestMatFactorLU, BaseTestMatFactorILU, ## BaseTestMatFactorILUDT, unittest.TestCase): MKSYS = staticmethod(mksys_diag) MTYPE = PETSc.Mat.Type.SEQAIJ class TestMatFactorB2(BaseTestMatFactorLU, BaseTestMatFactorILU, ## BaseTestMatFactorILUDT, unittest.TestCase): MKSYS = staticmethod(mksys_poi2) MTYPE = PETSc.Mat.Type.SEQAIJ # --- class TestMatFactorC1(BaseTestMatFactorLU, BaseTestMatFactorILU, unittest.TestCase): MKSYS = staticmethod(mksys_diag) MTYPE = PETSc.Mat.Type.SEQBAIJ class TestMatFactorC2(BaseTestMatFactorLU, BaseTestMatFactorILU, unittest.TestCase): MKSYS = staticmethod(mksys_poi2) MTYPE = PETSc.Mat.Type.SEQBAIJ # --- class TestMatFactorD1(BaseTestMatFactorChol, BaseTestMatFactorICC, unittest.TestCase): MKSYS = staticmethod(mksys_diag) MTYPE = PETSc.Mat.Type.SEQSBAIJ MOPTS = [PETSc.Mat.Option.IGNORE_LOWER_TRIANGULAR] class TestMatFactorD2(BaseTestMatFactorChol, BaseTestMatFactorICC, unittest.TestCase): MKSYS = staticmethod(mksys_poi2) MTYPE = PETSc.Mat.Type.SEQSBAIJ MOPTS = [PETSc.Mat.Option.IGNORE_LOWER_TRIANGULAR] # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_gc.py0000644000175000017500000000460713750315427016555 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest import gc, weakref import warnings # -------------------------------------------------------------------- ## gc.set_debug((gc.DEBUG_STATS | ## gc.DEBUG_LEAK) & ## ~gc.DEBUG_SAVEALL) # -------------------------------------------------------------------- class BaseTestGC(object): def setUp(self): self.obj = self.CLASS().create(comm=PETSc.COMM_SELF) def tearDown(self): wref = self.make_weakref() self.assertTrue(wref() is self.obj) self.obj = None gc.collect() self.assertTrue(wref() is None) def make_weakref(self): wref = weakref.ref(self.obj) return wref def testCycleInSelf(self): self.obj.setAttr('myself', self.obj) def testCycleInMethod(self): self.obj.setAttr('mymeth', self.obj.view) def testCycleInInstance(self): class A: pass a = A() a.obj = self.obj self.obj.setAttr('myinst', a) def testCycleInAllWays(self): self.testCycleInSelf() self.testCycleInMethod() self.testCycleInInstance() # -------------------------------------------------------------------- class TestGCVec(BaseTestGC, unittest.TestCase): CLASS = PETSc.Vec class TestGCVecSubType(TestGCVec): CLASS = type('_Vec', (PETSc.Vec,), {}) class TestGCMat(BaseTestGC, unittest.TestCase): CLASS = PETSc.Mat class TestGCMatSubType(TestGCMat): CLASS = type('_Mat', (PETSc.Mat,), {}) class TestGCPC(BaseTestGC, unittest.TestCase): CLASS = PETSc.PC class TestGCPCSubType(TestGCPC): CLASS = type('_PC', (PETSc.PC,), {}) class TestGCKSP(BaseTestGC, unittest.TestCase): CLASS = PETSc.KSP class TestGCKSPSubType(TestGCKSP): CLASS = type('_KSP', (PETSc.KSP,), {}) class TestGCSNES(BaseTestGC, unittest.TestCase): CLASS = PETSc.SNES def testCycleInAppCtx(self): self.obj.setAppCtx(self.obj) class TestGCSNESSubType(TestGCSNES): CLASS = type('_SNES', (PETSc.SNES,), {}) class TestGCTS(BaseTestGC, unittest.TestCase): CLASS = PETSc.TS def testCycleInAppCtx(self): self.obj.setAppCtx(self.obj) class TestGCTSSubType(TestGCTS): CLASS = type('_TS', (PETSc.TS,), {}) def testCycleInAppCtx(self): self.obj.setAppCtx(self.obj) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_dmshell.py0000644000175000017500000001713013750315427017607 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest import numpy as np class TestDMShell(unittest.TestCase): COMM = PETSc.COMM_WORLD def setUp(self): self.dm = PETSc.DMShell().create(comm=self.COMM) def tearDown(self): self.dm = None def testSetGlobalVector(self): vec = PETSc.Vec().create(comm=self.COMM) vec.setSizes((10, None)) vec.setUp() self.dm.setGlobalVector(vec) gvec = self.dm.createGlobalVector() self.assertEqual(vec.getSizes(), gvec.getSizes()) self.assertEqual(vec.comm, gvec.comm) def testSetCreateGlobalVector(self): def create_vec(dm): v = PETSc.Vec().create(comm=dm.comm) v.setSizes((10, None)) v.setUp() return v self.dm.setCreateGlobalVector(create_vec) gvec = self.dm.createGlobalVector() self.assertEqual(gvec.comm, self.dm.comm) self.assertEqual(gvec.getLocalSize(), 10) def testSetLocalVector(self): vec = PETSc.Vec().create(comm=PETSc.COMM_SELF) vec.setSizes((1 + 10*self.COMM.rank, None)) vec.setUp() self.dm.setLocalVector(vec) lvec = self.dm.createLocalVector() self.assertEqual(vec.getSizes(), lvec.getSizes()) lsize, gsize = lvec.getSizes() self.assertEqual(lsize, gsize) self.assertEqual(lvec.comm, PETSc.COMM_SELF) def testSetCreateLocalVector(self): def create_vec(dm): v = PETSc.Vec().create(comm=PETSc.COMM_SELF) v.setSizes((1 + 10*dm.comm.rank, None)) v.setUp() return v self.dm.setCreateLocalVector(create_vec) lvec = self.dm.createLocalVector() lsize, gsize = lvec.getSizes() self.assertEqual(lsize, gsize) self.assertEqual(lsize, 1 + 10*self.dm.comm.rank) self.assertEqual(lvec.comm, PETSc.COMM_SELF) def testSetMatrix(self): mat = PETSc.Mat().create(comm=self.COMM) mat.setSizes(((10, None), (2, None))) mat.setUp() mat.assemble() self.dm.setMatrix(mat) nmat = self.dm.createMatrix() self.assertEqual(nmat.getSizes(), mat.getSizes()) def testSetCreateMatrix(self): def create_mat(dm): mat = PETSc.Mat().create(comm=self.COMM) mat.setSizes(((10, None), (2, None))) mat.setUp() return mat self.dm.setCreateMatrix(create_mat) nmat = self.dm.createMatrix() self.assertEqual(nmat.getSizes(), create_mat(self.dm).getSizes()) def testGlobalToLocal(self): def begin(dm, ivec, mode, ovec): if mode == PETSc.InsertMode.INSERT_VALUES: ovec[...] = ivec[...] elif mode == PETSc.InsertMode.ADD_VALUES: ovec[...] += ivec[...] def end(dm, ivec, mode, ovec): pass vec = PETSc.Vec().create(comm=self.COMM) vec.setSizes((10, None)) vec.setUp() vec[...] = self.dm.comm.rank + 1 ovec = PETSc.Vec().create(comm=PETSc.COMM_SELF) ovec.setSizes((10, None)) ovec.setUp() self.dm.setGlobalToLocal(begin, end) self.dm.globalToLocal(vec, ovec, addv=PETSc.InsertMode.INSERT_VALUES) self.assertTrue(np.allclose(vec.getArray(), ovec.getArray())) self.dm.globalToLocal(vec, ovec, addv=PETSc.InsertMode.ADD_VALUES) self.assertTrue(np.allclose(2*vec.getArray(), ovec.getArray())) def testLocalToGlobal(self): def begin(dm, ivec, mode, ovec): if mode == PETSc.InsertMode.INSERT_VALUES: ovec[...] = ivec[...] elif mode == PETSc.InsertMode.ADD_VALUES: ovec[...] += ivec[...] def end(dm, ivec, mode, ovec): pass vec = PETSc.Vec().create(comm=PETSc.COMM_SELF) vec.setSizes((10, None)) vec.setUp() vec[...] = self.dm.comm.rank + 1 ovec = PETSc.Vec().create(comm=self.COMM) ovec.setSizes((10, None)) ovec.setUp() self.dm.setLocalToGlobal(begin, end) self.dm.localToGlobal(vec, ovec, addv=PETSc.InsertMode.INSERT_VALUES) self.assertTrue(np.allclose(vec.getArray(), ovec.getArray())) self.dm.localToGlobal(vec, ovec, addv=PETSc.InsertMode.ADD_VALUES) self.assertTrue(np.allclose(2*vec.getArray(), ovec.getArray())) def testLocalToLocal(self): def begin(dm, ivec, mode, ovec): if mode == PETSc.InsertMode.INSERT_VALUES: ovec[...] = ivec[...] elif mode == PETSc.InsertMode.ADD_VALUES: ovec[...] += ivec[...] def end(dm, ivec, mode, ovec): pass vec = PETSc.Vec().create(comm=PETSc.COMM_SELF) vec.setSizes((10, None)) vec.setUp() vec[...] = self.dm.comm.rank + 1 ovec = vec.duplicate() self.dm.setLocalToLocal(begin, end) self.dm.localToLocal(vec, ovec, addv=PETSc.InsertMode.INSERT_VALUES) self.assertTrue(np.allclose(vec.getArray(), ovec.getArray())) self.dm.localToLocal(vec, ovec, addv=PETSc.InsertMode.ADD_VALUES) self.assertTrue(np.allclose(2*vec.getArray(), ovec.getArray())) def testGlobalToLocalVecScatter(self): vec = PETSc.Vec().create() vec.setSizes((10, None)) vec.setUp() sct, ovec = PETSc.Scatter.toAll(vec) self.dm.setGlobalToLocalVecScatter(sct) self.dm.globalToLocal(vec, ovec, addv=PETSc.InsertMode.INSERT_VALUES) self.assertTrue(np.allclose(vec.getArray(), ovec.getArray())) def testGlobalToLocalVecScatter(self): vec = PETSc.Vec().create() vec.setSizes((10, None)) vec.setUp() sct, ovec = PETSc.Scatter.toAll(vec) self.dm.setGlobalToLocalVecScatter(sct) self.dm.globalToLocal(vec, ovec, addv=PETSc.InsertMode.INSERT_VALUES) def testLocalToGlobalVecScatter(self): vec = PETSc.Vec().create() vec.setSizes((10, None)) vec.setUp() sct, ovec = PETSc.Scatter.toAll(vec) self.dm.setLocalToGlobalVecScatter(sct) self.dm.localToGlobal(vec, ovec, addv=PETSc.InsertMode.INSERT_VALUES) def testLocalToLocalVecScatter(self): vec = PETSc.Vec().create() vec.setSizes((10, None)) vec.setUp() sct, ovec = PETSc.Scatter.toAll(vec) self.dm.setLocalToLocalVecScatter(sct) self.dm.localToLocal(vec, ovec, addv=PETSc.InsertMode.INSERT_VALUES) def testCoarsenRefine(self): cdm = PETSc.DMShell().create(comm=self.COMM) def coarsen(dm, comm): return cdm def refine(dm, comm): return self.dm cdm.setRefine(refine) self.dm.setCoarsen(coarsen) coarsened = self.dm.coarsen() self.assertEqual(coarsened, cdm) refined = coarsened.refine() self.assertEqual(refined, self.dm) def testCreateInterpolation(self): mat = PETSc.Mat().create() mat.setSizes(((10, None), (10, None))) mat.setUp() vec = PETSc.Vec().create() vec.setSizes((10, None)) vec.setUp() def create_interp(dm, dmf): return mat, vec self.dm.setCreateInterpolation(create_interp) m, v = self.dm.createInterpolation(self.dm) self.assertEqual(m, mat) self.assertEqual(v, vec) def testCreateInjection(self): mat = PETSc.Mat().create() mat.setSizes(((10, None), (10, None))) mat.setUp() def create_inject(dm, dmf): return mat self.dm.setCreateInjection(create_inject) m = self.dm.createInjection(self.dm) self.assertEqual(m, mat) if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_dmstag.py0000644000175000017500000004005213750315427017435 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class BaseTestDMStag(object): COMM = PETSc.COMM_WORLD STENCIL = PETSc.DMStag.StencilType.BOX SWIDTH = 1 PROC_SIZES = None OWNERSHIP_RANGES = None def setUp(self): dim = len(self.SIZES) self.da = PETSc.DMStag().create(dim, dofs=self.DOFS, sizes=self.SIZES, boundary_types=self.BOUNDARY, stencil_type=self.STENCIL, stencil_width=self.SWIDTH, comm=self.COMM, proc_sizes=self.PROC_SIZES, ownership_ranges=self.OWNERSHIP_RANGES, setUp=True) self.directda = PETSc.DMStag().create(dim) self.directda.setStencilType(self.STENCIL) self.directda.setStencilWidth(self.SWIDTH) self.directda.setBoundaryTypes(self.BOUNDARY) self.directda.setDof(self.DOFS) self.directda.setGlobalSizes(self.SIZES) if self.PROC_SIZES is not None: self.directda.setProcSizes(self.PROC_SIZES) if self.OWNERSHIP_RANGES is not None: self.directda.setOwnershipRanges(self.OWNERSHIP_RANGES) self.directda.setUp() def tearDown(self): self.da = None self.directda = None def testCoordinates(self): self.da.setCoordinateDMType('stag') self.da.setUniformCoordinates(0,1,0,1,0,1) self.da.setUniformCoordinatesExplicit(0,1,0,1,0,1) cda = self.da.getCoordinateDM() datype = cda.getType() self.assertEqual(datype,'stag') cda.destroy() c = self.da.getCoordinatesLocal() self.da.setCoordinatesLocal(c) gc = self.da.getCoordinatesLocal() self.assertEqual(c.max()[1], gc.max()[1]) self.assertEqual(c.min()[1], gc.min()[1]) c = self.da.getCoordinates() self.da.setCoordinates(c) gc = self.da.getCoordinates() self.assertEqual(c.max()[1], gc.max()[1]) self.assertEqual(c.min()[1], gc.min()[1]) self.directda.setCoordinateDMType('product') self.directda.setUniformCoordinates(0,1,0,1,0,1) self.directda.setUniformCoordinatesProduct(0,1,0,1,0,1) cda = self.directda.getCoordinateDM() datype = cda.getType() self.assertEqual(datype,'product') cda.destroy() def testGetVec(self): vg = self.da.getGlobalVec() vl = self.da.getLocalVec() vg.set(1.0) self.assertEqual(vg.max()[1], 1.0) self.assertEqual(vg.min()[1], 1.0) self.da.globalToLocal(vg,vl) self.assertEqual(vl.max()[1], 1.0) self.assertTrue (vl.min()[1] in (1.0, 0.0)) vl.set(2.0) self.da.localToGlobal(vl,vg) self.assertEqual(vg.max()[1], 2.0) self.assertTrue (vg.min()[1] in (2.0, 0.0)) self.da.restoreGlobalVec(vg) self.da.restoreLocalVec(vl) def testGetOther(self): lgmap = self.da.getLGMap() dlgmap = self.directda.getLGMap() def testDof(self): dim = self.da.getDim() dofs = self.da.getDof() if dim == 1: dof0 = self.da.getLocationDof('left') dof1 = self.da.getLocationDof('element') self.assertEqual(dofs[0],dof0) self.assertEqual(dofs[1],dof1) if dim == 2: dof0 = self.da.getLocationDof('down_left') dof1 = self.da.getLocationDof('left') dof2 = self.da.getLocationDof('element') self.assertEqual(dofs[0],dof0) self.assertEqual(dofs[1],dof1) self.assertEqual(dofs[2],dof2) if dim == 3: dof0 = self.da.getLocationDof('back_down_right') dof1 = self.da.getLocationDof('down_left') dof2 = self.da.getLocationDof('left') dof3 = self.da.getLocationDof('element') self.assertEqual(dofs[0],dof0) self.assertEqual(dofs[1],dof1) self.assertEqual(dofs[2],dof2) self.assertEqual(dofs[3],dof3) def testMigrateVec(self): vec = self.da.createGlobalVec() dmTo = self.da.createCompatibleDMStag(self.NEWDOF) vecTo = dmTo.createGlobalVec() self.da.migrateVec(vec, dmTo, vecTo) def testDMDAInterface(self): return self.da.setCoordinateDMType('stag') self.da.setUniformCoordinates(0,1,0,1,0,1) dim = self.da.getDim() dofs = self.da.getDof() vec = self.da.createGlobalVec() if dim == 1: da,davec = self.da.VecSplitToDMDA(vec,'left',-dofs[0]) da,davec = self.da.VecSplitToDMDA(vec,'element',-dofs[1]) if dim == 2: da,davec = self.da.VecSplitToDMDA(vec,'down_left',-dofs[0]) da,davec = self.da.VecSplitToDMDA(vec,'down_left',-dofs[1]) da,davec = self.da.VecSplitToDMDA(vec,'down_left',-dofs[2]) if dim == 3: da,davec = self.da.VecSplitToDMDA(vec,'back_down_right',-dofs[0]) da,davec = self.da.VecSplitToDMDA(vec,'down_left',-dofs[1]) da,davec = self.da.VecSplitToDMDA(vec,'left',-dofs[2]) da,davec = self.da.VecSplitToDMDA(vec,'element',-dofs[3]) GHOSTED = PETSc.DM.BoundaryType.GHOSTED PERIODIC = PETSc.DM.BoundaryType.PERIODIC NONE = PETSc.DM.BoundaryType.NONE SCALE = 4 class BaseTestDMStag_1D(BaseTestDMStag): SIZES = [100*SCALE,] BOUNDARY = [NONE,] class BaseTestDMStag_2D(BaseTestDMStag): SIZES = [9*SCALE, 11*SCALE] BOUNDARY = [NONE, NONE] class BaseTestDMStag_3D(BaseTestDMStag): SIZES = [6*SCALE, 7*SCALE, 8*SCALE] BOUNDARY = [NONE, NONE, NONE] # -------------------------------------------------------------------- class TestDMStag_1D_W0_N11(BaseTestDMStag_1D, unittest.TestCase): SWIDTH = 0 DOFS = (1,1) NEWDOF = (2,1) class TestDMStag_1D_W0_N21(BaseTestDMStag_1D, unittest.TestCase): SWIDTH = 0 DOFS = (2,1) NEWDOF = (2,2) class TestDMStag_1D_W0_N12(BaseTestDMStag_1D, unittest.TestCase): SWIDTH = 0 DOFS = (1,2) NEWDOF = (2,2) class TestDMStag_1D_W2_N11(BaseTestDMStag_1D, unittest.TestCase): SWIDTH = 2 DOFS = (1,1) NEWDOF = (2,1) class TestDMStag_1D_W2_N21(BaseTestDMStag_1D, unittest.TestCase): SWIDTH = 2 DOFS = (2,1) NEWDOF = (2,2) class TestDMStag_1D_W2_N12(BaseTestDMStag_1D, unittest.TestCase): SWIDTH = 2 DOFS = (1,2) NEWDOF = (2,2) class TestDMStag_2D_W0_N112(BaseTestDMStag_2D, unittest.TestCase): DOFS = (1,1,2) SWIDTH = 0 NEWDOF = (2,2,2) class TestDMStag_2D_W2_N112(BaseTestDMStag_2D, unittest.TestCase): DOFS = (1,1,2) SWIDTH = 2 NEWDOF = (2,2,2) class TestDMStag_2D_PXY(BaseTestDMStag_2D, unittest.TestCase): SIZES = [13*SCALE,17*SCALE] DOFS = (1,1,2) SWIDTH = 5 BOUNDARY = (PERIODIC,)*2 NEWDOF = (2,2,2) class TestDMStag_2D_GXY(BaseTestDMStag_2D, unittest.TestCase): SIZES = [13*SCALE,17*SCALE] DOFS = (1,1,2) SWIDTH = 5 BOUNDARY = (GHOSTED,)*2 NEWDOF = (2,2,2) class TestDMStag_3D_W0_N1123(BaseTestDMStag_3D, unittest.TestCase): DOFS = (1,1,2,3) SWIDTH = 0 NEWDOF = (2,2,3,3) class TestDMStag_3D_W2_N1123(BaseTestDMStag_3D, unittest.TestCase): DOFS = (1,1,2,3) SWIDTH = 2 NEWDOF = (2,2,3,3) class TestDMStag_3D_PXYZ(BaseTestDMStag_3D, unittest.TestCase): SIZES = [11*SCALE,13*SCALE,17*SCALE] DOFS = (1,1,2,3) NEWDOF = (2,2,3,3) SWIDTH = 3 BOUNDARY = (PERIODIC,)*3 class TestDMStag_3D_GXYZ(BaseTestDMStag_3D, unittest.TestCase): SIZES = [11*SCALE,13*SCALE,17*SCALE] DOFS = (1,1,2,3) NEWDOF = (2,2,3,3) SWIDTH = 3 BOUNDARY = (GHOSTED,)*3 # -------------------------------------------------------------------- DIM = (1,2,3) DOF0 = (0,1,2) DOF1 = (0,1,2) DOF2 = (0,1,2) DOF3 = (0,1,2) BOUNDARY_TYPE = ('none', 'ghosted', 'periodic') STENCIL_TYPE = ('none', 'star', 'box') STENCIL_WIDTH = (0,1,2,3) class TestDMStagCreate(unittest.TestCase): pass counter = 0 for dim in DIM: for dof0 in DOF0: for dof1 in DOF1: for dof2 in DOF2: if dim == 1 and dof2 > 0: continue for dof3 in DOF3: if dim == 2 and dof3 > 0: continue if dof0==0 and dof1==0 and dof2==0 and dof3==0: continue dofs = [dof0,dof1,dof2,dof3][:dim+1] for boundary in BOUNDARY_TYPE: if boundary == "periodic": continue # XXX broken for stencil in STENCIL_TYPE: if stencil == 'none' and boundary != 'none': continue for width in STENCIL_WIDTH: if stencil == 'none' and width > 0: continue if stencil in ['star','box'] and width == 0: continue kargs = dict(dim=dim, dofs=dofs, boundary_type=boundary, stencil_type=stencil, stencil_width=width) def testCreate(self,kargs=kargs): kargs = dict(kargs) cda = PETSc.DMStag().create(kargs['dim'], dofs = kargs['dofs'], sizes = [8*SCALE,]*kargs['dim'], boundary_types = [kargs['boundary_type'],]*kargs['dim'], stencil_type = kargs['stencil_type'], stencil_width = kargs['stencil_width'], setUp=True) dda = PETSc.DMStag().create(kargs['dim']) dda.setStencilType(kargs['stencil_type']) dda.setStencilWidth(kargs['stencil_width']) dda.setBoundaryTypes([kargs['boundary_type'],]*kargs['dim']) dda.setDof(kargs['dofs']) dda.setGlobalSizes([8*SCALE,]*kargs['dim']) dda.setUp() cdim = cda.getDim() cdof = cda.getDof() cgsizes = cda.getGlobalSizes() clsizes = cda.getLocalSizes() cboundary = cda.getBoundaryTypes() cstencil_type = cda.getStencilType() cstencil_width = cda.getStencilWidth() centries_per_element = cda.getEntriesPerElement() cstarts, csizes, cnextra = cda.getCorners() cisLastRank = cda.getIsLastRank() cisFirstRank = cda.getIsFirstRank() cownershipranges = cda.getOwnershipRanges() cprocsizes = cda.getProcSizes() ddim = dda.getDim() ddof = dda.getDof() dgsizes = dda.getGlobalSizes() dlsizes = dda.getLocalSizes() dboundary = dda.getBoundaryTypes() dstencil_type = dda.getStencilType() dstencil_width = dda.getStencilWidth() dentries_per_element = dda.getEntriesPerElement() dstarts, dsizes, dnextra = dda.getCorners() disLastRank = dda.getIsLastRank() disFirstRank = dda.getIsFirstRank() downershipranges = dda.getOwnershipRanges() dprocsizes = dda.getProcSizes() self.assertEqual(cdim,kargs['dim']) self.assertEqual(cdof,tuple(kargs['dofs'])) self.assertEqual(cboundary,tuple([kargs['boundary_type'],]*kargs['dim'])) self.assertEqual(cstencil_type,kargs['stencil_type']) self.assertEqual(cstencil_width,kargs['stencil_width']) self.assertEqual(cgsizes,tuple([8*SCALE,]*kargs['dim'])) self.assertEqual(cdim,ddim) self.assertEqual(cdof,ddof) self.assertEqual(cgsizes,dgsizes) self.assertEqual(clsizes,dlsizes) self.assertEqual(cboundary,dboundary) self.assertEqual(cstencil_type,dstencil_type) self.assertEqual(cstencil_width,dstencil_width) self.assertEqual(centries_per_element,dentries_per_element) self.assertEqual(cstarts,dstarts) self.assertEqual(csizes,dsizes) self.assertEqual(cnextra,dnextra) self.assertEqual(cisLastRank,disLastRank) self.assertEqual(cisFirstRank,disFirstRank) self.assertEqual(cprocsizes, dprocsizes) for co,do in zip(cownershipranges, downershipranges): for i,j in zip(co,do): self.assertEqual(i,j) self.assertEqual(cdim+1,len(cdof)) self.assertEqual(cdim,len(cgsizes)) self.assertEqual(cdim,len(clsizes)) self.assertEqual(cdim,len(cboundary)) self.assertEqual(cdim,len(cstarts)) self.assertEqual(cdim,len(csizes)) self.assertEqual(cdim,len(cnextra)) self.assertEqual(cdim,len(cisLastRank)) self.assertEqual(cdim,len(cisLastRank)) if cdim == 1: self.assertEqual(centries_per_element, cdof[0] + cdof[1]) if cdim == 2: self.assertEqual(centries_per_element, cdof[0] + 2*cdof[1] + cdof[2]) if cdim == 3: self.assertEqual(centries_per_element, cdof[0] + 3*cdof[1] + 3*cdof[2] + cdof[3]) for i in range(cdim): self.assertEqual(csizes[i], clsizes[i]) if cisLastRank[i]: self.assertEqual(cnextra[i],1) if (cnextra[i]==1): self.assertTrue(cisLastRank[i]) if (cisFirstRank[i]): self.assertEqual(cstarts[i],0) self.assertEqual(len(cprocsizes), len(cownershipranges)) self.assertEqual(len(cprocsizes), cdim) for i,m in enumerate(cprocsizes): self.assertEqual(m, len(cownershipranges[i])) dda.destroy() cda.destroy() setattr(TestDMStagCreate, "testCreate%05d"%counter, testCreate) del testCreate counter += 1 del counter, dim, dofs, dof0, dof1, dof2, dof3, boundary, stencil, width # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # -------------------------------------------------------------------- petsc4py-3.15.1/test/test_is.py0000644000175000017500000001120713750315427016571 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest import random # -------------------------------------------------------------------- class BaseTestIS(object): TYPE = None def tearDown(self): self.iset = None def testGetType(self): istype = self.iset.getType() self.assertEqual(istype, self.TYPE) def testGetSize(self): lsize = self.iset.getLocalSize() gsize = self.iset.getSize() self.assertTrue(lsize <= gsize) def testDuplicate(self): iset = self.iset.duplicate() self.assertTrue(self.iset.equal(iset)) del iset def testCopy(self): iset = self.iset.copy() self.assertTrue(self.iset.equal(iset)) del iset def testEqual(self): self.assertTrue(self.iset.equal(self.iset)) iset = self.iset.duplicate() self.assertTrue(self.iset.equal(iset)) del iset def testSort(self): self.iset.sort() self.assertTrue(self.iset.isSorted()) def testDifference(self): iset = self.iset.difference(self.iset) self.assertEqual(iset.getLocalSize(), 0) del iset def testComplement(self): self.iset.sort() nmin = self.iset.getIndices().min() nmax = self.iset.getIndices().max() iset = self.iset.complement(nmin, nmax+1) iset.complement(nmin, nmax+1) del iset def testSum(self): if self.iset.getComm().getSize() > 1: return self.iset.sort() iset = self.iset.duplicate() iset.sum(self.iset) self.assertTrue(self.iset.equal(iset)) del iset def testExpand(self): iset = self.iset.expand(self.iset) if self.iset.type == iset.type: self.assertTrue(self.iset.equal(iset)) del iset def testRenumber(self): (n1,is1) = self.iset.renumber() (n2,is2) = self.iset.renumber(self.iset) del is1 del is2 def testProperties(self): proplist = ['sizes', 'size', 'local_size', 'indices', 'permutation', 'identity', 'sorted'] for prop in proplist: self.assertTrue(hasattr(self.iset, prop)) def testArray(self): import numpy refs = self.iset.getRefCount() arr1 = numpy.asarray(self.iset) self.assertEqual(self.iset.getRefCount(), refs+1) arr2 = self.iset.array self.assertEqual(self.iset.getRefCount(), refs+2) self.assertTrue((arr1 == arr2).all()) del arr2 self.assertEqual(self.iset.getRefCount(), refs+1) del arr1 self.assertEqual(self.iset.getRefCount(), refs) # -------------------------------------------------------------------- class TestISGeneral(BaseTestIS, unittest.TestCase): TYPE = PETSc.IS.Type.GENERAL def setUp(self): self.idx = list(range(10)) random.shuffle(self.idx) self.iset = PETSc.IS().createGeneral(self.idx) def testGetIndices(self): idx = self.iset.getIndices() self.assertEqual(self.idx, list(idx)) class TestISStride(BaseTestIS, unittest.TestCase): TYPE = PETSc.IS.Type.STRIDE def setUp(self): self.info = (10, 7, 3) size, start, step = self.info self.iset = PETSc.IS().createStride(size, start, step) def testGetIndices(self): size, start, step = self.info indices = [start+i*step for i in range(size)] self.assertEqual(list(self.iset.getIndices()), indices) def testToGeneral(self): self.iset.toGeneral() self.assertEqual(self.iset.getType(), PETSc.IS.Type.GENERAL) class TestISBlock(BaseTestIS, unittest.TestCase): TYPE = PETSc.IS.Type.BLOCK def setUp(self): self.bsize = 3 self.index = list(range(0,10,2)) random.shuffle(self.index) self.iset = PETSc.IS().createBlock(self.bsize, self.index) self.assertEqual(self.iset.getType(), PETSc.IS.Type.BLOCK) def testGetSize(self): lsize = self.iset.getLocalSize() self.assertEqual(lsize/self.bsize, len(self.index)) def testGetBlockSize(self): bs = self.iset.getBlockSize() self.assertEqual(bs, self.bsize) def testGetBlockIndices(self): index = list(self.iset.getBlockIndices()) self.assertEqual(index, self.index) def testGetIndices(self): bs = self.bsize idx = [] for i in self.iset.getBlockIndices(): for j in range(bs): idx.append(i*bs+j) index = list(self.iset.getIndices()) #self.assertEqual(index, idx) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_snes.py0000644000175000017500000003024313750315427017127 0ustar balaybalay00000000000000# -------------------------------------------------------------------- from petsc4py import PETSc import unittest from sys import getrefcount # -------------------------------------------------------------------- class Function: def __call__(self, snes, x, f): f[0] = (x[0]*x[0] + x[0]*x[1] - 3.0).item() f[1] = (x[0]*x[1] + x[1]*x[1] - 6.0).item() f.assemble() class Jacobian: def __call__(self, snes, x, J, P): P[0,0] = (2.0*x[0] + x[1]).item() P[0,1] = (x[0]).item() P[1,0] = (x[1]).item() P[1,1] = (x[0] + 2.0*x[1]).item() P.assemble() if J != P: J.assemble() # -------------------------------------------------------------------- class BaseTestSNES(object): SNES_TYPE = None def setUp(self): snes = PETSc.SNES() snes.create(PETSc.COMM_SELF) if self.SNES_TYPE: snes.setType(self.SNES_TYPE) self.snes = snes def tearDown(self): self.snes = None def testGetSetType(self): self.assertEqual(self.snes.getType(), self.SNES_TYPE) self.snes.setType(self.SNES_TYPE) self.assertEqual(self.snes.getType(), self.SNES_TYPE) def testTols(self): tols = self.snes.getTolerances() self.snes.setTolerances(*tols) tnames = ('rtol', 'atol','stol', 'max_it') tolvals = [getattr(self.snes, t) for t in tnames] self.assertEqual(tuple(tols), tuple(tolvals)) def testProperties(self): snes = self.snes # snes.appctx = (1,2,3) self.assertEqual(snes.appctx, (1,2,3)) snes.appctx = None self.assertEqual(snes.appctx, None) # snes.its = 1 self.assertEqual(snes.its, 1) snes.its = 0 self.assertEqual(snes.its, 0) # snes.norm = 1 self.assertEqual(snes.norm, 1) snes.norm = 0 self.assertEqual(snes.norm, 0) # rh, ih = snes.history self.assertTrue(len(rh)==0) self.assertTrue(len(ih)==0) # reason = PETSc.SNES.ConvergedReason.CONVERGED_ITS snes.reason = reason self.assertEqual(snes.reason, reason) self.assertTrue(snes.converged) self.assertFalse(snes.diverged) self.assertFalse(snes.iterating) reason = PETSc.SNES.ConvergedReason.DIVERGED_MAX_IT snes.reason = reason self.assertEqual(snes.reason, reason) self.assertFalse(snes.converged) self.assertTrue(snes.diverged) self.assertFalse(snes.iterating) reason = PETSc.SNES.ConvergedReason.CONVERGED_ITERATING snes.reason = reason self.assertEqual(snes.reason, reason) self.assertFalse(snes.converged) self.assertFalse(snes.diverged) self.assertTrue(snes.iterating) # self.assertFalse(snes.use_ew) self.assertFalse(snes.use_mf) self.assertFalse(snes.use_fd) def testGetSetFunc(self): r, func = self.snes.getFunction() self.assertFalse(r) self.assertTrue(func is None) r = PETSc.Vec().createSeq(2) func = Function() refcnt = getrefcount(func) self.snes.setFunction(func, r) self.snes.setFunction(func, r) self.assertEqual(getrefcount(func), refcnt + 1) r2, func2 = self.snes.getFunction() self.assertEqual(r, r2) self.assertEqual(func, func2[0]) self.assertEqual(getrefcount(func), refcnt + 1) r3, func3 = self.snes.getFunction() self.assertEqual(r, r3) self.assertEqual(func, func3[0]) self.assertEqual(getrefcount(func), refcnt + 1) def testCompFunc(self): r = PETSc.Vec().createSeq(2) func = Function() self.snes.setFunction(func, r) x, y = r.duplicate(), r.duplicate() x[0], x[1] = [1, 2] self.snes.computeFunction(x, y) self.assertAlmostEqual(abs(y[0]), 0.0) self.assertAlmostEqual(abs(y[1]), 0.0) def testGetSetJac(self): A, P, jac = self.snes.getJacobian() self.assertFalse(A) self.assertFalse(P) self.assertTrue(jac is None) J = PETSc.Mat().create(PETSc.COMM_SELF) J.setSizes([2,2]) J.setType(PETSc.Mat.Type.SEQAIJ) J.setUp() jac = Jacobian() refcnt = getrefcount(jac) self.snes.setJacobian(jac, J) self.snes.setJacobian(jac, J) self.assertEqual(getrefcount(jac), refcnt + 1) J2, P2, jac2 = self.snes.getJacobian() self.assertEqual(J, J2) self.assertEqual(J2, P2) self.assertEqual(jac, jac2[0]) self.assertEqual(getrefcount(jac), refcnt + 1) J3, P3, jac3 = self.snes.getJacobian() self.assertEqual(J, J3) self.assertEqual(J3, P3) self.assertEqual(jac, jac3[0]) self.assertEqual(getrefcount(jac), refcnt + 1) def testCompJac(self): J = PETSc.Mat().create(PETSc.COMM_SELF) J.setSizes([2,2]) J.setType(PETSc.Mat.Type.SEQAIJ) J.setUp() jac = Jacobian() self.snes.setJacobian(jac, J) x = PETSc.Vec().createSeq(2) x[0], x[1] = [1, 2] self.snes.getKSP().getPC() self.snes.computeJacobian(x, J) def testGetSetUpd(self): self.assertTrue(self.snes.getUpdate() is None) upd = lambda snes, it: None refcnt = getrefcount(upd) self.snes.setUpdate(upd) self.assertEqual(getrefcount(upd), refcnt + 1) self.snes.setUpdate(upd) self.assertEqual(getrefcount(upd), refcnt + 1) self.snes.setUpdate(None) self.assertTrue(self.snes.getUpdate() is None) self.assertEqual(getrefcount(upd), refcnt) self.snes.setUpdate(upd) self.assertEqual(getrefcount(upd), refcnt + 1) upd2 = lambda snes, it: None refcnt2 = getrefcount(upd2) self.snes.setUpdate(upd2) self.assertEqual(getrefcount(upd), refcnt) self.assertEqual(getrefcount(upd2), refcnt2 + 1) tmp = self.snes.getUpdate()[0] self.assertTrue(tmp is upd2) self.assertEqual(getrefcount(upd2), refcnt2 + 2) del tmp self.snes.setUpdate(None) self.assertTrue(self.snes.getUpdate() is None) self.assertEqual(getrefcount(upd2), refcnt2) def testGetKSP(self): ksp = self.snes.getKSP() self.assertEqual(ksp.getRefCount(), 2) def testSolve(self): J = PETSc.Mat().create(PETSc.COMM_SELF) J.setSizes([2,2]) J.setType(PETSc.Mat.Type.SEQAIJ) J.setUp() r = PETSc.Vec().createSeq(2) x = PETSc.Vec().createSeq(2) b = PETSc.Vec().createSeq(2) self.snes.setFunction(Function(), r) self.snes.setJacobian(Jacobian(), J) x.setArray([2,3]) b.set(0) self.snes.setConvergenceHistory() self.snes.setFromOptions() self.snes.solve(b, x) rh, ih = self.snes.getConvergenceHistory() self.snes.setConvergenceHistory(0, reset=True) rh, ih = self.snes.getConvergenceHistory() self.assertEqual(len(rh), 0) self.assertEqual(len(ih), 0) self.assertAlmostEqual(abs(x[0]), 1.0) self.assertAlmostEqual(abs(x[1]), 2.0) # XXX this test should not be here ! reason = self.snes.callConvergenceTest(1, 0, 0, 0) self.assertTrue(reason > 0) def testResetAndSolve(self): self.snes.reset() self.testSolve() self.snes.reset() self.testSolve() self.snes.reset() def testSetMonitor(self): reshist = {} def monitor(snes, its, fgnorm): reshist[its] = fgnorm refcnt = getrefcount(monitor) self.snes.setMonitor(monitor) self.assertEqual(getrefcount(monitor), refcnt + 1) self.testSolve() self.assertTrue(len(reshist) > 0) reshist = {} self.snes.cancelMonitor() self.assertEqual(getrefcount(monitor), refcnt) self.testSolve() self.assertTrue(len(reshist) == 0) self.snes.setMonitor(monitor) self.snes.monitor(1, 7) self.assertTrue(reshist[1] == 7) ## Monitor = PETSc.SNES.Monitor ## self.snes.setMonitor(Monitor()) ## self.snes.setMonitor(Monitor.DEFAULT) ## self.snes.setMonitor(Monitor.SOLUTION) ## self.snes.setMonitor(Monitor.RESIDUAL) ## self.snes.setMonitor(Monitor.SOLUTION_UPDATE) def testSetGetStepFails(self): its = self.snes.getIterationNumber() self.assertEqual(its, 0) fails = self.snes.getNonlinearStepFailures() self.assertEqual(fails, 0) fails = self.snes.getMaxNonlinearStepFailures() self.assertEqual(fails, 1) self.snes.setMaxNonlinearStepFailures(5) fails = self.snes.getMaxNonlinearStepFailures() self.assertEqual(fails, 5) self.snes.setMaxNonlinearStepFailures(1) fails = self.snes.getMaxNonlinearStepFailures() self.assertEqual(fails, 1) def testSetGetLinFails(self): its = self.snes.getLinearSolveIterations() self.assertEqual(its, 0) fails = self.snes.getLinearSolveFailures() self.assertEqual(fails, 0) fails = self.snes.getMaxLinearSolveFailures() self.assertEqual(fails, 1) self.snes.setMaxLinearSolveFailures(5) fails = self.snes.getMaxLinearSolveFailures() self.assertEqual(fails, 5) self.snes.setMaxLinearSolveFailures(1) fails = self.snes.getMaxLinearSolveFailures() self.assertEqual(fails, 1) def testEW(self): self.snes.setUseEW(False) self.assertFalse(self.snes.getUseEW()) self.snes.setUseEW(True) self.assertTrue(self.snes.getUseEW()) params = self.snes.getParamsEW() params['version'] = 1 self.snes.setParamsEW(**params) params = self.snes.getParamsEW() self.assertEqual(params['version'], 1) params['version'] = PETSc.DEFAULT self.snes.setParamsEW(**params) params = self.snes.getParamsEW() self.assertEqual(params['version'], 1) def testMF(self): #self.snes.setOptionsPrefix('MF-') #opts = PETSc.Options(self.snes) #opts['mat_mffd_type'] = 'ds' #opts['snes_monitor'] = 'stdout' #opts['ksp_monitor'] = 'stdout' #opts['snes_view'] = 'stdout' J = PETSc.Mat().create(PETSc.COMM_SELF) J.setSizes([2,2]) J.setType(PETSc.Mat.Type.SEQAIJ) J.setUp() r = PETSc.Vec().createSeq(2) x = PETSc.Vec().createSeq(2) b = PETSc.Vec().createSeq(2) fun = Function() jac = Jacobian() self.snes.setFunction(fun, r) self.snes.setJacobian(jac, J) self.assertFalse(self.snes.getUseMF()) self.snes.setUseMF(False) self.assertFalse(self.snes.getUseMF()) self.snes.setUseMF(True) self.assertTrue(self.snes.getUseMF()) self.snes.setFromOptions() x.setArray([2,3]) b.set(0) self.snes.solve(b, x) self.assertAlmostEqual(abs(x[0]), 1.0) self.assertAlmostEqual(abs(x[1]), 2.0) def testFDColor(self): J = PETSc.Mat().create(PETSc.COMM_SELF) J.setSizes([2,2]) J.setType(PETSc.Mat.Type.SEQAIJ) J.setUp() r = PETSc.Vec().createSeq(2) x = PETSc.Vec().createSeq(2) b = PETSc.Vec().createSeq(2) fun = Function() jac = Jacobian() self.snes.setFunction(fun, r) self.snes.setJacobian(jac, J) self.assertFalse(self.snes.getUseFD()) jac(self.snes, x, J, J) self.snes.setUseFD(False) self.assertFalse(self.snes.getUseFD()) self.snes.setUseFD(True) self.assertTrue(self.snes.getUseFD()) self.snes.setFromOptions() x.setArray([2,3]) b.set(0) self.snes.solve(b, x) self.assertAlmostEqual(abs(x[0]), 1.0) self.assertAlmostEqual(abs(x[1]), 2.0) # -------------------------------------------------------------------- class TestSNESLS(BaseTestSNES, unittest.TestCase): SNES_TYPE = PETSc.SNES.Type.NEWTONLS class TestSNESTR(BaseTestSNES, unittest.TestCase): SNES_TYPE = PETSc.SNES.Type.NEWTONTR # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_dmplex.py0000644000175000017500000004153314030740317017444 0ustar balaybalay00000000000000import petsc4py from petsc4py import PETSc import unittest import os import filecmp import numpy as np # -------------------------------------------------------------------- ERR_SUP = 56 class BaseTestPlex(object): COMM = PETSc.COMM_WORLD DIM = 1 CELLS = [[0, 1], [1, 2]] COORDS = [[0.], [0.5], [1.]] COMP = 1 DOFS = [1, 0] def setUp(self): self.plex = PETSc.DMPlex().createFromCellList(self.DIM, self.CELLS, self.COORDS, comm=self.COMM) def tearDown(self): self.plex.destroy() self.plex = None def testTopology(self): dim = self.plex.getDimension() pStart, pEnd = self.plex.getChart() cStart, cEnd = self.plex.getHeightStratum(0) vStart, vEnd = self.plex.getDepthStratum(0) numDepths = self.plex.getLabelSize("depth") coords_raw = self.plex.getCoordinates().getArray() coords = np.reshape(coords_raw, (vEnd - vStart, dim)) self.assertEqual(dim, self.DIM) self.assertEqual(numDepths, self.DIM+1) if self.CELLS is not None: self.assertEqual(cEnd-cStart, len(self.CELLS)) if self.COORDS is not None: self.assertEqual(vEnd-vStart, len(self.COORDS)) self.assertTrue((coords == self.COORDS).all()) def testClosure(self): pStart, pEnd = self.plex.getChart() for p in range(pStart, pEnd): closure = self.plex.getTransitiveClosure(p)[0] for c in closure: cone = self.plex.getCone(c) self.assertEqual(self.plex.getConeSize(c), len(cone)) for i in cone: self.assertIn(i, closure) star = self.plex.getTransitiveClosure(p, useCone=False)[0] for s in star: support = self.plex.getSupport(s) self.assertEqual(self.plex.getSupportSize(s), len(support)) for i in support: self.assertIn(i, star) def testAdjacency(self): PETSc.DMPlex.setAdjacencyUseAnchors(self.plex, False) flag = PETSc.DMPlex.getAdjacencyUseAnchors(self.plex) self.assertFalse(flag) PETSc.DMPlex.setAdjacencyUseAnchors(self.plex, True) flag = PETSc.DMPlex.getAdjacencyUseAnchors(self.plex) self.assertTrue(flag) PETSc.DMPlex.setBasicAdjacency(self.plex, False, False) flagA, flagB = PETSc.DMPlex.getBasicAdjacency(self.plex) self.assertFalse(flagA) self.assertFalse(flagB) PETSc.DMPlex.setBasicAdjacency(self.plex, True, True) flagA, flagB = PETSc.DMPlex.getBasicAdjacency(self.plex) self.assertTrue(flagA) self.assertTrue(flagB) pStart, pEnd = self.plex.getChart() for p in range(pStart, pEnd): adjacency = self.plex.getAdjacency(p) self.assertTrue(p in adjacency) self.assertTrue(len(adjacency) > 1) def testSectionDofs(self): self.plex.setNumFields(1) section = self.plex.createSection([self.COMP], [self.DOFS]) size = section.getStorageSize() entity_dofs = [self.plex.getStratumSize("depth", d) * self.DOFS[d] for d in range(self.DIM+1)] self.assertEqual(sum(entity_dofs), size) def testSectionClosure(self): section = self.plex.createSection([self.COMP], [self.DOFS]) self.plex.setSection(section) vec = self.plex.createLocalVec() pStart, pEnd = self.plex.getChart() for p in range(pStart, pEnd): for i in range(section.getDof(p)): off = section.getOffset(p) vec.setValue(off+i, p) for p in range(pStart, pEnd): point_closure = self.plex.getTransitiveClosure(p)[0] dof_closure = self.plex.vecGetClosure(section, vec, p) for p in dof_closure: self.assertIn(p, point_closure) def testBoundaryLabel(self): pStart, pEnd = self.plex.getChart() if (pEnd - pStart == 0): return self.assertFalse(self.plex.hasLabel("boundary")) self.plex.markBoundaryFaces("boundary") self.assertTrue(self.plex.hasLabel("boundary")) faces = self.plex.getStratumIS("boundary", 1) for f in faces.getIndices(): points, orient = self.plex.getTransitiveClosure(f, useCone=True) for p in points: self.plex.setLabelValue("boundary", p, 1) for p in range(pStart, pEnd): if self.plex.getLabelValue("boundary", p) != 1: self.plex.setLabelValue("boundary", p, 2) numBoundary = self.plex.getStratumSize("boundary", 1) numInterior = self.plex.getStratumSize("boundary", 2) self.assertNotEqual(numBoundary, pEnd - pStart) self.assertNotEqual(numInterior, pEnd - pStart) self.assertEqual(numBoundary + numInterior, pEnd - pStart) def testAdapt(self): dim = self.plex.getDimension() if dim == 1: return vStart, vEnd = self.plex.getDepthStratum(0) numVertices = vEnd-vStart metric_array = np.zeros([numVertices,dim,dim]) for met in metric_array: met[:,:] = np.diag([9]*dim) metric = PETSc.Vec().createWithArray(metric_array) try: newplex = self.plex.adaptMetric(metric,"") except PETSc.Error as exc: if exc.ierr != ERR_SUP: raise # -------------------------------------------------------------------- class BaseTestPlex_2D(BaseTestPlex): DIM = 2 CELLS = [[0, 1, 3], [1, 3, 4], [1, 2, 4], [2, 4, 5], [3, 4, 6], [4, 6, 7], [4, 5, 7], [5, 7, 8]] COORDS = [[0.0, 0.0], [0.5, 0.0], [1.0, 0.0], [0.0, 0.5], [0.5, 0.5], [1.0, 0.5], [0.0, 1.0], [0.5, 1.0], [1.0, 1.0]] DOFS = [1, 0, 0] class BaseTestPlex_3D(BaseTestPlex): DIM = 3 CELLS = [[0, 2, 3, 7], [0, 2, 6, 7], [0, 4, 6, 7], [0, 1, 3, 7], [0, 1, 5, 7], [0, 4, 5, 7]] COORDS = [[0., 0., 0.], [1., 0., 0.], [0., 1., 0.], [1., 1., 0.], [0., 0., 1.], [1., 0., 1.], [0., 1., 1.], [1., 1., 1.]] DOFS = [1, 0, 0, 0] # -------------------------------------------------------------------- class TestPlex_1D(BaseTestPlex, unittest.TestCase): pass class TestPlex_2D(BaseTestPlex_2D, unittest.TestCase): pass class TestPlex_3D(BaseTestPlex_3D, unittest.TestCase): pass class TestPlex_2D_P3(BaseTestPlex_2D, unittest.TestCase): DOFS = [1, 2, 1] class TestPlex_3D_P3(BaseTestPlex_3D, unittest.TestCase): DOFS = [1, 2, 1, 0] class TestPlex_3D_P4(BaseTestPlex_3D, unittest.TestCase): DOFS = [1, 3, 3, 1] class TestPlex_2D_BoxTensor(BaseTestPlex_2D, unittest.TestCase): CELLS = None COORDS = None def setUp(self): self.plex = PETSc.DMPlex().createBoxMesh([3,3], simplex=False) class TestPlex_3D_BoxTensor(BaseTestPlex_3D, unittest.TestCase): CELLS = None COORDS = None def setUp(self): self.plex = PETSc.DMPlex().createBoxMesh([3,3,3], simplex=False) try: raise PETSc.Error PETSc.DMPlex().createBoxMesh([2,2], simplex=True, comm=PETSc.COMM_SELF).destroy() except PETSc.Error: pass else: class TestPlex_2D_Box(BaseTestPlex_2D, unittest.TestCase): CELLS = None COORDS = None def setUp(self): self.plex = PETSc.DMPlex().createBoxMesh([1,1], simplex=True) class TestPlex_2D_Boundary(BaseTestPlex_2D, unittest.TestCase): CELLS = None COORDS = None def setUp(self): boundary = PETSc.DMPlex().create(self.COMM) boundary.createSquareBoundary([0., 0.], [1., 1.], [2, 2]) boundary.setDimension(self.DIM-1) self.plex = PETSc.DMPlex().generate(boundary) class TestPlex_3D_Box(BaseTestPlex_3D, unittest.TestCase): CELLS = None COORDS = None def setUp(self): self.plex = PETSc.DMPlex().createBoxMesh([1,1,1], simplex=True) class TestPlex_3D_Boundary(BaseTestPlex_3D, unittest.TestCase): CELLS = None COORDS = None def setUp(self): boundary = PETSc.DMPlex().create(self.COMM) boundary.createCubeBoundary([0., 0., 0.], [1., 1., 1.], [1, 1, 1]) boundary.setDimension(self.DIM-1) self.plex = PETSc.DMPlex().generate(boundary) # -------------------------------------------------------------------- PETSC_DIR = petsc4py.get_config()['PETSC_DIR'] def check_dtype(method): def wrapper(self, *args, **kwargs): if PETSc.ScalarType is PETSc.ComplexType: return else: return method(self, *args, **kwargs) return wrapper def check_package(method): def wrapper(self, *args, **kwargs): if not PETSc.Sys.hasExternalPackage("hdf5"): return elif self.PARTITIONERTYPE != "simple" and \ not PETSc.Sys.hasExternalPackage(self.PARTITIONERTYPE): return else: return method(self, *args, **kwargs) return wrapper def check_nsize(method): def wrapper(self, *args, **kwargs): if PETSc.COMM_WORLD.size != self.NSIZE: return else: return method(self, *args, **kwargs) return wrapper class BaseTestPlexHDF5(object): NSIZE = 4 NTIMES = 3 def setUp(self): self.txtvwr = PETSc.Viewer() def tearDown(self): if not PETSc.COMM_WORLD.rank: if os.path.exists(self.outfile()): os.remove(self.outfile()) if os.path.exists(self.tmp_output_file()): os.remove(self.tmp_output_file()) self.txtvwr = None def _name(self): return "%s_outformat-%s_%s" % (self.SUFFIX, self.OUTFORMAT, self.PARTITIONERTYPE) def infile(self): return os.path.join(PETSC_DIR, "share/petsc/datafiles/", "meshes/blockcylinder-50.h5") def outfile(self): return os.path.join("./temp_test_dmplex_%s.h5" % self._name()) def informat(self): return PETSc.Viewer.Format.HDF5_XDMF def outformat(self): d = {"hdf5_petsc": PETSc.Viewer.Format.HDF5_PETSC, "hdf5_xdmf": PETSc.Viewer.Format.HDF5_XDMF} return d[self.OUTFORMAT] def partitionerType(self): d = {"simple": PETSc.Partitioner.Type.SIMPLE, "ptscotch": PETSc.Partitioner.Type.PTSCOTCH, "parmetis": PETSc.Partitioner.Type.PARMETIS} return d[self.PARTITIONERTYPE] def ref_output_file(self): return os.path.join(PETSC_DIR, "src/dm/impls/plex/tutorials/", "output/ex5_%s.out" % self._name()) def tmp_output_file(self): return os.path.join("./temp_test_dmplex_%s.out" % self._name()) def outputText(self, msg, comm): if not comm.rank: with open(self.tmp_output_file(), 'a') as f: f.write(msg) def outputPlex(self, plex): self.txtvwr.createASCII(self.tmp_output_file(), mode='a', comm=plex.comm) plex.view(viewer=self.txtvwr) self.txtvwr.destroy() @check_dtype @check_package @check_nsize def testViewLoadCycle(self): grank = PETSc.COMM_WORLD.rank for i in range(self.NTIMES): if i == 0: infname = self.infile() informt = self.informat() else: infname = self.outfile() informt = self.outformat() if self.HETEROGENEOUS: mycolor = (grank > self.NTIMES - i) else: mycolor = 0 mpicomm = PETSc.COMM_WORLD.tompi4py() comm = PETSc.Comm(comm=mpicomm.Split(color=mycolor, key=grank)) if mycolor == 0: self.outputText("Begin cycle %d\n" % i, comm) plex = PETSc.DMPlex() vwr = PETSc.ViewerHDF5() # Create plex plex.create(comm=comm) plex.setName("DMPlex Object") # Load data from XDMF into dm in parallel vwr.create(infname, mode='r', comm=comm) vwr.pushFormat(format=informt) plex.load(viewer=vwr) plex.setOptionsPrefix("loaded_") plex.setFromOptions() vwr.popFormat() vwr.destroy() self.outputPlex(plex) # Test DM is indeed distributed flg = plex.isDistributed() self.outputText("Loaded mesh distributed? %s\n" % str(flg).upper(), comm) # Interpolate plex.interpolate() plex.setOptionsPrefix("interpolated_") plex.setFromOptions() self.outputPlex(plex) # Redistribute part = plex.getPartitioner() part.setType(self.partitionerType()) _ = plex.distribute(overlap=0) plex.setOptionsPrefix("redistributed_") plex.setFromOptions() self.outputPlex(plex) # Save redistributed dm to XDMF in parallel vwr.create(self.outfile(), mode='w', comm=comm) vwr.pushFormat(format=self.outformat()) plex.view(viewer=vwr) vwr.popFormat() vwr.destroy() # Destroy plex plex.destroy() self.outputText("End cycle %d\n--------\n" % i, comm) PETSc.COMM_WORLD.Barrier() # Check that the output is identical to that of plex/tutorial/ex5.c. self.assertTrue(filecmp.cmp(self.tmp_output_file(), self.ref_output_file(), shallow=False), 'Contents of the files not the same.') PETSc.COMM_WORLD.Barrier() class BaseTestPlexHDF5Homogeneous(BaseTestPlexHDF5): """Test save on N / load on N.""" SUFFIX = 0 HETEROGENEOUS = False class BaseTestPlexHDF5Heterogeneous(BaseTestPlexHDF5): """Test save on N / load on M.""" SUFFIX = 1 HETEROGENEOUS = True class TestPlexHDF5PETSCSimpleHomogeneous(BaseTestPlexHDF5Homogeneous, unittest.TestCase): OUTFORMAT = "hdf5_petsc" PARTITIONERTYPE = "simple" """ Skipping. PTScotch produces different distributions when run in a sequence in a single session. class TestPlexHDF5PETSCPTScotchHomogeneous(BaseTestPlexHDF5Homogeneous, unittest.TestCase): OUTFORMAT = "hdf5_petsc" PARTITIONERTYPE = "ptscotch" """ class TestPlexHDF5PETSCParmetisHomogeneous(BaseTestPlexHDF5Homogeneous, unittest.TestCase): OUTFORMAT = "hdf5_petsc" PARTITIONERTYPE = "parmetis" class TestPlexHDF5XDMFSimpleHomogeneous(BaseTestPlexHDF5Homogeneous, unittest.TestCase): OUTFORMAT = "hdf5_xdmf" PARTITIONERTYPE = "simple" """ Skipping. PTScotch produces different distributions when run in a sequence in a single session. class TestPlexHDF5XDMFPTScotchHomogeneous(BaseTestPlexHDF5Homogeneous, unittest.TestCase): OUTFORMAT = "hdf5_xdmf" PARTITIONERTYPE = "ptscotch" """ class TestPlexHDF5XDMFParmetisHomogeneous(BaseTestPlexHDF5Homogeneous, unittest.TestCase): OUTFORMAT = "hdf5_xdmf" PARTITIONERTYPE = "parmetis" class TestPlexHDF5PETSCSimpleHeterogeneous(BaseTestPlexHDF5Heterogeneous, unittest.TestCase): OUTFORMAT = "hdf5_petsc" PARTITIONERTYPE = "simple" """ Skipping. PTScotch produces different distributions when run in a sequence in a single session. class TestPlexHDF5PETSCPTScotchHeterogeneous(BaseTestPlexHDF5Heterogeneous, unittest.TestCase): OUTFORMAT = "hdf5_petsc" PARTITIONERTYPE = "ptscotch" """ class TestPlexHDF5PETSCParmetisHeterogeneous(BaseTestPlexHDF5Heterogeneous, unittest.TestCase): OUTFORMAT = "hdf5_petsc" PARTITIONERTYPE = "parmetis" class TestPlexHDF5XDMFSimpleHeterogeneous(BaseTestPlexHDF5Heterogeneous, unittest.TestCase): OUTFORMAT = "hdf5_xdmf" PARTITIONERTYPE = "simple" class TestPlexHDF5XDMFPTScotchHeterogeneous(BaseTestPlexHDF5Heterogeneous, unittest.TestCase): OUTFORMAT = "hdf5_xdmf" PARTITIONERTYPE = "ptscotch" class TestPlexHDF5XDMFParmetisHeterogeneous(BaseTestPlexHDF5Heterogeneous, unittest.TestCase): OUTFORMAT = "hdf5_xdmf" PARTITIONERTYPE = "parmetis" # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_vec.py0000644000175000017500000002233313750315427016735 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class BaseTestVec(object): COMM = None TYPE = None def setUp(self): v = PETSc.Vec() v.create(self.COMM) v.setSizes(100) v.setType(self.TYPE) self.vec = v def tearDown(self): self.vec.destroy() self.vec = None def testDuplicate(self): self.vec.set(1) vec = self.vec.duplicate() self.assertFalse(self.vec.equal(vec)) self.assertEqual(self.vec.sizes, vec.sizes) del vec def testCopy(self): self.vec.set(1) vec = self.vec.duplicate() self.vec.copy(vec) self.assertTrue(self.vec.equal(vec)) del vec def testDot(self): self.vec.set(1) d = self.vec.dot(self.vec) self.assertAlmostEqual(abs(d), self.vec.getSize()) self.vec.dotBegin(self.vec) d = self.vec.dotEnd(self.vec) self.assertAlmostEqual(abs(d), self.vec.getSize()) def testNorm(self): from math import sqrt self.vec.set(1) n1 = self.vec.norm(PETSc.NormType.NORM_1) n2 = self.vec.norm(PETSc.NormType.NORM_2) ni = self.vec.norm(PETSc.NormType.NORM_INFINITY) self.assertAlmostEqual(n1, self.vec.getSize()) self.assertAlmostEqual(n2, sqrt(self.vec.getSize())) self.assertAlmostEqual(n2, self.vec.norm()) self.assertAlmostEqual(ni, 1.0) self.vec.normBegin(PETSc.NormType.NORM_1) nn1 = self.vec.normEnd(PETSc.NormType.NORM_1) self.assertAlmostEqual(nn1, n1) self.vec.normBegin() nn2 = self.vec.normEnd() self.assertAlmostEqual(nn2, n2) self.vec.normBegin(PETSc.NormType.NORM_INFINITY) nni = self.vec.normEnd(PETSc.NormType.NORM_INFINITY) self.assertAlmostEqual(nni, ni) def testNormalize(self): from math import sqrt self.vec.set(1) n2 = self.vec.normalize() self.assertAlmostEqual(n2, sqrt(self.vec.getSize())) self.assertAlmostEqual(1, self.vec.norm()) def testSumMinMax(self): self.vec.set(1) self.assertEqual(self.vec.sum(), self.vec.getSize()) self.vec.set(-7) self.assertEqual(self.vec.min()[1], -7) self.vec.set(10) self.assertEqual(self.vec.max()[1], 10) def testSwap(self): v1 = self.vec v2 = v1.duplicate() v1.set(1) v2.set(2) v1.swap(v2) idx, _ = self.vec.getOwnershipRange() self.assertEqual(v1[idx], 2) self.assertEqual(v2[idx], 1) def testBsize(self): self.vec.setBlockSize(1) self.assertEqual(self.vec.getBlockSize(), 1) self.vec.setBlockSize(1) def testGetSetVals(self): start, end = self.vec.getOwnershipRange() self.vec[start] = -7 self.vec[end-1] = -7 self.assertEqual(self.vec[start], -7) self.assertEqual(self.vec[end-1], -7) for i in range(start, end): self.vec[i] = i values = [self.vec[i] for i in range(start, end)] self.assertEqual(values, list(range(start, end))) sz = self.vec.getSize() self.assertEqual(self.vec.sum(), (sz-1)/2.0*sz) def testGetSetValsBlocked(self): return lsize, gsize = self.vec.getSizes() start, end = self.vec.getOwnershipRange() bsizes = list(range(1, lsize+1)) nblocks = list(range(1, lsize+1)) compat = [(bs, nb) for bs in bsizes if not (gsize%bs or lsize % bs) for nb in nblocks if bs*nb <= lsize] for bsize, nblock in compat: self.vec.setBlockSize(bsize) bindex = [start//bsize+i for i in range(nblock)] bvalue = [float(i) for i in range(nblock*bsize)] self.vec.setValuesBlocked(bindex, bvalue) self.vec.assemble() index = [start+i for i in range(nblock*bsize)] value = self.vec.getValues(index) self.assertEqual(bvalue, list(value)) def testGetSetArray(self): self.vec.set(1) arr0 = self.vec.getArray().copy() self.assertEqual(arr0.sum(), self.vec.getLocalSize()) arr0 = self.vec.getArray().copy() self.vec.setRandom() arr1 = self.vec.getArray().copy() self.vec.setArray(arr1) arr1 = self.vec.getArray().copy() arr2 = self.vec.getArray().copy() self.assertTrue((arr1 == arr2).all()) import numpy refs = self.vec.getRefCount() arr3 = numpy.asarray(self.vec) self.assertEqual(self.vec.getRefCount(), refs+1) self.assertTrue((arr1 == arr3).all()) arr3[:] = 0 self.assertAlmostEqual(abs(self.vec.sum()), 0) self.assertEqual(self.vec.max()[1], 0) self.assertEqual(self.vec.min()[1], 0) self.vec.set(1) self.assertAlmostEqual(abs(arr3.sum()), self.vec.getLocalSize()) self.assertEqual(arr3.min(), 1) self.assertEqual(arr3.max(), 1) del arr3 self.assertEqual(self.vec.getRefCount(), refs) def testPlaceArray(self): self.vec.set(1) array = self.vec.getArray().copy() self.vec.placeArray(array) array[:] = 2 self.assertAlmostEqual(abs(self.vec.sum()), 2*self.vec.getSize()) self.vec.resetArray() self.assertAlmostEqual(abs(self.vec.sum()), self.vec.getSize()) def testSetOption(self): opt1 = PETSc.Vec.Option.IGNORE_OFF_PROC_ENTRIES opt2 = PETSc.Vec.Option.IGNORE_NEGATIVE_INDICES for opt in [opt1, opt2]*2: for flag in [True,False]*2: self.vec.setOption(opt,flag) def testGetSetItem(self): v = self.vec w = v.duplicate() # v[...] = 7 self.assertEqual(v.max()[1], 7) self.assertEqual(v.min()[1], 7) # v.setRandom() w[...] = v self.assertTrue(w.equal(v)) # v.setRandom() w[...] = v.getArray() self.assertTrue(w.equal(v)) # s, e = v.getOwnershipRange() v.setRandom() w[s:e] = v.getArray().copy() self.assertTrue(w.equal(v)) w1, v1 = w[s], v[s] w2, v2 = w[e-1], v[e-1] self.assertEqual(w1, v1) self.assertEqual(w2, v2) def testMAXPY(self): y = self.vec y.set(1) x = [y.copy() for _ in range(3)] a = [1]*len(x) y.maxpy(a, x) z = y.duplicate() z.set(len(x)+1) assert (y.equal(z)) # -------------------------------------------------------------------- class TestVecSeq(BaseTestVec, unittest.TestCase): COMM = PETSc.COMM_SELF TYPE = PETSc.Vec.Type.SEQ class TestVecMPI(BaseTestVec, unittest.TestCase): COMM = PETSc.COMM_WORLD TYPE = PETSc.Vec.Type.MPI class TestVecShared(BaseTestVec, unittest.TestCase): if PETSc.COMM_WORLD.getSize() == 1: TYPE = PETSc.Vec.Type.SHARED else: TYPE = PETSc.Vec.Type.MPI COMM = PETSc.COMM_WORLD #class TestVecSieve(BaseTestVec, unittest.TestCase): # CLASS = PETSc.VecSieve # TARGS = ([],) #class TestVecGhost(BaseTestVec, unittest.TestCase): # CLASS = PETSc.VecGhost # TARGS = ([],) # -------------------------------------------------------------------- class TestVecWithArray(unittest.TestCase): def testCreateSeq(self): import numpy a = numpy.zeros(5, dtype=PETSc.ScalarType) v1 = PETSc.Vec().createWithArray(a, comm=PETSc.COMM_SELF) v2 = PETSc.Vec().createWithArray(a, size=5, comm=PETSc.COMM_SELF) v3 = PETSc.Vec().createWithArray(a, size=3, comm=PETSc.COMM_SELF) self.assertTrue(v1.size == 5) self.assertTrue(v2.size == 5) self.assertTrue(v3.size == 3) a1 = v1.getDict()['__array__']; self.assertTrue(a is a1) a2 = v2.getDict()['__array__']; self.assertTrue(a is a2) a3 = v3.getDict()['__array__']; self.assertTrue(a is a2) def testCreateMPI(self): import numpy a = numpy.zeros(5, dtype=PETSc.ScalarType) v1 = PETSc.Vec().createWithArray(a, comm=PETSc.COMM_WORLD) v2 = PETSc.Vec().createWithArray(a, size=(5,None), comm=PETSc.COMM_WORLD) v3 = PETSc.Vec().createWithArray(a, size=(3,None), comm=PETSc.COMM_WORLD) self.assertTrue(v1.local_size == 5) self.assertTrue(v2.local_size == 5) self.assertTrue(v3.local_size == 3) a1 = v1.getDict()['__array__']; self.assertTrue(a is a1) a2 = v2.getDict()['__array__']; self.assertTrue(a is a2) a3 = v3.getDict()['__array__']; self.assertTrue(a is a2) def testSetMPIGhost(self): import numpy v = PETSc.Vec().create() v.setType(PETSc.Vec.Type.MPI) v.setSizes((5,None)) ghosts = [i % v.size for i in range(v.owner_range[1],v.owner_range[1]+3)] v.setMPIGhost(ghosts) v.setArray(numpy.array(range(*v.owner_range))) v.ghostUpdate() with v.localForm() as loc: self.assertTrue((loc[0:v.local_size] == range(*v.owner_range)).all()) self.assertTrue((loc[v.local_size:] == ghosts).all()) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # -------------------------------------------------------------------- petsc4py-3.15.1/test/test_tao.py0000644000175000017500000000332013750315427016736 0ustar balaybalay00000000000000# -------------------------------------------------------------------- from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class BaseTestTAO(object): COMM = None def setUp(self): self.tao = PETSc.TAO().create(comm=self.COMM) def tearDown(self): self.tao = None def testSetRoutinesToNone(self): tao = self.tao objective, gradient, objgrad = None, None, None constraint, varbounds = None, None hessian, jacobian = None, None tao.setObjective(objective) tao.setGradient(gradient) tao.setVariableBounds(varbounds) tao.setObjectiveGradient(objgrad) tao.setConstraints(constraint) tao.setHessian(hessian) tao.setJacobian(jacobian) def testGetVecsAndMats(self): tao = self.tao x = tao.getSolution() g = tao.getGradient() l, u = tao.getVariableBounds() r = None#tao.getConstraintVec() H, HP = None,None#tao.getHessianMat() J, JP = None,None#tao.getJacobianMat() for o in [x, g, r, l, u ,H, HP, J, JP,]: self.assertFalse(o) def testGetKSP(self): ksp = self.tao.getKSP() self.assertFalse(ksp) # -------------------------------------------------------------------- class TestTAOSelf(BaseTestTAO, unittest.TestCase): COMM = PETSc.COMM_SELF class TestTAOWorld(BaseTestTAO, unittest.TestCase): COMM = PETSc.COMM_WORLD # -------------------------------------------------------------------- import numpy if numpy.iscomplexobj(PETSc.ScalarType()): del BaseTestTAO del TestTAOSelf del TestTAOWorld if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_optdb.py0000644000175000017500000000531013750315427017264 0ustar balaybalay00000000000000import unittest from petsc4py import PETSc from sys import getrefcount # -------------------------------------------------------------------- class TestOptions(unittest.TestCase): PREFIX = 'myopts-' OPTLIST = [('bool', True), ('int', -7), ('real', 5), ('scalar', 3), ('string', 'petsc4py'), ] def _putopts(self, opts=None, OPTLIST=None): if opts is None: opts = self.opts if OPTLIST is None: OPTLIST = self.OPTLIST for k,v in OPTLIST: opts[k] = v def _delopts(self, opts=None, OPTLIST=None): if opts is None: opts = self.opts if OPTLIST is None: OPTLIST = self.OPTLIST for k,v in OPTLIST: del opts[k] def setUp(self): self.opts = PETSc.Options(self.PREFIX) def tearDown(self): self.opts = None def testHasOpts(self): self._putopts() for k, v in self.OPTLIST: self.assertTrue(self.opts.hasName(k)) self.assertTrue(k in self.opts) missing = k+'-missing' self.assertFalse(self.opts.hasName(missing)) self.assertFalse(missing in self.opts) self._delopts() def testGetOpts(self): self._putopts() for k, v in self.OPTLIST: getopt = getattr(self.opts, 'get'+k.title()) self.assertEqual(getopt(k), v) self._delopts() def testGetAll(self): self._putopts() allopts = self.opts.getAll() self.assertTrue(type(allopts) is dict) optlist = [(k, str(v).lower()) for (k,v) in self.OPTLIST] for k,v in allopts.items(): self.assertTrue((k, v) in optlist) self._delopts() def testGetAllQuoted(self): dct = {'o0' : '"0 1 2"', 'o1' : '"a b c"', 'o2' : '"x y z"',} for k in dct: self.opts[k] = dct[k] allopts = self.opts.getAll() for k in dct: self.assertEqual(allopts[k], dct[k][1:-1]) del self.opts[k] def testMonitor(self): optlist = [] mon = lambda n,v: optlist.append((n,v)) self.opts.setMonitor(mon) self.assertEqual(getrefcount(mon)-1, 2) self._putopts() target = [(self.PREFIX+k, str(v).lower()) for k, v in self.OPTLIST] self.assertEqual(optlist, target) self.opts.cancelMonitor() self.assertEqual(getrefcount(mon)-1, 1) self._delopts() # -------------------------------------------------------------------- del TestOptions.testMonitor # XXX if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_ksp.py0000644000175000017500000001535513750315427016763 0ustar balaybalay00000000000000# -------------------------------------------------------------------- from petsc4py import PETSc import unittest from sys import getrefcount # -------------------------------------------------------------------- class BaseTestKSP(object): KSP_TYPE = None PC_TYPE = None def setUp(self): ksp = PETSc.KSP() ksp.create(PETSc.COMM_SELF) if self.KSP_TYPE: ksp.setType(self.KSP_TYPE) if self.PC_TYPE: pc = ksp.getPC() pc.setType(self.PC_TYPE) self.ksp = ksp def tearDown(self): self.ksp = None def testGetSetType(self): self.assertEqual(self.ksp.getType(), self.KSP_TYPE) self.ksp.setType(self.KSP_TYPE) self.assertEqual(self.ksp.getType(), self.KSP_TYPE) def testTols(self): tols = self.ksp.getTolerances() self.ksp.setTolerances(*tols) tnames = ('rtol', 'atol', 'divtol', 'max_it') tolvals = [getattr(self.ksp, t) for t in tnames] self.assertEqual(tuple(tols), tuple(tolvals)) def testProperties(self): ksp = self.ksp # ksp.appctx = (1,2,3) self.assertEqual(ksp.appctx, (1,2,3)) ksp.appctx = None self.assertEqual(ksp.appctx, None) # side = ksp.pc_side ksp.pc_side = side self.assertEqual(ksp.pc_side, side) # nt = ksp.norm_type ksp.norm_type = nt self.assertEqual(ksp.norm_type, nt) # ksp.its = 1 self.assertEqual(ksp.its, 1) ksp.its = 0 self.assertEqual(ksp.its, 0) # ksp.norm = 1 self.assertEqual(ksp.norm, 1) ksp.norm = 0 self.assertEqual(ksp.norm, 0) # rh = ksp.history self.assertTrue(len(rh)==0) # reason = PETSc.KSP.ConvergedReason.CONVERGED_ITS ksp.reason = reason self.assertEqual(ksp.reason, reason) self.assertTrue(ksp.converged) self.assertFalse(ksp.diverged) self.assertFalse(ksp.iterating) reason = PETSc.KSP.ConvergedReason.DIVERGED_MAX_IT ksp.reason = reason self.assertEqual(ksp.reason, reason) self.assertFalse(ksp.converged) self.assertTrue(ksp.diverged) self.assertFalse(ksp.iterating) reason = PETSc.KSP.ConvergedReason.CONVERGED_ITERATING ksp.reason = reason self.assertEqual(ksp.reason, reason) self.assertFalse(ksp.converged) self.assertFalse(ksp.diverged) self.assertTrue(ksp.iterating) def testGetSetPC(self): oldpc = self.ksp.getPC() self.assertEqual(oldpc.getRefCount(), 2) newpc = PETSc.PC() newpc.create(self.ksp.getComm()) self.assertEqual(newpc.getRefCount(), 1) self.ksp.setPC(newpc) self.assertEqual(newpc.getRefCount(), 2) self.assertEqual(oldpc.getRefCount(), 1) oldpc.destroy() self.assertFalse(bool(oldpc)) pc = self.ksp.getPC() self.assertTrue(bool(pc)) self.assertEqual(pc, newpc) self.assertEqual(pc.getRefCount(), 3) newpc.destroy() self.assertFalse(bool(newpc)) self.assertEqual(pc.getRefCount(), 2) def testSolve(self): A = PETSc.Mat().create(PETSc.COMM_SELF) A.setSizes([3,3]) A.setType(PETSc.Mat.Type.SEQAIJ) A.setPreallocationNNZ(1) for i in range(3): A.setValue(i, i, 0.9/(i+1)) A.assemble() A.shift(1) x, b = A.createVecs() b.set(10) x.setRandom() self.ksp.setOperators(A) self.ksp.setConvergenceHistory() self.ksp.solve(b, x) r = b.duplicate() u = x.duplicate() self.ksp.buildSolution(u) self.ksp.buildResidual(u) rh = self.ksp.getConvergenceHistory() self.ksp.setConvergenceHistory(0) rh = self.ksp.getConvergenceHistory() self.assertEqual(len(rh), 0) del A, x, b def testResetAndSolve(self): self.ksp.reset() self.testSolve() self.ksp.reset() self.testSolve() self.ksp.reset() def testSetMonitor(self): reshist = {} def monitor(ksp, its, rnorm): reshist[its] = rnorm refcnt = getrefcount(monitor) self.ksp.setMonitor(monitor) self.assertEqual(getrefcount(monitor), refcnt + 1) ## self.testSolve() reshist = {} self.ksp.cancelMonitor() self.assertEqual(getrefcount(monitor), refcnt) self.testSolve() self.assertEqual(len(reshist), 0) ## Monitor = PETSc.KSP.Monitor ## self.ksp.setMonitor(Monitor()) ## self.ksp.setMonitor(Monitor.DEFAULT) ## self.ksp.setMonitor(Monitor.TRUE_RESIDUAL_NORM) ## self.ksp.setMonitor(Monitor.SOLUTION) def testSetConvergenceTest(self): def converged(ksp, its, rnorm): if its > 10: return True return False refcnt = getrefcount(converged) self.ksp.setConvergenceTest(converged) self.assertEqual(getrefcount(converged), refcnt + 1) self.ksp.setConvergenceTest(None) self.assertEqual(getrefcount(converged), refcnt) # -------------------------------------------------------------------- class TestKSPPREONLY(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.PREONLY PC_TYPE = PETSc.PC.Type.LU class TestKSPRICHARDSON(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.RICHARDSON class TestKSPCHEBYCHEV(BaseTestKSP, unittest.TestCase): try: KSP_TYPE = PETSc.KSP.Type.CHEBYSHEV except AttributeError: KSP_TYPE = PETSc.KSP.Type.CHEBYCHEV class TestKSPCG(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.CG class TestKSPCGNE(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.CGNE class TestKSPSTCG(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.STCG class TestKSPBCGS(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.BCGS class TestKSPBCGSL(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.BCGSL class TestKSPCGS(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.CGS class TestKSPQCG(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.QCG PC_TYPE = PETSc.PC.Type.JACOBI class TestKSPBICG(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.BICG class TestKSPGMRES(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.GMRES class TestKSPFGMRES(BaseTestKSP, unittest.TestCase): KSP_TYPE = PETSc.KSP.Type.FGMRES # -------------------------------------------------------------------- if PETSc.ScalarType().dtype.char in 'FDG': del TestKSPSTCG # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_mat_dense.py0000644000175000017500000001524213750315427020120 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest import numpy as np def mkdata(comm, m, N, bs): start = m * comm.rank end = start + m idt = PETSc.IntType sdt = PETSc.ScalarType rows = np.array(range(start, end), dtype=idt) cols = np.array(range(0, N), dtype=idt) vals = np.array(range(0, m*N*bs*bs), dtype=sdt) vals.shape = (-1, bs, bs) return rows, cols, vals class BaseTestMatAnyDense(object): COMM = PETSc.COMM_NULL GRID = 0, 0 BSIZE = None TYPE = PETSc.Mat.Type.DENSE def setUp(self): COMM = self.COMM GM, GN = self.GRID BS = self.BSIZE #or 1 # self.A = PETSc.Mat().create(comm=COMM) bs = BS or 1; m, N = GM, GN; rowsz = (m*bs, None) colsz = (None, N*bs) self.A.setSizes([rowsz, colsz], BS) self.A.setType(self.TYPE) def tearDown(self): self.A.destroy() self.A = None def testSetValues(self): self._preallocate() r, c, v = self._set_values() self.A.assemble() self._chk_array(self.A, r, c, v) r, c, v = self._set_values() self.A.assemble() self._chk_array(self.A, r, c, v) def testGetDiagonalBlock(self): M, N = self.A.getSize() # only for square matrices if M != N: return self._preallocate() self._set_values() self.A.assemble() B = self.A.getDiagonalBlock() self.assertEqual(self.A.getLocalSize(), B.getSize()) B.destroy() def testCreateTranspose(self): self._preallocate() self._set_values() self.A.assemble() A = self.A AT = PETSc.Mat().createTranspose(A) x, y = A.createVecs() xt, yt = AT.createVecs() # y.setRandom() A.multTranspose(y, x) y.copy(xt) AT.mult(xt, yt) self.assertTrue(yt.equal(x)) # x.setRandom() A.mult(x, y) x.copy(yt) AT.multTranspose(yt, xt) self.assertTrue(xt.equal(y)) def _preallocate(self): self.A.setPreallocationDense(None) def _set_values(self): COMM = self.COMM GM, GN = self.GRID BS = self.BSIZE or 1 rows, cols, vals = mkdata(COMM, GM, GN, BS) if not self.BSIZE: setvalues = self.A.setValues else: setvalues = self.A.setValuesBlocked setvalues(rows, cols, vals) return rows, cols, vals def _chk_bs(self, A, bs): self.assertEqual(A.getBlockSize(), bs or 1) def _chk_array(self, A, r, c, v): return # XXX vals = self.A.getValues(r, c) vals.shape = v.shape self.assertTrue(np.allclose(vals, v)) # -- Dense --------------------- class BaseTestMatDense(BaseTestMatAnyDense, unittest.TestCase): COMM = PETSc.COMM_WORLD GRID = 0, 0 BSIZE = None # -- Seq Dense -- class TestMatSeqDense(BaseTestMatDense): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQDENSE class TestMatSeqDense_G23(TestMatSeqDense): GRID = 2, 3 class TestMatSeqDense_G45(TestMatSeqDense): GRID = 4, 5 class TestMatSeqDense_G77(TestMatSeqDense): GRID = 7, 7 class TestMatSeqDense_G89(TestMatSeqDense): GRID = 8, 9 # -- MPI Dense -- class TestMatMPIDense(BaseTestMatDense): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPIDENSE class TestMatMPIDense_G23(TestMatMPIDense): GRID = 2, 3 class TestMatMPIDense_G45(TestMatMPIDense): GRID = 4, 5 class TestMatMPIDense_G77(TestMatMPIDense): GRID = 7, 7 class TestMatMPIDense_G89(TestMatMPIDense): GRID = 8, 9 # -- Dense + Block --------------- class BaseTestMatDense_B(BaseTestMatAnyDense, unittest.TestCase): COMM = PETSc.COMM_WORLD GRID = 0, 0 BSIZE = 1 def _preallocate(self): #self.A.setBlockSize(self.BSIZE) self.A.setPreallocationDense(None) #self.A.setBlockSize(self.BSIZE) self._chk_bs(self.A, self.BSIZE) # -- Seq Dense + Block -- class TestMatSeqDense_B(BaseTestMatDense_B): COMM = PETSc.COMM_SELF TYPE = PETSc.Mat.Type.SEQDENSE # bs = 1 class TestMatSeqDense_B_G23(TestMatSeqDense_B): GRID = 2, 3 class TestMatSeqDense_B_G45(TestMatSeqDense_B): GRID = 4, 5 class TestMatSeqDense_B_G89(TestMatSeqDense_B): GRID = 8, 9 # bs = 2 class TestMatSeqDense_B_G23_B2(TestMatSeqDense_B_G23): BSIZE = 2 class TestMatSeqDense_B_G45_B2(TestMatSeqDense_B_G45): BSIZE = 2 class TestMatSeqDense_B_G89_B2(TestMatSeqDense_B_G89): BSIZE = 2 # bs = 3 class TestMatSeqDense_B_G23_B3(TestMatSeqDense_B_G23): BSIZE = 3 class TestMatSeqDense_B_G45_B3(TestMatSeqDense_B_G45): BSIZE = 3 class TestMatSeqDense_B_G89_B3(TestMatSeqDense_B_G89): BSIZE = 3 # bs = 4 class TestMatSeqDense_B_G23_B4(TestMatSeqDense_B_G23): BSIZE = 4 class TestMatSeqDense_B_G45_B4(TestMatSeqDense_B_G45): BSIZE = 4 class TestMatSeqDense_B_G89_B4(TestMatSeqDense_B_G89): BSIZE = 4 # bs = 5 class TestMatSeqDense_B_G23_B5(TestMatSeqDense_B_G23): BSIZE = 5 class TestMatSeqDense_B_G45_B5(TestMatSeqDense_B_G45): BSIZE = 5 class TestMatSeqDense_B_G89_B5(TestMatSeqDense_B_G89): BSIZE = 5 # -- MPI Dense + Block -- class TestMatMPIDense_B(BaseTestMatDense_B): COMM = PETSc.COMM_WORLD TYPE = PETSc.Mat.Type.MPIDENSE # bs = 1 class TestMatMPIDense_B_G23(TestMatMPIDense_B): GRID = 2, 3 class TestMatMPIDense_B_G45(TestMatMPIDense_B): GRID = 4, 5 class TestMatMPIDense_B_G77(TestMatMPIDense_B): GRID = 7, 7 class TestMatMPIDense_B_G89(TestMatMPIDense_B): GRID = 8, 9 # bs = 2 class TestMatMPIDense_B_G23_B2(TestMatMPIDense_B_G23): BSIZE = 2 class TestMatMPIDense_B_G45_B2(TestMatMPIDense_B_G45): BSIZE = 2 class TestMatMPIDense_B_G77_B2(TestMatMPIDense_B_G77): BSIZE = 2 class TestMatMPIDense_B_G89_B2(TestMatMPIDense_B_G89): BSIZE = 2 # bs = 3 class TestMatMPIDense_B_G23_B3(TestMatMPIDense_B_G23): BSIZE = 3 class TestMatMPIDense_B_G45_B3(TestMatMPIDense_B_G45): BSIZE = 3 class TestMatMPIDense_B_G77_B3(TestMatMPIDense_B_G77): BSIZE = 3 class TestMatMPIDense_B_G89_B3(TestMatMPIDense_B_G89): BSIZE = 3 # bs = 4 class TestMatMPIDense_B_G23_B4(TestMatMPIDense_B_G23): BSIZE = 4 class TestMatMPIDense_B_G45_B4(TestMatMPIDense_B_G45): BSIZE = 4 class TestMatMPIDense_B_G77_B4(TestMatMPIDense_B_G77): BSIZE = 4 class TestMatMPIDense_B_G89_B4(TestMatMPIDense_B_G89): BSIZE = 4 # bs = 5 class TestMatMPIDense_B_G23_B5(TestMatMPIDense_B_G23): BSIZE = 5 class TestMatMPIDense_B_G45_B5(TestMatMPIDense_B_G45): BSIZE = 5 class TestMatMPIDense_B_G77_B5(TestMatMPIDense_B_G77): BSIZE = 5 class TestMatMPIDense_B_G89_B5(TestMatMPIDense_B_G89): BSIZE = 5 # ----- if __name__ == '__main__': unittest.main() petsc4py-3.15.1/test/test_nsp.py0000644000175000017500000000465313750315427016765 0ustar balaybalay00000000000000import unittest from petsc4py import PETSc import numpy as N from sys import getrefcount # -------------------------------------------------------------------- def allclose(seq1, seq2): for v1, v2 in zip(seq1, seq2): if abs(v1-v2) > 1e-5: return False return True class TestNullSpace(unittest.TestCase): def setUp(self): u1 = PETSc.Vec().createSeq(3) u2 = PETSc.Vec().createSeq(3) u1[0], u1[1], u1[2] = [1, 2, 0]; u1.normalize() u2[0], u2[1], u2[2] = [2, -1, 0]; u2.normalize() basis = [u1, u2] nullsp = PETSc.NullSpace().create(False, basis, comm=PETSc.COMM_SELF) self.basis = basis self.nullsp = nullsp def tearDown(self): self.basis = None self.nullsp = None def _remove(self): v = PETSc.Vec().createSeq(3); v[0], v[1], v[2] = [7, 8, 9] w = v.copy() self.nullsp.remove(w) return (v, w) def testRemove(self): v, w = self._remove() tols = (0, 1e-5) self.assertTrue(allclose(v.array, [7, 8, 9])) self.assertTrue(allclose(w.array, [0, 0, 9])) del v, w def testRemoveInplace(self): v, w = self._remove() self.nullsp.remove(v) self.assertTrue(v.equal(w)) del v, w def testRemoveWithFunction(self): def myremove(nsp, vec): vec.setArray([1,2,3]) self.nullsp.setFunction(myremove) v, w = self._remove() self.assertTrue(allclose(v.array, [7, 8, 9])) self.assertTrue(allclose(w.array, [1, 2, 3])) self.nullsp.remove(v) self.assertTrue(allclose(v.array, [1, 2, 3])) self.nullsp.setFunction(None) self.testRemove() def testGetSetFunction(self): def rem(nsp, vec): vec.set(0) self.nullsp.setFunction(rem) self.assertEqual(getrefcount(rem)-1, 2) dct = self.nullsp.getDict() self.assertTrue(dct is not None) self.assertEqual(getrefcount(dct)-1, 2) fun, a, kw = dct['__function__'] self.assertTrue(fun is rem) self.nullsp.setFunction(None) fun = dct.get('__function__') self.assertEqual(getrefcount(rem)-1, 1) self.assertTrue(fun is None) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # -------------------------------------------------------------------- petsc4py-3.15.1/test/test_snes_py.py0000644000175000017500000000551513750315427017643 0ustar balaybalay00000000000000# -------------------------------------------------------------------- from petsc4py import PETSc import unittest from sys import getrefcount # -------------------------------------------------------------------- class MySNES(object): def __init__(self): self.trace = False self.call_log = {} def _log(self, method, *args): self.call_log.setdefault(method, 0) self.call_log[method] += 1 if not self.trace: return clsname = self.__class__.__name__ pargs = [] for a in args: pargs.append(a) if isinstance(a, PETSc.Object): pargs[-1] = type(a).__name__ pargs = tuple(pargs) print ('%-20s' % ('%s.%s%s'% (clsname, method, pargs))) def create(self,*args): self._log('create', *args) def destroy(self,*args): self._log('destroy', *args) if not self.trace: return for k, v in self.call_log.items(): print ('%-20s %2d' % (k, v)) def view(self, snes, viewer): self._log('view', snes, viewer) def setFromOptions(self, snes): OptDB = PETSc.Options(snes) self.trace = OptDB.getBool('trace',self.trace) self._log('setFromOptions',snes) def setUp(self, snes): self._log('setUp', snes) def reset(self, snes): self._log('reset', snes) #def preSolve(self, snes): # self._log('preSolve', snes) # #def postSolve(self, snes): # self._log('postSolve', snes) def preStep(self, snes): self._log('preStep', snes) def postStep(self, snes): self._log('postStep', snes) #def computeFunction(self, snes, x, F): # self._log('computeFunction', snes, x, F) # snes.computeFunction(x, F) # #def computeJacobian(self, snes, x, A, B): # self._log('computeJacobian', snes, x, A, B) # flag = snes.computeJacobian(x, A, B) # return flag # #def linearSolve(self, snes, b, x): # self._log('linearSolve', snes, b, x) # snes.ksp.solve(b,x) # ## return False # not succedd # if snes.ksp.getConvergedReason() < 0: # return False # not succedd # return True # succedd # #def lineSearch(self, snes, x, y, F): # self._log('lineSearch', snes, x, y, F) # x.axpy(-1,y) # snes.computeFunction(x, F) # ## return False # not succedd # return True # succedd from test_snes import BaseTestSNES class TestSNESPython(BaseTestSNES, unittest.TestCase): SNES_TYPE = PETSc.SNES.Type.PYTHON def setUp(self): super(TestSNESPython, self).setUp() self.snes.setPythonContext(MySNES()) # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # -------------------------------------------------------------------- petsc4py-3.15.1/test/test_ts.py0000644000175000017500000001664313750315427016615 0ustar balaybalay00000000000000import unittest from petsc4py import PETSc from sys import getrefcount # -------------------------------------------------------------------- class MyODE: """ du/dt + u**2 = 0; u0,u1,u2 = 1,2,3 """ def __init__(self): self.rhsfunction_calls = 0 self.rhsjacobian_calls = 0 self.ifunction_calls = 0 self.ijacobian_calls = 0 self.presolve_calls = 0 self.update_calls = 0 self.postsolve_calls = 0 self.monitor_calls = 0 def rhsfunction(self,ts,t,u,F): # print ('MyODE.rhsfunction()') self.rhsfunction_calls += 1 f = -(u * u) f.copy(F) def rhsjacobian(self,ts,t,u,J,P): # print ('MyODE.rhsjacobian()') self.rhsjacobian_calls += 1 P.zeroEntries() diag = -2 * u P.setDiagonal(diag) P.assemble() if J != P: J.assemble() return True # same_nz def ifunction(self,ts,t,u,du,F): # print ('MyODE.ifunction()') self.ifunction_calls += 1 f = du + u * u f.copy(F) def ijacobian(self,ts,t,u,du,a,J,P): # print ('MyODE.ijacobian()') self.ijacobian_calls += 1 P.zeroEntries() diag = a + 2 * u P.setDiagonal(diag) P.assemble() if J != P: J.assemble() return True # same_nz def monitor(self, ts, s, t, u): self.monitor_calls += 1 dt = ts.time_step ut = ts.vec_sol.norm() #prn = PETSc.Sys.Print #prn('TS: step %2d, T:%f, dT:%f, u:%f' % (s,t,dt,ut)) class BaseTestTSNonlinear(object): TYPE = None def setUp(self): self.ts = PETSc.TS().create(PETSc.COMM_SELF) eft = PETSc.TS.ExactFinalTime.STEPOVER self.ts.setExactFinalTime(eft) ptype = PETSc.TS.ProblemType.NONLINEAR self.ts.setProblemType(ptype) self.ts.setType(self.TYPE) if PETSc.ScalarType().dtype.char in 'fF': snes = self.ts.getSNES() snes.setTolerances(rtol=1e-6) def tearDown(self): self.ts = None class BaseTestTSNonlinearRHS(BaseTestTSNonlinear): def testSolveRHS(self): ts = self.ts dct = self.ts.getDict() self.assertTrue(dct is not None) self.assertTrue(type(dct) is dict) ode = MyODE() J = PETSc.Mat().create(ts.comm) J.setSizes(3); J.setFromOptions() J.setUp() u, f = J.createVecs() ts.setAppCtx(ode) ts.setRHSFunction(ode.rhsfunction, f) ts.setRHSJacobian(ode.rhsjacobian, J, J) ts.setMonitor(ode.monitor) ts.snes.ksp.pc.setType('none') T0, dT, nT = 0.00, 0.1, 10 T = T0 + nT*dT ts.setTime(T0) ts.setTimeStep(dT) ts.setMaxTime(T) ts.setMaxSteps(nT) ts.setFromOptions() u[0], u[1], u[2] = 1, 2, 3 ts.solve(u) self.assertTrue(ode.rhsfunction_calls > 0) self.assertTrue(ode.rhsjacobian_calls > 0) dct = self.ts.getDict() self.assertTrue('__appctx__' in dct) self.assertTrue('__rhsfunction__' in dct) self.assertTrue('__rhsjacobian__' in dct) self.assertTrue('__monitor__' in dct) n = ode.monitor_calls ts.monitor(ts.step_number, ts.time) self.assertEqual(ode.monitor_calls, n+1) n = ode.monitor_calls ts.cancelMonitor() ts.monitor(ts.step_number, ts.time) self.assertEqual(ode.monitor_calls, n) def testFDColorRHS(self): ts = self.ts ode = MyODE() J = PETSc.Mat().create(ts.comm) J.setSizes(5); J.setType('aij') J.setPreallocationNNZ(nnz=1) u, f = J.createVecs() ts.setAppCtx(ode) ts.setRHSFunction(ode.rhsfunction, f) ts.setRHSJacobian(ode.rhsjacobian, J, J) ts.setMonitor(ode.monitor) T0, dT, nT = 0.00, 0.1, 10 T = T0 + nT*dT ts.setTime(T0) ts.setTimeStep(dT) ts.setMaxTime(T) ts.setMaxSteps(nT) ts.setFromOptions() u[0], u[1], u[2] = 1, 2, 3 ts.setSolution(u) ode.rhsjacobian(ts,0,u,J,J) ts.setUp() ts.snes.setUseFD(True) ts.solve(u) def testResetAndSolveRHS(self): self.ts.reset() self.ts.setStepNumber(0) self.testSolveRHS() self.ts.reset() self.ts.setStepNumber(0) self.testSolveRHS() self.ts.reset() class BaseTestTSNonlinearI(BaseTestTSNonlinear): def testSolveI(self): ts = self.ts dct = self.ts.getDict() self.assertTrue(dct is not None) self.assertTrue(type(dct) is dict) ode = MyODE() J = PETSc.Mat().create(ts.comm) J.setSizes(3); J.setFromOptions() J.setUp() u, f = J.createVecs() ts.setAppCtx(ode) ts.setIFunction(ode.ifunction, f) ts.setIJacobian(ode.ijacobian, J, J) ts.setMonitor(ode.monitor) ts.snes.ksp.pc.setType('none') T0, dT, nT = 0.00, 0.1, 10 T = T0 + nT*dT ts.setTime(T0) ts.setTimeStep(dT) ts.setMaxTime(T) ts.setMaxSteps(nT) ts.setFromOptions() u[0], u[1], u[2] = 1, 2, 3 ts.solve(u) self.assertTrue(ode.ifunction_calls > 0) self.assertTrue(ode.ijacobian_calls > 0) dct = self.ts.getDict() self.assertTrue('__appctx__' in dct) self.assertTrue('__ifunction__' in dct) self.assertTrue('__ijacobian__' in dct) self.assertTrue('__monitor__' in dct) n = ode.monitor_calls ts.monitor(ts.step_number, ts.time) self.assertEqual(ode.monitor_calls, n+1) n = ode.monitor_calls ts.cancelMonitor() ts.monitor(ts.step_number, ts.time) self.assertEqual(ode.monitor_calls, n) def testFDColorI(self): ts = self.ts ode = MyODE() J = PETSc.Mat().create(ts.comm) J.setSizes(5); J.setType('aij') J.setPreallocationNNZ(nnz=1) J.setFromOptions() u, f = J.createVecs() ts.setAppCtx(ode) ts.setIFunction(ode.ifunction, f) ts.setIJacobian(ode.ijacobian, J, J) ts.setMonitor(ode.monitor) T0, dT, nT = 0.00, 0.1, 10 T = T0 + nT*dT ts.setTime(T0) ts.setTimeStep(dT) ts.setMaxTime(T) ts.setMaxSteps(nT) ts.setFromOptions() u[0], u[1], u[2] = 1, 2, 3 ts.setSolution(u) ode.ijacobian(ts,0,u,0*u,1,J,J) ts.setUp() ts.snes.setUseFD(True) ts.solve(u) def testResetAndSolveI(self): self.ts.reset() self.ts.setStepNumber(0) self.testSolveI() self.ts.reset() self.ts.setStepNumber(0) self.testSolveI() self.ts.reset() class TestTSBeuler(BaseTestTSNonlinearRHS,BaseTestTSNonlinearI, unittest.TestCase): TYPE = PETSc.TS.Type.BEULER class TestTSCN(BaseTestTSNonlinearRHS,BaseTestTSNonlinearI, unittest.TestCase): TYPE = PETSc.TS.Type.CN class TestTSTheta(BaseTestTSNonlinearRHS, BaseTestTSNonlinearI, unittest.TestCase): TYPE = PETSc.TS.Type.THETA class TestTSAlpha(BaseTestTSNonlinearRHS, BaseTestTSNonlinearI, unittest.TestCase): TYPE = PETSc.TS.Type.ALPHA # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # -------------------------------------------------------------------- petsc4py-3.15.1/test/test_dmda.py0000644000175000017500000003455113750315427017072 0ustar balaybalay00000000000000from petsc4py import PETSc import unittest # -------------------------------------------------------------------- class BaseTestDA(object): COMM = PETSc.COMM_WORLD SIZES = None BOUNDARY = None DOF = 1 STENCIL = PETSc.DMDA.StencilType.STAR SWIDTH = 1 def setUp(self): self.da = PETSc.DMDA().create(dim=len(self.SIZES), dof=self.DOF, sizes=self.SIZES, boundary_type=self.BOUNDARY, stencil_type=self.STENCIL, stencil_width=self.SWIDTH, comm=self.COMM) def tearDown(self): self.da = None def testGetInfo(self): dim = self.da.getDim() dof = self.da.getDof() sizes = self.da.getSizes() psizes = self.da.getProcSizes() boundary = self.da.getBoundaryType() stencil_type = self.da.getStencilType() stencil_width = self.da.getStencilWidth() self.assertEqual(dim, len(self.SIZES)) self.assertEqual(dof, self.DOF) self.assertEqual(sizes, tuple(self.SIZES)) self.assertEqual(boundary, self.BOUNDARY or (0,)*dim) self.assertEqual(stencil_type, self.STENCIL) self.assertEqual(stencil_width, self.SWIDTH) def testRangesCorners(self): dim = self.da.getDim() ranges = self.da.getRanges() starts, lsizes = self.da.getCorners() self.assertEqual(dim, len(ranges)) self.assertEqual(dim, len(starts)) self.assertEqual(dim, len(lsizes)) for i in range(dim): s, e = ranges[i] self.assertEqual(s, starts[i]) self.assertEqual(e-s, lsizes[i]) def testGhostRangesCorners(self): dim = self.da.getDim() ranges = self.da.getGhostRanges() starts, lsizes = self.da.getGhostCorners() self.assertEqual(dim, len(ranges)) self.assertEqual(dim, len(starts)) self.assertEqual(dim, len(lsizes)) for i in range(dim): s, e = ranges[i] self.assertEqual(s, starts[i]) self.assertEqual(e-s, lsizes[i]) def testOwnershipRanges(self): dim = self.da.getDim() ownership_ranges = self.da.getOwnershipRanges() procsizes = self.da.getProcSizes() self.assertEqual(len(procsizes), len(ownership_ranges)) for i,m in enumerate(procsizes): self.assertEqual(m, len(ownership_ranges[i])) def testFieldName(self): for i in range(self.da.getDof()): self.da.setFieldName(i, "field%d" % i) for i in range(self.da.getDof()): name = self.da.getFieldName(i) self.assertEqual(name, "field%d" % i) def testCoordinates(self): self.da.setUniformCoordinates(0,1,0,1,0,1) # c = self.da.getCoordinates() self.da.setCoordinates(c) c.destroy() cda = self.da.getCoordinateDM() cda.destroy() # c = self.da.getCoordinates() self.da.setCoordinates(c) c.destroy() gc = self.da.getCoordinatesLocal() gc.destroy() def testCreateVecMat(self): vn = self.da.createNaturalVec() vg = self.da.createGlobalVec() vl = self.da.createLocalVec() mat = self.da.createMat() self.assertTrue(mat.getType() in ('aij', 'seqaij', 'mpiaij')) vn.set(1.0) self.da.naturalToGlobal(vn,vg) self.assertEqual(vg.max()[1], 1.0) self.assertEqual(vg.min()[1], 1.0) self.da.globalToLocal(vg,vl) self.assertEqual(vl.max()[1], 1.0) self.assertTrue (vl.min()[1] in (1.0, 0.0)) vn.set(0.0) self.da.globalToNatural(vg,vn) self.assertEqual(vn.max()[1], 1.0) self.assertEqual(vn.min()[1], 1.0) vl2 = self.da.createLocalVec() self.da.localToLocal(vl,vl2) self.assertEqual(vl2.max()[1], 1.0) self.assertTrue (vl2.min()[1] in (1.0, 0.0)) NONE = PETSc.DM.BoundaryType.NONE s = self.da.stencil_width btype = self.da.boundary_type psize = self.da.proc_sizes for b, p in zip(btype, psize): if b != NONE and p == 1: return vg2 = self.da.createGlobalVec() self.da.localToGlobal(vl2,vg2) def testGetVec(self): vg = self.da.getGlobalVec() vl = self.da.getLocalVec() try: vg.set(1.0) self.assertEqual(vg.max()[1], 1.0) self.assertEqual(vg.min()[1], 1.0) self.da.globalToLocal(vg,vl) self.assertEqual(vl.max()[1], 1.0) self.assertTrue (vl.min()[1] in (1.0, 0.0)) vl.set(2.0) NONE = PETSc.DM.BoundaryType.NONE s = self.da.stencil_width btype = self.da.boundary_type psize = self.da.proc_sizes for b, p in zip(btype, psize): if b != NONE and p == 1: return self.da.localToGlobal(vl,vg) self.assertEqual(vg.max()[1], 2.0) self.assertTrue (vg.min()[1] in (2.0, 0.0)) finally: self.da.restoreGlobalVec(vg) self.da.restoreLocalVec(vl) def testGetOther(self): ao = self.da.getAO() lgmap = self.da.getLGMap() l2g, g2l = self.da.getScatter() def testRefineCoarsen(self): da = self.da rda = da.refine() self.assertEqual(da.getDim(), rda.getDim()) self.assertEqual(da.getDof(), rda.getDof()) if da.dim != 1: self.assertEqual(da.getStencilType(), rda.getStencilType()) self.assertEqual(da.getStencilWidth(), rda.getStencilWidth()) cda = rda.coarsen() self.assertEqual(rda.getDim(), cda.getDim()) self.assertEqual(rda.getDof(), cda.getDof()) for n1, n2 in zip(self.da.getSizes(), cda.getSizes()): self.assertTrue(abs(n1-n2)<=1) def testCoarsenRefine(self): da = self.da cda = self.da.coarsen() self.assertEqual(da.getDim(), cda.getDim()) self.assertEqual(da.getDof(), cda.getDof()) if da.dim != 1: self.assertEqual(da.getStencilType(), cda.getStencilType()) self.assertEqual(da.getStencilWidth(), cda.getStencilWidth()) rda = cda.refine() for n1, n2 in zip(self.da.getSizes(), rda.getSizes()): self.assertTrue(abs(n1-n2)<=1) def testRefineHierarchy(self): levels = self.da.refineHierarchy(2) self.assertTrue(isinstance(levels, list)) self.assertEqual(len(levels), 2) for item in levels: self.assertTrue(isinstance(item, PETSc.DM)) def testCoarsenHierarchy(self): levels = self.da.coarsenHierarchy(2) self.assertTrue(isinstance(levels, list)) self.assertEqual(len(levels), 2) for item in levels: self.assertTrue(isinstance(item, PETSc.DM)) def testCreateInterpolation(self): da = self.da if da.dim == 1: return rda = da.refine() mat, vec = da.createInterpolation(rda) def testCreateInjection(self): da = self.da if da.dim == 1: return rda = da.refine() scatter = da.createInjection(rda) MIRROR = PETSc.DMDA.BoundaryType.MIRROR GHOSTED = PETSc.DMDA.BoundaryType.GHOSTED PERIODIC = PETSc.DMDA.BoundaryType.PERIODIC TWIST = PETSc.DMDA.BoundaryType.TWIST SCALE = 4 class BaseTestDA_1D(BaseTestDA): SIZES = [100*SCALE] class BaseTestDA_2D(BaseTestDA): SIZES = [9*SCALE,11*SCALE] class BaseTestDA_3D(BaseTestDA): SIZES = [6*SCALE,7*SCALE,8*SCALE] # -------------------------------------------------------------------- class TestDA_1D(BaseTestDA_1D, unittest.TestCase): pass class TestDA_1D_W0(TestDA_1D): SWIDTH = 0 class TestDA_1D_W2(TestDA_1D): SWIDTH = 2 class TestDA_2D(BaseTestDA_2D, unittest.TestCase): pass class TestDA_2D_W0(TestDA_2D): SWIDTH = 0 class TestDA_2D_W0_N2(TestDA_2D): DOF = 2 SWIDTH = 0 class TestDA_2D_W2(TestDA_2D): SWIDTH = 2 class TestDA_2D_W2_N2(TestDA_2D): DOF = 2 SWIDTH = 2 class TestDA_2D_PXY(TestDA_2D): SIZES = [13*SCALE,17*SCALE] DOF = 2 SWIDTH = 5 BOUNDARY = (PERIODIC,)*2 class TestDA_2D_GXY(TestDA_2D): SIZES = [13*SCALE,17*SCALE] DOF = 2 SWIDTH = 5 BOUNDARY = (GHOSTED,)*2 class TestDA_2D_TXY(TestDA_2D): SIZES = [13*SCALE,17*SCALE] DOF = 2 SWIDTH = 5 BOUNDARY = (TWIST,)*2 class TestDA_3D(BaseTestDA_3D, unittest.TestCase): pass class TestDA_3D_W0(TestDA_3D): SWIDTH = 0 class TestDA_3D_W0_N2(TestDA_3D): DOF = 2 SWIDTH = 0 class TestDA_3D_W2(TestDA_3D): SWIDTH = 2 class TestDA_3D_W2_N2(TestDA_3D): DOF = 2 SWIDTH = 2 class TestDA_3D_PXYZ(TestDA_3D): SIZES = [11*SCALE,13*SCALE,17*SCALE] DOF = 2 SWIDTH = 3 BOUNDARY = (PERIODIC,)*3 class TestDA_3D_GXYZ(TestDA_3D): SIZES = [11*SCALE,13*SCALE,17*SCALE] DOF = 2 SWIDTH = 3 BOUNDARY = (GHOSTED,)*3 class TestDA_3D_TXYZ(TestDA_3D): SIZES = [11*SCALE,13*SCALE,17*SCALE] DOF = 2 SWIDTH = 3 BOUNDARY = (TWIST,)*3 # -------------------------------------------------------------------- DIM = (1,2,3,) DOF = (None,1,2,3,4,5,) BOUNDARY_TYPE = ( None, "none", (0,)*3, 0, "ghosted", (GHOSTED,)*3, GHOSTED, "periodic", (PERIODIC,)*3, PERIODIC, "twist", (TWIST,)*3, TWIST, ) STENCIL_TYPE = (None,"star","box") STENCIL_WIDTH = (None,0,1,2,3) DIM = (1,2,3) DOF = (None,2,5) BOUNDARY_TYPE = (None,"none","periodic","ghosted","twist") STENCIL_TYPE = (None,"box") STENCIL_WIDTH = (None,1,2) class TestDACreate(unittest.TestCase): pass counter = 0 for dim in DIM: for dof in DOF: for boundary in BOUNDARY_TYPE: if isinstance(boundary, tuple): boundary = boundary[:dim] for stencil in STENCIL_TYPE: for width in STENCIL_WIDTH: kargs = dict(sizes=[8*SCALE]*dim, dim=dim, dof=dof, boundary_type=boundary, stencil_type=stencil, stencil_width=width) def testCreate(self, kargs=kargs): kargs = dict(kargs) da = PETSc.DMDA().create(**kargs) da.destroy() setattr(TestDACreate, "testCreate%04d"%counter, testCreate) del testCreate, kargs counter += 1 del counter, dim, dof, boundary, stencil, width class TestDADuplicate(unittest.TestCase): pass counter = 0 for dim in DIM: for dof in DOF: for boundary in BOUNDARY_TYPE: if isinstance(boundary, tuple): boundary = boundary[:dim] for stencil in STENCIL_TYPE: for width in STENCIL_WIDTH: kargs = dict(dim=dim, dof=dof, boundary_type=boundary, stencil_type=stencil, stencil_width=width) def testDuplicate(self, kargs=kargs): kargs = dict(kargs) dim = kargs.pop('dim') dof = kargs['dof'] boundary = kargs['boundary_type'] stencil = kargs['stencil_type'] width = kargs['stencil_width'] da = PETSc.DMDA().create([8*SCALE]*dim) newda = da.duplicate(**kargs) self.assertEqual(newda.dim, da.dim) self.assertEqual(newda.sizes, da.sizes) self.assertEqual(newda.proc_sizes, da.proc_sizes) self.assertEqual(newda.ranges, da.ranges) self.assertEqual(newda.corners, da.corners) if (newda.boundary_type == da.boundary_type and newda.stencil_width == da.stencil_width): self.assertEqual(newda.ghost_ranges, da.ghost_ranges) self.assertEqual(newda.ghost_corners, da.ghost_corners) if dof is None: dof = da.dof if boundary is None: boundary = da.boundary_type elif boundary == "none": boundary = (0,) * dim elif boundary == "mirror": boundary = (MIRROR,) * dim elif boundary == "ghosted": boundary = (GHOSTED,) * dim elif boundary == "periodic": boundary = (PERIODIC,) * dim elif boundary == "twist": boundary = (TWIST,) * dim elif isinstance(boundary, int): boundary = (boundary,) * dim if stencil is None: stencil = da.stencil[0] if width is None: width = da.stencil_width self.assertEqual(newda.dof, dof) self.assertEqual(newda.boundary_type, boundary) if dim == 1: self.assertEqual(newda.stencil, (stencil, width)) newda.destroy() da.destroy() setattr(TestDADuplicate, "testDuplicate%04d"%counter, testDuplicate) del testDuplicate, kargs counter += 1 del counter, dim, dof, boundary, stencil, width # -------------------------------------------------------------------- if PETSc.COMM_WORLD.getSize() > 1: del TestDA_1D_W0 del TestDA_2D_W0, TestDA_2D_W0_N2 del TestDA_3D_W0, TestDA_3D_W0_N2 # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # -------------------------------------------------------------------- petsc4py-3.15.1/test/test_ts_py.py0000644000175000017500000001127413750315427017320 0ustar balaybalay00000000000000import unittest from petsc4py import PETSc from sys import getrefcount import gc # -------------------------------------------------------------------- class MyODE: """ du/dt + u**2 = 0; u0 = 1 """ def __init__(self): self.function_calls = 0 self.jacobian_calls = 0 def function(self,ts,t,u,du,F): #print 'MyODE.function()' self.function_calls += 1 f = du + u * u f.copy(F) def jacobian(self,ts,t,u,du,a,J,P): #print 'MyODE.jacobian()' self.jacobian_calls += 1 P.zeroEntries() diag = a + 2 * u P.setDiagonal(diag) P.assemble() if J != P: J.assemble() return False # same_nz class MyTS: def __init__(self): self.log = {} def _log(self, method, *args): self.log.setdefault(method, 0) self.log[method] += 1 def create(self, ts, *args): self._log('create', *args) self.vec_update = PETSc.Vec() def destroy(self, ts, *args): self._log('destroy', *args) self.vec_update.destroy() def setFromOptions(self, ts, *args): self._log('setFromOptions', *args) def setUp(self, ts, *args): self._log('setUp', ts, *args) self.vec_update = ts.getSolution().duplicate() def reset(self, ts, *args): self._log('reset', ts, *args) def solveStep(self, ts, t, u, *args): self._log('solveStep', ts, t, u, *args) ts.snes.solve(None, u) def adaptStep(self, ts, t, u, *args): self._log('adaptStep', ts, t, u, *args) return (ts.getTimeStep(), True) class TestTSPython(unittest.TestCase): def setUp(self): self.ts = PETSc.TS() self.ts.createPython(MyTS(), comm=PETSc.COMM_SELF) eft = PETSc.TS.ExactFinalTime.STEPOVER self.ts.setExactFinalTime(eft) ctx = self.ts.getPythonContext() self.assertEqual(getrefcount(ctx), 3) self.assertEqual(ctx.log['create'], 1) self.nsolve = 0 def tearDown(self): ctx = self.ts.getPythonContext() self.assertEqual(getrefcount(ctx), 3) self.assertTrue('destroy' not in ctx.log) self.ts.destroy() # XXX self.ts = None self.assertEqual(ctx.log['destroy'], 1) self.assertEqual(getrefcount(ctx), 2) def testSolve(self): ts = self.ts ts.setProblemType(ts.ProblemType.NONLINEAR) ode = MyODE() J = PETSc.Mat().create(ts.comm) J.setSizes(3); J.setFromOptions() J.setUp() u, f = J.createVecs() ts.setAppCtx(ode) ts.setIFunction(ode.function, f) ts.setIJacobian(ode.jacobian, J, J) ts.snes.ksp.pc.setType('none') T0, dT, nT = 0.0, 0.1, 10 T = T0 + nT*dT ts.setTime(T0) ts.setTimeStep(dT) ts.setMaxTime(T) ts.setMaxSteps(nT) ts.setFromOptions() u[0], u[1], u[2] = 1, 2, 3 ts.solve(u) self.nsolve +=1 self.assertTrue(ode.function_calls > 0) self.assertTrue(ode.jacobian_calls > 0) ctx = self.ts.getPythonContext() ncalls = self.nsolve * ts.step_number self.assertTrue(ctx.log['solveStep'] == ncalls) self.assertTrue(ctx.log['adaptStep'] == ncalls) del ctx dct = self.ts.getDict() self.assertTrue('__appctx__' in dct) self.assertTrue('__ifunction__' in dct) self.assertTrue('__ijacobian__' in dct) def testFDColor(self): # ts = self.ts ts.setProblemType(ts.ProblemType.NONLINEAR) ode = MyODE() J = PETSc.Mat().create(ts.comm) J.setSizes(5); J.setType('aij'); J.setPreallocationNNZ(1) J.setFromOptions() u, f = J.createVecs() ts.setAppCtx(ode) ts.setIFunction(ode.function, f) ts.setIJacobian(ode.jacobian, J, J) T0, dT, nT = 0.00, 0.1, 10 T = T0 + nT*dT ts.setTime(T0) ts.setTimeStep(dT) ts.setMaxTime(T) ts.setMaxSteps(nT) ts.setFromOptions() u[:] = 1, 2, 3, 4, 5 ts.setSolution(u) ode.jacobian(ts,0.0,u,u,1.0,J,J) ts.snes.setUseFD(True) ts.solve(u) self.nsolve +=1 def testResetAndSolve(self): self.ts.reset() self.ts.setStepNumber(0) self.testSolve() self.ts.reset() self.ts.setStepNumber(0) self.testFDColor() self.ts.reset() self.ts.setStepNumber(0) self.testSolve() self.ts.reset() # -------------------------------------------------------------------- if __name__ == '__main__': unittest.main() # --------------------------------------------------------------------